@bisondesk/core-sdk 1.0.23-B → 1.0.25

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 (225) hide show
  1. package/lib/constants.d.ts +0 -77
  2. package/lib/constants.d.ts.map +1 -1
  3. package/lib/constants.js +1 -924
  4. package/lib/constants.js.map +1 -1
  5. package/lib/types/crm.d.ts +30 -102
  6. package/lib/types/crm.d.ts.map +1 -1
  7. package/lib/types/crm.js +0 -16
  8. package/lib/types/crm.js.map +1 -1
  9. package/lib/types/definitions.d.ts +13 -15
  10. package/lib/types/definitions.d.ts.map +1 -1
  11. package/lib/types/fields.d.ts +25 -26
  12. package/lib/types/fields.d.ts.map +1 -1
  13. package/lib/types/fields.js +0 -4
  14. package/lib/types/fields.js.map +1 -1
  15. package/lib/types/interests.d.ts +31 -0
  16. package/lib/types/interests.d.ts.map +1 -0
  17. package/lib/types/{settings.js → interests.js} +1 -1
  18. package/lib/types/interests.js.map +1 -0
  19. package/lib/types/picklists.d.ts +4 -15
  20. package/lib/types/picklists.d.ts.map +1 -1
  21. package/lib/types/search.d.ts +4 -26
  22. package/lib/types/search.d.ts.map +1 -1
  23. package/lib/types/search.js.map +1 -1
  24. package/lib/types/storage.d.ts +11 -1
  25. package/lib/types/storage.d.ts.map +1 -1
  26. package/lib/types/storage.js +0 -15
  27. package/lib/types/storage.js.map +1 -1
  28. package/lib/types/tenants.d.ts +9 -32
  29. package/lib/types/tenants.d.ts.map +1 -1
  30. package/lib/types/tenants.js +0 -11
  31. package/lib/types/tenants.js.map +1 -1
  32. package/lib/types/users.d.ts +3 -11
  33. package/lib/types/users.d.ts.map +1 -1
  34. package/lib/types/utils.d.ts +0 -20
  35. package/lib/types/utils.d.ts.map +1 -1
  36. package/lib/types/utils.js +0 -6
  37. package/lib/types/utils.js.map +1 -1
  38. package/lib/types/vehicles.d.ts +92 -406
  39. package/lib/types/vehicles.d.ts.map +1 -1
  40. package/lib/types/vehicles.js +1 -54
  41. package/lib/types/vehicles.js.map +1 -1
  42. package/package.json +6 -8
  43. package/src/constants.ts +1 -930
  44. package/src/types/crm.ts +30 -117
  45. package/src/types/definitions.ts +12 -19
  46. package/src/types/fields.ts +31 -72
  47. package/src/types/interests.ts +28 -0
  48. package/src/types/picklists.ts +7 -26
  49. package/src/types/search.ts +4 -34
  50. package/src/types/storage.ts +12 -1
  51. package/src/types/tenants.ts +11 -37
  52. package/src/types/users.ts +3 -17
  53. package/src/types/utils.ts +0 -25
  54. package/src/types/vehicles.ts +93 -461
  55. package/tsconfig.tsbuildinfo +2995 -1
  56. package/lib/apis/crm.d.ts +0 -39
  57. package/lib/apis/crm.d.ts.map +0 -1
  58. package/lib/apis/crm.js +0 -201
  59. package/lib/apis/crm.js.map +0 -1
  60. package/lib/apis/documents.d.ts +0 -4
  61. package/lib/apis/documents.d.ts.map +0 -1
  62. package/lib/apis/documents.js +0 -47
  63. package/lib/apis/documents.js.map +0 -1
  64. package/lib/apis/internet-vehicles.d.ts +0 -3
  65. package/lib/apis/internet-vehicles.d.ts.map +0 -1
  66. package/lib/apis/internet-vehicles.js +0 -27
  67. package/lib/apis/internet-vehicles.js.map +0 -1
  68. package/lib/apis/leasing-administration.d.ts +0 -8
  69. package/lib/apis/leasing-administration.d.ts.map +0 -1
  70. package/lib/apis/leasing-administration.js +0 -49
  71. package/lib/apis/leasing-administration.js.map +0 -1
  72. package/lib/apis/leasing.d.ts +0 -19
  73. package/lib/apis/leasing.d.ts.map +0 -1
  74. package/lib/apis/leasing.js +0 -168
  75. package/lib/apis/leasing.js.map +0 -1
  76. package/lib/apis/opportunities.d.ts +0 -9
  77. package/lib/apis/opportunities.d.ts.map +0 -1
  78. package/lib/apis/opportunities.js +0 -94
  79. package/lib/apis/opportunities.js.map +0 -1
  80. package/lib/apis/picklists.d.ts +0 -5
  81. package/lib/apis/picklists.d.ts.map +0 -1
  82. package/lib/apis/picklists.js +0 -44
  83. package/lib/apis/picklists.js.map +0 -1
  84. package/lib/apis/tenants.d.ts +0 -7
  85. package/lib/apis/tenants.d.ts.map +0 -1
  86. package/lib/apis/tenants.js +0 -80
  87. package/lib/apis/tenants.js.map +0 -1
  88. package/lib/apis/users.d.ts +0 -3
  89. package/lib/apis/users.d.ts.map +0 -1
  90. package/lib/apis/users.js +0 -26
  91. package/lib/apis/users.js.map +0 -1
  92. package/lib/apis/utils.d.ts +0 -9
  93. package/lib/apis/utils.d.ts.map +0 -1
  94. package/lib/apis/utils.js +0 -23
  95. package/lib/apis/utils.js.map +0 -1
  96. package/lib/apis/vehicles.d.ts +0 -18
  97. package/lib/apis/vehicles.d.ts.map +0 -1
  98. package/lib/apis/vehicles.js +0 -159
  99. package/lib/apis/vehicles.js.map +0 -1
  100. package/lib/ddb-entities.d.ts +0 -2
  101. package/lib/ddb-entities.d.ts.map +0 -1
  102. package/lib/ddb-entities.js +0 -5
  103. package/lib/ddb-entities.js.map +0 -1
  104. package/lib/types/activities.d.ts +0 -38
  105. package/lib/types/activities.d.ts.map +0 -1
  106. package/lib/types/activities.js +0 -16
  107. package/lib/types/activities.js.map +0 -1
  108. package/lib/types/documents.d.ts +0 -105
  109. package/lib/types/documents.d.ts.map +0 -1
  110. package/lib/types/documents.js +0 -3
  111. package/lib/types/documents.js.map +0 -1
  112. package/lib/types/internet-vehicles.d.ts +0 -64
  113. package/lib/types/internet-vehicles.d.ts.map +0 -1
  114. package/lib/types/internet-vehicles.js +0 -3
  115. package/lib/types/internet-vehicles.js.map +0 -1
  116. package/lib/types/leads.d.ts +0 -134
  117. package/lib/types/leads.d.ts.map +0 -1
  118. package/lib/types/leads.js +0 -3
  119. package/lib/types/leads.js.map +0 -1
  120. package/lib/types/leasing-administration.d.ts +0 -107
  121. package/lib/types/leasing-administration.d.ts.map +0 -1
  122. package/lib/types/leasing-administration.js +0 -3
  123. package/lib/types/leasing-administration.js.map +0 -1
  124. package/lib/types/leasing-search.d.ts +0 -22
  125. package/lib/types/leasing-search.d.ts.map +0 -1
  126. package/lib/types/leasing-search.js +0 -3
  127. package/lib/types/leasing-search.js.map +0 -1
  128. package/lib/types/leasing-settings.d.ts +0 -113
  129. package/lib/types/leasing-settings.d.ts.map +0 -1
  130. package/lib/types/leasing-settings.js +0 -10
  131. package/lib/types/leasing-settings.js.map +0 -1
  132. package/lib/types/leasing.d.ts +0 -322
  133. package/lib/types/leasing.d.ts.map +0 -1
  134. package/lib/types/leasing.js +0 -24
  135. package/lib/types/leasing.js.map +0 -1
  136. package/lib/types/machines.d.ts +0 -38
  137. package/lib/types/machines.d.ts.map +0 -1
  138. package/lib/types/machines.js +0 -3
  139. package/lib/types/machines.js.map +0 -1
  140. package/lib/types/opportunities.d.ts +0 -448
  141. package/lib/types/opportunities.d.ts.map +0 -1
  142. package/lib/types/opportunities.js +0 -68
  143. package/lib/types/opportunities.js.map +0 -1
  144. package/lib/types/payments.d.ts +0 -38
  145. package/lib/types/payments.d.ts.map +0 -1
  146. package/lib/types/payments.js +0 -9
  147. package/lib/types/payments.js.map +0 -1
  148. package/lib/types/quotes.d.ts +0 -173
  149. package/lib/types/quotes.d.ts.map +0 -1
  150. package/lib/types/quotes.js +0 -26
  151. package/lib/types/quotes.js.map +0 -1
  152. package/lib/types/recently-viewed.d.ts +0 -33
  153. package/lib/types/recently-viewed.d.ts.map +0 -1
  154. package/lib/types/recently-viewed.js +0 -3
  155. package/lib/types/recently-viewed.js.map +0 -1
  156. package/lib/types/saved-filters.d.ts +0 -20
  157. package/lib/types/saved-filters.d.ts.map +0 -1
  158. package/lib/types/saved-filters.js +0 -3
  159. package/lib/types/saved-filters.js.map +0 -1
  160. package/lib/types/settings.d.ts +0 -50
  161. package/lib/types/settings.d.ts.map +0 -1
  162. package/lib/types/settings.js.map +0 -1
  163. package/lib/types/templates.d.ts +0 -35
  164. package/lib/types/templates.d.ts.map +0 -1
  165. package/lib/types/templates.js +0 -9
  166. package/lib/types/templates.js.map +0 -1
  167. package/lib/types/website.d.ts +0 -24
  168. package/lib/types/website.d.ts.map +0 -1
  169. package/lib/types/website.js +0 -3
  170. package/lib/types/website.js.map +0 -1
  171. package/lib/utils/forms.d.ts +0 -6
  172. package/lib/utils/forms.d.ts.map +0 -1
  173. package/lib/utils/forms.js +0 -33
  174. package/lib/utils/forms.js.map +0 -1
  175. package/lib/utils/leasing.d.ts +0 -3
  176. package/lib/utils/leasing.d.ts.map +0 -1
  177. package/lib/utils/leasing.js +0 -10
  178. package/lib/utils/leasing.js.map +0 -1
  179. package/lib/utils/slug.d.ts +0 -3
  180. package/lib/utils/slug.d.ts.map +0 -1
  181. package/lib/utils/slug.js +0 -23
  182. package/lib/utils/slug.js.map +0 -1
  183. package/lib/utils/tenants.d.ts +0 -4
  184. package/lib/utils/tenants.d.ts.map +0 -1
  185. package/lib/utils/tenants.js +0 -16
  186. package/lib/utils/tenants.js.map +0 -1
  187. package/lib/utils/vehicles.d.ts +0 -12
  188. package/lib/utils/vehicles.d.ts.map +0 -1
  189. package/lib/utils/vehicles.js +0 -73
  190. package/lib/utils/vehicles.js.map +0 -1
  191. package/src/apis/crm.ts +0 -302
  192. package/src/apis/documents.ts +0 -54
  193. package/src/apis/internet-vehicles.ts +0 -23
  194. package/src/apis/leasing-administration.ts +0 -70
  195. package/src/apis/leasing.ts +0 -257
  196. package/src/apis/opportunities.ts +0 -133
  197. package/src/apis/picklists.ts +0 -50
  198. package/src/apis/tenants.ts +0 -100
  199. package/src/apis/users.ts +0 -22
  200. package/src/apis/utils.ts +0 -23
  201. package/src/apis/vehicles.ts +0 -229
  202. package/src/ddb-entities.ts +0 -1
  203. package/src/environment.d.ts +0 -6
  204. package/src/types/activities.ts +0 -41
  205. package/src/types/documents.ts +0 -110
  206. package/src/types/internet-vehicles.ts +0 -67
  207. package/src/types/leads.ts +0 -144
  208. package/src/types/leasing-administration.ts +0 -131
  209. package/src/types/leasing-search.ts +0 -24
  210. package/src/types/leasing-settings.ts +0 -111
  211. package/src/types/leasing.ts +0 -360
  212. package/src/types/machines.ts +0 -40
  213. package/src/types/opportunities.ts +0 -496
  214. package/src/types/payments.ts +0 -40
  215. package/src/types/quotes.ts +0 -186
  216. package/src/types/recently-viewed.ts +0 -45
  217. package/src/types/saved-filters.ts +0 -21
  218. package/src/types/settings.ts +0 -51
  219. package/src/types/templates.ts +0 -40
  220. package/src/types/website.ts +0 -28
  221. package/src/utils/forms.ts +0 -32
  222. package/src/utils/leasing.ts +0 -14
  223. package/src/utils/slug.ts +0 -19
  224. package/src/utils/tenants.ts +0 -14
  225. package/src/utils/vehicles.ts +0 -92
