@bisondesk/core-sdk 1.0.230-esm → 1.0.231

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 (99) hide show
  1. package/lib/apis/crm.js +98 -81
  2. package/lib/apis/crm.js.map +1 -1
  3. package/lib/apis/documents.js +22 -14
  4. package/lib/apis/documents.js.map +1 -1
  5. package/lib/apis/internet-vehicles.js +14 -7
  6. package/lib/apis/internet-vehicles.js.map +1 -1
  7. package/lib/apis/leasing-administration.js +26 -18
  8. package/lib/apis/leasing-administration.js.map +1 -1
  9. package/lib/apis/leasing.js +72 -56
  10. package/lib/apis/leasing.js.map +1 -1
  11. package/lib/apis/opportunities.js +45 -34
  12. package/lib/apis/opportunities.js.map +1 -1
  13. package/lib/apis/picklists.js +20 -12
  14. package/lib/apis/picklists.js.map +1 -1
  15. package/lib/apis/tenants.js +34 -23
  16. package/lib/apis/tenants.js.map +1 -1
  17. package/lib/apis/users.js +17 -10
  18. package/lib/apis/users.js.map +1 -1
  19. package/lib/apis/utils.js +13 -7
  20. package/lib/apis/utils.js.map +1 -1
  21. package/lib/apis/vehicles.js +65 -51
  22. package/lib/apis/vehicles.js.map +1 -1
  23. package/lib/constants.d.ts +1 -0
  24. package/lib/constants.d.ts.map +1 -1
  25. package/lib/constants.js +98 -60
  26. package/lib/constants.js.map +1 -1
  27. package/lib/ddb-entities.js +4 -1
  28. package/lib/ddb-entities.js.map +1 -1
  29. package/lib/types/activities.js +7 -4
  30. package/lib/types/activities.js.map +1 -1
  31. package/lib/types/crm.d.ts +3 -0
  32. package/lib/types/crm.d.ts.map +1 -1
  33. package/lib/types/crm.js +9 -6
  34. package/lib/types/crm.js.map +1 -1
  35. package/lib/types/definitions.js +2 -1
  36. package/lib/types/documents.js +2 -1
  37. package/lib/types/events.js +6 -2
  38. package/lib/types/events.js.map +1 -1
  39. package/lib/types/fields.js +10 -4
  40. package/lib/types/fields.js.map +1 -1
  41. package/lib/types/internet-vehicles.js +2 -1
  42. package/lib/types/leads.js +2 -1
  43. package/lib/types/leasing-administration.js +2 -1
  44. package/lib/types/leasing-search.js +2 -1
  45. package/lib/types/leasing-settings.d.ts +3 -1
  46. package/lib/types/leasing-settings.d.ts.map +1 -1
  47. package/lib/types/leasing-settings.js +5 -2
  48. package/lib/types/leasing-settings.js.map +1 -1
  49. package/lib/types/leasing.d.ts +7 -0
  50. package/lib/types/leasing.d.ts.map +1 -1
  51. package/lib/types/leasing.js +9 -6
  52. package/lib/types/leasing.js.map +1 -1
  53. package/lib/types/machines.js +2 -1
  54. package/lib/types/opportunities.js +21 -18
  55. package/lib/types/opportunities.js.map +1 -1
  56. package/lib/types/payments.js +5 -2
  57. package/lib/types/payments.js.map +1 -1
  58. package/lib/types/picklists.js +2 -1
  59. package/lib/types/quotes.js +9 -6
  60. package/lib/types/quotes.js.map +1 -1
  61. package/lib/types/recently-viewed.js +2 -1
  62. package/lib/types/saved-filters.js +2 -1
  63. package/lib/types/search.js +21 -9
  64. package/lib/types/search.js.map +1 -1
  65. package/lib/types/settings.js +2 -1
  66. package/lib/types/storage.js +17 -1
  67. package/lib/types/storage.js.map +1 -1
  68. package/lib/types/templates.js +5 -2
  69. package/lib/types/templates.js.map +1 -1
  70. package/lib/types/tenants.d.ts +10 -0
  71. package/lib/types/tenants.d.ts.map +1 -1
  72. package/lib/types/tenants.js +13 -1
  73. package/lib/types/tenants.js.map +1 -1
  74. package/lib/types/users.js +2 -1
  75. package/lib/types/utils.js +5 -2
  76. package/lib/types/utils.js.map +1 -1
  77. package/lib/types/vehicles.d.ts +57 -56
  78. package/lib/types/vehicles.d.ts.map +1 -1
  79. package/lib/types/vehicles.js +17 -14
  80. package/lib/types/vehicles.js.map +1 -1
  81. package/lib/types/website.js +2 -1
  82. package/lib/utils/forms.js +13 -6
  83. package/lib/utils/forms.js.map +1 -1
  84. package/lib/utils/leasing.js +9 -3
  85. package/lib/utils/leasing.js.map +1 -1
  86. package/lib/utils/slug.js +10 -3
  87. package/lib/utils/slug.js.map +1 -1
  88. package/lib/utils/tenants.js +8 -3
  89. package/lib/utils/tenants.js.map +1 -1
  90. package/lib/utils/vehicles.js +18 -10
  91. package/lib/utils/vehicles.js.map +1 -1
  92. package/package.json +2 -2
  93. package/src/constants.ts +1 -0
  94. package/src/types/crm.ts +1 -0
  95. package/src/types/leasing-settings.ts +3 -1
  96. package/src/types/tenants.ts +11 -0
  97. package/src/types/vehicles.ts +53 -56
  98. package/tsconfig.json +4 -4
  99. package/tsconfig.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/core-sdk",
