@escapenavigator/utils 1.6.79 → 1.6.80

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.
@@ -0,0 +1 @@
1
+ export declare const convertHHMMToMinutes: (hhmm: string) => number;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertHHMMToMinutes = void 0;
4
+ const convertHHMMToMinutes = (hhmm) => +hhmm.split(':')[0] * 60 + +hhmm.split(':')[1];
5
+ exports.convertHHMMToMinutes = convertHHMMToMinutes;
@@ -0,0 +1,10 @@
1
+ export declare function getEmailResultSection({ result, resultTitle, noResultTitle, photos, }: {
2
+ result: string;
3
+ resultTitle: string;
4
+ noResultTitle: string;
5
+ photos: string[];
6
+ }): {
7
+ type: "paragraph";
8
+ title: string;
9
+ text: string;
10
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEmailResultSection = void 0;
4
+ const photoHtml = (photo) => `<a target="_blank" href="${photo}" style="padding-top: 12px; padding-right: 12px; outline: none; border: none"><img src="${photo}" style="width: 150px;height:150px; object-fit: cover;border-radius: 12px;"></a>`;
5
+ function getEmailResultSection({ result, resultTitle, noResultTitle, photos, }) {
6
+ if (!result && !photos.length)
7
+ return null;
8
+ const title = result ? resultTitle : noResultTitle;
9
+ return {
10
+ type: 'paragraph',
11
+ title,
12
+ text: `${photos.map((p) => photoHtml(p)).join('')}`,
13
+ };
14
+ }
15
+ exports.getEmailResultSection = getEmailResultSection;
@@ -0,0 +1,19 @@
1
+ export declare function getEmailUpsalesSection({ upsales, link, title, buttonText, }: {
2
+ upsales: Array<{
3
+ title: string;
4
+ description: string;
5
+ }>;
6
+ link: string;
7
+ title: string;
8
+ buttonText: string;
9
+ }): ({
10
+ type: "paragraph";
11
+ title: string;
12
+ text: string;
13
+ link?: undefined;
14
+ } | {
15
+ type: "button";
16
+ text: string;
17
+ link: string;
18
+ title?: undefined;
19
+ })[];
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEmailUpsalesSection = void 0;
4
+ const html = ({ title, description, }) => `<br/><b>${title}</b> - ${description}`;
5
+ function getEmailUpsalesSection({ upsales, link, title, buttonText, }) {
6
+ if (!upsales || !upsales.length)
7
+ return null;
8
+ return [{
9
+ type: 'paragraph',
10
+ title,
11
+ text: `${upsales.map((p) => html(p)).join('')}`,
12
+ }, {
13
+ type: 'button',
14
+ text: buttonText,
15
+ link,
16
+ }];
17
+ }
18
+ exports.getEmailUpsalesSection = getEmailUpsalesSection;
package/dist/index.d.ts CHANGED
@@ -11,3 +11,5 @@ export * from './serialize-record';
11
11
  export * from './serialize-slot';
12
12
  export * from './tz-date';
13
13
  export * from './validate-by-dto';
14
+ export * from './convert-hhmm-to-minutes';
15
+ export * from './convert-minutes-to-hhmm';
package/dist/index.js CHANGED
@@ -27,3 +27,5 @@ __exportStar(require("./serialize-record"), exports);
27
27
  __exportStar(require("./serialize-slot"), exports);
28
28
  __exportStar(require("./tz-date"), exports);
29
29
  __exportStar(require("./validate-by-dto"), exports);
30
+ __exportStar(require("./convert-hhmm-to-minutes"), exports);
31
+ __exportStar(require("./convert-minutes-to-hhmm"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escapenavigator/utils",
3
- "version": "1.6.79",
3
+ "version": "1.6.80",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,7 +14,7 @@
14
14
  "test": "jest"
15
15
  },
16
16
  "dependencies": {
17
- "@escapenavigator/types": "^1.6.77",
17
+ "@escapenavigator/types": "^1.6.78",
18
18
  "axios": "^0.21.4",
19
19
  "class-transformer": "^0.5.1",
20
20
  "class-validator": "^0.13.1",
@@ -55,5 +55,5 @@
55
55
  "node_modules"
56
56
  ]
57
57
  },
58
- "gitHead": "5a0be0402a4daea0ca7848c118921882c4ba9352"
58
+ "gitHead": "8d252c412be054b27bebb5014a07029719c6c6f0"
59
59
  }