@kadirgun/lucid-bravo 0.1.2 → 0.1.3
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/build/index.js +3 -9
- package/build/src/lucid_bravo.d.ts +1 -2
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -40,9 +40,6 @@ var LucidBravo = class {
|
|
|
40
40
|
if (this.model) return this.model;
|
|
41
41
|
throw new Error("Model not defined");
|
|
42
42
|
}
|
|
43
|
-
transform(items) {
|
|
44
|
-
return items;
|
|
45
|
-
}
|
|
46
43
|
/**
|
|
47
44
|
* Main entry point to apply all filters, includes, sorting and pagination
|
|
48
45
|
*/
|
|
@@ -60,13 +57,10 @@ var LucidBravo = class {
|
|
|
60
57
|
return Number(result.$extras.total);
|
|
61
58
|
}
|
|
62
59
|
async paginate() {
|
|
63
|
-
const items = await this.apply();
|
|
64
|
-
const total = await this.count(this.$countQuery);
|
|
65
|
-
const filtered = await this.count(this.$filteredQuery);
|
|
66
60
|
return {
|
|
67
|
-
items: this.
|
|
68
|
-
total,
|
|
69
|
-
filtered
|
|
61
|
+
items: await this.apply(),
|
|
62
|
+
total: await this.count(this.$countQuery),
|
|
63
|
+
filtered: await this.count(this.$filteredQuery)
|
|
70
64
|
};
|
|
71
65
|
}
|
|
72
66
|
/**
|
|
@@ -13,7 +13,7 @@ export declare abstract class LucidBravo<T extends LucidModel> {
|
|
|
13
13
|
protected defaultLimit: number;
|
|
14
14
|
protected defaultSort: BravoSortOption | null;
|
|
15
15
|
constructor(params?: BravoParams, query?: ModelQueryBuilderContract<T>);
|
|
16
|
-
static build<
|
|
16
|
+
static build<B>(this: Constructor<B>, params?: BravoParams, query?: ModelQueryBuilderContract<LucidModel>): B;
|
|
17
17
|
/**
|
|
18
18
|
* Return a whitelist of sortable columns
|
|
19
19
|
*/
|
|
@@ -23,7 +23,6 @@ export declare abstract class LucidBravo<T extends LucidModel> {
|
|
|
23
23
|
*/
|
|
24
24
|
protected getAllowedIncludes(): LucidBravoRelations<InstanceType<T>>[];
|
|
25
25
|
protected getModel(): T;
|
|
26
|
-
protected transform(items: InstanceType<T>[]): InstanceType<T>[];
|
|
27
26
|
/**
|
|
28
27
|
* Main entry point to apply all filters, includes, sorting and pagination
|
|
29
28
|
*/
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@kadirgun/lucid-bravo",
|
|
3
3
|
"description": "A powerful, fluent query builder for AdonisJS Lucid to handle filtering, sorting and pagination in a single flow",
|
|
4
4
|
"homepage": "https://github.com/kadirgun/lucid-bravo",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.3",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24.0.0"
|
|
8
8
|
},
|