@ruiapp/rapid-configure-tools 0.5.2 → 0.6.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 CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var path = require('path');
6
6
  var fs = require('fs');
7
7
  var lodash = require('lodash');
8
+ var rapidCore = require('@ruiapp/rapid-core');
8
9
  var axios = require('axios');
9
10
  var axiosCookiejarSupport = require('axios-cookiejar-support');
10
11
  var toughCookie = require('tough-cookie');
@@ -15,59 +16,12 @@ var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
15
16
  var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
16
17
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
17
18
 
18
- function ensureDirectoryExists(dirPath) {
19
- if (!fs__default["default"].existsSync(dirPath)) {
20
- const parentDirPath = path__default["default"].dirname(dirPath);
21
- ensureDirectoryExists(parentDirPath);
22
- fs__default["default"].mkdirSync(dirPath);
23
- }
24
- }
25
- function enumFileBaseNamesInDirectory(options) {
26
- const { dirPath, prefix, fileNameFilter } = options;
27
- let fileNames = [];
28
- let resolvedDirPath = dirPath;
29
- const isRelative = dirPath.startsWith(".") || dirPath.startsWith("..");
30
- if (isRelative) {
31
- resolvedDirPath = path__default["default"].join(process.cwd(), dirPath);
32
- }
33
- if (!fs__default["default"].existsSync(resolvedDirPath)) {
34
- console.warn(`Directory '${resolvedDirPath}' not found.`);
35
- return [];
36
- }
37
- const files = fs__default["default"].readdirSync(resolvedDirPath);
38
- for (const fileName of files) {
39
- const filePathName = path__default["default"].join(resolvedDirPath, fileName);
40
- const fileStat = fs__default["default"].statSync(filePathName);
41
- if (fileStat.isDirectory()) {
42
- fileNames = fileNames.concat(enumFileBaseNamesInDirectory({
43
- dirPath: filePathName,
44
- prefix: prefix ? `${prefix}/${fileName}` : fileName,
45
- fileNameFilter,
46
- }));
47
- }
48
- else if (fileStat.isFile()) {
49
- if (fileNameFilter && !fileNameFilter(fileName)) {
50
- continue;
51
- }
52
- const baseName = path__default["default"].parse(fileName).name;
53
- if (prefix) {
54
- fileNames.push(`${prefix}/${baseName}`);
55
- }
56
- else {
57
- fileNames.push(baseName);
58
- }
59
- }
60
- }
61
- fileNames.sort();
62
- return fileNames;
63
- }
64
-
65
19
  /**
66
20
  * 用于生成模型索引文件,将模型定义按照类型分别导出。
67
21
  */
