@bisondesk/commons-sdk 1.0.318 → 1.0.320

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 (187) hide show
  1. package/lib/{types/becris.d.ts → becris.d.ts} +1 -1
  2. package/lib/{types/becris.d.ts.map → becris.d.ts.map} +1 -1
  3. package/lib/becris.js +1 -2
  4. package/lib/becris.js.map +1 -1
  5. package/lib/{types/constants.d.ts → constants.d.ts} +5 -1
  6. package/lib/constants.d.ts.map +1 -0
  7. package/lib/constants.js +26 -25
  8. package/lib/constants.js.map +1 -1
  9. package/lib/date-utils.d.ts +6 -0
  10. package/lib/date-utils.d.ts.map +1 -0
  11. package/lib/date-utils.js +7 -0
  12. package/lib/date-utils.js.map +1 -0
  13. package/lib/{types/discussions.d.ts → discussions.d.ts} +1 -1
  14. package/lib/discussions.d.ts.map +1 -0
  15. package/lib/discussions.js +1 -4
  16. package/lib/discussions.js.map +1 -1
  17. package/lib/{types/errors.d.ts → errors.d.ts} +2 -2
  18. package/lib/errors.d.ts.map +1 -0
  19. package/lib/errors.js +7 -17
  20. package/lib/errors.js.map +1 -1
  21. package/lib/{types/exact.d.ts → exact.d.ts} +12 -0
  22. package/lib/{types/exact.d.ts.map → exact.d.ts.map} +1 -1
  23. package/lib/exact.js +1 -2
  24. package/lib/exact.js.map +1 -1
  25. package/lib/{types/fetch.d.ts → fetch.d.ts} +2 -2
  26. package/lib/fetch.d.ts.map +1 -0
  27. package/lib/fetch.js +10 -18
  28. package/lib/fetch.js.map +1 -1
  29. package/lib/formatting.js +2 -7
  30. package/lib/formatting.js.map +1 -1
  31. package/lib/ids.js +5 -9
  32. package/lib/ids.js.map +1 -1
  33. package/lib/insurance.js +1 -2
  34. package/lib/{types/location-utils.d.ts → location-utils.d.ts} +1 -1
  35. package/lib/{types/location-utils.d.ts.map → location-utils.d.ts.map} +1 -1
  36. package/lib/location-utils.js +3 -8
  37. package/lib/location-utils.js.map +1 -1
  38. package/lib/locations.js +4 -9
  39. package/lib/locations.js.map +1 -1
  40. package/lib/{types/messages.d.ts → messages.d.ts} +1 -1
  41. package/lib/{types/messages.d.ts.map → messages.d.ts.map} +1 -1
  42. package/lib/messages.js +1 -2
  43. package/lib/messages.js.map +1 -1
  44. package/lib/{types/notifications.d.ts → notifications.d.ts} +1 -1
  45. package/lib/notifications.d.ts.map +1 -0
  46. package/lib/notifications.js +6 -9
  47. package/lib/notifications.js.map +1 -1
  48. package/lib/{types/pdf-gen.d.ts → pdf-gen.d.ts} +6 -2
  49. package/lib/pdf-gen.d.ts.map +1 -0
  50. package/lib/pdf-gen.js +1 -2
  51. package/lib/pdf-gen.js.map +1 -1
  52. package/lib/servers.js +3 -7
  53. package/lib/servers.js.map +1 -1
  54. package/lib/{types/storage.d.ts → storage.d.ts} +1 -1
  55. package/lib/{types/storage.d.ts.map → storage.d.ts.map} +1 -1
  56. package/lib/storage.js +4 -7
  57. package/lib/storage.js.map +1 -1
  58. package/lib/{types/tasks.d.ts → tasks.d.ts} +3 -4
  59. package/lib/tasks.d.ts.map +1 -0
  60. package/lib/tasks.js +4 -7
  61. package/lib/tasks.js.map +1 -1
  62. package/lib/{types/types.d.ts → types.d.ts} +22 -6
  63. package/lib/types.d.ts.map +1 -0
  64. package/lib/types.js +7 -5
  65. package/lib/types.js.map +1 -1
  66. package/package.json +12 -21
  67. package/src/becris.ts +1 -1
  68. package/src/constants.ts +4 -0
  69. package/src/date-utils.ts +14 -0
  70. package/src/discussions.ts +1 -1
  71. package/src/errors.ts +3 -3
  72. package/src/exact.ts +15 -0
  73. package/src/fetch.ts +4 -5
  74. package/src/location-utils.ts +1 -1
  75. package/src/messages.ts +1 -1
  76. package/src/notifications.ts +1 -1
  77. package/src/pdf-gen.ts +7 -2
  78. package/src/storage.ts +1 -1
  79. package/src/tasks.ts +3 -4
  80. package/src/types.ts +25 -7
  81. package/tsconfig.deploy.json +4 -0
  82. package/tsconfig.deploy.tsbuildinfo +1 -0
  83. package/tsconfig.json +1 -2
  84. package/tsconfig.tsbuildinfo +1 -1
  85. package/lib/cjs/becris.js +0 -3
  86. package/lib/cjs/becris.js.map +0 -1
  87. package/lib/cjs/constants.js +0 -107
  88. package/lib/cjs/constants.js.map +0 -1
  89. package/lib/cjs/dayjs-utils.js +0 -26
  90. package/lib/cjs/dayjs-utils.js.map +0 -1
  91. package/lib/cjs/discussions.js +0 -5
  92. package/lib/cjs/discussions.js.map +0 -1
  93. package/lib/cjs/errors.js +0 -67
  94. package/lib/cjs/errors.js.map +0 -1
  95. package/lib/cjs/exact.js +0 -3
  96. package/lib/cjs/exact.js.map +0 -1
  97. package/lib/cjs/fetch.js +0 -40
  98. package/lib/cjs/fetch.js.map +0 -1
  99. package/lib/cjs/formatting.js +0 -20
  100. package/lib/cjs/formatting.js.map +0 -1
  101. package/lib/cjs/ids.js +0 -35
  102. package/lib/cjs/ids.js.map +0 -1
  103. package/lib/cjs/insurance.js +0 -3
  104. package/lib/cjs/insurance.js.map +0 -1
  105. package/lib/cjs/location-utils.js +0 -21
  106. package/lib/cjs/location-utils.js.map +0 -1
  107. package/lib/cjs/locations.js +0 -95
  108. package/lib/cjs/locations.js.map +0 -1
  109. package/lib/cjs/messages.js +0 -3
  110. package/lib/cjs/messages.js.map +0 -1
  111. package/lib/cjs/notifications.js +0 -18
  112. package/lib/cjs/notifications.js.map +0 -1
  113. package/lib/cjs/pdf-gen.js +0 -3
  114. package/lib/cjs/pdf-gen.js.map +0 -1
  115. package/lib/cjs/servers.js +0 -26
  116. package/lib/cjs/servers.js.map +0 -1
  117. package/lib/cjs/storage.js +0 -14
  118. package/lib/cjs/storage.js.map +0 -1
  119. package/lib/cjs/tasks.js +0 -15
  120. package/lib/cjs/tasks.js.map +0 -1
  121. package/lib/cjs/types.js +0 -8
  122. package/lib/cjs/types.js.map +0 -1
  123. package/lib/dayjs-utils.js +0 -25
  124. package/lib/dayjs-utils.js.map +0 -1
  125. package/lib/esm/becris.js +0 -2
  126. package/lib/esm/becris.js.map +0 -1
  127. package/lib/esm/constants.js +0 -104
  128. package/lib/esm/constants.js.map +0 -1
  129. package/lib/esm/dayjs-utils.js +0 -18
  130. package/lib/esm/dayjs-utils.js.map +0 -1
  131. package/lib/esm/discussions.js +0 -2
  132. package/lib/esm/discussions.js.map +0 -1
  133. package/lib/esm/errors.js +0 -57
  134. package/lib/esm/errors.js.map +0 -1
  135. package/lib/esm/exact.js +0 -2
  136. package/lib/esm/exact.js.map +0 -1
  137. package/lib/esm/fetch.js +0 -32
  138. package/lib/esm/fetch.js.map +0 -1
  139. package/lib/esm/formatting.js +0 -15
  140. package/lib/esm/formatting.js.map +0 -1
  141. package/lib/esm/ids.js +0 -31
  142. package/lib/esm/ids.js.map +0 -1
  143. package/lib/esm/insurance.js +0 -2
  144. package/lib/esm/insurance.js.map +0 -1
  145. package/lib/esm/location-utils.js +0 -16
  146. package/lib/esm/location-utils.js.map +0 -1
  147. package/lib/esm/locations.js +0 -90
  148. package/lib/esm/locations.js.map +0 -1
  149. package/lib/esm/messages.js +0 -2
  150. package/lib/esm/messages.js.map +0 -1
  151. package/lib/esm/notifications.js +0 -15
  152. package/lib/esm/notifications.js.map +0 -1
  153. package/lib/esm/pdf-gen.js +0 -2
  154. package/lib/esm/pdf-gen.js.map +0 -1
  155. package/lib/esm/servers.js +0 -22
  156. package/lib/esm/servers.js.map +0 -1
  157. package/lib/esm/storage.js +0 -11
  158. package/lib/esm/storage.js.map +0 -1
  159. package/lib/esm/tasks.js +0 -12
  160. package/lib/esm/tasks.js.map +0 -1
  161. package/lib/esm/types.js +0 -5
  162. package/lib/esm/types.js.map +0 -1
  163. package/lib/tsconfig.cjs.tsbuildinfo +0 -1
  164. package/lib/tsconfig.esm.tsbuildinfo +0 -1
  165. package/lib/types/constants.d.ts.map +0 -1
  166. package/lib/types/dayjs-utils.d.ts +0 -8
  167. package/lib/types/dayjs-utils.d.ts.map +0 -1
  168. package/lib/types/discussions.d.ts.map +0 -1
  169. package/lib/types/errors.d.ts.map +0 -1
  170. package/lib/types/fetch.d.ts.map +0 -1
  171. package/lib/types/notifications.d.ts.map +0 -1
  172. package/lib/types/pdf-gen.d.ts.map +0 -1
  173. package/lib/types/tasks.d.ts.map +0 -1
  174. package/lib/types/types.d.ts.map +0 -1
  175. package/src/dayjs-utils.ts +0 -30
  176. package/tsconfig.cjs.json +0 -8
  177. package/tsconfig.esm.json +0 -8
  178. /package/lib/{types/formatting.d.ts → formatting.d.ts} +0 -0
  179. /package/lib/{types/formatting.d.ts.map → formatting.d.ts.map} +0 -0
  180. /package/lib/{types/ids.d.ts → ids.d.ts} +0 -0
  181. /package/lib/{types/ids.d.ts.map → ids.d.ts.map} +0 -0
  182. /package/lib/{types/insurance.d.ts → insurance.d.ts} +0 -0
  183. /package/lib/{types/insurance.d.ts.map → insurance.d.ts.map} +0 -0
  184. /package/lib/{types/locations.d.ts → locations.d.ts} +0 -0
  185. /package/lib/{types/locations.d.ts.map → locations.d.ts.map} +0 -0
  186. /package/lib/{types/servers.d.ts → servers.d.ts} +0 -0
  187. /package/lib/{types/servers.d.ts.map → servers.d.ts.map} +0 -0
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFormatedAddressFromLocationValue = exports.getAddressText = void 0;
4
- const getAddressText = (address, joinBy = '<br>') => {
1
+ export const getAddressText = (address, joinBy = '<br>') => {
5
2
  const regionLines = [address.postalCode, address.city, address.country.toUpperCase()]
6
3
  .filter((n) => !!n)
7
4
  .join(', ');
@@ -11,11 +8,9 @@ const getAddressText = (address, joinBy = '<br>') => {
11
8
  }
12
9
  return filteredParts.join(joinBy);
13
10
  };
14
- exports.getAddressText = getAddressText;
15
- const getFormatedAddressFromLocationValue = (location) => {
11
+ export const getFormatedAddressFromLocationValue = (location) => {
16
12
  const PARTS_JOINER = ', ';
17
- const address = (0, exports.getAddressText)(location, PARTS_JOINER);
13
+ const address = getAddressText(location, PARTS_JOINER);
18
14
  return address;
19
15
  };
20
- exports.getFormatedAddressFromLocationValue = getFormatedAddressFromLocationValue;
21
16
  //# sourceMappingURL=location-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"location-utils.js","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAC5B,OAAsB,EACtB,SAAiB,MAAM,EACH,EAAE;IACtB,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;SAClF,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SAClB,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,aAAa,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,MAAM,CACpF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CACX,CAAC;IAEF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;QAC9B,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAhBW,QAAA,cAAc,kBAgBzB;AAEK,MAAM,mCAAmC,GAAG,CACjD,QAAuB,EACH,EAAE;IACtB,MAAM,YAAY,GAAG,IAAI,CAAC;IAC1B,MAAM,OAAO,GAAG,IAAA,sBAAc,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEvD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAPW,QAAA,mCAAmC,uCAO9C","sourcesContent":["import { LocationValue } from './types';\n\nexport const getAddressText = (\n address: LocationValue,\n joinBy: string = '<br>'\n): string | undefined => {\n const regionLines = [address.postalCode, address.city, address.country.toUpperCase()]\n .filter((n) => !!n)\n .join(', ');\n\n const filteredParts = [address.addressLine1, address.addressLine2, regionLines].filter(\n (n) => !!n\n );\n\n if (filteredParts.length === 0) {\n return undefined;\n }\n return filteredParts.join(joinBy);\n};\n\nexport const getFormatedAddressFromLocationValue = (\n location: LocationValue\n): string | undefined => {\n const PARTS_JOINER = ', ';\n const address = getAddressText(location, PARTS_JOINER);\n\n return address;\n};\n"]}
1
+ {"version":3,"file":"location-utils.js","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,OAAsB,EACtB,SAAiB,MAAM,EACH,EAAE;IACtB,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;SAClF,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SAClB,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,aAAa,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,MAAM,CACpF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CACX,CAAC;IAEF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mCAAmC,GAAG,CACjD,QAAuB,EACH,EAAE;IACtB,MAAM,YAAY,GAAG,IAAI,CAAC;IAC1B,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEvD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import { LocationValue } from './types.js';\n\nexport const getAddressText = (\n address: LocationValue,\n joinBy: string = '<br>'\n): string | undefined => {\n const regionLines = [address.postalCode, address.city, address.country.toUpperCase()]\n .filter((n) => !!n)\n .join(', ');\n\n const filteredParts = [address.addressLine1, address.addressLine2, regionLines].filter(\n (n) => !!n\n );\n\n if (filteredParts.length === 0) {\n return undefined;\n }\n return filteredParts.join(joinBy);\n};\n\nexport const getFormatedAddressFromLocationValue = (\n location: LocationValue\n): string | undefined => {\n const PARTS_JOINER = ', ';\n const address = getAddressText(location, PARTS_JOINER);\n\n return address;\n};\n"]}
package/lib/locations.js CHANGED
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isEuropeanCountry = exports.isEUCountry = exports.RouteLabel = void 0;
4
- var RouteLabel;
1
+ export var RouteLabel;
5
2
  (function (RouteLabel) {
6
3
  RouteLabel["Unspecified"] = "ROUTE_LABEL_UNSPECIFIED";
7
4
  RouteLabel["Default"] = "DEFAULT_ROUTE";
8
5
  RouteLabel["DefaultAlternate"] = "DEFAULT_ROUTE_ALTERNATE";
9
6
  RouteLabel["FuelEfficient"] = "FUEL_EFFICIENT";
10
- })(RouteLabel = exports.RouteLabel || (exports.RouteLabel = {}));
11
- const isEUCountry = (country) => [
7
+ })(RouteLabel || (RouteLabel = {}));
8
+ export const isEUCountry = (country) => [
12
9
  'AT',
13
10
  'BE',
14
11
  'BG',
@@ -37,8 +34,7 @@ const isEUCountry = (country) => [
37
34
  'SI',
38
35
  'SK',
39
36
  ].includes(country.toUpperCase());
40
- exports.isEUCountry = isEUCountry;
41
- const isEuropeanCountry = (country) => [
37
+ export const isEuropeanCountry = (country) => [
42
38
  'AL',
43
39
  'AD',
44
40
  'AM',
@@ -91,5 +87,4 @@ const isEuropeanCountry = (country) => [
91
87
  'UA',
92
88
  'GB',
93
89
  ].includes(country.toUpperCase());
94
- exports.isEuropeanCountry = isEuropeanCountry;
95
90
  //# sourceMappingURL=locations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"locations.js","sourceRoot":"/","sources":["locations.ts"],"names":[],"mappings":";;;AAqBA,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,qD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IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AArDvB,QAAA,iBAAiB,qBAqDM","sourcesContent":["export type GPSCoord = {\n lat: number;\n lon: number;\n alt?: number;\n gMapsZoom?: number;\n};\n\nexport type LocationValue = {\n addressLine1?: string;\n addressLine2?: string;\n city?: string;\n country: string;\n postalCode?: string;\n gps?: GPSCoord;\n};\n\nexport type RoutesRequest = {\n origin: LocationValue;\n destination: LocationValue;\n};\n\nexport enum RouteLabel {\n Unspecified = 'ROUTE_LABEL_UNSPECIFIED',\n Default = 'DEFAULT_ROUTE',\n DefaultAlternate = 'DEFAULT_ROUTE_ALTERNATE',\n FuelEfficient = 'FUEL_EFFICIENT',\n}\n\nexport type Route = {\n duration: string;\n distanceMeters: number;\n routeLabels: RouteLabel[];\n};\n\nexport type RoutesResponse = {\n routes: Route[];\n};\n\nexport const isEUCountry = (country: string): boolean =>\n [\n 'AT',\n 'BE',\n 'BG',\n 'CY',\n 'CZ',\n 'DE',\n 'DK',\n 'EE',\n 'ES',\n 'FI',\n 'FR',\n 'GR',\n 'HR',\n 'HU',\n 'IE',\n 'IT',\n 'LT',\n 'LU',\n 'LV',\n 'MT',\n 'NL',\n 'PL',\n 'PT',\n 'RO',\n 'SE',\n 'SI',\n 'SK',\n ].includes(country.toUpperCase());\n\nexport const isEuropeanCountry = (country: string): boolean =>\n [\n 'AL',\n 'AD',\n 'AM',\n 'AT',\n 'AZ',\n 'BY',\n 'BE',\n 'BA',\n 'BG',\n 'HR',\n 'CY',\n 'CZ',\n 'DK',\n 'EE',\n 'FO',\n 'FI',\n 'FR',\n 'GE',\n 'DE',\n 'GI',\n 'GR',\n 'HU',\n 'IS',\n 'IE',\n 'IT',\n 'KZ',\n 'XK',\n 'LV',\n 'LI',\n 'LT',\n 'LU',\n 'MK',\n 'MT',\n 'MD',\n 'MC',\n 'ME',\n 'NL',\n 'NO',\n 'PL',\n 'PT',\n 'RO',\n 'RU',\n 'SM',\n 'RS',\n 'SK',\n 'SI',\n 'ES',\n 'SE',\n 'CH',\n 'UA',\n 'GB',\n ].includes(country.toUpperCase());\n\n//I want the isEuropeanCountry but with countries in lowercase\n"]}
1
+ {"version":3,"file":"locations.js","sourceRoot":"/","sources":["locations.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,qDAAuC,CAAA;IACvC,uCAAyB,CAAA;IACzB,0DAA4C,CAAA;IAC5C,8CAAgC,CAAA;AAClC,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAYD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAe,EAAW,EAAE,CACtD;IACE,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAW,EAAE,CAC5D;IACE,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC","sourcesContent":["export type GPSCoord = {\n lat: number;\n lon: number;\n alt?: number;\n gMapsZoom?: number;\n};\n\nexport type LocationValue = {\n addressLine1?: string;\n addressLine2?: string;\n city?: string;\n country: string;\n postalCode?: string;\n gps?: GPSCoord;\n};\n\nexport type RoutesRequest = {\n origin: LocationValue;\n destination: LocationValue;\n};\n\nexport enum RouteLabel {\n Unspecified = 'ROUTE_LABEL_UNSPECIFIED',\n Default = 'DEFAULT_ROUTE',\n DefaultAlternate = 'DEFAULT_ROUTE_ALTERNATE',\n FuelEfficient = 'FUEL_EFFICIENT',\n}\n\nexport type Route = {\n duration: string;\n distanceMeters: number;\n routeLabels: RouteLabel[];\n};\n\nexport type RoutesResponse = {\n routes: Route[];\n};\n\nexport const isEUCountry = (country: string): boolean =>\n [\n 'AT',\n 'BE',\n 'BG',\n 'CY',\n 'CZ',\n 'DE',\n 'DK',\n 'EE',\n 'ES',\n 'FI',\n 'FR',\n 'GR',\n 'HR',\n 'HU',\n 'IE',\n 'IT',\n 'LT',\n 'LU',\n 'LV',\n 'MT',\n 'NL',\n 'PL',\n 'PT',\n 'RO',\n 'SE',\n 'SI',\n 'SK',\n ].includes(country.toUpperCase());\n\nexport const isEuropeanCountry = (country: string): boolean =>\n [\n 'AL',\n 'AD',\n 'AM',\n 'AT',\n 'AZ',\n 'BY',\n 'BE',\n 'BA',\n 'BG',\n 'HR',\n 'CY',\n 'CZ',\n 'DK',\n 'EE',\n 'FO',\n 'FI',\n 'FR',\n 'GE',\n 'DE',\n 'GI',\n 'GR',\n 'HU',\n 'IS',\n 'IE',\n 'IT',\n 'KZ',\n 'XK',\n 'LV',\n 'LI',\n 'LT',\n 'LU',\n 'MK',\n 'MT',\n 'MD',\n 'MC',\n 'ME',\n 'NL',\n 'NO',\n 'PL',\n 'PT',\n 'RO',\n 'RU',\n 'SM',\n 'RS',\n 'SK',\n 'SI',\n 'ES',\n 'SE',\n 'CH',\n 'UA',\n 'GB',\n ].includes(country.toUpperCase());\n\n//I want the isEuropeanCountry but with countries in lowercase\n"]}
@@ -1,4 +1,4 @@
1
- import { AttachmentValue } from './types';
1
+ import { AttachmentValue } from './types.js';
2
2
  export type EmailAddress = {
3
3
  name?: string;
4
4
  email: string;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"/","sources":["messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,eAAe,CAAC;IA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nB,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC,IAAI,EACA;QACE,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,GACD;QACE,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACP,CAAC"}
package/lib/messages.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"/","sources":["messages.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types';\n\nexport type EmailAddress = {\n name?: string;\n email: string;\n};\n\nexport type EmailDestination = EmailAddress & {\n organizationId?: string;\n contactId?: string;\n addressType: 'TO' | 'CC' | 'BCC';\n};\n\nexport type EmailContent = {\n subject: string;\n body: {\n text?: string;\n html?: string;\n };\n};\n\nexport type EmailMessage = {\n id: string;\n sentAt: string;\n sentBy: string;\n content?: AttachmentValue;\n subject: string;\n source: EmailAddress;\n replyTo?: EmailAddress;\n destinations: EmailDestination[];\n};\n\nexport type EmailMessageEvent = {\n tenantId: string;\n message: EmailMessage;\n};\n\nexport type TemplatedEmailRequest = {\n data: Record<string, unknown>;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n template: string;\n attachments?: AttachmentValue[];\n};\n\nexport type EmailRequest = {\n references?: string[] | string;\n /* messageId of the email to reply to */\n inReplyTo?: string;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n attachments?: AttachmentValue[];\n body:\n | {\n text?: string;\n html: string;\n }\n | {\n html?: string;\n text: string;\n };\n};\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"/","sources":["messages.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types.js';\n\nexport type EmailAddress = {\n name?: string;\n email: string;\n};\n\nexport type EmailDestination = EmailAddress & {\n organizationId?: string;\n contactId?: string;\n addressType: 'TO' | 'CC' | 'BCC';\n};\n\nexport type EmailContent = {\n subject: string;\n body: {\n text?: string;\n html?: string;\n };\n};\n\nexport type EmailMessage = {\n id: string;\n sentAt: string;\n sentBy: string;\n content?: AttachmentValue;\n subject: string;\n source: EmailAddress;\n replyTo?: EmailAddress;\n destinations: EmailDestination[];\n};\n\nexport type EmailMessageEvent = {\n tenantId: string;\n message: EmailMessage;\n};\n\nexport type TemplatedEmailRequest = {\n data: Record<string, unknown>;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n template: string;\n attachments?: AttachmentValue[];\n};\n\nexport type EmailRequest = {\n references?: string[] | string;\n /* messageId of the email to reply to */\n inReplyTo?: string;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n attachments?: AttachmentValue[];\n body:\n | {\n text?: string;\n html: string;\n }\n | {\n html?: string;\n text: string;\n };\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { BusinessEntityIds } from './constants';
1
+ import { BusinessEntityIds } from './constants.js';
2
2
  export declare enum GroupableNotificationOrigin {
3
3
  Message = "message"
4
4
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"/","sources":["notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,oBAAY,2BAA2B;IACrC,OAAO,YAAY;CACpB;AACD,oBAAY,sBAAsB;IAChC,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,KAAK,QAAQ,GAAG;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAE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AAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,oBAAY,mBAAmB;IAC7B,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,2BAA2B,CAAC;CACtC,CAAC"}
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotificationsFilter = exports.NotificationVisibility = exports.GroupableNotificationOrigin = void 0;
4
- var GroupableNotificationOrigin;
1
+ export var GroupableNotificationOrigin;
5
2
  (function (GroupableNotificationOrigin) {
6
3
  GroupableNotificationOrigin["Message"] = "message";
7
- })(GroupableNotificationOrigin = exports.GroupableNotificationOrigin || (exports.GroupableNotificationOrigin = {}));
8
- var NotificationVisibility;
4
+ })(GroupableNotificationOrigin || (GroupableNotificationOrigin = {}));
5
+ export var NotificationVisibility;
9
6
  (function (NotificationVisibility) {
10
7
  NotificationVisibility["UNREAD"] = "unread";
11
8
  NotificationVisibility["READ"] = "read";
12
- })(NotificationVisibility = exports.NotificationVisibility || (exports.NotificationVisibility = {}));
13
- var NotificationsFilter;
9
+ })(NotificationVisibility || (NotificationVisibility = {}));
10
+ export var NotificationsFilter;
14
11
  (function (NotificationsFilter) {
15
12
  NotificationsFilter["Unread"] = "unread";
16
13
  NotificationsFilter["Archived"] = "archived";
17
- })(NotificationsFilter = exports.NotificationsFilter || (exports.NotificationsFilter = {}));
14
+ })(NotificationsFilter || (NotificationsFilter = {}));
18
15
  //# sourceMappingURL=notifications.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.js","sourceRoot":"/","sources":["notifications.ts"],"names":[],"mappings":";;;AAEA,IAAY,2BAEX;AAFD,WAAY,2BAA2B;IACrC,kDAAmB,CAAA;AACrB,CAAC,EAFW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAEtC;AACD,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,uCAAa,CAAA;AACf,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAGjC;AAoDD,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;AACvB,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B","sourcesContent":["import { BusinessEntityIds } from './constants';\n\nexport enum GroupableNotificationOrigin {\n Message = 'message',\n}\nexport enum NotificationVisibility {\n UNREAD = 'unread',\n READ = 'read',\n}\n\ntype BaseMeta = {\n snippet?: string;\n};\n\nexport type NewNotificationsEvent<T extends BaseMeta = BaseMeta> = {\n tenantId: string;\n notifications: NewNotification<T>[];\n};\n\ntype BaseNotification<T extends BaseMeta = BaseMeta> = {\n sourceId: string; // userId\n destinationId: string; // userId\n businessEntityId: BusinessEntityIds;\n recordId: string;\n recordTitle?: string;\n meta: T;\n origin: string;\n};\n\nexport type NewNotification<T extends BaseMeta = BaseMeta> = BaseNotification<T>;\n\nexport type Notification<T extends BaseMeta = BaseMeta> = BaseNotification<T> & {\n id: string;\n createdAt: string;\n visibility: NotificationVisibility;\n archived: boolean;\n};\n\nexport type NotificationReadUpdates = {\n /* not passing a value means read all */\n notificationIds: string[] | undefined;\n origin?: GroupableNotificationOrigin;\n};\n\nexport type NotificationArchiveUpdates = {\n notificationIds: string[];\n origin?: GroupableNotificationOrigin;\n};\n\nexport type NotificationsInfo = NotificationsStats & {\n externalPushAppId?: string;\n};\n\nexport type NotificationsStats = {\n unreadCount: number;\n unseen: boolean;\n latestSeenAt?: string;\n latestNotificationAt?: string;\n};\n\nexport enum NotificationsFilter {\n Unread = 'unread',\n Archived = 'archived',\n}\n\nexport type NotificationsQuery = {\n limit?: number;\n filter?: NotificationsFilter;\n nextToken?: string;\n origin?: GroupableNotificationOrigin;\n};\n"]}
1
+ {"version":3,"file":"notifications.js","sourceRoot":"/","sources":["notifications.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,2BAEX;AAFD,WAAY,2BAA2B;IACrC,kDAAmB,CAAA;AACrB,CAAC,EAFW,2BAA2B,KAA3B,2BAA2B,QAEtC;AACD,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,uCAAa,CAAA;AACf,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;AAoDD,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;AACvB,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B","sourcesContent":["import { BusinessEntityIds } from './constants.js';\n\nexport enum GroupableNotificationOrigin {\n Message = 'message',\n}\nexport enum NotificationVisibility {\n UNREAD = 'unread',\n READ = 'read',\n}\n\ntype BaseMeta = {\n snippet?: string;\n};\n\nexport type NewNotificationsEvent<T extends BaseMeta = BaseMeta> = {\n tenantId: string;\n notifications: NewNotification<T>[];\n};\n\ntype BaseNotification<T extends BaseMeta = BaseMeta> = {\n sourceId: string; // userId\n destinationId: string; // userId\n businessEntityId: BusinessEntityIds;\n recordId: string;\n recordTitle?: string;\n meta: T;\n origin: string;\n};\n\nexport type NewNotification<T extends BaseMeta = BaseMeta> = BaseNotification<T>;\n\nexport type Notification<T extends BaseMeta = BaseMeta> = BaseNotification<T> & {\n id: string;\n createdAt: string;\n visibility: NotificationVisibility;\n archived: boolean;\n};\n\nexport type NotificationReadUpdates = {\n /* not passing a value means read all */\n notificationIds: string[] | undefined;\n origin?: GroupableNotificationOrigin;\n};\n\nexport type NotificationArchiveUpdates = {\n notificationIds: string[];\n origin?: GroupableNotificationOrigin;\n};\n\nexport type NotificationsInfo = NotificationsStats & {\n externalPushAppId?: string;\n};\n\nexport type NotificationsStats = {\n unreadCount: number;\n unseen: boolean;\n latestSeenAt?: string;\n latestNotificationAt?: string;\n};\n\nexport enum NotificationsFilter {\n Unread = 'unread',\n Archived = 'archived',\n}\n\nexport type NotificationsQuery = {\n limit?: number;\n filter?: NotificationsFilter;\n nextToken?: string;\n origin?: GroupableNotificationOrigin;\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { BusinessEntityIds } from './constants';
2
- import { AttachmentValue } from './types';
1
+ import { BusinessEntityIds } from './constants.js';
2
+ import { AttachmentValue } from './types.js';
3
3
  export type TemplateData = {
4
4
  [key: string]: unknown;
5
5
  };
@@ -36,5 +36,9 @@ export type GeneratePdfEvent = {
36
36
  outputFilename?: string;
37
37
  tenantId: string;
38
38
  };
39
+ export type PDFPageSplit = {
40
+ start: number;
41
+ end: number;
42
+ };
39
43
  export {};
40
44
  //# sourceMappingURL=pdf-gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf-gen.d.ts","sourceRoot":"/","sources":["pdf-gen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,eAAe,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG;IAC7C,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
package/lib/pdf-gen.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=pdf-gen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-gen.js","sourceRoot":"/","sources":["pdf-gen.ts"],"names":[],"mappings":"","sourcesContent":["import { BusinessEntityIds } from './constants';\nimport { AttachmentValue } from './types';\n\nexport type TemplateData = { [key: string]: unknown };\n\nexport type NewPdfTemplateGroup = {\n exampleData?: TemplateData;\n title: string;\n id: string; // [a-z][a-z0-9_]*\n};\n\nexport type PdfTemplateGroup = NewPdfTemplateGroup & {\n modifiedAt: string;\n modifiedBy: string;\n};\n\ntype BasePdfTemplate = {\n branch: string;\n docx: AttachmentValue;\n groupId: string;\n language: string;\n};\n\nexport type PdfTemplate = BasePdfTemplate & {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n pdf: AttachmentValue;\n};\n\nexport type NewPdfTemplate = BasePdfTemplate & {\n id?: string;\n};\n\nexport type GeneratePdfEvent = {\n branch: string;\n businessEntityId: BusinessEntityIds;\n data: TemplateData;\n groupId: string;\n language: string;\n outputFilename?: string;\n tenantId: string;\n};\n"]}
1
+ {"version":3,"file":"pdf-gen.js","sourceRoot":"/","sources":["pdf-gen.ts"],"names":[],"mappings":"","sourcesContent":["import { BusinessEntityIds } from './constants.js';\nimport { AttachmentValue } from './types.js';\n\nexport type TemplateData = { [key: string]: unknown };\n\nexport type NewPdfTemplateGroup = {\n exampleData?: TemplateData;\n title: string;\n id: string; // [a-z][a-z0-9_]*\n};\n\nexport type PdfTemplateGroup = NewPdfTemplateGroup & {\n modifiedAt: string;\n modifiedBy: string;\n};\n\ntype BasePdfTemplate = {\n branch: string;\n docx: AttachmentValue;\n groupId: string;\n language: string;\n};\n\nexport type PdfTemplate = BasePdfTemplate & {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n pdf: AttachmentValue;\n};\n\nexport type NewPdfTemplate = BasePdfTemplate & {\n id?: string;\n};\n\nexport type GeneratePdfEvent = {\n branch: string;\n businessEntityId: BusinessEntityIds;\n data: TemplateData;\n groupId: string;\n language: string;\n outputFilename?: string;\n tenantId: string;\n};\n\nexport type PDFPageSplit = {\n start: number;\n end: number;\n};\n"]}
package/lib/servers.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getServerPort = exports.LambdaServer = void 0;
4
- var LambdaServer;
1
+ export var LambdaServer;
5
2
  (function (LambdaServer) {
6
3
  LambdaServer[LambdaServer["HYPERPORTAL_SYNC"] = 0] = "HYPERPORTAL_SYNC";
7
4
  LambdaServer[LambdaServer["CORE"] = 1] = "CORE";
@@ -17,10 +14,9 @@ var LambdaServer;
17
14
  LambdaServer[LambdaServer["BECRIS"] = 11] = "BECRIS";
18
15
  LambdaServer[LambdaServer["TRACK_AND_TRACE"] = 12] = "TRACK_AND_TRACE";
19
16
  LambdaServer[LambdaServer["TASKS"] = 13] = "TASKS";
20
- })(LambdaServer = exports.LambdaServer || (exports.LambdaServer = {}));
21
- const getServerPort = (server) => 2000 +
17
+ })(LambdaServer || (LambdaServer = {}));
18
+ export const getServerPort = (server) => 2000 +
22
19
  Object.values(LambdaServer)
23
20
  .filter((v) => typeof v === 'number')
24
21
  .indexOf(server);
25
- exports.getServerPort = getServerPort;
26
22
  //# sourceMappingURL=servers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"servers.js","sourceRoot":"/","sources":["servers.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,uEAAgB,CAAA;IAChB,+CAAI,CAAA;IACJ,6EAAmB,CAAA;IACnB,2DAAU,CAAA;IACV,iEAAa,CAAA;IACb,6DAAW,CAAA;IACX,qDAAO,CAAA;IACP,uDAAQ,CAAA;IACR,qEAAe,CAAA;IACf,iDAAK,CAAA;IACL,sDAAO,CAAA;IACP,oDAAM,CAAA;IACN,sEAAe,CAAA;IACf,kDAAK,CAAA;AACP,CAAC,EAfW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAevB;AAEM,MAAM,aAAa,GAAG,CAAC,MAAoB,EAAU,EAAE,CAC5D,IAAI;IACJ,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;SACxB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;SACpC,OAAO,CAAC,MAAM,CAAC,CAAC;AAJR,QAAA,aAAa,iBAIL","sourcesContent":["export enum LambdaServer {\n HYPERPORTAL_SYNC,\n CORE,\n CUSTOMER_MANAGEMENT,\n MIGRATIONS,\n NOTIFICATIONS,\n DISCUSSIONS,\n PDF_GEN,\n MACHINES,\n INSURANCE_CHECK,\n EXACT,\n STORAGE,\n BECRIS,\n TRACK_AND_TRACE,\n TASKS,\n}\n\nexport const getServerPort = (server: LambdaServer): number =>\n 2000 +\n Object.values(LambdaServer)\n .filter((v) => typeof v === 'number')\n .indexOf(server);\n"]}
1
+ {"version":3,"file":"servers.js","sourceRoot":"/","sources":["servers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,uEAAgB,CAAA;IAChB,+CAAI,CAAA;IACJ,6EAAmB,CAAA;IACnB,2DAAU,CAAA;IACV,iEAAa,CAAA;IACb,6DAAW,CAAA;IACX,qDAAO,CAAA;IACP,uDAAQ,CAAA;IACR,qEAAe,CAAA;IACf,iDAAK,CAAA;IACL,sDAAO,CAAA;IACP,oDAAM,CAAA;IACN,sEAAe,CAAA;IACf,kDAAK,CAAA;AACP,CAAC,EAfW,YAAY,KAAZ,YAAY,QAevB;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAoB,EAAU,EAAE,CAC5D,IAAI;IACJ,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;SACxB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;SACpC,OAAO,CAAC,MAAM,CAAC,CAAC","sourcesContent":["export enum LambdaServer {\n HYPERPORTAL_SYNC,\n CORE,\n CUSTOMER_MANAGEMENT,\n MIGRATIONS,\n NOTIFICATIONS,\n DISCUSSIONS,\n PDF_GEN,\n MACHINES,\n INSURANCE_CHECK,\n EXACT,\n STORAGE,\n BECRIS,\n TRACK_AND_TRACE,\n TASKS,\n}\n\nexport const getServerPort = (server: LambdaServer): number =>\n 2000 +\n Object.values(LambdaServer)\n .filter((v) => typeof v === 'number')\n .indexOf(server);\n"]}
@@ -1,5 +1,5 @@
1
1
  import type Joi from 'joi';
2
- import { Requester } from './types';
2
+ import { Requester } from './types.js';
3
3
  export type UploadInfo = {
4
4
  id: string;
5
5
  uploadUrl: string;
@@ -1 +1 @@
1
- {"version":3,"file":"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,CAAC,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;KACrC,GAAG,IAAI,eAAe,GAAG,cAAc;CACzC,CAAC;AAEF,oBAAY,qBAAqB;IAC/B,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,qBAAqB,CAAC;CACnC,CAAC"}
package/lib/storage.js CHANGED
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MediaExportResolution = exports.UploadProviders = void 0;
4
- var UploadProviders;
1
+ export var UploadProviders;
5
2
  (function (UploadProviders) {
6
3
  UploadProviders["Vimeo"] = "vimeo";
7
4
  UploadProviders["S3"] = "s3";
8
- })(UploadProviders = exports.UploadProviders || (exports.UploadProviders = {}));
9
- var MediaExportResolution;
5
+ })(UploadProviders || (UploadProviders = {}));
6
+ export var MediaExportResolution;
10
7
  (function (MediaExportResolution) {
11
8
  MediaExportResolution["Low"] = "low";
12
9
  MediaExportResolution["High"] = "high";
13
- })(MediaExportResolution = exports.MediaExportResolution || (exports.MediaExportResolution = {}));
10
+ })(MediaExportResolution || (MediaExportResolution = {}));
14
11
  //# sourceMappingURL=storage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","sourceRoot":"/","sources":["storage.ts"],"names":[],"mappings":";;;AAyBA,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,4BAAS,CAAA;AACX,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B;AAsCD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,sCAAa,CAAA;AACf,CAAC,EAHW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGhC","sourcesContent":["import type Joi from 'joi';\nimport { Requester } from './types';\n\nexport type UploadInfo = {\n id: string;\n uploadUrl: string;\n downloadPath: string;\n method: 'POST' | 'PATCH' | 'PUT';\n headers?: {\n [name: string]: string;\n };\n};\n\nexport type VideoDownloadInfo = {\n url: string;\n quality: string;\n size: number;\n};\n\nexport type VideoInfo = {\n status: 'SUCCESS' | 'PROCESSING' | 'ERROR';\n downloads: VideoDownloadInfo[];\n id: string;\n};\n\nexport enum UploadProviders {\n Vimeo = 'vimeo',\n S3 = 's3',\n}\n\ntype BaseUploadUrlRequest = {\n contentType: string;\n};\n\nexport type VimeoUploadRequest = BaseUploadUrlRequest & {\n size: number;\n name: string;\n};\n\nexport type S3UploadRequest = BaseUploadUrlRequest & {\n // is the file supposed to be shared by all tenants that need it, or will each tenant have its copy\n shared: boolean;\n fileName: string;\n businessEntityId: string;\n};\n\nexport type UploadUrlRequest<Provider extends UploadProviders> =\n Provider extends UploadProviders.Vimeo\n ? VimeoUploadRequest\n : Provider extends UploadProviders.S3\n ? S3UploadRequest\n : {};\n\nexport type UploadProvider = {\n validationSchema: Joi.ObjectSchema<any>;\n getVideoListInfo: (requester: Requester, videoIds: string[]) => Promise<VideoInfo[]>;\n getUploadInfo(\n requester: Requester,\n request: UploadUrlRequest<UploadProviders>\n ): Promise<UploadInfo>;\n};\n\nexport type UploadProvidersDefinition = {\n [key in UploadProviders]: UploadProvider;\n};\n\nexport enum MediaExportResolution {\n Low = 'low',\n High = 'high',\n}\n\nexport type MediaExportRequest = {\n urls: string[];\n resolution?: MediaExportResolution;\n};\n\nexport type MediaExportEvent = {\n s3Keys: string[];\n outputId: string;\n tenantId: string;\n entityId: string;\n resolution: MediaExportResolution;\n};\n"]}
1
+ {"version":3,"file":"storage.js","sourceRoot":"/","sources":["storage.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,4BAAS,CAAA;AACX,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAsCD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,sCAAa,CAAA;AACf,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC","sourcesContent":["import type Joi from 'joi';\nimport { Requester } from './types.js';\n\nexport type UploadInfo = {\n id: string;\n uploadUrl: string;\n downloadPath: string;\n method: 'POST' | 'PATCH' | 'PUT';\n headers?: {\n [name: string]: string;\n };\n};\n\nexport type VideoDownloadInfo = {\n url: string;\n quality: string;\n size: number;\n};\n\nexport type VideoInfo = {\n status: 'SUCCESS' | 'PROCESSING' | 'ERROR';\n downloads: VideoDownloadInfo[];\n id: string;\n};\n\nexport enum UploadProviders {\n Vimeo = 'vimeo',\n S3 = 's3',\n}\n\ntype BaseUploadUrlRequest = {\n contentType: string;\n};\n\nexport type VimeoUploadRequest = BaseUploadUrlRequest & {\n size: number;\n name: string;\n};\n\nexport type S3UploadRequest = BaseUploadUrlRequest & {\n // is the file supposed to be shared by all tenants that need it, or will each tenant have its copy\n shared: boolean;\n fileName: string;\n businessEntityId: string;\n};\n\nexport type UploadUrlRequest<Provider extends UploadProviders> =\n Provider extends UploadProviders.Vimeo\n ? VimeoUploadRequest\n : Provider extends UploadProviders.S3\n ? S3UploadRequest\n : {};\n\nexport type UploadProvider = {\n validationSchema: Joi.ObjectSchema<any>;\n getVideoListInfo: (requester: Requester, videoIds: string[]) => Promise<VideoInfo[]>;\n getUploadInfo(\n requester: Requester,\n request: UploadUrlRequest<UploadProviders>\n ): Promise<UploadInfo>;\n};\n\nexport type UploadProvidersDefinition = {\n [key in UploadProviders]: UploadProvider;\n};\n\nexport enum MediaExportResolution {\n Low = 'low',\n High = 'high',\n}\n\nexport type MediaExportRequest = {\n urls: string[];\n resolution?: MediaExportResolution;\n};\n\nexport type MediaExportEvent = {\n s3Keys: string[];\n outputId: string;\n tenantId: string;\n entityId: string;\n resolution: MediaExportResolution;\n};\n"]}
@@ -1,4 +1,5 @@
1
- import { BusinessEntityIds } from './constants';
1
+ import { BusinessEntityIds } from './constants.js';
2
+ import { NextRequest } from './types.js';
2
3
  export declare enum TaskPriority {
3
4
  Normal = 30,
4
5
  High = 20,
@@ -43,11 +44,9 @@ export type TaskNotificationData = {
43
44
  snippet?: string;
44
45
  };
45
46
  export type TasksQuery = {
46
- limit?: number;
47
- nextToken?: string;
48
47
  assignee?: string;
49
48
  showDone?: boolean;
50
- };
49
+ } & NextRequest;
51
50
  export type AssigneeTasksBetweenDatesQuery = {
52
51
  assignee: string;
53
52
  start: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"/","sources":["tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,oBAAY,YAAY;IACtB,MAAM,KAAK;IACX,IAAI,KAAK;IACT,MAAM,KAAK;CACZ;AAED,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,KAAK,UAAU,GAAG;IAChB,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,CAC9B,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,SAAS,CAAC,GAAG;IACvC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CACF,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,QAAQ,GAC5B,UAAU,GAAG;IACX,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,EAAE,CAAC,EAAE,SAAS,CAAC;CAChB,CAAC;AAEJ,MAAM,MAAM,IAAI,GAAG,QAAQ,GACzB,UAAU,GAAG;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEJ,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,WAAW,CAAC;AAEhB,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
package/lib/tasks.js CHANGED
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TaskStatus = exports.TaskPriority = void 0;
4
- var TaskPriority;
1
+ export var TaskPriority;
5
2
  (function (TaskPriority) {
6
3
  TaskPriority[TaskPriority["Normal"] = 30] = "Normal";
7
4
  TaskPriority[TaskPriority["High"] = 20] = "High";
8
5
  TaskPriority[TaskPriority["Urgent"] = 10] = "Urgent";
9
- })(TaskPriority = exports.TaskPriority || (exports.TaskPriority = {}));
10
- var TaskStatus;
6
+ })(TaskPriority || (TaskPriority = {}));
7
+ export var TaskStatus;
11
8
  (function (TaskStatus) {
12
9
  TaskStatus["Open"] = "open";
13
10
  TaskStatus["Done"] = "done";
14
- })(TaskStatus = exports.TaskStatus || (exports.TaskStatus = {}));
11
+ })(TaskStatus || (TaskStatus = {}));
15
12
  //# sourceMappingURL=tasks.js.map
