@etainabl/nodejs-sdk 1.2.5 → 1.2.7

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.
@@ -48,11 +48,16 @@ const getScheduledReportRunTimes = (schedule, limit = 1, taskTime = (0, moment_1
48
48
  return [];
49
49
  const originalStartDate = moment_1.default.utc(schedule.startDate);
50
50
  let startDate = originalStartDate;
51
- const runTimes = Array.from(Array(limit).keys()).map(() => {
51
+ const includeStartDate = taskTime.isSameOrBefore(originalStartDate, 'minute');
52
+ let runTimes = [];
53
+ if (includeStartDate) {
54
+ runTimes = [originalStartDate];
55
+ }
56
+ const scheduleRunTimes = Array.from(Array(includeStartDate ? limit - 1 : limit).keys()).map(() => {
52
57
  const nextRunTime = getNextRunTime(startDate, schedule, taskTime);
53
58
  startDate = nextRunTime.hour(originalStartDate.hour()).minute(originalStartDate.minute());
54
59
  return nextRunTime;
55
60
  });
56
- return runTimes;
61
+ return [...runTimes, ...scheduleRunTimes];
57
62
  };
58
63
  exports.getScheduledReportRunTimes = getScheduledReportRunTimes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etainabl/nodejs-sdk",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/mjs/index.js",
6
6
  "author": "Jonathan Lambert <jonathan@etainabl.com>",
@@ -15,7 +15,7 @@
15
15
  "@types/node": "^20.4.5"
16
16
  },
17
17
  "scripts": {
18
- "process": "tsc && yarn publish",
18
+ "process": "yarn build && yarn publish",
19
19
  "build": "rm -rf dist/* && tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && ./fixup.sh"
20
20
  },
21
21
  "exports": {