d5-api-initializer 1.5.4 → 1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "d5-api-initializer",
3
- "version": "1.5.4",
3
+ "version": "1.6.0",
4
4
  "license": "MIT",
5
5
  "dependencies": {},
6
6
  "main": "publish/cjs/d5-api-initializer",
@@ -31,7 +31,9 @@
31
31
  "prerelease": "npm version prerelease --preid=alpha"
32
32
  },
33
33
  "devDependencies": {
34
- "@babel/core": "7.23.9",
34
+ "@babel/core": "7.27.4",
35
+ "@babel/preset-env": "7.27.2",
36
+ "@babel/preset-typescript": "7.27.1",
35
37
  "@types/node": "20.11.16",
36
38
  "archiver": "6.0.1",
37
39
  "copy-webpack-plugin": "^11.0.0",
@@ -40,8 +42,8 @@
40
42
  "dotenv": "16.4.7",
41
43
  "eslint": "7.19.0",
42
44
  "rimraf": "5.0.5",
43
- "ts-loader": "9.5.2",
45
+ "babel-loader": "10.0.0",
44
46
  "tsup": "7.0.0",
45
- "typescript": "5.7.3"
47
+ "typescript": "5.8.3"
46
48
  }
47
49
  }
@@ -399,7 +399,6 @@ var ApiInvoker = class {
399
399
  }
400
400
  getSrcRequest() {
401
401
  throw new Error("not implemented");
402
- return this._jsWapiInvoker.getSrcRequest();
403
402
  }
