@bisondesk/core-sdk 1.0.23-B → 1.0.23
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.
- package/lib/constants.d.ts +0 -77
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +1 -924
- package/lib/constants.js.map +1 -1
- package/lib/types/crm.d.ts +30 -103
- package/lib/types/crm.d.ts.map +1 -1
- package/lib/types/crm.js +0 -16
- package/lib/types/crm.js.map +1 -1
- package/lib/types/definitions.d.ts +13 -15
- package/lib/types/definitions.d.ts.map +1 -1
- package/lib/types/fields.d.ts +25 -26
- package/lib/types/fields.d.ts.map +1 -1
- package/lib/types/fields.js +0 -4
- package/lib/types/fields.js.map +1 -1
- package/lib/types/interests.d.ts +25 -0
- package/lib/types/interests.d.ts.map +1 -0
- package/lib/types/{settings.js → interests.js} +1 -1
- package/lib/types/interests.js.map +1 -0
- package/lib/types/picklists.d.ts +4 -15
- package/lib/types/picklists.d.ts.map +1 -1
- package/lib/types/search.d.ts +4 -26
- package/lib/types/search.d.ts.map +1 -1
- package/lib/types/search.js.map +1 -1
- package/lib/types/storage.d.ts +11 -1
- package/lib/types/storage.d.ts.map +1 -1
- package/lib/types/storage.js +0 -15
- package/lib/types/storage.js.map +1 -1
- package/lib/types/tenants.d.ts +9 -32
- package/lib/types/tenants.d.ts.map +1 -1
- package/lib/types/tenants.js +0 -11
- package/lib/types/tenants.js.map +1 -1
- package/lib/types/users.d.ts +3 -11
- package/lib/types/users.d.ts.map +1 -1
- package/lib/types/utils.d.ts +0 -20
- package/lib/types/utils.d.ts.map +1 -1
- package/lib/types/utils.js +0 -6
- package/lib/types/utils.js.map +1 -1
- package/lib/types/vehicles.d.ts +92 -406
- package/lib/types/vehicles.d.ts.map +1 -1
- package/lib/types/vehicles.js +1 -54
- package/lib/types/vehicles.js.map +1 -1
- package/package.json +6 -8
- package/src/constants.ts +1 -930
- package/src/types/crm.ts +30 -118
- package/src/types/definitions.ts +12 -19
- package/src/types/fields.ts +31 -72
- package/src/types/interests.ts +24 -0
- package/src/types/picklists.ts +7 -26
- package/src/types/search.ts +4 -34
- package/src/types/storage.ts +12 -1
- package/src/types/tenants.ts +11 -37
- package/src/types/users.ts +3 -17
- package/src/types/utils.ts +0 -25
- package/src/types/vehicles.ts +93 -461
- package/tsconfig.tsbuildinfo +2995 -1
- package/lib/apis/crm.d.ts +0 -39
- package/lib/apis/crm.d.ts.map +0 -1
- package/lib/apis/crm.js +0 -201
- package/lib/apis/crm.js.map +0 -1
- package/lib/apis/documents.d.ts +0 -4
- package/lib/apis/documents.d.ts.map +0 -1
- package/lib/apis/documents.js +0 -47
- package/lib/apis/documents.js.map +0 -1
- package/lib/apis/internet-vehicles.d.ts +0 -3
- package/lib/apis/internet-vehicles.d.ts.map +0 -1
- package/lib/apis/internet-vehicles.js +0 -27
- package/lib/apis/internet-vehicles.js.map +0 -1
- package/lib/apis/leasing-administration.d.ts +0 -8
- package/lib/apis/leasing-administration.d.ts.map +0 -1
- package/lib/apis/leasing-administration.js +0 -49
- package/lib/apis/leasing-administration.js.map +0 -1
- package/lib/apis/leasing.d.ts +0 -19
- package/lib/apis/leasing.d.ts.map +0 -1
- package/lib/apis/leasing.js +0 -168
- package/lib/apis/leasing.js.map +0 -1
- package/lib/apis/opportunities.d.ts +0 -9
- package/lib/apis/opportunities.d.ts.map +0 -1
- package/lib/apis/opportunities.js +0 -94
- package/lib/apis/opportunities.js.map +0 -1
- package/lib/apis/picklists.d.ts +0 -5
- package/lib/apis/picklists.d.ts.map +0 -1
- package/lib/apis/picklists.js +0 -44
- package/lib/apis/picklists.js.map +0 -1
- package/lib/apis/tenants.d.ts +0 -7
- package/lib/apis/tenants.d.ts.map +0 -1
- package/lib/apis/tenants.js +0 -80
- package/lib/apis/tenants.js.map +0 -1
- package/lib/apis/users.d.ts +0 -3
- package/lib/apis/users.d.ts.map +0 -1
- package/lib/apis/users.js +0 -26
- package/lib/apis/users.js.map +0 -1
- package/lib/apis/utils.d.ts +0 -9
- package/lib/apis/utils.d.ts.map +0 -1
- package/lib/apis/utils.js +0 -23
- package/lib/apis/utils.js.map +0 -1
- package/lib/apis/vehicles.d.ts +0 -18
- package/lib/apis/vehicles.d.ts.map +0 -1
- package/lib/apis/vehicles.js +0 -159
- package/lib/apis/vehicles.js.map +0 -1
- package/lib/ddb-entities.d.ts +0 -2
- package/lib/ddb-entities.d.ts.map +0 -1
- package/lib/ddb-entities.js +0 -5
- package/lib/ddb-entities.js.map +0 -1
- package/lib/types/activities.d.ts +0 -38
- package/lib/types/activities.d.ts.map +0 -1
- package/lib/types/activities.js +0 -16
- package/lib/types/activities.js.map +0 -1
- package/lib/types/documents.d.ts +0 -105
- package/lib/types/documents.d.ts.map +0 -1
- package/lib/types/documents.js +0 -3
- package/lib/types/documents.js.map +0 -1
- package/lib/types/internet-vehicles.d.ts +0 -64
- package/lib/types/internet-vehicles.d.ts.map +0 -1
- package/lib/types/internet-vehicles.js +0 -3
- package/lib/types/internet-vehicles.js.map +0 -1
- package/lib/types/leads.d.ts +0 -134
- package/lib/types/leads.d.ts.map +0 -1
- package/lib/types/leads.js +0 -3
- package/lib/types/leads.js.map +0 -1
- package/lib/types/leasing-administration.d.ts +0 -107
- package/lib/types/leasing-administration.d.ts.map +0 -1
- package/lib/types/leasing-administration.js +0 -3
- package/lib/types/leasing-administration.js.map +0 -1
- package/lib/types/leasing-search.d.ts +0 -22
- package/lib/types/leasing-search.d.ts.map +0 -1
- package/lib/types/leasing-search.js +0 -3
- package/lib/types/leasing-search.js.map +0 -1
- package/lib/types/leasing-settings.d.ts +0 -113
- package/lib/types/leasing-settings.d.ts.map +0 -1
- package/lib/types/leasing-settings.js +0 -10
- package/lib/types/leasing-settings.js.map +0 -1
- package/lib/types/leasing.d.ts +0 -322
- package/lib/types/leasing.d.ts.map +0 -1
- package/lib/types/leasing.js +0 -24
- package/lib/types/leasing.js.map +0 -1
- package/lib/types/machines.d.ts +0 -38
- package/lib/types/machines.d.ts.map +0 -1
- package/lib/types/machines.js +0 -3
- package/lib/types/machines.js.map +0 -1
- package/lib/types/opportunities.d.ts +0 -448
- package/lib/types/opportunities.d.ts.map +0 -1
- package/lib/types/opportunities.js +0 -68
- package/lib/types/opportunities.js.map +0 -1
- package/lib/types/payments.d.ts +0 -38
- package/lib/types/payments.d.ts.map +0 -1
- package/lib/types/payments.js +0 -9
- package/lib/types/payments.js.map +0 -1
- package/lib/types/quotes.d.ts +0 -173
- package/lib/types/quotes.d.ts.map +0 -1
- package/lib/types/quotes.js +0 -26
- package/lib/types/quotes.js.map +0 -1
- package/lib/types/recently-viewed.d.ts +0 -33
- package/lib/types/recently-viewed.d.ts.map +0 -1
- package/lib/types/recently-viewed.js +0 -3
- package/lib/types/recently-viewed.js.map +0 -1
- package/lib/types/saved-filters.d.ts +0 -20
- package/lib/types/saved-filters.d.ts.map +0 -1
- package/lib/types/saved-filters.js +0 -3
- package/lib/types/saved-filters.js.map +0 -1
- package/lib/types/settings.d.ts +0 -50
- package/lib/types/settings.d.ts.map +0 -1
- package/lib/types/settings.js.map +0 -1
- package/lib/types/templates.d.ts +0 -35
- package/lib/types/templates.d.ts.map +0 -1
- package/lib/types/templates.js +0 -9
- package/lib/types/templates.js.map +0 -1
- package/lib/types/website.d.ts +0 -24
- package/lib/types/website.d.ts.map +0 -1
- package/lib/types/website.js +0 -3
- package/lib/types/website.js.map +0 -1
- package/lib/utils/forms.d.ts +0 -6
- package/lib/utils/forms.d.ts.map +0 -1
- package/lib/utils/forms.js +0 -33
- package/lib/utils/forms.js.map +0 -1
- package/lib/utils/leasing.d.ts +0 -3
- package/lib/utils/leasing.d.ts.map +0 -1
- package/lib/utils/leasing.js +0 -10
- package/lib/utils/leasing.js.map +0 -1
- package/lib/utils/slug.d.ts +0 -3
- package/lib/utils/slug.d.ts.map +0 -1
- package/lib/utils/slug.js +0 -23
- package/lib/utils/slug.js.map +0 -1
- package/lib/utils/tenants.d.ts +0 -4
- package/lib/utils/tenants.d.ts.map +0 -1
- package/lib/utils/tenants.js +0 -16
- package/lib/utils/tenants.js.map +0 -1
- package/lib/utils/vehicles.d.ts +0 -12
- package/lib/utils/vehicles.d.ts.map +0 -1
- package/lib/utils/vehicles.js +0 -73
- package/lib/utils/vehicles.js.map +0 -1
- package/src/apis/crm.ts +0 -302
- package/src/apis/documents.ts +0 -54
- package/src/apis/internet-vehicles.ts +0 -23
- package/src/apis/leasing-administration.ts +0 -70
- package/src/apis/leasing.ts +0 -257
- package/src/apis/opportunities.ts +0 -133
- package/src/apis/picklists.ts +0 -50
- package/src/apis/tenants.ts +0 -100
- package/src/apis/users.ts +0 -22
- package/src/apis/utils.ts +0 -23
- package/src/apis/vehicles.ts +0 -229
- package/src/ddb-entities.ts +0 -1
- package/src/environment.d.ts +0 -6
- package/src/types/activities.ts +0 -41
- package/src/types/documents.ts +0 -110
- package/src/types/internet-vehicles.ts +0 -67
- package/src/types/leads.ts +0 -144
- package/src/types/leasing-administration.ts +0 -131
- package/src/types/leasing-search.ts +0 -24
- package/src/types/leasing-settings.ts +0 -111
- package/src/types/leasing.ts +0 -360
- package/src/types/machines.ts +0 -40
- package/src/types/opportunities.ts +0 -496
- package/src/types/payments.ts +0 -40
- package/src/types/quotes.ts +0 -186
- package/src/types/recently-viewed.ts +0 -45
- package/src/types/saved-filters.ts +0 -21
- package/src/types/settings.ts +0 -51
- package/src/types/templates.ts +0 -40
- package/src/types/website.ts +0 -28
- package/src/utils/forms.ts +0 -32
- package/src/utils/leasing.ts +0 -14
- package/src/utils/slug.ts +0 -19
- package/src/utils/tenants.ts +0 -14
- package/src/utils/vehicles.ts +0 -92
package/src/types/crm.ts
CHANGED
|
@@ -1,141 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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 { PhoneNumberValue } from './fields';
|
|
2
|
+
import { Interest } from './interests';
|
|
10
3
|
|
|
11
|
-
export type
|
|
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
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export type InputSearchContact = SearchContact & {
|
|
92
|
-
permissions: SearchPermissions;
|
|
21
|
+
org: Partial<Organization>;
|
|
22
|
+
contact: Partial<Contact>;
|
|
93
23
|
};
|
|
94
24
|
|
|
95
|
-
export type
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
type BaseContact = {
|
|
25
|
+
export type Contact = {
|
|
26
|
+
id: string;
|
|
27
|
+
organizationId: string;
|
|
101
28
|
accountManager?: string;
|
|
102
|
-
countryCode?: string;
|
|
103
29
|
language?: string;
|
|
104
|
-
emails: string[];
|
|
105
|
-
job?: string;
|
|
106
|
-
/** either firstName or lastName should be filled in */
|
|
107
30
|
firstName?: string;
|
|
108
|
-
lastName
|
|
109
|
-
organizationId?: string;
|
|
110
|
-
/** will not be filled if organizationId is present */
|
|
111
|
-
orgName?: string;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export type NewContact = BaseContact & {
|
|
115
|
-
id?: undefined;
|
|
116
|
-
createdAt?: undefined;
|
|
117
|
-
createdBy?: undefined;
|
|
118
|
-
phones: Array<PhoneNumberValue | PhoneNumberRawValue>;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export type Contact = BaseContact & {
|
|
122
|
-
id: string;
|
|
31
|
+
lastName: string;
|
|
123
32
|
createdAt: string;
|
|
124
33
|
createdBy: string;
|
|
125
34
|
phones: PhoneNumberValue[];
|
|
35
|
+
emails: string[];
|
|
36
|
+
job?: string;
|
|
126
37
|
};
|
|
127
38
|
|
|
128
|
-
export
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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;
|
|
47
|
+
remarks?: string;
|
|
48
|
+
};
|
|
137
49
|
|
|
138
|
-
export
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
50
|
+
export type Lead = {
|
|
51
|
+
contact: LeadContact;
|
|
52
|
+
interests: Interest[];
|
|
53
|
+
};
|
package/src/types/definitions.ts
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
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[];
|
package/src/types/fields.ts
CHANGED
|
@@ -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
|
|
35
|
-
| '
|
|
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
|
|
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,24 @@
|
|
|
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
|
+
};
|
package/src/types/picklists.ts
CHANGED
|
@@ -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
|
|
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[] })[];
|
package/src/types/search.ts
CHANGED
|
@@ -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
|
-
|
|
121
|
-
|
|
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
|
-
|
|
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
|
-
};
|
package/src/types/storage.ts
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
export
|
|
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
|
+
};
|
package/src/types/tenants.ts
CHANGED
|
@@ -1,55 +1,29 @@
|
|
|
1
1
|
import { Region } from '@bisondesk/commons-sdk/lib/types';
|
|
2
2
|
|
|
3
|
-
export type
|
|
4
|
-
|
|
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
|
|
12
|
+
export type Tenant = NewTenant & {
|
|
38
13
|
id: string;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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 = {
|
package/src/types/users.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
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:
|
|
22
|
+
roles: string[];
|
|
37
23
|
updatedAt: string;
|
|
38
24
|
};
|
|
39
25
|
|
package/src/types/utils.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
|
|
2
|
-
import { AdHocPicklistValueDisplay } from './picklists';
|
|
3
|
-
|
|
4
1
|
export type CountryInfo = {
|
|
5
2
|
code: string; // code is ISO 3166-1 alpha-2
|
|
6
3
|
name: string;
|
|
@@ -28,25 +25,3 @@ export type Country = {
|
|
|
28
25
|
name: string;
|
|
29
26
|
dialCode: number;
|
|
30
27
|
};
|
|
31
|
-
|
|
32
|
-
export type ReferenceData = {
|
|
33
|
-
recordTitles: AdHocRecordTitles;
|
|
34
|
-
picklistTitles: AdHocPicklistValueDisplay;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type AdHocRecordTitles = {
|
|
38
|
-
[businessEntityId: string]: {
|
|
39
|
-
[recordId: string]: string | MultiLangValue;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type DataRecord<T, M = undefined> = {
|
|
44
|
-
record: T;
|
|
45
|
-
meta?: M; // typically ReferenceData
|
|
46
|
-
actions: string[];
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export enum PricePercentageMode {
|
|
50
|
-
CURRENCY = 'currency',
|
|
51
|
-
PERCENTAGE = 'percentage',
|
|
52
|
-
}
|