@ruiapp/rapid-configure-tools 0.6.4 → 0.7.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/dist/mod.js +6 -0
- package/dist/rapid-models-updater/DictionaryEntryUpdater.d.ts +1 -1
- package/dist/rapid-models-updater/DictionaryUpdater.d.ts +1 -1
- package/dist/rapid-models-updater/ModelUpdater.d.ts +1 -1
- package/dist/rapid-models-updater/PropertyUpdater.d.ts +1 -1
- package/dist/rapid-models-updater/types.d.ts +2 -1
- package/package.json +4 -3
- package/src/meta-file-generator/generators/model-codes-generator.ts +1 -1
- package/src/meta-file-generator/generators/model-locales-generator.ts +1 -1
- package/src/meta-file-generator/generators/model-types-generator.ts +7 -1
- package/src/rapid-models-updater/DictionaryEntryUpdater.ts +1 -1
- package/src/rapid-models-updater/DictionaryUpdater.ts +1 -1
- package/src/rapid-models-updater/ModelUpdater.ts +1 -1
- package/src/rapid-models-updater/PageUpdater.ts +2 -1
- package/src/rapid-models-updater/PropertyUpdater.ts +1 -1
- package/src/rapid-models-updater/types.ts +2 -1
package/dist/mod.js
CHANGED
|
@@ -295,6 +295,9 @@ function generateDictionaryTypes(metaDir) {
|
|
|
295
295
|
for (const dictionary of dictionaries) {
|
|
296
296
|
codes.push(`/**`);
|
|
297
297
|
codes.push(` * ${dictionary.name}`);
|
|
298
|
+
if (dictionary.deprecated) {
|
|
299
|
+
codes.push(` * @deprecated ${dictionary.deprecationDescription || ""}`);
|
|
300
|
+
}
|
|
298
301
|
codes.push(` */`);
|
|
299
302
|
if (!dictionary.entries) {
|
|
300
303
|
codes.push(`export type ${dictionary.code} = any;`);
|
|
@@ -342,6 +345,9 @@ function generateEntityTypes(metaDir) {
|
|
|
342
345
|
for (const field of entity.fields) {
|
|
343
346
|
codes.push(` /**`);
|
|
344
347
|
codes.push(` * ${field.name}`);
|
|
348
|
+
if (field.deprecated) {
|
|
349
|
+
codes.push(` * @deprecated ${field.deprecationDescription || ""}`);
|
|
350
|
+
}
|
|
345
351
|
codes.push(` */`);
|
|
346
352
|
codes.push(` ${field.code}${field.required ? "" : "?"}: ${convertSdRpdFieldTypeToTypeScriptType(field, entities)};`);
|
|
347
353
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RapidDataDictionaryEntry } from "@ruiapp/rapid-
|
|
1
|
+
import type { RapidDataDictionaryEntry } from "@ruiapp/rapid-common";
|
|
2
2
|
import type { AxiosInstance } from "axios";
|
|
3
3
|
import type { RapidDataDictionaryWithId, RapidDataDictionaryEntryWithId } from "./types";
|
|
4
4
|
export declare function newDictionaryEntryUpdater(rapidConfigApi: AxiosInstance): import("./types").IRapidModelUpdaterBatchGetMode<RapidDataDictionaryEntryWithId, RapidDataDictionaryEntry, RapidDataDictionaryWithId>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RapidDataDictionary } from "@ruiapp/rapid-
|
|
1
|
+
import type { RapidDataDictionary } from "@ruiapp/rapid-common";
|
|
2
2
|
import type { AxiosInstance } from "axios";
|
|
3
3
|
import type { RapidDataDictionaryWithId } from "./types";
|
|
4
4
|
export declare function newDictionaryUpdater(rapidConfigApi: AxiosInstance): import("./types").IRapidModelUpdaterBatchGetMode<RapidDataDictionaryWithId, RapidDataDictionary, any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RapidEntity } from "@ruiapp/rapid-
|
|
1
|
+
import type { RapidEntity } from "@ruiapp/rapid-common";
|
|
2
2
|
import type { AxiosInstance } from "axios";
|
|
3
3
|
import type { RapidModel } from "./types";
|
|
4
4
|
export declare function newModelUpdater(rapidConfigApi: AxiosInstance): import("./types").IRapidModelUpdaterBatchGetMode<RapidModel, RapidEntity<string, string>, any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RapidField } from "@ruiapp/rapid-
|
|
1
|
+
import type { RapidField } from "@ruiapp/rapid-common";
|
|
2
2
|
import type { AxiosInstance } from "axios";
|
|
3
3
|
import type { RapidModel, RapidProperty } from "./types";
|
|
4
4
|
export declare function newPropertyUpdater(rapidConfigApi: AxiosInstance): import("./types").IRapidModelUpdaterBatchGetMode<RapidProperty, RapidField<string, string>, RapidModel>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { RapidDataDictionary, RapidDataDictionaryEntry, RapidEntity, RapidField
|
|
1
|
+
import type { RapidDataDictionary, RapidDataDictionaryEntry, RapidEntity, RapidField } from "@ruiapp/rapid-common";
|
|
2
|
+
import type { RapidPage } from "@ruiapp/rapid-extension";
|
|
2
3
|
export type IRapidModelUpdater<TEntity, TInput, TMainEntity = any> = IRapidModelUpdaterBatchGetMode<TEntity, TInput, TMainEntity> | IRapidModelUpdaterSingleGetMode<TEntity, TInput, TMainEntity>;
|
|
3
4
|
export interface IRapidModelUpdaterCommon<TEntity, TInput, TMainEntity> {
|
|
4
5
|
modelType: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruiapp/rapid-configure-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/mod.js",
|
|
6
6
|
"keywords": [],
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
"axios-cookiejar-support": "^4.0.7",
|
|
21
21
|
"lodash": "^4.17.21",
|
|
22
22
|
"tough-cookie": "^4.1.3",
|
|
23
|
-
"@ruiapp/rapid-
|
|
24
|
-
"@ruiapp/rapid-
|
|
23
|
+
"@ruiapp/rapid-extension": "^0.10.0",
|
|
24
|
+
"@ruiapp/rapid-common": "^0.1.0",
|
|
25
|
+
"@ruiapp/rapid-core": "^0.11.8"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {},
|
|
27
28
|
"scripts": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import { each, map, snakeCase } from "lodash";
|
|
3
3
|
import path from "path";
|
|
4
|
-
import type { RapidDataDictionary, RapidEntity } from "@ruiapp/rapid-
|
|
4
|
+
import type { RapidDataDictionary, RapidEntity } from "@ruiapp/rapid-common";
|
|
5
5
|
|
|
6
6
|
function generateEntitySingularCodes(modelsDir: string, metaDir: string, codes: string[]) {
|
|
7
7
|
const entities = require(path.join(metaDir, "entity-models")).default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import type { RapidDataDictionary, RapidEntity, RapidField } from "@ruiapp/rapid-
|
|
3
|
+
import type { RapidDataDictionary, RapidEntity, RapidField } from "@ruiapp/rapid-common";
|
|
4
4
|
|
|
5
5
|
function generateDictionaryLocales(metaDir: string) {
|
|
6
6
|
const dictionaries: RapidDataDictionary[] = require(path.join(metaDir, "data-dictionary-models")).default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import { uniq, find } from "lodash";
|
|
3
3
|
import path from "path";
|
|
4
|
-
import type { RapidDataDictionary, RapidEntity, RapidField } from "@ruiapp/rapid-
|
|
4
|
+
import type { RapidDataDictionary, RapidEntity, RapidField } from "@ruiapp/rapid-common";
|
|
5
5
|
|
|
6
6
|
function convertSdRpdFieldTypeToTypeScriptType(field: RapidField, entities: RapidEntity[]) {
|
|
7
7
|
const { type, dataDictionary, targetSingularCode, relation } = field;
|
|
@@ -54,6 +54,9 @@ function generateDictionaryTypes(metaDir: string) {
|
|
|
54
54
|
for (const dictionary of dictionaries) {
|
|
55
55
|
codes.push(`/**`);
|
|
56
56
|
codes.push(` * ${dictionary.name}`);
|
|
57
|
+
if (dictionary.deprecated) {
|
|
58
|
+
codes.push(` * @deprecated ${dictionary.deprecationDescription || ""}`);
|
|
59
|
+
}
|
|
57
60
|
codes.push(` */`);
|
|
58
61
|
if (!dictionary.entries) {
|
|
59
62
|
codes.push(`export type ${dictionary.code} = any;`);
|
|
@@ -107,6 +110,9 @@ function generateEntityTypes(metaDir: string) {
|
|
|
107
110
|
for (const field of entity.fields) {
|
|
108
111
|
codes.push(` /**`);
|
|
109
112
|
codes.push(` * ${field.name}`);
|
|
113
|
+
if (field.deprecated) {
|
|
114
|
+
codes.push(` * @deprecated ${field.deprecationDescription || ""}`);
|
|
115
|
+
}
|
|
110
116
|
codes.push(` */`);
|
|
111
117
|
codes.push(` ${field.code}${field.required ? "" : "?"}: ${convertSdRpdFieldTypeToTypeScriptType(field, entities)};`);
|
|
112
118
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RapidDataDictionaryEntry } from "@ruiapp/rapid-
|
|
1
|
+
import type { RapidDataDictionaryEntry } from "@ruiapp/rapid-common";
|
|
2
2
|
import type { AxiosInstance } from "axios";
|
|
3
3
|
import { detectChangedFields } from "../utils/ObjectChangesDetector";
|
|
4
4
|
import type {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RapidDataDictionary } from "@ruiapp/rapid-
|
|
1
|
+
import type { RapidDataDictionary } from "@ruiapp/rapid-common";
|
|
2
2
|
import type { AxiosInstance } from "axios";
|
|
3
3
|
import { pick } from "lodash";
|
|
4
4
|
import { detectChangedFields } from "../utils/ObjectChangesDetector";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { FindEntityOptions
|
|
1
|
+
import type { FindEntityOptions } from "@ruiapp/rapid-common";
|
|
2
|
+
import type { RapidPage } from "@ruiapp/rapid-extension";
|
|
2
3
|
import type { AxiosInstance } from "axios";
|
|
3
4
|
import { detectChangedFields } from "../utils/ObjectChangesDetector";
|
|
4
5
|
import type { CreateRapidPageInput, IRapidModelUpdater, UpdateRapidPageInput, RapidPageEntity } from "./types";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RapidField } from "@ruiapp/rapid-
|
|
1
|
+
import type { RapidField } from "@ruiapp/rapid-common";
|
|
2
2
|
import type { AxiosInstance } from "axios";
|
|
3
3
|
import { detectChangedFields } from "../utils/ObjectChangesDetector";
|
|
4
4
|
import type { RapidModel, RapidProperty, CreateRapidPropertyInput, IRapidModelUpdater, UpdateRapidPropertyInput } from "./types";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { RapidDataDictionary, RapidDataDictionaryEntry, RapidEntity, RapidField
|
|
1
|
+
import type { RapidDataDictionary, RapidDataDictionaryEntry, RapidEntity, RapidField } from "@ruiapp/rapid-common";
|
|
2
|
+
import type { RapidPage } from "@ruiapp/rapid-extension";
|
|
2
3
|
|
|
3
4
|
export type IRapidModelUpdater<TEntity, TInput, TMainEntity = any> =
|
|
4
5
|
| IRapidModelUpdaterBatchGetMode<TEntity, TInput, TMainEntity>
|