@bisondesk/core-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 (442) hide show
  1. package/lib/{types/apis → apis}/crm.d.ts +8 -3
  2. package/lib/apis/crm.d.ts.map +1 -0
  3. package/lib/{esm/apis → apis}/crm.js +23 -2
  4. package/lib/apis/crm.js.map +1 -0
  5. package/lib/{types/apis → apis}/internet-vehicles.d.ts +1 -1
  6. package/lib/{types/apis → apis}/internet-vehicles.d.ts.map +1 -1
  7. package/lib/apis/internet-vehicles.js.map +1 -0
  8. package/lib/{types/apis → apis}/leasing-administration.d.ts +1 -1
  9. package/lib/{types/apis → apis}/leasing-administration.d.ts.map +1 -1
  10. package/lib/apis/leasing-administration.js.map +1 -0
  11. package/lib/{types/apis → apis}/leasing.d.ts +2 -2
  12. package/lib/{types/apis → apis}/leasing.d.ts.map +1 -1
  13. package/lib/apis/leasing.js.map +1 -0
  14. package/lib/{types/apis → apis}/opportunities.d.ts +4 -3
  15. package/lib/apis/opportunities.d.ts.map +1 -0
  16. package/lib/{esm/apis → apis}/opportunities.js +10 -2
  17. package/lib/apis/opportunities.js.map +1 -0
  18. package/lib/{types/apis → apis}/picklists.d.ts +2 -1
  19. package/lib/apis/picklists.d.ts.map +1 -0
  20. package/lib/{esm/apis → apis}/picklists.js +16 -0
  21. package/lib/apis/picklists.js.map +1 -0
  22. package/lib/{types/apis → apis}/tenants.d.ts +1 -1
  23. package/lib/{types/apis → apis}/tenants.d.ts.map +1 -1
  24. package/lib/apis/tenants.js.map +1 -0
  25. package/lib/{types/apis → apis}/users.d.ts +1 -1
  26. package/lib/{types/apis → apis}/users.d.ts.map +1 -1
  27. package/lib/apis/users.js.map +1 -0
  28. package/lib/{types/apis → apis}/vehicles.d.ts +2 -2
  29. package/lib/{types/apis → apis}/vehicles.d.ts.map +1 -1
  30. package/lib/apis/vehicles.js.map +1 -0
  31. package/lib/{types/constants.d.ts → constants.d.ts} +3 -1
  32. package/lib/constants.d.ts.map +1 -0
  33. package/lib/{esm/constants.js → constants.js} +6 -4
  34. package/lib/constants.js.map +1 -0
  35. package/lib/types/{types/crm.d.ts → crm.d.ts} +6 -5
  36. package/lib/types/crm.d.ts.map +1 -0
  37. package/lib/types/crm.js.map +1 -0
  38. package/lib/types/{types/definitions.d.ts → definitions.d.ts} +2 -2
  39. package/lib/types/{types/definitions.d.ts.map → definitions.d.ts.map} +1 -1
  40. package/lib/types/definitions.js.map +1 -0
  41. package/lib/types/{types/delivery-settings.d.ts → delivery-settings.d.ts} +2 -2
  42. package/lib/types/delivery-settings.d.ts.map +1 -0
  43. package/lib/types/delivery-settings.js.map +1 -0
  44. package/lib/types/{types/insights.d.ts → insights.d.ts} +2 -2
  45. package/lib/types/insights.d.ts.map +1 -0
  46. package/lib/types/insights.js.map +1 -0
  47. package/lib/types/{types/interests.d.ts → interests.d.ts} +2 -2
  48. package/lib/types/interests.d.ts.map +1 -0
  49. package/lib/types/interests.js.map +1 -0
  50. package/lib/types/{types/internet-opportunities.d.ts → internet-opportunities.d.ts} +5 -2
  51. package/lib/types/internet-opportunities.d.ts.map +1 -0
  52. package/lib/types/internet-opportunities.js.map +1 -0
  53. package/lib/types/{types/internet-vehicles.d.ts → internet-vehicles.d.ts} +3 -3
  54. package/lib/types/internet-vehicles.d.ts.map +1 -0
  55. package/lib/types/internet-vehicles.js.map +1 -0
  56. package/lib/types/{types/leasing-administration.d.ts → leasing-administration.d.ts} +2 -1
  57. package/lib/types/leasing-administration.d.ts.map +1 -0
  58. package/lib/types/leasing-administration.js.map +1 -0
  59. package/lib/types/{types/leasing-debtors.d.ts → leasing-debtors.d.ts} +1 -1
  60. package/lib/types/{types/leasing-debtors.d.ts.map → leasing-debtors.d.ts.map} +1 -1
  61. package/lib/types/leasing-debtors.js.map +1 -0
  62. package/lib/types/{types/leasing-search.d.ts → leasing-search.d.ts} +4 -4
  63. package/lib/types/leasing-search.d.ts.map +1 -0
  64. package/lib/types/leasing-search.js.map +1 -0
  65. package/lib/types/{types/leasing-settings.d.ts → leasing-settings.d.ts} +2 -2
  66. package/lib/types/leasing-settings.d.ts.map +1 -0
  67. package/lib/{cjs/types → types}/leasing-settings.js.map +1 -1
  68. package/lib/types/{types/leasing.d.ts → leasing.d.ts} +17 -2
  69. package/lib/types/{types/leasing.d.ts.map → leasing.d.ts.map} +1 -1
  70. package/lib/types/leasing.js.map +1 -0
  71. package/lib/types/{types/opportunities.d.ts → opportunities.d.ts} +13 -10
  72. package/lib/types/opportunities.d.ts.map +1 -0
  73. package/lib/types/opportunities.js.map +1 -0
  74. package/lib/types/{types/picklists.d.ts → picklists.d.ts} +6 -0
  75. package/lib/types/picklists.d.ts.map +1 -0
  76. package/lib/types/picklists.js.map +1 -0
  77. package/lib/types/{types/quote-settings.d.ts → quote-settings.d.ts} +1 -1
  78. package/lib/types/{types/quote-settings.d.ts.map → quote-settings.d.ts.map} +1 -1
  79. package/lib/types/quote-settings.js.map +1 -0
  80. package/lib/types/{types/quotes.d.ts → quotes.d.ts} +4 -4
  81. package/lib/types/quotes.d.ts.map +1 -0
  82. package/lib/types/quotes.js.map +1 -0
  83. package/lib/types/{types/recently-viewed.d.ts → recently-viewed.d.ts} +1 -1
  84. package/lib/types/recently-viewed.d.ts.map +1 -0
  85. package/lib/types/recently-viewed.js.map +1 -0
  86. package/lib/types/{types/roi-ratings.d.ts → roi-ratings.d.ts} +3 -3
  87. package/lib/types/roi-ratings.d.ts.map +1 -0
  88. package/lib/types/roi-ratings.js.map +1 -0
  89. package/lib/types/{types/saved-filters.d.ts → saved-filters.d.ts} +2 -2
  90. package/lib/types/saved-filters.d.ts.map +1 -0
  91. package/lib/{cjs/types → types}/saved-filters.js.map +1 -1
  92. package/lib/types/{types/search.d.ts → search.d.ts} +21 -2
  93. package/lib/types/search.d.ts.map +1 -0
  94. package/lib/types/search.js.map +1 -0
  95. package/lib/types/{types/tenants.d.ts → tenants.d.ts} +2 -1
  96. package/lib/types/tenants.d.ts.map +1 -0
  97. package/lib/types/tenants.js.map +1 -0
  98. package/lib/types/{types/utils.d.ts → utils.d.ts} +1 -1
  99. package/lib/types/utils.d.ts.map +1 -0
  100. package/lib/types/utils.js.map +1 -0
  101. package/lib/types/{types/vehicles.d.ts → vehicles.d.ts} +1 -1
  102. package/lib/types/{types/vehicles.d.ts.map → vehicles.d.ts.map} +1 -1
  103. package/lib/types/vehicles.js.map +1 -0
  104. package/lib/{types/utils → utils}/forms.d.ts +1 -1
  105. package/lib/{types/utils → utils}/forms.d.ts.map +1 -1
  106. package/lib/{esm/utils → utils}/forms.js +2 -2
  107. package/lib/utils/forms.js.map +1 -0
  108. package/lib/{types/utils → utils}/leasing.d.ts +1 -1
  109. package/lib/utils/leasing.d.ts.map +1 -0
  110. package/lib/utils/leasing.js +5 -0
  111. package/lib/utils/leasing.js.map +1 -0
  112. package/lib/{types/utils → utils}/opportunities.d.ts +1 -1
  113. package/lib/{types/utils → utils}/opportunities.d.ts.map +1 -1
  114. package/lib/{esm/utils → utils}/opportunities.js +1 -1
  115. package/lib/utils/opportunities.js.map +1 -0
  116. package/lib/utils/search.d.ts +33 -0
  117. package/lib/utils/search.d.ts.map +1 -0
  118. package/lib/utils/search.js +64 -0
  119. package/lib/utils/search.js.map +1 -0
  120. package/lib/utils/slug.d.ts +3 -0
  121. package/lib/{types/utils → utils}/slug.d.ts.map +1 -1
  122. package/lib/{esm/utils → utils}/slug.js +1 -1
  123. package/lib/utils/slug.js.map +1 -0
  124. package/lib/{types/utils → utils}/tenants.d.ts +1 -1
  125. package/lib/{types/utils → utils}/tenants.d.ts.map +1 -1
  126. package/lib/{esm/utils → utils}/tenants.js +1 -1
  127. package/lib/utils/tenants.js.map +1 -0
  128. package/lib/{types/utils → utils}/vehicles.d.ts +1 -1
  129. package/lib/{types/utils → utils}/vehicles.d.ts.map +1 -1
  130. package/lib/{esm/utils → utils}/vehicles.js +1 -1
  131. package/lib/utils/vehicles.js.map +1 -0
  132. package/package.json +15 -24
  133. package/src/apis/crm.ts +46 -11
  134. package/src/apis/internet-vehicles.ts +1 -1
  135. package/src/apis/leasing-administration.ts +3 -3
  136. package/src/apis/leasing.ts +12 -12
  137. package/src/apis/opportunities.ts +17 -6
  138. package/src/apis/picklists.ts +26 -3
  139. package/src/apis/tenants.ts +6 -6
  140. package/src/apis/users.ts +2 -2
  141. package/src/apis/vehicles.ts +11 -11
  142. package/src/constants.ts +3 -1
  143. package/src/types/crm.ts +8 -5
  144. package/src/types/definitions.ts +2 -2
  145. package/src/types/delivery-settings.ts +2 -2
  146. package/src/types/insights.ts +2 -2
  147. package/src/types/interests.ts +2 -2
  148. package/src/types/internet-opportunities.ts +5 -2
  149. package/src/types/internet-vehicles.ts +3 -3
  150. package/src/types/leasing-administration.ts +3 -2
  151. package/src/types/leasing-debtors.ts +1 -1
  152. package/src/types/leasing-search.ts +4 -4
  153. package/src/types/leasing-settings.ts +2 -2
  154. package/src/types/leasing.ts +18 -2
  155. package/src/types/opportunities.ts +14 -10
  156. package/src/types/picklists.ts +7 -0
  157. package/src/types/quote-settings.ts +1 -1
  158. package/src/types/quotes.ts +4 -4
  159. package/src/types/recently-viewed.ts +1 -1
  160. package/src/types/roi-ratings.ts +3 -3
  161. package/src/types/saved-filters.ts +2 -2
  162. package/src/types/search.ts +24 -2
  163. package/src/types/tenants.ts +2 -1
  164. package/src/types/utils.ts +1 -1
  165. package/src/types/vehicles.ts +1 -1
  166. package/src/utils/forms.ts +2 -2
  167. package/src/utils/leasing.ts +5 -4
  168. package/src/utils/opportunities.ts +1 -1
  169. package/src/utils/search.ts +130 -0
  170. package/src/utils/slug.ts +2 -2
  171. package/src/utils/tenants.ts +2 -2
  172. package/src/utils/vehicles.ts +2 -2
  173. package/tsconfig.deploy.json +5 -0
  174. package/tsconfig.deploy.tsbuildinfo +1 -0
  175. package/tsconfig.json +1 -2
  176. package/tsconfig.tsbuildinfo +1 -0
  177. package/lib/cjs/apis/crm.js +0 -199
  178. package/lib/cjs/apis/crm.js.map +0 -1
  179. package/lib/cjs/apis/documents.js +0 -55
  180. package/lib/cjs/apis/documents.js.map +0 -1
  181. package/lib/cjs/apis/internet-vehicles.js +0 -25
  182. package/lib/cjs/apis/internet-vehicles.js.map +0 -1
  183. package/lib/cjs/apis/leasing-administration.js +0 -47
  184. package/lib/cjs/apis/leasing-administration.js.map +0 -1
  185. package/lib/cjs/apis/leasing.js +0 -167
  186. package/lib/cjs/apis/leasing.js.map +0 -1
  187. package/lib/cjs/apis/opportunities.js +0 -66
  188. package/lib/cjs/apis/opportunities.js.map +0 -1
  189. package/lib/cjs/apis/picklists.js +0 -42
  190. package/lib/cjs/apis/picklists.js.map +0 -1
  191. package/lib/cjs/apis/tenants.js +0 -78
  192. package/lib/cjs/apis/tenants.js.map +0 -1
  193. package/lib/cjs/apis/users.js +0 -24
  194. package/lib/cjs/apis/users.js.map +0 -1
  195. package/lib/cjs/apis/vehicles.js +0 -183
  196. package/lib/cjs/apis/vehicles.js.map +0 -1
  197. package/lib/cjs/constants.js +0 -940
  198. package/lib/cjs/constants.js.map +0 -1
  199. package/lib/cjs/ddb-entities.js +0 -5
  200. package/lib/cjs/ddb-entities.js.map +0 -1
  201. package/lib/cjs/types/activities.js +0 -16
  202. package/lib/cjs/types/activities.js.map +0 -1
  203. package/lib/cjs/types/comparables.js +0 -3
  204. package/lib/cjs/types/crm.js +0 -19
  205. package/lib/cjs/types/crm.js.map +0 -1
  206. package/lib/cjs/types/definitions.js +0 -3
  207. package/lib/cjs/types/definitions.js.map +0 -1
  208. package/lib/cjs/types/delivery-settings.js +0 -9
  209. package/lib/cjs/types/delivery-settings.js.map +0 -1
  210. package/lib/cjs/types/documents.js +0 -9
  211. package/lib/cjs/types/documents.js.map +0 -1
  212. package/lib/cjs/types/events.js +0 -10
  213. package/lib/cjs/types/events.js.map +0 -1
  214. package/lib/cjs/types/fields.js +0 -29
  215. package/lib/cjs/types/fields.js.map +0 -1
  216. package/lib/cjs/types/insights.js +0 -3
  217. package/lib/cjs/types/insights.js.map +0 -1
  218. package/lib/cjs/types/interests.js +0 -10
  219. package/lib/cjs/types/interests.js.map +0 -1
  220. package/lib/cjs/types/internet-opportunities.js +0 -3
  221. package/lib/cjs/types/internet-opportunities.js.map +0 -1
  222. package/lib/cjs/types/internet-vehicles.js +0 -3
  223. package/lib/cjs/types/internet-vehicles.js.map +0 -1
  224. package/lib/cjs/types/leasing-administration.js +0 -3
  225. package/lib/cjs/types/leasing-administration.js.map +0 -1
  226. package/lib/cjs/types/leasing-debtors.js +0 -3
  227. package/lib/cjs/types/leasing-debtors.js.map +0 -1
  228. package/lib/cjs/types/leasing-search.js +0 -3
  229. package/lib/cjs/types/leasing-search.js.map +0 -1
  230. package/lib/cjs/types/leasing-settings.js +0 -10
  231. package/lib/cjs/types/leasing.js +0 -33
  232. package/lib/cjs/types/leasing.js.map +0 -1
  233. package/lib/cjs/types/machines.js +0 -3
  234. package/lib/cjs/types/opportunities.js +0 -95
  235. package/lib/cjs/types/opportunities.js.map +0 -1
  236. package/lib/cjs/types/payments.js +0 -10
  237. package/lib/cjs/types/payments.js.map +0 -1
  238. package/lib/cjs/types/picklists.js +0 -3
  239. package/lib/cjs/types/picklists.js.map +0 -1
  240. package/lib/cjs/types/quote-settings.js +0 -3
  241. package/lib/cjs/types/quote-settings.js.map +0 -1
  242. package/lib/cjs/types/quotes.js +0 -45
  243. package/lib/cjs/types/quotes.js.map +0 -1
  244. package/lib/cjs/types/recently-viewed.js +0 -3
  245. package/lib/cjs/types/recently-viewed.js.map +0 -1
  246. package/lib/cjs/types/reservations.js +0 -8
  247. package/lib/cjs/types/reservations.js.map +0 -1
  248. package/lib/cjs/types/roi-ratings.js +0 -8
  249. package/lib/cjs/types/roi-ratings.js.map +0 -1
  250. package/lib/cjs/types/saved-filters.js +0 -12
  251. package/lib/cjs/types/search.js +0 -36
  252. package/lib/cjs/types/search.js.map +0 -1
  253. package/lib/cjs/types/settings.js +0 -3
  254. package/lib/cjs/types/storage.js +0 -5
  255. package/lib/cjs/types/storage.js.map +0 -1
  256. package/lib/cjs/types/templates.js +0 -3
  257. package/lib/cjs/types/tenants.js +0 -19
  258. package/lib/cjs/types/tenants.js.map +0 -1
  259. package/lib/cjs/types/users.js +0 -3
  260. package/lib/cjs/types/utils.js +0 -9
  261. package/lib/cjs/types/utils.js.map +0 -1
  262. package/lib/cjs/types/vehicles.js +0 -63
  263. package/lib/cjs/types/vehicles.js.map +0 -1
  264. package/lib/cjs/types/website.js +0 -3
  265. package/lib/cjs/utils/forms.js +0 -31
  266. package/lib/cjs/utils/forms.js.map +0 -1
  267. package/lib/cjs/utils/leasing.js +0 -8
  268. package/lib/cjs/utils/leasing.js.map +0 -1
  269. package/lib/cjs/utils/opportunities.js +0 -60
  270. package/lib/cjs/utils/opportunities.js.map +0 -1
  271. package/lib/cjs/utils/slug.js +0 -21
  272. package/lib/cjs/utils/slug.js.map +0 -1
  273. package/lib/cjs/utils/tenants.js +0 -21
  274. package/lib/cjs/utils/tenants.js.map +0 -1
  275. package/lib/cjs/utils/vehicles.js +0 -60
  276. package/lib/cjs/utils/vehicles.js.map +0 -1
  277. package/lib/esm/apis/crm.js.map +0 -1
  278. package/lib/esm/apis/documents.js +0 -49
  279. package/lib/esm/apis/documents.js.map +0 -1
  280. package/lib/esm/apis/internet-vehicles.js.map +0 -1
  281. package/lib/esm/apis/leasing-administration.js.map +0 -1
  282. package/lib/esm/apis/leasing.js.map +0 -1
  283. package/lib/esm/apis/opportunities.js.map +0 -1
  284. package/lib/esm/apis/picklists.js.map +0 -1
  285. package/lib/esm/apis/tenants.js.map +0 -1
  286. package/lib/esm/apis/users.js.map +0 -1
  287. package/lib/esm/apis/vehicles.js.map +0 -1
  288. package/lib/esm/constants.js.map +0 -1
  289. package/lib/esm/types/comparables.js.map +0 -1
  290. package/lib/esm/types/crm.js.map +0 -1
  291. package/lib/esm/types/definitions.js.map +0 -1
  292. package/lib/esm/types/delivery-settings.js.map +0 -1
  293. package/lib/esm/types/documents.js +0 -6
  294. package/lib/esm/types/documents.js.map +0 -1
  295. package/lib/esm/types/insights.js.map +0 -1
  296. package/lib/esm/types/interests.js.map +0 -1
  297. package/lib/esm/types/internet-opportunities.js.map +0 -1
  298. package/lib/esm/types/internet-vehicles.js.map +0 -1
  299. package/lib/esm/types/leasing-administration.js.map +0 -1
  300. package/lib/esm/types/leasing-debtors.js.map +0 -1
  301. package/lib/esm/types/leasing-search.js.map +0 -1
  302. package/lib/esm/types/leasing-settings.js.map +0 -1
  303. package/lib/esm/types/leasing.js.map +0 -1
  304. package/lib/esm/types/machines.js.map +0 -1
  305. package/lib/esm/types/opportunities.js.map +0 -1
  306. package/lib/esm/types/picklists.js.map +0 -1
  307. package/lib/esm/types/quote-settings.js.map +0 -1
  308. package/lib/esm/types/quotes.js.map +0 -1
  309. package/lib/esm/types/recently-viewed.js.map +0 -1
  310. package/lib/esm/types/roi-ratings.js.map +0 -1
  311. package/lib/esm/types/saved-filters.js.map +0 -1
  312. package/lib/esm/types/search.js.map +0 -1
  313. package/lib/esm/types/settings.js.map +0 -1
  314. package/lib/esm/types/storage.js +0 -2
  315. package/lib/esm/types/storage.js.map +0 -1
  316. package/lib/esm/types/templates.js.map +0 -1
  317. package/lib/esm/types/tenants.js.map +0 -1
  318. package/lib/esm/types/users.js.map +0 -1
  319. package/lib/esm/types/utils.js.map +0 -1
  320. package/lib/esm/types/vehicles.js.map +0 -1
  321. package/lib/esm/types/website.js.map +0 -1
  322. package/lib/esm/utils/forms.js.map +0 -1
  323. package/lib/esm/utils/leasing.js +0 -4
  324. package/lib/esm/utils/leasing.js.map +0 -1
  325. package/lib/esm/utils/opportunities.js.map +0 -1
  326. package/lib/esm/utils/slug.js.map +0 -1
  327. package/lib/esm/utils/tenants.js.map +0 -1
  328. package/lib/esm/utils/vehicles.js.map +0 -1
  329. package/lib/tsconfig.cjs.tsbuildinfo +0 -1
  330. package/lib/tsconfig.esm.tsbuildinfo +0 -1
  331. package/lib/types/apis/crm.d.ts.map +0 -1
  332. package/lib/types/apis/documents.d.ts +0 -4
  333. package/lib/types/apis/documents.d.ts.map +0 -1
  334. package/lib/types/apis/opportunities.d.ts.map +0 -1
  335. package/lib/types/apis/picklists.d.ts.map +0 -1
  336. package/lib/types/constants.d.ts.map +0 -1
  337. package/lib/types/types/crm.d.ts.map +0 -1
  338. package/lib/types/types/delivery-settings.d.ts.map +0 -1
  339. package/lib/types/types/documents.d.ts +0 -140
  340. package/lib/types/types/documents.d.ts.map +0 -1
  341. package/lib/types/types/insights.d.ts.map +0 -1
  342. package/lib/types/types/interests.d.ts.map +0 -1
  343. package/lib/types/types/internet-opportunities.d.ts.map +0 -1
  344. package/lib/types/types/internet-vehicles.d.ts.map +0 -1
  345. package/lib/types/types/leasing-administration.d.ts.map +0 -1
  346. package/lib/types/types/leasing-search.d.ts.map +0 -1
  347. package/lib/types/types/leasing-settings.d.ts.map +0 -1
  348. package/lib/types/types/opportunities.d.ts.map +0 -1
  349. package/lib/types/types/picklists.d.ts.map +0 -1
  350. package/lib/types/types/quotes.d.ts.map +0 -1
  351. package/lib/types/types/recently-viewed.d.ts.map +0 -1
  352. package/lib/types/types/roi-ratings.d.ts.map +0 -1
  353. package/lib/types/types/saved-filters.d.ts.map +0 -1
  354. package/lib/types/types/search.d.ts.map +0 -1
  355. package/lib/types/types/storage.d.ts +0 -2
  356. package/lib/types/types/storage.d.ts.map +0 -1
  357. package/lib/types/types/tenants.d.ts.map +0 -1
  358. package/lib/types/types/utils.d.ts.map +0 -1
  359. package/lib/types/utils/leasing.d.ts.map +0 -1
  360. package/lib/types/utils/slug.d.ts +0 -3
  361. package/src/apis/documents.ts +0 -64
  362. package/src/types/documents.ts +0 -141
  363. package/src/types/storage.ts +0 -1
  364. package/tsconfig.cjs.json +0 -9
  365. package/tsconfig.esm.json +0 -9
  366. /package/lib/{esm/apis → apis}/internet-vehicles.js +0 -0
  367. /package/lib/{esm/apis → apis}/leasing-administration.js +0 -0
  368. /package/lib/{esm/apis → apis}/leasing.js +0 -0
  369. /package/lib/{esm/apis → apis}/tenants.js +0 -0
  370. /package/lib/{esm/apis → apis}/users.js +0 -0
  371. /package/lib/{esm/apis → apis}/vehicles.js +0 -0
  372. /package/lib/{types/ddb-entities.d.ts → ddb-entities.d.ts} +0 -0
  373. /package/lib/{types/ddb-entities.d.ts.map → ddb-entities.d.ts.map} +0 -0
  374. /package/lib/{esm/ddb-entities.js → ddb-entities.js} +0 -0
  375. /package/lib/{esm/ddb-entities.js.map → ddb-entities.js.map} +0 -0
  376. /package/lib/types/{types/activities.d.ts → activities.d.ts} +0 -0
  377. /package/lib/types/{types/activities.d.ts.map → activities.d.ts.map} +0 -0
  378. /package/lib/{esm/types → types}/activities.js +0 -0
  379. /package/lib/{esm/types → types}/activities.js.map +0 -0
  380. /package/lib/types/{types/comparables.d.ts → comparables.d.ts} +0 -0
  381. /package/lib/types/{types/comparables.d.ts.map → comparables.d.ts.map} +0 -0
  382. /package/lib/{esm/types → types}/comparables.js +0 -0
  383. /package/lib/{cjs/types → types}/comparables.js.map +0 -0
  384. /package/lib/{esm/types → types}/crm.js +0 -0
  385. /package/lib/{esm/types → types}/definitions.js +0 -0
  386. /package/lib/{esm/types → types}/delivery-settings.js +0 -0
  387. /package/lib/types/{types/events.d.ts → events.d.ts} +0 -0
  388. /package/lib/types/{types/events.d.ts.map → events.d.ts.map} +0 -0
  389. /package/lib/{esm/types → types}/events.js +0 -0
  390. /package/lib/{esm/types → types}/events.js.map +0 -0
  391. /package/lib/types/{types/fields.d.ts → fields.d.ts} +0 -0
  392. /package/lib/types/{types/fields.d.ts.map → fields.d.ts.map} +0 -0
  393. /package/lib/{esm/types → types}/fields.js +0 -0
  394. /package/lib/{esm/types → types}/fields.js.map +0 -0
  395. /package/lib/{esm/types → types}/insights.js +0 -0
  396. /package/lib/{esm/types → types}/interests.js +0 -0
  397. /package/lib/{esm/types → types}/internet-opportunities.js +0 -0
  398. /package/lib/{esm/types → types}/internet-vehicles.js +0 -0
  399. /package/lib/{esm/types → types}/leasing-administration.js +0 -0
  400. /package/lib/{esm/types → types}/leasing-debtors.js +0 -0
  401. /package/lib/{esm/types → types}/leasing-search.js +0 -0
  402. /package/lib/{esm/types → types}/leasing-settings.js +0 -0
  403. /package/lib/{esm/types → types}/leasing.js +0 -0
  404. /package/lib/types/{types/machines.d.ts → machines.d.ts} +0 -0
  405. /package/lib/types/{types/machines.d.ts.map → machines.d.ts.map} +0 -0
  406. /package/lib/{esm/types → types}/machines.js +0 -0
  407. /package/lib/{cjs/types → types}/machines.js.map +0 -0
  408. /package/lib/{esm/types → types}/opportunities.js +0 -0
  409. /package/lib/types/{types/payments.d.ts → payments.d.ts} +0 -0
  410. /package/lib/types/{types/payments.d.ts.map → payments.d.ts.map} +0 -0
  411. /package/lib/{esm/types → types}/payments.js +0 -0
  412. /package/lib/{esm/types → types}/payments.js.map +0 -0
  413. /package/lib/{esm/types → types}/picklists.js +0 -0
  414. /package/lib/{esm/types → types}/quote-settings.js +0 -0
  415. /package/lib/{esm/types → types}/quotes.js +0 -0
  416. /package/lib/{esm/types → types}/recently-viewed.js +0 -0
  417. /package/lib/types/{types/reservations.d.ts → reservations.d.ts} +0 -0
  418. /package/lib/types/{types/reservations.d.ts.map → reservations.d.ts.map} +0 -0
  419. /package/lib/{esm/types → types}/reservations.js +0 -0
  420. /package/lib/{esm/types → types}/reservations.js.map +0 -0
  421. /package/lib/{esm/types → types}/roi-ratings.js +0 -0
  422. /package/lib/{esm/types → types}/saved-filters.js +0 -0
  423. /package/lib/{esm/types → types}/search.js +0 -0
  424. /package/lib/types/{types/settings.d.ts → settings.d.ts} +0 -0
  425. /package/lib/types/{types/settings.d.ts.map → settings.d.ts.map} +0 -0
  426. /package/lib/{esm/types → types}/settings.js +0 -0
  427. /package/lib/{cjs/types → types}/settings.js.map +0 -0
  428. /package/lib/types/{types/templates.d.ts → templates.d.ts} +0 -0
  429. /package/lib/types/{types/templates.d.ts.map → templates.d.ts.map} +0 -0
  430. /package/lib/{esm/types → types}/templates.js +0 -0
  431. /package/lib/{cjs/types → types}/templates.js.map +0 -0
  432. /package/lib/{esm/types → types}/tenants.js +0 -0
  433. /package/lib/types/{types/users.d.ts → users.d.ts} +0 -0
  434. /package/lib/types/{types/users.d.ts.map → users.d.ts.map} +0 -0
  435. /package/lib/{esm/types → types}/users.js +0 -0
  436. /package/lib/{cjs/types → types}/users.js.map +0 -0
  437. /package/lib/{esm/types → types}/utils.js +0 -0
  438. /package/lib/{esm/types → types}/vehicles.js +0 -0
  439. /package/lib/types/{types/website.d.ts → website.d.ts} +0 -0
  440. /package/lib/types/{types/website.d.ts.map → website.d.ts.map} +0 -0
  441. /package/lib/{esm/types → types}/website.js +0 -0
  442. /package/lib/{cjs/types → types}/website.js.map +0 -0
