@lighthouse/common 5.0.0-canary-11 → 5.0.0-canary-13

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.
Files changed (91) hide show
  1. package/dist/helpers/build-fetch-url/index.js +2 -2
  2. package/dist/helpers/fetch-image/index.js +1 -1
  3. package/dist/helpers/fetch-image-for-pdf-generator-service/index.js +9 -9
  4. package/dist/helpers/fetch-image-for-web/index.js +3 -14
  5. package/dist/helpers/get-audit-entry-details/index.js +2 -0
  6. package/dist/helpers/get-issue-details/index.js +2 -0
  7. package/dist/helpers/get-task-entry-details/index.js +3 -1
  8. package/dist/pdf/helpers/fields/index.js +2 -2
  9. package/dist/scheduling/scheduling.types.js +9 -9
  10. package/dist/service-hours/schema.js +12 -12
  11. package/lib/errors/DomainError.js +7 -8
  12. package/lib/errors/DomainError.js.map +1 -1
  13. package/lib/errors/ValidationError.js +11 -9
  14. package/lib/errors/ValidationError.js.map +1 -1
  15. package/lib/helpers/build-fetch-url/index.js +2 -2
  16. package/lib/helpers/build-fetch-url/index.js.map +1 -1
  17. package/lib/helpers/fetch-image/index.js +1 -1
  18. package/lib/helpers/fetch-image/index.js.map +1 -1
  19. package/lib/helpers/fetch-image-for-pdf-generator-service/index.js +174 -180
  20. package/lib/helpers/fetch-image-for-pdf-generator-service/index.js.map +1 -1
  21. package/lib/helpers/fetch-image-for-web/index.js +60 -74
  22. package/lib/helpers/fetch-image-for-web/index.js.map +1 -1
  23. package/lib/helpers/fetch-lighthouse-logo/index.js +41 -43
  24. package/lib/helpers/fetch-lighthouse-logo/index.js.map +1 -1
  25. package/lib/helpers/get-audit-entry-details/index.js +2 -0
  26. package/lib/helpers/get-audit-entry-details/index.js.map +1 -1
  27. package/lib/helpers/get-audit-items-data/index.js +8 -8
  28. package/lib/helpers/get-audit-items-data/index.js.map +1 -1
  29. package/lib/helpers/get-issue-details/index.js +2 -0
  30. package/lib/helpers/get-issue-details/index.js.map +1 -1
  31. package/lib/helpers/get-job-details/index.js.map +1 -1
  32. package/lib/helpers/get-location-reference/index.js +6 -4
  33. package/lib/helpers/get-location-reference/index.js.map +1 -1
  34. package/lib/helpers/get-reference-details/index.js.map +1 -1
  35. package/lib/helpers/get-task-entry-details/index.js +3 -1
  36. package/lib/helpers/get-task-entry-details/index.js.map +1 -1
  37. package/lib/helpers/get-timezone-datetime/index.js.map +1 -1
  38. package/lib/pdf/activity-report/index.js +299 -311
  39. package/lib/pdf/activity-report/index.js.map +1 -1
  40. package/lib/pdf/audit/index.js.map +1 -1
  41. package/lib/pdf/helpers/build-audit-content/index.js.map +1 -1
  42. package/lib/pdf/helpers/build-audit-follow-ups/index.js.map +1 -1
  43. package/lib/pdf/helpers/build-location-scans-content/index.js.map +1 -1
  44. package/lib/pdf/helpers/build-template-content/index.js.map +1 -1
  45. package/lib/pdf/helpers/fields/index.js +14 -14
  46. package/lib/pdf/helpers/fields/index.js.map +1 -1
  47. package/lib/pdf/helpers/generate-definition/index.js.map +1 -1
  48. package/lib/pdf/helpers/horizontal-line/index.js.map +1 -1
  49. package/lib/pdf/helpers/html-transformer/index.js +1 -2
  50. package/lib/pdf/helpers/html-transformer/index.js.map +1 -1
  51. package/lib/pdf/helpers/table/index.js +63 -65
  52. package/lib/pdf/helpers/table/index.js.map +1 -1
  53. package/lib/pdf/issue/index.js.map +1 -1
  54. package/lib/pdf/job/index.js.map +1 -1
  55. package/lib/pdf/shift-report/index.js +275 -291
  56. package/lib/pdf/shift-report/index.js.map +1 -1
  57. package/lib/pdf/task/index.js.map +1 -1
  58. package/lib/scheduling/generators/occurrenceIntervalsGenerator.js +27 -30
  59. package/lib/scheduling/generators/occurrenceIntervalsGenerator.js.map +1 -1
  60. package/lib/scheduling/generators/scheduleIntervalsGenerator.js +19 -21
  61. package/lib/scheduling/generators/scheduleIntervalsGenerator.js.map +1 -1
  62. package/lib/scheduling/generators/serviceIntervalsGenerator.js +134 -136
  63. package/lib/scheduling/generators/serviceIntervalsGenerator.js.map +1 -1
  64. package/lib/scheduling/helpers/generateNonRepeatingSchedule.js +81 -83
  65. package/lib/scheduling/helpers/generateNonRepeatingSchedule.js.map +1 -1
  66. package/lib/scheduling/helpers/generateRepeatingSchedule.js +104 -106
  67. package/lib/scheduling/helpers/generateRepeatingSchedule.js.map +1 -1
  68. package/lib/scheduling/helpers/generateScheduleEnd.js.map +1 -1
  69. package/lib/scheduling/helpers/mergeIntervals.js.map +1 -1
  70. package/lib/scheduling/scheduling.types.js +9 -9
  71. package/lib/scheduling/scheduling.types.js.map +1 -1
  72. package/lib/scheduling/strategies/getNext.js +21 -17
  73. package/lib/scheduling/strategies/getNext.js.map +1 -1
  74. package/lib/scheduling/strategies/getNextExactDateOfMonth.js +21 -18
  75. package/lib/scheduling/strategies/getNextExactDateOfMonth.js.map +1 -1
  76. package/lib/scheduling/strategies/getNextLastDayOfMonth.js +20 -17
  77. package/lib/scheduling/strategies/getNextLastDayOfMonth.js.map +1 -1
  78. package/lib/scheduling/strategies/getNextLastWeekdayOfMonth.js +20 -17
  79. package/lib/scheduling/strategies/getNextLastWeekdayOfMonth.js.map +1 -1
  80. package/lib/scheduling/strategies/getNextNoRepeat.js +15 -14
  81. package/lib/scheduling/strategies/getNextNoRepeat.js.map +1 -1
  82. package/lib/scheduling/strategies/getNextWeekday.js +36 -33
  83. package/lib/scheduling/strategies/getNextWeekday.js.map +1 -1
  84. package/lib/scheduling/strategies/getNextXDayOfXWeekOfMonth.js +20 -17
  85. package/lib/scheduling/strategies/getNextXDayOfXWeekOfMonth.js.map +1 -1
  86. package/lib/schema/schema.js +21 -23
  87. package/lib/schema/schema.js.map +1 -1
  88. package/lib/service-hours/schema.js +15 -13
  89. package/lib/service-hours/schema.js.map +1 -1
  90. package/package.json +2 -2
  91. package/yarn-error.log +0 -13549
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  import Promise from 'bluebird';
@@ -48,27 +48,25 @@ export function buildShiftPdf(_x, _x2) {
48
48
  function _buildShiftPdf() {
49
49
  _buildShiftPdf = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(pdfOptions, data) {
50
50
  var timestamp, timezone, title, content;
51
- return _regeneratorRuntime.wrap(function _callee$(_context) {
52
- while (1) {
53
- switch (_context.prev = _context.next) {
54
- case 0:
55
- timestamp = data.timestamp, timezone = data.timezone;
56
- title = 'Daily Shift Report';
57
- _context.next = 4;
58
- return generateContent(data);
59
- case 4:
60
- content = _context.sent;
61
- return _context.abrupt("return", generateDefinition(_objectSpread({
62
- content: content,
63
- fileTitle: title,
64
- timestamp: timestamp,
65
- timezone: timezone,
66
- type: 'Shift Report'
67
- }, pdfOptions)));
68
- case 6:
69
- case "end":
70
- return _context.stop();
71
- }
51
+ return _regeneratorRuntime.wrap(function (_context) {
52
+ while (1) switch (_context.prev = _context.next) {
53
+ case 0:
54
+ timestamp = data.timestamp, timezone = data.timezone;
55
+ title = 'Daily Shift Report';
56
+ _context.next = 1;
57
+ return generateContent(data);
58
+ case 1:
59
+ content = _context.sent;
60
+ return _context.abrupt("return", generateDefinition(_objectSpread({
61
+ content: content,
62
+ fileTitle: title,
63
+ timestamp: timestamp,
64
+ timezone: timezone,
65
+ type: 'Shift Report'
66
+ }, pdfOptions)));
67
+ case 2:
68
+ case "end":
69
+ return _context.stop();
72
70
  }
73
71
  }, _callee);
74
72
  }));
@@ -80,21 +78,19 @@ function generateContent(_x3) {
80
78
  function _generateContent() {
81
79
  _generateContent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
82
80
  var activitySection, summarySection, titleTable;
83
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
84
- while (1) {
85
- switch (_context2.prev = _context2.next) {
86
- case 0:
87
- _context2.next = 2;
88
- return buildActivitySection(data);
89
- case 2:
90
- activitySection = _context2.sent;
91
- summarySection = buildSummarySection(data);
92
- titleTable = buildTitleTable(data);
93
- return _context2.abrupt("return", [titleTable, summarySection, activitySection]);
94
- case 6:
95
- case "end":
96
- return _context2.stop();
97
- }
81
+ return _regeneratorRuntime.wrap(function (_context2) {
82
+ while (1) switch (_context2.prev = _context2.next) {
83
+ case 0:
84
+ _context2.next = 1;
85
+ return buildActivitySection(data);
86
+ case 1:
87
+ activitySection = _context2.sent;
88
+ summarySection = buildSummarySection(data);
89
+ titleTable = buildTitleTable(data);
90
+ return _context2.abrupt("return", [titleTable, summarySection, activitySection]);
91
+ case 2:
92
+ case "end":
93
+ return _context2.stop();
98
94
  }
99
95
  }, _callee2);
100
96
  }));
@@ -106,23 +102,21 @@ function buildActivitySection(_x4) {
106
102
  function _buildActivitySection() {
107
103
  _buildActivitySection = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data) {
108
104
  var timeline, activitySummary;
109
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
110
- while (1) {
111
- switch (_context3.prev = _context3.next) {
112
- case 0:
113
- _context3.next = 2;
114
- return buildTimelineTable(data);
115
- case 2:
116
- timeline = _context3.sent;
117
- _context3.next = 5;
118
- return buildActivitySummarySection(data);
119
- case 5:
120
- activitySummary = _context3.sent;
121
- return _context3.abrupt("return", [timeline, activitySummary]);
122
- case 7:
123
- case "end":
124
- return _context3.stop();
125
- }
105
+ return _regeneratorRuntime.wrap(function (_context3) {
106
+ while (1) switch (_context3.prev = _context3.next) {
107
+ case 0:
108
+ _context3.next = 1;
109
+ return buildTimelineTable(data);
110
+ case 1:
111
+ timeline = _context3.sent;
112
+ _context3.next = 2;
113
+ return buildActivitySummarySection(data);
114
+ case 2:
115
+ activitySummary = _context3.sent;
116
+ return _context3.abrupt("return", [timeline, activitySummary]);
117
+ case 3:
118
+ case "end":
119
+ return _context3.stop();
126
120
  }
127
121
  }, _callee3);
128
122
  }));
@@ -216,43 +210,41 @@ function buildActivitySummarySection(_x5) {
216
210
  function _buildActivitySummarySection() {
217
211
  _buildActivitySummarySection = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
218
212
  var audits, events, issues, settings, tasks, timezone, enterEvents, auditRows, issueRows, scanRows, taskRows, rows, sortedRows, title, header, hLine, activityTable, activitySummarySection;
219
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
220
- while (1) {
221
- switch (_context4.prev = _context4.next) {
222
- case 0:
223
- audits = data.audits, events = data.events, issues = data.issues, settings = data.settings, tasks = data.tasks, timezone = data.timezone;
224
- enterEvents = filter(events, function (event) {
225
- return event.type === 'enter';
226
- });
227
- auditRows = map(audits, getFormRowData('audits', data));
228
- issueRows = map(issues, getFormRowData('issues', data));
229
- scanRows = map(enterEvents, getScanRowData(data));
230
- taskRows = map(tasks, getFormRowData('tasks', data));
231
- rows = [].concat(_toConsumableArray(auditRows), _toConsumableArray(issueRows), _toConsumableArray(scanRows), _toConsumableArray(taskRows));
232
- sortedRows = sortBy(rows, ['timestamp'], ['asc']);
233
- title = text('Activity Summary', {
234
- style: 'summarySectionHeader'
235
- });
236
- header = table({
237
- body: [[title]],
238
- layout: 'noBorders',
239
- style: 'summaryHeaderTable'
240
- });
241
- hLine = horizontalLine();
242
- _context4.next = 13;
243
- return buildActivityTable({
244
- rows: sortedRows,
245
- settings: settings,
246
- timezone: timezone
247
- });
248
- case 13:
249
- activityTable = _context4.sent;
250
- activitySummarySection = [header, hLine, activityTable];
251
- return _context4.abrupt("return", activitySummarySection);
252
- case 16:
253
- case "end":
254
- return _context4.stop();
255
- }
213
+ return _regeneratorRuntime.wrap(function (_context4) {
214
+ while (1) switch (_context4.prev = _context4.next) {
215
+ case 0:
216
+ audits = data.audits, events = data.events, issues = data.issues, settings = data.settings, tasks = data.tasks, timezone = data.timezone;
217
+ enterEvents = filter(events, function (event) {
218
+ return event.type === 'enter';
219
+ });
220
+ auditRows = map(audits, getFormRowData('audits', data));
221
+ issueRows = map(issues, getFormRowData('issues', data));
222
+ scanRows = map(enterEvents, getScanRowData(data));
223
+ taskRows = map(tasks, getFormRowData('tasks', data));
224
+ rows = [].concat(_toConsumableArray(auditRows), _toConsumableArray(issueRows), _toConsumableArray(scanRows), _toConsumableArray(taskRows));
225
+ sortedRows = sortBy(rows, ['timestamp'], ['asc']);
226
+ title = text('Activity Summary', {
227
+ style: 'summarySectionHeader'
228
+ });
229
+ header = table({
230
+ body: [[title]],
231
+ layout: 'noBorders',
232
+ style: 'summaryHeaderTable'
233
+ });
234
+ hLine = horizontalLine();
235
+ _context4.next = 1;
236
+ return buildActivityTable({
237
+ rows: sortedRows,
238
+ settings: settings,
239
+ timezone: timezone
240
+ });
241
+ case 1:
242
+ activityTable = _context4.sent;
243
+ activitySummarySection = [header, hLine, activityTable];
244
+ return _context4.abrupt("return", activitySummarySection);
245
+ case 2:
246
+ case "end":
247
+ return _context4.stop();
256
248
  }
257
249
  }, _callee4);
258
250
  }));
@@ -264,143 +256,139 @@ function buildActivityTable(_x6) {
264
256
  function _buildActivityTable() {
265
257
  _buildActivityTable = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref) {
266
258
  var rows, settings, timezone, timezoneAbbr, activityTableHeader, activityTableRows, activityTableBody, activityTable;
267
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
268
- while (1) {
269
- switch (_context6.prev = _context6.next) {
270
- case 0:
271
- rows = _ref.rows, settings = _ref.settings, timezone = _ref.timezone;
272
- timezoneAbbr = getTimezoneAbbr(timezone);
273
- activityTableHeader = [text('Activity', {
274
- bold: true
275
- }), {
276
- text: ''
277
- }, text('Location', {
278
- bold: true
279
- }), text("Timestamp (".concat(timezoneAbbr, ")"), {
280
- alignment: 'right',
281
- bold: true
282
- })];
283
- _context6.next = 5;
284
- return Promise.map(rows, /*#__PURE__*/function () {
285
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data) {
286
- var link, location, icon, summaryFields, timestamp, title, timezoneHour, iconCell, rows, hasSummaryFields, fieldsTable, activityTableRow;
287
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
288
- while (1) {
289
- switch (_context5.prev = _context5.next) {
290
- case 0:
291
- link = data.link, location = data.location, icon = data.icon, summaryFields = data.summaryFields, timestamp = data.timestamp, title = data.title;
292
- timezoneHour = getTimezoneDatetime({
293
- format: 'ddd DD h:mm a',
294
- showTzAbbr: false,
295
- timestamp: timestamp,
296
- timezone: timezone
297
- });
298
- iconCell = icon ? {
299
- alignment: 'center',
300
- fit: [8, 8],
301
- image: icon,
302
- link: link
303
- } : {
304
- text: ''
305
- };
306
- rows = [[text(title, {
307
- link: link
308
- }), iconCell, text(location, {
309
- link: link
310
- }), text(timezoneHour, {
311
- alignment: 'right',
312
- link: link
313
- })]];
314
- hasSummaryFields = !isEmpty(summaryFields);
315
- if (!hasSummaryFields) {
316
- _context5.next = 10;
317
- break;
318
- }
319
- _context5.next = 8;
320
- return summaryFieldsTable({
321
- fields: summaryFields,
322
- settings: settings,
323
- timezone: timezone
324
- });
325
- case 8:
326
- fieldsTable = _context5.sent;
327
- rows.push([fieldsTable]);
328
- case 10:
329
- activityTableRow = [table({
330
- body: [].concat(rows),
331
- colSpan: 5,
332
- dontBreakRows: true,
333
- headerRow: 0,
334
- layout: {
335
- hLineWidth: function hLineWidth() {
336
- return 0;
337
- },
338
- paddingLeft: function paddingLeft() {
339
- return 0;
340
- },
341
- paddingRight: function paddingRight() {
342
- return 0;
343
- },
344
- paddingTop: function paddingTop() {
345
- return 5;
346
- },
347
- paddingBottom: function paddingBottom() {
348
- return 5;
349
- },
350
- vLineWidth: function vLineWidth() {
351
- return 0;
352
- }
353
- },
354
- widths: [120, 25, 200, 110, '*']
355
- })];
356
- return _context5.abrupt("return", activityTableRow);
357
- case 12:
358
- case "end":
359
- return _context5.stop();
259
+ return _regeneratorRuntime.wrap(function (_context6) {
260
+ while (1) switch (_context6.prev = _context6.next) {
261
+ case 0:
262
+ rows = _ref.rows, settings = _ref.settings, timezone = _ref.timezone;
263
+ timezoneAbbr = getTimezoneAbbr(timezone);
264
+ activityTableHeader = [text('Activity', {
265
+ bold: true
266
+ }), {
267
+ text: ''
268
+ }, text('Location', {
269
+ bold: true
270
+ }), text("Timestamp (".concat(timezoneAbbr, ")"), {
271
+ alignment: 'right',
272
+ bold: true
273
+ })];
274
+ _context6.next = 1;
275
+ return Promise.map(rows, /*#__PURE__*/function () {
276
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data) {
277
+ var link, location, icon, summaryFields, timestamp, title, timezoneHour, iconCell, rows, hasSummaryFields, fieldsTable, activityTableRow;
278
+ return _regeneratorRuntime.wrap(function (_context5) {
279
+ while (1) switch (_context5.prev = _context5.next) {
280
+ case 0:
281
+ link = data.link, location = data.location, icon = data.icon, summaryFields = data.summaryFields, timestamp = data.timestamp, title = data.title;
282
+ timezoneHour = getTimezoneDatetime({
283
+ format: 'ddd DD h:mm a',
284
+ showTzAbbr: false,
285
+ timestamp: timestamp,
286
+ timezone: timezone
287
+ });
288
+ iconCell = icon ? {
289
+ alignment: 'center',
290
+ fit: [8, 8],
291
+ image: icon,
292
+ link: link
293
+ } : {
294
+ text: ''
295
+ };
296
+ rows = [[text(title, {
297
+ link: link
298
+ }), iconCell, text(location, {
299
+ link: link
300
+ }), text(timezoneHour, {
301
+ alignment: 'right',
302
+ link: link
303
+ })]];
304
+ hasSummaryFields = !isEmpty(summaryFields);
305
+ if (!hasSummaryFields) {
306
+ _context5.next = 2;
307
+ break;
360
308
  }
361
- }
362
- }, _callee5);
363
- }));
364
- return function (_x8) {
365
- return _ref6.apply(this, arguments);
366
- };
367
- }());
368
- case 5:
369
- activityTableRows = _context6.sent;
370
- activityTableBody = isEmpty(activityTableRows) ? [[text('No other activity', {
371
- colSpan: 4
372
- })]] : activityTableRows;
373
- activityTable = table({
374
- body: [activityTableHeader].concat(_toConsumableArray(activityTableBody)),
375
- dontBreakRows: true,
376
- layout: {
377
- hLineWidth: function hLineWidth() {
378
- return 0;
379
- },
380
- fillColor: zebraFillColor,
381
- paddingLeft: function paddingLeft() {
382
- return 5;
383
- },
384
- paddingRight: function paddingRight() {
385
- return 5;
386
- },
387
- paddingTop: function paddingTop() {
388
- return 5;
389
- },
390
- paddingBottom: function paddingBottom() {
391
- return 5;
392
- },
393
- vLineWidth: function vLineWidth() {
394
- return 0;
309
+ _context5.next = 1;
310
+ return summaryFieldsTable({
311
+ fields: summaryFields,
312
+ settings: settings,
313
+ timezone: timezone
314
+ });
315
+ case 1:
316
+ fieldsTable = _context5.sent;
317
+ rows.push([fieldsTable]);
318
+ case 2:
319
+ activityTableRow = [table({
320
+ body: [].concat(rows),
321
+ colSpan: 5,
322
+ dontBreakRows: true,
323
+ headerRow: 0,
324
+ layout: {
325
+ hLineWidth: function hLineWidth() {
326
+ return 0;
327
+ },
328
+ paddingLeft: function paddingLeft() {
329
+ return 0;
330
+ },
331
+ paddingRight: function paddingRight() {
332
+ return 0;
333
+ },
334
+ paddingTop: function paddingTop() {
335
+ return 5;
336
+ },
337
+ paddingBottom: function paddingBottom() {
338
+ return 5;
339
+ },
340
+ vLineWidth: function vLineWidth() {
341
+ return 0;
342
+ }
343
+ },
344
+ widths: [120, 25, 200, 110, '*']
345
+ })];
346
+ return _context5.abrupt("return", activityTableRow);
347
+ case 3:
348
+ case "end":
349
+ return _context5.stop();
395
350
  }
351
+ }, _callee5);
352
+ }));
353
+ return function (_x8) {
354
+ return _ref6.apply(this, arguments);
355
+ };
356
+ }());
357
+ case 1:
358
+ activityTableRows = _context6.sent;
359
+ activityTableBody = isEmpty(activityTableRows) ? [[text('No other activity', {
360
+ colSpan: 4
361
+ })]] : activityTableRows;
362
+ activityTable = table({
363
+ body: [activityTableHeader].concat(_toConsumableArray(activityTableBody)),
364
+ dontBreakRows: true,
365
+ layout: {
366
+ hLineWidth: function hLineWidth() {
367
+ return 0;
368
+ },
369
+ fillColor: zebraFillColor,
370
+ paddingLeft: function paddingLeft() {
371
+ return 5;
396
372
  },
397
- widths: [110, 15, 230, 80, '*']
398
- });
399
- return _context6.abrupt("return", activityTable);
400
- case 9:
401
- case "end":
402
- return _context6.stop();
403
- }
373
+ paddingRight: function paddingRight() {
374
+ return 5;
375
+ },
376
+ paddingTop: function paddingTop() {
377
+ return 5;
378
+ },
379
+ paddingBottom: function paddingBottom() {
380
+ return 5;
381
+ },
382
+ vLineWidth: function vLineWidth() {
383
+ return 0;
384
+ }
385
+ },
386
+ widths: [110, 15, 230, 80, '*']
387
+ });
388
+ return _context6.abrupt("return", activityTable);
389
+ case 2:
390
+ case "end":
391
+ return _context6.stop();
404
392
  }
405
393
  }, _callee6);
406
394
  }));
