adminforth 1.1.98 → 1.1.99
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/dataConnectors/sqlite.ts +13 -0
- package/dist/dataConnectors/sqlite.js +17 -0
- package/dist/index.js +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
- package/tsconfig.json +1 -1
package/dataConnectors/sqlite.ts
CHANGED
|
@@ -80,6 +80,12 @@ class SQLiteConnector extends AdminForthBaseConnector implements IAdminForthData
|
|
|
80
80
|
|
|
81
81
|
} else if (field.type == AdminForthDataTypes.BOOLEAN) {
|
|
82
82
|
return !!value;
|
|
83
|
+
} else if (field.type == AdminForthDataTypes.JSON) {
|
|
84
|
+
if (field._underlineType == 'text' || field._underlineType == 'varchar') {
|
|
85
|
+
return JSON.parse(value);
|
|
86
|
+
} else {
|
|
87
|
+
console.error(`AdminForth: JSON field is not a string/text but ${field._underlineType}, this is not supported yet`);
|
|
88
|
+
}
|
|
83
89
|
}
|
|
84
90
|
|
|
85
91
|
return value;
|
|
@@ -114,6 +120,13 @@ class SQLiteConnector extends AdminForthBaseConnector implements IAdminForthData
|
|
|
114
120
|
}
|
|
115
121
|
} else if (field.type == AdminForthDataTypes.BOOLEAN) {
|
|
116
122
|
return value ? 1 : 0;
|
|
123
|
+
} else if (field.type == AdminForthDataTypes.JSON) {
|
|
124
|
+
// check underline type is text or string
|
|
125
|
+
if (field._underlineType == 'text' || field._underlineType == 'varchar') {
|
|
126
|
+
return JSON.stringify(value);
|
|
127
|
+
} else {
|
|
128
|
+
console.error(`AdminForth: JSON field is not a string/text but ${field._underlineType}, this is not supported yet`);
|
|
129
|
+
}
|
|
117
130
|
}
|
|
118
131
|
|
|
119
132
|
return value;
|
|
@@ -111,6 +111,14 @@ class SQLiteConnector extends AdminForthBaseConnector {
|
|
|
111
111
|
else if (field.type == AdminForthDataTypes.BOOLEAN) {
|
|
112
112
|
return !!value;
|
|
113
113
|
}
|
|
114
|
+
else if (field.type == AdminForthDataTypes.JSON) {
|
|
115
|
+
if (field._underlineType == 'text' || field._underlineType == 'varchar') {
|
|
116
|
+
return JSON.parse(value);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
console.error(`AdminForth: JSON field is not a string/text but ${field._underlineType}, this is not supported yet`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
114
122
|
return value;
|
|
115
123
|
}
|
|
116
124
|
getRecordByPrimaryKeyWithOriginalTypes(resource, key) {
|
|
@@ -146,6 +154,15 @@ class SQLiteConnector extends AdminForthBaseConnector {
|
|
|
146
154
|
else if (field.type == AdminForthDataTypes.BOOLEAN) {
|
|
147
155
|
return value ? 1 : 0;
|
|
148
156
|
}
|
|
157
|
+
else if (field.type == AdminForthDataTypes.JSON) {
|
|
158
|
+
// check underline type is text or string
|
|
159
|
+
if (field._underlineType == 'text' || field._underlineType == 'varchar') {
|
|
160
|
+
return JSON.stringify(value);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
console.error(`AdminForth: JSON field is not a string/text but ${field._underlineType}, this is not supported yet`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
149
166
|
return value;
|
|
150
167
|
}
|
|
151
168
|
getDataWithOriginalTypes(_a) {
|
package/dist/index.js
CHANGED
|
@@ -89,7 +89,7 @@ class AdminForth {
|
|
|
89
89
|
if (!this.config.rootUser.password) {
|
|
90
90
|
throw new Error('rootUser.password is required');
|
|
91
91
|
}
|
|
92
|
-
console.log('\n ⚠️⚠️⚠️ [INSECURE ALERT] config.rootUser is set, please create a new user and remove config.rootUser from config
|
|
92
|
+
console.log('\n ⚠️⚠️⚠️ [INSECURE ALERT] config.rootUser is set, please create a new user and remove config.rootUser from config ASAP when you are in production\n');
|
|
93
93
|
}
|
|
94
94
|
if (!this.config.customization.customComponentsDir) {
|
|
95
95
|
this.config.customization.customComponentsDir = './custom';
|
package/index.ts
CHANGED
|
@@ -124,7 +124,7 @@ class AdminForth implements IAdminForth {
|
|
|
124
124
|
throw new Error('rootUser.password is required');
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
console.log('\n ⚠️⚠️⚠️ [INSECURE ALERT] config.rootUser is set, please create a new user and remove config.rootUser from config
|
|
127
|
+
console.log('\n ⚠️⚠️⚠️ [INSECURE ALERT] config.rootUser is set, please create a new user and remove config.rootUser from config ASAP when you are in production\n');
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
if (!this.config.customization.customComponentsDir) {
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
109
109
|
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
|
|
110
110
|
},
|
|
111
|
-
"exclude": ["node_modules", "dist", "spa", "documentation", "plugins
|
|
111
|
+
"exclude": ["node_modules", "dist", "spa", "documentation", "plugins/**/index.ts"], /* Exclude files from compilation. */
|
|
112
112
|
}
|