@@ -2,8 +2,8 @@ import { SERVICE_ID_ADMIN_HEADER, TENANT_ID_ADMIN_HEADER } from '@bisondesk/comm
2
2
  import { XError } from '@bisondesk/commons-sdk/errors';
3
3
  import { cleanHeaders, fetchJson, getAdminAuth } from '@bisondesk/commons-sdk/fetch';
4
4
  import fetch, { Response } from 'node-fetch';
5
- import { DataRecord } from '../types/utils';
6
- import { NewVehicle, Vehicle, VehicleMarketing, VehiclePurchase } from '../types/vehicles';
5
+ import { DataRecord } from '../types/utils.js';
6
+ import { NewVehicle, Vehicle, VehicleMarketing, VehiclePurchase } from '../types/vehicles.js';
7
7
 
8
8
  export const getVehicle = async (
9
9
  tenantId: string,
@@ -21,7 +21,7 @@ export const getVehicle = async (
21
21
  );
22
22
 
23
23
  if (response.ok) {
24
- return response.status === 200 ? response.json() : undefined;
24
+ return response.status === 200 ? (response.json() as any) : undefined;
25
25
  }
26
26
 
27
27
  const body = await response.text();
@@ -57,7 +57,7 @@ export const getVehiclePurchase = async (
57
57
  );
58
58
 
59
59
  if (response.ok) {
60
- return response.status === 200 ? response.json() : undefined;
60
+ return response.status === 200 ? (response.json() as any) : undefined;
61
61
  }
62
62
 
63
63
  const body = await response.text();
@@ -80,7 +80,7 @@ export const getVehicleByStockNumber = async (
80
80
  );
81
81
 
82
82
  if (response.ok) {
83
- return response.status === 200 ? response.json() : undefined;
83
+ return response.status === 200 ? (response.json() as any) : undefined;
84
84
  }
85
85
 
86
86
  const body = await response.text();
@@ -103,7 +103,7 @@ export const getVehicleByPurchaseStockNumber = async (
103
103
  );
104
104
 
105
105
  if (response.ok) {
106
- return response.status === 200 ? response.json() : undefined;
106
+ return response.status === 200 ? (response.json() as any) : undefined;
107
107
  }
108
108
 
109
109
  const body = await response.text();
@@ -129,7 +129,7 @@ export const listVehiclesMarketing = async (
129
129
  );
130
130
 
131
131
  if (response.ok) {
132
- return response.status === 200 ? response.json() : undefined;
132
+ return response.status === 200 ? (response.json() as any) : undefined;
133
133
  }
134
134
 
135
135
  const body = await response.text();
@@ -152,7 +152,7 @@ export const getVehicleMarketing = async (
152
152
  );
153
153
 
154
154
  if (response.ok) {
155
- return response.status === 200 ? response.json() : undefined;
155
+ return response.status === 200 ? (response.json() as any) : undefined;
156
156
  }
157
157
 
158
158
  const body = await response.text();
@@ -180,7 +180,7 @@ export const saveMarketing = async (
180
180
  );
181
181
 
182
182
  if (response.ok) {
183
- return response.json();
183
+ return response.json() as any;
184
184
  }
185
185
  const body = await response.text();
186
186
  throw new XError(response.statusText, { body, tenantId, vehicleId, marketing });
@@ -208,7 +208,7 @@ export const saveVehiclePurchase = async (
208
208
  );
209
209
 
210
210
  if (response.ok) {
211
- return response.json();
211
+ return response.json() as any;
212
212
  }
213
213
  const body = await response.text();
214
214
  throw new XError(response.statusText, { body, tenantId, vehicleId, purchase, opts });
@@ -232,7 +232,7 @@ export const saveVehicle = async (
232
232
  });
