Skip to content

Commit e636517

Browse files
committed
Merge branch 'main' of github.com:devforth/adminforth
2 parents 0cd34fb + 319e3bb commit e636517

File tree

129 files changed

+2975
-974
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2975
-974
lines changed

Changelog.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,32 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [v1.5.8] - next
8+
## [v1.5.9] - next
99

10-
# Added
10+
## [v1.5.8]
11+
12+
### Added
1113

1214
- Command to generate typescript models `npx -y adminforth generate-models --env-file=.env`
1315
- add i18n support: add vue-i18n to frontend and tr function to backend. This will allow to implement translation plugins
1416
- badgeTooltip - now you can add a tooltip to the badge to explain what it means
1517
- ability to authorize not only subscription on websocket but filter out whom users message will be published (updated doc)
1618
- added ability to refresh menu item badge from the backend using websocket publish
19+
- fix bugs when e.g. UR (urdu) can't be recognized by LLM (define names explicitly)
20+
- make user menu switch shorter
21+
- next param support on login route (also preserve next param between login/signup navigation)
22+
23+
### Improved
24+
25+
- Added separate BeforeCreateSave function in types without oldRecord and make oldRecord mandatory in existing BeforeSaveFunction
26+
- Added dataConnector: IAdminForthDataSourceConnectorBase; into IOperationalResource - for reusing connectors from users code
1727

18-
# Improved
28+
### Fixed
1929

20-
- Added separate BeforeCreateSave function in types without oldRecord and make oldRecord Mandatory in existing BeforeSaveFunction
30+
- WS on base URL
31+
- favicon when using BaseURL
32+
- Mongo: fix search by strings with "+" and other special characters
33+
- mongo storing boolean as true/false now. Before it was 1/0 which broke compatibility with many other ORMs
2134

2235
## [v1.5.7] - 2024-12-09
2336

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
* [Full API reference](https://adminforth.dev/docs/api/).
1212

1313
<div align="center">
14-
<img src="https://github.com/user-attachments/assets/a06ebf9f-b9c7-4d34-8668-edd2cedee686" alt="Image description" width="800px">
14+
<img src="https://github.com/user-attachments/assets/f507a46b-f282-4f81-97e0-32fceb002ded"
15+
alt="Image description" width="800px">
1516
</div>
1617

1718
Features:

adminforth/adapters/completion-adapter-open-ai-chat-gpt/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ export default class CompletionAdapterOpenAIChatGPT
88

99
constructor(options: AdapterOptions) {
1010
this.options = options;
11-
if (!options.openAiApiKey) {
11+
}
12+
13+
validate() {
14+
if (!this.options.openAiApiKey) {
1215
throw new Error("openAiApiKey is required");
1316
}
1417
}

adminforth/adapters/completion-adapter-open-ai-chat-gpt/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adminforth/adapters/completion-adapter-open-ai-chat-gpt/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adminforth/completion-adapter-open-ai-chat-gpt",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"type": "module",

adminforth/adapters/email-adapter-aws-ses/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ export default class EmailAdapterAwsSes implements EmailAdapter {
77

88
constructor(options: AdapterOptions) {
99
this.options = options;
10-
if (!options.region) {
10+
}
11+
12+
validate() {
13+
if (!this.options.region) {
1114
throw new Error("AWS SES region is required");
1215
}
13-
if (!options.accessKeyId) {
16+
if (!this.options.accessKeyId) {
1417
throw new Error("AWS SES accessKeyId is required");
1518
}
16-
if (!options.secretAccessKey) {
19+
if (!this.options.secretAccessKey) {
1720
throw new Error("AWS SES secretAccessKey is required");
1821
}
1922
}

adminforth/adapters/email-adapter-aws-ses/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adminforth/adapters/email-adapter-aws-ses/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adminforth/email-adapter-aws-ses",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"type": "module",

adminforth/dataConnectors/mongo.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import AdminForthBaseConnector from './baseConnector.js';
55

66
import { AdminForthDataTypes, AdminForthFilterOperators, AdminForthSortDirections, } from '../types/Common.js';
77

8+
const escapeRegex = (value) => {
9+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // Escapes special characters
10+
};
11+
812
class MongoConnector extends AdminForthBaseConnector implements IAdminForthDataSourceConnector {
913
db: MongoClient
1014

@@ -31,8 +35,8 @@ class MongoConnector extends AdminForthBaseConnector implements IAdminForthDataS
3135
[AdminForthFilterOperators.LT]: (value) => ({ $lt: value }),
3236
[AdminForthFilterOperators.GTE]: (value) => ({ $gte: value }),
3337
[AdminForthFilterOperators.LTE]: (value) => ({ $lte: value }),
34-
[AdminForthFilterOperators.LIKE]: (value) => ({ $regex: value }),
35-
[AdminForthFilterOperators.ILIKE]: (value) => ({ $regex: value, $options: 'i' }),
38+
[AdminForthFilterOperators.LIKE]: (value) => ({ $regex: escapeRegex(value) }),
39+
[AdminForthFilterOperators.ILIKE]: (value) => ({ $regex: escapeRegex(value), $options: 'i' }),
3640
[AdminForthFilterOperators.IN]: (value) => ({ $in: value }),
3741
[AdminForthFilterOperators.NIN]: (value) => ({ $nin: value }),
3842
};
@@ -103,7 +107,7 @@ class MongoConnector extends AdminForthBaseConnector implements IAdminForthDataS
103107
return dayjs(value).toISOString();
104108
}
105109
} else if (field.type == AdminForthDataTypes.BOOLEAN) {
106-
return value ? 1 : 0;
110+
return value ? true : false;
107111
}
108112
return value;
109113
}

adminforth/documentation/blog/2024-10-01-ai-blog/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ nvm use 20
4141
mkdir ai-blog
4242
cd ai-blog
4343
npm init -y
44-
npm install adminforth @adminforth/upload @adminforth/rich-editor @adminforth/chat-gpt \
45-
express slugify http-proxy @types/express typescript tsx @types/node --save-dev
44+
npm i adminforth @adminforth/upload @adminforth/rich-editor @adminforth/chat-gpt \
45+
express slugify http-proxy @types/express typescript tsx @types/node -D
4646
npx --yes tsc --init --module NodeNext --target ESNext
4747
```
4848

0 commit comments

Comments
 (0)