gap-nodejs-sdk 1.0.431 → 1.0.433
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/api/pos_client_api/1.0.0/api/report.d.ts +1 -0
- package/dist/api/pos_client_api/1.0.0/api/report.d.ts.map +1 -1
- package/dist/api/pos_client_api/1.0.0/api/report.js +14 -0
- package/dist/api/pos_client_api/1.0.0/endpoints/report.d.ts +1 -0
- package/dist/api/pos_client_api/1.0.0/endpoints/report.d.ts.map +1 -1
- package/dist/api/pos_client_api/1.0.0/endpoints/report.js +1 -0
- package/dist/api/pos_client_api/1.0.0/types/request/time_keeping.d.ts +1 -1
- package/dist/gap-sdk.js +1 -1
- package/package.json +2 -2
|
@@ -6,5 +6,6 @@ import * as Response from "../types/response";
|
|
|
6
6
|
export default class Report extends Base implements ReportAbstractClass {
|
|
7
7
|
static API_VERSION: GapApiVersion;
|
|
8
8
|
static getReport(data: Request.GetReportRequest): Promise<Response.GetReportResponse>;
|
|
9
|
+
static exportExcelReport(data: Request.GetReportRequest): Promise<null>;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=report.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../../src/api/pos_client_api/1.0.0/api/report.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,IAAI,MAAM,uBAAuB,CAAC;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../../src/api/pos_client_api/1.0.0/api/report.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,IAAI,MAAM,uBAAuB,CAAC;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAK9C,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,IAAK,YAAW,mBAAmB;IACnE,OAAc,WAAW,gBAAoB;WAEzB,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;WAU9E,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAWvF"}
|
|
@@ -2,6 +2,9 @@ import { __awaiter } from "tslib";
|
|
|
2
2
|
import { report } from "../endpoints";
|
|
3
3
|
import Base from "../../../../base/Base";
|
|
4
4
|
import { GapApiVersion } from "../../../../base_type";
|
|
5
|
+
import { formatExportDateString } from "../../../../utils/date-time";
|
|
6
|
+
import dayjs from "dayjs";
|
|
7
|
+
import FileDownload from "js-file-download";
|
|
5
8
|
export default class Report extends Base {
|
|
6
9
|
static getReport(data) {
|
|
7
10
|
var _a;
|
|
@@ -13,5 +16,16 @@ export default class Report extends Base {
|
|
|
13
16
|
return (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.data;
|
|
14
17
|
});
|
|
15
18
|
}
|
|
19
|
+
static exportExcelReport(data) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const response = yield this.client.get({
|
|
22
|
+
path: report.EXPORT_EXCEL,
|
|
23
|
+
query: data
|
|
24
|
+
});
|
|
25
|
+
const exportDateFormat = formatExportDateString();
|
|
26
|
+
FileDownload(response.data, `${dayjs().format(exportDateFormat)}.xlsx`, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
|
27
|
+
return null;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
16
30
|
}
|
|
17
31
|
Report.API_VERSION = GapApiVersion.V1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../../src/api/pos_client_api/1.0.0/endpoints/report.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../../../src/api/pos_client_api/1.0.0/endpoints/report.ts"],"names":[],"mappings":";;;;AAAA,wBAGC"}
|