package/src/types/crm.ts CHANGED
@@ -1,141 +1,54 @@
1
- import {
2
- LocationValue,
3
- PhoneNumberRawValue,
4
- PhoneNumberValue,
5
- SearchPermissions,
6
- } from '@bisondesk/commons-sdk/lib/types';
7
- import { PublicSearchDefinition } from './definitions';
8
- import { LeasingContract } from './leasing';
9
- import { ReferenceData } from './utils';
1
+ import { PhoneNumberRawValue, PhoneNumberValue } from './fields';
2
+ import { Interest } from './interests';
10
3
 
11
- export type CrmEvent = CrmOrganizationEvent | CrmContactEvent;
12
-
13
- export type CrmContactEvent = {
14
- contactId: string;
15
- organizationId?: string;
16
- action: 'upsert' | 'delete';
17
- actionAt: string;
18
- userId: string;
19
- tenantId: string;
20
- };
21
-
22
- export type CrmOrganizationEvent = {
23
- organizationId: string;
24
- action: 'upsert' | 'delete';
25
- actionAt: string;
26
- userId: string;
27
- tenantId: string;
28
- };
29
-
30
- type BaseOrganization = {
31
- inUse: boolean;
4
+ export type Organization = {
32
5
  countryCode: string;
33
- syncedAt: string;
6
+ createdAt: string;
7
+ createdBy: string;
8
+ externalId: number;
9
+ id: string;
34
10
  name: string;
35
11
  segment?: string;
36
12
  type?: 'COMPANY' | 'INDIVIDUAL';
37
13
  vatNumber?: string;
38
- addresses?: {
39
- legal?: LocationValue;
40
- transport?: LocationValue;
41
- };
42
- accountManagers: string[];
43
- billingEmails?: string[];
44
- skipPaymentReminders?: boolean;
45
- trustworthy?: boolean;
46
- };
47
-
48
- export type NewOrganization = BaseOrganization & {
49
- id?: undefined;
50
- externalId?: undefined;
51
- createdAt?: undefined;
52
- createdBy?: undefined;
53
- };
54
-
55
- export type Organization = BaseOrganization & {
56
- createdAt: string;
57
- externalId: number;
58
- createdBy: string;
59
- id: string;
60
- debt?: OrganizationDebtInfo;
61
- blocked?: boolean;
62
- blockedAt?: string;
63
- blockedBy?: string;
64
- blockedReason?: string;
65
- };
66
-
67
- export type OrganizationDebtInfo = {
68
- overdueSince?: string;
69
- overdueInvoices: number;
70
- overdueAmount: string;
71
- unpaidInvoices: number;
72
- unpaidAmount: string;
73
14
  };
74
15
 
75
16
  export type SearchOrganization = {
76
- org: Organization;
77
- contract: LeasingContract[]; // important for the logic regarding leasing overdue reminders
78
- };
79
-
80
- export type PotentialDuplicatesReferenceData = ReferenceData & { blockIgnore?: boolean };
81
-
82
- export type InputSearchOrganization = SearchOrganization & {
83
- permissions: SearchPermissions;
17
+ org: Partial<Organization>;
84
18
  };
85
19
 
86
20
  export type SearchContact = {
87
- contact: Contact;
88
- org?: Organization;
89
- };
90
-
91
- export type InputSearchContact = SearchContact & {
92
- permissions: SearchPermissions;
93
- };
94
-
95
- export type CrmPublicSearchDefinitions = {
96
- searchOrg: PublicSearchDefinition;
97
- searchContact: PublicSearchDefinition;
21
+ org: Partial<Organization>;
22
+ contact: Partial<Contact>;
98
23
  };
99
24
 
100
- type BaseContact = {
25
+ export type Contact = {
26
+ id: string;
27
+ organizationId: string;
101
28
  accountManager?: string;
102
- countryCode?: string;
103
29
  language?: string;
30
+ firstName?: string;
31
+ lastName: string;
32
+ createdAt: string;
33
+ createdBy: string;
34
+ phones: PhoneNumberValue[];
104
35
  emails: string[];
105
36
  job?: string;
106
- /** either firstName or lastName should be filled in */
107
- firstName?: string;
108
- lastName?: string;
109
- organizationId?: string;
110
- /** will not be filled if organizationId is present */
111
- orgName?: string;
112
37
  };
113
38
 
114
- export type NewContact = BaseContact & {
115
- id?: undefined;
116
- createdAt?: undefined;
117
- createdBy?: undefined;
118
- phones: Array<PhoneNumberValue | PhoneNumberRawValue>;
39
+ export type LeadContact = {
40
+ accountManager: string;
41
+ companyName?: string;
42
+ country: string;
43
+ email?: string;
44
+ language?: string;
45
+ name: string;
46
+ phone?: PhoneNumberValue | PhoneNumberRawValue;
47
+ remarks?: string;
119
48
  };
120
49
 
121
- export type Contact = BaseContact & {
50
+ export type Lead = {
122
51
  id: string;
123
- createdAt: string;
124
- createdBy: string;
125
- phones: PhoneNumberValue[];
52
+ contact: LeadContact;
53
+ interests: Interest[];
126
54
  };
127
-
128
- export enum SaveContactResolution {
129
- IgnoreDuplicates = 'IGNORE_DUPLICATES',
130
- BlockDuplicates = 'BLOCK_DUPLICATES',
131
- }
132
-
133
- export enum SaveOrgResolution {
134
- IgnoreDuplicates = 'IGNORE_DUPLICATES',
135
- BlockDuplicates = 'BLOCK_DUPLICATES',
136
- }
137
-
138
- export enum CrmSearchScope {
139
- Tenant = 'tenant',
140
- Conglomerate = 'conglomerate',
141
- }
@@ -5,35 +5,28 @@ import { Aggregation } from './search';
5
5
  // These definitions are sent to the UI
6
6
  //
7
7
  export type PublicSearchDefinition = {
8
- fields: { [fieldId: string]: SearchField };
9
- aggs: Aggregation[];
8
+ name: string;
9
+ fields: { [fieldId: string]: PublicSearchField };
10
10
  };
11
11
 
12
+ export type PublicSearchField = {
13
+ id: string;
14
+ titles: { [lang: string]: string };
15
+ agg?: Aggregation;
16
+ } & FieldTypeInfo;
17
+
12
18
  //
13
19
  // These definitions are for internal consumption
14
20
  //
15
21
  export type SearchDefinition = {
22
+ name: string;
16
23
  fields: { [fieldId: string]: SearchField };
17
24
  };
18
25
 
19
26
  export type SearchField = {
20
27
  id: string;
28
+ esMapping: unknown;
21
29
  titles: { [lang: string]: string };
30
+ fullText?: boolean | ((lang: string) => string);
31
+ agg?: Aggregation;
22
32
  } & FieldTypeInfo;
23
-
24
- export type EsDefinitionField = {
25
- esMapping: unknown;
26
- sortKey?: string;
27
- };
28
-
29
- export type EsDefinition = {
30
- name: string;
31
- nestedEsPaths: string[];
32
- fields: {
33
- [fieldId: string]: EsDefinitionField;
34
- };
35
- };
36
-
37
- export type EsFullTextSearchDefinition = ((lang: string) => string)[];
38
-
39
- export type EsAggregationsDefinition = Aggregation[];
@@ -1,12 +1,10 @@
1
+ import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
2
+
1
3
  export enum FieldTypes {
2
- attachment = 'attachment',
3
4
  checkbox = 'checkbox',
4
- collaborator = 'collaborator',
5
5
  date = 'date',
6
6
  email = 'email',
7
7
  image = 'image',
8
- link = 'link',
9
- location = 'location',
10
8
  multilang = 'multilang',
11
9
  multiline = 'multiline',
12
10
  number = 'number',
@@ -26,72 +24,41 @@ export enum DateGranularity {
26
24
  yearMonthDayTime = 'yearMonthDayTime',
27
25
  }
28
26
 
27
+ export type PhoneNumberValue = {
28
+ country?: string;
29
+ e164: string;
30
+ international: string;
31
+ national: string;
32
+ };
33
+
34
+ export type PhoneNumberRawValue = {
35
+ defaultCountry?: string;
36
+ input: string;
37
+ };
38
+
39
+ export type AttachmentValue = {
40
+ contentType: string;
41
+ fileName: string;
42
+ id: string;
43
+ size: number;
44
+ uploadedAt: string;
45
+ uploadedBy: string;
46
+ url: string;
47
+ descriptions?: string | MultiLangValue;
48
+ };
49
+
29
50
  //
30
51
  // Field metas
31
52
  //
32
53
  type BaseMeta = {};
33
54
 
34
- type NumberUnit =
35
- | 'acre'
36
- | 'bit'
37
- | 'byte'
38
- | 'celsius'
39
- | 'centimeter'
40
- | 'day'
41
- | 'degree'
42
- | 'fahrenheit'
43
- | 'fluid-ounce'
44
- | 'foot'
45
- | 'gallon'
46
- | 'gigabit'
47
- | 'gigabyte'
48
- | 'gram'
49
- | 'hectare'
50
- | 'hour'
51
- | 'inch'
52
- | 'kilobit'
53
- | 'kilobyte'
54
- | 'kilogram'
55
- | 'kilometer'
56
- | 'liter'
57
- | 'megabit'
58
- | 'megabyte'
59
- | 'meter'
60
- | 'mile'
61
- | 'mile-scandinavian'
62
- | 'milliliter'
63
- | 'millimeter'
64
- | 'millisecond'
65
- | 'minute'
66
- | 'month'
67
- | 'ounce'
68
- | 'percent'
69
- | 'petabyte'
70
- | 'pound'
71
- | 'second'
72
- | 'stone'
73
- | 'terabit'
74
- | 'terabyte'
75
- | 'week'
76
- | 'yard'
77
- | 'year';
78
-
79
- type BaseNumberMeta = {
55
+ export type NumberMeta = BaseMeta & {
56
+ style?: 'currency' | 'decimal' | 'unit' | 'percent';
80
57
  minimumFractionDigits?: number;
81
58
  maximumFractionDigits?: number;
59
+ unit?: string; // see full list https://github.com/unicode-org/cldr/blob/master/common/validity/unit.xml
82
60
  useGrouping?: boolean;
83
- } & (
84
- | {
85
- style: 'unit';
86
- unit: NumberUnit;
87
- }
88
- | {
89
- style?: 'currency' | 'decimal' | 'percent';
90
- unit?: NumberUnit;
91
- }
92
- );
93
-
94
- export type NumberMeta = BaseMeta & BaseNumberMeta;
61
+ };
95
62
 
96
63
  export type DateMeta = BaseMeta & {
97
64
  granularity: DateGranularity;
@@ -101,23 +68,15 @@ export type RatingMeta = BaseMeta & {
101
68
  max: number;
102
69
  };
103
70
 
104
- export type PicklistMeta = BaseMeta & {
105
- picklistId: string;
106
- };
107
-
108
71
  export type FieldTypeInfo =
109
- | { type: FieldTypes.attachment }
110
72
  | { type: FieldTypes.checkbox }
111
73
  | { type: FieldTypes.date; meta: DateMeta }
112
74
  | { type: FieldTypes.email }
113
75
  | { type: FieldTypes.image }
114
- | { type: FieldTypes.link }
115
- | { type: FieldTypes.location }
116
76
  | { type: FieldTypes.multilang }
117
77
  | { type: FieldTypes.multiline }
118
78
  | { type: FieldTypes.number; meta: NumberMeta }
119
79
  | { type: FieldTypes.phoneNumber }
120
- | { type: FieldTypes.picklist; meta: PicklistMeta }
80
+ | { type: FieldTypes.picklist }
121
81
  | { type: FieldTypes.rating; meta: RatingMeta }
122
- | { type: FieldTypes.text }
123
- | { type: FieldTypes.collaborator };
82
+ | { type: FieldTypes.text };
@@ -0,0 +1,28 @@
1
+ export type Interest = {
2
+ id: string;
3
+
4
+ vehicleIds: string[];
5
+
6
+ adr?: boolean;
7
+ age?: number;
8
+ axleConfigurations?: string[];
9
+ bodywork?: string;
10
+ category: string;
11
+ crane?: boolean;
12
+ damaged?: boolean;
13
+ euronorms?: string[];
14
+ horsepower?: number;
15
+ isNew?: boolean;
16
+ kilometers?: number;
17
+ makes?: string[];
18
+ models?: { [make: string]: string[] };
19
+ price?: number;
20
+ retarderIntarder?: boolean;
21
+ suspensions?: string[];
22
+ tailgate?: boolean;
23
+ transmissions?: string[];
24
+
25
+ remarks?: string;
26
+ };
27
+
28
+ export type InterestSearchRequest = { interest: Interest; offset: number; limit: number };
@@ -1,47 +1,36 @@
1
1
  import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
2
+ ////////////////////////////////////////////////////////////////////
3
+ // Picklist
4
+ ////////////////////////////////////////////////////////////////////
2
5
 
3
6
  export type PicklistValueUpdateRequest = {
4
7
  picklistId: string;
5
8
  value: PicklistValue | NewPicklistValue;
6
9
  };
7
-
8
- export type NewPicklistValue<T = Record<string, string>> = {
10
+ export type NewPicklistValue = {
9
11
  color?: string;
10
12
  sortPriority?: number;
11
13
  titles: MultiLangValue;
12
14
  dependency?: PicklistValueDependency;
13
- meta?: T;
14
15
  };
15
-
16
- export type PicklistValue<T = any> = NewPicklistValue<T> & {
16
+ export type PicklistValue = NewPicklistValue & {
17
17
  id: string;
18
18
  system?: boolean;
19
19
  };
20
-
21
20
  export type PicklistValueListRequest = {
22
21
  picklistId: string;
23
22
  limit: number;
24
23
  offset: number;
25
- dependencies?: PicklistValueDependency[];
26
24
  };
27
-
28
25
  export type PicklistValueRequest = {
29
26
  picklistId: string;
30
27
  valueId: string;
31
28
  };
32
-
33
- export type AdHocPicklistValues<T = any> = {
29
+ export type AdHocPicklistValues = {
34
30
  [picklistId: string]: {
35
- [valueId: string]: PicklistValue<T>;
31
+ [valueId: string]: PicklistValue;
36
32
  };
37
33
  };
38
-
39
- export type AdHocPicklistRequest = {
40
- requests: PicklistValueRequest[];
41
- preferredLang: string;
42
- tenantLang: string;
43
- };
44
-
45
34
  export type AdHocPicklistValueDisplay = {
46
35
  [picklistId: string]: {
47
36
  [valueId: string]: {
@@ -50,32 +39,26 @@ export type AdHocPicklistValueDisplay = {
50
39
  };
51
40
  };
52
41
  };
53
-
54
42
  export type PicklistOptionsRequest = {
55
43
  picklistId: string;
56
44
  dependencies?: PicklistValueDependency[];
57
45
  lang: string;
58
46
  };
59
-
60
47
  export type QuickAddPicklistValue = {
61
48
  sortPriority?: number;
62
49
  titles: MultiLangValue;
63
50
  };
64
-
65
51
  export type NewPicklist = {
66
- id?: undefined;
67
52
  titles: MultiLangValue;
68
53
  values: QuickAddPicklistValue[];
69
54
  customSort?: boolean;
70
55
  };
71
-
72
56
  export type BasePicklist = {
73
57
  customSort?: boolean;
74
58
  id: string;
75
59
  system?: boolean;
76
60
  titles: MultiLangValue;
77
61
  };
78
-
79
62
  export type PicklistInfo = BasePicklist & {
80
63
  count: number;
81
64
  modifiedAt: string;
@@ -84,5 +67,3 @@ export type PicklistValueDependency = {
84
67
  picklistId: string;
85
68
  values: string[];
86
69
  };
87
-
88
- export type PicklistCollection = (BasePicklist & { data: PicklistValue[] })[];
@@ -2,9 +2,6 @@
2
2
  // Generic stuff
3
3
  ///////////////////////////////////////////////////////
4
4
 
5
- import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
6
- import { FieldTypes, NumberMeta } from './fields';
7
-
8
5
  export enum ConditionType {
9
6
  and = 'AND',
10
7
  or = 'OR',
@@ -93,13 +90,6 @@ export type SearchRequest = {
93
90
  sortBy?: SortFilter[];
94
91
  };
95
92
 
96
- export type PublicSearchRequest = {
97
- limit: number;
98
- offset?: number;
99
- query?: ComplexFilter;
100
- sortBy?: SortFilter[];
101
- };
102
-
103
93
  ///////////////////////////////////////////////////////
104
94
  // Aggregations
105
95
  ///////////////////////////////////////////////////////
@@ -117,24 +107,11 @@ export enum AggregationType {
117
107
  }
118
108
 
119
109
  export type TermAggregation = {
120
- titles: MultiLangValue;
121
- fieldId: string;
110
+ priority: number;
111
+ fieldType: 'string' | 'number' | 'boolean';
122
112
  type: AggregationType.term;
123
-
124
113
  orderBy?: 'count' | 'field';
125
- } & (
126
- | {
127
- fieldType: FieldTypes.picklist;
128
- picklistId: string;
129
- }
130
- | {
131
- fieldType: FieldTypes.number;
132
- meta?: NumberMeta;
133
- }
134
- | {
135
- fieldType: Exclude<FieldTypes, FieldTypes.picklist | FieldTypes.number>;
136
- }
137
- );
114
+ };
138
115
 
139
116
  export type Range =
140
117
  | {
@@ -151,12 +128,10 @@ export type Range =
151
128
  };
152
129
 
153
130
  export type RangeAggregation = {
154
- titles: MultiLangValue;
155
- fieldId: string;
131
+ priority: number;
156
132
  type: AggregationType.range;
157
133
  step: number;
158
134
  ranges: Range[];
159
- format?: NumberMeta;
160
135
  };
161
136
 
162
137
  export type Aggregation = TermAggregation | RangeAggregation;
@@ -176,8 +151,3 @@ export type AggregationResult = {
176
151
  export type AggregationResultSet = {
177
152
  [field: string]: AggregationResult[];
178
153
  };
179
-
180
- export type AggregationResponse<M = {}> = {
181
- results: AggregationResultSet;
182
- meta: M;
183
- };
@@ -1 +1,12 @@
1
- export * from '@bisondesk/commons-sdk/lib/storage';
1
+ export type UploadInfo = {
2
+ id: string;
3
+ uploadUrl: string;
4
+ downloadUrl: string;
5
+ };
6
+
7
+ export type GetUploadUrlRequest = {
8
+ businessEntityId: string;
9
+ fieldId: string;
10
+ fileName: string;
11
+ contentType: string;
12
+ };
@@ -1,55 +1,29 @@
1
1
  import { Region } from '@bisondesk/commons-sdk/lib/types';
2
2
 
3
- export type PublicTenant = {
4
- defaultCountry: string;
5
- defaultCurrency: string;
6
- defaultLanguage: string;
7
- id: string; // the id is provided on creation bc we assume tenants will be created by someone on the team
8
- name: string;
3
+ export type NewTenant = {
4
+ country: string;
9
5
  region: Region;
6
+ name: string;
7
+ languages: string[];
10
8
  subdomain: string;
11
-
12
- // Pay attention to what information is added here since
13
- // the tenant can be obtained without authentication
14
- };
15
-
16
- export enum TenantModule {
17
- CRM = 'crm',
18
- Docs = 'docs',
19
- Leads = 'leads',
20
- Leasing = 'leasing',
21
- Market = 'market',
22
- Opportunities = 'opportunities',
23
- VehiclesMasterData = 'vehicles_master_data',
24
- }
25
-
26
- export type Tenant = PublicTenant & {
27
- languages: [string, ...string[]];
28
- conglomerate?: string;
29
- emailDomain: string;
30
- hyperdmsIds?: string[];
31
- hyperportalId?: string;
32
- exactAccounting?: boolean;
33
- branches: [Branch, ...Branch[]];
34
- modules: TenantModule[];
9
+ currency: string;
35
10
  };
36
11
 
37
- export type Branch = {
12
+ export type Tenant = NewTenant & {
38
13
  id: string;
39
- name: string;
40
- country: string;
41
- exactAccounting?: boolean;
42
- currency: string;
43
- adminNumberPrefix: string;
44
- stockNumberPrefix: string;
14
+ subdomain: string;
15
+ // Pay attention to what information is added here since
16
+ // the tenant can be obtained without authentication
45
17
  };
46
18
 
47
19
  export type HdmsVehiclesSync = {
48
20
  active: boolean;
21
+ filterName: string;
49
22
  };
50
23
 
51
24
  export type HdmsCrmSync = {
52
25
  active: boolean;
26
+ filterName: string;
53
27
  };
54
28
 
55
29
  export type TenantSyncSettings = {
@@ -1,9 +1,4 @@
1
- import { AppRoles } from '@bisondesk/commons-sdk/lib/constants';
2
- import {
3
- AttachmentValue,
4
- PhoneNumberRawValue,
5
- PhoneNumberValue,
6
- } from '@bisondesk/commons-sdk/lib/types';
1
+ import { AttachmentValue, PhoneNumberRawValue, PhoneNumberValue } from './fields';
7
2
 
8
3
  export type NewUserRequest = {
9
4
  email: string;
@@ -11,16 +6,7 @@ export type NewUserRequest = {
11
6
  language: string;
12
7
  lastName: string;
13
8
  phone: PhoneNumberRawValue;
14
- picture?: AttachmentValue;
15
- roles: AppRoles[];
16
- };
17
-
18
- export type ValidNewUserRequest = Omit<NewUserRequest, 'phone'> & {
19
- phone: PhoneNumberValue;
20
- };
21
-
22
- export type UpdateUserRequest = Omit<User, 'phone'> & {
23
- phone: PhoneNumberRawValue | PhoneNumberValue;
9
+ roles: string[];
24
10
  };
25
11
 
26
12
  export type User = {
@@ -33,7 +19,7 @@ export type User = {
33
19
  lastName: string;
34
20
  phone: PhoneNumberValue;
35
21
  picture?: AttachmentValue;
36
- roles: AppRoles[];
22
+ roles: string[];
37
23
  updatedAt: string;
38
24
  };
39
25