package/lib/tasks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tasks.js","sourceRoot":"/","sources":["tasks.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,oDAAW,CAAA;IACX,gDAAS,CAAA;IACT,oDAAW,CAAA;AACb,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB","sourcesContent":["import { BusinessEntityIds } from './constants';\n\nexport enum TaskPriority {\n Normal = 30,\n High = 20,\n Urgent = 10,\n}\n\nexport enum TaskStatus {\n Open = 'open',\n Done = 'done',\n}\n\ntype RecordData = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n recordTitle?: string;\n};\n\ntype BaseTask = {\n assignee?: string;\n dueDate?: string;\n priority: TaskPriority;\n status: TaskStatus;\n title: string;\n};\n\nexport type TaskUpdate = Partial<\n Omit<BaseTask, 'assignee' | 'dueDate'> & {\n assignee?: string | null;\n dueDate?: string | null;\n }\n>;\n\nexport type NewTask = BaseTask &\n RecordData & {\n createdAt?: undefined;\n createdBy?: undefined;\n id?: undefined;\n };\n\nexport type Task = BaseTask &\n RecordData & {\n createdAt: string;\n createdBy: string;\n deletedAt?: string;\n id: string;\n };\n\nexport type TaskAudit = Partial<Task> & {\n changedAt: string;\n changedBy: string;\n};\n\nexport type TaskNotificationData = {\n snippet?: string;\n};\n\nexport type TasksQuery = {\n limit?: number;\n nextToken?: string;\n assignee?: string;\n showDone?: boolean;\n};\n\nexport type AssigneeTasksBetweenDatesQuery = {\n assignee: string;\n start: string;\n end: string;\n};\n"]}
1
+ {"version":3,"file":"tasks.js","sourceRoot":"/","sources":["tasks.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,oDAAW,CAAA;IACX,gDAAS,CAAA;IACT,oDAAW,CAAA;AACb,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB","sourcesContent":["import { BusinessEntityIds } from './constants.js';\nimport { NextRequest } from './types.js';\n\nexport enum TaskPriority {\n Normal = 30,\n High = 20,\n Urgent = 10,\n}\n\nexport enum TaskStatus {\n Open = 'open',\n Done = 'done',\n}\n\ntype RecordData = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n recordTitle?: string;\n};\n\ntype BaseTask = {\n assignee?: string;\n dueDate?: string;\n priority: TaskPriority;\n status: TaskStatus;\n title: string;\n};\n\nexport type TaskUpdate = Partial<\n Omit<BaseTask, 'assignee' | 'dueDate'> & {\n assignee?: string | null;\n dueDate?: string | null;\n }\n>;\n\nexport type NewTask = BaseTask &\n RecordData & {\n createdAt?: undefined;\n createdBy?: undefined;\n id?: undefined;\n };\n\nexport type Task = BaseTask &\n RecordData & {\n createdAt: string;\n createdBy: string;\n deletedAt?: string;\n id: string;\n };\n\nexport type TaskAudit = Partial<Task> & {\n changedAt: string;\n changedBy: string;\n};\n\nexport type TaskNotificationData = {\n snippet?: string;\n};\n\nexport type TasksQuery = {\n assignee?: string;\n showDone?: boolean;\n} & NextRequest;\n\nexport type AssigneeTasksBetweenDatesQuery = {\n assignee: string;\n start: string;\n end: string;\n};\n"]}
@@ -1,6 +1,6 @@
1
- import { AppRoles, TopLevelActions } from './constants';
2
- import { LocationValue } from './locations';
3
- export { GPSCoord, LocationValue } from './locations';
1
+ import { AppRoles, TopLevelActions } from './constants.js';
2
+ import { LocationValue } from './locations.js';
3
+ export type { GPSCoord, LocationValue } from './locations.js';
4
4
  export type PaginatedList<T, M = {}> = {
5
5
  results: T[];
6
6
  nextToken?: undefined;
@@ -17,6 +17,10 @@ export type NextList<T, M = {}> = {
17
17
  meta: M;
18
18
  totalCount?: number;
19
19
  };
20
+ export type NextRequest = {
21
+ limit?: number;
22
+ nextToken?: string;
23
+ };
20
24
  export type PaginatedRequest = {
21
25
  limit?: number;
22
26
  offset?: number;
@@ -127,9 +131,21 @@ export type VatValidationRequest = {
127
131
  defaultCountry?: string;
128
132
  input: string;
129
133
  };
130
- export type CurrencyLayerResponse = {
131
- conversionRate: number;
132
- targetCurrency: string;
134
+ export type CurrencyListResponse = {
135
+ currencies: Record<string, {
136
+ label: string;
137
+ }>;
138
+ };
139
+ export type CurrencyConversionRequest = {
133
140
  sourceCurrency: string;
141
+ targetCurrency?: string;
134
142
  };
143
+ export type CurrencyConversionResponse = {
144
+ sourceCurrency: string;
145
+ rates: Record<string, string>;
146
+ };
147
+ export declare enum TransactionType {
148
+ sale = "sale",
149
+ purchase = "purchase"
150
+ }
135
151
  //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,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,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB"}
package/lib/types.js CHANGED
@@ -1,8 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Region = void 0;
4
- var Region;
1
+ export var Region;
5
2
  (function (Region) {
6
3
  Region["euWest1"] = "eu-west-1";
7
- })(Region = exports.Region || (exports.Region = {}));
4
+ })(Region || (Region = {}));
5
+ export var TransactionType;
6
+ (function (TransactionType) {
7
+ TransactionType["sale"] = "sale";
8
+ TransactionType["purchase"] = "purchase";
9
+ })(TransactionType || (TransactionType = {}));
8
10
  //# sourceMappingURL=types.js.map
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":";;;AA8CA,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,+BAAqB,CAAA;AACvB,CAAC,EAFW,MAAM,GAAN,cAAM,KAAN,cAAM,QAEjB","sourcesContent":["import { AppRoles, TopLevelActions } from './constants';\nimport { LocationValue } from './locations';\nexport { GPSCoord, LocationValue } from './locations';\n\nexport type PaginatedList<T, M = {}> = {\n results: T[];\n nextToken?: undefined;\n meta: M;\n totalCount: number;\n};\n\nexport type PaginationRequest = {\n limit: number;\n offset: number;\n};\n\nexport type NextList<T, M = {}> = {\n results: T[];\n nextToken?: string;\n meta: M;\n totalCount?: number;\n};\n\nexport type PaginatedRequest = {\n limit?: number;\n offset?: number;\n};\n\nexport type Requester = {\n lang: string;\n roles: AppRoles[];\n actions: TopLevelActions[];\n tenantId: string;\n tenantLang: string;\n userAgent?: string;\n source?: string;\n userId: string;\n isApi: boolean;\n};\n\nexport type Option = {\n value: string | number;\n label: string;\n color?: string;\n};\n\nexport enum Region {\n euWest1 = 'eu-west-1',\n}\n\nexport type ErrorResponse = {\n message?: string;\n data?: unknown;\n};\n\nexport type MultiLangValue = { key?: string } & { [languageCode: string]: string };\n\nexport type CognitoInfo = {\n userPoolId: string;\n appClientId: string;\n region: Region;\n};\n\nexport type SearchPermissions = {\n users: string[];\n roles: AppRoles[];\n};\n\nexport type PhoneNumberValue = {\n country: string;\n e164: string;\n international: string;\n national: string;\n};\n\nexport type PhoneNumberRawValue = {\n defaultCountry?: string;\n input: string;\n};\n\nexport type LinkValue = {\n text?: string;\n url: string;\n};\n\nexport type Document = {\n type: string; // passport, driving_license, ...\n displayName: string;\n file: AttachmentValue;\n};\n\nexport type AttachmentValue = {\n contentType: string;\n fileName: string;\n id: string;\n previewSrc?: string;\n size: number;\n uploadedAt: string;\n uploadedBy: string;\n url: string;\n descriptions?: string | MultiLangValue;\n};\n\nexport type VatLayerResponseLog = {\n response: VatLayerResponse;\n raw: any;\n};\n\nexport type VatLayerResponse = {\n vatNumber: string;\n viesStatus: 'ok' | 'failure';\n} & (\n | { formatValid: boolean; viesValid: false; validAt?: undefined; countryCode?: string }\n | {\n formatValid: true;\n viesValid: boolean;\n validAt: string;\n countryCode: string;\n name: string;\n addressLines: string[];\n }\n);\n\nexport type VatValidationResponse = {\n vatNumber: string;\n formatValid?: boolean;\n viesStatus: 'ok' | 'failure';\n countryCode?: string;\n} & (\n | { viesValid: false; validAt?: undefined }\n | {\n viesValid: true;\n validAt: string;\n name?: string;\n normalizedAddress?: LocationValue;\n officialAddress?: string[];\n }\n);\n\nexport type VatValidationRequest = {\n defaultCountry?: string;\n input: string;\n};\n\nexport type CurrencyLayerResponse = {\n conversionRate: number;\n targetCurrency: string;\n sourceCurrency: string;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":"AAmDA,MAAM,CAAN,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,+BAAqB,CAAA;AACvB,CAAC,EAFW,MAAM,KAAN,MAAM,QAEjB;AA8GD,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,wCAAqB,CAAA;AACvB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["import { AppRoles, TopLevelActions } from './constants.js';\nimport { LocationValue } from './locations.js';\n\nexport type { GPSCoord, LocationValue } from './locations.js';\n\nexport type PaginatedList<T, M = {}> = {\n results: T[];\n nextToken?: undefined;\n meta: M;\n totalCount: number;\n};\n\nexport type PaginationRequest = {\n limit: number;\n offset: number;\n};\n\nexport type NextList<T, M = {}> = {\n results: T[];\n nextToken?: string;\n meta: M;\n totalCount?: number;\n};\n\nexport type NextRequest = {\n limit?: number;\n nextToken?: string;\n};\n\nexport type PaginatedRequest = {\n limit?: number;\n offset?: number;\n};\nexport type Requester = {\n lang: string;\n roles: AppRoles[];\n actions: TopLevelActions[];\n tenantId: string;\n tenantLang: string;\n userAgent?: string;\n source?: string;\n userId: string;\n isApi: boolean;\n};\n\nexport type Option = {\n value: string | number;\n label: string;\n color?: string;\n};\n\nexport enum Region {\n euWest1 = 'eu-west-1',\n}\n\nexport type ErrorResponse = {\n message?: string;\n data?: unknown;\n};\n\nexport type MultiLangValue = { key?: string } & { [languageCode: string]: string };\n\nexport type CognitoInfo = {\n userPoolId: string;\n appClientId: string;\n region: Region;\n};\n\nexport type SearchPermissions = {\n users: string[];\n roles: AppRoles[];\n};\n\nexport type PhoneNumberValue = {\n country: string;\n e164: string;\n international: string;\n national: string;\n};\n\nexport type PhoneNumberRawValue = {\n defaultCountry?: string;\n input: string;\n};\n\nexport type LinkValue = {\n text?: string;\n url: string;\n};\n\nexport type Document = {\n type: string; // passport, driving_license, ...\n displayName: string;\n file: AttachmentValue;\n};\n\nexport type AttachmentValue = {\n contentType: string;\n fileName: string;\n id: string;\n previewSrc?: string;\n size: number;\n uploadedAt: string;\n uploadedBy: string;\n url: string;\n descriptions?: string | MultiLangValue;\n};\n\nexport type VatLayerResponseLog = {\n response: VatLayerResponse;\n raw: any;\n};\n\nexport type VatLayerResponse = {\n vatNumber: string;\n viesStatus: 'ok' | 'failure';\n} & (\n | { formatValid: boolean; viesValid: false; validAt?: undefined; countryCode?: string }\n | {\n formatValid: true;\n viesValid: boolean;\n validAt: string;\n countryCode: string;\n name: string;\n addressLines: string[];\n }\n);\n\nexport type VatValidationResponse = {\n vatNumber: string;\n formatValid?: boolean;\n viesStatus: 'ok' | 'failure';\n countryCode?: string;\n} & (\n | { viesValid: false; validAt?: undefined }\n | {\n viesValid: true;\n validAt: string;\n name?: string;\n normalizedAddress?: LocationValue;\n officialAddress?: string[];\n }\n);\n\nexport type VatValidationRequest = {\n defaultCountry?: string;\n input: string;\n};\n\nexport type CurrencyListResponse = {\n currencies: Record<string, { label: string }>;\n};\n\nexport type CurrencyConversionRequest = {\n sourceCurrency: string;\n targetCurrency?: string;\n};\n\nexport type CurrencyConversionResponse = {\n sourceCurrency: string;\n rates: Record<string, string>;\n};\n\nexport enum TransactionType {\n sale = 'sale',\n purchase = 'purchase',\n}\n"]}
package/package.json CHANGED
@@ -1,40 +1,31 @@
1
1
  {
2
2
  "name": "@bisondesk/commons-sdk",
3
- "version": "1.0.318",
3
+ "version": "1.0.320",
4
+ "type": "module",
4
5
  "scripts": {
5
- "build": "npx tsc --build tsconfig.cjs.json & npx tsc --build tsconfig.esm.json",
6
+ "build": "npx tsc --build tsconfig.deploy.json",
6
7
  "clean": "rm -rf lib *.tsbuildinfo",
7
8
  "unittest": "echo \"No test specified\"",
8
9
  "integrationtest": "echo \"No test specified\""
9
10
  },
10
11
  "dependencies": {
11
- "dayjs": "1.10.4",
12
- "dayjs-business-days": "1.0.4",
12
+ "@date-fns/utc": "1.1.1",
13
+ "date-fns": "3.2.0",
13
14
  "joi": "17.4.0",
14
- "nanoid": "3.3.6"
15
+ "nanoid": "5.0.4"
15
16
  },
16
17
  "devDependencies": {
17
- "typescript": "5.0.4"
18
- },
19
- "main": "./lib/cjs/*",
20
- "module": "./lib/esm/*",
21
- "exports": {
22
- "./*": {
23
- "import": [
24
- "./lib/esm/*.js",
25
- "./lib/esm/*/*.js"
26
- ],
27
- "require": [
28
- "./lib/cjs/*.js",
29
- "./lib/cjs/*/*.js"
30
- ]
31
- }
18
+ "@types/date-fns": "2.6.0",
19
+ "typescript": "5.3.3"
32
20
  },
33
21
  "typesVersions": {
34
22
  "*": {
35
23
  "*": [
36
- "lib/types/*"
24
+ "lib/*.d.ts"
37
25
  ]
38
26
  }
27
+ },
28
+ "exports": {
29
+ "./*": "./lib/*.js"
39
30
  }
40
31
  }
package/src/becris.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AttachmentValue } from './types';
1
+ import { AttachmentValue } from './types.js';
2
2
 
3
3
  export type LeasingCreditorBranch = {
4
4
  bciNumber: string;
package/src/constants.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  //
4
4
  export enum AppRoles {
5
5
  Accountant = 'accountant',
6
+ SeniorAccountant = 'senior_accountant',
6
7
  Admin = 'admins',
7
8
  Administrative = 'administrative',
8
9
  Commercial = 'commercial',
@@ -15,6 +16,7 @@ export enum TopLevelActions {
15
16
  AdministrationAll = 'admin:*',
16
17
  DocumentsBrowse = 'docs:finance:browse',
17
18
  LeadsAll = 'leads:*',
19
+ BrowseDocumentDrafts = 'docs:drafts:browse',
18
20
  LeasingDebtorsView = 'leasing:debtors:view',
19
21
  LeasingOverduesView = 'leasing:overdues:view',
20
22
  LeasingContractsExport = 'leasing:contracts:export',
@@ -54,6 +56,7 @@ export enum BusinessEntityIds {
54
56
  Contacts = 'contacts',
55
57
  Emails = 'emails',
56
58
  FinanceDocuments = 'finance_documents',
59
+ AdministrativeDocuments = 'administrative_documents',
57
60
  InternetVehicles = 'internet-vehicles',
58
61
  LeasingContracts = 'leasing_contracts',
59
62
  LeasingUploadAutomation = 'leasing_upload_automation',
@@ -64,6 +67,7 @@ export enum BusinessEntityIds {
64
67
  Vehicles = 'vehicles',
65
68
  VehiclesPriceLists = 'vehicles_price_lists',
66
69
  Debtors = 'debtors',
70
+ DocumentDrafts = 'document_drafts',
67
71
  }
68
72
 
69
73
  //
@@ -0,0 +1,14 @@
1
+ import { compareAsc, isBefore } from 'date-fns';
2
+
3
+ export const isSameOrAfter = (value: Date, reference: Date): boolean =>
4
+ compareAsc(value, reference) >= 0;
5
+
6
+ export const isSameOrBefore = (value: Date, reference: Date): boolean =>
7
+ compareAsc(value, reference) <= 0;
8
+
9
+ export const isBetween = (value: Date, startInclusive: Date, endExclusive: Date): boolean =>
10
+ isSameOrAfter(value, startInclusive) && isBefore(value, endExclusive);
11
+
12
+ export const businessDaysAdd = (value: Date, days: number): Date => businessDaysAdd(value, days);
13
+
14
+ export const isoString = () => new Date().toISOString();
@@ -1,4 +1,4 @@
1
- import { BusinessEntityIds } from './constants';
1
+ import { BusinessEntityIds } from './constants.js';
2
2
 
3
3
  export type Discussion = {
4
4
  businessEntityId: BusinessEntityIds;
package/src/errors.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ValidationError, ValidationErrorItem } from 'joi';
1
+ import Joi from 'joi';
2
2
 
3
3
  export class XError extends Error {
4
4
  errorCtx: any;
@@ -52,7 +52,7 @@ export class InvalidArgumentsError extends Error {
52
52
  isValidation = true;
53
53
  errorCtx: any;
54
54
 
55
- constructor(message?: string, errors?: ValidationError, errorCtx?: any) {
55
+ constructor(message?: string, errors?: Joi.ValidationError, errorCtx?: any) {
56
56
  super(message);
57
57
  this.name = 'InvalidArgumentsError';
58
58
  this.errorCtx = errorCtx;
@@ -60,7 +60,7 @@ export class InvalidArgumentsError extends Error {
60
60
  if (errors != null) {
61
61
  this.validationErrors = {
62
62
  errors: errors.details.map(
63
- ({ path, type, message }: ValidationErrorItem): FieldValidationError => ({
63
+ ({ path, type, message }: Joi.ValidationErrorItem): FieldValidationError => ({
64
64
  message,
65
65
  path,
66
66
  type: type === 'custom' ? message : type,
package/src/exact.ts CHANGED
@@ -14,3 +14,18 @@ export type ExactClientAccount = {
14
14
  exactTld: string;
15
15
  authenticated: boolean;
16
16
  };
17
+
18
+ // TODO remove once exact-sdk is correctly published
19
+ export type GlAccount = {
20
+ id: string;
21
+ code: number;
22
+ description: string;
23
+ };
24
+
25
+ export type Journal = {
26
+ code: string;
27
+ type: string;
28
+ glAccountCode: string;
29
+ glAccountDescription: string;
30
+ description: string;
31
+ };