@opengis/fastify-table 1.4.28 → 1.4.29
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/package.json +1 -1
- package/server/plugins/file/isFileExists.js +2 -2
- package/server/plugins/file/uploadMultiPart.js +2 -1
- package/server/plugins/file/utils/getPath.js +1 -1
- package/server/plugins/file/utils/isFileExists.js +1 -0
- package/server/plugins/file/utils/uploadFileDisk.js +1 -1
- package/server/plugins/grpc/grpc.js +2 -1
- package/server/plugins/grpc/office2pdf.js +2 -1
- package/server/routes/file/controllers/export.js +14 -8
- package/server/routes/file/controllers/utils/{convertJSONToXls.js → jsonToXls.js} +1 -2
- package/server/routes/menu/controllers/getMenu.js +4 -3
- package/server/routes/table/controllers/tableData.js +5 -3
- package/server/routes/table/functions/getData.js +17 -3
- package/utils.js +4 -0
- /package/server/routes/file/controllers/utils/{convertJSONToCSV.js → jsonToCsv.js} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import path from 'path';
|
|
1
|
+
import path from 'node:path';
|
|
2
2
|
import providers from './providers/index.js';
|
|
3
3
|
|
|
4
|
-
async function isFileExists(filePath, options = {
|
|
4
|
+
async function isFileExists(filePath, options = {}) {
|
|
5
5
|
const filename = path.basename(filePath);
|
|
6
6
|
|
|
7
7
|
// prefix
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { mkdir } from 'node:fs/promises';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import config from '../../../config.js';
|
|
5
5
|
|
|
6
6
|
import providers from './providers/index.js';
|
|
7
|
+
|
|
7
8
|
import uploadFileDisk from './utils/uploadFileDisk.js';
|
|
8
9
|
|
|
9
10
|
import { all, images } from './utils/allowedExtensions.js';
|
|
@@ -4,7 +4,7 @@ import { rename, readFile, writeFile } from 'node:fs/promises';
|
|
|
4
4
|
import { formidable } from 'formidable';
|
|
5
5
|
import { imageSize } from 'image-size';
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import config from '../../../../config.js';
|
|
8
8
|
|
|
9
9
|
import { images } from './allowedExtensions.js';
|
|
10
10
|
import grpc from '../../grpc/grpc.js';
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import grpc from '@grpc/grpc-js';
|
|
3
3
|
import protoLoader from '@grpc/proto-loader';
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import config from '../../../config.js';
|
|
6
|
+
import logger from '../logger/getLogger.js';
|
|
6
7
|
|
|
7
8
|
config.ready = config.ready || {};
|
|
8
9
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import grpc from '@grpc/grpc-js';
|
|
3
3
|
import protoLoader from '@grpc/proto-loader';
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import config from '../../../config.js';
|
|
6
|
+
import logger from '../logger/getLogger.js';
|
|
6
7
|
|
|
7
8
|
config.ready = config.ready || {};
|
|
8
9
|
|
|
@@ -9,12 +9,18 @@ import {
|
|
|
9
9
|
mkdir, readFile, rm, writeFile,
|
|
10
10
|
} from 'node:fs/promises';
|
|
11
11
|
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
import
|
|
12
|
+
import config from '../../../../config.js';
|
|
13
|
+
import logger from '../../../plugins/logger/getLogger.js';
|
|
14
|
+
import getTemplate from '../../../plugins/table/funcs/getTemplate.js';
|
|
15
|
+
import getMeta from '../../../plugins/pg/funcs/getMeta.js';
|
|
16
|
+
import pgClients from '../../../plugins/pg/pgClients.js';
|
|
17
|
+
import eventStream from '../../../plugins/util/funcs/eventStream.js';
|
|
18
|
+
import getData from '../../table/functions/getData.js';
|
|
19
|
+
import getFolder from '../../../plugins/crud/funcs/utils/getFolder.js';
|
|
20
|
+
import metaFormat from '../../../plugins/table/funcs/metaFormat/index.js';
|
|
21
|
+
|
|
22
|
+
import jsonToXls from './utils/jsonToXls.js';
|
|
23
|
+
import jsonToCsv from './utils/jsonToCsv.js';
|
|
18
24
|
import formatResult from './utils/formatResult.js';
|
|
19
25
|
|
|
20
26
|
const startStreamWithTotal = 10000;
|
|
@@ -262,12 +268,12 @@ export default async function exportTable({
|
|
|
262
268
|
const resp = {};
|
|
263
269
|
|
|
264
270
|
if (format === 'csv') {
|
|
265
|
-
await
|
|
271
|
+
await jsonToCsv({
|
|
266
272
|
filePath: filePathJSON, send, colmodel, domain: host, source, columnList,
|
|
267
273
|
});
|
|
268
274
|
}
|
|
269
275
|
if (format === 'xlsx') {
|
|
270
|
-
await
|
|
276
|
+
await jsonToXls({
|
|
271
277
|
filePath: filePathJSON, send, colmodel, domain: host, source, resp,
|
|
272
278
|
});
|
|
273
279
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
|
|
4
|
+
import logger from '../../../../plugins/logger/getLogger.js';
|
|
6
5
|
import grpc from '../../../../plugins/grpc/grpc.js';
|
|
7
6
|
|
|
8
7
|
const { jsonToXls } = grpc();
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import config from '../../../../config.js';
|
|
8
|
+
import pgClients from '../../../plugins/pg/pgClients.js';
|
|
9
|
+
import applyHook from '../../../plugins/hook/funcs/applyHook.js';
|
|
10
|
+
import menuDirs from '../../../plugins/table/funcs/menuDirs.js';
|
|
10
11
|
|
|
11
12
|
const menuCache = [];
|
|
12
13
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import getToken from '../../../plugins/crud/funcs/getToken.js';
|
|
2
|
+
import getOpt from '../../../plugins/crud/funcs/getOpt.js';
|
|
3
|
+
import getTemplate from '../../../plugins/table/funcs/getTemplate.js';
|
|
4
|
+
import getMeta from '../../../plugins/pg/funcs/getMeta.js';
|
|
5
|
+
import pgClients from '../../../plugins/pg/pgClients.js';
|
|
4
6
|
|
|
5
7
|
import getData from '../functions/getData.js';
|
|
6
8
|
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import config from '../../../../config.js';
|
|
2
|
+
import { handlebars, handlebarsSync } from '../../../helpers/index.js';
|
|
3
|
+
|
|
4
|
+
import getFilterSQL from '../../../plugins/table/funcs/getFilterSQL/index.js';
|
|
5
|
+
import getAccess from '../../../plugins/crud/funcs/getAccess.js';
|
|
6
|
+
import setToken from '../../../plugins/crud/funcs/setToken.js';
|
|
7
|
+
import gisIRColumn from '../../../plugins/table/funcs/gisIRColumn.js';
|
|
8
|
+
import applyHook from '../../../plugins/hook/funcs/applyHook.js';
|
|
9
|
+
import getSelect from '../../../plugins/table/funcs/getSelect.js';
|
|
10
|
+
import setOpt from '../../../plugins/crud/funcs/setOpt.js';
|
|
11
|
+
import getOpt from '../../../plugins/crud/funcs/getOpt.js';
|
|
12
|
+
import getFilter from '../../../plugins/table/funcs/getFilter.js';
|
|
13
|
+
import logger from '../../../plugins/logger/getLogger.js';
|
|
14
|
+
import getTemplate from '../../../plugins/table/funcs/getTemplate.js';
|
|
15
|
+
import getMeta from '../../../plugins/pg/funcs/getMeta.js';
|
|
16
|
+
import pgClients from '../../../plugins/pg/pgClients.js';
|
|
17
|
+
import metaFormat from '../../../plugins/table/funcs/metaFormat/index.js';
|
|
4
18
|
|
|
5
19
|
import extraDataGet from '../../../plugins/extra/extraDataGet.js';
|
|
6
20
|
|
package/utils.js
CHANGED
|
@@ -101,6 +101,8 @@ import grpc from './server/plugins/grpc/grpc.js';
|
|
|
101
101
|
import file2json from './server/plugins/grpc/file2json.js';
|
|
102
102
|
import officeConverter from './server/plugins/grpc/office2pdf.js';
|
|
103
103
|
import getExport from './server/plugins/file/getExport.js';
|
|
104
|
+
import jsonToCsv from './server/routes/file/controllers/utils/jsonToCsv.js';
|
|
105
|
+
import jsonToXls from './server/routes/file/controllers/utils/jsonToXls.js';
|
|
104
106
|
|
|
105
107
|
export default null;
|
|
106
108
|
export {
|
|
@@ -196,4 +198,6 @@ export {
|
|
|
196
198
|
getExport,
|
|
197
199
|
officeConverter,
|
|
198
200
|
allowedExtensions,
|
|
201
|
+
jsonToCsv,
|
|
202
|
+
jsonToXls,
|
|
199
203
|
};
|
|
File without changes
|