@tryghost/bookshelf-filter 2.0.3 → 2.1.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 +9 -15
- package/lib/bookshelf-filter.js +4 -4
- package/package.json +17 -17
package/README.md
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
or
|
|
8
8
|
|
|
9
|
-
`
|
|
10
|
-
|
|
9
|
+
`pnpm add @tryghost/bookshelf-filter`
|
|
11
10
|
|
|
12
11
|
## Purpose
|
|
13
12
|
|
|
@@ -15,29 +14,24 @@ Bookshelf plugin that parses and applies NQL filter expressions with support for
|
|
|
15
14
|
|
|
16
15
|
## Usage
|
|
17
16
|
|
|
18
|
-
|
|
19
17
|
## Develop
|
|
20
18
|
|
|
21
|
-
This is a mono repository, managed with [
|
|
19
|
+
This is a mono repository, managed with [Nx](https://nx.dev).
|
|
22
20
|
|
|
23
21
|
Follow the instructions for the top-level repo.
|
|
24
|
-
1. `git clone` this repo & `cd` into it as usual
|
|
25
|
-
2. Run `yarn` to install top-level dependencies.
|
|
26
22
|
|
|
23
|
+
1. `git clone` this repo & `cd` into it as usual
|
|
24
|
+
2. Run `pnpm install` to install top-level dependencies.
|
|
27
25
|
|
|
28
26
|
## Run
|
|
29
27
|
|
|
30
|
-
- `
|
|
31
|
-
|
|
28
|
+
- `pnpm dev`
|
|
32
29
|
|
|
33
30
|
## Test
|
|
34
31
|
|
|
35
|
-
- `
|
|
36
|
-
- `
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
- `pnpm lint` runs oxlint
|
|
33
|
+
- `pnpm test` runs lint and tests
|
|
40
34
|
|
|
41
|
-
# Copyright & License
|
|
35
|
+
# Copyright & License
|
|
42
36
|
|
|
43
|
-
Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE).
|
|
37
|
+
Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE).
|
package/lib/bookshelf-filter.js
CHANGED
|
@@ -3,7 +3,7 @@ const errors = require('@tryghost/errors');
|
|
|
3
3
|
const tpl = require('@tryghost/tpl');
|
|
4
4
|
|
|
5
5
|
const messages = {
|
|
6
|
-
errorParsing: 'Error parsing filter'
|
|
6
|
+
errorParsing: 'Error parsing filter',
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -61,16 +61,16 @@ const filter = function filter(Bookshelf) {
|
|
|
61
61
|
overrides: overrides,
|
|
62
62
|
defaults: defaults,
|
|
63
63
|
transformer: transformer,
|
|
64
|
-
cte: cte
|
|
64
|
+
cte: cte,
|
|
65
65
|
}).querySQL(qb);
|
|
66
66
|
});
|
|
67
67
|
} catch (err) {
|
|
68
68
|
throw new errors.BadRequestError({
|
|
69
69
|
message: tpl(messages.errorParsing),
|
|
70
|
-
err
|
|
70
|
+
err,
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
}
|
|
73
|
+
},
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
Bookshelf.Model = Model;
|
package/package.json
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/bookshelf-filter",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "Ghost Foundation",
|
|
4
6
|
"repository": {
|
|
5
7
|
"type": "git",
|
|
6
8
|
"url": "git+https://github.com/TryGhost/framework.git",
|
|
7
9
|
"directory": "packages/bookshelf-filter"
|
|
8
10
|
},
|
|
9
|
-
"author": "Ghost Foundation",
|
|
10
|
-
"license": "MIT",
|
|
11
|
-
"main": "index.js",
|
|
12
|
-
"scripts": {
|
|
13
|
-
"dev": "echo \"Implement me!\"",
|
|
14
|
-
"test": "NODE_ENV=testing vitest run --coverage --config ../../vitest.config.ts",
|
|
15
|
-
"lint": "eslint . --ext .js --cache",
|
|
16
|
-
"posttest": "yarn lint"
|
|
17
|
-
},
|
|
18
11
|
"files": [
|
|
19
12
|
"index.js",
|
|
20
13
|
"lib"
|
|
21
14
|
],
|
|
15
|
+
"main": "index.js",
|
|
22
16
|
"publishConfig": {
|
|
23
17
|
"access": "public"
|
|
24
18
|
},
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"sinon": "21.0.2"
|
|
27
|
-
},
|
|
28
19
|
"dependencies": {
|
|
29
|
-
"@tryghost/debug": "^2.0.3",
|
|
30
|
-
"@tryghost/errors": "^3.0.3",
|
|
31
20
|
"@tryghost/nql": "0.12.10",
|
|
32
|
-
"@tryghost/
|
|
21
|
+
"@tryghost/debug": "2.1.0",
|
|
22
|
+
"@tryghost/tpl": "2.1.0",
|
|
23
|
+
"@tryghost/errors": "3.1.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"sinon": "21.1.2"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"dev": "echo \"Implement me!\"",
|
|
30
|
+
"test": "NODE_ENV=testing vitest run --coverage --config ../../vitest.config.ts",
|
|
31
|
+
"lint": "oxlint -c ../../.oxlintrc.json .",
|
|
32
|
+
"posttest": "pnpm run lint"
|
|
33
33
|
}
|
|
34
|
-
}
|
|
34
|
+
}
|