@lighthouse/common 6.10.0 → 6.10.1-canary.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.
Files changed (229) hide show
  1. package/.mise.toml +6 -6
  2. package/CHANGELOG.md +758 -758
  3. package/README.md +1 -1
  4. package/dist/errors/FetchImageError.js +3 -3
  5. package/dist/helpers/fetch-image-for-pdf-generator-service/index.js +7 -7
  6. package/dist/helpers/floatify/index.js +6 -6
  7. package/dist/helpers/get-audit-items-data/index.js +47 -36
  8. package/dist/helpers/validate-url/index.js +4 -4
  9. package/dist/pdf/activity-report/index.js +32 -32
  10. package/dist/pdf/audit/index.js +23 -23
  11. package/dist/pdf/helpers/fields/index.js +47 -27
  12. package/dist/pdf/issue/index.js +23 -23
  13. package/dist/pdf/job/index.js +22 -22
  14. package/dist/pdf/shift-report/index.js +28 -28
  15. package/dist/pdf/task/index.js +23 -23
  16. package/dist/scheduling/generators/occurrenceIntervalsGenerator.js +2 -2
  17. package/dist/scheduling/generators/scheduleIntervalsGenerator.js +2 -2
  18. package/dist/scheduling/generators/serviceIntervalsGenerator.js +2 -2
  19. package/dist/scheduling/helpers/convertToTimezone.js +6 -6
  20. package/dist/scheduling/helpers/generateNonRepeatingSchedule.js +2 -2
  21. package/dist/scheduling/helpers/generateRepeatingSchedule.js +2 -2
  22. package/dist/scheduling/helpers/generateScheduleEnd.js +2 -2
  23. package/dist/scheduling/helpers/hasValidStartAndEnd.js +5 -5
  24. package/dist/scheduling/helpers/intervalCovers.js +6 -6
  25. package/dist/scheduling/helpers/intervalIntersectsEnd.js +6 -6
  26. package/dist/scheduling/helpers/intervalIntersectsStart.js +6 -6
  27. package/dist/scheduling/helpers/intervalOnlyIntersectsEnd.js +6 -6
  28. package/dist/scheduling/helpers/intervalOnlyIntersectsStart.js +6 -6
  29. package/dist/scheduling/helpers/intervalOutside.js +6 -6
  30. package/dist/scheduling/helpers/intervalWithin.js +6 -6
  31. package/dist/scheduling/helpers/mergeIntervals.js +6 -6
  32. package/dist/scheduling/helpers/splitIntervals.js +6 -6
  33. package/dist/scheduling/strategies/getNext.js +2 -2
  34. package/dist/scheduling/strategies/getNextExactDateOfMonth.js +2 -2
  35. package/dist/scheduling/strategies/getNextLastDayOfMonth.js +2 -2
  36. package/dist/scheduling/strategies/getNextLastWeekdayOfMonth.js +2 -2
  37. package/dist/scheduling/strategies/getNextNoRepeat.js +2 -2
  38. package/dist/scheduling/strategies/getNextWeekday.js +2 -2
  39. package/dist/scheduling/strategies/getNextXDayOfXWeekOfMonth.js +2 -2
  40. package/dist/service-hours/__helpers__/calculate-hours.js +4 -4
  41. package/dist/service-hours/__helpers__/isOpen.js +2 -2
  42. package/dist/service-hours/schema.js +4 -4
  43. package/lib/constants.js +12 -6
  44. package/lib/constants.js.map +1 -1
  45. package/lib/errors/DomainError.js +14 -21
  46. package/lib/errors/DomainError.js.map +1 -1
  47. package/lib/errors/FetchImageError.js +17 -24
  48. package/lib/errors/FetchImageError.js.map +1 -1
  49. package/lib/errors/ValidationError.js +30 -36
  50. package/lib/errors/ValidationError.js.map +1 -1
  51. package/lib/errors/index.js +23 -5
  52. package/lib/errors/index.js.map +1 -1
  53. package/lib/helpers/build-fetch-url/index.js +43 -47
  54. package/lib/helpers/build-fetch-url/index.js.map +1 -1
  55. package/lib/helpers/fetch-image/index.js +83 -82
  56. package/lib/helpers/fetch-image/index.js.map +1 -1
  57. package/lib/helpers/fetch-image-for-pdf-generator-service/index.js +168 -243
  58. package/lib/helpers/fetch-image-for-pdf-generator-service/index.js.map +1 -1
  59. package/lib/helpers/fetch-image-for-web/index.js +71 -94
  60. package/lib/helpers/fetch-image-for-web/index.js.map +1 -1
  61. package/lib/helpers/fetch-lighthouse-logo/index.js +36 -61
  62. package/lib/helpers/fetch-lighthouse-logo/index.js.map +1 -1
  63. package/lib/helpers/floatify/index.js +13 -7
  64. package/lib/helpers/floatify/index.js.map +1 -1
  65. package/lib/helpers/get-assignees-full-names/index.js +11 -7
  66. package/lib/helpers/get-assignees-full-names/index.js.map +1 -1
  67. package/lib/helpers/get-audit-entry-details/index.js +42 -32
  68. package/lib/helpers/get-audit-entry-details/index.js.map +1 -1
  69. package/lib/helpers/get-audit-items-data/index.js +104 -83
  70. package/lib/helpers/get-audit-items-data/index.js.map +1 -1
  71. package/lib/helpers/get-geometry-geocoded-string/index.js +10 -5
  72. package/lib/helpers/get-geometry-geocoded-string/index.js.map +1 -1
  73. package/lib/helpers/get-issue-details/index.js +53 -43
  74. package/lib/helpers/get-issue-details/index.js.map +1 -1
  75. package/lib/helpers/get-job-details/index.js +49 -41
  76. package/lib/helpers/get-job-details/index.js.map +1 -1
  77. package/lib/helpers/get-location-reference/index.js +32 -34
  78. package/lib/helpers/get-location-reference/index.js.map +1 -1
  79. package/lib/helpers/get-pretty-duration/index.js +16 -10
  80. package/lib/helpers/get-pretty-duration/index.js.map +1 -1
  81. package/lib/helpers/get-reference-details/index.js +20 -10
  82. package/lib/helpers/get-reference-details/index.js.map +1 -1
  83. package/lib/helpers/get-status-details/index.js +8 -2
  84. package/lib/helpers/get-status-details/index.js.map +1 -1
  85. package/lib/helpers/get-task-entry-details/index.js +32 -23
  86. package/lib/helpers/get-task-entry-details/index.js.map +1 -1
  87. package/lib/helpers/get-timezone-abbr/index.js +11 -4
  88. package/lib/helpers/get-timezone-abbr/index.js.map +1 -1
  89. package/lib/helpers/get-timezone-datetime/index.js +20 -13
  90. package/lib/helpers/get-timezone-datetime/index.js.map +1 -1
  91. package/lib/helpers/get-user-full-name/index.js +9 -3
  92. package/lib/helpers/get-user-full-name/index.js.map +1 -1
  93. package/lib/helpers/get-value-as-percentage/index.js +9 -4
  94. package/lib/helpers/get-value-as-percentage/index.js.map +1 -1
  95. package/lib/helpers/image-validators/index.js +18 -12
  96. package/lib/helpers/image-validators/index.js.map +1 -1
  97. package/lib/helpers/index.js +130 -18
  98. package/lib/helpers/index.js.map +1 -1
  99. package/lib/helpers/validate-url/index.js +11 -5
  100. package/lib/helpers/validate-url/index.js.map +1 -1
  101. package/lib/images/index.js +10 -4
  102. package/lib/images/index.js.map +1 -1
  103. package/lib/index.js +66 -10
  104. package/lib/index.js.map +1 -1
  105. package/lib/pdf/activity-report/index.js +407 -537
  106. package/lib/pdf/activity-report/index.js.map +1 -1
  107. package/lib/pdf/audit/index.js +137 -134
  108. package/lib/pdf/audit/index.js.map +1 -1
  109. package/lib/pdf/fonts/index.js +4 -2
  110. package/lib/pdf/fonts/index.js.map +1 -1
  111. package/lib/pdf/helpers/build-audit-content/index.js +57 -51
  112. package/lib/pdf/helpers/build-audit-content/index.js.map +1 -1
  113. package/lib/pdf/helpers/build-audit-follow-ups/index.js +52 -50
  114. package/lib/pdf/helpers/build-audit-follow-ups/index.js.map +1 -1
  115. package/lib/pdf/helpers/build-location-scans-content/index.js +22 -16
  116. package/lib/pdf/helpers/build-location-scans-content/index.js.map +1 -1
  117. package/lib/pdf/helpers/build-template-content/index.js +52 -51
  118. package/lib/pdf/helpers/build-template-content/index.js.map +1 -1
  119. package/lib/pdf/helpers/default-footer/index.js +38 -35
  120. package/lib/pdf/helpers/default-footer/index.js.map +1 -1
  121. package/lib/pdf/helpers/default-header/index.js +40 -35
  122. package/lib/pdf/helpers/default-header/index.js.map +1 -1
  123. package/lib/pdf/helpers/default-styles/index.js +7 -1
  124. package/lib/pdf/helpers/default-styles/index.js.map +1 -1
  125. package/lib/pdf/helpers/fields/index.js +225 -214
  126. package/lib/pdf/helpers/fields/index.js.map +1 -1
  127. package/lib/pdf/helpers/format-location-address/index.js +14 -8
  128. package/lib/pdf/helpers/format-location-address/index.js.map +1 -1
  129. package/lib/pdf/helpers/generate-definition/index.js +60 -65
  130. package/lib/pdf/helpers/generate-definition/index.js.map +1 -1
  131. package/lib/pdf/helpers/horizontal-line/index.js +14 -14
  132. package/lib/pdf/helpers/horizontal-line/index.js.map +1 -1
  133. package/lib/pdf/helpers/html-transformer/index.js +45 -35
  134. package/lib/pdf/helpers/html-transformer/index.js.map +1 -1
  135. package/lib/pdf/helpers/index.js +194 -15
  136. package/lib/pdf/helpers/index.js.map +1 -1
  137. package/lib/pdf/helpers/parse-value/index.js +10 -4
  138. package/lib/pdf/helpers/parse-value/index.js.map +1 -1
  139. package/lib/pdf/helpers/table/index.js +136 -205
  140. package/lib/pdf/helpers/table/index.js.map +1 -1
  141. package/lib/pdf/helpers/text/index.js +11 -8
  142. package/lib/pdf/helpers/text/index.js.map +1 -1
  143. package/lib/pdf/icons/index.js +8 -2
  144. package/lib/pdf/icons/index.js.map +1 -1
  145. package/lib/pdf/index.js +47 -6
  146. package/lib/pdf/index.js.map +1 -1
  147. package/lib/pdf/issue/index.js +141 -135
  148. package/lib/pdf/issue/index.js.map +1 -1
  149. package/lib/pdf/job/index.js +95 -81
  150. package/lib/pdf/job/index.js.map +1 -1
  151. package/lib/pdf/shift-report/emptyFixtures.js +8 -2
  152. package/lib/pdf/shift-report/emptyFixtures.js.map +1 -1
  153. package/lib/pdf/shift-report/index.js +399 -521
  154. package/lib/pdf/shift-report/index.js.map +1 -1
  155. package/lib/pdf/task/index.js +89 -83
  156. package/lib/pdf/task/index.js.map +1 -1
  157. package/lib/scheduling/generators/index.js +38 -3
  158. package/lib/scheduling/generators/index.js.map +1 -1
  159. package/lib/scheduling/generators/occurrenceIntervalsGenerator.js +44 -37
  160. package/lib/scheduling/generators/occurrenceIntervalsGenerator.js.map +1 -1
  161. package/lib/scheduling/generators/scheduleIntervalsGenerator.js +20 -28
  162. package/lib/scheduling/generators/scheduleIntervalsGenerator.js.map +1 -1
  163. package/lib/scheduling/generators/serviceIntervalsGenerator.js +120 -150
  164. package/lib/scheduling/generators/serviceIntervalsGenerator.js.map +1 -1
  165. package/lib/scheduling/helpers/convertToTimezone.js +18 -11
  166. package/lib/scheduling/helpers/convertToTimezone.js.map +1 -1
  167. package/lib/scheduling/helpers/generateNonRepeatingSchedule.js +57 -95
  168. package/lib/scheduling/helpers/generateNonRepeatingSchedule.js.map +1 -1
  169. package/lib/scheduling/helpers/generateRepeatingSchedule.js +80 -119
  170. package/lib/scheduling/helpers/generateRepeatingSchedule.js.map +1 -1
  171. package/lib/scheduling/helpers/generateScheduleEnd.js +24 -14
  172. package/lib/scheduling/helpers/generateScheduleEnd.js.map +1 -1
  173. package/lib/scheduling/helpers/hasValidStartAndEnd.js +19 -11
  174. package/lib/scheduling/helpers/hasValidStartAndEnd.js.map +1 -1
  175. package/lib/scheduling/helpers/index.js +159 -14
  176. package/lib/scheduling/helpers/index.js.map +1 -1
  177. package/lib/scheduling/helpers/intervalCovers.js +13 -7
  178. package/lib/scheduling/helpers/intervalCovers.js.map +1 -1
  179. package/lib/scheduling/helpers/intervalIntersectsEnd.js +13 -7
  180. package/lib/scheduling/helpers/intervalIntersectsEnd.js.map +1 -1
  181. package/lib/scheduling/helpers/intervalIntersectsStart.js +13 -7
  182. package/lib/scheduling/helpers/intervalIntersectsStart.js.map +1 -1
  183. package/lib/scheduling/helpers/intervalOnlyIntersectsEnd.js +15 -10
  184. package/lib/scheduling/helpers/intervalOnlyIntersectsEnd.js.map +1 -1
  185. package/lib/scheduling/helpers/intervalOnlyIntersectsStart.js +15 -10
  186. package/lib/scheduling/helpers/intervalOnlyIntersectsStart.js.map +1 -1
  187. package/lib/scheduling/helpers/intervalOutside.js +15 -9
  188. package/lib/scheduling/helpers/intervalOutside.js.map +1 -1
  189. package/lib/scheduling/helpers/intervalWithin.js +13 -7
  190. package/lib/scheduling/helpers/intervalWithin.js.map +1 -1
  191. package/lib/scheduling/helpers/mergeIntervals.js +21 -17
  192. package/lib/scheduling/helpers/mergeIntervals.js.map +1 -1
  193. package/lib/scheduling/helpers/splitIntervals.js +24 -23
  194. package/lib/scheduling/helpers/splitIntervals.js.map +1 -1
  195. package/lib/scheduling/index.js +38 -3
  196. package/lib/scheduling/index.js.map +1 -1
  197. package/lib/scheduling/scheduling.types.js +9 -3
  198. package/lib/scheduling/scheduling.types.js.map +1 -1
  199. package/lib/scheduling/strategies/getNext.js +57 -63
  200. package/lib/scheduling/strategies/getNext.js.map +1 -1
  201. package/lib/scheduling/strategies/getNextExactDateOfMonth.js +47 -56
  202. package/lib/scheduling/strategies/getNextExactDateOfMonth.js.map +1 -1
  203. package/lib/scheduling/strategies/getNextLastDayOfMonth.js +43 -51
  204. package/lib/scheduling/strategies/getNextLastDayOfMonth.js.map +1 -1
  205. package/lib/scheduling/strategies/getNextLastWeekdayOfMonth.js +49 -56
  206. package/lib/scheduling/strategies/getNextLastWeekdayOfMonth.js.map +1 -1
  207. package/lib/scheduling/strategies/getNextNoRepeat.js +25 -36
  208. package/lib/scheduling/strategies/getNextNoRepeat.js.map +1 -1
  209. package/lib/scheduling/strategies/getNextWeekday.js +47 -79
  210. package/lib/scheduling/strategies/getNextWeekday.js.map +1 -1
  211. package/lib/scheduling/strategies/getNextXDayOfXWeekOfMonth.js +52 -58
  212. package/lib/scheduling/strategies/getNextXDayOfXWeekOfMonth.js.map +1 -1
  213. package/lib/scheduling/strategies/index.js +82 -7
  214. package/lib/scheduling/strategies/index.js.map +1 -1
  215. package/lib/schema/index.js +16 -1
  216. package/lib/schema/index.js.map +1 -1
  217. package/lib/schema/schema.js +28 -34
  218. package/lib/schema/schema.js.map +1 -1
  219. package/lib/service-hours/__helpers__/calculate-hours.js +24 -22
  220. package/lib/service-hours/__helpers__/calculate-hours.js.map +1 -1
  221. package/lib/service-hours/__helpers__/isOpen.js +25 -24
  222. package/lib/service-hours/__helpers__/isOpen.js.map +1 -1
  223. package/lib/service-hours/index.js +27 -2
  224. package/lib/service-hours/index.js.map +1 -1
  225. package/lib/service-hours/schema.js +68 -55
  226. package/lib/service-hours/schema.js.map +1 -1
  227. package/package.json +86 -86
  228. package/vitest.config.ts +23 -23
  229. package/vitest.setup.js +7 -7
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.scheduleIntervalsGenerator = scheduleIntervalsGenerator;
7
7
  var _helpers = require("../helpers");