233
233
 
234
234
  if (response.ok) {
235
- return response.json();
235
+ return response.json() as any;
236
236
  }
237
237
  const body = await response.text();
238
238
  throw new XError(response.statusText, { body, tenantId, vehicle, opts });
package/src/constants.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { VehicleAxle } from './types/vehicles';
1
+ import { VehicleAxle } from './types/vehicles.js';
2
2
 
3
3
  export { BusinessEntityIds } from '@bisondesk/commons-sdk/constants';
4
4
 
@@ -34,6 +34,8 @@ export const SHIPPING_COMPANIES_PICKLIST_ID = 'shippingCompanies';
34
34
  export const SLB_PARTNERS_PICKLIST_ID = 'slb_partners';
35
35
  export const PURCHASE_LOGISTICS_STATUS_PICKLIST_ID = 'purchaseLogisticsStatus';
36
36
  export const QUOTE_STATUS_PICKLIST_ID = 'quoteStatus';
37
+ export const DOCUMENT_CATEGORIES_PICKLIST_ID = 'documentCategories';
38
+ export const DOCUMENT_LINE_CATEGORIES_PICKLIST_ID = 'documentLineCategories';
37
39
 
38
40
  export const PICKLIST_FALLBACK_LOCALE = 'en';
39
41
 