3
- "version": "1.0.230-esm",
3
+ "version": "1.0.231",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "clean": "rm -rf build dist lib *.tsbuildinfo",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "author": "TheTruckCompany",
13
13
  "dependencies": {
14
- "@bisondesk/commons-sdk": "1.0.230-esm",
14
+ "@bisondesk/commons-sdk": "1.0.231",
15
15
  "joi": "17.4.0",
16
16
  "decimal.js": "10.3.1",
17
17
  "slugify": "1.6.5"
package/src/constants.ts CHANGED
@@ -26,6 +26,7 @@ export const AXLE_MAKE_PICKLIST_ID = 'axleMake';
26
26
  export const TAILGATE_MAKE_PICKLIST_ID = 'tailgateMakes';
27
27
  export const VAT_PERCENTAGE_PICKLIST_ID = 'vatPercentages';
28
28
  export const CRANE_MAKE_PICKLIST_ID = 'craneMakes';
29
+ export const ENGINEERING_DOCS_PICKLIST_ID = 'engineeringDocs';
29
30
 
30
31
  //
31
32
  // STATIC PICKLIST ID VALUES
package/src/types/crm.ts CHANGED
@@ -42,6 +42,7 @@ type BaseOrganization = {
42
42
  accountManagers: string[];
43
43
  billingEmails?: string[];
44
44
  skipPaymentReminders?: boolean;
45
+ trustworthy?: boolean;
45
46
  };
46
47
 
47
48
  export type NewOrganization = BaseOrganization & {
@@ -1,5 +1,5 @@
1
1
  import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
2
- import { Categories } from '../constants';
2
+ import { Categories, OpportunityType } from '../constants';
3
3
  import { SortFilter } from './search';
4
4
 
5
5
  export type LeasingQuoteParams = { id: string; name: string; modifiedAt: string } & {
@@ -55,6 +55,7 @@ type BaseLeasingQuoteExtraSettings = {
55
55
  vehicleCategoryRestrictions: Categories[];
56
56
  departments: string[];
57
57
  departmentTitles?: { [department: string]: string };
58
+ opportunityTypeRestrictions: OpportunityType[];
58
59
  };
59
60
 
60
61
  export type BaseLeasingQuoteExtraInput = {
@@ -106,4 +107,5 @@ export type LeasingQuoteExtrasRequest = {
106
107
  offset?: number;
107
108
  limit?: number;
108
109
  sortBy?: SortFilter;
110
+ opportunityType?: OpportunityType;
109
111
  };
@@ -13,6 +13,16 @@ export type PublicTenant = {
13
13
  // the tenant can be obtained without authentication
14
14
  };
15
15
 
16
+ export enum TenantModule {
17
+ CRM = 'crm',
18
+ Docs = 'docs',
19
+ Leads = 'leads',
20
+ Leasing = 'leasing',
21
+ Market = 'market',
22
+ Opportunities = 'opportunities',
23
+ VehiclesMaster = 'vehicles_master_data',
24
+ }
25
+
16
26
  export type Tenant = PublicTenant & {
17
27
  languages: [string, ...string[]];
18
28
  conglomerate?: string;
@@ -21,6 +31,7 @@ export type Tenant = PublicTenant & {
21
31
  hyperportalId?: string;
22
32
  exactAccounting?: boolean;
23
33
  branches: [Branch, ...Branch[]];
34
+ modules: TenantModule[];
24
35
  };
25
36
 
26
37
  export type Branch = {
@@ -13,6 +13,54 @@ type BaseVehicleEvent = {
13
13
  tenantId: string;
14
14
  };
15
15
 
16
+ type VehicleSuperstructure = {
17
+ carCapacity?: number;
18
+ compartmentCount?: number;
19
+ counter?: boolean;
20
+ crane?: {
21
+ make?: string;
22
+ model?: string;
23
+ position?: 'Behind the cabin' | 'Rear';
24
+ present?: boolean;
25
+ year?: number;
26
+ };
27
+ dimensions?: {
28
+ height?: number;
29
+ length?: number;
30
+ width?: number;
31
+ extended?: string; // L1, L2, ...
32
+ heightened?: string; // H1, H2, ...
33
+ };
34
+ baseVehicle?: SuperstructureBaseVehicle;
35
+ extendable?: boolean;
36
+ highPressurePump?: boolean;
37
+ loadingPlatformHeight?: number;
38
+ pump?: boolean;
39
+ slidingRoof?: boolean;
40
+ tailgate?: {
41
+ capacity?: number;
42
+ make?: string;
43
+ model?: string;
44
+ present?: boolean;
45
+ type?: 'slider_lift' | 'cantilever' | 'column_lift';
46
+ };
47
+ tank?: {
48
+ capacity: number;
49
+ };
50
+ temperatureControl?: {
51
+ engineType?: 'diesel' | 'electric' | 'diesel+electric' | 'engine';
52
+ make?: string;
53
+ runningHours?: {
54
+ diesel?: number;
55
+ electric?: number;
56
+ };
57
+ };
58
+ tipper?: {
59
+ tipsBack?: boolean;
60
+ tipsLeft?: boolean;
61
+ tipsRight?: boolean;
62
+ };
63
+ };
16
64
  export type NewVehicleRequest = {
17
65
  branch: string;
18
66
  count: number;
@@ -37,6 +85,7 @@ export type NewVehicleRequest = {
37
85
  pictures: AttachmentValue[];
38
86
  videos: AttachmentValue[];
39
87
  docs: Document[];
88
+ engineeringDocs: Document[];
40
89
  };
41
90
  vinList?: string;
42
91
  deal: {
@@ -143,6 +192,7 @@ export type VehicleInternalInfo = {
143
192
  metaId: string;
144
193
  };
145
194
  documents: Document[];
195
+ engineeringDocs: Document[];
146
196
  pricing: {
147
197
  premium?: string;
148
198
  minimum?: string;
@@ -199,14 +249,8 @@ export type SuperstructureBaseVehicle = {
199
249
  odometerKm?: number;
200
250
  powerHp?: number;
201
251
  bodystyle?: string;
202
- accessories: {
203
- crane?: boolean;
204
- adr?: boolean;
205
- tailgate?: boolean;
206
- hydraulicTipperKit?: boolean;
207
- powerTakeOff?: boolean;
208
- trailerCoupling?: boolean;
209
- };
252
+ accessories: VehicleExternalInfo['accessories'];
253
+ superstructure?: Pick<VehicleSuperstructure, 'crane' | 'tailgate'>;
210
254
  };
211
255
 
212
256
  // mostly inspired by the Hexon data model
@@ -290,54 +334,7 @@ export type VehicleExternalInfo = {
290
334
  price?: string | undefined;
291
335
  currency?: string | undefined;
292
336
  };
293
- superstructure?: {
294
- carCapacity?: number;
295
- compartmentCount?: number;
296
- counter?: boolean;
297
- crane?: {
298
- make?: string;
299
- model?: string;
300
- position?: 'Behind the cabin' | 'Rear';
301
- present?: boolean;
302
- year?: number;
303
- };
304
- dimensions?: {
305
- height?: number;
306
- length?: number;
307
- width?: number;
308
- extended?: string; // L1, L2, ...
309
- heightened?: string; // H1, H2, ...
310
- };
311
- baseVehicle?: SuperstructureBaseVehicle;
312
- extendable?: boolean;
313
- highPressurePump?: boolean;
314
- loadingPlatformHeight?: number;
315
- pump?: boolean;
316
- slidingRoof?: boolean;
317
- tailgate?: {
318
- capacity?: number;
319
- make?: string;
320
- model?: string;
321
- present?: boolean;
322
- type?: 'slider_lift' | 'cantilever' | 'column_lift';
323
- };
324
- tank?: {
325
- capacity: number;
326
- };
327
- temperatureControl?: {
328
- engineType?: 'diesel' | 'electric' | 'diesel+electric' | 'engine';
329
- make?: string;
330
- runningHours?: {
331
- diesel?: number;
332
- electric?: number;
333
- };
334
- };
335
- tipper?: {
336
- tipsBack?: boolean;
337
- tipsLeft?: boolean;
338
- tipsRight?: boolean;
339
- };
340
- };
337
+ superstructure?: VehicleSuperstructure;
341
338
  weights?: {
342
339
  gvw?: number;
343
340
  massEmpty?: number;
package/tsconfig.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "extends": "../../tsconfig.json",
3
+ "include": ["src"],
3
4
  "compilerOptions": {
5
+ "composite": true,
4
6
  "declaration": true,
5
- "module": "ES2020",
6
7
  "declarationMap": true,
7
- "sourceMap": true,
8
- "composite": true,
9
8
  "outDir": "lib",
10
9
  "rootDir": "src",
10
+ "sourceMap": true
11
11
  },
12
- "include": ["src"]
12
+ "references": [{ "path": "../commons-sdk" }]
13
13
  }