@bisondesk/commons-sdk 1.0.318 → 1.0.319

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,4 +1,4 @@
1
- import { AttachmentValue } from './types';
1
+ import { AttachmentValue } from './types.js';
2
2
  export type LeasingCreditorBranch = {
3
3
  bciNumber: string;
4
4
  vatNumber: string;
@@ -1 +1 @@
1
- {"version":3,"file":"becris.d.ts","sourceRoot":"/","sources":["becris.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CAAC;CAC3C,CAAC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GAAG,qBAAqB,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wBAAwB,EAAE,MAAM,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,gCAAgC,EAAE,MAAM,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
package/lib/becris.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=becris.js.map
package/lib/becris.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"becris.js","sourceRoot":"/","sources":["becris.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types';\n\nexport type LeasingCreditorBranch = {\n bciNumber: string;\n vatNumber: string;\n licenceDate: string;\n becrisFirstReportDate: string;\n becrisStartDate: string;\n};\n\nexport type LeasingCreditorSettings = {\n [branchId: string]: LeasingCreditorBranch;\n};\n\nexport type BecrisDeclaration = {\n createdAt: string;\n endDate: string;\n endingInstruments: number;\n existingInstruments: number;\n file: AttachmentValue;\n id: string;\n newInstruments: number;\n startDate: string;\n};\n\nexport type BecrisInstrument = {\n clientId: string;\n clientExternalId: string;\n contractId: string;\n contractNumber: string;\n endDate?: string;\n id: string; // Hyperportal's LCT process id if it exists, otherwise the contract id\n inceptionDate: string;\n instrumentNumber: string;\n legalFinalMaturityDate: string;\n outstandingNominalAmount: string; // updated when creating a new declaration\n settlementDate: string;\n totalCommitmentAmountAtInception: string;\n vatNumber: string;\n\n /**\n * Becris state\n */\n active: boolean; // false if undeclaredAt is not null, useful for filtering in dynamodb\n declaredAt?: string;\n undeclaredAt?: string;\n};\n"]}
1
+ {"version":3,"file":"becris.js","sourceRoot":"/","sources":["becris.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types.js';\n\nexport type LeasingCreditorBranch = {\n bciNumber: string;\n vatNumber: string;\n licenceDate: string;\n becrisFirstReportDate: string;\n becrisStartDate: string;\n};\n\nexport type LeasingCreditorSettings = {\n [branchId: string]: LeasingCreditorBranch;\n};\n\nexport type BecrisDeclaration = {\n createdAt: string;\n endDate: string;\n endingInstruments: number;\n existingInstruments: number;\n file: AttachmentValue;\n id: string;\n newInstruments: number;\n startDate: string;\n};\n\nexport type BecrisInstrument = {\n clientId: string;\n clientExternalId: string;\n contractId: string;\n contractNumber: string;\n endDate?: string;\n id: string; // Hyperportal's LCT process id if it exists, otherwise the contract id\n inceptionDate: string;\n instrumentNumber: string;\n legalFinalMaturityDate: string;\n outstandingNominalAmount: string; // updated when creating a new declaration\n settlementDate: string;\n totalCommitmentAmountAtInception: string;\n vatNumber: string;\n\n /**\n * Becris state\n */\n active: boolean; // false if undeclaredAt is not null, useful for filtering in dynamodb\n declaredAt?: string;\n undeclaredAt?: string;\n};\n"]}
@@ -1,5 +1,6 @@
1
1
  export declare enum AppRoles {
2
2
  Accountant = "accountant",
3
+ SeniorAccountant = "senior_accountant",
3
4
  Admin = "admins",
4
5
  Administrative = "administrative",
5
6
  Commercial = "commercial",
@@ -11,6 +12,7 @@ export declare enum TopLevelActions {
11
12
  AdministrationAll = "admin:*",
12
13
  DocumentsBrowse = "docs:finance:browse",
13
14
  LeadsAll = "leads:*",
15
+ BrowseDocumentDrafts = "docs:drafts:browse",
14
16
  LeasingDebtorsView = "leasing:debtors:view",
15
17
  LeasingOverduesView = "leasing:overdues:view",
16
18
  LeasingContractsExport = "leasing:contracts:export",
@@ -34,6 +36,7 @@ export declare enum BusinessEntityIds {
34
36
  Contacts = "contacts",
35
37
  Emails = "emails",
36
38
  FinanceDocuments = "finance_documents",
39
+ AdministrativeDocuments = "administrative_documents",
37
40
  InternetVehicles = "internet-vehicles",
38
41
  LeasingContracts = "leasing_contracts",
39
42
  LeasingUploadAutomation = "leasing_upload_automation",
@@ -43,7 +46,8 @@ export declare enum BusinessEntityIds {
43
46
  Users = "users",
44
47
  Vehicles = "vehicles",
45
48
  VehiclesPriceLists = "vehicles_price_lists",
46
- Debtors = "debtors"
49
+ Debtors = "debtors",
50
+ DocumentDrafts = "document_drafts"
47
51
  }
48
52
  export declare const LEASING_QUOTE_TEMPLATE_GROUP_ID = "leasing_quote_template";
49
53
  export declare const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = "leasing_quote_proforma_template";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":"AAGA,oBAAY,QAAQ;IAClB,UAAU,eAAe;IACzB,gBAAgB,sBAAsB;IACtC,KAAK,WAAW;IAChB,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,aAAa,mBAAmB;IAChC,UAAU,gBAAgB;CAC3B;AAED,oBAAY,eAAe;IACzB,iBAAiB,YAAY;IAC7B,eAAe,wBAAwB;IACvC,QAAQ,YAAY;IACpB,oB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MAAM,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAalD,CAAC;AAEF,eAAO,MAAM,mBAAmB,oBAAoB,CAAC"}
package/lib/constants.js CHANGED
@@ -1,21 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_SLB_PARTNER = exports.HEXON_LANG_CODES = exports.EU_VAT_COUNTRY_CODES = exports.SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = exports.SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = exports.LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = exports.LEASING_QUOTE_LOCATION_TEMPLATE = exports.LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID = exports.LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = exports.LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = exports.LEASING_QUOTE_TEMPLATE_GROUP_ID = exports.BusinessEntityIds = exports.SYSTEM_USER_ID = exports.NO_TENANT_ID_VALUE = exports.SERVICE_ID_ADMIN_HEADER = exports.TENANT_ID_ADMIN_HEADER = exports.SUPPORTED_LANGUAGES = exports.TopLevelActions = exports.AppRoles = void 0;
4
- var AppRoles;
1
+ export var AppRoles;
5
2
  (function (AppRoles) {
6
3
  AppRoles["Accountant"] = "accountant";
4
+ AppRoles["SeniorAccountant"] = "senior_accountant";
7
5
  AppRoles["Admin"] = "admins";
8
6
  AppRoles["Administrative"] = "administrative";
9
7
  AppRoles["Commercial"] = "commercial";
10
8
  AppRoles["Manager"] = "manager";
11
9
  AppRoles["ParkLogistics"] = "park_logistics";
12
10
  AppRoles["AppManager"] = "app_manager";
13
- })(AppRoles = exports.AppRoles || (exports.AppRoles = {}));
14
- var TopLevelActions;
11
+ })(AppRoles || (AppRoles = {}));
12
+ export var TopLevelActions;
15
13
  (function (TopLevelActions) {
16
14
  TopLevelActions["AdministrationAll"] = "admin:*";
17
15
  TopLevelActions["DocumentsBrowse"] = "docs:finance:browse";
18
16
  TopLevelActions["LeadsAll"] = "leads:*";
17
+ TopLevelActions["BrowseDocumentDrafts"] = "docs:drafts:browse";
19
18
  TopLevelActions["LeasingDebtorsView"] = "leasing:debtors:view";
20
19
  TopLevelActions["LeasingOverduesView"] = "leasing:overdues:view";
21
20
  TopLevelActions["LeasingContractsExport"] = "leasing:contracts:export";
@@ -28,18 +27,19 @@ var TopLevelActions;
28
27
  TopLevelActions["VehicleCreate"] = "vehicle:create";
29
28
  TopLevelActions["TasksAll"] = "tasks:*";
30
29
  TopLevelActions["TrackAndTraceDevices"] = "tt:devices:*";
31
- })(TopLevelActions = exports.TopLevelActions || (exports.TopLevelActions = {}));
32
- exports.SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'];
33
- exports.TENANT_ID_ADMIN_HEADER = 'tenant-id';
34
- exports.SERVICE_ID_ADMIN_HEADER = 'service-id';
35
- exports.NO_TENANT_ID_VALUE = 'notenant';
36
- exports.SYSTEM_USER_ID = 'system';
37
- var BusinessEntityIds;
30
+ })(TopLevelActions || (TopLevelActions = {}));
31
+ export const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'];
32
+ export const TENANT_ID_ADMIN_HEADER = 'tenant-id';
33
+ export const SERVICE_ID_ADMIN_HEADER = 'service-id';
34
+ export const NO_TENANT_ID_VALUE = 'notenant';
35
+ export const SYSTEM_USER_ID = 'system';
36
+ export var BusinessEntityIds;
38
37
  (function (BusinessEntityIds) {
39
38
  BusinessEntityIds["BecrisDeclarations"] = "becris_declarations";
40
39
  BusinessEntityIds["Contacts"] = "contacts";
41
40
  BusinessEntityIds["Emails"] = "emails";
42
41
  BusinessEntityIds["FinanceDocuments"] = "finance_documents";
42
+ BusinessEntityIds["AdministrativeDocuments"] = "administrative_documents";
43
43
  BusinessEntityIds["InternetVehicles"] = "internet-vehicles";
44
44
  BusinessEntityIds["LeasingContracts"] = "leasing_contracts";
45
45
  BusinessEntityIds["LeasingUploadAutomation"] = "leasing_upload_automation";
@@ -50,16 +50,17 @@ var BusinessEntityIds;
50
50
  BusinessEntityIds["Vehicles"] = "vehicles";
51
51
  BusinessEntityIds["VehiclesPriceLists"] = "vehicles_price_lists";
52
52
  BusinessEntityIds["Debtors"] = "debtors";
53
- })(BusinessEntityIds = exports.BusinessEntityIds || (exports.BusinessEntityIds = {}));
54
- exports.LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';
55
- exports.LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';
56
- exports.LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = 'leasing_contract_amortization_template';
57
- exports.LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID = 'leasing_contract_amortization_print_version_template';
58
- exports.LEASING_QUOTE_LOCATION_TEMPLATE = 'leasing_quote_location_template';
59
- exports.LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';
60
- exports.SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';
61
- exports.SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';
62
- exports.EU_VAT_COUNTRY_CODES = [
53
+ BusinessEntityIds["DocumentDrafts"] = "document_drafts";
54
+ })(BusinessEntityIds || (BusinessEntityIds = {}));
55
+ export const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';
56
+ export const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';
57
+ export const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = 'leasing_contract_amortization_template';
58
+ export const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID = 'leasing_contract_amortization_print_version_template';
59
+ export const LEASING_QUOTE_LOCATION_TEMPLATE = 'leasing_quote_location_template';
60
+ export const LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';
61
+ export const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';
62
+ export const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';
63
+ export const EU_VAT_COUNTRY_CODES = [
63
64
  'at',
64
65
  'be',
65
66
  'bg',
@@ -89,7 +90,7 @@ exports.EU_VAT_COUNTRY_CODES = [
89
90
  'se',
90
91
  'xi',
91
92
  ];
92
- exports.HEXON_LANG_CODES = [
93
+ export const HEXON_LANG_CODES = [
93
94
  'en',
94
95
  'nl',
95
96
  'de',
@@ -103,5 +104,5 @@ exports.HEXON_LANG_CODES = [
103
104
  'el',
104
105
  'bg',
105
106
  ];
106
- exports.DEFAULT_SLB_PARTNER = 'To be announced';
107
+ export const DEFAULT_SLB_PARTNER = 'To be announced';
107
108
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":";;;AAGA,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,4BAAgB,CAAA;IAChB,6CAAiC,CAAA;IACjC,qCAAyB,CAAA;IACzB,+BAAmB,CAAA;IACnB,4CAAgC,CAAA;IAChC,sCAA0B,CAAA;AAC5B,CAAC,EARW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAQnB;AAED,IAAY,eAgBX;AAhBD,WAAY,eAAe;IACzB,gDAA6B,CAAA;IAC7B,0DAAuC,CAAA;IACvC,uCAAoB,CAAA;IACpB,8DAA2C,CAAA;IAC3C,gEAA6C,CAAA;IAC7C,sEAAmD,CAAA;IACnD,8EAA2D,CAAA;IAC3D,kEAA+C,CAAA;IAC/C,iDAA8B,CAAA;IAC9B,qDAAkC,CAAA;IAClC,uDAAoC,CAAA;IACpC,6CAA0B,CAAA;IAC1B,mDAAgC,CAAA;IACh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J,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;AAEW,QAAA,gBAAgB,GAA0B;IACrD,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;AAEW,QAAA,mBAAmB,GAAG,iBAAiB,CAAC","sourcesContent":["//\n// STATIC ROLES\n//\nexport enum AppRoles {\n Accountant = 'accountant',\n Admin = 'admins',\n Administrative = 'administrative',\n Commercial = 'commercial',\n Manager = 'manager',\n ParkLogistics = 'park_logistics',\n AppManager = 'app_manager',\n}\n\nexport enum TopLevelActions {\n AdministrationAll = 'admin:*',\n DocumentsBrowse = 'docs:finance:browse',\n LeadsAll = 'leads:*',\n LeasingDebtorsView = 'leasing:debtors:view',\n LeasingOverduesView = 'leasing:overdues:view',\n LeasingContractsExport = 'leasing:contracts:export',\n LeasingContractsRsExport = 'leasing:contracts:rs:export-rs', // rs stands for rental solutions\n LeasingDebtorsExport = 'leasing:debtors:export',\n MarketBrowse = 'market:browse',\n MarketInsights = 'insights:market',\n VehicleInsights = 'insights:vehicle',\n SettingsAll = 'settings:*',\n VehicleCreate = 'vehicle:create',\n TasksAll = 'tasks:*',\n TrackAndTraceDevices = 'tt:devices:*',\n}\n\n//\n// I18N\n//\nexport const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'] as const;\n\n//\n// Headers\n//\nexport const TENANT_ID_ADMIN_HEADER = 'tenant-id';\nexport const SERVICE_ID_ADMIN_HEADER = 'service-id';\n\n//\n// AUTH\n//\nexport const NO_TENANT_ID_VALUE = 'notenant';\nexport const SYSTEM_USER_ID = 'system';\n\n//\n// Business Entity IDs\n//\nexport enum BusinessEntityIds {\n BecrisDeclarations = 'becris_declarations',\n Contacts = 'contacts',\n Emails = 'emails',\n FinanceDocuments = 'finance_documents',\n InternetVehicles = 'internet-vehicles',\n LeasingContracts = 'leasing_contracts',\n LeasingUploadAutomation = 'leasing_upload_automation',\n Opportunities = 'opportunities',\n Organizations = 'organizations',\n PdfTemplates = 'pdf_templates',\n Users = 'users',\n Vehicles = 'vehicles',\n VehiclesPriceLists = 'vehicles_price_lists',\n Debtors = 'debtors',\n}\n\n//\n// PDF Templates IDs\n//\nexport const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';\nexport const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID =\n 'leasing_contract_amortization_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID =\n 'leasing_contract_amortization_print_version_template';\nexport const LEASING_QUOTE_LOCATION_TEMPLATE = 'leasing_quote_location_template';\nexport const LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';\nexport const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';\nexport const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';\n\n//\n// VAT Prefixes for EU Countries and Great Britain & Northern Ireland\n//\nexport const EU_VAT_COUNTRY_CODES = [\n 'at',\n 'be',\n 'bg',\n 'hr',\n 'cy',\n 'cz',\n 'dk',\n 'ee',\n 'fi',\n 'fr',\n 'de',\n 'el',\n 'hu',\n 'ie',\n 'it',\n 'lv',\n 'lt',\n 'lu',\n 'mt',\n 'nl',\n 'pl',\n 'pt',\n 'ro',\n 'sk',\n 'si',\n 'es',\n 'se',\n 'xi', // Northern Ireland\n];\n\nexport const HEXON_LANG_CODES: [string, ...string[]] = [\n 'en',\n 'nl',\n 'de',\n 'fr',\n 'es',\n 'pt',\n 'it',\n 'pl',\n 'ru',\n 'ro',\n 'el',\n 'bg',\n];\n\nexport const DEFAULT_SLB_PARTNER = 'To be announced';\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,QASX;AATD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,kDAAsC,CAAA;IACtC,4BAAgB,CAAA;IAChB,6CAAiC,CAAA;IACjC,qCAAyB,CAAA;IACzB,+BAAmB,CAAA;IACnB,4CAAgC,CAAA;IAChC,sCAA0B,CAAA;AAC5B,CAAC,EATW,QAAQ,KAAR,QAAQ,QASnB;AAED,MAAM,CAAN,IAAY,eAiBX;AAjBD,WAAY,eAAe;IACzB,gDAA6B,CAAA;IAC7B,0DAAuC,CAAA;IACvC,uCAAoB,CAAA;IACpB,8DAA2C,CAAA;IAC3C,8DAA2C,CAAA;IAC3C,gEAA6C,CAAA;IAC7C,sEAAmD,CAAA;IACnD,8EAA2D,CAAA;IAC3D,kEAA+C,CAAA;IAC/C,iDAA8B,CAAA;IAC9B,qDAAkC,CAAA;IAClC,uDAAoC,CAAA;IACpC,6CAA0B,CAAA;IAC1B,mDAAgC,CAAA;IAChC,uCAAoB,CAAA;IACpB,wDAAqC,CAAA;AACvC,CAAC,EAjBW,eAAe,KAAf,eAAe,QAiB1B;AAKD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAKjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAClD,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAKpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;AAC7C,MAAM,CAAC,MA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AI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAA0B;IACrD,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;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC","sourcesContent":["//\n// STATIC ROLES\n//\nexport enum AppRoles {\n Accountant = 'accountant',\n SeniorAccountant = 'senior_accountant',\n Admin = 'admins',\n Administrative = 'administrative',\n Commercial = 'commercial',\n Manager = 'manager',\n ParkLogistics = 'park_logistics',\n AppManager = 'app_manager',\n}\n\nexport enum TopLevelActions {\n AdministrationAll = 'admin:*',\n DocumentsBrowse = 'docs:finance:browse',\n LeadsAll = 'leads:*',\n BrowseDocumentDrafts = 'docs:drafts:browse',\n LeasingDebtorsView = 'leasing:debtors:view',\n LeasingOverduesView = 'leasing:overdues:view',\n LeasingContractsExport = 'leasing:contracts:export',\n LeasingContractsRsExport = 'leasing:contracts:rs:export-rs', // rs stands for rental solutions\n LeasingDebtorsExport = 'leasing:debtors:export',\n MarketBrowse = 'market:browse',\n MarketInsights = 'insights:market',\n VehicleInsights = 'insights:vehicle',\n SettingsAll = 'settings:*',\n VehicleCreate = 'vehicle:create',\n TasksAll = 'tasks:*',\n TrackAndTraceDevices = 'tt:devices:*',\n}\n\n//\n// I18N\n//\nexport const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'] as const;\n\n//\n// Headers\n//\nexport const TENANT_ID_ADMIN_HEADER = 'tenant-id';\nexport const SERVICE_ID_ADMIN_HEADER = 'service-id';\n\n//\n// AUTH\n//\nexport const NO_TENANT_ID_VALUE = 'notenant';\nexport const SYSTEM_USER_ID = 'system';\n\n//\n// Business Entity IDs\n//\nexport enum BusinessEntityIds {\n BecrisDeclarations = 'becris_declarations',\n Contacts = 'contacts',\n Emails = 'emails',\n FinanceDocuments = 'finance_documents',\n AdministrativeDocuments = 'administrative_documents',\n InternetVehicles = 'internet-vehicles',\n LeasingContracts = 'leasing_contracts',\n LeasingUploadAutomation = 'leasing_upload_automation',\n Opportunities = 'opportunities',\n Organizations = 'organizations',\n PdfTemplates = 'pdf_templates',\n Users = 'users',\n Vehicles = 'vehicles',\n VehiclesPriceLists = 'vehicles_price_lists',\n Debtors = 'debtors',\n DocumentDrafts = 'document_drafts',\n}\n\n//\n// PDF Templates IDs\n//\nexport const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';\nexport const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID =\n 'leasing_contract_amortization_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID =\n 'leasing_contract_amortization_print_version_template';\nexport const LEASING_QUOTE_LOCATION_TEMPLATE = 'leasing_quote_location_template';\nexport const LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';\nexport const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';\nexport const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';\n\n//\n// VAT Prefixes for EU Countries and Great Britain & Northern Ireland\n//\nexport const EU_VAT_COUNTRY_CODES = [\n 'at',\n 'be',\n 'bg',\n 'hr',\n 'cy',\n 'cz',\n 'dk',\n 'ee',\n 'fi',\n 'fr',\n 'de',\n 'el',\n 'hu',\n 'ie',\n 'it',\n 'lv',\n 'lt',\n 'lu',\n 'mt',\n 'nl',\n 'pl',\n 'pt',\n 'ro',\n 'sk',\n 'si',\n 'es',\n 'se',\n 'xi', // Northern Ireland\n];\n\nexport const HEXON_LANG_CODES: [string, ...string[]] = [\n 'en',\n 'nl',\n 'de',\n 'fr',\n 'es',\n 'pt',\n 'it',\n 'pl',\n 'ru',\n 'ro',\n 'el',\n 'bg',\n];\n\nexport const DEFAULT_SLB_PARTNER = 'To be announced';\n"]}
@@ -0,0 +1,6 @@
1
+ export declare const isSameOrAfter: (value: Date, reference: Date) => boolean;
2
+ export declare const isSameOrBefore: (value: Date, reference: Date) => boolean;
3
+ export declare const isBetween: (value: Date, startInclusive: Date, endExclusive: Date) => boolean;
4
+ export declare const businessDaysAdd: (value: Date, days: number) => Date;
5
+ export declare const isoString: () => string;
6
+ //# sourceMappingURL=date-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-utils.d.ts","sourceRoot":"/","sources":["date-utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,UAAW,IAAI,aAAa,IAAI,KAAG,OAC1B,CAAC;AAEpC,eAAO,MAAM,cAAc,UAAW,IAAI,aAAa,IAAI,KAAG,OAC3B,CAAC;AAEpC,eAAO,MAAM,SAAS,UAAW,IAAI,kBAAkB,IAAI,gBAAgB,IAAI,KAAG,OACX,CAAC;AAExE,eAAO,MAAM,eAAe,UAAW,IAAI,QAAQ,MAAM,KAAG,IAAoC,CAAC;AAEjG,eAAO,MAAM,SAAS,cAAiC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { compareAsc, isBefore } from 'date-fns';
2
+ export const isSameOrAfter = (value, reference) => compareAsc(value, reference) >= 0;
3
+ export const isSameOrBefore = (value, reference) => compareAsc(value, reference) <= 0;
4
+ export const isBetween = (value, startInclusive, endExclusive) => isSameOrAfter(value, startInclusive) && isBefore(value, endExclusive);
5
+ export const businessDaysAdd = (value, days) => businessDaysAdd(value, days);
6
+ export const isoString = () => new Date().toISOString();
7
+ //# sourceMappingURL=date-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-utils.js","sourceRoot":"/","sources":["date-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAW,EAAE,SAAe,EAAW,EAAE,CACrE,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAW,EAAE,SAAe,EAAW,EAAE,CACtE,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAW,EAAE,cAAoB,EAAE,YAAkB,EAAW,EAAE,CAC1F,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAW,EAAE,IAAY,EAAQ,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAEjG,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { compareAsc, isBefore } from 'date-fns';\n\nexport const isSameOrAfter = (value: Date, reference: Date): boolean =>\n compareAsc(value, reference) >= 0;\n\nexport const isSameOrBefore = (value: Date, reference: Date): boolean =>\n compareAsc(value, reference) <= 0;\n\nexport const isBetween = (value: Date, startInclusive: Date, endExclusive: Date): boolean =>\n isSameOrAfter(value, startInclusive) && isBefore(value, endExclusive);\n\nexport const businessDaysAdd = (value: Date, days: number): Date => businessDaysAdd(value, days);\n\nexport const isoString = () => new Date().toISOString();\n"]}
@@ -1,4 +1,4 @@
1
- import { BusinessEntityIds } from './constants';
1
+ import { BusinessEntityIds } from './constants.js';
2
2
  export type Discussion = {
3
3
  businessEntityId: BusinessEntityIds;
4
4
  createdAt: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discussions.d.ts","sourceRoot":"/","sources":["discussions.ts"],"names":[],"mappings":"A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AChB,CAAC"}
@@ -1,5 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MESSAGE_NOTIFICATION_ORIGIN = void 0;
4
- exports.MESSAGE_NOTIFICATION_ORIGIN = 'message';
1
+ export const MESSAGE_NOTIFICATION_ORIGIN = 'message';
5
2
  //# sourceMappingURL=discussions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"discussions.js","sourceRoot":"/","sources":["discussions.ts"],"names":[],"mappings":";;;AAqCa,QAAA,2BAA2B,GAAG,SAAS,CAAC","sourcesContent":["import { BusinessEntityIds } from './constants';\n\nexport type Discussion = {\n businessEntityId: BusinessEntityIds;\n createdAt: string;\n followers: string[];\n id: string;\n recordId: string;\n title?: string;\n};\n\nexport type DiscussionData = {\n discussion: Discussion;\n messages: Message[];\n};\n\nexport type NewDiscussion = {\n businessEntityId: BusinessEntityIds;\n content: MessageContent;\n recordId: string;\n title?: string;\n followers: string[];\n};\n\nexport type Message = {\n author: string;\n content?: MessageContent; // optional if the content is deleted\n createdAt: string;\n deletedAt?: string;\n id: string;\n};\n\nexport type MessageContent = {\n value: string;\n mentions: string[];\n};\n\nexport const MESSAGE_NOTIFICATION_ORIGIN = 'message';\n\nexport type MessageNotificationData = {\n snippet: string;\n id: string;\n mention?: boolean;\n};\n\nexport type NewDiscussionEvent = {\n discussion: NewDiscussion;\n tenantId: string;\n author: string;\n};\n"]}
1
+ {"version":3,"file":"discussions.js","sourceRoot":"/","sources":["discussions.ts"],"names":[],"mappings":"AAqCA,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC","sourcesContent":["import { BusinessEntityIds } from './constants.js';\n\nexport type Discussion = {\n businessEntityId: BusinessEntityIds;\n createdAt: string;\n followers: string[];\n id: string;\n recordId: string;\n title?: string;\n};\n\nexport type DiscussionData = {\n discussion: Discussion;\n messages: Message[];\n};\n\nexport type NewDiscussion = {\n businessEntityId: BusinessEntityIds;\n content: MessageContent;\n recordId: string;\n title?: string;\n followers: string[];\n};\n\nexport type Message = {\n author: string;\n content?: MessageContent; // optional if the content is deleted\n createdAt: string;\n deletedAt?: string;\n id: string;\n};\n\nexport type MessageContent = {\n value: string;\n mentions: string[];\n};\n\nexport const MESSAGE_NOTIFICATION_ORIGIN = 'message';\n\nexport type MessageNotificationData = {\n snippet: string;\n id: string;\n mention?: boolean;\n};\n\nexport type NewDiscussionEvent = {\n discussion: NewDiscussion;\n tenantId: string;\n author: string;\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { ValidationError } from 'joi';
1
+ import Joi from 'joi';
2
2
  export declare class XError extends Error {
3
3
  errorCtx: any;
4
4
  constructor(message?: string, errorCtx?: any);
@@ -27,7 +27,7 @@ export declare class InvalidArgumentsError extends Error {
27
27
  };
28
28
  isValidation: boolean;
29
29
  errorCtx: any;
30
- constructor(message?: string, errors?: ValidationError, errorCtx?: any);
30
+ constructor(message?: string, errors?: Joi.ValidationError, errorCtx?: any);
31
31
  }
32
32
  export declare class UnauthorizedError extends Error {
33
33
  constructor(message?: string);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"/","sources":["errors.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,qBAAa,MAAO,SAAQ,KAAK;IAC/B,QAAQ,EAAE,GAAG,CAAC;gBAEF,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG;CAK7C;AAED,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,EAAE,GAAG,CAAC;gBAEF,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,GAAG;CAMvC;AAED,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,CAAC,EAAE,MAAM;CAI7B;AAED,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,CAAC,EAAE,MAAM;CAI7B;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,CAAC,EAAE,MAAM;CAI7B;AAED,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AACF,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,gBAAgB,CAAC,EAAE;QAAE,MAAM,EAAE,oBAAoB,EAAE,CAAA;KAAE,CAAC;IACtD,YAAY,UAAQ;IACpB,QAAQ,EAAE,GAAG,CAAC;gBAEF,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE,GAAG;CAiB3E;AAED,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,CAAC,EAAE,MAAM;CAI7B"}
package/lib/errors.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UnauthorizedError = exports.InvalidArgumentsError = exports.EntryAlreadyExistsError = exports.ForbiddenError = exports.AsyncStopError = exports.WrappedError = exports.XError = void 0;
4
- class XError extends Error {
1
+ export class XError extends Error {
5
2
  errorCtx;
6
3
  constructor(message, errorCtx) {
7
4
  super(message);
@@ -9,8 +6,7 @@ class XError extends Error {
9
6
  this.errorCtx = errorCtx;
10
7
  }
11
8
  }
12
- exports.XError = XError;
13
- class WrappedError extends Error {
9
+ export class WrappedError extends Error {
14
10
  errorCtx;
15
11
  constructor(err, errorCtx) {
16
12
  super(err.message);
@@ -19,29 +15,25 @@ class WrappedError extends Error {
19
15
  this.errorCtx = errorCtx;
20
16
  }
21
17
  }
22
- exports.WrappedError = WrappedError;
23
- class AsyncStopError extends Error {
18
+ export class AsyncStopError extends Error {
24
19
  constructor(message) {
25
20
  super(message);
26
21
  this.name = 'AsyncStopError';
27
22
  }
28
23
  }
29
- exports.AsyncStopError = AsyncStopError;
30
- class ForbiddenError extends Error {
24
+ export class ForbiddenError extends Error {
31
25
  constructor(message) {
32
26
  super(message);
33
27
  this.name = 'ForbiddenError';
34
28
  }
35
29
  }
36
- exports.ForbiddenError = ForbiddenError;
37
- class EntryAlreadyExistsError extends Error {
30
+ export class EntryAlreadyExistsError extends Error {
38
31
  constructor(message) {
39
32
  super(message);
40
33
  this.name = 'EntryAlreadyExistsError';
41
34
  }
42
35
  }
43
- exports.EntryAlreadyExistsError = EntryAlreadyExistsError;
44
- class InvalidArgumentsError extends Error {
36
+ export class InvalidArgumentsError extends Error {
45
37
  validationErrors;
46
38
  isValidation = true;
47
39
  errorCtx;
@@ -60,12 +52,10 @@ class InvalidArgumentsError extends Error {
60
52
  }
61
53
  }
62
54
  }
63
- exports.InvalidArgumentsError = InvalidArgumentsError;
64
- class UnauthorizedError extends Error {
55
+ export class UnauthorizedError extends Error {
65
56
  constructor(message) {
66
57
  super(message);
67
58
  this.name = 'UnauthorizedError';
68
59
  }
69
60
  }
70
- exports.UnauthorizedError = UnauthorizedError;
71
61
  //# sourceMappingURL=errors.js.map
package/lib/errors.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"/","sources":["errors.ts"],"names":[],"mappings":";;;AAEA,MAAa,MAAO,SAAQ,KAAK;IAC/B,QAAQ,CAAM;IAEd,YAAY,OAAgB,EAAE,QAAc;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AARD,wBAQC;AAED,MAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAM;IAEd,YAAY,GAAU,EAAE,QAAc;QACpC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QACvB,IAAI,CAAC,QAA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AgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AALD,8CAKC","sourcesContent":["import { ValidationError, ValidationErrorItem } from 'joi';\n\nexport class XError extends Error {\n errorCtx: any;\n\n constructor(message?: string, errorCtx?: any) {\n super(message);\n this.name = 'XError';\n this.errorCtx = errorCtx;\n }\n}\n\nexport class WrappedError extends Error {\n errorCtx: any;\n\n constructor(err: Error, errorCtx?: any) {\n super(err.message);\n this.name = err.name;\n this.stack = err.stack;\n this.errorCtx = errorCtx;\n }\n}\n\nexport class AsyncStopError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'AsyncStopError';\n }\n}\n\nexport class ForbiddenError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'ForbiddenError';\n }\n}\n\nexport class EntryAlreadyExistsError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'EntryAlreadyExistsError';\n }\n}\n\ntype FieldValidationError = {\n message: string;\n path: Array<string | number>;\n type: string;\n};\nexport class InvalidArgumentsError extends Error {\n validationErrors?: { errors: FieldValidationError[] };\n isValidation = true;\n errorCtx: any;\n\n constructor(message?: string, errors?: ValidationError, errorCtx?: any) {\n super(message);\n this.name = 'InvalidArgumentsError';\n this.errorCtx = errorCtx;\n\n if (errors != null) {\n this.validationErrors = {\n errors: errors.details.map(\n ({ path, type, message }: ValidationErrorItem): FieldValidationError => ({\n message,\n path,\n type: type === 'custom' ? message : type,\n })\n ),\n };\n }\n }\n}\n\nexport class UnauthorizedError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'UnauthorizedError';\n }\n}\n"]}
1
+ {"version":3,"file":"errors.js","sourceRoot":"/","sources":["errors.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,MAAO,SAAQ,KAAK;IAC/B,QAAQ,CAAM;IAEd,YAAY,OAAgB,EAAE,QAAc;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,C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AE,MAAM,CAAC,OAAO,CAAC,GAAG,CACxB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAA2B,EAAwB,EAAE,CAAC,CAAC;oBAC3E,OAAO;oBACP,IAAI;oBACJ,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;iBACzC,CAAC,CACH;aACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF","sourcesContent":["import Joi from 'joi';\n\nexport class XError extends Error {\n errorCtx: any;\n\n constructor(message?: string, errorCtx?: any) {\n super(message);\n this.name = 'XError';\n this.errorCtx = errorCtx;\n }\n}\n\nexport class WrappedError extends Error {\n errorCtx: any;\n\n constructor(err: Error, errorCtx?: any) {\n super(err.message);\n this.name = err.name;\n this.stack = err.stack;\n this.errorCtx = errorCtx;\n }\n}\n\nexport class AsyncStopError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'AsyncStopError';\n }\n}\n\nexport class ForbiddenError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'ForbiddenError';\n }\n}\n\nexport class EntryAlreadyExistsError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'EntryAlreadyExistsError';\n }\n}\n\ntype FieldValidationError = {\n message: string;\n path: Array<string | number>;\n type: string;\n};\nexport class InvalidArgumentsError extends Error {\n validationErrors?: { errors: FieldValidationError[] };\n isValidation = true;\n errorCtx: any;\n\n constructor(message?: string, errors?: Joi.ValidationError, errorCtx?: any) {\n super(message);\n this.name = 'InvalidArgumentsError';\n this.errorCtx = errorCtx;\n\n if (errors != null) {\n this.validationErrors = {\n errors: errors.details.map(\n ({ path, type, message }: Joi.ValidationErrorItem): FieldValidationError => ({\n message,\n path,\n type: type === 'custom' ? message : type,\n })\n ),\n };\n }\n }\n}\n\nexport class UnauthorizedError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'UnauthorizedError';\n }\n}\n"]}
@@ -13,4 +13,16 @@ export type ExactClientAccount = {
13
13
  exactTld: string;
14
14
  authenticated: boolean;
15
15
  };
16
+ export type GlAccount = {
17
+ id: string;
18
+ code: number;
19
+ description: string;
20
+ };
21
+ export type Journal = {
22
+ code: string;
23
+ type: string;
24
+ glAccountCode: string;
25
+ glAccountDescription: string;
26
+ description: string;
27
+ };
16
28
  //# sourceMappingURL=exact.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exact.d.ts","sourceRoot":"/","sources":["exact.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"exact.d.ts","sourceRoot":"/","sources":["exact.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAGF,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
package/lib/exact.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=exact.js.map
package/lib/exact.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"exact.js","sourceRoot":"/","sources":["exact.ts"],"names":[],"mappings":"","sourcesContent":["export type NewExactClientAccount = {\n branchId: string;\n division: number;\n clientId: string;\n exactTld: string;\n};\n\nexport type ExactClientAccount = {\n branchId: string;\n division: number;\n clientId: string;\n lastAuthenticatedAt?: string;\n expiresAt?: string;\n exactTld: string;\n authenticated: boolean;\n};\n"]}
1
+ {"version":3,"file":"exact.js","sourceRoot":"/","sources":["exact.ts"],"names":[],"mappings":"","sourcesContent":["export type NewExactClientAccount = {\n branchId: string;\n division: number;\n clientId: string;\n exactTld: string;\n};\n\nexport type ExactClientAccount = {\n branchId: string;\n division: number;\n clientId: string;\n lastAuthenticatedAt?: string;\n expiresAt?: string;\n exactTld: string;\n authenticated: boolean;\n};\n\n// TODO remove once exact-sdk is correctly published\nexport type GlAccount = {\n id: string;\n code: number;\n description: string;\n};\n\nexport type Journal = {\n code: string;\n type: string;\n glAccountCode: string;\n glAccountDescription: string;\n description: string;\n};\n"]}
@@ -1,5 +1,5 @@
1
- import type { HeadersInit } from 'node-fetch';
2
- import { RequestInfo, RequestInit } from 'node-fetch';
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import type { HeadersInit, RequestInfo, RequestInit } from 'node-fetch';
3
3
  import type { URL } from 'node:url';
4
4
  export declare const fetchJson: <T>(url: URL | RequestInfo, init?: RequestInit) => Promise<T | undefined>;
5
5
  export declare const getAdminAuth: () => Promise<string>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAIpC,eAAO,MAAM,SAAS,WACf,GAAG,GAAG,WAAW,SACf,WAAW,2BAkBnB,CAAC;AAEF,eAAO,MAAM,YAAY,QAAa,QAAQ,MAAM,CAMnD,CAAC;AAEF,eAAO,MAAM,iBAAiB;;MAA2C,MAOxE,CAAC;AAEF,eAAO,MAAM,YAAY;;MAAqD,WACF,CAAC"}
package/lib/fetch.js CHANGED
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanHeaders = exports.getTenantIdHeader = exports.getAdminAuth = exports.fetchJson = void 0;
4
- const node_fetch_1 = __importDefault(require("node-fetch"));
5
- const constants_1 = require("./constants");
6
- const errors_1 = require("./errors");
7
- const fetchJson = async (url, init) => {
1
+ import { TENANT_ID_ADMIN_HEADER } from './constants.js';
2
+ import { InvalidArgumentsError, XError } from './errors.js';
3
+ export const fetchJson = async (url, init) => {
8
4
  url = url.toString().replace(/([^:]\/)\/+/g, '$1');
9
- const response = await (0, node_fetch_1.default)(url, init);
5
+ const response = await fetch(url, init);
10
6
  if (!response.ok) {
11
7
  const body = await response.text();
12
- throw new errors_1.XError(response.statusText, {
8
+ throw new XError(response.statusText, {
13
9
  url,
14
10
  body: init?.body,
15
11
  response: body,
@@ -18,22 +14,18 @@ const fetchJson = async (url, init) => {
18
14
  }
19
15
  return response.status === 200 ? response.json() : undefined;
20
16
  };
21
- exports.fetchJson = fetchJson;
22
- const getAdminAuth = async () => {
17
+ export const getAdminAuth = async () => {
23
18
  if (!process.env.ADMIN_KEY) {
24
19
  return '';
25
20
  }
26
21
  return `AdminKey ${process.env.ADMIN_KEY}`;
27
22
  };
28
- exports.getAdminAuth = getAdminAuth;
29
- const getTenantIdHeader = (headers) => {
30
- const tenantId = headers[constants_1.TENANT_ID_ADMIN_HEADER];
23
+ export const getTenantIdHeader = (headers) => {
24
+ const tenantId = headers[TENANT_ID_ADMIN_HEADER];
31
25
  if (!tenantId || typeof tenantId !== 'string') {
32
- throw new errors_1.InvalidArgumentsError('Missing or invalid tenantId');
26
+ throw new InvalidArgumentsError('Missing or invalid tenantId');
33
27
  }
34
28
  return tenantId;
35
29
  };
36
- exports.getTenantIdHeader = getTenantIdHeader;
37
- const cleanHeaders = (headers) => Object.entries(headers).filter((h) => h[1] != null);
38
- exports.cleanHeaders = cleanHeaders;
30
+ export const cleanHeaders = (headers) => Object.entries(headers).filter((h) => h[1] != null);
39
31
  //# sourceMappingURL=fetch.js.map
package/lib/fetch.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":";;;AACA,4DAAuE;AAEvE,2CAAqD;AACrD,qCAAyD;AAElD,MAAM,SAAS,GAAG,KAAK,EAC5B,GAAsB,EACtB,IAAkB,EACM,EAAE;IAE1B,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAa,MAAM,IAAA,oBAAK,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAElD,IAAI,CAAC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RequestInfo, RequestInit, Response } from 'node-fetch';\nimport type { URL } from 'node:url';\nimport { TENANT_ID_ADMIN_HEADER } from './constants';\nimport { InvalidArgumentsError, XError } from './errors';\n\nexport const fetchJson = async <T>(\n url: URL | RequestInfo,\n init?: RequestInit\n): Promise<T | undefined> => {\n // sometimes the origin ends with a slash and when we append the path it gets a double slash\n url = url.toString().replace(/([^:]\\/)\\/+/g, '$1');\n\n const response: Response = await fetch(url, init);\n\n if (!response.ok) {\n const body = await response.text();\n throw new XError(response.statusText, {\n url,\n body: init?.body,\n response: body,\n status: response.status,\n });\n }\n\n return response.status === 200 ? (response.json() as Promise<T>) : undefined;\n};\n\nexport const getAdminAuth = async (): Promise<string> => {\n if (!process.env.ADMIN_KEY) {\n return '';\n }\n\n return `AdminKey ${process.env.ADMIN_KEY}`;\n};\n\nexport const getTenantIdHeader = (headers: { [name: string]: unknown }): string => {\n const tenantId = headers[TENANT_ID_ADMIN_HEADER];\n if (!tenantId || typeof tenantId !== 'string') {\n throw new InvalidArgumentsError('Missing or invalid tenantId');\n }\n\n return tenantId;\n};\n\nexport const cleanHeaders = (headers: { [key: string]: string | undefined }): HeadersInit =>\n Object.entries(headers).filter((h): h is [string, string] => h[1] != null);\n"]}
1
+ {"version":3,"file":"fetch.js","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAC5B,GAAsB,EACtB,IAAkB,EACM,EAAE;IAE1B,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAW,CAAC,CAAC;IAE/C,IAAI,CAAC,QAAQ,CAAC,EAAE,E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constants.js';\nimport { InvalidArgumentsError, XError } from './errors.js';\n\nexport const fetchJson = async <T>(\n url: URL | RequestInfo,\n init?: RequestInit\n): Promise<T | undefined> => {\n // sometimes the origin ends with a slash and when we append the path it gets a double slash\n url = url.toString().replace(/([^:]\\/)\\/+/g, '$1');\n\n const response = await fetch(url, init as any);\n\n if (!response.ok) {\n const body = await response.text();\n throw new XError(response.statusText, {\n url,\n body: init?.body,\n response: body,\n status: response.status,\n });\n }\n\n return response.status === 200 ? (response.json() as Promise<T>) : undefined;\n};\n\nexport const getAdminAuth = async (): Promise<string> => {\n if (!process.env.ADMIN_KEY) {\n return '';\n }\n\n return `AdminKey ${process.env.ADMIN_KEY}`;\n};\n\nexport const getTenantIdHeader = (headers: { [name: string]: unknown }): string => {\n const tenantId = headers[TENANT_ID_ADMIN_HEADER];\n if (!tenantId || typeof tenantId !== 'string') {\n throw new InvalidArgumentsError('Missing or invalid tenantId');\n }\n\n return tenantId;\n};\n\nexport const cleanHeaders = (headers: { [key: string]: string | undefined }): HeadersInit =>\n Object.entries(headers).filter((h): h is [string, string] => h[1] != null);\n"]}
package/lib/formatting.js CHANGED
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatCurrency = exports.joinWithSeparator = void 0;
4
1
  const DEFAULT_SEPARATOR = ' • ';
5
- const joinWithSeparator = (text, { separator = DEFAULT_SEPARATOR, filter = Boolean, } = {}) => text.filter(filter).join(separator);
6
- exports.joinWithSeparator = joinWithSeparator;
7
- const formatCurrency = (amount, locale = 'de-DE', showCurrencySign = false, options = { currency: 'EUR' }) => {
2
+ export const joinWithSeparator = (text, { separator = DEFAULT_SEPARATOR, filter = Boolean, } = {}) => text.filter(filter).join(separator);
3
+ export const formatCurrency = (amount, locale = 'de-DE', showCurrencySign = false, options = { currency: 'EUR' }) => {
8
4
  return new Intl.NumberFormat(locale, {
9
5
  minimumFractionDigits: 2,
10
6
  maximumFractionDigits: 2,
@@ -16,5 +12,4 @@ const formatCurrency = (amount, locale = 'de-DE', showCurrencySign = false, opti
16
12
  .map((p) => (showCurrencySign || (p.type != 'literal' && p.type != 'currency') ? p.value : ''))
17
13
  .join('');
18
14
  };
19
- exports.formatCurrency = formatCurrency;
20
15
  //# sourceMappingURL=formatting.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatting.js","sourceRoot":"/","sources":["formatting.ts"],"names":[],"mappings":";;;AAAA,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEzB,MAAM,iBAAiB,GAAG,CAC/B,IAA4C,EAC5C,EACE,SAAS,GAAG,iBAAiB,EAC7B,MAAM,GAAG,OAAO,MAC4C,EAAE,EAChE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAN5B,QAAA,iBAAiB,qBAMW;AAElC,MAAM,cAAc,GAAG,CAC5B,MAAc,EACd,MAAM,GAAG,OAAO,EAChB,gBAAgB,GAAG,KAAK,EACxB,UAAoC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAC/C,EAAE;IACV,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;QACnC,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,EAAE,CAAC;QACxB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,IAAI;QACjB,GAAG,OAAO;KACX,CAAC;SACC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC9F,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC,CAAC;AAhBW,QAAA,cAAc,kBAgBzB","sourcesContent":["const DEFAULT_SEPARATOR = ' • ';\n\nexport const joinWithSeparator = (\n text: (string | number | undefined | null)[],\n {\n separator = DEFAULT_SEPARATOR,\n filter = Boolean,\n }: { separator?: string; filter?: (value: any) => boolean } = {}\n) => text.filter(filter).join(separator);\n\nexport const formatCurrency = (\n amount: string,\n locale = 'de-DE',\n showCurrencySign = false,\n options: Intl.NumberFormatOptions = { currency: 'EUR' }\n): string => {\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n style: 'currency',\n useGrouping: true,\n ...options,\n })\n .formatToParts(Number(amount))\n .map((p) => (showCurrencySign || (p.type != 'literal' && p.type != 'currency') ? p.value : ''))\n .join('');\n};\n"]}
1
+ {"version":3,"file":"formatting.js","sourceRoot":"/","sources":["formatting.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAA4C,EAC5C,EACE,SAAS,GAAG,iBAAiB,EAC7B,MAAM,GAAG,OAAO,MAC4C,EAAE,EAChE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,MAAc,EACd,MAAM,GAAG,OAAO,EAChB,gBAAgB,GAAG,KAAK,EACxB,UAAoC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAC/C,EAAE;IACV,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;QACnC,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,EAAE,CAAC;QACxB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,IAAI;QACjB,GAAG,OAAO;KACX,CAAC;SACC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC9F,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC,CAAC","sourcesContent":["const DEFAULT_SEPARATOR = ' • ';\n\nexport const joinWithSeparator = (\n text: (string | number | undefined | null)[],\n {\n separator = DEFAULT_SEPARATOR,\n filter = Boolean,\n }: { separator?: string; filter?: (value: any) => boolean } = {}\n) => text.filter(filter).join(separator);\n\nexport const formatCurrency = (\n amount: string,\n locale = 'de-DE',\n showCurrencySign = false,\n options: Intl.NumberFormatOptions = { currency: 'EUR' }\n): string => {\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n style: 'currency',\n useGrouping: true,\n ...options,\n })\n .formatToParts(Number(amount))\n .map((p) => (showCurrencySign || (p.type != 'literal' && p.type != 'currency') ? p.value : ''))\n .join('');\n};\n"]}
package/lib/ids.js CHANGED
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateId = exports.Alphabet = void 0;
4
- const nanoid_1 = require("nanoid");
5
- var Alphabet;
1
+ import { customAlphabet } from 'nanoid';
2
+ export var Alphabet;
6
3
  (function (Alphabet) {
7
4
  Alphabet["Full"] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
8
5
  Alphabet["Alphanumeric"] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
9
6
  Alphabet["Lowercase"] = "abcdefghijklmnopqrstuvwxyz";
10
7
  Alphabet["LowerAlphanumeric"] = "0123456789abcdefghijklmnopqrstuvwxyz";
11
8
  Alphabet["ReferenceCode"] = "123456789ABCDEFGHJKMNPQRSTUVWXYZ";
12
- })(Alphabet = exports.Alphabet || (exports.Alphabet = {}));
13
- const generateId = (idLength = 15, alphabet = Alphabet.Full) => {
14
- const nanoid = (0, nanoid_1.customAlphabet)(alphabet, idLength);
9
+ })(Alphabet || (Alphabet = {}));
10
+ export const generateId = (idLength = 15, alphabet = Alphabet.Full) => {
11
+ const nanoid = customAlphabet(alphabet, idLength);
15
12
  while (true) {
16
13
  const id = nanoid();
17
14
  if (isValid(id)) {
@@ -19,7 +16,6 @@ const generateId = (idLength = 15, alphabet = Alphabet.Full) => {
19
16
  }
20
17
  }
21
18
  };
22
- exports.generateId = generateId;
23
19
  const isValid = (id) => {
24
20
  if (!Number.isNaN(Number.parseInt(id[0]))) {
25
21
  return false;
package/lib/ids.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","sourceRoot":"/","sources":["ids.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,oFAAwE,CAAA;IACxE,2FAA+E,CAAA;IAC/E,oDAAwC,CAAA;IACxC,sEAA0D,CAAA;IAC1D,8DAAkD,CAAA;AACpD,CAAC,EANW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAMnB;AAIM,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,EAAE,WAAqB,QAAQ,CAAC,IAAI,EAAU,EAAE;IAC9F,MAAM,MAAM,GAAG,IAAA,uBAAc,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,OAAO,IAAI,EAAE;QACX,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;QACpB,IAAI,OAAO,CAAC,EAAE,CAAC,EAAE;YACf,OAAO,EAAE,CAAC;SACX;KACF;AACH,CAAC,CAAC;AARW,QAAA,UAAU,cAQrB;AAEF,MAAM,OAAO,GAAG,CAAC,EAAU,EAAW,EAAE;IACtC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACzC,OAAO,KAAK,CAAC;KACd;IAED,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC1C,OAAO,KAAK,CAAC;KACd;IAED,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACrB,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import { customAlphabet } from 'nanoid';\n\nexport enum Alphabet {\n Full = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_',\n Alphanumeric = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',\n Lowercase = 'abcdefghijklmnopqrstuvwxyz',\n LowerAlphanumeric = '0123456789abcdefghijklmnopqrstuvwxyz',\n ReferenceCode = '123456789ABCDEFGHJKMNPQRSTUVWXYZ',\n}\n\n// The ID can contain only alphabets and numbers and underscore.\n// The ID should start with an alphabet and should not have two consecutive underscores or end with an underscore.\nexport const generateId = (idLength: number = 15, alphabet: Alphabet = Alphabet.Full): string => {\n const nanoid = customAlphabet(alphabet, idLength);\n while (true) {\n const id = nanoid();\n if (isValid(id)) {\n return id;\n }\n }\n};\n\nconst isValid = (id: string): boolean => {\n if (!Number.isNaN(Number.parseInt(id[0]))) {\n return false;\n }\n\n if (id.endsWith('_') || id.startsWith('_')) {\n return false;\n }\n\n if (id.includes('__')) {\n return false;\n }\n\n return true;\n};\n"]}
1
+ {"version":3,"file":"ids.js","sourceRoot":"/","sources":["ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,oFAAwE,CAAA;IACxE,2FAA+E,CAAA;IAC/E,oDAAwC,CAAA;IACxC,sEAA0D,CAAA;IAC1D,8DAAkD,CAAA;AACpD,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB;AAID,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,EAAE,WAAqB,QAAQ,CAAC,IAAI,EAAU,EAAE;IAC9F,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;QACpB,IAAI,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,EAAU,EAAW,EAAE;IACtC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import { customAlphabet } from 'nanoid';\n\nexport enum Alphabet {\n Full = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_',\n Alphanumeric = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',\n Lowercase = 'abcdefghijklmnopqrstuvwxyz',\n LowerAlphanumeric = '0123456789abcdefghijklmnopqrstuvwxyz',\n ReferenceCode = '123456789ABCDEFGHJKMNPQRSTUVWXYZ',\n}\n\n// The ID can contain only alphabets and numbers and underscore.\n// The ID should start with an alphabet and should not have two consecutive underscores or end with an underscore.\nexport const generateId = (idLength: number = 15, alphabet: Alphabet = Alphabet.Full): string => {\n const nanoid = customAlphabet(alphabet, idLength);\n while (true) {\n const id = nanoid();\n if (isValid(id)) {\n return id;\n }\n }\n};\n\nconst isValid = (id: string): boolean => {\n if (!Number.isNaN(Number.parseInt(id[0]))) {\n return false;\n }\n\n if (id.endsWith('_') || id.startsWith('_')) {\n return false;\n }\n\n if (id.includes('__')) {\n return false;\n }\n\n return true;\n};\n"]}
package/lib/insurance.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=insurance.js.map
@@ -1,4 +1,4 @@
1
- import { LocationValue } from './types';
1
+ import { LocationValue } from './types.js';
2
2
  export declare const getAddressText: (address: LocationValue, joinBy?: string) => string | undefined;
3
3
  export declare const getFormatedAddressFromLocationValue: (location: LocationValue) => string | undefined;
4
4
  //# sourceMappingURL=location-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"location-utils.d.ts","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,cAAc,YAChB,aAAa,WACd,MAAM,KACb,MAAM,GAAG,SAaX,CAAC;AAEF,eAAO,MAAM,mCAAmC,aACpC,aAAa,KACtB,MAAM,GAAG,SAKX,CAAC"}
1
+ {"version":3,"file":"location-utils.d.ts","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,cAAc,YAChB,aAAa,WACd,MAAM,KACb,MAAM,GAAG,SAaX,CAAC;AAEF,eAAO,MAAM,mCAAmC,aACpC,aAAa,KACtB,MAAM,GAAG,SAKX,CAAC"}