@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
@@ -0,0 +1,64 @@
1
+ import { joinWithSeparator } from '@bisondesk/commons-sdk/formatting';
2
+ import { BusinessEntityIds } from '../constants.js';
3
+ export const getCustomerInformation = (org, contact) => {
4
+ if (org != null) {
5
+ return {
6
+ countryCode: org.countryCode,
7
+ title: org.name,
8
+ code: org.externalId,
9
+ };
10
+ }
11
+ if (contact != null) {
12
+ return {
13
+ countryCode: contact.countryCode,
14
+ title: [contact?.firstName, contact?.lastName].filter(Boolean).join(' '),
15
+ };
16
+ }
17
+ };
18
+ export const mappings = {
19
+ [BusinessEntityIds.Opportunities]: {
20
+ getMainEntity: (entity) => entity.opportunity,
21
+ getTitle: (opp) => opp.id,
22
+ getDescription: (opp) => joinWithSeparator([
23
+ getCustomerInformation(opp.org, opp.contact)?.code,
24
+ opp.vehicle?.external.identification.stockNumber,
25
+ ].filter(Boolean)),
26
+ getTags: (opp) => [opp.id],
27
+ },
28
+ [BusinessEntityIds.Vehicles]: {
29
+ getMainEntity: (entity) => entity.vehicle,
30
+ getTitle: (vehicle) => vehicle.internal.description.title,
31
+ getTags: (vehicle) => [
32
+ vehicle.external.identification?.stockNumber,
33
+ vehicle.internal.identification?.administrativeNumber,
34
+ ],
35
+ },
36
+ [BusinessEntityIds.Organizations]: {
37
+ getMainEntity: (entity) => entity.org,
38
+ getTitle: (org) => org.name,
39
+ getTags: (org) => [`${org.externalId}`, org.vatNumber],
40
+ },
41
+ [BusinessEntityIds.LeasingContracts]: {
42
+ getMainEntity: (entity) => entity.contract,
43
+ getTitle: (contract) => contract.contractNumber ?? contract.id,
44
+ getTags: (contract) => [contract.contractNumber, contract.slbPartner],
45
+ },
46
+ };
47
+ const getMapping = (businessEntityId) => {
48
+ const mapping = mappings[businessEntityId];
49
+ if (!mapping) {
50
+ throw new Error(`Invalid business entity id ${businessEntityId}`);
51
+ }
52
+ return mapping;
53
+ };
54
+ export const getTagsForBusinessEntity = (businessEntityId, entity) => getMapping(businessEntityId).getTags(entity).filter(Boolean);
55
+ export const getTagsForSearchBusinessEntity = (businessEntityId, entity) => getTagsForBusinessEntity(businessEntityId, getMainEntityFromSearchEntity(businessEntityId, entity));
56
+ export const getDescriptionForBusinessEntity = (businessEntityId, entity) => joinWithSeparator(getTagsForBusinessEntity(businessEntityId, entity));
57
+ export const getDescriptionForSearchBusinessEntity = (businessEntityId, entity) => {
58
+ return (getMapping(businessEntityId).getDescription?.(entity) ??
59
+ getDescriptionForBusinessEntity(businessEntityId, getMainEntityFromSearchEntity(businessEntityId, entity)));
60
+ };
61
+ export const getMainEntityFromSearchEntity = (businessEntityId, entity) => getMapping(businessEntityId).getMainEntity(entity);
62
+ export const getTitleForBusinessEntity = (businessEntityId, entity) => getMapping(businessEntityId).getTitle(entity);
63
+ export const getTitleForSearchBusinessEntity = (businessEntityId, searchEntity) => getTitleForBusinessEntity(businessEntityId, getMainEntityFromSearchEntity(businessEntityId, searchEntity));
64
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"/","sources":["utils/search.ts"],"names":[],"mappings":"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","sourcesContent":["import { joinWithSeparator } from '@bisondesk/commons-sdk/formatting';\nimport { BusinessEntityIds } from '../constants.js';\nimport { Contact, Organization, SearchOrganization } from '../types/crm.js';\nimport { SearchLeasingContract } from '../types/leasing-search.js';\nimport { LeasingContract } from '../types/leasing.js';\nimport { Opportunity, SearchOpportunity } from '../types/opportunities.js';\nimport { SearchVehicle, Vehicle } from '../types/vehicles.js';\n\nexport type GlobalBusinessEntity = Opportunity | Vehicle | Organization | LeasingContract;\nexport type GlobalSearchEntity =\n | SearchOpportunity\n | SearchVehicle\n | SearchOrganization\n | SearchLeasingContract;\n\nexport const getCustomerInformation = (org?: Organization, contact?: Contact) => {\n if (org != null) {\n return {\n countryCode: org.countryCode,\n title: org.name,\n code: org.externalId,\n };\n }\n\n if (contact != null) {\n return {\n countryCode: contact.countryCode,\n title: [contact?.firstName, contact?.lastName].filter(Boolean).join(' '),\n };\n }\n};\n\nexport const mappings: {\n [key in BusinessEntityIds]?: {\n getMainEntity: (entity: any) => GlobalBusinessEntity;\n getTitle: (entity: any) => string;\n getTags: (entity: any) => (string | undefined)[];\n getDescription?: (entity: any) => string;\n };\n} = {\n [BusinessEntityIds.Opportunities]: {\n getMainEntity: (entity: SearchOpportunity) => entity.opportunity,\n getTitle: (opp: Opportunity) => opp.id,\n getDescription: (opp: SearchOpportunity) =>\n joinWithSeparator(\n [\n getCustomerInformation(opp.org, opp.contact)?.code,\n opp.vehicle?.external.identification.stockNumber,\n ].filter(Boolean)\n ),\n getTags: (opp: Opportunity) => [opp.id],\n },\n [BusinessEntityIds.Vehicles]: {\n getMainEntity: (entity: SearchVehicle) => entity.vehicle,\n getTitle: (vehicle: Vehicle) => vehicle.internal.description.title,\n getTags: (vehicle: Vehicle) => [\n vehicle.external.identification?.stockNumber,\n vehicle.internal.identification?.administrativeNumber,\n ],\n },\n [BusinessEntityIds.Organizations]: {\n getMainEntity: (entity: SearchOrganization) => entity.org,\n getTitle: (org: Organization) => org.name,\n getTags: (org: Organization) => [`${org.externalId}`, org.vatNumber],\n },\n [BusinessEntityIds.LeasingContracts]: {\n getMainEntity: (entity: SearchLeasingContract) => entity.contract,\n getTitle: (contract: LeasingContract) => contract.contractNumber ?? contract.id,\n getTags: (contract: LeasingContract) => [contract.contractNumber, contract.slbPartner],\n },\n};\n\nconst getMapping = (businessEntityId: BusinessEntityIds) => {\n const mapping = mappings[businessEntityId];\n if (!mapping) {\n throw new Error(`Invalid business entity id ${businessEntityId}`);\n }\n return mapping;\n};\n\nexport const getTagsForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n): string[] => getMapping(businessEntityId).getTags(entity).filter(Boolean) as string[];\n\nexport const getTagsForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) =>\n getTagsForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, entity)\n );\n\nexport const getDescriptionForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n) => joinWithSeparator(getTagsForBusinessEntity(businessEntityId, entity));\n\nexport const getDescriptionForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) => {\n return (\n getMapping(businessEntityId).getDescription?.(entity) ??\n getDescriptionForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, entity)\n )\n );\n};\n\nexport const getMainEntityFromSearchEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) => getMapping(businessEntityId).getMainEntity(entity);\n\nexport const getTitleForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n) => getMapping(businessEntityId).getTitle(entity);\n\nexport const getTitleForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n searchEntity: GlobalSearchEntity\n) =>\n getTitleForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, searchEntity)\n );\n"]}
@@ -0,0 +1,3 @@
1
+ import { Vehicle } from '../types/vehicles.js';
2
+ export declare const getVehicleSlug: (vehicle: Vehicle) => string;
3
+ //# sourceMappingURL=slug.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slug.d.ts","sourceRoot":"/","sources":["utils/slug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,eAAO,MAAM,cAAc,YAAa,OAAO,KAAG,MAejD,CAAC"}
1
+ {"version":3,"file":"slug.d.ts","sourceRoot":"/","sources":["utils/slug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,eAAO,MAAM,cAAc,YAAa,OAAO,KAAG,MAejD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import slugify from 'slugify';
2
2
  export const getVehicleSlug = (vehicle) => {
3
- return slugify([
3
+ return slugify.default([
4
4
  vehicle.external.identification.stockNumber ?? vehicle.internal.identification.stockNumber,
5
5
  vehicle.external.general.make,
6
6
  vehicle.external.general.modelName,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slug.js","sourceRoot":"/","sources":["utils/slug.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAU,EAAE;IACzD,OAAO,OAAO,CAAC,OAAO,CACpB;QACE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW;QAC1F,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI;QAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS;QAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ;QACjC,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,EAAE;QAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ;QACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS;QAClC,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,EAAE,aAAa;KAClD;SACE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SAClB,IAAI,CAAC,GAAG,CAAC,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import slugify from 'slugify';\nimport { Vehicle } from '../types/vehicles.js';\n\nexport const getVehicleSlug = (vehicle: Vehicle): string => {\n return slugify.default(\n [\n vehicle.external.identification.stockNumber ?? vehicle.internal.identification.stockNumber,\n vehicle.external.general.make,\n vehicle.external.general.modelName,\n vehicle.external.general.typeName,\n `${vehicle.external.history?.advertisingYear}`,\n vehicle.external.general.category,\n vehicle.external.general.bodystyle,\n vehicle.external.powertrain?.axles?.configuration,\n ]\n .filter((f) => !!f)\n .join(' ')\n );\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { Branch, Tenant } from '../types/tenants';
1
+ import { Branch, Tenant } from '../types/tenants.js';
2
2
  export declare const getBranch: (tenant: Tenant, branchId: string) => Branch;
3
3
  export declare const getDefaultBranch: (tenant: Tenant) => Branch;
4
4
  export declare const getBranchStandardVatRate: (tenant: Tenant, branchId: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.d.ts","sourceRoot":"/","sources":["utils/tenants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,SAAS,WAAY,MAAM,YAAY,MAAM,KAAG,MAO5D,CAAC;AAEF,eAAO,MAAM,gBAAgB,WAAY,MAAM,KAAG,MAAiC,CAAC;AAEpF,eAAO,MAAM,wBAAwB,WAAY,MAAM,YAAY,MAAM,KAAG,MAG3E,CAAC"}
1
+ {"version":3,"file":"tenants.d.ts","sourceRoot":"/","sources":["utils/tenants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAErD,eAAO,MAAM,SAAS,WAAY,MAAM,YAAY,MAAM,KAAG,MAO5D,CAAC;AAEF,eAAO,MAAM,gBAAgB,WAAY,MAAM,KAAG,MAAiC,CAAC;AAEpF,eAAO,MAAM,wBAAwB,WAAY,MAAM,YAAY,MAAM,KAAG,MAG3E,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { XError } from '@bisondesk/commons-sdk/errors';
2
- import { first } from 'lodash';
2
+ import { first } from 'lodash-es';
3
3
  export const getBranch = (tenant, branchId) => {
4
4
  const branch = tenant.branches.find((branch) => branch.id === branchId);
5
5
  if (branch == null) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.js","sourceRoot":"/","sources":["utils/tenants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAU,EAAE;IACpE,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;IAChF,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,MAAM,CAAC,0BAA0B,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAE,CAAC;AAEpF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAU,EAAE;IACnF,MAAM,MAAM,GAAW,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import { XError } from '@bisondesk/commons-sdk/errors';\nimport { first } from 'lodash-es';\nimport { Branch, Tenant } from '../types/tenants.js';\n\nexport const getBranch = (tenant: Tenant, branchId: string): Branch => {\n const branch = tenant.branches.find((branch: Branch) => branch.id === branchId);\n if (branch == null) {\n throw new XError('tenants.branch-not-found', { tenantId: tenant.id, branchId });\n }\n\n return branch;\n};\n\nexport const getDefaultBranch = (tenant: Tenant): Branch => first(tenant.branches)!;\n\nexport const getBranchStandardVatRate = (tenant: Tenant, branchId: string): string => {\n const branch: Branch = getBranch(tenant, branchId);\n return branch.vatRates.standard;\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { VehicleExternalInfo } from '../types/vehicles';
1
+ import { VehicleExternalInfo } from '../types/vehicles.js';
2
2
  export declare const extractCustomFeatures: (vehicle: VehicleExternalInfo) => string[];
3
3
  export declare const getInternalTitle: ({ make, category, modelName, bodywork, modelTypeName, }: {
4
4
  make: string;
@@ -1 +1 @@
1
- {"version":3,"file":"vehicles.d.ts","sourceRoot":"/","sources":["utils/vehicles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,qBAAqB,YAAa,mBAAmB,KAAG,MAAM,EA+B1E,CAAC;AAEF,eAAO,MAAM,gBAAgB;UAOrB,MAAM;cACF,MAAM;;;;MAId,MAcH,CAAC;AAGF,eAAO,MAAM,sBAAsB,QAAS,MAAM,KAAG,MAYpD,CAAC"}
1
+ {"version":3,"file":"vehicles.d.ts","sourceRoot":"/","sources":["utils/vehicles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAO,MAAM,qBAAqB,YAAa,mBAAmB,KAAG,MAAM,EA+B1E,CAAC;AAEF,eAAO,MAAM,gBAAgB;UAOrB,MAAM;cACF,MAAM;;;;MAId,MAcH,CAAC;AAGF,eAAO,MAAM,sBAAsB,QAAS,MAAM,KAAG,MAYpD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Categories } from '../constants';
1
+ import { Categories } from '../constants.js';
2
2
  export const extractCustomFeatures = (vehicle) => {
3
3
  const features = [
4
4
  {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vehicles.js","sourceRoot":"/","sources":["utils/vehicles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAA4B,EAAY,EAAE;IAC9E,MAAM,QAAQ,GAGR;QACJ;YACE,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,EAAE,OAAO;YAC7D,eAAe,EAAE,OAAO;SACzB;QACD;YACE,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO;YAChE,eAAe,EAAE,UAAU;SAC5B;QACD,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE;QAC1E;YACE,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,gBAAgB;YAC3D,eAAe,EAAE,kBAAkB;SACpC;QACD;YACE,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,kBAAkB;YAC7D,eAAe,EAAE,oBAAoB;SACtC;QACD;YACE,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO;YAClD,eAAe,EAAE,SAAS;SAC3B;KACF,CAAC;IAEF,OAAO,QAAQ;SACZ,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;SAChD,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAC/B,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,aAAa,GAOd,EAAU,EAAE;IACX,IAAI,QAAQ,KAAK,UAAU,CAAC,OAAO,IAAI,QAAQ,KAAK,UAAU,CAAC,WAAW,EAAE,CAAC;QAC3E,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC;aAC/B,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,IAAI,CAAC,GAAG,CAAC;aACT,IAAI,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,CAAC;SACpC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,IAAI,CAAC,GAAG,CAAC;SACT,IAAI,EAAE,CAAC;AACZ,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAW,EAAU,EAAE;IAC5D,MAAM,OAAO,GAAG,4BAA4B,CAAC;IAC7C,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAErC,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,SAAS,GAAG,GAAG,GAAG,aAAa,CAAC;IACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,aAAa,CAAC,CAAC;IAEjD,OAAO,sBAAsB,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC","sourcesContent":["import { Categories } from '../constants.js';\nimport { VehicleExternalInfo } from '../types/vehicles.js';\n\nexport const extractCustomFeatures = (vehicle: VehicleExternalInfo): string[] => {\n const features: {\n getValue: (vehicle: VehicleExternalInfo) => any;\n picklistValueId: string;\n }[] = [\n {\n getValue: (vehicle) => vehicle.superstructure?.crane?.present,\n picklistValueId: 'crane',\n },\n {\n getValue: (vehicle) => vehicle.superstructure?.tailgate?.present,\n picklistValueId: 'tailgate',\n },\n { getValue: (vehicle) => vehicle.accessories.adr, picklistValueId: 'adr' },\n {\n getValue: (vehicle) => vehicle.accessories.retarderIntarder,\n picklistValueId: 'retarderIntarder',\n },\n {\n getValue: (vehicle) => vehicle.accessories.hydraulicTipperKit,\n picklistValueId: 'hydraulicTipperKit',\n },\n {\n getValue: (vehicle) => vehicle.accessories.lowDeck,\n picklistValueId: 'lowDeck',\n },\n ];\n\n return features\n .filter((feature) => !!feature.getValue(vehicle))\n .map((feature) => feature.picklistValueId);\n};\n\nexport const getInternalTitle = ({\n make,\n category,\n modelName,\n bodywork,\n modelTypeName,\n}: {\n make: string;\n category: string;\n modelName?: string;\n modelTypeName?: string;\n bodywork?: string;\n}): string => {\n if (category === Categories.Trailer || category === Categories.SemiTrailer) {\n return [make, modelName, bodywork]\n .filter((v): v is string => !!v)\n .map((v) => v.trim())\n .join(' ')\n .trim();\n }\n\n return [make, modelName, modelTypeName]\n .filter((v): v is string => !!v)\n .map((v) => v.trim())\n .join(' ')\n .trim();\n};\n\n// example: 1 -> A, 2 -> B, 26 -> Z, 27 -> AA, 28 -> AB, 52 -> AZ, 53 -> BA, 54 -> BB, 702 -> ZZ, 703 -> AAA\nexport const convertNumberToLetters = (num: number): string => {\n const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n const lettersLength = letters.length;\n\n if (num < 1) {\n return '';\n }\n\n const remainder = num % lettersLength;\n const quotient = Math.floor(num / lettersLength);\n\n return convertNumberToLetters(quotient) + letters.charAt(remainder - 1);\n};\n"]}
package/package.json CHANGED
@@ -1,48 +1,39 @@
1
1
  {
2
2
  "name": "@bisondesk/core-sdk",
3
- "version": "1.0.318",
3
+ "version": "1.0.320",
4
4
  "description": "",
5
+ "type": "module",
5
6
  "scripts": {
6
7
  "clean": "rm -rf build dist lib *.tsbuildinfo",
7
8
  "unittest": "echo \"No test specified\"",
8
9
  "integrationtest": "echo \"No test specified\"",
9
- "build": "npx tsc --build tsconfig.cjs.json & npx tsc --build tsconfig.esm.json",
10
+ "build": "npx tsc --build tsconfig.deploy.json",
10
11
  "watch": "npx tsc --build --watch"
11
12
  },
12
13
  "author": "TheTruckCompany",
13
14
  "dependencies": {
14
- "decimal.js": "10.3.1",
15
- "immer": "9.0.6",
15
+ "decimal.js": "10.4.3",
16
+ "immer": "10.0.3",
16
17
  "joi": "17.4.0",
17
- "lodash": "4.17.21",
18
- "slugify": "1.6.5"
18
+ "lodash-es": "4.17.21",
19
+ "slugify": "1.6.6"
19
20
  },
20
21
  "devDependencies": {
21
- "@types/node": "16.11.7",
22
- "typescript": "5.0.4"
22
+ "@types/lodash-es": "4.17.12",
23
+ "@types/node": "18.11.9",
24
+ "typescript": "5.3.3"
23
25
  },
24
26
  "peerDependencies": {
25
- "@bisondesk/commons-sdk": "^1.0.0"
26
- },
27
- "main": "./lib/cjs/*",
28
- "module": "./lib/esm/*",
29
- "exports": {
30
- "./*": {
31
- "import": [
32
- "./lib/esm/*.js",
33
- "./lib/esm/*/*.js"
34
- ],
35
- "require": [
36
- "./lib/cjs/*.js",
37
- "./lib/cjs/*/*.js"
38
- ]
39
- }
27
+ "@bisondesk/commons-sdk": "*"
40
28
  },
41
29
  "typesVersions": {
42
30
  "*": {
43
31
  "*": [
44
- "lib/types/*"
32
+ "lib/*.d.ts"
45
33
  ]
46
34
  }
35
+ },
36
+ "exports": {
37
+ "./*": "./lib/*.js"
47
38
  }
48
39
  }
package/src/apis/crm.ts CHANGED
@@ -11,9 +11,9 @@ import {
11
11
  Organization,
12
12
  SearchContact,
13
13
  SearchOrganization,
14
- } from '../types/crm';
15
- import { SearchRequest } from '../types/search';
16
- import { ReferenceData } from '../types/utils';
14
+ } from '../types/crm.js';
15
+ import { SearchRequest } from '../types/search.js';
16
+ import { ReferenceData } from '../types/utils.js';
17
17
 
18
18
  export const getCrmOrganization = async (
19
19
  tenantId: string,
@@ -33,7 +33,9 @@ export const getCrmOrganization = async (
33
33
  );
34
34
 
35
35
  if (response.ok) {
36
- return response.status === 200 ? response.json() : undefined;
36
+ return (response.status === 200 ? response.json() : undefined) as Promise<
37
+ Organization | undefined
38
+ >;
37
39
  }
38
40
 
39
41
  const body = await response.text();
@@ -58,7 +60,9 @@ export const getCrmOrganizationByExternalId = async (
58
60
  );
59
61
 
60
62
  if (response.ok) {
61
- return response.status === 200 ? response.json() : undefined;
63
+ return (response.status === 200 ? response.json() : undefined) as Promise<
64
+ Organization | undefined
65
+ >;
62
66
  }
63
67
 
64
68
  const body = await response.text();
@@ -83,7 +87,7 @@ export const saveCrmOrganization = async (
83
87
  });
84
88
 
85
89
  if (response.ok) {
86
- return response.json();
90
+ return response.json() as Promise<Organization>;
87
91
  }
88
92
 
89
93
  const body = await response.text();
@@ -133,13 +137,14 @@ export const searchCrmOrganizations = async (
133
137
  Authorization: auth,
134
138
  [TENANT_ID_ADMIN_HEADER]: tenantId,
135
139
  [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,
140
+ 'Content-Type': 'application/json',
136
141
  }),
137
142
  body: JSON.stringify(req),
138
143
  }
139
144
  );
140
145
 
141
146
  if (response.ok) {
142
- return response.status === 200 ? response.json() : undefined;
147
+ return response.status === 200 ? (response.json() as any) : undefined;
143
148
  }
144
149
 
145
150
  const body = await response.text();
@@ -167,7 +172,7 @@ export const searchCrmContacts = async (
167
172
  );
168
173
 
169
174
  if (response.ok) {
170
- return response.status === 200 ? response.json() : undefined;
175
+ return response.status === 200 ? (response.json() as any) : undefined;
171
176
  }
172
177
 
173
178
  const body = await response.text();
@@ -216,13 +221,43 @@ export const listCrmContacts = async (
216
221
  );
217
222
 
218
223
  if (response.ok) {
219
- return response.status === 200 ? response.json() : undefined;
224
+ return response.status === 200 ? (response.json() as any) : undefined;
220
225
  }
221
226
 
222
227
  const body = await response.text();
223
228
  throw new XError(response.statusText, { body, tenantId, organizationId, opts });
224
229
  };
225
230
 
231
+ export const listPotentialDuplicateOrgs = async (
232
+ tenantId: string,
233
+ org: Partial<Organization>,
234
+ opts?: { serviceId?: string; limit?: number; offset?: number }
235
+ ): Promise<PaginatedList<SearchOrganization, ReferenceData>> => {
236
+ const auth = await getAdminAuth();
237
+ const limit = opts?.limit ?? '';
238
+ const offset = opts?.offset ?? '';
239
+ const response: Response = await fetch(
240
+ `${process.env.CORE_API_ORIGIN}/api/crm/organizations/duplicate-check?limit=${limit}&offset=${offset}`,
241
+ {
242
+ method: 'POST',
243
+ headers: cleanHeaders({
244
+ 'Content-Type': 'application/json',
245
+ Authorization: auth,
246
+ [TENANT_ID_ADMIN_HEADER]: tenantId,
247
+ [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,
248
+ }),
249
+ body: JSON.stringify(org),
250
+ }
251
+ );
252
+
253
+ if (response.ok) {
254
+ return response.status === 200 ? (response.json() as any) : undefined;
255
+ }
256
+
257
+ const body = await response.text();
258
+ throw new XError(response.statusText, { body, tenantId, org, opts });
259
+ };
260
+
226
261
  export const getCrmContact = async (
227
262
  tenantId: string,
228
263
  contactId: string,
@@ -241,7 +276,7 @@ export const getCrmContact = async (
241
276
  );
242
277
 
243
278
  if (response.ok) {
244
- return response.status === 200 ? response.json() : undefined;
279
+ return response.status === 200 ? (response.json() as any) : undefined;
245
280
  }
246
281
 
247
282
  const body = await response.text();
@@ -266,7 +301,7 @@ export const saveCrmContact = async (
266
301
  });
267
302
 
268
303
  if (response.ok) {
269
- return response.json();
304
+ return response.json() as any;
270
305
  }
271
306
 
272
307
  const body = await response.text();
@@ -1,7 +1,7 @@
1
1
  import { XError } from '@bisondesk/commons-sdk/errors';
2
2
  import { getAdminAuth } from '@bisondesk/commons-sdk/fetch';
3
3
  import fetch, { Response } from 'node-fetch';
4
- import { SearchInternetVehicle } from '../types/internet-vehicles';
4
+ import { SearchInternetVehicle } from '../types/internet-vehicles.js';
5
5
 
6
6
  export const upsertInternetVehicles = async (vehicles: SearchInternetVehicle[]): Promise<void> => {
7
7
  const auth = await getAdminAuth();
@@ -6,7 +6,7 @@ import {
6
6
  LeasingAdminUpload,
7
7
  LeasingAdminUploadStatus,
8
8
  NewLeasingAdminUploadRequest,
9
- } from '../types/leasing-administration';
9
+ } from '../types/leasing-administration.js';
10
10
 
11
11
  export const createLeasingAdminUpload = async (
12
12
  tenantId: string,
@@ -29,7 +29,7 @@ export const createLeasingAdminUpload = async (
29
29
  );
30
30
 
31
31
  if (response.ok) {
32
- return response.json();
32
+ return response.json() as Promise<LeasingAdminUpload>;
33
33
  }
34
34
 
35
35
  const body = await response.text();
@@ -59,7 +59,7 @@ export const updateLeasingAdminUploadStatus = async (
59
59
  );
60
60
 
61
61
  if (response.ok) {
62
- return response.json();
62
+ return response.json() as Promise<LeasingAdminUpload>;
63
63
  }
64
64
 
65
65
  const body = await response.text();
@@ -9,8 +9,8 @@ import {
9
9
  LeasingContract,
10
10
  NewLeasingConditions,
11
11
  NewLeasingContract,
12
- } from '../types/leasing';
13
- import { DataRecord } from '../types/utils';
12
+ } from '../types/leasing.js';
13
+ import { DataRecord } from '../types/utils.js';
14
14
 
15
15
  export const listLeasingClients = async (
16
16
  tenantId: string,
@@ -31,7 +31,7 @@ export const listLeasingClients = async (
31
31
  );
32
32
 
33
33
  if (response.ok) {
34
- return response.status === 200 ? response.json() : undefined;
34
+ return response.status === 200 ? (response.json() as any) : undefined;
35
35
  }
36
36
 
37
37
  const body = await response.text();
@@ -57,7 +57,7 @@ export const listLeasingContracts = 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 getLeasingConditions = 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 createLeasingConditions = async (
103
103
  });
104
104
 
105
105
  if (response.status === 200) {
106
- return response.json();
106
+ return response.json() as any;
107
107
  }
108
108
 
109
109
  const body = await response.text();
@@ -126,7 +126,7 @@ export const getLeasingContractByNumber = async (
126
126
  );
127
127
 
128
128
  if (response.ok) {
129
- return response.status === 200 ? response.json() : undefined;
129
+ return response.status === 200 ? (response.json() as any) : undefined;
130
130
  }
131
131
 
132
132
  const body = await response.text();
@@ -149,7 +149,7 @@ export const getLeasingContract = async (
149
149
  );
150
150
 
151
151
  if (response.ok) {
152
- return response.status === 200 ? response.json() : undefined;
152
+ return response.status === 200 ? (response.json() as any) : undefined;
153
153
  }
154
154
 
155
155
  const body = await response.text();
@@ -173,7 +173,7 @@ export const findLeasingContracts = async (
173
173
  );
174
174
 
175
175
  if (response.status === 200) {
176
- return response.json();
176
+ return response.json() as any;
177
177
  }
178
178
 
179
179
  const body = await response.text();
@@ -196,7 +196,7 @@ export const upsertLeasingContract = async (
196
196
  });
197
197
 
198
198
  if (response.status === 200) {
199
- return response.json();
199
+ return response.json() as any;
200
200
  }
201
201
 
202
202
  const body = await response.text();
@@ -219,7 +219,7 @@ export const getLeasingAmortizations = async (
219
219
  );
220
220
 
221
221
  if (response.status === 200) {
222
- return response.json();
222
+ return response.json() as any;
223
223
  }
224
224
 
225
225
  const body = await response.text();
@@ -242,7 +242,7 @@ export const listAmortizationDocsByContract = async (
242
242
  );
243
243
 
244
244
  if (response.status === 200) {
245
- return response.json();
245
+ return response.json() as any as any;
246
246
  }
247
247
 
248
248
  const body = await response.text();
@@ -1,15 +1,26 @@
1
1
  import { TENANT_ID_ADMIN_HEADER } from '@bisondesk/commons-sdk/constants';
2
- import { fetchJson } from '@bisondesk/commons-sdk/fetch';
3
-
4
- import { cleanHeaders, getAdminAuth } from '@bisondesk/commons-sdk/fetch';
2
+ import { cleanHeaders, fetchJson, getAdminAuth } from '@bisondesk/commons-sdk/fetch';
5
3
  import {
6
4
  NewOpportunity,
7
5
  Opportunity,
8
6
  OpportunityBFF,
9
7
  OpportunityUpdate,
10
- } from '../types/opportunities';
11
- import { LeasingQuoteParams } from '../types/quote-settings';
12
- import { Quote } from '../types/quotes';
8
+ } from '../types/opportunities.js';
9
+ import { LeasingQuoteParams } from '../types/quote-settings.js';
10
+ import { Quote } from '../types/quotes.js';
11
+
12
+ export const getOpportunityById = async (
13
+ tenantId: string,
14
+ opportunityId: string
15
+ ): Promise<Opportunity | undefined> => {
16
+ const auth = await getAdminAuth();
17
+ return fetchJson(`${process.env.CORE_API_ORIGIN}/api/opportunities/${opportunityId}`, {
18
+ headers: cleanHeaders({
19
+ Authorization: auth,
20
+ [TENANT_ID_ADMIN_HEADER]: tenantId,
21
+ }),
22
+ });
23
+ };
13
24
 
14
25
  export const getOpportunityBff = async (
15
26
  tenantId: string,
@@ -6,7 +6,9 @@ import {
6
6
  AdHocPicklistRequest,
7
7
  AdHocPicklistValueDisplay,
8
8
  PicklistOptionsRequest,
9
- } from '../types/picklists';
9
+ PicklistValue,
10
+ PicklistValueUpdateRequest,
11
+ } from '../types/picklists.js';
10
12
 
11
13
  export const getMultiplePicklistValues = async (
12
14
  request: AdHocPicklistRequest
@@ -22,7 +24,7 @@ export const getMultiplePicklistValues = async (
22
24
  });
23
25
 
24
26
  if (response.ok) {
25
- return response.json();
27
+ return response.json() as any;
26
28
  }
27
29
 
28
30
  const body = await response.text();
@@ -42,9 +44,30 @@ export const getPicklistOptions = async (req: PicklistOptionsRequest): Promise<O
42
44
  });
43
45
 
44
46
  if (response.ok) {
45
- return response.json();
47
+ return response.json() as any;
46
48
  }
47
49
 
48
50
  const body = await response.text();
49
51
  throw new XError(response.statusText, { body, req });
50
52
  };
53
+
54
+ export const upsertPicklistValue = async (
55
+ request: PicklistValueUpdateRequest
56
+ ): Promise<PicklistValue> => {
57
+ const auth = await getAdminAuth();
58
+ const response: Response = await fetch(`${process.env.CORE_API_ORIGIN}/api/picklists/value`, {
59
+ method: 'POST',
60
+ headers: {
61
+ Authorization: auth,
62
+ 'Content-Type': 'application/json',
63
+ },
64
+ body: JSON.stringify(request),
65
+ });
66
+
67
+ if (response.ok) {
68
+ return response.json() as any;
69
+ }
70
+
71
+ const body = await response.text();
72
+ throw new XError(response.statusText, { body });
73
+ };
@@ -1,7 +1,7 @@
1
1
  import { XError } from '@bisondesk/commons-sdk/errors';
2
2
  import { getAdminAuth } from '@bisondesk/commons-sdk/fetch';
3
3
  import fetch, { Response } from 'node-fetch';
4
- import { Tenant, TenantSyncSettings } from '../types/tenants';
4
+ import { Tenant, TenantSyncSettings } from '../types/tenants.js';
5
5
 
6
6
  export const listTenants = async (): Promise<Tenant[]> => {
7
7
  const auth = await getAdminAuth();
@@ -12,7 +12,7 @@ export const listTenants = async (): Promise<Tenant[]> => {
12
12
  });
13
13
 
14
14
  if (response.ok) {
15
- return response.json();
15
+ return response.json() as any;
16
16
  }
17
17
 
18
18
  const body = await response.text();
@@ -31,7 +31,7 @@ export const listTenantsSyncSettings = async (): Promise<TenantSyncSettings[]> =
31
31
  );
32
32
 
33
33
  if (response.ok) {
34
- return response.json();
34
+ return response.json() as any;
35
35
  }
36
36
 
37
37
  const body = await response.text();
@@ -50,7 +50,7 @@ export const getTenant = async (tenantId: string): Promise<Tenant | undefined> =
50
50
  );
51
51
 
52
52
  if (response.ok) {
53
- return response.status === 200 ? response.json() : undefined;
53
+ return response.status === 200 ? (response.json() as any) : undefined;
54
54
  }
55
55
 
56
56
  const body = await response.text();
@@ -71,7 +71,7 @@ export const getTenantByHyperdmsId = async (
71
71
  );
72
72
 
73
73
  if (response.ok) {
74
- return response.status === 200 ? response.json() : undefined;
74
+ return response.status === 200 ? (response.json() as any) : undefined;
75
75
  }
76
76
 
77
77
  const body = await response.text();
@@ -92,7 +92,7 @@ export const getTenantByHyperportalId = async (
92
92
  );
93
93
 
94
94
  if (response.ok) {
95
- return response.status === 200 ? response.json() : undefined;
95
+ return response.status === 200 ? (response.json() as any) : undefined;
96
96
  }
97
97
 
98
98
  const body = await response.text();
package/src/apis/users.ts CHANGED
@@ -2,7 +2,7 @@ import { TENANT_ID_ADMIN_HEADER } from '@bisondesk/commons-sdk/constants';
2
2
  import { XError } from '@bisondesk/commons-sdk/errors';
3
3
  import { cleanHeaders, getAdminAuth } from '@bisondesk/commons-sdk/fetch';
4
4
  import fetch, { Response } from 'node-fetch';
5
- import { User } from '../types/users';
5
+ import { User } from '../types/users.js';
6
6
 
7
7
  export const getUser = async (tenantId: string, userId: string): Promise<User | undefined> => {
8
8
  const auth = await getAdminAuth();
@@ -14,7 +14,7 @@ export const getUser = async (tenantId: string, userId: string): Promise<User |
14
14
  });
15
15
 
16
16
  if (response.ok) {
17
- return response.status === 200 ? response.json() : undefined;
17
+ return response.status === 200 ? (response.json() as any) : undefined;
18
18
  }
19
19
 
20
20
  const body = await response.text();