404
403
  setColumns(columns) {
405
404
  this.columns = columns;
@@ -445,6 +444,14 @@ var ApiInvoker = class {
445
444
  this._jsWapiInvoker = this._jsWapiInvoker.addSorts(sorts);
446
445
  return this;
447
446
  }
447
+ addFile(fileID, fileStream) {
448
+ this._jsWapiInvoker = this._jsWapiInvoker.addFile(fileID, fileStream);
449
+ return this;
450
+ }
451
+ addRequestRow(data) {
452
+ this._jsWapiInvoker = this._jsWapiInvoker.addRequestRow(data);
453
+ return this;
454
+ }
448
455
  /* ------------------------------Other------------------------------ */
449
456
  invoke() {
450
457
  return new ApiResponse(this._jsWapiInvoker.invoke(), this._objectName);
@@ -946,6 +953,9 @@ var ApiRequest = class {
946
953
  addWatermarkToPdf(params) {
947
954
  addWatermarkToPdf(this._jsWapiRequest, params);
948
955
  }
956
+ unzip(params) {
957
+ return this._jsWapiRequest.zip().unzip(params);
958
+ }
949
959
  /**
950
960
  * Вернуть содержимое meta-Excel в виде JSON-объекта:
951
961
  * @param fileRequestId имя поля в multipart-запросе с Excel-файлом
@@ -46,6 +46,8 @@ declare namespace jsWapi {
46
46
  setSingleColumn(column: string): JSWapiInvoker;
47
47
  invokeAndGetFileAsString(): string;
48
48
  invokeAndGetExcelFileAsJson(): Map<string, any>;
49
+ addRequestRow(row: Record<string, any>): JSWapiInvoker;
50
+ addFile(fileID: string, file: any): JSWapiInvoker;
49
51
  invoke(): JSWapiResponse;
50
52
  };
51
53
  type JSWapiRequest = {
@@ -76,6 +78,7 @@ declare namespace jsWapi {
76
78
  getRowsPerPage(): number;
77
79
  getLanguage(): string;
78
80
  pdf(): JSWapiPdf;
81
+ zip(): JSWapiZip;
79
82
  xls(): JSWapiXls;
80
83
  getMultiFileAsString(...arg: string[]): any;
81
84
  getMultiExcelFileAsJson(...arg: string[]): any;
@@ -237,6 +240,30 @@ declare namespace jsWapi {
237
240
  interface JSWapiPdf {
238
241
  load(params: JSWapiPdfLoadParams): JSWapiPdf;
239
242
  }
243
+ interface JSZipEntity {
244
+ /**
245
+ * полное имя файла вместе с директориями
246
+ * @example
247
+ * zipEntry.name() === "1/2/3/tax.xlsx"
248
+ */
249
+ name(): string;
250
+ /**
251
+ * true, если это директория
252
+ */
253
+ isDirectory(): boolean;
254
+ }
255
+ interface JSWapiZip {
256
+ /**
257
+ *
258
+ * @param {Object} params
259
+ * @param params.callback Функция в callback вызывается для каждого элемента zip-файла.
260
+ *
261
+ */
262
+ unzip(params: {
263
+ fileRequestId: string;
264
+ callback: (zipEntry: JSZipEntity) => void;
265
+ }): JSWapiPdf;
266
+ }
240
267
  /**
241
268
  * Вернуть содержимое meta-Excel в виде JSON-объекта:
242
269
  {
@@ -384,6 +411,8 @@ declare class ApiInvoker implements IInvoker$1<ApiInvoker> {
384
411
  addAggregatedColumns(aggregatedColumns: IMappedCollection): ApiInvoker;
385
412
  addNestedColumns(nestedColumns: IMappedCollection): ApiInvoker;
386
413
  addSorts(sorts: string[]): ApiInvoker;
414
+ addFile(fileID: string, fileStream: any): ApiInvoker;
415
+ addRequestRow(data: Record<string, any>): ApiInvoker;
387
416
  invoke(): ApiResponse;
388
417
  }
389
418
 
@@ -492,6 +521,10 @@ declare class ApiRequest {
492
521
  newJSWapiInvoker(objectName: string, operName: string): jsWapi.JSWapiInvoker;
493
522
  newApiInvoker(objectName: string, operName: string): ApiInvoker;
494
523
  addWatermarkToPdf(params: AddWatermarkToPdfParams): void;
524
+ unzip(params: {
525
+ fileRequestId: string;
526
+ callback: (zipEntry: jsWapi.JSZipEntity) => void;
527
+ }): jsWapi.JSWapiPdf;
495
528
  /**
496
529
  * Вернуть содержимое meta-Excel в виде JSON-объекта:
497
530
  * @param fileRequestId имя поля в multipart-запросе с Excel-файлом
@@ -360,7 +360,6 @@ var ApiInvoker = class {
360
360
  }
361
361
  getSrcRequest() {
362
362
  throw new Error("not implemented");
363
- return this._jsWapiInvoker.getSrcRequest();
364
363
  }
365
364
  setColumns(columns) {
366
365
  this.columns = columns;
@@ -406,6 +405,14 @@ var ApiInvoker = class {
406
405
  this._jsWapiInvoker = this._jsWapiInvoker.addSorts(sorts);
407
406
  return this;
408
407
  }
408
+ addFile(fileID, fileStream) {
409
+ this._jsWapiInvoker = this._jsWapiInvoker.addFile(fileID, fileStream);
410
+ return this;
411
+ }
412
+ addRequestRow(data) {
413
+ this._jsWapiInvoker = this._jsWapiInvoker.addRequestRow(data);
414
+ return this;
415
+ }
409
416
  /* ------------------------------Other------------------------------ */
410
417
  invoke() {
411
418
  return new ApiResponse(this._jsWapiInvoker.invoke(), this._objectName);
@@ -907,6 +914,9 @@ var ApiRequest = class {
907
914
  addWatermarkToPdf(params) {
908
915
  addWatermarkToPdf(this._jsWapiRequest, params);
909
916
  }
917
+ unzip(params) {
918
+ return this._jsWapiRequest.zip().unzip(params);
919
+ }
910
920
  /**
911
921
  * Вернуть содержимое meta-Excel в виде JSON-объекта:
912
922
  * @param fileRequestId имя поля в multipart-запросе с Excel-файлом
@@ -360,7 +360,6 @@ var ApiInvoker = class {
360
360
  }
361
361
  getSrcRequest() {
362
362
  throw new Error("not implemented");
363
- return this._jsWapiInvoker.getSrcRequest();
364
363
  }
365
364
  setColumns(columns) {
366
365
  this.columns = columns;
@@ -406,6 +405,14 @@ var ApiInvoker = class {
406
405
  this._jsWapiInvoker = this._jsWapiInvoker.addSorts(sorts);
407
406
  return this;
408
407
  }
408
+ addFile(fileID, fileStream) {
409
+ this._jsWapiInvoker = this._jsWapiInvoker.addFile(fileID, fileStream);
410
+ return this;
411
+ }
412
+ addRequestRow(data) {
413
+ this._jsWapiInvoker = this._jsWapiInvoker.addRequestRow(data);
414
+ return this;
415
+ }
409
416
  /* ------------------------------Other------------------------------ */
410
417
  invoke() {
411
418
  return new ApiResponse(this._jsWapiInvoker.invoke(), this._objectName);
@@ -907,6 +914,9 @@ var ApiRequest = class {
907
914
  addWatermarkToPdf(params) {
908
915
  addWatermarkToPdf(this._jsWapiRequest, params);
909
916
  }
917
+ unzip(params) {
918
+ return this._jsWapiRequest.zip().unzip(params);
919
+ }
910
920
  /**
911
921
  * Вернуть содержимое meta-Excel в виде JSON-объекта:
912
922
  * @param fileRequestId имя поля в multipart-запросе с Excel-файлом