@ruiapp/rapid-core 0.6.0 → 0.6.2
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/dist/bootstrapApplicationConfig.d.ts +52 -9
- package/dist/index.js +44 -16
- package/dist/types.d.ts +40 -2
- package/package.json +1 -1
- package/src/bootstrapApplicationConfig.ts +41 -13
- package/src/plugins/metaManage/MetaManagePlugin.ts +3 -3
- package/src/types.ts +48 -2
|
@@ -17,6 +17,7 @@ declare const _default: {
|
|
|
17
17
|
type: "integer";
|
|
18
18
|
required: true;
|
|
19
19
|
autoIncrement: true;
|
|
20
|
+
description?: undefined;
|
|
20
21
|
relation?: undefined;
|
|
21
22
|
targetSingularCode?: undefined;
|
|
22
23
|
selfIdColumnName?: undefined;
|
|
@@ -28,6 +29,7 @@ declare const _default: {
|
|
|
28
29
|
type: "text";
|
|
29
30
|
required: true;
|
|
30
31
|
autoIncrement?: undefined;
|
|
32
|
+
description?: undefined;
|
|
31
33
|
relation?: undefined;
|
|
32
34
|
targetSingularCode?: undefined;
|
|
33
35
|
selfIdColumnName?: undefined;
|
|
@@ -39,12 +41,14 @@ declare const _default: {
|
|
|
39
41
|
type: "text";
|
|
40
42
|
required: false;
|
|
41
43
|
autoIncrement?: undefined;
|
|
44
|
+
description?: undefined;
|
|
42
45
|
relation?: undefined;
|
|
43
46
|
targetSingularCode?: undefined;
|
|
44
47
|
selfIdColumnName?: undefined;
|
|
45
48
|
defaultValue?: undefined;
|
|
46
49
|
} | {
|
|
47
50
|
name: string;
|
|
51
|
+
description: string;
|
|
48
52
|
code: string;
|
|
49
53
|
columnName: string;
|
|
50
54
|
type: "json";
|
|
@@ -64,6 +68,19 @@ declare const _default: {
|
|
|
64
68
|
columnName?: undefined;
|
|
65
69
|
required?: undefined;
|
|
66
70
|
autoIncrement?: undefined;
|
|
71
|
+
description?: undefined;
|
|
72
|
+
defaultValue?: undefined;
|
|
73
|
+
} | {
|
|
74
|
+
name: string;
|
|
75
|
+
code: string;
|
|
76
|
+
columnName: string;
|
|
77
|
+
type: "json";
|
|
78
|
+
required: false;
|
|
79
|
+
autoIncrement?: undefined;
|
|
80
|
+
description?: undefined;
|
|
81
|
+
relation?: undefined;
|
|
82
|
+
targetSingularCode?: undefined;
|
|
83
|
+
selfIdColumnName?: undefined;
|
|
67
84
|
defaultValue?: undefined;
|
|
68
85
|
} | {
|
|
69
86
|
name: string;
|
|
@@ -73,6 +90,7 @@ declare const _default: {
|
|
|
73
90
|
required: true;
|
|
74
91
|
defaultValue: string;
|
|
75
92
|
autoIncrement?: undefined;
|
|
93
|
+
description?: undefined;
|
|
76
94
|
relation?: undefined;
|
|
77
95
|
targetSingularCode?: undefined;
|
|
78
96
|
selfIdColumnName?: undefined;
|
|
@@ -109,8 +127,8 @@ declare const _default: {
|
|
|
109
127
|
relation?: undefined;
|
|
110
128
|
targetSingularCode?: undefined;
|
|
111
129
|
targetIdColumnName?: undefined;
|
|
112
|
-
defaultValue?: undefined;
|
|
113
130
|
description?: undefined;
|
|
131
|
+
defaultValue?: undefined;
|
|
114
132
|
} | {
|
|
115
133
|
name: string;
|
|
116
134
|
code: string;
|
|
@@ -121,8 +139,8 @@ declare const _default: {
|
|
|
121
139
|
targetIdColumnName: string;
|
|
122
140
|
columnName?: undefined;
|
|
123
141
|
autoIncrement?: undefined;
|
|
124
|
-
defaultValue?: undefined;
|
|
125
142
|
description?: undefined;
|
|
143
|
+
defaultValue?: undefined;
|
|
126
144
|
} | {
|
|
127
145
|
name: string;
|
|
128
146
|
code: string;
|
|
@@ -133,8 +151,8 @@ declare const _default: {
|
|
|
133
151
|
relation?: undefined;
|
|
134
152
|
targetSingularCode?: undefined;
|
|
135
153
|
targetIdColumnName?: undefined;
|
|
136
|
-
defaultValue?: undefined;
|
|
137
154
|
description?: undefined;
|
|
155
|
+
defaultValue?: undefined;
|
|
138
156
|
} | {
|
|
139
157
|
name: string;
|
|
140
158
|
code: string;
|
|
@@ -145,10 +163,11 @@ declare const _default: {
|
|
|
145
163
|
relation?: undefined;
|
|
146
164
|
targetSingularCode?: undefined;
|
|
147
165
|
targetIdColumnName?: undefined;
|
|
148
|
-
defaultValue?: undefined;
|
|
149
166
|
description?: undefined;
|
|
167
|
+
defaultValue?: undefined;
|
|
150
168
|
} | {
|
|
151
169
|
name: string;
|
|
170
|
+
description: string;
|
|
152
171
|
code: string;
|
|
153
172
|
columnName: string;
|
|
154
173
|
type: "json";
|
|
@@ -158,7 +177,6 @@ declare const _default: {
|
|
|
158
177
|
targetSingularCode?: undefined;
|
|
159
178
|
targetIdColumnName?: undefined;
|
|
160
179
|
defaultValue?: undefined;
|
|
161
|
-
description?: undefined;
|
|
162
180
|
} | {
|
|
163
181
|
name: string;
|
|
164
182
|
code: string;
|
|
@@ -175,25 +193,25 @@ declare const _default: {
|
|
|
175
193
|
name: string;
|
|
176
194
|
code: string;
|
|
177
195
|
columnName: string;
|
|
178
|
-
type: "
|
|
196
|
+
type: "json";
|
|
179
197
|
required: false;
|
|
180
198
|
autoIncrement?: undefined;
|
|
181
199
|
relation?: undefined;
|
|
182
200
|
targetSingularCode?: undefined;
|
|
183
201
|
targetIdColumnName?: undefined;
|
|
184
|
-
defaultValue?: undefined;
|
|
185
202
|
description?: undefined;
|
|
203
|
+
defaultValue?: undefined;
|
|
186
204
|
} | {
|
|
187
205
|
name: string;
|
|
188
206
|
code: string;
|
|
189
207
|
columnName: string;
|
|
190
|
-
|
|
191
|
-
type: "text";
|
|
208
|
+
type: "integer";
|
|
192
209
|
required: false;
|
|
193
210
|
autoIncrement?: undefined;
|
|
194
211
|
relation?: undefined;
|
|
195
212
|
targetSingularCode?: undefined;
|
|
196
213
|
targetIdColumnName?: undefined;
|
|
214
|
+
description?: undefined;
|
|
197
215
|
defaultValue?: undefined;
|
|
198
216
|
})[];
|
|
199
217
|
indexes: {
|
|
@@ -223,6 +241,7 @@ declare const _default: {
|
|
|
223
241
|
relation?: undefined;
|
|
224
242
|
targetSingularCode?: undefined;
|
|
225
243
|
selfIdColumnName?: undefined;
|
|
244
|
+
description?: undefined;
|
|
226
245
|
} | {
|
|
227
246
|
name: string;
|
|
228
247
|
code: string;
|
|
@@ -234,6 +253,7 @@ declare const _default: {
|
|
|
234
253
|
relation?: undefined;
|
|
235
254
|
targetSingularCode?: undefined;
|
|
236
255
|
selfIdColumnName?: undefined;
|
|
256
|
+
description?: undefined;
|
|
237
257
|
} | {
|
|
238
258
|
name: string;
|
|
239
259
|
code: string;
|
|
@@ -245,6 +265,7 @@ declare const _default: {
|
|
|
245
265
|
relation?: undefined;
|
|
246
266
|
targetSingularCode?: undefined;
|
|
247
267
|
selfIdColumnName?: undefined;
|
|
268
|
+
description?: undefined;
|
|
248
269
|
} | {
|
|
249
270
|
name: string;
|
|
250
271
|
code: string;
|
|
@@ -256,6 +277,7 @@ declare const _default: {
|
|
|
256
277
|
relation?: undefined;
|
|
257
278
|
targetSingularCode?: undefined;
|
|
258
279
|
selfIdColumnName?: undefined;
|
|
280
|
+
description?: undefined;
|
|
259
281
|
} | {
|
|
260
282
|
name: string;
|
|
261
283
|
code: string;
|
|
@@ -267,6 +289,7 @@ declare const _default: {
|
|
|
267
289
|
relation?: undefined;
|
|
268
290
|
targetSingularCode?: undefined;
|
|
269
291
|
selfIdColumnName?: undefined;
|
|
292
|
+
description?: undefined;
|
|
270
293
|
} | {
|
|
271
294
|
name: string;
|
|
272
295
|
code: string;
|
|
@@ -278,6 +301,19 @@ declare const _default: {
|
|
|
278
301
|
required?: undefined;
|
|
279
302
|
autoIncrement?: undefined;
|
|
280
303
|
defaultValue?: undefined;
|
|
304
|
+
description?: undefined;
|
|
305
|
+
} | {
|
|
306
|
+
name: string;
|
|
307
|
+
description: string;
|
|
308
|
+
code: string;
|
|
309
|
+
columnName: string;
|
|
310
|
+
type: "json";
|
|
311
|
+
required: false;
|
|
312
|
+
autoIncrement?: undefined;
|
|
313
|
+
defaultValue?: undefined;
|
|
314
|
+
relation?: undefined;
|
|
315
|
+
targetSingularCode?: undefined;
|
|
316
|
+
selfIdColumnName?: undefined;
|
|
281
317
|
})[];
|
|
282
318
|
indexes?: undefined;
|
|
283
319
|
} | {
|
|
@@ -300,6 +336,7 @@ declare const _default: {
|
|
|
300
336
|
targetSingularCode?: undefined;
|
|
301
337
|
targetIdColumnName?: undefined;
|
|
302
338
|
defaultValue?: undefined;
|
|
339
|
+
description?: undefined;
|
|
303
340
|
} | {
|
|
304
341
|
name: string;
|
|
305
342
|
code: string;
|
|
@@ -311,6 +348,7 @@ declare const _default: {
|
|
|
311
348
|
required?: undefined;
|
|
312
349
|
autoIncrement?: undefined;
|
|
313
350
|
defaultValue?: undefined;
|
|
351
|
+
description?: undefined;
|
|
314
352
|
} | {
|
|
315
353
|
name: string;
|
|
316
354
|
code: string;
|
|
@@ -322,6 +360,7 @@ declare const _default: {
|
|
|
322
360
|
relation?: undefined;
|
|
323
361
|
targetSingularCode?: undefined;
|
|
324
362
|
targetIdColumnName?: undefined;
|
|
363
|
+
description?: undefined;
|
|
325
364
|
} | {
|
|
326
365
|
name: string;
|
|
327
366
|
code: string;
|
|
@@ -333,6 +372,7 @@ declare const _default: {
|
|
|
333
372
|
targetSingularCode?: undefined;
|
|
334
373
|
targetIdColumnName?: undefined;
|
|
335
374
|
defaultValue?: undefined;
|
|
375
|
+
description?: undefined;
|
|
336
376
|
} | {
|
|
337
377
|
name: string;
|
|
338
378
|
code: string;
|
|
@@ -344,6 +384,7 @@ declare const _default: {
|
|
|
344
384
|
targetSingularCode?: undefined;
|
|
345
385
|
targetIdColumnName?: undefined;
|
|
346
386
|
defaultValue?: undefined;
|
|
387
|
+
description?: undefined;
|
|
347
388
|
} | {
|
|
348
389
|
name: string;
|
|
349
390
|
code: string;
|
|
@@ -355,8 +396,10 @@ declare const _default: {
|
|
|
355
396
|
targetSingularCode?: undefined;
|
|
356
397
|
targetIdColumnName?: undefined;
|
|
357
398
|
defaultValue?: undefined;
|
|
399
|
+
description?: undefined;
|
|
358
400
|
} | {
|
|
359
401
|
name: string;
|
|
402
|
+
description: string;
|
|
360
403
|
code: string;
|
|
361
404
|
columnName: string;
|
|
362
405
|
type: "json";
|
package/dist/index.js
CHANGED
|
@@ -1641,8 +1641,17 @@ var bootstrapApplicationConfig = {
|
|
|
1641
1641
|
type: "text",
|
|
1642
1642
|
required: false,
|
|
1643
1643
|
},
|
|
1644
|
+
{
|
|
1645
|
+
name: "i18n",
|
|
1646
|
+
description: "The i18n text names of the model attributes.",
|
|
1647
|
+
code: "i18n",
|
|
1648
|
+
columnName: "i18n",
|
|
1649
|
+
type: "json",
|
|
1650
|
+
required: false,
|
|
1651
|
+
},
|
|
1644
1652
|
{
|
|
1645
1653
|
name: "locales",
|
|
1654
|
+
description: "The locale translations of the model attributes.",
|
|
1646
1655
|
code: "locales",
|
|
1647
1656
|
columnName: "locales",
|
|
1648
1657
|
type: "json",
|
|
@@ -1820,8 +1829,17 @@ var bootstrapApplicationConfig = {
|
|
|
1820
1829
|
type: "text",
|
|
1821
1830
|
required: false,
|
|
1822
1831
|
},
|
|
1832
|
+
{
|
|
1833
|
+
name: "i18n",
|
|
1834
|
+
description: "The i18n text names of the property attributes.",
|
|
1835
|
+
code: "i18n",
|
|
1836
|
+
columnName: "i18n",
|
|
1837
|
+
type: "json",
|
|
1838
|
+
required: false,
|
|
1839
|
+
},
|
|
1823
1840
|
{
|
|
1824
1841
|
name: "locales",
|
|
1842
|
+
description: "The locale translations of the property attributes.",
|
|
1825
1843
|
code: "locales",
|
|
1826
1844
|
columnName: "locales",
|
|
1827
1845
|
type: "json",
|
|
@@ -1949,14 +1967,6 @@ var bootstrapApplicationConfig = {
|
|
|
1949
1967
|
type: "text",
|
|
1950
1968
|
required: false,
|
|
1951
1969
|
},
|
|
1952
|
-
{
|
|
1953
|
-
name: "i18n string storage",
|
|
1954
|
-
code: "i18nStringStorage",
|
|
1955
|
-
columnName: "i18n_string_storage",
|
|
1956
|
-
description: "The storage type of i18n strings. `json` or `i18nStringsTable`.",
|
|
1957
|
-
type: "text",
|
|
1958
|
-
required: false,
|
|
1959
|
-
},
|
|
1960
1970
|
],
|
|
1961
1971
|
indexes: [
|
|
1962
1972
|
{
|
|
@@ -2063,8 +2073,17 @@ var bootstrapApplicationConfig = {
|
|
|
2063
2073
|
targetSingularCode: "data_dictionary_entry",
|
|
2064
2074
|
selfIdColumnName: "dictionary_id",
|
|
2065
2075
|
},
|
|
2076
|
+
{
|
|
2077
|
+
name: "i18n",
|
|
2078
|
+
description: "The i18n text names of the data dictionary attributes.",
|
|
2079
|
+
code: "i18n",
|
|
2080
|
+
columnName: "i18n",
|
|
2081
|
+
type: "json",
|
|
2082
|
+
required: false,
|
|
2083
|
+
},
|
|
2066
2084
|
{
|
|
2067
2085
|
name: "locales",
|
|
2086
|
+
description: "The locale translations of the data dictionary attributes.",
|
|
2068
2087
|
code: "locales",
|
|
2069
2088
|
columnName: "locales",
|
|
2070
2089
|
type: "json",
|
|
@@ -2148,8 +2167,17 @@ var bootstrapApplicationConfig = {
|
|
|
2148
2167
|
type: "boolean",
|
|
2149
2168
|
required: false,
|
|
2150
2169
|
},
|
|
2170
|
+
{
|
|
2171
|
+
name: "i18n",
|
|
2172
|
+
description: "The i18n text names of the data dictionary entry attributes.",
|
|
2173
|
+
code: "i18n",
|
|
2174
|
+
columnName: "i18n",
|
|
2175
|
+
type: "json",
|
|
2176
|
+
required: false,
|
|
2177
|
+
},
|
|
2151
2178
|
{
|
|
2152
2179
|
name: "locales",
|
|
2180
|
+
description: "The locale translations of the data dictionary entry attributes.",
|
|
2153
2181
|
code: "locales",
|
|
2154
2182
|
columnName: "locales",
|
|
2155
2183
|
type: "json",
|
|
@@ -2236,12 +2264,12 @@ var bootstrapApplicationConfig = {
|
|
|
2236
2264
|
{
|
|
2237
2265
|
maintainedBy: "dataManager",
|
|
2238
2266
|
namespace: "meta",
|
|
2239
|
-
name: "
|
|
2240
|
-
code: "
|
|
2241
|
-
singularCode: "
|
|
2242
|
-
pluralCode: "
|
|
2267
|
+
name: "locale strings",
|
|
2268
|
+
code: "LocaleString",
|
|
2269
|
+
singularCode: "locale_string",
|
|
2270
|
+
pluralCode: "locale_strings",
|
|
2243
2271
|
schema: "public",
|
|
2244
|
-
tableName: "
|
|
2272
|
+
tableName: "meta_locale_strings",
|
|
2245
2273
|
properties: [
|
|
2246
2274
|
{
|
|
2247
2275
|
name: "id",
|
|
@@ -5139,7 +5167,7 @@ async function syncDatabaseSchema(server, applicationConfig) {
|
|
|
5139
5167
|
await server.queryDatabaseObject(`CREATE TABLE IF NOT EXISTS ${queryBuilder.quoteTable(model)} ()`, []);
|
|
5140
5168
|
}
|
|
5141
5169
|
if (!tableInDb || tableInDb.table_description != model.name) {
|
|
5142
|
-
await server.
|
|
5170
|
+
await server.tryQueryDatabaseObject(`COMMENT ON TABLE ${queryBuilder.quoteTable(model)} IS ${queryBuilder.formatValueToSqlLiteral(model.name)};`, []);
|
|
5143
5171
|
}
|
|
5144
5172
|
}
|
|
5145
5173
|
const sqlQueryColumnInformations = `SELECT c.table_schema, c.table_name, c.column_name, c.ordinal_position, d.description, c.data_type, c.udt_name, c.is_nullable, c.column_default, c.character_maximum_length, c.numeric_precision, c.numeric_scale
|
|
@@ -5174,7 +5202,7 @@ async function syncDatabaseSchema(server, applicationConfig) {
|
|
|
5174
5202
|
await server.tryQueryDatabaseObject(columnDDL);
|
|
5175
5203
|
}
|
|
5176
5204
|
if (!columnInDb || columnInDb.description != property.name) {
|
|
5177
|
-
await server.
|
|
5205
|
+
await server.tryQueryDatabaseObject(`COMMENT ON COLUMN ${queryBuilder.quoteTable(model)}.${queryBuilder.quoteObject(property.targetIdColumnName)} IS ${queryBuilder.formatValueToSqlLiteral(property.name)};`, []);
|
|
5178
5206
|
}
|
|
5179
5207
|
}
|
|
5180
5208
|
else if (property.relation === "many") {
|
|
@@ -5278,7 +5306,7 @@ async function syncDatabaseSchema(server, applicationConfig) {
|
|
|
5278
5306
|
}
|
|
5279
5307
|
}
|
|
5280
5308
|
if (!columnInDb || columnInDb.description != property.name) {
|
|
5281
|
-
await server.
|
|
5309
|
+
await server.tryQueryDatabaseObject(`COMMENT ON COLUMN ${queryBuilder.quoteTable(model)}.${queryBuilder.quoteObject(property.columnName || property.code)} IS ${queryBuilder.formatValueToSqlLiteral(property.name)};`, []);
|
|
5282
5310
|
}
|
|
5283
5311
|
}
|
|
5284
5312
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -199,10 +199,14 @@ export interface RpdDataModel {
|
|
|
199
199
|
/**
|
|
200
200
|
* 多语言配置
|
|
201
201
|
*/
|
|
202
|
+
i18n?: Record<string, string>;
|
|
203
|
+
/**
|
|
204
|
+
* 本地化资源
|
|
205
|
+
*/
|
|
202
206
|
locales?: Record<string, RpdDataModelLocale>;
|
|
203
207
|
}
|
|
204
208
|
/**
|
|
205
|
-
*
|
|
209
|
+
* 实体本地化资源配置
|
|
206
210
|
*/
|
|
207
211
|
export type RpdDataModelLocale = {
|
|
208
212
|
name: string;
|
|
@@ -309,8 +313,15 @@ export interface RpdDataModelProperty {
|
|
|
309
313
|
/**
|
|
310
314
|
* 多语言配置
|
|
311
315
|
*/
|
|
316
|
+
i18n?: Record<string, string>;
|
|
317
|
+
/**
|
|
318
|
+
* 本地化资源
|
|
319
|
+
*/
|
|
312
320
|
locales?: Record<string, RpdDataModelPropertyLocale>;
|
|
313
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* 实体属性本地化资源配置
|
|
324
|
+
*/
|
|
314
325
|
export type RpdDataModelPropertyLocale = {
|
|
315
326
|
name: string;
|
|
316
327
|
description?: string;
|
|
@@ -345,6 +356,18 @@ export type RpdDataDictionary = {
|
|
|
345
356
|
* 字典项
|
|
346
357
|
*/
|
|
347
358
|
entries: RpdDataDictionaryEntry[];
|
|
359
|
+
/**
|
|
360
|
+
* 多语言配置
|
|
361
|
+
*/
|
|
362
|
+
i18n?: Record<string, string>;
|
|
363
|
+
/**
|
|
364
|
+
* 本地化资源
|
|
365
|
+
*/
|
|
366
|
+
locales?: Record<string, RpdDataDictionaryLocale>;
|
|
367
|
+
};
|
|
368
|
+
export type RpdDataDictionaryLocale = {
|
|
369
|
+
name: string;
|
|
370
|
+
description?: string;
|
|
348
371
|
};
|
|
349
372
|
/**
|
|
350
373
|
* 数据字典项
|
|
@@ -378,6 +401,21 @@ export type RpdDataDictionaryEntry = {
|
|
|
378
401
|
* 是否禁用
|
|
379
402
|
*/
|
|
380
403
|
disabled: boolean;
|
|
404
|
+
/**
|
|
405
|
+
* 多语言配置
|
|
406
|
+
*/
|
|
407
|
+
i18n?: Record<string, string>;
|
|
408
|
+
/**
|
|
409
|
+
* 本地化资源
|
|
410
|
+
*/
|
|
411
|
+
locales?: Record<string, RpdDataDictionaryEntryLocale>;
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* 数据字典项本地化资源配置
|
|
415
|
+
*/
|
|
416
|
+
export type RpdDataDictionaryEntryLocale = {
|
|
417
|
+
name: string;
|
|
418
|
+
description?: string;
|
|
381
419
|
};
|
|
382
420
|
export interface RpdDataModelExtension {
|
|
383
421
|
code: string;
|
|
@@ -585,7 +623,7 @@ export type EntityWatchHandlerContext<TEventName extends keyof RpdServerEventTyp
|
|
|
585
623
|
export interface EntityWatchPluginInitOptions {
|
|
586
624
|
watchers: EntityWatcherType[];
|
|
587
625
|
}
|
|
588
|
-
export interface
|
|
626
|
+
export interface LocaleString {
|
|
589
627
|
namespace: string;
|
|
590
628
|
name: string;
|
|
591
629
|
lingual: string;
|
package/package.json
CHANGED
|
@@ -36,8 +36,17 @@ export default {
|
|
|
36
36
|
type: "text",
|
|
37
37
|
required: false,
|
|
38
38
|
},
|
|
39
|
+
{
|
|
40
|
+
name: "i18n",
|
|
41
|
+
description: "The i18n text names of the model attributes.",
|
|
42
|
+
code: "i18n",
|
|
43
|
+
columnName: "i18n",
|
|
44
|
+
type: "json",
|
|
45
|
+
required: false,
|
|
46
|
+
},
|
|
39
47
|
{
|
|
40
48
|
name: "locales",
|
|
49
|
+
description: "The locale translations of the model attributes.",
|
|
41
50
|
code: "locales",
|
|
42
51
|
columnName: "locales",
|
|
43
52
|
type: "json",
|
|
@@ -215,8 +224,17 @@ export default {
|
|
|
215
224
|
type: "text",
|
|
216
225
|
required: false,
|
|
217
226
|
},
|
|
227
|
+
{
|
|
228
|
+
name: "i18n",
|
|
229
|
+
description: "The i18n text names of the property attributes.",
|
|
230
|
+
code: "i18n",
|
|
231
|
+
columnName: "i18n",
|
|
232
|
+
type: "json",
|
|
233
|
+
required: false,
|
|
234
|
+
},
|
|
218
235
|
{
|
|
219
236
|
name: "locales",
|
|
237
|
+
description: "The locale translations of the property attributes.",
|
|
220
238
|
code: "locales",
|
|
221
239
|
columnName: "locales",
|
|
222
240
|
type: "json",
|
|
@@ -344,14 +362,6 @@ export default {
|
|
|
344
362
|
type: "text",
|
|
345
363
|
required: false,
|
|
346
364
|
},
|
|
347
|
-
{
|
|
348
|
-
name: "i18n string storage",
|
|
349
|
-
code: "i18nStringStorage",
|
|
350
|
-
columnName: "i18n_string_storage",
|
|
351
|
-
description: "The storage type of i18n strings. `json` or `i18nStringsTable`.",
|
|
352
|
-
type: "text",
|
|
353
|
-
required: false,
|
|
354
|
-
},
|
|
355
365
|
],
|
|
356
366
|
indexes: [
|
|
357
367
|
{
|
|
@@ -458,8 +468,17 @@ export default {
|
|
|
458
468
|
targetSingularCode: "data_dictionary_entry",
|
|
459
469
|
selfIdColumnName: "dictionary_id",
|
|
460
470
|
},
|
|
471
|
+
{
|
|
472
|
+
name: "i18n",
|
|
473
|
+
description: "The i18n text names of the data dictionary attributes.",
|
|
474
|
+
code: "i18n",
|
|
475
|
+
columnName: "i18n",
|
|
476
|
+
type: "json",
|
|
477
|
+
required: false,
|
|
478
|
+
},
|
|
461
479
|
{
|
|
462
480
|
name: "locales",
|
|
481
|
+
description: "The locale translations of the data dictionary attributes.",
|
|
463
482
|
code: "locales",
|
|
464
483
|
columnName: "locales",
|
|
465
484
|
type: "json",
|
|
@@ -543,8 +562,17 @@ export default {
|
|
|
543
562
|
type: "boolean",
|
|
544
563
|
required: false,
|
|
545
564
|
},
|
|
565
|
+
{
|
|
566
|
+
name: "i18n",
|
|
567
|
+
description: "The i18n text names of the data dictionary entry attributes.",
|
|
568
|
+
code: "i18n",
|
|
569
|
+
columnName: "i18n",
|
|
570
|
+
type: "json",
|
|
571
|
+
required: false,
|
|
572
|
+
},
|
|
546
573
|
{
|
|
547
574
|
name: "locales",
|
|
575
|
+
description: "The locale translations of the data dictionary entry attributes.",
|
|
548
576
|
code: "locales",
|
|
549
577
|
columnName: "locales",
|
|
550
578
|
type: "json",
|
|
@@ -631,12 +659,12 @@ export default {
|
|
|
631
659
|
{
|
|
632
660
|
maintainedBy: "dataManager",
|
|
633
661
|
namespace: "meta",
|
|
634
|
-
name: "
|
|
635
|
-
code: "
|
|
636
|
-
singularCode: "
|
|
637
|
-
pluralCode: "
|
|
662
|
+
name: "locale strings",
|
|
663
|
+
code: "LocaleString",
|
|
664
|
+
singularCode: "locale_string",
|
|
665
|
+
pluralCode: "locale_strings",
|
|
638
666
|
schema: "public",
|
|
639
|
-
tableName: "
|
|
667
|
+
tableName: "meta_locale_strings",
|
|
640
668
|
properties: [
|
|
641
669
|
{
|
|
642
670
|
name: "id",
|
|
@@ -223,7 +223,7 @@ async function syncDatabaseSchema(server: IRpdServer, applicationConfig: RpdAppl
|
|
|
223
223
|
await server.queryDatabaseObject(`CREATE TABLE IF NOT EXISTS ${queryBuilder.quoteTable(model)} ()`, []);
|
|
224
224
|
}
|
|
225
225
|
if (!tableInDb || tableInDb.table_description != model.name) {
|
|
226
|
-
await server.
|
|
226
|
+
await server.tryQueryDatabaseObject(`COMMENT ON TABLE ${queryBuilder.quoteTable(model)} IS ${queryBuilder.formatValueToSqlLiteral(model.name)};`, []);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
|
|
@@ -264,7 +264,7 @@ async function syncDatabaseSchema(server: IRpdServer, applicationConfig: RpdAppl
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
if (!columnInDb || columnInDb.description != property.name) {
|
|
267
|
-
await server.
|
|
267
|
+
await server.tryQueryDatabaseObject(
|
|
268
268
|
`COMMENT ON COLUMN ${queryBuilder.quoteTable(model)}.${queryBuilder.quoteObject(
|
|
269
269
|
property.targetIdColumnName,
|
|
270
270
|
)} IS ${queryBuilder.formatValueToSqlLiteral(property.name)};`,
|
|
@@ -377,7 +377,7 @@ async function syncDatabaseSchema(server: IRpdServer, applicationConfig: RpdAppl
|
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
if (!columnInDb || columnInDb.description != property.name) {
|
|
380
|
-
await server.
|
|
380
|
+
await server.tryQueryDatabaseObject(
|
|
381
381
|
`COMMENT ON COLUMN ${queryBuilder.quoteTable(model)}.${queryBuilder.quoteObject(
|
|
382
382
|
property.columnName || property.code,
|
|
383
383
|
)} IS ${queryBuilder.formatValueToSqlLiteral(property.name)};`,
|
package/src/types.ts
CHANGED
|
@@ -227,11 +227,16 @@ export interface RpdDataModel {
|
|
|
227
227
|
/**
|
|
228
228
|
* 多语言配置
|
|
229
229
|
*/
|
|
230
|
+
i18n?: Record<string, string>;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* 本地化资源
|
|
234
|
+
*/
|
|
230
235
|
locales?: Record<string, RpdDataModelLocale>;
|
|
231
236
|
}
|
|
232
237
|
|
|
233
238
|
/**
|
|
234
|
-
*
|
|
239
|
+
* 实体本地化资源配置
|
|
235
240
|
*/
|
|
236
241
|
export type RpdDataModelLocale = {
|
|
237
242
|
name: string;
|
|
@@ -345,9 +350,17 @@ export interface RpdDataModelProperty {
|
|
|
345
350
|
/**
|
|
346
351
|
* 多语言配置
|
|
347
352
|
*/
|
|
353
|
+
i18n?: Record<string, string>;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* 本地化资源
|
|
357
|
+
*/
|
|
348
358
|
locales?: Record<string, RpdDataModelPropertyLocale>;
|
|
349
359
|
}
|
|
350
360
|
|
|
361
|
+
/**
|
|
362
|
+
* 实体属性本地化资源配置
|
|
363
|
+
*/
|
|
351
364
|
export type RpdDataModelPropertyLocale = {
|
|
352
365
|
name: string;
|
|
353
366
|
description?: string;
|
|
@@ -409,6 +422,21 @@ export type RpdDataDictionary = {
|
|
|
409
422
|
* 字典项
|
|
410
423
|
*/
|
|
411
424
|
entries: RpdDataDictionaryEntry[];
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* 多语言配置
|
|
428
|
+
*/
|
|
429
|
+
i18n?: Record<string, string>;
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* 本地化资源
|
|
433
|
+
*/
|
|
434
|
+
locales?: Record<string, RpdDataDictionaryLocale>;
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
export type RpdDataDictionaryLocale = {
|
|
438
|
+
name: string;
|
|
439
|
+
description?: string;
|
|
412
440
|
};
|
|
413
441
|
|
|
414
442
|
/**
|
|
@@ -449,6 +477,24 @@ export type RpdDataDictionaryEntry = {
|
|
|
449
477
|
* 是否禁用
|
|
450
478
|
*/
|
|
451
479
|
disabled: boolean;
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* 多语言配置
|
|
483
|
+
*/
|
|
484
|
+
i18n?: Record<string, string>;
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* 本地化资源
|
|
488
|
+
*/
|
|
489
|
+
locales?: Record<string, RpdDataDictionaryEntryLocale>;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* 数据字典项本地化资源配置
|
|
494
|
+
*/
|
|
495
|
+
export type RpdDataDictionaryEntryLocale = {
|
|
496
|
+
name: string;
|
|
497
|
+
description?: string;
|
|
452
498
|
};
|
|
453
499
|
|
|
454
500
|
export interface RpdDataModelExtension {
|
|
@@ -749,7 +795,7 @@ export interface EntityWatchPluginInitOptions {
|
|
|
749
795
|
watchers: EntityWatcherType[];
|
|
750
796
|
}
|
|
751
797
|
|
|
752
|
-
export interface
|
|
798
|
+
export interface LocaleString {
|
|
753
799
|
namespace: string;
|
|
754
800
|
name: string;
|
|
755
801
|
lingual: string;
|