68
22
  function generateEntityModelIndexFilesOfTypeDir({ modelsDir, outputDir, typeDefFilePath, categoryDirName, modelTypeName, modelsFileName, extraImports, modelWrapper, flattenModelArray, }) {
69
23
  const filesDir = path__default["default"].join(modelsDir, categoryDirName);
70
- const fileNames = enumFileBaseNamesInDirectory({
24
+ const fileNames = rapidCore.enumFileBaseNamesInDirectory({
71
25
  dirPath: filesDir,
72
26
  fileNameFilter(fileName) {
73
27
  return !(fileName.endsWith(".test.js") || fileName.endsWith(".test.ts"));
@@ -126,7 +80,7 @@ function generateEntityModelIndexFilesOfTypeDir({ modelsDir, outputDir, typeDefF
126
80
  }
127
81
  function generateModelIndexFilesOfTypeDir({ modelsDir, outputDir, typeDefFilePath, categoryDirName, modelTypeName, modelsFileName, extraImports, modelWrapper, flattenModelArray, }) {
128
82
  const filesDir = path__default["default"].join(modelsDir, categoryDirName);
129
- const fileNames = enumFileBaseNamesInDirectory({
83
+ const fileNames = rapidCore.enumFileBaseNamesInDirectory({
130
84
  dirPath: filesDir,
131
85
  fileNameFilter(fileName) {
132
86
  return !(fileName.endsWith(".test.js") || fileName.endsWith(".test.ts"));
@@ -182,7 +136,7 @@ function generateModelIndexFiles(declarationsDirectory) {
182
136
  const modelsDir = path__default["default"].join(declarationsDirectory, "models");
183
137
  const outputDir = path__default["default"].join(declarationsDirectory, "meta");
184
138
  const typeDefFilePath = "@ruiapp/rapid-extension";
185
- ensureDirectoryExists(outputDir);
139
+ rapidCore.ensureDirectoryExists(outputDir);
186
140
  generateEntityModelIndexFilesOfTypeDir({
187
141
  modelsDir,
188
142
  outputDir,
@@ -610,7 +564,7 @@ class RapidUpdater {
610
564
  }
611
565
  }
612
566
  for (const entityToSave of entitiesToSave) {
613
- if (!modelUpdater.relationFields) {
567
+ if (!modelUpdater.relationFields || !modelUpdater.relationFields.length) {
614
568
  continue;
615
569
  }
616
570
  console.log(`update relation fields of ${modelUpdater.modelType} ${modelUpdater.inputTitlePrinter(entityToSave)}`);
@@ -954,13 +908,114 @@ function newPropertyUpdater(rapidConfigApi) {
954
908
  return propertyUpdater;
955
909
  }
956
910
 
911
+ function convertInputToEntity(input) {
912
+ const inputEntity = {
913
+ subSystem: input.subSystem,
914
+ appCode: input.appCode,
915
+ code: input.code,
916
+ parentCode: input.parentCode,
917
+ routePath: input.routePath,
918
+ name: input.name,
919
+ title: input.title,
920
+ permissionCheck: input.permissionCheck,
921
+ config: {
922
+ view: input.view,
923
+ stores: input.stores,
924
+ eventSubscriptions: input.eventSubscriptions,
925
+ functions: input.functions,
926
+ $i18n: input.$i18n,
927
+ $locales: input.$locales,
928
+ },
929
+ };
930
+ return inputEntity;
931
+ }
932
+ function newPageUpdater(rapidConfigApi) {
933
+ const pageUpdater = {
934
+ modelType: "page",
935
+ relationFields: [],
936
+ entityBatchMode: false,
937
+ inputTitlePrinter(input) {
938
+ return input.code;
939
+ },
940
+ entityKeyGetter(input) {
941
+ return input.code;
942
+ },
943
+ async entitySingleFinder(entityKey) {
944
+ const res = await rapidConfigApi.post(`meta/pages/operations/find`, {
945
+ filters: [
946
+ {
947
+ operator: "eq",
948
+ field: "code",
949
+ value: entityKey,
950
+ },
951
+ ],
952
+ });
953
+ const entities = res.data.list;
954
+ if (entities && entities.length) {
955
+ return entities[0];
956
+ }
957
+ return null;
958
+ },
959
+ entityExistensePredicate(input, entity) {
960
+ return entity.code === input.code;
961
+ },
962
+ isEntityChanged(input, remoteEntity) {
963
+ const inputEntity = convertInputToEntity(input);
964
+ const changedFieldNames = detectChangedFields(inputEntity, remoteEntity, [
965
+ "subSystem",
966
+ "appCode",
967
+ "code",
968
+ "parentCode",
969
+ "routePath",
970
+ "name",
971
+ "title",
972
+ "config",
973
+ "permissionCheck",
974
+ ]);
975
+ if (changedFieldNames.length) {
976
+ console.log(`${this.modelType} ${this.inputTitlePrinter(inputEntity)} changed with these fields:`, changedFieldNames);
977
+ }
978
+ return changedFieldNames.length > 0;
979
+ },
980
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
981
+ async createEntity(input, mainEntity, inputIndex) {
982
+ const createEntityInput = convertInputToEntity(input);
983
+ const res = await rapidConfigApi.post(`meta/pages`, createEntityInput);
984
+ const { data } = res;
985
+ if (!data.id) {
986
+ console.log("Response:");
987
+ console.log(data);
988
+ console.log("Input:");
989
+ console.log(createEntityInput);
990
+ }
991
+ return data;
992
+ },
993
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
994
+ async updateEntity(input, remoteEntity, mainEntity, inputIndex) {
995
+ const updateEntityInput = convertInputToEntity(input);
996
+ const res = await rapidConfigApi.patch(`meta/pages/${remoteEntity.id}`, updateEntityInput);
997
+ const { data } = res;
998
+ if (!data.id) {
999
+ console.log("Response:");
1000
+ console.log(data);
1001
+ console.log("Input:");
1002
+ console.log(updateEntityInput);
1003
+ }
1004
+ return data;
1005
+ },
1006
+ };
1007
+ return pageUpdater;
1008
+ }
1009
+
957
1010
  class RapidModelsUpdater {
958
1011
  #rapidConfigApi;
959
1012
  #entities;
960
1013
  #dataDictionaries;
1014
+ #pages;
961
1015
  constructor(options) {
962
1016
  this.#entities = options.entities;
963
1017
  this.#dataDictionaries = options.dataDictionaries;
1018
+ this.#pages = options.pages;
964
1019
  const { appDataDirLocation, rapidApiUrl } = options;
965
1020
  const cookieJarStorageLocation = path__default["default"].join(appDataDirLocation, "rapid-cookie-jar.json");
966
1021
  if (!fs__default["default"].existsSync(appDataDirLocation)) {
@@ -990,6 +1045,7 @@ class RapidModelsUpdater {
990
1045
  newDictionaryEntryUpdater(rapidConfigApi),
991
1046
  newModelUpdater(rapidConfigApi),
992
1047
  newPropertyUpdater(rapidConfigApi),
1048
+ newPageUpdater(rapidConfigApi),
993
1049
  ],
994
1050
  });
995
1051
  appUpdater.updateModels([
@@ -1001,6 +1057,10 @@ class RapidModelsUpdater {
1001
1057
  modelType: "model",
1002
1058
  entities: this.#entities.filter((item) => !item.metaOnly),
1003
1059
  },
1060
+ {
1061
+ modelType: "page",
1062
+ entities: this.#pages,
1063
+ },
1004
1064
  ]);
1005
1065
  }
1006
1066
  }
@@ -0,0 +1,4 @@
1
+ import type { RapidPage } from "@ruiapp/rapid-extension";
2
+ import type { AxiosInstance } from "axios";
3
+ import type { RapidPageEntity } from "./types";
4
+ export declare function newPageUpdater(rapidConfigApi: AxiosInstance): import("./types").IRapidModelUpdaterSingleGetMode<RapidPageEntity, RapidPage, any>;
@@ -1,9 +1,10 @@
1
- import type { RapidDataDictionary, RapidEntity } from "@ruiapp/rapid-extension";
1
+ import type { RapidDataDictionary, RapidEntity, RapidPage } from "@ruiapp/rapid-extension";
2
2
  export interface RapidModelsUpdateOptions {
3
3
  appDataDirLocation: string;
4
4
  rapidApiUrl: string;
5
5
  entities: RapidEntity[];
6
6
  dataDictionaries: RapidDataDictionary[];
7
+ pages: RapidPage[];
7
8
  }
8
9
  export default class RapidModelsUpdater {
9
10
  #private;
@@ -1,4 +1,4 @@
1
- import type { RapidDataDictionary, RapidDataDictionaryEntry, RapidEntity, RapidField } from "@ruiapp/rapid-extension";
1
+ import type { RapidDataDictionary, RapidDataDictionaryEntry, RapidEntity, RapidField, RapidPage } from "@ruiapp/rapid-extension";
2
2
  export type IRapidModelUpdater<TEntity, TInput, TMainEntity = any> = IRapidModelUpdaterBatchGetMode<TEntity, TInput, TMainEntity> | IRapidModelUpdaterSingleGetMode<TEntity, TInput, TMainEntity>;
3
3
  export interface IRapidModelUpdaterCommon<TEntity, TInput, TMainEntity> {
4
4
  modelType: string;
@@ -43,3 +43,17 @@ export type CreateRapidPropertyInput = RapidField & {
43
43
  };
44
44
  export type UpdateRapidPropertyInput = CreateRapidPropertyInput;
45
45
  export type RapidProperty = ObjWithIdProp & RapidField;
46
+ export type CreateRapidPageInput = RapidPage;
47
+ export type UpdateRapidPageInput = CreateRapidPageInput;
48
+ export type RapidPageEntity = {
49
+ id?: string;
50
+ subSystem?: string;
51
+ appCode?: string;
52
+ code: string;
53
+ parentCode?: string;
54
+ routePath?: string;
55
+ name: string;
56
+ title?: string;
57
+ config?: Record<any, any>;
58
+ permissionCheck?: Record<any, any>;
59
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruiapp/rapid-configure-tools",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "",
5
5
  "main": "dist/mod.js",
6
6
  "keywords": [],
@@ -20,7 +20,8 @@
20
20
  "axios-cookiejar-support": "^4.0.7",
21
21
  "lodash": "^4.17.21",
22
22
  "tough-cookie": "^4.1.3",
23
- "@ruiapp/rapid-extension": "^0.5.26"
23
+ "@ruiapp/rapid-extension": "^0.6.0",
24
+ "@ruiapp/rapid-core": "^0.10.0"
24
25
  },
25
26
  "dependencies": {},
26
27
  "scripts": {
@@ -5,7 +5,7 @@
5
5
  import fs from "fs";
6
6
  import { forEach } from "lodash";
7
7
  import path from "path";
8
- import { ensureDirectoryExists, enumFileBaseNamesInDirectory } from "../../utils/file-utility";
8
+ import { ensureDirectoryExists, enumFileBaseNamesInDirectory } from "@ruiapp/rapid-core";
9
9
 
10
10
  interface GenerateModelsIndexFileOption {
11
11
  /**
@@ -62,7 +62,7 @@ export default class RapidUpdater {
62
62
  }
63
63
 
64
64
  for (const entityToSave of entitiesToSave) {
65
- if (!modelUpdater.relationFields) {
65
+ if (!modelUpdater.relationFields || !modelUpdater.relationFields.length) {
66
66
  continue;
67
67
  }
68
68
 
@@ -0,0 +1,115 @@
1
+ import type { FindEntityOptions, RapidPage } from "@ruiapp/rapid-extension";
2
+ import type { AxiosInstance } from "axios";
3
+ import { detectChangedFields } from "./ObjectChangesDetector";
4
+ import type { CreateRapidPageInput, IRapidModelUpdater, UpdateRapidPageInput, RapidPageEntity } from "./types";
5
+
6
+ function convertInputToEntity(input: RapidPage) {
7
+ const inputEntity: RapidPageEntity = {
8
+ subSystem: input.subSystem,
9
+ appCode: input.appCode,
10
+ code: input.code,
11
+ parentCode: input.parentCode,
12
+ routePath: input.routePath,
13
+ name: input.name,
14
+ title: input.title,
15
+ permissionCheck: input.permissionCheck,
16
+ config: {
17
+ view: input.view,
18
+ stores: input.stores,
19
+ eventSubscriptions: input.eventSubscriptions,
20
+ functions: input.functions,
21
+ $i18n: input.$i18n,
22
+ $locales: input.$locales,
23
+ },
24
+ };
25
+ return inputEntity;
26
+ }
27
+
28
+ export function newPageUpdater(rapidConfigApi: AxiosInstance) {
29
+ const pageUpdater: IRapidModelUpdater<RapidPageEntity, RapidPage> = {
30
+ modelType: "page",
31
+ relationFields: [],
32
+
33
+ entityBatchMode: false,
34
+
35
+ inputTitlePrinter(input) {
36
+ return input.code;
37
+ },
38
+
39
+ entityKeyGetter(input) {
40
+ return input.code;
41
+ },
42
+
43
+ async entitySingleFinder(entityKey: string) {
44
+ const res = await rapidConfigApi.post(`meta/pages/operations/find`, {
45
+ filters: [
46
+ {
47
+ operator: "eq",
48
+ field: "code",
49
+ value: entityKey,
50
+ },
51
+ ],
52
+ } satisfies FindEntityOptions);
53
+
54
+ const entities = res.data.list;
55
+ if (entities && entities.length) {
56
+ return entities[0];
57
+ }
58
+
59
+ return null;
60
+ },
61
+
62
+ entityExistensePredicate(input, entity) {
63
+ return entity.code === input.code;
64
+ },
65
+
66
+ isEntityChanged(input, remoteEntity) {
67
+ const inputEntity = convertInputToEntity(input);
68
+ const changedFieldNames = detectChangedFields(inputEntity, remoteEntity, [
69
+ "subSystem",
70
+ "appCode",
71
+ "code",
72
+ "parentCode",
73
+ "routePath",
74
+ "name",
75
+ "title",
76
+ "config",
77
+ "permissionCheck",
78
+ ]);
79
+ if (changedFieldNames.length) {
80
+ console.log(`${this.modelType} ${this.inputTitlePrinter(inputEntity)} changed with these fields:`, changedFieldNames);
81
+ }
82
+ return changedFieldNames.length > 0;
83
+ },
84
+
85
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
86
+ async createEntity(input, mainEntity, inputIndex) {
87
+ const createEntityInput: CreateRapidPageInput = convertInputToEntity(input);
88
+ const res = await rapidConfigApi.post(`meta/pages`, createEntityInput);
89
+ const { data } = res;
90
+ if (!data.id) {
91
+ console.log("Response:");
92
+ console.log(data);
93
+ console.log("Input:");
94
+ console.log(createEntityInput);
95
+ }
96
+ return data;
97
+ },
98
+
99
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
100
+ async updateEntity(input, remoteEntity, mainEntity, inputIndex) {
101
+ const updateEntityInput: UpdateRapidPageInput = convertInputToEntity(input);
102
+ const res = await rapidConfigApi.patch(`meta/pages/${remoteEntity.id}`, updateEntityInput);
103
+ const { data } = res;
104
+ if (!data.id) {
105
+ console.log("Response:");
106
+ console.log(data);
107
+ console.log("Input:");
108
+ console.log(updateEntityInput);
109
+ }
110
+ return data;
111
+ },
112
+ };
113
+
114
+ return pageUpdater;
115
+ }
@@ -8,23 +8,27 @@ import { newDictionaryUpdater } from "./DictionaryUpdater";
8
8
  import { newDictionaryEntryUpdater } from "./DictionaryEntryUpdater";
9
9
  import { newModelUpdater } from "./ModelUpdater";
10
10
  import { newPropertyUpdater } from "./PropertyUpdater";
11
- import type { RapidDataDictionary, RapidEntity } from "@ruiapp/rapid-extension";
11
+ import type { RapidDataDictionary, RapidEntity, RapidPage } from "@ruiapp/rapid-extension";
12
+ import { newPageUpdater } from "./PageUpdater";
12
13
 
13
14
  export interface RapidModelsUpdateOptions {
14
15
  appDataDirLocation: string;
15
16
  rapidApiUrl: string;
16
17
  entities: RapidEntity[];
17
18
  dataDictionaries: RapidDataDictionary[];
19
+ pages: RapidPage[];
18
20
  }
19
21
 
20
22
  export default class RapidModelsUpdater {
21
23
  #rapidConfigApi: AxiosInstance;
22
24
  #entities: RapidEntity[];
23
25
  #dataDictionaries: RapidDataDictionary[];
26
+ #pages: RapidPage[];
24
27
 
25
28
  constructor(options: RapidModelsUpdateOptions) {
26
29
  this.#entities = options.entities;
27
30
  this.#dataDictionaries = options.dataDictionaries;
31
+ this.#pages = options.pages;
28
32
 
29
33
  const { appDataDirLocation, rapidApiUrl } = options;
30
34
 
@@ -61,6 +65,7 @@ export default class RapidModelsUpdater {
61
65
  newDictionaryEntryUpdater(rapidConfigApi),
62
66
  newModelUpdater(rapidConfigApi),
63
67
  newPropertyUpdater(rapidConfigApi),
68
+ newPageUpdater(rapidConfigApi),
64
69
  ],
65
70
  });
66
71
  appUpdater.updateModels([
@@ -72,6 +77,10 @@ export default class RapidModelsUpdater {
72
77
  modelType: "model",
73
78
  entities: this.#entities.filter((item) => !item.metaOnly),
74
79
  },
80
+ {
81
+ modelType: "page",
82
+ entities: this.#pages,
83
+ },
75
84
  ]);
76
85
  }
77
86
  }
@@ -1,4 +1,4 @@
1
- import type { RapidDataDictionary, RapidDataDictionaryEntry, RapidEntity, RapidField } from "@ruiapp/rapid-extension";
1
+ import type { RapidDataDictionary, RapidDataDictionaryEntry, RapidEntity, RapidField, RapidPage } from "@ruiapp/rapid-extension";
2
2
 
3
3
  export type IRapidModelUpdater<TEntity, TInput, TMainEntity = any> =
4
4
  | IRapidModelUpdaterBatchGetMode<TEntity, TInput, TMainEntity>
@@ -62,3 +62,19 @@ export type CreateRapidPropertyInput = RapidField & {
62
62
  export type UpdateRapidPropertyInput = CreateRapidPropertyInput;
63
63
 
64
64
  export type RapidProperty = ObjWithIdProp & RapidField;
65
+
66
+ export type CreateRapidPageInput = RapidPage;
67
+ export type UpdateRapidPageInput = CreateRapidPageInput;
68
+
69
+ export type RapidPageEntity = {
70
+ id?: string;
71
+ subSystem?: string;
72
+ appCode?: string;
73
+ code: string;
74
+ parentCode?: string;
75
+ routePath?: string;
76
+ name: string;
77
+ title?: string;
78
+ config?: Record<any, any>;
79
+ permissionCheck?: Record<any, any>;
80
+ };
@@ -1,7 +0,0 @@
1
- export declare function ensureDirectoryExists(dirPath: string): void;
2
- export type EnumFileBaseNamesOptions = {
3
- dirPath: string;
4
- prefix?: string;
5
- fileNameFilter?: (fileName: string) => boolean;
6
- };
7
- export declare function enumFileBaseNamesInDirectory(options: EnumFileBaseNamesOptions): string[];
@@ -1,62 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
-
4
- export function ensureDirectoryExists(dirPath: string) {
5
- if (!fs.existsSync(dirPath)) {
6
- const parentDirPath = path.dirname(dirPath);
7
- ensureDirectoryExists(parentDirPath);
8
-
9
- fs.mkdirSync(dirPath);
10
- }
11
- }
12
-
13
- export type EnumFileBaseNamesOptions = {
14
- dirPath: string;
15
- prefix?: string;
16
- fileNameFilter?: (fileName: string) => boolean;
17
- };
18
-
19
- export function enumFileBaseNamesInDirectory(options: EnumFileBaseNamesOptions): string[] {
20
- const { dirPath, prefix, fileNameFilter } = options;
21
- let fileNames = [];
22
-
23
- let resolvedDirPath = dirPath;
24
- const isRelative = dirPath.startsWith(".") || dirPath.startsWith("..");
25
- if (isRelative) {
26
- resolvedDirPath = path.join(process.cwd(), dirPath);
27
- }
28
-
29
- if (!fs.existsSync(resolvedDirPath)) {
30
- console.warn(`Directory '${resolvedDirPath}' not found.`);
31
- return [];
32
- }
33
-
34
- const files = fs.readdirSync(resolvedDirPath);
35
- for (const fileName of files) {
36
- const filePathName = path.join(resolvedDirPath, fileName);
37
- const fileStat = fs.statSync(filePathName);
38
- if (fileStat.isDirectory()) {
39
- fileNames = fileNames.concat(
40
- enumFileBaseNamesInDirectory({
41
- dirPath: filePathName,
42
- prefix: prefix ? `${prefix}/${fileName}` : fileName,
43
- fileNameFilter,
44
- }),
45
- );
46
- } else if (fileStat.isFile()) {
47
- if (fileNameFilter && !fileNameFilter(fileName)) {
48
- continue;
49
- }
50
-
51
- const baseName = path.parse(fileName).name;
52
- if (prefix) {
53
- fileNames.push(`${prefix}/${baseName}`);
54
- } else {
55
- fileNames.push(baseName);
56
- }
57
- }
58
- }
59
-
60
- fileNames.sort();
61
- return fileNames;
62
- }