@@ -459,72 +447,68 @@ function buildTimelineTable(_x7) {
459
447
  function _buildTimelineTable() {
460
448
  _buildTimelineTable = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data) {
461
449
  var timezone, timezoneAbbr, shiftRows, sortedRows, timeline, timelineHeaderRow, timelineTable, title, header, hLine, timelineSection;
462
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
463
- while (1) {
464
- switch (_context8.prev = _context8.next) {
465
- case 0:
466
- timezone = data.timezone;
467
- timezoneAbbr = getTimezoneAbbr(timezone);
468
- shiftRows = getShiftRowData(data);
469
- sortedRows = sortBy(shiftRows, ['timestamp'], ['asc']);
470
- _context8.next = 6;
471
- return Promise.map(sortedRows, /*#__PURE__*/function () {
472
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
473
- var location, timestamp, title, timezoneHour, rows;
474
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
475
- while (1) {
476
- switch (_context7.prev = _context7.next) {
477
- case 0:
478
- location = data.location, timestamp = data.timestamp, title = data.title;
479
- timezoneHour = getTimezoneDatetime({
480
- format: 'ddd DD h:mm a',
481
- showTzAbbr: false,
482
- timestamp: timestamp,
483
- timezone: timezone
484
- });
485
- rows = [text(title), text(location), text(timezoneHour, {
486
- alignment: 'right'
487
- })];
488
- return _context7.abrupt("return", rows);
489
- case 4:
490
- case "end":
491
- return _context7.stop();
492
- }
493
- }
494
- }, _callee7);
495
- }));
496
- return function (_x9) {
497
- return _ref7.apply(this, arguments);
498
- };
499
- }());
500
- case 6:
501
- timeline = _context8.sent;
502
- timelineHeaderRow = [text('Activity', {
503
- bold: true
504
- }), text('Location', {
505
- bold: true
506
- }), text("Timestamp (".concat(timezoneAbbr, ")"), {
507
- alignment: 'right',
508
- bold: true
509
- })];
510
- timelineTable = threeColumnTable({
511
- body: [timelineHeaderRow].concat(_toConsumableArray(timeline))
512
- });
513
- title = text('Timeline', {
514
- style: 'timelineTitle'
515
- });
516
- header = table({
517
- body: [[title]],
518
- layout: 'noBorders',
519
- style: 'summaryHeaderTable'
520
- });
521
- hLine = horizontalLine();
522
- timelineSection = [header, hLine, timelineTable];
523
- return _context8.abrupt("return", timelineSection);
524
- case 14:
525
- case "end":
526
- return _context8.stop();
527
- }
450
+ return _regeneratorRuntime.wrap(function (_context8) {
451
+ while (1) switch (_context8.prev = _context8.next) {
452
+ case 0:
453
+ timezone = data.timezone;
454
+ timezoneAbbr = getTimezoneAbbr(timezone);
455
+ shiftRows = getShiftRowData(data);
456
+ sortedRows = sortBy(shiftRows, ['timestamp'], ['asc']);
457
+ _context8.next = 1;
458
+ return Promise.map(sortedRows, /*#__PURE__*/function () {
459
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
460
+ var location, timestamp, title, timezoneHour, rows;
461
+ return _regeneratorRuntime.wrap(function (_context7) {
462
+ while (1) switch (_context7.prev = _context7.next) {
463
+ case 0:
464
+ location = data.location, timestamp = data.timestamp, title = data.title;
465
+ timezoneHour = getTimezoneDatetime({
466
+ format: 'ddd DD h:mm a',
467
+ showTzAbbr: false,
468
+ timestamp: timestamp,
469
+ timezone: timezone
470
+ });
471
+ rows = [text(title), text(location), text(timezoneHour, {
472
+ alignment: 'right'
473
+ })];
474
+ return _context7.abrupt("return", rows);
475
+ case 1:
476
+ case "end":
477
+ return _context7.stop();
478
+ }
479
+ }, _callee7);
480
+ }));
481
+ return function (_x9) {
482
+ return _ref7.apply(this, arguments);
483
+ };
484
+ }());
485
+ case 1:
486
+ timeline = _context8.sent;
487
+ timelineHeaderRow = [text('Activity', {
488
+ bold: true
489
+ }), text('Location', {
490
+ bold: true
491
+ }), text("Timestamp (".concat(timezoneAbbr, ")"), {
492
+ alignment: 'right',
493
+ bold: true
494
+ })];
495
+ timelineTable = threeColumnTable({
496
+ body: [timelineHeaderRow].concat(_toConsumableArray(timeline))
497
+ });
498
+ title = text('Timeline', {
499
+ style: 'timelineTitle'
500
+ });
501
+ header = table({
502
+ body: [[title]],
503
+ layout: 'noBorders',
504
+ style: 'summaryHeaderTable'
505
+ });
506
+ hLine = horizontalLine();
507
+ timelineSection = [header, hLine, timelineTable];
508
+ return _context8.abrupt("return", timelineSection);
509
+ case 2:
510
+ case "end":
511
+ return _context8.stop();
528
512
  }
529
513
  }, _callee8);
530
514
  }));