@nhtio/lucid-resourceful 1.20250724.0 → 1.20250724.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/index.cjs +9 -2
- package/index.cjs.map +1 -1
- package/index.mjs +9 -2
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/private/helpers.ts","../node_modules/.pnpm/p-map@7.0.3/node_modules/p-map/index.js","../src/private/lucene_to_lucid_translator.ts","../node_modules/.pnpm/@nhtio+tiny-typed-emitter@1.20250430.0/node_modules/@nhtio/tiny-typed-emitter/index.mjs","../src/private/mixin.ts","../src/private/prepare_consume_chain_builder.ts","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/errors.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/decorators/date.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/decorators/date_time.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/decorators/index.js","../node_modules/.pnpm/@poppinss+hooks@7.2.6/node_modules/@poppinss/hooks/build/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/preloader/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/base_model/proxy_handler.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/model_keys/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/keys_extractor.js","../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/utils/index.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js","../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/util.inspect.js","../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js","../node_modules/.pnpm/side-channel-list@1.0.0/node_modules/side-channel-list/index.js","../node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js","../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js","../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js","../node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js","../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js","../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js","../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js","../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js","../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js","../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js","../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js","../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js","../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js","../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js","../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js","../node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js","../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js","../node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js","../node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js","../node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js","../node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js","../node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js","../node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js","../node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/formats.js","../node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/utils.js","../node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/stringify.js","../node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/parse.js","../node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/index.js","../node_modules/.pnpm/@poppinss+utils@6.10.0/node_modules/@poppinss/utils/build/src/string/main.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/naming_strategies/camel_case.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/database/paginator/simple_paginator.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/paginator/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/query_reporter/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/query_runner/index.js","../node_modules/.pnpm/@poppinss+macroable@1.0.4/node_modules/@poppinss/macroable/build/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/database/query_builder/raw.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/database/static_builder/raw.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/database/static_builder/reference.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/database/query_builder/chainable.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/query_builder/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/base/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_one/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/base/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_one/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_one/query_client.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_one/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many/query_client.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/belongs_to/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/belongs_to/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/belongs_to/query_client.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/belongs_to/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/many_to_many/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/many_to_many/pivot_helpers.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/many_to_many/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/many_to_many/query_client.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/many_to_many/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many_through/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many_through/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many_through/query_client.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many_through/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/aggregates_loader/lazy_load.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/base_model/index.js","../src/private/decorator_schemas.ts","../src/private/decorators.ts","../src/index.ts"],"sourcesContent":["/*\n|--------------------------------------------------------------------------\n| Internal Helper Functions\n|--------------------------------------------------------------------------\n|\n| Functionality to help keep things DRY\n|\n*/\n\n/**\n * Removes all properties with undefined values from an object.\n * This utility function creates a new object containing only the properties\n * that have defined values, effectively filtering out any undefined properties.\n *\n * @example\n * ```typescript\n * const input = {\n * name: 'John',\n * age: undefined,\n * email: 'john@example.com',\n * phone: undefined\n * }\n *\n * const result = stripUndefinedValuesFromObject(input)\n * // Result: { name: 'John', email: 'john@example.com' }\n * ```\n *\n * @example\n * ```typescript\n * // Useful for cleaning up optional parameters before API calls\n * const apiParams = stripUndefinedValuesFromObject({\n * userId: user.id,\n * filter: searchFilter || undefined,\n * limit: pageSize || undefined,\n * offset: currentPage ? currentPage * pageSize : undefined\n * })\n * ```\n *\n * @template T - The type of the input object, must extend Record<string, any>\n * @param {T} obj - The object to filter, removing properties with undefined values\n * @returns {T} A new object of the same type with undefined properties removed\n */\nexport const stripUndefinedValuesFromObject = <T extends Record<string, any>>(obj: T): T => {\n return Object.fromEntries(Object.entries(obj).filter(([_, value]) => value !== undefined)) as T\n}\n","export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tskippedIndexesMap.set(index, value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[index] = value;\n\n\t\t\t\t\tresolvingCount--;\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (stopOnError) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.push(error);\n\t\t\t\t\t\tresolvingCount--;\n\n\t\t\t\t\t\t// In that case we can't really continue regardless of `stopOnError` state\n\t\t\t\t\t\t// since an iterable is likely to continue throwing after it throws once.\n\t\t\t\t\t\t// If we continue calling `next()` indefinitely we will likely end up\n\t\t\t\t\t\t// in an infinite loop of failed iteration.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait next();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\t// Create the concurrent runners in a detached (non-awaited)\n\t\t// promise. We need this so we can await the `next()` calls\n\t\t// to stop creating runners before hitting the concurrency limit\n\t\t// if the iterable has already been marked as done.\n\t\t// NOTE: We *must* do this for async iterators otherwise we'll spin up\n\t\t// infinite `next()` calls by default and never start the event loop.\n\t\t(async () => {\n\t\t\tfor (let index = 0; index < concurrency; index++) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (isIterableDone || isRejected) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t});\n}\n\nexport function pMapIterable(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tbackpressure = concurrency,\n\t} = {},\n) {\n\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t}\n\n\tif (typeof mapper !== 'function') {\n\t\tthrow new TypeError('Mapper function is required');\n\t}\n\n\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t}\n\n\tif (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`backpressure\\` to be an integer from \\`concurrency\\` (${concurrency}) and up or \\`Infinity\\`, got \\`${backpressure}\\` (${typeof backpressure})`);\n\t}\n\n\treturn {\n\t\tasync * [Symbol.asyncIterator]() {\n\t\t\tconst iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n\t\t\tconst promises = [];\n\t\t\tlet runningMappersCount = 0;\n\t\t\tlet isDone = false;\n\t\t\tlet index = 0;\n\n\t\t\tfunction trySpawn() {\n\t\t\t\tif (isDone || !(runningMappersCount < concurrency && promises.length < backpressure)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst promise = (async () => {\n\t\t\t\t\tconst {done, value} = await iterator.next();\n\n\t\t\t\t\tif (done) {\n\t\t\t\t\t\treturn {done: true};\n\t\t\t\t\t}\n\n\t\t\t\t\trunningMappersCount++;\n\n\t\t\t\t\t// Spawn if still below concurrency and backpressure limit\n\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst returnValue = await mapper(await value, index++);\n\n\t\t\t\t\t\trunningMappersCount--;\n\n\t\t\t\t\t\tif (returnValue === pMapSkip) {\n\t\t\t\t\t\t\tconst index = promises.indexOf(promise);\n\n\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\tpromises.splice(index, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Spawn if still below backpressure limit and just dropped below concurrency limit\n\t\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\t\treturn {done: false, value: returnValue};\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tisDone = true;\n\t\t\t\t\t\treturn {error};\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\tpromises.push(promise);\n\t\t\t}\n\n\t\t\ttrySpawn();\n\n\t\t\twhile (promises.length > 0) {\n\t\t\t\tconst {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop\n\n\t\t\t\tpromises.shift();\n\n\t\t\t\tif (error) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\tif (done) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Spawn if just dropped below backpressure limit and below the concurrency limit\n\t\t\t\ttrySpawn();\n\n\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tyield value;\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport const pMapSkip = Symbol('skip');\n","/* v8 ignore next */\nimport { parse, SyntaxError } from 'liqe'\nimport {\n E_LUCENE_SYNTAX_EXCEPTION,\n E_LUCENE_UNEXPECTED_EXCEPTION,\n E_LUCENE_INVALID_TYPE,\n} from '@nhtio/lucid-resourceful/errors'\nimport type { ModelKeysContract } from '@adonisjs/lucid/types/model'\nimport type { QueryClientContract } from '@adonisjs/lucid/types/database'\nimport type { DatabaseQueryBuilderContract } from '@adonisjs/lucid/types/querybuilder'\nimport type {\n LiqeQuery,\n ComparisonOperatorToken,\n EmptyExpression,\n FieldToken,\n ImplicitFieldToken,\n LiteralExpressionToken,\n LogicalExpressionToken,\n RangeExpressionToken,\n RegexExpressionToken,\n TagToken,\n UnaryOperatorToken,\n ParenthesizedExpressionToken,\n ExpressionToken,\n ParserAst,\n} from 'liqe'\n\n/**\n * Database query builder contract extended for Lucene filtering capabilities.\n *\n * @template Result - The result type for the query builder\n */\nexport interface LuceneFilteredDatabaseQueryBuilderContract extends DatabaseQueryBuilderContract {}\n\n/**\n * Applies an empty expression AST node to a database query.\n * Empty expressions are no-op operations that don't modify the query.\n *\n * @template T - The result type for the query builder\n * @param _ast - The empty expression AST node\n * @param _query - The database query builder to modify\n * @param _attributesToColumns - Mapping of model attributes to database columns\n * @param _primaryKey - The primary key column name\n * @param _tableName - The table name\n * @param _allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneEmptyExpressionAst = (\n _ast: EmptyExpression,\n _query: LuceneFilteredDatabaseQueryBuilderContract,\n _attributesToColumns: ModelKeysContract,\n _primaryKey: string,\n _tableName: string,\n _allowedColumns?: string[] | undefined\n) => {\n // noop, this is an empty expression, nothing to do here\n}\n\n/**\n * Applies a logical expression AST node (AND/OR) to a database query.\n * Handles logical operations between two expressions with proper SQL grouping.\n *\n * @template T - The result type for the query builder\n * @param ast - The logical expression AST node containing left/right operands and operator\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneLogicalExpressionAst = (\n ast: LogicalExpressionToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n const operatorType = ast.operator.operator\n query.where((subQuery) => {\n if (operatorType === 'AND') {\n applyLuceneAst(ast.left, subQuery, attributesToColumns, primaryKey, tableName, allowedColumns)\n applyLuceneAst(\n ast.right,\n subQuery,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n } else {\n subQuery.orWhere((orSubQuery) => {\n applyLuceneAst(\n ast.left,\n orSubQuery as any,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n })\n subQuery.orWhere((orSubQuery) => {\n applyLuceneAst(\n ast.right,\n orSubQuery as any,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n })\n }\n })\n}\n\n/**\n * Applies a parenthesized expression AST node to a database query.\n * Maintains logical grouping by wrapping the inner expression in a WHERE clause.\n *\n * @template T - The result type for the query builder\n * @param ast - The parenthesized expression AST node containing the inner expression\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneParenthesizedExpressionAst = (\n ast: ParenthesizedExpressionToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n query.where((subQuery) => {\n applyLuceneAst(\n ast.expression,\n subQuery,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n })\n}\n\n/**\n * Applies an empty expression to a database query for a specific column.\n * Handles queries for null or empty values.\n *\n * @template T - The result type for the query builder\n * @param column - The database column name to query\n * @param _expression - The empty expression (unused)\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param _attributesToColumns - Mapping of model attributes to database columns (unused)\n * @param _primaryKey - The primary key column name (unused)\n * @param _tableName - The table name (unused)\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneEmptyExpression = (\n column: string,\n _expression: EmptyExpression,\n operator: ComparisonOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n _attributesToColumns: ModelKeysContract,\n _primaryKey: string,\n _tableName: string,\n _allowedColumns?: string[] | undefined\n) => {\n switch (operator.operator) {\n case ':':\n case ':=':\n case ':<=':\n case ':>=':\n query.where((sub) => {\n sub.whereNull(column)\n sub.orWhere(column, '=', '')\n })\n break\n }\n}\n\n/**\n * Applies a literal expression to a database query for a specific column.\n * Handles string, boolean, and null values with appropriate SQL operations.\n * Supports quote stripping and handles different comparison operators.\n *\n * @template T - The result type for the query builder\n * @param column - The database column name to query\n * @param expression - The literal expression containing the value and quote information\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param _attributesToColumns - Mapping of model attributes to database columns (unused)\n * @param _primaryKey - The primary key column name (unused)\n * @param _tableName - The table name (unused)\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneLiteralExpression = (\n column: string,\n expression: LiteralExpressionToken,\n operator: ComparisonOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n _attributesToColumns: ModelKeysContract,\n _primaryKey: string,\n _tableName: string,\n _allowedColumns?: string[] | undefined\n) => {\n let value = expression.value\n if (value === null) {\n /*\n |--------------------------------------------------------------------------\n | Treat null values as empty strings or zero depending on the operator\n |--------------------------------------------------------------------------\n */\n switch (operator.operator) {\n case ':':\n case ':=':\n query.where((sub) => {\n sub.whereNull(column)\n sub.orWhere(column, '=', '')\n sub.orWhere(column, '=', 0)\n })\n break\n case ':<':\n query.where(column, '<', 0)\n break\n case ':<=':\n query.where(column, '<=', 0)\n break\n case ':>':\n query.where(column, '>', 0)\n break\n case ':>=':\n query.where(column, '>=', 0)\n break\n }\n return\n }\n if ('string' === typeof value && expression.quoted) {\n /*\n |--------------------------------------------------------------------------\n | Strip quotes from the value because they are not needed\n |--------------------------------------------------------------------------\n */\n if (expression.quotes === 'double') {\n value = value.replace(/^\"/g, '').replace(/\"$/g, '')\n } else if (expression.quotes === 'single') {\n value = value.replace(/^'/g, '').replace(/'$/g, '')\n }\n }\n switch (typeof value) {\n case 'string':\n switch (operator.operator) {\n case ':':\n case ':=':\n query.where((sub) => {\n sub.where(column, '=', value)\n sub.orWhere(column, 'like', value)\n })\n break\n case ':<':\n query.where(column, '<', value)\n break\n case ':<=':\n query.where(column, '<=', value)\n break\n case ':>':\n query.where(column, '>', value)\n break\n case ':>=':\n query.where(column, '>=', value)\n break\n }\n break\n case 'number':\n switch (operator.operator) {\n case ':':\n case ':=':\n query.where(column, '=', value)\n break\n case ':<':\n query.where(column, '<', value)\n break\n case ':<=':\n query.where(column, '<=', value)\n break\n case ':>':\n query.where(column, '>', value)\n break\n case ':>=':\n query.where(column, '>=', value)\n break\n }\n break\n case 'boolean':\n switch (operator.operator) {\n case ':':\n case ':=':\n query.where(column, '=', value)\n break\n case ':<':\n query.where(column, '<', value)\n break\n /* v8 ignore next 3 */\n case ':<=':\n query.where(column, '<=', value)\n break\n case ':>':\n query.where(column, '>', value)\n break\n case ':>=':\n query.where(column, '>=', value)\n break\n }\n break\n }\n}\n\n/**\n * Applies a range expression to a database query for a specific column.\n * Converts Lucene range syntax to SQL BETWEEN operations with proper inclusive/exclusive handling.\n *\n * @template T - The result type for the query builder\n * @param column - The database column name to query\n * @param expression - The range expression containing min/max values and inclusivity flags\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param _attributesToColumns - Mapping of model attributes to database columns (unused)\n * @param _primaryKey - The primary key column name (unused)\n * @param _tableName - The table name (unused)\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneRangeExpression = (\n column: string,\n expression: RangeExpressionToken,\n operator: ComparisonOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n _attributesToColumns: ModelKeysContract,\n _primaryKey: string,\n _tableName: string,\n _allowedColumns?: string[] | undefined\n) => {\n const comparableMin = expression.range.minInclusive\n ? expression.range.min\n : expression.range.min + 1\n const comparableMax = expression.range.maxInclusive\n ? expression.range.max\n : expression.range.max - 1\n switch (operator.operator) {\n case ':':\n case ':=':\n query.whereBetween(column, [comparableMin, comparableMax])\n break\n }\n}\n\n/**\n * Applies a regex expression to a database query for a specific column.\n * Converts regex patterns to SQL LIKE patterns with proper escaping.\n * Transforms * to % and ? to _ for SQL pattern matching.\n *\n * @template T - The result type for the query builder\n * @param column - The database column name to query\n * @param expression - The regex expression containing the pattern\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param _attributesToColumns - Mapping of model attributes to database columns (unused)\n * @param _primaryKey - The primary key column name (unused)\n * @param _tableName - The table name (unused)\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneRegexExpression = (\n column: string,\n expression: RegexExpressionToken,\n operator: ComparisonOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n _attributesToColumns: ModelKeysContract,\n _primaryKey: string,\n _tableName: string,\n _allowedColumns?: string[] | undefined\n) => {\n let value = expression.value\n /*\n |--------------------------------------------------------------------------\n | Escape any instances of `%` and `_` in the regex value\n |--------------------------------------------------------------------------\n */\n value = value.replace(/%/g, '\\\\%').replace(/_/g, '\\\\_')\n /*\n |--------------------------------------------------------------------------\n | Replace \"*\" with \"%\" and \"?\" with \"_\"\n |--------------------------------------------------------------------------\n */\n value = value.replace(/\\*/g, '%').replace(/\\?/g, '_')\n switch (operator.operator) {\n case ':':\n case ':=':\n query.whereLike(column, value)\n break\n }\n}\n\n/**\n * Applies an implicit field AST node to a database query.\n * Implicit fields use the primary key column when no specific field is specified.\n *\n * @template T - The result type for the query builder\n * @param _field - The implicit field token (unused)\n * @param expression - The expression to apply to the primary key column\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name to use for implicit fields\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneImplicitFieldAst = (\n _field: ImplicitFieldToken,\n expression: ExpressionToken,\n operator: ComparisonOperatorToken | undefined,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n const columnName = primaryKey\n if (allowedColumns && !allowedColumns.includes(columnName)) {\n /* v8 ignore next */\n return\n }\n\n // Default operator for implicit fields when none is provided\n const defaultOperator: ComparisonOperatorToken = operator || {\n operator: ':',\n type: 'ComparisonOperator',\n location: { start: 0, end: 0 },\n }\n\n switch (expression.type) {\n /* v8 ignore next 13 */\n case 'EmptyExpression':\n applyLuceneEmptyExpression(\n columnName,\n expression,\n defaultOperator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'LiteralExpression':\n applyLuceneLiteralExpression(\n columnName,\n expression,\n defaultOperator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'RangeExpression':\n applyLuceneRangeExpression(\n columnName,\n expression,\n defaultOperator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'RegexExpression':\n applyLuceneRegexExpression(\n columnName,\n expression,\n defaultOperator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n }\n}\n\n/**\n * Applies a field AST node to a database query.\n * Maps the field name to the corresponding database column and applies the expression.\n *\n * @template T - The result type for the query builder\n * @param field - The field token containing the field name\n * @param expression - The expression to apply to the mapped column\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneFieldAst = (\n field: FieldToken,\n expression: ExpressionToken,\n operator: ComparisonOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n const columnName = attributesToColumns.get(field.name)\n if (!columnName || (allowedColumns && !allowedColumns.includes(field.name))) {\n return\n }\n switch (expression.type) {\n case 'EmptyExpression':\n applyLuceneEmptyExpression(\n columnName,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'LiteralExpression':\n applyLuceneLiteralExpression(\n columnName,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'RangeExpression':\n applyLuceneRangeExpression(\n columnName,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'RegexExpression':\n applyLuceneRegexExpression(\n columnName,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n }\n}\n\n/**\n * Applies a tag AST node to a database query.\n * Tags represent field:expression pairs in Lucene syntax.\n * Delegates to either implicit field or explicit field handlers based on the field type.\n *\n * @template T - The result type for the query builder\n * @param ast - The tag AST node containing field, expression, and operator\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneTagAst = (\n ast: TagToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n const { expression, field, operator } = ast\n switch (field.type) {\n case 'ImplicitField':\n applyLuceneImplicitFieldAst(\n field,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n\n case 'Field':\n applyLuceneFieldAst(\n field,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n }\n}\n\n/**\n * Applies a unary operator AST node to a database query.\n * Handles NOT and negation (-) operators by wrapping the operand in a WHERE NOT clause.\n *\n * @template T - The result type for the query builder\n * @param ast - The unary operator AST node containing operator and operand\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneUnaryOperatorAst = (\n ast: UnaryOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n const operator = ast.operator\n\n if (operator === 'NOT' || operator === '-') {\n query.whereNot((subQuery) => {\n applyLuceneAst(\n ast.operand,\n subQuery,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n })\n /* v8 ignore next 13 */\n } else {\n query.where((subQuery) => {\n applyLuceneAst(\n ast.operand,\n subQuery,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n })\n }\n}\n\n/**\n * Applies any Lucene AST node to a database query.\n * This is the main dispatcher function that routes different AST node types\n * to their appropriate handler functions.\n *\n * @template T - The result type for the query builder\n * @param ast - The AST node to apply\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n * @param throwOnInvalidType - Whether to throw an error for unrecognized AST node types\n */\nexport const applyLuceneAst = (\n ast: ParserAst,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns: string[] | undefined,\n throwOnInvalidType: boolean = false\n) => {\n switch (ast.type) {\n case 'EmptyExpression':\n applyLuceneEmptyExpressionAst(\n ast,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'LogicalExpression':\n applyLuceneLogicalExpressionAst(\n ast,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'ParenthesizedExpression':\n applyLuceneParenthesizedExpressionAst(\n ast,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'Tag':\n applyLuceneTagAst(ast, query, attributesToColumns, primaryKey, tableName, allowedColumns)\n break\n case 'UnaryOperator':\n applyLuceneUnaryOperatorAst(\n ast,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n /* v8 ignore next 5 */\n default:\n if (throwOnInvalidType) {\n throw new E_LUCENE_INVALID_TYPE((ast as any).type)\n }\n break\n }\n}\n\n/**\n * Converts a Lucene query string to a Lucid database query builder.\n * Parses the Lucene syntax and applies the resulting AST to generate SQL conditions.\n *\n * @template T - The result type for the query builder\n * @param luceneQuery - The Lucene query string to parse and convert\n * @param connection - The database connection client for creating queries\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name for implicit field queries\n * @param tableName - The database table name to query\n * @param allowedColumns - Optional array of allowed column names for security filtering\n * @returns A database query builder with the Lucene conditions applied\n * @throws {E_LUCENE_SYNTAX_EXCEPTION} When the Lucene query has syntax errors\n * @throws {E_LUCENE_UNEXPECTED_EXCEPTION} When an unexpected error occurs during parsing\n * @throws {E_LUCENE_INVALID_TYPE} When an unrecognized AST node type is encountered\n */\nexport const luceneToLucid = (\n luceneQuery: string,\n connection: QueryClientContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n): LuceneFilteredDatabaseQueryBuilderContract => {\n let parsed: LiqeQuery\n try {\n parsed = parse(luceneQuery)\n } catch (error) {\n if (error instanceof SyntaxError) {\n throw new E_LUCENE_SYNTAX_EXCEPTION(error)\n }\n /* v8 ignore next 2 */\n throw new E_LUCENE_UNEXPECTED_EXCEPTION(error)\n }\n const query: LuceneFilteredDatabaseQueryBuilderContract = connection.query().from(tableName)\n applyLuceneAst(parsed, query, attributesToColumns, primaryKey, tableName, allowedColumns, true)\n return query\n}\n","var o = Object.defineProperty;\nvar a = (t, s, r) => s in t ? o(t, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[s] = r;\nvar n = (t, s, r) => a(t, typeof s != \"symbol\" ? s + \"\" : s, r);\nconst u = \"1.20250430.0\";\nclass l {\n /**\n * Creates a new TypedEventEmitter instance.\n */\n constructor() {\n /**\n * The internal event listener map for the emitter.\n */\n n(this, \"e\");\n this.e = {};\n }\n /**\n * Subscribe to an event with a typed listener.\n * @param event - The event name.\n * @param listener - The listener function.\n * @param ctx - The `this` context to apply to the listener when it is called\n * @returns the current instance for chaining\n */\n on(s, r, i) {\n return Array.isArray(this.e[s]) || (this.e[s] = []), this.e[s].push({\n fn: r,\n ctx: i || null\n }), this;\n }\n /**\n * Subscribe to an event once with a typed listener.\n * @param event - The event name.\n * @param listener - The listener function.\n * @param ctx - The `this` context to apply to the listener when it is called\n * @returns the current instance for chaining\n */\n once(s, r, i) {\n const f = this;\n function h() {\n r.apply(i || null, arguments), f.off(s, h);\n }\n return h._ = r, this.on(s, h, i);\n }\n /**\n * Emit an event.\n * @param event - The event name.\n * @param args - The arguments to pass to the listeners.\n * @returns the current instance for chaining\n */\n emit(s, ...r) {\n const i = this.e[s];\n return Array.isArray(i) && i.forEach((f) => {\n f.fn.apply(f.ctx || null, r);\n }), this;\n }\n /**\n * Unsubscribe from an event.\n * @param event - The event name.\n * @param listener - Optional. The listener function to remove.\n * @returns the current instance for chaining\n *\n * @remarks When no listener is provided, all listeners for the event will be removed, otherwise\n * only the specified listener will be removed.\n */\n off(s, r) {\n return Array.isArray(this.e[s]) && (r ? this.e[s] = this.e[s].filter(\n // @ts-ignore\n (i) => i.fn !== r && i.fn._ !== r\n ) : this.e[s] = []), this;\n }\n}\nexport {\n l as TypedEventEmitter,\n u as version\n};\n//# sourceMappingURL=index.mjs.map\n","/*\n|--------------------------------------------------------------------------\n| Mixin for Lucid Models\n|--------------------------------------------------------------------------\n|\n| Adds the required metadata and functionality to Lucid models\n| which will be utilized by the resourceful controller & factory\n*/\nimport * as helpers from './helpers'\nimport { default as pMap } from 'p-map'\nimport * as guards from './type_guards'\nimport { joi } from '@nhtio/lucid-resourceful/joi'\nimport { luceneToLucid } from './lucene_to_lucid_translator'\nimport { TypedEventEmitter } from '@nhtio/tiny-typed-emitter'\nimport { ACLOperationsEnum, CRUDOperationsEnum } from './constants'\nimport { operationCRUDToACL, isString, isFunction, prepareFields } from './utils'\nimport {\n E_FORBIDDEN,\n E_INVALID_COLUMN_ACCESS,\n E_INVALID_RESOURCEFUL_MIXIN_OPTIONS,\n E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION,\n E_MISSING_PRIMARY_KEY_EXCEPTION,\n E_RECORD_NOT_FOUND_EXCEPTION,\n E_INVALID_PAYLOAD_EXCEPTION,\n E_FORBIDDEN_PAYLOAD_EXCEPTION,\n} from '@nhtio/lucid-resourceful/errors'\nimport {\n ResourcefulArrayType,\n ResourcefulBigintType,\n ResourcefulBinaryType,\n ResourcefulBooleanType,\n ResourcefulDateTimeType,\n ResourcefulDateType,\n ResourcefulIntegerType,\n ResourcefulNumberType,\n ResourcefulObjectType,\n ResourcefulStringType,\n ResourcefulUnsignedIntegerType,\n} from '@nhtio/lucid-resourceful/definitions'\nimport type { BaseModel } from '@adonisjs/lucid/orm'\nimport type { HttpContext } from '@adonisjs/core/http'\nimport type { ApplicationService } from '@adonisjs/core/types'\nimport type { AnySchema, ObjectSchema, ValidationError } from 'joi'\nimport type { EventMap, Key, Listener } from '@nhtio/tiny-typed-emitter'\nimport type { NormalizeConstructor } from '@adonisjs/core/types/helpers'\nimport type { DatabaseQueryBuilderContract } from '@adonisjs/lucid/types/querybuilder'\nimport type {\n ComputedOptions,\n LucidModel,\n ModelColumnOptions,\n ModelObject,\n} from '@adonisjs/lucid/types/model'\nimport type {\n ExternalDocumentationObject,\n PromiseAble,\n ResourcefulAccessControlFilter,\n ResourcefulColumnDefinition,\n ResourcefulComputedAccessorDefinition,\n ResourcefulDataType,\n ResourcefulGeneralAccessControlFilter,\n ResourcefulModelColumnMetaSchema,\n ResourcefulModelComputedAccessorMetaSchema,\n ResourcefulModelMetaSchema,\n ResourcefulModelOpenApiRelatedSchema,\n ResourcefulModelOpenApiSchema,\n ResourcefulModelRelationshipMetaSchema,\n ResourcefulPropertySchema,\n ResourcefulRelationshipDefinition,\n ResourcefulResourceAccessControlFilter,\n ValidationScoper,\n ResourcefulModelSerializableAttributes,\n} from '@nhtio/lucid-resourceful/types'\n\n/**\n * Result object returned by the resourceful index/list operation.\n *\n * Contains paginated records along with metadata about the query execution\n * and pagination state. The records are filtered according to field-level\n * access control and only contain the requested fields.\n *\n * @template ReturnType - The shape of records after field selection and ACL filtering\n */\nexport interface ResourcefulIndexResult<ReturnType = any> {\n /** Array of records with only the requested and accessible fields */\n records: Array<Partial<ReturnType>>\n /** Total number of records matching the filter (before pagination) */\n total: number\n /** The current page number (1-based) */\n page: number\n /** Number of records per page */\n perPage: number\n /** SQL query string used for counting total records */\n countQuery: string\n /** SQL query string used for fetching the paginated records */\n recordsQuery: string\n}\n\n/**\n * Function type for generating payload validation schemas based on request context.\n *\n * These functions are called during create and update operations to generate\n * context-specific validation schemas using Joi. They provide the core model-level\n * validation that applies regardless of request-specific hooks.\n *\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @returns Promise resolving to a Joi schema for validating the request payload\n */\nexport interface ResourcefulPayloadValidatorGetter {\n (ctx: HttpContext, app: ApplicationService): PromiseAble<AnySchema>\n}\n\n/**\n * Function type for generating request-specific payload validation schemas.\n *\n * These functions are provided via hooks during create and update operations\n * to add additional validation constraints beyond the base model validation.\n * They enable request-specific validation logic based on context.\n *\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @returns Promise resolving to a Joi ObjectSchema for additional validation, or null to skip\n */\nexport interface ResourcefulPayloadSchemaGetter {\n (ctx: HttpContext, app: ApplicationService): PromiseAble<ObjectSchema | null>\n}\n\n/**\n * Function type for applying query-level scoping to database queries.\n *\n * These callbacks are applied to queries during CRUD operations to enforce\n * data access boundaries based on request context. They modify the query\n * in-place by adding WHERE clauses, JOINs, or other constraints.\n *\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param query - Database query builder to modify with scoping constraints\n * @returns Promise that resolves when the query has been modified\n */\nexport interface ResourcefulQueryScopeCallback {\n (\n ctx: HttpContext,\n app: ApplicationService,\n query: DatabaseQueryBuilderContract\n ): PromiseAble<void>\n}\n\n/**\n * Array of query scope callback functions.\n *\n * Used for operations that need to apply query-level scoping (index, read, delete).\n * Callbacks are applied in sequence to build up the complete set of access constraints.\n */\nexport type ResourcefulScopeHooks = ResourcefulQueryScopeCallback[]\n\n/**\n * Array of payload validation schema getter functions.\n *\n * Used for operations that accept request payloads (create, update).\n * Each function can return additional validation constraints based on request context.\n */\nexport type ResourcefulValidationHooks = ResourcefulPayloadSchemaGetter[]\n\n/**\n * Combined hook interface providing both query scoping and payload validation.\n *\n * Used by the update operation which needs both query scoping (to find the record)\n * and payload validation (to validate the update data).\n */\nexport interface ResourcefulHooks {\n /** Query scope callbacks for constraining database queries */\n queryScopeCallbacks: ResourcefulScopeHooks\n /** Payload validation schema getters for additional validation */\n payloadValidationSchemas: ResourcefulValidationHooks\n}\n\nexport type ResourcefulMixinEventMap<\n Model extends LucidModel = LucidModel,\n ModelInstance = InstanceType<Model>,\n> = EventMap<{\n 'acl:error': [unknown, HttpContext, ApplicationService, ModelInstance | undefined]\n 'validation:scope:error': [unknown, HttpContext, ApplicationService, string, ResourcefulDataType]\n}>\n\n/**\n * Enhanced Lucid model interface providing resourceful CRUD functionality.\n *\n * This interface extends the base LucidModel with metadata-driven CRUD operations,\n * field-level access control, query scoping, OpenAPI schema generation, and event\n * handling capabilities. Models implementing this interface gain static methods\n * for handling HTTP requests with built-in validation, pagination, filtering,\n * and comprehensive security features.\n *\n * The interface defines both metadata storage properties and operational methods\n * that work together to provide a complete resourceful API layer on top of\n * AdonisJS Lucid ORM models.\n *\n * @extends LucidModel\n *\n * @example\n * ```typescript\n * import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'\n * import { withResourceful, resourceful } from 'lucid-resourceful'\n *\n * class User extends withResourceful()(BaseModel) implements ResourcefulModel {\n * @column({ isPrimary: true })\n * @resourceful({ type: 'number', nullable: false })\n * public id: number\n *\n * @column()\n * @resourceful({ type: 'string', nullable: false })\n * public name: string\n *\n * // Automatically gains all ResourcefulModel methods\n * // User.$onResourcefulIndex, User.$onResourcefulRead, etc.\n * }\n * ```\n */\nexport interface ResourcefulModel extends LucidModel {\n /** The display name for this model used in API documentation and error messages */\n $resourcefulName: string\n\n /** Optional description for OpenAPI schema documentation */\n $resourcefulMetaDescription?: string\n\n /** Optional external documentation reference for OpenAPI schema */\n $resourcefulMetaExternalDocs?: ExternalDocumentationObject\n\n /** Optional example value for OpenAPI schema documentation */\n $resourcefulMetaExample?: string\n\n /** Map of column property names to their resourceful metadata definitions */\n $resourcefulColumns: Map<string, ResourcefulColumnDefinition<ResourcefulPropertySchema>>\n\n /** Map of relationship property names to their resourceful metadata definitions */\n $resourcefulRelationships: Map<string, ResourcefulRelationshipDefinition>\n\n /** Map of computed accessor property names to their resourceful metadata definitions */\n $resourcefulComputedAccessors: Map<\n string,\n ResourcefulComputedAccessorDefinition<ResourcefulPropertySchema>\n >\n\n /** Access control filter functions organized by CRUD operation type */\n $resourcefulAccessControlFilters: ResourcefulMixinOptions['accessControlFilters']\n\n /** Error handling strategy when ACL evaluation fails */\n $resourcefulOnACLError: ResourcefulMixinOptions['onACLError']\n\n /** Query scope callback functions for constraining database queries */\n $resourcefulQueryScopeCallbacks: ResourcefulMixinOptions['queryScopeCallbacks']\n\n /** Payload validation schema builder functions for create and update operations */\n $resourcefulPayloadValidationSchemaBuilders: ResourcefulMixinOptions['payloadValidationSchemaBuilders']\n\n /**\n * Registers an event listener for resourceful model events.\n *\n * This method provides a way to listen for events emitted during resourceful\n * operations such as ACL errors or validation scope errors. Useful for logging,\n * monitoring, or implementing custom error handling logic.\n *\n * @template K - The event key type from the resourceful event map\n * @param event - The name of the event to listen for ('acl:error', 'validation:scope:error')\n * @param listener - Function to call when the event is emitted\n * @returns The model class for method chaining\n *\n * @example\n * ```typescript\n * User.$onResourcefulEvent('acl:error', (error, ctx, app, instance) => {\n * console.error('ACL error occurred:', error);\n * });\n * ```\n */\n $onResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<ResourcefulModel>>,\n listener: Listener<K, ResourcefulMixinEventMap<ResourcefulModel>>\n ): this\n\n /**\n * Registers a one-time event listener for resourceful model events.\n *\n * Similar to $onResourcefulEvent but the listener is automatically removed\n * after being called once. Useful for handling events that should only\n * trigger a single response.\n *\n * @template K - The event key type from the resourceful event map\n * @param event - The name of the event to listen for\n * @param listener - Function to call when the event is emitted\n * @returns The model class for method chaining\n *\n * @example\n * ```typescript\n * User.$onceResourcefulEvent('validation:scope:error', (error, ctx, app, key, datatype) => {\n * console.warn('Validation scope error (one-time):', error);\n * });\n * ```\n */\n $onceResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<ResourcefulModel>>,\n listener: Listener<K, ResourcefulMixinEventMap<ResourcefulModel>>\n ): this\n\n /**\n * Removes an event listener for resourceful model events.\n *\n * Unregisters a previously registered event listener. If no listener is\n * provided, all listeners for the specified event are removed.\n *\n * @template K - The event key type from the resourceful event map\n * @param event - The name of the event to stop listening for\n * @param listener - Optional specific listener function to remove\n * @returns The model class for method chaining\n *\n * @example\n * ```typescript\n * // Remove specific listener\n * User.$offResourcefulEvent('acl:error', myErrorHandler);\n *\n * // Remove all listeners for an event\n * User.$offResourcefulEvent('acl:error');\n * ```\n */\n $offResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<ResourcefulModel>>,\n listener?: Listener<K, ResourcefulMixinEventMap<ResourcefulModel>>\n ): this\n\n /**\n * Performs paginated listing and searching of model records with comprehensive filtering.\n *\n * This method provides the core implementation for resourceful index/list operations,\n * supporting pagination, field selection, access control, and Lucene query syntax for\n * filtering. It validates all inputs, applies ACL filters, executes the query with\n * proper field mapping between serialized names and database columns, and returns\n * structured results with query metadata.\n *\n * @template SelectedFields - Array of field names that can be selected from the model's serializable attributes\n * @template ReturnType - The resulting type after picking the selected fields from the model's serializable attributes\n *\n * @param filter - Lucene-style query string for filtering records (e.g., \"name:john AND email:*.com\").\n * If null or undefined, defaults to empty string (no filtering).\n * @param page - The page number for pagination (must be ≥ 1). Used with perPage to calculate offset.\n * @param perPage - Number of records per page (must be ≥ 1 and ≤ 100 by default).\n * @param fields - Array of field names to include in the response. If null, undefined, or empty,\n * defaults to just the primary key field. Field names should use serialized names\n * (as they appear in API responses), not database column names.\n * @param ctx - HTTP context containing request information, authentication, and other request-scoped data.\n * @param app - Application service instance providing access to application-level services and configuration.\n * @param hooks - Optional array of query scope callbacks to apply additional filtering constraints.\n *\n * @returns Promise resolving to ResourcefulIndexResult containing:\n * - `records`: Array of partial record objects with only the requested fields\n * - `total`: Total number of records matching the filter (before pagination)\n * - `page`: The requested page number (echoed back)\n * - `perPage`: The requested per-page limit (echoed back)\n * - `countQuery`: SQL query string used for counting total records\n * - `recordsQuery`: SQL query string used for fetching the actual records\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n * @throws {E_INVALID_COLUMN_ACCESS} When no fields are available for access after ACL filtering\n * @throws {E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION} When input validation fails\n *\n * @example\n * ```typescript\n * // Basic usage with pagination\n * const result = await User.$onResourcefulIndex(\n * 'name:john',\n * 1,\n * 10,\n * ['id', 'name', 'email'],\n * ctx,\n * app\n * );\n *\n * // Complex filtering with date ranges\n * const result = await User.$onResourcefulIndex(\n * 'name:john AND createdAt:[2021-01-01T00:00:00Z TO 2021-12-31T23:59:59Z]',\n * 2,\n * 25,\n * ['id', 'name', 'createdAt'],\n * ctx,\n * app\n * );\n * ```\n */\n $onResourcefulIndex<\n SelectedFields extends Array<\n keyof ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>\n >,\n SelectedSingleField extends keyof ResourcefulModelSerializableAttributes<\n InstanceType<LucidModel>\n >,\n ReturnType = Pick<\n ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>,\n SelectedFields[number]\n >,\n >(\n filter: string | null | undefined,\n page: number,\n perPage: number,\n fields: SelectedFields | SelectedSingleField | null | undefined,\n sort:\n | Array<\n [\n Extract<keyof ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>, string>,\n 'asc' | 'desc',\n ]\n >\n | null\n | undefined,\n ctx: HttpContext,\n app: ApplicationService,\n hooks?: ResourcefulScopeHooks\n ): Promise<ResourcefulIndexResult<ReturnType>>\n\n /**\n * Retrieves a single model record by its unique identifier with access control.\n *\n * This method implements secure record retrieval by first applying query scope callbacks\n * to verify the record exists within the user's access scope, then fetching the full\n * model instance for field-level ACL evaluation. Only fields that pass ACL checks\n * are included in the response.\n *\n * @param uid - The unique identifier of the record to retrieve\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional array of query scope callbacks to apply additional filtering constraints\n *\n * @returns Promise resolving to the record object with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n *\n * @example\n * ```typescript\n * // Retrieve a user by ID\n * const user = await User.$onResourcefulRead(123, ctx, app);\n *\n * // With additional query scoping\n * const user = await User.$onResourcefulRead(123, ctx, app, [\n * (ctx, app, query) => query.where('tenant_id', ctx.auth.user.tenantId)\n * ]);\n * ```\n */\n $onResourcefulRead(\n uid: number,\n ctx: HttpContext,\n app: ApplicationService,\n hooks?: ResourcefulScopeHooks\n ): Promise<any>\n\n /**\n * Creates a new model record with payload validation and access control.\n *\n * This method handles secure record creation by validating the request payload\n * against both model-level and request-specific validation schemas, checking\n * field-level write permissions, and returning the created record with appropriate\n * field filtering applied.\n *\n * @param payload - The data object containing field values for the new record\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional array of validation schema getters for additional payload validation\n *\n * @returns Promise resolving to the created record with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_INVALID_PAYLOAD_EXCEPTION} When core model validation fails\n * @throws {E_FORBIDDEN_PAYLOAD_EXCEPTION} When request-specific validation fails\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n *\n * @example\n * ```typescript\n * // Create a new user\n * const user = await User.$onResourcefulCreate({\n * name: 'John Doe',\n * email: 'john@example.com'\n * }, ctx, app);\n *\n * // With additional validation\n * const user = await User.$onResourcefulCreate(payload, ctx, app, [\n * (ctx, app) => joi.object({ email: joi.string().domain('company.com') })\n * ]);\n * ```\n */\n $onResourcefulCreate(\n payload: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks?: ResourcefulValidationHooks\n ): Promise<any>\n\n /**\n * Updates an existing model record with payload validation and access control.\n *\n * This method implements secure record updates by first verifying the record exists\n * and is accessible via the read operation, validating the update payload, checking\n * field-level write permissions, and returning the updated record with appropriate\n * field filtering applied.\n *\n * @param uid - The unique identifier of the record to update\n * @param payload - The data object containing field values to update\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional object containing query scope callbacks and validation schema getters\n *\n * @returns Promise resolving to the updated record with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_INVALID_PAYLOAD_EXCEPTION} When core model validation fails\n * @throws {E_FORBIDDEN_PAYLOAD_EXCEPTION} When request-specific validation fails\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n *\n * @example\n * ```typescript\n * // Update a user\n * const user = await User.$onResourcefulUpdate(123, {\n * name: 'Jane Doe'\n * }, ctx, app);\n *\n * // With additional scoping and validation\n * const user = await User.$onResourcefulUpdate(123, payload, ctx, app, {\n * queryScopeCallbacks: [(ctx, app, query) => query.where('active', true)],\n * payloadValidationSchemas: [(ctx, app) => customValidationSchema]\n * });\n * ```\n */\n $onResourcefulUpdate(\n uid: number,\n payload: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks?: Partial<ResourcefulHooks>\n ): Promise<any>\n\n /**\n * Deletes an existing model record with access control.\n *\n * This method implements secure record deletion by applying query scope callbacks\n * to verify the record exists within the user's access scope, checking delete\n * permissions via ACL filters, and then removing the record from the database.\n *\n * @param uid - The unique identifier of the record to delete\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional array of query scope callbacks to apply additional filtering constraints\n *\n * @returns Promise that resolves when the record has been successfully deleted\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_FORBIDDEN} When access is denied by model-level ACL filters\n *\n * @example\n * ```typescript\n * // Delete a user\n * await User.$onResourcefulDelete(123, ctx, app);\n *\n * // With additional query scoping\n * await User.$onResourcefulDelete(123, ctx, app, [\n * (ctx, app, query) => query.where('tenant_id', ctx.auth.user.tenantId)\n * ]);\n * ```\n */\n $onResourcefulDelete(\n uid: number,\n ctx: HttpContext,\n app: ApplicationService,\n hooks?: ResourcefulScopeHooks\n ): Promise<void>\n\n /**\n * Generates an OpenAPI schema object for this model with context-aware field filtering.\n *\n * This method creates a complete OpenAPI v3 schema representation of the model\n * by evaluating field-level access control permissions for the given request context.\n * Only fields that pass ACL checks are included in the generated schema, ensuring\n * that API documentation accurately reflects what data is accessible to the current user.\n *\n * The method processes all resourceful properties (columns, computed accessors, and\n * relationships) and converts them to their OpenAPI schema equivalents while respecting\n * access control constraints and applying proper type mappings.\n *\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n *\n * @returns Promise resolving to a complete OpenAPI schema object with:\n * - `type`: Always 'object' for model schemas\n * - `title`: The model's resourceful name\n * - `description`: Optional model description from metadata\n * - `properties`: Object containing schema definitions for accessible fields\n * - `required`: Array of required field names (non-nullable fields)\n * - `externalDocs`: Optional external documentation reference\n * - `example`: Optional example value for the schema\n *\n * @example\n * ```typescript\n * // Generate OpenAPI schema for current user context\n * const schema = await User.$asOpenApiSchemaObject(ctx, app);\n *\n * // Result structure:\n * {\n * type: 'object',\n * title: 'User',\n * properties: {\n * id: { type: 'number', readOnly: true },\n * name: { type: 'string' },\n * email: { type: 'string', format: 'email' }\n * },\n * required: ['id', 'name', 'email']\n * }\n * ```\n *\n * @see {@link ResourcefulModelOpenApiSchema} for the complete schema structure\n */\n $asOpenApiSchemaObject(\n ctx: HttpContext,\n app: ApplicationService\n ): Promise<ResourcefulModelOpenApiSchema>\n}\n\nexport const ResourcefulErrorHandlerMethod = ['bubble', 'pass', 'fail'] as const\nexport type ResourcefulErrorHandlerMethod = (typeof ResourcefulErrorHandlerMethod)[number]\nexport const ResourcefulACLOperationType = ['read', 'write'] as const\nexport type ResourcefulACLOperationType = (typeof ResourcefulACLOperationType)[number]\n\ntype ResourcefulCheckAccessOptions<\n Model extends LucidModel = LucidModel,\n ResourcefulModelInstance = InstanceType<Model>,\n> = { ctx: HttpContext; app: ApplicationService } & (\n | { operation: CRUDOperationsEnum.LIST | CRUDOperationsEnum.CREATE; instance?: undefined }\n | {\n operation: CRUDOperationsEnum.READ | CRUDOperationsEnum.UPDATE | CRUDOperationsEnum.DELETE\n instance: ResourcefulModelInstance\n }\n)\n\nexport interface AdvancedResourcefulMixinOptions {\n propertyEvaluationConcurrency: number\n aclEvaluationConcurrency: number\n}\n\nexport interface ResourcefulMixinOptions<\n Model extends LucidModel = LucidModel,\n ModelInstance = InstanceType<Model>,\n> {\n name: string\n readRequiredForWrite: boolean\n accessControlFilters: {\n list: ResourcefulGeneralAccessControlFilter[]\n create: ResourcefulGeneralAccessControlFilter[]\n read: ResourcefulResourceAccessControlFilter<Model, ModelInstance>[]\n update: ResourcefulResourceAccessControlFilter<Model, ModelInstance>[]\n delete: ResourcefulResourceAccessControlFilter<Model, ModelInstance>[]\n }\n payloadValidationSchemaBuilders: {\n create: ResourcefulPayloadValidatorGetter[]\n update: ResourcefulPayloadValidatorGetter[]\n }\n onACLError: ResourcefulErrorHandlerMethod\n onValidationScopeError: ResourcefulErrorHandlerMethod\n queryScopeCallbacks: {\n list: ResourcefulQueryScopeCallback[]\n access: ResourcefulQueryScopeCallback[]\n }\n description?: string\n externalDocs?: ExternalDocumentationObject\n example?: string\n advanced: AdvancedResourcefulMixinOptions\n}\n\ntype ResourcefulCheckAccessReturn =\n | {\n isForbidden: true\n message: string\n allowedFieldsMap?: undefined\n allowedColumnsMap?: undefined\n }\n | {\n isForbidden: false\n message?: undefined\n allowedFieldsMap: Map<string, boolean>\n allowedColumnsMap: Map<string, boolean>\n }\n\nconst getFieldKey = (\n key: string,\n definition: ModelColumnOptions | ComputedOptions | ReturnType<LucidModel['$getRelation']>\n) => {\n if (isString(definition.serializeAs)) {\n return definition.serializeAs as string | null\n }\n return key\n}\n\nfunction StaticImplements<T>() {\n return (_t: T) => {}\n}\n\n/**\n * Creates a mixin that adds resourceful CRUD functionality to Lucid models.\n *\n * This function implements the mixin pattern to enhance AdonisJS Lucid models with\n * metadata-driven CRUD operations, field-level access control, query scoping,\n * and OpenAPI schema generation capabilities. The resulting model gains static\n * methods for handling HTTP requests with built-in validation, pagination,\n * filtering, and security features.\n *\n * The mixin validates and normalizes configuration options, creates isolated\n * metadata maps for each model class to prevent inheritance conflicts, and\n * establishes an event emitter for monitoring ACL and validation operations.\n *\n * @param options - Configuration object for customizing mixin behavior\n * @param options.name - Display name for the model (defaults to class name)\n * @param options.readRequiredForWrite - Whether read access is required before write operations\n * @param options.accessControlFilters - Object containing arrays of ACL filter functions for different operations\n * @param options.accessControlFilters.list - Filters applied during listing/search operations\n * @param options.accessControlFilters.create - Filters applied during record creation\n * @param options.accessControlFilters.read - Filters applied during record reading\n * @param options.accessControlFilters.update - Filters applied during record updates\n * @param options.accessControlFilters.delete - Filters applied during record deletion\n * @param options.onACLError - Error handling strategy when ACL evaluation fails ('throw', 'pass', 'fail')\n * @param options.onValidationScopeError - Error handling strategy when validation scope functions fail\n * @param options.queryScopeCallbacks - Object containing query scope callback functions\n * @param options.queryScopeCallbacks.list - Callbacks applied to listing/search queries\n * @param options.queryScopeCallbacks.access - Callbacks applied to individual record access queries\n * @param options.description - Optional description for OpenAPI documentation\n * @param options.externalDocs - Optional external documentation reference for OpenAPI\n * @param options.example - Optional example value for OpenAPI documentation\n * @param options.advanced - Advanced configuration options for performance tuning\n * @param options.advanced.propertyEvaluationConcurrency - Concurrency limit for property ACL evaluation\n * @param options.advanced.aclEvaluationConcurrency - Concurrency limit for ACL filter evaluation\n *\n * @returns A mixin function that accepts a Lucid model class and returns the enhanced model\n *\n * @throws {E_INVALID_RESOURCEFUL_MIXIN_OPTIONS} When the provided options fail validation\n *\n * @example\n * ```typescript\n * import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'\n * import { withResourceful, resourceful } from 'lucid-resourceful'\n *\n * class User extends withResourceful({\n * name: 'User',\n * readRequiredForWrite: true,\n * accessControlFilters: {\n * read: [(ctx) => ctx.auth.user?.id === ctx.params.id],\n * update: [(ctx) => ctx.auth.user?.isAdmin]\n * }\n * })(BaseModel) {\n * @column({ isPrimary: true })\n * @resourceful({ type: 'number', nullable: false })\n * public id: number\n *\n * @column()\n * @resourceful({ type: 'string', nullable: false })\n * public name: string\n * }\n *\n * // Generated controller with CRUD operations\n * const UserController = User.generateController()\n * ```\n *\n * @see {@link ResourcefulMixinOptions} for detailed configuration options\n * @see {@link ResourcefulModel} for the enhanced model interface\n */\nexport function withResourceful(\n options: Partial<ResourcefulMixinOptions> = {}\n): <Model extends NormalizeConstructor<typeof BaseModel>>(\n superclass: Model\n) => Model & ResourcefulModel {\n return <Model extends NormalizeConstructor<typeof BaseModel>>(\n superclass: Model\n ): Model & ResourcefulModel => {\n const optionsSchema = joi.object<ResourcefulMixinOptions>({\n name: joi.string().default(superclass.name),\n readRequiredForWrite: joi.boolean().default(false),\n accessControlFilters: joi\n .object({\n list: joi.array().items(joi.function()).default([]),\n create: joi.array().items(joi.function()).default([]),\n read: joi.array().items(joi.function()).default([]),\n update: joi.array().items(joi.function()).default([]),\n delete: joi.array().items(joi.function()).default([]),\n })\n .default({}),\n onACLError: joi\n .string()\n .valid(...ResourcefulErrorHandlerMethod)\n .default('throw'),\n onValidationScopeError: joi\n .string()\n .valid(...ResourcefulErrorHandlerMethod)\n .default('throw'),\n queryScopeCallbacks: joi\n .object({\n list: joi.array().items(joi.function()).default([]),\n access: joi.array().items(joi.function()).default([]),\n })\n .default({}),\n description: joi.string().optional(),\n externalDocs: joi\n .object<ExternalDocumentationObject>({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n advanced: joi\n .object<AdvancedResourcefulMixinOptions>({\n propertyEvaluationConcurrency: joi.number().integer().min(1).default(10),\n aclEvaluationConcurrency: joi.number().integer().min(1).default(2),\n })\n .default({\n propertyEvaluationConcurrency: 10,\n aclEvaluationConcurrency: 2,\n }),\n })\n\n const { error, value: validatedOptions } = optionsSchema.validate(options, {\n abortEarly: true,\n }) as { error?: ValidationError; value: ResourcefulMixinOptions<Model> }\n\n if (error) {\n throw new E_INVALID_RESOURCEFUL_MIXIN_OPTIONS(superclass.name, error)\n }\n\n // Ensure each class gets its own non-inherited static Maps\n const ensureOwnResourcefulMap = <T>(cls: any, key: string): Map<string, T> => {\n if (!Object.prototype.hasOwnProperty.call(cls, key) || !(cls[key] instanceof Map)) {\n return new Map()\n }\n return cls[key]\n }\n\n const resourcefulColumns = ensureOwnResourcefulMap<\n ResourcefulColumnDefinition<ResourcefulPropertySchema>\n >(superclass, '$resourcefulColumns')\n const resourcefulRelationships = ensureOwnResourcefulMap<ResourcefulRelationshipDefinition>(\n superclass,\n '$resourcefulRelationships'\n )\n const resourcefulComputedAccessors = ensureOwnResourcefulMap<\n ResourcefulComputedAccessorDefinition<ResourcefulPropertySchema>\n >(superclass, '$resourcefulComputedAccessors')\n\n const resourcefulModelEventEmitter = new TypedEventEmitter<\n ResourcefulMixinEventMap<Model & ResourcefulModel>\n >()\n\n StaticImplements<ResourcefulModel>()\n class ResourcefulModel extends superclass {\n declare static readonly $resourcefulName: string\n declare static $resourcefulMetaDescription?: string\n declare static $resourcefulMetaExternalDocs?: ExternalDocumentationObject\n declare static $resourcefulMetaExample?: string\n static $resourcefulColumns: Map<\n string,\n ResourcefulColumnDefinition<ResourcefulPropertySchema>\n > = resourcefulColumns\n static $resourcefulRelationships: Map<string, ResourcefulRelationshipDefinition> =\n resourcefulRelationships\n static $resourcefulComputedAccessors: Map<\n string,\n ResourcefulComputedAccessorDefinition<ResourcefulPropertySchema>\n > = resourcefulComputedAccessors\n declare static $resourcefulAccessControlFilters: ResourcefulMixinOptions['accessControlFilters']\n declare static $resourcefulOnACLError: ResourcefulMixinOptions['onACLError']\n declare static $resourcefulQueryScopeCallbacks: ResourcefulMixinOptions['queryScopeCallbacks']\n declare static $resourcefulPayloadValidationSchemaBuilders: ResourcefulMixinOptions['payloadValidationSchemaBuilders']\n\n static $onResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>,\n listener: Listener<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>\n ) {\n resourcefulModelEventEmitter.on(event, listener)\n return this\n }\n\n static $onceResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>,\n listener: Listener<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>\n ) {\n resourcefulModelEventEmitter.once(event, listener)\n return this\n }\n\n static $offResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>,\n listener?: Listener<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>\n ) {\n resourcefulModelEventEmitter.off(event, listener)\n return this\n }\n\n protected static async $getAsResourcefulForContext(\n ctx: HttpContext,\n app: ApplicationService\n ): Promise<ResourcefulModelMetaSchema> {\n const resourcefulModelMetaSchema: ResourcefulModelMetaSchema = {\n name: validatedOptions.name,\n properties: {},\n description: this.$resourcefulMetaDescription,\n externalDocs: this.$resourcefulMetaExternalDocs,\n example: this.$resourcefulMetaExample,\n }\n await pMap(\n Array.from(this.$resourcefulColumns.entries()),\n async ([propertyKey, columnDefinition]) => {\n const lucidDefinitions = this.$getColumn(propertyKey)\n if (!lucidDefinitions) return\n const resourcefulModelColumnMetaSchema: ResourcefulModelColumnMetaSchema = {\n propertyKey,\n definition: columnDefinition,\n lucidDefinitions,\n ...(await this.$getPropertyCanReadWrite(\n ctx,\n app,\n propertyKey,\n lucidDefinitions,\n columnDefinition.readAccessControlFilters,\n columnDefinition.writeAccessControlFilters,\n 'column'\n )),\n kind: 'column',\n validator: this.$getPropertyValidator(\n ctx,\n app,\n propertyKey,\n columnDefinition.type,\n columnDefinition.nullable,\n columnDefinition.validationScopes as any,\n 'column'\n ),\n }\n if (\n !resourcefulModelColumnMetaSchema.canRead &&\n !resourcefulModelColumnMetaSchema.canWrite\n )\n return\n resourcefulModelMetaSchema.properties[propertyKey] = resourcefulModelColumnMetaSchema\n },\n {\n concurrency: validatedOptions.advanced.propertyEvaluationConcurrency,\n }\n )\n await pMap(\n Array.from(this.$resourcefulComputedAccessors.entries()),\n async ([propertyKey, computedAccessorDefinition]) => {\n const lucidDefinitions = this.$getComputed(propertyKey)\n if (!lucidDefinitions) return\n const resourcefulModelComputedAccessorMetaSchema: ResourcefulModelComputedAccessorMetaSchema =\n {\n propertyKey,\n definition: computedAccessorDefinition,\n lucidDefinitions,\n ...(await this.$getPropertyCanReadWrite(\n ctx,\n app,\n propertyKey,\n lucidDefinitions,\n computedAccessorDefinition.readAccessControlFilters,\n computedAccessorDefinition.writeAccessControlFilters,\n 'computedAccessor',\n computedAccessorDefinition.writable\n )),\n kind: 'computedAccessor',\n validator: this.$getPropertyValidator(\n ctx,\n app,\n propertyKey,\n computedAccessorDefinition.type,\n computedAccessorDefinition.nullable,\n computedAccessorDefinition.validationScopes as any,\n 'computedAccessor',\n computedAccessorDefinition.writable\n ),\n }\n if (\n !resourcefulModelComputedAccessorMetaSchema.canRead &&\n !resourcefulModelComputedAccessorMetaSchema.canWrite\n )\n return\n resourcefulModelMetaSchema.properties[propertyKey] =\n resourcefulModelComputedAccessorMetaSchema\n },\n {\n concurrency: validatedOptions.advanced.propertyEvaluationConcurrency,\n }\n )\n await pMap(\n Array.from(this.$resourcefulRelationships.entries()),\n async ([propertyKey, relationshipDefinition]) => {\n const lucidDefinitions = this.$getRelation(propertyKey)\n if (!lucidDefinitions) return\n const resourcefulModelRelationshipMetaSchema: ResourcefulModelRelationshipMetaSchema = {\n propertyKey,\n definition: relationshipDefinition,\n lucidDefinitions,\n ...(await this.$getPropertyCanReadWrite(\n ctx,\n app,\n propertyKey,\n lucidDefinitions,\n relationshipDefinition.readAccessControlFilters,\n relationshipDefinition.writeAccessControlFilters,\n 'relationship'\n )),\n kind: 'relationship',\n validator: joi.forbidden(),\n relatedModel: relationshipDefinition.relatedModel,\n }\n if (\n !resourcefulModelRelationshipMetaSchema.canRead &&\n !resourcefulModelRelationshipMetaSchema.canWrite\n )\n return\n resourcefulModelMetaSchema.properties[propertyKey] =\n resourcefulModelRelationshipMetaSchema\n },\n {\n concurrency: validatedOptions.advanced.propertyEvaluationConcurrency,\n }\n )\n return resourcefulModelMetaSchema\n }\n\n protected static $getPropertyValidator(\n ctx: HttpContext,\n app: ApplicationService,\n key: string,\n datatype: ResourcefulDataType,\n nullable: boolean,\n validationScopes: ValidationScoper<AnySchema>[] | undefined,\n kind: 'column' | 'computedAccessor' | 'relationship',\n writable: boolean = false\n ): AnySchema {\n if ('relationship' === kind || ('computedAccessor' === kind && !writable)) {\n // relationships and read-only computed accessors are not acceptable in a payload\n return joi.any().forbidden()\n }\n const baseValidator = this.$getPropertyBaseValidator(datatype, nullable, kind, writable)\n if (Array.isArray(validationScopes) && validationScopes.length > 0) {\n validationScopes.forEach((validationScope) => {\n try {\n validationScope(baseValidator)\n } catch (err) {\n resourcefulModelEventEmitter.emit(\n 'validation:scope:error',\n err,\n ctx,\n app,\n key,\n datatype\n )\n switch (validatedOptions.onValidationScopeError) {\n case 'bubble':\n throw err\n case 'pass':\n // do nothing, just pass the validation scope\n break\n case 'fail':\n return joi.any().forbidden()\n }\n }\n })\n }\n return baseValidator\n }\n\n protected static $getPropertyBaseValidator(\n datatype: ResourcefulDataType,\n nullable: boolean,\n kind: 'column' | 'computedAccessor' | 'relationship',\n writable: boolean = false\n ): AnySchema {\n if ('relationship' === kind || ('computedAccessor' === kind && !writable)) {\n // relationships and read-only computed accessors are not acceptable in a payload\n return joi.any().forbidden()\n }\n nullable = nullable || ('boolean' === typeof datatype.nullable && datatype.nullable)\n switch (true) {\n case datatype instanceof ResourcefulStringType: {\n const d: ResourcefulStringType = datatype as unknown as ResourcefulStringType\n const r = joi.string().min(d.minLength).max(d.maxLength)\n if (d.pattern) {\n r.pattern(new RegExp(d.pattern))\n }\n if (d.enum) {\n r.valid(...d.enum)\n }\n if (nullable) {\n r.allow(null)\n }\n return r\n }\n case datatype instanceof ResourcefulDateType: {\n /*\n |--------------------------------------------------------------------------\n | Dates are a subset of the 'string' type and thus the OpenAPI validator\n | does not have any specific options for them.\n |--------------------------------------------------------------------------\n |\n | const d: ResourcefulDateType = datatype as unknown as ResourcefulDateType\n |\n */\n const r = joi.date().iso()\n if (nullable) {\n r.allow(null)\n }\n return r\n }\n case datatype instanceof ResourcefulDateTimeType: {\n /*\n |--------------------------------------------------------------------------\n | DateTimes are a subset of the 'string' type and thus the OpenAPI validator\n | does not have any specific options for them.\n |--------------------------------------------------------------------------\n |\n | const d: ResourcefulDateTimeType = datatype as unknown as ResourcefulDateTimeType\n |\n */\n const r = joi.date().iso()\n if (nullable) {\n r.allow(null)\n }\n return r\n }\n case datatype instanceof ResourcefulBinaryType: {\n const d: ResourcefulBinaryType = datatype as unknown as ResourcefulBinaryType\n const r = joi.string()\n if (nullable) {\n r.allow(null)\n }\n if (d.minLength !== undefined) {\n r.min(d.minLength)\n }\n if (d.maxLength !== undefined) {\n r.max(d.maxLength)\n }\n return r\n }\n case datatype instanceof ResourcefulNumberType: {\n const d: ResourcefulNumberType = datatype as unknown as ResourcefulNumberType\n const r = joi.number()\n if (nullable) {\n r.allow(null)\n }\n r.multiple(d.multipleOf)\n if (d.exclusiveMaximum) {\n r.less(d.maximum)\n } else {\n r.max(d.maximum)\n }\n if (d.exclusiveMinimum) {\n r.greater(d.minimum)\n } else {\n r.min(d.minimum)\n }\n return r\n }\n case datatype instanceof ResourcefulIntegerType: {\n const d: ResourcefulIntegerType = datatype as unknown as ResourcefulIntegerType\n const r = joi.number()\n if (nullable) {\n r.allow(null)\n }\n r.integer().multiple(d.multipleOf)\n if (d.exclusiveMaximum) {\n r.less(d.maximum)\n } else {\n r.max(d.maximum)\n }\n if (d.exclusiveMinimum) {\n r.greater(d.minimum)\n } else {\n r.min(d.minimum)\n }\n return r\n }\n case datatype instanceof ResourcefulBigintType: {\n const d: ResourcefulBigintType = datatype as unknown as ResourcefulBigintType\n const r = joi.bigint()\n if (nullable) {\n r.allow(null)\n }\n r.multiple(d.multipleOf)\n if (d.exclusiveMaximum) {\n r.less(d.maximum)\n } else {\n r.max(d.maximum)\n }\n if (d.exclusiveMinimum) {\n r.greater(d.minimum)\n } else {\n r.min(d.minimum)\n }\n return r\n }\n case datatype instanceof ResourcefulUnsignedIntegerType: {\n const d: ResourcefulUnsignedIntegerType =\n datatype as unknown as ResourcefulUnsignedIntegerType\n const r = joi.number().unsafe()\n if (nullable) {\n r.allow(null)\n }\n r.integer().multiple(d.multipleOf)\n if (d.exclusiveMaximum) {\n r.less(d.maximum)\n } else {\n r.max(d.maximum)\n }\n if (d.exclusiveMinimum) {\n r.greater(d.minimum)\n } else {\n r.min(d.minimum)\n }\n return r\n }\n case datatype instanceof ResourcefulBooleanType: {\n const r = joi.boolean()\n if (nullable) {\n r.allow(null)\n }\n return r\n }\n case datatype instanceof ResourcefulObjectType: {\n const d: ResourcefulObjectType = datatype as unknown as ResourcefulObjectType\n\n // Add property validation based on the new structure with composition patterns\n const objectSchema: { [key: string]: AnySchema } = {}\n\n Object.entries(d.properties).forEach(([propKey, propDef]) => {\n let propValidator: AnySchema\n\n if ('oneOf' in propDef) {\n // oneOf composition\n const alternatives = propDef.oneOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n propValidator = joi.alternatives().try(...alternatives)\n } else if ('allOf' in propDef) {\n // allOf composition\n const schemas = propDef.allOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n propValidator = schemas.reduce((acc, schema) => acc.concat(schema), joi.any())\n } else if ('anyOf' in propDef) {\n // anyOf composition\n const alternatives = propDef.anyOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n propValidator = joi.alternatives().try(...alternatives)\n } else if ('not' in propDef) {\n // not composition\n const notSchemas = propDef.not.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n propValidator = joi.any().not(...notSchemas)\n } else {\n // Direct ResourcefulDataType\n propValidator = this.$getPropertyBaseValidator(\n propDef,\n propDef.nullable || false,\n kind,\n !(propDef.readOnly || false)\n )\n }\n\n // Check if this field should be required\n if (d.required && d.required.includes(propKey)) {\n propValidator.required()\n }\n\n objectSchema[propKey] = propValidator\n })\n const r = joi.object(objectSchema)\n if (nullable) {\n r.allow(null)\n }\n\n if (d.minProperties !== undefined) {\n r.min(d.minProperties)\n }\n\n if (d.maxProperties !== undefined) {\n r.max(d.maxProperties)\n }\n\n if (guards.isObject(d.additionalProperties)) {\n const additionalPropertiesType = d.additionalProperties as ResourcefulDataType\n r.pattern(\n joi.string(),\n this.$getPropertyBaseValidator(\n additionalPropertiesType,\n additionalPropertiesType.nullable || false,\n kind,\n !(additionalPropertiesType.readOnly || false)\n )\n )\n } else {\n r.unknown(true === d.additionalProperties)\n }\n\n return r\n }\n case datatype instanceof ResourcefulArrayType: {\n const d: ResourcefulArrayType = datatype as unknown as ResourcefulArrayType\n const r = joi.array()\n if (nullable) {\n r.allow(null)\n }\n // Handle different item type structures\n let itemValidator: AnySchema\n if ('oneOf' in d.items) {\n // oneOf composition\n const alternatives = d.items.oneOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n itemValidator = joi.alternatives().try(...alternatives)\n } else if ('allOf' in d.items) {\n // allOf composition\n const schemas = d.items.allOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n itemValidator = schemas.reduce((acc, schema) => acc.concat(schema), joi.any())\n } else if ('anyOf' in d.items) {\n // anyOf composition\n const alternatives = d.items.anyOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n itemValidator = joi.alternatives().try(...alternatives)\n } else if ('not' in d.items) {\n // not composition\n const notSchemas = d.items.not.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n itemValidator = joi.any().not(...notSchemas)\n } else {\n // Direct ResourcefulDataType\n itemValidator = this.$getPropertyBaseValidator(\n d.items,\n d.items.nullable || false,\n kind,\n !(d.items.readOnly || false)\n )\n }\n r.items(itemValidator)\n if (d.minItems !== undefined) {\n r.min(d.minItems)\n }\n if (d.maxItems !== undefined) {\n r.max(d.maxItems)\n }\n if (d.uniqueItems) {\n r.unique()\n }\n return r\n }\n default:\n return joi.any().forbidden()\n }\n }\n\n protected static async $getPropertyCanReadWrite(\n ctx: HttpContext,\n app: ApplicationService,\n key: string,\n lucidDefinition:\n | ModelColumnOptions\n | ComputedOptions\n | ReturnType<LucidModel['$getRelation']>,\n readAclFilters: ResourcefulAccessControlFilter[] = [],\n writeAclFilters: ResourcefulAccessControlFilter[] = [],\n kind: 'column' | 'computedAccessor' | 'relationship',\n writable: boolean = false\n ): Promise<{ canRead: boolean; canWrite: boolean }> {\n const fieldKey = getFieldKey(key, lucidDefinition)\n if (null === fieldKey) {\n // if the field key is null, that means that the field cannot be \"read\"\n // this is part of the baseline lucid decorator API, so we need to honor the\n // expected behavior\n if (validatedOptions.readRequiredForWrite) {\n return { canRead: false, canWrite: false }\n }\n }\n const canRead =\n null === fieldKey ? false : await this.$evaluatePropertyAccess(ctx, app, readAclFilters)\n const canWrite =\n 'relationship' === kind || ('computedAccessor' === kind && !writable)\n ? false\n : await this.$evaluatePropertyAccess(\n ctx,\n app,\n writeAclFilters.length > 0 ? writeAclFilters : readAclFilters\n )\n return { canRead, canWrite }\n }\n\n protected static async $evaluatePropertyAccess(\n ctx: HttpContext,\n app: ApplicationService,\n acls: ResourcefulAccessControlFilter[] = []\n ): Promise<boolean> {\n if (acls.length === 0) {\n return true\n }\n const results = await pMap(\n acls,\n async (acl) => {\n try {\n return await acl(ctx, app)\n } catch (err) {\n resourcefulModelEventEmitter.emit('acl:error', err, ctx, app, undefined)\n switch (validatedOptions.onACLError) {\n case 'pass':\n return true\n case 'fail':\n return false\n default:\n throw err\n }\n }\n },\n {\n concurrency: validatedOptions.advanced.aclEvaluationConcurrency,\n }\n )\n return results.every((result) => result === true)\n }\n\n static async $asOpenApiSchemaObject(\n ctx: HttpContext,\n app: ApplicationService\n ): Promise<ResourcefulModelOpenApiSchema> {\n const resourcefulModelMetaSchema: ResourcefulModelMetaSchema =\n await this.$getAsResourcefulForContext(ctx, app)\n const ret: ResourcefulModelOpenApiSchema = {\n type: 'object',\n title: resourcefulModelMetaSchema.name,\n description: resourcefulModelMetaSchema.description,\n externalDocs: resourcefulModelMetaSchema.externalDocs,\n example: resourcefulModelMetaSchema.example,\n properties: {},\n }\n Object.entries(resourcefulModelMetaSchema.properties).forEach(\n ([propertyKey, propertyMeta]) => {\n switch (propertyMeta.kind) {\n case 'column': {\n ret.properties![propertyKey] = this.$resourcefulModelColumnMetaToOpenApiSchema(\n propertyKey,\n propertyMeta as ResourcefulModelColumnMetaSchema\n )\n return\n }\n case 'computedAccessor': {\n ret.properties![propertyKey] =\n this.$resourcefulModelComputedAccessorMetaToOpenApiSchema(\n propertyKey,\n propertyMeta as ResourcefulModelComputedAccessorMetaSchema\n )\n return\n }\n case 'relationship': {\n const relatedSchema = this.$resourcefulModelRelationshipMetaToOpenApiSchema(\n propertyKey,\n propertyMeta as ResourcefulModelRelationshipMetaSchema\n )\n if (relatedSchema) {\n ret.properties![propertyKey] = relatedSchema\n }\n return\n }\n }\n }\n )\n const requiredPropSet: Set<string> = new Set()\n Object.entries(ret.properties!).forEach(([propertyKey, schema]) => {\n if (\n !guards.isObject(schema) ||\n '$ref' in schema ||\n !('nullable' in schema) ||\n schema.nullable\n )\n return\n requiredPropSet.add(propertyKey)\n })\n ret.required = Array.from(requiredPropSet)\n return ret\n }\n\n protected static $getDefaultValueFromPropertyMeta(\n propertyMeta: ResourcefulModelColumnMetaSchema | ResourcefulModelComputedAccessorMetaSchema\n ): any | undefined {\n const joiDescription = propertyMeta.validator.describe()\n if (\n guards.isObject(joiDescription) &&\n 'flags' in joiDescription &&\n guards.isObject(joiDescription.flags) &&\n 'default' in joiDescription.flags\n ) {\n return joiDescription.flags.default\n }\n }\n\n protected static $resourcefulModelColumnMetaToOpenApiSchema(\n propertyKey: string,\n propertyMeta: ResourcefulModelColumnMetaSchema\n ): ResourcefulModelOpenApiSchema {\n const ret: ResourcefulModelOpenApiSchema = helpers.stripUndefinedValuesFromObject({\n items: (propertyMeta.definition as any).items,\n title: getFieldKey(propertyKey, propertyMeta.lucidDefinitions) || propertyKey,\n description: propertyMeta.definition.description,\n format: (propertyMeta.definition as any).format,\n default: this.$getDefaultValueFromPropertyMeta(propertyMeta),\n multipleOf: (propertyMeta.definition as any).multipleOf,\n maximum: (propertyMeta.definition as any).maximum,\n exclusiveMaximum: (propertyMeta.definition as any).exclusiveMaximum,\n minimum: (propertyMeta.definition as any).minimum,\n exclusiveMinimum: (propertyMeta.definition as any).exclusiveMinimum,\n maxLength: (propertyMeta.definition as any).maxLength,\n minLength: (propertyMeta.definition as any).minLength,\n pattern: (propertyMeta.definition as any).pattern,\n additionalProperties: (propertyMeta.definition as any).additionalProperties,\n maxItems: (propertyMeta.definition as any).maxItems,\n minItems: (propertyMeta.definition as any).minItems,\n uniqueItems: (propertyMeta.definition as any).uniqueItems,\n maxProperties: (propertyMeta.definition as any).maxProperties,\n minProperties: (propertyMeta.definition as any).minProperties,\n required: (propertyMeta.definition as any).required,\n enum: (propertyMeta.definition as any).enum,\n properties: (propertyMeta.definition as any).properties,\n allOf: (propertyMeta.definition as any).allOf,\n oneOf: (propertyMeta.definition as any).oneOf,\n anyOf: (propertyMeta.definition as any).anyOf,\n not: (propertyMeta.definition as any).not,\n nullable: (propertyMeta.definition as any).nullable,\n readOnly: propertyMeta.canRead && !propertyMeta.canWrite,\n writeOnly: !propertyMeta.canRead && propertyMeta.canWrite,\n externalDocs: propertyMeta.definition.externalDocs,\n example: propertyMeta.definition.example,\n ...(propertyMeta.definition.type as any),\n })\n return ret\n }\n\n protected static $resourcefulModelComputedAccessorMetaToOpenApiSchema(\n propertyKey: string,\n propertyMeta: ResourcefulModelComputedAccessorMetaSchema\n ): ResourcefulModelOpenApiSchema {\n const ret: ResourcefulModelOpenApiSchema = helpers.stripUndefinedValuesFromObject({\n items: (propertyMeta.definition as any).items,\n title: getFieldKey(propertyKey, propertyMeta.lucidDefinitions) || propertyKey,\n description: propertyMeta.definition.description,\n format: (propertyMeta.definition as any).format,\n default: this.$getDefaultValueFromPropertyMeta(propertyMeta),\n multipleOf: (propertyMeta.definition as any).multipleOf,\n maximum: (propertyMeta.definition as any).maximum,\n exclusiveMaximum: (propertyMeta.definition as any).exclusiveMaximum,\n minimum: (propertyMeta.definition as any).minimum,\n exclusiveMinimum: (propertyMeta.definition as any).exclusiveMinimum,\n maxLength: (propertyMeta.definition as any).maxLength,\n minLength: (propertyMeta.definition as any).minLength,\n pattern: (propertyMeta.definition as any).pattern,\n additionalProperties: (propertyMeta.definition as any).additionalProperties,\n maxItems: (propertyMeta.definition as any).maxItems,\n minItems: (propertyMeta.definition as any).minItems,\n uniqueItems: (propertyMeta.definition as any).uniqueItems,\n maxProperties: (propertyMeta.definition as any).maxProperties,\n minProperties: (propertyMeta.definition as any).minProperties,\n required: (propertyMeta.definition as any).required,\n enum: (propertyMeta.definition as any).enum,\n properties: (propertyMeta.definition as any).properties,\n allOf: (propertyMeta.definition as any).allOf,\n oneOf: (propertyMeta.definition as any).oneOf,\n anyOf: (propertyMeta.definition as any).anyOf,\n not: (propertyMeta.definition as any).not,\n nullable: (propertyMeta.definition as any).nullable,\n readOnly: propertyMeta.canRead && !propertyMeta.canWrite,\n writeOnly: !propertyMeta.canRead && propertyMeta.canWrite,\n externalDocs: propertyMeta.definition.externalDocs,\n example: propertyMeta.definition.example,\n ...(propertyMeta.definition.type as any),\n })\n return ret\n }\n\n protected static $resourcefulModelRelationshipMetaToOpenApiSchema(\n _propertyKey: string,\n propertyMeta: ResourcefulModelRelationshipMetaSchema\n ): ResourcefulModelOpenApiRelatedSchema | undefined {\n const relatedModel = propertyMeta.relatedModel()\n if (!relatedModel) {\n // If the related model is not defined, we cannot generate a schema for it\n return undefined\n }\n if (!guards.isResourcefulModel(relatedModel)) {\n // If the related model is not a ResourcefulModel, we cannot generate a schema for it\n return undefined\n }\n const ref: string = `#/components/schemas/${relatedModel.$resourcefulName}`\n return {\n $ref: ref,\n }\n }\n\n protected static async $resourcefulCheckAccess(\n config: ResourcefulCheckAccessOptions\n ): Promise<ResourcefulCheckAccessReturn> {\n const { ctx, app, operation, instance } = config\n const allowedFieldsMap = new Map<string, boolean>()\n const allowedColumnsMap = new Map<string, boolean>()\n const mixinAccessControlFilters = validatedOptions.accessControlFilters[operation]\n\n if (mixinAccessControlFilters) {\n const mixinAccessControlResult = await Promise.all(\n mixinAccessControlFilters.map((func) => func(ctx, app, instance as any))\n )\n const isAllowedByMixinFilters = mixinAccessControlResult.every(Boolean)\n\n if (!isAllowedByMixinFilters) {\n return {\n isForbidden: true,\n message: 'Access denied by Mixin ACLs.',\n allowedFieldsMap: undefined,\n }\n }\n }\n\n // If the operation is DELETE, we don't check the field-level access\n if (operation === CRUDOperationsEnum.DELETE) {\n return { isForbidden: false, allowedFieldsMap, allowedColumnsMap }\n }\n\n const columnsOptions = this.$resourcefulColumns.values()\n const aclOperation = operationCRUDToACL(operation)\n const addColumnOptionToAllowedFieldsMap = (propertyKey: string) => {\n const serializedName = this.$keys.attributesToSerialized.resolve(propertyKey)\n const columnName = this.$keys.serializedToColumns.resolve(serializedName)\n\n if (serializedName) {\n allowedFieldsMap.set(propertyKey, true)\n }\n\n if (columnName) {\n allowedColumnsMap.set(columnName, true)\n }\n }\n\n for (const columnOptions of columnsOptions) {\n const propertyACLFilters =\n aclOperation === ACLOperationsEnum.READ\n ? columnOptions.readAccessControlFilters\n : columnOptions.writeAccessControlFilters\n\n // If a column has no ACLs - it allowed to everyone\n if (!propertyACLFilters) {\n addColumnOptionToAllowedFieldsMap(columnOptions.propertyKey)\n\n continue\n }\n\n const isAllowed = await this.$evaluatePropertyAccess(ctx, app, propertyACLFilters)\n\n if (isAllowed) {\n addColumnOptionToAllowedFieldsMap(columnOptions.propertyKey)\n }\n }\n\n const hasNoAllowedFields = !allowedFieldsMap.size\n\n if (hasNoAllowedFields) {\n return {\n isForbidden: true,\n message: 'Access denied since user does not has access to at least 1 column.',\n }\n }\n\n return {\n isForbidden: false,\n allowedFieldsMap,\n allowedColumnsMap,\n }\n }\n\n private static $getPrivateKeyAttribute() {\n let ret: string | undefined\n this.$columnsDefinitions.forEach((columnOptions, attribute) => {\n if (\n columnOptions.serializeAs !== null &&\n (columnOptions.isPrimary || columnOptions.columnName === this.primaryKey)\n ) {\n ret = columnOptions.serializeAs || attribute\n }\n })\n return ret\n }\n\n /**\n * Performs paginated listing and searching of model records with comprehensive filtering.\n *\n * This method provides the core implementation for resourceful index/list operations,\n * supporting pagination, field selection, access control, and Lucene query syntax for\n * filtering. It validates all inputs, applies ACL filters, executes the query with\n * proper field mapping between serialized names and database columns, and returns\n * structured results with query metadata.\n *\n * @template SelectedFields - Array of field names that can be selected from the model's serializable attributes\n * @template ReturnType - The resulting type after picking the selected fields from the model's serializable attributes\n *\n * @param filter - Lucene-style query string for filtering records (e.g., \"name:john AND email:*.com\").\n * If null or undefined, defaults to empty string (no filtering).\n * @param page - The page number for pagination (must be ≥ 1). Used with perPage to calculate offset.\n * @param perPage - Number of records per page (must be ≥ 1 and ≤ 100 by default).\n * @param fields - Array of field names to include in the response. If null, undefined, or empty,\n * defaults to just the primary key field. Field names should use serialized names\n * (as they appear in API responses), not database column names.\n * @param ctx - HTTP context containing request information, authentication, and other request-scoped data.\n * @param app - Application service instance providing access to application-level services and configuration.\n * @param hooks - Optional array of query scope callbacks to apply additional filtering constraints.\n *\n * @returns Promise resolving to ResourcefulIndexResult containing:\n * - `records`: Array of partial record objects with only the requested fields\n * - `total`: Total number of records matching the filter (before pagination)\n * - `page`: The requested page number (echoed back)\n * - `perPage`: The requested per-page limit (echoed back)\n * - `countQuery`: SQL query string used for counting total records\n * - `recordsQuery`: SQL query string used for fetching the actual records\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n * @throws {E_INVALID_COLUMN_ACCESS} When no fields are available for access after ACL filtering\n * @throws {E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION} When input validation fails\n *\n * @example\n * ```typescript\n * // Basic usage with pagination\n * const result = await User.$onResourcefulIndex(\n * 'name:john',\n * 1,\n * 10,\n * ['id', 'name', 'email'],\n * ctx,\n * app\n * );\n *\n * // Complex filtering with date ranges\n * const result = await User.$onResourcefulIndex(\n * 'name:john AND createdAt:[2021-01-01T00:00:00Z TO 2021-12-31T23:59:59Z]',\n * 2,\n * 25,\n * ['id', 'name', 'createdAt'],\n * ctx,\n * app\n * );\n * ```\n */\n protected static $formatResourcefulRecord(\n record: Record<string, any>\n ): Partial<ResourcefulModelSerializableAttributes<Model & ResourcefulModel>> {\n const result: Partial<ResourcefulModelSerializableAttributes<Model & ResourcefulModel>> = {}\n\n for (const [key, value] of Object.entries(record)) {\n const serializable = this.$keys.columnsToSerialized.get(key)\n const attribute = this.$keys.columnsToAttributes.get(key)\n\n if (!attribute || !serializable) {\n continue\n }\n\n const opts = this.$getColumn(attribute)\n\n if (!opts) {\n continue\n }\n\n const preparedValue = isFunction(opts.consume)\n ? opts.consume(value, attribute, this as any)\n : value\n\n result[\n serializable as keyof ResourcefulModelSerializableAttributes<Model & ResourcefulModel>\n ] = preparedValue\n }\n\n return result\n }\n\n protected static async $validatePayloadWithValidationGetters(\n ctx: HttpContext,\n app: ApplicationService,\n payload: unknown,\n validationGetters: ResourcefulPayloadValidatorGetter[]\n ) {\n const schemas = await Promise.all(validationGetters.map((getter) => getter(ctx, app)))\n\n for (const schema of schemas) {\n const { error: schemaError } = schema.validate(payload)\n\n if (schemaError) {\n return schemaError\n }\n }\n\n return null\n }\n\n protected static async $validatePayloadWithPayloadSchemaGetters(\n ctx: HttpContext,\n app: ApplicationService,\n payload: unknown,\n payloadSchemaGetters: ResourcefulPayloadSchemaGetter[]\n ) {\n const resolved = await Promise.all(payloadSchemaGetters.map((getter) => getter(ctx, app)))\n const schemas = resolved.filter((schema) => schema !== null && schema !== undefined)\n\n for (const schema of schemas) {\n const { error: schemaError } = schema.validate(payload)\n\n if (schemaError) {\n return schemaError\n }\n }\n\n return null\n }\n\n protected static $resourcefulGetQueryBuilder() {\n return this.$adapter.modelConstructorClient(this).query().from(this.table)\n }\n\n static async $onResourcefulIndex<\n SelectedFields extends Array<\n keyof ResourcefulModelSerializableAttributes<Model & ResourcefulModel>\n >,\n SelectedSingleField extends keyof ResourcefulModelSerializableAttributes<\n Model & ResourcefulModel\n >,\n ReturnType = Pick<\n ResourcefulModelSerializableAttributes<Model & ResourcefulModel>,\n SelectedFields[number]\n >,\n >(\n filter: string | null | undefined,\n page: number,\n perPage: number,\n fields: SelectedFields | SelectedSingleField | null | undefined,\n sort:\n | Array<\n [\n Extract<\n keyof ResourcefulModelSerializableAttributes<Model & ResourcefulModel>,\n string\n >,\n 'asc' | 'desc',\n ]\n >\n | null\n | undefined,\n ctx: HttpContext,\n app: ApplicationService,\n hooks: ResourcefulScopeHooks = []\n ): Promise<ResourcefulIndexResult<ReturnType>> {\n /*\n |--------------------------------------------------------------------------\n | Normalize inputs\n |--------------------------------------------------------------------------\n */\n const primaryKey = this.$getPrivateKeyAttribute()\n\n if (!primaryKey) {\n throw new E_MISSING_PRIMARY_KEY_EXCEPTION(this.$resourcefulName)\n }\n\n if (!isString(filter)) {\n filter = ''\n }\n\n fields = prepareFields(fields, primaryKey)\n\n /*\n |--------------------------------------------------------------------------\n | Check Access\n |--------------------------------------------------------------------------\n */\n const { isForbidden, allowedFieldsMap, message } = await this.$resourcefulCheckAccess({\n ctx,\n app,\n operation: CRUDOperationsEnum.LIST,\n })\n\n if (isForbidden) {\n throw new E_FORBIDDEN(message)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Validate Request Details\n |--------------------------------------------------------------------------\n */\n const possibleFields = Array.from(allowedFieldsMap.keys())\n if (possibleFields.length === 0) {\n throw new E_INVALID_COLUMN_ACCESS('No fields available for access')\n }\n const schema = joi.object({\n filter: joi.string().allow('').required(),\n page: joi.number().integer().min(1).required(),\n perPage: joi.number().integer().min(1).max(100).required(),\n fields: joi\n .array()\n .items(joi.string().valid(...possibleFields))\n .required(),\n })\n const { error: methodValidationError, value: validatedMethodOptions } = schema.validate(\n {\n filter,\n page,\n perPage,\n fields,\n },\n {\n abortEarly: false,\n }\n )\n if (methodValidationError) {\n throw new E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION(methodValidationError)\n }\n /*\n |--------------------------------------------------------------------------\n | Create the baseline query\n |--------------------------------------------------------------------------\n */\n let query = luceneToLucid(\n validatedMethodOptions.filter,\n this.$adapter.modelConstructorClient(this),\n this.$keys.serializedToColumns,\n primaryKey,\n this.table,\n possibleFields\n )\n /*\n |--------------------------------------------------------------------------\n | Apply Resourceful Query Scope Callbacks\n |--------------------------------------------------------------------------\n */\n for (const scopeCallback of [\n ...(this.$resourcefulQueryScopeCallbacks.list || []),\n ...hooks,\n ]) {\n await scopeCallback(ctx, app, query)\n }\n /*\n |--------------------------------------------------------------------------\n | Split into separate queries for count and results\n |--------------------------------------------------------------------------\n */\n const columnsToSelect = validatedMethodOptions.fields\n .filter((field: string) => allowedFieldsMap.has(field))\n .map((field: string) => this.$keys.serializedToColumns.get(field))\n const countQuery = query.clone<{ total: number }>()\n const recordsQuery = query.clone()\n\n countQuery.count('*', 'total')\n recordsQuery\n .select(columnsToSelect)\n .forPage(validatedMethodOptions.page, validatedMethodOptions.perPage)\n\n if (Array.isArray(sort) && sort.length > 0) {\n sort.forEach(([field, direction]) => {\n if (allowedFieldsMap.has(field)) {\n recordsQuery.orderBy(field, direction)\n }\n })\n }\n\n const countQueryQuery = countQuery.toQuery()\n const recordsQueryQuery = recordsQuery.toQuery()\n /*\n |--------------------------------------------------------------------------\n | Retrieve raw results\n |--------------------------------------------------------------------------\n */\n const [countResults, rawRecords] = await Promise.all([countQuery, recordsQuery])\n const totalRaw = Number(countResults?.[0]?.total)\n\n /*\n |--------------------------------------------------------------------------\n | Return results\n |--------------------------------------------------------------------------\n */\n return {\n total: Number.isNaN(totalRaw) ? 0 : totalRaw,\n page: validatedMethodOptions.page,\n perPage: validatedMethodOptions.perPage,\n records: rawRecords.map((record) =>\n this.$formatResourcefulRecord(record)\n ) as Partial<ReturnType>[],\n countQuery: countQueryQuery,\n recordsQuery: recordsQueryQuery,\n }\n }\n\n /**\n * Retrieves a single model record by its unique identifier with access control.\n *\n * This method implements secure record retrieval by first applying query scope callbacks\n * to verify the record exists within the user's access scope, then fetching the full\n * model instance for field-level ACL evaluation. Only fields that pass ACL checks\n * are included in the response.\n *\n * The dual-fetch pattern ensures security: the first query applies scoping constraints\n * to verify access, while the second query retrieves the full model for ACL evaluation.\n *\n * @param uid - The unique identifier of the record to retrieve\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional array of query scope callbacks to apply additional filtering constraints\n *\n * @returns Promise resolving to the record object with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n */\n static async $onResourcefulRead(\n uid: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks: ResourcefulScopeHooks = []\n ): Promise<ResourcefulModelSerializableAttributes<Model & ResourcefulModel>> {\n /*\n |--------------------------------------------------------------------------\n | Normalize inputs\n |--------------------------------------------------------------------------\n */\n const primaryKey = this.$getPrivateKeyAttribute()\n\n if (!primaryKey) {\n throw new E_MISSING_PRIMARY_KEY_EXCEPTION(this.$resourcefulName)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Check Access\n |--------------------------------------------------------------------------\n */\n const query = this.$resourcefulGetQueryBuilder()\n\n const allScopeCallbacks = [...(this.$resourcefulQueryScopeCallbacks.list || []), ...hooks]\n\n for (const scopeCallback of allScopeCallbacks) {\n await scopeCallback(ctx, app, query)\n }\n\n const recordRaw = await query.where(this.primaryKey, uid).select(this.primaryKey).first()\n\n if (!recordRaw) {\n throw new E_RECORD_NOT_FOUND_EXCEPTION()\n }\n\n const rid = recordRaw[this.primaryKey]\n\n const record = await this.query().where(this.primaryKey, rid).first()\n if (!record) {\n throw new E_RECORD_NOT_FOUND_EXCEPTION()\n }\n\n const { isForbidden, allowedFieldsMap, message } = await this.$resourcefulCheckAccess({\n ctx,\n app,\n instance: record,\n operation: CRUDOperationsEnum.READ,\n })\n\n if (isForbidden) {\n throw new E_FORBIDDEN(message)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Format and return the result\n |--------------------------------------------------------------------------\n */\n\n const recordObject = record.toObject()\n\n const recordObjectWithAllowedFields: Partial<ModelObject> = {}\n\n for (const [key, value] of Object.entries(recordObject)) {\n if (allowedFieldsMap.has(key)) {\n recordObjectWithAllowedFields[key] = value\n }\n }\n\n return recordObjectWithAllowedFields as ResourcefulModelSerializableAttributes<\n Model & ResourcefulModel\n >\n }\n\n /**\n * Creates a new model record with payload validation and access control.\n *\n * This method handles secure record creation by validating the request payload\n * against both model-level and request-specific validation schemas, checking\n * field-level write permissions, and returning the created record with appropriate\n * field filtering applied via the read operation.\n *\n * @param payload - The data object containing field values for the new record\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional array of validation schema getters for additional payload validation\n *\n * @returns Promise resolving to the created record with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_INVALID_PAYLOAD_EXCEPTION} When core model validation fails\n * @throws {E_FORBIDDEN_PAYLOAD_EXCEPTION} When request-specific validation fails\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n */\n static async $onResourcefulCreate(\n payload: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks: ResourcefulValidationHooks = []\n ): Promise<ResourcefulModelSerializableAttributes<Model & ResourcefulModel>> {\n /*\n |--------------------------------------------------------------------------\n | Normalize inputs\n |--------------------------------------------------------------------------\n */\n const primaryKey = this.$getPrivateKeyAttribute()\n\n if (!primaryKey) {\n throw new E_MISSING_PRIMARY_KEY_EXCEPTION(this.$resourcefulName)\n }\n /*\n |--------------------------------------------------------------------------\n | Check Access\n |--------------------------------------------------------------------------\n */\n const payloadValidatorGetters = [...(options.payloadValidationSchemaBuilders?.create || [])]\n const [payloadValidatorGettersError, payloadSchemaGettersError] = await Promise.all([\n this.$validatePayloadWithValidationGetters(ctx, app, payload, payloadValidatorGetters),\n this.$validatePayloadWithPayloadSchemaGetters(ctx, app, payload, hooks),\n ])\n\n if (payloadValidatorGettersError || payloadSchemaGettersError) {\n if (payloadValidatorGettersError) {\n throw new E_INVALID_PAYLOAD_EXCEPTION(payloadValidatorGettersError)\n }\n if (payloadSchemaGettersError) {\n throw new E_FORBIDDEN_PAYLOAD_EXCEPTION(payloadSchemaGettersError)\n }\n }\n\n const { isForbidden, allowedFieldsMap, message } = await this.$resourcefulCheckAccess({\n ctx,\n app,\n operation: CRUDOperationsEnum.CREATE,\n })\n\n if (isForbidden) {\n throw new E_FORBIDDEN(message)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Validate and prepare payload\n |--------------------------------------------------------------------------\n */\n const preparedPayload: Record<string, any> = {}\n\n // Only process fields that are allowed by ACL\n for (const [key, value] of Object.entries(payload)) {\n const attribute = this.$keys.serializedToAttributes.get(key)\n const isValueNull = value === null || value === undefined\n\n if (!attribute) {\n continue\n }\n\n if (!isValueNull && !allowedFieldsMap.has(attribute)) {\n throw new E_FORBIDDEN(`User does not has write access to field ${attribute}.`)\n }\n\n preparedPayload[attribute] = value\n }\n\n /*\n |--------------------------------------------------------------------------\n | Create the record\n |--------------------------------------------------------------------------\n */\n const newRecord = await this.create(preparedPayload as InstanceType<Model>)\n\n /*\n |--------------------------------------------------------------------------\n | Format and return the result\n |--------------------------------------------------------------------------\n */\n\n // Call inner Read method to honor Read ACL\n return await this.$onResourcefulRead(newRecord.$getAttribute(primaryKey), ctx, app)\n }\n\n /**\n * Updates an existing model record with payload validation and access control.\n *\n * This method implements secure record updates by first verifying the record exists\n * and is accessible via the read operation, validating the update payload against both\n * model-level and request-specific schemas, checking field-level write permissions,\n * and returning the updated record with appropriate field filtering applied.\n *\n * The method reuses $onResourcefulRead for consistent access control and scoping logic.\n *\n * @param uid - The unique identifier of the record to update\n * @param payload - The data object containing field values to update\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional object containing query scope callbacks and validation schema getters\n *\n * @returns Promise resolving to the updated record with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_INVALID_PAYLOAD_EXCEPTION} When core model validation fails\n * @throws {E_FORBIDDEN_PAYLOAD_EXCEPTION} When request-specific validation fails\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n */\n static async $onResourcefulUpdate(\n uid: any,\n payload: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks: Partial<ResourcefulHooks> = {}\n ): Promise<ResourcefulModelSerializableAttributes<Model & ResourcefulModel>> {\n /*\n |--------------------------------------------------------------------------\n | Normalize inputs\n |--------------------------------------------------------------------------\n */\n const primaryKey = this.$getPrivateKeyAttribute()\n\n if (!primaryKey) {\n throw new E_MISSING_PRIMARY_KEY_EXCEPTION(this.$resourcefulName)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Check Access & Find the existing record\n |--------------------------------------------------------------------------\n */\n const payloadValidatorGetters = [...(options.payloadValidationSchemaBuilders?.update || [])]\n const [payloadValidatorGettersError, payloadSchemaGettersError] = await Promise.all([\n this.$validatePayloadWithValidationGetters(ctx, app, payload, payloadValidatorGetters),\n this.$validatePayloadWithPayloadSchemaGetters(\n ctx,\n app,\n payload,\n hooks.payloadValidationSchemas || []\n ),\n ])\n\n if (payloadValidatorGettersError || payloadSchemaGettersError) {\n if (payloadValidatorGettersError) {\n throw new E_INVALID_PAYLOAD_EXCEPTION(payloadValidatorGettersError)\n }\n if (payloadSchemaGettersError) {\n throw new E_FORBIDDEN_PAYLOAD_EXCEPTION(payloadSchemaGettersError)\n }\n }\n\n // Attempt to load the existing record via $onResourcefulRead in order to\n // prevent duplicating the scoping logic\n await this.$onResourcefulRead(uid, ctx, app, hooks.queryScopeCallbacks || [])\n\n // Refetching record using model to update with it later\n const record = await this.query().where(primaryKey, uid).first()\n if (!record) {\n throw new E_RECORD_NOT_FOUND_EXCEPTION()\n }\n\n const { isForbidden, allowedFieldsMap, message } = await this.$resourcefulCheckAccess({\n ctx,\n app,\n instance: record,\n operation: CRUDOperationsEnum.UPDATE,\n })\n\n if (isForbidden) {\n throw new E_FORBIDDEN(message)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Prepare payload\n |--------------------------------------------------------------------------\n */\n const preparedPayload: Record<string, any> = {}\n\n // Only process fields that are allowed by ACL\n for (const [key, value] of Object.entries(payload)) {\n const attribute = this.$keys.serializedToAttributes.get(key)\n const isValueNull = value === null || value === undefined\n\n if (!attribute) {\n continue\n }\n\n if (!isValueNull && !allowedFieldsMap.has(attribute)) {\n throw new E_FORBIDDEN(`User does not has write access to field ${attribute}.`)\n }\n\n preparedPayload[attribute] = value\n }\n\n /*\n |--------------------------------------------------------------------------\n | Update the record\n |--------------------------------------------------------------------------\n */\n\n record.merge(preparedPayload as Partial<InstanceType<Model>>)\n\n await record.save()\n\n /*\n |--------------------------------------------------------------------------\n | Format and return the result\n |--------------------------------------------------------------------------\n */\n\n // Call inner Read method to honor Read ACL\n return this.$onResourcefulRead(uid, ctx, app)\n }\n\n /**\n * Deletes an existing model record with verification and access control.\n *\n * This method securely deletes records by first verifying the record exists\n * and is accessible via the read operation, then checking model-level deletion\n * permissions before executing the deletion. Returns the record as it existed\n * before deletion with appropriate field filtering applied.\n *\n * The method reuses $onResourcefulRead for consistent access control and scoping logic.\n *\n * @param uid - The unique identifier of the record to delete\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional object containing query scope callbacks\n *\n * @returns Promise resolving to the deleted record as it existed before deletion\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_FORBIDDEN} When access is denied by model-level access control filters\n */\n static async $onResourcefulDelete(\n uid: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks: ResourcefulScopeHooks = []\n ): Promise<void> {\n /*\n |--------------------------------------------------------------------------\n | Normalize inputs\n |--------------------------------------------------------------------------\n */\n const primaryKey = this.$getPrivateKeyAttribute()\n\n if (!primaryKey) {\n throw new E_MISSING_PRIMARY_KEY_EXCEPTION(this.$resourcefulName)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Find the existing record for access check\n |--------------------------------------------------------------------------\n */\n const query = this.$resourcefulGetQueryBuilder()\n\n for (const scopeCallback of [\n ...(this.$resourcefulQueryScopeCallbacks.access || []),\n ...hooks,\n ]) {\n await scopeCallback(ctx, app, query)\n }\n\n const rawRecord = await query.where(primaryKey, uid).first()\n\n if (!rawRecord) {\n throw new E_RECORD_NOT_FOUND_EXCEPTION()\n }\n\n const record = new this().merge(this.$formatResourcefulRecord(rawRecord))\n\n /*\n |--------------------------------------------------------------------------\n | Check Access\n |--------------------------------------------------------------------------\n */\n const { isForbidden, message } = await this.$resourcefulCheckAccess({\n ctx,\n app,\n instance: record,\n operation: CRUDOperationsEnum.DELETE,\n })\n\n if (isForbidden) {\n throw new E_FORBIDDEN(message)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Delete the record\n |--------------------------------------------------------------------------\n */\n\n await record.delete()\n }\n }\n Object.defineProperty(ResourcefulModel, '$resourcefulName', {\n value: validatedOptions.name,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulMetaDescription', {\n value: validatedOptions.description,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulMetaExternalDocs', {\n value: validatedOptions.externalDocs,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulMetaExample', {\n value: validatedOptions.example,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulAccessControlFilters', {\n value: validatedOptions.accessControlFilters,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulOnACLError', {\n value: validatedOptions.onACLError,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulQueryScopeCallbacks', {\n value: validatedOptions.queryScopeCallbacks || { list: [], access: [] },\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulPayloadValidationSchemaBuilders', {\n value: validatedOptions.payloadValidationSchemaBuilders || { create: [], update: [] },\n writable: false,\n enumerable: true,\n configurable: false,\n })\n return ResourcefulModel\n }\n}\n","/*\n|--------------------------------------------------------------------------\n| Prepare/Consume Chain Builder\n|--------------------------------------------------------------------------\n|\n| Utility for chaining prepare and consume functions in resourceful decorators.\n| This allows combining default decorator behavior with custom logic in a\n| predictable order while maintaining proper error handling.\n|\n*/\n\n/**\n * Function types for prepare and consume operations\n */\nexport type CustomPrepareFunction = (value: unknown) => unknown\nexport type CustomConsumeFunction = (value: unknown) => unknown\nexport type DefaultPrepareFunction<T = unknown> = (\n key: string,\n value: unknown,\n nullable?: boolean\n) => T\nexport type DefaultConsumeFunction<T = unknown> = (\n key: string,\n value: unknown,\n nullable?: boolean\n) => T\n\n/**\n * Utility class for building chained prepare and consume functions.\n *\n * The chaining order reflects the data flow:\n * - Prepare chain: Default → Custom (data flows TO database)\n * - Consume chain: Custom → Default (data flows FROM database)\n */\nexport class PrepareConsumeChainBuilder {\n /**\n * Creates a chained prepare function that calls default first, then custom.\n *\n * @param propertyKey - The property name for error context\n * @param nullable - Whether the field accepts null values\n * @param defaultPrepare - The default prepare function from decorator\n * @param customPrepare - The custom prepare function from options\n * @returns A chained prepare function or undefined if no functions provided\n */\n static chainPrepare<T>(\n propertyKey: string,\n nullable: boolean,\n defaultPrepare?: DefaultPrepareFunction<T> | undefined,\n customPrepare?: CustomPrepareFunction | undefined\n ): CustomPrepareFunction | undefined {\n // If neither function is provided, return undefined\n if (!defaultPrepare && !customPrepare) {\n return undefined\n }\n\n // If only custom function is provided, return it directly\n if (!defaultPrepare && customPrepare) {\n return customPrepare\n }\n\n // If only default function is provided, wrap it to match signature\n if (defaultPrepare && !customPrepare) {\n return (value: unknown) => defaultPrepare(propertyKey, value, nullable)\n }\n\n // Both functions provided - chain them: default → custom\n return (value: unknown) => {\n const defaultResult = defaultPrepare!(propertyKey, value, nullable)\n\n return customPrepare!(defaultResult)\n }\n }\n\n /**\n * Creates a chained consume function that calls custom first, then default.\n *\n * @param propertyKey - The property name for error context\n * @param nullable - Whether the field accepts null values\n * @param defaultConsume - The default consume function from decorator\n * @param customConsume - The custom consume function from options\n * @returns A chained consume function or undefined if no functions provided\n */\n static chainConsume<T>(\n propertyKey: string,\n nullable: boolean,\n defaultConsume?: DefaultConsumeFunction<T>,\n customConsume?: CustomConsumeFunction\n ): CustomConsumeFunction | undefined {\n // If neither function is provided, return undefined\n if (!defaultConsume && !customConsume) {\n return undefined\n }\n\n // If only custom function is provided, return it directly\n if (!defaultConsume && customConsume) {\n return customConsume\n }\n\n // If only default function is provided, wrap it to match signature\n if (defaultConsume && !customConsume) {\n return (value: unknown) => defaultConsume(propertyKey, value, nullable)\n }\n\n // Both functions provided - chain them: custom → default\n return (value: unknown) => {\n const customResult = customConsume!(value)\n\n return defaultConsume!(propertyKey, customResult, nullable)\n }\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { createError, Exception } from '@poppinss/utils';\nexport const E_INVALID_DATE_COLUMN_VALUE = createError('Invalid value for \"%s\". %s', 'E_INVALID_DATE_COLUMN_VALUE', 500);\nexport const E_UNMANAGED_DB_CONNECTION = createError('Cannot connect to unregistered connection %s', 'E_UNMANAGED_DB_CONNECTION', 500);\nexport const E_MISSING_MODEL_ATTRIBUTE = createError('Relation \"%s\" expects \"%s\" to exist on \"%s\" model, but is missing. Did you forget to define the column?', 'E_MISSING_MODEL_ATTRIBUTE', 500);\nexport const E_INCOMPLETE_REPLICAS_CONFIG = createError('Make sure to define read/write replicas or use connection property', 'E_INCOMPLETE_REPLICAS_CONFIG', 500);\nexport const E_INVALID_REPLICAS_CONFIG = createError('Make sure to define connection property inside read/write replicas', 'E_INVALID_REPLICAS_CONFIG', 500);\nexport const E_MODEL_DELETED = createError('Cannot mutate delete model instance', 'E_MODEL_DELETED', 500);\n/**\n * The \"E_ROW_NOT_FOUND\" exception is raised when\n * no row is found in a database single query\n *\n * The \"error.model\" can be used to know the model which\n * raised the error. This will only be present when using\n * Lucid models not Database queries\n */\nexport const E_ROW_NOT_FOUND = class extends Exception {\n static status = 404;\n static code = 'E_ROW_NOT_FOUND';\n static message = 'Row not found';\n /**\n * The model that raised the error.\n */\n model;\n constructor(model) {\n super();\n this.model = model;\n }\n};\nexport const E_UNABLE_ACQUIRE_LOCK = createError('Unable to acquire lock. Concurrent migrations are not allowed', 'E_UNABLE_ACQUIRE_LOCK', 500);\nexport const E_UNABLE_RELEASE_LOCK = createError('Migration completed, but unable to release database lock', 'E_UNABLE_RELEASE_LOCK', 500);\nexport const E_MISSING_SCHEMA_FILES = createError('Cannot perform rollback. Schema file \"%s\" is missing', 'E_MISSING_SCHEMA_FILES', 500);\nexport const E_UNDEFINED_RELATIONSHIP = createError('\"%s\" is not defined as a relationship on \"%s\" model', 'E_UNDEFINED_RELATIONSHIP', 500);\nexport const E_RUNTIME_EXCEPTION = createError('%s', 'E_RUNTIME_EXCEPTION', 500);\n/**\n * The client is not supported by Lucid\n */\nexport const E_UNSUPPORTED_CLIENT = createError('Unsupported client \"%s\"', 'E_UNSUPPORTED_CLIENT', 500);\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { DateTime } from 'luxon';\nimport * as errors from '../../errors.js';\n/**\n * The method to prepare the date column before persisting it's\n * value to the database\n */\nfunction prepareDateColumn(value, attributeName, modelInstance) {\n /**\n * Return string or missing values as it is. If `auto` is set to true on\n * the column, then the hook will always initialize the date\n */\n if (typeof value === 'string' || !value) {\n return value;\n }\n const modelName = modelInstance.constructor.name;\n /**\n * Format luxon instances to SQL formatted date\n */\n if (DateTime.isDateTime(value)) {\n if (!value.isValid) {\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n value.invalidReason,\n ]);\n }\n return value.toISODate();\n }\n /**\n * Anything else if not an acceptable value for date column\n */\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n 'The value must be an instance of \"luxon.DateTime\"',\n ]);\n}\n/**\n * Consume database return value and convert it to an instance of luxon.DateTime\n */\nfunction consumeDateColumn(value, attributeName, modelInstance) {\n /**\n * Bypass null columns\n */\n if (!value) {\n return value;\n }\n /**\n * Convert from string\n */\n if (typeof value === 'string') {\n return DateTime.fromSQL(value);\n }\n /**\n * Convert from date\n */\n if (value instanceof Date) {\n return DateTime.fromJSDate(value);\n }\n /**\n * Any another value cannot be formatted\n */\n const modelName = modelInstance.constructor.name;\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n `${typeof value} cannot be formatted`,\n ]);\n}\n/**\n * Decorator to define a new date column\n */\nexport const dateColumn = (options) => {\n return function decorateAsColumn(target, property) {\n const Model = target.constructor;\n Model.boot();\n const normalizedOptions = Object.assign({\n prepare: prepareDateColumn,\n consume: consumeDateColumn,\n serialize: (value) => {\n if (DateTime.isDateTime(value)) {\n return value.toISODate();\n }\n return value;\n },\n meta: {},\n }, options);\n /**\n * Type always has to be a date\n */\n normalizedOptions.meta.type = 'date';\n normalizedOptions.meta.autoCreate = normalizedOptions.autoCreate === true;\n normalizedOptions.meta.autoUpdate = normalizedOptions.autoUpdate === true;\n Model.$addColumn(property, normalizedOptions);\n };\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { DateTime } from 'luxon';\nimport * as errors from '../../errors.js';\n/**\n * The method to prepare the datetime column before persisting it's\n * value to the database\n */\nfunction prepareDateTimeColumn(value, attributeName, modelInstance) {\n /**\n * Return string or missing values as it is. If `auto` is set to true on\n * the column, then the hook will always initialize the date\n */\n if (typeof value === 'string' || !value) {\n return value;\n }\n const model = modelInstance.constructor;\n const modelName = model.name;\n /**\n * Format luxon instances to SQL formatted date\n */\n if (DateTime.isDateTime(value)) {\n if (!value.isValid) {\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n value.invalidReason,\n ]);\n }\n const dateTimeFormat = model.query(modelInstance.$options).client.dialect.dateTimeFormat;\n return value.toFormat(dateTimeFormat);\n }\n /**\n * Anything else if not an acceptable value for date column\n */\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n 'It must be an instance of \"luxon.DateTime\"',\n ]);\n}\n/**\n * Consume database return value and convert it to an instance of luxon.DateTime\n */\nfunction consumeDateTimeColumn(value, attributeName, modelInstance) {\n /**\n * Bypass null columns\n */\n if (!value) {\n return value;\n }\n /**\n * Convert from string\n */\n if (typeof value === 'string') {\n return DateTime.fromSQL(value);\n }\n /**\n * Convert from date\n */\n if (value instanceof Date) {\n return DateTime.fromJSDate(value);\n }\n /**\n * Any another value cannot be formatted\n */\n const modelName = modelInstance.constructor.name;\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n `${typeof value} cannot be formatted`,\n ]);\n}\n/**\n * Decorator to define a new date time column\n */\nexport const dateTimeColumn = (options) => {\n return function decorateAsColumn(target, property) {\n const Model = target.constructor;\n Model.boot();\n const normalizedOptions = Object.assign({\n prepare: prepareDateTimeColumn,\n consume: consumeDateTimeColumn,\n serialize: (value) => {\n if (DateTime.isDateTime(value)) {\n return value.toISO();\n }\n return value;\n },\n meta: {},\n }, options);\n /**\n * Type always has to be a datetime\n */\n normalizedOptions.meta.type = 'datetime';\n normalizedOptions.meta.autoCreate = normalizedOptions.autoCreate === true;\n normalizedOptions.meta.autoUpdate = normalizedOptions.autoUpdate === true;\n Model.$addColumn(property, normalizedOptions);\n };\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { dateColumn } from './date.js';\nimport { dateTimeColumn } from './date_time.js';\n/**\n * Define property on a model as a column. The decorator needs a\n * proper model class inheriting the base model\n */\nexport const column = (options) => {\n return function decorateAsColumn(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addColumn(property, options || {});\n };\n};\ncolumn.date = dateColumn;\ncolumn.dateTime = dateTimeColumn;\n/**\n * Define computed property on a model. The decorator needs a\n * proper model class inheriting the base model\n */\nexport const computed = (options) => {\n return function decorateAsComputed(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addComputed(property, options || {});\n };\n};\n/**\n * Define belongsTo relationship\n */\nexport const belongsTo = (relatedModel, relation) => {\n return function decorateAsRelation(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addRelation(property, 'belongsTo', relatedModel, Object.assign({ relatedModel }, relation));\n };\n};\n/**\n * Define hasOne relationship\n */\nexport const hasOne = (relatedModel, relation) => {\n return function decorateAsRelation(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addRelation(property, 'hasOne', relatedModel, Object.assign({ relatedModel }, relation));\n };\n};\n/**\n * Define hasMany relationship\n */\nexport const hasMany = (relatedModel, relation) => {\n return function decorateAsRelation(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addRelation(property, 'hasMany', relatedModel, Object.assign({ relatedModel }, relation));\n };\n};\n/**\n * Define manyToMany relationship\n */\nexport const manyToMany = (relatedModel, relation) => {\n return function decorateAsRelation(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addRelation(property, 'manyToMany', relatedModel, Object.assign({ relatedModel }, relation));\n };\n};\n/**\n * Define hasManyThrough relationship\n */\nexport const hasManyThrough = ([relatedModel, throughModel], relation) => {\n return function decorateAsRelation(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addRelation(property, 'hasManyThrough', relatedModel, Object.assign({ relatedModel, throughModel }, relation));\n };\n};\n/**\n * Before/After save hook\n */\nexport const beforeSave = () => {\n return function decorateAsHook(target, property) {\n target.boot();\n target.before('save', target[property].bind(target));\n };\n};\nexport const afterSave = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('save', target[property].bind(target));\n };\n};\n/**\n * Before/After create hook\n */\nexport const beforeCreate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('create', target[property].bind(target));\n };\n};\nexport const afterCreate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('create', target[property].bind(target));\n };\n};\n/**\n * Before/After update hook\n */\nexport const beforeUpdate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('update', target[property].bind(target));\n };\n};\nexport const afterUpdate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('update', target[property].bind(target));\n };\n};\n/**\n * Before/After delete hook\n */\nexport const beforeDelete = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('delete', target[property].bind(target));\n };\n};\nexport const afterDelete = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('delete', target[property].bind(target));\n };\n};\n/**\n * Before/After find hook\n */\nexport const beforeFind = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('find', target[property].bind(target));\n };\n};\nexport const afterFind = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('find', target[property].bind(target));\n };\n};\n/**\n * Before/After fetchs hook\n */\nexport const beforeFetch = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('fetch', target[property].bind(target));\n };\n};\nexport const afterFetch = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('fetch', target[property].bind(target));\n };\n};\n/**\n * Before/After paginate hook\n */\nexport const beforePaginate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('paginate', target[property].bind(target));\n };\n};\nexport const afterPaginate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('paginate', target[property].bind(target));\n };\n};\n","// src/runner.ts\nimport { debuglog } from \"util\";\nvar debug = debuglog(\"poppinss:hooks\");\nvar Runner = class {\n constructor(action, hookHandlers) {\n this.action = action;\n this.#hookHandlers = hookHandlers || /* @__PURE__ */ new Set();\n }\n /**\n * A collection of registered hook handlers\n */\n #hookHandlers;\n /**\n * Cleanup handlers should always be an array of functions. Using a set will\n * discard duplicates and it is very much possible for two hooks to return\n * a shared cleanup handler.\n */\n #cleanupHandlers = [];\n /**\n * State to perform the cleanup\n */\n #state = \"idle\";\n /**\n * A collection of handlers to ignore when executed them\n */\n #handlersToIgnore = [];\n /**\n * Whether or not to skip all the hooks\n */\n #skipAllHooks = false;\n /**\n * Find if cleanup is pending or not\n */\n get isCleanupPending() {\n return this.#state === \"cleanup_pending\";\n }\n /**\n * Filter to check if we should run the handler\n */\n #filter(handlerName) {\n return !this.#handlersToIgnore.includes(handlerName);\n }\n /**\n * Ignore specific or all hook handlers. Calling this\n * method multiple times will result in overwriting\n * the existing state.\n */\n without(handlersToIgnore) {\n if (!handlersToIgnore) {\n debug(\"skipping all hooks\");\n this.#skipAllHooks = true;\n } else {\n this.#skipAllHooks = false;\n debug(\"skipping %O hooks\", handlersToIgnore);\n this.#handlersToIgnore = handlersToIgnore;\n }\n return this;\n }\n /**\n * Executing hooks\n */\n async #exec(reverse, data) {\n if (this.#state !== \"idle\") {\n return;\n }\n this.#state = \"cleanup_pending\";\n if (this.#skipAllHooks) {\n return;\n }\n debug(\"running hooks\");\n const handlers = reverse ? Array.from(this.#hookHandlers).reverse() : this.#hookHandlers;\n for (let handler of handlers) {\n if (this.#filter(handler.name)) {\n if (handler.name) {\n debug(\"running hook %s\", handler.name);\n }\n const result = await (typeof handler === \"function\" ? handler(...data) : handler.handle(this.action, ...data));\n if (typeof result === \"function\") {\n if (handler.name) {\n debug(\"cleanup scheduled by %s hook\", handler.name);\n }\n this.#cleanupHandlers.push(result);\n }\n }\n }\n }\n /**\n * Execute handlers\n */\n async run(...data) {\n return this.#exec(false, data);\n }\n /**\n * Execute handlers in reverse order\n */\n async runReverse(...data) {\n return this.#exec(true, data);\n }\n /**\n * Execute cleanup actions\n */\n async cleanup(...data) {\n if (!this.isCleanupPending) {\n return;\n }\n this.#state = \"cleanup_initiated\";\n debug(\"performing cleanup\");\n let startIndex = this.#cleanupHandlers.length;\n while (startIndex--) {\n await this.#cleanupHandlers[startIndex](...data);\n }\n this.#state = \"cleanup_completed\";\n this.#cleanupHandlers = [];\n }\n};\n\n// src/hooks.ts\nvar Hooks = class {\n /**\n * A collection of registered hooks\n */\n #hooks = /* @__PURE__ */ new Map();\n /**\n * Get access to all the registered hooks. The return value is\n * a map of the event name and a set of handlers.\n */\n all() {\n return this.#hooks;\n }\n /**\n * Find if a handler for a given event exists.\n */\n has(event, handler) {\n const handlers = this.#hooks.get(event);\n if (!handlers) {\n return false;\n }\n return handlers.has(handler);\n }\n /**\n * Add a hook handler for a given event. Adding the same handler twice will\n * result in a noop.\n */\n add(event, handler) {\n const handlers = this.#hooks.get(event);\n if (!handlers) {\n this.#hooks.set(event, /* @__PURE__ */ new Set());\n }\n this.#hooks.get(event).add(handler);\n return this;\n }\n /**\n * Remove hook handler for a given event.\n */\n remove(event, handler) {\n const handlers = this.#hooks.get(event);\n if (!handlers) {\n return false;\n }\n return handlers.delete(handler);\n }\n /**\n * Clear all the hooks for a specific event or all the\n * events.\n */\n clear(event) {\n if (!event) {\n this.#hooks.clear();\n return;\n }\n this.#hooks.delete(event);\n }\n /**\n * Merge hooks from an existing hooks instance.\n */\n merge(hooks) {\n hooks.all().forEach((actionHooks, action) => {\n actionHooks.forEach((handler) => {\n this.add(action, handler);\n });\n });\n }\n /**\n * Returns an instance of the runner to run hooks\n */\n runner(action) {\n return new Runner(action, this.#hooks.get(action));\n }\n};\nexport {\n Hooks as default\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport * as errors from '../../errors.js';\n/**\n * Exposes the API to define and preload relationships in reference to\n * a model\n */\nexport class Preloader {\n model;\n preloads = {};\n /**\n * When invoked via query builder. The preloader will get the side-loaded\n * object, that should be transferred to relationship model instances.\n */\n sideloaded = {};\n debugQueries = false;\n constructor(model) {\n this.model = model;\n }\n /**\n * Processes a relationship for a single parent\n */\n async processRelation(name, parent, client) {\n const { relation, callback } = this.preloads[name];\n const query = relation\n .eagerQuery(parent, client)\n .debug(this.debugQueries)\n .sideload(this.sideloaded);\n /**\n * Pass query to end user for adding more constraints\n */\n if (typeof callback === 'function') {\n callback(query);\n }\n const result = await query.selectRelationKeys().exec();\n /**\n * hasOne and belongsTo will always return an array of a single row (if done right)\n */\n if (relation.type === 'hasOne' || relation.type === 'belongsTo') {\n relation.setRelated(parent, result[0] || null);\n return;\n }\n /**\n * Set array of related instances\n */\n relation.setRelated(parent, result);\n }\n /**\n * Process a given relationship for many parent instances. This happens\n * during eager-loading\n */\n async processRelationForMany(name, parent, client) {\n const { relation, callback } = this.preloads[name];\n const query = relation\n .eagerQuery(parent, client)\n .debug(this.debugQueries)\n .sideload(this.sideloaded);\n /**\n * Pass query to end user for adding more constraints\n */\n if (typeof callback === 'function') {\n callback(query);\n }\n const result = await query.selectRelationKeys().exec();\n /**\n * Set array of related instances\n */\n relation.setRelatedForMany(parent, result);\n }\n /**\n * Define a relationship to preload\n */\n load(name, callback) {\n const relation = this.model.$getRelation(name);\n if (!relation) {\n throw new errors.E_UNDEFINED_RELATIONSHIP([name, this.model.name]);\n }\n relation.boot();\n this.preloads[name] = {\n relation: relation,\n callback: callback,\n };\n return this;\n }\n /**\n * Alias for \"this.load\"\n */\n preload(name, callback) {\n return this.load(name, callback);\n }\n /**\n * Define a relationship to preload, but only if they are not\n * already preloaded\n */\n preloadOnce(name) {\n if (!this.preloads[name]) {\n return this.load(name);\n }\n return this;\n }\n /**\n * Toggle query debugging\n */\n debug(debug) {\n this.debugQueries = debug;\n return this;\n }\n /**\n * Define attributes to be passed to all the model instance as\n * side-loaded attributes\n */\n sideload(values) {\n this.sideloaded = values;\n return this;\n }\n /**\n * Clone preloader instance\n */\n clone() {\n const clone = new Preloader(this.model);\n clone.preloads = Object.assign({}, this.preloads);\n clone.sideloaded = Object.assign({}, this.sideloaded);\n clone.debugQueries = this.debugQueries;\n return clone;\n }\n /**\n * Process of all the preloaded relationships for a single parent\n */\n async processAllForOne(parent, client) {\n await Promise.all(Object.keys(this.preloads).map((relationName) => {\n return this.processRelation(relationName, parent, client);\n }));\n }\n /**\n * Process of all the preloaded relationships for many parents\n */\n async processAllForMany(parent, client) {\n if (!parent.length) {\n return;\n }\n await Promise.all(Object.keys(this.preloads).map((relationName) => {\n return this.processRelationForMany(relationName, parent, client);\n }));\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * A proxy trap to add support for custom getters and setters\n */\nexport const proxyHandler = {\n get(target, key, receiver) {\n const Model = target.constructor;\n const column = Model.$getColumn(key);\n /**\n * Fetch the attribute value, when attribute exists and\n * doesn't have a getter\n */\n if (column && !column.hasGetter) {\n const attributeValue = target.$getAttribute(key);\n if (attributeValue === undefined) {\n return Reflect.get(target, key, receiver);\n }\n return attributeValue;\n }\n /**\n * Fetch the relation when property is defined as a relationship\n */\n const relation = Model.$getRelation(key);\n if (relation) {\n return target.$getRelated(key);\n }\n return Reflect.get(target, key, receiver);\n },\n set(target, key, value, receiver) {\n const Model = target.constructor;\n const column = Model.$getColumn(key);\n /**\n * Set value as an attribute when column is defined and\n * their isn't any setter for it.\n */\n if (column && !column.hasSetter) {\n target.$setAttribute(key, value);\n Reflect.set(target, key, value, receiver);\n return true;\n }\n /**\n * Fetch the relation when property is defined as a relationship\n */\n const relation = Model.$getRelation(key);\n if (relation) {\n target.$setRelated(key, value);\n return true;\n }\n return Reflect.set(target, key, value, receiver);\n },\n defineProperty(target, key, value) {\n const Model = target.constructor;\n const column = Model.$getColumn(key);\n /**\n * Set the attribute along side defining the property\n */\n if (column && !column.hasSetter && value.value !== undefined) {\n target.$setAttribute(key, value.value);\n }\n return Reflect.defineProperty(target, key, value);\n },\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * Exposes the API to collect, get and resolve model keys\n */\nexport class ModelKeys {\n keys;\n constructor(keys = {}) {\n this.keys = keys;\n }\n /**\n * Add a new key\n */\n add(key, value) {\n this.keys[key] = value;\n }\n get(key, defaultValue) {\n return this.keys[key] || defaultValue;\n }\n /**\n * Resolve key, if unable to resolve, the key will be\n * returned as it is.\n */\n resolve(key) {\n return this.get(key, key);\n }\n /**\n * Return all keys\n */\n all() {\n return this.keys;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport * as errors from '../../errors.js';\n/**\n * Utility to consistently extract relationship keys from the model\n * and the relation model.\n */\nexport class KeysExtractor {\n model;\n relationName;\n keys;\n constructor(model, relationName, keys) {\n this.model = model;\n this.relationName = relationName;\n this.keys = keys;\n }\n /**\n * Extract the defined keys from the models\n */\n extract() {\n const relationRef = `${this.model.name}.${this.relationName}`;\n return Object.keys(this.keys).reduce((result, extractKey) => {\n const { key, model } = this.keys[extractKey];\n const attribute = model.$getColumn(key);\n if (!attribute) {\n throw new errors.E_MISSING_MODEL_ATTRIBUTE([relationRef, key, model.name]);\n }\n result[extractKey] = {\n attributeName: key,\n columnName: attribute.columnName,\n };\n return result;\n }, {});\n }\n}\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport slash from 'slash';\nimport { join, extname } from 'node:path';\nimport { Exception, fsReadAll, isScriptFile } from '@poppinss/utils';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport * as errors from '../errors.js';\nimport { DateTime } from 'luxon';\nimport equal from 'fast-deep-equal';\n/**\n * Ensure that relation is defined\n */\nexport function ensureRelation(name, relation) {\n if (!relation) {\n throw new Exception(`Cannot process unregistered relationship ${name}`, { status: 500 });\n }\n return true;\n}\n/**\n * Ensure a key value is not null or undefined inside an object.\n */\nexport function ensureValue(collection, key, missingCallback) {\n const value = collection[key];\n if (value === undefined || value === null) {\n missingCallback();\n return;\n }\n return value;\n}\n/**\n * Collects values for a key inside an array. Similar to `Array.map`, but\n * reports missing values.\n */\nexport function collectValues(payload, key, missingCallback) {\n return payload.map((row) => {\n return ensureValue(row, key, missingCallback);\n });\n}\n/**\n * Transform value if it is an instance of DateTime, so it can be processed by query builder\n */\nexport function transformDateValue(value, dialect) {\n if (DateTime.isDateTime(value)) {\n return value.toFormat(dialect.dateTimeFormat);\n }\n return value;\n}\n/**\n * Compare two values deeply whether they are equal or not\n */\nexport function compareValues(valueA, valueB) {\n if (DateTime.isDateTime(valueA) || DateTime.isDateTime(valueB)) {\n return DateTime.isDateTime(valueA) && DateTime.isDateTime(valueB)\n ? valueA.equals(valueB)\n : valueA === valueB;\n }\n else {\n return equal(valueA, valueB);\n }\n}\n/**\n * Raises exception when a relationship `booted` property is false.\n */\nexport function ensureRelationIsBooted(relation) {\n if (!relation.booted) {\n throw new errors.E_RUNTIME_EXCEPTION([\n 'Relationship is not booted. Make sure to call boot first',\n ]);\n }\n}\n/**\n * Returns the value for a key from the model instance and raises descriptive\n * exception when the value is missing\n */\nexport function getValue(model, key, relation, action = 'preload') {\n return ensureValue(model, key, () => {\n throw new Exception(`Cannot ${action} \"${relation.relationName}\", value of \"${relation.model.name}.${key}\" is undefined`, { status: 500 });\n });\n}\n/**\n * Helper to find if value is a valid Object or\n * not\n */\nexport function isObject(value) {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n/**\n * Drops duplicate values from an array\n */\nexport function unique(value) {\n if (!Array.isArray(value)) {\n return [];\n }\n return [...new Set(value)];\n}\n/**\n * Returns a diff of rows to be updated or inserted when performing\n * a many to many `attach`\n */\nexport function syncDiff(original, incoming) {\n const diff = Object.keys(incoming).reduce((result, incomingRowId) => {\n const originalRow = original[incomingRowId];\n const incomingRow = incoming[incomingRowId];\n /**\n * When there isn't any matching row, we need to insert\n * the upcoming row\n */\n if (!originalRow) {\n result.added[incomingRowId] = incomingRow;\n }\n else if (Object.keys(incomingRow).find((key) => incomingRow[key] !== originalRow[key])) {\n /**\n * If any of the row attributes are different, then we must\n * update that row\n */\n result.updated[incomingRowId] = incomingRow;\n }\n return result;\n }, { added: {}, updated: {} });\n return diff;\n}\n/**\n * Invokes a callback by wrapping it inside managed transaction\n * when passed client is not transaction itself.\n */\nexport async function managedTransaction(client, callback) {\n const isManagedTransaction = !client.isTransaction;\n const trx = client.isTransaction\n ? client\n : await client.transaction();\n if (!isManagedTransaction) {\n return callback(trx);\n }\n try {\n const response = await callback(trx);\n await trx.commit();\n return response;\n }\n catch (error) {\n await trx.rollback();\n throw error;\n }\n}\n/**\n * Returns the sql method for a DDL statement\n */\nexport function getDDLMethod(sql) {\n sql = sql.toLowerCase();\n if (sql.startsWith('create')) {\n return 'create';\n }\n if (sql.startsWith('alter')) {\n return 'alter';\n }\n if (sql.startsWith('drop')) {\n return 'drop';\n }\n return 'unknown';\n}\n/**\n * Normalizes the cherry-picking object to always be an object with\n * `pick` and `omit` properties\n */\nexport function normalizeCherryPickObject(fields) {\n if (Array.isArray(fields)) {\n return {\n pick: fields,\n omit: [],\n };\n }\n return {\n pick: fields.pick,\n omit: fields.omit,\n };\n}\n/**\n * Sources files from a given directory\n */\nexport async function sourceFiles(fromLocation, directory, naturalSort) {\n const absDirectoryPath = fileURLToPath(new URL(directory, fromLocation));\n let files = await fsReadAll(absDirectoryPath, {\n filter: isScriptFile,\n ignoreMissingRoot: true,\n });\n /**\n * Sort files\n */\n if (naturalSort) {\n files = files.sort((a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' }));\n }\n else {\n files = files.sort();\n }\n return {\n directory,\n files: files.map((file) => {\n const name = join(directory, file.replace(RegExp(`${extname(file)}$`), ''));\n return {\n /**\n * Absolute path to the file. Needed to ready the schema source\n */\n absPath: join(absDirectoryPath, file),\n /**\n * Normalizing name to always have unix slashes.\n */\n name: slash(name),\n /**\n * Import schema file\n */\n async getSource() {\n const exports = await import(pathToFileURL(this.absPath).href);\n if (!exports.default) {\n throw new Error(`Missing default export from \"${this.name}\" schema file`);\n }\n return exports.default;\n },\n };\n }),\n };\n}\n","'use strict';\n\n/** @type {import('./type')} */\nmodule.exports = TypeError;\n","module.exports = require('util').inspect;\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nvar quotes = {\n __proto__: null,\n 'double': '\"',\n single: \"'\"\n};\nvar quoteREs = {\n __proto__: null,\n 'double': /([\"\\\\])/g,\n single: /(['\\\\])/g\n};\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other\n /* eslint-env browser */\n if (typeof window !== 'undefined' && obj === window) {\n return '{ [object Window] }';\n }\n if (\n (typeof globalThis !== 'undefined' && obj === globalThis)\n || (typeof global !== 'undefined' && obj === global)\n ) {\n return '{ [object globalThis] }';\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var style = opts.quoteStyle || defaultStyle;\n var quoteChar = quotes[style];\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction canTrustToString(obj) {\n return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));\n}\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n var quoteRE = quoteREs[opts.quoteStyle || 'single'];\n quoteRE.lastIndex = 0;\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, quoteRE, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar inspect = require('object-inspect');\n\nvar $TypeError = require('es-errors/type');\n\n/*\n* This function traverses the list returning the node corresponding to the given key.\n*\n* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.\n* By doing so, all the recently used nodes can be accessed relatively quickly.\n*/\n/** @type {import('./list.d.ts').listGetNode} */\n// eslint-disable-next-line consistent-return\nvar listGetNode = function (list, key, isDelete) {\n\t/** @type {typeof list | NonNullable<(typeof list)['next']>} */\n\tvar prev = list;\n\t/** @type {(typeof list)['next']} */\n\tvar curr;\n\t// eslint-disable-next-line eqeqeq\n\tfor (; (curr = prev.next) != null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tif (!isDelete) {\n\t\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\t\tcurr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);\n\t\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\t}\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\n/** @type {import('./list.d.ts').listGet} */\nvar listGet = function (objects, key) {\n\tif (!objects) {\n\t\treturn void undefined;\n\t}\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\n/** @type {import('./list.d.ts').listSet} */\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t});\n\t}\n};\n/** @type {import('./list.d.ts').listHas} */\nvar listHas = function (objects, key) {\n\tif (!objects) {\n\t\treturn false;\n\t}\n\treturn !!listGetNode(objects, key);\n};\n/** @type {import('./list.d.ts').listDelete} */\n// eslint-disable-next-line consistent-return\nvar listDelete = function (objects, key) {\n\tif (objects) {\n\t\treturn listGetNode(objects, key, true);\n\t}\n};\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannelList() {\n\t/** @typedef {ReturnType<typeof getSideChannelList>} Channel */\n\t/** @typedef {Parameters<Channel['get']>[0]} K */\n\t/** @typedef {Parameters<Channel['set']>[1]} V */\n\n\t/** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\tvar root = $o && $o.next;\n\t\t\tvar deletedNode = listDelete($o, key);\n\t\t\tif (deletedNode && root && root === deletedNode) {\n\t\t\t\t$o = void undefined;\n\t\t\t}\n\t\t\treturn !!deletedNode;\n\t\t},\n\t\tget: function (key) {\n\t\t\treturn listGet($o, key);\n\t\t},\n\t\thas: function (key) {\n\t\t\treturn listHas($o, key);\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$o) {\n\t\t\t\t// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head\n\t\t\t\t$o = {\n\t\t\t\t\tnext: void undefined\n\t\t\t\t};\n\t\t\t}\n\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\tlistSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value);\n\t\t}\n\t};\n\t// @ts-expect-error TODO: figure out why this is erroring\n\treturn channel;\n};\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Object;\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Error;\n","'use strict';\n\n/** @type {import('./eval')} */\nmodule.exports = EvalError;\n","'use strict';\n\n/** @type {import('./range')} */\nmodule.exports = RangeError;\n","'use strict';\n\n/** @type {import('./ref')} */\nmodule.exports = ReferenceError;\n","'use strict';\n\n/** @type {import('./syntax')} */\nmodule.exports = SyntaxError;\n","'use strict';\n\n/** @type {import('./uri')} */\nmodule.exports = URIError;\n","'use strict';\n\n/** @type {import('./abs')} */\nmodule.exports = Math.abs;\n","'use strict';\n\n/** @type {import('./floor')} */\nmodule.exports = Math.floor;\n","'use strict';\n\n/** @type {import('./max')} */\nmodule.exports = Math.max;\n","'use strict';\n\n/** @type {import('./min')} */\nmodule.exports = Math.min;\n","'use strict';\n\n/** @type {import('./pow')} */\nmodule.exports = Math.pow;\n","'use strict';\n\n/** @type {import('./round')} */\nmodule.exports = Math.round;\n","'use strict';\n\n/** @type {import('./isNaN')} */\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\n/** @type {import('./sign')} */\nmodule.exports = function sign(number) {\n\tif ($isNaN(number) || number === 0) {\n\t\treturn number;\n\t}\n\treturn number < 0 ? -1 : +1;\n};\n","'use strict';\n\n/** @type {import('./gOPD')} */\nmodule.exports = Object.getOwnPropertyDescriptor;\n","'use strict';\n\n/** @type {import('.')} */\nvar $gOPD = require('./gOPD');\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\n/** @type {import('.')} */\nvar $defineProperty = Object.defineProperty || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n","'use strict';\n\n/** @type {import('./shams')} */\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\t/** @type {{ [k in symbol]?: unknown }} */\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\t// eslint-disable-next-line no-extra-parens\n\t\tvar descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\n/** @type {import('.')} */\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/** @type {import('./Reflect.getPrototypeOf')} */\nmodule.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;\n","'use strict';\n\nvar $Object = require('es-object-atoms');\n\n/** @type {import('./Object.getPrototypeOf')} */\nmodule.exports = $Object.getPrototypeOf || null;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\n/** @type {import('./functionCall')} */\nmodule.exports = Function.prototype.call;\n","'use strict';\n\n/** @type {import('./functionApply')} */\nmodule.exports = Function.prototype.apply;\n","'use strict';\n\n/** @type {import('./reflectApply')} */\nmodule.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;\n","'use strict';\n\nvar bind = require('function-bind');\n\nvar $apply = require('./functionApply');\nvar $call = require('./functionCall');\nvar $reflectApply = require('./reflectApply');\n\n/** @type {import('./actualApply')} */\nmodule.exports = $reflectApply || bind.call($call, $apply);\n","'use strict';\n\nvar bind = require('function-bind');\nvar $TypeError = require('es-errors/type');\n\nvar $call = require('./functionCall');\nvar $actualApply = require('./actualApply');\n\n/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */\nmodule.exports = function callBindBasic(args) {\n\tif (args.length < 1 || typeof args[0] !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\treturn $actualApply(bind, $call, args);\n};\n","'use strict';\n\nvar callBind = require('call-bind-apply-helpers');\nvar gOPD = require('gopd');\n\nvar hasProtoAccessor;\ntry {\n\t// eslint-disable-next-line no-extra-parens, no-proto\n\thasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;\n} catch (e) {\n\tif (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {\n\t\tthrow e;\n\t}\n}\n\n// eslint-disable-next-line no-extra-parens\nvar desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));\n\nvar $Object = Object;\nvar $getPrototypeOf = $Object.getPrototypeOf;\n\n/** @type {import('./get')} */\nmodule.exports = desc && typeof desc.get === 'function'\n\t? callBind([desc.get])\n\t: typeof $getPrototypeOf === 'function'\n\t\t? /** @type {import('./get')} */ function getDunder(value) {\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\treturn $getPrototypeOf(value == null ? value : $Object(value));\n\t\t}\n\t\t: false;\n","'use strict';\n\nvar reflectGetProto = require('./Reflect.getPrototypeOf');\nvar originalGetProto = require('./Object.getPrototypeOf');\n\nvar getDunderProto = require('dunder-proto/get');\n\n/** @type {import('.')} */\nmodule.exports = reflectGetProto\n\t? function getProto(O) {\n\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\treturn reflectGetProto(O);\n\t}\n\t: originalGetProto\n\t\t? function getProto(O) {\n\t\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\t\tthrow new TypeError('getProto: not an object');\n\t\t\t}\n\t\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\t\treturn originalGetProto(O);\n\t\t}\n\t\t: getDunderProto\n\t\t\t? function getProto(O) {\n\t\t\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\t\t\treturn getDunderProto(O);\n\t\t\t}\n\t\t\t: null;\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar undefined;\n\nvar $Object = require('es-object-atoms');\n\nvar $Error = require('es-errors');\nvar $EvalError = require('es-errors/eval');\nvar $RangeError = require('es-errors/range');\nvar $ReferenceError = require('es-errors/ref');\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\nvar $URIError = require('es-errors/uri');\n\nvar abs = require('math-intrinsics/abs');\nvar floor = require('math-intrinsics/floor');\nvar max = require('math-intrinsics/max');\nvar min = require('math-intrinsics/min');\nvar pow = require('math-intrinsics/pow');\nvar round = require('math-intrinsics/round');\nvar sign = require('math-intrinsics/sign');\n\nvar $Function = Function;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = require('gopd');\nvar $defineProperty = require('es-define-property');\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = require('get-proto');\nvar $ObjectGPO = require('get-proto/Object.getPrototypeOf');\nvar $ReflectGPO = require('get-proto/Reflect.getPrototypeOf');\n\nvar $apply = require('call-bind-apply-helpers/functionApply');\nvar $call = require('call-bind-apply-helpers/functionCall');\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t__proto__: null,\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': $Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': $EvalError,\n\t'%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': $Object,\n\t'%Object.getOwnPropertyDescriptor%': $gOPD,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': $RangeError,\n\t'%ReferenceError%': $ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': $URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,\n\n\t'%Function.prototype.call%': $call,\n\t'%Function.prototype.apply%': $apply,\n\t'%Object.defineProperty%': $defineProperty,\n\t'%Object.getPrototypeOf%': $ObjectGPO,\n\t'%Math.abs%': abs,\n\t'%Math.floor%': floor,\n\t'%Math.max%': max,\n\t'%Math.min%': min,\n\t'%Math.pow%': pow,\n\t'%Math.round%': round,\n\t'%Math.sign%': sign,\n\t'%Reflect.getPrototypeOf%': $ReflectGPO\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t__proto__: null,\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call($call, Array.prototype.concat);\nvar $spliceApply = bind.call($apply, Array.prototype.splice);\nvar $replace = bind.call($call, String.prototype.replace);\nvar $strSlice = bind.call($call, String.prototype.slice);\nvar $exec = bind.call($call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBindBasic = require('call-bind-apply-helpers');\n\n/** @type {(thisArg: string, searchString: string, position?: number) => number} */\nvar $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);\n\n/** @type {import('.')} */\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\t/* eslint no-extra-parens: 0 */\n\n\tvar intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBindBasic(/** @type {const} */ ([intrinsic]));\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = require('es-errors/type');\nvar $Map = GetIntrinsic('%Map%', true);\n\n/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */\nvar $mapGet = callBound('Map.prototype.get', true);\n/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */\nvar $mapSet = callBound('Map.prototype.set', true);\n/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */\nvar $mapHas = callBound('Map.prototype.has', true);\n/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */\nvar $mapDelete = callBound('Map.prototype.delete', true);\n/** @type {<K, V>(thisArg: Map<K, V>) => number} */\nvar $mapSize = callBound('Map.prototype.size', true);\n\n/** @type {import('.')} */\nmodule.exports = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {\n\t/** @typedef {ReturnType<typeof getSideChannelMap>} Channel */\n\t/** @typedef {Parameters<Channel['get']>[0]} K */\n\t/** @typedef {Parameters<Channel['set']>[1]} V */\n\n\t/** @type {Map<K, V> | undefined} */ var $m;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\tif ($m) {\n\t\t\t\tvar result = $mapDelete($m, key);\n\t\t\t\tif ($mapSize($m) === 0) {\n\t\t\t\t\t$m = void undefined;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($m) {\n\t\t\t\treturn $mapGet($m, key);\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($m) {\n\t\t\t\treturn $mapHas($m, key);\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$m) {\n\t\t\t\t// @ts-expect-error TS can't handle narrowing a variable inside a closure\n\t\t\t\t$m = new $Map();\n\t\t\t}\n\t\t\t$mapSet($m, key, value);\n\t\t}\n\t};\n\n\t// @ts-expect-error TODO: figure out why TS is erroring here\n\treturn channel;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bound');\nvar inspect = require('object-inspect');\nvar getSideChannelMap = require('side-channel-map');\n\nvar $TypeError = require('es-errors/type');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\n\n/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\n/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\n/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\n/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */\nvar $weakMapDelete = callBound('WeakMap.prototype.delete', true);\n\n/** @type {import('.')} */\nmodule.exports = $WeakMap\n\t? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() {\n\t\t/** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */\n\t\t/** @typedef {Parameters<Channel['get']>[0]} K */\n\t\t/** @typedef {Parameters<Channel['set']>[1]} V */\n\n\t\t/** @type {WeakMap<K & object, V> | undefined} */ var $wm;\n\t\t/** @type {Channel | undefined} */ var $m;\n\n\t\t/** @type {Channel} */\n\t\tvar channel = {\n\t\t\tassert: function (key) {\n\t\t\t\tif (!channel.has(key)) {\n\t\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t\t}\n\t\t\t},\n\t\t\t'delete': function (key) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif ($wm) {\n\t\t\t\t\t\treturn $weakMapDelete($wm, key);\n\t\t\t\t\t}\n\t\t\t\t} else if (getSideChannelMap) {\n\t\t\t\t\tif ($m) {\n\t\t\t\t\t\treturn $m['delete'](key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tget: function (key) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif ($wm) {\n\t\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $m && $m.get(key);\n\t\t\t},\n\t\t\thas: function (key) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif ($wm) {\n\t\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn !!$m && $m.has(key);\n\t\t\t},\n\t\t\tset: function (key, value) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif (!$wm) {\n\t\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t\t}\n\t\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t\t} else if (getSideChannelMap) {\n\t\t\t\t\tif (!$m) {\n\t\t\t\t\t\t$m = getSideChannelMap();\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\t\t\t/** @type {NonNullable<typeof $m>} */ ($m).set(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// @ts-expect-error TODO: figure out why this is erroring\n\t\treturn channel;\n\t}\n\t: getSideChannelMap;\n","'use strict';\n\nvar $TypeError = require('es-errors/type');\nvar inspect = require('object-inspect');\nvar getSideChannelList = require('side-channel-list');\nvar getSideChannelMap = require('side-channel-map');\nvar getSideChannelWeakMap = require('side-channel-weakmap');\n\nvar makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannel() {\n\t/** @typedef {ReturnType<typeof getSideChannel>} Channel */\n\n\t/** @type {Channel | undefined} */ var $channelData;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\treturn !!$channelData && $channelData['delete'](key);\n\t\t},\n\t\tget: function (key) {\n\t\t\treturn $channelData && $channelData.get(key);\n\t\t},\n\t\thas: function (key) {\n\t\t\treturn !!$channelData && $channelData.has(key);\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$channelData) {\n\t\t\t\t$channelData = makeChannel();\n\t\t\t}\n\n\t\t\t$channelData.set(key, value);\n\t\t}\n\t};\n\t// @ts-expect-error TODO: figure out why this is erroring\n\treturn channel;\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n","'use strict';\n\nvar formats = require('./formats');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? { __proto__: null } : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object' && typeof source !== 'function') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if (\n (options && (options.plainObjects || options.allowPrototypes))\n || !has.call(Object.prototype, source)\n ) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, defaultDecoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar limit = 1024;\n\n/* eslint operator-linebreak: [2, \"before\"] */\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var j = 0; j < string.length; j += limit) {\n var segment = string.length >= limit ? string.slice(j, j + limit) : string;\n var arr = [];\n\n for (var i = 0; i < segment.length; ++i) {\n var c = segment.charCodeAt(i);\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n arr[arr.length] = segment.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n arr[arr.length] = hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n arr[arr.length] = hexTable[0xC0 | (c >> 6)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n arr[arr.length] = hexTable[0xE0 | (c >> 12)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));\n\n arr[arr.length] = hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n out += arr.join('');\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","'use strict';\n\nvar getSideChannel = require('side-channel');\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n allowEmptyArrays: false,\n arrayFormat: 'indices',\n charset: 'utf-8',\n charsetSentinel: false,\n commaRoundTrip: false,\n delimiter: '&',\n encode: true,\n encodeDotInKeys: false,\n encoder: utils.encode,\n encodeValuesOnly: false,\n filter: void undefined,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n if (encodeValuesOnly && encoder) {\n obj = utils.maybeMap(obj, encoder);\n }\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\\./g, '%2E') : String(prefix);\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;\n\n if (allowEmptyArrays && isArray(obj) && obj.length === 0) {\n return adjustedPrefix + '[]';\n }\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && key && typeof key.value !== 'undefined'\n ? key.value\n : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\\./g, '%2E') : String(key);\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {\n throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n var arrayFormat;\n if (opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if ('indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = defaults.arrayFormat;\n }\n\n if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n arrayFormat: arrayFormat,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n commaRoundTrip: !!opts.commaRoundTrip,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];\n var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n var value = obj[key];\n\n if (options.skipNulls && value === null) {\n continue;\n }\n pushToArray(keys, stringify(\n value,\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.allowEmptyArrays,\n options.strictNullHandling,\n options.skipNulls,\n options.encodeDotInKeys,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowEmptyArrays: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decodeDotInKeys: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n duplicates: 'combine',\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictDepth: false,\n strictNullHandling: false,\n throwOnLimitExceeded: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options, currentArrayLength) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = { __proto__: null };\n\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(\n options.delimiter,\n options.throwOnLimitExceeded ? limit + 1 : limit\n );\n\n if (options.throwOnLimitExceeded && parts.length > limit) {\n throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');\n }\n\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key;\n var val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n\n val = utils.maybeMap(\n parseArrayValue(\n part.slice(pos + 1),\n options,\n isArray(obj[key]) ? obj[key].length : 0\n ),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(String(val));\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n var existing = has.call(obj, key);\n if (existing && options.duplicates === 'combine') {\n obj[key] = utils.combine(obj[key], val);\n } else if (!existing || options.duplicates === 'last') {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var currentArrayLength = 0;\n if (chain.length > 0 && chain[chain.length - 1] === '[]') {\n var parentKey = chain.slice(0, -1).join('');\n currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;\n }\n\n var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))\n ? []\n : utils.combine([], leaf);\n } else {\n obj = options.plainObjects ? { __proto__: null } : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;\n var index = parseInt(decodedRoot, 10);\n if (!options.parseArrays && decodedRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== decodedRoot\n && String(index) === decodedRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (decodedRoot !== '__proto__') {\n obj[decodedRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, check strictDepth option for throw, else just add whatever is left\n\n if (segment) {\n if (options.strictDepth === true) {\n throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');\n }\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {\n throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {\n throw new TypeError('`throwOnLimitExceeded` option must be a boolean');\n }\n\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;\n\n if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {\n throw new TypeError('The duplicates option must be either combine, first, or last');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n duplicates: duplicates,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,\n throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? { __proto__: null } : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? { __proto__: null } : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","import \"../../chunk-2KG3PWR4.js\";\n\n// src/string/main.ts\nimport string from \"@poppinss/string\";\nvar main_default = string;\nexport {\n main_default as default\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport string from '@poppinss/utils/string';\n/**\n * Camelcase naming strategy for the model to use camelcase keys\n * for the serialized output.\n */\nexport class CamelCaseNamingStrategy {\n /**\n * The default table name for the given model\n */\n tableName(model) {\n return string.pluralize(string.snakeCase(model.name));\n }\n /**\n * The database column name for a given model attribute\n */\n columnName(_, attributeName) {\n return string.snakeCase(attributeName);\n }\n /**\n * The post serialization name for a given model attribute\n */\n serializedName(_, attributeName) {\n return string.camelCase(attributeName);\n }\n /**\n * The local key for a given model relationship\n */\n relationLocalKey(relation, model, relatedModel) {\n if (relation === 'belongsTo') {\n return relatedModel.primaryKey;\n }\n return model.primaryKey;\n }\n /**\n * The foreign key for a given model relationship\n */\n relationForeignKey(relation, model, relatedModel) {\n if (relation === 'belongsTo') {\n return string.camelCase(`${relatedModel.name}_${relatedModel.primaryKey}`);\n }\n return string.camelCase(`${model.name}_${model.primaryKey}`);\n }\n /**\n * Pivot table name for many to many relationship\n */\n relationPivotTable(_, model, relatedModel) {\n return string.snakeCase([relatedModel.name, model.name].sort().join('_'));\n }\n /**\n * Pivot foreign key for many to many relationship\n */\n relationPivotForeignKey(_, model) {\n return string.snakeCase(`${model.name}_${model.primaryKey}`);\n }\n /**\n * Keys for the pagination meta\n */\n paginationMetaKeys() {\n return {\n total: 'total',\n perPage: 'perPage',\n currentPage: 'currentPage',\n lastPage: 'lastPage',\n firstPage: 'firstPage',\n firstPageUrl: 'firstPageUrl',\n lastPageUrl: 'lastPageUrl',\n nextPageUrl: 'nextPageUrl',\n previousPageUrl: 'previousPageUrl',\n };\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { stringify } from 'qs';\nimport { CamelCaseNamingStrategy } from '../../orm/naming_strategies/camel_case.js';\n/**\n * Simple paginator works with the data set provided by the standard\n * `offset` and `limit` based pagination.\n */\nexport class SimplePaginator extends Array {\n totalNumber;\n perPage;\n currentPage;\n qs = {};\n url = '/';\n rows;\n /**\n * Naming strategy for the pagination meta keys\n */\n static namingStrategy = new CamelCaseNamingStrategy();\n /**\n * Can be defined at per instance level as well\n */\n namingStrategy = SimplePaginator.namingStrategy;\n /**\n * The first page is always 1\n */\n firstPage = 1;\n /**\n * Find if results set is empty or not\n */\n isEmpty;\n /**\n * Casting `total` to a number. Later, we can think of situations\n * to cast it to a bigint\n */\n total;\n /**\n * Find if there are total records or not. This is not same as\n * `isEmpty`.\n *\n * The `isEmpty` reports about the current set of results. However `hasTotal`\n * reports about the total number of records, regardless of the current.\n */\n hasTotal;\n /**\n * The Last page number\n */\n lastPage;\n /**\n * Find if there are more pages to come\n */\n hasMorePages;\n /**\n * Find if there are enough results to be paginated or not\n */\n hasPages;\n constructor(totalNumber, perPage, currentPage, ...rows) {\n super(...rows);\n this.totalNumber = totalNumber;\n this.perPage = perPage;\n this.currentPage = currentPage;\n this.rows = rows;\n this.isEmpty = this.rows.length === 0;\n this.total = Number(this.totalNumber);\n this.hasTotal = this.total > 0;\n this.lastPage = Math.max(Math.ceil(this.total / this.perPage), 1);\n this.hasPages = this.lastPage !== 1;\n this.hasMorePages = this.lastPage > this.currentPage;\n }\n /**\n * A reference to the result rows\n */\n all() {\n return this.rows;\n }\n /**\n * Returns JSON meta data\n */\n getMeta() {\n const metaKeys = this.namingStrategy.paginationMetaKeys();\n return {\n [metaKeys.total]: this.total,\n [metaKeys.perPage]: this.perPage,\n [metaKeys.currentPage]: this.currentPage,\n [metaKeys.lastPage]: this.lastPage,\n [metaKeys.firstPage]: this.firstPage,\n [metaKeys.firstPageUrl]: this.getUrl(1),\n [metaKeys.lastPageUrl]: this.getUrl(this.lastPage),\n [metaKeys.nextPageUrl]: this.getNextPageUrl(),\n [metaKeys.previousPageUrl]: this.getPreviousPageUrl(),\n };\n }\n /**\n * Returns JSON representation of the paginated\n * data\n */\n toJSON() {\n return {\n meta: this.getMeta(),\n data: this.all(),\n };\n }\n /**\n * Define query string to be appended to the pagination links\n */\n queryString(values) {\n this.qs = values;\n return this;\n }\n /**\n * Define base url for making the pagination links\n */\n baseUrl(url) {\n this.url = url;\n return this;\n }\n /**\n * Returns url for a given page. Doesn't validates the integrity of the\n * page\n */\n getUrl(page) {\n const qs = stringify(Object.assign({}, this.qs, { page: page < 1 ? 1 : page }));\n return `${this.url}?${qs}`;\n }\n /**\n * Returns url for the next page\n */\n getNextPageUrl() {\n if (this.hasMorePages) {\n return this.getUrl(this.currentPage + 1);\n }\n return null;\n }\n /**\n * Returns URL for the previous page\n */\n getPreviousPageUrl() {\n if (this.currentPage > 1) {\n return this.getUrl(this.currentPage - 1);\n }\n return null;\n }\n /**\n * Returns an array of urls under a given range\n */\n getUrlsForRange(start, end) {\n let urls = [];\n for (let i = start; i <= end; i++) {\n urls.push({ url: this.getUrl(i), page: i, isActive: i === this.currentPage });\n }\n return urls;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { SimplePaginator } from '../../database/paginator/simple_paginator.js';\n/**\n * Model paginator extends the simple paginator and adds support for\n * serializing models as well\n */\nexport class ModelPaginator extends SimplePaginator {\n /**\n * Serialize models\n */\n serialize(cherryPick) {\n return {\n meta: this.getMeta(),\n data: this.all().map((row) => row.serialize(cherryPick)),\n };\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * Used for reporting queries using the profiler and the event\n * emitter\n */\nexport class QueryReporter {\n client;\n debug;\n data;\n eventName = 'db:query';\n startTime;\n isReady = false;\n constructor(client, debug, data) {\n this.client = client;\n this.debug = debug;\n this.data = data;\n }\n /**\n * Initiate the hrtime when there are one or more query listeners\n */\n initStartTime() {\n if (!this.client.emitter.hasListeners(this.eventName) || !this.debug) {\n return;\n }\n this.startTime = process.hrtime();\n }\n /**\n * Emit the query with duration\n */\n emitQueryEvent(error) {\n if (!this.startTime) {\n return;\n }\n const eventData = { duration: process.hrtime(this.startTime), ...this.data, error };\n this.client.emitter.emit(this.eventName, eventData);\n }\n /**\n * Begin query reporting. Data passed to this method will\n * overwrite the existing data object\n */\n begin(data) {\n this.isReady = true;\n this.data = data || this.data;\n this.initStartTime();\n return this;\n }\n /**\n * End query reporting\n */\n end(error) {\n if (!this.isReady) {\n return;\n }\n this.emitQueryEvent(error);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { Exception } from '@poppinss/utils';\nimport { QueryReporter } from '../query_reporter/index.js';\n/**\n * Query runner exposes the API for executing knex query builder by using the\n * read/write replicas supported only by Lucid.\n *\n * Also it will emit the query data and profile the queries as well.\n */\nexport class QueryRunner {\n client;\n debug;\n logData;\n reporter;\n constructor(client, debug, logData) {\n this.client = client;\n this.debug = debug;\n this.logData = logData;\n this.reporter = new QueryReporter(this.client, this.debug, this.logData);\n }\n /**\n * Is query dialect using sqlite database or not\n */\n isUsingSqlite() {\n return ['sqlite3', 'better-sqlite3', 'libsql'].includes(this.client.dialect.name);\n }\n /**\n * Find if query has a transaction attached to it, by using\n * `useTransaction` method\n */\n isInTransaction(query) {\n return query['client'].transacting;\n }\n /**\n * Find if query is a write query or not.\n */\n isWriteQuery(query) {\n return ['update', 'del', 'delete', 'insert'].includes(query['_method']);\n }\n /**\n * Returns read or write client by inspecting the query\n */\n getQueryClient(query) {\n return this.isWriteQuery(query) ? this.client.getWriteClient() : this.client.getReadClient();\n }\n /**\n * Executes the query by handling exceptions and returns it back\n * gracefully.\n */\n async executeQuery(query) {\n try {\n const result = await query;\n return [undefined, result];\n }\n catch (error) {\n return [error, undefined];\n }\n }\n /**\n * Executes the knex builder directly\n */\n async executeDirectly(query) {\n /**\n * We listen for query event on the knex query builder to avoid calling\n * toSQL too many times and also get the actual time it took to\n * execute the query\n */\n ;\n query['once']('query', (sql) => this.reporter.begin({ ...this.logData, ...sql }));\n const [error, result] = await this.executeQuery(query);\n this.reporter.end(error);\n if (error) {\n throw error;\n }\n return result;\n }\n /**\n * Executes query by using a proper read or write connection.\n */\n async executeUsingManagedConnection(query) {\n const queryClient = this.getQueryClient(query);\n /**\n * Acquire connection from the knex connection pool. This is will\n * use the rounding robin mechanism and force set it on\n * the query.\n */\n const connection = await queryClient.client.acquireConnection();\n query.connection(connection);\n query['once']('query', (sql) => this.reporter.begin({ ...this.logData, ...sql }));\n /**\n * Execute query and report event and profiler data\n */\n const [error, result] = await this.executeQuery(query);\n this.reporter.end(error);\n /**\n * Make sure to always release the connection\n */\n queryClient.client.releaseConnection(connection);\n /**\n * If there was an error, raise it or return the result\n */\n if (error) {\n throw error;\n }\n return result;\n }\n /**\n * Run query by managing its life-cycle\n */\n async run(query) {\n /**\n * We execute the queries using transaction or using sqlite database\n * directly.\n *\n * - The transaction already has a pre-acquired connection.\n * - There is no concept of read/write replicas in sqlite.\n */\n if (this.isUsingSqlite() || this.isInTransaction(query)) {\n return this.executeDirectly(query);\n }\n /**\n * Cannot execute write queries with client in read mode\n */\n if (this.isWriteQuery(query) && this.client.mode === 'read') {\n throw new Exception('Updates and deletes cannot be performed in read mode');\n }\n return this.executeUsingManagedConnection(query);\n }\n}\n","// index.ts\nvar Macroable = class {\n /**\n *\n * Macros are standard properties that gets added to the class prototype.\n *\n * ```ts\n * MyClass.macro('foo', 'bar')\n * ```\n */\n static macro(name, value) {\n this.prototype[name] = value;\n }\n /**\n *\n * Getters are added to the class prototype using the Object.defineProperty.\n *\n * ```ts\n * MyClass.getter('foo', function foo () {\n * return 'bar'\n * })\n * ```\n *\n * You can add a singleton getter by enabling the `singleton` flag.\n *\n * ```ts\n * const singleton = true\n *\n * MyClass.getter('foo', function foo () {\n * return 'bar'\n * }, singleton)\n * ```\n */\n static getter(name, accumulator, singleton = false) {\n Object.defineProperty(this.prototype, name, {\n get() {\n const value = accumulator.call(this);\n if (singleton) {\n Object.defineProperty(this, name, {\n configurable: false,\n enumerable: false,\n value,\n writable: false\n });\n }\n return value;\n },\n configurable: true,\n enumerable: false\n });\n }\n};\nexport {\n Macroable as default\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { QueryRunner } from '../../query_runner/index.js';\n/**\n * Exposes the API to execute raw queries\n */\nexport class RawQueryBuilder {\n knexQuery;\n client;\n /**\n * Custom data someone want to send to the profiler and the\n * query event\n */\n customReporterData;\n /**\n * Control whether to debug the query or not. The initial\n * value is inherited from the query client\n */\n debugQueries;\n constructor(knexQuery, client) {\n this.knexQuery = knexQuery;\n this.client = client;\n this.debugQueries = this.client.debug;\n }\n /**\n * Returns the log data\n */\n getQueryData() {\n return {\n connection: this.client.connectionName,\n inTransaction: this.client.isTransaction,\n ...this.customReporterData,\n };\n }\n /**\n * Define custom reporter data. It will be merged with\n * the existing data\n */\n reporterData(data) {\n this.customReporterData = data;\n return this;\n }\n /**\n * Wrap the query with before/after strings.\n */\n wrap(before, after) {\n this.knexQuery.wrap(before, after);\n return this;\n }\n /**\n * Turn on/off debugging for this query\n */\n debug(debug) {\n this.debugQueries = debug;\n return this;\n }\n /**\n * Define query timeout\n */\n timeout(time, options) {\n this.knexQuery['timeout'](time, options);\n return this;\n }\n /**\n * Returns SQL query as a string\n */\n toQuery() {\n return this.knexQuery.toQuery();\n }\n /**\n * @deprecated\n * Do not use this method. Instead create a query using the\n * transaction client directly.\n *\n * ```ts\n * trx.rawQuery()\n * ```\n */\n useTransaction(transaction) {\n this.knexQuery.transacting(transaction.knexClient);\n return this;\n }\n /**\n * Executes the query\n */\n async exec() {\n return new QueryRunner(this.client, this.debugQueries, this.getQueryData()).run(this.knexQuery);\n }\n /**\n * Get sql representation of the query\n */\n toSQL() {\n return this.knexQuery.toSQL();\n }\n /**\n * Implementation of `then` for the promise API\n */\n then(resolve, reject) {\n return this.exec().then(resolve, reject);\n }\n /**\n * Implementation of `catch` for the promise API\n */\n catch(reject) {\n return this.exec().catch(reject);\n }\n /**\n * Implementation of `finally` for the promise API\n */\n finally(fullfilled) {\n return this.exec().finally(fullfilled);\n }\n /**\n * Required when Promises are extended\n */\n get [Symbol.toStringTag]() {\n return this.constructor.name;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * Exposes the API to construct raw queries. If you want to execute\n * raw queries, you can use the RawQueryBuilder\n */\nexport class RawBuilder {\n sql;\n bindings;\n wrapBefore;\n wrapAfter;\n constructor(sql, bindings) {\n this.sql = sql;\n this.bindings = bindings;\n }\n /**\n * Wrap the query with before/after strings.\n */\n wrap(before, after) {\n this.wrapAfter = after;\n this.wrapBefore = before;\n return this;\n }\n /**\n * Converts the raw query to knex raw query instance\n */\n toKnex(client) {\n const rawQuery = client.raw(this.sql, this.bindings);\n if (this.wrapBefore && this.wrapAfter) {\n rawQuery.wrap(this.wrapBefore, this.wrapAfter);\n }\n return rawQuery;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * Reference builder to create SQL reference values\n */\nexport class ReferenceBuilder {\n ref;\n client;\n schema;\n alias;\n constructor(ref, client) {\n this.ref = ref;\n this.client = client;\n }\n /**\n * Define schema\n */\n withSchema(schema) {\n this.schema = schema;\n return this;\n }\n /**\n * Define alias\n */\n as(alias) {\n this.alias = alias;\n return this;\n }\n /**\n * Converts reference to knex\n */\n toKnex(client) {\n const ref = (client || this.client).ref(this.ref);\n this.schema && ref.withSchema(this.schema);\n this.alias && ref.as(this.alias);\n return ref;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport Macroable from '@poppinss/macroable';\nimport { Exception } from '@poppinss/utils';\nimport { isObject } from '../../utils/index.js';\nimport { RawQueryBuilder } from './raw.js';\nimport { RawBuilder } from '../static_builder/raw.js';\nimport { ReferenceBuilder } from '../static_builder/reference.js';\n/**\n * The chainable query builder to construct SQL queries for selecting, updating and\n * deleting records.\n *\n * The API internally uses the knex query builder. However, many of methods may have\n * different API.\n */\nexport class Chainable extends Macroable {\n knexQuery;\n queryCallback;\n keysResolver;\n hasAggregates = false;\n hasGroupBy = false;\n hasUnion = false;\n /**\n * Collection where clauses in a 2nd array. Calling `wrapExisting`\n * adds a new stack item\n */\n whereStack = [[]];\n /**\n * Returns the recent most array from the where stack\n */\n getRecentStackItem() {\n return this.whereStack[this.whereStack.length - 1];\n }\n /**\n * Returns the wrapping method for a given where method\n */\n getWrappingMethod(method) {\n if (method.startsWith('or')) {\n return {\n method: method,\n wrappingMethod: 'orWhere',\n };\n }\n return {\n method: method,\n wrappingMethod: 'where',\n };\n }\n /**\n * Applies the where clauses\n */\n applyWhere() {\n this.knexQuery.clearWhere();\n if (this.whereStack.length === 1) {\n this.whereStack[0].forEach(({ method, args }) => {\n ;\n this.knexQuery[method](...args);\n });\n return;\n }\n this.whereStack.forEach((collection) => {\n if (collection.length) {\n const firstItem = collection.shift();\n const wrapper = this.getWrappingMethod(firstItem.method);\n this.knexQuery[wrapper.wrappingMethod]((subquery) => {\n subquery[wrapper.method](...firstItem.args);\n collection.forEach(({ method, args }) => subquery[method](...args));\n });\n }\n });\n }\n /**\n * An array of selected columns\n */\n get columns() {\n return this.knexQuery['_statements']\n .filter(({ grouping }) => grouping === 'columns')\n .reduce((result, { value }) => {\n result = result.concat(value);\n return result;\n }, []);\n }\n /**\n * Custom alias for the query results. Ignored if it not a\n * subquery\n */\n subQueryAlias;\n constructor(knexQuery, queryCallback, keysResolver) {\n super();\n this.knexQuery = knexQuery;\n this.queryCallback = queryCallback;\n this.keysResolver = keysResolver;\n }\n /**\n * Raises exception when only one argument is passed to a where\n * clause and it is a string. It means the value is undefined\n */\n validateWhereSingleArgument(value, method) {\n if (typeof value === 'string') {\n throw new Exception(`\".${method}\" expects value to be defined, but undefined is passed`);\n }\n }\n /**\n * Returns the value pair for the `whereBetween` clause\n */\n getBetweenPair(value) {\n const [lhs, rhs] = value;\n if (lhs === undefined || rhs === undefined) {\n throw new Error('Invalid array for whereBetween value');\n }\n return [this.transformValue(lhs), this.transformValue(rhs)];\n }\n /**\n * Normalizes the columns aggregates functions to something\n * knex can process.\n */\n normalizeAggregateColumns(columns, alias) {\n if (columns.constructor === Object) {\n return Object.keys(columns).reduce((result, key) => {\n const value = columns[key];\n result[key] =\n typeof value === 'string' ? this.resolveKey(value) : this.transformValue(value);\n return result;\n }, {});\n }\n if (!alias) {\n return columns;\n }\n return {\n [alias]: typeof columns === 'string' ? this.resolveKey(columns) : this.transformValue(columns),\n };\n }\n /**\n * Resolves the column name considering raw queries as well.\n */\n resolveColumn(columns, checkForObject = false, returnValue) {\n if (columns instanceof RawQueryBuilder) {\n return columns['knexQuery'];\n }\n if (columns instanceof RawBuilder) {\n return columns.toKnex(this.knexQuery.client);\n }\n return this.resolveKey(columns, checkForObject, returnValue);\n }\n /**\n * Resolves column names\n */\n resolveKey(columns, checkForObject = false, returnValue) {\n /**\n * If there is no keys resolver in place, then return the\n * optional return value or defined column(s)\n */\n if (!this.keysResolver) {\n return returnValue || columns;\n }\n /**\n * If column is a string, then resolve it as a key\n */\n if (typeof columns === 'string') {\n return columns === '*' ? columns : this.keysResolver(columns);\n }\n /**\n * If check for objects is enabled, then resolve object keys\n */\n if (checkForObject && isObject(columns)) {\n return Object.keys(columns).reduce((result, column) => {\n result[this.keysResolver(column)] = columns[column];\n return result;\n }, {});\n }\n /**\n * Return the return value or columns as fallback\n */\n return returnValue || columns;\n }\n /**\n * Apply existing query flags to a new query builder. This is\n * done during clone operation\n */\n applyQueryFlags(query) {\n query.hasAggregates = this.hasAggregates;\n query.hasGroupBy = this.hasGroupBy;\n query.hasUnion = this.hasUnion;\n query.whereStack = this.whereStack.map((collection) => {\n return collection.map((node) => node);\n });\n }\n /**\n * Transforms the value to something that knex can internally understand and\n * handle. It includes.\n *\n * 1. Returning the `knexBuilder` for sub queries.\n * 2. Returning the `knex.refBuilder` for reference builder.\n * 2. Returning the `knexBuilder` for raw queries.\n * 3. Wrapping callbacks, so that the end user receives an instance Lucid query\n * builder and not knex query builder.\n */\n transformValue(value) {\n if (value instanceof Chainable) {\n return value.toKnex();\n }\n if (value instanceof ReferenceBuilder) {\n return value.toKnex(this.knexQuery.client);\n }\n if (typeof value === 'function') {\n return this.transformCallback(value);\n }\n return this.transformRaw(value);\n }\n /**\n * Transforms the user callback to something that knex\n * can internally process\n */\n transformCallback(value) {\n if (typeof value === 'function') {\n return this.queryCallback(value, this.keysResolver);\n }\n return value;\n }\n /**\n * Returns the underlying knex raw query builder for Lucid raw\n * query builder\n */\n transformRaw(value) {\n if (value instanceof RawQueryBuilder) {\n return value['knexQuery'];\n }\n if (value instanceof RawBuilder) {\n return value.toKnex(this.knexQuery.client);\n }\n return value;\n }\n /**\n * Define columns for selection\n */\n select(...args) {\n let columns = args;\n if (Array.isArray(args[0])) {\n columns = args[0];\n }\n this.knexQuery.select(columns.map((column) => {\n if (typeof column === 'string') {\n return this.resolveKey(column, true);\n }\n return this.transformValue(column);\n }));\n return this;\n }\n /**\n * Select table for the query. Re-calling this method multiple times will\n * use the last selected table\n */\n from(table) {\n this.knexQuery.from(this.transformValue(table));\n return this;\n }\n /**\n * Wrap existing where clauses to its own group\n */\n wrapExisting() {\n if (this.getRecentStackItem().length) {\n this.whereStack.push([]);\n }\n return this;\n }\n /**\n * Add a `where` clause\n */\n where(key, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (value !== undefined) {\n whereClauses.push({\n method: 'where',\n args: [this.resolveColumn(key), operator, this.transformValue(value)],\n });\n }\n else if (operator !== undefined) {\n whereClauses.push({\n method: 'where',\n args: [this.resolveColumn(key), this.transformValue(operator)],\n });\n }\n else {\n /**\n * Only callback is allowed as a standalone param. One must use `whereRaw`\n * for raw/sub queries. This is our limitation to have consistent API\n */\n this.validateWhereSingleArgument(key, 'where');\n whereClauses.push({\n method: 'where',\n args: [this.resolveColumn(key, true, this.transformCallback(key))],\n });\n }\n return this;\n }\n /**\n * Add a `or where` clause\n */\n orWhere(key, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (value !== undefined) {\n whereClauses.push({\n method: 'orWhere',\n args: [this.resolveColumn(key), operator, this.transformValue(value)],\n });\n }\n else if (operator !== undefined) {\n whereClauses.push({\n method: 'orWhere',\n args: [this.resolveColumn(key), this.transformValue(operator)],\n });\n }\n else {\n this.validateWhereSingleArgument(key, 'orWhere');\n whereClauses.push({\n method: 'orWhere',\n args: [this.resolveColumn(key, true, this.transformCallback(key))],\n });\n }\n return this;\n }\n /**\n * Alias for `where`\n */\n andWhere(key, operator, value) {\n return this.where(key, operator, value);\n }\n /**\n * Adding `where not` clause\n */\n whereNot(key, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (value !== undefined) {\n whereClauses.push({\n method: 'whereNot',\n args: [this.resolveColumn(key), operator, this.transformValue(value)],\n });\n }\n else if (operator !== undefined) {\n whereClauses.push({\n method: 'whereNot',\n args: [this.resolveColumn(key), this.transformValue(operator)],\n });\n }\n else {\n this.validateWhereSingleArgument(key, 'whereNot');\n whereClauses.push({\n method: 'whereNot',\n args: [this.resolveColumn(key, true, this.transformCallback(key))],\n });\n }\n return this;\n }\n /**\n * Adding `or where not` clause\n */\n orWhereNot(key, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (value !== undefined) {\n whereClauses.push({\n method: 'orWhereNot',\n args: [this.resolveColumn(key), operator, this.transformValue(value)],\n });\n }\n else if (operator !== undefined) {\n whereClauses.push({\n method: 'orWhereNot',\n args: [this.resolveColumn(key), this.transformValue(operator)],\n });\n }\n else {\n this.validateWhereSingleArgument(key, 'orWhereNot');\n whereClauses.push({\n method: 'orWhereNot',\n args: [this.resolveColumn(key, true, this.transformCallback(key))],\n });\n }\n return this;\n }\n /**\n * Alias for [[whereNot]]\n */\n andWhereNot(key, operator, value) {\n return this.whereNot(key, operator, value);\n }\n /**\n * Add a where clause on a given column\n */\n whereColumn(column, operator, comparisonColumn) {\n if (comparisonColumn !== undefined) {\n this.where(column, operator, new ReferenceBuilder(comparisonColumn, this.knexQuery.client));\n }\n else {\n this.where(column, new ReferenceBuilder(operator, this.knexQuery.client));\n }\n return this;\n }\n /**\n * Add a orWhere clause on a given column\n */\n orWhereColumn(column, operator, comparisonColumn) {\n if (comparisonColumn !== undefined) {\n this.orWhere(column, operator, new ReferenceBuilder(comparisonColumn, this.knexQuery.client));\n }\n else {\n this.orWhere(column, new ReferenceBuilder(operator, this.knexQuery.client));\n }\n return this;\n }\n /**\n * Alias for whereColumn\n */\n andWhereColumn(column, operator, comparisonColumn) {\n return this.whereColumn(column, operator, comparisonColumn);\n }\n /**\n * Add a whereNot clause on a given column\n */\n whereNotColumn(column, operator, comparisonColumn) {\n if (comparisonColumn !== undefined) {\n this.whereNot(column, operator, new ReferenceBuilder(comparisonColumn, this.knexQuery.client));\n }\n else {\n this.whereNot(column, new ReferenceBuilder(operator, this.knexQuery.client));\n }\n return this;\n }\n /**\n * Add a orWhereNotColumn clause on a given column\n */\n orWhereNotColumn(column, operator, comparisonColumn) {\n if (comparisonColumn !== undefined) {\n this.orWhereNot(column, operator, new ReferenceBuilder(comparisonColumn, this.knexQuery.client));\n }\n else {\n this.orWhereNot(column, new ReferenceBuilder(operator, this.knexQuery.client));\n }\n return this;\n }\n /**\n * Alias for whereNotColumn\n */\n andWhereNotColumn(column, operator, comparisonColumn) {\n return this.whereNotColumn(column, operator, comparisonColumn);\n }\n /**\n * Adding a `where in` clause\n */\n whereIn(columns, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveColumn(column))\n : this.resolveColumn(columns);\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereIn',\n args: [columns, value],\n });\n return this;\n }\n /**\n * Adding a `or where in` clause\n */\n orWhereIn(columns, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveColumn(column))\n : this.resolveColumn(columns);\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereIn',\n args: [columns, value],\n });\n return this;\n }\n /**\n * Alias for [[whereIn]]\n */\n andWhereIn(key, value) {\n return this.whereIn(key, value);\n }\n /**\n * Adding a `where not in` clause\n */\n whereNotIn(columns, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveColumn(column))\n : this.resolveColumn(columns);\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNotIn',\n args: [columns, value],\n });\n return this;\n }\n /**\n * Adding a `or where not in` clause\n */\n orWhereNotIn(columns, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveColumn(column))\n : this.resolveColumn(columns);\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotIn',\n args: [columns, value],\n });\n return this;\n }\n /**\n * Alias for [[whereNotIn]]\n */\n andWhereNotIn(key, value) {\n return this.whereNotIn(key, value);\n }\n /**\n * Adding `where not null` clause\n */\n whereNull(key) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNull',\n args: [this.resolveColumn(key)],\n });\n return this;\n }\n /**\n * Adding `or where not null` clause\n */\n orWhereNull(key) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNull',\n args: [this.resolveColumn(key)],\n });\n return this;\n }\n /**\n * Alias for [[whereNull]]\n */\n andWhereNull(key) {\n return this.whereNull(key);\n }\n /**\n * Adding `where not null` clause\n */\n whereNotNull(key) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNotNull',\n args: [this.resolveColumn(key)],\n });\n return this;\n }\n /**\n * Adding `or where not null` clause\n */\n orWhereNotNull(key) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotNull',\n args: [this.resolveColumn(key)],\n });\n return this;\n }\n /**\n * Alias for [[whereNotNull]]\n */\n andWhereNotNull(key) {\n return this.whereNotNull(key);\n }\n /**\n * Add a `where exists` clause\n */\n whereExists(value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereExists',\n args: [this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `or where exists` clause\n */\n orWhereExists(value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereExists',\n args: [this.transformValue(value)],\n });\n return this;\n }\n /**\n * Alias for [[whereExists]]\n */\n andWhereExists(value) {\n return this.whereExists(value);\n }\n /**\n * Add a `where not exists` clause\n */\n whereNotExists(value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNotExists',\n args: [this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `or where not exists` clause\n */\n orWhereNotExists(value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotExists',\n args: [this.transformValue(value)],\n });\n return this;\n }\n /**\n * Alias for [[whereNotExists]]\n */\n andWhereNotExists(value) {\n return this.whereNotExists(value);\n }\n /**\n * Add where between clause\n */\n whereBetween(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereBetween',\n args: [this.resolveColumn(key), this.getBetweenPair(value)],\n });\n return this;\n }\n /**\n * Add where between clause\n */\n orWhereBetween(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereBetween',\n args: [this.resolveColumn(key), this.getBetweenPair(value)],\n });\n return this;\n }\n /**\n * Alias for [[whereBetween]]\n */\n andWhereBetween(key, value) {\n return this.whereBetween(key, value);\n }\n /**\n * Add where between clause\n */\n whereNotBetween(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNotBetween',\n args: [this.resolveColumn(key), this.getBetweenPair(value)],\n });\n return this;\n }\n /**\n * Add where between clause\n */\n orWhereNotBetween(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotBetween',\n args: [this.resolveColumn(key), this.getBetweenPair(value)],\n });\n return this;\n }\n /**\n * Alias for [[whereNotBetween]]\n */\n andWhereNotBetween(key, value) {\n return this.whereNotBetween(key, value);\n }\n /**\n * Adding a where clause using raw sql\n */\n whereRaw(sql, bindings) {\n const whereClauses = this.getRecentStackItem();\n if (bindings) {\n bindings = Array.isArray(bindings)\n ? bindings.map((binding) => this.transformValue(binding))\n : bindings;\n whereClauses.push({\n method: 'whereRaw',\n args: [sql, bindings],\n });\n }\n else {\n whereClauses.push({\n method: 'whereRaw',\n args: [this.transformRaw(sql)],\n });\n }\n return this;\n }\n /**\n * Adding a or where clause using raw sql\n */\n orWhereRaw(sql, bindings) {\n const whereClauses = this.getRecentStackItem();\n if (bindings) {\n bindings = Array.isArray(bindings)\n ? bindings.map((binding) => this.transformValue(binding))\n : bindings;\n whereClauses.push({\n method: 'orWhereRaw',\n args: [sql, bindings],\n });\n }\n else {\n whereClauses.push({\n method: 'orWhereRaw',\n args: [this.transformRaw(sql)],\n });\n }\n return this;\n }\n /**\n * Alias for [[whereRaw]]\n */\n andWhereRaw(sql, bindings) {\n return this.whereRaw(sql, bindings);\n }\n /**\n * Add a `where like` clause\n */\n whereLike(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereLike',\n args: [this.resolveColumn(key), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `where like` clause\n */\n orWhereLike(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereLike',\n args: [this.resolveColumn(key), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `where like` clause\n */\n andWhereLike(key, value) {\n return this.whereLike(key, value);\n }\n /**\n * Add a `where like` clause\n */\n whereILike(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereILike',\n args: [this.resolveColumn(key), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `where like` clause\n */\n orWhereILike(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereILike',\n args: [this.resolveColumn(key), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `where like` clause\n */\n andWhereILike(key, value) {\n return this.whereILike(key, value);\n }\n /**\n * Define a where clause with value that matches for JSON\n */\n whereJson(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereJsonObject',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for JSON\n */\n orWhereJson(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereJsonObject',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a where clause with value that matches for JSON\n *\n * @alias whereJson\n */\n andWhereJson(column, value) {\n return this.whereJson(column, value);\n }\n /**\n * Define a where clause with value that matches for JSON\n */\n whereNotJson(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNotJsonObject',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for JSON\n */\n orWhereNotJson(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotJsonObject',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a where clause with value that matches for JSON\n *\n * @alias whereNotJson\n */\n andWhereNotJson(column, value) {\n return this.whereNotJson(column, value);\n }\n /**\n * Define a where clause with value that matches for a superset of\n * JSON\n */\n whereJsonSuperset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereJsonSupersetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for a superset of\n * JSON\n */\n orWhereJsonSuperset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereJsonSupersetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define or where clause with value that matches for a superset of\n * JSON\n *\n * @alias whereJsonSuperset\n */\n andWhereJsonSuperset(column, value) {\n return this.whereJsonSuperset(column, value);\n }\n /**\n * Define a where clause with value that matches for a superset of\n * JSON\n */\n whereNotJsonSuperset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereJsonNotSupersetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for a superset of\n * JSON\n */\n orWhereNotJsonSuperset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereJsonNotSupersetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define or where clause with value that matches for a superset of\n * JSON\n *\n * @alias whereNotJsonSuperset\n */\n andWhereNotJsonSuperset(column, value) {\n return this.whereNotJsonSuperset(column, value);\n }\n /**\n * Define a where clause with value that matches for a subset of\n * JSON\n */\n whereJsonSubset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereJsonSubsetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for a subset of\n * JSON\n */\n orWhereJsonSubset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereJsonSubsetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define or where clause with value that matches for a subset of\n * JSON\n *\n * @alias whereJsonSubset\n */\n andWhereJsonSubset(column, value) {\n return this.whereJsonSubset(column, value);\n }\n /**\n * Define a where clause with value that matches for a subset of\n * JSON\n */\n whereNotJsonSubset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereJsonNotSubsetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for a subset of\n * JSON\n */\n orWhereNotJsonSubset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereJsonNotSubsetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define or where clause with value that matches for a subset of\n * JSON\n *\n * @alias whereNotJsonSubset\n */\n andWhereNotJsonSubset(column, value) {\n return this.whereNotJsonSubset(column, value);\n }\n /**\n * Adds a where clause with comparison of a value returned\n * by a JsonPath given an operator and a value.\n */\n whereJsonPath(column, jsonPath, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (!value) {\n value = operator;\n operator = '=';\n }\n whereClauses.push({\n method: 'whereJsonPath',\n args: [this.resolveColumn(column), jsonPath, operator, this.transformValue(value)],\n });\n return this;\n }\n /**\n * Adds a or where clause with comparison of a value returned\n * by a JsonPath given an operator and a value.\n */\n orWhereJsonPath(column, jsonPath, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (!value) {\n value = operator;\n operator = '=';\n }\n whereClauses.push({\n method: 'orWhereJsonPath',\n args: [this.resolveColumn(column), jsonPath, operator, this.transformValue(value)],\n });\n return this;\n }\n /**\n * Adds a where clause with comparison of a value returned\n * by a JsonPath given an operator and a value.\n *\n * @alias whereJsonPath\n */\n andWhereJsonPath(column, jsonPath, operator, value) {\n return this.whereJsonPath(column, jsonPath, operator, value);\n }\n /**\n * Add a join clause\n */\n join(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.join(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.join(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.join(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add an inner join clause\n */\n innerJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.innerJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.innerJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.innerJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a left join clause\n */\n leftJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.leftJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.leftJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.leftJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a left outer join clause\n */\n leftOuterJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.leftOuterJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.leftOuterJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.leftOuterJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a right join clause\n */\n rightJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.rightJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.rightJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.rightJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a right outer join clause\n */\n rightOuterJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.rightOuterJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.rightOuterJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.rightOuterJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a full outer join clause\n */\n fullOuterJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.fullOuterJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.fullOuterJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.fullOuterJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a cross join clause\n */\n crossJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.crossJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.crossJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.crossJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add join clause as a raw query\n */\n joinRaw(sql, bindings) {\n if (bindings) {\n this.knexQuery.joinRaw(sql, bindings);\n }\n else {\n this.knexQuery.joinRaw(this.transformRaw(sql));\n }\n return this;\n }\n /**\n * Adds a having clause. The having clause breaks for `postgreSQL` when\n * referencing alias columns, since PG doesn't support alias columns\n * being referred within `having` clause. The end user has to\n * use raw queries in this case.\n */\n having(key, operator, value) {\n if (value !== undefined) {\n this.knexQuery.having(this.resolveColumn(key), operator, this.transformValue(value));\n return this;\n }\n if (operator !== undefined) {\n throw new Exception('Invalid arguments for \"queryBuilder.having\". Excepts a callback or key-value pair along with an operator');\n }\n this.knexQuery.having(this.transformValue(key));\n return this;\n }\n /**\n * Adds or having clause. The having clause breaks for `postgreSQL` when\n * referencing alias columns, since PG doesn't support alias columns\n * being referred within `having` clause. The end user has to\n * use raw queries in this case.\n */\n orHaving(key, operator, value) {\n if (value !== undefined) {\n this.knexQuery.orHaving(this.resolveColumn(key), operator, this.transformValue(value));\n return this;\n }\n if (operator !== undefined) {\n throw new Exception('Invalid arguments for \"queryBuilder.orHaving\". Excepts a callback or key-value pair along with an operator');\n }\n this.knexQuery.orHaving(this.transformValue(key));\n return this;\n }\n /**\n * Alias for [[having]]\n */\n andHaving(key, operator, value) {\n return this.having(key, operator, value);\n }\n /**\n * Adding having in clause to the query\n */\n havingIn(key, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n this.knexQuery.havingIn(this.resolveColumn(key), value);\n return this;\n }\n /**\n * Adding or having in clause to the query\n */\n orHavingIn(key, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n this.knexQuery['orHavingIn'](this.resolveColumn(key), value);\n return this;\n }\n /**\n * Alias for [[havingIn]]\n */\n andHavingIn(key, value) {\n return this.havingIn(key, value);\n }\n /**\n * Adding having not in clause to the query\n */\n havingNotIn(key, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n this.knexQuery['havingNotIn'](this.resolveColumn(key), value);\n return this;\n }\n /**\n * Adding or having not in clause to the query\n */\n orHavingNotIn(key, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n this.knexQuery['orHavingNotIn'](this.resolveColumn(key), value);\n return this;\n }\n /**\n * Alias for [[havingNotIn]]\n */\n andHavingNotIn(key, value) {\n return this.havingNotIn(key, value);\n }\n /**\n * Adding having null clause\n */\n havingNull(key) {\n this.knexQuery['havingNull'](this.resolveColumn(key));\n return this;\n }\n /**\n * Adding or having null clause\n */\n orHavingNull(key) {\n ;\n this.knexQuery['orHavingNull'](this.resolveColumn(key));\n return this;\n }\n /**\n * Alias for [[havingNull]] clause\n */\n andHavingNull(key) {\n return this.havingNull(key);\n }\n /**\n * Adding having not null clause\n */\n havingNotNull(key) {\n this.knexQuery['havingNotNull'](this.resolveColumn(key));\n return this;\n }\n /**\n * Adding or having not null clause\n */\n orHavingNotNull(key) {\n ;\n this.knexQuery['orHavingNotNull'](this.resolveColumn(key));\n return this;\n }\n /**\n * Alias for [[havingNotNull]] clause\n */\n andHavingNotNull(key) {\n return this.havingNotNull(key);\n }\n /**\n * Adding `having exists` clause\n */\n havingExists(value) {\n ;\n this.knexQuery['havingExists'](this.transformValue(value));\n return this;\n }\n /**\n * Adding `or having exists` clause\n */\n orHavingExists(value) {\n ;\n this.knexQuery['orHavingExists'](this.transformValue(value));\n return this;\n }\n /**\n * Alias for [[havingExists]]\n */\n andHavingExists(value) {\n return this.havingExists(value);\n }\n /**\n * Adding `having not exists` clause\n */\n havingNotExists(value) {\n ;\n this.knexQuery['havingNotExists'](this.transformValue(value));\n return this;\n }\n /**\n * Adding `or having not exists` clause\n */\n orHavingNotExists(value) {\n ;\n this.knexQuery['orHavingNotExists'](this.transformValue(value));\n return this;\n }\n /**\n * Alias for [[havingNotExists]]\n */\n andHavingNotExists(value) {\n return this.havingNotExists(value);\n }\n /**\n * Adding `having between` clause\n */\n havingBetween(key, value) {\n this.knexQuery.havingBetween(this.resolveColumn(key), this.getBetweenPair(value));\n return this;\n }\n /**\n * Adding `or having between` clause\n */\n orHavingBetween(key, value) {\n this.knexQuery.orHavingBetween(this.resolveColumn(key), this.getBetweenPair(value));\n return this;\n }\n /**\n * Alias for [[havingBetween]]\n */\n andHavingBetween(key, value) {\n return this.havingBetween(this.resolveColumn(key), value);\n }\n /**\n * Adding `having not between` clause\n */\n havingNotBetween(key, value) {\n this.knexQuery.havingNotBetween(this.resolveColumn(key), this.getBetweenPair(value));\n return this;\n }\n /**\n * Adding `or having not between` clause\n */\n orHavingNotBetween(key, value) {\n this.knexQuery.orHavingNotBetween(this.resolveColumn(key), this.getBetweenPair(value));\n return this;\n }\n /**\n * Alias for [[havingNotBetween]]\n */\n andHavingNotBetween(key, value) {\n return this.havingNotBetween(key, value);\n }\n /**\n * Adding a where clause using raw sql\n */\n havingRaw(sql, bindings) {\n if (bindings) {\n this.knexQuery.havingRaw(sql, bindings);\n }\n else {\n this.knexQuery.havingRaw(this.transformRaw(sql));\n }\n return this;\n }\n /**\n * Adding a where clause using raw sql\n */\n orHavingRaw(sql, bindings) {\n if (bindings) {\n this.knexQuery.orHavingRaw(sql, bindings);\n }\n else {\n this.knexQuery.orHavingRaw(this.transformRaw(sql));\n }\n return this;\n }\n /**\n * Alias for [[havingRaw]]\n */\n andHavingRaw(sql, bindings) {\n return this.havingRaw(sql, bindings);\n }\n /**\n * Add distinct clause\n */\n distinct(...columns) {\n this.knexQuery.distinct(...columns.map((column) => this.resolveKey(column)));\n return this;\n }\n /**\n * Add distinctOn clause\n */\n distinctOn(...columns) {\n this.knexQuery.distinctOn(...columns.map((column) => this.resolveKey(column)));\n return this;\n }\n /**\n * Add group by clause\n */\n groupBy(...columns) {\n this.hasGroupBy = true;\n this.knexQuery.groupBy(...columns.map((column) => this.resolveKey(column)));\n return this;\n }\n /**\n * Add group by clause as a raw query\n */\n groupByRaw(sql, bindings) {\n this.hasGroupBy = true;\n if (bindings) {\n this.knexQuery.groupByRaw(sql, bindings);\n }\n else {\n this.knexQuery.groupByRaw(this.transformRaw(sql));\n }\n return this;\n }\n /**\n * Add order by clause\n */\n orderBy(column, direction) {\n if (typeof column === 'string') {\n this.knexQuery.orderBy(this.resolveKey(column), direction);\n return this;\n }\n /**\n * Here value can be one of the following\n * ['age', 'name']\n * [{ column: 'age', direction: 'desc' }]\n *\n * [{ column: Database.query().from('user_logins'), direction: 'desc' }]\n */\n if (Array.isArray(column)) {\n const transformedColumns = column.map((col) => {\n if (typeof col === 'string') {\n return { column: this.resolveKey(col) };\n }\n if (col.column) {\n col.column =\n typeof col.column === 'string'\n ? this.resolveKey(col.column)\n : this.transformValue(col.column);\n return col;\n }\n return col;\n });\n this.knexQuery.orderBy(transformedColumns);\n return this;\n }\n this.knexQuery.orderBy(this.transformValue(column), direction);\n return this;\n }\n /**\n * Add order by clause as a raw query\n */\n orderByRaw(sql, bindings) {\n if (bindings) {\n this.knexQuery.orderByRaw(sql, bindings);\n }\n else {\n this.knexQuery.orderByRaw(this.transformRaw(sql));\n }\n return this;\n }\n /**\n * Define select offset\n */\n offset(value) {\n this.knexQuery.offset(value);\n return this;\n }\n /**\n * Define results limit\n */\n limit(value) {\n this.knexQuery.limit(value);\n return this;\n }\n /**\n * Define union queries\n */\n union(queries, wrap) {\n this.hasUnion = true;\n queries = Array.isArray(queries)\n ? queries.map((one) => this.transformValue(one))\n : this.transformValue(queries);\n wrap !== undefined ? this.knexQuery.union(queries, wrap) : this.knexQuery.union(queries);\n return this;\n }\n /**\n * Define union all queries\n */\n unionAll(queries, wrap) {\n this.hasUnion = true;\n queries = Array.isArray(queries)\n ? queries.map((one) => this.transformValue(one))\n : this.transformValue(queries);\n wrap !== undefined ? this.knexQuery.unionAll(queries, wrap) : this.knexQuery.unionAll(queries);\n return this;\n }\n /**\n * Define intersect queries\n */\n intersect(queries, wrap) {\n queries = Array.isArray(queries)\n ? queries.map((one) => this.transformValue(one))\n : this.transformValue(queries);\n wrap !== undefined ? this.knexQuery.intersect(queries, wrap) : this.knexQuery.intersect(queries);\n return this;\n }\n /**\n * Clear select columns\n */\n clearSelect() {\n this.knexQuery.clearSelect();\n return this;\n }\n /**\n * Clear where clauses\n */\n clearWhere() {\n this.whereStack = [[]];\n this.knexQuery.clearWhere();\n return this;\n }\n /**\n * Clear order by\n */\n clearOrder() {\n this.knexQuery.clearOrder();\n return this;\n }\n /**\n * Clear having\n */\n clearHaving() {\n this.knexQuery.clearHaving();\n return this;\n }\n /**\n * Clear limit\n */\n clearLimit() {\n ;\n this.knexQuery['_single'].limit = null;\n return this;\n }\n /**\n * Clear offset\n */\n clearOffset() {\n ;\n this.knexQuery['_single'].offset = null;\n return this;\n }\n /**\n * Specify `FOR UPDATE` lock mode for a given\n * query\n */\n forUpdate(...tableNames) {\n this.knexQuery.forUpdate(...tableNames);\n return this;\n }\n /**\n * Specify `FOR SHARE` lock mode for a given\n * query\n */\n forShare(...tableNames) {\n this.knexQuery.forShare(...tableNames);\n return this;\n }\n /**\n * Skip locked rows\n */\n skipLocked() {\n this.knexQuery.skipLocked();\n return this;\n }\n /**\n * Fail when query wants a locked row\n */\n noWait() {\n this.knexQuery.noWait();\n return this;\n }\n /**\n * Define `with` CTE\n */\n with(alias, query, columns = []) {\n if (columns.length > 0) {\n this.knexQuery.with(alias, columns, this.transformValue(query));\n }\n else {\n this.knexQuery.with(alias, this.transformValue(query));\n }\n return this;\n }\n /**\n * Define `with` CTE with recursive keyword\n */\n withRecursive(alias, query, columns = []) {\n if (columns.length > 0) {\n this.knexQuery.withRecursive(alias, columns, this.transformValue(query));\n }\n else {\n this.knexQuery.withRecursive(alias, this.transformValue(query));\n }\n return this;\n }\n /**\n * Define `with materialized` CTE\n */\n withMaterialized(alias, query, columns = []) {\n if (columns.length > 0) {\n this.knexQuery.withMaterialized(alias, columns, this.transformValue(query));\n }\n else {\n this.knexQuery.withMaterialized(alias, this.transformValue(query));\n }\n return this;\n }\n /**\n * Define not `with materialized` CTE\n */\n withNotMaterialized(alias, query, columns = []) {\n if (columns.length > 0) {\n this.knexQuery.withNotMaterialized(alias, columns, this.transformValue(query));\n }\n else {\n this.knexQuery.withNotMaterialized(alias, this.transformValue(query));\n }\n return this;\n }\n /**\n * Define schema for the table\n */\n withSchema(schema) {\n this.knexQuery.withSchema(schema);\n return this;\n }\n /**\n * Define table alias\n */\n as(alias) {\n this.subQueryAlias = alias;\n this.knexQuery.as(alias);\n return this;\n }\n /**\n * Count rows for the current query\n */\n count(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.count(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Count distinct rows for the current query\n */\n countDistinct(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.countDistinct(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of `min` aggregate function\n */\n min(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.min(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of `max` aggregate function\n */\n max(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.max(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of `avg` aggregate function\n */\n avg(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.avg(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of distinct `avg` aggregate function\n */\n avgDistinct(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.avgDistinct(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of `sum` aggregate function\n */\n sum(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.sum(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of distinct `sum` aggregate function\n */\n sumDistinct(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.sumDistinct(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * A shorthand for applying offset and limit based upon\n * the current page\n */\n forPage(page, perPage) {\n /**\n * Calculate offset from current page and per page values\n */\n const offset = page === 1 ? 0 : perPage * (page - 1);\n this.offset(offset).limit(perPage);\n return this;\n }\n /**\n * Define a query to constraint to be defined when condition is truthy\n */\n if(condition, matchCallback, noMatchCallback) {\n let matched = condition;\n if (typeof condition === 'function') {\n matched = condition();\n }\n if (matched) {\n matchCallback(this);\n }\n else if (noMatchCallback) {\n noMatchCallback(this);\n }\n return this;\n }\n /**\n * Define a query to constraint to be defined when condition is falsy\n */\n unless(condition, matchCallback, noMatchCallback) {\n let matched = condition;\n if (typeof condition === 'function') {\n matched = condition();\n }\n if (!matched) {\n matchCallback(this);\n }\n else if (noMatchCallback) {\n noMatchCallback(this);\n }\n return this;\n }\n /**\n * Define matching blocks just like `if/else if and else`.\n */\n match(...blocks) {\n const matchingBlock = blocks.find((block) => {\n if (Array.isArray(block) && block.length === 2) {\n if (typeof block[0] === 'function' && block[0]()) {\n return true;\n }\n else if (block[0]) {\n return true;\n }\n }\n if (typeof block === 'function') {\n return true;\n }\n });\n if (!matchingBlock) {\n return this;\n }\n if (Array.isArray(matchingBlock)) {\n matchingBlock[1](this);\n }\n else {\n matchingBlock(this);\n }\n return this;\n }\n /**\n * Applies statements and returns knex query\n */\n toKnex() {\n this.applyWhere();\n return this.knexQuery;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { Exception } from '@poppinss/utils';\nimport { isObject } from '../../utils/index.js';\nimport { Preloader } from '../preloader/index.js';\nimport { ModelPaginator } from '../paginator/index.js';\nimport { QueryRunner } from '../../query_runner/index.js';\nimport { Chainable } from '../../database/query_builder/chainable.js';\nimport { SimplePaginator } from '../../database/paginator/simple_paginator.js';\nimport * as errors from '../../errors.js';\n/**\n * A wrapper to invoke scope methods on the query builder\n * underlying model\n */\nclass ModelScopes {\n builder;\n constructor(builder) {\n this.builder = builder;\n return new Proxy(this, {\n get(target, key) {\n if (typeof target.builder.model[key] === 'function') {\n return (...args) => {\n return target.builder.model[key](target.builder, ...args);\n };\n }\n /**\n * Unknown keys are not allowed\n */\n throw new Error(`\"${String(key)}\" is not defined as a query scope on \"${target.builder.model.name}\" model`);\n },\n });\n }\n}\n/**\n * Database query builder exposes the API to construct and run queries for selecting,\n * updating and deleting records.\n */\nexport class ModelQueryBuilder extends Chainable {\n model;\n client;\n /**\n * A copy of defined preloads on the model instance\n */\n preloader;\n /**\n * A custom callback to transform each model row\n */\n rowTransformerCallback;\n /**\n * Required by macroable\n */\n static macros = {};\n static getters = {};\n /**\n * A references to model scopes wrapper. It is lazily initialized\n * only when the `apply` method is invoked\n */\n scopesWrapper = undefined;\n /**\n * Control whether to wrap adapter result to model\n * instances or not\n */\n wrapResultsToModelInstances = true;\n /**\n * Custom data someone want to send to the profiler and the\n * query event\n */\n customReporterData;\n /**\n * Control whether to debug the query or not. The initial\n * value is inherited from the query client\n */\n debugQueries;\n /**\n * Self join counter, increments with every \"withCount\"\n * \"has\" and \"whereHas\" queries.\n */\n joinCounter = 0;\n /**\n * Options that must be passed to all new model instances\n */\n clientOptions;\n /**\n * Whether query is a sub-query for `.where` callback\n */\n isChildQuery = false;\n /**\n * Side-loaded attributes that will be passed to the model instances\n */\n sideloaded = {};\n constructor(builder, model, client, customFn = (userFn) => {\n return ($builder) => {\n const subQuery = new ModelQueryBuilder($builder, this.model, this.client);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n }) {\n super(builder, customFn, model.$keys.attributesToColumns.resolve.bind(model.$keys.attributesToColumns));\n this.model = model;\n this.client = client;\n this.preloader = new Preloader(this.model);\n this.debugQueries = this.client.debug;\n this.clientOptions = {\n client: this.client,\n connection: this.client.connectionName,\n };\n /**\n * Assign table when not already assigned\n */\n if (!builder['_single'] || !builder['_single'].table) {\n builder.table(model.table);\n }\n }\n /**\n * Executes the current query\n */\n async execQuery() {\n this.applyWhere();\n const isWriteQuery = ['update', 'del', 'insert'].includes(this.knexQuery['_method']);\n const queryData = Object.assign(this.getQueryData(), this.customReporterData);\n const rows = await new QueryRunner(this.client, this.debugQueries, queryData).run(this.knexQuery);\n /**\n * Return the rows as it is when query is a write query\n */\n if (isWriteQuery || !this.wrapResultsToModelInstances) {\n return Array.isArray(rows) ? rows : [rows];\n }\n /**\n * Convert fetched results to an array of model instances\n */\n const modelInstances = rows.reduce((models, row) => {\n if (isObject(row)) {\n const modelInstance = this.model.$createFromAdapterResult(row, this.sideloaded, this.clientOptions);\n /**\n * Transform row when row transformer is defined\n */\n if (this.rowTransformerCallback) {\n this.rowTransformerCallback(modelInstance);\n }\n models.push(modelInstance);\n }\n return models;\n }, []);\n /**\n * Preload for model instances\n */\n await this.preloader\n .sideload(this.sideloaded)\n .debug(this.debugQueries)\n .processAllForMany(modelInstances, this.client);\n return modelInstances;\n }\n /**\n * Ensures that we are not executing `update` or `del` when using read only\n * client\n */\n ensureCanPerformWrites() {\n if (this.client && this.client.mode === 'read') {\n throw new Exception('Updates and deletes cannot be performed in read mode');\n }\n }\n /**\n * Defines sub query for checking the existence of a relationship\n */\n addWhereHas(relationName, boolean, operator, value, callback) {\n let rawMethod = 'whereRaw';\n let existsMethod = 'whereExists';\n switch (boolean) {\n case 'or':\n rawMethod = 'orWhereRaw';\n existsMethod = 'orWhereExists';\n break;\n case 'not':\n existsMethod = 'whereNotExists';\n break;\n case 'orNot':\n rawMethod = 'orWhereRaw';\n existsMethod = 'orWhereNotExists';\n break;\n }\n const subQuery = this.getRelationship(relationName).subQuery(this.client);\n subQuery.selfJoinCounter = this.joinCounter;\n /**\n * Invoke callback when defined\n */\n if (typeof callback === 'function') {\n callback(subQuery);\n }\n /**\n * Count all when value and operator are defined.\n */\n if (value !== undefined && operator !== undefined) {\n /**\n * If user callback has not defined any aggregates, then we should\n * add a count\n */\n if (!subQuery.hasAggregates) {\n subQuery.count('*');\n }\n /**\n * Pull sql and bindings from the query\n */\n const { sql, bindings } = subQuery.prepare().toSQL();\n /**\n * Define where raw clause. Query builder doesn't have any \"whereNotRaw\" method\n * and hence we need to prepend the `NOT` keyword manually\n */\n boolean === 'orNot' || boolean === 'not'\n ? this[rawMethod](`not (${sql}) ${operator} (?)`, bindings.concat([value]))\n : this[rawMethod](`(${sql}) ${operator} (?)`, bindings.concat([value]));\n return this;\n }\n /**\n * Use where exists when no operator and value is defined\n */\n ;\n this[existsMethod](subQuery.prepare());\n return this;\n }\n /**\n * Returns the profiler action. Protected, since the class is extended\n * by relationships\n */\n getQueryData() {\n return {\n connection: this.client.connectionName,\n inTransaction: this.client.isTransaction,\n model: this.model.name,\n };\n }\n /**\n * Returns the relationship instance from the model. An exception is\n * raised when relationship is missing\n */\n getRelationship(name) {\n const relation = this.model.$getRelation(name);\n /**\n * Ensure relationship exists\n */\n if (!relation) {\n throw new errors.E_UNDEFINED_RELATIONSHIP([name, this.model.name]);\n }\n relation.boot();\n return relation;\n }\n /**\n * Define custom reporter data. It will be merged with\n * the existing data\n */\n reporterData(data) {\n this.customReporterData = data;\n return this;\n }\n /**\n * Define a custom callback to transform rows\n */\n rowTransformer(callback) {\n this.rowTransformerCallback = callback;\n return this;\n }\n /**\n * Clone the current query builder\n */\n clone() {\n const clonedQuery = new ModelQueryBuilder(this.knexQuery.clone(), this.model, this.client);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.usePreloader(this.preloader.clone());\n clonedQuery.sideloaded = Object.assign({}, this.sideloaded);\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n this.rowTransformerCallback && this.rowTransformer(this.rowTransformerCallback);\n return clonedQuery;\n }\n /**\n * Define returning columns\n */\n returning(columns) {\n if (this.client.dialect.supportsReturningStatement) {\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveKey(column))\n : this.resolveKey(columns);\n this.knexQuery.returning(columns);\n }\n return this;\n }\n /**\n * Define a query to constraint to be defined when condition is truthy\n */\n ifDialect(dialects, matchCallback, noMatchCallback) {\n dialects = Array.isArray(dialects) ? dialects : [dialects];\n if (dialects.includes(this.client.dialect.name)) {\n matchCallback(this);\n }\n else if (noMatchCallback) {\n noMatchCallback(this);\n }\n return this;\n }\n /**\n * Define a query to constraint to be defined when condition is falsy\n */\n unlessDialect(dialects, matchCallback, noMatchCallback) {\n dialects = Array.isArray(dialects) ? dialects : [dialects];\n if (!dialects.includes(this.client.dialect.name)) {\n matchCallback(this);\n }\n else if (noMatchCallback) {\n noMatchCallback(this);\n }\n return this;\n }\n /**\n * Applies the query scopes on the current query builder\n * instance\n */\n withScopes(callback) {\n this.scopesWrapper = this.scopesWrapper || new ModelScopes(this);\n callback(this.scopesWrapper);\n return this;\n }\n /**\n * Applies the query scopes on the current query builder\n * instance\n */\n apply(callback) {\n return this.withScopes(callback);\n }\n /**\n * Define a custom preloader instance for preloading relationships\n */\n usePreloader(preloader) {\n this.preloader = preloader;\n return this;\n }\n /**\n * Set side-loaded properties to be passed to the model instance\n */\n sideload(value, merge = false) {\n if (merge) {\n Object.assign(this.sideloaded, value);\n }\n else {\n this.sideloaded = value;\n }\n return this;\n }\n /**\n * Fetch and return first results from the results set. This method\n * will implicitly set a `limit` on the query\n */\n async first() {\n const isFetchCall = this.wrapResultsToModelInstances && this.knexQuery['_method'] === 'select';\n if (isFetchCall) {\n await this.model.$hooks.runner('before:find').run(this);\n }\n const result = await this.limit(1).execQuery();\n if (result[0] && isFetchCall) {\n await this.model.$hooks.runner('after:find').run(result[0]);\n }\n return result[0] || null;\n }\n /**\n * Fetch and return first results from the results set. This method\n * will implicitly set a `limit` on the query\n */\n async firstOrFail() {\n const row = await this.first();\n if (!row) {\n throw new errors.E_ROW_NOT_FOUND(this.model);\n }\n return row;\n }\n /**\n * Load aggregate value as a sub-query for a relationship\n */\n withAggregate(relationName, userCallback) {\n const subQuery = this.getRelationship(relationName).subQuery(this.client);\n subQuery.selfJoinCounter = this.joinCounter;\n /**\n * Invoke user callback\n */\n userCallback(subQuery);\n /**\n * Raise exception if the callback has not defined an aggregate\n */\n if (!subQuery.hasAggregates) {\n throw new Exception('\"withAggregate\" callback must use an aggregate function');\n }\n /**\n * Select \"*\" when no custom selects are defined\n */\n if (!this.columns.length) {\n this.select(`${this.model.table}.*`);\n }\n /**\n * Throw exception when no alias\n */\n if (!subQuery.subQueryAlias) {\n throw new Exception('\"withAggregate\" callback must define the alias for the aggregate query');\n }\n /**\n * Count sub-query selection\n */\n this.select(subQuery.prepare());\n /**\n * Bump the counter\n */\n this.joinCounter++;\n return this;\n }\n /**\n * Get count of a relationship alongside the main query results\n */\n withCount(relationName, userCallback) {\n this.withAggregate(relationName, (subQuery) => {\n if (typeof userCallback === 'function') {\n userCallback(subQuery);\n }\n /**\n * Count \"*\"\n */\n if (!subQuery.hasAggregates) {\n subQuery.count('*');\n }\n /**\n * Define alias for the sub-query\n */\n if (!subQuery.subQueryAlias) {\n subQuery.as(`${relationName}_count`);\n }\n });\n return this;\n }\n /**\n * Add where constraint using the relationship\n */\n whereHas(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'and', operator, value, callback);\n }\n /**\n * Add or where constraint using the relationship\n */\n orWhereHas(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'or', operator, value, callback);\n }\n /**\n * Alias of [[whereHas]]\n */\n andWhereHas(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'and', operator, value, callback);\n }\n /**\n * Add where not constraint using the relationship\n */\n whereDoesntHave(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'not', operator, value, callback);\n }\n /**\n * Add or where not constraint using the relationship\n */\n orWhereDoesntHave(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'orNot', operator, value, callback);\n }\n /**\n * Alias of [[whereDoesntHave]]\n */\n andWhereDoesntHave(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'not', operator, value, callback);\n }\n /**\n * Add where constraint using the relationship\n */\n has(relationName, operator, value) {\n return this.addWhereHas(relationName, 'and', operator, value);\n }\n /**\n * Add or where constraint using the relationship\n */\n orHas(relationName, operator, value) {\n return this.addWhereHas(relationName, 'or', operator, value);\n }\n /**\n * Alias of [[has]]\n */\n andHas(relationName, operator, value) {\n return this.addWhereHas(relationName, 'and', operator, value);\n }\n /**\n * Add where not constraint using the relationship\n */\n doesntHave(relationName, operator, value) {\n return this.addWhereHas(relationName, 'not', operator, value);\n }\n /**\n * Add or where not constraint using the relationship\n */\n orDoesntHave(relationName, operator, value) {\n return this.addWhereHas(relationName, 'orNot', operator, value);\n }\n /**\n * Alias of [[doesntHave]]\n */\n andDoesntHave(relationName, operator, value) {\n return this.addWhereHas(relationName, 'not', operator, value);\n }\n /**\n * Define a relationship to be preloaded\n */\n preload(relationName, userCallback) {\n this.preloader.load(relationName, userCallback);\n return this;\n }\n /**\n * Define a relationship to preload, but only if they are not\n * already preloaded\n */\n preloadOnce(relationName) {\n this.preloader.preloadOnce(relationName);\n return this;\n }\n /**\n * Perform update by incrementing value for a given column. Increments\n * can be clubbed with `update` as well\n */\n increment(column, counter) {\n this.ensureCanPerformWrites();\n this.knexQuery.increment(this.resolveKey(column, true), counter);\n return this;\n }\n /**\n * Perform update by decrementing value for a given column. Decrements\n * can be clubbed with `update` as well\n */\n decrement(column, counter) {\n this.ensureCanPerformWrites();\n this.knexQuery.decrement(this.resolveKey(column, true), counter);\n return this;\n }\n update(column, value, returning) {\n this.ensureCanPerformWrites();\n if (value === undefined && returning === undefined) {\n this.knexQuery.update(this.resolveKey(column, true));\n }\n else if (returning === undefined) {\n this.knexQuery.update(this.resolveKey(column), value);\n }\n else {\n this.knexQuery.update(this.resolveKey(column), value, returning);\n }\n return this;\n }\n /**\n * Delete rows under the current query\n */\n del() {\n this.ensureCanPerformWrites();\n this.knexQuery.del();\n return this;\n }\n /**\n * Alias for [[del]]\n */\n delete() {\n return this.del();\n }\n /**\n * Turn on/off debugging for this query\n */\n debug(debug) {\n this.debugQueries = debug;\n return this;\n }\n /**\n * Define query timeout\n */\n timeout(time, options) {\n this.knexQuery['timeout'](time, options);\n return this;\n }\n /**\n * Returns SQL query as a string\n */\n toQuery() {\n this.applyWhere();\n return this.knexQuery.toQuery();\n }\n /**\n * @deprecated\n * Do not use this method. Instead create a query with options.client\n *\n * ```ts\n * Model.query({ client: trx })\n * ```\n */\n useTransaction(transaction) {\n this.knexQuery.transacting(transaction.knexClient);\n return this;\n }\n /**\n * Executes the query\n */\n async exec() {\n const isFetchCall = this.wrapResultsToModelInstances && this.knexQuery['_method'] === 'select';\n if (isFetchCall) {\n await this.model.$hooks.runner('before:fetch').run(this);\n }\n const result = await this.execQuery();\n if (isFetchCall) {\n await this.model.$hooks.runner('after:fetch').run(result);\n }\n return result;\n }\n /**\n * Paginate through rows inside a given table\n */\n async paginate(page, perPage = 20) {\n const isFetchCall = this.wrapResultsToModelInstances && this.knexQuery['_method'] === 'select';\n /**\n * Cast to number\n */\n page = Number(page);\n perPage = Number(perPage);\n const countQuery = this.clone()\n .clearOrder()\n .clearLimit()\n .clearOffset()\n .clearSelect()\n .count('* as total')\n .pojo();\n /**\n * We pass both the counts query and the main query to the\n * paginate hook\n */\n if (isFetchCall) {\n await this.model.$hooks.runner('before:paginate').run([countQuery, this]);\n await this.model.$hooks.runner('before:fetch').run(this);\n }\n const aggregateResult = await countQuery.exec();\n const total = this.hasGroupBy ? aggregateResult.length : aggregateResult[0].total;\n const results = total > 0 ? await this.forPage(page, perPage).execQuery() : [];\n /**\n * Choose paginator\n */\n const paginator = this.wrapResultsToModelInstances\n ? new ModelPaginator(total, perPage, page, ...results)\n : new SimplePaginator(total, perPage, page, ...results);\n paginator.namingStrategy = this.model.namingStrategy;\n if (isFetchCall) {\n await this.model.$hooks.runner('after:paginate').run(paginator);\n await this.model.$hooks.runner('after:fetch').run(results);\n }\n return paginator;\n }\n /**\n * Get sql representation of the query\n */\n toSQL() {\n this.applyWhere();\n return this.knexQuery.toSQL();\n }\n /**\n * Get rows back as a plain javascript object and not an array\n * of model instances\n */\n pojo() {\n this.wrapResultsToModelInstances = false;\n return this;\n }\n /**\n * Implementation of `then` for the promise API\n */\n then(resolve, reject) {\n return this.exec().then(resolve, reject);\n }\n /**\n * Implementation of `catch` for the promise API\n */\n catch(reject) {\n return this.exec().catch(reject);\n }\n /**\n * Implementation of `finally` for the promise API\n */\n finally(fulfilled) {\n return this.exec().finally(fulfilled);\n }\n /**\n * Required when Promises are extended\n */\n get [Symbol.toStringTag]() {\n return this.constructor.name;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { ModelQueryBuilder } from '../../query_builder/index.js';\n/**\n * Base query builder for ORM Relationships\n */\nexport class BaseQueryBuilder extends ModelQueryBuilder {\n /**\n * Eager constraints\n */\n groupConstraints = {};\n /**\n * Is query a relationship query obtained using `related('relation').query()`\n */\n get isRelatedQuery() {\n return true;\n }\n /**\n * Is query a relationship query obtained using `related('relation').subQuery()`\n */\n get isRelatedSubQuery() {\n return false;\n }\n /**\n * Is query a relationship query obtained using one of the preload methods.\n */\n isRelatedPreloadQuery = false;\n constructor(builder, client, relation, dbCallback) {\n super(builder, relation.relatedModel(), client, dbCallback);\n }\n /**\n * Returns the selected columns\n */\n getSelectedColumns() {\n return this.knexQuery['_statements'].find(({ grouping }) => grouping === 'columns');\n }\n /**\n * Returns the profiler action. Protected, since the class is extended\n * by relationships\n */\n getQueryData() {\n return Object.assign(this.knexQuery.toSQL(), {\n connection: this.client.connectionName,\n inTransaction: this.client.isTransaction,\n model: this.model.name,\n eagerLoading: this.isRelatedPreloadQuery,\n relation: this.profilerData(),\n });\n }\n /**\n * Returns the name of the query action. Used mainly for\n * raising descriptive errors\n */\n queryAction() {\n let action = this.knexQuery['_method'];\n if (action === 'del') {\n action = 'delete';\n }\n if (action === 'select' && this.isRelatedPreloadQuery) {\n action = 'preload';\n }\n return action;\n }\n /**\n * Selects the relation keys. Invoked by the preloader\n */\n selectRelationKeys() {\n const columns = this.getSelectedColumns();\n /**\n * No columns have been defined, we will let knex do it's job by\n * adding `select *`\n */\n if (!columns) {\n return this;\n }\n /**\n * Finally push relation columns to existing selected columns\n */\n this.getRelationKeys().forEach((key) => {\n key = this.resolveKey(key);\n if (!columns.value.includes(key)) {\n columns.value.push(key);\n }\n });\n return this;\n }\n /**\n * Define the group limit\n */\n groupLimit(limit) {\n this.groupConstraints.limit = limit;\n return this;\n }\n /**\n * Define the group limit\n */\n groupOrderBy(column, direction) {\n this.groupConstraints.orderBy = { column, direction };\n return this;\n }\n /**\n * Return knex query\n */\n toKnex() {\n this.applyConstraints();\n return super.toKnex();\n }\n /**\n * Get query sql\n */\n toSQL() {\n this.applyConstraints();\n if (this.isRelatedPreloadQuery) {\n return this.groupConstraints.limit ? this.getGroupLimitQuery().toSQL() : super.toSQL();\n }\n /**\n * Apply orderBy and limit on the standard query when not\n * an eagerloading query\n */\n if (this.groupConstraints.limit) {\n this.limit(this.groupConstraints.limit);\n }\n if (this.groupConstraints.orderBy) {\n this.orderBy(this.groupConstraints.orderBy.column, this.groupConstraints.orderBy.direction);\n }\n return super.toSQL();\n }\n /**\n * Apply constraints before fetching the first\n * row\n */\n first() {\n this.applyConstraints();\n return super.first();\n }\n /**\n * Execute query\n */\n exec() {\n this.applyConstraints();\n if (this.isRelatedPreloadQuery) {\n return this.groupConstraints.limit ? this.getGroupLimitQuery().exec() : super.exec();\n }\n /**\n * Apply orderBy and limit on the standard query when not\n * an eagerloading query\n */\n if (this.groupConstraints.limit) {\n this.limit(this.groupConstraints.limit);\n }\n if (this.groupConstraints.orderBy) {\n this.orderBy(this.groupConstraints.orderBy.column, this.groupConstraints.orderBy.direction);\n }\n return super.exec();\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { getValue, unique } from '../../../utils/index.js';\nimport { BaseQueryBuilder } from '../base/query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class HasOneQueryBuilder extends BaseQueryBuilder {\n parent;\n relation;\n appliedConstraints = false;\n constructor(builder, client, parent, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasOneQueryBuilder($builder, this.client, this.parent, this.relation);\n subQuery.isChildQuery = true;\n subQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.parent = parent;\n this.relation = relation;\n }\n /**\n * Profiler data for HasOne relationship\n */\n profilerData() {\n return {\n type: this.relation.type,\n model: this.relation.model.name,\n relatedModel: this.relation.relatedModel().name,\n };\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.foreignKey];\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasOneQueryBuilder(this.knexQuery.clone(), this.client, this.parent, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const queryAction = this.queryAction();\n /**\n * Eager query constraints\n */\n if (Array.isArray(this.parent)) {\n this.wrapExisting().whereIn(this.relation.foreignKey, unique(this.parent.map((model) => {\n return getValue(model, this.relation.localKey, this.relation, queryAction);\n })));\n return;\n }\n /**\n * Query constraints\n */\n const value = getValue(this.parent, this.relation.localKey, this.relation, queryAction);\n this.wrapExisting().where(this.relation.foreignKey, value);\n /**\n * Do not add limit when updating or deleting\n */\n if (!['update', 'delete'].includes(queryAction)) {\n this.limit(1);\n }\n }\n /**\n * Dis-allow hasOne pagination\n */\n paginate() {\n throw new Error(`Cannot paginate a hasOne relationship \"(${this.relation.relationName})\"`);\n }\n /**\n * Dis-allow hasOne group query limit\n */\n getGroupLimitQuery() {\n throw new Error(`Cannot apply groupLimit or groupOrderBy on hasOne relationship \"(${this.relation.relationName})\"`);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { ModelQueryBuilder } from '../../query_builder/index.js';\n/**\n * Base query builder for ORM Relationships\n */\nexport class BaseSubQueryBuilder extends ModelQueryBuilder {\n /**\n * The counter for the self join alias. Usually will be set by\n * the consumer\n */\n selfJoinCounter = 0;\n /**\n * Alias for the self join table\n */\n get selfJoinAlias() {\n return `adonis_temp_${this.selfJoinCounter}`;\n }\n /**\n * Is query a relationship query obtained using `related('relation').query()`\n */\n get isRelatedQuery() {\n return false;\n }\n /**\n * Is query a relationship query obtained using `related('relation').subQuery()`\n */\n get isRelatedSubQuery() {\n return true;\n }\n /**\n * Is query a relationship query obtained using one of the preload methods.\n */\n get isRelatedPreloadQuery() {\n return false;\n }\n constructor(builder, client, relation, dbCallback) {\n super(builder, relation.relatedModel(), client, dbCallback);\n }\n /**\n * Returns the selected columns\n */\n getSelectedColumns() {\n return this.knexQuery['_statements'].find(({ grouping }) => grouping === 'columns');\n }\n /**\n * Selects the relation keys. Invoked by the preloader\n */\n selectRelationKeys() {\n const columns = this.getSelectedColumns();\n /**\n * No columns have been defined, we will let knex do it's job by\n * adding `select *`\n */\n if (!columns) {\n return this;\n }\n /**\n * Finally push relation columns to existing selected columns\n */\n this.getRelationKeys().forEach((key) => {\n key = this.resolveKey(key);\n if (!columns.value.includes(key)) {\n columns.value.push(key);\n }\n });\n return this;\n }\n /**\n * Get query sql\n */\n toSQL() {\n this.prepare();\n return super.toSQL();\n }\n /**\n * prepare\n */\n prepare() {\n this.applyConstraints();\n return this;\n }\n /**\n * Executing subqueries is not allowed. It is disabled in static types, but\n * in case someone by-pass typescript checks to invoke it\n */\n exec() {\n throw new Error('Cannot execute relationship subqueries');\n }\n paginate() {\n throw new Error('Cannot execute relationship subqueries');\n }\n update() {\n throw new Error('Cannot execute relationship subqueries');\n }\n del() {\n throw new Error('Cannot execute relationship subqueries');\n }\n first() {\n throw new Error('Cannot execute relationship subqueries');\n }\n firstOrFail() {\n throw new Error('Cannot execute relationship subqueries');\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { BaseSubQueryBuilder } from '../base/sub_query_builder.js';\nexport class HasOneSubQueryBuilder extends BaseSubQueryBuilder {\n relation;\n appliedConstraints = false;\n constructor(builder, client, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasOneSubQueryBuilder($builder, this.client, this.relation);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.relation = relation;\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.foreignKey];\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasOneSubQueryBuilder(this.knexQuery.clone(), this.client, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const relatedTable = this.relation.relatedModel().table;\n const localTable = this.relation.model.table;\n let tablePrefix = relatedTable;\n /**\n * In case of self joins, we must alias the table selection\n */\n if (relatedTable === localTable) {\n this.knexQuery.from(`${relatedTable} as ${this.selfJoinAlias}`);\n tablePrefix = this.selfJoinAlias;\n }\n this.wrapExisting().where(`${localTable}.${this.relation.localKeyColumnName}`, this.client.ref(`${tablePrefix}.${this.relation.foreignKeyColumnName}`));\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { managedTransaction } from '../../../utils/index.js';\nimport { HasOneQueryBuilder } from './query_builder.js';\nimport { HasOneSubQueryBuilder } from './sub_query_builder.js';\n/**\n * Query client for executing queries in scope to the defined\n * relationship\n */\nexport class HasOneQueryClient {\n relation;\n parent;\n client;\n constructor(relation, parent, client) {\n this.relation = relation;\n this.parent = parent;\n this.client = client;\n }\n /**\n * Generate a related query builder\n */\n static query(client, relation, rows) {\n const query = new HasOneQueryBuilder(client.knexQuery(), client, rows, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a related eager query builder\n */\n static eagerQuery(client, relation, rows) {\n const query = new HasOneQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of the sub query builder\n */\n static subQuery(client, relation) {\n const query = new HasOneSubQueryBuilder(client.knexQuery(), client, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns instance of query builder\n */\n query() {\n return HasOneQueryClient.query(this.client, this.relation, this.parent);\n }\n /**\n * Save related model instance\n */\n async save(related) {\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n this.relation.hydrateForPersistance(this.parent, related);\n related.$trx = trx;\n await related.save();\n });\n }\n /**\n * Create instance of the related model\n */\n async create(values, options) {\n const parent = this.parent;\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await parent.save();\n const valuesToPersist = Object.assign({}, values);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation.relatedModel().create(valuesToPersist, { client: trx, ...options });\n });\n }\n /**\n * Get the first matching related instance or create a new one\n */\n async firstOrCreate(search, savePayload, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n const valuesToPersist = Object.assign({}, search);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation\n .relatedModel()\n .firstOrCreate(valuesToPersist, savePayload, { client: trx, ...options });\n });\n }\n /**\n * Update the existing row or create a new one\n */\n async updateOrCreate(search, updatePayload, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n const valuesToPersist = Object.assign({}, search);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation\n .relatedModel()\n .updateOrCreate(valuesToPersist, updatePayload, { client: trx, ...options });\n });\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { KeysExtractor } from '../keys_extractor.js';\nimport { HasOneQueryClient } from './query_client.js';\nimport { ensureRelationIsBooted, getValue } from '../../../utils/index.js';\n/**\n * Manages loading and persisting has one relationship\n */\nexport class HasOne {\n relationName;\n relatedModel;\n options;\n model;\n type = 'hasOne';\n booted = false;\n serializeAs;\n /**\n * Reference to the onQuery hook defined by the user\n */\n onQueryHook;\n constructor(relationName, relatedModel, options, model) {\n this.relationName = relationName;\n this.relatedModel = relatedModel;\n this.options = options;\n this.model = model;\n this.onQueryHook = this.options.onQuery;\n this.serializeAs =\n this.options.serializeAs === undefined ? this.relationName : this.options.serializeAs;\n this.meta = this.options.meta;\n }\n /**\n * Clone relationship instance\n */\n clone(parent) {\n return new HasOne(this.relationName, this.relatedModel, { ...this.options }, parent);\n }\n /**\n * Boot the relationship and ensure that all keys are in\n * place for queries to do their job.\n */\n boot() {\n if (this.booted) {\n return;\n }\n const relatedModel = this.relatedModel();\n /**\n * Extracting keys from the model and the relation model. The keys\n * extractor ensures all the required columns are defined on\n * the models for the relationship to work\n */\n const { localKey, foreignKey } = new KeysExtractor(this.model, this.relationName, {\n localKey: {\n model: this.model,\n key: this.options.localKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, relatedModel, this.relationName),\n },\n foreignKey: {\n model: relatedModel,\n key: this.options.foreignKey ||\n this.model.namingStrategy.relationForeignKey(this.type, this.model, relatedModel, this.relationName),\n },\n }).extract();\n /**\n * Keys on the parent model\n */\n this.localKey = localKey.attributeName;\n this.localKeyColumnName = localKey.columnName;\n /**\n * Keys on the related model\n */\n this.foreignKey = foreignKey.attributeName;\n this.foreignKeyColumnName = foreignKey.columnName;\n /**\n * Booted successfully\n */\n this.booted = true;\n }\n /**\n * Set related model instance\n */\n setRelated(parent, related) {\n ensureRelationIsBooted(this);\n if (related === undefined) {\n return;\n }\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Push related model instance\n */\n pushRelated(parent, related) {\n ensureRelationIsBooted(this);\n if (related === undefined) {\n return;\n }\n parent.$pushRelated(this.relationName, related);\n }\n /**\n * Finds and set the related model instance next to the parent\n * models.\n */\n setRelatedForMany(parent, related) {\n ensureRelationIsBooted(this);\n parent.forEach((parentModel) => {\n const match = related.find((relatedModel) => {\n const value = parentModel[this.localKey];\n return value !== undefined && value === relatedModel[this.foreignKey];\n });\n this.setRelated(parentModel, match || null);\n });\n }\n /**\n * Returns an instance of query client for invoking queries\n */\n client(parent, client) {\n ensureRelationIsBooted(this);\n return new HasOneQueryClient(this, parent, client);\n }\n /**\n * Returns eager query instance\n */\n eagerQuery(parent, client) {\n ensureRelationIsBooted(this);\n return HasOneQueryClient.eagerQuery(client, this, parent);\n }\n /**\n * Returns instance of query builder\n */\n subQuery(client) {\n ensureRelationIsBooted(this);\n return HasOneQueryClient.subQuery(client, this);\n }\n /**\n * Hydrates values object for persistance.\n */\n hydrateForPersistance(parent, values) {\n ;\n values[this.foreignKey] = getValue(parent, this.localKey, this, 'persist');\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { getValue, unique } from '../../../utils/index.js';\nimport { BaseQueryBuilder } from '../base/query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class HasManyQueryBuilder extends BaseQueryBuilder {\n parent;\n relation;\n appliedConstraints = false;\n constructor(builder, client, parent, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasManyQueryBuilder($builder, this.client, this.parent, this.relation);\n subQuery.isChildQuery = true;\n subQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.parent = parent;\n this.relation = relation;\n }\n /**\n * Profiler data for HasMany relationship\n */\n profilerData() {\n return {\n type: this.relation.type,\n model: this.relation.model.name,\n relatedModel: this.relation.relatedModel().name,\n };\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.foreignKey];\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasManyQueryBuilder(this.knexQuery.clone(), this.client, this.parent, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n const queryAction = this.queryAction();\n this.appliedConstraints = true;\n /**\n * Eager query constraints\n */\n if (Array.isArray(this.parent)) {\n this.wrapExisting().whereIn(this.relation.foreignKey, unique(this.parent.map((model) => {\n return getValue(model, this.relation.localKey, this.relation, queryAction);\n })));\n return;\n }\n /**\n * Query constraints\n */\n const value = getValue(this.parent, this.relation.localKey, this.relation, queryAction);\n this.wrapExisting().where(this.relation.foreignKey, value);\n }\n /**\n * Same as standard model query builder paginate method. But ensures that\n * it is not invoked during eagerloading\n */\n paginate(page, perPage = 20) {\n if (this.isRelatedPreloadQuery) {\n throw new Error(`Cannot paginate relationship \"${this.relation.relationName}\" during preload`);\n }\n this.applyConstraints();\n return super.paginate(page, perPage);\n }\n /**\n * Returns the group limit query\n */\n getGroupLimitQuery() {\n const { direction, column } = this.groupConstraints.orderBy || {\n column: this.resolveKey(this.relation.relatedModel().primaryKey),\n direction: 'desc',\n };\n const rowName = 'adonis_group_limit_counter';\n const partitionBy = `PARTITION BY ${this.relation.foreignKeyColumnName}`;\n const orderBy = `ORDER BY ${column} ${direction}`;\n /**\n * Select * when no columns are selected\n */\n if (!this.getSelectedColumns()) {\n this.select('*');\n }\n this.select(this.client.raw(`row_number() over (${partitionBy} ${orderBy}) as ${rowName}`)).as('adonis_temp');\n const groupQuery = this.relation.relatedModel().query();\n groupQuery.usePreloader(this.preloader);\n groupQuery.sideload(this.sideloaded);\n groupQuery.debug(this.debugQueries);\n this.customReporterData && groupQuery.reporterData(this.customReporterData);\n return groupQuery.from(this).where(rowName, '<=', this.groupConstraints.limit);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { BaseSubQueryBuilder } from '../base/sub_query_builder.js';\nexport class HasManySubQueryBuilder extends BaseSubQueryBuilder {\n relation;\n appliedConstraints = false;\n constructor(builder, client, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasManySubQueryBuilder($builder, this.client, this.relation);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.relation = relation;\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.foreignKey];\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasManySubQueryBuilder(this.knexQuery.clone(), this.client, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const relatedTable = this.relation.relatedModel().table;\n const localTable = this.relation.model.table;\n let tablePrefix = relatedTable;\n /**\n * In case of self joins, we must alias the table selection\n */\n if (relatedTable === localTable) {\n this.knexQuery.from(`${relatedTable} as ${this.selfJoinAlias}`);\n tablePrefix = this.selfJoinAlias;\n }\n this.wrapExisting().where(`${localTable}.${this.relation.localKeyColumnName}`, this.client.ref(`${tablePrefix}.${this.relation.foreignKeyColumnName}`));\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { managedTransaction } from '../../../utils/index.js';\nimport { HasManyQueryBuilder } from './query_builder.js';\nimport { HasManySubQueryBuilder } from './sub_query_builder.js';\n/**\n * Query client for executing queries in scope to the defined\n * relationship\n */\nexport class HasManyQueryClient {\n relation;\n parent;\n client;\n constructor(relation, parent, client) {\n this.relation = relation;\n this.parent = parent;\n this.client = client;\n }\n /**\n * Generate a related query builder\n */\n static query(client, relation, row) {\n const query = new HasManyQueryBuilder(client.knexQuery(), client, row, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a related eager query builder\n */\n static eagerQuery(client, relation, rows) {\n const query = new HasManyQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of the sub query\n */\n static subQuery(client, relation) {\n const query = new HasManySubQueryBuilder(client.knexQuery(), client, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns instance of query builder\n */\n query() {\n return HasManyQueryClient.query(this.client, this.relation, this.parent);\n }\n /**\n * Save related model instance\n */\n async save(related) {\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n this.relation.hydrateForPersistance(this.parent, related);\n related.$trx = trx;\n await related.save();\n });\n }\n /**\n * Save related model instance\n */\n async saveMany(related) {\n const parent = this.parent;\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await parent.save();\n for (let row of related) {\n this.relation.hydrateForPersistance(this.parent, row);\n row.$trx = trx;\n await row.save();\n }\n });\n }\n /**\n * Create instance of the related model\n */\n async create(values, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n const valuesToPersist = Object.assign({}, values);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation.relatedModel().create(valuesToPersist, { client: trx, ...options });\n });\n }\n /**\n * Create instance of the related model\n */\n async createMany(values, options) {\n const parent = this.parent;\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await parent.save();\n const valuesToPersist = values.map((value) => {\n const valueToPersist = Object.assign({}, value);\n this.relation.hydrateForPersistance(this.parent, valueToPersist);\n return valueToPersist;\n });\n return this.relation.relatedModel().createMany(valuesToPersist, { client: trx, ...options });\n });\n }\n /**\n * Get the first matching related instance or create a new one\n */\n async firstOrCreate(search, savePayload, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n const valuesToPersist = Object.assign({}, search);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation\n .relatedModel()\n .firstOrCreate(valuesToPersist, savePayload, { client: trx, ...options });\n });\n }\n /**\n * Update the existing row or create a new one\n */\n async updateOrCreate(search, updatePayload, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n const valuesToPersist = Object.assign({}, search);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation\n .relatedModel()\n .updateOrCreate(valuesToPersist, updatePayload, { client: trx, ...options });\n });\n }\n /**\n * Fetch the existing related rows or create new one's\n */\n async fetchOrCreateMany(payload, predicate, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n payload.forEach((row) => {\n this.relation.hydrateForPersistance(this.parent, row);\n });\n predicate = Array.isArray(predicate) ? predicate : predicate ? [predicate] : [];\n return this.relation\n .relatedModel()\n .fetchOrCreateMany(predicate.concat(this.relation.foreignKey), payload, {\n client: trx,\n ...options,\n });\n });\n }\n /**\n * Update the existing related rows or create new one's\n */\n async updateOrCreateMany(payload, predicate, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n payload.forEach((row) => {\n this.relation.hydrateForPersistance(this.parent, row);\n });\n predicate = Array.isArray(predicate) ? predicate : predicate ? [predicate] : [];\n return this.relation\n .relatedModel()\n .updateOrCreateMany(predicate.concat(this.relation.foreignKey), payload, {\n client: trx,\n ...options,\n });\n });\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { KeysExtractor } from '../keys_extractor.js';\nimport { HasManyQueryClient } from './query_client.js';\nimport { ensureRelationIsBooted, getValue } from '../../../utils/index.js';\n/**\n * Manages persisting and fetching relationships\n */\nexport class HasMany {\n relationName;\n relatedModel;\n options;\n model;\n /**\n * The relationship name\n */\n type = 'hasMany';\n /**\n * Whether or not the relationship instance has been\n * booted\n */\n booted = false;\n /**\n * The key name for serializing the relationship\n */\n serializeAs;\n /**\n * Reference to the onQuery hook defined by the user\n */\n onQueryHook;\n constructor(relationName, relatedModel, options, model) {\n this.relationName = relationName;\n this.relatedModel = relatedModel;\n this.options = options;\n this.model = model;\n this.serializeAs =\n this.options.serializeAs === undefined ? this.relationName : this.options.serializeAs;\n this.onQueryHook = this.options.onQuery;\n this.meta = this.options.meta;\n }\n /**\n * Returns a boolean saving related row belongs to the parent\n * row or not.\n */\n isRelatedRow(parent, related) {\n return (parent[this.localKey] !== undefined &&\n related[this.foreignKey] === parent[this.localKey]);\n }\n /**\n * Clone relationship instance\n */\n clone(parent) {\n return new HasMany(this.relationName, this.relatedModel, { ...this.options }, parent);\n }\n /**\n * Boot the relationship and ensure that all keys are in\n * place for queries to do their job.\n */\n boot() {\n if (this.booted) {\n return;\n }\n const relatedModel = this.relatedModel();\n /**\n * Extracting keys from the model and the relation model. The keys\n * extractor ensures all the required columns are defined on\n * the models for the relationship to work\n */\n const { localKey, foreignKey } = new KeysExtractor(this.model, this.relationName, {\n localKey: {\n model: this.model,\n key: this.options.localKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, relatedModel, this.relationName),\n },\n foreignKey: {\n model: relatedModel,\n key: this.options.foreignKey ||\n this.model.namingStrategy.relationForeignKey(this.type, this.model, relatedModel, this.relationName),\n },\n }).extract();\n /**\n * Keys on the parent model\n */\n this.localKey = localKey.attributeName;\n this.localKeyColumnName = localKey.columnName;\n /**\n * Keys on the related model\n */\n this.foreignKey = foreignKey.attributeName;\n this.foreignKeyColumnName = foreignKey.columnName;\n /**\n * Booted successfully\n */\n this.booted = true;\n }\n /**\n * Set related model instances\n */\n setRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Push related model instance(s)\n */\n pushRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$pushRelated(this.relationName, related);\n }\n /**\n * Finds and set the related model instances next to the parent\n * models.\n */\n setRelatedForMany(parent, related) {\n ensureRelationIsBooted(this);\n parent.forEach((parentModel) => {\n const relatedRows = related.filter((relatedModel) => this.isRelatedRow(parentModel, relatedModel));\n this.setRelated(parentModel, relatedRows);\n });\n }\n /**\n * Returns an instance of query client for invoking queries\n */\n client(parent, client) {\n ensureRelationIsBooted(this);\n return new HasManyQueryClient(this, parent, client);\n }\n /**\n * Returns an instance of the eager query\n */\n eagerQuery(parent, client) {\n ensureRelationIsBooted(this);\n return HasManyQueryClient.eagerQuery(client, this, parent);\n }\n /**\n * Returns instance of query builder\n */\n subQuery(client) {\n ensureRelationIsBooted(this);\n return HasManyQueryClient.subQuery(client, this);\n }\n /**\n * Hydrates values object for persistance.\n */\n hydrateForPersistance(parent, values) {\n ;\n values[this.foreignKey] = getValue(parent, this.localKey, this, 'persist');\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { Exception } from '@poppinss/utils';\nimport { unique } from '../../../utils/index.js';\nimport { BaseQueryBuilder } from '../base/query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class BelongsToQueryBuilder extends BaseQueryBuilder {\n parent;\n relation;\n appliedConstraints = false;\n constructor(builder, client, parent, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new BelongsToQueryBuilder($builder, this.client, this.parent, this.relation);\n subQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.parent = parent;\n this.relation = relation;\n }\n /**\n * Raises exception that FK value is null\n */\n raiseMissingForeignKey() {\n const { relationName, foreignKey } = this.relation;\n const modelName = this.relation.model.name;\n throw new Exception([\n `Cannot preload \"${relationName}\", value of \"${modelName}.${foreignKey}\" is undefined.`,\n 'Make sure to set \"null\" as the default value for foreign keys',\n ].join(' '), { status: 500 });\n }\n /**\n * The profiler data for belongsTo relationship\n */\n profilerData() {\n return {\n type: this.relation.type,\n model: this.relation.model.name,\n relatedModel: this.relation.relatedModel().name,\n };\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.localKey];\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const queryAction = this.queryAction();\n /**\n * Eager query constraints\n */\n if (Array.isArray(this.parent)) {\n const foreignKeyValues = this.parent\n .map((model) => model[this.relation.foreignKey])\n .filter((foreignKeyValue) => {\n if (foreignKeyValue === undefined) {\n this.raiseMissingForeignKey();\n }\n return foreignKeyValue !== null;\n });\n this.wrapExisting().whereIn(this.relation.localKey, unique(foreignKeyValues));\n return;\n }\n /**\n * Query constraints\n */\n if (this.parent[this.relation.foreignKey] === undefined) {\n this.raiseMissingForeignKey();\n }\n this.wrapExisting().where(this.relation.localKey, this.parent[this.relation.foreignKey]);\n /**\n * Do not add limit when updating or deleting\n */\n if (!['update', 'delete'].includes(queryAction)) {\n this.limit(1);\n }\n return;\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new BelongsToQueryBuilder(this.knexQuery.clone(), this.client, this.parent, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Dis-allow belongsTo pagination\n */\n paginate() {\n throw new Error(`Cannot paginate a belongsTo relationship \"(${this.relation.relationName})\"`);\n }\n /**\n * Dis-allow belongsTo group query limit\n */\n getGroupLimitQuery() {\n throw new Error(`Cannot apply groupLimit or groupOrderBy on a belongsTo relationship \"(${this.relation.relationName})\"`);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { BaseSubQueryBuilder } from '../base/sub_query_builder.js';\nexport class BelongsToSubQueryBuilder extends BaseSubQueryBuilder {\n relation;\n appliedConstraints = false;\n constructor(builder, client, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new BelongsToSubQueryBuilder($builder, this.client, this.relation);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.relation = relation;\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.foreignKey];\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new BelongsToSubQueryBuilder(this.knexQuery.clone(), this.client, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const relatedTable = this.relation.relatedModel().table;\n const localTable = this.relation.model.table;\n let tablePrefix = relatedTable;\n /**\n * In case of self joins, we must alias the table selection\n */\n if (relatedTable === localTable) {\n this.knexQuery.from(`${relatedTable} as ${this.selfJoinAlias}`);\n tablePrefix = this.selfJoinAlias;\n }\n this.wrapExisting().where(`${tablePrefix}.${this.relation.localKeyColumnName}`, this.client.ref(`${localTable}.${this.relation.foreignKeyColumnName}`));\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { managedTransaction } from '../../../utils/index.js';\nimport { BelongsToQueryBuilder } from './query_builder.js';\nimport { BelongsToSubQueryBuilder } from './sub_query_builder.js';\n/**\n * Query client for executing queries in scope to the belongsTo relationship.\n */\nexport class BelongsToQueryClient {\n relation;\n parent;\n client;\n constructor(relation, parent, client) {\n this.relation = relation;\n this.parent = parent;\n this.client = client;\n }\n /**\n * Generate a query builder instance\n */\n static query(client, relation, rows) {\n const query = new BelongsToQueryBuilder(client.knexQuery(), client, rows, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a eager query\n */\n static eagerQuery(client, relation, rows) {\n const query = new BelongsToQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of the subquery\n */\n static subQuery(client, relation) {\n const query = new BelongsToSubQueryBuilder(client.knexQuery(), client, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns instance of query builder\n */\n query() {\n return BelongsToQueryClient.query(this.client, this.relation, this.parent);\n }\n /**\n * Associate the related model with the parent model\n */\n async associate(related) {\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n related.$trx = trx;\n await related.save();\n this.relation.hydrateForPersistance(this.parent, related);\n this.parent.$trx = trx;\n await this.parent.save();\n });\n }\n /**\n * Drop association\n */\n async dissociate() {\n ;\n this.parent[this.relation.foreignKey] = null;\n await this.parent.save();\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { KeysExtractor } from '../keys_extractor.js';\nimport { BelongsToQueryClient } from './query_client.js';\nimport { ensureRelationIsBooted, getValue } from '../../../utils/index.js';\n/**\n * Manages loading and persisting belongs to relationship\n */\nexport class BelongsTo {\n relationName;\n relatedModel;\n options;\n model;\n /**\n * Relationship name\n */\n type = 'belongsTo';\n /**\n * Whether or not the relationship instance has been booted\n */\n booted = false;\n /**\n * The key name for serializing the relationship\n */\n serializeAs;\n /**\n * Reference to the onQuery hook defined by the user\n */\n onQueryHook;\n constructor(relationName, relatedModel, options, model) {\n this.relationName = relationName;\n this.relatedModel = relatedModel;\n this.options = options;\n this.model = model;\n this.onQueryHook = this.options.onQuery;\n this.serializeAs =\n this.options.serializeAs === undefined ? this.relationName : this.options.serializeAs;\n this.meta = this.options.meta;\n }\n /**\n * Clone relationship instance\n */\n clone(parent) {\n return new BelongsTo(this.relationName, this.relatedModel, { ...this.options }, parent);\n }\n /**\n * Returns a boolean telling if the related row belongs to the parent\n * row or not.\n */\n isRelatedRow(parent, related) {\n return (related[this.localKey] !== undefined &&\n parent[this.foreignKey] === related[this.localKey]);\n }\n /**\n * Boot the relationship and ensure that all keys are in\n * place for queries to do their job.\n */\n boot() {\n if (this.booted) {\n return;\n }\n const relatedModel = this.relatedModel();\n /**\n * Extracting keys from the model and the relation model. The keys\n * extractor ensures all the required columns are defined on\n * the models for the relationship to work\n */\n const { localKey, foreignKey } = new KeysExtractor(this.model, this.relationName, {\n localKey: {\n model: relatedModel,\n key: this.options.localKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, relatedModel, this.relationName),\n },\n foreignKey: {\n model: this.model,\n key: this.options.foreignKey ||\n this.model.namingStrategy.relationForeignKey(this.type, this.model, relatedModel, this.relationName),\n },\n }).extract();\n /**\n * Keys on the related model\n */\n this.localKey = localKey.attributeName;\n this.localKeyColumnName = localKey.columnName;\n /**\n * Keys on the parent model\n */\n this.foreignKey = foreignKey.attributeName;\n this.foreignKeyColumnName = foreignKey.columnName;\n /**\n * Booted successfully\n */\n this.booted = true;\n }\n /**\n * Set related model instance\n */\n setRelated(parent, related) {\n ensureRelationIsBooted(this);\n if (related === undefined) {\n return;\n }\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Push related model instance\n */\n pushRelated(parent, related) {\n ensureRelationIsBooted(this);\n if (related === undefined) {\n return;\n }\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Finds and set the related model instance next to the parent\n * models.\n */\n setRelatedForMany(parent, related) {\n ensureRelationIsBooted(this);\n parent.forEach((parentRow) => {\n const match = related.find((relatedRow) => this.isRelatedRow(parentRow, relatedRow));\n this.setRelated(parentRow, match || null);\n });\n }\n /**\n * Returns an instance of query client for the given relationship\n */\n client(parent, client) {\n ensureRelationIsBooted(this);\n return new BelongsToQueryClient(this, parent, client);\n }\n /**\n * Returns instance of the eager query for the relationship\n */\n eagerQuery(parent, client) {\n ensureRelationIsBooted(this);\n return BelongsToQueryClient.eagerQuery(client, this, parent);\n }\n /**\n * Returns instance of query builder\n */\n subQuery(client) {\n ensureRelationIsBooted(this);\n return BelongsToQueryClient.subQuery(client, this);\n }\n /**\n * Hydrates values object for persistance.\n */\n hydrateForPersistance(parent, related) {\n ;\n parent[this.foreignKey] = getValue(related, this.localKey, this, 'associate');\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { PivotHelpers } from './pivot_helpers.js';\nimport { BaseSubQueryBuilder } from '../base/sub_query_builder.js';\n/**\n * Exposes the API to construct sub queries for a many to many relationships\n */\nexport class ManyToManySubQueryBuilder extends BaseSubQueryBuilder {\n builder;\n client;\n relation;\n /**\n * Pivot helpers provides the implementation for pivot table constraints\n * and clauses\n */\n pivotHelpers = new PivotHelpers(this, false);\n /**\n * Reference to the related table\n */\n relatedTable;\n hasSelfRelation;\n /**\n * Whether or not the constraints has been applied\n */\n appliedConstraints = false;\n isChildQuery = false;\n constructor(builder, client, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new ManyToManySubQueryBuilder($builder, this.client, this.relation);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.builder = builder;\n this.client = client;\n this.relation = relation;\n this.relatedTable = this.relation.relatedModel().table;\n this.hasSelfRelation = this.relatedTable === this.relation.model.table;\n }\n /**\n * Prefixes the related table name to a column\n */\n prefixRelatedTable(column) {\n if (column.includes('.')) {\n return column;\n }\n if (this.hasSelfRelation) {\n return `${this.selfJoinAlias}.${column}`;\n }\n return `${this.relatedTable}.${column}`;\n }\n /**\n * Transforms the selected column names by prefixing the\n * table name\n */\n transformRelatedTableColumns(columns) {\n return columns.map((column) => {\n if (typeof column === 'string') {\n return this.prefixRelatedTable(this.resolveKey(column));\n }\n return this.transformValue(column);\n });\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [`${this.relation.relatedModel().table}.${this.relation.relatedKeyColumnName}`];\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const localTable = this.relation.model.table;\n let tablePrefix = this.relatedTable;\n /**\n * In case of self joins, we must alias the table selection\n */\n if (this.relation.relatedModel() === this.relation.model) {\n this.knexQuery.from(`${this.relatedTable} as ${this.selfJoinAlias}`);\n tablePrefix = this.selfJoinAlias;\n }\n this.innerJoin(this.relation.pivotTable, `${tablePrefix}.${this.relation.relatedKeyColumnName}`, `${this.relation.pivotTable}.${this.relation.pivotRelatedForeignKey}`);\n this.wrapExisting().where(`${localTable}.${this.relation.localKeyColumnName}`, this.client.ref(this.pivotHelpers.prefixPivotTable(this.relation.pivotForeignKey)));\n }\n /**\n * Select keys from the related table\n */\n select(...args) {\n let columns = args;\n if (Array.isArray(args[0])) {\n columns = args[0];\n }\n this.knexQuery.select(this.transformRelatedTableColumns(columns));\n return this;\n }\n /**\n * Add where clause with pivot table prefix\n */\n wherePivot(key, operator, value) {\n this.pivotHelpers.wherePivot('and', key, operator, value);\n return this;\n }\n /**\n * Add or where clause with pivot table prefix\n */\n orWherePivot(key, operator, value) {\n this.pivotHelpers.wherePivot('or', key, operator, value);\n return this;\n }\n /**\n * Alias for wherePivot\n */\n andWherePivot(key, operator, value) {\n return this.wherePivot(key, operator, value);\n }\n /**\n * Add where not pivot\n */\n whereNotPivot(key, operator, value) {\n this.pivotHelpers.wherePivot('not', key, operator, value);\n return this;\n }\n /**\n * Add or where not pivot\n */\n orWhereNotPivot(key, operator, value) {\n this.pivotHelpers.wherePivot('orNot', key, operator, value);\n return this;\n }\n /**\n * Alias for `whereNotPivot`\n */\n andWhereNotPivot(key, operator, value) {\n return this.whereNotPivot(key, operator, value);\n }\n /**\n * Adds where in clause\n */\n whereInPivot(key, value) {\n this.pivotHelpers.whereInPivot('and', key, value);\n return this;\n }\n /**\n * Adds or where in clause\n */\n orWhereInPivot(key, value) {\n this.pivotHelpers.whereInPivot('or', key, value);\n return this;\n }\n /**\n * Alias from `whereInPivot`\n */\n andWhereInPivot(key, value) {\n return this.whereInPivot(key, value);\n }\n /**\n * Adds where not in clause\n */\n whereNotInPivot(key, value) {\n this.pivotHelpers.whereInPivot('not', key, value);\n return this;\n }\n /**\n * Adds or where not in clause\n */\n orWhereNotInPivot(key, value) {\n this.pivotHelpers.whereInPivot('orNot', key, value);\n return this;\n }\n /**\n * Alias from `whereNotInPivot`\n */\n andWhereNotInPivot(key, value) {\n return this.whereNotInPivot(key, value);\n }\n /**\n * Same as \"whereNull\", but for the pivot table only\n */\n whereNullPivot(key) {\n this.pivotHelpers.whereNullPivot('and', key);\n return this;\n }\n /**\n * Same as \"orWhereNull\", but for the pivot table only\n */\n orWhereNullPivot(key) {\n this.pivotHelpers.whereNullPivot('or', key);\n return this;\n }\n /**\n * Same as \"andWhereNull\", but for the pivot table only\n */\n andWhereNullPivot(key) {\n return this.whereNullPivot(key);\n }\n /**\n * Same as \"whereNotNull\", but for the pivot table only\n */\n whereNotNullPivot(key) {\n this.pivotHelpers.whereNullPivot('not', key);\n return this;\n }\n /**\n * Same as \"orWhereNotNull\", but for the pivot table only\n */\n orWhereNotNullPivot(key) {\n this.pivotHelpers.whereNullPivot('orNot', key);\n return this;\n }\n /**\n * Same as \"andWhereNotNull\", but for the pivot table only\n */\n andWhereNotNullPivot(key) {\n return this.whereNotNullPivot(key);\n }\n /**\n * Select pivot columns\n */\n pivotColumns(columns) {\n this.pivotHelpers.pivotColumns(columns);\n return this;\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new ManyToManySubQueryBuilder(this.knexQuery.clone(), this.client, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { ManyToManySubQueryBuilder } from './sub_query_builder.js';\nexport class PivotHelpers {\n query;\n aliasSelectColumns;\n constructor(query, aliasSelectColumns) {\n this.query = query;\n this.aliasSelectColumns = aliasSelectColumns;\n }\n /**\n * Prefixes the pivot table name to a column\n */\n prefixPivotTable(column) {\n if (column.includes('.')) {\n return column;\n }\n if (this.query instanceof ManyToManySubQueryBuilder) {\n return `${this.query.relation.pivotTable}.${column}`;\n }\n return this.query.isPivotOnlyQuery ? column : `${this.query.relation.pivotTable}.${column}`;\n }\n /**\n * Adds a where pivot condition to the query\n */\n wherePivot(variation, key, operator, value) {\n let method = 'where';\n switch (variation) {\n case 'or':\n method = 'orWhere';\n break;\n case 'not':\n method = 'whereNot';\n break;\n case 'orNot':\n method = 'orWhereNot';\n }\n if (value !== undefined) {\n return this.query[method](this.prefixPivotTable(key), operator, value);\n }\n else if (operator !== undefined) {\n return this.query[method](this.prefixPivotTable(key), operator);\n }\n else {\n return this.query[method](key);\n }\n }\n /**\n * Adds a where pivot condition to the query\n */\n whereNullPivot(variation, key) {\n let method = 'whereNull';\n switch (variation) {\n case 'or':\n method = 'orWhereNull';\n break;\n case 'not':\n method = 'whereNotNull';\n break;\n case 'orNot':\n method = 'orWhereNotNull';\n }\n return this.query[method](this.prefixPivotTable(key));\n }\n /**\n * Adds a where pivot condition to the query\n */\n whereInPivot(variation, key, value) {\n let method = 'whereIn';\n switch (variation) {\n case 'or':\n method = 'orWhereIn';\n break;\n case 'not':\n method = 'whereNotIn';\n break;\n case 'orNot':\n method = 'orWhereNotIn';\n }\n key = Array.isArray(key)\n ? key.map((one) => this.prefixPivotTable(one))\n : this.prefixPivotTable(key);\n return this.query[method](key, value);\n }\n /**\n * Select pivot columns\n */\n pivotColumns(columns) {\n this.query.knexQuery.select(columns.map((column) => {\n if (this.aliasSelectColumns) {\n return `${this.prefixPivotTable(column)} as ${this.query.relation.pivotAlias(column)}`;\n }\n return this.prefixPivotTable(column);\n }));\n return this;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { DateTime } from 'luxon';\nimport { PivotHelpers } from './pivot_helpers.js';\nimport { getValue, unique } from '../../../utils/index.js';\nimport { BaseQueryBuilder } from '../base/query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class ManyToManyQueryBuilder extends BaseQueryBuilder {\n parent;\n relation;\n pivotQuery = false;\n relatedTable;\n pivotHelpers = new PivotHelpers(this, true);\n cherryPickingKeys = false;\n appliedConstraints = false;\n /**\n * A boolean to know if query build targets only the pivot\n * table or not\n */\n get isPivotOnlyQuery() {\n return this.pivotQuery;\n }\n set isPivotOnlyQuery(pivotOnly) {\n this.pivotQuery = pivotOnly;\n /**\n * Get plain object for a pivot only query\n */\n if (this.pivotQuery) {\n this.pojo();\n }\n }\n constructor(builder, client, parent, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new ManyToManyQueryBuilder($builder, this.client, this.parent, this.relation);\n subQuery.isChildQuery = true;\n subQuery.isPivotOnlyQuery = this.isPivotOnlyQuery;\n subQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.parent = parent;\n this.relation = relation;\n this.relatedTable = this.relation.relatedModel().table;\n }\n /**\n * Profiler data for ManyToMany relationship\n */\n profilerData() {\n return {\n type: this.relation.type,\n model: this.relation.model.name,\n pivotTable: this.relation.pivotTable,\n relatedModel: this.relation.relatedModel().name,\n };\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.prefixRelatedTable(this.relation.relatedKeyColumnName)];\n }\n /**\n * Prefixes the related table name to a column\n */\n prefixRelatedTable(column) {\n return column.includes('.') ? column : `${this.relatedTable}.${column}`;\n }\n /**\n * Adds where constraint to the pivot table\n */\n addWhereConstraints() {\n const queryAction = this.queryAction();\n /**\n * Eager query constraints\n */\n if (Array.isArray(this.parent)) {\n this.wrapExisting().whereInPivot(this.relation.pivotForeignKey, unique(this.parent.map((model) => {\n return getValue(model, this.relation.localKey, this.relation, queryAction);\n })));\n return;\n }\n /**\n * Query constraints\n */\n const value = getValue(this.parent, this.relation.localKey, this.relation, queryAction);\n this.wrapExisting().wherePivot(this.relation.pivotForeignKey, value);\n }\n /**\n * Transforms the selected column names by prefixing the\n * table name\n */\n transformRelatedTableColumns(columns) {\n if (this.isPivotOnlyQuery) {\n return columns;\n }\n return columns.map((column) => {\n if (typeof column === 'string') {\n return this.prefixRelatedTable(this.resolveKey(column));\n }\n return this.transformValue(column);\n });\n }\n /**\n * Applying query constraints to scope them to relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n if (this.isPivotOnlyQuery || ['delete', 'update'].includes(this.queryAction())) {\n this.from(this.relation.pivotTable);\n this.addWhereConstraints();\n return;\n }\n /**\n * Add select statements only when not running aggregate\n * queries. The end user can still select columns\n */\n if (!this.hasAggregates) {\n /**\n * Select * from related model when user is not cherry picking\n * keys\n */\n if (!this.cherryPickingKeys) {\n this.select('*');\n }\n /**\n * Select columns from the pivot table\n */\n this.pivotColumns([this.relation.pivotForeignKey, this.relation.pivotRelatedForeignKey]\n .concat(this.relation.pivotColumns)\n .concat(this.relation.pivotTimestamps));\n }\n /**\n * Add inner join between related model and pivot table\n */\n this.innerJoin(this.relation.pivotTable, `${this.relatedTable}.${this.relation.relatedKeyColumnName}`, `${this.relation.pivotTable}.${this.relation.pivotRelatedForeignKey}`);\n this.addWhereConstraints();\n return;\n }\n /**\n * Select keys from the related table\n */\n select(...args) {\n let columns = args;\n if (Array.isArray(args[0])) {\n columns = args[0];\n }\n this.cherryPickingKeys = true;\n this.knexQuery.select(this.transformRelatedTableColumns(columns));\n return this;\n }\n /**\n * Add where clause with pivot table prefix\n */\n wherePivot(key, operator, value) {\n this.pivotHelpers.wherePivot('and', key, operator, value);\n return this;\n }\n /**\n * Add or where clause with pivot table prefix\n */\n orWherePivot(key, operator, value) {\n this.pivotHelpers.wherePivot('or', key, operator, value);\n return this;\n }\n /**\n * Alias for wherePivot\n */\n andWherePivot(key, operator, value) {\n return this.wherePivot(key, operator, value);\n }\n /**\n * Add where not pivot\n */\n whereNotPivot(key, operator, value) {\n this.pivotHelpers.wherePivot('not', key, operator, value);\n return this;\n }\n /**\n * Add or where not pivot\n */\n orWhereNotPivot(key, operator, value) {\n this.pivotHelpers.wherePivot('orNot', key, operator, value);\n return this;\n }\n /**\n * Alias for `whereNotPivot`\n */\n andWhereNotPivot(key, operator, value) {\n return this.whereNotPivot(key, operator, value);\n }\n /**\n * Adds where in clause\n */\n whereInPivot(key, value) {\n this.pivotHelpers.whereInPivot('and', key, value);\n return this;\n }\n /**\n * Adds or where in clause\n */\n orWhereInPivot(key, value) {\n this.pivotHelpers.whereInPivot('or', key, value);\n return this;\n }\n /**\n * Alias from `whereInPivot`\n */\n andWhereInPivot(key, value) {\n return this.whereInPivot(key, value);\n }\n /**\n * Adds where not in clause\n */\n whereNotInPivot(key, value) {\n this.pivotHelpers.whereInPivot('not', key, value);\n return this;\n }\n /**\n * Adds or where not in clause\n */\n orWhereNotInPivot(key, value) {\n this.pivotHelpers.whereInPivot('orNot', key, value);\n return this;\n }\n /**\n * Alias from `whereNotInPivot`\n */\n andWhereNotInPivot(key, value) {\n return this.whereNotInPivot(key, value);\n }\n /**\n * Same as \"whereNull\", but for the pivot table only\n */\n whereNullPivot(key) {\n this.pivotHelpers.whereNullPivot('and', key);\n return this;\n }\n /**\n * Same as \"orWhereNull\", but for the pivot table only\n */\n orWhereNullPivot(key) {\n this.pivotHelpers.whereNullPivot('or', key);\n return this;\n }\n /**\n * Same as \"andWhereNull\", but for the pivot table only\n */\n andWhereNullPivot(key) {\n return this.whereNullPivot(key);\n }\n /**\n * Same as \"whereNotNull\", but for the pivot table only\n */\n whereNotNullPivot(key) {\n this.pivotHelpers.whereNullPivot('not', key);\n return this;\n }\n /**\n * Same as \"orWhereNotNull\", but for the pivot table only\n */\n orWhereNotNullPivot(key) {\n this.pivotHelpers.whereNullPivot('orNot', key);\n return this;\n }\n /**\n * Same as \"andWhereNotNull\", but for the pivot table only\n */\n andWhereNotNullPivot(key) {\n return this.whereNotNullPivot(key);\n }\n /**\n * Select pivot columns\n */\n pivotColumns(columns) {\n this.pivotHelpers.pivotColumns(columns);\n return this;\n }\n /**\n * Clones query\n */\n clone() {\n this.applyConstraints();\n const clonedQuery = new ManyToManyQueryBuilder(this.knexQuery.clone(), this.client, this.parent, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.isPivotOnlyQuery = this.isPivotOnlyQuery;\n clonedQuery.cherryPickingKeys = this.cherryPickingKeys;\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Paginate through rows inside a given table\n */\n paginate(page, perPage = 20) {\n if (this.isRelatedPreloadQuery) {\n throw new Error(`Cannot paginate relationship \"${this.relation.relationName}\" during preload`);\n }\n this.applyConstraints();\n return super.paginate(page, perPage);\n }\n async exec() {\n const pivotTimestamps = this.relation.pivotTimestamps.map((timestamp) => this.relation.pivotAlias(timestamp));\n /**\n * Transform pivot timestamps\n */\n if (pivotTimestamps.length) {\n this.rowTransformer((row) => {\n pivotTimestamps.forEach((timestamp) => {\n const timestampValue = row.$extras[timestamp];\n if (!timestampValue) {\n return;\n }\n /**\n * Convert from string\n */\n if (typeof timestampValue === 'string') {\n row.$extras[timestamp] = DateTime.fromSQL(timestampValue);\n }\n /**\n * Convert from date\n */\n if (timestampValue instanceof Date) {\n row.$extras[timestamp] = DateTime.fromJSDate(timestampValue);\n }\n });\n });\n }\n return super.exec();\n }\n /**\n * Returns the group limit query\n */\n getGroupLimitQuery() {\n const { direction, column } = this.groupConstraints.orderBy || {\n column: this.prefixRelatedTable(this.resolveKey(this.relation.relatedModel().primaryKey)),\n direction: 'desc',\n };\n const rowName = 'adonis_group_limit_counter';\n const partitionBy = `PARTITION BY ${this.pivotHelpers.prefixPivotTable(this.relation.pivotForeignKey)}`;\n const orderBy = `ORDER BY ${column} ${direction}`;\n /**\n * Select * when no columns are selected\n */\n if (!this.getSelectedColumns()) {\n this.select('*');\n }\n this.select(this.client.raw(`row_number() over (${partitionBy} ${orderBy}) as ${rowName}`)).as('adonis_temp');\n const groupQuery = this.relation.relatedModel().query();\n groupQuery.usePreloader(this.preloader);\n groupQuery.sideload(this.sideloaded);\n groupQuery.debug(this.debugQueries);\n this.customReporterData && groupQuery.reporterData(this.customReporterData);\n return groupQuery.from(this).where(rowName, '<=', this.groupConstraints.limit);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { DateTime } from 'luxon';\nimport { ManyToManyQueryBuilder } from './query_builder.js';\nimport { ManyToManySubQueryBuilder } from './sub_query_builder.js';\nimport { managedTransaction, syncDiff } from '../../../utils/index.js';\n/**\n * ------------------------------------------------------------\n * NO_PIVOT_ATTRS\n * ------------------------------------------------------------\n *\n * We do not define pivot attributes during a save/create calls. Coz, one can\n * attach the related instance with multiple parent instance.\n *\n * For example:\n *\n * user.related('skills').save(skill)\n * user1.related('skills').save(skill)\n *\n * As per the above example, the `skill.$extras.pivot_user_id` will have\n * which user id?\n *\n * Same is true with a create call\n *\n * const skill = user.related('skills').create({ name: 'Programming' })\n * user1.related('skills').save(skill)\n */\n/**\n * Query client for executing queries in scope to the defined\n * relationship\n */\nexport class ManyToManyQueryClient {\n relation;\n parent;\n client;\n constructor(relation, parent, client) {\n this.relation = relation;\n this.parent = parent;\n this.client = client;\n }\n /**\n * Returns the timestamps for the pivot row\n */\n getPivotTimestamps(updatedAtOnly) {\n const timestamps = {};\n if (this.relation.pivotCreatedAtTimestamp && !updatedAtOnly) {\n timestamps[this.relation.pivotCreatedAtTimestamp] = DateTime.local().toFormat(this.client.dialect.dateTimeFormat);\n }\n if (this.relation.pivotUpdatedAtTimestamp) {\n timestamps[this.relation.pivotUpdatedAtTimestamp] = DateTime.local().toFormat(this.client.dialect.dateTimeFormat);\n }\n return timestamps;\n }\n /**\n * Generate a related query builder\n */\n static query(client, relation, rows) {\n const query = new ManyToManyQueryBuilder(client.knexQuery(), client, rows, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a related eager query builder\n */\n static eagerQuery(client, relation, rows) {\n const query = new ManyToManyQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of the related sub query builder\n */\n static subQuery(client, relation) {\n const query = new ManyToManySubQueryBuilder(client.knexQuery(), client, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a related pivot query builder\n */\n static pivotQuery(client, relation, rows) {\n const query = new ManyToManyQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = false;\n query.isPivotOnlyQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns query builder instance\n */\n query() {\n return ManyToManyQueryClient.query(this.client, this.relation, this.parent);\n }\n /**\n * Returns a query builder instance for the pivot table only\n */\n pivotQuery() {\n return ManyToManyQueryClient.pivotQuery(this.client, this.relation, this.parent);\n }\n /**\n * Save related model instance.\n * @note: Read the \"NO_PIVOT_ATTRS\" section at the top\n */\n async save(related, performSync = true, pivotAttributes) {\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n /**\n * Persist parent\n */\n this.parent.$trx = trx;\n await this.parent.save();\n /**\n * Persist related\n */\n related.$trx = trx;\n await related.save();\n const [, relatedForeignKeyValue] = this.relation.getPivotRelatedPair(related);\n const pivotPayload = {\n [relatedForeignKeyValue]: pivotAttributes || {},\n };\n /**\n * Sync when checkExisting = true, to avoid duplicate rows. Otherwise\n * perform insert\n */\n if (performSync) {\n await this.sync(pivotPayload, false, trx);\n }\n else {\n await this.attach(pivotPayload, trx);\n }\n });\n }\n /**\n * Save many of related model instances\n * @note: Read the \"NO_PIVOT_ATTRS\" section at the top\n */\n async saveMany(related, performSync = true, pivotAttributes) {\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n /**\n * Persist parent\n */\n this.parent.$trx = trx;\n await this.parent.save();\n /**\n * Persist all related models\n */\n for (let one of related) {\n one.$trx = trx;\n await one.save();\n }\n const relatedForeignKeyValues = related.reduce((result, one, index) => {\n const [, relatedForeignKeyValue] = this.relation.getPivotRelatedPair(one);\n result[relatedForeignKeyValue] = pivotAttributes?.[index] || {};\n return result;\n }, {});\n /**\n * Sync when checkExisting = true, to avoid duplicate rows. Otherwise\n * perform insert\n */\n if (performSync) {\n await this.sync(relatedForeignKeyValues, false, trx);\n }\n else {\n await this.attach(relatedForeignKeyValues, trx);\n }\n });\n }\n /**\n * Create and persist an instance of related model. Also makes the pivot table\n * entry to create the relationship\n * @note: Read the \"NO_PIVOT_ATTRS\" section at the top\n */\n async create(values, pivotAttributes, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n /**\n * Create and persist related model instance\n */\n const related = await this.relation.relatedModel().create(values, { client: trx, ...options });\n const [, relatedForeignKeyValue] = this.relation.getPivotRelatedPair(related);\n const pivotPayload = {\n [relatedForeignKeyValue]: pivotAttributes || {},\n };\n /**\n * Attach new rows\n */\n await this.attach(pivotPayload, trx);\n return related;\n });\n }\n /**\n * Create and persist multiple of instances of related model. Also makes\n * the pivot table entries to create the relationship.\n * @note: Read the \"NO_PIVOT_ATTRS\" section at the top\n */\n async createMany(values, pivotAttributes, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n /**\n * Create and persist related model instance\n */\n const related = await this.relation\n .relatedModel()\n .createMany(values, { client: trx, ...options });\n const relatedForeignKeyValues = related.reduce((result, one, index) => {\n const [, relatedForeignKeyValue] = this.relation.getPivotRelatedPair(one);\n result[relatedForeignKeyValue] = pivotAttributes?.[index] || {};\n return result;\n }, {});\n /**\n * Attach new rows\n */\n await this.attach(relatedForeignKeyValues, trx);\n return related;\n });\n }\n /**\n * Attach one or more related models using it's foreign key value\n * by performing insert inside the pivot table.\n */\n async attach(ids, trx) {\n /**\n * Pivot foreign key value (On the parent model)\n */\n const [, foreignKeyValue] = this.relation.getPivotPair(this.parent);\n /**\n * Finding if `ids` parameter is an object or not\n */\n const hasAttributes = !Array.isArray(ids);\n /**\n * Extracting pivot related foreign keys (On the related model)\n */\n const pivotRows = (!hasAttributes ? ids : Object.keys(ids)).map((id) => {\n return Object.assign(this.getPivotTimestamps(false), hasAttributes ? ids[id] : {}, {\n [this.relation.pivotForeignKey]: foreignKeyValue,\n [this.relation.pivotRelatedForeignKey]: id,\n });\n });\n if (!pivotRows.length) {\n return;\n }\n /**\n * Perform bulk insert\n */\n const query = trx ? trx.insertQuery() : this.client.insertQuery();\n await query.table(this.relation.pivotTable).multiInsert(pivotRows);\n }\n /**\n * Detach related ids from the pivot table\n */\n async detach(ids, trx) {\n const query = this.pivotQuery();\n /**\n * Scope deletion to specific rows when `id` is defined. Otherwise\n * delete all the rows\n */\n if (ids && ids.length) {\n query.whereInPivot(this.relation.pivotRelatedForeignKey, ids);\n }\n /**\n * Use transaction when defined\n */\n if (trx) {\n query.useTransaction(trx);\n }\n await query.del();\n }\n /**\n * Sync pivot rows by\n *\n * - Dropping the non-existing one's.\n * - Creating the new one's.\n * - Updating the existing one's with different attributes.\n */\n async sync(ids, \n /**\n * Detach means, do not remove existing rows, that are\n * missing in this new object/array.\n */\n detach = true, trx) {\n await managedTransaction(trx || this.client, async (transaction) => {\n const hasAttributes = !Array.isArray(ids);\n /**\n * An object of pivot rows from from the incoming ids or\n * an object of key-value pair.\n */\n const pivotRows = !hasAttributes\n ? ids.reduce((result, id) => {\n result[id] = {};\n return result;\n }, {})\n : ids;\n const query = this.pivotQuery().useTransaction(transaction);\n /**\n * We must scope the select query to related foreign key when ids\n * is an array and not an object. This will help in performance\n * when there are indexes defined on this key\n */\n if (!hasAttributes) {\n query.select(this.relation.pivotRelatedForeignKey);\n }\n const pivotRelatedForeignKeys = Object.keys(pivotRows);\n /**\n * Fetch existing pivot rows for the relationship\n */\n const existingPivotRows = await query\n .whereIn(this.relation.pivotRelatedForeignKey, pivotRelatedForeignKeys)\n .exec();\n /**\n * Find a diff of rows being removed, added or updated in comparison\n * to the existing pivot rows.\n */\n const { added, updated } = syncDiff(existingPivotRows.reduce((result, row) => {\n result[row[this.relation.pivotRelatedForeignKey]] = row;\n return result;\n }, {}), pivotRows);\n /**\n * Add new rows\n */\n await this.attach(added, transaction);\n /**\n * Update\n */\n for (let id of Object.keys(updated)) {\n const attributes = updated[id];\n await this.pivotQuery()\n .useTransaction(transaction)\n .wherePivot(this.relation.pivotRelatedForeignKey, id)\n .update(Object.assign({}, this.getPivotTimestamps(true), attributes));\n }\n /**\n * Return early when detach is disabled.\n */\n if (!detach) {\n return;\n }\n /**\n * Detach everything except the synced ids\n */\n await this.pivotQuery()\n .useTransaction(transaction)\n .whereNotInPivot(this.relation.pivotRelatedForeignKey, pivotRelatedForeignKeys)\n .del();\n });\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { KeysExtractor } from '../keys_extractor.js';\nimport { ManyToManyQueryClient } from './query_client.js';\nimport { ensureRelationIsBooted, getValue } from '../../../utils/index.js';\n/**\n * Manages loading and persisting many to many relationship\n */\nexport class ManyToMany {\n relationName;\n relatedModel;\n options;\n model;\n type = 'manyToMany';\n booted = false;\n serializeAs;\n /**\n * Timestamp columns for the pivot table\n */\n get pivotTimestamps() {\n const timestamps = [];\n this.pivotCreatedAtTimestamp && timestamps.push(this.pivotCreatedAtTimestamp);\n this.pivotUpdatedAtTimestamp && timestamps.push(this.pivotUpdatedAtTimestamp);\n return timestamps;\n }\n /**\n * Reference to the onQuery hook defined by the user\n */\n onQueryHook;\n /**\n * Computes the created at timestamps column name\n * for the pivot table\n */\n computedCreatedAtTimestamp() {\n if (!this.options.pivotTimestamps) {\n return;\n }\n if (this.options.pivotTimestamps === true) {\n this.pivotCreatedAtTimestamp = 'created_at';\n return;\n }\n if (typeof this.options.pivotTimestamps.createdAt === 'string') {\n this.pivotCreatedAtTimestamp = this.options.pivotTimestamps.createdAt;\n }\n else if (this.options.pivotTimestamps.createdAt === true) {\n this.pivotCreatedAtTimestamp = 'created_at';\n }\n }\n /**\n * Computes the updated at timestamps column name\n * for the pivot table\n */\n computedUpdatedAtTimestamp() {\n if (!this.options.pivotTimestamps) {\n return;\n }\n if (this.options.pivotTimestamps === true) {\n this.pivotUpdatedAtTimestamp = 'updated_at';\n return;\n }\n if (typeof this.options.pivotTimestamps.updatedAt === 'string') {\n this.pivotUpdatedAtTimestamp = this.options.pivotTimestamps.updatedAt;\n }\n else if (this.options.pivotTimestamps.updatedAt === true) {\n this.pivotUpdatedAtTimestamp = 'updated_at';\n }\n }\n constructor(relationName, relatedModel, options, model) {\n this.relationName = relationName;\n this.relatedModel = relatedModel;\n this.options = options;\n this.model = model;\n this.serializeAs =\n this.options.serializeAs === undefined ? this.relationName : this.options.serializeAs;\n this.pivotColumns = this.options.pivotColumns || [];\n this.onQueryHook = this.options.onQuery;\n this.meta = this.options.meta;\n }\n /**\n * Returns the alias for the pivot key\n */\n pivotAlias(key) {\n return `pivot_${key}`;\n }\n /**\n * Clone relationship instance\n */\n clone(parent) {\n return new ManyToMany(this.relationName, this.relatedModel, { ...this.options }, parent);\n }\n /**\n * Boot the relationship and ensure that all keys are in\n * place for queries to do their job.\n */\n boot() {\n if (this.booted) {\n return;\n }\n const relatedModel = this.relatedModel();\n /**\n * Extracting keys from the model and the relation model. The keys\n * extractor ensures all the required columns are defined on\n * the models for the relationship to work\n */\n const { localKey, relatedKey } = new KeysExtractor(this.model, this.relationName, {\n localKey: {\n model: this.model,\n key: this.options.localKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, relatedModel, this.relationName),\n },\n relatedKey: {\n model: relatedModel,\n key: this.options.relatedKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, relatedModel, this.relationName),\n },\n }).extract();\n this.pivotTable =\n this.options.pivotTable ||\n this.model.namingStrategy.relationPivotTable(this.type, this.model, relatedModel, this.relationName);\n /**\n * Keys on the parent model\n */\n this.localKey = localKey.attributeName;\n this.localKeyColumnName = localKey.columnName;\n /**\n * Keys on the related model\n */\n this.relatedKey = relatedKey.attributeName;\n this.relatedKeyColumnName = relatedKey.columnName;\n /**\n * Parent model foreign key in the pivot table\n */\n this.pivotForeignKey =\n this.options.pivotForeignKey ||\n this.model.namingStrategy.relationPivotForeignKey(this.type, this.model, relatedModel, this.relationName);\n /**\n * Related model foreign key in the pivot table\n */\n this.pivotRelatedForeignKey =\n this.options.pivotRelatedForeignKey ||\n this.model.namingStrategy.relationPivotForeignKey(this.type, relatedModel, this.model, this.relationName);\n /**\n * Configure pivot timestamps to use. This is a temporary\n * setup. We will have to soon introduce pivot models\n */\n this.computedCreatedAtTimestamp();\n this.computedUpdatedAtTimestamp();\n /**\n * Booted successfully\n */\n this.booted = true;\n }\n /**\n * Set related model instances\n */\n setRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Push related model instance(s)\n */\n pushRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$pushRelated(this.relationName, related);\n }\n /**\n * Finds and set the related model instances next to the parent\n * models.\n */\n setRelatedForMany(parent, related) {\n ensureRelationIsBooted(this);\n const pivotForeignKeyAlias = this.pivotAlias(this.pivotForeignKey);\n parent.forEach((parentModel) => {\n this.setRelated(parentModel, related.filter((relatedModel) => {\n const value = parentModel[this.localKey];\n return value !== undefined && relatedModel.$extras[pivotForeignKeyAlias] === value;\n }));\n });\n }\n /**\n * Returns an instance of query client for invoking queries\n */\n client(parent, client) {\n ensureRelationIsBooted(this);\n return new ManyToManyQueryClient(this, parent, client);\n }\n /**\n * Returns an instance of eager query builder\n */\n eagerQuery(parent, client) {\n ensureRelationIsBooted(this);\n return ManyToManyQueryClient.eagerQuery(client, this, parent);\n }\n /**\n * Returns instance of query builder\n */\n subQuery(client) {\n ensureRelationIsBooted(this);\n return ManyToManyQueryClient.subQuery(client, this);\n }\n /**\n * Returns key-value pair for the pivot table in relation to the parent model\n */\n getPivotPair(parent) {\n return [this.pivotForeignKey, getValue(parent, this.localKey, this, 'persist')];\n }\n /**\n * Returns key-value pair for the pivot table in relation to the related model\n */\n getPivotRelatedPair(related) {\n return [this.pivotRelatedForeignKey, getValue(related, this.relatedKey, this, 'persist')];\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { getValue, unique } from '../../../utils/index.js';\nimport { BaseQueryBuilder } from '../base/query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class HasManyThroughQueryBuilder extends BaseQueryBuilder {\n parent;\n relation;\n cherryPickingKeys = false;\n appliedConstraints = false;\n throughTable;\n relatedTable;\n constructor(builder, client, parent, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasManyThroughQueryBuilder($builder, this.client, this.parent, this.relation);\n subQuery.isChildQuery = true;\n subQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.parent = parent;\n this.relation = relation;\n this.throughTable = this.relation.throughModel().table;\n this.relatedTable = this.relation.relatedModel().table;\n }\n /**\n * Prefixes the through table name to a column\n */\n prefixThroughTable(column) {\n return column.includes('.') ? column : `${this.throughTable}.${column}`;\n }\n /**\n * Prefixes the related table name to a column\n */\n prefixRelatedTable(column) {\n return column.includes('.') ? column : `${this.relatedTable}.${column}`;\n }\n /**\n * Adds where constraint to the pivot table\n */\n addWhereConstraints(builder) {\n const queryAction = this.queryAction();\n /**\n * Eager query constraints\n */\n if (Array.isArray(this.parent)) {\n builder.whereIn(this.prefixThroughTable(this.relation.foreignKeyColumnName), unique(this.parent.map((model) => {\n return getValue(model, this.relation.localKey, this.relation, queryAction);\n })));\n return;\n }\n /**\n * Query constraints\n */\n const value = getValue(this.parent, this.relation.localKey, this.relation, queryAction);\n builder.where(this.prefixThroughTable(this.relation.foreignKeyColumnName), value);\n }\n /**\n * Transforms the selected column names by prefixing the\n * table name\n */\n transformRelatedTableColumns(columns) {\n return columns.map((column) => {\n if (typeof column === 'string') {\n return this.prefixRelatedTable(this.resolveKey(column));\n }\n return this.transformValue(column);\n });\n }\n /**\n * Profiler data for HasManyThrough relationship\n */\n profilerData() {\n return {\n type: this.relation.type,\n model: this.relation.model.name,\n throughModel: this.relation.throughModel().name,\n relatedModel: this.relation.relatedModel().name,\n };\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.prefixRelatedTable(this.relation.throughForeignKeyColumnName)];\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n if (['delete', 'update'].includes(this.queryAction())) {\n this.whereIn(this.prefixRelatedTable(this.relation.throughForeignKeyColumnName), (subQuery) => {\n subQuery.from(this.throughTable);\n this.addWhereConstraints(subQuery);\n });\n return;\n }\n /**\n * Add select statements only when not running aggregate\n * queries. The end user can still select columns\n */\n if (!this.hasAggregates) {\n /**\n * Select * from related model when user is not cherry picking\n * keys\n */\n if (!this.cherryPickingKeys) {\n this.select('*');\n }\n /**\n * Selecting all from the related table, along with the foreign key of the\n * through table.\n */\n this.knexQuery.select(`${this.prefixThroughTable(this.relation.foreignKeyColumnName)} as ${this.relation.throughAlias(this.relation.foreignKeyColumnName)}`);\n }\n /**\n * Inner join\n */\n this.innerJoin(this.throughTable, this.prefixThroughTable(this.relation.throughLocalKeyColumnName), this.prefixRelatedTable(this.relation.throughForeignKeyColumnName));\n /**\n * Adding where constraints\n */\n this.addWhereConstraints(this);\n }\n /**\n * Select keys from the related table\n */\n select(...args) {\n let columns = args;\n if (Array.isArray(args[0])) {\n columns = args[0];\n }\n this.cherryPickingKeys = true;\n this.knexQuery.select(this.transformRelatedTableColumns(columns));\n return this;\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasManyThroughQueryBuilder(this.knexQuery.clone(), this.client, this.parent, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.cherryPickingKeys = this.cherryPickingKeys;\n clonedQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Paginate through rows inside a given table\n */\n paginate(page, perPage = 20) {\n if (this.isRelatedPreloadQuery) {\n throw new Error(`Cannot paginate relationship \"${this.relation.relationName}\" during preload`);\n }\n this.applyConstraints();\n return super.paginate(page, perPage);\n }\n /**\n * Returns the group limit query\n */\n getGroupLimitQuery() {\n const { direction, column } = this.groupConstraints.orderBy || {\n column: this.prefixRelatedTable(this.resolveKey(this.relation.relatedModel().primaryKey)),\n direction: 'desc',\n };\n const rowName = 'adonis_group_limit_counter';\n const partitionBy = `PARTITION BY ${this.prefixThroughTable(this.relation.foreignKeyColumnName)}`;\n const orderBy = `ORDER BY ${column} ${direction}`;\n /**\n * Select * when no columns are selected\n */\n if (!this.getSelectedColumns()) {\n this.select('*');\n }\n this.select(this.client.raw(`row_number() over (${partitionBy} ${orderBy}) as ${rowName}`)).as('adonis_temp');\n const groupQuery = this.relation.relatedModel().query();\n groupQuery.usePreloader(this.preloader);\n groupQuery.sideload(this.sideloaded);\n groupQuery.debug(this.debugQueries);\n this.customReporterData && groupQuery.reporterData(this.customReporterData);\n return groupQuery.from(this).where(rowName, '<=', this.groupConstraints.limit);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { BaseSubQueryBuilder } from '../base/sub_query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class HasManyThroughSubQueryBuilder extends BaseSubQueryBuilder {\n relation;\n /**\n * A boolean to track if query constraints for the relationship\n * has been applied or not\n */\n appliedConstraints = false;\n /**\n * Reference to the related table\n */\n relatedTable;\n /**\n * Reference to the through table\n */\n throughTable;\n hasSelfRelation;\n constructor(builder, client, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasManyThroughSubQueryBuilder($builder, this.client, this.relation);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.relation = relation;\n this.relatedTable = this.relation.relatedModel().table;\n this.throughTable = this.relation.throughModel().table;\n this.hasSelfRelation = this.relatedTable === this.relation.model.table;\n }\n /**\n * Prefixes the through table name to a column\n */\n prefixThroughTable(column) {\n return column.includes('.') ? column : `${this.throughTable}.${column}`;\n }\n /**\n * Prefixes the related table name to a column\n */\n prefixRelatedTable(column) {\n if (column.includes('.')) {\n return column;\n }\n if (this.hasSelfRelation) {\n return `${this.selfJoinAlias}.${column}`;\n }\n return `${this.relatedTable}.${column}`;\n }\n /**\n * Transforms the selected column names by prefixing the\n * table name\n */\n transformRelatedTableColumns(columns) {\n return columns.map((column) => {\n if (typeof column === 'string') {\n return this.prefixRelatedTable(this.resolveKey(column));\n }\n return this.transformValue(column);\n });\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.throughForeignKeyColumnName];\n }\n /**\n * Select keys from the related table\n */\n select(...args) {\n let columns = args;\n if (Array.isArray(args[0])) {\n columns = args[0];\n }\n this.knexQuery.select(this.transformRelatedTableColumns(columns));\n return this;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n /**\n * In case of self joins, we must alias the table selection\n */\n if (this.relation.relatedModel() === this.relation.model) {\n this.knexQuery.from(`${this.relatedTable} as ${this.selfJoinAlias}`);\n }\n this.innerJoin(this.throughTable, this.prefixThroughTable(this.relation.throughLocalKeyColumnName), this.prefixRelatedTable(this.relation.throughForeignKeyColumnName));\n this.where(`${this.relation.model.table}.${this.relation.localKeyColumnName}`, this.client.ref(this.prefixThroughTable(this.relation.foreignKeyColumnName)));\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasManyThroughSubQueryBuilder(this.knexQuery.clone(), this.client, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { HasManyThroughQueryBuilder } from './query_builder.js';\nimport { HasManyThroughSubQueryBuilder } from './sub_query_builder.js';\n/**\n * Query client for executing queries in scope to the defined\n * relationship\n */\nexport class HasManyThroughClient {\n relation;\n parent;\n client;\n constructor(relation, parent, client) {\n this.relation = relation;\n this.parent = parent;\n this.client = client;\n }\n /**\n * Generate a related query builder\n */\n static query(client, relation, rows) {\n const query = new HasManyThroughQueryBuilder(client.knexQuery(), client, rows, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a related eager query builder\n */\n static eagerQuery(client, relation, rows) {\n const query = new HasManyThroughQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of the sub query\n */\n static subQuery(client, relation) {\n const query = new HasManyThroughSubQueryBuilder(client.knexQuery(), client, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of has many through query builder\n */\n query() {\n return HasManyThroughClient.query(this.client, this.relation, this.parent);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { KeysExtractor } from '../keys_extractor.js';\nimport { HasManyThroughClient } from './query_client.js';\nimport { ensureRelationIsBooted } from '../../../utils/index.js';\n/**\n * Manages loading and persisting has many through relationship\n */\nexport class HasManyThrough {\n relationName;\n relatedModel;\n options;\n model;\n type = 'hasManyThrough';\n booted = false;\n serializeAs;\n throughModel;\n /**\n * Reference to the onQuery hook defined by the user\n */\n onQueryHook;\n constructor(relationName, relatedModel, options, model) {\n this.relationName = relationName;\n this.relatedModel = relatedModel;\n this.options = options;\n this.model = model;\n this.onQueryHook = this.options.onQuery;\n this.throughModel = this.options.throughModel;\n this.serializeAs =\n this.options.serializeAs === undefined ? this.relationName : this.options.serializeAs;\n this.meta = this.options.meta;\n }\n /**\n * Clone relationship instance\n */\n clone(parent) {\n return new HasManyThrough(this.relationName, this.relatedModel, { ...this.options }, parent);\n }\n /**\n * Returns the alias for the through key\n */\n throughAlias(key) {\n return `through_${key}`;\n }\n /**\n * Boot the relationship and ensure that all keys are in\n * place for queries to do their job.\n */\n boot() {\n if (this.booted) {\n return;\n }\n /**\n * Extracting keys from the model and the relation model. The keys\n * extractor ensures all the required columns are defined on\n * the models for the relationship to work\n */\n const { localKey, foreignKey, throughLocalKey, throughForeignKey } = new KeysExtractor(this.model, this.relationName, {\n localKey: {\n model: this.model,\n key: this.options.localKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, this.relatedModel(), this.relationName),\n },\n foreignKey: {\n model: this.throughModel(),\n key: this.options.foreignKey ||\n this.model.namingStrategy.relationForeignKey(this.type, this.model, this.throughModel(), this.relationName),\n },\n throughLocalKey: {\n model: this.throughModel(),\n key: this.options.throughLocalKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.throughModel(), this.relatedModel(), this.relationName),\n },\n throughForeignKey: {\n model: this.relatedModel(),\n key: this.options.throughForeignKey ||\n this.model.namingStrategy.relationForeignKey(this.type, this.throughModel(), this.relatedModel(), this.relationName),\n },\n }).extract();\n /**\n * Keys on the parent model\n */\n this.localKey = localKey.attributeName;\n this.localKeyColumnName = localKey.columnName;\n /**\n * Keys on the through model\n */\n this.foreignKey = foreignKey.attributeName;\n this.foreignKeyColumnName = foreignKey.columnName;\n this.throughLocalKey = throughLocalKey.attributeName;\n this.throughLocalKeyColumnName = throughLocalKey.columnName;\n this.throughForeignKey = throughForeignKey.attributeName;\n this.throughForeignKeyColumnName = throughForeignKey.columnName;\n /**\n * Booted successfully\n */\n this.booted = true;\n }\n /**\n * Set related model instances\n */\n setRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Push related model instance(s)\n */\n pushRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$pushRelated(this.relationName, related);\n }\n /**\n * Finds and set the related model instances next to the parent\n * models.\n */\n setRelatedForMany(parent, related) {\n ensureRelationIsBooted(this);\n const $foreignCastAsKeyAlias = this.throughAlias(this.foreignKeyColumnName);\n parent.forEach((parentModel) => {\n this.setRelated(parentModel, related.filter((relatedModel) => {\n const value = parentModel[this.localKey];\n return value !== undefined && relatedModel.$extras[$foreignCastAsKeyAlias] === value;\n }));\n });\n }\n /**\n * Returns an instance of query client for invoking queries\n */\n client(parent, client) {\n ensureRelationIsBooted(this);\n return new HasManyThroughClient(this, parent, client);\n }\n /**\n * Returns instance of the eager query\n */\n eagerQuery(parent, client) {\n ensureRelationIsBooted(this);\n return HasManyThroughClient.eagerQuery(client, this, parent);\n }\n /**\n * Returns instance of query builder\n */\n subQuery(client) {\n ensureRelationIsBooted(this);\n return HasManyThroughClient.subQuery(client, this);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * An implementation for lazy loading model relationship aggregates\n */\nexport class LazyLoadAggregates {\n model;\n query;\n constructor(model) {\n this.model = model;\n /**\n * Model must be persisted before the lazy loading can happen\n */\n const Model = this.model.constructor;\n /**\n * The \"refresh\" query has the where clause already assigned\n */\n this.query = this.model.$getQueryFor('refresh', Model.$adapter.modelClient(this.model));\n /**\n * Selecting just the primary key\n */\n this.query.select(Model.primaryKey);\n }\n /**\n * Load aggregate of relationship\n */\n loadAggregate(relationName, userCallback) {\n this.query.withAggregate(relationName, userCallback);\n return this;\n }\n /**\n * Load count of relationship\n */\n loadCount(relationName, userCallback) {\n this.query.withCount(relationName, userCallback);\n return this;\n }\n /**\n * Execute query\n */\n async exec() {\n const result = await this.query.pojo().first();\n if (!result) {\n return;\n }\n /**\n * Consume adapter result\n */\n this.model.$consumeAdapterResult(result);\n }\n /**\n * Implementation of `then` for the promise API\n */\n then(resolve, reject) {\n return this.exec().then(resolve, reject);\n }\n /**\n * Implementation of `catch` for the promise API\n */\n catch(reject) {\n return this.exec().catch(reject);\n }\n /**\n * Implementation of `finally` for the promise API\n */\n finally(fullfilled) {\n return this.exec().finally(fullfilled);\n }\n /**\n * Required when Promises are extended\n */\n get [Symbol.toStringTag]() {\n return this.constructor.name;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { DateTime } from 'luxon';\nimport Hooks from '@poppinss/hooks';\nimport lodash from '@poppinss/utils/lodash';\nimport { Exception, defineStaticProperty } from '@poppinss/utils';\nimport * as errors from '../../errors.js';\nimport { Preloader } from '../preloader/index.js';\nimport { proxyHandler } from './proxy_handler.js';\nimport { ModelKeys } from '../model_keys/index.js';\nimport { HasOne } from '../relations/has_one/index.js';\nimport { HasMany } from '../relations/has_many/index.js';\nimport { BelongsTo } from '../relations/belongs_to/index.js';\nimport { ManyToMany } from '../relations/many_to_many/index.js';\nimport { HasManyThrough } from '../relations/has_many_through/index.js';\nimport { CamelCaseNamingStrategy } from '../naming_strategies/camel_case.js';\nimport { LazyLoadAggregates } from '../relations/aggregates_loader/lazy_load.js';\nimport { isObject, collectValues, ensureRelation, managedTransaction, normalizeCherryPickObject, transformDateValue, compareValues, } from '../../utils/index.js';\nconst MANY_RELATIONS = ['hasMany', 'manyToMany', 'hasManyThrough'];\nconst DATE_TIME_TYPES = {\n date: 'date',\n datetime: 'datetime',\n};\nfunction StaticImplements() {\n return (_t) => { };\n}\n/**\n * Abstract class to define fully fledged data models\n */\nlet BaseModelImpl = class BaseModelImpl {\n /**\n * The adapter to be used for persisting and fetching data.\n *\n * NOTE: Adapter is a singleton and share among all the models, unless\n * a user wants to swap the adapter for a given model\n */\n static $adapter;\n /**\n * Define an adapter to use for interacting with\n * the database\n */\n static useAdapter(adapter) {\n this.$adapter = adapter;\n }\n /**\n * Naming strategy for model properties\n */\n static namingStrategy = new CamelCaseNamingStrategy();\n /**\n * Primary key is required to build relationships across models\n */\n static primaryKey;\n /**\n * Whether the model has been booted. Booting the model initializes its\n * static properties. Base models must not be initialized.\n */\n static booted;\n /**\n * Query scopes defined on the model\n */\n static $queryScopes = {};\n /**\n * A set of properties marked as computed. Computed properties are included in\n * the `toJSON` result, else they behave the same way as any other instance\n * property.\n */\n static $computedDefinitions;\n /**\n * Columns makes it easier to define extra props on the model\n * and distinguish them with the attributes to be sent\n * over to the adapter\n */\n static $columnsDefinitions;\n /**\n * Registered relationships for the given model\n */\n static $relationsDefinitions;\n /**\n * The name of database table. It is auto generated from the model name, unless\n * specified\n */\n static table;\n /**\n * Self assign the primary instead of relying on the database to\n * return it back\n */\n static selfAssignPrimaryKey;\n /**\n * A custom connection to use for queries. The connection defined on\n * query builder is preferred over the model connection\n */\n static connection;\n /**\n * Storing model hooks\n */\n static $hooks;\n /**\n * Keys mappings to make the lookups easy\n */\n static $keys;\n /**\n * Creates a new model instance with payload and adapter options\n */\n static newUpWithOptions(payload, options, allowExtraProperties) {\n const row = new this();\n row.merge(payload, allowExtraProperties);\n /**\n * Pass client options to the newly created row. If row was found\n * the query builder will set the same options.\n */\n row.$setOptionsAndTrx(options);\n return row;\n }\n /**\n * Helper method for `fetchOrNewUpMany`, `fetchOrCreateMany` and `createOrUpdate`\n * many.\n */\n static newUpIfMissing(rowObjects, existingRows, keys, mergeAttribute, options, allowExtraProperties) {\n /**\n * Return existing or create missing rows in the same order as the original\n * array\n */\n return rowObjects.map((rowObject) => {\n const existingRow = existingRows.find((row) => {\n return keys.every((key) => {\n const objectValue = rowObject[key];\n const rowValue = row[key];\n return compareValues(rowValue, objectValue);\n });\n });\n /**\n * Return the row found from the select call\n */\n if (existingRow) {\n if (mergeAttribute) {\n existingRow.merge(rowObject, allowExtraProperties);\n }\n return existingRow;\n }\n /**\n * Otherwise create a new one\n */\n return this.newUpWithOptions(rowObject, options, allowExtraProperties);\n });\n }\n /**\n * Returns the model query instance for the given model\n */\n static query(options) {\n return this.$adapter.query(this, options);\n }\n static async transaction(callbackOrOptions, options) {\n if (typeof callbackOrOptions === 'function') {\n const client = this.$adapter.modelConstructorClient(this, options);\n return client.transaction(callbackOrOptions, options);\n }\n const client = this.$adapter.modelConstructorClient(this, callbackOrOptions);\n return client.transaction(callbackOrOptions);\n }\n /**\n * Create a model instance from the adapter result. The result value must\n * be a valid object, otherwise `null` is returned.\n */\n static $createFromAdapterResult(adapterResult, sideloadAttributes, options) {\n if (typeof adapterResult !== 'object' || Array.isArray(adapterResult)) {\n return null;\n }\n const instance = new this();\n instance.$consumeAdapterResult(adapterResult, sideloadAttributes);\n instance.$hydrateOriginals();\n instance.$setOptionsAndTrx(options);\n instance.$isPersisted = true;\n instance.$isLocal = false;\n return instance;\n }\n /**\n * Creates an array of models from the adapter results. The `adapterResults`\n * must be an array with valid Javascript objects.\n *\n * 1. If top level value is not an array, then an empty array is returned.\n * 2. If row is not an object, then it will be ignored.\n */\n static $createMultipleFromAdapterResult(adapterResults, sideloadAttributes, options) {\n if (!Array.isArray(adapterResults)) {\n return [];\n }\n return adapterResults.reduce((models, row) => {\n if (isObject(row)) {\n models.push(this.$createFromAdapterResult(row, sideloadAttributes, options));\n }\n return models;\n }, []);\n }\n /**\n * Define a new column on the model. This is required, so that\n * we differentiate between plain properties vs model attributes.\n */\n static $addColumn(name, options) {\n const descriptor = Object.getOwnPropertyDescriptor(this.prototype, name);\n const column = {\n isPrimary: options.isPrimary || false,\n columnName: options.columnName || this.namingStrategy.columnName(this, name),\n hasGetter: !!(descriptor && descriptor.get),\n hasSetter: !!(descriptor && descriptor.set),\n serializeAs: options.serializeAs !== undefined\n ? options.serializeAs\n : this.namingStrategy.serializedName(this, name),\n serialize: options.serialize,\n prepare: options.prepare,\n consume: options.consume,\n meta: options.meta,\n };\n /**\n * Set column as the primary column, when `primary` is true\n */\n if (column.isPrimary) {\n this.primaryKey = name;\n }\n this.$columnsDefinitions.set(name, column);\n this.$keys.attributesToColumns.add(name, column.columnName);\n column.serializeAs && this.$keys.attributesToSerialized.add(name, column.serializeAs);\n this.$keys.columnsToAttributes.add(column.columnName, name);\n column.serializeAs && this.$keys.columnsToSerialized.add(column.columnName, column.serializeAs);\n column.serializeAs && this.$keys.serializedToAttributes.add(column.serializeAs, name);\n column.serializeAs && this.$keys.serializedToColumns.add(column.serializeAs, column.columnName);\n return column;\n }\n /**\n * Returns a boolean telling if column exists on the model\n */\n static $hasColumn(name) {\n return this.$columnsDefinitions.has(name);\n }\n /**\n * Returns the column for a given name\n */\n static $getColumn(name) {\n return this.$columnsDefinitions.get(name);\n }\n /**\n * Adds a computed node\n */\n static $addComputed(name, options) {\n const computed = {\n serializeAs: options.serializeAs !== undefined\n ? options.serializeAs\n : this.namingStrategy.serializedName(this, name),\n meta: options.meta,\n };\n this.$computedDefinitions.set(name, computed);\n return computed;\n }\n /**\n * Find if some property is marked as computed\n */\n static $hasComputed(name) {\n return this.$computedDefinitions.has(name);\n }\n /**\n * Get computed node\n */\n static $getComputed(name) {\n return this.$computedDefinitions.get(name);\n }\n /**\n * Register has one relationship\n */\n static $addHasOne(name, relatedModel, options) {\n this.$relationsDefinitions.set(name, new HasOne(name, relatedModel, options, this));\n }\n /**\n * Register has many relationship\n */\n static $addHasMany(name, relatedModel, options) {\n this.$relationsDefinitions.set(name, new HasMany(name, relatedModel, options, this));\n }\n /**\n * Register belongs to relationship\n */\n static $addBelongsTo(name, relatedModel, options) {\n this.$relationsDefinitions.set(name, new BelongsTo(name, relatedModel, options, this));\n }\n /**\n * Register many-to-many relationship\n */\n static $addManyToMany(name, relatedModel, options) {\n this.$relationsDefinitions.set(name, new ManyToMany(name, relatedModel, options, this));\n }\n /**\n * Register has many through relationship\n */\n static $addHasManyThrough(name, relatedModel, options) {\n this.$relationsDefinitions.set(name, new HasManyThrough(name, relatedModel, options, this));\n }\n /**\n * Adds a relationship\n */\n static $addRelation(name, type, relatedModel, options) {\n switch (type) {\n case 'hasOne':\n this.$addHasOne(name, relatedModel, options);\n break;\n case 'hasMany':\n this.$addHasMany(name, relatedModel, options);\n break;\n case 'belongsTo':\n this.$addBelongsTo(name, relatedModel, options);\n break;\n case 'manyToMany':\n this.$addManyToMany(name, relatedModel, options);\n break;\n case 'hasManyThrough':\n this.$addHasManyThrough(name, relatedModel, options);\n break;\n default:\n throw new Error(`${type} is not a supported relation type`);\n }\n }\n /**\n * Find if some property is marked as a relation or not\n */\n static $hasRelation(name) {\n return this.$relationsDefinitions.has(name);\n }\n /**\n * Returns relationship node for a given relation\n */\n static $getRelation(name) {\n return this.$relationsDefinitions.get(name);\n }\n /**\n * Define a static property on the model using the inherit or\n * define strategy.\n *\n * Inherit strategy will clone the property from the parent model\n * and will set it on the current model\n */\n static $defineProperty(propertyName, defaultValue, strategy) {\n defineStaticProperty(this, propertyName, {\n initialValue: defaultValue,\n strategy: strategy,\n });\n }\n /**\n * Boot the model\n */\n static boot() {\n /**\n * Define the property when not defined on self\n */\n if (!this.hasOwnProperty('booted')) {\n this.booted = false;\n }\n /**\n * Return when already booted\n */\n if (this.booted === true) {\n return;\n }\n this.booted = true;\n /**\n * Table name is never inherited from the base model\n */\n this.$defineProperty('table', this.namingStrategy.tableName(this), 'define');\n /**\n * Inherit primary key or default to \"id\"\n */\n this.$defineProperty('primaryKey', 'id', 'inherit');\n /**\n * Inherit selfAssignPrimaryKey or default to \"false\"\n */\n this.$defineProperty('selfAssignPrimaryKey', false, 'inherit');\n /**\n * Define the keys' property. This allows looking up variations\n * for model keys\n */\n this.$defineProperty('$keys', {\n attributesToColumns: new ModelKeys(),\n attributesToSerialized: new ModelKeys(),\n columnsToAttributes: new ModelKeys(),\n columnsToSerialized: new ModelKeys(),\n serializedToColumns: new ModelKeys(),\n serializedToAttributes: new ModelKeys(),\n }, (value) => {\n return {\n attributesToColumns: new ModelKeys(Object.assign({}, value.attributesToColumns.all())),\n attributesToSerialized: new ModelKeys(Object.assign({}, value.attributesToSerialized.all())),\n columnsToAttributes: new ModelKeys(Object.assign({}, value.columnsToAttributes.all())),\n columnsToSerialized: new ModelKeys(Object.assign({}, value.columnsToSerialized.all())),\n serializedToColumns: new ModelKeys(Object.assign({}, value.serializedToColumns.all())),\n serializedToAttributes: new ModelKeys(Object.assign({}, value.serializedToAttributes.all())),\n };\n });\n /**\n * Define columns\n */\n this.$defineProperty('$columnsDefinitions', new Map(), 'inherit');\n /**\n * Define computed properties\n */\n this.$defineProperty('$computedDefinitions', new Map(), 'inherit');\n /**\n * Define relationships\n */\n this.$defineProperty('$relationsDefinitions', new Map(), (value) => {\n const relations = new Map();\n value.forEach((relation, key) => {\n const relationClone = relation.clone(this);\n relations.set(key, relationClone);\n });\n return relations;\n });\n /**\n * Define hooks.\n */\n this.$defineProperty('$hooks', new Hooks(), (value) => {\n const hooks = new Hooks();\n hooks.merge(value);\n return hooks;\n });\n }\n static before(event, handler) {\n this.$hooks.add(`before:${event}`, handler);\n }\n static after(event, handler) {\n this.$hooks.add(`after:${event}`, handler);\n }\n /**\n * Returns a fresh persisted instance of model by applying\n * attributes to the model instance\n */\n static async create(values, options) {\n const instance = this.newUpWithOptions(values, options, options?.allowExtraProperties);\n await instance.save();\n return instance;\n }\n /**\n * Same as [[BaseModel.create]] without invoking hooks.\n */\n static async createQuietly(values, options) {\n const instance = this.newUpWithOptions(values, options, options?.allowExtraProperties);\n await instance.saveQuietly();\n return instance;\n }\n /**\n * Same as [[BaseModel.create]], but persists multiple instances. The create\n * many call will be wrapped inside a managed transaction for consistency.\n * If required, you can also pass a transaction client and the method\n * will use that instead of create a new one.\n */\n static async createMany(values, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n return managedTransaction(client, async (trx) => {\n const modelInstances = [];\n const createOptions = {\n client: trx,\n allowExtraProperties: options?.allowExtraProperties,\n };\n for (let row of values) {\n const modelInstance = await this.create(row, createOptions);\n modelInstances.push(modelInstance);\n }\n return modelInstances;\n });\n }\n /**\n * Same as [[BaseModel.createMany]] without invoking hooks.\n */\n static async createManyQuietly(values, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n return managedTransaction(client, async (trx) => {\n const modelInstances = [];\n const createOptions = {\n client: trx,\n allowExtraProperties: options?.allowExtraProperties,\n };\n for (let row of values) {\n const modelInstance = await this.createQuietly(row, createOptions);\n modelInstances.push(modelInstance);\n }\n return modelInstances;\n });\n }\n /**\n * Find model instance using the primary key\n */\n static async find(value, options) {\n if (value === undefined) {\n throw new Exception('\"find\" expects a value. Received undefined');\n }\n return this.findBy(this.primaryKey, value, options);\n }\n /**\n * Find model instance using the primary key\n */\n static async findOrFail(value, options) {\n if (value === undefined) {\n throw new Exception('\"findOrFail\" expects a value. Received undefined');\n }\n return this.findByOrFail(this.primaryKey, value, options);\n }\n static async findBy(key, value, options) {\n if (typeof key === 'object') {\n return this.query(value)\n .where(key)\n .first();\n }\n if (value === undefined) {\n throw new Exception('\"findBy\" expects a value. Received undefined');\n }\n return this.query(options).where(key, value).first();\n }\n static async findByOrFail(key, value, options) {\n if (typeof key === 'object') {\n return this.query(value)\n .where(key)\n .firstOrFail();\n }\n if (value === undefined) {\n throw new Exception('\"findByOrFail\" expects a value. Received undefined');\n }\n return this.query(options).where(key, value).firstOrFail();\n }\n static findManyBy(key, value, options) {\n if (typeof key === 'object') {\n return this.query(value)\n .where(key)\n .exec();\n }\n if (value === undefined) {\n throw new Exception('\"findManyBy\" expects a value. Received undefined');\n }\n return this.query(options).where(key, value).exec();\n }\n /**\n * Same as `query().first()`\n */\n static async first(options) {\n return this.query(options).first();\n }\n /**\n * Same as `query().firstOrFail()`\n */\n static async firstOrFail(options) {\n return this.query(options).firstOrFail();\n }\n /**\n * Find model instance using a key/value pair\n */\n static async findMany(value, options) {\n if (value === undefined) {\n throw new Exception('\"findMany\" expects a value. Received undefined');\n }\n return this.query(options)\n .whereIn(this.primaryKey, value)\n .orderBy(this.primaryKey, 'desc')\n .exec();\n }\n /**\n * Find model instance using a key/value pair or create a\n * new one without persisting it.\n */\n static async firstOrNew(searchPayload, savePayload, options) {\n /**\n * Search using the search payload and fetch the first row\n */\n const query = this.query(options).where(searchPayload);\n const row = await query.first();\n /**\n * Create a new one, if row is not found\n */\n if (!row) {\n return this.newUpWithOptions(Object.assign({}, searchPayload, savePayload), query.clientOptions, options?.allowExtraProperties);\n }\n return row;\n }\n /**\n * Same as `firstOrNew`, but also persists the newly created model instance.\n */\n static async firstOrCreate(searchPayload, savePayload, options) {\n /**\n * Search using the search payload and fetch the first row\n */\n const query = this.query(options).where(searchPayload);\n let row = await query.first();\n /**\n * Create a new instance and persist it to the database\n */\n if (!row) {\n row = this.newUpWithOptions(Object.assign({}, searchPayload, savePayload), query.clientOptions, options?.allowExtraProperties);\n await row.save();\n }\n return row;\n }\n /**\n * Updates or creates a new row inside the database\n */\n static async updateOrCreate(searchPayload, updatedPayload, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n /**\n * We wrap updateOrCreate call inside a transaction and obtain an update\n * lock on the selected row. This ensures that concurrent reads waits\n * for the existing writes to finish\n */\n return managedTransaction(client, async (trx) => {\n const query = this.query({ client: trx }).forUpdate().where(searchPayload);\n let row = await query.first();\n /**\n * Create a new instance or update the existing one (if found)\n */\n if (!row) {\n row = this.newUpWithOptions(Object.assign({}, searchPayload, updatedPayload), query.clientOptions, options?.allowExtraProperties);\n }\n else {\n row.merge(updatedPayload, options?.allowExtraProperties);\n }\n await row.save();\n return row;\n });\n }\n /**\n * Find existing rows or create an in-memory instances of the missing ones.\n */\n static async fetchOrNewUpMany(uniqueKeys, payload, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n uniqueKeys = Array.isArray(uniqueKeys) ? uniqueKeys : [uniqueKeys];\n const uniquenessPair = uniqueKeys.map((uniqueKey) => {\n return {\n key: uniqueKey,\n value: collectValues(payload, uniqueKey, () => {\n throw new Exception(`Value for the \"${uniqueKey}\" is null or undefined inside \"fetchOrNewUpMany\" payload`);\n }).map((value) => transformDateValue(value, client.dialect)),\n };\n });\n /**\n * Find existing rows\n */\n const query = this.query(options);\n uniquenessPair.forEach(({ key, value }) => query.whereIn(key, value));\n const existingRows = await query;\n /**\n * Return existing rows as it is and create a model instance for missing one's\n */\n return this.newUpIfMissing(payload, existingRows, uniqueKeys, false, query.clientOptions, options?.allowExtraProperties);\n }\n /**\n * Find existing rows or create missing one's. One database call per insert\n * is invoked, so that each insert goes through the lifecycle of model\n * hooks.\n */\n static async fetchOrCreateMany(uniqueKeys, payload, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n uniqueKeys = Array.isArray(uniqueKeys) ? uniqueKeys : [uniqueKeys];\n const uniquenessPair = uniqueKeys.map((uniqueKey) => {\n return {\n key: uniqueKey,\n value: collectValues(payload, uniqueKey, () => {\n throw new Exception(`Value for the \"${uniqueKey}\" is null or undefined inside \"fetchOrCreateMany\" payload`);\n }).map((value) => transformDateValue(value, client.dialect)),\n };\n });\n /**\n * Find existing rows\n */\n const query = this.query(options);\n uniquenessPair.forEach(({ key, value }) => query.whereIn(key, value));\n const existingRows = await query;\n /**\n * Create model instance for the missing rows\n */\n const rows = this.newUpIfMissing(payload, existingRows, uniqueKeys, false, query.clientOptions, options?.allowExtraProperties);\n /**\n * Persist inside db inside a transaction\n */\n await managedTransaction(query.client, async (trx) => {\n for (let row of rows) {\n /**\n * If transaction `client` was passed, then the row will have\n * the `trx` already set. But since, the trx of row will be\n * same as the `trx` passed to this callback, we can safely\n * re-set it.\n */\n row.$trx = trx;\n if (!row.$isPersisted) {\n await row.save();\n }\n }\n });\n return rows;\n }\n /**\n * Update existing rows or create missing one's. One database call per insert\n * is invoked, so that each insert and update goes through the lifecycle\n * of model hooks.\n */\n static async updateOrCreateMany(uniqueKeys, payload, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n uniqueKeys = Array.isArray(uniqueKeys) ? uniqueKeys : [uniqueKeys];\n const uniquenessPair = uniqueKeys.map((uniqueKey) => {\n return {\n key: uniqueKey,\n value: collectValues(payload, uniqueKey, () => {\n throw new Exception(`Value for the \"${uniqueKey}\" is null or undefined inside \"updateOrCreateMany\" payload`);\n }).map((value) => transformDateValue(value, client.dialect)),\n };\n });\n return managedTransaction(client, async (trx) => {\n /**\n * Find existing rows\n */\n const query = this.query({ client: trx }).forUpdate();\n uniquenessPair.forEach(({ key, value }) => query.whereIn(key, value));\n const existingRows = await query;\n /**\n * Create model instance for the missing rows\n */\n const rows = this.newUpIfMissing(payload, existingRows, uniqueKeys, true, query.clientOptions, options?.allowExtraProperties);\n for (let row of rows) {\n await row.save();\n }\n return rows;\n });\n }\n /**\n * Returns all rows from the model table\n */\n static async all(options) {\n return this.query(options).orderBy(this.primaryKey, 'desc');\n }\n /**\n * Truncate model table\n */\n static truncate(cascade = false) {\n return this.query().client.truncate(this.table, cascade);\n }\n constructor() {\n return new Proxy(this, proxyHandler);\n }\n /**\n * Custom options defined on the model instance that are\n * passed to the adapter\n */\n modelOptions;\n /**\n * Reference to transaction that will be used for performing queries on a given\n * model instance.\n */\n modelTrx;\n /**\n * The transaction listener listens for the `commit` and `rollback` events and\n * cleanup the `$trx` reference\n */\n transactionListener = function listener() {\n this.modelTrx = undefined;\n }.bind(this);\n /**\n * When `fill` method is called, then we may have a situation where it\n * removed the values which exists in `original` and hence the dirty\n * diff has to do a negative diff as well\n */\n fillInvoked = false;\n /**\n * A copy of cached getters\n */\n cachedGetters = {};\n /**\n * Find if force updates are enabled\n */\n forceUpdate = false;\n /**\n * Raises exception when mutations are performed on a delete model\n */\n ensureIsntDeleted() {\n if (this.$isDeleted) {\n throw new errors.E_MODEL_DELETED();\n }\n }\n /**\n * Invoked when performing the insert call. The method initiates\n * all `datetime` columns, if there are not initiated already\n * and `autoCreate` or `autoUpdate` flags are turned on.\n */\n initiateAutoCreateColumns() {\n const model = this.constructor;\n model.$columnsDefinitions.forEach((column, attributeName) => {\n const columnType = column.meta?.type;\n /**\n * Return early when not dealing with date time columns\n */\n if (!columnType || !(columnType in DATE_TIME_TYPES)) {\n return;\n }\n /**\n * Set the value when its missing and `autoCreate` or `autoUpdate`\n * flags are defined.\n */\n const attributeValue = this[attributeName];\n if (!attributeValue && (column.meta.autoCreate || column.meta.autoUpdate)) {\n ;\n this[attributeName] = DateTime.local();\n return;\n }\n });\n }\n /**\n * Invoked when performing the update call. The method initiates\n * all `datetime` columns, if there have `autoUpdate` flag\n * turned on.\n */\n initiateAutoUpdateColumns() {\n const model = this.constructor;\n model.$columnsDefinitions.forEach((column, attributeName) => {\n const columnType = column.meta?.type;\n /**\n * Return early when not dealing with date time columns or auto update\n * is not set to true\n */\n if (!columnType || !(columnType in DATE_TIME_TYPES) || !column.meta.autoUpdate) {\n return;\n }\n ;\n this[attributeName] = DateTime.local();\n });\n }\n /**\n * Preparing the object to be sent to the adapter. We need\n * to create the object with the property names to be\n * used by the adapter.\n */\n prepareForAdapter(attributes) {\n const Model = this.constructor;\n return Object.keys(attributes).reduce((result, key) => {\n const column = Model.$getColumn(key);\n const value = typeof column.prepare === 'function'\n ? column.prepare(attributes[key], key, this)\n : attributes[key];\n result[column.columnName] = value;\n return result;\n }, {});\n }\n /**\n * Returns true when the field must be included\n * inside the serialized object.\n */\n shouldSerializeField(serializeAs, fields) {\n /**\n * If explicit serializing is turned off, then never\n * return the field\n */\n if (!serializeAs) {\n return false;\n }\n /**\n * If not explicit fields are defined, then always include the field\n */\n if (!fields) {\n return true;\n }\n const { pick, omit } = normalizeCherryPickObject(fields);\n /**\n * Return false, when under omit array\n */\n if (omit && omit.includes(serializeAs)) {\n return false;\n }\n /**\n * Otherwise ensure is inside pick array\n */\n return !pick || pick.includes(serializeAs);\n }\n /**\n * A type only reference to the columns\n */\n $columns = {};\n /**\n * A copy of attributes that will be sent over to adapter\n */\n $attributes = {};\n /**\n * Original represents the properties that already has been\n * persisted or loaded by the adapter.\n */\n $original = {};\n /**\n * Preloaded relationships on the model instance\n */\n $preloaded = {};\n /**\n * Extras are dynamic properties set on the model instance, which\n * are not serialized and neither cast for adapter calls.\n *\n * This is helpful when adapter wants to load some extra data conditionally\n * and that data must not be persisted back the adapter.\n */\n $extras = {};\n /**\n * Side-loaded are dynamic properties set on the model instance, which\n * are not serialized and neither cast for adapter calls.\n *\n * This is helpful when you want to add dynamic metadata to the model\n * and it's children as well.\n *\n * The difference between [[extras]] and [[sideloaded]] is:\n *\n * - Extras can be different for each model instance\n * - Extras are not shared down the hierarchy (example relationships)\n * - Side-loaded are shared across multiple model instances created via `$createMultipleFromAdapterResult`.\n * - Side-loaded are passed to the relationships as well.\n */\n $sideloaded = {};\n /**\n * Persisted means the model has been persisted with the adapter. This will\n * also be true, when model instance is created as a result of fetch\n * call from the adapter.\n */\n $isPersisted = false;\n /**\n * Once deleted the model instance cannot make calls to the adapter\n */\n $isDeleted = false;\n /**\n * `$isLocal` tells if the model instance was created locally vs\n * one generated as a result of fetch call from the adapter.\n */\n $isLocal = true;\n /**\n * Returns the value of primary key. The value must be\n * set inside attributes object\n */\n get $primaryKeyValue() {\n const model = this.constructor;\n const column = model.$getColumn(model.primaryKey);\n if (column && column.hasGetter) {\n return this[model.primaryKey];\n }\n return this.$getAttribute(model.primaryKey);\n }\n /**\n * Opposite of [[this.isPersisted]]\n */\n get $isNew() {\n return !this.$isPersisted;\n }\n /**\n * Returns dirty properties of a model by doing a diff\n * between original values and current attributes\n */\n get $dirty() {\n const processedKeys = [];\n /**\n * Do not compute diff, when model has never been persisted\n */\n if (!this.$isPersisted) {\n return this.$attributes;\n }\n const dirty = Object.keys(this.$attributes).reduce((result, key) => {\n const value = this.$attributes[key];\n const originalValue = this.$original[key];\n let isEqual = true;\n if (isObject(value) && 'isDirty' in value) {\n isEqual = !value.isDirty;\n }\n else {\n isEqual = compareValues(originalValue, value);\n }\n if (!isEqual) {\n result[key] = value;\n }\n if (this.fillInvoked) {\n processedKeys.push(key);\n }\n return result;\n }, {});\n /**\n * Find negative diff if fill was invoked, since we may have removed values\n * that exists in originals\n */\n if (this.fillInvoked) {\n Object.keys(this.$original)\n .filter((key) => !processedKeys.includes(key))\n .forEach((key) => {\n dirty[key] = null;\n });\n }\n return dirty;\n }\n /**\n * Finding if model is dirty with changes or not\n */\n get $isDirty() {\n return Object.keys(this.$dirty).length > 0;\n }\n /**\n * Returns the transaction\n */\n get $trx() {\n return this.modelTrx;\n }\n /**\n * Set the trx to be used by the model to executing queries\n */\n set $trx(trx) {\n if (!trx) {\n this.modelTrx = undefined;\n return;\n }\n /**\n * Remove old listeners\n */\n if (this.modelTrx) {\n this.modelTrx.removeListener('commit', this.transactionListener);\n this.modelTrx.removeListener('rollback', this.transactionListener);\n }\n /**\n * Store reference to the transaction\n */\n this.modelTrx = trx;\n this.modelTrx.once('commit', this.transactionListener);\n this.modelTrx.once('rollback', this.transactionListener);\n }\n /**\n * Get options\n */\n get $options() {\n return this.modelOptions;\n }\n /**\n * Set options\n */\n set $options(options) {\n if (!options) {\n this.modelOptions = undefined;\n return;\n }\n this.modelOptions = this.modelOptions || {};\n if (options.connection) {\n this.modelOptions.connection = options.connection;\n }\n }\n /**\n * Set options on the model instance along with transaction\n */\n $setOptionsAndTrx(options) {\n if (!options) {\n return;\n }\n if (options.client && options.client.isTransaction) {\n this.$trx = options.client;\n }\n this.$options = options;\n }\n /**\n * A chainable method to set transaction on the model\n */\n useTransaction(trx) {\n this.$trx = trx;\n return this;\n }\n /**\n * A chainable method to set transaction on the model\n */\n useConnection(connection) {\n this.$options = { connection };\n return this;\n }\n /**\n * Set attribute\n */\n $setAttribute(key, value) {\n this.ensureIsntDeleted();\n this.$attributes[key] = value;\n }\n /**\n * Get value of attribute\n */\n $getAttribute(key) {\n return this.$attributes[key];\n }\n /**\n * Returns the attribute value from the cache which was resolved by\n * the mutated by a getter. This is done to avoid re-mutating\n * the same attribute value over and over again.\n */\n $getAttributeFromCache(key, callback) {\n const original = this.$getAttribute(key);\n const cached = this.cachedGetters[key];\n /**\n * Return the resolved value from cache when cache original is same\n * as the attribute value\n */\n if (cached && cached.original === original) {\n return cached.resolved;\n }\n /**\n * Re-resolve the value from the callback\n */\n const resolved = callback(original);\n if (!cached) {\n /**\n * Create cache entry\n */\n this.cachedGetters[key] = { getter: callback, original, resolved };\n }\n else {\n /**\n * Update original and resolved keys\n */\n this.cachedGetters[key].original = original;\n this.cachedGetters[key].resolved = resolved;\n }\n return resolved;\n }\n /**\n * Returns the related model or default value when model is missing\n */\n $getRelated(key) {\n return this.$preloaded[key];\n }\n /**\n * A boolean to know if relationship has been preloaded or not\n */\n $hasRelated(key) {\n return this.$preloaded[key] !== undefined;\n }\n /**\n * Sets the related data on the model instance. The method internally handles\n * `one to one` or `many` relations\n */\n $setRelated(key, models) {\n const Model = this.constructor;\n const relation = Model.$relationsDefinitions.get(key);\n /**\n * Ignore when relation is not defined\n */\n if (!relation) {\n return;\n }\n /**\n * Reset array before invoking $pushRelated\n */\n if (MANY_RELATIONS.includes(relation.type)) {\n if (!Array.isArray(models)) {\n throw new Exception(`\"${Model.name}.${key}\" must be an array when setting \"${relation.type}\" relationship`);\n }\n this.$preloaded[key] = [];\n }\n return this.$pushRelated(key, models);\n }\n /**\n * Push related adds to the existing related collection\n */\n $pushRelated(key, models) {\n const Model = this.constructor;\n const relation = Model.$relationsDefinitions.get(key);\n /**\n * Ignore when relation is not defined\n */\n if (!relation) {\n return;\n }\n /**\n * Create multiple for `hasMany` `manyToMany` and `hasManyThrough`\n */\n if (MANY_RELATIONS.includes(relation.type)) {\n this.$preloaded[key] = (this.$preloaded[key] || []).concat(models);\n return;\n }\n /**\n * Dis-allow setting multiple model instances for a one-to-one relationship\n */\n if (Array.isArray(models)) {\n throw new Error(`\"${Model.name}.${key}\" cannot reference more than one instance of \"${relation.relatedModel().name}\" model`);\n }\n this.$preloaded[key] = models;\n }\n /**\n * Merges the object with the model attributes, assuming object keys\n * are coming the database.\n *\n * 1. If key is unknown, it will be added to the `extras` object.\n * 2. If key is defined as a relationship, it will be ignored and one must call `$setRelated`.\n */\n $consumeAdapterResult(adapterResult, sideloadedAttributes) {\n const Model = this.constructor;\n /**\n * Merging sideloaded attributes with the existing sideloaded values\n * on the model instance\n */\n if (sideloadedAttributes) {\n this.$sideloaded = Object.assign({}, this.$sideloaded, sideloadedAttributes);\n }\n /**\n * Merge result of adapter with the attributes. This enables\n * the adapter to hydrate models with properties generated\n * as a result of insert or update\n */\n if (isObject(adapterResult)) {\n Object.keys(adapterResult).forEach((key) => {\n /**\n * Pull the attribute name from the column name, since adapter\n * results always holds the column names.\n */\n const attributeName = Model.$keys.columnsToAttributes.get(key);\n if (attributeName) {\n const attribute = Model.$getColumn(attributeName);\n /**\n * Invoke `consume` method for the column, before setting the\n * attribute\n */\n const value = typeof attribute.consume === 'function'\n ? attribute.consume(adapterResult[key], attributeName, this)\n : adapterResult[key];\n /**\n * When consuming the adapter result, we must always set the attributes\n * directly, as we do not want to invoke setters.\n */\n this.$setAttribute(attributeName, value);\n return;\n }\n /**\n * If key is defined as a relation, then ignore it, since one\n * must pass a qualified model to `this.$setRelated()`\n */\n if (Model.$relationsDefinitions.has(key)) {\n return;\n }\n /**\n * Set directly on the model\n */\n if (this.hasOwnProperty(key)) {\n ;\n this[key] = adapterResult[key];\n return;\n }\n this.$extras[key] = adapterResult[key];\n });\n }\n }\n /**\n * Sync originals with the attributes. After this `isDirty` will\n * return false\n */\n $hydrateOriginals() {\n this.$original = {};\n lodash.merge(this.$original, this.$attributes);\n }\n /**\n * Set bulk attributes on the model instance. Setting relationships via\n * fill isn't allowed, since we disallow setting relationships\n * locally\n */\n fill(values, allowExtraProperties = false) {\n this.$attributes = {};\n this.merge(values, allowExtraProperties);\n this.fillInvoked = true;\n return this;\n }\n /**\n * Merge bulk attributes with existing attributes.\n *\n * 1. If key is unknown, it will be added to the `extras` object.\n * 2. If key is defined as a relationship, it will be ignored and one must call `$setRelated`.\n */\n merge(values, allowExtraProperties = false) {\n const Model = this.constructor;\n /**\n * Merge values with the attributes\n */\n if (isObject(values)) {\n Object.keys(values).forEach((key) => {\n const value = values[key];\n /**\n * Set as column\n */\n if (Model.$hasColumn(key)) {\n ;\n this[key] = value;\n return;\n }\n /**\n * Resolve the attribute name from the column names. Since people\n * usually define the column names directly as well by\n * accepting them directly from the API.\n */\n const attributeName = Model.$keys.columnsToAttributes.get(key);\n if (attributeName) {\n ;\n this[attributeName] = value;\n return;\n }\n /**\n * If key is defined as a relation, then ignore it, since one\n * must pass a qualified model to `this.$setRelated()`\n */\n if (Model.$relationsDefinitions.has(key)) {\n return;\n }\n /**\n * If the property already exists on the model, then set it\n * as it is vs defining it as an extra property\n */\n if (this.hasOwnProperty(key)) {\n ;\n this[key] = value;\n return;\n }\n /**\n * Raise error when not instructed to ignore non-existing properties.\n */\n if (!allowExtraProperties) {\n throw new Error(`Cannot define \"${key}\" on \"${Model.name}\" model, since it is not defined as a model property`);\n }\n this.$extras[key] = value;\n });\n }\n return this;\n }\n /**\n * Returns whether any of the fields have been modified\n */\n isDirty(fields) {\n const keys = Array.isArray(fields) ? fields : fields ? [fields] : [];\n if (keys.length === 0) {\n return this.$isDirty;\n }\n return keys.some((key) => key in this.$dirty);\n }\n /**\n * Enable force update even when no attributes\n * are dirty\n */\n enableForceUpdate() {\n this.forceUpdate = true;\n return this;\n }\n /**\n * Preloads one or more relationships for the current model\n */\n async load(relationName, callback) {\n this.ensureIsntDeleted();\n if (!this.$isPersisted) {\n throw new Exception('Cannot lazy load relationship for an unpersisted model instance');\n }\n const Model = this.constructor;\n const preloader = new Preloader(Model);\n if (typeof relationName === 'function') {\n relationName(preloader);\n }\n else {\n preloader.load(relationName, callback);\n }\n const queryClient = Model.$adapter.modelClient(this);\n await preloader\n .sideload(this.$sideloaded)\n .debug(queryClient.debug)\n .processAllForOne(this, queryClient);\n }\n /**\n * Load relationships onto the instance, but only if they are not\n * already preloaded\n */\n async loadOnce(relationName) {\n if (!this.$preloaded[relationName]) {\n return this.load(relationName);\n }\n }\n /**\n * @deprecated\n */\n async preload(relationName, callback) {\n process.emitWarning('DeprecationWarning', '\"Model.preload()\" is deprecated. Use \"Model.load()\" instead');\n return this.load(relationName, callback);\n }\n /**\n * Lazy load the relationship aggregate value\n */\n loadAggregate(relationName, callback) {\n this.ensureIsntDeleted();\n if (!this.$isPersisted) {\n throw new Exception('Cannot lazy load relationship aggregates for an unpersisted model instance');\n }\n return new LazyLoadAggregates(this).loadAggregate(relationName, callback);\n }\n /**\n * Lazy load the relationship count value\n */\n loadCount(relationName, callback) {\n this.ensureIsntDeleted();\n if (!this.$isPersisted) {\n throw new Exception('Cannot lazy load relationship aggregates for an unpersisted model instance');\n }\n return new LazyLoadAggregates(this).loadCount(relationName, callback);\n }\n /**\n * Perform save on the model instance to commit mutations.\n */\n async save() {\n this.ensureIsntDeleted();\n const Model = this.constructor;\n /**\n * Persist the model when it's not persisted already\n */\n if (!this.$isPersisted) {\n await Model.$hooks.runner('before:create').run(this);\n await Model.$hooks.runner('before:save').run(this);\n this.initiateAutoCreateColumns();\n await Model.$adapter.insert(this, this.prepareForAdapter(this.$attributes));\n this.$hydrateOriginals();\n this.$isPersisted = true;\n await Model.$hooks.runner('after:create').run(this);\n await Model.$hooks.runner('after:save').run(this);\n return this;\n }\n /**\n * Call hooks beforehand, so that they have the chance\n * to make mutations that produces one or more `$dirty`\n * fields.\n */\n await Model.$hooks.runner('before:update').run(this);\n await Model.$hooks.runner('before:save').run(this);\n const forceUpdate = this.forceUpdate;\n this.forceUpdate = false;\n /**\n * Do not issue updates when model doesn't have any mutations\n */\n if (!this.$isDirty && !forceUpdate) {\n return this;\n }\n /**\n * Perform update\n */\n this.initiateAutoUpdateColumns();\n const updatePayload = this.prepareForAdapter(this.$dirty);\n if (Object.keys(updatePayload).length > 0) {\n await Model.$adapter.update(this, updatePayload);\n }\n this.$hydrateOriginals();\n await Model.$hooks.runner('after:update').run(this);\n await Model.$hooks.runner('after:save').run(this);\n return this;\n }\n /**\n * Same as [[BaseModel.save]] without invoking hooks.\n */\n async saveQuietly() {\n this.ensureIsntDeleted();\n const Model = this.constructor;\n /**\n * Persist the model when it's not persisted already\n */\n if (!this.$isPersisted) {\n this.initiateAutoCreateColumns();\n await Model.$adapter.insert(this, this.prepareForAdapter(this.$attributes));\n this.$hydrateOriginals();\n this.$isPersisted = true;\n return this;\n }\n /**\n * Call hooks beforehand, so that they have the chance\n * to make mutations that produces one or more `$dirty`\n * fields.\n */\n const forceUpdate = this.forceUpdate;\n this.forceUpdate = false;\n /**\n * Do not issue updates when model doesn't have any mutations\n */\n if (!this.$isDirty && !forceUpdate) {\n return this;\n }\n /**\n * Perform update\n */\n this.initiateAutoUpdateColumns();\n const updatePayload = this.prepareForAdapter(this.$dirty);\n if (Object.keys(updatePayload).length > 0) {\n await Model.$adapter.update(this, updatePayload);\n }\n this.$hydrateOriginals();\n return this;\n }\n /**\n * The lockForUpdate method re-fetches the model instance from\n * the database and locks the row to perform an update. The\n * provided callback receives a fresh user instance and should\n * use that to perform an update.\n */\n async lockForUpdate(callback) {\n const Model = this.constructor;\n const queryClient = Model.$adapter.modelClient(this);\n return managedTransaction(queryClient, async (trx) => {\n const user = await Model.query({ client: trx })\n .forUpdate()\n .where(Model.primaryKey, this.$primaryKeyValue)\n .first();\n if (!user) {\n throw new errors.E_MODEL_DELETED();\n }\n return callback(user);\n });\n }\n /**\n * Perform delete by issuing a delete request on the adapter\n */\n async delete() {\n this.ensureIsntDeleted();\n const Model = this.constructor;\n await Model.$hooks.runner('before:delete').run(this);\n await Model.$adapter.delete(this);\n this.$isDeleted = true;\n await Model.$hooks.runner('after:delete').run(this);\n }\n /**\n * Same as [[BaseModel.delete]] without invoking hooks.\n */\n async deleteQuietly() {\n this.ensureIsntDeleted();\n const Model = this.constructor;\n await Model.$adapter.delete(this);\n this.$isDeleted = true;\n }\n /**\n * Serializes model attributes to a plain object\n */\n serializeAttributes(fields, raw = false) {\n const Model = this.constructor;\n return Object.keys(this.$attributes).reduce((result, key) => {\n const column = Model.$getColumn(key);\n if (!this.shouldSerializeField(column.serializeAs, fields)) {\n return result;\n }\n const value = this[key];\n result[column.serializeAs] =\n typeof column.serialize === 'function' && !raw ? column.serialize(value, key, this) : value;\n return result;\n }, {});\n }\n /**\n * Serializes model compute properties to an object.\n */\n serializeComputed(fields) {\n const Model = this.constructor;\n const result = {};\n Model.$computedDefinitions.forEach((value, key) => {\n const computedValue = this[key];\n if (computedValue !== undefined && this.shouldSerializeField(value.serializeAs, fields)) {\n result[value.serializeAs] = computedValue;\n }\n });\n return result;\n }\n /**\n * Serializes relationships to a plain object. When `raw=true`, it will\n * recursively serialize the relationships as well.\n */\n serializeRelations(cherryPick, raw = false) {\n const Model = this.constructor;\n return Object.keys(this.$preloaded).reduce((result, key) => {\n const relation = Model.$getRelation(key);\n /**\n * Do not serialize relationship, when serializeAs is null\n */\n if (!relation.serializeAs) {\n return result;\n }\n const value = this.$preloaded[key];\n /**\n * Return relationship model as it is, when `raw` is true.\n */\n if (raw) {\n result[relation.serializeAs] = value;\n return result;\n }\n /**\n * Always make sure we are passing a valid object or undefined\n * to the relationships\n */\n const relationOptions = cherryPick ? cherryPick[relation.serializeAs] : undefined;\n result[relation.serializeAs] = Array.isArray(value)\n ? value.map((one) => one.serialize(relationOptions))\n : value === null\n ? null\n : value.serialize(relationOptions);\n return result;\n }, {});\n }\n /**\n * Converting model to it's JSON representation\n */\n serialize(cherryPick) {\n let extras = null;\n if (this.serializeExtras === true) {\n extras = { meta: this.$extras };\n }\n else if (typeof this.serializeExtras === 'function') {\n extras = this.serializeExtras();\n }\n return {\n ...this.serializeAttributes(cherryPick?.fields, false),\n ...this.serializeRelations(cherryPick?.relations, false),\n ...this.serializeComputed(cherryPick?.fields),\n ...extras,\n };\n }\n /**\n * Convert model to a plain Javascript object\n */\n toObject() {\n const Model = this.constructor;\n const computed = {};\n /**\n * Relationships toObject\n */\n const preloaded = Object.keys(this.$preloaded).reduce((result, key) => {\n const value = this.$preloaded[key];\n result[key] = Array.isArray(value) ? value.map((one) => one.toObject()) : value.toObject();\n return result;\n }, {});\n /**\n * Update computed object with computed definitions\n */\n Model.$computedDefinitions.forEach((_, key) => {\n const computedValue = this[key];\n if (computedValue !== undefined) {\n computed[key] = computedValue;\n }\n });\n return {\n ...this.$attributes,\n ...preloaded,\n ...computed,\n $extras: this.$extras,\n };\n }\n /**\n * Returns the serialize method output. However, any model can overwrite\n * it to define it's custom serialize output\n */\n toJSON() {\n return this.serialize();\n }\n /**\n * Returns the query for `insert`, `update` or `delete` actions.\n * Since the query builder for these actions are not exposed to\n * the end user, this method gives a way to compose queries.\n */\n $getQueryFor(action, client) {\n const modelConstructor = this.constructor;\n const primaryKey = modelConstructor.primaryKey;\n const primaryKeyColumn = modelConstructor.$keys.attributesToColumns.get(primaryKey, primaryKey);\n /**\n * Returning insert query for the inserts\n */\n if (action === 'insert') {\n const insertQuery = client.insertQuery().table(modelConstructor.table);\n insertQuery.returning(primaryKeyColumn);\n return insertQuery;\n }\n /**\n * When self assigning the primary key, then we read the primary\n * value from the originals and the attributes, since we allow\n * updating primary key itself\n */\n const primaryKeyValue = modelConstructor.selfAssignPrimaryKey\n ? this.$original[primaryKey]\n : this.$primaryKeyValue;\n /**\n * Returning generic query builder for rest of the queries\n */\n return client.modelQuery(modelConstructor).where(primaryKeyColumn, primaryKeyValue);\n }\n /**\n * Returns an instance of relationship on the given model\n */\n related(relationName) {\n const Model = this.constructor;\n const relation = Model.$getRelation(relationName);\n ensureRelation(relationName, relation);\n relation.boot();\n return relation.client(this, Model.$adapter.modelClient(this));\n }\n /**\n * Reload/Refresh the model instance\n */\n async refresh() {\n this.ensureIsntDeleted();\n /**\n * Noop when model instance is not persisted\n */\n if (!this.$isPersisted) {\n return this;\n }\n const Model = this.constructor;\n await Model.$adapter.refresh(this);\n return this;\n }\n};\nBaseModelImpl = __decorate([\n StaticImplements()\n], BaseModelImpl);\nexport const BaseModel = BaseModelImpl;\n/**\n * Helper to mark a function as query scope\n */\nexport function scope(callback) {\n return callback;\n}\n","/*\n|--------------------------------------------------------------------------\n| Decorator Schemas\n|--------------------------------------------------------------------------\n|\n| Joi validation schemas for Resourceful decorators. These schemas ensure\n| that decorator options to the expected shapes during runtime.\n|\n*/\nimport { joi } from '@nhtio/lucid-resourceful/joi'\nimport { guards } from '@nhtio/lucid-resourceful/utils'\nimport { E_INVALID_RESOURCEFUL_DECORATOR_OPTIONS } from '@nhtio/lucid-resourceful/errors'\nimport {\n ResourcefulStringType,\n ResourcefulDateType,\n ResourcefulDateTimeType,\n ResourcefulBinaryType,\n ResourcefulNumberType,\n ResourcefulIntegerType,\n ResourcefulBigintType,\n ResourcefulUnsignedIntegerType,\n ResourcefulBooleanType,\n ResourcefulObjectType,\n ResourcefulArrayType,\n} from '@nhtio/lucid-resourceful/definitions'\nimport type { ObjectSchema } from 'joi'\n\n/*\n|--------------------------------------------------------------------------\n| Validate, Normalize and Cast\n|--------------------------------------------------------------------------\n|\n| Internal utility for validating decorator options using Joi schemas.\n| Applies defaults, performs type conversions, and provides meaningful\n| error messages with context about which decorator and field failed.\n|\n*/\n\nexport const validateNormalizeAndCastDecoratorOptions = <InputType, OutputType>(\n fieldName: string,\n decoratorName: string,\n schema: ObjectSchema,\n input: InputType\n): OutputType => {\n const { error, value } = schema.validate(input, {\n convert: true,\n abortEarly: false,\n })\n if (error) {\n throw new E_INVALID_RESOURCEFUL_DECORATOR_OPTIONS(decoratorName, fieldName, error)\n }\n return value as OutputType\n}\n\n/*\n|--------------------------------------------------------------------------\n| Base Schemas\n|--------------------------------------------------------------------------\n*/\n\nconst resourcefulPropertyDefinitionSchema = joi.object({\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n})\n\nconst joiInstanceCheckerAlternativesFactory = (Ctor: any, CtorName: string) => {\n return [\n joi.object().instance(Ctor),\n joi.function().instance(Ctor),\n joi.custom((value, helpers) => {\n if (guards.isObject(value) && value.constructor.name === CtorName) {\n return value\n }\n return helpers.error('any.invalid', { value, type: CtorName })\n }),\n ]\n}\n\nconst resourcefulDataTypeSchema = joi.alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, 'ResourcefulStringType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, 'ResourcefulDateType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, 'ResourcefulDateTimeType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, 'ResourcefulBinaryType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, 'ResourcefulNumberType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, 'ResourcefulIntegerType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, 'ResourcefulBigintType'),\n ...joiInstanceCheckerAlternativesFactory(\n ResourcefulUnsignedIntegerType,\n 'ResourcefulUnsignedIntegerType'\n ),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, 'ResourcefulBooleanType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulObjectType, 'ResourcefulObjectType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulArrayType, 'ResourcefulArrayType')\n)\n\nconst localResourcefulPropertyDefinitionSchema = resourcefulPropertyDefinitionSchema.keys({\n type: resourcefulDataTypeSchema.required(),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Column Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const resourcefulColumnDefinitionSchema = localResourcefulPropertyDefinitionSchema\n\nexport const resourcefulColumnOptionsSchema = joi.object({\n // Lucid ColumnOptions (partial)\n columnName: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n consume: joi.function().optional(),\n prepare: joi.function().optional(),\n meta: joi.object().optional(),\n isPrimary: joi.boolean().default(false),\n hasDefaultValue: joi.boolean().default(false),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: resourcefulDataTypeSchema.required(),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Data Type Specific Column Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const dataTypeColumnOptionsSchema = joi.object({\n // Lucid ColumnOptions (partial) - excluding 'prepare' and 'consume'\n columnName: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n meta: joi.object().optional(),\n isPrimary: joi.boolean().default(false),\n hasDefaultValue: joi.boolean().default(false),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: resourcefulDataTypeSchema.optional(),\n})\n\nconst baseDateColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n autoCreate: joi.boolean().default(false),\n autoUpdate: joi.boolean().default(false),\n})\n\n/*\n|--------------------------------------------------------------------------\n| String Column Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const stringColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, 'ResourcefulStringType')\n )\n .default(() => new ResourcefulStringType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Date Column Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const dateColumnOptionsSchema = baseDateColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, 'ResourcefulDateType')\n )\n .default(() => new ResourcefulDateType()),\n})\n\nexport const dateTimeColumnOptionsSchema = baseDateColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, 'ResourcefulDateTimeType')\n )\n .default(() => new ResourcefulDateTimeType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Binary Column Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const binaryColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, 'ResourcefulBinaryType')\n )\n .default(() => new ResourcefulBinaryType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Number Column Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const numberColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, 'ResourcefulNumberType')\n )\n .default(() => new ResourcefulNumberType()),\n})\n\nexport const integerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, 'ResourcefulIntegerType')\n )\n .default(() => new ResourcefulIntegerType()),\n})\n\nexport const bigintColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, 'ResourcefulBigintType')\n )\n .default(() => new ResourcefulBigintType()),\n})\n\nexport const unsignedIntegerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(\n ResourcefulUnsignedIntegerType,\n 'ResourcefulUnsignedIntegerType'\n )\n )\n .default(() => new ResourcefulUnsignedIntegerType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Boolean Column Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const booleanColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, 'ResourcefulBooleanType')\n )\n .default(() => new ResourcefulBooleanType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Object/Array Column Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const objectColumnOptionsSchema = joi.object({\n // Lucid ColumnOptions (full)\n columnName: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n consume: joi.function().optional(),\n prepare: joi.function().optional(),\n meta: joi.object().optional(),\n isPrimary: joi.boolean().default(false),\n hasDefaultValue: joi.boolean().default(false),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulObjectType, 'ResourcefulObjectType')\n )\n .default(() => new ResourcefulObjectType()),\n})\n\nexport const arrayColumnOptionsSchema = joi.object({\n // Lucid ColumnOptions (full)\n columnName: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n consume: joi.function().optional(),\n prepare: joi.function().optional(),\n meta: joi.object().optional(),\n isPrimary: joi.boolean().default(false),\n hasDefaultValue: joi.boolean().default(false),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulArrayType, 'ResourcefulArrayType')\n )\n .default(() => new ResourcefulArrayType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Computed Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const resourcefulComputedDefinitionSchema = localResourcefulPropertyDefinitionSchema.append({\n writable: joi.boolean().default(false),\n})\n\nexport const resourcefulComputedOptionsSchema = joi.object({\n // Lucid ComputedOptions (partial)\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n meta: joi.object().optional(),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: resourcefulDataTypeSchema.required(),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Data Type Specific Computed Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const dataTypeComputedOptionsSchema = joi.object({\n // Lucid ComputedOptions (partial) - excluding 'prepare' and 'consume'\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n meta: joi.object().optional(),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: resourcefulDataTypeSchema.optional(),\n})\n\nconst baseDateComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n autoCreate: joi.boolean().default(false),\n autoUpdate: joi.boolean().default(false),\n})\n\n/*\n|--------------------------------------------------------------------------\n| String Computed Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const stringComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, 'ResourcefulStringType')\n )\n .default(() => new ResourcefulStringType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Date Computed Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const dateComputedOptionsSchema = baseDateComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, 'ResourcefulDateType')\n )\n .default(() => new ResourcefulDateType()),\n})\n\nexport const dateTimeComputedOptionsSchema = baseDateComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, 'ResourcefulDateTimeType')\n )\n .default(() => new ResourcefulDateTimeType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Binary Computed Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const binaryComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, 'ResourcefulBinaryType')\n )\n .default(() => new ResourcefulBinaryType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Number Computed Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const numberComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, 'ResourcefulNumberType')\n )\n .default(() => new ResourcefulNumberType()),\n})\n\nexport const integerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, 'ResourcefulIntegerType')\n )\n .default(() => new ResourcefulIntegerType()),\n})\n\nexport const bigintComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, 'ResourcefulBigintType')\n )\n .default(() => new ResourcefulBigintType()),\n})\n\nexport const unsignedIntegerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(\n ResourcefulUnsignedIntegerType,\n 'ResourcefulUnsignedIntegerType'\n )\n )\n .default(() => new ResourcefulUnsignedIntegerType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Boolean Computed Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const booleanComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, 'ResourcefulBooleanType')\n )\n .default(() => new ResourcefulBooleanType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Object/Array Computed Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const objectComputedOptionsSchema = joi.object({\n // Lucid ComputedOptions (full)\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n meta: joi.object().optional(),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulObjectType, 'ResourcefulObjectType')\n )\n .default(() => new ResourcefulObjectType()),\n})\n\nexport const arrayComputedOptionsSchema = joi.object({\n // Lucid ComputedOptions (full)\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n meta: joi.object().optional(),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulArrayType, 'ResourcefulArrayType')\n )\n .default(() => new ResourcefulArrayType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Relationship Schemas\n|--------------------------------------------------------------------------\n|\n| Joi validation schemas for relationship decorator options. These schemas\n| combine Lucid relationship options with resourceful relationship options.\n|\n*/\n\n// Base schema for resourceful relationship options\nexport const resourcefulRelationshipOptionsSchema = joi.object({\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n})\n\n// Schema for belongsTo, hasOne, hasMany relationships\nexport const relationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({\n // Lucid RelationOptions\n localKey: joi.string().optional(),\n foreignKey: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n onQuery: joi.function().optional(),\n relatedModel: joi.function(),\n})\n\n// Schema for manyToMany relationships\nexport const manyToManyRelationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({\n // Lucid ManyToManyRelationOptions\n localKey: joi.string().optional(),\n relatedKey: joi.string().optional(),\n pivotForeignKey: joi.string().optional(),\n pivotRelatedForeignKey: joi.string().optional(),\n pivotTable: joi.string().optional(),\n pivotTimestamps: joi.boolean().optional(),\n pivotColumns: joi.array().items(joi.string()).optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n onQuery: joi.function().optional(),\n relatedModel: joi.function(),\n})\n\n// Schema for hasManyThrough relationships\nexport const hasManyThroughRelationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({\n // Lucid HasManyThroughRelationOptions (ThroughRelationOptions without throughModel)\n localKey: joi.string().optional(),\n foreignKey: joi.string().optional(),\n throughLocalKey: joi.string().optional(),\n throughForeignKey: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n onQuery: joi.function().optional(),\n relatedModel: joi.function(),\n})\n","/*\n|--------------------------------------------------------------------------\n| Decorators for Resourceful Lucid Models\n|--------------------------------------------------------------------------\n|\n| Decorators which are used to add the required metadata to Lucid models\n| which have been extended with the Resourceful mixin.\n|\n*/\n\n/*\n|--------------------------------------------------------------------------\n| NOTE FOR FUTURE MAINTAINERS\n|--------------------------------------------------------------------------\n|\n| The `type` property for resourceful decorators (e.g., resourcefulColumn, resourcefulComputed)\n| must always be a ResourcefulDataType instance (e.g., ResourcefulStringType(), ResourcefulNumberType(), etc.),\n| not a string literal like 'string' or 'number'.\n| This is required because the system expects a structured data type definition with validation,\n| format, and other metadata, not just a primitive string. See src/private/data_types.ts for details.\n|\n*/\n\nimport { guards } from '@nhtio/lucid-resourceful/utils'\nimport {\n PrepareConsumeChainBuilder,\n DefaultPrepareFunction,\n DefaultConsumeFunction,\n} from './prepare_consume_chain_builder'\nimport {\n LucidModel,\n ColumnOptions,\n ComputedOptions,\n DateColumnDecorator,\n DateTimeColumnDecorator,\n} from '@adonisjs/lucid/types/model'\nimport {\n column as lucidColumn,\n computed as lucidComputed,\n belongsTo as lucidBelongsTo,\n hasOne as lucidHasOne,\n hasMany as lucidHasMany,\n manyToMany as lucidManyToMany,\n hasManyThrough as lucidHasManyThrough,\n} from '@adonisjs/lucid/orm'\nimport {\n prepareString,\n prepareBinary,\n prepareNumber,\n prepareInteger,\n prepareBigint,\n prepareUnsignedint,\n prepareBoolean,\n prepareObject,\n prepareArray,\n consumeString,\n consumeBinary,\n consumeNumber,\n consumeInteger,\n consumeBigint,\n consumeUnsignedint,\n consumeBoolean,\n consumeObject,\n consumeArray,\n} from './decorator_utils'\nimport {\n validateNormalizeAndCastDecoratorOptions,\n resourcefulColumnOptionsSchema,\n stringColumnOptionsSchema,\n dateColumnOptionsSchema,\n dateTimeColumnOptionsSchema,\n binaryColumnOptionsSchema,\n numberColumnOptionsSchema,\n integerColumnOptionsSchema,\n bigintColumnOptionsSchema,\n unsignedIntegerColumnOptionsSchema,\n booleanColumnOptionsSchema,\n objectColumnOptionsSchema,\n arrayColumnOptionsSchema,\n resourcefulComputedOptionsSchema,\n stringComputedOptionsSchema,\n dateComputedOptionsSchema,\n dateTimeComputedOptionsSchema,\n binaryComputedOptionsSchema,\n numberComputedOptionsSchema,\n integerComputedOptionsSchema,\n bigintComputedOptionsSchema,\n unsignedIntegerComputedOptionsSchema,\n booleanComputedOptionsSchema,\n objectComputedOptionsSchema,\n arrayComputedOptionsSchema,\n relationOptionsSchema,\n manyToManyRelationOptionsSchema,\n hasManyThroughRelationOptionsSchema,\n} from './decorator_schemas'\nimport type {\n HasOne,\n ManyToMany,\n HasManyThrough,\n ManyToManyRelationOptions,\n RelationOptions,\n ThroughRelationOptions,\n} from '@adonisjs/lucid/types/relations'\nimport type {\n ResourcefulColumnDefinition,\n ResourcefulComputedAccessorDefinition,\n ResourcefulRelationshipDefinition,\n AnySchema,\n StringSchema,\n DateSchema,\n BinarySchema,\n NumberSchema,\n BooleanSchema,\n ObjectSchema,\n ArraySchema,\n ResourcefulPropertySchema,\n} from '@nhtio/lucid-resourceful/types'\n\n/**\n * Options for date columns including autoCreate and autoUpdate flags.\n *\n * @example\n * ```ts\n * {\n * autoCreate: true,\n * autoUpdate: false,\n * nullable: false,\n * }\n * ```\n */\nexport type DateColumnOptions = DataTypeColumnOptions & {\n autoCreate: boolean\n autoUpdate: boolean\n}\n\n/**\n * Options for relation decorators on related models.\n *\n * @example\n * ```ts\n * import { resourcefulBelongsTo } from '@nhtio/lucid-resourceful'\n *\n * class Post {\n * @resourcefulBelongsTo(() => User, { foreignKey: 'user_id' })\n * public user: User\n * }\n * ```\n */\nexport type RelatedModelRelationOptions<RelatedModel extends LucidModel> =\n | RelationOptions<RelatedModel, LucidModel, HasOne<RelatedModel, LucidModel>>\n | ManyToManyRelationOptions<ManyToMany<RelatedModel>>\n | Omit<\n ThroughRelationOptions<RelatedModel, LucidModel, HasManyThrough<RelatedModel>>,\n 'throughModel'\n >\n\n/**\n * Options for hasManyThrough relation decorators.\n *\n * @example\n * ```ts\n * import { resourcefulHasManyThrough } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulHasManyThrough([\n * () => Role,\n * () => UserRolePivot\n * ], { foreignKey: 'user_id' })\n * public roles: HasManyThrough<typeof Role>\n * }\n * ```\n */\nexport type HasManyThroughRelationOptions<RelatedModel extends LucidModel> = Omit<\n ThroughRelationOptions<RelatedModel, LucidModel, HasManyThrough<RelatedModel>>,\n 'throughModel'\n>\n\ntype ValidatorInput<Schema extends AnySchema = AnySchema> = Partial<DataTypeColumnOptions> &\n Partial<ResourcefulColumnDefinition<Schema>>\ntype ValidatorOutnput<Schema extends AnySchema = AnySchema> = DataTypeColumnOptions &\n ResourcefulColumnDefinition<Schema>\n\ninterface ColumnOptionsWithDate extends ColumnOptions {\n autoCreate: boolean\n autoUpdate: boolean\n}\n\nconst extractLucidOptionsForLucidDecorator = <\n LucidDecoratorOptionsType,\n InputOptionsType extends LucidDecoratorOptionsType = LucidDecoratorOptionsType,\n>(\n options: InputOptionsType,\n keys: Array<keyof LucidDecoratorOptionsType>,\n overrides?: Partial<LucidDecoratorOptionsType>\n): Partial<LucidDecoratorOptionsType> => {\n const extracted: Partial<LucidDecoratorOptionsType> = {}\n Object.entries(options as {}).forEach((entry) => {\n const [key, value] = entry as [keyof InputOptionsType, InputOptionsType[keyof InputOptionsType]]\n if (keys.includes(key as keyof LucidDecoratorOptionsType)) {\n const k = key as keyof LucidDecoratorOptionsType\n const v = value as unknown as LucidDecoratorOptionsType[keyof LucidDecoratorOptionsType]\n extracted[k] = v\n }\n })\n if (guards.isObject(overrides)) {\n Object.assign(extracted, overrides)\n }\n return extracted\n}\n\nconst extractLucidOptionsForLucidColumnDecorator = (\n options: Partial<ColumnOptionsWithDate>,\n overrides?: Partial<ColumnOptionsWithDate>\n) => {\n return extractLucidOptionsForLucidDecorator<Partial<ColumnOptionsWithDate>>(\n options,\n [\n 'columnName',\n 'serializeAs',\n 'isPrimary',\n 'meta',\n 'serialize',\n 'prepare',\n 'consume',\n 'autoCreate',\n 'autoUpdate',\n ],\n overrides\n )\n}\n\nconst extractLucidOptionsForLucidComputedDecorator = (\n options: Partial<ComputedOptions>,\n overrides?: Partial<ComputedOptions>\n) => {\n return extractLucidOptionsForLucidDecorator<Partial<ComputedOptions>>(\n options,\n ['serializeAs', 'meta'],\n overrides\n )\n}\n\nconst extractLucidOptionsForLucidRelatedModelDecorator = <RelatedModel extends LucidModel>(\n options: Partial<RelatedModelRelationOptions<RelatedModel>>,\n overrides?: Partial<RelatedModelRelationOptions<RelatedModel>>\n) => {\n return extractLucidOptionsForLucidDecorator<Partial<RelatedModelRelationOptions<RelatedModel>>>(\n options,\n [\n 'localKey',\n 'foreignKey',\n 'serializeAs',\n 'onQuery',\n 'meta',\n 'pivotTable',\n 'localKey',\n 'pivotForeignKey',\n 'relatedKey',\n 'pivotRelatedForeignKey',\n 'pivotColumns',\n 'pivotTimestamps',\n 'throughLocalKey',\n 'throughForeignKey',\n ] as any,\n overrides\n )\n}\n\nconst extractLucidOptionsForLucidHasManyThroughDecorator = <RelatedModel extends LucidModel>(\n options: Partial<HasManyThroughRelationOptions<RelatedModel>>,\n overrides?: Partial<HasManyThroughRelationOptions<RelatedModel>>\n) => {\n return extractLucidOptionsForLucidDecorator<Partial<HasManyThroughRelationOptions<RelatedModel>>>(\n options,\n [\n 'localKey',\n 'foreignKey',\n 'serializeAs',\n 'onQuery',\n 'meta',\n 'pivotTable',\n 'localKey',\n 'pivotForeignKey',\n 'relatedKey',\n 'pivotRelatedForeignKey',\n 'pivotColumns',\n 'pivotTimestamps',\n 'throughLocalKey',\n 'throughForeignKey',\n ] as any,\n overrides\n )\n}\n\nconst handleResourcefulColumn = <Schema extends AnySchema = ResourcefulPropertySchema>(config: {\n decoratorName: string\n target: any\n propertyKey: string\n decoratorOption: Partial<ResourcefulColumnDefinition<Schema>>\n decoratorOptionsValidationSchema: ObjectSchema\n lucidDecoratorFunction: typeof lucidColumn | DateColumnDecorator | DateTimeColumnDecorator\n overrides?: Partial<ColumnOptions>\n defaultPrepare?: DefaultPrepareFunction\n defaultConsume?: DefaultConsumeFunction\n}) => {\n const {\n decoratorName,\n target,\n propertyKey,\n decoratorOption,\n decoratorOptionsValidationSchema,\n overrides = {},\n lucidDecoratorFunction,\n defaultPrepare,\n defaultConsume,\n } = config\n\n const opts = validateNormalizeAndCastDecoratorOptions<\n Partial<ResourcefulColumnDefinition<Schema>>,\n ResourcefulColumnDefinition<Schema>\n >(propertyKey, decoratorName, decoratorOptionsValidationSchema, {\n ...decoratorOption,\n propertyKey,\n })\n const customPrepare = opts.prepare\n const customConsume = opts.consume\n const nullable = opts.nullable || false\n\n // Create chained functions using PrepareConsumeChainBuilder\n const chainedPrepare = PrepareConsumeChainBuilder.chainPrepare(\n propertyKey,\n nullable,\n defaultPrepare,\n customPrepare\n )\n const chainedConsume = PrepareConsumeChainBuilder.chainConsume(\n propertyKey,\n nullable,\n defaultConsume,\n customConsume\n )\n\n // Merge DataTypeColumnOptions for Lucid, excluding prepare/consume from opts\n const lucidOptions = extractLucidOptionsForLucidColumnDecorator(\n opts as unknown as Partial<ColumnOptions>,\n {\n ...overrides,\n ...(chainedPrepare && { prepare: chainedPrepare }),\n ...(chainedConsume && { consume: chainedConsume }),\n }\n )\n\n lucidDecoratorFunction(lucidOptions)(target, propertyKey)\n\n const map = ensureOwnResourcefulMap(target, '$resourcefulColumns')\n map.set(propertyKey, opts)\n}\n\nconst handleResourcefulComputed = <Schema extends AnySchema = ResourcefulPropertySchema>(config: {\n decoratorName: string\n target: any\n propertyKey: string\n decoratorOption: Partial<ResourcefulComputedAccessorDefinition<Schema>>\n decoratorOptionsValidationSchema: ObjectSchema\n}) => {\n const { decoratorName, target, propertyKey, decoratorOption, decoratorOptionsValidationSchema } =\n config\n const opts = validateNormalizeAndCastDecoratorOptions<\n Partial<ResourcefulComputedAccessorDefinition<Schema>>,\n ResourcefulComputedAccessorDefinition<Schema>\n >(propertyKey, decoratorName, decoratorOptionsValidationSchema, {\n ...decoratorOption,\n propertyKey,\n })\n // Merge DataTypeComputedOptions for Lucid\n const lucidOptions = extractLucidOptionsForLucidComputedDecorator(\n opts as unknown as Partial<ComputedOptions>\n )\n\n lucidComputed(lucidOptions)(target, propertyKey)\n\n const map = ensureOwnResourcefulMap(target, '$resourcefulComputedAccessors')\n map.set(propertyKey, opts)\n}\n\nfunction ensureOwnResourcefulMap(target: any, mapKey: string) {\n const ctor = target.constructor\n if (!Object.prototype.hasOwnProperty.call(ctor, mapKey)) {\n ctor[mapKey] = new Map()\n }\n return ctor[mapKey]\n}\n\nexport type DataTypeColumnOptions = Omit<ColumnOptions, 'prepare' | 'consume'>\n\nexport type DataTypeComputedOptions = Omit<ComputedOptions, 'prepare' | 'consume'>\n\n/**\n * Decorator to define a resourceful column on a Lucid model property.\n * Applies validation, metadata, and Lucid column options.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulStringType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn({ type: ResourcefulStringType({ minLength: 1, maxLength: 100 }), nullable: false })\n * public name: string\n * }\n * ```\n *\n * @param options - Resourceful column options and Lucid column options.\n * @returns Property decorator function.\n */\nexport function resourcefulColumn<Schema extends AnySchema = ResourcefulPropertySchema>(\n options: Partial<ColumnOptions> & Partial<ResourcefulColumnDefinition<Schema>> = {}\n) {\n const decoratorName = 'resourcefulColumn'\n const decoratorOptionsValidationSchema = resourcefulColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<\n ValidatorInput<Schema>,\n ValidatorOutnput<Schema>\n >(propertyKey, decoratorName, decoratorOptionsValidationSchema, { ...options, propertyKey })\n const lucidOptions = extractLucidOptionsForLucidColumnDecorator(opts)\n\n lucidColumn(lucidOptions)(target, propertyKey)\n\n const map = ensureOwnResourcefulMap(target, '$resourcefulColumns')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful string column on a Lucid model property.\n * Includes prepare and consume functions for string type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulStringType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.string({ type: ResourcefulStringType({ minLength: 3 }), nullable: false })\n * public email: string\n * }\n * ```\n *\n * @param options - Resourceful string column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.string = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<StringSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.string'\n const decoratorOptionsValidationSchema = stringColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareString as DefaultPrepareFunction,\n defaultConsume: consumeString as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful date column on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulDateType } from '@nhtio/lucid-resourceful'\n *\n * class Event {\n * @resourcefulColumn.date({ type: ResourcefulDateType(), autoCreate: true, autoUpdate: false })\n * public startDate: Date\n * }\n * ```\n *\n * @param options - Resourceful date column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.date = function (\n options: Partial<DateColumnOptions> & Partial<ResourcefulColumnDefinition<DateSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.date'\n const decoratorOptionsValidationSchema = dateColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn.date,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful dateTime column on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulDateTimeType } from '@nhtio/lucid-resourceful'\n *\n * class Event {\n * @resourcefulColumn.dateTime({ type: ResourcefulDateTimeType(), autoCreate: true, autoUpdate: true })\n * public updatedAt: Date\n * }\n * ```\n *\n * @param options - Resourceful dateTime column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.dateTime = function (\n options: Partial<DateColumnOptions> & Partial<ResourcefulColumnDefinition<DateSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.dateTime'\n const decoratorOptionsValidationSchema = dateTimeColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn.dateTime,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful binary column on a Lucid model property.\n * Includes prepare and consume functions for binary type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulBinaryType } from '@nhtio/lucid-resourceful'\n *\n * class File {\n * @resourcefulColumn.binary({ type: ResourcefulBinaryType(), nullable: true })\n * public data: Buffer\n * }\n * ```\n *\n * @param options - Resourceful binary column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.binary = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<BinarySchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.binary'\n const decoratorOptionsValidationSchema = binaryColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareBinary as DefaultPrepareFunction,\n defaultConsume: consumeBinary as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful number column on a Lucid model property.\n * Includes prepare and consume functions for number type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulNumberType } from '@nhtio/lucid-resourceful'\n *\n * class Product {\n * @resourcefulColumn.number({ type: ResourcefulNumberType(), nullable: false })\n * public price: number\n * }\n * ```\n *\n * @param options - Resourceful number column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.number = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.number'\n const decoratorOptionsValidationSchema = numberColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareNumber as DefaultPrepareFunction,\n defaultConsume: consumeNumber as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful integer column on a Lucid model property.\n * Includes prepare and consume functions for integer type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulIntegerType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.integer({ type: ResourcefulIntegerType(), nullable: false })\n * public age: number\n * }\n * ```\n *\n * @param options - Resourceful integer column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.integer = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.integer'\n const decoratorOptionsValidationSchema = integerColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareInteger as DefaultPrepareFunction,\n defaultConsume: consumeInteger as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful bigint column on a Lucid model property.\n * Includes prepare and consume functions for bigint type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulBigintType } from '@nhtio/lucid-resourceful'\n *\n * class Transaction {\n * @resourcefulColumn.bigint({ type: ResourcefulBigintType(), nullable: false })\n * public bigValue: bigint\n * }\n * ```\n *\n * @param options - Resourceful bigint column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.bigint = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.bigint'\n const decoratorOptionsValidationSchema = bigintColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareBigint as DefaultPrepareFunction,\n defaultConsume: consumeBigint as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful unsigned integer column on a Lucid model property.\n * Includes prepare and consume functions for unsigned integer type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulUnsignedIntegerType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.unsignedint({ type: ResourcefulUnsignedIntegerType(), nullable: false })\n * public positiveCount: number\n * }\n * ```\n *\n * @param options - Resourceful unsigned integer column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.unsignedint = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.unsignedint'\n const decoratorOptionsValidationSchema = unsignedIntegerColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareUnsignedint as DefaultPrepareFunction,\n defaultConsume: consumeUnsignedint as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful boolean column on a Lucid model property.\n * Includes prepare and consume functions for boolean type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulBooleanType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.boolean({ type: ResourcefulBooleanType(), nullable: false })\n * public isActive: boolean\n * }\n * ```\n *\n * @param options - Resourceful boolean column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.boolean = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<BooleanSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.boolean'\n const decoratorOptionsValidationSchema = booleanColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareBoolean as DefaultPrepareFunction,\n defaultConsume: consumeBoolean as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful object column on a Lucid model property.\n * Includes prepare and consume functions for object type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulObjectType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.object({ type: ResourcefulObjectType(), nullable: true })\n * public metadata: object\n * }\n * ```\n *\n * @param options - Resourceful object column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.object = function (\n options: Partial<ColumnOptions> & Partial<ResourcefulColumnDefinition<ObjectSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.object'\n const decoratorOptionsValidationSchema = objectColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareObject as DefaultPrepareFunction,\n defaultConsume: consumeObject as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful array column on a Lucid model property.\n * Includes prepare and consume functions for array type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulArrayType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.array({ type: ResourcefulArrayType({ items: { type: 'string' } }), nullable: true })\n * public tags: any[]\n * }\n * ```\n *\n * @param options - Resourceful array column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.array = function (\n options: Partial<ColumnOptions> & Partial<ResourcefulColumnDefinition<ArraySchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.array'\n const decoratorOptionsValidationSchema = arrayColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareArray as DefaultPrepareFunction,\n defaultConsume: consumeArray as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful computed accessor on a Lucid model property.\n * Applies validation, metadata, and Lucid computed options.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulStringType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed({ type: ResourcefulStringType({ minLength: 1, maxLength: 100 }) })\n * public get fullName() {\n * return `${this.firstName} ${this.lastName}`\n * }\n * }\n * ```\n *\n * @param options - Resourceful computed accessor options and Lucid computed options.\n * @returns Property decorator function.\n */\nexport function resourcefulComputed<Schema extends AnySchema = ResourcefulPropertySchema>(\n options: Partial<ComputedOptions> & Partial<ResourcefulComputedAccessorDefinition<Schema>> = {}\n) {\n const decoratorName = 'resourcefulComputed'\n const decoratorOptionsValidationSchema = resourcefulComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<\n ValidatorInput<Schema>,\n ValidatorOutnput<Schema>\n >(propertyKey, decoratorName, decoratorOptionsValidationSchema, { ...options, propertyKey })\n const lucidOptions = extractLucidOptionsForLucidComputedDecorator(opts)\n\n lucidComputed(lucidOptions)(target, propertyKey)\n\n const map = ensureOwnResourcefulMap(target, '$resourcefulComputedAccessors')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful string computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulStringType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.string({ type: ResourcefulStringType({ minLength: 3 }) })\n * public get displayName() {\n * return this.name.toUpperCase()\n * }\n * }\n * ```\n *\n * @param options - Resourceful string computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.string = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<StringSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.string'\n const decoratorOptionsValidationSchema = stringComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful date computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulDateType } from '@nhtio/lucid-resourceful'\n *\n * class Event {\n * @resourcefulComputed.date({ type: ResourcefulDateType() })\n * public get eventDate() {\n * return this._eventDate\n * }\n * }\n * ```\n *\n * @param options - Resourceful date computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.date = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<DateSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.date'\n const decoratorOptionsValidationSchema = dateComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful dateTime computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulDateTimeType } from '@nhtio/lucid-resourceful'\n *\n * class Event {\n * @resourcefulComputed.dateTime({ type: ResourcefulDateTimeType() })\n * public get updatedAt() {\n * return this._updatedAt\n * }\n * }\n * ```\n *\n * @param options - Resourceful dateTime computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.dateTime = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<DateSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.dateTime'\n const decoratorOptionsValidationSchema = dateTimeComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful binary computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulBinaryType } from '@nhtio/lucid-resourceful'\n *\n * class File {\n * @resourcefulComputed.binary({ type: ResourcefulBinaryType() })\n * public get fileData() {\n * return this._fileData\n * }\n * }\n * ```\n *\n * @param options - Resourceful binary computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.binary = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<BinarySchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.binary'\n const decoratorOptionsValidationSchema = binaryComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful number computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulNumberType } from '@nhtio/lucid-resourceful'\n *\n * class Product {\n * @resourcefulComputed.number({ type: ResourcefulNumberType() })\n * public get discountedPrice() {\n * return this.price * 0.9\n * }\n * }\n * ```\n *\n * @param options - Resourceful number computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.number = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.number'\n const decoratorOptionsValidationSchema = numberComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful integer computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulIntegerType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.integer({ type: ResourcefulIntegerType() })\n * public get roundedAge() {\n * return Math.floor(this.age)\n * }\n * }\n * ```\n *\n * @param options - Resourceful integer computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.integer = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.integer'\n const decoratorOptionsValidationSchema = integerComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful bigint computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulBigintType } from '@nhtio/lucid-resourceful'\n *\n * class Transaction {\n * @resourcefulComputed.bigint({ type: ResourcefulBigintType() })\n * public get bigValue() {\n * return this._bigValue\n * }\n * }\n * ```\n *\n * @param options - Resourceful bigint computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.bigint = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.bigint'\n const decoratorOptionsValidationSchema = bigintComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful unsigned integer computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulUnsignedIntegerType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.unsignedint({ type: ResourcefulUnsignedIntegerType() })\n * public get positiveCount() {\n * return this._positiveCount\n * }\n * }\n * ```\n *\n * @param options - Resourceful unsigned integer computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.unsignedint = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.unsignedint'\n const decoratorOptionsValidationSchema = unsignedIntegerComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful boolean computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulBooleanType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.boolean({ type: ResourcefulBooleanType() })\n * public get isActive() {\n * return this._isActive\n * }\n * }\n * ```\n *\n * @param options - Resourceful boolean computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.boolean = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<BooleanSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.boolean'\n const decoratorOptionsValidationSchema = booleanComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful object computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulObjectType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.object({ type: ResourcefulObjectType() })\n * public get metadata() {\n * return this._metadata\n * }\n * }\n * ```\n *\n * @param options - Resourceful object computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.object = function (\n options: Partial<ComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<ObjectSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.object'\n const decoratorOptionsValidationSchema = objectComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful array computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulArrayType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.array({ type: ResourcefulArrayType({ items: { type: 'string' } }) })\n * public get tags() {\n * return this._tags\n * }\n * }\n * ```\n *\n * @param options - Resourceful array computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.array = function (\n options: Partial<ComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<ArraySchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.array'\n const decoratorOptionsValidationSchema = arrayComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful belongsTo relationship on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulBelongsTo } from '@nhtio/lucid-resourceful'\n *\n * class Post {\n * @resourcefulBelongsTo(() => User, { foreignKey: 'user_id' })\n * public user: User\n * }\n * ```\n *\n * @param model - Function returning the related model class.\n * @param options - Relationship options and resourceful relationship definition.\n * @returns Property decorator function.\n */\nexport function resourcefulBelongsTo<RelatedModel extends LucidModel>(\n model: () => RelatedModel,\n options: Partial<RelationOptions<RelatedModel, LucidModel, HasOne<RelatedModel, LucidModel>>> &\n Partial<ResourcefulRelationshipDefinition> = {}\n) {\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<any, any>(\n propertyKey,\n 'resourcefulBelongsTo',\n relationOptionsSchema,\n { ...options, propertyKey, relatedModel: model }\n )\n const lucidOptions = extractLucidOptionsForLucidRelatedModelDecorator(opts)\n lucidBelongsTo(model, lucidOptions as any)(target, propertyKey)\n const map = ensureOwnResourcefulMap(target, '$resourcefulRelationships')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful hasOne relationship on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulHasOne } from '@nhtio/lucid-resourceful'\n *\n * class UserProfile {\n * @resourcefulHasOne(() => User, { foreignKey: 'user_id' })\n * public user: UserProfile\n * }\n * ```\n *\n * @param model - Function returning the related model class.\n * @param options - Relationship options and resourceful relationship definition.\n * @returns Property decorator function.\n */\nexport function resourcefulHasOne<RelatedModel extends LucidModel>(\n model: () => RelatedModel,\n options: Partial<RelationOptions<RelatedModel, LucidModel, HasOne<RelatedModel, LucidModel>>> &\n Partial<ResourcefulRelationshipDefinition> = {}\n) {\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<any, any>(\n propertyKey,\n 'resourcefulHasOne',\n relationOptionsSchema,\n { ...options, propertyKey, relatedModel: model }\n )\n const lucidOptions = extractLucidOptionsForLucidRelatedModelDecorator(opts)\n lucidHasOne(model, lucidOptions as any)(target, propertyKey)\n const map = ensureOwnResourcefulMap(target, '$resourcefulRelationships')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful hasMany relationship on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulHasMany } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulHasMany(() => Post, { foreignKey: 'user_id' })\n * public posts: HasMany<typeof Post>\n * }\n * ```\n *\n * @param model - Function returning the related model class.\n * @param options - Relationship options and resourceful relationship definition.\n * @returns Property decorator function.\n */\nexport function resourcefulHasMany<RelatedModel extends LucidModel>(\n model: () => RelatedModel,\n options: Partial<RelationOptions<RelatedModel, LucidModel, HasOne<RelatedModel, LucidModel>>> &\n Partial<ResourcefulRelationshipDefinition> = {}\n) {\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<any, any>(\n propertyKey,\n 'resourcefulHasMany',\n relationOptionsSchema,\n { ...options, propertyKey, relatedModel: model }\n )\n const lucidOptions = extractLucidOptionsForLucidRelatedModelDecorator(opts)\n lucidHasMany(model, lucidOptions as any)(target, propertyKey)\n const map = ensureOwnResourcefulMap(target, '$resourcefulRelationships')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful manyToMany relationship on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulManyToMany } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulManyToMany(() => Role, { pivotTable: 'role_user' })\n * public roles: ManyToMany<typeof Role>\n * }\n * ```\n *\n * @param model - Function returning the related model class.\n * @param options - ManyToMany relationship options and resourceful relationship definition.\n * @returns Property decorator function.\n */\nexport function resourcefulManyToMany<RelatedModel extends LucidModel>(\n model: () => RelatedModel,\n options: Partial<ManyToManyRelationOptions<ManyToMany<RelatedModel>>> &\n Partial<ResourcefulRelationshipDefinition> = {}\n) {\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<any, any>(\n propertyKey,\n 'resourcefulManyToMany',\n manyToManyRelationOptionsSchema,\n { ...options, propertyKey, relatedModel: model }\n )\n const lucidOptions = extractLucidOptionsForLucidRelatedModelDecorator(opts)\n lucidManyToMany(model, lucidOptions as any)(target, propertyKey)\n const map = ensureOwnResourcefulMap(target, '$resourcefulRelationships')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful hasManyThrough relationship on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulHasManyThrough } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulHasManyThrough([\n * () => Role,\n * () => UserRolePivot\n * ], { foreignKey: 'user_id' })\n * public roles: HasManyThrough<typeof Role>\n * }\n * ```\n *\n * @param model - Tuple of functions returning the related model and through model classes.\n * @param options - HasManyThrough relationship options and resourceful relationship definition.\n * @returns Property decorator function.\n */\nexport function resourcefulHasManyThrough<RelatedModel extends LucidModel>(\n model: [() => RelatedModel, () => LucidModel],\n options: Partial<HasManyThroughRelationOptions<RelatedModel>> &\n Partial<ResourcefulRelationshipDefinition> = {}\n) {\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<any, any>(\n propertyKey,\n 'resourcefulHasManyThrough',\n hasManyThroughRelationOptionsSchema,\n { ...options, propertyKey, relatedModel: model[0] }\n )\n const lucidOptions = extractLucidOptionsForLucidHasManyThroughDecorator(opts)\n lucidHasManyThrough(model, lucidOptions as any)(target, propertyKey)\n const map = ensureOwnResourcefulMap(target, '$resourcefulRelationships')\n map.set(propertyKey, opts)\n }\n}\n","/**\n * A decorator-driven AdonisJS library that lets you annotate Lucid ORM models with metadata to automatically generate CRUD controllers, validation rules, OpenAPI schemas, and a unified query interface.\n * @module @nhtio/lucid-resourceful\n */\n\n/**\n * The current version of the package.\n *\n * @tip This is a constant that is replaced during the build process with the actual version of the package.\n */\nexport const version = __VERSION__\n\nexport { withResourceful } from './private/mixin'\nexport {\n resourcefulColumn,\n resourcefulComputed,\n resourcefulBelongsTo,\n resourcefulHasOne,\n resourcefulHasMany,\n resourcefulManyToMany,\n resourcefulHasManyThrough,\n} from './private/decorators'\nexport * as errors from '@nhtio/lucid-resourceful/errors'\nexport * as definitions from '@nhtio/lucid-resourceful/definitions'\n"],"names":["index","error","column","parse","SyntaxError","isString","joi","ensureOwnResourcefulMap","TypedEventEmitter","guards.isObject","helpers.stripUndefinedValuesFromObject","guards.isResourcefulModel","ref","_a","errors.E_INVALID_DATE_COLUMN_VALUE","errors.E_UNDEFINED_RELATIONSHIP","debug","errors.E_MISSING_MODEL_ATTRIBUTE","a","equal","errors.E_RUNTIME_EXCEPTION","$replace","$concat","require$$0","has","isArray","inspect","isRegExp","global","hasOwn","l","n","type","k","$TypeError","require$$1","abs","floor","max","min","pow","round","isNaN","sign","$gOPD","$defineProperty","hasSymbols","$Object","toStr","concatty","slicy","bind","Empty","implementation","$apply","$call","require$$2","require$$3","gOPD","getProto","undefined","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21","require$$22","doEval","require$$23","require$$24","stringToPath","quote","getBaseIntrinsic","GetIntrinsic","callBindBasic","callBound","getSideChannelMap","getSideChannelList","getSideChannelWeakMap","formats","compactQueue","arrayToObject","merge","encode","compact","isBuffer","combine","maybeMap","utils","getSideChannel","defaults","isNonNullishPrimitive","stringify","serializeDate","sideChannel","value","normalizeStringifyOptions","limit","brackets","normalizeParseOptions","string","errors.E_ROW_NOT_FOUND","client","computed","errors.E_MODEL_DELETED","lucidComputed","lucidColumn","lucidBelongsTo","lucidHasOne","lucidHasMany","lucidManyToMany","lucidHasManyThrough"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0CO,MAAM,iCAAiC,CAAgC,QAAc;AAC1F,SAAO,OAAO,YAAY,OAAO,QAAQ,GAAG,EAAE,OAAO,CAAC,CAAC,GAAG,KAAK,MAAM,UAAU,MAAS,CAAC;AAC3F;AC5Ce,eAAe,KAC7B,UACA,QACA;AAAA,EACC,cAAc,OAAO;AAAA,EACrB,cAAc;AAAA,EACd;AACF,IAAK,CAAA,GACH;AACD,SAAO,IAAI,QAAQ,CAAC,UAAU,YAAY;AACzC,QAAI,SAAS,OAAO,QAAQ,MAAM,UAAa,SAAS,OAAO,aAAa,MAAM,QAAW;AAC5F,YAAM,IAAI,UAAU,8EAA8E,OAAO,QAAQ,GAAG;AAAA,IACrH;AAEA,QAAI,OAAO,WAAW,YAAY;AACjC,YAAM,IAAI,UAAU,6BAA6B;AAAA,IAClD;AAEA,QAAI,EAAG,OAAO,cAAc,WAAW,KAAK,eAAe,KAAM,gBAAgB,OAAO,oBAAoB;AAC3G,YAAM,IAAI,UAAU,kFAAkF,WAAW,OAAO,OAAO,WAAW,GAAG;AAAA,IAC9I;AAEA,UAAM,SAAS,CAAA;AACf,UAAM,SAAS,CAAA;AACf,UAAM,oBAAoB,oBAAI,IAAG;A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A;AAAA,MACA;AAAA,MACA,EAAE,GAAG,SAAS,aAAa,cAAc,MAAA;AAAA,IAAM;AAEjD,UAAM,eAAe,iDAAiD,IAAI;AAC1EC,eAAgB,OAAO,YAAmB,EAAE,QAAQ,WAAW;AAC/D,UAAM,MAAM,wBAAwB,QAAQ,2BAA2B;AACvE,QAAI,IAAI,aAAa,IAAI;AAAA,EAC3B;AACF;AAsBO,SAAS,0BACd,OACA,UAC+C,IAC/C;AACA,SAAO,SAAU,QAAa,aAAqB;AACjD,UAAM,OAAO;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA,EAAE,GAAG,SAAS,aAAa,cAAc,MAAM,CAAC,EAAA;AAAA,IAAE;AAEpD,UAAM,eAAe,mDAAmD,IAAI;AAC5EC,mBAAoB,OAAO,YAAmB,EAAE,QAAQ,WAAW;AACnE,UAAM,MAAM,wBAAwB,QAAQ,2BAA2B;AACvE,QAAI,IAAI,aAAa,IAAI;AAAA,EAC3B;AACF;ACj6CO,MAAM,UAAU;","x_google_ignoreList":[1,3,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/private/helpers.ts","../node_modules/.pnpm/p-map@7.0.3/node_modules/p-map/index.js","../src/private/lucene_to_lucid_translator.ts","../node_modules/.pnpm/@nhtio+tiny-typed-emitter@1.20250430.0/node_modules/@nhtio/tiny-typed-emitter/index.mjs","../src/private/mixin.ts","../src/private/prepare_consume_chain_builder.ts","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/errors.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/decorators/date.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/decorators/date_time.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/decorators/index.js","../node_modules/.pnpm/@poppinss+hooks@7.2.6/node_modules/@poppinss/hooks/build/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/preloader/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/base_model/proxy_handler.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/model_keys/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/keys_extractor.js","../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/utils/index.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js","../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/util.inspect.js","../node_modules/.pnpm/object-inspect@1.13.4/node_modules/object-inspect/index.js","../node_modules/.pnpm/side-channel-list@1.0.0/node_modules/side-channel-list/index.js","../node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js","../node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js","../node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js","../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js","../node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js","../node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js","../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js","../node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js","../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js","../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js","../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js","../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js","../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js","../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js","../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js","../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js","../node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js","../node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js","../node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js","../node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js","../node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js","../node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js","../node_modules/.pnpm/side-channel-map@1.0.1/node_modules/side-channel-map/index.js","../node_modules/.pnpm/side-channel-weakmap@1.0.2/node_modules/side-channel-weakmap/index.js","../node_modules/.pnpm/side-channel@1.1.0/node_modules/side-channel/index.js","../node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/formats.js","../node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/utils.js","../node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/stringify.js","../node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/parse.js","../node_modules/.pnpm/qs@6.14.0/node_modules/qs/lib/index.js","../node_modules/.pnpm/@poppinss+utils@6.10.0/node_modules/@poppinss/utils/build/src/string/main.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/naming_strategies/camel_case.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/database/paginator/simple_paginator.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/paginator/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/query_reporter/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/query_runner/index.js","../node_modules/.pnpm/@poppinss+macroable@1.0.4/node_modules/@poppinss/macroable/build/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/database/query_builder/raw.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/database/static_builder/raw.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/database/static_builder/reference.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/database/query_builder/chainable.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/query_builder/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/base/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_one/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/base/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_one/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_one/query_client.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_one/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many/query_client.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/belongs_to/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/belongs_to/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/belongs_to/query_client.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/belongs_to/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/many_to_many/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/many_to_many/pivot_helpers.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/many_to_many/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/many_to_many/query_client.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/many_to_many/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many_through/query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many_through/sub_query_builder.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many_through/query_client.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/has_many_through/index.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/relations/aggregates_loader/lazy_load.js","../node_modules/.pnpm/@adonisjs+lucid@21.7.0_@adonisjs+assembler@7.8.2_typescript@5.8.3__@adonisjs+core@6.19._eeb1001bada02021af77985eaa97c862/node_modules/@adonisjs/lucid/build/src/orm/base_model/index.js","../src/private/decorator_schemas.ts","../src/private/decorators.ts","../src/index.ts"],"sourcesContent":["/*\n|--------------------------------------------------------------------------\n| Internal Helper Functions\n|--------------------------------------------------------------------------\n|\n| Functionality to help keep things DRY\n|\n*/\n\n/**\n * Removes all properties with undefined values from an object.\n * This utility function creates a new object containing only the properties\n * that have defined values, effectively filtering out any undefined properties.\n *\n * @example\n * ```typescript\n * const input = {\n * name: 'John',\n * age: undefined,\n * email: 'john@example.com',\n * phone: undefined\n * }\n *\n * const result = stripUndefinedValuesFromObject(input)\n * // Result: { name: 'John', email: 'john@example.com' }\n * ```\n *\n * @example\n * ```typescript\n * // Useful for cleaning up optional parameters before API calls\n * const apiParams = stripUndefinedValuesFromObject({\n * userId: user.id,\n * filter: searchFilter || undefined,\n * limit: pageSize || undefined,\n * offset: currentPage ? currentPage * pageSize : undefined\n * })\n * ```\n *\n * @template T - The type of the input object, must extend Record<string, any>\n * @param {T} obj - The object to filter, removing properties with undefined values\n * @returns {T} A new object of the same type with undefined properties removed\n */\nexport const stripUndefinedValuesFromObject = <T extends Record<string, any>>(obj: T): T => {\n return Object.fromEntries(Object.entries(obj).filter(([_, value]) => value !== undefined)) as T\n}\n","export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tskippedIndexesMap.set(index, value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[index] = value;\n\n\t\t\t\t\tresolvingCount--;\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (stopOnError) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.push(error);\n\t\t\t\t\t\tresolvingCount--;\n\n\t\t\t\t\t\t// In that case we can't really continue regardless of `stopOnError` state\n\t\t\t\t\t\t// since an iterable is likely to continue throwing after it throws once.\n\t\t\t\t\t\t// If we continue calling `next()` indefinitely we will likely end up\n\t\t\t\t\t\t// in an infinite loop of failed iteration.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait next();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\t// Create the concurrent runners in a detached (non-awaited)\n\t\t// promise. We need this so we can await the `next()` calls\n\t\t// to stop creating runners before hitting the concurrency limit\n\t\t// if the iterable has already been marked as done.\n\t\t// NOTE: We *must* do this for async iterators otherwise we'll spin up\n\t\t// infinite `next()` calls by default and never start the event loop.\n\t\t(async () => {\n\t\t\tfor (let index = 0; index < concurrency; index++) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (isIterableDone || isRejected) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t});\n}\n\nexport function pMapIterable(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tbackpressure = concurrency,\n\t} = {},\n) {\n\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t}\n\n\tif (typeof mapper !== 'function') {\n\t\tthrow new TypeError('Mapper function is required');\n\t}\n\n\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t}\n\n\tif (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {\n\t\tthrow new TypeError(`Expected \\`backpressure\\` to be an integer from \\`concurrency\\` (${concurrency}) and up or \\`Infinity\\`, got \\`${backpressure}\\` (${typeof backpressure})`);\n\t}\n\n\treturn {\n\t\tasync * [Symbol.asyncIterator]() {\n\t\t\tconst iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();\n\n\t\t\tconst promises = [];\n\t\t\tlet runningMappersCount = 0;\n\t\t\tlet isDone = false;\n\t\t\tlet index = 0;\n\n\t\t\tfunction trySpawn() {\n\t\t\t\tif (isDone || !(runningMappersCount < concurrency && promises.length < backpressure)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst promise = (async () => {\n\t\t\t\t\tconst {done, value} = await iterator.next();\n\n\t\t\t\t\tif (done) {\n\t\t\t\t\t\treturn {done: true};\n\t\t\t\t\t}\n\n\t\t\t\t\trunningMappersCount++;\n\n\t\t\t\t\t// Spawn if still below concurrency and backpressure limit\n\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst returnValue = await mapper(await value, index++);\n\n\t\t\t\t\t\trunningMappersCount--;\n\n\t\t\t\t\t\tif (returnValue === pMapSkip) {\n\t\t\t\t\t\t\tconst index = promises.indexOf(promise);\n\n\t\t\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\t\t\tpromises.splice(index, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Spawn if still below backpressure limit and just dropped below concurrency limit\n\t\t\t\t\t\ttrySpawn();\n\n\t\t\t\t\t\treturn {done: false, value: returnValue};\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tisDone = true;\n\t\t\t\t\t\treturn {error};\n\t\t\t\t\t}\n\t\t\t\t})();\n\n\t\t\t\tpromises.push(promise);\n\t\t\t}\n\n\t\t\ttrySpawn();\n\n\t\t\twhile (promises.length > 0) {\n\t\t\t\tconst {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop\n\n\t\t\t\tpromises.shift();\n\n\t\t\t\tif (error) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\tif (done) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Spawn if just dropped below backpressure limit and below the concurrency limit\n\t\t\t\ttrySpawn();\n\n\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tyield value;\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport const pMapSkip = Symbol('skip');\n","/* v8 ignore next */\nimport { parse, SyntaxError } from 'liqe'\nimport {\n E_LUCENE_SYNTAX_EXCEPTION,\n E_LUCENE_UNEXPECTED_EXCEPTION,\n E_LUCENE_INVALID_TYPE,\n} from '@nhtio/lucid-resourceful/errors'\nimport type { ModelKeysContract } from '@adonisjs/lucid/types/model'\nimport type { QueryClientContract } from '@adonisjs/lucid/types/database'\nimport type { DatabaseQueryBuilderContract } from '@adonisjs/lucid/types/querybuilder'\nimport type {\n LiqeQuery,\n ComparisonOperatorToken,\n EmptyExpression,\n FieldToken,\n ImplicitFieldToken,\n LiteralExpressionToken,\n LogicalExpressionToken,\n RangeExpressionToken,\n RegexExpressionToken,\n TagToken,\n UnaryOperatorToken,\n ParenthesizedExpressionToken,\n ExpressionToken,\n ParserAst,\n} from 'liqe'\n\n/**\n * Database query builder contract extended for Lucene filtering capabilities.\n *\n * @template Result - The result type for the query builder\n */\nexport interface LuceneFilteredDatabaseQueryBuilderContract extends DatabaseQueryBuilderContract {}\n\n/**\n * Applies an empty expression AST node to a database query.\n * Empty expressions are no-op operations that don't modify the query.\n *\n * @template T - The result type for the query builder\n * @param _ast - The empty expression AST node\n * @param _query - The database query builder to modify\n * @param _attributesToColumns - Mapping of model attributes to database columns\n * @param _primaryKey - The primary key column name\n * @param _tableName - The table name\n * @param _allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneEmptyExpressionAst = (\n _ast: EmptyExpression,\n _query: LuceneFilteredDatabaseQueryBuilderContract,\n _attributesToColumns: ModelKeysContract,\n _primaryKey: string,\n _tableName: string,\n _allowedColumns?: string[] | undefined\n) => {\n // noop, this is an empty expression, nothing to do here\n}\n\n/**\n * Applies a logical expression AST node (AND/OR) to a database query.\n * Handles logical operations between two expressions with proper SQL grouping.\n *\n * @template T - The result type for the query builder\n * @param ast - The logical expression AST node containing left/right operands and operator\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneLogicalExpressionAst = (\n ast: LogicalExpressionToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n const operatorType = ast.operator.operator\n query.where((subQuery) => {\n if (operatorType === 'AND') {\n applyLuceneAst(ast.left, subQuery, attributesToColumns, primaryKey, tableName, allowedColumns)\n applyLuceneAst(\n ast.right,\n subQuery,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n } else {\n subQuery.orWhere((orSubQuery) => {\n applyLuceneAst(\n ast.left,\n orSubQuery as any,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n })\n subQuery.orWhere((orSubQuery) => {\n applyLuceneAst(\n ast.right,\n orSubQuery as any,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n })\n }\n })\n}\n\n/**\n * Applies a parenthesized expression AST node to a database query.\n * Maintains logical grouping by wrapping the inner expression in a WHERE clause.\n *\n * @template T - The result type for the query builder\n * @param ast - The parenthesized expression AST node containing the inner expression\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneParenthesizedExpressionAst = (\n ast: ParenthesizedExpressionToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n query.where((subQuery) => {\n applyLuceneAst(\n ast.expression,\n subQuery,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n })\n}\n\n/**\n * Applies an empty expression to a database query for a specific column.\n * Handles queries for null or empty values.\n *\n * @template T - The result type for the query builder\n * @param column - The database column name to query\n * @param _expression - The empty expression (unused)\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param _attributesToColumns - Mapping of model attributes to database columns (unused)\n * @param _primaryKey - The primary key column name (unused)\n * @param _tableName - The table name (unused)\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneEmptyExpression = (\n column: string,\n _expression: EmptyExpression,\n operator: ComparisonOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n _attributesToColumns: ModelKeysContract,\n _primaryKey: string,\n _tableName: string,\n _allowedColumns?: string[] | undefined\n) => {\n switch (operator.operator) {\n case ':':\n case ':=':\n case ':<=':\n case ':>=':\n query.where((sub) => {\n sub.whereNull(column)\n sub.orWhere(column, '=', '')\n })\n break\n }\n}\n\n/**\n * Applies a literal expression to a database query for a specific column.\n * Handles string, boolean, and null values with appropriate SQL operations.\n * Supports quote stripping and handles different comparison operators.\n *\n * @template T - The result type for the query builder\n * @param column - The database column name to query\n * @param expression - The literal expression containing the value and quote information\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param _attributesToColumns - Mapping of model attributes to database columns (unused)\n * @param _primaryKey - The primary key column name (unused)\n * @param _tableName - The table name (unused)\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneLiteralExpression = (\n column: string,\n expression: LiteralExpressionToken,\n operator: ComparisonOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n _attributesToColumns: ModelKeysContract,\n _primaryKey: string,\n _tableName: string,\n _allowedColumns?: string[] | undefined\n) => {\n let value = expression.value\n if (value === null) {\n /*\n |--------------------------------------------------------------------------\n | Treat null values as empty strings or zero depending on the operator\n |--------------------------------------------------------------------------\n */\n switch (operator.operator) {\n case ':':\n case ':=':\n query.where((sub) => {\n sub.whereNull(column)\n sub.orWhere(column, '=', '')\n sub.orWhere(column, '=', 0)\n })\n break\n case ':<':\n query.where(column, '<', 0)\n break\n case ':<=':\n query.where(column, '<=', 0)\n break\n case ':>':\n query.where(column, '>', 0)\n break\n case ':>=':\n query.where(column, '>=', 0)\n break\n }\n return\n }\n if ('string' === typeof value && expression.quoted) {\n /*\n |--------------------------------------------------------------------------\n | Strip quotes from the value because they are not needed\n |--------------------------------------------------------------------------\n */\n if (expression.quotes === 'double') {\n value = value.replace(/^\"/g, '').replace(/\"$/g, '')\n } else if (expression.quotes === 'single') {\n value = value.replace(/^'/g, '').replace(/'$/g, '')\n }\n }\n switch (typeof value) {\n case 'string':\n switch (operator.operator) {\n case ':':\n case ':=':\n query.where((sub) => {\n sub.where(column, '=', value)\n sub.orWhere(column, 'like', value)\n })\n break\n case ':<':\n query.where(column, '<', value)\n break\n case ':<=':\n query.where(column, '<=', value)\n break\n case ':>':\n query.where(column, '>', value)\n break\n case ':>=':\n query.where(column, '>=', value)\n break\n }\n break\n case 'number':\n switch (operator.operator) {\n case ':':\n case ':=':\n query.where(column, '=', value)\n break\n case ':<':\n query.where(column, '<', value)\n break\n case ':<=':\n query.where(column, '<=', value)\n break\n case ':>':\n query.where(column, '>', value)\n break\n case ':>=':\n query.where(column, '>=', value)\n break\n }\n break\n case 'boolean':\n switch (operator.operator) {\n case ':':\n case ':=':\n query.where(column, '=', value)\n break\n case ':<':\n query.where(column, '<', value)\n break\n /* v8 ignore next 3 */\n case ':<=':\n query.where(column, '<=', value)\n break\n case ':>':\n query.where(column, '>', value)\n break\n case ':>=':\n query.where(column, '>=', value)\n break\n }\n break\n }\n}\n\n/**\n * Applies a range expression to a database query for a specific column.\n * Converts Lucene range syntax to SQL BETWEEN operations with proper inclusive/exclusive handling.\n *\n * @template T - The result type for the query builder\n * @param column - The database column name to query\n * @param expression - The range expression containing min/max values and inclusivity flags\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param _attributesToColumns - Mapping of model attributes to database columns (unused)\n * @param _primaryKey - The primary key column name (unused)\n * @param _tableName - The table name (unused)\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneRangeExpression = (\n column: string,\n expression: RangeExpressionToken,\n operator: ComparisonOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n _attributesToColumns: ModelKeysContract,\n _primaryKey: string,\n _tableName: string,\n _allowedColumns?: string[] | undefined\n) => {\n const comparableMin = expression.range.minInclusive\n ? expression.range.min\n : expression.range.min + 1\n const comparableMax = expression.range.maxInclusive\n ? expression.range.max\n : expression.range.max - 1\n switch (operator.operator) {\n case ':':\n case ':=':\n query.whereBetween(column, [comparableMin, comparableMax])\n break\n }\n}\n\n/**\n * Applies a regex expression to a database query for a specific column.\n * Converts regex patterns to SQL LIKE patterns with proper escaping.\n * Transforms * to % and ? to _ for SQL pattern matching.\n *\n * @template T - The result type for the query builder\n * @param column - The database column name to query\n * @param expression - The regex expression containing the pattern\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param _attributesToColumns - Mapping of model attributes to database columns (unused)\n * @param _primaryKey - The primary key column name (unused)\n * @param _tableName - The table name (unused)\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneRegexExpression = (\n column: string,\n expression: RegexExpressionToken,\n operator: ComparisonOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n _attributesToColumns: ModelKeysContract,\n _primaryKey: string,\n _tableName: string,\n _allowedColumns?: string[] | undefined\n) => {\n let value = expression.value\n /*\n |--------------------------------------------------------------------------\n | Escape any instances of `%` and `_` in the regex value\n |--------------------------------------------------------------------------\n */\n value = value.replace(/%/g, '\\\\%').replace(/_/g, '\\\\_')\n /*\n |--------------------------------------------------------------------------\n | Replace \"*\" with \"%\" and \"?\" with \"_\"\n |--------------------------------------------------------------------------\n */\n value = value.replace(/\\*/g, '%').replace(/\\?/g, '_')\n switch (operator.operator) {\n case ':':\n case ':=':\n query.whereLike(column, value)\n break\n }\n}\n\n/**\n * Applies an implicit field AST node to a database query.\n * Implicit fields use the primary key column when no specific field is specified.\n *\n * @template T - The result type for the query builder\n * @param _field - The implicit field token (unused)\n * @param expression - The expression to apply to the primary key column\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name to use for implicit fields\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneImplicitFieldAst = (\n _field: ImplicitFieldToken,\n expression: ExpressionToken,\n operator: ComparisonOperatorToken | undefined,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n const columnName = primaryKey\n if (allowedColumns && !allowedColumns.includes(columnName)) {\n /* v8 ignore next */\n return\n }\n\n // Default operator for implicit fields when none is provided\n const defaultOperator: ComparisonOperatorToken = operator || {\n operator: ':',\n type: 'ComparisonOperator',\n location: { start: 0, end: 0 },\n }\n\n switch (expression.type) {\n /* v8 ignore next 13 */\n case 'EmptyExpression':\n applyLuceneEmptyExpression(\n columnName,\n expression,\n defaultOperator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'LiteralExpression':\n applyLuceneLiteralExpression(\n columnName,\n expression,\n defaultOperator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'RangeExpression':\n applyLuceneRangeExpression(\n columnName,\n expression,\n defaultOperator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'RegexExpression':\n applyLuceneRegexExpression(\n columnName,\n expression,\n defaultOperator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n }\n}\n\n/**\n * Applies a field AST node to a database query.\n * Maps the field name to the corresponding database column and applies the expression.\n *\n * @template T - The result type for the query builder\n * @param field - The field token containing the field name\n * @param expression - The expression to apply to the mapped column\n * @param operator - The comparison operator token\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneFieldAst = (\n field: FieldToken,\n expression: ExpressionToken,\n operator: ComparisonOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n const columnName = attributesToColumns.get(field.name)\n if (!columnName || (allowedColumns && !allowedColumns.includes(field.name))) {\n return\n }\n switch (expression.type) {\n case 'EmptyExpression':\n applyLuceneEmptyExpression(\n columnName,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'LiteralExpression':\n applyLuceneLiteralExpression(\n columnName,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'RangeExpression':\n applyLuceneRangeExpression(\n columnName,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'RegexExpression':\n applyLuceneRegexExpression(\n columnName,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n }\n}\n\n/**\n * Applies a tag AST node to a database query.\n * Tags represent field:expression pairs in Lucene syntax.\n * Delegates to either implicit field or explicit field handlers based on the field type.\n *\n * @template T - The result type for the query builder\n * @param ast - The tag AST node containing field, expression, and operator\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneTagAst = (\n ast: TagToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n const { expression, field, operator } = ast\n switch (field.type) {\n case 'ImplicitField':\n applyLuceneImplicitFieldAst(\n field,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n\n case 'Field':\n applyLuceneFieldAst(\n field,\n expression,\n operator,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n }\n}\n\n/**\n * Applies a unary operator AST node to a database query.\n * Handles NOT and negation (-) operators by wrapping the operand in a WHERE NOT clause.\n *\n * @template T - The result type for the query builder\n * @param ast - The unary operator AST node containing operator and operand\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n */\nexport const applyLuceneUnaryOperatorAst = (\n ast: UnaryOperatorToken,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n) => {\n const operator = ast.operator\n\n if (operator === 'NOT' || operator === '-') {\n query.whereNot((subQuery) => {\n applyLuceneAst(\n ast.operand,\n subQuery,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n })\n /* v8 ignore next 13 */\n } else {\n query.where((subQuery) => {\n applyLuceneAst(\n ast.operand,\n subQuery,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n })\n }\n}\n\n/**\n * Applies any Lucene AST node to a database query.\n * This is the main dispatcher function that routes different AST node types\n * to their appropriate handler functions.\n *\n * @template T - The result type for the query builder\n * @param ast - The AST node to apply\n * @param query - The database query builder to modify\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name\n * @param tableName - The table name\n * @param allowedColumns - Optional array of allowed column names for filtering\n * @param throwOnInvalidType - Whether to throw an error for unrecognized AST node types\n */\nexport const applyLuceneAst = (\n ast: ParserAst,\n query: LuceneFilteredDatabaseQueryBuilderContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns: string[] | undefined,\n throwOnInvalidType: boolean = false\n) => {\n switch (ast.type) {\n case 'EmptyExpression':\n applyLuceneEmptyExpressionAst(\n ast,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'LogicalExpression':\n applyLuceneLogicalExpressionAst(\n ast,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'ParenthesizedExpression':\n applyLuceneParenthesizedExpressionAst(\n ast,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n case 'Tag':\n applyLuceneTagAst(ast, query, attributesToColumns, primaryKey, tableName, allowedColumns)\n break\n case 'UnaryOperator':\n applyLuceneUnaryOperatorAst(\n ast,\n query,\n attributesToColumns,\n primaryKey,\n tableName,\n allowedColumns\n )\n break\n /* v8 ignore next 5 */\n default:\n if (throwOnInvalidType) {\n throw new E_LUCENE_INVALID_TYPE((ast as any).type)\n }\n break\n }\n}\n\n/**\n * Converts a Lucene query string to a Lucid database query builder.\n * Parses the Lucene syntax and applies the resulting AST to generate SQL conditions.\n *\n * @template T - The result type for the query builder\n * @param luceneQuery - The Lucene query string to parse and convert\n * @param connection - The database connection client for creating queries\n * @param attributesToColumns - Mapping of model attributes to database columns\n * @param primaryKey - The primary key column name for implicit field queries\n * @param tableName - The database table name to query\n * @param allowedColumns - Optional array of allowed column names for security filtering\n * @returns A database query builder with the Lucene conditions applied\n * @throws {E_LUCENE_SYNTAX_EXCEPTION} When the Lucene query has syntax errors\n * @throws {E_LUCENE_UNEXPECTED_EXCEPTION} When an unexpected error occurs during parsing\n * @throws {E_LUCENE_INVALID_TYPE} When an unrecognized AST node type is encountered\n */\nexport const luceneToLucid = (\n luceneQuery: string,\n connection: QueryClientContract,\n attributesToColumns: ModelKeysContract,\n primaryKey: string,\n tableName: string,\n allowedColumns?: string[] | undefined\n): LuceneFilteredDatabaseQueryBuilderContract => {\n let parsed: LiqeQuery\n try {\n parsed = parse(luceneQuery)\n } catch (error) {\n if (error instanceof SyntaxError) {\n throw new E_LUCENE_SYNTAX_EXCEPTION(error)\n }\n /* v8 ignore next 2 */\n throw new E_LUCENE_UNEXPECTED_EXCEPTION(error)\n }\n const query: LuceneFilteredDatabaseQueryBuilderContract = connection.query().from(tableName)\n applyLuceneAst(parsed, query, attributesToColumns, primaryKey, tableName, allowedColumns, true)\n return query\n}\n","var o = Object.defineProperty;\nvar a = (t, s, r) => s in t ? o(t, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[s] = r;\nvar n = (t, s, r) => a(t, typeof s != \"symbol\" ? s + \"\" : s, r);\nconst u = \"1.20250430.0\";\nclass l {\n /**\n * Creates a new TypedEventEmitter instance.\n */\n constructor() {\n /**\n * The internal event listener map for the emitter.\n */\n n(this, \"e\");\n this.e = {};\n }\n /**\n * Subscribe to an event with a typed listener.\n * @param event - The event name.\n * @param listener - The listener function.\n * @param ctx - The `this` context to apply to the listener when it is called\n * @returns the current instance for chaining\n */\n on(s, r, i) {\n return Array.isArray(this.e[s]) || (this.e[s] = []), this.e[s].push({\n fn: r,\n ctx: i || null\n }), this;\n }\n /**\n * Subscribe to an event once with a typed listener.\n * @param event - The event name.\n * @param listener - The listener function.\n * @param ctx - The `this` context to apply to the listener when it is called\n * @returns the current instance for chaining\n */\n once(s, r, i) {\n const f = this;\n function h() {\n r.apply(i || null, arguments), f.off(s, h);\n }\n return h._ = r, this.on(s, h, i);\n }\n /**\n * Emit an event.\n * @param event - The event name.\n * @param args - The arguments to pass to the listeners.\n * @returns the current instance for chaining\n */\n emit(s, ...r) {\n const i = this.e[s];\n return Array.isArray(i) && i.forEach((f) => {\n f.fn.apply(f.ctx || null, r);\n }), this;\n }\n /**\n * Unsubscribe from an event.\n * @param event - The event name.\n * @param listener - Optional. The listener function to remove.\n * @returns the current instance for chaining\n *\n * @remarks When no listener is provided, all listeners for the event will be removed, otherwise\n * only the specified listener will be removed.\n */\n off(s, r) {\n return Array.isArray(this.e[s]) && (r ? this.e[s] = this.e[s].filter(\n // @ts-ignore\n (i) => i.fn !== r && i.fn._ !== r\n ) : this.e[s] = []), this;\n }\n}\nexport {\n l as TypedEventEmitter,\n u as version\n};\n//# sourceMappingURL=index.mjs.map\n","/*\n|--------------------------------------------------------------------------\n| Mixin for Lucid Models\n|--------------------------------------------------------------------------\n|\n| Adds the required metadata and functionality to Lucid models\n| which will be utilized by the resourceful controller & factory\n*/\nimport * as helpers from './helpers'\nimport { default as pMap } from 'p-map'\nimport * as guards from './type_guards'\nimport { joi } from '@nhtio/lucid-resourceful/joi'\nimport { luceneToLucid } from './lucene_to_lucid_translator'\nimport { TypedEventEmitter } from '@nhtio/tiny-typed-emitter'\nimport { ACLOperationsEnum, CRUDOperationsEnum } from './constants'\nimport { operationCRUDToACL, isString, isFunction, prepareFields } from './utils'\nimport {\n E_FORBIDDEN,\n E_INVALID_COLUMN_ACCESS,\n E_INVALID_RESOURCEFUL_MIXIN_OPTIONS,\n E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION,\n E_MISSING_PRIMARY_KEY_EXCEPTION,\n E_RECORD_NOT_FOUND_EXCEPTION,\n E_INVALID_PAYLOAD_EXCEPTION,\n E_FORBIDDEN_PAYLOAD_EXCEPTION,\n} from '@nhtio/lucid-resourceful/errors'\nimport {\n ResourcefulArrayType,\n ResourcefulBigintType,\n ResourcefulBinaryType,\n ResourcefulBooleanType,\n ResourcefulDateTimeType,\n ResourcefulDateType,\n ResourcefulIntegerType,\n ResourcefulNumberType,\n ResourcefulObjectType,\n ResourcefulStringType,\n ResourcefulUnsignedIntegerType,\n} from '@nhtio/lucid-resourceful/definitions'\nimport type { BaseModel } from '@adonisjs/lucid/orm'\nimport type { HttpContext } from '@adonisjs/core/http'\nimport type { ApplicationService } from '@adonisjs/core/types'\nimport type { AnySchema, ObjectSchema, ValidationError } from 'joi'\nimport type { EventMap, Key, Listener } from '@nhtio/tiny-typed-emitter'\nimport type { NormalizeConstructor } from '@adonisjs/core/types/helpers'\nimport type { DatabaseQueryBuilderContract } from '@adonisjs/lucid/types/querybuilder'\nimport type {\n ComputedOptions,\n LucidModel,\n ModelColumnOptions,\n ModelObject,\n} from '@adonisjs/lucid/types/model'\nimport type {\n ExternalDocumentationObject,\n PromiseAble,\n ResourcefulAccessControlFilter,\n ResourcefulColumnDefinition,\n ResourcefulComputedAccessorDefinition,\n ResourcefulDataType,\n ResourcefulGeneralAccessControlFilter,\n ResourcefulModelColumnMetaSchema,\n ResourcefulModelComputedAccessorMetaSchema,\n ResourcefulModelMetaSchema,\n ResourcefulModelOpenApiRelatedSchema,\n ResourcefulModelOpenApiSchema,\n ResourcefulModelRelationshipMetaSchema,\n ResourcefulPropertySchema,\n ResourcefulRelationshipDefinition,\n ResourcefulResourceAccessControlFilter,\n ValidationScoper,\n ResourcefulModelSerializableAttributes,\n} from '@nhtio/lucid-resourceful/types'\n\n/**\n * Result object returned by the resourceful index/list operation.\n *\n * Contains paginated records along with metadata about the query execution\n * and pagination state. The records are filtered according to field-level\n * access control and only contain the requested fields.\n *\n * @template ReturnType - The shape of records after field selection and ACL filtering\n */\nexport interface ResourcefulIndexResult<ReturnType = any> {\n /** Array of records with only the requested and accessible fields */\n records: Array<Partial<ReturnType>>\n /** Total number of records matching the filter (before pagination) */\n total: number\n /** The current page number (1-based) */\n page: number\n /** Number of records per page */\n perPage: number\n /** SQL query string used for counting total records */\n countQuery: string\n /** SQL query string used for fetching the paginated records */\n recordsQuery: string\n}\n\n/**\n * Function type for generating payload validation schemas based on request context.\n *\n * These functions are called during create and update operations to generate\n * context-specific validation schemas using Joi. They provide the core model-level\n * validation that applies regardless of request-specific hooks.\n *\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @returns Promise resolving to a Joi schema for validating the request payload\n */\nexport interface ResourcefulPayloadValidatorGetter {\n (ctx: HttpContext, app: ApplicationService): PromiseAble<AnySchema>\n}\n\n/**\n * Function type for generating request-specific payload validation schemas.\n *\n * These functions are provided via hooks during create and update operations\n * to add additional validation constraints beyond the base model validation.\n * They enable request-specific validation logic based on context.\n *\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @returns Promise resolving to a Joi ObjectSchema for additional validation, or null to skip\n */\nexport interface ResourcefulPayloadSchemaGetter {\n (ctx: HttpContext, app: ApplicationService): PromiseAble<ObjectSchema | null>\n}\n\n/**\n * Function type for applying query-level scoping to database queries.\n *\n * These callbacks are applied to queries during CRUD operations to enforce\n * data access boundaries based on request context. They modify the query\n * in-place by adding WHERE clauses, JOINs, or other constraints.\n *\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param query - Database query builder to modify with scoping constraints\n * @returns Promise that resolves when the query has been modified\n */\nexport interface ResourcefulQueryScopeCallback {\n (\n ctx: HttpContext,\n app: ApplicationService,\n query: DatabaseQueryBuilderContract\n ): PromiseAble<void>\n}\n\n/**\n * Array of query scope callback functions.\n *\n * Used for operations that need to apply query-level scoping (index, read, delete).\n * Callbacks are applied in sequence to build up the complete set of access constraints.\n */\nexport type ResourcefulScopeHooks = ResourcefulQueryScopeCallback[]\n\n/**\n * Array of payload validation schema getter functions.\n *\n * Used for operations that accept request payloads (create, update).\n * Each function can return additional validation constraints based on request context.\n */\nexport type ResourcefulValidationHooks = ResourcefulPayloadSchemaGetter[]\n\n/**\n * Combined hook interface providing both query scoping and payload validation.\n *\n * Used by the update operation which needs both query scoping (to find the record)\n * and payload validation (to validate the update data).\n */\nexport interface ResourcefulHooks {\n /** Query scope callbacks for constraining database queries */\n queryScopeCallbacks: ResourcefulScopeHooks\n /** Payload validation schema getters for additional validation */\n payloadValidationSchemas: ResourcefulValidationHooks\n}\n\nexport type ResourcefulMixinEventMap<\n Model extends LucidModel = LucidModel,\n ModelInstance = InstanceType<Model>,\n> = EventMap<{\n 'acl:error': [unknown, HttpContext, ApplicationService, ModelInstance | undefined]\n 'validation:scope:error': [unknown, HttpContext, ApplicationService, string, ResourcefulDataType]\n}>\n\n/**\n * Enhanced Lucid model interface providing resourceful CRUD functionality.\n *\n * This interface extends the base LucidModel with metadata-driven CRUD operations,\n * field-level access control, query scoping, OpenAPI schema generation, and event\n * handling capabilities. Models implementing this interface gain static methods\n * for handling HTTP requests with built-in validation, pagination, filtering,\n * and comprehensive security features.\n *\n * The interface defines both metadata storage properties and operational methods\n * that work together to provide a complete resourceful API layer on top of\n * AdonisJS Lucid ORM models.\n *\n * @extends LucidModel\n *\n * @example\n * ```typescript\n * import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'\n * import { withResourceful, resourceful } from 'lucid-resourceful'\n *\n * class User extends withResourceful()(BaseModel) implements ResourcefulModel {\n * @column({ isPrimary: true })\n * @resourceful({ type: 'number', nullable: false })\n * public id: number\n *\n * @column()\n * @resourceful({ type: 'string', nullable: false })\n * public name: string\n *\n * // Automatically gains all ResourcefulModel methods\n * // User.$onResourcefulIndex, User.$onResourcefulRead, etc.\n * }\n * ```\n */\nexport interface ResourcefulModel extends LucidModel {\n /** The display name for this model used in API documentation and error messages */\n $resourcefulName: string\n\n /** Optional description for OpenAPI schema documentation */\n $resourcefulMetaDescription?: string\n\n /** Optional external documentation reference for OpenAPI schema */\n $resourcefulMetaExternalDocs?: ExternalDocumentationObject\n\n /** Optional example value for OpenAPI schema documentation */\n $resourcefulMetaExample?: string\n\n /** Map of column property names to their resourceful metadata definitions */\n $resourcefulColumns: Map<string, ResourcefulColumnDefinition<ResourcefulPropertySchema>>\n\n /** Map of relationship property names to their resourceful metadata definitions */\n $resourcefulRelationships: Map<string, ResourcefulRelationshipDefinition>\n\n /** Map of computed accessor property names to their resourceful metadata definitions */\n $resourcefulComputedAccessors: Map<\n string,\n ResourcefulComputedAccessorDefinition<ResourcefulPropertySchema>\n >\n\n /** Access control filter functions organized by CRUD operation type */\n $resourcefulAccessControlFilters: ResourcefulMixinOptions['accessControlFilters']\n\n /** Error handling strategy when ACL evaluation fails */\n $resourcefulOnACLError: ResourcefulMixinOptions['onACLError']\n\n /** Query scope callback functions for constraining database queries */\n $resourcefulQueryScopeCallbacks: ResourcefulMixinOptions['queryScopeCallbacks']\n\n /** Payload validation schema builder functions for create and update operations */\n $resourcefulPayloadValidationSchemaBuilders: ResourcefulMixinOptions['payloadValidationSchemaBuilders']\n\n /**\n * Registers an event listener for resourceful model events.\n *\n * This method provides a way to listen for events emitted during resourceful\n * operations such as ACL errors or validation scope errors. Useful for logging,\n * monitoring, or implementing custom error handling logic.\n *\n * @template K - The event key type from the resourceful event map\n * @param event - The name of the event to listen for ('acl:error', 'validation:scope:error')\n * @param listener - Function to call when the event is emitted\n * @returns The model class for method chaining\n *\n * @example\n * ```typescript\n * User.$onResourcefulEvent('acl:error', (error, ctx, app, instance) => {\n * console.error('ACL error occurred:', error);\n * });\n * ```\n */\n $onResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<ResourcefulModel>>,\n listener: Listener<K, ResourcefulMixinEventMap<ResourcefulModel>>\n ): this\n\n /**\n * Registers a one-time event listener for resourceful model events.\n *\n * Similar to $onResourcefulEvent but the listener is automatically removed\n * after being called once. Useful for handling events that should only\n * trigger a single response.\n *\n * @template K - The event key type from the resourceful event map\n * @param event - The name of the event to listen for\n * @param listener - Function to call when the event is emitted\n * @returns The model class for method chaining\n *\n * @example\n * ```typescript\n * User.$onceResourcefulEvent('validation:scope:error', (error, ctx, app, key, datatype) => {\n * console.warn('Validation scope error (one-time):', error);\n * });\n * ```\n */\n $onceResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<ResourcefulModel>>,\n listener: Listener<K, ResourcefulMixinEventMap<ResourcefulModel>>\n ): this\n\n /**\n * Removes an event listener for resourceful model events.\n *\n * Unregisters a previously registered event listener. If no listener is\n * provided, all listeners for the specified event are removed.\n *\n * @template K - The event key type from the resourceful event map\n * @param event - The name of the event to stop listening for\n * @param listener - Optional specific listener function to remove\n * @returns The model class for method chaining\n *\n * @example\n * ```typescript\n * // Remove specific listener\n * User.$offResourcefulEvent('acl:error', myErrorHandler);\n *\n * // Remove all listeners for an event\n * User.$offResourcefulEvent('acl:error');\n * ```\n */\n $offResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<ResourcefulModel>>,\n listener?: Listener<K, ResourcefulMixinEventMap<ResourcefulModel>>\n ): this\n\n /**\n * Performs paginated listing and searching of model records with comprehensive filtering.\n *\n * This method provides the core implementation for resourceful index/list operations,\n * supporting pagination, field selection, access control, and Lucene query syntax for\n * filtering. It validates all inputs, applies ACL filters, executes the query with\n * proper field mapping between serialized names and database columns, and returns\n * structured results with query metadata.\n *\n * @template SelectedFields - Array of field names that can be selected from the model's serializable attributes\n * @template ReturnType - The resulting type after picking the selected fields from the model's serializable attributes\n *\n * @param filter - Lucene-style query string for filtering records (e.g., \"name:john AND email:*.com\").\n * If null or undefined, defaults to empty string (no filtering).\n * @param page - The page number for pagination (must be ≥ 1). Used with perPage to calculate offset.\n * @param perPage - Number of records per page (must be ≥ 1 and ≤ 100 by default).\n * @param fields - Array of field names to include in the response. If null, undefined, or empty,\n * defaults to just the primary key field. Field names should use serialized names\n * (as they appear in API responses), not database column names.\n * @param ctx - HTTP context containing request information, authentication, and other request-scoped data.\n * @param app - Application service instance providing access to application-level services and configuration.\n * @param hooks - Optional array of query scope callbacks to apply additional filtering constraints.\n *\n * @returns Promise resolving to ResourcefulIndexResult containing:\n * - `records`: Array of partial record objects with only the requested fields\n * - `total`: Total number of records matching the filter (before pagination)\n * - `page`: The requested page number (echoed back)\n * - `perPage`: The requested per-page limit (echoed back)\n * - `countQuery`: SQL query string used for counting total records\n * - `recordsQuery`: SQL query string used for fetching the actual records\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n * @throws {E_INVALID_COLUMN_ACCESS} When no fields are available for access after ACL filtering\n * @throws {E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION} When input validation fails\n *\n * @example\n * ```typescript\n * // Basic usage with pagination\n * const result = await User.$onResourcefulIndex(\n * 'name:john',\n * 1,\n * 10,\n * ['id', 'name', 'email'],\n * ctx,\n * app\n * );\n *\n * // Complex filtering with date ranges\n * const result = await User.$onResourcefulIndex(\n * 'name:john AND createdAt:[2021-01-01T00:00:00Z TO 2021-12-31T23:59:59Z]',\n * 2,\n * 25,\n * ['id', 'name', 'createdAt'],\n * ctx,\n * app\n * );\n * ```\n */\n $onResourcefulIndex<\n SelectedFields extends Array<\n keyof ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>\n >,\n SelectedSingleField extends keyof ResourcefulModelSerializableAttributes<\n InstanceType<LucidModel>\n >,\n ReturnType = Pick<\n ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>,\n SelectedFields[number]\n >,\n >(\n filter: string | null | undefined,\n page: number,\n perPage: number,\n fields: SelectedFields | SelectedSingleField | null | undefined,\n sort:\n | Array<\n [\n Extract<keyof ResourcefulModelSerializableAttributes<InstanceType<LucidModel>>, string>,\n 'asc' | 'desc',\n ]\n >\n | null\n | undefined,\n ctx: HttpContext,\n app: ApplicationService,\n hooks?: ResourcefulScopeHooks\n ): Promise<ResourcefulIndexResult<ReturnType>>\n\n /**\n * Retrieves a single model record by its unique identifier with access control.\n *\n * This method implements secure record retrieval by first applying query scope callbacks\n * to verify the record exists within the user's access scope, then fetching the full\n * model instance for field-level ACL evaluation. Only fields that pass ACL checks\n * are included in the response.\n *\n * @param uid - The unique identifier of the record to retrieve\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional array of query scope callbacks to apply additional filtering constraints\n *\n * @returns Promise resolving to the record object with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n *\n * @example\n * ```typescript\n * // Retrieve a user by ID\n * const user = await User.$onResourcefulRead(123, ctx, app);\n *\n * // With additional query scoping\n * const user = await User.$onResourcefulRead(123, ctx, app, [\n * (ctx, app, query) => query.where('tenant_id', ctx.auth.user.tenantId)\n * ]);\n * ```\n */\n $onResourcefulRead(\n uid: number,\n ctx: HttpContext,\n app: ApplicationService,\n hooks?: ResourcefulScopeHooks\n ): Promise<any>\n\n /**\n * Creates a new model record with payload validation and access control.\n *\n * This method handles secure record creation by validating the request payload\n * against both model-level and request-specific validation schemas, checking\n * field-level write permissions, and returning the created record with appropriate\n * field filtering applied.\n *\n * @param payload - The data object containing field values for the new record\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional array of validation schema getters for additional payload validation\n *\n * @returns Promise resolving to the created record with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_INVALID_PAYLOAD_EXCEPTION} When core model validation fails\n * @throws {E_FORBIDDEN_PAYLOAD_EXCEPTION} When request-specific validation fails\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n *\n * @example\n * ```typescript\n * // Create a new user\n * const user = await User.$onResourcefulCreate({\n * name: 'John Doe',\n * email: 'john@example.com'\n * }, ctx, app);\n *\n * // With additional validation\n * const user = await User.$onResourcefulCreate(payload, ctx, app, [\n * (ctx, app) => joi.object({ email: joi.string().domain('company.com') })\n * ]);\n * ```\n */\n $onResourcefulCreate(\n payload: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks?: ResourcefulValidationHooks\n ): Promise<any>\n\n /**\n * Updates an existing model record with payload validation and access control.\n *\n * This method implements secure record updates by first verifying the record exists\n * and is accessible via the read operation, validating the update payload, checking\n * field-level write permissions, and returning the updated record with appropriate\n * field filtering applied.\n *\n * @param uid - The unique identifier of the record to update\n * @param payload - The data object containing field values to update\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional object containing query scope callbacks and validation schema getters\n *\n * @returns Promise resolving to the updated record with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_INVALID_PAYLOAD_EXCEPTION} When core model validation fails\n * @throws {E_FORBIDDEN_PAYLOAD_EXCEPTION} When request-specific validation fails\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n *\n * @example\n * ```typescript\n * // Update a user\n * const user = await User.$onResourcefulUpdate(123, {\n * name: 'Jane Doe'\n * }, ctx, app);\n *\n * // With additional scoping and validation\n * const user = await User.$onResourcefulUpdate(123, payload, ctx, app, {\n * queryScopeCallbacks: [(ctx, app, query) => query.where('active', true)],\n * payloadValidationSchemas: [(ctx, app) => customValidationSchema]\n * });\n * ```\n */\n $onResourcefulUpdate(\n uid: number,\n payload: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks?: Partial<ResourcefulHooks>\n ): Promise<any>\n\n /**\n * Deletes an existing model record with access control.\n *\n * This method implements secure record deletion by applying query scope callbacks\n * to verify the record exists within the user's access scope, checking delete\n * permissions via ACL filters, and then removing the record from the database.\n *\n * @param uid - The unique identifier of the record to delete\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional array of query scope callbacks to apply additional filtering constraints\n *\n * @returns Promise that resolves when the record has been successfully deleted\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_FORBIDDEN} When access is denied by model-level ACL filters\n *\n * @example\n * ```typescript\n * // Delete a user\n * await User.$onResourcefulDelete(123, ctx, app);\n *\n * // With additional query scoping\n * await User.$onResourcefulDelete(123, ctx, app, [\n * (ctx, app, query) => query.where('tenant_id', ctx.auth.user.tenantId)\n * ]);\n * ```\n */\n $onResourcefulDelete(\n uid: number,\n ctx: HttpContext,\n app: ApplicationService,\n hooks?: ResourcefulScopeHooks\n ): Promise<void>\n\n /**\n * Generates an OpenAPI schema object for this model with context-aware field filtering.\n *\n * This method creates a complete OpenAPI v3 schema representation of the model\n * by evaluating field-level access control permissions for the given request context.\n * Only fields that pass ACL checks are included in the generated schema, ensuring\n * that API documentation accurately reflects what data is accessible to the current user.\n *\n * The method processes all resourceful properties (columns, computed accessors, and\n * relationships) and converts them to their OpenAPI schema equivalents while respecting\n * access control constraints and applying proper type mappings.\n *\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n *\n * @returns Promise resolving to a complete OpenAPI schema object with:\n * - `type`: Always 'object' for model schemas\n * - `title`: The model's resourceful name\n * - `description`: Optional model description from metadata\n * - `properties`: Object containing schema definitions for accessible fields\n * - `required`: Array of required field names (non-nullable fields)\n * - `externalDocs`: Optional external documentation reference\n * - `example`: Optional example value for the schema\n *\n * @example\n * ```typescript\n * // Generate OpenAPI schema for current user context\n * const schema = await User.$asOpenApiSchemaObject(ctx, app);\n *\n * // Result structure:\n * {\n * type: 'object',\n * title: 'User',\n * properties: {\n * id: { type: 'number', readOnly: true },\n * name: { type: 'string' },\n * email: { type: 'string', format: 'email' }\n * },\n * required: ['id', 'name', 'email']\n * }\n * ```\n *\n * @see {@link ResourcefulModelOpenApiSchema} for the complete schema structure\n */\n $asOpenApiSchemaObject(\n ctx: HttpContext,\n app: ApplicationService\n ): Promise<ResourcefulModelOpenApiSchema>\n}\n\nexport const ResourcefulErrorHandlerMethod = ['bubble', 'pass', 'fail'] as const\nexport type ResourcefulErrorHandlerMethod = (typeof ResourcefulErrorHandlerMethod)[number]\nexport const ResourcefulACLOperationType = ['read', 'write'] as const\nexport type ResourcefulACLOperationType = (typeof ResourcefulACLOperationType)[number]\n\ntype ResourcefulCheckAccessOptions<\n Model extends LucidModel = LucidModel,\n ResourcefulModelInstance = InstanceType<Model>,\n> = { ctx: HttpContext; app: ApplicationService } & (\n | { operation: CRUDOperationsEnum.LIST | CRUDOperationsEnum.CREATE; instance?: undefined }\n | {\n operation: CRUDOperationsEnum.READ | CRUDOperationsEnum.UPDATE | CRUDOperationsEnum.DELETE\n instance: ResourcefulModelInstance\n }\n)\n\nexport interface AdvancedResourcefulMixinOptions {\n propertyEvaluationConcurrency: number\n aclEvaluationConcurrency: number\n}\n\nexport interface ResourcefulMixinOptions<\n Model extends LucidModel = LucidModel,\n ModelInstance = InstanceType<Model>,\n> {\n name: string\n readRequiredForWrite: boolean\n accessControlFilters: {\n list: ResourcefulGeneralAccessControlFilter[]\n create: ResourcefulGeneralAccessControlFilter[]\n read: ResourcefulResourceAccessControlFilter<Model, ModelInstance>[]\n update: ResourcefulResourceAccessControlFilter<Model, ModelInstance>[]\n delete: ResourcefulResourceAccessControlFilter<Model, ModelInstance>[]\n }\n payloadValidationSchemaBuilders: {\n create: ResourcefulPayloadValidatorGetter[]\n update: ResourcefulPayloadValidatorGetter[]\n }\n onACLError: ResourcefulErrorHandlerMethod\n onValidationScopeError: ResourcefulErrorHandlerMethod\n queryScopeCallbacks: {\n list: ResourcefulQueryScopeCallback[]\n access: ResourcefulQueryScopeCallback[]\n }\n description?: string\n externalDocs?: ExternalDocumentationObject\n example?: string\n advanced: AdvancedResourcefulMixinOptions\n}\n\ntype ResourcefulCheckAccessReturn =\n | {\n isForbidden: true\n message: string\n allowedFieldsMap?: undefined\n allowedColumnsMap?: undefined\n }\n | {\n isForbidden: false\n message?: undefined\n allowedFieldsMap: Map<string, boolean>\n allowedColumnsMap: Map<string, boolean>\n }\n\nconst getFieldKey = (\n key: string,\n definition: ModelColumnOptions | ComputedOptions | ReturnType<LucidModel['$getRelation']>\n) => {\n if (isString(definition.serializeAs)) {\n return definition.serializeAs as string | null\n }\n return key\n}\n\nfunction StaticImplements<T>() {\n return (_t: T) => {}\n}\n\n/**\n * Creates a mixin that adds resourceful CRUD functionality to Lucid models.\n *\n * This function implements the mixin pattern to enhance AdonisJS Lucid models with\n * metadata-driven CRUD operations, field-level access control, query scoping,\n * and OpenAPI schema generation capabilities. The resulting model gains static\n * methods for handling HTTP requests with built-in validation, pagination,\n * filtering, and security features.\n *\n * The mixin validates and normalizes configuration options, creates isolated\n * metadata maps for each model class to prevent inheritance conflicts, and\n * establishes an event emitter for monitoring ACL and validation operations.\n *\n * @param options - Configuration object for customizing mixin behavior\n * @param options.name - Display name for the model (defaults to class name)\n * @param options.readRequiredForWrite - Whether read access is required before write operations\n * @param options.accessControlFilters - Object containing arrays of ACL filter functions for different operations\n * @param options.accessControlFilters.list - Filters applied during listing/search operations\n * @param options.accessControlFilters.create - Filters applied during record creation\n * @param options.accessControlFilters.read - Filters applied during record reading\n * @param options.accessControlFilters.update - Filters applied during record updates\n * @param options.accessControlFilters.delete - Filters applied during record deletion\n * @param options.onACLError - Error handling strategy when ACL evaluation fails ('throw', 'pass', 'fail')\n * @param options.onValidationScopeError - Error handling strategy when validation scope functions fail\n * @param options.queryScopeCallbacks - Object containing query scope callback functions\n * @param options.queryScopeCallbacks.list - Callbacks applied to listing/search queries\n * @param options.queryScopeCallbacks.access - Callbacks applied to individual record access queries\n * @param options.description - Optional description for OpenAPI documentation\n * @param options.externalDocs - Optional external documentation reference for OpenAPI\n * @param options.example - Optional example value for OpenAPI documentation\n * @param options.advanced - Advanced configuration options for performance tuning\n * @param options.advanced.propertyEvaluationConcurrency - Concurrency limit for property ACL evaluation\n * @param options.advanced.aclEvaluationConcurrency - Concurrency limit for ACL filter evaluation\n *\n * @returns A mixin function that accepts a Lucid model class and returns the enhanced model\n *\n * @throws {E_INVALID_RESOURCEFUL_MIXIN_OPTIONS} When the provided options fail validation\n *\n * @example\n * ```typescript\n * import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'\n * import { withResourceful, resourceful } from 'lucid-resourceful'\n *\n * class User extends withResourceful({\n * name: 'User',\n * readRequiredForWrite: true,\n * accessControlFilters: {\n * read: [(ctx) => ctx.auth.user?.id === ctx.params.id],\n * update: [(ctx) => ctx.auth.user?.isAdmin]\n * }\n * })(BaseModel) {\n * @column({ isPrimary: true })\n * @resourceful({ type: 'number', nullable: false })\n * public id: number\n *\n * @column()\n * @resourceful({ type: 'string', nullable: false })\n * public name: string\n * }\n *\n * // Generated controller with CRUD operations\n * const UserController = User.generateController()\n * ```\n *\n * @see {@link ResourcefulMixinOptions} for detailed configuration options\n * @see {@link ResourcefulModel} for the enhanced model interface\n */\nexport function withResourceful(\n options: Partial<ResourcefulMixinOptions> = {}\n): <Model extends NormalizeConstructor<typeof BaseModel>>(\n superclass: Model\n) => Model & ResourcefulModel {\n return <Model extends NormalizeConstructor<typeof BaseModel>>(\n superclass: Model\n ): Model & ResourcefulModel => {\n const optionsSchema = joi.object<ResourcefulMixinOptions>({\n name: joi.string().default(superclass.name),\n readRequiredForWrite: joi.boolean().default(false),\n accessControlFilters: joi\n .object({\n list: joi.array().items(joi.function()).default([]),\n create: joi.array().items(joi.function()).default([]),\n read: joi.array().items(joi.function()).default([]),\n update: joi.array().items(joi.function()).default([]),\n delete: joi.array().items(joi.function()).default([]),\n })\n .default({}),\n onACLError: joi\n .string()\n .valid(...ResourcefulErrorHandlerMethod)\n .default('throw'),\n onValidationScopeError: joi\n .string()\n .valid(...ResourcefulErrorHandlerMethod)\n .default('throw'),\n queryScopeCallbacks: joi\n .object({\n list: joi.array().items(joi.function()).default([]),\n access: joi.array().items(joi.function()).default([]),\n })\n .default({}),\n description: joi.string().optional(),\n externalDocs: joi\n .object<ExternalDocumentationObject>({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n advanced: joi\n .object<AdvancedResourcefulMixinOptions>({\n propertyEvaluationConcurrency: joi.number().integer().min(1).default(10),\n aclEvaluationConcurrency: joi.number().integer().min(1).default(2),\n })\n .default({\n propertyEvaluationConcurrency: 10,\n aclEvaluationConcurrency: 2,\n }),\n })\n\n const { error, value: validatedOptions } = optionsSchema.validate(options, {\n abortEarly: true,\n }) as { error?: ValidationError; value: ResourcefulMixinOptions<Model> }\n\n if (error) {\n throw new E_INVALID_RESOURCEFUL_MIXIN_OPTIONS(superclass.name, error)\n }\n\n // Ensure each class gets its own non-inherited static Maps\n const ensureOwnResourcefulMap = <T>(cls: any, key: string): Map<string, T> => {\n if (!Object.prototype.hasOwnProperty.call(cls, key) || !(cls[key] instanceof Map)) {\n return new Map()\n }\n return cls[key]\n }\n\n const resourcefulColumns = ensureOwnResourcefulMap<\n ResourcefulColumnDefinition<ResourcefulPropertySchema>\n >(superclass, '$resourcefulColumns')\n const resourcefulRelationships = ensureOwnResourcefulMap<ResourcefulRelationshipDefinition>(\n superclass,\n '$resourcefulRelationships'\n )\n const resourcefulComputedAccessors = ensureOwnResourcefulMap<\n ResourcefulComputedAccessorDefinition<ResourcefulPropertySchema>\n >(superclass, '$resourcefulComputedAccessors')\n\n const resourcefulModelEventEmitter = new TypedEventEmitter<\n ResourcefulMixinEventMap<Model & ResourcefulModel>\n >()\n\n StaticImplements<ResourcefulModel>()\n class ResourcefulModel extends superclass {\n declare static readonly $resourcefulName: string\n declare static $resourcefulMetaDescription?: string\n declare static $resourcefulMetaExternalDocs?: ExternalDocumentationObject\n declare static $resourcefulMetaExample?: string\n static $resourcefulColumns: Map<\n string,\n ResourcefulColumnDefinition<ResourcefulPropertySchema>\n > = resourcefulColumns\n static $resourcefulRelationships: Map<string, ResourcefulRelationshipDefinition> =\n resourcefulRelationships\n static $resourcefulComputedAccessors: Map<\n string,\n ResourcefulComputedAccessorDefinition<ResourcefulPropertySchema>\n > = resourcefulComputedAccessors\n declare static $resourcefulAccessControlFilters: ResourcefulMixinOptions['accessControlFilters']\n declare static $resourcefulOnACLError: ResourcefulMixinOptions['onACLError']\n declare static $resourcefulQueryScopeCallbacks: ResourcefulMixinOptions['queryScopeCallbacks']\n declare static $resourcefulPayloadValidationSchemaBuilders: ResourcefulMixinOptions['payloadValidationSchemaBuilders']\n\n static $onResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>,\n listener: Listener<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>\n ) {\n resourcefulModelEventEmitter.on(event, listener)\n return this\n }\n\n static $onceResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>,\n listener: Listener<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>\n ) {\n resourcefulModelEventEmitter.once(event, listener)\n return this\n }\n\n static $offResourcefulEvent<K>(\n event: Key<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>,\n listener?: Listener<K, ResourcefulMixinEventMap<Model & ResourcefulModel>>\n ) {\n resourcefulModelEventEmitter.off(event, listener)\n return this\n }\n\n protected static async $getAsResourcefulForContext(\n ctx: HttpContext,\n app: ApplicationService\n ): Promise<ResourcefulModelMetaSchema> {\n const resourcefulModelMetaSchema: ResourcefulModelMetaSchema = {\n name: validatedOptions.name,\n properties: {},\n description: this.$resourcefulMetaDescription,\n externalDocs: this.$resourcefulMetaExternalDocs,\n example: this.$resourcefulMetaExample,\n }\n await pMap(\n Array.from(this.$resourcefulColumns.entries()),\n async ([propertyKey, columnDefinition]) => {\n const lucidDefinitions = this.$getColumn(propertyKey)\n if (!lucidDefinitions) return\n const resourcefulModelColumnMetaSchema: ResourcefulModelColumnMetaSchema = {\n propertyKey,\n definition: columnDefinition,\n lucidDefinitions,\n ...(await this.$getPropertyCanReadWrite(\n ctx,\n app,\n propertyKey,\n lucidDefinitions,\n columnDefinition.readAccessControlFilters,\n columnDefinition.writeAccessControlFilters,\n 'column'\n )),\n kind: 'column',\n validator: this.$getPropertyValidator(\n ctx,\n app,\n propertyKey,\n columnDefinition.type,\n columnDefinition.nullable,\n columnDefinition.validationScopes as any,\n 'column'\n ),\n }\n if (\n !resourcefulModelColumnMetaSchema.canRead &&\n !resourcefulModelColumnMetaSchema.canWrite\n )\n return\n resourcefulModelMetaSchema.properties[propertyKey] = resourcefulModelColumnMetaSchema\n },\n {\n concurrency: validatedOptions.advanced.propertyEvaluationConcurrency,\n }\n )\n await pMap(\n Array.from(this.$resourcefulComputedAccessors.entries()),\n async ([propertyKey, computedAccessorDefinition]) => {\n const lucidDefinitions = this.$getComputed(propertyKey)\n if (!lucidDefinitions) return\n const resourcefulModelComputedAccessorMetaSchema: ResourcefulModelComputedAccessorMetaSchema =\n {\n propertyKey,\n definition: computedAccessorDefinition,\n lucidDefinitions,\n ...(await this.$getPropertyCanReadWrite(\n ctx,\n app,\n propertyKey,\n lucidDefinitions,\n computedAccessorDefinition.readAccessControlFilters,\n computedAccessorDefinition.writeAccessControlFilters,\n 'computedAccessor',\n computedAccessorDefinition.writable\n )),\n kind: 'computedAccessor',\n validator: this.$getPropertyValidator(\n ctx,\n app,\n propertyKey,\n computedAccessorDefinition.type,\n computedAccessorDefinition.nullable,\n computedAccessorDefinition.validationScopes as any,\n 'computedAccessor',\n computedAccessorDefinition.writable\n ),\n }\n if (\n !resourcefulModelComputedAccessorMetaSchema.canRead &&\n !resourcefulModelComputedAccessorMetaSchema.canWrite\n )\n return\n resourcefulModelMetaSchema.properties[propertyKey] =\n resourcefulModelComputedAccessorMetaSchema\n },\n {\n concurrency: validatedOptions.advanced.propertyEvaluationConcurrency,\n }\n )\n await pMap(\n Array.from(this.$resourcefulRelationships.entries()),\n async ([propertyKey, relationshipDefinition]) => {\n const lucidDefinitions = this.$getRelation(propertyKey)\n if (!lucidDefinitions) return\n const resourcefulModelRelationshipMetaSchema: ResourcefulModelRelationshipMetaSchema = {\n propertyKey,\n definition: relationshipDefinition,\n lucidDefinitions,\n ...(await this.$getPropertyCanReadWrite(\n ctx,\n app,\n propertyKey,\n lucidDefinitions,\n relationshipDefinition.readAccessControlFilters,\n relationshipDefinition.writeAccessControlFilters,\n 'relationship'\n )),\n kind: 'relationship',\n validator: joi.forbidden(),\n relatedModel: relationshipDefinition.relatedModel,\n }\n if (\n !resourcefulModelRelationshipMetaSchema.canRead &&\n !resourcefulModelRelationshipMetaSchema.canWrite\n )\n return\n resourcefulModelMetaSchema.properties[propertyKey] =\n resourcefulModelRelationshipMetaSchema\n },\n {\n concurrency: validatedOptions.advanced.propertyEvaluationConcurrency,\n }\n )\n return resourcefulModelMetaSchema\n }\n\n protected static $getPropertyValidator(\n ctx: HttpContext,\n app: ApplicationService,\n key: string,\n datatype: ResourcefulDataType,\n nullable: boolean,\n validationScopes: ValidationScoper<AnySchema>[] | undefined,\n kind: 'column' | 'computedAccessor' | 'relationship',\n writable: boolean = false\n ): AnySchema {\n if ('relationship' === kind || ('computedAccessor' === kind && !writable)) {\n // relationships and read-only computed accessors are not acceptable in a payload\n return joi.any().forbidden()\n }\n const baseValidator = this.$getPropertyBaseValidator(datatype, nullable, kind, writable)\n if (Array.isArray(validationScopes) && validationScopes.length > 0) {\n validationScopes.forEach((validationScope) => {\n try {\n validationScope(baseValidator)\n } catch (err) {\n resourcefulModelEventEmitter.emit(\n 'validation:scope:error',\n err,\n ctx,\n app,\n key,\n datatype\n )\n switch (validatedOptions.onValidationScopeError) {\n case 'bubble':\n throw err\n case 'pass':\n // do nothing, just pass the validation scope\n break\n case 'fail':\n return joi.any().forbidden()\n }\n }\n })\n }\n return baseValidator\n }\n\n protected static $getPropertyBaseValidator(\n datatype: ResourcefulDataType,\n nullable: boolean,\n kind: 'column' | 'computedAccessor' | 'relationship',\n writable: boolean = false\n ): AnySchema {\n if ('relationship' === kind || ('computedAccessor' === kind && !writable)) {\n // relationships and read-only computed accessors are not acceptable in a payload\n return joi.any().forbidden()\n }\n nullable = nullable || ('boolean' === typeof datatype.nullable && datatype.nullable)\n switch (true) {\n case datatype instanceof ResourcefulStringType: {\n const d: ResourcefulStringType = datatype as unknown as ResourcefulStringType\n const r = joi.string().min(d.minLength).max(d.maxLength)\n if (d.pattern) {\n r.pattern(new RegExp(d.pattern))\n }\n if (d.enum) {\n r.valid(...d.enum)\n }\n if (nullable) {\n r.allow(null)\n }\n return r\n }\n case datatype instanceof ResourcefulDateType: {\n /*\n |--------------------------------------------------------------------------\n | Dates are a subset of the 'string' type and thus the OpenAPI validator\n | does not have any specific options for them.\n |--------------------------------------------------------------------------\n |\n | const d: ResourcefulDateType = datatype as unknown as ResourcefulDateType\n |\n */\n const r = joi.date().iso()\n if (nullable) {\n r.allow(null)\n }\n return r\n }\n case datatype instanceof ResourcefulDateTimeType: {\n /*\n |--------------------------------------------------------------------------\n | DateTimes are a subset of the 'string' type and thus the OpenAPI validator\n | does not have any specific options for them.\n |--------------------------------------------------------------------------\n |\n | const d: ResourcefulDateTimeType = datatype as unknown as ResourcefulDateTimeType\n |\n */\n const r = joi.date().iso()\n if (nullable) {\n r.allow(null)\n }\n return r\n }\n case datatype instanceof ResourcefulBinaryType: {\n const d: ResourcefulBinaryType = datatype as unknown as ResourcefulBinaryType\n const r = joi.string()\n if (nullable) {\n r.allow(null)\n }\n if (d.minLength !== undefined) {\n r.min(d.minLength)\n }\n if (d.maxLength !== undefined) {\n r.max(d.maxLength)\n }\n return r\n }\n case datatype instanceof ResourcefulNumberType: {\n const d: ResourcefulNumberType = datatype as unknown as ResourcefulNumberType\n const r = joi.number()\n if (nullable) {\n r.allow(null)\n }\n r.multiple(d.multipleOf)\n if (d.exclusiveMaximum) {\n r.less(d.maximum)\n } else {\n r.max(d.maximum)\n }\n if (d.exclusiveMinimum) {\n r.greater(d.minimum)\n } else {\n r.min(d.minimum)\n }\n return r\n }\n case datatype instanceof ResourcefulIntegerType: {\n const d: ResourcefulIntegerType = datatype as unknown as ResourcefulIntegerType\n const r = joi.number()\n if (nullable) {\n r.allow(null)\n }\n r.integer().multiple(d.multipleOf)\n if (d.exclusiveMaximum) {\n r.less(d.maximum)\n } else {\n r.max(d.maximum)\n }\n if (d.exclusiveMinimum) {\n r.greater(d.minimum)\n } else {\n r.min(d.minimum)\n }\n return r\n }\n case datatype instanceof ResourcefulBigintType: {\n const d: ResourcefulBigintType = datatype as unknown as ResourcefulBigintType\n const r = joi.bigint()\n if (nullable) {\n r.allow(null)\n }\n r.multiple(d.multipleOf)\n if (d.exclusiveMaximum) {\n r.less(d.maximum)\n } else {\n r.max(d.maximum)\n }\n if (d.exclusiveMinimum) {\n r.greater(d.minimum)\n } else {\n r.min(d.minimum)\n }\n return r\n }\n case datatype instanceof ResourcefulUnsignedIntegerType: {\n const d: ResourcefulUnsignedIntegerType =\n datatype as unknown as ResourcefulUnsignedIntegerType\n const r = joi.number().unsafe()\n if (nullable) {\n r.allow(null)\n }\n r.integer().multiple(d.multipleOf)\n if (d.exclusiveMaximum) {\n r.less(d.maximum)\n } else {\n r.max(d.maximum)\n }\n if (d.exclusiveMinimum) {\n r.greater(d.minimum)\n } else {\n r.min(d.minimum)\n }\n return r\n }\n case datatype instanceof ResourcefulBooleanType: {\n const r = joi.boolean()\n if (nullable) {\n r.allow(null)\n }\n return r\n }\n case datatype instanceof ResourcefulObjectType: {\n const d: ResourcefulObjectType = datatype as unknown as ResourcefulObjectType\n\n // Add property validation based on the new structure with composition patterns\n const objectSchema: { [key: string]: AnySchema } = {}\n\n Object.entries(d.properties).forEach(([propKey, propDef]) => {\n let propValidator: AnySchema\n\n if ('oneOf' in propDef) {\n // oneOf composition\n const alternatives = propDef.oneOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n propValidator = joi.alternatives().try(...alternatives)\n } else if ('allOf' in propDef) {\n // allOf composition\n const schemas = propDef.allOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n propValidator = schemas.reduce((acc, schema) => acc.concat(schema), joi.any())\n } else if ('anyOf' in propDef) {\n // anyOf composition\n const alternatives = propDef.anyOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n propValidator = joi.alternatives().try(...alternatives)\n } else if ('not' in propDef) {\n // not composition\n const notSchemas = propDef.not.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n propValidator = joi.any().not(...notSchemas)\n } else {\n // Direct ResourcefulDataType\n propValidator = this.$getPropertyBaseValidator(\n propDef,\n propDef.nullable || false,\n kind,\n !(propDef.readOnly || false)\n )\n }\n\n // Check if this field should be required\n if (d.required && d.required.includes(propKey)) {\n propValidator.required()\n }\n\n objectSchema[propKey] = propValidator\n })\n const r = joi.object(objectSchema)\n if (nullable) {\n r.allow(null)\n }\n\n if (d.minProperties !== undefined) {\n r.min(d.minProperties)\n }\n\n if (d.maxProperties !== undefined) {\n r.max(d.maxProperties)\n }\n\n if (guards.isObject(d.additionalProperties)) {\n const additionalPropertiesType = d.additionalProperties as ResourcefulDataType\n r.pattern(\n joi.string(),\n this.$getPropertyBaseValidator(\n additionalPropertiesType,\n additionalPropertiesType.nullable || false,\n kind,\n !(additionalPropertiesType.readOnly || false)\n )\n )\n } else {\n r.unknown(true === d.additionalProperties)\n }\n\n return r\n }\n case datatype instanceof ResourcefulArrayType: {\n const d: ResourcefulArrayType = datatype as unknown as ResourcefulArrayType\n const r = joi.array()\n if (nullable) {\n r.allow(null)\n }\n // Handle different item type structures\n let itemValidator: AnySchema\n if ('oneOf' in d.items) {\n // oneOf composition\n const alternatives = d.items.oneOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n itemValidator = joi.alternatives().try(...alternatives)\n } else if ('allOf' in d.items) {\n // allOf composition\n const schemas = d.items.allOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n itemValidator = schemas.reduce((acc, schema) => acc.concat(schema), joi.any())\n } else if ('anyOf' in d.items) {\n // anyOf composition\n const alternatives = d.items.anyOf.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n itemValidator = joi.alternatives().try(...alternatives)\n } else if ('not' in d.items) {\n // not composition\n const notSchemas = d.items.not.map((item) =>\n this.$getPropertyBaseValidator(\n item,\n item.nullable || false,\n kind,\n !(item.readOnly || false)\n )\n )\n itemValidator = joi.any().not(...notSchemas)\n } else {\n // Direct ResourcefulDataType\n itemValidator = this.$getPropertyBaseValidator(\n d.items,\n d.items.nullable || false,\n kind,\n !(d.items.readOnly || false)\n )\n }\n r.items(itemValidator)\n if (d.minItems !== undefined) {\n r.min(d.minItems)\n }\n if (d.maxItems !== undefined) {\n r.max(d.maxItems)\n }\n if (d.uniqueItems) {\n r.unique()\n }\n return r\n }\n default:\n return joi.any().forbidden()\n }\n }\n\n protected static async $getPropertyCanReadWrite(\n ctx: HttpContext,\n app: ApplicationService,\n key: string,\n lucidDefinition:\n | ModelColumnOptions\n | ComputedOptions\n | ReturnType<LucidModel['$getRelation']>,\n readAclFilters: ResourcefulAccessControlFilter[] = [],\n writeAclFilters: ResourcefulAccessControlFilter[] = [],\n kind: 'column' | 'computedAccessor' | 'relationship',\n writable: boolean = false\n ): Promise<{ canRead: boolean; canWrite: boolean }> {\n const fieldKey = getFieldKey(key, lucidDefinition)\n if (null === fieldKey) {\n // if the field key is null, that means that the field cannot be \"read\"\n // this is part of the baseline lucid decorator API, so we need to honor the\n // expected behavior\n if (validatedOptions.readRequiredForWrite) {\n return { canRead: false, canWrite: false }\n }\n }\n const canRead =\n null === fieldKey ? false : await this.$evaluatePropertyAccess(ctx, app, readAclFilters)\n const canWrite =\n 'relationship' === kind || ('computedAccessor' === kind && !writable)\n ? false\n : await this.$evaluatePropertyAccess(\n ctx,\n app,\n writeAclFilters.length > 0 ? writeAclFilters : readAclFilters\n )\n return { canRead, canWrite }\n }\n\n protected static async $evaluatePropertyAccess(\n ctx: HttpContext,\n app: ApplicationService,\n acls: ResourcefulAccessControlFilter[] = []\n ): Promise<boolean> {\n if (acls.length === 0) {\n return true\n }\n const results = await pMap(\n acls,\n async (acl) => {\n try {\n return await acl(ctx, app)\n } catch (err) {\n resourcefulModelEventEmitter.emit('acl:error', err, ctx, app, undefined)\n switch (validatedOptions.onACLError) {\n case 'pass':\n return true\n case 'fail':\n return false\n default:\n throw err\n }\n }\n },\n {\n concurrency: validatedOptions.advanced.aclEvaluationConcurrency,\n }\n )\n return results.every((result) => result === true)\n }\n\n static async $asOpenApiSchemaObject(\n ctx: HttpContext,\n app: ApplicationService\n ): Promise<ResourcefulModelOpenApiSchema> {\n const resourcefulModelMetaSchema: ResourcefulModelMetaSchema =\n await this.$getAsResourcefulForContext(ctx, app)\n const ret: ResourcefulModelOpenApiSchema = {\n type: 'object',\n title: resourcefulModelMetaSchema.name,\n description: resourcefulModelMetaSchema.description,\n externalDocs: resourcefulModelMetaSchema.externalDocs,\n example: resourcefulModelMetaSchema.example,\n properties: {},\n }\n Object.entries(resourcefulModelMetaSchema.properties).forEach(\n ([propertyKey, propertyMeta]) => {\n const resolvedColumnName = getFieldKey(\n propertyKey,\n propertyMeta.lucidDefinitions as ModelColumnOptions | ComputedOptions\n )\n if (null === resolvedColumnName) {\n // if the field key is null, that means that the field cannot be \"read\"\n // this is part of the baseline lucid decorator API, so we need to honor the\n // expected behavior\n return\n }\n switch (propertyMeta.kind) {\n case 'column': {\n ret.properties![propertyKey] = this.$resourcefulModelColumnMetaToOpenApiSchema(\n propertyKey,\n propertyMeta as ResourcefulModelColumnMetaSchema\n )\n return\n }\n case 'computedAccessor': {\n ret.properties![propertyKey] =\n this.$resourcefulModelComputedAccessorMetaToOpenApiSchema(\n propertyKey,\n propertyMeta as ResourcefulModelComputedAccessorMetaSchema\n )\n return\n }\n case 'relationship': {\n const relatedSchema = this.$resourcefulModelRelationshipMetaToOpenApiSchema(\n propertyKey,\n propertyMeta as ResourcefulModelRelationshipMetaSchema\n )\n if (relatedSchema) {\n ret.properties![propertyKey] = relatedSchema\n }\n return\n }\n }\n }\n )\n const requiredPropSet: Set<string> = new Set()\n Object.entries(ret.properties!).forEach(([propertyKey, schema]) => {\n if (\n !guards.isObject(schema) ||\n '$ref' in schema ||\n !('nullable' in schema) ||\n schema.nullable\n )\n return\n requiredPropSet.add(propertyKey)\n })\n ret.required = Array.from(requiredPropSet)\n return ret\n }\n\n protected static $getDefaultValueFromPropertyMeta(\n propertyMeta: ResourcefulModelColumnMetaSchema | ResourcefulModelComputedAccessorMetaSchema\n ): any | undefined {\n const joiDescription = propertyMeta.validator.describe()\n if (\n guards.isObject(joiDescription) &&\n 'flags' in joiDescription &&\n guards.isObject(joiDescription.flags) &&\n 'default' in joiDescription.flags\n ) {\n return joiDescription.flags.default\n }\n }\n\n protected static $resourcefulModelColumnMetaToOpenApiSchema(\n propertyKey: string,\n propertyMeta: ResourcefulModelColumnMetaSchema\n ): ResourcefulModelOpenApiSchema {\n const ret: ResourcefulModelOpenApiSchema = helpers.stripUndefinedValuesFromObject({\n items: (propertyMeta.definition as any).items,\n title: getFieldKey(propertyKey, propertyMeta.lucidDefinitions) || propertyKey,\n description: propertyMeta.definition.description,\n format: (propertyMeta.definition as any).format,\n default: this.$getDefaultValueFromPropertyMeta(propertyMeta),\n multipleOf: (propertyMeta.definition as any).multipleOf,\n maximum: (propertyMeta.definition as any).maximum,\n exclusiveMaximum: (propertyMeta.definition as any).exclusiveMaximum,\n minimum: (propertyMeta.definition as any).minimum,\n exclusiveMinimum: (propertyMeta.definition as any).exclusiveMinimum,\n maxLength: (propertyMeta.definition as any).maxLength,\n minLength: (propertyMeta.definition as any).minLength,\n pattern: (propertyMeta.definition as any).pattern,\n additionalProperties: (propertyMeta.definition as any).additionalProperties,\n maxItems: (propertyMeta.definition as any).maxItems,\n minItems: (propertyMeta.definition as any).minItems,\n uniqueItems: (propertyMeta.definition as any).uniqueItems,\n maxProperties: (propertyMeta.definition as any).maxProperties,\n minProperties: (propertyMeta.definition as any).minProperties,\n required: (propertyMeta.definition as any).required,\n enum: (propertyMeta.definition as any).enum,\n properties: (propertyMeta.definition as any).properties,\n allOf: (propertyMeta.definition as any).allOf,\n oneOf: (propertyMeta.definition as any).oneOf,\n anyOf: (propertyMeta.definition as any).anyOf,\n not: (propertyMeta.definition as any).not,\n nullable: (propertyMeta.definition as any).nullable,\n readOnly: propertyMeta.canRead && !propertyMeta.canWrite,\n writeOnly: !propertyMeta.canRead && propertyMeta.canWrite,\n externalDocs: propertyMeta.definition.externalDocs,\n example: propertyMeta.definition.example,\n ...(propertyMeta.definition.type as any),\n })\n return ret\n }\n\n protected static $resourcefulModelComputedAccessorMetaToOpenApiSchema(\n propertyKey: string,\n propertyMeta: ResourcefulModelComputedAccessorMetaSchema\n ): ResourcefulModelOpenApiSchema {\n const ret: ResourcefulModelOpenApiSchema = helpers.stripUndefinedValuesFromObject({\n items: (propertyMeta.definition as any).items,\n title: getFieldKey(propertyKey, propertyMeta.lucidDefinitions) || propertyKey,\n description: propertyMeta.definition.description,\n format: (propertyMeta.definition as any).format,\n default: this.$getDefaultValueFromPropertyMeta(propertyMeta),\n multipleOf: (propertyMeta.definition as any).multipleOf,\n maximum: (propertyMeta.definition as any).maximum,\n exclusiveMaximum: (propertyMeta.definition as any).exclusiveMaximum,\n minimum: (propertyMeta.definition as any).minimum,\n exclusiveMinimum: (propertyMeta.definition as any).exclusiveMinimum,\n maxLength: (propertyMeta.definition as any).maxLength,\n minLength: (propertyMeta.definition as any).minLength,\n pattern: (propertyMeta.definition as any).pattern,\n additionalProperties: (propertyMeta.definition as any).additionalProperties,\n maxItems: (propertyMeta.definition as any).maxItems,\n minItems: (propertyMeta.definition as any).minItems,\n uniqueItems: (propertyMeta.definition as any).uniqueItems,\n maxProperties: (propertyMeta.definition as any).maxProperties,\n minProperties: (propertyMeta.definition as any).minProperties,\n required: (propertyMeta.definition as any).required,\n enum: (propertyMeta.definition as any).enum,\n properties: (propertyMeta.definition as any).properties,\n allOf: (propertyMeta.definition as any).allOf,\n oneOf: (propertyMeta.definition as any).oneOf,\n anyOf: (propertyMeta.definition as any).anyOf,\n not: (propertyMeta.definition as any).not,\n nullable: (propertyMeta.definition as any).nullable,\n readOnly: propertyMeta.canRead && !propertyMeta.canWrite,\n writeOnly: !propertyMeta.canRead && propertyMeta.canWrite,\n externalDocs: propertyMeta.definition.externalDocs,\n example: propertyMeta.definition.example,\n ...(propertyMeta.definition.type as any),\n })\n return ret\n }\n\n protected static $resourcefulModelRelationshipMetaToOpenApiSchema(\n _propertyKey: string,\n propertyMeta: ResourcefulModelRelationshipMetaSchema\n ): ResourcefulModelOpenApiRelatedSchema | undefined {\n const relatedModel = propertyMeta.relatedModel()\n if (!relatedModel) {\n // If the related model is not defined, we cannot generate a schema for it\n return undefined\n }\n if (!guards.isResourcefulModel(relatedModel)) {\n // If the related model is not a ResourcefulModel, we cannot generate a schema for it\n return undefined\n }\n const ref: string = `#/components/schemas/${relatedModel.$resourcefulName}`\n return {\n $ref: ref,\n }\n }\n\n protected static async $resourcefulCheckAccess(\n config: ResourcefulCheckAccessOptions\n ): Promise<ResourcefulCheckAccessReturn> {\n const { ctx, app, operation, instance } = config\n const allowedFieldsMap = new Map<string, boolean>()\n const allowedColumnsMap = new Map<string, boolean>()\n const mixinAccessControlFilters = validatedOptions.accessControlFilters[operation]\n\n if (mixinAccessControlFilters) {\n const mixinAccessControlResult = await Promise.all(\n mixinAccessControlFilters.map((func) => func(ctx, app, instance as any))\n )\n const isAllowedByMixinFilters = mixinAccessControlResult.every(Boolean)\n\n if (!isAllowedByMixinFilters) {\n return {\n isForbidden: true,\n message: 'Access denied by Mixin ACLs.',\n allowedFieldsMap: undefined,\n }\n }\n }\n\n // If the operation is DELETE, we don't check the field-level access\n if (operation === CRUDOperationsEnum.DELETE) {\n return { isForbidden: false, allowedFieldsMap, allowedColumnsMap }\n }\n\n const columnsOptions = this.$resourcefulColumns.values()\n const aclOperation = operationCRUDToACL(operation)\n const addColumnOptionToAllowedFieldsMap = (propertyKey: string) => {\n const serializedName = this.$keys.attributesToSerialized.resolve(propertyKey)\n const columnName = this.$keys.serializedToColumns.resolve(serializedName)\n\n if (serializedName) {\n allowedFieldsMap.set(propertyKey, true)\n }\n\n if (columnName) {\n allowedColumnsMap.set(columnName, true)\n }\n }\n\n for (const columnOptions of columnsOptions) {\n const propertyACLFilters =\n aclOperation === ACLOperationsEnum.READ\n ? columnOptions.readAccessControlFilters\n : columnOptions.writeAccessControlFilters\n\n // If a column has no ACLs - it allowed to everyone\n if (!propertyACLFilters) {\n addColumnOptionToAllowedFieldsMap(columnOptions.propertyKey)\n\n continue\n }\n\n const isAllowed = await this.$evaluatePropertyAccess(ctx, app, propertyACLFilters)\n\n if (isAllowed) {\n addColumnOptionToAllowedFieldsMap(columnOptions.propertyKey)\n }\n }\n\n const hasNoAllowedFields = !allowedFieldsMap.size\n\n if (hasNoAllowedFields) {\n return {\n isForbidden: true,\n message: 'Access denied since user does not has access to at least 1 column.',\n }\n }\n\n return {\n isForbidden: false,\n allowedFieldsMap,\n allowedColumnsMap,\n }\n }\n\n private static $getPrivateKeyAttribute() {\n let ret: string | undefined\n this.$columnsDefinitions.forEach((columnOptions, attribute) => {\n if (\n columnOptions.serializeAs !== null &&\n (columnOptions.isPrimary || columnOptions.columnName === this.primaryKey)\n ) {\n ret = columnOptions.serializeAs || attribute\n }\n })\n return ret\n }\n\n /**\n * Performs paginated listing and searching of model records with comprehensive filtering.\n *\n * This method provides the core implementation for resourceful index/list operations,\n * supporting pagination, field selection, access control, and Lucene query syntax for\n * filtering. It validates all inputs, applies ACL filters, executes the query with\n * proper field mapping between serialized names and database columns, and returns\n * structured results with query metadata.\n *\n * @template SelectedFields - Array of field names that can be selected from the model's serializable attributes\n * @template ReturnType - The resulting type after picking the selected fields from the model's serializable attributes\n *\n * @param filter - Lucene-style query string for filtering records (e.g., \"name:john AND email:*.com\").\n * If null or undefined, defaults to empty string (no filtering).\n * @param page - The page number for pagination (must be ≥ 1). Used with perPage to calculate offset.\n * @param perPage - Number of records per page (must be ≥ 1 and ≤ 100 by default).\n * @param fields - Array of field names to include in the response. If null, undefined, or empty,\n * defaults to just the primary key field. Field names should use serialized names\n * (as they appear in API responses), not database column names.\n * @param ctx - HTTP context containing request information, authentication, and other request-scoped data.\n * @param app - Application service instance providing access to application-level services and configuration.\n * @param hooks - Optional array of query scope callbacks to apply additional filtering constraints.\n *\n * @returns Promise resolving to ResourcefulIndexResult containing:\n * - `records`: Array of partial record objects with only the requested fields\n * - `total`: Total number of records matching the filter (before pagination)\n * - `page`: The requested page number (echoed back)\n * - `perPage`: The requested per-page limit (echoed back)\n * - `countQuery`: SQL query string used for counting total records\n * - `recordsQuery`: SQL query string used for fetching the actual records\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n * @throws {E_INVALID_COLUMN_ACCESS} When no fields are available for access after ACL filtering\n * @throws {E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION} When input validation fails\n *\n * @example\n * ```typescript\n * // Basic usage with pagination\n * const result = await User.$onResourcefulIndex(\n * 'name:john',\n * 1,\n * 10,\n * ['id', 'name', 'email'],\n * ctx,\n * app\n * );\n *\n * // Complex filtering with date ranges\n * const result = await User.$onResourcefulIndex(\n * 'name:john AND createdAt:[2021-01-01T00:00:00Z TO 2021-12-31T23:59:59Z]',\n * 2,\n * 25,\n * ['id', 'name', 'createdAt'],\n * ctx,\n * app\n * );\n * ```\n */\n protected static $formatResourcefulRecord(\n record: Record<string, any>\n ): Partial<ResourcefulModelSerializableAttributes<Model & ResourcefulModel>> {\n const result: Partial<ResourcefulModelSerializableAttributes<Model & ResourcefulModel>> = {}\n\n for (const [key, value] of Object.entries(record)) {\n const serializable = this.$keys.columnsToSerialized.get(key)\n const attribute = this.$keys.columnsToAttributes.get(key)\n\n if (!attribute || !serializable) {\n continue\n }\n\n const opts = this.$getColumn(attribute)\n\n if (!opts) {\n continue\n }\n\n const preparedValue = isFunction(opts.consume)\n ? opts.consume(value, attribute, this as any)\n : value\n\n result[\n serializable as keyof ResourcefulModelSerializableAttributes<Model & ResourcefulModel>\n ] = preparedValue\n }\n\n return result\n }\n\n protected static async $validatePayloadWithValidationGetters(\n ctx: HttpContext,\n app: ApplicationService,\n payload: unknown,\n validationGetters: ResourcefulPayloadValidatorGetter[]\n ) {\n const schemas = await Promise.all(validationGetters.map((getter) => getter(ctx, app)))\n\n for (const schema of schemas) {\n const { error: schemaError } = schema.validate(payload)\n\n if (schemaError) {\n return schemaError\n }\n }\n\n return null\n }\n\n protected static async $validatePayloadWithPayloadSchemaGetters(\n ctx: HttpContext,\n app: ApplicationService,\n payload: unknown,\n payloadSchemaGetters: ResourcefulPayloadSchemaGetter[]\n ) {\n const resolved = await Promise.all(payloadSchemaGetters.map((getter) => getter(ctx, app)))\n const schemas = resolved.filter((schema) => schema !== null && schema !== undefined)\n\n for (const schema of schemas) {\n const { error: schemaError } = schema.validate(payload)\n\n if (schemaError) {\n return schemaError\n }\n }\n\n return null\n }\n\n protected static $resourcefulGetQueryBuilder() {\n return this.$adapter.modelConstructorClient(this).query().from(this.table)\n }\n\n static async $onResourcefulIndex<\n SelectedFields extends Array<\n keyof ResourcefulModelSerializableAttributes<Model & ResourcefulModel>\n >,\n SelectedSingleField extends keyof ResourcefulModelSerializableAttributes<\n Model & ResourcefulModel\n >,\n ReturnType = Pick<\n ResourcefulModelSerializableAttributes<Model & ResourcefulModel>,\n SelectedFields[number]\n >,\n >(\n filter: string | null | undefined,\n page: number,\n perPage: number,\n fields: SelectedFields | SelectedSingleField | null | undefined,\n sort:\n | Array<\n [\n Extract<\n keyof ResourcefulModelSerializableAttributes<Model & ResourcefulModel>,\n string\n >,\n 'asc' | 'desc',\n ]\n >\n | null\n | undefined,\n ctx: HttpContext,\n app: ApplicationService,\n hooks: ResourcefulScopeHooks = []\n ): Promise<ResourcefulIndexResult<ReturnType>> {\n /*\n |--------------------------------------------------------------------------\n | Normalize inputs\n |--------------------------------------------------------------------------\n */\n const primaryKey = this.$getPrivateKeyAttribute()\n\n if (!primaryKey) {\n throw new E_MISSING_PRIMARY_KEY_EXCEPTION(this.$resourcefulName)\n }\n\n if (!isString(filter)) {\n filter = ''\n }\n\n fields = prepareFields(fields, primaryKey)\n\n /*\n |--------------------------------------------------------------------------\n | Check Access\n |--------------------------------------------------------------------------\n */\n const { isForbidden, allowedFieldsMap, message } = await this.$resourcefulCheckAccess({\n ctx,\n app,\n operation: CRUDOperationsEnum.LIST,\n })\n\n if (isForbidden) {\n throw new E_FORBIDDEN(message)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Validate Request Details\n |--------------------------------------------------------------------------\n */\n const possibleFields = Array.from(allowedFieldsMap.keys())\n if (possibleFields.length === 0) {\n throw new E_INVALID_COLUMN_ACCESS('No fields available for access')\n }\n const schema = joi.object({\n filter: joi.string().allow('').required(),\n page: joi.number().integer().min(1).required(),\n perPage: joi.number().integer().min(1).max(100).required(),\n fields: joi\n .array()\n .items(joi.string().valid(...possibleFields))\n .required(),\n })\n const { error: methodValidationError, value: validatedMethodOptions } = schema.validate(\n {\n filter,\n page,\n perPage,\n fields,\n },\n {\n abortEarly: false,\n }\n )\n if (methodValidationError) {\n throw new E_INVALID_RESOUREFUL_INDEX_REQUEST_EXCEPTION(methodValidationError)\n }\n /*\n |--------------------------------------------------------------------------\n | Create the baseline query\n |--------------------------------------------------------------------------\n */\n let query = luceneToLucid(\n validatedMethodOptions.filter,\n this.$adapter.modelConstructorClient(this),\n this.$keys.serializedToColumns,\n primaryKey,\n this.table,\n possibleFields\n )\n /*\n |--------------------------------------------------------------------------\n | Apply Resourceful Query Scope Callbacks\n |--------------------------------------------------------------------------\n */\n for (const scopeCallback of [\n ...(this.$resourcefulQueryScopeCallbacks.list || []),\n ...hooks,\n ]) {\n await scopeCallback(ctx, app, query)\n }\n /*\n |--------------------------------------------------------------------------\n | Split into separate queries for count and results\n |--------------------------------------------------------------------------\n */\n const columnsToSelect = validatedMethodOptions.fields\n .filter((field: string) => allowedFieldsMap.has(field))\n .map((field: string) => this.$keys.serializedToColumns.get(field))\n .filter((column: string | undefined): column is string => !!column)\n const countQuery = query.clone<{ total: number }>()\n const recordsQuery = query.clone()\n\n countQuery.count('*', 'total')\n recordsQuery\n .select(columnsToSelect)\n .forPage(validatedMethodOptions.page, validatedMethodOptions.perPage)\n\n if (Array.isArray(sort) && sort.length > 0) {\n sort.forEach(([field, direction]) => {\n if (allowedFieldsMap.has(field)) {\n recordsQuery.orderBy(field, direction)\n }\n })\n }\n\n const countQueryQuery = countQuery.toQuery()\n const recordsQueryQuery = recordsQuery.toQuery()\n /*\n |--------------------------------------------------------------------------\n | Retrieve raw results\n |--------------------------------------------------------------------------\n */\n const [countResults, rawRecords] = await Promise.all([countQuery, recordsQuery])\n const totalRaw = Number(countResults?.[0]?.total)\n\n /*\n |--------------------------------------------------------------------------\n | Return results\n |--------------------------------------------------------------------------\n */\n return {\n total: Number.isNaN(totalRaw) ? 0 : totalRaw,\n page: validatedMethodOptions.page,\n perPage: validatedMethodOptions.perPage,\n records: rawRecords.map((record) =>\n this.$formatResourcefulRecord(record)\n ) as Partial<ReturnType>[],\n countQuery: countQueryQuery,\n recordsQuery: recordsQueryQuery,\n }\n }\n\n /**\n * Retrieves a single model record by its unique identifier with access control.\n *\n * This method implements secure record retrieval by first applying query scope callbacks\n * to verify the record exists within the user's access scope, then fetching the full\n * model instance for field-level ACL evaluation. Only fields that pass ACL checks\n * are included in the response.\n *\n * The dual-fetch pattern ensures security: the first query applies scoping constraints\n * to verify access, while the second query retrieves the full model for ACL evaluation.\n *\n * @param uid - The unique identifier of the record to retrieve\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional array of query scope callbacks to apply additional filtering constraints\n *\n * @returns Promise resolving to the record object with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n */\n static async $onResourcefulRead(\n uid: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks: ResourcefulScopeHooks = []\n ): Promise<ResourcefulModelSerializableAttributes<Model & ResourcefulModel>> {\n /*\n |--------------------------------------------------------------------------\n | Normalize inputs\n |--------------------------------------------------------------------------\n */\n const primaryKey = this.$getPrivateKeyAttribute()\n\n if (!primaryKey) {\n throw new E_MISSING_PRIMARY_KEY_EXCEPTION(this.$resourcefulName)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Check Access\n |--------------------------------------------------------------------------\n */\n const query = this.$resourcefulGetQueryBuilder()\n\n const allScopeCallbacks = [...(this.$resourcefulQueryScopeCallbacks.list || []), ...hooks]\n\n for (const scopeCallback of allScopeCallbacks) {\n await scopeCallback(ctx, app, query)\n }\n\n const recordRaw = await query.where(this.primaryKey, uid).select(this.primaryKey).first()\n\n if (!recordRaw) {\n throw new E_RECORD_NOT_FOUND_EXCEPTION()\n }\n\n const rid = recordRaw[this.primaryKey]\n\n const record = await this.query().where(this.primaryKey, rid).first()\n if (!record) {\n throw new E_RECORD_NOT_FOUND_EXCEPTION()\n }\n\n const { isForbidden, allowedFieldsMap, message } = await this.$resourcefulCheckAccess({\n ctx,\n app,\n instance: record,\n operation: CRUDOperationsEnum.READ,\n })\n\n if (isForbidden) {\n throw new E_FORBIDDEN(message)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Format and return the result\n |--------------------------------------------------------------------------\n */\n\n const recordObject = record.toObject()\n\n const recordObjectWithAllowedFields: Partial<ModelObject> = {}\n\n for (const [key, value] of Object.entries(recordObject)) {\n if (allowedFieldsMap.has(key)) {\n recordObjectWithAllowedFields[key] = value\n }\n }\n\n return recordObjectWithAllowedFields as ResourcefulModelSerializableAttributes<\n Model & ResourcefulModel\n >\n }\n\n /**\n * Creates a new model record with payload validation and access control.\n *\n * This method handles secure record creation by validating the request payload\n * against both model-level and request-specific validation schemas, checking\n * field-level write permissions, and returning the created record with appropriate\n * field filtering applied via the read operation.\n *\n * @param payload - The data object containing field values for the new record\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional array of validation schema getters for additional payload validation\n *\n * @returns Promise resolving to the created record with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_INVALID_PAYLOAD_EXCEPTION} When core model validation fails\n * @throws {E_FORBIDDEN_PAYLOAD_EXCEPTION} When request-specific validation fails\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n */\n static async $onResourcefulCreate(\n payload: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks: ResourcefulValidationHooks = []\n ): Promise<ResourcefulModelSerializableAttributes<Model & ResourcefulModel>> {\n /*\n |--------------------------------------------------------------------------\n | Normalize inputs\n |--------------------------------------------------------------------------\n */\n const primaryKey = this.$getPrivateKeyAttribute()\n\n if (!primaryKey) {\n throw new E_MISSING_PRIMARY_KEY_EXCEPTION(this.$resourcefulName)\n }\n /*\n |--------------------------------------------------------------------------\n | Check Access\n |--------------------------------------------------------------------------\n */\n const payloadValidatorGetters = [...(options.payloadValidationSchemaBuilders?.create || [])]\n const [payloadValidatorGettersError, payloadSchemaGettersError] = await Promise.all([\n this.$validatePayloadWithValidationGetters(ctx, app, payload, payloadValidatorGetters),\n this.$validatePayloadWithPayloadSchemaGetters(ctx, app, payload, hooks),\n ])\n\n if (payloadValidatorGettersError || payloadSchemaGettersError) {\n if (payloadValidatorGettersError) {\n throw new E_INVALID_PAYLOAD_EXCEPTION(payloadValidatorGettersError)\n }\n if (payloadSchemaGettersError) {\n throw new E_FORBIDDEN_PAYLOAD_EXCEPTION(payloadSchemaGettersError)\n }\n }\n\n const { isForbidden, allowedFieldsMap, message } = await this.$resourcefulCheckAccess({\n ctx,\n app,\n operation: CRUDOperationsEnum.CREATE,\n })\n\n if (isForbidden) {\n throw new E_FORBIDDEN(message)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Validate and prepare payload\n |--------------------------------------------------------------------------\n */\n const preparedPayload: Record<string, any> = {}\n\n // Only process fields that are allowed by ACL\n for (const [key, value] of Object.entries(payload)) {\n const attribute = this.$keys.serializedToAttributes.get(key)\n const isValueNull = value === null || value === undefined\n\n if (!attribute) {\n continue\n }\n\n if (!isValueNull && !allowedFieldsMap.has(attribute)) {\n throw new E_FORBIDDEN(`User does not has write access to field ${attribute}.`)\n }\n\n preparedPayload[attribute] = value\n }\n\n /*\n |--------------------------------------------------------------------------\n | Create the record\n |--------------------------------------------------------------------------\n */\n const newRecord = await this.create(preparedPayload as InstanceType<Model>)\n\n /*\n |--------------------------------------------------------------------------\n | Format and return the result\n |--------------------------------------------------------------------------\n */\n\n // Call inner Read method to honor Read ACL\n return await this.$onResourcefulRead(newRecord.$getAttribute(primaryKey), ctx, app)\n }\n\n /**\n * Updates an existing model record with payload validation and access control.\n *\n * This method implements secure record updates by first verifying the record exists\n * and is accessible via the read operation, validating the update payload against both\n * model-level and request-specific schemas, checking field-level write permissions,\n * and returning the updated record with appropriate field filtering applied.\n *\n * The method reuses $onResourcefulRead for consistent access control and scoping logic.\n *\n * @param uid - The unique identifier of the record to update\n * @param payload - The data object containing field values to update\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional object containing query scope callbacks and validation schema getters\n *\n * @returns Promise resolving to the updated record with only accessible fields\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_INVALID_PAYLOAD_EXCEPTION} When core model validation fails\n * @throws {E_FORBIDDEN_PAYLOAD_EXCEPTION} When request-specific validation fails\n * @throws {E_FORBIDDEN} When access is denied by model-level or field-level ACL filters\n */\n static async $onResourcefulUpdate(\n uid: any,\n payload: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks: Partial<ResourcefulHooks> = {}\n ): Promise<ResourcefulModelSerializableAttributes<Model & ResourcefulModel>> {\n /*\n |--------------------------------------------------------------------------\n | Normalize inputs\n |--------------------------------------------------------------------------\n */\n const primaryKey = this.$getPrivateKeyAttribute()\n\n if (!primaryKey) {\n throw new E_MISSING_PRIMARY_KEY_EXCEPTION(this.$resourcefulName)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Check Access & Find the existing record\n |--------------------------------------------------------------------------\n */\n const payloadValidatorGetters = [...(options.payloadValidationSchemaBuilders?.update || [])]\n const [payloadValidatorGettersError, payloadSchemaGettersError] = await Promise.all([\n this.$validatePayloadWithValidationGetters(ctx, app, payload, payloadValidatorGetters),\n this.$validatePayloadWithPayloadSchemaGetters(\n ctx,\n app,\n payload,\n hooks.payloadValidationSchemas || []\n ),\n ])\n\n if (payloadValidatorGettersError || payloadSchemaGettersError) {\n if (payloadValidatorGettersError) {\n throw new E_INVALID_PAYLOAD_EXCEPTION(payloadValidatorGettersError)\n }\n if (payloadSchemaGettersError) {\n throw new E_FORBIDDEN_PAYLOAD_EXCEPTION(payloadSchemaGettersError)\n }\n }\n\n // Attempt to load the existing record via $onResourcefulRead in order to\n // prevent duplicating the scoping logic\n await this.$onResourcefulRead(uid, ctx, app, hooks.queryScopeCallbacks || [])\n\n // Refetching record using model to update with it later\n const record = await this.query().where(primaryKey, uid).first()\n if (!record) {\n throw new E_RECORD_NOT_FOUND_EXCEPTION()\n }\n\n const { isForbidden, allowedFieldsMap, message } = await this.$resourcefulCheckAccess({\n ctx,\n app,\n instance: record,\n operation: CRUDOperationsEnum.UPDATE,\n })\n\n if (isForbidden) {\n throw new E_FORBIDDEN(message)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Prepare payload\n |--------------------------------------------------------------------------\n */\n const preparedPayload: Record<string, any> = {}\n\n // Only process fields that are allowed by ACL\n for (const [key, value] of Object.entries(payload)) {\n const attribute = this.$keys.serializedToAttributes.get(key)\n const isValueNull = value === null || value === undefined\n\n if (!attribute) {\n continue\n }\n\n if (!isValueNull && !allowedFieldsMap.has(attribute)) {\n throw new E_FORBIDDEN(`User does not has write access to field ${attribute}.`)\n }\n\n preparedPayload[attribute] = value\n }\n\n /*\n |--------------------------------------------------------------------------\n | Update the record\n |--------------------------------------------------------------------------\n */\n\n record.merge(preparedPayload as Partial<InstanceType<Model>>)\n\n await record.save()\n\n /*\n |--------------------------------------------------------------------------\n | Format and return the result\n |--------------------------------------------------------------------------\n */\n\n // Call inner Read method to honor Read ACL\n return this.$onResourcefulRead(uid, ctx, app)\n }\n\n /**\n * Deletes an existing model record with verification and access control.\n *\n * This method securely deletes records by first verifying the record exists\n * and is accessible via the read operation, then checking model-level deletion\n * permissions before executing the deletion. Returns the record as it existed\n * before deletion with appropriate field filtering applied.\n *\n * The method reuses $onResourcefulRead for consistent access control and scoping logic.\n *\n * @param uid - The unique identifier of the record to delete\n * @param ctx - HTTP context containing request information and authentication\n * @param app - Application service instance for accessing app-level services\n * @param hooks - Optional object containing query scope callbacks\n *\n * @returns Promise resolving to the deleted record as it existed before deletion\n *\n * @throws {E_MISSING_PRIMARY_KEY_EXCEPTION} When the model has no identifiable primary key\n * @throws {E_RECORD_NOT_FOUND_EXCEPTION} When no record exists with the given ID or user lacks access\n * @throws {E_FORBIDDEN} When access is denied by model-level access control filters\n */\n static async $onResourcefulDelete(\n uid: any,\n ctx: HttpContext,\n app: ApplicationService,\n hooks: ResourcefulScopeHooks = []\n ): Promise<void> {\n /*\n |--------------------------------------------------------------------------\n | Normalize inputs\n |--------------------------------------------------------------------------\n */\n const primaryKey = this.$getPrivateKeyAttribute()\n\n if (!primaryKey) {\n throw new E_MISSING_PRIMARY_KEY_EXCEPTION(this.$resourcefulName)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Find the existing record for access check\n |--------------------------------------------------------------------------\n */\n const query = this.$resourcefulGetQueryBuilder()\n\n for (const scopeCallback of [\n ...(this.$resourcefulQueryScopeCallbacks.access || []),\n ...hooks,\n ]) {\n await scopeCallback(ctx, app, query)\n }\n\n const rawRecord = await query.where(primaryKey, uid).first()\n\n if (!rawRecord) {\n throw new E_RECORD_NOT_FOUND_EXCEPTION()\n }\n\n const record = new this().merge(this.$formatResourcefulRecord(rawRecord))\n\n /*\n |--------------------------------------------------------------------------\n | Check Access\n |--------------------------------------------------------------------------\n */\n const { isForbidden, message } = await this.$resourcefulCheckAccess({\n ctx,\n app,\n instance: record,\n operation: CRUDOperationsEnum.DELETE,\n })\n\n if (isForbidden) {\n throw new E_FORBIDDEN(message)\n }\n\n /*\n |--------------------------------------------------------------------------\n | Delete the record\n |--------------------------------------------------------------------------\n */\n\n await record.delete()\n }\n }\n Object.defineProperty(ResourcefulModel, '$resourcefulName', {\n value: validatedOptions.name,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulMetaDescription', {\n value: validatedOptions.description,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulMetaExternalDocs', {\n value: validatedOptions.externalDocs,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulMetaExample', {\n value: validatedOptions.example,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulAccessControlFilters', {\n value: validatedOptions.accessControlFilters,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulOnACLError', {\n value: validatedOptions.onACLError,\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulQueryScopeCallbacks', {\n value: validatedOptions.queryScopeCallbacks || { list: [], access: [] },\n writable: false,\n enumerable: true,\n configurable: false,\n })\n Object.defineProperty(ResourcefulModel, '$resourcefulPayloadValidationSchemaBuilders', {\n value: validatedOptions.payloadValidationSchemaBuilders || { create: [], update: [] },\n writable: false,\n enumerable: true,\n configurable: false,\n })\n return ResourcefulModel\n }\n}\n","/*\n|--------------------------------------------------------------------------\n| Prepare/Consume Chain Builder\n|--------------------------------------------------------------------------\n|\n| Utility for chaining prepare and consume functions in resourceful decorators.\n| This allows combining default decorator behavior with custom logic in a\n| predictable order while maintaining proper error handling.\n|\n*/\n\n/**\n * Function types for prepare and consume operations\n */\nexport type CustomPrepareFunction = (value: unknown) => unknown\nexport type CustomConsumeFunction = (value: unknown) => unknown\nexport type DefaultPrepareFunction<T = unknown> = (\n key: string,\n value: unknown,\n nullable?: boolean\n) => T\nexport type DefaultConsumeFunction<T = unknown> = (\n key: string,\n value: unknown,\n nullable?: boolean\n) => T\n\n/**\n * Utility class for building chained prepare and consume functions.\n *\n * The chaining order reflects the data flow:\n * - Prepare chain: Default → Custom (data flows TO database)\n * - Consume chain: Custom → Default (data flows FROM database)\n */\nexport class PrepareConsumeChainBuilder {\n /**\n * Creates a chained prepare function that calls default first, then custom.\n *\n * @param propertyKey - The property name for error context\n * @param nullable - Whether the field accepts null values\n * @param defaultPrepare - The default prepare function from decorator\n * @param customPrepare - The custom prepare function from options\n * @returns A chained prepare function or undefined if no functions provided\n */\n static chainPrepare<T>(\n propertyKey: string,\n nullable: boolean,\n defaultPrepare?: DefaultPrepareFunction<T> | undefined,\n customPrepare?: CustomPrepareFunction | undefined\n ): CustomPrepareFunction | undefined {\n // If neither function is provided, return undefined\n if (!defaultPrepare && !customPrepare) {\n return undefined\n }\n\n // If only custom function is provided, return it directly\n if (!defaultPrepare && customPrepare) {\n return customPrepare\n }\n\n // If only default function is provided, wrap it to match signature\n if (defaultPrepare && !customPrepare) {\n return (value: unknown) => defaultPrepare(propertyKey, value, nullable)\n }\n\n // Both functions provided - chain them: default → custom\n return (value: unknown) => {\n const defaultResult = defaultPrepare!(propertyKey, value, nullable)\n\n return customPrepare!(defaultResult)\n }\n }\n\n /**\n * Creates a chained consume function that calls custom first, then default.\n *\n * @param propertyKey - The property name for error context\n * @param nullable - Whether the field accepts null values\n * @param defaultConsume - The default consume function from decorator\n * @param customConsume - The custom consume function from options\n * @returns A chained consume function or undefined if no functions provided\n */\n static chainConsume<T>(\n propertyKey: string,\n nullable: boolean,\n defaultConsume?: DefaultConsumeFunction<T>,\n customConsume?: CustomConsumeFunction\n ): CustomConsumeFunction | undefined {\n // If neither function is provided, return undefined\n if (!defaultConsume && !customConsume) {\n return undefined\n }\n\n // If only custom function is provided, return it directly\n if (!defaultConsume && customConsume) {\n return customConsume\n }\n\n // If only default function is provided, wrap it to match signature\n if (defaultConsume && !customConsume) {\n return (value: unknown) => defaultConsume(propertyKey, value, nullable)\n }\n\n // Both functions provided - chain them: custom → default\n return (value: unknown) => {\n const customResult = customConsume!(value)\n\n return defaultConsume!(propertyKey, customResult, nullable)\n }\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { createError, Exception } from '@poppinss/utils';\nexport const E_INVALID_DATE_COLUMN_VALUE = createError('Invalid value for \"%s\". %s', 'E_INVALID_DATE_COLUMN_VALUE', 500);\nexport const E_UNMANAGED_DB_CONNECTION = createError('Cannot connect to unregistered connection %s', 'E_UNMANAGED_DB_CONNECTION', 500);\nexport const E_MISSING_MODEL_ATTRIBUTE = createError('Relation \"%s\" expects \"%s\" to exist on \"%s\" model, but is missing. Did you forget to define the column?', 'E_MISSING_MODEL_ATTRIBUTE', 500);\nexport const E_INCOMPLETE_REPLICAS_CONFIG = createError('Make sure to define read/write replicas or use connection property', 'E_INCOMPLETE_REPLICAS_CONFIG', 500);\nexport const E_INVALID_REPLICAS_CONFIG = createError('Make sure to define connection property inside read/write replicas', 'E_INVALID_REPLICAS_CONFIG', 500);\nexport const E_MODEL_DELETED = createError('Cannot mutate delete model instance', 'E_MODEL_DELETED', 500);\n/**\n * The \"E_ROW_NOT_FOUND\" exception is raised when\n * no row is found in a database single query\n *\n * The \"error.model\" can be used to know the model which\n * raised the error. This will only be present when using\n * Lucid models not Database queries\n */\nexport const E_ROW_NOT_FOUND = class extends Exception {\n static status = 404;\n static code = 'E_ROW_NOT_FOUND';\n static message = 'Row not found';\n /**\n * The model that raised the error.\n */\n model;\n constructor(model) {\n super();\n this.model = model;\n }\n};\nexport const E_UNABLE_ACQUIRE_LOCK = createError('Unable to acquire lock. Concurrent migrations are not allowed', 'E_UNABLE_ACQUIRE_LOCK', 500);\nexport const E_UNABLE_RELEASE_LOCK = createError('Migration completed, but unable to release database lock', 'E_UNABLE_RELEASE_LOCK', 500);\nexport const E_MISSING_SCHEMA_FILES = createError('Cannot perform rollback. Schema file \"%s\" is missing', 'E_MISSING_SCHEMA_FILES', 500);\nexport const E_UNDEFINED_RELATIONSHIP = createError('\"%s\" is not defined as a relationship on \"%s\" model', 'E_UNDEFINED_RELATIONSHIP', 500);\nexport const E_RUNTIME_EXCEPTION = createError('%s', 'E_RUNTIME_EXCEPTION', 500);\n/**\n * The client is not supported by Lucid\n */\nexport const E_UNSUPPORTED_CLIENT = createError('Unsupported client \"%s\"', 'E_UNSUPPORTED_CLIENT', 500);\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { DateTime } from 'luxon';\nimport * as errors from '../../errors.js';\n/**\n * The method to prepare the date column before persisting it's\n * value to the database\n */\nfunction prepareDateColumn(value, attributeName, modelInstance) {\n /**\n * Return string or missing values as it is. If `auto` is set to true on\n * the column, then the hook will always initialize the date\n */\n if (typeof value === 'string' || !value) {\n return value;\n }\n const modelName = modelInstance.constructor.name;\n /**\n * Format luxon instances to SQL formatted date\n */\n if (DateTime.isDateTime(value)) {\n if (!value.isValid) {\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n value.invalidReason,\n ]);\n }\n return value.toISODate();\n }\n /**\n * Anything else if not an acceptable value for date column\n */\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n 'The value must be an instance of \"luxon.DateTime\"',\n ]);\n}\n/**\n * Consume database return value and convert it to an instance of luxon.DateTime\n */\nfunction consumeDateColumn(value, attributeName, modelInstance) {\n /**\n * Bypass null columns\n */\n if (!value) {\n return value;\n }\n /**\n * Convert from string\n */\n if (typeof value === 'string') {\n return DateTime.fromSQL(value);\n }\n /**\n * Convert from date\n */\n if (value instanceof Date) {\n return DateTime.fromJSDate(value);\n }\n /**\n * Any another value cannot be formatted\n */\n const modelName = modelInstance.constructor.name;\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n `${typeof value} cannot be formatted`,\n ]);\n}\n/**\n * Decorator to define a new date column\n */\nexport const dateColumn = (options) => {\n return function decorateAsColumn(target, property) {\n const Model = target.constructor;\n Model.boot();\n const normalizedOptions = Object.assign({\n prepare: prepareDateColumn,\n consume: consumeDateColumn,\n serialize: (value) => {\n if (DateTime.isDateTime(value)) {\n return value.toISODate();\n }\n return value;\n },\n meta: {},\n }, options);\n /**\n * Type always has to be a date\n */\n normalizedOptions.meta.type = 'date';\n normalizedOptions.meta.autoCreate = normalizedOptions.autoCreate === true;\n normalizedOptions.meta.autoUpdate = normalizedOptions.autoUpdate === true;\n Model.$addColumn(property, normalizedOptions);\n };\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { DateTime } from 'luxon';\nimport * as errors from '../../errors.js';\n/**\n * The method to prepare the datetime column before persisting it's\n * value to the database\n */\nfunction prepareDateTimeColumn(value, attributeName, modelInstance) {\n /**\n * Return string or missing values as it is. If `auto` is set to true on\n * the column, then the hook will always initialize the date\n */\n if (typeof value === 'string' || !value) {\n return value;\n }\n const model = modelInstance.constructor;\n const modelName = model.name;\n /**\n * Format luxon instances to SQL formatted date\n */\n if (DateTime.isDateTime(value)) {\n if (!value.isValid) {\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n value.invalidReason,\n ]);\n }\n const dateTimeFormat = model.query(modelInstance.$options).client.dialect.dateTimeFormat;\n return value.toFormat(dateTimeFormat);\n }\n /**\n * Anything else if not an acceptable value for date column\n */\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n 'It must be an instance of \"luxon.DateTime\"',\n ]);\n}\n/**\n * Consume database return value and convert it to an instance of luxon.DateTime\n */\nfunction consumeDateTimeColumn(value, attributeName, modelInstance) {\n /**\n * Bypass null columns\n */\n if (!value) {\n return value;\n }\n /**\n * Convert from string\n */\n if (typeof value === 'string') {\n return DateTime.fromSQL(value);\n }\n /**\n * Convert from date\n */\n if (value instanceof Date) {\n return DateTime.fromJSDate(value);\n }\n /**\n * Any another value cannot be formatted\n */\n const modelName = modelInstance.constructor.name;\n throw new errors.E_INVALID_DATE_COLUMN_VALUE([\n `${modelName}.${attributeName}`,\n `${typeof value} cannot be formatted`,\n ]);\n}\n/**\n * Decorator to define a new date time column\n */\nexport const dateTimeColumn = (options) => {\n return function decorateAsColumn(target, property) {\n const Model = target.constructor;\n Model.boot();\n const normalizedOptions = Object.assign({\n prepare: prepareDateTimeColumn,\n consume: consumeDateTimeColumn,\n serialize: (value) => {\n if (DateTime.isDateTime(value)) {\n return value.toISO();\n }\n return value;\n },\n meta: {},\n }, options);\n /**\n * Type always has to be a datetime\n */\n normalizedOptions.meta.type = 'datetime';\n normalizedOptions.meta.autoCreate = normalizedOptions.autoCreate === true;\n normalizedOptions.meta.autoUpdate = normalizedOptions.autoUpdate === true;\n Model.$addColumn(property, normalizedOptions);\n };\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { dateColumn } from './date.js';\nimport { dateTimeColumn } from './date_time.js';\n/**\n * Define property on a model as a column. The decorator needs a\n * proper model class inheriting the base model\n */\nexport const column = (options) => {\n return function decorateAsColumn(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addColumn(property, options || {});\n };\n};\ncolumn.date = dateColumn;\ncolumn.dateTime = dateTimeColumn;\n/**\n * Define computed property on a model. The decorator needs a\n * proper model class inheriting the base model\n */\nexport const computed = (options) => {\n return function decorateAsComputed(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addComputed(property, options || {});\n };\n};\n/**\n * Define belongsTo relationship\n */\nexport const belongsTo = (relatedModel, relation) => {\n return function decorateAsRelation(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addRelation(property, 'belongsTo', relatedModel, Object.assign({ relatedModel }, relation));\n };\n};\n/**\n * Define hasOne relationship\n */\nexport const hasOne = (relatedModel, relation) => {\n return function decorateAsRelation(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addRelation(property, 'hasOne', relatedModel, Object.assign({ relatedModel }, relation));\n };\n};\n/**\n * Define hasMany relationship\n */\nexport const hasMany = (relatedModel, relation) => {\n return function decorateAsRelation(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addRelation(property, 'hasMany', relatedModel, Object.assign({ relatedModel }, relation));\n };\n};\n/**\n * Define manyToMany relationship\n */\nexport const manyToMany = (relatedModel, relation) => {\n return function decorateAsRelation(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addRelation(property, 'manyToMany', relatedModel, Object.assign({ relatedModel }, relation));\n };\n};\n/**\n * Define hasManyThrough relationship\n */\nexport const hasManyThrough = ([relatedModel, throughModel], relation) => {\n return function decorateAsRelation(target, property) {\n const Model = target.constructor;\n Model.boot();\n Model.$addRelation(property, 'hasManyThrough', relatedModel, Object.assign({ relatedModel, throughModel }, relation));\n };\n};\n/**\n * Before/After save hook\n */\nexport const beforeSave = () => {\n return function decorateAsHook(target, property) {\n target.boot();\n target.before('save', target[property].bind(target));\n };\n};\nexport const afterSave = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('save', target[property].bind(target));\n };\n};\n/**\n * Before/After create hook\n */\nexport const beforeCreate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('create', target[property].bind(target));\n };\n};\nexport const afterCreate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('create', target[property].bind(target));\n };\n};\n/**\n * Before/After update hook\n */\nexport const beforeUpdate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('update', target[property].bind(target));\n };\n};\nexport const afterUpdate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('update', target[property].bind(target));\n };\n};\n/**\n * Before/After delete hook\n */\nexport const beforeDelete = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('delete', target[property].bind(target));\n };\n};\nexport const afterDelete = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('delete', target[property].bind(target));\n };\n};\n/**\n * Before/After find hook\n */\nexport const beforeFind = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('find', target[property].bind(target));\n };\n};\nexport const afterFind = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('find', target[property].bind(target));\n };\n};\n/**\n * Before/After fetchs hook\n */\nexport const beforeFetch = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('fetch', target[property].bind(target));\n };\n};\nexport const afterFetch = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('fetch', target[property].bind(target));\n };\n};\n/**\n * Before/After paginate hook\n */\nexport const beforePaginate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.before('paginate', target[property].bind(target));\n };\n};\nexport const afterPaginate = () => {\n return function decorateAsColumn(target, property) {\n target.boot();\n target.after('paginate', target[property].bind(target));\n };\n};\n","// src/runner.ts\nimport { debuglog } from \"util\";\nvar debug = debuglog(\"poppinss:hooks\");\nvar Runner = class {\n constructor(action, hookHandlers) {\n this.action = action;\n this.#hookHandlers = hookHandlers || /* @__PURE__ */ new Set();\n }\n /**\n * A collection of registered hook handlers\n */\n #hookHandlers;\n /**\n * Cleanup handlers should always be an array of functions. Using a set will\n * discard duplicates and it is very much possible for two hooks to return\n * a shared cleanup handler.\n */\n #cleanupHandlers = [];\n /**\n * State to perform the cleanup\n */\n #state = \"idle\";\n /**\n * A collection of handlers to ignore when executed them\n */\n #handlersToIgnore = [];\n /**\n * Whether or not to skip all the hooks\n */\n #skipAllHooks = false;\n /**\n * Find if cleanup is pending or not\n */\n get isCleanupPending() {\n return this.#state === \"cleanup_pending\";\n }\n /**\n * Filter to check if we should run the handler\n */\n #filter(handlerName) {\n return !this.#handlersToIgnore.includes(handlerName);\n }\n /**\n * Ignore specific or all hook handlers. Calling this\n * method multiple times will result in overwriting\n * the existing state.\n */\n without(handlersToIgnore) {\n if (!handlersToIgnore) {\n debug(\"skipping all hooks\");\n this.#skipAllHooks = true;\n } else {\n this.#skipAllHooks = false;\n debug(\"skipping %O hooks\", handlersToIgnore);\n this.#handlersToIgnore = handlersToIgnore;\n }\n return this;\n }\n /**\n * Executing hooks\n */\n async #exec(reverse, data) {\n if (this.#state !== \"idle\") {\n return;\n }\n this.#state = \"cleanup_pending\";\n if (this.#skipAllHooks) {\n return;\n }\n debug(\"running hooks\");\n const handlers = reverse ? Array.from(this.#hookHandlers).reverse() : this.#hookHandlers;\n for (let handler of handlers) {\n if (this.#filter(handler.name)) {\n if (handler.name) {\n debug(\"running hook %s\", handler.name);\n }\n const result = await (typeof handler === \"function\" ? handler(...data) : handler.handle(this.action, ...data));\n if (typeof result === \"function\") {\n if (handler.name) {\n debug(\"cleanup scheduled by %s hook\", handler.name);\n }\n this.#cleanupHandlers.push(result);\n }\n }\n }\n }\n /**\n * Execute handlers\n */\n async run(...data) {\n return this.#exec(false, data);\n }\n /**\n * Execute handlers in reverse order\n */\n async runReverse(...data) {\n return this.#exec(true, data);\n }\n /**\n * Execute cleanup actions\n */\n async cleanup(...data) {\n if (!this.isCleanupPending) {\n return;\n }\n this.#state = \"cleanup_initiated\";\n debug(\"performing cleanup\");\n let startIndex = this.#cleanupHandlers.length;\n while (startIndex--) {\n await this.#cleanupHandlers[startIndex](...data);\n }\n this.#state = \"cleanup_completed\";\n this.#cleanupHandlers = [];\n }\n};\n\n// src/hooks.ts\nvar Hooks = class {\n /**\n * A collection of registered hooks\n */\n #hooks = /* @__PURE__ */ new Map();\n /**\n * Get access to all the registered hooks. The return value is\n * a map of the event name and a set of handlers.\n */\n all() {\n return this.#hooks;\n }\n /**\n * Find if a handler for a given event exists.\n */\n has(event, handler) {\n const handlers = this.#hooks.get(event);\n if (!handlers) {\n return false;\n }\n return handlers.has(handler);\n }\n /**\n * Add a hook handler for a given event. Adding the same handler twice will\n * result in a noop.\n */\n add(event, handler) {\n const handlers = this.#hooks.get(event);\n if (!handlers) {\n this.#hooks.set(event, /* @__PURE__ */ new Set());\n }\n this.#hooks.get(event).add(handler);\n return this;\n }\n /**\n * Remove hook handler for a given event.\n */\n remove(event, handler) {\n const handlers = this.#hooks.get(event);\n if (!handlers) {\n return false;\n }\n return handlers.delete(handler);\n }\n /**\n * Clear all the hooks for a specific event or all the\n * events.\n */\n clear(event) {\n if (!event) {\n this.#hooks.clear();\n return;\n }\n this.#hooks.delete(event);\n }\n /**\n * Merge hooks from an existing hooks instance.\n */\n merge(hooks) {\n hooks.all().forEach((actionHooks, action) => {\n actionHooks.forEach((handler) => {\n this.add(action, handler);\n });\n });\n }\n /**\n * Returns an instance of the runner to run hooks\n */\n runner(action) {\n return new Runner(action, this.#hooks.get(action));\n }\n};\nexport {\n Hooks as default\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport * as errors from '../../errors.js';\n/**\n * Exposes the API to define and preload relationships in reference to\n * a model\n */\nexport class Preloader {\n model;\n preloads = {};\n /**\n * When invoked via query builder. The preloader will get the side-loaded\n * object, that should be transferred to relationship model instances.\n */\n sideloaded = {};\n debugQueries = false;\n constructor(model) {\n this.model = model;\n }\n /**\n * Processes a relationship for a single parent\n */\n async processRelation(name, parent, client) {\n const { relation, callback } = this.preloads[name];\n const query = relation\n .eagerQuery(parent, client)\n .debug(this.debugQueries)\n .sideload(this.sideloaded);\n /**\n * Pass query to end user for adding more constraints\n */\n if (typeof callback === 'function') {\n callback(query);\n }\n const result = await query.selectRelationKeys().exec();\n /**\n * hasOne and belongsTo will always return an array of a single row (if done right)\n */\n if (relation.type === 'hasOne' || relation.type === 'belongsTo') {\n relation.setRelated(parent, result[0] || null);\n return;\n }\n /**\n * Set array of related instances\n */\n relation.setRelated(parent, result);\n }\n /**\n * Process a given relationship for many parent instances. This happens\n * during eager-loading\n */\n async processRelationForMany(name, parent, client) {\n const { relation, callback } = this.preloads[name];\n const query = relation\n .eagerQuery(parent, client)\n .debug(this.debugQueries)\n .sideload(this.sideloaded);\n /**\n * Pass query to end user for adding more constraints\n */\n if (typeof callback === 'function') {\n callback(query);\n }\n const result = await query.selectRelationKeys().exec();\n /**\n * Set array of related instances\n */\n relation.setRelatedForMany(parent, result);\n }\n /**\n * Define a relationship to preload\n */\n load(name, callback) {\n const relation = this.model.$getRelation(name);\n if (!relation) {\n throw new errors.E_UNDEFINED_RELATIONSHIP([name, this.model.name]);\n }\n relation.boot();\n this.preloads[name] = {\n relation: relation,\n callback: callback,\n };\n return this;\n }\n /**\n * Alias for \"this.load\"\n */\n preload(name, callback) {\n return this.load(name, callback);\n }\n /**\n * Define a relationship to preload, but only if they are not\n * already preloaded\n */\n preloadOnce(name) {\n if (!this.preloads[name]) {\n return this.load(name);\n }\n return this;\n }\n /**\n * Toggle query debugging\n */\n debug(debug) {\n this.debugQueries = debug;\n return this;\n }\n /**\n * Define attributes to be passed to all the model instance as\n * side-loaded attributes\n */\n sideload(values) {\n this.sideloaded = values;\n return this;\n }\n /**\n * Clone preloader instance\n */\n clone() {\n const clone = new Preloader(this.model);\n clone.preloads = Object.assign({}, this.preloads);\n clone.sideloaded = Object.assign({}, this.sideloaded);\n clone.debugQueries = this.debugQueries;\n return clone;\n }\n /**\n * Process of all the preloaded relationships for a single parent\n */\n async processAllForOne(parent, client) {\n await Promise.all(Object.keys(this.preloads).map((relationName) => {\n return this.processRelation(relationName, parent, client);\n }));\n }\n /**\n * Process of all the preloaded relationships for many parents\n */\n async processAllForMany(parent, client) {\n if (!parent.length) {\n return;\n }\n await Promise.all(Object.keys(this.preloads).map((relationName) => {\n return this.processRelationForMany(relationName, parent, client);\n }));\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * A proxy trap to add support for custom getters and setters\n */\nexport const proxyHandler = {\n get(target, key, receiver) {\n const Model = target.constructor;\n const column = Model.$getColumn(key);\n /**\n * Fetch the attribute value, when attribute exists and\n * doesn't have a getter\n */\n if (column && !column.hasGetter) {\n const attributeValue = target.$getAttribute(key);\n if (attributeValue === undefined) {\n return Reflect.get(target, key, receiver);\n }\n return attributeValue;\n }\n /**\n * Fetch the relation when property is defined as a relationship\n */\n const relation = Model.$getRelation(key);\n if (relation) {\n return target.$getRelated(key);\n }\n return Reflect.get(target, key, receiver);\n },\n set(target, key, value, receiver) {\n const Model = target.constructor;\n const column = Model.$getColumn(key);\n /**\n * Set value as an attribute when column is defined and\n * their isn't any setter for it.\n */\n if (column && !column.hasSetter) {\n target.$setAttribute(key, value);\n Reflect.set(target, key, value, receiver);\n return true;\n }\n /**\n * Fetch the relation when property is defined as a relationship\n */\n const relation = Model.$getRelation(key);\n if (relation) {\n target.$setRelated(key, value);\n return true;\n }\n return Reflect.set(target, key, value, receiver);\n },\n defineProperty(target, key, value) {\n const Model = target.constructor;\n const column = Model.$getColumn(key);\n /**\n * Set the attribute along side defining the property\n */\n if (column && !column.hasSetter && value.value !== undefined) {\n target.$setAttribute(key, value.value);\n }\n return Reflect.defineProperty(target, key, value);\n },\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * Exposes the API to collect, get and resolve model keys\n */\nexport class ModelKeys {\n keys;\n constructor(keys = {}) {\n this.keys = keys;\n }\n /**\n * Add a new key\n */\n add(key, value) {\n this.keys[key] = value;\n }\n get(key, defaultValue) {\n return this.keys[key] || defaultValue;\n }\n /**\n * Resolve key, if unable to resolve, the key will be\n * returned as it is.\n */\n resolve(key) {\n return this.get(key, key);\n }\n /**\n * Return all keys\n */\n all() {\n return this.keys;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport * as errors from '../../errors.js';\n/**\n * Utility to consistently extract relationship keys from the model\n * and the relation model.\n */\nexport class KeysExtractor {\n model;\n relationName;\n keys;\n constructor(model, relationName, keys) {\n this.model = model;\n this.relationName = relationName;\n this.keys = keys;\n }\n /**\n * Extract the defined keys from the models\n */\n extract() {\n const relationRef = `${this.model.name}.${this.relationName}`;\n return Object.keys(this.keys).reduce((result, extractKey) => {\n const { key, model } = this.keys[extractKey];\n const attribute = model.$getColumn(key);\n if (!attribute) {\n throw new errors.E_MISSING_MODEL_ATTRIBUTE([relationRef, key, model.name]);\n }\n result[extractKey] = {\n attributeName: key,\n columnName: attribute.columnName,\n };\n return result;\n }, {});\n }\n}\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport slash from 'slash';\nimport { join, extname } from 'node:path';\nimport { Exception, fsReadAll, isScriptFile } from '@poppinss/utils';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport * as errors from '../errors.js';\nimport { DateTime } from 'luxon';\nimport equal from 'fast-deep-equal';\n/**\n * Ensure that relation is defined\n */\nexport function ensureRelation(name, relation) {\n if (!relation) {\n throw new Exception(`Cannot process unregistered relationship ${name}`, { status: 500 });\n }\n return true;\n}\n/**\n * Ensure a key value is not null or undefined inside an object.\n */\nexport function ensureValue(collection, key, missingCallback) {\n const value = collection[key];\n if (value === undefined || value === null) {\n missingCallback();\n return;\n }\n return value;\n}\n/**\n * Collects values for a key inside an array. Similar to `Array.map`, but\n * reports missing values.\n */\nexport function collectValues(payload, key, missingCallback) {\n return payload.map((row) => {\n return ensureValue(row, key, missingCallback);\n });\n}\n/**\n * Transform value if it is an instance of DateTime, so it can be processed by query builder\n */\nexport function transformDateValue(value, dialect) {\n if (DateTime.isDateTime(value)) {\n return value.toFormat(dialect.dateTimeFormat);\n }\n return value;\n}\n/**\n * Compare two values deeply whether they are equal or not\n */\nexport function compareValues(valueA, valueB) {\n if (DateTime.isDateTime(valueA) || DateTime.isDateTime(valueB)) {\n return DateTime.isDateTime(valueA) && DateTime.isDateTime(valueB)\n ? valueA.equals(valueB)\n : valueA === valueB;\n }\n else {\n return equal(valueA, valueB);\n }\n}\n/**\n * Raises exception when a relationship `booted` property is false.\n */\nexport function ensureRelationIsBooted(relation) {\n if (!relation.booted) {\n throw new errors.E_RUNTIME_EXCEPTION([\n 'Relationship is not booted. Make sure to call boot first',\n ]);\n }\n}\n/**\n * Returns the value for a key from the model instance and raises descriptive\n * exception when the value is missing\n */\nexport function getValue(model, key, relation, action = 'preload') {\n return ensureValue(model, key, () => {\n throw new Exception(`Cannot ${action} \"${relation.relationName}\", value of \"${relation.model.name}.${key}\" is undefined`, { status: 500 });\n });\n}\n/**\n * Helper to find if value is a valid Object or\n * not\n */\nexport function isObject(value) {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n/**\n * Drops duplicate values from an array\n */\nexport function unique(value) {\n if (!Array.isArray(value)) {\n return [];\n }\n return [...new Set(value)];\n}\n/**\n * Returns a diff of rows to be updated or inserted when performing\n * a many to many `attach`\n */\nexport function syncDiff(original, incoming) {\n const diff = Object.keys(incoming).reduce((result, incomingRowId) => {\n const originalRow = original[incomingRowId];\n const incomingRow = incoming[incomingRowId];\n /**\n * When there isn't any matching row, we need to insert\n * the upcoming row\n */\n if (!originalRow) {\n result.added[incomingRowId] = incomingRow;\n }\n else if (Object.keys(incomingRow).find((key) => incomingRow[key] !== originalRow[key])) {\n /**\n * If any of the row attributes are different, then we must\n * update that row\n */\n result.updated[incomingRowId] = incomingRow;\n }\n return result;\n }, { added: {}, updated: {} });\n return diff;\n}\n/**\n * Invokes a callback by wrapping it inside managed transaction\n * when passed client is not transaction itself.\n */\nexport async function managedTransaction(client, callback) {\n const isManagedTransaction = !client.isTransaction;\n const trx = client.isTransaction\n ? client\n : await client.transaction();\n if (!isManagedTransaction) {\n return callback(trx);\n }\n try {\n const response = await callback(trx);\n await trx.commit();\n return response;\n }\n catch (error) {\n await trx.rollback();\n throw error;\n }\n}\n/**\n * Returns the sql method for a DDL statement\n */\nexport function getDDLMethod(sql) {\n sql = sql.toLowerCase();\n if (sql.startsWith('create')) {\n return 'create';\n }\n if (sql.startsWith('alter')) {\n return 'alter';\n }\n if (sql.startsWith('drop')) {\n return 'drop';\n }\n return 'unknown';\n}\n/**\n * Normalizes the cherry-picking object to always be an object with\n * `pick` and `omit` properties\n */\nexport function normalizeCherryPickObject(fields) {\n if (Array.isArray(fields)) {\n return {\n pick: fields,\n omit: [],\n };\n }\n return {\n pick: fields.pick,\n omit: fields.omit,\n };\n}\n/**\n * Sources files from a given directory\n */\nexport async function sourceFiles(fromLocation, directory, naturalSort) {\n const absDirectoryPath = fileURLToPath(new URL(directory, fromLocation));\n let files = await fsReadAll(absDirectoryPath, {\n filter: isScriptFile,\n ignoreMissingRoot: true,\n });\n /**\n * Sort files\n */\n if (naturalSort) {\n files = files.sort((a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' }));\n }\n else {\n files = files.sort();\n }\n return {\n directory,\n files: files.map((file) => {\n const name = join(directory, file.replace(RegExp(`${extname(file)}$`), ''));\n return {\n /**\n * Absolute path to the file. Needed to ready the schema source\n */\n absPath: join(absDirectoryPath, file),\n /**\n * Normalizing name to always have unix slashes.\n */\n name: slash(name),\n /**\n * Import schema file\n */\n async getSource() {\n const exports = await import(pathToFileURL(this.absPath).href);\n if (!exports.default) {\n throw new Error(`Missing default export from \"${this.name}\" schema file`);\n }\n return exports.default;\n },\n };\n }),\n };\n}\n","'use strict';\n\n/** @type {import('./type')} */\nmodule.exports = TypeError;\n","module.exports = require('util').inspect;\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nvar quotes = {\n __proto__: null,\n 'double': '\"',\n single: \"'\"\n};\nvar quoteREs = {\n __proto__: null,\n 'double': /([\"\\\\])/g,\n single: /(['\\\\])/g\n};\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other\n /* eslint-env browser */\n if (typeof window !== 'undefined' && obj === window) {\n return '{ [object Window] }';\n }\n if (\n (typeof globalThis !== 'undefined' && obj === globalThis)\n || (typeof global !== 'undefined' && obj === global)\n ) {\n return '{ [object globalThis] }';\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var style = opts.quoteStyle || defaultStyle;\n var quoteChar = quotes[style];\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction canTrustToString(obj) {\n return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));\n}\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n var quoteRE = quoteREs[opts.quoteStyle || 'single'];\n quoteRE.lastIndex = 0;\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, quoteRE, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar inspect = require('object-inspect');\n\nvar $TypeError = require('es-errors/type');\n\n/*\n* This function traverses the list returning the node corresponding to the given key.\n*\n* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.\n* By doing so, all the recently used nodes can be accessed relatively quickly.\n*/\n/** @type {import('./list.d.ts').listGetNode} */\n// eslint-disable-next-line consistent-return\nvar listGetNode = function (list, key, isDelete) {\n\t/** @type {typeof list | NonNullable<(typeof list)['next']>} */\n\tvar prev = list;\n\t/** @type {(typeof list)['next']} */\n\tvar curr;\n\t// eslint-disable-next-line eqeqeq\n\tfor (; (curr = prev.next) != null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tif (!isDelete) {\n\t\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\t\tcurr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);\n\t\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\t}\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\n/** @type {import('./list.d.ts').listGet} */\nvar listGet = function (objects, key) {\n\tif (!objects) {\n\t\treturn void undefined;\n\t}\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\n/** @type {import('./list.d.ts').listSet} */\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t});\n\t}\n};\n/** @type {import('./list.d.ts').listHas} */\nvar listHas = function (objects, key) {\n\tif (!objects) {\n\t\treturn false;\n\t}\n\treturn !!listGetNode(objects, key);\n};\n/** @type {import('./list.d.ts').listDelete} */\n// eslint-disable-next-line consistent-return\nvar listDelete = function (objects, key) {\n\tif (objects) {\n\t\treturn listGetNode(objects, key, true);\n\t}\n};\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannelList() {\n\t/** @typedef {ReturnType<typeof getSideChannelList>} Channel */\n\t/** @typedef {Parameters<Channel['get']>[0]} K */\n\t/** @typedef {Parameters<Channel['set']>[1]} V */\n\n\t/** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\tvar root = $o && $o.next;\n\t\t\tvar deletedNode = listDelete($o, key);\n\t\t\tif (deletedNode && root && root === deletedNode) {\n\t\t\t\t$o = void undefined;\n\t\t\t}\n\t\t\treturn !!deletedNode;\n\t\t},\n\t\tget: function (key) {\n\t\t\treturn listGet($o, key);\n\t\t},\n\t\thas: function (key) {\n\t\t\treturn listHas($o, key);\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$o) {\n\t\t\t\t// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head\n\t\t\t\t$o = {\n\t\t\t\t\tnext: void undefined\n\t\t\t\t};\n\t\t\t}\n\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\tlistSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value);\n\t\t}\n\t};\n\t// @ts-expect-error TODO: figure out why this is erroring\n\treturn channel;\n};\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Object;\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Error;\n","'use strict';\n\n/** @type {import('./eval')} */\nmodule.exports = EvalError;\n","'use strict';\n\n/** @type {import('./range')} */\nmodule.exports = RangeError;\n","'use strict';\n\n/** @type {import('./ref')} */\nmodule.exports = ReferenceError;\n","'use strict';\n\n/** @type {import('./syntax')} */\nmodule.exports = SyntaxError;\n","'use strict';\n\n/** @type {import('./uri')} */\nmodule.exports = URIError;\n","'use strict';\n\n/** @type {import('./abs')} */\nmodule.exports = Math.abs;\n","'use strict';\n\n/** @type {import('./floor')} */\nmodule.exports = Math.floor;\n","'use strict';\n\n/** @type {import('./max')} */\nmodule.exports = Math.max;\n","'use strict';\n\n/** @type {import('./min')} */\nmodule.exports = Math.min;\n","'use strict';\n\n/** @type {import('./pow')} */\nmodule.exports = Math.pow;\n","'use strict';\n\n/** @type {import('./round')} */\nmodule.exports = Math.round;\n","'use strict';\n\n/** @type {import('./isNaN')} */\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\n/** @type {import('./sign')} */\nmodule.exports = function sign(number) {\n\tif ($isNaN(number) || number === 0) {\n\t\treturn number;\n\t}\n\treturn number < 0 ? -1 : +1;\n};\n","'use strict';\n\n/** @type {import('./gOPD')} */\nmodule.exports = Object.getOwnPropertyDescriptor;\n","'use strict';\n\n/** @type {import('.')} */\nvar $gOPD = require('./gOPD');\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\n/** @type {import('.')} */\nvar $defineProperty = Object.defineProperty || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n","'use strict';\n\n/** @type {import('./shams')} */\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\t/** @type {{ [k in symbol]?: unknown }} */\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\t// eslint-disable-next-line no-extra-parens\n\t\tvar descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\n/** @type {import('.')} */\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/** @type {import('./Reflect.getPrototypeOf')} */\nmodule.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;\n","'use strict';\n\nvar $Object = require('es-object-atoms');\n\n/** @type {import('./Object.getPrototypeOf')} */\nmodule.exports = $Object.getPrototypeOf || null;\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\n/** @type {import('./functionCall')} */\nmodule.exports = Function.prototype.call;\n","'use strict';\n\n/** @type {import('./functionApply')} */\nmodule.exports = Function.prototype.apply;\n","'use strict';\n\n/** @type {import('./reflectApply')} */\nmodule.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;\n","'use strict';\n\nvar bind = require('function-bind');\n\nvar $apply = require('./functionApply');\nvar $call = require('./functionCall');\nvar $reflectApply = require('./reflectApply');\n\n/** @type {import('./actualApply')} */\nmodule.exports = $reflectApply || bind.call($call, $apply);\n","'use strict';\n\nvar bind = require('function-bind');\nvar $TypeError = require('es-errors/type');\n\nvar $call = require('./functionCall');\nvar $actualApply = require('./actualApply');\n\n/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */\nmodule.exports = function callBindBasic(args) {\n\tif (args.length < 1 || typeof args[0] !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\treturn $actualApply(bind, $call, args);\n};\n","'use strict';\n\nvar callBind = require('call-bind-apply-helpers');\nvar gOPD = require('gopd');\n\nvar hasProtoAccessor;\ntry {\n\t// eslint-disable-next-line no-extra-parens, no-proto\n\thasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;\n} catch (e) {\n\tif (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {\n\t\tthrow e;\n\t}\n}\n\n// eslint-disable-next-line no-extra-parens\nvar desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));\n\nvar $Object = Object;\nvar $getPrototypeOf = $Object.getPrototypeOf;\n\n/** @type {import('./get')} */\nmodule.exports = desc && typeof desc.get === 'function'\n\t? callBind([desc.get])\n\t: typeof $getPrototypeOf === 'function'\n\t\t? /** @type {import('./get')} */ function getDunder(value) {\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\treturn $getPrototypeOf(value == null ? value : $Object(value));\n\t\t}\n\t\t: false;\n","'use strict';\n\nvar reflectGetProto = require('./Reflect.getPrototypeOf');\nvar originalGetProto = require('./Object.getPrototypeOf');\n\nvar getDunderProto = require('dunder-proto/get');\n\n/** @type {import('.')} */\nmodule.exports = reflectGetProto\n\t? function getProto(O) {\n\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\treturn reflectGetProto(O);\n\t}\n\t: originalGetProto\n\t\t? function getProto(O) {\n\t\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\t\tthrow new TypeError('getProto: not an object');\n\t\t\t}\n\t\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\t\treturn originalGetProto(O);\n\t\t}\n\t\t: getDunderProto\n\t\t\t? function getProto(O) {\n\t\t\t\t// @ts-expect-error TS can't narrow inside a closure, for some reason\n\t\t\t\treturn getDunderProto(O);\n\t\t\t}\n\t\t\t: null;\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar undefined;\n\nvar $Object = require('es-object-atoms');\n\nvar $Error = require('es-errors');\nvar $EvalError = require('es-errors/eval');\nvar $RangeError = require('es-errors/range');\nvar $ReferenceError = require('es-errors/ref');\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\nvar $URIError = require('es-errors/uri');\n\nvar abs = require('math-intrinsics/abs');\nvar floor = require('math-intrinsics/floor');\nvar max = require('math-intrinsics/max');\nvar min = require('math-intrinsics/min');\nvar pow = require('math-intrinsics/pow');\nvar round = require('math-intrinsics/round');\nvar sign = require('math-intrinsics/sign');\n\nvar $Function = Function;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = require('gopd');\nvar $defineProperty = require('es-define-property');\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = require('get-proto');\nvar $ObjectGPO = require('get-proto/Object.getPrototypeOf');\nvar $ReflectGPO = require('get-proto/Reflect.getPrototypeOf');\n\nvar $apply = require('call-bind-apply-helpers/functionApply');\nvar $call = require('call-bind-apply-helpers/functionCall');\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t__proto__: null,\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': $Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': $EvalError,\n\t'%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': $Object,\n\t'%Object.getOwnPropertyDescriptor%': $gOPD,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': $RangeError,\n\t'%ReferenceError%': $ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': $URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,\n\n\t'%Function.prototype.call%': $call,\n\t'%Function.prototype.apply%': $apply,\n\t'%Object.defineProperty%': $defineProperty,\n\t'%Object.getPrototypeOf%': $ObjectGPO,\n\t'%Math.abs%': abs,\n\t'%Math.floor%': floor,\n\t'%Math.max%': max,\n\t'%Math.min%': min,\n\t'%Math.pow%': pow,\n\t'%Math.round%': round,\n\t'%Math.sign%': sign,\n\t'%Reflect.getPrototypeOf%': $ReflectGPO\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t__proto__: null,\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call($call, Array.prototype.concat);\nvar $spliceApply = bind.call($apply, Array.prototype.splice);\nvar $replace = bind.call($call, String.prototype.replace);\nvar $strSlice = bind.call($call, String.prototype.slice);\nvar $exec = bind.call($call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBindBasic = require('call-bind-apply-helpers');\n\n/** @type {(thisArg: string, searchString: string, position?: number) => number} */\nvar $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);\n\n/** @type {import('.')} */\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\t/* eslint no-extra-parens: 0 */\n\n\tvar intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBindBasic(/** @type {const} */ ([intrinsic]));\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = require('es-errors/type');\nvar $Map = GetIntrinsic('%Map%', true);\n\n/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */\nvar $mapGet = callBound('Map.prototype.get', true);\n/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */\nvar $mapSet = callBound('Map.prototype.set', true);\n/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */\nvar $mapHas = callBound('Map.prototype.has', true);\n/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */\nvar $mapDelete = callBound('Map.prototype.delete', true);\n/** @type {<K, V>(thisArg: Map<K, V>) => number} */\nvar $mapSize = callBound('Map.prototype.size', true);\n\n/** @type {import('.')} */\nmodule.exports = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {\n\t/** @typedef {ReturnType<typeof getSideChannelMap>} Channel */\n\t/** @typedef {Parameters<Channel['get']>[0]} K */\n\t/** @typedef {Parameters<Channel['set']>[1]} V */\n\n\t/** @type {Map<K, V> | undefined} */ var $m;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\tif ($m) {\n\t\t\t\tvar result = $mapDelete($m, key);\n\t\t\t\tif ($mapSize($m) === 0) {\n\t\t\t\t\t$m = void undefined;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($m) {\n\t\t\t\treturn $mapGet($m, key);\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($m) {\n\t\t\t\treturn $mapHas($m, key);\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$m) {\n\t\t\t\t// @ts-expect-error TS can't handle narrowing a variable inside a closure\n\t\t\t\t$m = new $Map();\n\t\t\t}\n\t\t\t$mapSet($m, key, value);\n\t\t}\n\t};\n\n\t// @ts-expect-error TODO: figure out why TS is erroring here\n\treturn channel;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bound');\nvar inspect = require('object-inspect');\nvar getSideChannelMap = require('side-channel-map');\n\nvar $TypeError = require('es-errors/type');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\n\n/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\n/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\n/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\n/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */\nvar $weakMapDelete = callBound('WeakMap.prototype.delete', true);\n\n/** @type {import('.')} */\nmodule.exports = $WeakMap\n\t? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() {\n\t\t/** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */\n\t\t/** @typedef {Parameters<Channel['get']>[0]} K */\n\t\t/** @typedef {Parameters<Channel['set']>[1]} V */\n\n\t\t/** @type {WeakMap<K & object, V> | undefined} */ var $wm;\n\t\t/** @type {Channel | undefined} */ var $m;\n\n\t\t/** @type {Channel} */\n\t\tvar channel = {\n\t\t\tassert: function (key) {\n\t\t\t\tif (!channel.has(key)) {\n\t\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t\t}\n\t\t\t},\n\t\t\t'delete': function (key) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif ($wm) {\n\t\t\t\t\t\treturn $weakMapDelete($wm, key);\n\t\t\t\t\t}\n\t\t\t\t} else if (getSideChannelMap) {\n\t\t\t\t\tif ($m) {\n\t\t\t\t\t\treturn $m['delete'](key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tget: function (key) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif ($wm) {\n\t\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $m && $m.get(key);\n\t\t\t},\n\t\t\thas: function (key) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif ($wm) {\n\t\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn !!$m && $m.has(key);\n\t\t\t},\n\t\t\tset: function (key, value) {\n\t\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\t\tif (!$wm) {\n\t\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t\t}\n\t\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t\t} else if (getSideChannelMap) {\n\t\t\t\t\tif (!$m) {\n\t\t\t\t\t\t$m = getSideChannelMap();\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\t\t\t/** @type {NonNullable<typeof $m>} */ ($m).set(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// @ts-expect-error TODO: figure out why this is erroring\n\t\treturn channel;\n\t}\n\t: getSideChannelMap;\n","'use strict';\n\nvar $TypeError = require('es-errors/type');\nvar inspect = require('object-inspect');\nvar getSideChannelList = require('side-channel-list');\nvar getSideChannelMap = require('side-channel-map');\nvar getSideChannelWeakMap = require('side-channel-weakmap');\n\nvar makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannel() {\n\t/** @typedef {ReturnType<typeof getSideChannel>} Channel */\n\n\t/** @type {Channel | undefined} */ var $channelData;\n\n\t/** @type {Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\t'delete': function (key) {\n\t\t\treturn !!$channelData && $channelData['delete'](key);\n\t\t},\n\t\tget: function (key) {\n\t\t\treturn $channelData && $channelData.get(key);\n\t\t},\n\t\thas: function (key) {\n\t\t\treturn !!$channelData && $channelData.has(key);\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif (!$channelData) {\n\t\t\t\t$channelData = makeChannel();\n\t\t\t}\n\n\t\t\t$channelData.set(key, value);\n\t\t}\n\t};\n\t// @ts-expect-error TODO: figure out why this is erroring\n\treturn channel;\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n","'use strict';\n\nvar formats = require('./formats');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? { __proto__: null } : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object' && typeof source !== 'function') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if (\n (options && (options.plainObjects || options.allowPrototypes))\n || !has.call(Object.prototype, source)\n ) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, defaultDecoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar limit = 1024;\n\n/* eslint operator-linebreak: [2, \"before\"] */\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var j = 0; j < string.length; j += limit) {\n var segment = string.length >= limit ? string.slice(j, j + limit) : string;\n var arr = [];\n\n for (var i = 0; i < segment.length; ++i) {\n var c = segment.charCodeAt(i);\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n arr[arr.length] = segment.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n arr[arr.length] = hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n arr[arr.length] = hexTable[0xC0 | (c >> 6)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n arr[arr.length] = hexTable[0xE0 | (c >> 12)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));\n\n arr[arr.length] = hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n out += arr.join('');\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","'use strict';\n\nvar getSideChannel = require('side-channel');\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n allowEmptyArrays: false,\n arrayFormat: 'indices',\n charset: 'utf-8',\n charsetSentinel: false,\n commaRoundTrip: false,\n delimiter: '&',\n encode: true,\n encodeDotInKeys: false,\n encoder: utils.encode,\n encodeValuesOnly: false,\n filter: void undefined,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n if (encodeValuesOnly && encoder) {\n obj = utils.maybeMap(obj, encoder);\n }\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\\./g, '%2E') : String(prefix);\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;\n\n if (allowEmptyArrays && isArray(obj) && obj.length === 0) {\n return adjustedPrefix + '[]';\n }\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && key && typeof key.value !== 'undefined'\n ? key.value\n : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\\./g, '%2E') : String(key);\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {\n throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n var arrayFormat;\n if (opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if ('indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = defaults.arrayFormat;\n }\n\n if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n arrayFormat: arrayFormat,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n commaRoundTrip: !!opts.commaRoundTrip,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];\n var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n var value = obj[key];\n\n if (options.skipNulls && value === null) {\n continue;\n }\n pushToArray(keys, stringify(\n value,\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.allowEmptyArrays,\n options.strictNullHandling,\n options.skipNulls,\n options.encodeDotInKeys,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowEmptyArrays: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decodeDotInKeys: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n duplicates: 'combine',\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictDepth: false,\n strictNullHandling: false,\n throwOnLimitExceeded: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options, currentArrayLength) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {\n throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = { __proto__: null };\n\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(\n options.delimiter,\n options.throwOnLimitExceeded ? limit + 1 : limit\n );\n\n if (options.throwOnLimitExceeded && parts.length > limit) {\n throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');\n }\n\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key;\n var val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n\n val = utils.maybeMap(\n parseArrayValue(\n part.slice(pos + 1),\n options,\n isArray(obj[key]) ? obj[key].length : 0\n ),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(String(val));\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n var existing = has.call(obj, key);\n if (existing && options.duplicates === 'combine') {\n obj[key] = utils.combine(obj[key], val);\n } else if (!existing || options.duplicates === 'last') {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var currentArrayLength = 0;\n if (chain.length > 0 && chain[chain.length - 1] === '[]') {\n var parentKey = chain.slice(0, -1).join('');\n currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;\n }\n\n var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))\n ? []\n : utils.combine([], leaf);\n } else {\n obj = options.plainObjects ? { __proto__: null } : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;\n var index = parseInt(decodedRoot, 10);\n if (!options.parseArrays && decodedRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== decodedRoot\n && String(index) === decodedRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (decodedRoot !== '__proto__') {\n obj[decodedRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, check strictDepth option for throw, else just add whatever is left\n\n if (segment) {\n if (options.strictDepth === true) {\n throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');\n }\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {\n throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {\n throw new TypeError('`throwOnLimitExceeded` option must be a boolean');\n }\n\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;\n\n if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {\n throw new TypeError('The duplicates option must be either combine, first, or last');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n duplicates: duplicates,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,\n throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? { __proto__: null } : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? { __proto__: null } : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","import \"../../chunk-2KG3PWR4.js\";\n\n// src/string/main.ts\nimport string from \"@poppinss/string\";\nvar main_default = string;\nexport {\n main_default as default\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport string from '@poppinss/utils/string';\n/**\n * Camelcase naming strategy for the model to use camelcase keys\n * for the serialized output.\n */\nexport class CamelCaseNamingStrategy {\n /**\n * The default table name for the given model\n */\n tableName(model) {\n return string.pluralize(string.snakeCase(model.name));\n }\n /**\n * The database column name for a given model attribute\n */\n columnName(_, attributeName) {\n return string.snakeCase(attributeName);\n }\n /**\n * The post serialization name for a given model attribute\n */\n serializedName(_, attributeName) {\n return string.camelCase(attributeName);\n }\n /**\n * The local key for a given model relationship\n */\n relationLocalKey(relation, model, relatedModel) {\n if (relation === 'belongsTo') {\n return relatedModel.primaryKey;\n }\n return model.primaryKey;\n }\n /**\n * The foreign key for a given model relationship\n */\n relationForeignKey(relation, model, relatedModel) {\n if (relation === 'belongsTo') {\n return string.camelCase(`${relatedModel.name}_${relatedModel.primaryKey}`);\n }\n return string.camelCase(`${model.name}_${model.primaryKey}`);\n }\n /**\n * Pivot table name for many to many relationship\n */\n relationPivotTable(_, model, relatedModel) {\n return string.snakeCase([relatedModel.name, model.name].sort().join('_'));\n }\n /**\n * Pivot foreign key for many to many relationship\n */\n relationPivotForeignKey(_, model) {\n return string.snakeCase(`${model.name}_${model.primaryKey}`);\n }\n /**\n * Keys for the pagination meta\n */\n paginationMetaKeys() {\n return {\n total: 'total',\n perPage: 'perPage',\n currentPage: 'currentPage',\n lastPage: 'lastPage',\n firstPage: 'firstPage',\n firstPageUrl: 'firstPageUrl',\n lastPageUrl: 'lastPageUrl',\n nextPageUrl: 'nextPageUrl',\n previousPageUrl: 'previousPageUrl',\n };\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { stringify } from 'qs';\nimport { CamelCaseNamingStrategy } from '../../orm/naming_strategies/camel_case.js';\n/**\n * Simple paginator works with the data set provided by the standard\n * `offset` and `limit` based pagination.\n */\nexport class SimplePaginator extends Array {\n totalNumber;\n perPage;\n currentPage;\n qs = {};\n url = '/';\n rows;\n /**\n * Naming strategy for the pagination meta keys\n */\n static namingStrategy = new CamelCaseNamingStrategy();\n /**\n * Can be defined at per instance level as well\n */\n namingStrategy = SimplePaginator.namingStrategy;\n /**\n * The first page is always 1\n */\n firstPage = 1;\n /**\n * Find if results set is empty or not\n */\n isEmpty;\n /**\n * Casting `total` to a number. Later, we can think of situations\n * to cast it to a bigint\n */\n total;\n /**\n * Find if there are total records or not. This is not same as\n * `isEmpty`.\n *\n * The `isEmpty` reports about the current set of results. However `hasTotal`\n * reports about the total number of records, regardless of the current.\n */\n hasTotal;\n /**\n * The Last page number\n */\n lastPage;\n /**\n * Find if there are more pages to come\n */\n hasMorePages;\n /**\n * Find if there are enough results to be paginated or not\n */\n hasPages;\n constructor(totalNumber, perPage, currentPage, ...rows) {\n super(...rows);\n this.totalNumber = totalNumber;\n this.perPage = perPage;\n this.currentPage = currentPage;\n this.rows = rows;\n this.isEmpty = this.rows.length === 0;\n this.total = Number(this.totalNumber);\n this.hasTotal = this.total > 0;\n this.lastPage = Math.max(Math.ceil(this.total / this.perPage), 1);\n this.hasPages = this.lastPage !== 1;\n this.hasMorePages = this.lastPage > this.currentPage;\n }\n /**\n * A reference to the result rows\n */\n all() {\n return this.rows;\n }\n /**\n * Returns JSON meta data\n */\n getMeta() {\n const metaKeys = this.namingStrategy.paginationMetaKeys();\n return {\n [metaKeys.total]: this.total,\n [metaKeys.perPage]: this.perPage,\n [metaKeys.currentPage]: this.currentPage,\n [metaKeys.lastPage]: this.lastPage,\n [metaKeys.firstPage]: this.firstPage,\n [metaKeys.firstPageUrl]: this.getUrl(1),\n [metaKeys.lastPageUrl]: this.getUrl(this.lastPage),\n [metaKeys.nextPageUrl]: this.getNextPageUrl(),\n [metaKeys.previousPageUrl]: this.getPreviousPageUrl(),\n };\n }\n /**\n * Returns JSON representation of the paginated\n * data\n */\n toJSON() {\n return {\n meta: this.getMeta(),\n data: this.all(),\n };\n }\n /**\n * Define query string to be appended to the pagination links\n */\n queryString(values) {\n this.qs = values;\n return this;\n }\n /**\n * Define base url for making the pagination links\n */\n baseUrl(url) {\n this.url = url;\n return this;\n }\n /**\n * Returns url for a given page. Doesn't validates the integrity of the\n * page\n */\n getUrl(page) {\n const qs = stringify(Object.assign({}, this.qs, { page: page < 1 ? 1 : page }));\n return `${this.url}?${qs}`;\n }\n /**\n * Returns url for the next page\n */\n getNextPageUrl() {\n if (this.hasMorePages) {\n return this.getUrl(this.currentPage + 1);\n }\n return null;\n }\n /**\n * Returns URL for the previous page\n */\n getPreviousPageUrl() {\n if (this.currentPage > 1) {\n return this.getUrl(this.currentPage - 1);\n }\n return null;\n }\n /**\n * Returns an array of urls under a given range\n */\n getUrlsForRange(start, end) {\n let urls = [];\n for (let i = start; i <= end; i++) {\n urls.push({ url: this.getUrl(i), page: i, isActive: i === this.currentPage });\n }\n return urls;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { SimplePaginator } from '../../database/paginator/simple_paginator.js';\n/**\n * Model paginator extends the simple paginator and adds support for\n * serializing models as well\n */\nexport class ModelPaginator extends SimplePaginator {\n /**\n * Serialize models\n */\n serialize(cherryPick) {\n return {\n meta: this.getMeta(),\n data: this.all().map((row) => row.serialize(cherryPick)),\n };\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * Used for reporting queries using the profiler and the event\n * emitter\n */\nexport class QueryReporter {\n client;\n debug;\n data;\n eventName = 'db:query';\n startTime;\n isReady = false;\n constructor(client, debug, data) {\n this.client = client;\n this.debug = debug;\n this.data = data;\n }\n /**\n * Initiate the hrtime when there are one or more query listeners\n */\n initStartTime() {\n if (!this.client.emitter.hasListeners(this.eventName) || !this.debug) {\n return;\n }\n this.startTime = process.hrtime();\n }\n /**\n * Emit the query with duration\n */\n emitQueryEvent(error) {\n if (!this.startTime) {\n return;\n }\n const eventData = { duration: process.hrtime(this.startTime), ...this.data, error };\n this.client.emitter.emit(this.eventName, eventData);\n }\n /**\n * Begin query reporting. Data passed to this method will\n * overwrite the existing data object\n */\n begin(data) {\n this.isReady = true;\n this.data = data || this.data;\n this.initStartTime();\n return this;\n }\n /**\n * End query reporting\n */\n end(error) {\n if (!this.isReady) {\n return;\n }\n this.emitQueryEvent(error);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { Exception } from '@poppinss/utils';\nimport { QueryReporter } from '../query_reporter/index.js';\n/**\n * Query runner exposes the API for executing knex query builder by using the\n * read/write replicas supported only by Lucid.\n *\n * Also it will emit the query data and profile the queries as well.\n */\nexport class QueryRunner {\n client;\n debug;\n logData;\n reporter;\n constructor(client, debug, logData) {\n this.client = client;\n this.debug = debug;\n this.logData = logData;\n this.reporter = new QueryReporter(this.client, this.debug, this.logData);\n }\n /**\n * Is query dialect using sqlite database or not\n */\n isUsingSqlite() {\n return ['sqlite3', 'better-sqlite3', 'libsql'].includes(this.client.dialect.name);\n }\n /**\n * Find if query has a transaction attached to it, by using\n * `useTransaction` method\n */\n isInTransaction(query) {\n return query['client'].transacting;\n }\n /**\n * Find if query is a write query or not.\n */\n isWriteQuery(query) {\n return ['update', 'del', 'delete', 'insert'].includes(query['_method']);\n }\n /**\n * Returns read or write client by inspecting the query\n */\n getQueryClient(query) {\n return this.isWriteQuery(query) ? this.client.getWriteClient() : this.client.getReadClient();\n }\n /**\n * Executes the query by handling exceptions and returns it back\n * gracefully.\n */\n async executeQuery(query) {\n try {\n const result = await query;\n return [undefined, result];\n }\n catch (error) {\n return [error, undefined];\n }\n }\n /**\n * Executes the knex builder directly\n */\n async executeDirectly(query) {\n /**\n * We listen for query event on the knex query builder to avoid calling\n * toSQL too many times and also get the actual time it took to\n * execute the query\n */\n ;\n query['once']('query', (sql) => this.reporter.begin({ ...this.logData, ...sql }));\n const [error, result] = await this.executeQuery(query);\n this.reporter.end(error);\n if (error) {\n throw error;\n }\n return result;\n }\n /**\n * Executes query by using a proper read or write connection.\n */\n async executeUsingManagedConnection(query) {\n const queryClient = this.getQueryClient(query);\n /**\n * Acquire connection from the knex connection pool. This is will\n * use the rounding robin mechanism and force set it on\n * the query.\n */\n const connection = await queryClient.client.acquireConnection();\n query.connection(connection);\n query['once']('query', (sql) => this.reporter.begin({ ...this.logData, ...sql }));\n /**\n * Execute query and report event and profiler data\n */\n const [error, result] = await this.executeQuery(query);\n this.reporter.end(error);\n /**\n * Make sure to always release the connection\n */\n queryClient.client.releaseConnection(connection);\n /**\n * If there was an error, raise it or return the result\n */\n if (error) {\n throw error;\n }\n return result;\n }\n /**\n * Run query by managing its life-cycle\n */\n async run(query) {\n /**\n * We execute the queries using transaction or using sqlite database\n * directly.\n *\n * - The transaction already has a pre-acquired connection.\n * - There is no concept of read/write replicas in sqlite.\n */\n if (this.isUsingSqlite() || this.isInTransaction(query)) {\n return this.executeDirectly(query);\n }\n /**\n * Cannot execute write queries with client in read mode\n */\n if (this.isWriteQuery(query) && this.client.mode === 'read') {\n throw new Exception('Updates and deletes cannot be performed in read mode');\n }\n return this.executeUsingManagedConnection(query);\n }\n}\n","// index.ts\nvar Macroable = class {\n /**\n *\n * Macros are standard properties that gets added to the class prototype.\n *\n * ```ts\n * MyClass.macro('foo', 'bar')\n * ```\n */\n static macro(name, value) {\n this.prototype[name] = value;\n }\n /**\n *\n * Getters are added to the class prototype using the Object.defineProperty.\n *\n * ```ts\n * MyClass.getter('foo', function foo () {\n * return 'bar'\n * })\n * ```\n *\n * You can add a singleton getter by enabling the `singleton` flag.\n *\n * ```ts\n * const singleton = true\n *\n * MyClass.getter('foo', function foo () {\n * return 'bar'\n * }, singleton)\n * ```\n */\n static getter(name, accumulator, singleton = false) {\n Object.defineProperty(this.prototype, name, {\n get() {\n const value = accumulator.call(this);\n if (singleton) {\n Object.defineProperty(this, name, {\n configurable: false,\n enumerable: false,\n value,\n writable: false\n });\n }\n return value;\n },\n configurable: true,\n enumerable: false\n });\n }\n};\nexport {\n Macroable as default\n};\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { QueryRunner } from '../../query_runner/index.js';\n/**\n * Exposes the API to execute raw queries\n */\nexport class RawQueryBuilder {\n knexQuery;\n client;\n /**\n * Custom data someone want to send to the profiler and the\n * query event\n */\n customReporterData;\n /**\n * Control whether to debug the query or not. The initial\n * value is inherited from the query client\n */\n debugQueries;\n constructor(knexQuery, client) {\n this.knexQuery = knexQuery;\n this.client = client;\n this.debugQueries = this.client.debug;\n }\n /**\n * Returns the log data\n */\n getQueryData() {\n return {\n connection: this.client.connectionName,\n inTransaction: this.client.isTransaction,\n ...this.customReporterData,\n };\n }\n /**\n * Define custom reporter data. It will be merged with\n * the existing data\n */\n reporterData(data) {\n this.customReporterData = data;\n return this;\n }\n /**\n * Wrap the query with before/after strings.\n */\n wrap(before, after) {\n this.knexQuery.wrap(before, after);\n return this;\n }\n /**\n * Turn on/off debugging for this query\n */\n debug(debug) {\n this.debugQueries = debug;\n return this;\n }\n /**\n * Define query timeout\n */\n timeout(time, options) {\n this.knexQuery['timeout'](time, options);\n return this;\n }\n /**\n * Returns SQL query as a string\n */\n toQuery() {\n return this.knexQuery.toQuery();\n }\n /**\n * @deprecated\n * Do not use this method. Instead create a query using the\n * transaction client directly.\n *\n * ```ts\n * trx.rawQuery()\n * ```\n */\n useTransaction(transaction) {\n this.knexQuery.transacting(transaction.knexClient);\n return this;\n }\n /**\n * Executes the query\n */\n async exec() {\n return new QueryRunner(this.client, this.debugQueries, this.getQueryData()).run(this.knexQuery);\n }\n /**\n * Get sql representation of the query\n */\n toSQL() {\n return this.knexQuery.toSQL();\n }\n /**\n * Implementation of `then` for the promise API\n */\n then(resolve, reject) {\n return this.exec().then(resolve, reject);\n }\n /**\n * Implementation of `catch` for the promise API\n */\n catch(reject) {\n return this.exec().catch(reject);\n }\n /**\n * Implementation of `finally` for the promise API\n */\n finally(fullfilled) {\n return this.exec().finally(fullfilled);\n }\n /**\n * Required when Promises are extended\n */\n get [Symbol.toStringTag]() {\n return this.constructor.name;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * Exposes the API to construct raw queries. If you want to execute\n * raw queries, you can use the RawQueryBuilder\n */\nexport class RawBuilder {\n sql;\n bindings;\n wrapBefore;\n wrapAfter;\n constructor(sql, bindings) {\n this.sql = sql;\n this.bindings = bindings;\n }\n /**\n * Wrap the query with before/after strings.\n */\n wrap(before, after) {\n this.wrapAfter = after;\n this.wrapBefore = before;\n return this;\n }\n /**\n * Converts the raw query to knex raw query instance\n */\n toKnex(client) {\n const rawQuery = client.raw(this.sql, this.bindings);\n if (this.wrapBefore && this.wrapAfter) {\n rawQuery.wrap(this.wrapBefore, this.wrapAfter);\n }\n return rawQuery;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * Reference builder to create SQL reference values\n */\nexport class ReferenceBuilder {\n ref;\n client;\n schema;\n alias;\n constructor(ref, client) {\n this.ref = ref;\n this.client = client;\n }\n /**\n * Define schema\n */\n withSchema(schema) {\n this.schema = schema;\n return this;\n }\n /**\n * Define alias\n */\n as(alias) {\n this.alias = alias;\n return this;\n }\n /**\n * Converts reference to knex\n */\n toKnex(client) {\n const ref = (client || this.client).ref(this.ref);\n this.schema && ref.withSchema(this.schema);\n this.alias && ref.as(this.alias);\n return ref;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport Macroable from '@poppinss/macroable';\nimport { Exception } from '@poppinss/utils';\nimport { isObject } from '../../utils/index.js';\nimport { RawQueryBuilder } from './raw.js';\nimport { RawBuilder } from '../static_builder/raw.js';\nimport { ReferenceBuilder } from '../static_builder/reference.js';\n/**\n * The chainable query builder to construct SQL queries for selecting, updating and\n * deleting records.\n *\n * The API internally uses the knex query builder. However, many of methods may have\n * different API.\n */\nexport class Chainable extends Macroable {\n knexQuery;\n queryCallback;\n keysResolver;\n hasAggregates = false;\n hasGroupBy = false;\n hasUnion = false;\n /**\n * Collection where clauses in a 2nd array. Calling `wrapExisting`\n * adds a new stack item\n */\n whereStack = [[]];\n /**\n * Returns the recent most array from the where stack\n */\n getRecentStackItem() {\n return this.whereStack[this.whereStack.length - 1];\n }\n /**\n * Returns the wrapping method for a given where method\n */\n getWrappingMethod(method) {\n if (method.startsWith('or')) {\n return {\n method: method,\n wrappingMethod: 'orWhere',\n };\n }\n return {\n method: method,\n wrappingMethod: 'where',\n };\n }\n /**\n * Applies the where clauses\n */\n applyWhere() {\n this.knexQuery.clearWhere();\n if (this.whereStack.length === 1) {\n this.whereStack[0].forEach(({ method, args }) => {\n ;\n this.knexQuery[method](...args);\n });\n return;\n }\n this.whereStack.forEach((collection) => {\n if (collection.length) {\n const firstItem = collection.shift();\n const wrapper = this.getWrappingMethod(firstItem.method);\n this.knexQuery[wrapper.wrappingMethod]((subquery) => {\n subquery[wrapper.method](...firstItem.args);\n collection.forEach(({ method, args }) => subquery[method](...args));\n });\n }\n });\n }\n /**\n * An array of selected columns\n */\n get columns() {\n return this.knexQuery['_statements']\n .filter(({ grouping }) => grouping === 'columns')\n .reduce((result, { value }) => {\n result = result.concat(value);\n return result;\n }, []);\n }\n /**\n * Custom alias for the query results. Ignored if it not a\n * subquery\n */\n subQueryAlias;\n constructor(knexQuery, queryCallback, keysResolver) {\n super();\n this.knexQuery = knexQuery;\n this.queryCallback = queryCallback;\n this.keysResolver = keysResolver;\n }\n /**\n * Raises exception when only one argument is passed to a where\n * clause and it is a string. It means the value is undefined\n */\n validateWhereSingleArgument(value, method) {\n if (typeof value === 'string') {\n throw new Exception(`\".${method}\" expects value to be defined, but undefined is passed`);\n }\n }\n /**\n * Returns the value pair for the `whereBetween` clause\n */\n getBetweenPair(value) {\n const [lhs, rhs] = value;\n if (lhs === undefined || rhs === undefined) {\n throw new Error('Invalid array for whereBetween value');\n }\n return [this.transformValue(lhs), this.transformValue(rhs)];\n }\n /**\n * Normalizes the columns aggregates functions to something\n * knex can process.\n */\n normalizeAggregateColumns(columns, alias) {\n if (columns.constructor === Object) {\n return Object.keys(columns).reduce((result, key) => {\n const value = columns[key];\n result[key] =\n typeof value === 'string' ? this.resolveKey(value) : this.transformValue(value);\n return result;\n }, {});\n }\n if (!alias) {\n return columns;\n }\n return {\n [alias]: typeof columns === 'string' ? this.resolveKey(columns) : this.transformValue(columns),\n };\n }\n /**\n * Resolves the column name considering raw queries as well.\n */\n resolveColumn(columns, checkForObject = false, returnValue) {\n if (columns instanceof RawQueryBuilder) {\n return columns['knexQuery'];\n }\n if (columns instanceof RawBuilder) {\n return columns.toKnex(this.knexQuery.client);\n }\n return this.resolveKey(columns, checkForObject, returnValue);\n }\n /**\n * Resolves column names\n */\n resolveKey(columns, checkForObject = false, returnValue) {\n /**\n * If there is no keys resolver in place, then return the\n * optional return value or defined column(s)\n */\n if (!this.keysResolver) {\n return returnValue || columns;\n }\n /**\n * If column is a string, then resolve it as a key\n */\n if (typeof columns === 'string') {\n return columns === '*' ? columns : this.keysResolver(columns);\n }\n /**\n * If check for objects is enabled, then resolve object keys\n */\n if (checkForObject && isObject(columns)) {\n return Object.keys(columns).reduce((result, column) => {\n result[this.keysResolver(column)] = columns[column];\n return result;\n }, {});\n }\n /**\n * Return the return value or columns as fallback\n */\n return returnValue || columns;\n }\n /**\n * Apply existing query flags to a new query builder. This is\n * done during clone operation\n */\n applyQueryFlags(query) {\n query.hasAggregates = this.hasAggregates;\n query.hasGroupBy = this.hasGroupBy;\n query.hasUnion = this.hasUnion;\n query.whereStack = this.whereStack.map((collection) => {\n return collection.map((node) => node);\n });\n }\n /**\n * Transforms the value to something that knex can internally understand and\n * handle. It includes.\n *\n * 1. Returning the `knexBuilder` for sub queries.\n * 2. Returning the `knex.refBuilder` for reference builder.\n * 2. Returning the `knexBuilder` for raw queries.\n * 3. Wrapping callbacks, so that the end user receives an instance Lucid query\n * builder and not knex query builder.\n */\n transformValue(value) {\n if (value instanceof Chainable) {\n return value.toKnex();\n }\n if (value instanceof ReferenceBuilder) {\n return value.toKnex(this.knexQuery.client);\n }\n if (typeof value === 'function') {\n return this.transformCallback(value);\n }\n return this.transformRaw(value);\n }\n /**\n * Transforms the user callback to something that knex\n * can internally process\n */\n transformCallback(value) {\n if (typeof value === 'function') {\n return this.queryCallback(value, this.keysResolver);\n }\n return value;\n }\n /**\n * Returns the underlying knex raw query builder for Lucid raw\n * query builder\n */\n transformRaw(value) {\n if (value instanceof RawQueryBuilder) {\n return value['knexQuery'];\n }\n if (value instanceof RawBuilder) {\n return value.toKnex(this.knexQuery.client);\n }\n return value;\n }\n /**\n * Define columns for selection\n */\n select(...args) {\n let columns = args;\n if (Array.isArray(args[0])) {\n columns = args[0];\n }\n this.knexQuery.select(columns.map((column) => {\n if (typeof column === 'string') {\n return this.resolveKey(column, true);\n }\n return this.transformValue(column);\n }));\n return this;\n }\n /**\n * Select table for the query. Re-calling this method multiple times will\n * use the last selected table\n */\n from(table) {\n this.knexQuery.from(this.transformValue(table));\n return this;\n }\n /**\n * Wrap existing where clauses to its own group\n */\n wrapExisting() {\n if (this.getRecentStackItem().length) {\n this.whereStack.push([]);\n }\n return this;\n }\n /**\n * Add a `where` clause\n */\n where(key, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (value !== undefined) {\n whereClauses.push({\n method: 'where',\n args: [this.resolveColumn(key), operator, this.transformValue(value)],\n });\n }\n else if (operator !== undefined) {\n whereClauses.push({\n method: 'where',\n args: [this.resolveColumn(key), this.transformValue(operator)],\n });\n }\n else {\n /**\n * Only callback is allowed as a standalone param. One must use `whereRaw`\n * for raw/sub queries. This is our limitation to have consistent API\n */\n this.validateWhereSingleArgument(key, 'where');\n whereClauses.push({\n method: 'where',\n args: [this.resolveColumn(key, true, this.transformCallback(key))],\n });\n }\n return this;\n }\n /**\n * Add a `or where` clause\n */\n orWhere(key, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (value !== undefined) {\n whereClauses.push({\n method: 'orWhere',\n args: [this.resolveColumn(key), operator, this.transformValue(value)],\n });\n }\n else if (operator !== undefined) {\n whereClauses.push({\n method: 'orWhere',\n args: [this.resolveColumn(key), this.transformValue(operator)],\n });\n }\n else {\n this.validateWhereSingleArgument(key, 'orWhere');\n whereClauses.push({\n method: 'orWhere',\n args: [this.resolveColumn(key, true, this.transformCallback(key))],\n });\n }\n return this;\n }\n /**\n * Alias for `where`\n */\n andWhere(key, operator, value) {\n return this.where(key, operator, value);\n }\n /**\n * Adding `where not` clause\n */\n whereNot(key, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (value !== undefined) {\n whereClauses.push({\n method: 'whereNot',\n args: [this.resolveColumn(key), operator, this.transformValue(value)],\n });\n }\n else if (operator !== undefined) {\n whereClauses.push({\n method: 'whereNot',\n args: [this.resolveColumn(key), this.transformValue(operator)],\n });\n }\n else {\n this.validateWhereSingleArgument(key, 'whereNot');\n whereClauses.push({\n method: 'whereNot',\n args: [this.resolveColumn(key, true, this.transformCallback(key))],\n });\n }\n return this;\n }\n /**\n * Adding `or where not` clause\n */\n orWhereNot(key, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (value !== undefined) {\n whereClauses.push({\n method: 'orWhereNot',\n args: [this.resolveColumn(key), operator, this.transformValue(value)],\n });\n }\n else if (operator !== undefined) {\n whereClauses.push({\n method: 'orWhereNot',\n args: [this.resolveColumn(key), this.transformValue(operator)],\n });\n }\n else {\n this.validateWhereSingleArgument(key, 'orWhereNot');\n whereClauses.push({\n method: 'orWhereNot',\n args: [this.resolveColumn(key, true, this.transformCallback(key))],\n });\n }\n return this;\n }\n /**\n * Alias for [[whereNot]]\n */\n andWhereNot(key, operator, value) {\n return this.whereNot(key, operator, value);\n }\n /**\n * Add a where clause on a given column\n */\n whereColumn(column, operator, comparisonColumn) {\n if (comparisonColumn !== undefined) {\n this.where(column, operator, new ReferenceBuilder(comparisonColumn, this.knexQuery.client));\n }\n else {\n this.where(column, new ReferenceBuilder(operator, this.knexQuery.client));\n }\n return this;\n }\n /**\n * Add a orWhere clause on a given column\n */\n orWhereColumn(column, operator, comparisonColumn) {\n if (comparisonColumn !== undefined) {\n this.orWhere(column, operator, new ReferenceBuilder(comparisonColumn, this.knexQuery.client));\n }\n else {\n this.orWhere(column, new ReferenceBuilder(operator, this.knexQuery.client));\n }\n return this;\n }\n /**\n * Alias for whereColumn\n */\n andWhereColumn(column, operator, comparisonColumn) {\n return this.whereColumn(column, operator, comparisonColumn);\n }\n /**\n * Add a whereNot clause on a given column\n */\n whereNotColumn(column, operator, comparisonColumn) {\n if (comparisonColumn !== undefined) {\n this.whereNot(column, operator, new ReferenceBuilder(comparisonColumn, this.knexQuery.client));\n }\n else {\n this.whereNot(column, new ReferenceBuilder(operator, this.knexQuery.client));\n }\n return this;\n }\n /**\n * Add a orWhereNotColumn clause on a given column\n */\n orWhereNotColumn(column, operator, comparisonColumn) {\n if (comparisonColumn !== undefined) {\n this.orWhereNot(column, operator, new ReferenceBuilder(comparisonColumn, this.knexQuery.client));\n }\n else {\n this.orWhereNot(column, new ReferenceBuilder(operator, this.knexQuery.client));\n }\n return this;\n }\n /**\n * Alias for whereNotColumn\n */\n andWhereNotColumn(column, operator, comparisonColumn) {\n return this.whereNotColumn(column, operator, comparisonColumn);\n }\n /**\n * Adding a `where in` clause\n */\n whereIn(columns, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveColumn(column))\n : this.resolveColumn(columns);\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereIn',\n args: [columns, value],\n });\n return this;\n }\n /**\n * Adding a `or where in` clause\n */\n orWhereIn(columns, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveColumn(column))\n : this.resolveColumn(columns);\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereIn',\n args: [columns, value],\n });\n return this;\n }\n /**\n * Alias for [[whereIn]]\n */\n andWhereIn(key, value) {\n return this.whereIn(key, value);\n }\n /**\n * Adding a `where not in` clause\n */\n whereNotIn(columns, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveColumn(column))\n : this.resolveColumn(columns);\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNotIn',\n args: [columns, value],\n });\n return this;\n }\n /**\n * Adding a `or where not in` clause\n */\n orWhereNotIn(columns, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveColumn(column))\n : this.resolveColumn(columns);\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotIn',\n args: [columns, value],\n });\n return this;\n }\n /**\n * Alias for [[whereNotIn]]\n */\n andWhereNotIn(key, value) {\n return this.whereNotIn(key, value);\n }\n /**\n * Adding `where not null` clause\n */\n whereNull(key) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNull',\n args: [this.resolveColumn(key)],\n });\n return this;\n }\n /**\n * Adding `or where not null` clause\n */\n orWhereNull(key) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNull',\n args: [this.resolveColumn(key)],\n });\n return this;\n }\n /**\n * Alias for [[whereNull]]\n */\n andWhereNull(key) {\n return this.whereNull(key);\n }\n /**\n * Adding `where not null` clause\n */\n whereNotNull(key) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNotNull',\n args: [this.resolveColumn(key)],\n });\n return this;\n }\n /**\n * Adding `or where not null` clause\n */\n orWhereNotNull(key) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotNull',\n args: [this.resolveColumn(key)],\n });\n return this;\n }\n /**\n * Alias for [[whereNotNull]]\n */\n andWhereNotNull(key) {\n return this.whereNotNull(key);\n }\n /**\n * Add a `where exists` clause\n */\n whereExists(value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereExists',\n args: [this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `or where exists` clause\n */\n orWhereExists(value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereExists',\n args: [this.transformValue(value)],\n });\n return this;\n }\n /**\n * Alias for [[whereExists]]\n */\n andWhereExists(value) {\n return this.whereExists(value);\n }\n /**\n * Add a `where not exists` clause\n */\n whereNotExists(value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNotExists',\n args: [this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `or where not exists` clause\n */\n orWhereNotExists(value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotExists',\n args: [this.transformValue(value)],\n });\n return this;\n }\n /**\n * Alias for [[whereNotExists]]\n */\n andWhereNotExists(value) {\n return this.whereNotExists(value);\n }\n /**\n * Add where between clause\n */\n whereBetween(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereBetween',\n args: [this.resolveColumn(key), this.getBetweenPair(value)],\n });\n return this;\n }\n /**\n * Add where between clause\n */\n orWhereBetween(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereBetween',\n args: [this.resolveColumn(key), this.getBetweenPair(value)],\n });\n return this;\n }\n /**\n * Alias for [[whereBetween]]\n */\n andWhereBetween(key, value) {\n return this.whereBetween(key, value);\n }\n /**\n * Add where between clause\n */\n whereNotBetween(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNotBetween',\n args: [this.resolveColumn(key), this.getBetweenPair(value)],\n });\n return this;\n }\n /**\n * Add where between clause\n */\n orWhereNotBetween(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotBetween',\n args: [this.resolveColumn(key), this.getBetweenPair(value)],\n });\n return this;\n }\n /**\n * Alias for [[whereNotBetween]]\n */\n andWhereNotBetween(key, value) {\n return this.whereNotBetween(key, value);\n }\n /**\n * Adding a where clause using raw sql\n */\n whereRaw(sql, bindings) {\n const whereClauses = this.getRecentStackItem();\n if (bindings) {\n bindings = Array.isArray(bindings)\n ? bindings.map((binding) => this.transformValue(binding))\n : bindings;\n whereClauses.push({\n method: 'whereRaw',\n args: [sql, bindings],\n });\n }\n else {\n whereClauses.push({\n method: 'whereRaw',\n args: [this.transformRaw(sql)],\n });\n }\n return this;\n }\n /**\n * Adding a or where clause using raw sql\n */\n orWhereRaw(sql, bindings) {\n const whereClauses = this.getRecentStackItem();\n if (bindings) {\n bindings = Array.isArray(bindings)\n ? bindings.map((binding) => this.transformValue(binding))\n : bindings;\n whereClauses.push({\n method: 'orWhereRaw',\n args: [sql, bindings],\n });\n }\n else {\n whereClauses.push({\n method: 'orWhereRaw',\n args: [this.transformRaw(sql)],\n });\n }\n return this;\n }\n /**\n * Alias for [[whereRaw]]\n */\n andWhereRaw(sql, bindings) {\n return this.whereRaw(sql, bindings);\n }\n /**\n * Add a `where like` clause\n */\n whereLike(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereLike',\n args: [this.resolveColumn(key), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `where like` clause\n */\n orWhereLike(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereLike',\n args: [this.resolveColumn(key), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `where like` clause\n */\n andWhereLike(key, value) {\n return this.whereLike(key, value);\n }\n /**\n * Add a `where like` clause\n */\n whereILike(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereILike',\n args: [this.resolveColumn(key), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `where like` clause\n */\n orWhereILike(key, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereILike',\n args: [this.resolveColumn(key), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Add a `where like` clause\n */\n andWhereILike(key, value) {\n return this.whereILike(key, value);\n }\n /**\n * Define a where clause with value that matches for JSON\n */\n whereJson(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereJsonObject',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for JSON\n */\n orWhereJson(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereJsonObject',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a where clause with value that matches for JSON\n *\n * @alias whereJson\n */\n andWhereJson(column, value) {\n return this.whereJson(column, value);\n }\n /**\n * Define a where clause with value that matches for JSON\n */\n whereNotJson(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereNotJsonObject',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for JSON\n */\n orWhereNotJson(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereNotJsonObject',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a where clause with value that matches for JSON\n *\n * @alias whereNotJson\n */\n andWhereNotJson(column, value) {\n return this.whereNotJson(column, value);\n }\n /**\n * Define a where clause with value that matches for a superset of\n * JSON\n */\n whereJsonSuperset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereJsonSupersetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for a superset of\n * JSON\n */\n orWhereJsonSuperset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereJsonSupersetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define or where clause with value that matches for a superset of\n * JSON\n *\n * @alias whereJsonSuperset\n */\n andWhereJsonSuperset(column, value) {\n return this.whereJsonSuperset(column, value);\n }\n /**\n * Define a where clause with value that matches for a superset of\n * JSON\n */\n whereNotJsonSuperset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereJsonNotSupersetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for a superset of\n * JSON\n */\n orWhereNotJsonSuperset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereJsonNotSupersetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define or where clause with value that matches for a superset of\n * JSON\n *\n * @alias whereNotJsonSuperset\n */\n andWhereNotJsonSuperset(column, value) {\n return this.whereNotJsonSuperset(column, value);\n }\n /**\n * Define a where clause with value that matches for a subset of\n * JSON\n */\n whereJsonSubset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereJsonSubsetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for a subset of\n * JSON\n */\n orWhereJsonSubset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereJsonSubsetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define or where clause with value that matches for a subset of\n * JSON\n *\n * @alias whereJsonSubset\n */\n andWhereJsonSubset(column, value) {\n return this.whereJsonSubset(column, value);\n }\n /**\n * Define a where clause with value that matches for a subset of\n * JSON\n */\n whereNotJsonSubset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'whereJsonNotSubsetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define a or where clause with value that matches for a subset of\n * JSON\n */\n orWhereNotJsonSubset(column, value) {\n const whereClauses = this.getRecentStackItem();\n whereClauses.push({\n method: 'orWhereJsonNotSubsetOf',\n args: [this.resolveColumn(column), this.transformValue(value)],\n });\n return this;\n }\n /**\n * Define or where clause with value that matches for a subset of\n * JSON\n *\n * @alias whereNotJsonSubset\n */\n andWhereNotJsonSubset(column, value) {\n return this.whereNotJsonSubset(column, value);\n }\n /**\n * Adds a where clause with comparison of a value returned\n * by a JsonPath given an operator and a value.\n */\n whereJsonPath(column, jsonPath, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (!value) {\n value = operator;\n operator = '=';\n }\n whereClauses.push({\n method: 'whereJsonPath',\n args: [this.resolveColumn(column), jsonPath, operator, this.transformValue(value)],\n });\n return this;\n }\n /**\n * Adds a or where clause with comparison of a value returned\n * by a JsonPath given an operator and a value.\n */\n orWhereJsonPath(column, jsonPath, operator, value) {\n const whereClauses = this.getRecentStackItem();\n if (!value) {\n value = operator;\n operator = '=';\n }\n whereClauses.push({\n method: 'orWhereJsonPath',\n args: [this.resolveColumn(column), jsonPath, operator, this.transformValue(value)],\n });\n return this;\n }\n /**\n * Adds a where clause with comparison of a value returned\n * by a JsonPath given an operator and a value.\n *\n * @alias whereJsonPath\n */\n andWhereJsonPath(column, jsonPath, operator, value) {\n return this.whereJsonPath(column, jsonPath, operator, value);\n }\n /**\n * Add a join clause\n */\n join(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.join(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.join(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.join(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add an inner join clause\n */\n innerJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.innerJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.innerJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.innerJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a left join clause\n */\n leftJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.leftJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.leftJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.leftJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a left outer join clause\n */\n leftOuterJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.leftOuterJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.leftOuterJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.leftOuterJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a right join clause\n */\n rightJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.rightJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.rightJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.rightJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a right outer join clause\n */\n rightOuterJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.rightOuterJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.rightOuterJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.rightOuterJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a full outer join clause\n */\n fullOuterJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.fullOuterJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.fullOuterJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.fullOuterJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add a cross join clause\n */\n crossJoin(table, first, operator, second) {\n if (second !== undefined) {\n this.knexQuery.crossJoin(table, first, operator, this.transformRaw(second));\n }\n else if (operator !== undefined) {\n this.knexQuery.crossJoin(table, first, this.transformRaw(operator));\n }\n else {\n this.knexQuery.crossJoin(table, this.transformRaw(first));\n }\n return this;\n }\n /**\n * Add join clause as a raw query\n */\n joinRaw(sql, bindings) {\n if (bindings) {\n this.knexQuery.joinRaw(sql, bindings);\n }\n else {\n this.knexQuery.joinRaw(this.transformRaw(sql));\n }\n return this;\n }\n /**\n * Adds a having clause. The having clause breaks for `postgreSQL` when\n * referencing alias columns, since PG doesn't support alias columns\n * being referred within `having` clause. The end user has to\n * use raw queries in this case.\n */\n having(key, operator, value) {\n if (value !== undefined) {\n this.knexQuery.having(this.resolveColumn(key), operator, this.transformValue(value));\n return this;\n }\n if (operator !== undefined) {\n throw new Exception('Invalid arguments for \"queryBuilder.having\". Excepts a callback or key-value pair along with an operator');\n }\n this.knexQuery.having(this.transformValue(key));\n return this;\n }\n /**\n * Adds or having clause. The having clause breaks for `postgreSQL` when\n * referencing alias columns, since PG doesn't support alias columns\n * being referred within `having` clause. The end user has to\n * use raw queries in this case.\n */\n orHaving(key, operator, value) {\n if (value !== undefined) {\n this.knexQuery.orHaving(this.resolveColumn(key), operator, this.transformValue(value));\n return this;\n }\n if (operator !== undefined) {\n throw new Exception('Invalid arguments for \"queryBuilder.orHaving\". Excepts a callback or key-value pair along with an operator');\n }\n this.knexQuery.orHaving(this.transformValue(key));\n return this;\n }\n /**\n * Alias for [[having]]\n */\n andHaving(key, operator, value) {\n return this.having(key, operator, value);\n }\n /**\n * Adding having in clause to the query\n */\n havingIn(key, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n this.knexQuery.havingIn(this.resolveColumn(key), value);\n return this;\n }\n /**\n * Adding or having in clause to the query\n */\n orHavingIn(key, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n this.knexQuery['orHavingIn'](this.resolveColumn(key), value);\n return this;\n }\n /**\n * Alias for [[havingIn]]\n */\n andHavingIn(key, value) {\n return this.havingIn(key, value);\n }\n /**\n * Adding having not in clause to the query\n */\n havingNotIn(key, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n this.knexQuery['havingNotIn'](this.resolveColumn(key), value);\n return this;\n }\n /**\n * Adding or having not in clause to the query\n */\n orHavingNotIn(key, value) {\n value = Array.isArray(value)\n ? value.map((one) => this.transformValue(one))\n : this.transformValue(value);\n this.knexQuery['orHavingNotIn'](this.resolveColumn(key), value);\n return this;\n }\n /**\n * Alias for [[havingNotIn]]\n */\n andHavingNotIn(key, value) {\n return this.havingNotIn(key, value);\n }\n /**\n * Adding having null clause\n */\n havingNull(key) {\n this.knexQuery['havingNull'](this.resolveColumn(key));\n return this;\n }\n /**\n * Adding or having null clause\n */\n orHavingNull(key) {\n ;\n this.knexQuery['orHavingNull'](this.resolveColumn(key));\n return this;\n }\n /**\n * Alias for [[havingNull]] clause\n */\n andHavingNull(key) {\n return this.havingNull(key);\n }\n /**\n * Adding having not null clause\n */\n havingNotNull(key) {\n this.knexQuery['havingNotNull'](this.resolveColumn(key));\n return this;\n }\n /**\n * Adding or having not null clause\n */\n orHavingNotNull(key) {\n ;\n this.knexQuery['orHavingNotNull'](this.resolveColumn(key));\n return this;\n }\n /**\n * Alias for [[havingNotNull]] clause\n */\n andHavingNotNull(key) {\n return this.havingNotNull(key);\n }\n /**\n * Adding `having exists` clause\n */\n havingExists(value) {\n ;\n this.knexQuery['havingExists'](this.transformValue(value));\n return this;\n }\n /**\n * Adding `or having exists` clause\n */\n orHavingExists(value) {\n ;\n this.knexQuery['orHavingExists'](this.transformValue(value));\n return this;\n }\n /**\n * Alias for [[havingExists]]\n */\n andHavingExists(value) {\n return this.havingExists(value);\n }\n /**\n * Adding `having not exists` clause\n */\n havingNotExists(value) {\n ;\n this.knexQuery['havingNotExists'](this.transformValue(value));\n return this;\n }\n /**\n * Adding `or having not exists` clause\n */\n orHavingNotExists(value) {\n ;\n this.knexQuery['orHavingNotExists'](this.transformValue(value));\n return this;\n }\n /**\n * Alias for [[havingNotExists]]\n */\n andHavingNotExists(value) {\n return this.havingNotExists(value);\n }\n /**\n * Adding `having between` clause\n */\n havingBetween(key, value) {\n this.knexQuery.havingBetween(this.resolveColumn(key), this.getBetweenPair(value));\n return this;\n }\n /**\n * Adding `or having between` clause\n */\n orHavingBetween(key, value) {\n this.knexQuery.orHavingBetween(this.resolveColumn(key), this.getBetweenPair(value));\n return this;\n }\n /**\n * Alias for [[havingBetween]]\n */\n andHavingBetween(key, value) {\n return this.havingBetween(this.resolveColumn(key), value);\n }\n /**\n * Adding `having not between` clause\n */\n havingNotBetween(key, value) {\n this.knexQuery.havingNotBetween(this.resolveColumn(key), this.getBetweenPair(value));\n return this;\n }\n /**\n * Adding `or having not between` clause\n */\n orHavingNotBetween(key, value) {\n this.knexQuery.orHavingNotBetween(this.resolveColumn(key), this.getBetweenPair(value));\n return this;\n }\n /**\n * Alias for [[havingNotBetween]]\n */\n andHavingNotBetween(key, value) {\n return this.havingNotBetween(key, value);\n }\n /**\n * Adding a where clause using raw sql\n */\n havingRaw(sql, bindings) {\n if (bindings) {\n this.knexQuery.havingRaw(sql, bindings);\n }\n else {\n this.knexQuery.havingRaw(this.transformRaw(sql));\n }\n return this;\n }\n /**\n * Adding a where clause using raw sql\n */\n orHavingRaw(sql, bindings) {\n if (bindings) {\n this.knexQuery.orHavingRaw(sql, bindings);\n }\n else {\n this.knexQuery.orHavingRaw(this.transformRaw(sql));\n }\n return this;\n }\n /**\n * Alias for [[havingRaw]]\n */\n andHavingRaw(sql, bindings) {\n return this.havingRaw(sql, bindings);\n }\n /**\n * Add distinct clause\n */\n distinct(...columns) {\n this.knexQuery.distinct(...columns.map((column) => this.resolveKey(column)));\n return this;\n }\n /**\n * Add distinctOn clause\n */\n distinctOn(...columns) {\n this.knexQuery.distinctOn(...columns.map((column) => this.resolveKey(column)));\n return this;\n }\n /**\n * Add group by clause\n */\n groupBy(...columns) {\n this.hasGroupBy = true;\n this.knexQuery.groupBy(...columns.map((column) => this.resolveKey(column)));\n return this;\n }\n /**\n * Add group by clause as a raw query\n */\n groupByRaw(sql, bindings) {\n this.hasGroupBy = true;\n if (bindings) {\n this.knexQuery.groupByRaw(sql, bindings);\n }\n else {\n this.knexQuery.groupByRaw(this.transformRaw(sql));\n }\n return this;\n }\n /**\n * Add order by clause\n */\n orderBy(column, direction) {\n if (typeof column === 'string') {\n this.knexQuery.orderBy(this.resolveKey(column), direction);\n return this;\n }\n /**\n * Here value can be one of the following\n * ['age', 'name']\n * [{ column: 'age', direction: 'desc' }]\n *\n * [{ column: Database.query().from('user_logins'), direction: 'desc' }]\n */\n if (Array.isArray(column)) {\n const transformedColumns = column.map((col) => {\n if (typeof col === 'string') {\n return { column: this.resolveKey(col) };\n }\n if (col.column) {\n col.column =\n typeof col.column === 'string'\n ? this.resolveKey(col.column)\n : this.transformValue(col.column);\n return col;\n }\n return col;\n });\n this.knexQuery.orderBy(transformedColumns);\n return this;\n }\n this.knexQuery.orderBy(this.transformValue(column), direction);\n return this;\n }\n /**\n * Add order by clause as a raw query\n */\n orderByRaw(sql, bindings) {\n if (bindings) {\n this.knexQuery.orderByRaw(sql, bindings);\n }\n else {\n this.knexQuery.orderByRaw(this.transformRaw(sql));\n }\n return this;\n }\n /**\n * Define select offset\n */\n offset(value) {\n this.knexQuery.offset(value);\n return this;\n }\n /**\n * Define results limit\n */\n limit(value) {\n this.knexQuery.limit(value);\n return this;\n }\n /**\n * Define union queries\n */\n union(queries, wrap) {\n this.hasUnion = true;\n queries = Array.isArray(queries)\n ? queries.map((one) => this.transformValue(one))\n : this.transformValue(queries);\n wrap !== undefined ? this.knexQuery.union(queries, wrap) : this.knexQuery.union(queries);\n return this;\n }\n /**\n * Define union all queries\n */\n unionAll(queries, wrap) {\n this.hasUnion = true;\n queries = Array.isArray(queries)\n ? queries.map((one) => this.transformValue(one))\n : this.transformValue(queries);\n wrap !== undefined ? this.knexQuery.unionAll(queries, wrap) : this.knexQuery.unionAll(queries);\n return this;\n }\n /**\n * Define intersect queries\n */\n intersect(queries, wrap) {\n queries = Array.isArray(queries)\n ? queries.map((one) => this.transformValue(one))\n : this.transformValue(queries);\n wrap !== undefined ? this.knexQuery.intersect(queries, wrap) : this.knexQuery.intersect(queries);\n return this;\n }\n /**\n * Clear select columns\n */\n clearSelect() {\n this.knexQuery.clearSelect();\n return this;\n }\n /**\n * Clear where clauses\n */\n clearWhere() {\n this.whereStack = [[]];\n this.knexQuery.clearWhere();\n return this;\n }\n /**\n * Clear order by\n */\n clearOrder() {\n this.knexQuery.clearOrder();\n return this;\n }\n /**\n * Clear having\n */\n clearHaving() {\n this.knexQuery.clearHaving();\n return this;\n }\n /**\n * Clear limit\n */\n clearLimit() {\n ;\n this.knexQuery['_single'].limit = null;\n return this;\n }\n /**\n * Clear offset\n */\n clearOffset() {\n ;\n this.knexQuery['_single'].offset = null;\n return this;\n }\n /**\n * Specify `FOR UPDATE` lock mode for a given\n * query\n */\n forUpdate(...tableNames) {\n this.knexQuery.forUpdate(...tableNames);\n return this;\n }\n /**\n * Specify `FOR SHARE` lock mode for a given\n * query\n */\n forShare(...tableNames) {\n this.knexQuery.forShare(...tableNames);\n return this;\n }\n /**\n * Skip locked rows\n */\n skipLocked() {\n this.knexQuery.skipLocked();\n return this;\n }\n /**\n * Fail when query wants a locked row\n */\n noWait() {\n this.knexQuery.noWait();\n return this;\n }\n /**\n * Define `with` CTE\n */\n with(alias, query, columns = []) {\n if (columns.length > 0) {\n this.knexQuery.with(alias, columns, this.transformValue(query));\n }\n else {\n this.knexQuery.with(alias, this.transformValue(query));\n }\n return this;\n }\n /**\n * Define `with` CTE with recursive keyword\n */\n withRecursive(alias, query, columns = []) {\n if (columns.length > 0) {\n this.knexQuery.withRecursive(alias, columns, this.transformValue(query));\n }\n else {\n this.knexQuery.withRecursive(alias, this.transformValue(query));\n }\n return this;\n }\n /**\n * Define `with materialized` CTE\n */\n withMaterialized(alias, query, columns = []) {\n if (columns.length > 0) {\n this.knexQuery.withMaterialized(alias, columns, this.transformValue(query));\n }\n else {\n this.knexQuery.withMaterialized(alias, this.transformValue(query));\n }\n return this;\n }\n /**\n * Define not `with materialized` CTE\n */\n withNotMaterialized(alias, query, columns = []) {\n if (columns.length > 0) {\n this.knexQuery.withNotMaterialized(alias, columns, this.transformValue(query));\n }\n else {\n this.knexQuery.withNotMaterialized(alias, this.transformValue(query));\n }\n return this;\n }\n /**\n * Define schema for the table\n */\n withSchema(schema) {\n this.knexQuery.withSchema(schema);\n return this;\n }\n /**\n * Define table alias\n */\n as(alias) {\n this.subQueryAlias = alias;\n this.knexQuery.as(alias);\n return this;\n }\n /**\n * Count rows for the current query\n */\n count(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.count(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Count distinct rows for the current query\n */\n countDistinct(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.countDistinct(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of `min` aggregate function\n */\n min(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.min(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of `max` aggregate function\n */\n max(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.max(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of `avg` aggregate function\n */\n avg(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.avg(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of distinct `avg` aggregate function\n */\n avgDistinct(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.avgDistinct(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of `sum` aggregate function\n */\n sum(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.sum(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * Make use of distinct `sum` aggregate function\n */\n sumDistinct(columns, alias) {\n this.hasAggregates = true;\n this.knexQuery.sumDistinct(this.normalizeAggregateColumns(columns, alias));\n return this;\n }\n /**\n * A shorthand for applying offset and limit based upon\n * the current page\n */\n forPage(page, perPage) {\n /**\n * Calculate offset from current page and per page values\n */\n const offset = page === 1 ? 0 : perPage * (page - 1);\n this.offset(offset).limit(perPage);\n return this;\n }\n /**\n * Define a query to constraint to be defined when condition is truthy\n */\n if(condition, matchCallback, noMatchCallback) {\n let matched = condition;\n if (typeof condition === 'function') {\n matched = condition();\n }\n if (matched) {\n matchCallback(this);\n }\n else if (noMatchCallback) {\n noMatchCallback(this);\n }\n return this;\n }\n /**\n * Define a query to constraint to be defined when condition is falsy\n */\n unless(condition, matchCallback, noMatchCallback) {\n let matched = condition;\n if (typeof condition === 'function') {\n matched = condition();\n }\n if (!matched) {\n matchCallback(this);\n }\n else if (noMatchCallback) {\n noMatchCallback(this);\n }\n return this;\n }\n /**\n * Define matching blocks just like `if/else if and else`.\n */\n match(...blocks) {\n const matchingBlock = blocks.find((block) => {\n if (Array.isArray(block) && block.length === 2) {\n if (typeof block[0] === 'function' && block[0]()) {\n return true;\n }\n else if (block[0]) {\n return true;\n }\n }\n if (typeof block === 'function') {\n return true;\n }\n });\n if (!matchingBlock) {\n return this;\n }\n if (Array.isArray(matchingBlock)) {\n matchingBlock[1](this);\n }\n else {\n matchingBlock(this);\n }\n return this;\n }\n /**\n * Applies statements and returns knex query\n */\n toKnex() {\n this.applyWhere();\n return this.knexQuery;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { Exception } from '@poppinss/utils';\nimport { isObject } from '../../utils/index.js';\nimport { Preloader } from '../preloader/index.js';\nimport { ModelPaginator } from '../paginator/index.js';\nimport { QueryRunner } from '../../query_runner/index.js';\nimport { Chainable } from '../../database/query_builder/chainable.js';\nimport { SimplePaginator } from '../../database/paginator/simple_paginator.js';\nimport * as errors from '../../errors.js';\n/**\n * A wrapper to invoke scope methods on the query builder\n * underlying model\n */\nclass ModelScopes {\n builder;\n constructor(builder) {\n this.builder = builder;\n return new Proxy(this, {\n get(target, key) {\n if (typeof target.builder.model[key] === 'function') {\n return (...args) => {\n return target.builder.model[key](target.builder, ...args);\n };\n }\n /**\n * Unknown keys are not allowed\n */\n throw new Error(`\"${String(key)}\" is not defined as a query scope on \"${target.builder.model.name}\" model`);\n },\n });\n }\n}\n/**\n * Database query builder exposes the API to construct and run queries for selecting,\n * updating and deleting records.\n */\nexport class ModelQueryBuilder extends Chainable {\n model;\n client;\n /**\n * A copy of defined preloads on the model instance\n */\n preloader;\n /**\n * A custom callback to transform each model row\n */\n rowTransformerCallback;\n /**\n * Required by macroable\n */\n static macros = {};\n static getters = {};\n /**\n * A references to model scopes wrapper. It is lazily initialized\n * only when the `apply` method is invoked\n */\n scopesWrapper = undefined;\n /**\n * Control whether to wrap adapter result to model\n * instances or not\n */\n wrapResultsToModelInstances = true;\n /**\n * Custom data someone want to send to the profiler and the\n * query event\n */\n customReporterData;\n /**\n * Control whether to debug the query or not. The initial\n * value is inherited from the query client\n */\n debugQueries;\n /**\n * Self join counter, increments with every \"withCount\"\n * \"has\" and \"whereHas\" queries.\n */\n joinCounter = 0;\n /**\n * Options that must be passed to all new model instances\n */\n clientOptions;\n /**\n * Whether query is a sub-query for `.where` callback\n */\n isChildQuery = false;\n /**\n * Side-loaded attributes that will be passed to the model instances\n */\n sideloaded = {};\n constructor(builder, model, client, customFn = (userFn) => {\n return ($builder) => {\n const subQuery = new ModelQueryBuilder($builder, this.model, this.client);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n }) {\n super(builder, customFn, model.$keys.attributesToColumns.resolve.bind(model.$keys.attributesToColumns));\n this.model = model;\n this.client = client;\n this.preloader = new Preloader(this.model);\n this.debugQueries = this.client.debug;\n this.clientOptions = {\n client: this.client,\n connection: this.client.connectionName,\n };\n /**\n * Assign table when not already assigned\n */\n if (!builder['_single'] || !builder['_single'].table) {\n builder.table(model.table);\n }\n }\n /**\n * Executes the current query\n */\n async execQuery() {\n this.applyWhere();\n const isWriteQuery = ['update', 'del', 'insert'].includes(this.knexQuery['_method']);\n const queryData = Object.assign(this.getQueryData(), this.customReporterData);\n const rows = await new QueryRunner(this.client, this.debugQueries, queryData).run(this.knexQuery);\n /**\n * Return the rows as it is when query is a write query\n */\n if (isWriteQuery || !this.wrapResultsToModelInstances) {\n return Array.isArray(rows) ? rows : [rows];\n }\n /**\n * Convert fetched results to an array of model instances\n */\n const modelInstances = rows.reduce((models, row) => {\n if (isObject(row)) {\n const modelInstance = this.model.$createFromAdapterResult(row, this.sideloaded, this.clientOptions);\n /**\n * Transform row when row transformer is defined\n */\n if (this.rowTransformerCallback) {\n this.rowTransformerCallback(modelInstance);\n }\n models.push(modelInstance);\n }\n return models;\n }, []);\n /**\n * Preload for model instances\n */\n await this.preloader\n .sideload(this.sideloaded)\n .debug(this.debugQueries)\n .processAllForMany(modelInstances, this.client);\n return modelInstances;\n }\n /**\n * Ensures that we are not executing `update` or `del` when using read only\n * client\n */\n ensureCanPerformWrites() {\n if (this.client && this.client.mode === 'read') {\n throw new Exception('Updates and deletes cannot be performed in read mode');\n }\n }\n /**\n * Defines sub query for checking the existence of a relationship\n */\n addWhereHas(relationName, boolean, operator, value, callback) {\n let rawMethod = 'whereRaw';\n let existsMethod = 'whereExists';\n switch (boolean) {\n case 'or':\n rawMethod = 'orWhereRaw';\n existsMethod = 'orWhereExists';\n break;\n case 'not':\n existsMethod = 'whereNotExists';\n break;\n case 'orNot':\n rawMethod = 'orWhereRaw';\n existsMethod = 'orWhereNotExists';\n break;\n }\n const subQuery = this.getRelationship(relationName).subQuery(this.client);\n subQuery.selfJoinCounter = this.joinCounter;\n /**\n * Invoke callback when defined\n */\n if (typeof callback === 'function') {\n callback(subQuery);\n }\n /**\n * Count all when value and operator are defined.\n */\n if (value !== undefined && operator !== undefined) {\n /**\n * If user callback has not defined any aggregates, then we should\n * add a count\n */\n if (!subQuery.hasAggregates) {\n subQuery.count('*');\n }\n /**\n * Pull sql and bindings from the query\n */\n const { sql, bindings } = subQuery.prepare().toSQL();\n /**\n * Define where raw clause. Query builder doesn't have any \"whereNotRaw\" method\n * and hence we need to prepend the `NOT` keyword manually\n */\n boolean === 'orNot' || boolean === 'not'\n ? this[rawMethod](`not (${sql}) ${operator} (?)`, bindings.concat([value]))\n : this[rawMethod](`(${sql}) ${operator} (?)`, bindings.concat([value]));\n return this;\n }\n /**\n * Use where exists when no operator and value is defined\n */\n ;\n this[existsMethod](subQuery.prepare());\n return this;\n }\n /**\n * Returns the profiler action. Protected, since the class is extended\n * by relationships\n */\n getQueryData() {\n return {\n connection: this.client.connectionName,\n inTransaction: this.client.isTransaction,\n model: this.model.name,\n };\n }\n /**\n * Returns the relationship instance from the model. An exception is\n * raised when relationship is missing\n */\n getRelationship(name) {\n const relation = this.model.$getRelation(name);\n /**\n * Ensure relationship exists\n */\n if (!relation) {\n throw new errors.E_UNDEFINED_RELATIONSHIP([name, this.model.name]);\n }\n relation.boot();\n return relation;\n }\n /**\n * Define custom reporter data. It will be merged with\n * the existing data\n */\n reporterData(data) {\n this.customReporterData = data;\n return this;\n }\n /**\n * Define a custom callback to transform rows\n */\n rowTransformer(callback) {\n this.rowTransformerCallback = callback;\n return this;\n }\n /**\n * Clone the current query builder\n */\n clone() {\n const clonedQuery = new ModelQueryBuilder(this.knexQuery.clone(), this.model, this.client);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.usePreloader(this.preloader.clone());\n clonedQuery.sideloaded = Object.assign({}, this.sideloaded);\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n this.rowTransformerCallback && this.rowTransformer(this.rowTransformerCallback);\n return clonedQuery;\n }\n /**\n * Define returning columns\n */\n returning(columns) {\n if (this.client.dialect.supportsReturningStatement) {\n columns = Array.isArray(columns)\n ? columns.map((column) => this.resolveKey(column))\n : this.resolveKey(columns);\n this.knexQuery.returning(columns);\n }\n return this;\n }\n /**\n * Define a query to constraint to be defined when condition is truthy\n */\n ifDialect(dialects, matchCallback, noMatchCallback) {\n dialects = Array.isArray(dialects) ? dialects : [dialects];\n if (dialects.includes(this.client.dialect.name)) {\n matchCallback(this);\n }\n else if (noMatchCallback) {\n noMatchCallback(this);\n }\n return this;\n }\n /**\n * Define a query to constraint to be defined when condition is falsy\n */\n unlessDialect(dialects, matchCallback, noMatchCallback) {\n dialects = Array.isArray(dialects) ? dialects : [dialects];\n if (!dialects.includes(this.client.dialect.name)) {\n matchCallback(this);\n }\n else if (noMatchCallback) {\n noMatchCallback(this);\n }\n return this;\n }\n /**\n * Applies the query scopes on the current query builder\n * instance\n */\n withScopes(callback) {\n this.scopesWrapper = this.scopesWrapper || new ModelScopes(this);\n callback(this.scopesWrapper);\n return this;\n }\n /**\n * Applies the query scopes on the current query builder\n * instance\n */\n apply(callback) {\n return this.withScopes(callback);\n }\n /**\n * Define a custom preloader instance for preloading relationships\n */\n usePreloader(preloader) {\n this.preloader = preloader;\n return this;\n }\n /**\n * Set side-loaded properties to be passed to the model instance\n */\n sideload(value, merge = false) {\n if (merge) {\n Object.assign(this.sideloaded, value);\n }\n else {\n this.sideloaded = value;\n }\n return this;\n }\n /**\n * Fetch and return first results from the results set. This method\n * will implicitly set a `limit` on the query\n */\n async first() {\n const isFetchCall = this.wrapResultsToModelInstances && this.knexQuery['_method'] === 'select';\n if (isFetchCall) {\n await this.model.$hooks.runner('before:find').run(this);\n }\n const result = await this.limit(1).execQuery();\n if (result[0] && isFetchCall) {\n await this.model.$hooks.runner('after:find').run(result[0]);\n }\n return result[0] || null;\n }\n /**\n * Fetch and return first results from the results set. This method\n * will implicitly set a `limit` on the query\n */\n async firstOrFail() {\n const row = await this.first();\n if (!row) {\n throw new errors.E_ROW_NOT_FOUND(this.model);\n }\n return row;\n }\n /**\n * Load aggregate value as a sub-query for a relationship\n */\n withAggregate(relationName, userCallback) {\n const subQuery = this.getRelationship(relationName).subQuery(this.client);\n subQuery.selfJoinCounter = this.joinCounter;\n /**\n * Invoke user callback\n */\n userCallback(subQuery);\n /**\n * Raise exception if the callback has not defined an aggregate\n */\n if (!subQuery.hasAggregates) {\n throw new Exception('\"withAggregate\" callback must use an aggregate function');\n }\n /**\n * Select \"*\" when no custom selects are defined\n */\n if (!this.columns.length) {\n this.select(`${this.model.table}.*`);\n }\n /**\n * Throw exception when no alias\n */\n if (!subQuery.subQueryAlias) {\n throw new Exception('\"withAggregate\" callback must define the alias for the aggregate query');\n }\n /**\n * Count sub-query selection\n */\n this.select(subQuery.prepare());\n /**\n * Bump the counter\n */\n this.joinCounter++;\n return this;\n }\n /**\n * Get count of a relationship alongside the main query results\n */\n withCount(relationName, userCallback) {\n this.withAggregate(relationName, (subQuery) => {\n if (typeof userCallback === 'function') {\n userCallback(subQuery);\n }\n /**\n * Count \"*\"\n */\n if (!subQuery.hasAggregates) {\n subQuery.count('*');\n }\n /**\n * Define alias for the sub-query\n */\n if (!subQuery.subQueryAlias) {\n subQuery.as(`${relationName}_count`);\n }\n });\n return this;\n }\n /**\n * Add where constraint using the relationship\n */\n whereHas(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'and', operator, value, callback);\n }\n /**\n * Add or where constraint using the relationship\n */\n orWhereHas(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'or', operator, value, callback);\n }\n /**\n * Alias of [[whereHas]]\n */\n andWhereHas(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'and', operator, value, callback);\n }\n /**\n * Add where not constraint using the relationship\n */\n whereDoesntHave(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'not', operator, value, callback);\n }\n /**\n * Add or where not constraint using the relationship\n */\n orWhereDoesntHave(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'orNot', operator, value, callback);\n }\n /**\n * Alias of [[whereDoesntHave]]\n */\n andWhereDoesntHave(relationName, callback, operator, value) {\n return this.addWhereHas(relationName, 'not', operator, value, callback);\n }\n /**\n * Add where constraint using the relationship\n */\n has(relationName, operator, value) {\n return this.addWhereHas(relationName, 'and', operator, value);\n }\n /**\n * Add or where constraint using the relationship\n */\n orHas(relationName, operator, value) {\n return this.addWhereHas(relationName, 'or', operator, value);\n }\n /**\n * Alias of [[has]]\n */\n andHas(relationName, operator, value) {\n return this.addWhereHas(relationName, 'and', operator, value);\n }\n /**\n * Add where not constraint using the relationship\n */\n doesntHave(relationName, operator, value) {\n return this.addWhereHas(relationName, 'not', operator, value);\n }\n /**\n * Add or where not constraint using the relationship\n */\n orDoesntHave(relationName, operator, value) {\n return this.addWhereHas(relationName, 'orNot', operator, value);\n }\n /**\n * Alias of [[doesntHave]]\n */\n andDoesntHave(relationName, operator, value) {\n return this.addWhereHas(relationName, 'not', operator, value);\n }\n /**\n * Define a relationship to be preloaded\n */\n preload(relationName, userCallback) {\n this.preloader.load(relationName, userCallback);\n return this;\n }\n /**\n * Define a relationship to preload, but only if they are not\n * already preloaded\n */\n preloadOnce(relationName) {\n this.preloader.preloadOnce(relationName);\n return this;\n }\n /**\n * Perform update by incrementing value for a given column. Increments\n * can be clubbed with `update` as well\n */\n increment(column, counter) {\n this.ensureCanPerformWrites();\n this.knexQuery.increment(this.resolveKey(column, true), counter);\n return this;\n }\n /**\n * Perform update by decrementing value for a given column. Decrements\n * can be clubbed with `update` as well\n */\n decrement(column, counter) {\n this.ensureCanPerformWrites();\n this.knexQuery.decrement(this.resolveKey(column, true), counter);\n return this;\n }\n update(column, value, returning) {\n this.ensureCanPerformWrites();\n if (value === undefined && returning === undefined) {\n this.knexQuery.update(this.resolveKey(column, true));\n }\n else if (returning === undefined) {\n this.knexQuery.update(this.resolveKey(column), value);\n }\n else {\n this.knexQuery.update(this.resolveKey(column), value, returning);\n }\n return this;\n }\n /**\n * Delete rows under the current query\n */\n del() {\n this.ensureCanPerformWrites();\n this.knexQuery.del();\n return this;\n }\n /**\n * Alias for [[del]]\n */\n delete() {\n return this.del();\n }\n /**\n * Turn on/off debugging for this query\n */\n debug(debug) {\n this.debugQueries = debug;\n return this;\n }\n /**\n * Define query timeout\n */\n timeout(time, options) {\n this.knexQuery['timeout'](time, options);\n return this;\n }\n /**\n * Returns SQL query as a string\n */\n toQuery() {\n this.applyWhere();\n return this.knexQuery.toQuery();\n }\n /**\n * @deprecated\n * Do not use this method. Instead create a query with options.client\n *\n * ```ts\n * Model.query({ client: trx })\n * ```\n */\n useTransaction(transaction) {\n this.knexQuery.transacting(transaction.knexClient);\n return this;\n }\n /**\n * Executes the query\n */\n async exec() {\n const isFetchCall = this.wrapResultsToModelInstances && this.knexQuery['_method'] === 'select';\n if (isFetchCall) {\n await this.model.$hooks.runner('before:fetch').run(this);\n }\n const result = await this.execQuery();\n if (isFetchCall) {\n await this.model.$hooks.runner('after:fetch').run(result);\n }\n return result;\n }\n /**\n * Paginate through rows inside a given table\n */\n async paginate(page, perPage = 20) {\n const isFetchCall = this.wrapResultsToModelInstances && this.knexQuery['_method'] === 'select';\n /**\n * Cast to number\n */\n page = Number(page);\n perPage = Number(perPage);\n const countQuery = this.clone()\n .clearOrder()\n .clearLimit()\n .clearOffset()\n .clearSelect()\n .count('* as total')\n .pojo();\n /**\n * We pass both the counts query and the main query to the\n * paginate hook\n */\n if (isFetchCall) {\n await this.model.$hooks.runner('before:paginate').run([countQuery, this]);\n await this.model.$hooks.runner('before:fetch').run(this);\n }\n const aggregateResult = await countQuery.exec();\n const total = this.hasGroupBy ? aggregateResult.length : aggregateResult[0].total;\n const results = total > 0 ? await this.forPage(page, perPage).execQuery() : [];\n /**\n * Choose paginator\n */\n const paginator = this.wrapResultsToModelInstances\n ? new ModelPaginator(total, perPage, page, ...results)\n : new SimplePaginator(total, perPage, page, ...results);\n paginator.namingStrategy = this.model.namingStrategy;\n if (isFetchCall) {\n await this.model.$hooks.runner('after:paginate').run(paginator);\n await this.model.$hooks.runner('after:fetch').run(results);\n }\n return paginator;\n }\n /**\n * Get sql representation of the query\n */\n toSQL() {\n this.applyWhere();\n return this.knexQuery.toSQL();\n }\n /**\n * Get rows back as a plain javascript object and not an array\n * of model instances\n */\n pojo() {\n this.wrapResultsToModelInstances = false;\n return this;\n }\n /**\n * Implementation of `then` for the promise API\n */\n then(resolve, reject) {\n return this.exec().then(resolve, reject);\n }\n /**\n * Implementation of `catch` for the promise API\n */\n catch(reject) {\n return this.exec().catch(reject);\n }\n /**\n * Implementation of `finally` for the promise API\n */\n finally(fulfilled) {\n return this.exec().finally(fulfilled);\n }\n /**\n * Required when Promises are extended\n */\n get [Symbol.toStringTag]() {\n return this.constructor.name;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { ModelQueryBuilder } from '../../query_builder/index.js';\n/**\n * Base query builder for ORM Relationships\n */\nexport class BaseQueryBuilder extends ModelQueryBuilder {\n /**\n * Eager constraints\n */\n groupConstraints = {};\n /**\n * Is query a relationship query obtained using `related('relation').query()`\n */\n get isRelatedQuery() {\n return true;\n }\n /**\n * Is query a relationship query obtained using `related('relation').subQuery()`\n */\n get isRelatedSubQuery() {\n return false;\n }\n /**\n * Is query a relationship query obtained using one of the preload methods.\n */\n isRelatedPreloadQuery = false;\n constructor(builder, client, relation, dbCallback) {\n super(builder, relation.relatedModel(), client, dbCallback);\n }\n /**\n * Returns the selected columns\n */\n getSelectedColumns() {\n return this.knexQuery['_statements'].find(({ grouping }) => grouping === 'columns');\n }\n /**\n * Returns the profiler action. Protected, since the class is extended\n * by relationships\n */\n getQueryData() {\n return Object.assign(this.knexQuery.toSQL(), {\n connection: this.client.connectionName,\n inTransaction: this.client.isTransaction,\n model: this.model.name,\n eagerLoading: this.isRelatedPreloadQuery,\n relation: this.profilerData(),\n });\n }\n /**\n * Returns the name of the query action. Used mainly for\n * raising descriptive errors\n */\n queryAction() {\n let action = this.knexQuery['_method'];\n if (action === 'del') {\n action = 'delete';\n }\n if (action === 'select' && this.isRelatedPreloadQuery) {\n action = 'preload';\n }\n return action;\n }\n /**\n * Selects the relation keys. Invoked by the preloader\n */\n selectRelationKeys() {\n const columns = this.getSelectedColumns();\n /**\n * No columns have been defined, we will let knex do it's job by\n * adding `select *`\n */\n if (!columns) {\n return this;\n }\n /**\n * Finally push relation columns to existing selected columns\n */\n this.getRelationKeys().forEach((key) => {\n key = this.resolveKey(key);\n if (!columns.value.includes(key)) {\n columns.value.push(key);\n }\n });\n return this;\n }\n /**\n * Define the group limit\n */\n groupLimit(limit) {\n this.groupConstraints.limit = limit;\n return this;\n }\n /**\n * Define the group limit\n */\n groupOrderBy(column, direction) {\n this.groupConstraints.orderBy = { column, direction };\n return this;\n }\n /**\n * Return knex query\n */\n toKnex() {\n this.applyConstraints();\n return super.toKnex();\n }\n /**\n * Get query sql\n */\n toSQL() {\n this.applyConstraints();\n if (this.isRelatedPreloadQuery) {\n return this.groupConstraints.limit ? this.getGroupLimitQuery().toSQL() : super.toSQL();\n }\n /**\n * Apply orderBy and limit on the standard query when not\n * an eagerloading query\n */\n if (this.groupConstraints.limit) {\n this.limit(this.groupConstraints.limit);\n }\n if (this.groupConstraints.orderBy) {\n this.orderBy(this.groupConstraints.orderBy.column, this.groupConstraints.orderBy.direction);\n }\n return super.toSQL();\n }\n /**\n * Apply constraints before fetching the first\n * row\n */\n first() {\n this.applyConstraints();\n return super.first();\n }\n /**\n * Execute query\n */\n exec() {\n this.applyConstraints();\n if (this.isRelatedPreloadQuery) {\n return this.groupConstraints.limit ? this.getGroupLimitQuery().exec() : super.exec();\n }\n /**\n * Apply orderBy and limit on the standard query when not\n * an eagerloading query\n */\n if (this.groupConstraints.limit) {\n this.limit(this.groupConstraints.limit);\n }\n if (this.groupConstraints.orderBy) {\n this.orderBy(this.groupConstraints.orderBy.column, this.groupConstraints.orderBy.direction);\n }\n return super.exec();\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { getValue, unique } from '../../../utils/index.js';\nimport { BaseQueryBuilder } from '../base/query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class HasOneQueryBuilder extends BaseQueryBuilder {\n parent;\n relation;\n appliedConstraints = false;\n constructor(builder, client, parent, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasOneQueryBuilder($builder, this.client, this.parent, this.relation);\n subQuery.isChildQuery = true;\n subQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.parent = parent;\n this.relation = relation;\n }\n /**\n * Profiler data for HasOne relationship\n */\n profilerData() {\n return {\n type: this.relation.type,\n model: this.relation.model.name,\n relatedModel: this.relation.relatedModel().name,\n };\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.foreignKey];\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasOneQueryBuilder(this.knexQuery.clone(), this.client, this.parent, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const queryAction = this.queryAction();\n /**\n * Eager query constraints\n */\n if (Array.isArray(this.parent)) {\n this.wrapExisting().whereIn(this.relation.foreignKey, unique(this.parent.map((model) => {\n return getValue(model, this.relation.localKey, this.relation, queryAction);\n })));\n return;\n }\n /**\n * Query constraints\n */\n const value = getValue(this.parent, this.relation.localKey, this.relation, queryAction);\n this.wrapExisting().where(this.relation.foreignKey, value);\n /**\n * Do not add limit when updating or deleting\n */\n if (!['update', 'delete'].includes(queryAction)) {\n this.limit(1);\n }\n }\n /**\n * Dis-allow hasOne pagination\n */\n paginate() {\n throw new Error(`Cannot paginate a hasOne relationship \"(${this.relation.relationName})\"`);\n }\n /**\n * Dis-allow hasOne group query limit\n */\n getGroupLimitQuery() {\n throw new Error(`Cannot apply groupLimit or groupOrderBy on hasOne relationship \"(${this.relation.relationName})\"`);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { ModelQueryBuilder } from '../../query_builder/index.js';\n/**\n * Base query builder for ORM Relationships\n */\nexport class BaseSubQueryBuilder extends ModelQueryBuilder {\n /**\n * The counter for the self join alias. Usually will be set by\n * the consumer\n */\n selfJoinCounter = 0;\n /**\n * Alias for the self join table\n */\n get selfJoinAlias() {\n return `adonis_temp_${this.selfJoinCounter}`;\n }\n /**\n * Is query a relationship query obtained using `related('relation').query()`\n */\n get isRelatedQuery() {\n return false;\n }\n /**\n * Is query a relationship query obtained using `related('relation').subQuery()`\n */\n get isRelatedSubQuery() {\n return true;\n }\n /**\n * Is query a relationship query obtained using one of the preload methods.\n */\n get isRelatedPreloadQuery() {\n return false;\n }\n constructor(builder, client, relation, dbCallback) {\n super(builder, relation.relatedModel(), client, dbCallback);\n }\n /**\n * Returns the selected columns\n */\n getSelectedColumns() {\n return this.knexQuery['_statements'].find(({ grouping }) => grouping === 'columns');\n }\n /**\n * Selects the relation keys. Invoked by the preloader\n */\n selectRelationKeys() {\n const columns = this.getSelectedColumns();\n /**\n * No columns have been defined, we will let knex do it's job by\n * adding `select *`\n */\n if (!columns) {\n return this;\n }\n /**\n * Finally push relation columns to existing selected columns\n */\n this.getRelationKeys().forEach((key) => {\n key = this.resolveKey(key);\n if (!columns.value.includes(key)) {\n columns.value.push(key);\n }\n });\n return this;\n }\n /**\n * Get query sql\n */\n toSQL() {\n this.prepare();\n return super.toSQL();\n }\n /**\n * prepare\n */\n prepare() {\n this.applyConstraints();\n return this;\n }\n /**\n * Executing subqueries is not allowed. It is disabled in static types, but\n * in case someone by-pass typescript checks to invoke it\n */\n exec() {\n throw new Error('Cannot execute relationship subqueries');\n }\n paginate() {\n throw new Error('Cannot execute relationship subqueries');\n }\n update() {\n throw new Error('Cannot execute relationship subqueries');\n }\n del() {\n throw new Error('Cannot execute relationship subqueries');\n }\n first() {\n throw new Error('Cannot execute relationship subqueries');\n }\n firstOrFail() {\n throw new Error('Cannot execute relationship subqueries');\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { BaseSubQueryBuilder } from '../base/sub_query_builder.js';\nexport class HasOneSubQueryBuilder extends BaseSubQueryBuilder {\n relation;\n appliedConstraints = false;\n constructor(builder, client, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasOneSubQueryBuilder($builder, this.client, this.relation);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.relation = relation;\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.foreignKey];\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasOneSubQueryBuilder(this.knexQuery.clone(), this.client, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const relatedTable = this.relation.relatedModel().table;\n const localTable = this.relation.model.table;\n let tablePrefix = relatedTable;\n /**\n * In case of self joins, we must alias the table selection\n */\n if (relatedTable === localTable) {\n this.knexQuery.from(`${relatedTable} as ${this.selfJoinAlias}`);\n tablePrefix = this.selfJoinAlias;\n }\n this.wrapExisting().where(`${localTable}.${this.relation.localKeyColumnName}`, this.client.ref(`${tablePrefix}.${this.relation.foreignKeyColumnName}`));\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { managedTransaction } from '../../../utils/index.js';\nimport { HasOneQueryBuilder } from './query_builder.js';\nimport { HasOneSubQueryBuilder } from './sub_query_builder.js';\n/**\n * Query client for executing queries in scope to the defined\n * relationship\n */\nexport class HasOneQueryClient {\n relation;\n parent;\n client;\n constructor(relation, parent, client) {\n this.relation = relation;\n this.parent = parent;\n this.client = client;\n }\n /**\n * Generate a related query builder\n */\n static query(client, relation, rows) {\n const query = new HasOneQueryBuilder(client.knexQuery(), client, rows, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a related eager query builder\n */\n static eagerQuery(client, relation, rows) {\n const query = new HasOneQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of the sub query builder\n */\n static subQuery(client, relation) {\n const query = new HasOneSubQueryBuilder(client.knexQuery(), client, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns instance of query builder\n */\n query() {\n return HasOneQueryClient.query(this.client, this.relation, this.parent);\n }\n /**\n * Save related model instance\n */\n async save(related) {\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n this.relation.hydrateForPersistance(this.parent, related);\n related.$trx = trx;\n await related.save();\n });\n }\n /**\n * Create instance of the related model\n */\n async create(values, options) {\n const parent = this.parent;\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await parent.save();\n const valuesToPersist = Object.assign({}, values);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation.relatedModel().create(valuesToPersist, { client: trx, ...options });\n });\n }\n /**\n * Get the first matching related instance or create a new one\n */\n async firstOrCreate(search, savePayload, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n const valuesToPersist = Object.assign({}, search);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation\n .relatedModel()\n .firstOrCreate(valuesToPersist, savePayload, { client: trx, ...options });\n });\n }\n /**\n * Update the existing row or create a new one\n */\n async updateOrCreate(search, updatePayload, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n const valuesToPersist = Object.assign({}, search);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation\n .relatedModel()\n .updateOrCreate(valuesToPersist, updatePayload, { client: trx, ...options });\n });\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { KeysExtractor } from '../keys_extractor.js';\nimport { HasOneQueryClient } from './query_client.js';\nimport { ensureRelationIsBooted, getValue } from '../../../utils/index.js';\n/**\n * Manages loading and persisting has one relationship\n */\nexport class HasOne {\n relationName;\n relatedModel;\n options;\n model;\n type = 'hasOne';\n booted = false;\n serializeAs;\n /**\n * Reference to the onQuery hook defined by the user\n */\n onQueryHook;\n constructor(relationName, relatedModel, options, model) {\n this.relationName = relationName;\n this.relatedModel = relatedModel;\n this.options = options;\n this.model = model;\n this.onQueryHook = this.options.onQuery;\n this.serializeAs =\n this.options.serializeAs === undefined ? this.relationName : this.options.serializeAs;\n this.meta = this.options.meta;\n }\n /**\n * Clone relationship instance\n */\n clone(parent) {\n return new HasOne(this.relationName, this.relatedModel, { ...this.options }, parent);\n }\n /**\n * Boot the relationship and ensure that all keys are in\n * place for queries to do their job.\n */\n boot() {\n if (this.booted) {\n return;\n }\n const relatedModel = this.relatedModel();\n /**\n * Extracting keys from the model and the relation model. The keys\n * extractor ensures all the required columns are defined on\n * the models for the relationship to work\n */\n const { localKey, foreignKey } = new KeysExtractor(this.model, this.relationName, {\n localKey: {\n model: this.model,\n key: this.options.localKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, relatedModel, this.relationName),\n },\n foreignKey: {\n model: relatedModel,\n key: this.options.foreignKey ||\n this.model.namingStrategy.relationForeignKey(this.type, this.model, relatedModel, this.relationName),\n },\n }).extract();\n /**\n * Keys on the parent model\n */\n this.localKey = localKey.attributeName;\n this.localKeyColumnName = localKey.columnName;\n /**\n * Keys on the related model\n */\n this.foreignKey = foreignKey.attributeName;\n this.foreignKeyColumnName = foreignKey.columnName;\n /**\n * Booted successfully\n */\n this.booted = true;\n }\n /**\n * Set related model instance\n */\n setRelated(parent, related) {\n ensureRelationIsBooted(this);\n if (related === undefined) {\n return;\n }\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Push related model instance\n */\n pushRelated(parent, related) {\n ensureRelationIsBooted(this);\n if (related === undefined) {\n return;\n }\n parent.$pushRelated(this.relationName, related);\n }\n /**\n * Finds and set the related model instance next to the parent\n * models.\n */\n setRelatedForMany(parent, related) {\n ensureRelationIsBooted(this);\n parent.forEach((parentModel) => {\n const match = related.find((relatedModel) => {\n const value = parentModel[this.localKey];\n return value !== undefined && value === relatedModel[this.foreignKey];\n });\n this.setRelated(parentModel, match || null);\n });\n }\n /**\n * Returns an instance of query client for invoking queries\n */\n client(parent, client) {\n ensureRelationIsBooted(this);\n return new HasOneQueryClient(this, parent, client);\n }\n /**\n * Returns eager query instance\n */\n eagerQuery(parent, client) {\n ensureRelationIsBooted(this);\n return HasOneQueryClient.eagerQuery(client, this, parent);\n }\n /**\n * Returns instance of query builder\n */\n subQuery(client) {\n ensureRelationIsBooted(this);\n return HasOneQueryClient.subQuery(client, this);\n }\n /**\n * Hydrates values object for persistance.\n */\n hydrateForPersistance(parent, values) {\n ;\n values[this.foreignKey] = getValue(parent, this.localKey, this, 'persist');\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { getValue, unique } from '../../../utils/index.js';\nimport { BaseQueryBuilder } from '../base/query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class HasManyQueryBuilder extends BaseQueryBuilder {\n parent;\n relation;\n appliedConstraints = false;\n constructor(builder, client, parent, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasManyQueryBuilder($builder, this.client, this.parent, this.relation);\n subQuery.isChildQuery = true;\n subQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.parent = parent;\n this.relation = relation;\n }\n /**\n * Profiler data for HasMany relationship\n */\n profilerData() {\n return {\n type: this.relation.type,\n model: this.relation.model.name,\n relatedModel: this.relation.relatedModel().name,\n };\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.foreignKey];\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasManyQueryBuilder(this.knexQuery.clone(), this.client, this.parent, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n const queryAction = this.queryAction();\n this.appliedConstraints = true;\n /**\n * Eager query constraints\n */\n if (Array.isArray(this.parent)) {\n this.wrapExisting().whereIn(this.relation.foreignKey, unique(this.parent.map((model) => {\n return getValue(model, this.relation.localKey, this.relation, queryAction);\n })));\n return;\n }\n /**\n * Query constraints\n */\n const value = getValue(this.parent, this.relation.localKey, this.relation, queryAction);\n this.wrapExisting().where(this.relation.foreignKey, value);\n }\n /**\n * Same as standard model query builder paginate method. But ensures that\n * it is not invoked during eagerloading\n */\n paginate(page, perPage = 20) {\n if (this.isRelatedPreloadQuery) {\n throw new Error(`Cannot paginate relationship \"${this.relation.relationName}\" during preload`);\n }\n this.applyConstraints();\n return super.paginate(page, perPage);\n }\n /**\n * Returns the group limit query\n */\n getGroupLimitQuery() {\n const { direction, column } = this.groupConstraints.orderBy || {\n column: this.resolveKey(this.relation.relatedModel().primaryKey),\n direction: 'desc',\n };\n const rowName = 'adonis_group_limit_counter';\n const partitionBy = `PARTITION BY ${this.relation.foreignKeyColumnName}`;\n const orderBy = `ORDER BY ${column} ${direction}`;\n /**\n * Select * when no columns are selected\n */\n if (!this.getSelectedColumns()) {\n this.select('*');\n }\n this.select(this.client.raw(`row_number() over (${partitionBy} ${orderBy}) as ${rowName}`)).as('adonis_temp');\n const groupQuery = this.relation.relatedModel().query();\n groupQuery.usePreloader(this.preloader);\n groupQuery.sideload(this.sideloaded);\n groupQuery.debug(this.debugQueries);\n this.customReporterData && groupQuery.reporterData(this.customReporterData);\n return groupQuery.from(this).where(rowName, '<=', this.groupConstraints.limit);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { BaseSubQueryBuilder } from '../base/sub_query_builder.js';\nexport class HasManySubQueryBuilder extends BaseSubQueryBuilder {\n relation;\n appliedConstraints = false;\n constructor(builder, client, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasManySubQueryBuilder($builder, this.client, this.relation);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.relation = relation;\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.foreignKey];\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasManySubQueryBuilder(this.knexQuery.clone(), this.client, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const relatedTable = this.relation.relatedModel().table;\n const localTable = this.relation.model.table;\n let tablePrefix = relatedTable;\n /**\n * In case of self joins, we must alias the table selection\n */\n if (relatedTable === localTable) {\n this.knexQuery.from(`${relatedTable} as ${this.selfJoinAlias}`);\n tablePrefix = this.selfJoinAlias;\n }\n this.wrapExisting().where(`${localTable}.${this.relation.localKeyColumnName}`, this.client.ref(`${tablePrefix}.${this.relation.foreignKeyColumnName}`));\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { managedTransaction } from '../../../utils/index.js';\nimport { HasManyQueryBuilder } from './query_builder.js';\nimport { HasManySubQueryBuilder } from './sub_query_builder.js';\n/**\n * Query client for executing queries in scope to the defined\n * relationship\n */\nexport class HasManyQueryClient {\n relation;\n parent;\n client;\n constructor(relation, parent, client) {\n this.relation = relation;\n this.parent = parent;\n this.client = client;\n }\n /**\n * Generate a related query builder\n */\n static query(client, relation, row) {\n const query = new HasManyQueryBuilder(client.knexQuery(), client, row, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a related eager query builder\n */\n static eagerQuery(client, relation, rows) {\n const query = new HasManyQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of the sub query\n */\n static subQuery(client, relation) {\n const query = new HasManySubQueryBuilder(client.knexQuery(), client, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns instance of query builder\n */\n query() {\n return HasManyQueryClient.query(this.client, this.relation, this.parent);\n }\n /**\n * Save related model instance\n */\n async save(related) {\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n this.relation.hydrateForPersistance(this.parent, related);\n related.$trx = trx;\n await related.save();\n });\n }\n /**\n * Save related model instance\n */\n async saveMany(related) {\n const parent = this.parent;\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await parent.save();\n for (let row of related) {\n this.relation.hydrateForPersistance(this.parent, row);\n row.$trx = trx;\n await row.save();\n }\n });\n }\n /**\n * Create instance of the related model\n */\n async create(values, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n const valuesToPersist = Object.assign({}, values);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation.relatedModel().create(valuesToPersist, { client: trx, ...options });\n });\n }\n /**\n * Create instance of the related model\n */\n async createMany(values, options) {\n const parent = this.parent;\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await parent.save();\n const valuesToPersist = values.map((value) => {\n const valueToPersist = Object.assign({}, value);\n this.relation.hydrateForPersistance(this.parent, valueToPersist);\n return valueToPersist;\n });\n return this.relation.relatedModel().createMany(valuesToPersist, { client: trx, ...options });\n });\n }\n /**\n * Get the first matching related instance or create a new one\n */\n async firstOrCreate(search, savePayload, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n const valuesToPersist = Object.assign({}, search);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation\n .relatedModel()\n .firstOrCreate(valuesToPersist, savePayload, { client: trx, ...options });\n });\n }\n /**\n * Update the existing row or create a new one\n */\n async updateOrCreate(search, updatePayload, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n const valuesToPersist = Object.assign({}, search);\n this.relation.hydrateForPersistance(this.parent, valuesToPersist);\n return this.relation\n .relatedModel()\n .updateOrCreate(valuesToPersist, updatePayload, { client: trx, ...options });\n });\n }\n /**\n * Fetch the existing related rows or create new one's\n */\n async fetchOrCreateMany(payload, predicate, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n payload.forEach((row) => {\n this.relation.hydrateForPersistance(this.parent, row);\n });\n predicate = Array.isArray(predicate) ? predicate : predicate ? [predicate] : [];\n return this.relation\n .relatedModel()\n .fetchOrCreateMany(predicate.concat(this.relation.foreignKey), payload, {\n client: trx,\n ...options,\n });\n });\n }\n /**\n * Update the existing related rows or create new one's\n */\n async updateOrCreateMany(payload, predicate, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n payload.forEach((row) => {\n this.relation.hydrateForPersistance(this.parent, row);\n });\n predicate = Array.isArray(predicate) ? predicate : predicate ? [predicate] : [];\n return this.relation\n .relatedModel()\n .updateOrCreateMany(predicate.concat(this.relation.foreignKey), payload, {\n client: trx,\n ...options,\n });\n });\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { KeysExtractor } from '../keys_extractor.js';\nimport { HasManyQueryClient } from './query_client.js';\nimport { ensureRelationIsBooted, getValue } from '../../../utils/index.js';\n/**\n * Manages persisting and fetching relationships\n */\nexport class HasMany {\n relationName;\n relatedModel;\n options;\n model;\n /**\n * The relationship name\n */\n type = 'hasMany';\n /**\n * Whether or not the relationship instance has been\n * booted\n */\n booted = false;\n /**\n * The key name for serializing the relationship\n */\n serializeAs;\n /**\n * Reference to the onQuery hook defined by the user\n */\n onQueryHook;\n constructor(relationName, relatedModel, options, model) {\n this.relationName = relationName;\n this.relatedModel = relatedModel;\n this.options = options;\n this.model = model;\n this.serializeAs =\n this.options.serializeAs === undefined ? this.relationName : this.options.serializeAs;\n this.onQueryHook = this.options.onQuery;\n this.meta = this.options.meta;\n }\n /**\n * Returns a boolean saving related row belongs to the parent\n * row or not.\n */\n isRelatedRow(parent, related) {\n return (parent[this.localKey] !== undefined &&\n related[this.foreignKey] === parent[this.localKey]);\n }\n /**\n * Clone relationship instance\n */\n clone(parent) {\n return new HasMany(this.relationName, this.relatedModel, { ...this.options }, parent);\n }\n /**\n * Boot the relationship and ensure that all keys are in\n * place for queries to do their job.\n */\n boot() {\n if (this.booted) {\n return;\n }\n const relatedModel = this.relatedModel();\n /**\n * Extracting keys from the model and the relation model. The keys\n * extractor ensures all the required columns are defined on\n * the models for the relationship to work\n */\n const { localKey, foreignKey } = new KeysExtractor(this.model, this.relationName, {\n localKey: {\n model: this.model,\n key: this.options.localKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, relatedModel, this.relationName),\n },\n foreignKey: {\n model: relatedModel,\n key: this.options.foreignKey ||\n this.model.namingStrategy.relationForeignKey(this.type, this.model, relatedModel, this.relationName),\n },\n }).extract();\n /**\n * Keys on the parent model\n */\n this.localKey = localKey.attributeName;\n this.localKeyColumnName = localKey.columnName;\n /**\n * Keys on the related model\n */\n this.foreignKey = foreignKey.attributeName;\n this.foreignKeyColumnName = foreignKey.columnName;\n /**\n * Booted successfully\n */\n this.booted = true;\n }\n /**\n * Set related model instances\n */\n setRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Push related model instance(s)\n */\n pushRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$pushRelated(this.relationName, related);\n }\n /**\n * Finds and set the related model instances next to the parent\n * models.\n */\n setRelatedForMany(parent, related) {\n ensureRelationIsBooted(this);\n parent.forEach((parentModel) => {\n const relatedRows = related.filter((relatedModel) => this.isRelatedRow(parentModel, relatedModel));\n this.setRelated(parentModel, relatedRows);\n });\n }\n /**\n * Returns an instance of query client for invoking queries\n */\n client(parent, client) {\n ensureRelationIsBooted(this);\n return new HasManyQueryClient(this, parent, client);\n }\n /**\n * Returns an instance of the eager query\n */\n eagerQuery(parent, client) {\n ensureRelationIsBooted(this);\n return HasManyQueryClient.eagerQuery(client, this, parent);\n }\n /**\n * Returns instance of query builder\n */\n subQuery(client) {\n ensureRelationIsBooted(this);\n return HasManyQueryClient.subQuery(client, this);\n }\n /**\n * Hydrates values object for persistance.\n */\n hydrateForPersistance(parent, values) {\n ;\n values[this.foreignKey] = getValue(parent, this.localKey, this, 'persist');\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { Exception } from '@poppinss/utils';\nimport { unique } from '../../../utils/index.js';\nimport { BaseQueryBuilder } from '../base/query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class BelongsToQueryBuilder extends BaseQueryBuilder {\n parent;\n relation;\n appliedConstraints = false;\n constructor(builder, client, parent, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new BelongsToQueryBuilder($builder, this.client, this.parent, this.relation);\n subQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.parent = parent;\n this.relation = relation;\n }\n /**\n * Raises exception that FK value is null\n */\n raiseMissingForeignKey() {\n const { relationName, foreignKey } = this.relation;\n const modelName = this.relation.model.name;\n throw new Exception([\n `Cannot preload \"${relationName}\", value of \"${modelName}.${foreignKey}\" is undefined.`,\n 'Make sure to set \"null\" as the default value for foreign keys',\n ].join(' '), { status: 500 });\n }\n /**\n * The profiler data for belongsTo relationship\n */\n profilerData() {\n return {\n type: this.relation.type,\n model: this.relation.model.name,\n relatedModel: this.relation.relatedModel().name,\n };\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.localKey];\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const queryAction = this.queryAction();\n /**\n * Eager query constraints\n */\n if (Array.isArray(this.parent)) {\n const foreignKeyValues = this.parent\n .map((model) => model[this.relation.foreignKey])\n .filter((foreignKeyValue) => {\n if (foreignKeyValue === undefined) {\n this.raiseMissingForeignKey();\n }\n return foreignKeyValue !== null;\n });\n this.wrapExisting().whereIn(this.relation.localKey, unique(foreignKeyValues));\n return;\n }\n /**\n * Query constraints\n */\n if (this.parent[this.relation.foreignKey] === undefined) {\n this.raiseMissingForeignKey();\n }\n this.wrapExisting().where(this.relation.localKey, this.parent[this.relation.foreignKey]);\n /**\n * Do not add limit when updating or deleting\n */\n if (!['update', 'delete'].includes(queryAction)) {\n this.limit(1);\n }\n return;\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new BelongsToQueryBuilder(this.knexQuery.clone(), this.client, this.parent, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Dis-allow belongsTo pagination\n */\n paginate() {\n throw new Error(`Cannot paginate a belongsTo relationship \"(${this.relation.relationName})\"`);\n }\n /**\n * Dis-allow belongsTo group query limit\n */\n getGroupLimitQuery() {\n throw new Error(`Cannot apply groupLimit or groupOrderBy on a belongsTo relationship \"(${this.relation.relationName})\"`);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { BaseSubQueryBuilder } from '../base/sub_query_builder.js';\nexport class BelongsToSubQueryBuilder extends BaseSubQueryBuilder {\n relation;\n appliedConstraints = false;\n constructor(builder, client, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new BelongsToSubQueryBuilder($builder, this.client, this.relation);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.relation = relation;\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.foreignKey];\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new BelongsToSubQueryBuilder(this.knexQuery.clone(), this.client, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const relatedTable = this.relation.relatedModel().table;\n const localTable = this.relation.model.table;\n let tablePrefix = relatedTable;\n /**\n * In case of self joins, we must alias the table selection\n */\n if (relatedTable === localTable) {\n this.knexQuery.from(`${relatedTable} as ${this.selfJoinAlias}`);\n tablePrefix = this.selfJoinAlias;\n }\n this.wrapExisting().where(`${tablePrefix}.${this.relation.localKeyColumnName}`, this.client.ref(`${localTable}.${this.relation.foreignKeyColumnName}`));\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { managedTransaction } from '../../../utils/index.js';\nimport { BelongsToQueryBuilder } from './query_builder.js';\nimport { BelongsToSubQueryBuilder } from './sub_query_builder.js';\n/**\n * Query client for executing queries in scope to the belongsTo relationship.\n */\nexport class BelongsToQueryClient {\n relation;\n parent;\n client;\n constructor(relation, parent, client) {\n this.relation = relation;\n this.parent = parent;\n this.client = client;\n }\n /**\n * Generate a query builder instance\n */\n static query(client, relation, rows) {\n const query = new BelongsToQueryBuilder(client.knexQuery(), client, rows, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a eager query\n */\n static eagerQuery(client, relation, rows) {\n const query = new BelongsToQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of the subquery\n */\n static subQuery(client, relation) {\n const query = new BelongsToSubQueryBuilder(client.knexQuery(), client, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns instance of query builder\n */\n query() {\n return BelongsToQueryClient.query(this.client, this.relation, this.parent);\n }\n /**\n * Associate the related model with the parent model\n */\n async associate(related) {\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n related.$trx = trx;\n await related.save();\n this.relation.hydrateForPersistance(this.parent, related);\n this.parent.$trx = trx;\n await this.parent.save();\n });\n }\n /**\n * Drop association\n */\n async dissociate() {\n ;\n this.parent[this.relation.foreignKey] = null;\n await this.parent.save();\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { KeysExtractor } from '../keys_extractor.js';\nimport { BelongsToQueryClient } from './query_client.js';\nimport { ensureRelationIsBooted, getValue } from '../../../utils/index.js';\n/**\n * Manages loading and persisting belongs to relationship\n */\nexport class BelongsTo {\n relationName;\n relatedModel;\n options;\n model;\n /**\n * Relationship name\n */\n type = 'belongsTo';\n /**\n * Whether or not the relationship instance has been booted\n */\n booted = false;\n /**\n * The key name for serializing the relationship\n */\n serializeAs;\n /**\n * Reference to the onQuery hook defined by the user\n */\n onQueryHook;\n constructor(relationName, relatedModel, options, model) {\n this.relationName = relationName;\n this.relatedModel = relatedModel;\n this.options = options;\n this.model = model;\n this.onQueryHook = this.options.onQuery;\n this.serializeAs =\n this.options.serializeAs === undefined ? this.relationName : this.options.serializeAs;\n this.meta = this.options.meta;\n }\n /**\n * Clone relationship instance\n */\n clone(parent) {\n return new BelongsTo(this.relationName, this.relatedModel, { ...this.options }, parent);\n }\n /**\n * Returns a boolean telling if the related row belongs to the parent\n * row or not.\n */\n isRelatedRow(parent, related) {\n return (related[this.localKey] !== undefined &&\n parent[this.foreignKey] === related[this.localKey]);\n }\n /**\n * Boot the relationship and ensure that all keys are in\n * place for queries to do their job.\n */\n boot() {\n if (this.booted) {\n return;\n }\n const relatedModel = this.relatedModel();\n /**\n * Extracting keys from the model and the relation model. The keys\n * extractor ensures all the required columns are defined on\n * the models for the relationship to work\n */\n const { localKey, foreignKey } = new KeysExtractor(this.model, this.relationName, {\n localKey: {\n model: relatedModel,\n key: this.options.localKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, relatedModel, this.relationName),\n },\n foreignKey: {\n model: this.model,\n key: this.options.foreignKey ||\n this.model.namingStrategy.relationForeignKey(this.type, this.model, relatedModel, this.relationName),\n },\n }).extract();\n /**\n * Keys on the related model\n */\n this.localKey = localKey.attributeName;\n this.localKeyColumnName = localKey.columnName;\n /**\n * Keys on the parent model\n */\n this.foreignKey = foreignKey.attributeName;\n this.foreignKeyColumnName = foreignKey.columnName;\n /**\n * Booted successfully\n */\n this.booted = true;\n }\n /**\n * Set related model instance\n */\n setRelated(parent, related) {\n ensureRelationIsBooted(this);\n if (related === undefined) {\n return;\n }\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Push related model instance\n */\n pushRelated(parent, related) {\n ensureRelationIsBooted(this);\n if (related === undefined) {\n return;\n }\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Finds and set the related model instance next to the parent\n * models.\n */\n setRelatedForMany(parent, related) {\n ensureRelationIsBooted(this);\n parent.forEach((parentRow) => {\n const match = related.find((relatedRow) => this.isRelatedRow(parentRow, relatedRow));\n this.setRelated(parentRow, match || null);\n });\n }\n /**\n * Returns an instance of query client for the given relationship\n */\n client(parent, client) {\n ensureRelationIsBooted(this);\n return new BelongsToQueryClient(this, parent, client);\n }\n /**\n * Returns instance of the eager query for the relationship\n */\n eagerQuery(parent, client) {\n ensureRelationIsBooted(this);\n return BelongsToQueryClient.eagerQuery(client, this, parent);\n }\n /**\n * Returns instance of query builder\n */\n subQuery(client) {\n ensureRelationIsBooted(this);\n return BelongsToQueryClient.subQuery(client, this);\n }\n /**\n * Hydrates values object for persistance.\n */\n hydrateForPersistance(parent, related) {\n ;\n parent[this.foreignKey] = getValue(related, this.localKey, this, 'associate');\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { PivotHelpers } from './pivot_helpers.js';\nimport { BaseSubQueryBuilder } from '../base/sub_query_builder.js';\n/**\n * Exposes the API to construct sub queries for a many to many relationships\n */\nexport class ManyToManySubQueryBuilder extends BaseSubQueryBuilder {\n builder;\n client;\n relation;\n /**\n * Pivot helpers provides the implementation for pivot table constraints\n * and clauses\n */\n pivotHelpers = new PivotHelpers(this, false);\n /**\n * Reference to the related table\n */\n relatedTable;\n hasSelfRelation;\n /**\n * Whether or not the constraints has been applied\n */\n appliedConstraints = false;\n isChildQuery = false;\n constructor(builder, client, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new ManyToManySubQueryBuilder($builder, this.client, this.relation);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.builder = builder;\n this.client = client;\n this.relation = relation;\n this.relatedTable = this.relation.relatedModel().table;\n this.hasSelfRelation = this.relatedTable === this.relation.model.table;\n }\n /**\n * Prefixes the related table name to a column\n */\n prefixRelatedTable(column) {\n if (column.includes('.')) {\n return column;\n }\n if (this.hasSelfRelation) {\n return `${this.selfJoinAlias}.${column}`;\n }\n return `${this.relatedTable}.${column}`;\n }\n /**\n * Transforms the selected column names by prefixing the\n * table name\n */\n transformRelatedTableColumns(columns) {\n return columns.map((column) => {\n if (typeof column === 'string') {\n return this.prefixRelatedTable(this.resolveKey(column));\n }\n return this.transformValue(column);\n });\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [`${this.relation.relatedModel().table}.${this.relation.relatedKeyColumnName}`];\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n const localTable = this.relation.model.table;\n let tablePrefix = this.relatedTable;\n /**\n * In case of self joins, we must alias the table selection\n */\n if (this.relation.relatedModel() === this.relation.model) {\n this.knexQuery.from(`${this.relatedTable} as ${this.selfJoinAlias}`);\n tablePrefix = this.selfJoinAlias;\n }\n this.innerJoin(this.relation.pivotTable, `${tablePrefix}.${this.relation.relatedKeyColumnName}`, `${this.relation.pivotTable}.${this.relation.pivotRelatedForeignKey}`);\n this.wrapExisting().where(`${localTable}.${this.relation.localKeyColumnName}`, this.client.ref(this.pivotHelpers.prefixPivotTable(this.relation.pivotForeignKey)));\n }\n /**\n * Select keys from the related table\n */\n select(...args) {\n let columns = args;\n if (Array.isArray(args[0])) {\n columns = args[0];\n }\n this.knexQuery.select(this.transformRelatedTableColumns(columns));\n return this;\n }\n /**\n * Add where clause with pivot table prefix\n */\n wherePivot(key, operator, value) {\n this.pivotHelpers.wherePivot('and', key, operator, value);\n return this;\n }\n /**\n * Add or where clause with pivot table prefix\n */\n orWherePivot(key, operator, value) {\n this.pivotHelpers.wherePivot('or', key, operator, value);\n return this;\n }\n /**\n * Alias for wherePivot\n */\n andWherePivot(key, operator, value) {\n return this.wherePivot(key, operator, value);\n }\n /**\n * Add where not pivot\n */\n whereNotPivot(key, operator, value) {\n this.pivotHelpers.wherePivot('not', key, operator, value);\n return this;\n }\n /**\n * Add or where not pivot\n */\n orWhereNotPivot(key, operator, value) {\n this.pivotHelpers.wherePivot('orNot', key, operator, value);\n return this;\n }\n /**\n * Alias for `whereNotPivot`\n */\n andWhereNotPivot(key, operator, value) {\n return this.whereNotPivot(key, operator, value);\n }\n /**\n * Adds where in clause\n */\n whereInPivot(key, value) {\n this.pivotHelpers.whereInPivot('and', key, value);\n return this;\n }\n /**\n * Adds or where in clause\n */\n orWhereInPivot(key, value) {\n this.pivotHelpers.whereInPivot('or', key, value);\n return this;\n }\n /**\n * Alias from `whereInPivot`\n */\n andWhereInPivot(key, value) {\n return this.whereInPivot(key, value);\n }\n /**\n * Adds where not in clause\n */\n whereNotInPivot(key, value) {\n this.pivotHelpers.whereInPivot('not', key, value);\n return this;\n }\n /**\n * Adds or where not in clause\n */\n orWhereNotInPivot(key, value) {\n this.pivotHelpers.whereInPivot('orNot', key, value);\n return this;\n }\n /**\n * Alias from `whereNotInPivot`\n */\n andWhereNotInPivot(key, value) {\n return this.whereNotInPivot(key, value);\n }\n /**\n * Same as \"whereNull\", but for the pivot table only\n */\n whereNullPivot(key) {\n this.pivotHelpers.whereNullPivot('and', key);\n return this;\n }\n /**\n * Same as \"orWhereNull\", but for the pivot table only\n */\n orWhereNullPivot(key) {\n this.pivotHelpers.whereNullPivot('or', key);\n return this;\n }\n /**\n * Same as \"andWhereNull\", but for the pivot table only\n */\n andWhereNullPivot(key) {\n return this.whereNullPivot(key);\n }\n /**\n * Same as \"whereNotNull\", but for the pivot table only\n */\n whereNotNullPivot(key) {\n this.pivotHelpers.whereNullPivot('not', key);\n return this;\n }\n /**\n * Same as \"orWhereNotNull\", but for the pivot table only\n */\n orWhereNotNullPivot(key) {\n this.pivotHelpers.whereNullPivot('orNot', key);\n return this;\n }\n /**\n * Same as \"andWhereNotNull\", but for the pivot table only\n */\n andWhereNotNullPivot(key) {\n return this.whereNotNullPivot(key);\n }\n /**\n * Select pivot columns\n */\n pivotColumns(columns) {\n this.pivotHelpers.pivotColumns(columns);\n return this;\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new ManyToManySubQueryBuilder(this.knexQuery.clone(), this.client, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { ManyToManySubQueryBuilder } from './sub_query_builder.js';\nexport class PivotHelpers {\n query;\n aliasSelectColumns;\n constructor(query, aliasSelectColumns) {\n this.query = query;\n this.aliasSelectColumns = aliasSelectColumns;\n }\n /**\n * Prefixes the pivot table name to a column\n */\n prefixPivotTable(column) {\n if (column.includes('.')) {\n return column;\n }\n if (this.query instanceof ManyToManySubQueryBuilder) {\n return `${this.query.relation.pivotTable}.${column}`;\n }\n return this.query.isPivotOnlyQuery ? column : `${this.query.relation.pivotTable}.${column}`;\n }\n /**\n * Adds a where pivot condition to the query\n */\n wherePivot(variation, key, operator, value) {\n let method = 'where';\n switch (variation) {\n case 'or':\n method = 'orWhere';\n break;\n case 'not':\n method = 'whereNot';\n break;\n case 'orNot':\n method = 'orWhereNot';\n }\n if (value !== undefined) {\n return this.query[method](this.prefixPivotTable(key), operator, value);\n }\n else if (operator !== undefined) {\n return this.query[method](this.prefixPivotTable(key), operator);\n }\n else {\n return this.query[method](key);\n }\n }\n /**\n * Adds a where pivot condition to the query\n */\n whereNullPivot(variation, key) {\n let method = 'whereNull';\n switch (variation) {\n case 'or':\n method = 'orWhereNull';\n break;\n case 'not':\n method = 'whereNotNull';\n break;\n case 'orNot':\n method = 'orWhereNotNull';\n }\n return this.query[method](this.prefixPivotTable(key));\n }\n /**\n * Adds a where pivot condition to the query\n */\n whereInPivot(variation, key, value) {\n let method = 'whereIn';\n switch (variation) {\n case 'or':\n method = 'orWhereIn';\n break;\n case 'not':\n method = 'whereNotIn';\n break;\n case 'orNot':\n method = 'orWhereNotIn';\n }\n key = Array.isArray(key)\n ? key.map((one) => this.prefixPivotTable(one))\n : this.prefixPivotTable(key);\n return this.query[method](key, value);\n }\n /**\n * Select pivot columns\n */\n pivotColumns(columns) {\n this.query.knexQuery.select(columns.map((column) => {\n if (this.aliasSelectColumns) {\n return `${this.prefixPivotTable(column)} as ${this.query.relation.pivotAlias(column)}`;\n }\n return this.prefixPivotTable(column);\n }));\n return this;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { DateTime } from 'luxon';\nimport { PivotHelpers } from './pivot_helpers.js';\nimport { getValue, unique } from '../../../utils/index.js';\nimport { BaseQueryBuilder } from '../base/query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class ManyToManyQueryBuilder extends BaseQueryBuilder {\n parent;\n relation;\n pivotQuery = false;\n relatedTable;\n pivotHelpers = new PivotHelpers(this, true);\n cherryPickingKeys = false;\n appliedConstraints = false;\n /**\n * A boolean to know if query build targets only the pivot\n * table or not\n */\n get isPivotOnlyQuery() {\n return this.pivotQuery;\n }\n set isPivotOnlyQuery(pivotOnly) {\n this.pivotQuery = pivotOnly;\n /**\n * Get plain object for a pivot only query\n */\n if (this.pivotQuery) {\n this.pojo();\n }\n }\n constructor(builder, client, parent, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new ManyToManyQueryBuilder($builder, this.client, this.parent, this.relation);\n subQuery.isChildQuery = true;\n subQuery.isPivotOnlyQuery = this.isPivotOnlyQuery;\n subQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.parent = parent;\n this.relation = relation;\n this.relatedTable = this.relation.relatedModel().table;\n }\n /**\n * Profiler data for ManyToMany relationship\n */\n profilerData() {\n return {\n type: this.relation.type,\n model: this.relation.model.name,\n pivotTable: this.relation.pivotTable,\n relatedModel: this.relation.relatedModel().name,\n };\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.prefixRelatedTable(this.relation.relatedKeyColumnName)];\n }\n /**\n * Prefixes the related table name to a column\n */\n prefixRelatedTable(column) {\n return column.includes('.') ? column : `${this.relatedTable}.${column}`;\n }\n /**\n * Adds where constraint to the pivot table\n */\n addWhereConstraints() {\n const queryAction = this.queryAction();\n /**\n * Eager query constraints\n */\n if (Array.isArray(this.parent)) {\n this.wrapExisting().whereInPivot(this.relation.pivotForeignKey, unique(this.parent.map((model) => {\n return getValue(model, this.relation.localKey, this.relation, queryAction);\n })));\n return;\n }\n /**\n * Query constraints\n */\n const value = getValue(this.parent, this.relation.localKey, this.relation, queryAction);\n this.wrapExisting().wherePivot(this.relation.pivotForeignKey, value);\n }\n /**\n * Transforms the selected column names by prefixing the\n * table name\n */\n transformRelatedTableColumns(columns) {\n if (this.isPivotOnlyQuery) {\n return columns;\n }\n return columns.map((column) => {\n if (typeof column === 'string') {\n return this.prefixRelatedTable(this.resolveKey(column));\n }\n return this.transformValue(column);\n });\n }\n /**\n * Applying query constraints to scope them to relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n if (this.isPivotOnlyQuery || ['delete', 'update'].includes(this.queryAction())) {\n this.from(this.relation.pivotTable);\n this.addWhereConstraints();\n return;\n }\n /**\n * Add select statements only when not running aggregate\n * queries. The end user can still select columns\n */\n if (!this.hasAggregates) {\n /**\n * Select * from related model when user is not cherry picking\n * keys\n */\n if (!this.cherryPickingKeys) {\n this.select('*');\n }\n /**\n * Select columns from the pivot table\n */\n this.pivotColumns([this.relation.pivotForeignKey, this.relation.pivotRelatedForeignKey]\n .concat(this.relation.pivotColumns)\n .concat(this.relation.pivotTimestamps));\n }\n /**\n * Add inner join between related model and pivot table\n */\n this.innerJoin(this.relation.pivotTable, `${this.relatedTable}.${this.relation.relatedKeyColumnName}`, `${this.relation.pivotTable}.${this.relation.pivotRelatedForeignKey}`);\n this.addWhereConstraints();\n return;\n }\n /**\n * Select keys from the related table\n */\n select(...args) {\n let columns = args;\n if (Array.isArray(args[0])) {\n columns = args[0];\n }\n this.cherryPickingKeys = true;\n this.knexQuery.select(this.transformRelatedTableColumns(columns));\n return this;\n }\n /**\n * Add where clause with pivot table prefix\n */\n wherePivot(key, operator, value) {\n this.pivotHelpers.wherePivot('and', key, operator, value);\n return this;\n }\n /**\n * Add or where clause with pivot table prefix\n */\n orWherePivot(key, operator, value) {\n this.pivotHelpers.wherePivot('or', key, operator, value);\n return this;\n }\n /**\n * Alias for wherePivot\n */\n andWherePivot(key, operator, value) {\n return this.wherePivot(key, operator, value);\n }\n /**\n * Add where not pivot\n */\n whereNotPivot(key, operator, value) {\n this.pivotHelpers.wherePivot('not', key, operator, value);\n return this;\n }\n /**\n * Add or where not pivot\n */\n orWhereNotPivot(key, operator, value) {\n this.pivotHelpers.wherePivot('orNot', key, operator, value);\n return this;\n }\n /**\n * Alias for `whereNotPivot`\n */\n andWhereNotPivot(key, operator, value) {\n return this.whereNotPivot(key, operator, value);\n }\n /**\n * Adds where in clause\n */\n whereInPivot(key, value) {\n this.pivotHelpers.whereInPivot('and', key, value);\n return this;\n }\n /**\n * Adds or where in clause\n */\n orWhereInPivot(key, value) {\n this.pivotHelpers.whereInPivot('or', key, value);\n return this;\n }\n /**\n * Alias from `whereInPivot`\n */\n andWhereInPivot(key, value) {\n return this.whereInPivot(key, value);\n }\n /**\n * Adds where not in clause\n */\n whereNotInPivot(key, value) {\n this.pivotHelpers.whereInPivot('not', key, value);\n return this;\n }\n /**\n * Adds or where not in clause\n */\n orWhereNotInPivot(key, value) {\n this.pivotHelpers.whereInPivot('orNot', key, value);\n return this;\n }\n /**\n * Alias from `whereNotInPivot`\n */\n andWhereNotInPivot(key, value) {\n return this.whereNotInPivot(key, value);\n }\n /**\n * Same as \"whereNull\", but for the pivot table only\n */\n whereNullPivot(key) {\n this.pivotHelpers.whereNullPivot('and', key);\n return this;\n }\n /**\n * Same as \"orWhereNull\", but for the pivot table only\n */\n orWhereNullPivot(key) {\n this.pivotHelpers.whereNullPivot('or', key);\n return this;\n }\n /**\n * Same as \"andWhereNull\", but for the pivot table only\n */\n andWhereNullPivot(key) {\n return this.whereNullPivot(key);\n }\n /**\n * Same as \"whereNotNull\", but for the pivot table only\n */\n whereNotNullPivot(key) {\n this.pivotHelpers.whereNullPivot('not', key);\n return this;\n }\n /**\n * Same as \"orWhereNotNull\", but for the pivot table only\n */\n orWhereNotNullPivot(key) {\n this.pivotHelpers.whereNullPivot('orNot', key);\n return this;\n }\n /**\n * Same as \"andWhereNotNull\", but for the pivot table only\n */\n andWhereNotNullPivot(key) {\n return this.whereNotNullPivot(key);\n }\n /**\n * Select pivot columns\n */\n pivotColumns(columns) {\n this.pivotHelpers.pivotColumns(columns);\n return this;\n }\n /**\n * Clones query\n */\n clone() {\n this.applyConstraints();\n const clonedQuery = new ManyToManyQueryBuilder(this.knexQuery.clone(), this.client, this.parent, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.isPivotOnlyQuery = this.isPivotOnlyQuery;\n clonedQuery.cherryPickingKeys = this.cherryPickingKeys;\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Paginate through rows inside a given table\n */\n paginate(page, perPage = 20) {\n if (this.isRelatedPreloadQuery) {\n throw new Error(`Cannot paginate relationship \"${this.relation.relationName}\" during preload`);\n }\n this.applyConstraints();\n return super.paginate(page, perPage);\n }\n async exec() {\n const pivotTimestamps = this.relation.pivotTimestamps.map((timestamp) => this.relation.pivotAlias(timestamp));\n /**\n * Transform pivot timestamps\n */\n if (pivotTimestamps.length) {\n this.rowTransformer((row) => {\n pivotTimestamps.forEach((timestamp) => {\n const timestampValue = row.$extras[timestamp];\n if (!timestampValue) {\n return;\n }\n /**\n * Convert from string\n */\n if (typeof timestampValue === 'string') {\n row.$extras[timestamp] = DateTime.fromSQL(timestampValue);\n }\n /**\n * Convert from date\n */\n if (timestampValue instanceof Date) {\n row.$extras[timestamp] = DateTime.fromJSDate(timestampValue);\n }\n });\n });\n }\n return super.exec();\n }\n /**\n * Returns the group limit query\n */\n getGroupLimitQuery() {\n const { direction, column } = this.groupConstraints.orderBy || {\n column: this.prefixRelatedTable(this.resolveKey(this.relation.relatedModel().primaryKey)),\n direction: 'desc',\n };\n const rowName = 'adonis_group_limit_counter';\n const partitionBy = `PARTITION BY ${this.pivotHelpers.prefixPivotTable(this.relation.pivotForeignKey)}`;\n const orderBy = `ORDER BY ${column} ${direction}`;\n /**\n * Select * when no columns are selected\n */\n if (!this.getSelectedColumns()) {\n this.select('*');\n }\n this.select(this.client.raw(`row_number() over (${partitionBy} ${orderBy}) as ${rowName}`)).as('adonis_temp');\n const groupQuery = this.relation.relatedModel().query();\n groupQuery.usePreloader(this.preloader);\n groupQuery.sideload(this.sideloaded);\n groupQuery.debug(this.debugQueries);\n this.customReporterData && groupQuery.reporterData(this.customReporterData);\n return groupQuery.from(this).where(rowName, '<=', this.groupConstraints.limit);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { DateTime } from 'luxon';\nimport { ManyToManyQueryBuilder } from './query_builder.js';\nimport { ManyToManySubQueryBuilder } from './sub_query_builder.js';\nimport { managedTransaction, syncDiff } from '../../../utils/index.js';\n/**\n * ------------------------------------------------------------\n * NO_PIVOT_ATTRS\n * ------------------------------------------------------------\n *\n * We do not define pivot attributes during a save/create calls. Coz, one can\n * attach the related instance with multiple parent instance.\n *\n * For example:\n *\n * user.related('skills').save(skill)\n * user1.related('skills').save(skill)\n *\n * As per the above example, the `skill.$extras.pivot_user_id` will have\n * which user id?\n *\n * Same is true with a create call\n *\n * const skill = user.related('skills').create({ name: 'Programming' })\n * user1.related('skills').save(skill)\n */\n/**\n * Query client for executing queries in scope to the defined\n * relationship\n */\nexport class ManyToManyQueryClient {\n relation;\n parent;\n client;\n constructor(relation, parent, client) {\n this.relation = relation;\n this.parent = parent;\n this.client = client;\n }\n /**\n * Returns the timestamps for the pivot row\n */\n getPivotTimestamps(updatedAtOnly) {\n const timestamps = {};\n if (this.relation.pivotCreatedAtTimestamp && !updatedAtOnly) {\n timestamps[this.relation.pivotCreatedAtTimestamp] = DateTime.local().toFormat(this.client.dialect.dateTimeFormat);\n }\n if (this.relation.pivotUpdatedAtTimestamp) {\n timestamps[this.relation.pivotUpdatedAtTimestamp] = DateTime.local().toFormat(this.client.dialect.dateTimeFormat);\n }\n return timestamps;\n }\n /**\n * Generate a related query builder\n */\n static query(client, relation, rows) {\n const query = new ManyToManyQueryBuilder(client.knexQuery(), client, rows, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a related eager query builder\n */\n static eagerQuery(client, relation, rows) {\n const query = new ManyToManyQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of the related sub query builder\n */\n static subQuery(client, relation) {\n const query = new ManyToManySubQueryBuilder(client.knexQuery(), client, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a related pivot query builder\n */\n static pivotQuery(client, relation, rows) {\n const query = new ManyToManyQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = false;\n query.isPivotOnlyQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns query builder instance\n */\n query() {\n return ManyToManyQueryClient.query(this.client, this.relation, this.parent);\n }\n /**\n * Returns a query builder instance for the pivot table only\n */\n pivotQuery() {\n return ManyToManyQueryClient.pivotQuery(this.client, this.relation, this.parent);\n }\n /**\n * Save related model instance.\n * @note: Read the \"NO_PIVOT_ATTRS\" section at the top\n */\n async save(related, performSync = true, pivotAttributes) {\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n /**\n * Persist parent\n */\n this.parent.$trx = trx;\n await this.parent.save();\n /**\n * Persist related\n */\n related.$trx = trx;\n await related.save();\n const [, relatedForeignKeyValue] = this.relation.getPivotRelatedPair(related);\n const pivotPayload = {\n [relatedForeignKeyValue]: pivotAttributes || {},\n };\n /**\n * Sync when checkExisting = true, to avoid duplicate rows. Otherwise\n * perform insert\n */\n if (performSync) {\n await this.sync(pivotPayload, false, trx);\n }\n else {\n await this.attach(pivotPayload, trx);\n }\n });\n }\n /**\n * Save many of related model instances\n * @note: Read the \"NO_PIVOT_ATTRS\" section at the top\n */\n async saveMany(related, performSync = true, pivotAttributes) {\n await managedTransaction(this.parent.$trx || this.client, async (trx) => {\n /**\n * Persist parent\n */\n this.parent.$trx = trx;\n await this.parent.save();\n /**\n * Persist all related models\n */\n for (let one of related) {\n one.$trx = trx;\n await one.save();\n }\n const relatedForeignKeyValues = related.reduce((result, one, index) => {\n const [, relatedForeignKeyValue] = this.relation.getPivotRelatedPair(one);\n result[relatedForeignKeyValue] = pivotAttributes?.[index] || {};\n return result;\n }, {});\n /**\n * Sync when checkExisting = true, to avoid duplicate rows. Otherwise\n * perform insert\n */\n if (performSync) {\n await this.sync(relatedForeignKeyValues, false, trx);\n }\n else {\n await this.attach(relatedForeignKeyValues, trx);\n }\n });\n }\n /**\n * Create and persist an instance of related model. Also makes the pivot table\n * entry to create the relationship\n * @note: Read the \"NO_PIVOT_ATTRS\" section at the top\n */\n async create(values, pivotAttributes, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n /**\n * Create and persist related model instance\n */\n const related = await this.relation.relatedModel().create(values, { client: trx, ...options });\n const [, relatedForeignKeyValue] = this.relation.getPivotRelatedPair(related);\n const pivotPayload = {\n [relatedForeignKeyValue]: pivotAttributes || {},\n };\n /**\n * Attach new rows\n */\n await this.attach(pivotPayload, trx);\n return related;\n });\n }\n /**\n * Create and persist multiple of instances of related model. Also makes\n * the pivot table entries to create the relationship.\n * @note: Read the \"NO_PIVOT_ATTRS\" section at the top\n */\n async createMany(values, pivotAttributes, options) {\n return managedTransaction(this.parent.$trx || this.client, async (trx) => {\n this.parent.$trx = trx;\n await this.parent.save();\n /**\n * Create and persist related model instance\n */\n const related = await this.relation\n .relatedModel()\n .createMany(values, { client: trx, ...options });\n const relatedForeignKeyValues = related.reduce((result, one, index) => {\n const [, relatedForeignKeyValue] = this.relation.getPivotRelatedPair(one);\n result[relatedForeignKeyValue] = pivotAttributes?.[index] || {};\n return result;\n }, {});\n /**\n * Attach new rows\n */\n await this.attach(relatedForeignKeyValues, trx);\n return related;\n });\n }\n /**\n * Attach one or more related models using it's foreign key value\n * by performing insert inside the pivot table.\n */\n async attach(ids, trx) {\n /**\n * Pivot foreign key value (On the parent model)\n */\n const [, foreignKeyValue] = this.relation.getPivotPair(this.parent);\n /**\n * Finding if `ids` parameter is an object or not\n */\n const hasAttributes = !Array.isArray(ids);\n /**\n * Extracting pivot related foreign keys (On the related model)\n */\n const pivotRows = (!hasAttributes ? ids : Object.keys(ids)).map((id) => {\n return Object.assign(this.getPivotTimestamps(false), hasAttributes ? ids[id] : {}, {\n [this.relation.pivotForeignKey]: foreignKeyValue,\n [this.relation.pivotRelatedForeignKey]: id,\n });\n });\n if (!pivotRows.length) {\n return;\n }\n /**\n * Perform bulk insert\n */\n const query = trx ? trx.insertQuery() : this.client.insertQuery();\n await query.table(this.relation.pivotTable).multiInsert(pivotRows);\n }\n /**\n * Detach related ids from the pivot table\n */\n async detach(ids, trx) {\n const query = this.pivotQuery();\n /**\n * Scope deletion to specific rows when `id` is defined. Otherwise\n * delete all the rows\n */\n if (ids && ids.length) {\n query.whereInPivot(this.relation.pivotRelatedForeignKey, ids);\n }\n /**\n * Use transaction when defined\n */\n if (trx) {\n query.useTransaction(trx);\n }\n await query.del();\n }\n /**\n * Sync pivot rows by\n *\n * - Dropping the non-existing one's.\n * - Creating the new one's.\n * - Updating the existing one's with different attributes.\n */\n async sync(ids, \n /**\n * Detach means, do not remove existing rows, that are\n * missing in this new object/array.\n */\n detach = true, trx) {\n await managedTransaction(trx || this.client, async (transaction) => {\n const hasAttributes = !Array.isArray(ids);\n /**\n * An object of pivot rows from from the incoming ids or\n * an object of key-value pair.\n */\n const pivotRows = !hasAttributes\n ? ids.reduce((result, id) => {\n result[id] = {};\n return result;\n }, {})\n : ids;\n const query = this.pivotQuery().useTransaction(transaction);\n /**\n * We must scope the select query to related foreign key when ids\n * is an array and not an object. This will help in performance\n * when there are indexes defined on this key\n */\n if (!hasAttributes) {\n query.select(this.relation.pivotRelatedForeignKey);\n }\n const pivotRelatedForeignKeys = Object.keys(pivotRows);\n /**\n * Fetch existing pivot rows for the relationship\n */\n const existingPivotRows = await query\n .whereIn(this.relation.pivotRelatedForeignKey, pivotRelatedForeignKeys)\n .exec();\n /**\n * Find a diff of rows being removed, added or updated in comparison\n * to the existing pivot rows.\n */\n const { added, updated } = syncDiff(existingPivotRows.reduce((result, row) => {\n result[row[this.relation.pivotRelatedForeignKey]] = row;\n return result;\n }, {}), pivotRows);\n /**\n * Add new rows\n */\n await this.attach(added, transaction);\n /**\n * Update\n */\n for (let id of Object.keys(updated)) {\n const attributes = updated[id];\n await this.pivotQuery()\n .useTransaction(transaction)\n .wherePivot(this.relation.pivotRelatedForeignKey, id)\n .update(Object.assign({}, this.getPivotTimestamps(true), attributes));\n }\n /**\n * Return early when detach is disabled.\n */\n if (!detach) {\n return;\n }\n /**\n * Detach everything except the synced ids\n */\n await this.pivotQuery()\n .useTransaction(transaction)\n .whereNotInPivot(this.relation.pivotRelatedForeignKey, pivotRelatedForeignKeys)\n .del();\n });\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { KeysExtractor } from '../keys_extractor.js';\nimport { ManyToManyQueryClient } from './query_client.js';\nimport { ensureRelationIsBooted, getValue } from '../../../utils/index.js';\n/**\n * Manages loading and persisting many to many relationship\n */\nexport class ManyToMany {\n relationName;\n relatedModel;\n options;\n model;\n type = 'manyToMany';\n booted = false;\n serializeAs;\n /**\n * Timestamp columns for the pivot table\n */\n get pivotTimestamps() {\n const timestamps = [];\n this.pivotCreatedAtTimestamp && timestamps.push(this.pivotCreatedAtTimestamp);\n this.pivotUpdatedAtTimestamp && timestamps.push(this.pivotUpdatedAtTimestamp);\n return timestamps;\n }\n /**\n * Reference to the onQuery hook defined by the user\n */\n onQueryHook;\n /**\n * Computes the created at timestamps column name\n * for the pivot table\n */\n computedCreatedAtTimestamp() {\n if (!this.options.pivotTimestamps) {\n return;\n }\n if (this.options.pivotTimestamps === true) {\n this.pivotCreatedAtTimestamp = 'created_at';\n return;\n }\n if (typeof this.options.pivotTimestamps.createdAt === 'string') {\n this.pivotCreatedAtTimestamp = this.options.pivotTimestamps.createdAt;\n }\n else if (this.options.pivotTimestamps.createdAt === true) {\n this.pivotCreatedAtTimestamp = 'created_at';\n }\n }\n /**\n * Computes the updated at timestamps column name\n * for the pivot table\n */\n computedUpdatedAtTimestamp() {\n if (!this.options.pivotTimestamps) {\n return;\n }\n if (this.options.pivotTimestamps === true) {\n this.pivotUpdatedAtTimestamp = 'updated_at';\n return;\n }\n if (typeof this.options.pivotTimestamps.updatedAt === 'string') {\n this.pivotUpdatedAtTimestamp = this.options.pivotTimestamps.updatedAt;\n }\n else if (this.options.pivotTimestamps.updatedAt === true) {\n this.pivotUpdatedAtTimestamp = 'updated_at';\n }\n }\n constructor(relationName, relatedModel, options, model) {\n this.relationName = relationName;\n this.relatedModel = relatedModel;\n this.options = options;\n this.model = model;\n this.serializeAs =\n this.options.serializeAs === undefined ? this.relationName : this.options.serializeAs;\n this.pivotColumns = this.options.pivotColumns || [];\n this.onQueryHook = this.options.onQuery;\n this.meta = this.options.meta;\n }\n /**\n * Returns the alias for the pivot key\n */\n pivotAlias(key) {\n return `pivot_${key}`;\n }\n /**\n * Clone relationship instance\n */\n clone(parent) {\n return new ManyToMany(this.relationName, this.relatedModel, { ...this.options }, parent);\n }\n /**\n * Boot the relationship and ensure that all keys are in\n * place for queries to do their job.\n */\n boot() {\n if (this.booted) {\n return;\n }\n const relatedModel = this.relatedModel();\n /**\n * Extracting keys from the model and the relation model. The keys\n * extractor ensures all the required columns are defined on\n * the models for the relationship to work\n */\n const { localKey, relatedKey } = new KeysExtractor(this.model, this.relationName, {\n localKey: {\n model: this.model,\n key: this.options.localKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, relatedModel, this.relationName),\n },\n relatedKey: {\n model: relatedModel,\n key: this.options.relatedKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, relatedModel, this.relationName),\n },\n }).extract();\n this.pivotTable =\n this.options.pivotTable ||\n this.model.namingStrategy.relationPivotTable(this.type, this.model, relatedModel, this.relationName);\n /**\n * Keys on the parent model\n */\n this.localKey = localKey.attributeName;\n this.localKeyColumnName = localKey.columnName;\n /**\n * Keys on the related model\n */\n this.relatedKey = relatedKey.attributeName;\n this.relatedKeyColumnName = relatedKey.columnName;\n /**\n * Parent model foreign key in the pivot table\n */\n this.pivotForeignKey =\n this.options.pivotForeignKey ||\n this.model.namingStrategy.relationPivotForeignKey(this.type, this.model, relatedModel, this.relationName);\n /**\n * Related model foreign key in the pivot table\n */\n this.pivotRelatedForeignKey =\n this.options.pivotRelatedForeignKey ||\n this.model.namingStrategy.relationPivotForeignKey(this.type, relatedModel, this.model, this.relationName);\n /**\n * Configure pivot timestamps to use. This is a temporary\n * setup. We will have to soon introduce pivot models\n */\n this.computedCreatedAtTimestamp();\n this.computedUpdatedAtTimestamp();\n /**\n * Booted successfully\n */\n this.booted = true;\n }\n /**\n * Set related model instances\n */\n setRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Push related model instance(s)\n */\n pushRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$pushRelated(this.relationName, related);\n }\n /**\n * Finds and set the related model instances next to the parent\n * models.\n */\n setRelatedForMany(parent, related) {\n ensureRelationIsBooted(this);\n const pivotForeignKeyAlias = this.pivotAlias(this.pivotForeignKey);\n parent.forEach((parentModel) => {\n this.setRelated(parentModel, related.filter((relatedModel) => {\n const value = parentModel[this.localKey];\n return value !== undefined && relatedModel.$extras[pivotForeignKeyAlias] === value;\n }));\n });\n }\n /**\n * Returns an instance of query client for invoking queries\n */\n client(parent, client) {\n ensureRelationIsBooted(this);\n return new ManyToManyQueryClient(this, parent, client);\n }\n /**\n * Returns an instance of eager query builder\n */\n eagerQuery(parent, client) {\n ensureRelationIsBooted(this);\n return ManyToManyQueryClient.eagerQuery(client, this, parent);\n }\n /**\n * Returns instance of query builder\n */\n subQuery(client) {\n ensureRelationIsBooted(this);\n return ManyToManyQueryClient.subQuery(client, this);\n }\n /**\n * Returns key-value pair for the pivot table in relation to the parent model\n */\n getPivotPair(parent) {\n return [this.pivotForeignKey, getValue(parent, this.localKey, this, 'persist')];\n }\n /**\n * Returns key-value pair for the pivot table in relation to the related model\n */\n getPivotRelatedPair(related) {\n return [this.pivotRelatedForeignKey, getValue(related, this.relatedKey, this, 'persist')];\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { getValue, unique } from '../../../utils/index.js';\nimport { BaseQueryBuilder } from '../base/query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class HasManyThroughQueryBuilder extends BaseQueryBuilder {\n parent;\n relation;\n cherryPickingKeys = false;\n appliedConstraints = false;\n throughTable;\n relatedTable;\n constructor(builder, client, parent, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasManyThroughQueryBuilder($builder, this.client, this.parent, this.relation);\n subQuery.isChildQuery = true;\n subQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.parent = parent;\n this.relation = relation;\n this.throughTable = this.relation.throughModel().table;\n this.relatedTable = this.relation.relatedModel().table;\n }\n /**\n * Prefixes the through table name to a column\n */\n prefixThroughTable(column) {\n return column.includes('.') ? column : `${this.throughTable}.${column}`;\n }\n /**\n * Prefixes the related table name to a column\n */\n prefixRelatedTable(column) {\n return column.includes('.') ? column : `${this.relatedTable}.${column}`;\n }\n /**\n * Adds where constraint to the pivot table\n */\n addWhereConstraints(builder) {\n const queryAction = this.queryAction();\n /**\n * Eager query constraints\n */\n if (Array.isArray(this.parent)) {\n builder.whereIn(this.prefixThroughTable(this.relation.foreignKeyColumnName), unique(this.parent.map((model) => {\n return getValue(model, this.relation.localKey, this.relation, queryAction);\n })));\n return;\n }\n /**\n * Query constraints\n */\n const value = getValue(this.parent, this.relation.localKey, this.relation, queryAction);\n builder.where(this.prefixThroughTable(this.relation.foreignKeyColumnName), value);\n }\n /**\n * Transforms the selected column names by prefixing the\n * table name\n */\n transformRelatedTableColumns(columns) {\n return columns.map((column) => {\n if (typeof column === 'string') {\n return this.prefixRelatedTable(this.resolveKey(column));\n }\n return this.transformValue(column);\n });\n }\n /**\n * Profiler data for HasManyThrough relationship\n */\n profilerData() {\n return {\n type: this.relation.type,\n model: this.relation.model.name,\n throughModel: this.relation.throughModel().name,\n relatedModel: this.relation.relatedModel().name,\n };\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.prefixRelatedTable(this.relation.throughForeignKeyColumnName)];\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n if (['delete', 'update'].includes(this.queryAction())) {\n this.whereIn(this.prefixRelatedTable(this.relation.throughForeignKeyColumnName), (subQuery) => {\n subQuery.from(this.throughTable);\n this.addWhereConstraints(subQuery);\n });\n return;\n }\n /**\n * Add select statements only when not running aggregate\n * queries. The end user can still select columns\n */\n if (!this.hasAggregates) {\n /**\n * Select * from related model when user is not cherry picking\n * keys\n */\n if (!this.cherryPickingKeys) {\n this.select('*');\n }\n /**\n * Selecting all from the related table, along with the foreign key of the\n * through table.\n */\n this.knexQuery.select(`${this.prefixThroughTable(this.relation.foreignKeyColumnName)} as ${this.relation.throughAlias(this.relation.foreignKeyColumnName)}`);\n }\n /**\n * Inner join\n */\n this.innerJoin(this.throughTable, this.prefixThroughTable(this.relation.throughLocalKeyColumnName), this.prefixRelatedTable(this.relation.throughForeignKeyColumnName));\n /**\n * Adding where constraints\n */\n this.addWhereConstraints(this);\n }\n /**\n * Select keys from the related table\n */\n select(...args) {\n let columns = args;\n if (Array.isArray(args[0])) {\n columns = args[0];\n }\n this.cherryPickingKeys = true;\n this.knexQuery.select(this.transformRelatedTableColumns(columns));\n return this;\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasManyThroughQueryBuilder(this.knexQuery.clone(), this.client, this.parent, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.cherryPickingKeys = this.cherryPickingKeys;\n clonedQuery.isRelatedPreloadQuery = this.isRelatedPreloadQuery;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n /**\n * Paginate through rows inside a given table\n */\n paginate(page, perPage = 20) {\n if (this.isRelatedPreloadQuery) {\n throw new Error(`Cannot paginate relationship \"${this.relation.relationName}\" during preload`);\n }\n this.applyConstraints();\n return super.paginate(page, perPage);\n }\n /**\n * Returns the group limit query\n */\n getGroupLimitQuery() {\n const { direction, column } = this.groupConstraints.orderBy || {\n column: this.prefixRelatedTable(this.resolveKey(this.relation.relatedModel().primaryKey)),\n direction: 'desc',\n };\n const rowName = 'adonis_group_limit_counter';\n const partitionBy = `PARTITION BY ${this.prefixThroughTable(this.relation.foreignKeyColumnName)}`;\n const orderBy = `ORDER BY ${column} ${direction}`;\n /**\n * Select * when no columns are selected\n */\n if (!this.getSelectedColumns()) {\n this.select('*');\n }\n this.select(this.client.raw(`row_number() over (${partitionBy} ${orderBy}) as ${rowName}`)).as('adonis_temp');\n const groupQuery = this.relation.relatedModel().query();\n groupQuery.usePreloader(this.preloader);\n groupQuery.sideload(this.sideloaded);\n groupQuery.debug(this.debugQueries);\n this.customReporterData && groupQuery.reporterData(this.customReporterData);\n return groupQuery.from(this).where(rowName, '<=', this.groupConstraints.limit);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { BaseSubQueryBuilder } from '../base/sub_query_builder.js';\n/**\n * Extends the model query builder for executing queries in scope\n * to the current relationship\n */\nexport class HasManyThroughSubQueryBuilder extends BaseSubQueryBuilder {\n relation;\n /**\n * A boolean to track if query constraints for the relationship\n * has been applied or not\n */\n appliedConstraints = false;\n /**\n * Reference to the related table\n */\n relatedTable;\n /**\n * Reference to the through table\n */\n throughTable;\n hasSelfRelation;\n constructor(builder, client, relation) {\n super(builder, client, relation, (userFn) => {\n return ($builder) => {\n const subQuery = new HasManyThroughSubQueryBuilder($builder, this.client, this.relation);\n subQuery.isChildQuery = true;\n userFn(subQuery);\n subQuery.applyWhere();\n };\n });\n this.relation = relation;\n this.relatedTable = this.relation.relatedModel().table;\n this.throughTable = this.relation.throughModel().table;\n this.hasSelfRelation = this.relatedTable === this.relation.model.table;\n }\n /**\n * Prefixes the through table name to a column\n */\n prefixThroughTable(column) {\n return column.includes('.') ? column : `${this.throughTable}.${column}`;\n }\n /**\n * Prefixes the related table name to a column\n */\n prefixRelatedTable(column) {\n if (column.includes('.')) {\n return column;\n }\n if (this.hasSelfRelation) {\n return `${this.selfJoinAlias}.${column}`;\n }\n return `${this.relatedTable}.${column}`;\n }\n /**\n * Transforms the selected column names by prefixing the\n * table name\n */\n transformRelatedTableColumns(columns) {\n return columns.map((column) => {\n if (typeof column === 'string') {\n return this.prefixRelatedTable(this.resolveKey(column));\n }\n return this.transformValue(column);\n });\n }\n /**\n * The keys for constructing the join query\n */\n getRelationKeys() {\n return [this.relation.throughForeignKeyColumnName];\n }\n /**\n * Select keys from the related table\n */\n select(...args) {\n let columns = args;\n if (Array.isArray(args[0])) {\n columns = args[0];\n }\n this.knexQuery.select(this.transformRelatedTableColumns(columns));\n return this;\n }\n /**\n * Applies constraint to limit rows to the current relationship\n * only.\n */\n applyConstraints() {\n if (this.appliedConstraints) {\n return;\n }\n this.appliedConstraints = true;\n /**\n * In case of self joins, we must alias the table selection\n */\n if (this.relation.relatedModel() === this.relation.model) {\n this.knexQuery.from(`${this.relatedTable} as ${this.selfJoinAlias}`);\n }\n this.innerJoin(this.throughTable, this.prefixThroughTable(this.relation.throughLocalKeyColumnName), this.prefixRelatedTable(this.relation.throughForeignKeyColumnName));\n this.where(`${this.relation.model.table}.${this.relation.localKeyColumnName}`, this.client.ref(this.prefixThroughTable(this.relation.foreignKeyColumnName)));\n }\n /**\n * Clones the current query\n */\n clone() {\n const clonedQuery = new HasManyThroughSubQueryBuilder(this.knexQuery.clone(), this.client, this.relation);\n this.applyQueryFlags(clonedQuery);\n clonedQuery.appliedConstraints = this.appliedConstraints;\n clonedQuery.debug(this.debugQueries);\n clonedQuery.reporterData(this.customReporterData);\n return clonedQuery;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { HasManyThroughQueryBuilder } from './query_builder.js';\nimport { HasManyThroughSubQueryBuilder } from './sub_query_builder.js';\n/**\n * Query client for executing queries in scope to the defined\n * relationship\n */\nexport class HasManyThroughClient {\n relation;\n parent;\n client;\n constructor(relation, parent, client) {\n this.relation = relation;\n this.parent = parent;\n this.client = client;\n }\n /**\n * Generate a related query builder\n */\n static query(client, relation, rows) {\n const query = new HasManyThroughQueryBuilder(client.knexQuery(), client, rows, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Generate a related eager query builder\n */\n static eagerQuery(client, relation, rows) {\n const query = new HasManyThroughQueryBuilder(client.knexQuery(), client, rows, relation);\n query.isRelatedPreloadQuery = true;\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of the sub query\n */\n static subQuery(client, relation) {\n const query = new HasManyThroughSubQueryBuilder(client.knexQuery(), client, relation);\n typeof relation.onQueryHook === 'function' && relation.onQueryHook(query);\n return query;\n }\n /**\n * Returns an instance of has many through query builder\n */\n query() {\n return HasManyThroughClient.query(this.client, this.relation, this.parent);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nimport { KeysExtractor } from '../keys_extractor.js';\nimport { HasManyThroughClient } from './query_client.js';\nimport { ensureRelationIsBooted } from '../../../utils/index.js';\n/**\n * Manages loading and persisting has many through relationship\n */\nexport class HasManyThrough {\n relationName;\n relatedModel;\n options;\n model;\n type = 'hasManyThrough';\n booted = false;\n serializeAs;\n throughModel;\n /**\n * Reference to the onQuery hook defined by the user\n */\n onQueryHook;\n constructor(relationName, relatedModel, options, model) {\n this.relationName = relationName;\n this.relatedModel = relatedModel;\n this.options = options;\n this.model = model;\n this.onQueryHook = this.options.onQuery;\n this.throughModel = this.options.throughModel;\n this.serializeAs =\n this.options.serializeAs === undefined ? this.relationName : this.options.serializeAs;\n this.meta = this.options.meta;\n }\n /**\n * Clone relationship instance\n */\n clone(parent) {\n return new HasManyThrough(this.relationName, this.relatedModel, { ...this.options }, parent);\n }\n /**\n * Returns the alias for the through key\n */\n throughAlias(key) {\n return `through_${key}`;\n }\n /**\n * Boot the relationship and ensure that all keys are in\n * place for queries to do their job.\n */\n boot() {\n if (this.booted) {\n return;\n }\n /**\n * Extracting keys from the model and the relation model. The keys\n * extractor ensures all the required columns are defined on\n * the models for the relationship to work\n */\n const { localKey, foreignKey, throughLocalKey, throughForeignKey } = new KeysExtractor(this.model, this.relationName, {\n localKey: {\n model: this.model,\n key: this.options.localKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.model, this.relatedModel(), this.relationName),\n },\n foreignKey: {\n model: this.throughModel(),\n key: this.options.foreignKey ||\n this.model.namingStrategy.relationForeignKey(this.type, this.model, this.throughModel(), this.relationName),\n },\n throughLocalKey: {\n model: this.throughModel(),\n key: this.options.throughLocalKey ||\n this.model.namingStrategy.relationLocalKey(this.type, this.throughModel(), this.relatedModel(), this.relationName),\n },\n throughForeignKey: {\n model: this.relatedModel(),\n key: this.options.throughForeignKey ||\n this.model.namingStrategy.relationForeignKey(this.type, this.throughModel(), this.relatedModel(), this.relationName),\n },\n }).extract();\n /**\n * Keys on the parent model\n */\n this.localKey = localKey.attributeName;\n this.localKeyColumnName = localKey.columnName;\n /**\n * Keys on the through model\n */\n this.foreignKey = foreignKey.attributeName;\n this.foreignKeyColumnName = foreignKey.columnName;\n this.throughLocalKey = throughLocalKey.attributeName;\n this.throughLocalKeyColumnName = throughLocalKey.columnName;\n this.throughForeignKey = throughForeignKey.attributeName;\n this.throughForeignKeyColumnName = throughForeignKey.columnName;\n /**\n * Booted successfully\n */\n this.booted = true;\n }\n /**\n * Set related model instances\n */\n setRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$setRelated(this.relationName, related);\n }\n /**\n * Push related model instance(s)\n */\n pushRelated(parent, related) {\n ensureRelationIsBooted(this);\n parent.$pushRelated(this.relationName, related);\n }\n /**\n * Finds and set the related model instances next to the parent\n * models.\n */\n setRelatedForMany(parent, related) {\n ensureRelationIsBooted(this);\n const $foreignCastAsKeyAlias = this.throughAlias(this.foreignKeyColumnName);\n parent.forEach((parentModel) => {\n this.setRelated(parentModel, related.filter((relatedModel) => {\n const value = parentModel[this.localKey];\n return value !== undefined && relatedModel.$extras[$foreignCastAsKeyAlias] === value;\n }));\n });\n }\n /**\n * Returns an instance of query client for invoking queries\n */\n client(parent, client) {\n ensureRelationIsBooted(this);\n return new HasManyThroughClient(this, parent, client);\n }\n /**\n * Returns instance of the eager query\n */\n eagerQuery(parent, client) {\n ensureRelationIsBooted(this);\n return HasManyThroughClient.eagerQuery(client, this, parent);\n }\n /**\n * Returns instance of query builder\n */\n subQuery(client) {\n ensureRelationIsBooted(this);\n return HasManyThroughClient.subQuery(client, this);\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n/**\n * An implementation for lazy loading model relationship aggregates\n */\nexport class LazyLoadAggregates {\n model;\n query;\n constructor(model) {\n this.model = model;\n /**\n * Model must be persisted before the lazy loading can happen\n */\n const Model = this.model.constructor;\n /**\n * The \"refresh\" query has the where clause already assigned\n */\n this.query = this.model.$getQueryFor('refresh', Model.$adapter.modelClient(this.model));\n /**\n * Selecting just the primary key\n */\n this.query.select(Model.primaryKey);\n }\n /**\n * Load aggregate of relationship\n */\n loadAggregate(relationName, userCallback) {\n this.query.withAggregate(relationName, userCallback);\n return this;\n }\n /**\n * Load count of relationship\n */\n loadCount(relationName, userCallback) {\n this.query.withCount(relationName, userCallback);\n return this;\n }\n /**\n * Execute query\n */\n async exec() {\n const result = await this.query.pojo().first();\n if (!result) {\n return;\n }\n /**\n * Consume adapter result\n */\n this.model.$consumeAdapterResult(result);\n }\n /**\n * Implementation of `then` for the promise API\n */\n then(resolve, reject) {\n return this.exec().then(resolve, reject);\n }\n /**\n * Implementation of `catch` for the promise API\n */\n catch(reject) {\n return this.exec().catch(reject);\n }\n /**\n * Implementation of `finally` for the promise API\n */\n finally(fullfilled) {\n return this.exec().finally(fullfilled);\n }\n /**\n * Required when Promises are extended\n */\n get [Symbol.toStringTag]() {\n return this.constructor.name;\n }\n}\n","/*\n * @adonisjs/lucid\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { DateTime } from 'luxon';\nimport Hooks from '@poppinss/hooks';\nimport lodash from '@poppinss/utils/lodash';\nimport { Exception, defineStaticProperty } from '@poppinss/utils';\nimport * as errors from '../../errors.js';\nimport { Preloader } from '../preloader/index.js';\nimport { proxyHandler } from './proxy_handler.js';\nimport { ModelKeys } from '../model_keys/index.js';\nimport { HasOne } from '../relations/has_one/index.js';\nimport { HasMany } from '../relations/has_many/index.js';\nimport { BelongsTo } from '../relations/belongs_to/index.js';\nimport { ManyToMany } from '../relations/many_to_many/index.js';\nimport { HasManyThrough } from '../relations/has_many_through/index.js';\nimport { CamelCaseNamingStrategy } from '../naming_strategies/camel_case.js';\nimport { LazyLoadAggregates } from '../relations/aggregates_loader/lazy_load.js';\nimport { isObject, collectValues, ensureRelation, managedTransaction, normalizeCherryPickObject, transformDateValue, compareValues, } from '../../utils/index.js';\nconst MANY_RELATIONS = ['hasMany', 'manyToMany', 'hasManyThrough'];\nconst DATE_TIME_TYPES = {\n date: 'date',\n datetime: 'datetime',\n};\nfunction StaticImplements() {\n return (_t) => { };\n}\n/**\n * Abstract class to define fully fledged data models\n */\nlet BaseModelImpl = class BaseModelImpl {\n /**\n * The adapter to be used for persisting and fetching data.\n *\n * NOTE: Adapter is a singleton and share among all the models, unless\n * a user wants to swap the adapter for a given model\n */\n static $adapter;\n /**\n * Define an adapter to use for interacting with\n * the database\n */\n static useAdapter(adapter) {\n this.$adapter = adapter;\n }\n /**\n * Naming strategy for model properties\n */\n static namingStrategy = new CamelCaseNamingStrategy();\n /**\n * Primary key is required to build relationships across models\n */\n static primaryKey;\n /**\n * Whether the model has been booted. Booting the model initializes its\n * static properties. Base models must not be initialized.\n */\n static booted;\n /**\n * Query scopes defined on the model\n */\n static $queryScopes = {};\n /**\n * A set of properties marked as computed. Computed properties are included in\n * the `toJSON` result, else they behave the same way as any other instance\n * property.\n */\n static $computedDefinitions;\n /**\n * Columns makes it easier to define extra props on the model\n * and distinguish them with the attributes to be sent\n * over to the adapter\n */\n static $columnsDefinitions;\n /**\n * Registered relationships for the given model\n */\n static $relationsDefinitions;\n /**\n * The name of database table. It is auto generated from the model name, unless\n * specified\n */\n static table;\n /**\n * Self assign the primary instead of relying on the database to\n * return it back\n */\n static selfAssignPrimaryKey;\n /**\n * A custom connection to use for queries. The connection defined on\n * query builder is preferred over the model connection\n */\n static connection;\n /**\n * Storing model hooks\n */\n static $hooks;\n /**\n * Keys mappings to make the lookups easy\n */\n static $keys;\n /**\n * Creates a new model instance with payload and adapter options\n */\n static newUpWithOptions(payload, options, allowExtraProperties) {\n const row = new this();\n row.merge(payload, allowExtraProperties);\n /**\n * Pass client options to the newly created row. If row was found\n * the query builder will set the same options.\n */\n row.$setOptionsAndTrx(options);\n return row;\n }\n /**\n * Helper method for `fetchOrNewUpMany`, `fetchOrCreateMany` and `createOrUpdate`\n * many.\n */\n static newUpIfMissing(rowObjects, existingRows, keys, mergeAttribute, options, allowExtraProperties) {\n /**\n * Return existing or create missing rows in the same order as the original\n * array\n */\n return rowObjects.map((rowObject) => {\n const existingRow = existingRows.find((row) => {\n return keys.every((key) => {\n const objectValue = rowObject[key];\n const rowValue = row[key];\n return compareValues(rowValue, objectValue);\n });\n });\n /**\n * Return the row found from the select call\n */\n if (existingRow) {\n if (mergeAttribute) {\n existingRow.merge(rowObject, allowExtraProperties);\n }\n return existingRow;\n }\n /**\n * Otherwise create a new one\n */\n return this.newUpWithOptions(rowObject, options, allowExtraProperties);\n });\n }\n /**\n * Returns the model query instance for the given model\n */\n static query(options) {\n return this.$adapter.query(this, options);\n }\n static async transaction(callbackOrOptions, options) {\n if (typeof callbackOrOptions === 'function') {\n const client = this.$adapter.modelConstructorClient(this, options);\n return client.transaction(callbackOrOptions, options);\n }\n const client = this.$adapter.modelConstructorClient(this, callbackOrOptions);\n return client.transaction(callbackOrOptions);\n }\n /**\n * Create a model instance from the adapter result. The result value must\n * be a valid object, otherwise `null` is returned.\n */\n static $createFromAdapterResult(adapterResult, sideloadAttributes, options) {\n if (typeof adapterResult !== 'object' || Array.isArray(adapterResult)) {\n return null;\n }\n const instance = new this();\n instance.$consumeAdapterResult(adapterResult, sideloadAttributes);\n instance.$hydrateOriginals();\n instance.$setOptionsAndTrx(options);\n instance.$isPersisted = true;\n instance.$isLocal = false;\n return instance;\n }\n /**\n * Creates an array of models from the adapter results. The `adapterResults`\n * must be an array with valid Javascript objects.\n *\n * 1. If top level value is not an array, then an empty array is returned.\n * 2. If row is not an object, then it will be ignored.\n */\n static $createMultipleFromAdapterResult(adapterResults, sideloadAttributes, options) {\n if (!Array.isArray(adapterResults)) {\n return [];\n }\n return adapterResults.reduce((models, row) => {\n if (isObject(row)) {\n models.push(this.$createFromAdapterResult(row, sideloadAttributes, options));\n }\n return models;\n }, []);\n }\n /**\n * Define a new column on the model. This is required, so that\n * we differentiate between plain properties vs model attributes.\n */\n static $addColumn(name, options) {\n const descriptor = Object.getOwnPropertyDescriptor(this.prototype, name);\n const column = {\n isPrimary: options.isPrimary || false,\n columnName: options.columnName || this.namingStrategy.columnName(this, name),\n hasGetter: !!(descriptor && descriptor.get),\n hasSetter: !!(descriptor && descriptor.set),\n serializeAs: options.serializeAs !== undefined\n ? options.serializeAs\n : this.namingStrategy.serializedName(this, name),\n serialize: options.serialize,\n prepare: options.prepare,\n consume: options.consume,\n meta: options.meta,\n };\n /**\n * Set column as the primary column, when `primary` is true\n */\n if (column.isPrimary) {\n this.primaryKey = name;\n }\n this.$columnsDefinitions.set(name, column);\n this.$keys.attributesToColumns.add(name, column.columnName);\n column.serializeAs && this.$keys.attributesToSerialized.add(name, column.serializeAs);\n this.$keys.columnsToAttributes.add(column.columnName, name);\n column.serializeAs && this.$keys.columnsToSerialized.add(column.columnName, column.serializeAs);\n column.serializeAs && this.$keys.serializedToAttributes.add(column.serializeAs, name);\n column.serializeAs && this.$keys.serializedToColumns.add(column.serializeAs, column.columnName);\n return column;\n }\n /**\n * Returns a boolean telling if column exists on the model\n */\n static $hasColumn(name) {\n return this.$columnsDefinitions.has(name);\n }\n /**\n * Returns the column for a given name\n */\n static $getColumn(name) {\n return this.$columnsDefinitions.get(name);\n }\n /**\n * Adds a computed node\n */\n static $addComputed(name, options) {\n const computed = {\n serializeAs: options.serializeAs !== undefined\n ? options.serializeAs\n : this.namingStrategy.serializedName(this, name),\n meta: options.meta,\n };\n this.$computedDefinitions.set(name, computed);\n return computed;\n }\n /**\n * Find if some property is marked as computed\n */\n static $hasComputed(name) {\n return this.$computedDefinitions.has(name);\n }\n /**\n * Get computed node\n */\n static $getComputed(name) {\n return this.$computedDefinitions.get(name);\n }\n /**\n * Register has one relationship\n */\n static $addHasOne(name, relatedModel, options) {\n this.$relationsDefinitions.set(name, new HasOne(name, relatedModel, options, this));\n }\n /**\n * Register has many relationship\n */\n static $addHasMany(name, relatedModel, options) {\n this.$relationsDefinitions.set(name, new HasMany(name, relatedModel, options, this));\n }\n /**\n * Register belongs to relationship\n */\n static $addBelongsTo(name, relatedModel, options) {\n this.$relationsDefinitions.set(name, new BelongsTo(name, relatedModel, options, this));\n }\n /**\n * Register many-to-many relationship\n */\n static $addManyToMany(name, relatedModel, options) {\n this.$relationsDefinitions.set(name, new ManyToMany(name, relatedModel, options, this));\n }\n /**\n * Register has many through relationship\n */\n static $addHasManyThrough(name, relatedModel, options) {\n this.$relationsDefinitions.set(name, new HasManyThrough(name, relatedModel, options, this));\n }\n /**\n * Adds a relationship\n */\n static $addRelation(name, type, relatedModel, options) {\n switch (type) {\n case 'hasOne':\n this.$addHasOne(name, relatedModel, options);\n break;\n case 'hasMany':\n this.$addHasMany(name, relatedModel, options);\n break;\n case 'belongsTo':\n this.$addBelongsTo(name, relatedModel, options);\n break;\n case 'manyToMany':\n this.$addManyToMany(name, relatedModel, options);\n break;\n case 'hasManyThrough':\n this.$addHasManyThrough(name, relatedModel, options);\n break;\n default:\n throw new Error(`${type} is not a supported relation type`);\n }\n }\n /**\n * Find if some property is marked as a relation or not\n */\n static $hasRelation(name) {\n return this.$relationsDefinitions.has(name);\n }\n /**\n * Returns relationship node for a given relation\n */\n static $getRelation(name) {\n return this.$relationsDefinitions.get(name);\n }\n /**\n * Define a static property on the model using the inherit or\n * define strategy.\n *\n * Inherit strategy will clone the property from the parent model\n * and will set it on the current model\n */\n static $defineProperty(propertyName, defaultValue, strategy) {\n defineStaticProperty(this, propertyName, {\n initialValue: defaultValue,\n strategy: strategy,\n });\n }\n /**\n * Boot the model\n */\n static boot() {\n /**\n * Define the property when not defined on self\n */\n if (!this.hasOwnProperty('booted')) {\n this.booted = false;\n }\n /**\n * Return when already booted\n */\n if (this.booted === true) {\n return;\n }\n this.booted = true;\n /**\n * Table name is never inherited from the base model\n */\n this.$defineProperty('table', this.namingStrategy.tableName(this), 'define');\n /**\n * Inherit primary key or default to \"id\"\n */\n this.$defineProperty('primaryKey', 'id', 'inherit');\n /**\n * Inherit selfAssignPrimaryKey or default to \"false\"\n */\n this.$defineProperty('selfAssignPrimaryKey', false, 'inherit');\n /**\n * Define the keys' property. This allows looking up variations\n * for model keys\n */\n this.$defineProperty('$keys', {\n attributesToColumns: new ModelKeys(),\n attributesToSerialized: new ModelKeys(),\n columnsToAttributes: new ModelKeys(),\n columnsToSerialized: new ModelKeys(),\n serializedToColumns: new ModelKeys(),\n serializedToAttributes: new ModelKeys(),\n }, (value) => {\n return {\n attributesToColumns: new ModelKeys(Object.assign({}, value.attributesToColumns.all())),\n attributesToSerialized: new ModelKeys(Object.assign({}, value.attributesToSerialized.all())),\n columnsToAttributes: new ModelKeys(Object.assign({}, value.columnsToAttributes.all())),\n columnsToSerialized: new ModelKeys(Object.assign({}, value.columnsToSerialized.all())),\n serializedToColumns: new ModelKeys(Object.assign({}, value.serializedToColumns.all())),\n serializedToAttributes: new ModelKeys(Object.assign({}, value.serializedToAttributes.all())),\n };\n });\n /**\n * Define columns\n */\n this.$defineProperty('$columnsDefinitions', new Map(), 'inherit');\n /**\n * Define computed properties\n */\n this.$defineProperty('$computedDefinitions', new Map(), 'inherit');\n /**\n * Define relationships\n */\n this.$defineProperty('$relationsDefinitions', new Map(), (value) => {\n const relations = new Map();\n value.forEach((relation, key) => {\n const relationClone = relation.clone(this);\n relations.set(key, relationClone);\n });\n return relations;\n });\n /**\n * Define hooks.\n */\n this.$defineProperty('$hooks', new Hooks(), (value) => {\n const hooks = new Hooks();\n hooks.merge(value);\n return hooks;\n });\n }\n static before(event, handler) {\n this.$hooks.add(`before:${event}`, handler);\n }\n static after(event, handler) {\n this.$hooks.add(`after:${event}`, handler);\n }\n /**\n * Returns a fresh persisted instance of model by applying\n * attributes to the model instance\n */\n static async create(values, options) {\n const instance = this.newUpWithOptions(values, options, options?.allowExtraProperties);\n await instance.save();\n return instance;\n }\n /**\n * Same as [[BaseModel.create]] without invoking hooks.\n */\n static async createQuietly(values, options) {\n const instance = this.newUpWithOptions(values, options, options?.allowExtraProperties);\n await instance.saveQuietly();\n return instance;\n }\n /**\n * Same as [[BaseModel.create]], but persists multiple instances. The create\n * many call will be wrapped inside a managed transaction for consistency.\n * If required, you can also pass a transaction client and the method\n * will use that instead of create a new one.\n */\n static async createMany(values, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n return managedTransaction(client, async (trx) => {\n const modelInstances = [];\n const createOptions = {\n client: trx,\n allowExtraProperties: options?.allowExtraProperties,\n };\n for (let row of values) {\n const modelInstance = await this.create(row, createOptions);\n modelInstances.push(modelInstance);\n }\n return modelInstances;\n });\n }\n /**\n * Same as [[BaseModel.createMany]] without invoking hooks.\n */\n static async createManyQuietly(values, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n return managedTransaction(client, async (trx) => {\n const modelInstances = [];\n const createOptions = {\n client: trx,\n allowExtraProperties: options?.allowExtraProperties,\n };\n for (let row of values) {\n const modelInstance = await this.createQuietly(row, createOptions);\n modelInstances.push(modelInstance);\n }\n return modelInstances;\n });\n }\n /**\n * Find model instance using the primary key\n */\n static async find(value, options) {\n if (value === undefined) {\n throw new Exception('\"find\" expects a value. Received undefined');\n }\n return this.findBy(this.primaryKey, value, options);\n }\n /**\n * Find model instance using the primary key\n */\n static async findOrFail(value, options) {\n if (value === undefined) {\n throw new Exception('\"findOrFail\" expects a value. Received undefined');\n }\n return this.findByOrFail(this.primaryKey, value, options);\n }\n static async findBy(key, value, options) {\n if (typeof key === 'object') {\n return this.query(value)\n .where(key)\n .first();\n }\n if (value === undefined) {\n throw new Exception('\"findBy\" expects a value. Received undefined');\n }\n return this.query(options).where(key, value).first();\n }\n static async findByOrFail(key, value, options) {\n if (typeof key === 'object') {\n return this.query(value)\n .where(key)\n .firstOrFail();\n }\n if (value === undefined) {\n throw new Exception('\"findByOrFail\" expects a value. Received undefined');\n }\n return this.query(options).where(key, value).firstOrFail();\n }\n static findManyBy(key, value, options) {\n if (typeof key === 'object') {\n return this.query(value)\n .where(key)\n .exec();\n }\n if (value === undefined) {\n throw new Exception('\"findManyBy\" expects a value. Received undefined');\n }\n return this.query(options).where(key, value).exec();\n }\n /**\n * Same as `query().first()`\n */\n static async first(options) {\n return this.query(options).first();\n }\n /**\n * Same as `query().firstOrFail()`\n */\n static async firstOrFail(options) {\n return this.query(options).firstOrFail();\n }\n /**\n * Find model instance using a key/value pair\n */\n static async findMany(value, options) {\n if (value === undefined) {\n throw new Exception('\"findMany\" expects a value. Received undefined');\n }\n return this.query(options)\n .whereIn(this.primaryKey, value)\n .orderBy(this.primaryKey, 'desc')\n .exec();\n }\n /**\n * Find model instance using a key/value pair or create a\n * new one without persisting it.\n */\n static async firstOrNew(searchPayload, savePayload, options) {\n /**\n * Search using the search payload and fetch the first row\n */\n const query = this.query(options).where(searchPayload);\n const row = await query.first();\n /**\n * Create a new one, if row is not found\n */\n if (!row) {\n return this.newUpWithOptions(Object.assign({}, searchPayload, savePayload), query.clientOptions, options?.allowExtraProperties);\n }\n return row;\n }\n /**\n * Same as `firstOrNew`, but also persists the newly created model instance.\n */\n static async firstOrCreate(searchPayload, savePayload, options) {\n /**\n * Search using the search payload and fetch the first row\n */\n const query = this.query(options).where(searchPayload);\n let row = await query.first();\n /**\n * Create a new instance and persist it to the database\n */\n if (!row) {\n row = this.newUpWithOptions(Object.assign({}, searchPayload, savePayload), query.clientOptions, options?.allowExtraProperties);\n await row.save();\n }\n return row;\n }\n /**\n * Updates or creates a new row inside the database\n */\n static async updateOrCreate(searchPayload, updatedPayload, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n /**\n * We wrap updateOrCreate call inside a transaction and obtain an update\n * lock on the selected row. This ensures that concurrent reads waits\n * for the existing writes to finish\n */\n return managedTransaction(client, async (trx) => {\n const query = this.query({ client: trx }).forUpdate().where(searchPayload);\n let row = await query.first();\n /**\n * Create a new instance or update the existing one (if found)\n */\n if (!row) {\n row = this.newUpWithOptions(Object.assign({}, searchPayload, updatedPayload), query.clientOptions, options?.allowExtraProperties);\n }\n else {\n row.merge(updatedPayload, options?.allowExtraProperties);\n }\n await row.save();\n return row;\n });\n }\n /**\n * Find existing rows or create an in-memory instances of the missing ones.\n */\n static async fetchOrNewUpMany(uniqueKeys, payload, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n uniqueKeys = Array.isArray(uniqueKeys) ? uniqueKeys : [uniqueKeys];\n const uniquenessPair = uniqueKeys.map((uniqueKey) => {\n return {\n key: uniqueKey,\n value: collectValues(payload, uniqueKey, () => {\n throw new Exception(`Value for the \"${uniqueKey}\" is null or undefined inside \"fetchOrNewUpMany\" payload`);\n }).map((value) => transformDateValue(value, client.dialect)),\n };\n });\n /**\n * Find existing rows\n */\n const query = this.query(options);\n uniquenessPair.forEach(({ key, value }) => query.whereIn(key, value));\n const existingRows = await query;\n /**\n * Return existing rows as it is and create a model instance for missing one's\n */\n return this.newUpIfMissing(payload, existingRows, uniqueKeys, false, query.clientOptions, options?.allowExtraProperties);\n }\n /**\n * Find existing rows or create missing one's. One database call per insert\n * is invoked, so that each insert goes through the lifecycle of model\n * hooks.\n */\n static async fetchOrCreateMany(uniqueKeys, payload, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n uniqueKeys = Array.isArray(uniqueKeys) ? uniqueKeys : [uniqueKeys];\n const uniquenessPair = uniqueKeys.map((uniqueKey) => {\n return {\n key: uniqueKey,\n value: collectValues(payload, uniqueKey, () => {\n throw new Exception(`Value for the \"${uniqueKey}\" is null or undefined inside \"fetchOrCreateMany\" payload`);\n }).map((value) => transformDateValue(value, client.dialect)),\n };\n });\n /**\n * Find existing rows\n */\n const query = this.query(options);\n uniquenessPair.forEach(({ key, value }) => query.whereIn(key, value));\n const existingRows = await query;\n /**\n * Create model instance for the missing rows\n */\n const rows = this.newUpIfMissing(payload, existingRows, uniqueKeys, false, query.clientOptions, options?.allowExtraProperties);\n /**\n * Persist inside db inside a transaction\n */\n await managedTransaction(query.client, async (trx) => {\n for (let row of rows) {\n /**\n * If transaction `client` was passed, then the row will have\n * the `trx` already set. But since, the trx of row will be\n * same as the `trx` passed to this callback, we can safely\n * re-set it.\n */\n row.$trx = trx;\n if (!row.$isPersisted) {\n await row.save();\n }\n }\n });\n return rows;\n }\n /**\n * Update existing rows or create missing one's. One database call per insert\n * is invoked, so that each insert and update goes through the lifecycle\n * of model hooks.\n */\n static async updateOrCreateMany(uniqueKeys, payload, options) {\n const client = this.$adapter.modelConstructorClient(this, options);\n uniqueKeys = Array.isArray(uniqueKeys) ? uniqueKeys : [uniqueKeys];\n const uniquenessPair = uniqueKeys.map((uniqueKey) => {\n return {\n key: uniqueKey,\n value: collectValues(payload, uniqueKey, () => {\n throw new Exception(`Value for the \"${uniqueKey}\" is null or undefined inside \"updateOrCreateMany\" payload`);\n }).map((value) => transformDateValue(value, client.dialect)),\n };\n });\n return managedTransaction(client, async (trx) => {\n /**\n * Find existing rows\n */\n const query = this.query({ client: trx }).forUpdate();\n uniquenessPair.forEach(({ key, value }) => query.whereIn(key, value));\n const existingRows = await query;\n /**\n * Create model instance for the missing rows\n */\n const rows = this.newUpIfMissing(payload, existingRows, uniqueKeys, true, query.clientOptions, options?.allowExtraProperties);\n for (let row of rows) {\n await row.save();\n }\n return rows;\n });\n }\n /**\n * Returns all rows from the model table\n */\n static async all(options) {\n return this.query(options).orderBy(this.primaryKey, 'desc');\n }\n /**\n * Truncate model table\n */\n static truncate(cascade = false) {\n return this.query().client.truncate(this.table, cascade);\n }\n constructor() {\n return new Proxy(this, proxyHandler);\n }\n /**\n * Custom options defined on the model instance that are\n * passed to the adapter\n */\n modelOptions;\n /**\n * Reference to transaction that will be used for performing queries on a given\n * model instance.\n */\n modelTrx;\n /**\n * The transaction listener listens for the `commit` and `rollback` events and\n * cleanup the `$trx` reference\n */\n transactionListener = function listener() {\n this.modelTrx = undefined;\n }.bind(this);\n /**\n * When `fill` method is called, then we may have a situation where it\n * removed the values which exists in `original` and hence the dirty\n * diff has to do a negative diff as well\n */\n fillInvoked = false;\n /**\n * A copy of cached getters\n */\n cachedGetters = {};\n /**\n * Find if force updates are enabled\n */\n forceUpdate = false;\n /**\n * Raises exception when mutations are performed on a delete model\n */\n ensureIsntDeleted() {\n if (this.$isDeleted) {\n throw new errors.E_MODEL_DELETED();\n }\n }\n /**\n * Invoked when performing the insert call. The method initiates\n * all `datetime` columns, if there are not initiated already\n * and `autoCreate` or `autoUpdate` flags are turned on.\n */\n initiateAutoCreateColumns() {\n const model = this.constructor;\n model.$columnsDefinitions.forEach((column, attributeName) => {\n const columnType = column.meta?.type;\n /**\n * Return early when not dealing with date time columns\n */\n if (!columnType || !(columnType in DATE_TIME_TYPES)) {\n return;\n }\n /**\n * Set the value when its missing and `autoCreate` or `autoUpdate`\n * flags are defined.\n */\n const attributeValue = this[attributeName];\n if (!attributeValue && (column.meta.autoCreate || column.meta.autoUpdate)) {\n ;\n this[attributeName] = DateTime.local();\n return;\n }\n });\n }\n /**\n * Invoked when performing the update call. The method initiates\n * all `datetime` columns, if there have `autoUpdate` flag\n * turned on.\n */\n initiateAutoUpdateColumns() {\n const model = this.constructor;\n model.$columnsDefinitions.forEach((column, attributeName) => {\n const columnType = column.meta?.type;\n /**\n * Return early when not dealing with date time columns or auto update\n * is not set to true\n */\n if (!columnType || !(columnType in DATE_TIME_TYPES) || !column.meta.autoUpdate) {\n return;\n }\n ;\n this[attributeName] = DateTime.local();\n });\n }\n /**\n * Preparing the object to be sent to the adapter. We need\n * to create the object with the property names to be\n * used by the adapter.\n */\n prepareForAdapter(attributes) {\n const Model = this.constructor;\n return Object.keys(attributes).reduce((result, key) => {\n const column = Model.$getColumn(key);\n const value = typeof column.prepare === 'function'\n ? column.prepare(attributes[key], key, this)\n : attributes[key];\n result[column.columnName] = value;\n return result;\n }, {});\n }\n /**\n * Returns true when the field must be included\n * inside the serialized object.\n */\n shouldSerializeField(serializeAs, fields) {\n /**\n * If explicit serializing is turned off, then never\n * return the field\n */\n if (!serializeAs) {\n return false;\n }\n /**\n * If not explicit fields are defined, then always include the field\n */\n if (!fields) {\n return true;\n }\n const { pick, omit } = normalizeCherryPickObject(fields);\n /**\n * Return false, when under omit array\n */\n if (omit && omit.includes(serializeAs)) {\n return false;\n }\n /**\n * Otherwise ensure is inside pick array\n */\n return !pick || pick.includes(serializeAs);\n }\n /**\n * A type only reference to the columns\n */\n $columns = {};\n /**\n * A copy of attributes that will be sent over to adapter\n */\n $attributes = {};\n /**\n * Original represents the properties that already has been\n * persisted or loaded by the adapter.\n */\n $original = {};\n /**\n * Preloaded relationships on the model instance\n */\n $preloaded = {};\n /**\n * Extras are dynamic properties set on the model instance, which\n * are not serialized and neither cast for adapter calls.\n *\n * This is helpful when adapter wants to load some extra data conditionally\n * and that data must not be persisted back the adapter.\n */\n $extras = {};\n /**\n * Side-loaded are dynamic properties set on the model instance, which\n * are not serialized and neither cast for adapter calls.\n *\n * This is helpful when you want to add dynamic metadata to the model\n * and it's children as well.\n *\n * The difference between [[extras]] and [[sideloaded]] is:\n *\n * - Extras can be different for each model instance\n * - Extras are not shared down the hierarchy (example relationships)\n * - Side-loaded are shared across multiple model instances created via `$createMultipleFromAdapterResult`.\n * - Side-loaded are passed to the relationships as well.\n */\n $sideloaded = {};\n /**\n * Persisted means the model has been persisted with the adapter. This will\n * also be true, when model instance is created as a result of fetch\n * call from the adapter.\n */\n $isPersisted = false;\n /**\n * Once deleted the model instance cannot make calls to the adapter\n */\n $isDeleted = false;\n /**\n * `$isLocal` tells if the model instance was created locally vs\n * one generated as a result of fetch call from the adapter.\n */\n $isLocal = true;\n /**\n * Returns the value of primary key. The value must be\n * set inside attributes object\n */\n get $primaryKeyValue() {\n const model = this.constructor;\n const column = model.$getColumn(model.primaryKey);\n if (column && column.hasGetter) {\n return this[model.primaryKey];\n }\n return this.$getAttribute(model.primaryKey);\n }\n /**\n * Opposite of [[this.isPersisted]]\n */\n get $isNew() {\n return !this.$isPersisted;\n }\n /**\n * Returns dirty properties of a model by doing a diff\n * between original values and current attributes\n */\n get $dirty() {\n const processedKeys = [];\n /**\n * Do not compute diff, when model has never been persisted\n */\n if (!this.$isPersisted) {\n return this.$attributes;\n }\n const dirty = Object.keys(this.$attributes).reduce((result, key) => {\n const value = this.$attributes[key];\n const originalValue = this.$original[key];\n let isEqual = true;\n if (isObject(value) && 'isDirty' in value) {\n isEqual = !value.isDirty;\n }\n else {\n isEqual = compareValues(originalValue, value);\n }\n if (!isEqual) {\n result[key] = value;\n }\n if (this.fillInvoked) {\n processedKeys.push(key);\n }\n return result;\n }, {});\n /**\n * Find negative diff if fill was invoked, since we may have removed values\n * that exists in originals\n */\n if (this.fillInvoked) {\n Object.keys(this.$original)\n .filter((key) => !processedKeys.includes(key))\n .forEach((key) => {\n dirty[key] = null;\n });\n }\n return dirty;\n }\n /**\n * Finding if model is dirty with changes or not\n */\n get $isDirty() {\n return Object.keys(this.$dirty).length > 0;\n }\n /**\n * Returns the transaction\n */\n get $trx() {\n return this.modelTrx;\n }\n /**\n * Set the trx to be used by the model to executing queries\n */\n set $trx(trx) {\n if (!trx) {\n this.modelTrx = undefined;\n return;\n }\n /**\n * Remove old listeners\n */\n if (this.modelTrx) {\n this.modelTrx.removeListener('commit', this.transactionListener);\n this.modelTrx.removeListener('rollback', this.transactionListener);\n }\n /**\n * Store reference to the transaction\n */\n this.modelTrx = trx;\n this.modelTrx.once('commit', this.transactionListener);\n this.modelTrx.once('rollback', this.transactionListener);\n }\n /**\n * Get options\n */\n get $options() {\n return this.modelOptions;\n }\n /**\n * Set options\n */\n set $options(options) {\n if (!options) {\n this.modelOptions = undefined;\n return;\n }\n this.modelOptions = this.modelOptions || {};\n if (options.connection) {\n this.modelOptions.connection = options.connection;\n }\n }\n /**\n * Set options on the model instance along with transaction\n */\n $setOptionsAndTrx(options) {\n if (!options) {\n return;\n }\n if (options.client && options.client.isTransaction) {\n this.$trx = options.client;\n }\n this.$options = options;\n }\n /**\n * A chainable method to set transaction on the model\n */\n useTransaction(trx) {\n this.$trx = trx;\n return this;\n }\n /**\n * A chainable method to set transaction on the model\n */\n useConnection(connection) {\n this.$options = { connection };\n return this;\n }\n /**\n * Set attribute\n */\n $setAttribute(key, value) {\n this.ensureIsntDeleted();\n this.$attributes[key] = value;\n }\n /**\n * Get value of attribute\n */\n $getAttribute(key) {\n return this.$attributes[key];\n }\n /**\n * Returns the attribute value from the cache which was resolved by\n * the mutated by a getter. This is done to avoid re-mutating\n * the same attribute value over and over again.\n */\n $getAttributeFromCache(key, callback) {\n const original = this.$getAttribute(key);\n const cached = this.cachedGetters[key];\n /**\n * Return the resolved value from cache when cache original is same\n * as the attribute value\n */\n if (cached && cached.original === original) {\n return cached.resolved;\n }\n /**\n * Re-resolve the value from the callback\n */\n const resolved = callback(original);\n if (!cached) {\n /**\n * Create cache entry\n */\n this.cachedGetters[key] = { getter: callback, original, resolved };\n }\n else {\n /**\n * Update original and resolved keys\n */\n this.cachedGetters[key].original = original;\n this.cachedGetters[key].resolved = resolved;\n }\n return resolved;\n }\n /**\n * Returns the related model or default value when model is missing\n */\n $getRelated(key) {\n return this.$preloaded[key];\n }\n /**\n * A boolean to know if relationship has been preloaded or not\n */\n $hasRelated(key) {\n return this.$preloaded[key] !== undefined;\n }\n /**\n * Sets the related data on the model instance. The method internally handles\n * `one to one` or `many` relations\n */\n $setRelated(key, models) {\n const Model = this.constructor;\n const relation = Model.$relationsDefinitions.get(key);\n /**\n * Ignore when relation is not defined\n */\n if (!relation) {\n return;\n }\n /**\n * Reset array before invoking $pushRelated\n */\n if (MANY_RELATIONS.includes(relation.type)) {\n if (!Array.isArray(models)) {\n throw new Exception(`\"${Model.name}.${key}\" must be an array when setting \"${relation.type}\" relationship`);\n }\n this.$preloaded[key] = [];\n }\n return this.$pushRelated(key, models);\n }\n /**\n * Push related adds to the existing related collection\n */\n $pushRelated(key, models) {\n const Model = this.constructor;\n const relation = Model.$relationsDefinitions.get(key);\n /**\n * Ignore when relation is not defined\n */\n if (!relation) {\n return;\n }\n /**\n * Create multiple for `hasMany` `manyToMany` and `hasManyThrough`\n */\n if (MANY_RELATIONS.includes(relation.type)) {\n this.$preloaded[key] = (this.$preloaded[key] || []).concat(models);\n return;\n }\n /**\n * Dis-allow setting multiple model instances for a one-to-one relationship\n */\n if (Array.isArray(models)) {\n throw new Error(`\"${Model.name}.${key}\" cannot reference more than one instance of \"${relation.relatedModel().name}\" model`);\n }\n this.$preloaded[key] = models;\n }\n /**\n * Merges the object with the model attributes, assuming object keys\n * are coming the database.\n *\n * 1. If key is unknown, it will be added to the `extras` object.\n * 2. If key is defined as a relationship, it will be ignored and one must call `$setRelated`.\n */\n $consumeAdapterResult(adapterResult, sideloadedAttributes) {\n const Model = this.constructor;\n /**\n * Merging sideloaded attributes with the existing sideloaded values\n * on the model instance\n */\n if (sideloadedAttributes) {\n this.$sideloaded = Object.assign({}, this.$sideloaded, sideloadedAttributes);\n }\n /**\n * Merge result of adapter with the attributes. This enables\n * the adapter to hydrate models with properties generated\n * as a result of insert or update\n */\n if (isObject(adapterResult)) {\n Object.keys(adapterResult).forEach((key) => {\n /**\n * Pull the attribute name from the column name, since adapter\n * results always holds the column names.\n */\n const attributeName = Model.$keys.columnsToAttributes.get(key);\n if (attributeName) {\n const attribute = Model.$getColumn(attributeName);\n /**\n * Invoke `consume` method for the column, before setting the\n * attribute\n */\n const value = typeof attribute.consume === 'function'\n ? attribute.consume(adapterResult[key], attributeName, this)\n : adapterResult[key];\n /**\n * When consuming the adapter result, we must always set the attributes\n * directly, as we do not want to invoke setters.\n */\n this.$setAttribute(attributeName, value);\n return;\n }\n /**\n * If key is defined as a relation, then ignore it, since one\n * must pass a qualified model to `this.$setRelated()`\n */\n if (Model.$relationsDefinitions.has(key)) {\n return;\n }\n /**\n * Set directly on the model\n */\n if (this.hasOwnProperty(key)) {\n ;\n this[key] = adapterResult[key];\n return;\n }\n this.$extras[key] = adapterResult[key];\n });\n }\n }\n /**\n * Sync originals with the attributes. After this `isDirty` will\n * return false\n */\n $hydrateOriginals() {\n this.$original = {};\n lodash.merge(this.$original, this.$attributes);\n }\n /**\n * Set bulk attributes on the model instance. Setting relationships via\n * fill isn't allowed, since we disallow setting relationships\n * locally\n */\n fill(values, allowExtraProperties = false) {\n this.$attributes = {};\n this.merge(values, allowExtraProperties);\n this.fillInvoked = true;\n return this;\n }\n /**\n * Merge bulk attributes with existing attributes.\n *\n * 1. If key is unknown, it will be added to the `extras` object.\n * 2. If key is defined as a relationship, it will be ignored and one must call `$setRelated`.\n */\n merge(values, allowExtraProperties = false) {\n const Model = this.constructor;\n /**\n * Merge values with the attributes\n */\n if (isObject(values)) {\n Object.keys(values).forEach((key) => {\n const value = values[key];\n /**\n * Set as column\n */\n if (Model.$hasColumn(key)) {\n ;\n this[key] = value;\n return;\n }\n /**\n * Resolve the attribute name from the column names. Since people\n * usually define the column names directly as well by\n * accepting them directly from the API.\n */\n const attributeName = Model.$keys.columnsToAttributes.get(key);\n if (attributeName) {\n ;\n this[attributeName] = value;\n return;\n }\n /**\n * If key is defined as a relation, then ignore it, since one\n * must pass a qualified model to `this.$setRelated()`\n */\n if (Model.$relationsDefinitions.has(key)) {\n return;\n }\n /**\n * If the property already exists on the model, then set it\n * as it is vs defining it as an extra property\n */\n if (this.hasOwnProperty(key)) {\n ;\n this[key] = value;\n return;\n }\n /**\n * Raise error when not instructed to ignore non-existing properties.\n */\n if (!allowExtraProperties) {\n throw new Error(`Cannot define \"${key}\" on \"${Model.name}\" model, since it is not defined as a model property`);\n }\n this.$extras[key] = value;\n });\n }\n return this;\n }\n /**\n * Returns whether any of the fields have been modified\n */\n isDirty(fields) {\n const keys = Array.isArray(fields) ? fields : fields ? [fields] : [];\n if (keys.length === 0) {\n return this.$isDirty;\n }\n return keys.some((key) => key in this.$dirty);\n }\n /**\n * Enable force update even when no attributes\n * are dirty\n */\n enableForceUpdate() {\n this.forceUpdate = true;\n return this;\n }\n /**\n * Preloads one or more relationships for the current model\n */\n async load(relationName, callback) {\n this.ensureIsntDeleted();\n if (!this.$isPersisted) {\n throw new Exception('Cannot lazy load relationship for an unpersisted model instance');\n }\n const Model = this.constructor;\n const preloader = new Preloader(Model);\n if (typeof relationName === 'function') {\n relationName(preloader);\n }\n else {\n preloader.load(relationName, callback);\n }\n const queryClient = Model.$adapter.modelClient(this);\n await preloader\n .sideload(this.$sideloaded)\n .debug(queryClient.debug)\n .processAllForOne(this, queryClient);\n }\n /**\n * Load relationships onto the instance, but only if they are not\n * already preloaded\n */\n async loadOnce(relationName) {\n if (!this.$preloaded[relationName]) {\n return this.load(relationName);\n }\n }\n /**\n * @deprecated\n */\n async preload(relationName, callback) {\n process.emitWarning('DeprecationWarning', '\"Model.preload()\" is deprecated. Use \"Model.load()\" instead');\n return this.load(relationName, callback);\n }\n /**\n * Lazy load the relationship aggregate value\n */\n loadAggregate(relationName, callback) {\n this.ensureIsntDeleted();\n if (!this.$isPersisted) {\n throw new Exception('Cannot lazy load relationship aggregates for an unpersisted model instance');\n }\n return new LazyLoadAggregates(this).loadAggregate(relationName, callback);\n }\n /**\n * Lazy load the relationship count value\n */\n loadCount(relationName, callback) {\n this.ensureIsntDeleted();\n if (!this.$isPersisted) {\n throw new Exception('Cannot lazy load relationship aggregates for an unpersisted model instance');\n }\n return new LazyLoadAggregates(this).loadCount(relationName, callback);\n }\n /**\n * Perform save on the model instance to commit mutations.\n */\n async save() {\n this.ensureIsntDeleted();\n const Model = this.constructor;\n /**\n * Persist the model when it's not persisted already\n */\n if (!this.$isPersisted) {\n await Model.$hooks.runner('before:create').run(this);\n await Model.$hooks.runner('before:save').run(this);\n this.initiateAutoCreateColumns();\n await Model.$adapter.insert(this, this.prepareForAdapter(this.$attributes));\n this.$hydrateOriginals();\n this.$isPersisted = true;\n await Model.$hooks.runner('after:create').run(this);\n await Model.$hooks.runner('after:save').run(this);\n return this;\n }\n /**\n * Call hooks beforehand, so that they have the chance\n * to make mutations that produces one or more `$dirty`\n * fields.\n */\n await Model.$hooks.runner('before:update').run(this);\n await Model.$hooks.runner('before:save').run(this);\n const forceUpdate = this.forceUpdate;\n this.forceUpdate = false;\n /**\n * Do not issue updates when model doesn't have any mutations\n */\n if (!this.$isDirty && !forceUpdate) {\n return this;\n }\n /**\n * Perform update\n */\n this.initiateAutoUpdateColumns();\n const updatePayload = this.prepareForAdapter(this.$dirty);\n if (Object.keys(updatePayload).length > 0) {\n await Model.$adapter.update(this, updatePayload);\n }\n this.$hydrateOriginals();\n await Model.$hooks.runner('after:update').run(this);\n await Model.$hooks.runner('after:save').run(this);\n return this;\n }\n /**\n * Same as [[BaseModel.save]] without invoking hooks.\n */\n async saveQuietly() {\n this.ensureIsntDeleted();\n const Model = this.constructor;\n /**\n * Persist the model when it's not persisted already\n */\n if (!this.$isPersisted) {\n this.initiateAutoCreateColumns();\n await Model.$adapter.insert(this, this.prepareForAdapter(this.$attributes));\n this.$hydrateOriginals();\n this.$isPersisted = true;\n return this;\n }\n /**\n * Call hooks beforehand, so that they have the chance\n * to make mutations that produces one or more `$dirty`\n * fields.\n */\n const forceUpdate = this.forceUpdate;\n this.forceUpdate = false;\n /**\n * Do not issue updates when model doesn't have any mutations\n */\n if (!this.$isDirty && !forceUpdate) {\n return this;\n }\n /**\n * Perform update\n */\n this.initiateAutoUpdateColumns();\n const updatePayload = this.prepareForAdapter(this.$dirty);\n if (Object.keys(updatePayload).length > 0) {\n await Model.$adapter.update(this, updatePayload);\n }\n this.$hydrateOriginals();\n return this;\n }\n /**\n * The lockForUpdate method re-fetches the model instance from\n * the database and locks the row to perform an update. The\n * provided callback receives a fresh user instance and should\n * use that to perform an update.\n */\n async lockForUpdate(callback) {\n const Model = this.constructor;\n const queryClient = Model.$adapter.modelClient(this);\n return managedTransaction(queryClient, async (trx) => {\n const user = await Model.query({ client: trx })\n .forUpdate()\n .where(Model.primaryKey, this.$primaryKeyValue)\n .first();\n if (!user) {\n throw new errors.E_MODEL_DELETED();\n }\n return callback(user);\n });\n }\n /**\n * Perform delete by issuing a delete request on the adapter\n */\n async delete() {\n this.ensureIsntDeleted();\n const Model = this.constructor;\n await Model.$hooks.runner('before:delete').run(this);\n await Model.$adapter.delete(this);\n this.$isDeleted = true;\n await Model.$hooks.runner('after:delete').run(this);\n }\n /**\n * Same as [[BaseModel.delete]] without invoking hooks.\n */\n async deleteQuietly() {\n this.ensureIsntDeleted();\n const Model = this.constructor;\n await Model.$adapter.delete(this);\n this.$isDeleted = true;\n }\n /**\n * Serializes model attributes to a plain object\n */\n serializeAttributes(fields, raw = false) {\n const Model = this.constructor;\n return Object.keys(this.$attributes).reduce((result, key) => {\n const column = Model.$getColumn(key);\n if (!this.shouldSerializeField(column.serializeAs, fields)) {\n return result;\n }\n const value = this[key];\n result[column.serializeAs] =\n typeof column.serialize === 'function' && !raw ? column.serialize(value, key, this) : value;\n return result;\n }, {});\n }\n /**\n * Serializes model compute properties to an object.\n */\n serializeComputed(fields) {\n const Model = this.constructor;\n const result = {};\n Model.$computedDefinitions.forEach((value, key) => {\n const computedValue = this[key];\n if (computedValue !== undefined && this.shouldSerializeField(value.serializeAs, fields)) {\n result[value.serializeAs] = computedValue;\n }\n });\n return result;\n }\n /**\n * Serializes relationships to a plain object. When `raw=true`, it will\n * recursively serialize the relationships as well.\n */\n serializeRelations(cherryPick, raw = false) {\n const Model = this.constructor;\n return Object.keys(this.$preloaded).reduce((result, key) => {\n const relation = Model.$getRelation(key);\n /**\n * Do not serialize relationship, when serializeAs is null\n */\n if (!relation.serializeAs) {\n return result;\n }\n const value = this.$preloaded[key];\n /**\n * Return relationship model as it is, when `raw` is true.\n */\n if (raw) {\n result[relation.serializeAs] = value;\n return result;\n }\n /**\n * Always make sure we are passing a valid object or undefined\n * to the relationships\n */\n const relationOptions = cherryPick ? cherryPick[relation.serializeAs] : undefined;\n result[relation.serializeAs] = Array.isArray(value)\n ? value.map((one) => one.serialize(relationOptions))\n : value === null\n ? null\n : value.serialize(relationOptions);\n return result;\n }, {});\n }\n /**\n * Converting model to it's JSON representation\n */\n serialize(cherryPick) {\n let extras = null;\n if (this.serializeExtras === true) {\n extras = { meta: this.$extras };\n }\n else if (typeof this.serializeExtras === 'function') {\n extras = this.serializeExtras();\n }\n return {\n ...this.serializeAttributes(cherryPick?.fields, false),\n ...this.serializeRelations(cherryPick?.relations, false),\n ...this.serializeComputed(cherryPick?.fields),\n ...extras,\n };\n }\n /**\n * Convert model to a plain Javascript object\n */\n toObject() {\n const Model = this.constructor;\n const computed = {};\n /**\n * Relationships toObject\n */\n const preloaded = Object.keys(this.$preloaded).reduce((result, key) => {\n const value = this.$preloaded[key];\n result[key] = Array.isArray(value) ? value.map((one) => one.toObject()) : value.toObject();\n return result;\n }, {});\n /**\n * Update computed object with computed definitions\n */\n Model.$computedDefinitions.forEach((_, key) => {\n const computedValue = this[key];\n if (computedValue !== undefined) {\n computed[key] = computedValue;\n }\n });\n return {\n ...this.$attributes,\n ...preloaded,\n ...computed,\n $extras: this.$extras,\n };\n }\n /**\n * Returns the serialize method output. However, any model can overwrite\n * it to define it's custom serialize output\n */\n toJSON() {\n return this.serialize();\n }\n /**\n * Returns the query for `insert`, `update` or `delete` actions.\n * Since the query builder for these actions are not exposed to\n * the end user, this method gives a way to compose queries.\n */\n $getQueryFor(action, client) {\n const modelConstructor = this.constructor;\n const primaryKey = modelConstructor.primaryKey;\n const primaryKeyColumn = modelConstructor.$keys.attributesToColumns.get(primaryKey, primaryKey);\n /**\n * Returning insert query for the inserts\n */\n if (action === 'insert') {\n const insertQuery = client.insertQuery().table(modelConstructor.table);\n insertQuery.returning(primaryKeyColumn);\n return insertQuery;\n }\n /**\n * When self assigning the primary key, then we read the primary\n * value from the originals and the attributes, since we allow\n * updating primary key itself\n */\n const primaryKeyValue = modelConstructor.selfAssignPrimaryKey\n ? this.$original[primaryKey]\n : this.$primaryKeyValue;\n /**\n * Returning generic query builder for rest of the queries\n */\n return client.modelQuery(modelConstructor).where(primaryKeyColumn, primaryKeyValue);\n }\n /**\n * Returns an instance of relationship on the given model\n */\n related(relationName) {\n const Model = this.constructor;\n const relation = Model.$getRelation(relationName);\n ensureRelation(relationName, relation);\n relation.boot();\n return relation.client(this, Model.$adapter.modelClient(this));\n }\n /**\n * Reload/Refresh the model instance\n */\n async refresh() {\n this.ensureIsntDeleted();\n /**\n * Noop when model instance is not persisted\n */\n if (!this.$isPersisted) {\n return this;\n }\n const Model = this.constructor;\n await Model.$adapter.refresh(this);\n return this;\n }\n};\nBaseModelImpl = __decorate([\n StaticImplements()\n], BaseModelImpl);\nexport const BaseModel = BaseModelImpl;\n/**\n * Helper to mark a function as query scope\n */\nexport function scope(callback) {\n return callback;\n}\n","/*\n|--------------------------------------------------------------------------\n| Decorator Schemas\n|--------------------------------------------------------------------------\n|\n| Joi validation schemas for Resourceful decorators. These schemas ensure\n| that decorator options to the expected shapes during runtime.\n|\n*/\nimport { joi } from '@nhtio/lucid-resourceful/joi'\nimport { guards } from '@nhtio/lucid-resourceful/utils'\nimport { E_INVALID_RESOURCEFUL_DECORATOR_OPTIONS } from '@nhtio/lucid-resourceful/errors'\nimport {\n ResourcefulStringType,\n ResourcefulDateType,\n ResourcefulDateTimeType,\n ResourcefulBinaryType,\n ResourcefulNumberType,\n ResourcefulIntegerType,\n ResourcefulBigintType,\n ResourcefulUnsignedIntegerType,\n ResourcefulBooleanType,\n ResourcefulObjectType,\n ResourcefulArrayType,\n} from '@nhtio/lucid-resourceful/definitions'\nimport type { ObjectSchema } from 'joi'\n\n/*\n|--------------------------------------------------------------------------\n| Validate, Normalize and Cast\n|--------------------------------------------------------------------------\n|\n| Internal utility for validating decorator options using Joi schemas.\n| Applies defaults, performs type conversions, and provides meaningful\n| error messages with context about which decorator and field failed.\n|\n*/\n\nexport const validateNormalizeAndCastDecoratorOptions = <InputType, OutputType>(\n fieldName: string,\n decoratorName: string,\n schema: ObjectSchema,\n input: InputType\n): OutputType => {\n const { error, value } = schema.validate(input, {\n convert: true,\n abortEarly: false,\n })\n if (error) {\n throw new E_INVALID_RESOURCEFUL_DECORATOR_OPTIONS(decoratorName, fieldName, error)\n }\n return value as OutputType\n}\n\n/*\n|--------------------------------------------------------------------------\n| Base Schemas\n|--------------------------------------------------------------------------\n*/\n\nconst resourcefulPropertyDefinitionSchema = joi.object({\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n})\n\nconst joiInstanceCheckerAlternativesFactory = (Ctor: any, CtorName: string) => {\n return [\n joi.object().instance(Ctor),\n joi.function().instance(Ctor),\n joi.custom((value, helpers) => {\n if (guards.isObject(value) && value.constructor.name === CtorName) {\n return value\n }\n return helpers.error('any.invalid', { value, type: CtorName })\n }),\n ]\n}\n\nconst resourcefulDataTypeSchema = joi.alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, 'ResourcefulStringType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, 'ResourcefulDateType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, 'ResourcefulDateTimeType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, 'ResourcefulBinaryType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, 'ResourcefulNumberType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, 'ResourcefulIntegerType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, 'ResourcefulBigintType'),\n ...joiInstanceCheckerAlternativesFactory(\n ResourcefulUnsignedIntegerType,\n 'ResourcefulUnsignedIntegerType'\n ),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, 'ResourcefulBooleanType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulObjectType, 'ResourcefulObjectType'),\n ...joiInstanceCheckerAlternativesFactory(ResourcefulArrayType, 'ResourcefulArrayType')\n)\n\nconst localResourcefulPropertyDefinitionSchema = resourcefulPropertyDefinitionSchema.keys({\n type: resourcefulDataTypeSchema.required(),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Column Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const resourcefulColumnDefinitionSchema = localResourcefulPropertyDefinitionSchema\n\nexport const resourcefulColumnOptionsSchema = joi.object({\n // Lucid ColumnOptions (partial)\n columnName: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n consume: joi.function().optional(),\n prepare: joi.function().optional(),\n meta: joi.object().optional(),\n isPrimary: joi.boolean().default(false),\n hasDefaultValue: joi.boolean().default(false),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: resourcefulDataTypeSchema.required(),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Data Type Specific Column Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const dataTypeColumnOptionsSchema = joi.object({\n // Lucid ColumnOptions (partial) - excluding 'prepare' and 'consume'\n columnName: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n meta: joi.object().optional(),\n isPrimary: joi.boolean().default(false),\n hasDefaultValue: joi.boolean().default(false),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: resourcefulDataTypeSchema.optional(),\n})\n\nconst baseDateColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n autoCreate: joi.boolean().default(false),\n autoUpdate: joi.boolean().default(false),\n})\n\n/*\n|--------------------------------------------------------------------------\n| String Column Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const stringColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, 'ResourcefulStringType')\n )\n .default(() => new ResourcefulStringType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Date Column Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const dateColumnOptionsSchema = baseDateColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, 'ResourcefulDateType')\n )\n .default(() => new ResourcefulDateType()),\n})\n\nexport const dateTimeColumnOptionsSchema = baseDateColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, 'ResourcefulDateTimeType')\n )\n .default(() => new ResourcefulDateTimeType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Binary Column Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const binaryColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, 'ResourcefulBinaryType')\n )\n .default(() => new ResourcefulBinaryType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Number Column Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const numberColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, 'ResourcefulNumberType')\n )\n .default(() => new ResourcefulNumberType()),\n})\n\nexport const integerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, 'ResourcefulIntegerType')\n )\n .default(() => new ResourcefulIntegerType()),\n})\n\nexport const bigintColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, 'ResourcefulBigintType')\n )\n .default(() => new ResourcefulBigintType()),\n})\n\nexport const unsignedIntegerColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(\n ResourcefulUnsignedIntegerType,\n 'ResourcefulUnsignedIntegerType'\n )\n )\n .default(() => new ResourcefulUnsignedIntegerType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Boolean Column Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const booleanColumnOptionsSchema = dataTypeColumnOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, 'ResourcefulBooleanType')\n )\n .default(() => new ResourcefulBooleanType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Object/Array Column Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const objectColumnOptionsSchema = joi.object({\n // Lucid ColumnOptions (full)\n columnName: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n consume: joi.function().optional(),\n prepare: joi.function().optional(),\n meta: joi.object().optional(),\n isPrimary: joi.boolean().default(false),\n hasDefaultValue: joi.boolean().default(false),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulObjectType, 'ResourcefulObjectType')\n )\n .default(() => new ResourcefulObjectType()),\n})\n\nexport const arrayColumnOptionsSchema = joi.object({\n // Lucid ColumnOptions (full)\n columnName: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n consume: joi.function().optional(),\n prepare: joi.function().optional(),\n meta: joi.object().optional(),\n isPrimary: joi.boolean().default(false),\n hasDefaultValue: joi.boolean().default(false),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulArrayType, 'ResourcefulArrayType')\n )\n .default(() => new ResourcefulArrayType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Computed Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const resourcefulComputedDefinitionSchema = localResourcefulPropertyDefinitionSchema.append({\n writable: joi.boolean().default(false),\n})\n\nexport const resourcefulComputedOptionsSchema = joi.object({\n // Lucid ComputedOptions (partial)\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n meta: joi.object().optional(),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: resourcefulDataTypeSchema.required(),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Data Type Specific Computed Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const dataTypeComputedOptionsSchema = joi.object({\n // Lucid ComputedOptions (partial) - excluding 'prepare' and 'consume'\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n meta: joi.object().optional(),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: resourcefulDataTypeSchema.optional(),\n})\n\nconst baseDateComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n autoCreate: joi.boolean().default(false),\n autoUpdate: joi.boolean().default(false),\n})\n\n/*\n|--------------------------------------------------------------------------\n| String Computed Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const stringComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulStringType, 'ResourcefulStringType')\n )\n .default(() => new ResourcefulStringType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Date Computed Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const dateComputedOptionsSchema = baseDateComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateType, 'ResourcefulDateType')\n )\n .default(() => new ResourcefulDateType()),\n})\n\nexport const dateTimeComputedOptionsSchema = baseDateComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulDateTimeType, 'ResourcefulDateTimeType')\n )\n .default(() => new ResourcefulDateTimeType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Binary Computed Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const binaryComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBinaryType, 'ResourcefulBinaryType')\n )\n .default(() => new ResourcefulBinaryType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Number Computed Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const numberComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulNumberType, 'ResourcefulNumberType')\n )\n .default(() => new ResourcefulNumberType()),\n})\n\nexport const integerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulIntegerType, 'ResourcefulIntegerType')\n )\n .default(() => new ResourcefulIntegerType()),\n})\n\nexport const bigintComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBigintType, 'ResourcefulBigintType')\n )\n .default(() => new ResourcefulBigintType()),\n})\n\nexport const unsignedIntegerComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(\n ResourcefulUnsignedIntegerType,\n 'ResourcefulUnsignedIntegerType'\n )\n )\n .default(() => new ResourcefulUnsignedIntegerType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Boolean Computed Schema\n|--------------------------------------------------------------------------\n*/\n\nexport const booleanComputedOptionsSchema = dataTypeComputedOptionsSchema.keys({\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulBooleanType, 'ResourcefulBooleanType')\n )\n .default(() => new ResourcefulBooleanType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Object/Array Computed Schemas\n|--------------------------------------------------------------------------\n*/\n\nexport const objectComputedOptionsSchema = joi.object({\n // Lucid ComputedOptions (full)\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n meta: joi.object().optional(),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulObjectType, 'ResourcefulObjectType')\n )\n .default(() => new ResourcefulObjectType()),\n})\n\nexport const arrayComputedOptionsSchema = joi.object({\n // Lucid ComputedOptions (full)\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n serialize: joi.function().optional(),\n meta: joi.object().optional(),\n\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n type: joi\n .alternatives(\n ...joiInstanceCheckerAlternativesFactory(ResourcefulArrayType, 'ResourcefulArrayType')\n )\n .default(() => new ResourcefulArrayType()),\n})\n\n/*\n|--------------------------------------------------------------------------\n| Relationship Schemas\n|--------------------------------------------------------------------------\n|\n| Joi validation schemas for relationship decorator options. These schemas\n| combine Lucid relationship options with resourceful relationship options.\n|\n*/\n\n// Base schema for resourceful relationship options\nexport const resourcefulRelationshipOptionsSchema = joi.object({\n // Resourceful options\n propertyKey: joi.string().default(''),\n readAccessControlFilters: joi.array().items(joi.function()).default([]),\n writeAccessControlFilters: joi.array().items(joi.function()).default([]),\n nullable: joi.boolean().default(false),\n description: joi.string().optional(),\n default: joi.any().optional(),\n externalDocs: joi\n .object({\n description: joi.string().optional(),\n url: joi.string().uri().required(),\n })\n .optional(),\n example: joi.string().optional(),\n deprecated: joi.boolean().default(false),\n})\n\n// Schema for belongsTo, hasOne, hasMany relationships\nexport const relationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({\n // Lucid RelationOptions\n localKey: joi.string().optional(),\n foreignKey: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n onQuery: joi.function().optional(),\n relatedModel: joi.function(),\n})\n\n// Schema for manyToMany relationships\nexport const manyToManyRelationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({\n // Lucid ManyToManyRelationOptions\n localKey: joi.string().optional(),\n relatedKey: joi.string().optional(),\n pivotForeignKey: joi.string().optional(),\n pivotRelatedForeignKey: joi.string().optional(),\n pivotTable: joi.string().optional(),\n pivotTimestamps: joi.boolean().optional(),\n pivotColumns: joi.array().items(joi.string()).optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n onQuery: joi.function().optional(),\n relatedModel: joi.function(),\n})\n\n// Schema for hasManyThrough relationships\nexport const hasManyThroughRelationOptionsSchema = resourcefulRelationshipOptionsSchema.keys({\n // Lucid HasManyThroughRelationOptions (ThroughRelationOptions without throughModel)\n localKey: joi.string().optional(),\n foreignKey: joi.string().optional(),\n throughLocalKey: joi.string().optional(),\n throughForeignKey: joi.string().optional(),\n serializeAs: joi.alternatives().try(joi.string(), joi.valid(null)).optional(),\n onQuery: joi.function().optional(),\n relatedModel: joi.function(),\n})\n","/*\n|--------------------------------------------------------------------------\n| Decorators for Resourceful Lucid Models\n|--------------------------------------------------------------------------\n|\n| Decorators which are used to add the required metadata to Lucid models\n| which have been extended with the Resourceful mixin.\n|\n*/\n\n/*\n|--------------------------------------------------------------------------\n| NOTE FOR FUTURE MAINTAINERS\n|--------------------------------------------------------------------------\n|\n| The `type` property for resourceful decorators (e.g., resourcefulColumn, resourcefulComputed)\n| must always be a ResourcefulDataType instance (e.g., ResourcefulStringType(), ResourcefulNumberType(), etc.),\n| not a string literal like 'string' or 'number'.\n| This is required because the system expects a structured data type definition with validation,\n| format, and other metadata, not just a primitive string. See src/private/data_types.ts for details.\n|\n*/\n\nimport { guards } from '@nhtio/lucid-resourceful/utils'\nimport {\n PrepareConsumeChainBuilder,\n DefaultPrepareFunction,\n DefaultConsumeFunction,\n} from './prepare_consume_chain_builder'\nimport {\n LucidModel,\n ColumnOptions,\n ComputedOptions,\n DateColumnDecorator,\n DateTimeColumnDecorator,\n} from '@adonisjs/lucid/types/model'\nimport {\n column as lucidColumn,\n computed as lucidComputed,\n belongsTo as lucidBelongsTo,\n hasOne as lucidHasOne,\n hasMany as lucidHasMany,\n manyToMany as lucidManyToMany,\n hasManyThrough as lucidHasManyThrough,\n} from '@adonisjs/lucid/orm'\nimport {\n prepareString,\n prepareBinary,\n prepareNumber,\n prepareInteger,\n prepareBigint,\n prepareUnsignedint,\n prepareBoolean,\n prepareObject,\n prepareArray,\n consumeString,\n consumeBinary,\n consumeNumber,\n consumeInteger,\n consumeBigint,\n consumeUnsignedint,\n consumeBoolean,\n consumeObject,\n consumeArray,\n} from './decorator_utils'\nimport {\n validateNormalizeAndCastDecoratorOptions,\n resourcefulColumnOptionsSchema,\n stringColumnOptionsSchema,\n dateColumnOptionsSchema,\n dateTimeColumnOptionsSchema,\n binaryColumnOptionsSchema,\n numberColumnOptionsSchema,\n integerColumnOptionsSchema,\n bigintColumnOptionsSchema,\n unsignedIntegerColumnOptionsSchema,\n booleanColumnOptionsSchema,\n objectColumnOptionsSchema,\n arrayColumnOptionsSchema,\n resourcefulComputedOptionsSchema,\n stringComputedOptionsSchema,\n dateComputedOptionsSchema,\n dateTimeComputedOptionsSchema,\n binaryComputedOptionsSchema,\n numberComputedOptionsSchema,\n integerComputedOptionsSchema,\n bigintComputedOptionsSchema,\n unsignedIntegerComputedOptionsSchema,\n booleanComputedOptionsSchema,\n objectComputedOptionsSchema,\n arrayComputedOptionsSchema,\n relationOptionsSchema,\n manyToManyRelationOptionsSchema,\n hasManyThroughRelationOptionsSchema,\n} from './decorator_schemas'\nimport type {\n HasOne,\n ManyToMany,\n HasManyThrough,\n ManyToManyRelationOptions,\n RelationOptions,\n ThroughRelationOptions,\n} from '@adonisjs/lucid/types/relations'\nimport type {\n ResourcefulColumnDefinition,\n ResourcefulComputedAccessorDefinition,\n ResourcefulRelationshipDefinition,\n AnySchema,\n StringSchema,\n DateSchema,\n BinarySchema,\n NumberSchema,\n BooleanSchema,\n ObjectSchema,\n ArraySchema,\n ResourcefulPropertySchema,\n} from '@nhtio/lucid-resourceful/types'\n\n/**\n * Options for date columns including autoCreate and autoUpdate flags.\n *\n * @example\n * ```ts\n * {\n * autoCreate: true,\n * autoUpdate: false,\n * nullable: false,\n * }\n * ```\n */\nexport type DateColumnOptions = DataTypeColumnOptions & {\n autoCreate: boolean\n autoUpdate: boolean\n}\n\n/**\n * Options for relation decorators on related models.\n *\n * @example\n * ```ts\n * import { resourcefulBelongsTo } from '@nhtio/lucid-resourceful'\n *\n * class Post {\n * @resourcefulBelongsTo(() => User, { foreignKey: 'user_id' })\n * public user: User\n * }\n * ```\n */\nexport type RelatedModelRelationOptions<RelatedModel extends LucidModel> =\n | RelationOptions<RelatedModel, LucidModel, HasOne<RelatedModel, LucidModel>>\n | ManyToManyRelationOptions<ManyToMany<RelatedModel>>\n | Omit<\n ThroughRelationOptions<RelatedModel, LucidModel, HasManyThrough<RelatedModel>>,\n 'throughModel'\n >\n\n/**\n * Options for hasManyThrough relation decorators.\n *\n * @example\n * ```ts\n * import { resourcefulHasManyThrough } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulHasManyThrough([\n * () => Role,\n * () => UserRolePivot\n * ], { foreignKey: 'user_id' })\n * public roles: HasManyThrough<typeof Role>\n * }\n * ```\n */\nexport type HasManyThroughRelationOptions<RelatedModel extends LucidModel> = Omit<\n ThroughRelationOptions<RelatedModel, LucidModel, HasManyThrough<RelatedModel>>,\n 'throughModel'\n>\n\ntype ValidatorInput<Schema extends AnySchema = AnySchema> = Partial<DataTypeColumnOptions> &\n Partial<ResourcefulColumnDefinition<Schema>>\ntype ValidatorOutnput<Schema extends AnySchema = AnySchema> = DataTypeColumnOptions &\n ResourcefulColumnDefinition<Schema>\n\ninterface ColumnOptionsWithDate extends ColumnOptions {\n autoCreate: boolean\n autoUpdate: boolean\n}\n\nconst extractLucidOptionsForLucidDecorator = <\n LucidDecoratorOptionsType,\n InputOptionsType extends LucidDecoratorOptionsType = LucidDecoratorOptionsType,\n>(\n options: InputOptionsType,\n keys: Array<keyof LucidDecoratorOptionsType>,\n overrides?: Partial<LucidDecoratorOptionsType>\n): Partial<LucidDecoratorOptionsType> => {\n const extracted: Partial<LucidDecoratorOptionsType> = {}\n Object.entries(options as {}).forEach((entry) => {\n const [key, value] = entry as [keyof InputOptionsType, InputOptionsType[keyof InputOptionsType]]\n if (keys.includes(key as keyof LucidDecoratorOptionsType)) {\n const k = key as keyof LucidDecoratorOptionsType\n const v = value as unknown as LucidDecoratorOptionsType[keyof LucidDecoratorOptionsType]\n extracted[k] = v\n }\n })\n if (guards.isObject(overrides)) {\n Object.assign(extracted, overrides)\n }\n return extracted\n}\n\nconst extractLucidOptionsForLucidColumnDecorator = (\n options: Partial<ColumnOptionsWithDate>,\n overrides?: Partial<ColumnOptionsWithDate>\n) => {\n return extractLucidOptionsForLucidDecorator<Partial<ColumnOptionsWithDate>>(\n options,\n [\n 'columnName',\n 'serializeAs',\n 'isPrimary',\n 'meta',\n 'serialize',\n 'prepare',\n 'consume',\n 'autoCreate',\n 'autoUpdate',\n ],\n overrides\n )\n}\n\nconst extractLucidOptionsForLucidComputedDecorator = (\n options: Partial<ComputedOptions>,\n overrides?: Partial<ComputedOptions>\n) => {\n return extractLucidOptionsForLucidDecorator<Partial<ComputedOptions>>(\n options,\n ['serializeAs', 'meta'],\n overrides\n )\n}\n\nconst extractLucidOptionsForLucidRelatedModelDecorator = <RelatedModel extends LucidModel>(\n options: Partial<RelatedModelRelationOptions<RelatedModel>>,\n overrides?: Partial<RelatedModelRelationOptions<RelatedModel>>\n) => {\n return extractLucidOptionsForLucidDecorator<Partial<RelatedModelRelationOptions<RelatedModel>>>(\n options,\n [\n 'localKey',\n 'foreignKey',\n 'serializeAs',\n 'onQuery',\n 'meta',\n 'pivotTable',\n 'localKey',\n 'pivotForeignKey',\n 'relatedKey',\n 'pivotRelatedForeignKey',\n 'pivotColumns',\n 'pivotTimestamps',\n 'throughLocalKey',\n 'throughForeignKey',\n ] as any,\n overrides\n )\n}\n\nconst extractLucidOptionsForLucidHasManyThroughDecorator = <RelatedModel extends LucidModel>(\n options: Partial<HasManyThroughRelationOptions<RelatedModel>>,\n overrides?: Partial<HasManyThroughRelationOptions<RelatedModel>>\n) => {\n return extractLucidOptionsForLucidDecorator<Partial<HasManyThroughRelationOptions<RelatedModel>>>(\n options,\n [\n 'localKey',\n 'foreignKey',\n 'serializeAs',\n 'onQuery',\n 'meta',\n 'pivotTable',\n 'localKey',\n 'pivotForeignKey',\n 'relatedKey',\n 'pivotRelatedForeignKey',\n 'pivotColumns',\n 'pivotTimestamps',\n 'throughLocalKey',\n 'throughForeignKey',\n ] as any,\n overrides\n )\n}\n\nconst handleResourcefulColumn = <Schema extends AnySchema = ResourcefulPropertySchema>(config: {\n decoratorName: string\n target: any\n propertyKey: string\n decoratorOption: Partial<ResourcefulColumnDefinition<Schema>>\n decoratorOptionsValidationSchema: ObjectSchema\n lucidDecoratorFunction: typeof lucidColumn | DateColumnDecorator | DateTimeColumnDecorator\n overrides?: Partial<ColumnOptions>\n defaultPrepare?: DefaultPrepareFunction\n defaultConsume?: DefaultConsumeFunction\n}) => {\n const {\n decoratorName,\n target,\n propertyKey,\n decoratorOption,\n decoratorOptionsValidationSchema,\n overrides = {},\n lucidDecoratorFunction,\n defaultPrepare,\n defaultConsume,\n } = config\n\n const opts = validateNormalizeAndCastDecoratorOptions<\n Partial<ResourcefulColumnDefinition<Schema>>,\n ResourcefulColumnDefinition<Schema>\n >(propertyKey, decoratorName, decoratorOptionsValidationSchema, {\n ...decoratorOption,\n propertyKey,\n })\n const customPrepare = opts.prepare\n const customConsume = opts.consume\n const nullable = opts.nullable || false\n\n // Create chained functions using PrepareConsumeChainBuilder\n const chainedPrepare = PrepareConsumeChainBuilder.chainPrepare(\n propertyKey,\n nullable,\n defaultPrepare,\n customPrepare\n )\n const chainedConsume = PrepareConsumeChainBuilder.chainConsume(\n propertyKey,\n nullable,\n defaultConsume,\n customConsume\n )\n\n // Merge DataTypeColumnOptions for Lucid, excluding prepare/consume from opts\n const lucidOptions = extractLucidOptionsForLucidColumnDecorator(\n opts as unknown as Partial<ColumnOptions>,\n {\n ...overrides,\n ...(chainedPrepare && { prepare: chainedPrepare }),\n ...(chainedConsume && { consume: chainedConsume }),\n }\n )\n\n lucidDecoratorFunction(lucidOptions)(target, propertyKey)\n\n const map = ensureOwnResourcefulMap(target, '$resourcefulColumns')\n map.set(propertyKey, opts)\n}\n\nconst handleResourcefulComputed = <Schema extends AnySchema = ResourcefulPropertySchema>(config: {\n decoratorName: string\n target: any\n propertyKey: string\n decoratorOption: Partial<ResourcefulComputedAccessorDefinition<Schema>>\n decoratorOptionsValidationSchema: ObjectSchema\n}) => {\n const { decoratorName, target, propertyKey, decoratorOption, decoratorOptionsValidationSchema } =\n config\n const opts = validateNormalizeAndCastDecoratorOptions<\n Partial<ResourcefulComputedAccessorDefinition<Schema>>,\n ResourcefulComputedAccessorDefinition<Schema>\n >(propertyKey, decoratorName, decoratorOptionsValidationSchema, {\n ...decoratorOption,\n propertyKey,\n })\n // Merge DataTypeComputedOptions for Lucid\n const lucidOptions = extractLucidOptionsForLucidComputedDecorator(\n opts as unknown as Partial<ComputedOptions>\n )\n\n lucidComputed(lucidOptions)(target, propertyKey)\n\n const map = ensureOwnResourcefulMap(target, '$resourcefulComputedAccessors')\n map.set(propertyKey, opts)\n}\n\nfunction ensureOwnResourcefulMap(target: any, mapKey: string) {\n const ctor = target.constructor\n if (!Object.prototype.hasOwnProperty.call(ctor, mapKey)) {\n ctor[mapKey] = new Map()\n }\n return ctor[mapKey]\n}\n\nexport type DataTypeColumnOptions = Omit<ColumnOptions, 'prepare' | 'consume'>\n\nexport type DataTypeComputedOptions = Omit<ComputedOptions, 'prepare' | 'consume'>\n\n/**\n * Decorator to define a resourceful column on a Lucid model property.\n * Applies validation, metadata, and Lucid column options.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulStringType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn({ type: ResourcefulStringType({ minLength: 1, maxLength: 100 }), nullable: false })\n * public name: string\n * }\n * ```\n *\n * @param options - Resourceful column options and Lucid column options.\n * @returns Property decorator function.\n */\nexport function resourcefulColumn<Schema extends AnySchema = ResourcefulPropertySchema>(\n options: Partial<ColumnOptions> & Partial<ResourcefulColumnDefinition<Schema>> = {}\n) {\n const decoratorName = 'resourcefulColumn'\n const decoratorOptionsValidationSchema = resourcefulColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<\n ValidatorInput<Schema>,\n ValidatorOutnput<Schema>\n >(propertyKey, decoratorName, decoratorOptionsValidationSchema, { ...options, propertyKey })\n const lucidOptions = extractLucidOptionsForLucidColumnDecorator(opts)\n\n lucidColumn(lucidOptions)(target, propertyKey)\n\n const map = ensureOwnResourcefulMap(target, '$resourcefulColumns')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful string column on a Lucid model property.\n * Includes prepare and consume functions for string type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulStringType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.string({ type: ResourcefulStringType({ minLength: 3 }), nullable: false })\n * public email: string\n * }\n * ```\n *\n * @param options - Resourceful string column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.string = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<StringSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.string'\n const decoratorOptionsValidationSchema = stringColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareString as DefaultPrepareFunction,\n defaultConsume: consumeString as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful date column on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulDateType } from '@nhtio/lucid-resourceful'\n *\n * class Event {\n * @resourcefulColumn.date({ type: ResourcefulDateType(), autoCreate: true, autoUpdate: false })\n * public startDate: Date\n * }\n * ```\n *\n * @param options - Resourceful date column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.date = function (\n options: Partial<DateColumnOptions> & Partial<ResourcefulColumnDefinition<DateSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.date'\n const decoratorOptionsValidationSchema = dateColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn.date,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful dateTime column on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulDateTimeType } from '@nhtio/lucid-resourceful'\n *\n * class Event {\n * @resourcefulColumn.dateTime({ type: ResourcefulDateTimeType(), autoCreate: true, autoUpdate: true })\n * public updatedAt: Date\n * }\n * ```\n *\n * @param options - Resourceful dateTime column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.dateTime = function (\n options: Partial<DateColumnOptions> & Partial<ResourcefulColumnDefinition<DateSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.dateTime'\n const decoratorOptionsValidationSchema = dateTimeColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn.dateTime,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful binary column on a Lucid model property.\n * Includes prepare and consume functions for binary type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulBinaryType } from '@nhtio/lucid-resourceful'\n *\n * class File {\n * @resourcefulColumn.binary({ type: ResourcefulBinaryType(), nullable: true })\n * public data: Buffer\n * }\n * ```\n *\n * @param options - Resourceful binary column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.binary = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<BinarySchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.binary'\n const decoratorOptionsValidationSchema = binaryColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareBinary as DefaultPrepareFunction,\n defaultConsume: consumeBinary as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful number column on a Lucid model property.\n * Includes prepare and consume functions for number type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulNumberType } from '@nhtio/lucid-resourceful'\n *\n * class Product {\n * @resourcefulColumn.number({ type: ResourcefulNumberType(), nullable: false })\n * public price: number\n * }\n * ```\n *\n * @param options - Resourceful number column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.number = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.number'\n const decoratorOptionsValidationSchema = numberColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareNumber as DefaultPrepareFunction,\n defaultConsume: consumeNumber as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful integer column on a Lucid model property.\n * Includes prepare and consume functions for integer type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulIntegerType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.integer({ type: ResourcefulIntegerType(), nullable: false })\n * public age: number\n * }\n * ```\n *\n * @param options - Resourceful integer column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.integer = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.integer'\n const decoratorOptionsValidationSchema = integerColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareInteger as DefaultPrepareFunction,\n defaultConsume: consumeInteger as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful bigint column on a Lucid model property.\n * Includes prepare and consume functions for bigint type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulBigintType } from '@nhtio/lucid-resourceful'\n *\n * class Transaction {\n * @resourcefulColumn.bigint({ type: ResourcefulBigintType(), nullable: false })\n * public bigValue: bigint\n * }\n * ```\n *\n * @param options - Resourceful bigint column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.bigint = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.bigint'\n const decoratorOptionsValidationSchema = bigintColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareBigint as DefaultPrepareFunction,\n defaultConsume: consumeBigint as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful unsigned integer column on a Lucid model property.\n * Includes prepare and consume functions for unsigned integer type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulUnsignedIntegerType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.unsignedint({ type: ResourcefulUnsignedIntegerType(), nullable: false })\n * public positiveCount: number\n * }\n * ```\n *\n * @param options - Resourceful unsigned integer column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.unsignedint = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.unsignedint'\n const decoratorOptionsValidationSchema = unsignedIntegerColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareUnsignedint as DefaultPrepareFunction,\n defaultConsume: consumeUnsignedint as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful boolean column on a Lucid model property.\n * Includes prepare and consume functions for boolean type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulBooleanType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.boolean({ type: ResourcefulBooleanType(), nullable: false })\n * public isActive: boolean\n * }\n * ```\n *\n * @param options - Resourceful boolean column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.boolean = function (\n options: Partial<DataTypeColumnOptions> & Partial<ResourcefulColumnDefinition<BooleanSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.boolean'\n const decoratorOptionsValidationSchema = booleanColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareBoolean as DefaultPrepareFunction,\n defaultConsume: consumeBoolean as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful object column on a Lucid model property.\n * Includes prepare and consume functions for object type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulObjectType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.object({ type: ResourcefulObjectType(), nullable: true })\n * public metadata: object\n * }\n * ```\n *\n * @param options - Resourceful object column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.object = function (\n options: Partial<ColumnOptions> & Partial<ResourcefulColumnDefinition<ObjectSchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.object'\n const decoratorOptionsValidationSchema = objectColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareObject as DefaultPrepareFunction,\n defaultConsume: consumeObject as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful array column on a Lucid model property.\n * Includes prepare and consume functions for array type.\n *\n * @example\n * ```ts\n * import { resourcefulColumn, ResourcefulArrayType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulColumn.array({ type: ResourcefulArrayType({ items: { type: 'string' } }), nullable: true })\n * public tags: any[]\n * }\n * ```\n *\n * @param options - Resourceful array column options.\n * @returns Property decorator function.\n */\nresourcefulColumn.array = function (\n options: Partial<ColumnOptions> & Partial<ResourcefulColumnDefinition<ArraySchema>> = {}\n) {\n const decoratorName = 'resourcefulColumn.array'\n const decoratorOptionsValidationSchema = arrayColumnOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulColumn({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n lucidDecoratorFunction: lucidColumn,\n defaultPrepare: prepareArray as DefaultPrepareFunction,\n defaultConsume: consumeArray as DefaultConsumeFunction,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful computed accessor on a Lucid model property.\n * Applies validation, metadata, and Lucid computed options.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulStringType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed({ type: ResourcefulStringType({ minLength: 1, maxLength: 100 }) })\n * public get fullName() {\n * return `${this.firstName} ${this.lastName}`\n * }\n * }\n * ```\n *\n * @param options - Resourceful computed accessor options and Lucid computed options.\n * @returns Property decorator function.\n */\nexport function resourcefulComputed<Schema extends AnySchema = ResourcefulPropertySchema>(\n options: Partial<ComputedOptions> & Partial<ResourcefulComputedAccessorDefinition<Schema>> = {}\n) {\n const decoratorName = 'resourcefulComputed'\n const decoratorOptionsValidationSchema = resourcefulComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<\n ValidatorInput<Schema>,\n ValidatorOutnput<Schema>\n >(propertyKey, decoratorName, decoratorOptionsValidationSchema, { ...options, propertyKey })\n const lucidOptions = extractLucidOptionsForLucidComputedDecorator(opts)\n\n lucidComputed(lucidOptions)(target, propertyKey)\n\n const map = ensureOwnResourcefulMap(target, '$resourcefulComputedAccessors')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful string computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulStringType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.string({ type: ResourcefulStringType({ minLength: 3 }) })\n * public get displayName() {\n * return this.name.toUpperCase()\n * }\n * }\n * ```\n *\n * @param options - Resourceful string computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.string = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<StringSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.string'\n const decoratorOptionsValidationSchema = stringComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful date computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulDateType } from '@nhtio/lucid-resourceful'\n *\n * class Event {\n * @resourcefulComputed.date({ type: ResourcefulDateType() })\n * public get eventDate() {\n * return this._eventDate\n * }\n * }\n * ```\n *\n * @param options - Resourceful date computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.date = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<DateSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.date'\n const decoratorOptionsValidationSchema = dateComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful dateTime computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulDateTimeType } from '@nhtio/lucid-resourceful'\n *\n * class Event {\n * @resourcefulComputed.dateTime({ type: ResourcefulDateTimeType() })\n * public get updatedAt() {\n * return this._updatedAt\n * }\n * }\n * ```\n *\n * @param options - Resourceful dateTime computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.dateTime = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<DateSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.dateTime'\n const decoratorOptionsValidationSchema = dateTimeComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful binary computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulBinaryType } from '@nhtio/lucid-resourceful'\n *\n * class File {\n * @resourcefulComputed.binary({ type: ResourcefulBinaryType() })\n * public get fileData() {\n * return this._fileData\n * }\n * }\n * ```\n *\n * @param options - Resourceful binary computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.binary = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<BinarySchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.binary'\n const decoratorOptionsValidationSchema = binaryComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful number computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulNumberType } from '@nhtio/lucid-resourceful'\n *\n * class Product {\n * @resourcefulComputed.number({ type: ResourcefulNumberType() })\n * public get discountedPrice() {\n * return this.price * 0.9\n * }\n * }\n * ```\n *\n * @param options - Resourceful number computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.number = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.number'\n const decoratorOptionsValidationSchema = numberComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful integer computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulIntegerType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.integer({ type: ResourcefulIntegerType() })\n * public get roundedAge() {\n * return Math.floor(this.age)\n * }\n * }\n * ```\n *\n * @param options - Resourceful integer computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.integer = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.integer'\n const decoratorOptionsValidationSchema = integerComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful bigint computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulBigintType } from '@nhtio/lucid-resourceful'\n *\n * class Transaction {\n * @resourcefulComputed.bigint({ type: ResourcefulBigintType() })\n * public get bigValue() {\n * return this._bigValue\n * }\n * }\n * ```\n *\n * @param options - Resourceful bigint computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.bigint = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.bigint'\n const decoratorOptionsValidationSchema = bigintComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful unsigned integer computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulUnsignedIntegerType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.unsignedint({ type: ResourcefulUnsignedIntegerType() })\n * public get positiveCount() {\n * return this._positiveCount\n * }\n * }\n * ```\n *\n * @param options - Resourceful unsigned integer computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.unsignedint = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<NumberSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.unsignedint'\n const decoratorOptionsValidationSchema = unsignedIntegerComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful boolean computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulBooleanType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.boolean({ type: ResourcefulBooleanType() })\n * public get isActive() {\n * return this._isActive\n * }\n * }\n * ```\n *\n * @param options - Resourceful boolean computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.boolean = function (\n options: Partial<DataTypeComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<BooleanSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.boolean'\n const decoratorOptionsValidationSchema = booleanComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful object computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulObjectType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.object({ type: ResourcefulObjectType() })\n * public get metadata() {\n * return this._metadata\n * }\n * }\n * ```\n *\n * @param options - Resourceful object computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.object = function (\n options: Partial<ComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<ObjectSchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.object'\n const decoratorOptionsValidationSchema = objectComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful array computed accessor on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulComputed, ResourcefulArrayType } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulComputed.array({ type: ResourcefulArrayType({ items: { type: 'string' } }) })\n * public get tags() {\n * return this._tags\n * }\n * }\n * ```\n *\n * @param options - Resourceful array computed accessor options.\n * @returns Property decorator function.\n */\nresourcefulComputed.array = function (\n options: Partial<ComputedOptions> &\n Partial<ResourcefulComputedAccessorDefinition<ArraySchema>> = {}\n) {\n const decoratorName = 'resourcefulComputed.array'\n const decoratorOptionsValidationSchema = arrayComputedOptionsSchema\n\n return function (target: any, propertyKey: string) {\n handleResourcefulComputed({\n decoratorName,\n target,\n propertyKey,\n decoratorOption: options,\n decoratorOptionsValidationSchema,\n })\n }\n}\n\n/**\n * Decorator to define a resourceful belongsTo relationship on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulBelongsTo } from '@nhtio/lucid-resourceful'\n *\n * class Post {\n * @resourcefulBelongsTo(() => User, { foreignKey: 'user_id' })\n * public user: User\n * }\n * ```\n *\n * @param model - Function returning the related model class.\n * @param options - Relationship options and resourceful relationship definition.\n * @returns Property decorator function.\n */\nexport function resourcefulBelongsTo<RelatedModel extends LucidModel>(\n model: () => RelatedModel,\n options: Partial<RelationOptions<RelatedModel, LucidModel, HasOne<RelatedModel, LucidModel>>> &\n Partial<ResourcefulRelationshipDefinition> = {}\n) {\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<any, any>(\n propertyKey,\n 'resourcefulBelongsTo',\n relationOptionsSchema,\n { ...options, propertyKey, relatedModel: model }\n )\n const lucidOptions = extractLucidOptionsForLucidRelatedModelDecorator(opts)\n lucidBelongsTo(model, lucidOptions as any)(target, propertyKey)\n const map = ensureOwnResourcefulMap(target, '$resourcefulRelationships')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful hasOne relationship on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulHasOne } from '@nhtio/lucid-resourceful'\n *\n * class UserProfile {\n * @resourcefulHasOne(() => User, { foreignKey: 'user_id' })\n * public user: UserProfile\n * }\n * ```\n *\n * @param model - Function returning the related model class.\n * @param options - Relationship options and resourceful relationship definition.\n * @returns Property decorator function.\n */\nexport function resourcefulHasOne<RelatedModel extends LucidModel>(\n model: () => RelatedModel,\n options: Partial<RelationOptions<RelatedModel, LucidModel, HasOne<RelatedModel, LucidModel>>> &\n Partial<ResourcefulRelationshipDefinition> = {}\n) {\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<any, any>(\n propertyKey,\n 'resourcefulHasOne',\n relationOptionsSchema,\n { ...options, propertyKey, relatedModel: model }\n )\n const lucidOptions = extractLucidOptionsForLucidRelatedModelDecorator(opts)\n lucidHasOne(model, lucidOptions as any)(target, propertyKey)\n const map = ensureOwnResourcefulMap(target, '$resourcefulRelationships')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful hasMany relationship on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulHasMany } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulHasMany(() => Post, { foreignKey: 'user_id' })\n * public posts: HasMany<typeof Post>\n * }\n * ```\n *\n * @param model - Function returning the related model class.\n * @param options - Relationship options and resourceful relationship definition.\n * @returns Property decorator function.\n */\nexport function resourcefulHasMany<RelatedModel extends LucidModel>(\n model: () => RelatedModel,\n options: Partial<RelationOptions<RelatedModel, LucidModel, HasOne<RelatedModel, LucidModel>>> &\n Partial<ResourcefulRelationshipDefinition> = {}\n) {\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<any, any>(\n propertyKey,\n 'resourcefulHasMany',\n relationOptionsSchema,\n { ...options, propertyKey, relatedModel: model }\n )\n const lucidOptions = extractLucidOptionsForLucidRelatedModelDecorator(opts)\n lucidHasMany(model, lucidOptions as any)(target, propertyKey)\n const map = ensureOwnResourcefulMap(target, '$resourcefulRelationships')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful manyToMany relationship on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulManyToMany } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulManyToMany(() => Role, { pivotTable: 'role_user' })\n * public roles: ManyToMany<typeof Role>\n * }\n * ```\n *\n * @param model - Function returning the related model class.\n * @param options - ManyToMany relationship options and resourceful relationship definition.\n * @returns Property decorator function.\n */\nexport function resourcefulManyToMany<RelatedModel extends LucidModel>(\n model: () => RelatedModel,\n options: Partial<ManyToManyRelationOptions<ManyToMany<RelatedModel>>> &\n Partial<ResourcefulRelationshipDefinition> = {}\n) {\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<any, any>(\n propertyKey,\n 'resourcefulManyToMany',\n manyToManyRelationOptionsSchema,\n { ...options, propertyKey, relatedModel: model }\n )\n const lucidOptions = extractLucidOptionsForLucidRelatedModelDecorator(opts)\n lucidManyToMany(model, lucidOptions as any)(target, propertyKey)\n const map = ensureOwnResourcefulMap(target, '$resourcefulRelationships')\n map.set(propertyKey, opts)\n }\n}\n\n/**\n * Decorator to define a resourceful hasManyThrough relationship on a Lucid model property.\n *\n * @example\n * ```ts\n * import { resourcefulHasManyThrough } from '@nhtio/lucid-resourceful'\n *\n * class User {\n * @resourcefulHasManyThrough([\n * () => Role,\n * () => UserRolePivot\n * ], { foreignKey: 'user_id' })\n * public roles: HasManyThrough<typeof Role>\n * }\n * ```\n *\n * @param model - Tuple of functions returning the related model and through model classes.\n * @param options - HasManyThrough relationship options and resourceful relationship definition.\n * @returns Property decorator function.\n */\nexport function resourcefulHasManyThrough<RelatedModel extends LucidModel>(\n model: [() => RelatedModel, () => LucidModel],\n options: Partial<HasManyThroughRelationOptions<RelatedModel>> &\n Partial<ResourcefulRelationshipDefinition> = {}\n) {\n return function (target: any, propertyKey: string) {\n const opts = validateNormalizeAndCastDecoratorOptions<any, any>(\n propertyKey,\n 'resourcefulHasManyThrough',\n hasManyThroughRelationOptionsSchema,\n { ...options, propertyKey, relatedModel: model[0] }\n )\n const lucidOptions = extractLucidOptionsForLucidHasManyThroughDecorator(opts)\n lucidHasManyThrough(model, lucidOptions as any)(target, propertyKey)\n const map = ensureOwnResourcefulMap(target, '$resourcefulRelationships')\n map.set(propertyKey, opts)\n }\n}\n","/**\n * A decorator-driven AdonisJS library that lets you annotate Lucid ORM models with metadata to automatically generate CRUD controllers, validation rules, OpenAPI schemas, and a unified query interface.\n * @module @nhtio/lucid-resourceful\n */\n\n/**\n * The current version of the package.\n *\n * @tip This is a constant that is replaced during the build process with the actual version of the package.\n */\nexport const version = __VERSION__\n\nexport { withResourceful } from './private/mixin'\nexport {\n resourcefulColumn,\n resourcefulComputed,\n resourcefulBelongsTo,\n resourcefulHasOne,\n resourcefulHasMany,\n resourcefulManyToMany,\n resourcefulHasManyThrough,\n} from './private/decorators'\nexport * as errors from '@nhtio/lucid-resourceful/errors'\nexport * as definitions from '@nhtio/lucid-resourceful/definitions'\n"],"names":["index","error","column","parse","SyntaxError","isString","joi","ensureOwnResourcefulMap","TypedEventEmitter","guards.isObject","helpers.stripUndefinedValuesFromObject","guards.isResourcefulModel","ref","_a","errors.E_INVALID_DATE_COLUMN_VALUE","errors.E_UNDEFINED_RELATIONSHIP","debug","errors.E_MISSING_MODEL_ATTRIBUTE","a","equal","errors.E_RUNTIME_EXCEPTION","$replace","$concat","require$$0","has","isArray","inspect","isRegExp","global","hasOwn","l","n","type","k","$TypeError","require$$1","abs","floor","max","min","pow","round","isNaN","sign","$gOPD","$defineProperty","hasSymbols","$Object","toStr","concatty","slicy","bind","Empty","implementation","$apply","$call","require$$2","require$$3","gOPD","getProto","undefined","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21","require$$22","doEval","require$$23","require$$24","stringToPath","quote","getBaseIntrinsic","GetIntrinsic","callBindBasic","callBound","getSideChannelMap","getSideChannelList","getSideChannelWeakMap","formats","compactQueue","arrayToObject","merge","encode","compact","isBuffer","combine","maybeMap","utils","getSideChannel","defaults","isNonNullishPrimitive","stringify","serializeDate","sideChannel","value","normalizeStringifyOptions","limit","brackets","normalizeParseOptions","string","errors.E_ROW_NOT_FOUND","client","computed","errors.E_MODEL_DELETED","lucidComputed","lucidColumn","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SAAS,0BACd,OACA,UAC+C,IAC/C;AACA,SAAO,SAAU,QAAa,aAAqB;AACjD,UAAM,OAAO;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA,EAAE,GAAG,SAAS,aAAa,cAAc,MAAM,CAAC,EAAA;AAAA,IAAE;AAEpD,UAAM,eAAe,mDAAmD,IAAI;AAC5EC,mBAAoB,OAAO,YAAmB,EAAE,QAAQ,WAAW;AACnE,UAAM,MAAM,wBAAwB,QAAQ,2BAA2B;AACvE,QAAI,IAAI,aAAa,IAAI;AAAA,EAC3B;AACF;ACj6CO,MAAM,UAAU;","x_google_ignoreList":[1,3,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99]}
|