8
8
  var _scheduling = require("../scheduling.types");
9
- /**
10
- * Generates schedule service and occurrence intervals
9
+ /**
10
+ * Generates schedule service and occurrence intervals
11
11
  */
12
12
  function* scheduleIntervalsGenerator(props) {
13
13
  const {
@@ -10,8 +10,8 @@ var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
10
10
  var _serviceHours = require("../../service-hours");
11
11
  var _scheduling = require("../scheduling.types");
12
12
  var _helpers = require("../helpers");
13
- /**
14
- * Generates service intervals between start and end range for service hours
13
+ /**
14
+ * Generates service intervals between start and end range for service hours
15
15
  */
16
16
  function* serviceIntervalsGenerator(props) {
17
17
  const {
@@ -8,12 +8,12 @@ exports.convertToTimezone = convertToTimezone;
8
8
  var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
9
  const DATE_FORMAT = 'YYYY-MM-DD HH:mm';
10
10
 
11
- /**
12
- * Accepts a timestamp and returns the same timestamp but in the timezone
13
- * provided
14
- *
15
- * convertToTimezone(1561248000000, 'Australia/Melbourne') // 2019-06-23T00:00:00+00:00
16
- * returns 1561212000000 // 2019-06-23T00:00:00+10:00
11
+ /**
12
+ * Accepts a timestamp and returns the same timestamp but in the timezone
13
+ * provided
14
+ *
15
+ * convertToTimezone(1561248000000, 'Australia/Melbourne') // 2019-06-23T00:00:00+00:00
16
+ * returns 1561212000000 // 2019-06-23T00:00:00+10:00
17
17
  */
18
18
  function convertToTimezone(timestamp, timezone) {
19
19
  const datestring = _momentTimezone.default.utc(timestamp).format(DATE_FORMAT);
@@ -8,8 +8,8 @@ var _fp = require("lodash/fp");
8
8
  var _ = require(".");
9
9
  var _scheduling = require("../scheduling.types");
10
10
  var _generators = require("../generators");
11
- /**
12
- * Generates non repeating schedule service and occurrence intervals
11
+ /**
12
+ * Generates non repeating schedule service and occurrence intervals
13
13
  */
14
14
  function* generateNonRepeatingSchedule(props) {
15
15
  const {
@@ -11,8 +11,8 @@ var _scheduling = require("../scheduling.types");
11
11
  var _generators = require("../generators");
12
12
  const complyingServiceIntervalUnits = exports.complyingServiceIntervalUnits = [_scheduling.Unit.Second, _scheduling.Unit.Minute, _scheduling.Unit.Hour];
13
13
 
14
- /**
15
- * Generates repeating schedule service and occurrence intervals
14
+ /**
15
+ * Generates repeating schedule service and occurrence intervals
16
16
  */
17
17
  function* generateRepeatingSchedule(props) {
18
18
  const {
@@ -8,8 +8,8 @@ exports.generateScheduleEnd = generateScheduleEnd;
8
8
  var _fp = require("lodash/fp");
9
9
  var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
10
10
  var _scheduling = require("../scheduling.types");
11
- /**
12
- * Generates a schedule end datetime based on the start and frequency
11
+ /**
12
+ * Generates a schedule end datetime based on the start and frequency
13
13
  */
14
14
  function generateScheduleEnd({
15
15
  frequency,
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.hasValidStartAndEnd = hasValidStartAndEnd;
8
8
  var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
- /**
10
- * Checks if start and end are valid datetimes
11
- *
12
- * hasValidStartAndEnd({ end: 1566970473988, start: 1566970464839 })
13
- * returns true
9
+ /**
10
+ * Checks if start and end are valid datetimes
11
+ *
12
+ * hasValidStartAndEnd({ end: 1566970473988, start: 1566970464839 })
13
+ * returns true
14
14
  */
15
15
  function hasValidStartAndEnd({
16
16
  start,
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.intervalCovers = intervalCovers;
7
- /**
8
- * Checks if interval covers another
9
- * Accepts two intervals and checks whether the first covers the second
10
- *
11
- * intervalCovers([0,20], [5,15])
12
- * returns true
7
+ /**
8
+ * Checks if interval covers another
9
+ * Accepts two intervals and checks whether the first covers the second
10
+ *
11
+ * intervalCovers([0,20], [5,15])
12
+ * returns true
13
13
  */
14
14
  function intervalCovers(firstInterval, secondInterval) {
15
15
  return firstInterval[0] <= secondInterval[0] && firstInterval[1] >= secondInterval[1];
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.intervalIntersectsEnd = intervalIntersectsEnd;
7
- /**
8
- * Check if interval intersects another interval's end
9
- * Accepts two intervals and checks whether the first intersects the second's end
10
- *
11
- * intervalIntersectsEnd([12,20], [5,15]))
12
- * returns true
7
+ /**
8
+ * Check if interval intersects another interval's end
9
+ * Accepts two intervals and checks whether the first intersects the second's end
10
+ *
11
+ * intervalIntersectsEnd([12,20], [5,15]))
12
+ * returns true
13
13
  */
14
14
  function intervalIntersectsEnd(firstInterval, secondInterval) {
15
15
  return firstInterval[1] >= secondInterval[1] && firstInterval[0] < secondInterval[1];
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.intervalIntersectsStart = intervalIntersectsStart;
7
- /**
8
- * Check if interval intersects another interval's start
9
- * Accepts two intervals and checks whether the first intersects the second's start
10
- *
11
- * intervalIntersectsStart([2,10], [5,15])
12
- * returns true
7
+ /**
8
+ * Check if interval intersects another interval's start
9
+ * Accepts two intervals and checks whether the first intersects the second's start
10
+ *
11
+ * intervalIntersectsStart([2,10], [5,15])
12
+ * returns true
13
13
  */
14
14
  function intervalIntersectsStart(firstInterval, secondInterval) {
15
15
  return firstInterval[0] <= secondInterval[0] && firstInterval[1] > secondInterval[0];
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.intervalOnlyIntersectsEnd = intervalOnlyIntersectsEnd;
7
7
  var _intervalIntersectsEnd = require("./intervalIntersectsEnd");
8
8
  var _intervalIntersectsStart = require("./intervalIntersectsStart");
9
- /**
10
- * Check if interval only intersects another interval's end
11
- * Accepts two intervals and checks whether the first only intersects the second's end
12
- *
13
- * intervalIntersectsEnd([12,20], [5,15]))
14
- * returns true
9
+ /**
10
+ * Check if interval only intersects another interval's end
11
+ * Accepts two intervals and checks whether the first only intersects the second's end
12
+ *
13
+ * intervalIntersectsEnd([12,20], [5,15]))
14
+ * returns true
15
15
  */
16
16
 
17
17
  function intervalOnlyIntersectsEnd(firstInterval, secondInterval) {
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.intervalOnlyIntersectsStart = intervalOnlyIntersectsStart;
7
7
  var _intervalIntersectsEnd = require("./intervalIntersectsEnd");
8
8
  var _intervalIntersectsStart = require("./intervalIntersectsStart");
9
- /**
10
- * Check if interval only intersects another interval's start
11
- * Accepts two intervals and checks whether the first only intersects the second's start
12
- *
13
- * intervalOnlyIntersectsStart([2,10], [5,15])
14
- * returns true
9
+ /**
10
+ * Check if interval only intersects another interval's start
11
+ * Accepts two intervals and checks whether the first only intersects the second's start
12
+ *
13
+ * intervalOnlyIntersectsStart([2,10], [5,15])
14
+ * returns true
15
15
  */
16
16
  function intervalOnlyIntersectsStart(firstInterval, secondInterval) {
17
17
  return (0, _intervalIntersectsStart.intervalIntersectsStart)(firstInterval, secondInterval) && !(0, _intervalIntersectsEnd.intervalIntersectsEnd)(firstInterval, secondInterval);
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.intervalOutside = intervalOutside;
7
- /**
8
- * Check if interval outside another interval
9
- * Accepts two intervals and checks whether other interval is in the past or future
10
- *
11
- * intervalOutside([1, 4], [5,15])
12
- * returns true
7
+ /**
8
+ * Check if interval outside another interval
9
+ * Accepts two intervals and checks whether other interval is in the past or future
10
+ *
11
+ * intervalOutside([1, 4], [5,15])
12
+ * returns true
13
13
  */
14
14
  function intervalOutside(firstInterval, secondInterval) {
15
15
  const future = firstInterval[0] > secondInterval[1] && firstInterval[1] > secondInterval[1];
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.intervalWithin = intervalWithin;
7
- /**
8
- * Checks if interval within another interval
9
- * Accepts two intervals and checks whether within other interval
10
- *
11
- * intervalWithin([7,12], [5,15])
12
- * returns true
7
+ /**
8
+ * Checks if interval within another interval
9
+ * Accepts two intervals and checks whether within other interval
10
+ *
11
+ * intervalWithin([7,12], [5,15])
12
+ * returns true
13
13
  */
14
14
  function intervalWithin(firstInterval, secondInterval) {
15
15
  return firstInterval[0] > secondInterval[0] && firstInterval[1] < secondInterval[1];
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.mergeIntervals = mergeIntervals;
7
7
  var _fp = require("lodash/fp");
8
- /**
9
- * Merges overlapping intervals
10
- * Accepts arrays of intervals and returns a flattened result of overlapping intervals
11
- *
12
- * mergeIntervals([[1,15], [11,25], [21,29], [40,1000]])
13
- * returns [[1,29], [40,1000]]
8
+ /**
9
+ * Merges overlapping intervals
10
+ * Accepts arrays of intervals and returns a flattened result of overlapping intervals
11
+ *
12
+ * mergeIntervals([[1,15], [11,25], [21,29], [40,1000]])
13
+ * returns [[1,29], [40,1000]]
14
14
  */
15
15
  function mergeIntervals(intervals) {
16
16
  if ((0, _fp.isEmpty)(intervals)) return intervals;
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.splitIntervals = splitIntervals;
7
7
  var _fp = require("lodash/fp");
8
8
  var _ = require(".");
9
- /**
10
- * Applies closed intervals to intervals
11
- * Accepts two sets of intervals and splits the first set by the second set
12
- *
13
- * splitIntervals([[1,10], [11,20], [21,29]], [[8,13]])
14
- * returns [[1,8], [13,20], [21,29]]
9
+ /**
10
+ * Applies closed intervals to intervals
11
+ * Accepts two sets of intervals and splits the first set by the second set
12
+ *
13
+ * splitIntervals([[1,10], [11,20], [21,29]], [[8,13]])
14
+ * returns [[1,8], [13,20], [21,29]]
15
15
  */
16
16
  function splitIntervals(intervals = [], closeIntervals = []) {
17
17
  if ((0, _fp.isEmpty)(closeIntervals)) return intervals;
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getNext = getNext;
8
8
  var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
9
  var _scheduling = require("../scheduling.types");
10
- /**
11
- * Generates next occurrence interval for stopwatch and window strategy
10
+ /**
11
+ * Generates next occurrence interval for stopwatch and window strategy
12
12
  */
13
13
  function* getNext({
14
14
  end,
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getNextExactDateOfMonth = getNextExactDateOfMonth;
8
8
  var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
9
  var _scheduling = require("../scheduling.types");
10
- /**
11
- * Generates next occurrence interval for exact date of month strategy
10
+ /**
11
+ * Generates next occurrence interval for exact date of month strategy
12
12
  */
13
13
  function* getNextExactDateOfMonth({
14
14
  end,
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getNextLastDayOfMonth = getNextLastDayOfMonth;
8
8
  var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
9
  var _scheduling = require("../scheduling.types");
10
- /**
11
- * Generates next occurrence interval for last day of month strategy
10
+ /**
11
+ * Generates next occurrence interval for last day of month strategy
12
12
  */
13
13
  function* getNextLastDayOfMonth({
14
14
  end,
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getNextLastWeekdayOfMonth = getNextLastWeekdayOfMonth;
8
8
  var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
9
  var _scheduling = require("../scheduling.types");
10
- /**
11
- * Generates next occurrence interval for last weekday of month strategy
10
+ /**
11
+ * Generates next occurrence interval for last weekday of month strategy
12
12
  */
13
13
  function* getNextLastWeekdayOfMonth({
14
14
  end,
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.getNextNoRepeat = getNextNoRepeat;
8
8
  var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
- /**
10
- * Generates next occurrence interval for non repeat strategy
9
+ /**
10
+ * Generates next occurrence interval for non repeat strategy
11
11
  */
12
12
  function* getNextNoRepeat({
13
13
  start,
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getNextWeekday = getNextWeekday;
8
8
  var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
9
  var _scheduling = require("../scheduling.types");
10
- /**
11
- * Generates next occurrence interval for weekdays strategy
10
+ /**
11
+ * Generates next occurrence interval for weekdays strategy
12
12
  */
13
13
  function* getNextWeekday({
14
14
  end,
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getNextXDayOfXWeekOfMonth = getNextXDayOfXWeekOfMonth;
8
8
  var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
9
  var _scheduling = require("../scheduling.types");
10
- /**
11
- * Generates next occurrence interval for x day of x week of month strategy
10
+ /**
11
+ * Generates next occurrence interval for x day of x week of month strategy
12
12
  */
13
13
  function* getNextXDayOfXWeekOfMonth({
14
14
  end,
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
- /**
4
- * Script to generate service hour definitions which is otherwise tedious to
5
- * calculate as we store them in millisecond offsets
6
- * Example Input: TUE 08:00 - TUE 17:00
3
+ /**
4
+ * Script to generate service hour definitions which is otherwise tedious to
5
+ * calculate as we store them in millisecond offsets
6
+ * Example Input: TUE 08:00 - TUE 17:00
7
7
  */
8
8
 
9
9
  const days = {
@@ -9,8 +9,8 @@ var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
9
9
  var _fp = require("lodash/fp");
10
10
  var _generators = require("../../scheduling/generators");
11
11
  var _scheduling = require("../../scheduling/scheduling.types");
12
- /**
13
- * Checks whether timestamp is within service hours for start and end
12
+ /**
13
+ * Checks whether timestamp is within service hours for start and end
14
14
  */
15
15
  function isOpen({
16
16
  serviceHours,
@@ -81,10 +81,10 @@ const schema = exports.schema = (0, _yup.object)({
81
81
  return true;
82
82
  })
83
83
  });
84
- /**
85
- * validateOverlappingHours
86
- * Validates that any hours do not overlap each other
87
- * Validates default hours are within a week range
84
+ /**
85
+ * validateOverlappingHours
86
+ * Validates that any hours do not overlap each other
87
+ * Validates default hours are within a week range
88
88
  */
89
89
  function validateOverlappingHours(options) {
90
90
  const {
package/lib/constants.js CHANGED
@@ -1,8 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LIGHTHOUSE_LOGO_URL = exports.DEFAULT_SUMMARY_FIELDS_COLUMN_LENGTH = exports.DEFAULT_PAGE_SIZE = exports.DEFAULT_PAGE_ORIENTATION = exports.DEFAULT_PAGE_MARGINS = exports.DEFAULT_IMAGE_COLUMN_LENGTH = void 0;
1
7
  // pdf
2
- export var DEFAULT_IMAGE_COLUMN_LENGTH = 2;
3
- export var DEFAULT_SUMMARY_FIELDS_COLUMN_LENGTH = 3;
4
- export var DEFAULT_PAGE_MARGINS = [60, 130, 60, 80];
5
- export var DEFAULT_PAGE_ORIENTATION = 'portrait';
6
- export var DEFAULT_PAGE_SIZE = 'A4';
7
- export var LIGHTHOUSE_LOGO_URL = 'https://assets-lighthouse-io.s3.amazonaws.com/img/lighthouse-color-logo-2023.png';
8
+ const DEFAULT_IMAGE_COLUMN_LENGTH = exports.DEFAULT_IMAGE_COLUMN_LENGTH = 2;
9
+ const DEFAULT_SUMMARY_FIELDS_COLUMN_LENGTH = exports.DEFAULT_SUMMARY_FIELDS_COLUMN_LENGTH = 3;
10
+ const DEFAULT_PAGE_MARGINS = exports.DEFAULT_PAGE_MARGINS = [60, 130, 60, 80];
11
+ const DEFAULT_PAGE_ORIENTATION = exports.DEFAULT_PAGE_ORIENTATION = 'portrait';
12
+ const DEFAULT_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = 'A4';
13
+ const LIGHTHOUSE_LOGO_URL = exports.LIGHTHOUSE_LOGO_URL = 'https://assets-lighthouse-io.s3.amazonaws.com/img/lighthouse-color-logo-2023.png';
8
14
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["DEFAULT_IMAGE_COLUMN_LENGTH","DEFAULT_SUMMARY_FIELDS_COLUMN_LENGTH","DEFAULT_PAGE_MARGINS","DEFAULT_PAGE_ORIENTATION","DEFAULT_PAGE_SIZE","LIGHTHOUSE_LOGO_URL"],"sources":["../src/constants.js"],"sourcesContent":["// pdf\nexport const DEFAULT_IMAGE_COLUMN_LENGTH = 2\nexport const DEFAULT_SUMMARY_FIELDS_COLUMN_LENGTH = 3\nexport const DEFAULT_PAGE_MARGINS = [60, 130, 60, 80]\nexport const DEFAULT_PAGE_ORIENTATION = 'portrait'\nexport const DEFAULT_PAGE_SIZE = 'A4'\nexport const LIGHTHOUSE_LOGO_URL =\n 'https://assets-lighthouse-io.s3.amazonaws.com/img/lighthouse-color-logo-2023.png'\n"],"mappings":"AAAA;AACA,OAAO,IAAMA,2BAA2B,GAAG,CAAC;AAC5C,OAAO,IAAMC,oCAAoC,GAAG,CAAC;AACrD,OAAO,IAAMC,oBAAoB,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC;AACrD,OAAO,IAAMC,wBAAwB,GAAG,UAAU;AAClD,OAAO,IAAMC,iBAAiB,GAAG,IAAI;AACrC,OAAO,IAAMC,mBAAmB,GAC9B,kFAAkF","ignoreList":[]}
1
+ {"version":3,"file":"constants.js","names":["DEFAULT_IMAGE_COLUMN_LENGTH","exports","DEFAULT_SUMMARY_FIELDS_COLUMN_LENGTH","DEFAULT_PAGE_MARGINS","DEFAULT_PAGE_ORIENTATION","DEFAULT_PAGE_SIZE","LIGHTHOUSE_LOGO_URL"],"sources":["../src/constants.js"],"sourcesContent":["// pdf\r\nexport const DEFAULT_IMAGE_COLUMN_LENGTH = 2\r\nexport const DEFAULT_SUMMARY_FIELDS_COLUMN_LENGTH = 3\r\nexport const DEFAULT_PAGE_MARGINS = [60, 130, 60, 80]\r\nexport const DEFAULT_PAGE_ORIENTATION = 'portrait'\r\nexport const DEFAULT_PAGE_SIZE = 'A4'\r\nexport const LIGHTHOUSE_LOGO_URL =\r\n 'https://assets-lighthouse-io.s3.amazonaws.com/img/lighthouse-color-logo-2023.png'\r\n"],"mappings":";;;;;;AAAA;AACO,MAAMA,2BAA2B,GAAAC,OAAA,CAAAD,2BAAA,GAAG,CAAC;AACrC,MAAME,oCAAoC,GAAAD,OAAA,CAAAC,oCAAA,GAAG,CAAC;AAC9C,MAAMC,oBAAoB,GAAAF,OAAA,CAAAE,oBAAA,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC;AAC9C,MAAMC,wBAAwB,GAAAH,OAAA,CAAAG,wBAAA,GAAG,UAAU;AAC3C,MAAMC,iBAAiB,GAAAJ,OAAA,CAAAI,iBAAA,GAAG,IAAI;AAC9B,MAAMC,mBAAmB,GAAAL,OAAA,CAAAK,mBAAA,GAC9B,kFAAkF","ignoreList":[]}
@@ -1,30 +1,23 @@
1
- import _createClass from "@babel/runtime/helpers/createClass";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
7
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
9
7
  // TODO is this universal?
10
- var DomainError = /*#__PURE__*/function (_Error) {
11
- function DomainError(message) {
12
- var _this;
13
- _classCallCheck(this, DomainError);
14
- _this = _callSuper(this, DomainError, [message]);
15
- _this.name = _this.constructor.name;
8
+ class DomainError extends Error {
9
+ constructor(message) {
10
+ super(message);
11
+ this.name = this.constructor.name;
16
12
 
17
13
  // @ts-ignore support both node and browser environments
18
14
  if (typeof Error.captureStackTrace === 'function') {
19
15
  // @ts-ignore
20
- Error.captureStackTrace(_this, _this.constructor);
16
+ Error.captureStackTrace(this, this.constructor);
21
17
  } else {
22
- _this.stack = new Error(message).stack;
18
+ this.stack = new Error(message).stack;
23
19
  }
24
- return _this;
25
20
  }
26
- _inherits(DomainError, _Error);
27
- return _createClass(DomainError);
28
- }(/*#__PURE__*/_wrapNativeSuper(Error));
29
- export { DomainError as default };
21
+ }
22
+ exports.default = DomainError;
30
23
  //# sourceMappingURL=DomainError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DomainError.js","names":["DomainError","_Error","message","_this","_classCallCheck","_callSuper","name","constructor","Error","captureStackTrace","stack","_inherits","_createClass","_wrapNativeSuper","default"],"sources":["../../src/errors/DomainError.ts"],"sourcesContent":["// TODO is this universal?\nexport default class DomainError extends Error {\n constructor(message: string) {\n super(message)\n this.name = this.constructor.name\n\n // @ts-ignore support both node and browser environments\n if (typeof Error.captureStackTrace === 'function') {\n // @ts-ignore\n Error.captureStackTrace(this, this.constructor)\n } else { \n this.stack = (new Error(message)).stack\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAAA,IACqBA,WAAW,0BAAAC,MAAA;EAC9B,SAAAD,YAAYE,OAAe,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAJ,WAAA;IAC3BG,KAAA,GAAAE,UAAA,OAAAL,WAAA,GAAME,OAAO;IACbC,KAAA,CAAKG,IAAI,GAAGH,KAAA,CAAKI,WAAW,CAACD,IAAI;;IAEjC;IACA,IAAI,OAAOE,KAAK,CAACC,iBAAiB,KAAK,UAAU,EAAE;MACjD;MACAD,KAAK,CAACC,iBAAiB,CAAAN,KAAA,EAAOA,KAAA,CAAKI,WAAW,CAAC;IACjD,CAAC,MAAM;MACLJ,KAAA,CAAKO,KAAK,GAAI,IAAIF,KAAK,CAACN,OAAO,CAAC,CAAEQ,KAAK;IACzC;IAAC,OAAAP,KAAA;EACH;EAACQ,SAAA,CAAAX,WAAA,EAAAC,MAAA;EAAA,OAAAW,YAAA,CAAAZ,WAAA;AAAA,eAAAa,gBAAA,CAZsCL,KAAK;AAAA,SAAzBR,WAAW,IAAAc,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"DomainError.js","names":["DomainError","Error","constructor","message","name","captureStackTrace","stack","exports","default"],"sources":["../../src/errors/DomainError.ts"],"sourcesContent":["// TODO is this universal?\r\nexport default class DomainError extends Error {\r\n constructor(message: string) {\r\n super(message)\r\n this.name = this.constructor.name\r\n\r\n // @ts-ignore support both node and browser environments\r\n if (typeof Error.captureStackTrace === 'function') {\r\n // @ts-ignore\r\n Error.captureStackTrace(this, this.constructor)\r\n } else { \r\n this.stack = (new Error(message)).stack\r\n }\r\n }\r\n}\r\n"],"mappings":";;;;;;AAAA;AACe,MAAMA,WAAW,SAASC,KAAK,CAAC;EAC7CC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,IAAI,CAACF,WAAW,CAACE,IAAI;;IAEjC;IACA,IAAI,OAAOH,KAAK,CAACI,iBAAiB,KAAK,UAAU,EAAE;MACjD;MACAJ,KAAK,CAACI,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAACH,WAAW,CAAC;IACjD,CAAC,MAAM;MACL,IAAI,CAACI,KAAK,GAAI,IAAIL,KAAK,CAACE,OAAO,CAAC,CAAEG,KAAK;IACzC;EACF;AACF;AAACC,OAAA,CAAAC,OAAA,GAAAR,WAAA","ignoreList":[]}
@@ -1,27 +1,20 @@
1
- import _createClass from "@babel/runtime/helpers/createClass";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
7
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
- /**
10
- * Custom error class for image fetching operations
11
- * Includes context information for better debugging
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FetchImageError = void 0;
7
+ /**
8
+ * Custom error class for image fetching operations
9
+ * Includes context information for better debugging
12
10
  */
13
- export var FetchImageError = /*#__PURE__*/function (_Error) {
14
- function FetchImageError(message) {
15
- var _this;
16
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
17
- _classCallCheck(this, FetchImageError);
18
- _this = _callSuper(this, FetchImageError, [message]);
19
- _this.name = 'FetchImageError';
20
- _this.context = context;
21
- _this.url = context.url;
22
- return _this;
11
+ class FetchImageError extends Error {
12
+ constructor(message, context = {}) {
13
+ super(message);
14
+ this.name = 'FetchImageError';
15
+ this.context = context;
16
+ this.url = context.url;
23
17
  }
24
- _inherits(FetchImageError, _Error);
25
- return _createClass(FetchImageError);
26
- }(/*#__PURE__*/_wrapNativeSuper(Error));
18
+ }
19
+ exports.FetchImageError = FetchImageError;
27
20
  //# sourceMappingURL=FetchImageError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FetchImageError.js","names":["FetchImageError","_Error","message","_this","context","arguments","length","undefined","_classCallCheck","_callSuper","name","url","_inherits","_createClass","_wrapNativeSuper","Error"],"sources":["../../src/errors/FetchImageError.js"],"sourcesContent":["/**\n * Custom error class for image fetching operations\n * Includes context information for better debugging\n */\nexport class FetchImageError extends Error {\n constructor(message, context = {}) {\n super(message)\n this.name = 'FetchImageError'\n this.context = context\n this.url = context.url\n }\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA,WAAaA,eAAe,0BAAAC,MAAA;EAC1B,SAAAD,gBAAYE,OAAO,EAAgB;IAAA,IAAAC,KAAA;IAAA,IAAdC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAAAG,eAAA,OAAAR,eAAA;IAC/BG,KAAA,GAAAM,UAAA,OAAAT,eAAA,GAAME,OAAO;IACbC,KAAA,CAAKO,IAAI,GAAG,iBAAiB;IAC7BP,KAAA,CAAKC,OAAO,GAAGA,OAAO;IACtBD,KAAA,CAAKQ,GAAG,GAAGP,OAAO,CAACO,GAAG;IAAA,OAAAR,KAAA;EACxB;EAACS,SAAA,CAAAZ,eAAA,EAAAC,MAAA;EAAA,OAAAY,YAAA,CAAAb,eAAA;AAAA,eAAAc,gBAAA,CANkCC,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"FetchImageError.js","names":["FetchImageError","Error","constructor","message","context","name","url","exports"],"sources":["../../src/errors/FetchImageError.js"],"sourcesContent":["/**\r\n * Custom error class for image fetching operations\r\n * Includes context information for better debugging\r\n */\r\nexport class FetchImageError extends Error {\r\n constructor(message, context = {}) {\r\n super(message)\r\n this.name = 'FetchImageError'\r\n this.context = context\r\n this.url = context.url\r\n }\r\n}\r\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACO,MAAMA,eAAe,SAASC,KAAK,CAAC;EACzCC,WAAWA,CAACC,OAAO,EAAEC,OAAO,GAAG,CAAC,CAAC,EAAE;IACjC,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,iBAAiB;IAC7B,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,GAAG,GAAGF,OAAO,CAACE,GAAG;EACxB;AACF;AAACC,OAAA,CAAAP,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -1,41 +1,35 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _inherits from "@babel/runtime/helpers/inherits";
8
- var _excluded = ["message", "name"];
9
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
- import { ValidationError as SchemaValidationError } from 'yup';
12
- import DomainError from './DomainError';
13
- var DEFAULT_MESSAGE = 'The data you submitted was invalid. Please try again with valid data.';
14
- var ValidationError = /*#__PURE__*/function (_DomainError) {
15
- function ValidationError(_ref) {
16
- var _this;
17
- var data = _ref.data,
18
- _ref$message = _ref.message,
19
- message = _ref$message === void 0 ? DEFAULT_MESSAGE : _ref$message;
20
- _classCallCheck(this, ValidationError);
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _yup = require("yup");
9
+ var _DomainError = _interopRequireDefault(require("./DomainError"));
10
+ const DEFAULT_MESSAGE = 'The data you submitted was invalid. Please try again with valid data.';
11
+ class ValidationError extends _DomainError.default {
12
+ constructor({
13
+ data,
14
+ message = DEFAULT_MESSAGE
15
+ }) {
21
16
  // When the data object is a schema validation error, take its data
22
17
  // attributes and apply to our wrapped error
23
- if (data instanceof SchemaValidationError) {
24
- var validationMessage = data.message,
25
- name = data.name,
26
- other = _objectWithoutProperties(data, _excluded);
27
- _this = _callSuper(this, ValidationError, [validationMessage]);
28
- _this.data = other;
29
- _this.status = 400;
30
- return _possibleConstructorReturn(_this);
18
+ if (data instanceof _yup.ValidationError) {
19
+ const {
20
+ message: validationMessage,
21
+ name,
22
+ ...other
23
+ } = data;
24
+ super(validationMessage);
25
+ this.data = other;
26
+ this.status = 400;
27
+ return;
31
28
  }
32
- _this = _callSuper(this, ValidationError, [message]);
33
- _this.data = data;
34
- _this.status = 400;
35
- return _assertThisInitialized(_this);
29
+ super(message);
30
+ this.data = data;
31
+ this.status = 400;
36
32
  }
37
- _inherits(ValidationError, _DomainError);
38
- return _createClass(ValidationError);
39
- }(DomainError);
40
- export { ValidationError as default };
33
+ }
34
+ exports.default = ValidationError;
41
35
  //# sourceMappingURL=ValidationError.js.map