package/src/types/crm.ts CHANGED
@@ -5,9 +5,9 @@ import {
5
5
  PhoneNumberValue,
6
6
  SearchPermissions,
7
7
  } from '@bisondesk/commons-sdk/types';
8
- import { PublicSearchDefinition } from './definitions';
9
- import { LeasingContract } from './leasing';
10
- import { ReferenceData } from './utils';
8
+ import { PublicSearchDefinition } from './definitions.js';
9
+ import { LeasingContract } from './leasing.js';
10
+ import { ReferenceData } from './utils.js';
11
11
 
12
12
  export type CrmEvent = CrmOrganizationEvent | CrmContactEvent;
13
13
 
@@ -41,11 +41,14 @@ type BaseOrganization = {
41
41
  transport?: LocationValue;
42
42
  };
43
43
  accountManagers: string[];
44
+ conglomerate?: boolean;
45
+ riskTags?: string[];
46
+
47
+ // billing
44
48
  billingEmails?: string[];
49
+ billingPhone?: string;
45
50
  skipPaymentReminders?: boolean;
46
51
  trustworthy?: boolean;
47
- conglomerate?: boolean;
48
- riskTags?: string[];
49
52
  };
50
53
 
51
54
  export type NewOrganization = BaseOrganization & {
@@ -1,6 +1,6 @@
1
1
  import { SUPPORTED_LANGUAGES } from '@bisondesk/commons-sdk/constants';
2
- import { FieldTypeInfo } from './fields';
3
- import { Aggregation } from './search';
2
+ import { FieldTypeInfo } from './fields.js';
3
+ import { Aggregation } from './search.js';
4
4
 
5
5
  //
6
6
  // These definitions are sent to the UI
@@ -1,7 +1,7 @@
1
1
  import { LocationValue } from '@bisondesk/commons-sdk/types';
2
- import { Categories } from '../constants';
2
+ import { Categories } from '../constants.js';
3
3
 
4
- export const enum TransitPlateCountries {
4
+ export enum TransitPlateCountries {
5
5
  BE = 'be',
6
6
  AT = 'at',
7
7
  }
@@ -1,5 +1,5 @@
1
- import { ComparableSpecs } from './comparables';
2
- import { ReferenceData } from './utils';
1
+ import { ComparableSpecs } from './comparables.js';
2
+ import { ReferenceData } from './utils.js';
3
3
 
4
4
  export type SimilarVehiclesRequest = {
5
5
  offset: number;
@@ -1,5 +1,5 @@
1
- import { ComparableSpecs } from './comparables';
2
- import { ReferenceData } from './utils';
1
+ import { ComparableSpecs } from './comparables.js';
2
+ import { ReferenceData } from './utils.js';
3
3
 
4
4
  export enum InterestActions {
5
5
  SET_INTEREST = 'set_interest',
@@ -1,5 +1,5 @@
1
1
  import { PhoneNumberValue } from '@bisondesk/commons-sdk/types';
2
- import { OpportunityType } from '../constants';
2
+ import { OpportunityType } from '../constants.js';
3
3
 
4
4
  type BaseInternetOpportunity = {
5
5
  // ids
@@ -20,16 +20,19 @@ type BaseInternetOpportunity = {
20
20
  lastName?: string;
21
21
  message?: string;
22
22
  name: string;
23
- platformEmail?: string;
24
23
  source: string;
25
24
  stockNumber?: string;
26
25
  type?: OpportunityType;
26
+ vehicleBid?: string;
27
27
  };
28
28
 
29
29
  export type InternetOpportunityEvent = BaseInternetOpportunity & {
30
30
  phoneNumber?: string;
31
+ replyToEmail?: string;
32
+ fromEmail?: string;
31
33
  };
32
34
 
33
35
  export type InternetOpportunity = BaseInternetOpportunity & {
36
+ platformEmail?: string;
34
37
  phoneNumber?: PhoneNumberValue;
35
38
  };
@@ -1,7 +1,7 @@
1
1
  import { LocationValue, PhoneNumberValue } from '@bisondesk/commons-sdk/types';
2
- import { PublicSearchDefinition } from './definitions';
3
- import { AggregationRequest } from './search';
4
- import { Vehicle } from './vehicles';
2
+ import { PublicSearchDefinition } from './definitions.js';
3
+ import { AggregationRequest } from './search.js';
4
+ import { Vehicle } from './vehicles.js';
5
5
 
6
6
  export type InternetVehicleInternalInfo = {
7
7
  createdAt: string;
@@ -1,5 +1,5 @@
1
1
  import { AttachmentValue } from '@bisondesk/commons-sdk/types';
2
- import { LeasingAdminUploadHandlers } from '../constants';
2
+ import { LeasingAdminUploadHandlers } from '../constants.js';
3
3
 
4
4
  export type LeasingAdminUploadStatus = 'success' | 'processing' | 'error';
5
5
 
@@ -70,7 +70,8 @@ export type INGMetadata = {
70
70
  interest: string;
71
71
  invoiceDate: string;
72
72
  invoiceNumber: string;
73
- pdfUrl: string;
73
+ pdfUrl: string; // data url
74
+ pdfFilename?: string;
74
75
  stockNumber: string;
75
76
  yearlyFee?: string;
76
77
  };
@@ -1,4 +1,4 @@
1
- import { Contact, Organization } from './crm';
1
+ import { Contact, Organization } from './crm.js';
2
2
 
3
3
  export type MonthData = {
4
4
  activeContractIds: string[];
@@ -1,9 +1,9 @@
1
1
  import { InsuranceEntry } from '@bisondesk/commons-sdk/insurance';
2
2
  import { SearchPermissions } from '@bisondesk/commons-sdk/types';
3
- import { Contact, Organization } from './crm';
4
- import { PublicSearchDefinition } from './definitions';
5
- import { LeasingContract } from './leasing';
6
- import { Vehicle } from './vehicles';
3
+ import { Contact, Organization } from './crm.js';
4
+ import { PublicSearchDefinition } from './definitions.js';
5
+ import { LeasingContract } from './leasing.js';
6
+ import { Vehicle } from './vehicles.js';
7
7
 
8
8
  export type LeasingPublicSearchDefinitions = {
9
9
  searchLeasingContract: PublicSearchDefinition;
@@ -1,6 +1,6 @@
1
1
  import { MultiLangValue } from '@bisondesk/commons-sdk/types';
2
- import { Categories, OpportunityType } from '../constants';
3
- import { SortFilter } from './search';
2
+ import { Categories, OpportunityType } from '../constants.js';
3
+ import { SortFilter } from './search.js';
4
4
 
5
5
  type BaseQuoteExtraSettings = {
6
6
  referenceCode: string;
@@ -1,7 +1,7 @@
1
1
  import { EmailMessage } from '@bisondesk/commons-sdk/messages';
2
2
  import { AttachmentValue, Document, LinkValue, PaginatedList } from '@bisondesk/commons-sdk/types';
3
- import { SortFilter } from './search';
4
- import { ReferenceData } from './utils';
3
+ import { SortFilter } from './search.js';
4
+ import { ReferenceData } from './utils.js';
5
5
 
6
6
  export enum LeasingContractActions {
7
7
  CREATE_FINANCE_DOCUMENT = 'create_finance_document',
@@ -392,3 +392,19 @@ export enum LEASING_EXPORT_TYPES {
392
392
  RENTAL_SOLUTIONS = 'rental-solutions',
393
393
  DEFAULT = 'default',
394
394
  }
395
+
396
+ export type NewExistingLeasingFinanceDocument = {
397
+ id?: undefined;
398
+ type: 'Sale Finance';
399
+ subtype: 'Invoice' | 'Credit Note';
400
+ issueDate: string;
401
+ contractId: string;
402
+ amount: string;
403
+ paidAt?: string;
404
+ dueDate?: string;
405
+ attachment: AttachmentValue;
406
+ invoiceNumber: string;
407
+ vatPercentage: string;
408
+ period: string;
409
+ description: string;
410
+ };
@@ -1,13 +1,13 @@
1
1
  import { Document, NextList } from '@bisondesk/commons-sdk/types';
2
- import { BusinessEntityIds, OpportunityType, WarningHints } from '../constants';
3
- import { Contact, Organization } from './crm';
4
- import type { InterestBffMeta, OpportunityInterest } from './interests';
5
- import { Payment } from './payments';
6
- import { Quote, QuoteStatus } from './quotes';
7
- import { OpportunityReservation } from './reservations';
8
- import { BaseSearchRequest } from './search';
9
- import { DataRecord, ReferenceData } from './utils';
10
- import { Vehicle } from './vehicles';
2
+ import { BusinessEntityIds, OpportunityType, WarningHints } from '../constants.js';
3
+ import { Contact, Organization } from './crm.js';
4
+ import type { InterestBffMeta, OpportunityInterest } from './interests.js';
5
+ import { Payment } from './payments.js';
6
+ import { Quote, QuoteStatus } from './quotes.js';
7
+ import { OpportunityReservation } from './reservations.js';
8
+ import { BaseSearchRequest } from './search.js';
9
+ import { DataRecord, ReferenceData } from './utils.js';
10
+ import { Vehicle } from './vehicles.js';
11
11
 
12
12
  export enum OpportunityActions {
13
13
  ADD_COMMISSION = 'add_commission',
@@ -228,6 +228,10 @@ export type OpportunityBffMeta = ReferenceData & {
228
228
  warnings: OpportunityWarning[];
229
229
  };
230
230
 
231
+ export type ContactMetdata = {
232
+ openOpportunities: number;
233
+ };
234
+
231
235
  export type OpportunityBFF = {
232
236
  opportunity: DataRecord<Opportunity, OpportunityBffMeta>;
233
237
  vehicle?: DataRecord<Vehicle, VehicleBffMetadata>;
@@ -238,7 +242,7 @@ export type OpportunityBFF = {
238
242
  payments: PaymentSummary | undefined;
239
243
  reservation?: DataRecord<OpportunityReservation>;
240
244
  customer?: {
241
- contact: DataRecord<Contact>;
245
+ contact: DataRecord<Contact, ContactMetdata>;
242
246
  org?: DataRecord<Organization>;
243
247
  };
244
248
  };
@@ -3,6 +3,7 @@ import { MultiLangValue } from '@bisondesk/commons-sdk/types';
3
3
  export type PicklistValueUpdateRequest = {
4
4
  picklistId: string;
5
5
  value: PicklistValue | NewPicklistValue;
6
+ tenantId?: string;
6
7
  };
7
8
 
8
9
  export type NewPicklistValue<T = Record<string, string>> = {
@@ -57,6 +58,12 @@ export type PicklistOptionsRequest = {
57
58
  lang: string;
58
59
  };
59
60
 
61
+ export type PicklistUpsertValueRequest = {
62
+ tenantId?: string;
63
+ picklistId: string;
64
+ value: PicklistValue | NewPicklistValue;
65
+ };
66
+
60
67
  export type QuickAddPicklistValue = {
61
68
  sortPriority?: number;
62
69
  titles: MultiLangValue;
@@ -1,4 +1,4 @@
1
- import { DeliveryParams } from './delivery-settings';
1
+ import { DeliveryParams } from './delivery-settings.js';
2
2
 
3
3
  export type UsedVehiclesSalesParams = BaseQuoteSettings & {
4
4
  modifiedBy: string;
@@ -1,14 +1,14 @@
1
1
  import { AttachmentValue, LocationValue } from '@bisondesk/commons-sdk/types';
2
- import { OpportunityType } from '../constants';
2
+ import { OpportunityType } from '../constants.js';
3
3
  import {
4
4
  CustomLeasingQuoteExtraInput,
5
5
  CustomSalesQuoteExtraInput,
6
6
  LeasingDeliveryPackageInput,
7
7
  LeasingQuoteExtraInput,
8
8
  SalesQuoteExtraInput,
9
- } from './leasing-settings';
10
- import { MatchingRuleValue } from './roi-ratings';
11
- import { PricePercentageMode } from './utils';
9
+ } from './leasing-settings.js';
10
+ import { MatchingRuleValue } from './roi-ratings.js';
11
+ import { PricePercentageMode } from './utils.js';
12
12
 
13
13
  export enum QuoteActions {
14
14
  ACCEPT = 'accept',
@@ -1,5 +1,5 @@
1
1
  import { AttachmentValue, Requester } from '@bisondesk/commons-sdk/types';
2
- import { BusinessEntityIds } from '../constants';
2
+ import { BusinessEntityIds } from '../constants.js';
3
3
 
4
4
  export type ViewedItemsRequest = {
5
5
  businessEntity?: string;
@@ -1,6 +1,6 @@
1
- import { AdditionalOperation, RulesLogic } from 'json-logic-js';
2
- import { OpportunityType } from '../constants';
3
- import { FieldTypeInfo } from './fields';
1
+ import type { AdditionalOperation, RulesLogic } from 'json-logic-js';
2
+ import { OpportunityType } from '../constants.js';
3
+ import { FieldTypeInfo } from './fields.js';
4
4
 
5
5
  export enum DisplayType {
6
6
  StarsRating = 'stars-rating',
@@ -1,5 +1,5 @@
1
- import { BusinessEntityIds } from '../constants';
2
- import { ComplexFilter } from './search';
1
+ import { BusinessEntityIds } from '../constants.js';
2
+ import { ComplexFilter } from './search.js';
3
3
 
4
4
  type SavedFilterQuery = {
5
5
  conditions: {
@@ -2,9 +2,9 @@
2
2
  // Generic stuff
3
3
  ///////////////////////////////////////////////////////
4
4
 
5
- import { SUPPORTED_LANGUAGES } from '@bisondesk/commons-sdk/constants';
5
+ import { BusinessEntityIds, SUPPORTED_LANGUAGES } from '@bisondesk/commons-sdk/constants';
6
6
  import { MultiLangValue } from '@bisondesk/commons-sdk/types';
7
- import { FieldTypes, NumberMeta } from './fields';
7
+ import { FieldTypes, NumberMeta } from './fields.js';
8
8
 
9
9
  export enum ConditionType {
10
10
  and = 'AND',
@@ -110,6 +110,28 @@ export type SearchRequest = {
110
110
  sortBy?: SortFilter[];
111
111
  } & (InfiniteSearchRequest | PaginatedSearchRequest);
112
112
 
113
+ export type GlobalSearchRequest = {
114
+ fullText: string;
115
+ limit: number;
116
+ } & {
117
+ entityIds: BusinessEntityIds[];
118
+ } & (InfiniteSearchRequest | PaginatedSearchRequest);
119
+
120
+ export type GlobalSearchResult = {
121
+ businessEntityId: BusinessEntityIds;
122
+ recordId: string;
123
+ title: string;
124
+ description: string;
125
+ tags?: string[];
126
+ };
127
+
128
+ export type GlobalSearchByIdRequest = {
129
+ ids: {
130
+ businessEntityId: BusinessEntityIds;
131
+ recordId: string;
132
+ }[];
133
+ };
134
+
113
135
  export type PublicSearchRequest = {
114
136
  limit: number;
115
137
  offset?: number;
@@ -1,5 +1,5 @@
1
1
  import { LocationValue, Region } from '@bisondesk/commons-sdk/types';
2
- import { OpportunityType } from '../constants';
2
+ import { OpportunityType } from '../constants.js';
3
3
 
4
4
  export type PublicTenant = {
5
5
  defaultCountry: string;
@@ -52,6 +52,7 @@ export type Branch = {
52
52
  currency: string;
53
53
  adminNumberPrefix: string;
54
54
  stockNumberPrefix: string;
55
+ vatNumber?: string;
55
56
  vatRates: {
56
57
  standard: string; //percentage value (e.g. 21)
57
58
  };
@@ -1,5 +1,5 @@
1
1
  import { MultiLangValue } from '@bisondesk/commons-sdk/types';
2
- import { AdHocPicklistValueDisplay } from './picklists';
2
+ import { AdHocPicklistValueDisplay } from './picklists.js';
3
3
 
4
4
  export type CountryInfo = {
5
5
  code: string; // code is ISO 3166-1 alpha-2
@@ -6,7 +6,7 @@ import {
6
6
  MultiLangValue,
7
7
  SearchPermissions,
8
8
  } from '@bisondesk/commons-sdk/types';
9
- import { OpportunityReservation } from './reservations';
9
+ import { OpportunityReservation } from './reservations.js';
10
10
 
11
11
  type BaseVehicleEvent = {
12
12
  id: string;
@@ -1,5 +1,5 @@
1
- import Decimal from 'decimal.js';
2
- import { PricePercentageMode } from '../types/utils';
1
+ import { Decimal } from 'decimal.js';
2
+ import { PricePercentageMode } from '../types/utils.js';
3
3
 
4
4
  export const computePricePercentage = (
5
5
  totalAmount: string,
@@ -1,13 +1,14 @@
1
- import { utc } from '@bisondesk/commons-sdk/dayjs-utils';
2
- import { map, sortBy, uniqBy } from 'lodash';
3
- import { LeasingContractClient } from '../types/leasing';
1
+ import { UTCDate } from '@date-fns/utc';
2
+ import { format } from 'date-fns';
3
+ import { map, sortBy, uniqBy } from 'lodash-es';
4
+ import { LeasingContractClient } from '../types/leasing.js';
4
5
 
5
6
  /* sort from oldest to most recent client */
6
7
  export const sortContractClients = (clients: LeasingContractClient[]): LeasingContractClient[] =>
7
8
  sortBy(
8
9
  map(
9
10
  uniqBy(clients, (c) => c.takeoverId),
10
- (c) => ({ ...c, since: utc(c.since).format('YYYY-MM-DD') }) // doing a map to also fix legacy data
11
+ (c) => ({ ...c, since: format(new UTCDate(c.since), 'yyyy-MM-dd') }) // doing a map to also fix legacy data
11
12
  ),
12
13
  (cli) => cli.since,
13
14
  (cli) => (cli.takeoverId ? parseInt(cli.takeoverId.replace(/[^0-9]/g, '')) : 0)
@@ -1,4 +1,4 @@
1
- import { Opportunity, OpportunityStatus, OpportunityStatusOrder } from '../types/opportunities';
1
+ import { Opportunity, OpportunityStatus, OpportunityStatusOrder } from '../types/opportunities.js';
2
2
 
3
3
  type CompareInput = {
4
4
  currentStatus: OpportunityStatus;
@@ -0,0 +1,130 @@
1
+ import { joinWithSeparator } from '@bisondesk/commons-sdk/formatting';
2
+ import { BusinessEntityIds } from '../constants.js';
3
+ import { Contact, Organization, SearchOrganization } from '../types/crm.js';
4
+ import { SearchLeasingContract } from '../types/leasing-search.js';
5
+ import { LeasingContract } from '../types/leasing.js';
6
+ import { Opportunity, SearchOpportunity } from '../types/opportunities.js';
7
+ import { SearchVehicle, Vehicle } from '../types/vehicles.js';
8
+
9
+ export type GlobalBusinessEntity = Opportunity | Vehicle | Organization | LeasingContract;
10
+ export type GlobalSearchEntity =
11
+ | SearchOpportunity
12
+ | SearchVehicle
13
+ | SearchOrganization
14
+ | SearchLeasingContract;
15
+
16
+ export const getCustomerInformation = (org?: Organization, contact?: Contact) => {
17
+ if (org != null) {
18
+ return {
19
+ countryCode: org.countryCode,
20
+ title: org.name,
21
+ code: org.externalId,
22
+ };
23
+ }
24
+
25
+ if (contact != null) {
26
+ return {
27
+ countryCode: contact.countryCode,
28
+ title: [contact?.firstName, contact?.lastName].filter(Boolean).join(' '),
29
+ };
30
+ }
31
+ };
32
+
33
+ export const mappings: {
34
+ [key in BusinessEntityIds]?: {
35
+ getMainEntity: (entity: any) => GlobalBusinessEntity;
36
+ getTitle: (entity: any) => string;
37
+ getTags: (entity: any) => (string | undefined)[];
38
+ getDescription?: (entity: any) => string;
39
+ };
40
+ } = {
41
+ [BusinessEntityIds.Opportunities]: {
42
+ getMainEntity: (entity: SearchOpportunity) => entity.opportunity,
43
+ getTitle: (opp: Opportunity) => opp.id,
44
+ getDescription: (opp: SearchOpportunity) =>
45
+ joinWithSeparator(
46
+ [
47
+ getCustomerInformation(opp.org, opp.contact)?.code,
48
+ opp.vehicle?.external.identification.stockNumber,
49
+ ].filter(Boolean)
50
+ ),
51
+ getTags: (opp: Opportunity) => [opp.id],
52
+ },
53
+ [BusinessEntityIds.Vehicles]: {
54
+ getMainEntity: (entity: SearchVehicle) => entity.vehicle,
55
+ getTitle: (vehicle: Vehicle) => vehicle.internal.description.title,
56
+ getTags: (vehicle: Vehicle) => [
57
+ vehicle.external.identification?.stockNumber,
58
+ vehicle.internal.identification?.administrativeNumber,
59
+ ],
60
+ },
61
+ [BusinessEntityIds.Organizations]: {
62
+ getMainEntity: (entity: SearchOrganization) => entity.org,
63
+ getTitle: (org: Organization) => org.name,
64
+ getTags: (org: Organization) => [`${org.externalId}`, org.vatNumber],
65
+ },
66
+ [BusinessEntityIds.LeasingContracts]: {
67
+ getMainEntity: (entity: SearchLeasingContract) => entity.contract,
68
+ getTitle: (contract: LeasingContract) => contract.contractNumber ?? contract.id,
69
+ getTags: (contract: LeasingContract) => [contract.contractNumber, contract.slbPartner],
70
+ },
71
+ };
72
+
73
+ const getMapping = (businessEntityId: BusinessEntityIds) => {
74
+ const mapping = mappings[businessEntityId];
75
+ if (!mapping) {
76
+ throw new Error(`Invalid business entity id ${businessEntityId}`);
77
+ }
78
+ return mapping;
79
+ };
80
+
81
+ export const getTagsForBusinessEntity = (
82
+ businessEntityId: BusinessEntityIds,
83
+ entity: GlobalBusinessEntity
84
+ ): string[] => getMapping(businessEntityId).getTags(entity).filter(Boolean) as string[];
85
+
86
+ export const getTagsForSearchBusinessEntity = (
87
+ businessEntityId: BusinessEntityIds,
88
+ entity: GlobalSearchEntity
89
+ ) =>
90
+ getTagsForBusinessEntity(
91
+ businessEntityId,
92
+ getMainEntityFromSearchEntity(businessEntityId, entity)
93
+ );
94
+
95
+ export const getDescriptionForBusinessEntity = (
96
+ businessEntityId: BusinessEntityIds,
97
+ entity: GlobalBusinessEntity
98
+ ) => joinWithSeparator(getTagsForBusinessEntity(businessEntityId, entity));
99
+
100
+ export const getDescriptionForSearchBusinessEntity = (
101
+ businessEntityId: BusinessEntityIds,
102
+ entity: GlobalSearchEntity
103
+ ) => {
104
+ return (
105
+ getMapping(businessEntityId).getDescription?.(entity) ??
106
+ getDescriptionForBusinessEntity(
107
+ businessEntityId,
108
+ getMainEntityFromSearchEntity(businessEntityId, entity)
109
+ )
110
+ );
111
+ };
112
+
113
+ export const getMainEntityFromSearchEntity = (
114
+ businessEntityId: BusinessEntityIds,
115
+ entity: GlobalSearchEntity
116
+ ) => getMapping(businessEntityId).getMainEntity(entity);
117
+
118
+ export const getTitleForBusinessEntity = (
119
+ businessEntityId: BusinessEntityIds,
120
+ entity: GlobalBusinessEntity
121
+ ) => getMapping(businessEntityId).getTitle(entity);
122
+
123
+ export const getTitleForSearchBusinessEntity = (
124
+ businessEntityId: BusinessEntityIds,
125
+ searchEntity: GlobalSearchEntity
126
+ ) =>
127
+ getTitleForBusinessEntity(
128
+ businessEntityId,
129
+ getMainEntityFromSearchEntity(businessEntityId, searchEntity)
130
+ );