@codenameryuu/adonis-lucid-filter 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/package.json +2 -17
- package/build/chunk-V7FYZD4D.js +0 -15
- package/build/chunk-V7FYZD4D.js.map +0 -1
- package/build/chunk-WD7GE7Y7.js +0 -9
- package/build/chunk-WD7GE7Y7.js.map +0 -1
- package/build/chunk-XUS63JTZ.js +0 -18
- package/build/chunk-XUS63JTZ.js.map +0 -1
- package/build/commands/make_filter.js +0 -29
- package/build/commands/make_filter.js.map +0 -1
- package/build/index.js +0 -111
- package/build/index.js.map +0 -1
- package/build/providers/lucid_filter_provider.js +0 -19
- package/build/providers/lucid_filter_provider.js.map +0 -1
- package/build/src/bindings/model_query_builder.js +0 -8
- package/build/src/bindings/model_query_builder.js.map +0 -1
- package/build/src/types/filter.js +0 -1
- package/build/src/types/filter.js.map +0 -1
- package/build/src/types/querybuilder.js +0 -1
- package/build/src/types/querybuilder.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ This addon adds the functionality to filter Lucid Models Adonis JS 7. Inspired b
|
|
|
6
6
|
|
|
7
7
|
Example, we want to return a list of users filtered by multiple parameters. When we navigate to:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
`/users?name=Tony&lastName=&companyId=2&industry=5`
|
|
10
10
|
|
|
11
11
|
`request.all()` or `request.qs()` will return:
|
|
12
12
|
|
|
@@ -59,13 +59,13 @@ export default class UsersController {
|
|
|
59
59
|
|
|
60
60
|
## Installation
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
- Install the package
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
65
|
yarn add @codenameryuu/adonis-lucid-filter
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
- Configure the package
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
71
|
node ace configure @codenameryuu/adonis-lucid-filter
|
|
@@ -73,7 +73,7 @@ node ace configure @codenameryuu/adonis-lucid-filter
|
|
|
73
73
|
|
|
74
74
|
## Usage
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
- Register the provider and commands inside `adonisrc.ts` file.
|
|
77
77
|
|
|
78
78
|
```typescript
|
|
79
79
|
providers: [
|
|
@@ -102,13 +102,13 @@ Where `user` is the Lucid Model you are creating the filter for. This will creat
|
|
|
102
102
|
|
|
103
103
|
Define the filter logic based on the camel cased input key passed to the `filter()` method.
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
- Empty strings are ignored
|
|
106
|
+
- `setup()` will be called regardless of input
|
|
107
|
+
- `_id` is dropped from the end of the input to define the method so filtering `user_id` would use the `user()` method
|
|
108
|
+
- Input without a corresponding filter method are ignored
|
|
109
|
+
- The value of the key is injected into the method
|
|
110
|
+
- All values are accessible through the `this.$input` a property
|
|
111
|
+
- All QueryBuilder methods are accessible in `this.$query` object in the model filter class.
|
|
112
112
|
|
|
113
113
|
To define methods for the following input:
|
|
114
114
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codenameryuu/adonis-lucid-filter",
|
|
3
3
|
"description": "Addon for filtering Adonis JS 7 Lucid ORM",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.8.0",
|
|
5
5
|
"author": "codenameryuu",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/codenameryuu/adonis-lucid-filter#readme",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"format": "prettier --write .",
|
|
31
31
|
"clean": "del-cli build",
|
|
32
32
|
"precompile": "npm run lint && npm run clean",
|
|
33
|
-
"compile": "
|
|
33
|
+
"compile": "tsc --emitDeclarationOnly --declaration",
|
|
34
34
|
"build": "npm run compile",
|
|
35
35
|
"pretest": "npm run lint",
|
|
36
36
|
"test": "c8 npm run quick:test",
|
|
@@ -107,20 +107,5 @@
|
|
|
107
107
|
"tests/**",
|
|
108
108
|
"bin/**"
|
|
109
109
|
]
|
|
110
|
-
},
|
|
111
|
-
"tsup": {
|
|
112
|
-
"entry": [
|
|
113
|
-
"./index.ts",
|
|
114
|
-
"./src/types/*.ts",
|
|
115
|
-
"./src/bindings/model_query_builder.ts",
|
|
116
|
-
"./commands/make_filter.ts",
|
|
117
|
-
"./providers/lucid_filter_provider.ts"
|
|
118
|
-
],
|
|
119
|
-
"outDir": "./build",
|
|
120
|
-
"clean": true,
|
|
121
|
-
"format": "esm",
|
|
122
|
-
"dts": false,
|
|
123
|
-
"sourcemap": true,
|
|
124
|
-
"target": "esnext"
|
|
125
110
|
}
|
|
126
111
|
}
|
package/build/chunk-V7FYZD4D.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// src/bindings/model_query_builder.ts
|
|
2
|
-
function extendModelQueryBuilder(builder) {
|
|
3
|
-
builder.macro(
|
|
4
|
-
"filter",
|
|
5
|
-
function(input, filter) {
|
|
6
|
-
const Filter = filter || this.model.$filter();
|
|
7
|
-
return new Filter(this, input).handle();
|
|
8
|
-
}
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
extendModelQueryBuilder
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=chunk-V7FYZD4D.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bindings/model_query_builder.ts"],"sourcesContent":["/*\n * adonis-lucid-filter\n *\n * (c) Lookin Anton <alf@lookinlab.ru>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport type { ModelQueryBuilder } from '@adonisjs/lucid/orm'\nimport type { LucidFilterContract } from '@codenameryuu/adonis-lucid-filter/types/filter'\n\n/**\n * Define filter method to ModelQueryBuilder\n */\nexport function extendModelQueryBuilder(builder: any) {\n builder.macro(\n 'filter',\n function (this: ModelQueryBuilder, input: any, filter?: LucidFilterContract) {\n const Filter = filter || (this.model as any).$filter()\n return new Filter(this, input).handle()\n }\n )\n}\n"],"mappings":";AAeO,SAAS,wBAAwB,SAAc;AACpD,UAAQ;AAAA,IACN;AAAA,IACA,SAAmC,OAAY,QAA8B;AAC3E,YAAM,SAAS,UAAW,KAAK,MAAc,QAAQ;AACrD,aAAO,IAAI,OAAO,MAAM,KAAK,EAAE,OAAO;AAAA,IACxC;AAAA,EACF;AACF;","names":[]}
|
package/build/chunk-WD7GE7Y7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../stubs/main.ts"],"sourcesContent":["/*\n * adonis-lucid-filter\n *\n * (c) Lookin Anton <alf@lookinlab.ru>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { fileURLToPath } from 'node:url'\nimport { dirname } from 'node:path'\n\nexport const stubsRoot = dirname(fileURLToPath(import.meta.url))\n"],"mappings":";AASA,SAAS,qBAAqB;AAC9B,SAAS,eAAe;AAEjB,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;","names":[]}
|
package/build/chunk-XUS63JTZ.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
-
if (decorator = decorators[i])
|
|
8
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9
|
-
if (kind && result) __defProp(target, key, result);
|
|
10
|
-
return result;
|
|
11
|
-
};
|
|
12
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
__decorateClass,
|
|
16
|
-
__publicField
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=chunk-XUS63JTZ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
stubsRoot
|
|
3
|
-
} from "../chunk-WD7GE7Y7.js";
|
|
4
|
-
import {
|
|
5
|
-
__decorateClass
|
|
6
|
-
} from "../chunk-XUS63JTZ.js";
|
|
7
|
-
|
|
8
|
-
// commands/make_filter.ts
|
|
9
|
-
import { BaseCommand, args } from "@adonisjs/core/ace";
|
|
10
|
-
var MakeFilter = class extends BaseCommand {
|
|
11
|
-
static commandName = "make:filter";
|
|
12
|
-
static description = "Make a new Lucid filter";
|
|
13
|
-
/**
|
|
14
|
-
* Run command
|
|
15
|
-
*/
|
|
16
|
-
async run() {
|
|
17
|
-
const codemods = await this.createCodemods();
|
|
18
|
-
await codemods.makeUsingStub(stubsRoot, "make/filter/main.stub", {
|
|
19
|
-
name: this.name
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
__decorateClass([
|
|
24
|
-
args.string({ description: "Name of the model file" })
|
|
25
|
-
], MakeFilter.prototype, "name", 2);
|
|
26
|
-
export {
|
|
27
|
-
MakeFilter as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=make_filter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../commands/make_filter.ts"],"sourcesContent":["/*\n * adonis-lucid-filter\n *\n * (c) Lookin Anton <alf@lookinlab.ru>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { BaseCommand, args } from '@adonisjs/core/ace'\nimport { stubsRoot } from '../stubs/main.js'\n\nexport default class MakeFilter extends BaseCommand {\n static commandName = 'make:filter'\n static description = 'Make a new Lucid filter'\n\n /**\n * The name of the model file.\n */\n @args.string({ description: 'Name of the model file' })\n declare name: string\n\n /**\n * Run command\n */\n async run(): Promise<void> {\n const codemods = await this.createCodemods()\n\n await codemods.makeUsingStub(stubsRoot, 'make/filter/main.stub', {\n name: this.name,\n })\n }\n}\n"],"mappings":";;;;;;;;AASA,SAAS,aAAa,YAAY;AAGlC,IAAqB,aAArB,cAAwC,YAAY;AAAA,EAClD,OAAO,cAAc;AAAA,EACrB,OAAO,cAAc;AAAA;AAAA;AAAA;AAAA,EAWrB,MAAM,MAAqB;AACzB,UAAM,WAAW,MAAM,KAAK,eAAe;AAE3C,UAAM,SAAS,cAAc,WAAW,yBAAyB;AAAA,MAC/D,MAAM,KAAK;AAAA,IACb,CAAC;AAAA,EACH;AACF;AAZU;AAAA,EADP,KAAK,OAAO,EAAE,aAAa,yBAAyB,CAAC;AAAA,GAPnC,WAQX;","names":[]}
|
package/build/index.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
stubsRoot
|
|
3
|
-
} from "./chunk-WD7GE7Y7.js";
|
|
4
|
-
import {
|
|
5
|
-
__decorateClass,
|
|
6
|
-
__publicField
|
|
7
|
-
} from "./chunk-XUS63JTZ.js";
|
|
8
|
-
|
|
9
|
-
// configure.ts
|
|
10
|
-
async function configure(command) {
|
|
11
|
-
const codemods = await command.createCodemods();
|
|
12
|
-
await codemods.updateRcFile((rcFile) => {
|
|
13
|
-
rcFile.addProvider("@codenameryuu/adonis-lucid-filter/provider");
|
|
14
|
-
rcFile.addCommand("@codenameryuu/adonis-lucid-filter/commands");
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// src/base_model.ts
|
|
19
|
-
import camelCase from "lodash/camelCase.js";
|
|
20
|
-
function StaticImplements() {
|
|
21
|
-
return (_t) => {
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
var BaseModelFilter = class {
|
|
25
|
-
constructor($query, $input) {
|
|
26
|
-
this.$query = $query;
|
|
27
|
-
this.$input = $input;
|
|
28
|
-
this.$input = BaseModelFilter.removeEmptyInput(this.$input);
|
|
29
|
-
this.$blacklist = this.constructor.blacklist;
|
|
30
|
-
}
|
|
31
|
-
handle() {
|
|
32
|
-
if (this.setup && typeof this.setup === "function") {
|
|
33
|
-
this.setup(this.$query);
|
|
34
|
-
}
|
|
35
|
-
this.$filterByInput();
|
|
36
|
-
return this.$query;
|
|
37
|
-
}
|
|
38
|
-
whitelistMethod(method) {
|
|
39
|
-
const index = this.$blacklist.indexOf(method);
|
|
40
|
-
const isBlacklisted = index !== -1;
|
|
41
|
-
if (isBlacklisted) this.$blacklist.splice(index, 1);
|
|
42
|
-
return isBlacklisted;
|
|
43
|
-
}
|
|
44
|
-
$filterByInput() {
|
|
45
|
-
for (const key in this.$input) {
|
|
46
|
-
const method = this.$getFilterMethod(key);
|
|
47
|
-
const keyName = key;
|
|
48
|
-
const value = this.$input[keyName];
|
|
49
|
-
if (this.$methodIsCallable(method)) {
|
|
50
|
-
;
|
|
51
|
-
this[method](value);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
$getFilterMethod(key) {
|
|
56
|
-
const methodName = this.constructor.dropId ? key.replace(/^(.*)(_id|Id)$/, "$1") : key;
|
|
57
|
-
return this.constructor.camelCase ? camelCase(methodName) : methodName;
|
|
58
|
-
}
|
|
59
|
-
static removeEmptyInput(input) {
|
|
60
|
-
const filteredInput = {};
|
|
61
|
-
for (const key in input) {
|
|
62
|
-
const keyName = key;
|
|
63
|
-
const value = input[keyName];
|
|
64
|
-
if (value !== "" && value !== null && value !== void 0) {
|
|
65
|
-
filteredInput[keyName] = value;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return filteredInput;
|
|
69
|
-
}
|
|
70
|
-
$methodIsCallable(method) {
|
|
71
|
-
const methodKey = method;
|
|
72
|
-
return !!this[methodKey] && typeof this[methodKey] === "function" && !this.$methodIsBlacklisted(method);
|
|
73
|
-
}
|
|
74
|
-
$methodIsBlacklisted(method) {
|
|
75
|
-
return this.$blacklist.includes(method);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
__publicField(BaseModelFilter, "blacklist", []);
|
|
79
|
-
__publicField(BaseModelFilter, "dropId", true);
|
|
80
|
-
__publicField(BaseModelFilter, "camelCase", true);
|
|
81
|
-
BaseModelFilter = __decorateClass([
|
|
82
|
-
StaticImplements()
|
|
83
|
-
], BaseModelFilter);
|
|
84
|
-
|
|
85
|
-
// src/mixin.ts
|
|
86
|
-
var Filterable = (superclass) => {
|
|
87
|
-
class FilterableModel extends superclass {
|
|
88
|
-
/**
|
|
89
|
-
* Filter method of filterable model
|
|
90
|
-
*/
|
|
91
|
-
static filter(input, filter) {
|
|
92
|
-
const Filter = filter || this.$filter();
|
|
93
|
-
return new Filter(this.query(), input).handle();
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Filtration scope of filterable model
|
|
97
|
-
*/
|
|
98
|
-
static filtration = function(query, input, filter) {
|
|
99
|
-
const Filter = filter || this.$filter();
|
|
100
|
-
return new Filter(query, input).handle();
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
return FilterableModel;
|
|
104
|
-
};
|
|
105
|
-
export {
|
|
106
|
-
BaseModelFilter,
|
|
107
|
-
Filterable,
|
|
108
|
-
configure,
|
|
109
|
-
stubsRoot
|
|
110
|
-
};
|
|
111
|
-
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../configure.ts","../src/base_model.ts","../src/mixin.ts"],"sourcesContent":["/*\n * adonis-lucid-filter\n *\n * (c) Lookin Anton <alf@lookinlab.ru>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport type Configure from '@adonisjs/core/commands/configure'\n\nexport async function configure(command: Configure) {\n const codemods = await command.createCodemods()\n\n await codemods.updateRcFile((rcFile) => {\n rcFile.addProvider('@codenameryuu/adonis-lucid-filter/provider')\n rcFile.addCommand('@codenameryuu/adonis-lucid-filter/commands')\n })\n}\n","/*\n * adonis-lucid-filter\n *\n * (c) Lookin Anton <alf@lookinlab.ru>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport camelCase from 'lodash/camelCase.js'\nimport type { LucidFilter, LucidFilterContract } from './types/filter.js'\n\nfunction StaticImplements<T>() {\n return (_t: T) => {}\n}\n\n/**\n * Class to filtering AdonisJS Lucid ORM\n *\n * @class BaseModelFilter\n * @constructor\n */\n@StaticImplements<LucidFilterContract>()\nexport class BaseModelFilter implements LucidFilter {\n declare ['constructor']: typeof BaseModelFilter\n declare $blacklist: string[]\n\n static blacklist: string[] = []\n static dropId: boolean = true\n static camelCase: boolean = true\n\n setup?($query: any): void\n\n constructor(\n public $query: any,\n public $input: object\n ) {\n this.$input = BaseModelFilter.removeEmptyInput(this.$input)\n this.$blacklist = this.constructor.blacklist\n }\n\n handle(): any {\n if (this.setup && typeof this.setup === 'function') {\n this.setup(this.$query)\n }\n this.$filterByInput()\n\n return this.$query\n }\n\n whitelistMethod(method: string): boolean {\n const index = this.$blacklist.indexOf(method)\n\n const isBlacklisted = index !== -1\n if (isBlacklisted) this.$blacklist.splice(index, 1)\n\n return isBlacklisted\n }\n\n $filterByInput(): void {\n for (const key in this.$input) {\n const method = this.$getFilterMethod(key)\n\n const keyName = key as keyof typeof this.$input\n const value: unknown = this.$input[keyName]\n\n if (this.$methodIsCallable(method)) {\n ;(this[method as keyof this] as Function)(value)\n }\n }\n }\n\n $getFilterMethod(key: string): string {\n const methodName = this.constructor.dropId ? key.replace(/^(.*)(_id|Id)$/, '$1') : key\n return this.constructor.camelCase ? camelCase(methodName) : methodName\n }\n\n static removeEmptyInput(input: object): object {\n const filteredInput = {}\n\n for (const key in input) {\n const keyName = key as keyof typeof input\n const value = input[keyName]\n\n if (value !== '' && value !== null && value !== undefined) {\n filteredInput[keyName] = value\n }\n }\n return filteredInput\n }\n\n $methodIsCallable(method: string): boolean {\n const methodKey = method as keyof this\n\n return (\n !!this[methodKey] &&\n typeof this[methodKey] === 'function' &&\n !this.$methodIsBlacklisted(method)\n )\n }\n\n $methodIsBlacklisted(method: string): boolean {\n return this.$blacklist.includes(method)\n }\n}\nexport default BaseModelFilter\n","/*\n * adonis-lucid-filter\n *\n * (c) Lookin Anton <alf@lookinlab.ru>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport type { NormalizeConstructor } from '@adonisjs/core/types/helpers'\nimport type { BaseModel } from '@adonisjs/lucid/orm'\nimport type {\n InputObject,\n LucidFilterContract,\n} from '@codenameryuu/adonis-lucid-filter/types/filter'\nimport type {\n ModelQueryBuilderContract,\n QueryScope,\n QueryScopeCallback,\n} from '@adonisjs/lucid/types/model'\n\nexport const Filterable = <Model extends NormalizeConstructor<typeof BaseModel>>(\n superclass: Model\n) => {\n class FilterableModel extends superclass {\n declare static $filter: () => LucidFilterContract\n\n /**\n * Filter method of filterable model\n */\n static filter<\n T extends typeof FilterableModel,\n Filter extends LucidFilterContract = ReturnType<T['$filter']>,\n >(\n this: T,\n input: InputObject<InstanceType<Filter>>,\n filter?: Filter\n ): ModelQueryBuilderContract<T> {\n const Filter = filter || this.$filter()\n return new Filter(this.query(), input).handle()\n }\n\n /**\n * Filtration scope of filterable model\n */\n static filtration = function (\n this: typeof FilterableModel,\n query,\n input,\n filter?: LucidFilterContract\n ) {\n const Filter = filter || this.$filter()\n return new Filter(query, input).handle()\n } as QueryScope<Model, QueryScopeCallback>\n }\n return FilterableModel\n}\n"],"mappings":";;;;;;;;;AAWA,eAAsB,UAAU,SAAoB;AAClD,QAAM,WAAW,MAAM,QAAQ,eAAe;AAE9C,QAAM,SAAS,aAAa,CAAC,WAAW;AACtC,WAAO,YAAY,4CAA4C;AAC/D,WAAO,WAAW,4CAA4C;AAAA,EAChE,CAAC;AACH;;;ACTA,OAAO,eAAe;AAGtB,SAAS,mBAAsB;AAC7B,SAAO,CAAC,OAAU;AAAA,EAAC;AACrB;AASO,IAAM,kBAAN,MAA6C;AAAA,EAUlD,YACS,QACA,QACP;AAFO;AACA;AAEP,SAAK,SAAS,gBAAgB,iBAAiB,KAAK,MAAM;AAC1D,SAAK,aAAa,KAAK,YAAY;AAAA,EACrC;AAAA,EAEA,SAAc;AACZ,QAAI,KAAK,SAAS,OAAO,KAAK,UAAU,YAAY;AAClD,WAAK,MAAM,KAAK,MAAM;AAAA,IACxB;AACA,SAAK,eAAe;AAEpB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,gBAAgB,QAAyB;AACvC,UAAM,QAAQ,KAAK,WAAW,QAAQ,MAAM;AAE5C,UAAM,gBAAgB,UAAU;AAChC,QAAI,cAAe,MAAK,WAAW,OAAO,OAAO,CAAC;AAElD,WAAO;AAAA,EACT;AAAA,EAEA,iBAAuB;AACrB,eAAW,OAAO,KAAK,QAAQ;AAC7B,YAAM,SAAS,KAAK,iBAAiB,GAAG;AAExC,YAAM,UAAU;AAChB,YAAM,QAAiB,KAAK,OAAO,OAAO;AAE1C,UAAI,KAAK,kBAAkB,MAAM,GAAG;AAClC;AAAC,QAAC,KAAK,MAAoB,EAAe,KAAK;AAAA,MACjD;AAAA,IACF;AAAA,EACF;AAAA,EAEA,iBAAiB,KAAqB;AACpC,UAAM,aAAa,KAAK,YAAY,SAAS,IAAI,QAAQ,kBAAkB,IAAI,IAAI;AACnF,WAAO,KAAK,YAAY,YAAY,UAAU,UAAU,IAAI;AAAA,EAC9D;AAAA,EAEA,OAAO,iBAAiB,OAAuB;AAC7C,UAAM,gBAAgB,CAAC;AAEvB,eAAW,OAAO,OAAO;AACvB,YAAM,UAAU;AAChB,YAAM,QAAQ,MAAM,OAAO;AAE3B,UAAI,UAAU,MAAM,UAAU,QAAQ,UAAU,QAAW;AACzD,sBAAc,OAAO,IAAI;AAAA,MAC3B;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAAA,EAEA,kBAAkB,QAAyB;AACzC,UAAM,YAAY;AAElB,WACE,CAAC,CAAC,KAAK,SAAS,KAChB,OAAO,KAAK,SAAS,MAAM,cAC3B,CAAC,KAAK,qBAAqB,MAAM;AAAA,EAErC;AAAA,EAEA,qBAAqB,QAAyB;AAC5C,WAAO,KAAK,WAAW,SAAS,MAAM;AAAA,EACxC;AACF;AA7EE,cAJW,iBAIJ,aAAsB,CAAC;AAC9B,cALW,iBAKJ,UAAkB;AACzB,cANW,iBAMJ,aAAqB;AANjB,kBAAN;AAAA,EADN,iBAAsC;AAAA,GAC1B;;;ACFN,IAAM,aAAa,CACxB,eACG;AAAA,EACH,MAAM,wBAAwB,WAAW;AAAA;AAAA;AAAA;AAAA,IAMvC,OAAO,OAKL,OACA,QAC8B;AAC9B,YAAM,SAAS,UAAU,KAAK,QAAQ;AACtC,aAAO,IAAI,OAAO,KAAK,MAAM,GAAG,KAAK,EAAE,OAAO;AAAA,IAChD;AAAA;AAAA;AAAA;AAAA,IAKA,OAAO,aAAa,SAElB,OACA,OACA,QACA;AACA,YAAM,SAAS,UAAU,KAAK,QAAQ;AACtC,aAAO,IAAI,OAAO,OAAO,KAAK,EAAE,OAAO;AAAA,IACzC;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
extendModelQueryBuilder
|
|
3
|
-
} from "../chunk-V7FYZD4D.js";
|
|
4
|
-
import "../chunk-XUS63JTZ.js";
|
|
5
|
-
|
|
6
|
-
// providers/lucid_filter_provider.ts
|
|
7
|
-
var LucidFilterProvider = class {
|
|
8
|
-
constructor(app) {
|
|
9
|
-
this.app = app;
|
|
10
|
-
}
|
|
11
|
-
async boot() {
|
|
12
|
-
const { ModelQueryBuilder } = await this.app.import("@adonisjs/lucid/orm");
|
|
13
|
-
extendModelQueryBuilder(ModelQueryBuilder);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
LucidFilterProvider as default
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=lucid_filter_provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../providers/lucid_filter_provider.ts"],"sourcesContent":["/*\n * adonis-lucid-filter\n *\n * (c) Lookin Anton <alf@lookinlab.ru>\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 path=\"../src/types/querybuilder.ts\" />\n\nimport type { ApplicationService } from '@adonisjs/core/types'\nimport { extendModelQueryBuilder } from '../src/bindings/model_query_builder.js'\n\nexport default class LucidFilterProvider {\n constructor(protected app: ApplicationService) {}\n\n async boot() {\n const { ModelQueryBuilder } = await this.app.import('@adonisjs/lucid/orm')\n extendModelQueryBuilder(ModelQueryBuilder)\n }\n}\n"],"mappings":";;;;;;AAcA,IAAqB,sBAArB,MAAyC;AAAA,EACvC,YAAsB,KAAyB;AAAzB;AAAA,EAA0B;AAAA,EAEhD,MAAM,OAAO;AACX,UAAM,EAAE,kBAAkB,IAAI,MAAM,KAAK,IAAI,OAAO,qBAAqB;AACzE,4BAAwB,iBAAiB;AAAA,EAC3C;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=filter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=querybuilder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|