@bisondesk/core-sdk 1.0.331 → 1.0.333
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/apis/debtors.d.ts +6 -0
- package/lib/apis/debtors.d.ts.map +1 -0
- package/lib/apis/debtors.js +25 -0
- package/lib/apis/debtors.js.map +1 -0
- package/lib/apis/leasing.d.ts +5 -1
- package/lib/apis/leasing.d.ts.map +1 -1
- package/lib/apis/leasing.js +17 -0
- package/lib/apis/leasing.js.map +1 -1
- package/lib/apis/picklists.d.ts +1 -5
- package/lib/apis/picklists.d.ts.map +1 -1
- package/lib/apis/picklists.js +1 -51
- package/lib/apis/picklists.js.map +1 -1
- package/lib/types/definitions.d.ts +1 -37
- package/lib/types/definitions.d.ts.map +1 -1
- package/lib/types/definitions.js +1 -1
- package/lib/types/definitions.js.map +1 -1
- package/lib/types/fields.d.ts +1 -82
- package/lib/types/fields.d.ts.map +1 -1
- package/lib/types/fields.js +1 -25
- package/lib/types/fields.js.map +1 -1
- package/lib/types/picklists.d.ts +1 -82
- package/lib/types/picklists.d.ts.map +1 -1
- package/lib/types/picklists.js +1 -1
- package/lib/types/picklists.js.map +1 -1
- package/lib/types/search.d.ts +1 -175
- package/lib/types/search.d.ts.map +1 -1
- package/lib/types/search.js +1 -32
- package/lib/types/search.js.map +1 -1
- package/lib/types/utils.d.ts +1 -46
- package/lib/types/utils.d.ts.map +1 -1
- package/lib/types/utils.js +1 -5
- package/lib/types/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/debtors.ts +37 -0
- package/src/apis/leasing.ts +30 -1
- package/src/apis/picklists.ts +1 -73
- package/src/types/definitions.ts +1 -43
- package/src/types/fields.ts +1 -123
- package/src/types/picklists.ts +1 -95
- package/src/types/search.ts +1 -222
- package/src/types/utils.ts +1 -52
- package/tsconfig.deploy.tsbuildinfo +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/src/types/picklists.ts
CHANGED
|
@@ -1,95 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type PicklistValueUpdateRequest = {
|
|
4
|
-
picklistId: string;
|
|
5
|
-
value: PicklistValue | NewPicklistValue;
|
|
6
|
-
tenantId?: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export type NewPicklistValue<T = Record<string, string>> = {
|
|
10
|
-
color?: string;
|
|
11
|
-
sortPriority?: number;
|
|
12
|
-
titles: MultiLangValue;
|
|
13
|
-
dependency?: PicklistValueDependency;
|
|
14
|
-
meta?: T;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type PicklistValue<T = any> = NewPicklistValue<T> & {
|
|
18
|
-
id: string;
|
|
19
|
-
system?: boolean;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type PicklistValueListRequest = {
|
|
23
|
-
picklistId: string;
|
|
24
|
-
limit: number;
|
|
25
|
-
offset: number;
|
|
26
|
-
dependencies?: PicklistValueDependency[];
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type PicklistValueRequest = {
|
|
30
|
-
picklistId: string;
|
|
31
|
-
valueId: string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type AdHocPicklistValues<T = any> = {
|
|
35
|
-
[picklistId: string]: {
|
|
36
|
-
[valueId: string]: PicklistValue<T>;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export type AdHocPicklistRequest = {
|
|
41
|
-
requests: PicklistValueRequest[];
|
|
42
|
-
preferredLang: string;
|
|
43
|
-
tenantLang: string;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export type AdHocPicklistValueDisplay = {
|
|
47
|
-
[picklistId: string]: {
|
|
48
|
-
[valueId: string]: {
|
|
49
|
-
color?: string;
|
|
50
|
-
title: string;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export type PicklistOptionsRequest = {
|
|
56
|
-
picklistId: string;
|
|
57
|
-
dependencies?: PicklistValueDependency[];
|
|
58
|
-
lang: string;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export type PicklistUpsertValueRequest = {
|
|
62
|
-
tenantId?: string;
|
|
63
|
-
picklistId: string;
|
|
64
|
-
value: PicklistValue | NewPicklistValue;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export type QuickAddPicklistValue = {
|
|
68
|
-
sortPriority?: number;
|
|
69
|
-
titles: MultiLangValue;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export type NewPicklist = {
|
|
73
|
-
id?: undefined;
|
|
74
|
-
titles: MultiLangValue;
|
|
75
|
-
values: QuickAddPicklistValue[];
|
|
76
|
-
customSort?: boolean;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export type BasePicklist = {
|
|
80
|
-
customSort?: boolean;
|
|
81
|
-
id: string;
|
|
82
|
-
system?: boolean;
|
|
83
|
-
titles: MultiLangValue;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export type PicklistInfo = BasePicklist & {
|
|
87
|
-
count: number;
|
|
88
|
-
modifiedAt: string;
|
|
89
|
-
};
|
|
90
|
-
export type PicklistValueDependency = {
|
|
91
|
-
picklistId: string;
|
|
92
|
-
values: string[];
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
export type PicklistCollection = (BasePicklist & { data: PicklistValue[] })[];
|
|
1
|
+
export * from '@bisondesk/commons-sdk/picklists';
|
package/src/types/search.ts
CHANGED
|
@@ -1,222 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// Generic stuff
|
|
3
|
-
///////////////////////////////////////////////////////
|
|
4
|
-
|
|
5
|
-
import { BusinessEntityIds, SUPPORTED_LANGUAGES } from '@bisondesk/commons-sdk/constants';
|
|
6
|
-
import { MultiLangValue } from '@bisondesk/commons-sdk/types';
|
|
7
|
-
import { FieldTypes, NumberMeta } from './fields.js';
|
|
8
|
-
|
|
9
|
-
export enum ConditionType {
|
|
10
|
-
and = 'AND',
|
|
11
|
-
or = 'OR',
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export enum ElasticsearchOperator {
|
|
15
|
-
// all properties
|
|
16
|
-
empty = 'EMPTY',
|
|
17
|
-
notEmpty = 'NOT_EMPTY',
|
|
18
|
-
is = 'IS',
|
|
19
|
-
isNot = 'IS_NOT',
|
|
20
|
-
// number, date properties
|
|
21
|
-
greaterThanOrEqual = 'GTE',
|
|
22
|
-
greaterThan = 'GT',
|
|
23
|
-
lessThanEqual = 'LTE',
|
|
24
|
-
lessThan = 'LT',
|
|
25
|
-
between = 'BETWEEN',
|
|
26
|
-
// string properties
|
|
27
|
-
contains = 'CONTAINS',
|
|
28
|
-
notContains = 'NOT_CONTAINS',
|
|
29
|
-
startsWith = 'STARTS_WITH',
|
|
30
|
-
endsWith = 'ENDS_WITH',
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export type Filter<OP = ElasticsearchOperator> = {
|
|
34
|
-
data: string;
|
|
35
|
-
fieldId: string;
|
|
36
|
-
operator: OP;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type ComplexFilter<OP = ElasticsearchOperator> = {
|
|
40
|
-
condition: ConditionType;
|
|
41
|
-
filters: Array<Filter<OP> | ComplexFilter<OP>>;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export type SearchResponse<T = any> = {
|
|
45
|
-
took: number;
|
|
46
|
-
timed_out: boolean;
|
|
47
|
-
_scroll_id?: string;
|
|
48
|
-
_shards: unknown;
|
|
49
|
-
hits: {
|
|
50
|
-
total: {
|
|
51
|
-
value: number;
|
|
52
|
-
relation: 'eq' | 'gte';
|
|
53
|
-
};
|
|
54
|
-
max_score: number;
|
|
55
|
-
hits: Array<{
|
|
56
|
-
_index: string;
|
|
57
|
-
_type: string;
|
|
58
|
-
_id: string;
|
|
59
|
-
_score: number;
|
|
60
|
-
_source?: T;
|
|
61
|
-
_version?: number;
|
|
62
|
-
_explanation?: unknown;
|
|
63
|
-
fields?: any;
|
|
64
|
-
highlight?: any;
|
|
65
|
-
inner_hits?: any;
|
|
66
|
-
matched_queries?: string[];
|
|
67
|
-
sort?: Array<string | number>;
|
|
68
|
-
}>;
|
|
69
|
-
};
|
|
70
|
-
aggregations?: { [aggName: string]: object };
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
///////////////////////////////////////////////////////
|
|
74
|
-
// Search
|
|
75
|
-
///////////////////////////////////////////////////////
|
|
76
|
-
|
|
77
|
-
export const FILTER_RANGE_SEPARATOR = '__';
|
|
78
|
-
|
|
79
|
-
export enum SortOrder {
|
|
80
|
-
asc = 'asc',
|
|
81
|
-
desc = 'desc',
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export type SortFilter = {
|
|
85
|
-
fieldId: string;
|
|
86
|
-
order: SortOrder;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export type BaseSearchRequest = {
|
|
90
|
-
fullText?: string;
|
|
91
|
-
limit: number;
|
|
92
|
-
query?: ComplexFilter<ElasticsearchOperator>;
|
|
93
|
-
sortBy?: SortFilter[];
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
type InfiniteSearchRequest = {
|
|
97
|
-
infinite: true;
|
|
98
|
-
nextToken?: string;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
type PaginatedSearchRequest = {
|
|
102
|
-
infinite?: false;
|
|
103
|
-
offset?: number;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export type SearchRequest = {
|
|
107
|
-
fullText?: string;
|
|
108
|
-
limit: number;
|
|
109
|
-
query?: ComplexFilter<ElasticsearchOperator>;
|
|
110
|
-
sortBy?: SortFilter[];
|
|
111
|
-
} & (InfiniteSearchRequest | PaginatedSearchRequest);
|
|
112
|
-
|
|
113
|
-
export type GlobalSearchRequest = {
|
|
114
|
-
fullText: string;
|
|
115
|
-
limit: number;
|
|
116
|
-
} & {
|
|
117
|
-
entityIds: BusinessEntityIds[];
|
|
118
|
-
} & (InfiniteSearchRequest | PaginatedSearchRequest);
|
|
119
|
-
|
|
120
|
-
export type GlobalSearchResult = {
|
|
121
|
-
businessEntityId: BusinessEntityIds;
|
|
122
|
-
recordId: string;
|
|
123
|
-
title: string;
|
|
124
|
-
description: string;
|
|
125
|
-
tags?: string[];
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export type GlobalSearchByIdRequest = {
|
|
129
|
-
ids: {
|
|
130
|
-
businessEntityId: BusinessEntityIds;
|
|
131
|
-
recordId: string;
|
|
132
|
-
}[];
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export type PublicSearchRequest = {
|
|
136
|
-
limit: number;
|
|
137
|
-
offset?: number;
|
|
138
|
-
query?: ComplexFilter;
|
|
139
|
-
sortBy?: SortFilter[];
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
///////////////////////////////////////////////////////
|
|
143
|
-
// Aggregations
|
|
144
|
-
///////////////////////////////////////////////////////
|
|
145
|
-
|
|
146
|
-
export type AggFilterOperator =
|
|
147
|
-
| ElasticsearchOperator.is
|
|
148
|
-
| ElasticsearchOperator.greaterThan
|
|
149
|
-
| ElasticsearchOperator.lessThan
|
|
150
|
-
| ElasticsearchOperator.greaterThanOrEqual
|
|
151
|
-
| ElasticsearchOperator.lessThanEqual;
|
|
152
|
-
|
|
153
|
-
export enum AggregationType {
|
|
154
|
-
term = 'TERM',
|
|
155
|
-
range = 'RANGE',
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export type TermAggregation = {
|
|
159
|
-
titles: MultiLangValue & { [local in (typeof SUPPORTED_LANGUAGES)[number]]: string };
|
|
160
|
-
fieldId: string;
|
|
161
|
-
type: AggregationType.term;
|
|
162
|
-
|
|
163
|
-
orderBy?: 'count' | 'field';
|
|
164
|
-
} & (
|
|
165
|
-
| {
|
|
166
|
-
fieldType: FieldTypes.picklist;
|
|
167
|
-
picklistId: string;
|
|
168
|
-
}
|
|
169
|
-
| {
|
|
170
|
-
fieldType: FieldTypes.number;
|
|
171
|
-
meta?: NumberMeta;
|
|
172
|
-
}
|
|
173
|
-
| {
|
|
174
|
-
fieldType: Exclude<FieldTypes, FieldTypes.picklist | FieldTypes.number>;
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
export type Range =
|
|
179
|
-
| {
|
|
180
|
-
start: number;
|
|
181
|
-
end?: number;
|
|
182
|
-
}
|
|
183
|
-
| {
|
|
184
|
-
start?: number;
|
|
185
|
-
end: number;
|
|
186
|
-
}
|
|
187
|
-
| {
|
|
188
|
-
start: number;
|
|
189
|
-
end: number;
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
export type RangeAggregation = {
|
|
193
|
-
titles: MultiLangValue & { [local in (typeof SUPPORTED_LANGUAGES)[number]]: string };
|
|
194
|
-
fieldId: string;
|
|
195
|
-
type: AggregationType.range;
|
|
196
|
-
step: number;
|
|
197
|
-
ranges: Range[];
|
|
198
|
-
format?: NumberMeta;
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
export type Aggregation = TermAggregation | RangeAggregation;
|
|
202
|
-
|
|
203
|
-
export type AggregationRequest = {
|
|
204
|
-
fullText?: string;
|
|
205
|
-
filters: ComplexFilter<AggFilterOperator>[];
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
export type AggregationResult = {
|
|
209
|
-
value: string;
|
|
210
|
-
count: number;
|
|
211
|
-
from?: number;
|
|
212
|
-
to?: number;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
export type AggregationResultSet = {
|
|
216
|
-
[field: string]: AggregationResult[];
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
export type AggregationResponse<M = {}> = {
|
|
220
|
-
results: AggregationResultSet;
|
|
221
|
-
meta: M;
|
|
222
|
-
};
|
|
1
|
+
export * from '@bisondesk/commons-sdk/search';
|
package/src/types/utils.ts
CHANGED
|
@@ -1,52 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { AdHocPicklistValueDisplay } from './picklists.js';
|
|
3
|
-
|
|
4
|
-
export type CountryInfo = {
|
|
5
|
-
code: string; // code is ISO 3166-1 alpha-2
|
|
6
|
-
name: string;
|
|
7
|
-
labels: {
|
|
8
|
-
city: string;
|
|
9
|
-
state: string;
|
|
10
|
-
postalCode?: string;
|
|
11
|
-
};
|
|
12
|
-
required: {
|
|
13
|
-
city: boolean;
|
|
14
|
-
state: boolean;
|
|
15
|
-
postalCode: boolean;
|
|
16
|
-
};
|
|
17
|
-
dialCode: number;
|
|
18
|
-
currencyCode: string;
|
|
19
|
-
states?: {
|
|
20
|
-
[code: string]: string; // code is ISO 3166-2
|
|
21
|
-
};
|
|
22
|
-
postalCodeFormat?: string;
|
|
23
|
-
postalCodeEx?: string;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type Country = {
|
|
27
|
-
code: string;
|
|
28
|
-
name: string;
|
|
29
|
-
dialCode: number;
|
|
30
|
-
};
|
|
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
|
-
}
|
|
1
|
+
export * from '@bisondesk/commons-sdk/utils';
|