@2bad/bitrix 3.0.0-beta.0 → 3.0.0
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/README.md +93 -186
- package/build/bin.d.ts +1 -0
- package/build/bin.js +160 -0
- package/build/client-Bk76ySik.js +769 -0
- package/build/index.d.ts +2881 -0
- package/build/index.js +1 -0
- package/package.json +43 -64
- package/build/bitrix.d.ts +0 -65
- package/build/bitrix.js +0 -55
- package/build/client/hooks/addAccessToken.d.ts +0 -6
- package/build/client/hooks/addAccessToken.js +0 -9
- package/build/client/index.d.ts +0 -15
- package/build/client/index.js +0 -53
- package/build/client/methods/batch.d.ts +0 -40
- package/build/client/methods/batch.js +0 -75
- package/build/client/methods/call.d.ts +0 -17
- package/build/client/methods/call.js +0 -27
- package/build/client/methods/list.d.ts +0 -30
- package/build/client/methods/list.js +0 -58
- package/build/commands.d.ts +0 -10
- package/build/commands.js +0 -1
- package/build/methods.d.ts +0 -92
- package/build/methods.js +0 -38
- package/build/payloads.d.ts +0 -40
- package/build/payloads.js +0 -1
- package/build/services/common.d.ts +0 -22
- package/build/services/common.js +0 -2
- package/build/services/companies/entities.d.ts +0 -54
- package/build/services/companies/entities.js +0 -1
- package/build/services/companies/index.d.ts +0 -15
- package/build/services/companies/index.js +0 -17
- package/build/services/companies/methods.d.ts +0 -44
- package/build/services/companies/methods.js +0 -1
- package/build/services/contacts/entities.d.ts +0 -45
- package/build/services/contacts/entities.js +0 -1
- package/build/services/contacts/index.d.ts +0 -15
- package/build/services/contacts/index.js +0 -17
- package/build/services/contacts/methods.d.ts +0 -44
- package/build/services/contacts/methods.js +0 -1
- package/build/services/currencies/entities.d.ts +0 -15
- package/build/services/currencies/entities.js +0 -1
- package/build/services/deals/entities.d.ts +0 -43
- package/build/services/deals/entities.js +0 -1
- package/build/services/deals/index.d.ts +0 -15
- package/build/services/deals/index.js +0 -17
- package/build/services/deals/methods.d.ts +0 -44
- package/build/services/deals/methods.js +0 -1
- package/build/services/leads/entities.d.ts +0 -49
- package/build/services/leads/entities.js +0 -1
- package/build/services/leads/index.d.ts +0 -15
- package/build/services/leads/index.js +0 -17
- package/build/services/leads/methods.d.ts +0 -44
- package/build/services/leads/methods.js +0 -1
- package/build/services/statuses/entities.d.ts +0 -16
- package/build/services/statuses/entities.js +0 -1
- package/build/services/statuses/index.d.ts +0 -14
- package/build/services/statuses/index.js +0 -19
- package/build/services/statuses/methods.d.ts +0 -51
- package/build/services/statuses/methods.js +0 -1
- package/build/services/users/entities.d.ts +0 -40
- package/build/services/users/entities.js +0 -1
- package/build/services/users/index.d.ts +0 -9
- package/build/services/users/index.js +0 -7
- package/build/services/users/methods.d.ts +0 -17
- package/build/services/users/methods.js +0 -1
- package/build/utils/Diff.d.ts +0 -1
- package/build/utils/Diff.js +0 -7
- package/build/utils/ExtractValue.d.ts +0 -6
- package/build/utils/ExtractValue.js +0 -5
- package/build/utils/isArray.d.ts +0 -2
- package/build/utils/isArray.js +0 -2
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,2881 @@
|
|
|
1
|
+
type BitrixErrorDetails = {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
readonly description: string;
|
|
4
|
+
readonly method: string;
|
|
5
|
+
readonly status?: number;
|
|
6
|
+
readonly command?: string;
|
|
7
|
+
readonly cause?: unknown;
|
|
8
|
+
};
|
|
9
|
+
export declare class BitrixError extends Error {
|
|
10
|
+
readonly name = "BitrixError";
|
|
11
|
+
readonly code: string;
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly method: string;
|
|
14
|
+
readonly status: number | undefined;
|
|
15
|
+
readonly command: string | undefined;
|
|
16
|
+
constructor({ code, description, method, status, command, cause }: BitrixErrorDetails);
|
|
17
|
+
}
|
|
18
|
+
type NumberString = string;
|
|
19
|
+
type ISODate = string;
|
|
20
|
+
type BoolString = 'Y' | 'N';
|
|
21
|
+
type Id = number | string;
|
|
22
|
+
type Field = {
|
|
23
|
+
readonly type: string;
|
|
24
|
+
readonly isRequired: boolean;
|
|
25
|
+
readonly isReadOnly: boolean;
|
|
26
|
+
readonly isImmutable: boolean;
|
|
27
|
+
readonly isMultiple: boolean;
|
|
28
|
+
readonly isDynamic: boolean;
|
|
29
|
+
readonly title: string;
|
|
30
|
+
readonly listLabel?: string;
|
|
31
|
+
readonly formLabel?: string;
|
|
32
|
+
readonly filterLabel?: string;
|
|
33
|
+
readonly statusType?: string;
|
|
34
|
+
readonly items?: ReadonlyArray<{
|
|
35
|
+
readonly ID: string;
|
|
36
|
+
readonly VALUE: string;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
type Fields = Readonly<Record<string, Field>>;
|
|
40
|
+
type MultiField = {
|
|
41
|
+
readonly ID: NumberString;
|
|
42
|
+
readonly VALUE_TYPE: string;
|
|
43
|
+
readonly VALUE: string;
|
|
44
|
+
readonly TYPE_ID: string;
|
|
45
|
+
};
|
|
46
|
+
type MultiFieldInput = {
|
|
47
|
+
readonly ID?: Id;
|
|
48
|
+
readonly VALUE: string;
|
|
49
|
+
readonly VALUE_TYPE?: string;
|
|
50
|
+
readonly DELETE?: BoolString;
|
|
51
|
+
};
|
|
52
|
+
type UserFields = {
|
|
53
|
+
readonly [field: `UF_${string}`]: unknown;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Typed user fields of each CRM entity, empty until augmented. `bitrix-types` generates the augmentation
|
|
57
|
+
* from a portal:
|
|
58
|
+
* ```ts
|
|
59
|
+
* declare module '@2bad/bitrix' {
|
|
60
|
+
* interface DealUserFields {
|
|
61
|
+
* readonly UF_CRM_1568211173: '45' | '47' | null
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
interface DealUserFields {}
|
|
67
|
+
interface LeadUserFields {}
|
|
68
|
+
interface ContactUserFields {}
|
|
69
|
+
interface CompanyUserFields {}
|
|
70
|
+
/**
|
|
71
|
+
* Value of a file user field
|
|
72
|
+
*/
|
|
73
|
+
type UserFieldFile = {
|
|
74
|
+
readonly id: number;
|
|
75
|
+
readonly showUrl: string;
|
|
76
|
+
readonly downloadUrl: string;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Accepted for a file user field on create and update: a new file as its name and base64 content,
|
|
80
|
+
* or an existing file by id
|
|
81
|
+
*/
|
|
82
|
+
type UserFieldFileInput = {
|
|
83
|
+
readonly fileData: readonly [name: string, base64: string];
|
|
84
|
+
} | {
|
|
85
|
+
readonly id: number;
|
|
86
|
+
};
|
|
87
|
+
type Utm = {
|
|
88
|
+
readonly UTM_SOURCE: string | null;
|
|
89
|
+
readonly UTM_MEDIUM: string | null;
|
|
90
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
91
|
+
readonly UTM_CONTENT: string | null;
|
|
92
|
+
readonly UTM_TERM: string | null;
|
|
93
|
+
};
|
|
94
|
+
type Address<P extends string> = { readonly [K in `${P}ADDRESS${'' | '_2' | '_CITY' | '_POSTAL_CODE' | '_REGION' | '_PROVINCE' | '_COUNTRY' | '_COUNTRY_CODE' | '_LOC_ADDR_ID'}`]: string | null; };
|
|
95
|
+
type Communications = {
|
|
96
|
+
readonly HAS_PHONE: BoolString;
|
|
97
|
+
readonly HAS_EMAIL: BoolString;
|
|
98
|
+
readonly HAS_IMOL: BoolString;
|
|
99
|
+
readonly PHONE?: readonly MultiField[];
|
|
100
|
+
readonly EMAIL?: readonly MultiField[];
|
|
101
|
+
readonly WEB?: readonly MultiField[];
|
|
102
|
+
readonly IM?: readonly MultiField[];
|
|
103
|
+
readonly LINK?: readonly MultiField[];
|
|
104
|
+
};
|
|
105
|
+
type Tracking = {
|
|
106
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
107
|
+
readonly CREATED_BY_ID: NumberString;
|
|
108
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
109
|
+
readonly DATE_CREATE: ISODate;
|
|
110
|
+
readonly DATE_MODIFY: ISODate;
|
|
111
|
+
readonly OPENED: BoolString;
|
|
112
|
+
readonly ORIGINATOR_ID: string | null;
|
|
113
|
+
readonly ORIGIN_ID: string | null;
|
|
114
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
115
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
116
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
117
|
+
};
|
|
118
|
+
type Deal = DealUserFields & UserFields & Utm & Tracking & {
|
|
119
|
+
readonly ID: NumberString;
|
|
120
|
+
readonly TITLE: string | null;
|
|
121
|
+
readonly TYPE_ID: string | null;
|
|
122
|
+
readonly CATEGORY_ID: NumberString;
|
|
123
|
+
readonly STAGE_ID: string;
|
|
124
|
+
readonly PREVIOUS_STAGE_ID?: string | null;
|
|
125
|
+
readonly STAGE_SEMANTIC_ID: string;
|
|
126
|
+
readonly IS_NEW: BoolString;
|
|
127
|
+
readonly IS_RECURRING: BoolString;
|
|
128
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
129
|
+
readonly IS_REPEATED_APPROACH: BoolString;
|
|
130
|
+
readonly PROBABILITY: NumberString | null;
|
|
131
|
+
readonly CURRENCY_ID: string;
|
|
132
|
+
readonly OPPORTUNITY: NumberString;
|
|
133
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
134
|
+
readonly TAX_VALUE: NumberString | null;
|
|
135
|
+
readonly COMPANY_ID: NumberString;
|
|
136
|
+
readonly MYCOMPANY_ID?: NumberString | null;
|
|
137
|
+
readonly CONTACT_ID: NumberString | null;
|
|
138
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
139
|
+
readonly QUOTE_ID: NumberString | null;
|
|
140
|
+
readonly BEGINDATE: ISODate;
|
|
141
|
+
readonly CLOSEDATE: ISODate;
|
|
142
|
+
readonly CLOSED: BoolString;
|
|
143
|
+
readonly COMMENTS: string | null;
|
|
144
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
145
|
+
readonly MOVED_TIME: ISODate | null;
|
|
146
|
+
readonly SOURCE_ID: string | null;
|
|
147
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
148
|
+
readonly LEAD_ID: NumberString | null;
|
|
149
|
+
readonly ADDITIONAL_INFO: string | null;
|
|
150
|
+
readonly LOCATION_ID: string | null;
|
|
151
|
+
};
|
|
152
|
+
type Lead = LeadUserFields & UserFields & Utm & Tracking & Communications & Address<''> & {
|
|
153
|
+
readonly ID: NumberString;
|
|
154
|
+
readonly TITLE: string | null;
|
|
155
|
+
readonly HONORIFIC: string | null;
|
|
156
|
+
readonly NAME: string | null;
|
|
157
|
+
readonly SECOND_NAME: string | null;
|
|
158
|
+
readonly LAST_NAME: string | null;
|
|
159
|
+
readonly BIRTHDATE: ISODate;
|
|
160
|
+
readonly COMPANY_TITLE: string | null;
|
|
161
|
+
readonly SOURCE_ID: string | null;
|
|
162
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
163
|
+
readonly STATUS_ID: string;
|
|
164
|
+
readonly STATUS_DESCRIPTION: string | null;
|
|
165
|
+
readonly STATUS_SEMANTIC_ID: string;
|
|
166
|
+
readonly POST: string | null;
|
|
167
|
+
readonly CURRENCY_ID: string;
|
|
168
|
+
readonly OPPORTUNITY: NumberString;
|
|
169
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
170
|
+
readonly COMMENTS: string | null;
|
|
171
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
172
|
+
readonly MOVED_TIME: ISODate | null;
|
|
173
|
+
readonly COMPANY_ID: NumberString | null;
|
|
174
|
+
readonly CONTACT_ID: NumberString | null;
|
|
175
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
176
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
177
|
+
readonly DATE_CLOSED: ISODate;
|
|
178
|
+
};
|
|
179
|
+
type Contact = ContactUserFields & UserFields & Utm & Tracking & Communications & Address<''> & {
|
|
180
|
+
readonly ID: NumberString;
|
|
181
|
+
readonly HONORIFIC: string | null;
|
|
182
|
+
readonly NAME: string | null;
|
|
183
|
+
readonly SECOND_NAME: string | null;
|
|
184
|
+
readonly LAST_NAME: string | null;
|
|
185
|
+
readonly PHOTO: unknown;
|
|
186
|
+
readonly BIRTHDATE: ISODate;
|
|
187
|
+
readonly TYPE_ID: string | null;
|
|
188
|
+
readonly SOURCE_ID: string | null;
|
|
189
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
190
|
+
readonly POST: string | null;
|
|
191
|
+
readonly COMMENTS: string | null;
|
|
192
|
+
readonly EXPORT: BoolString;
|
|
193
|
+
readonly COMPANY_ID: NumberString | null;
|
|
194
|
+
readonly COMPANY_IDS?: readonly NumberString[];
|
|
195
|
+
readonly LEAD_ID: NumberString | null;
|
|
196
|
+
readonly ORIGIN_VERSION: string | null;
|
|
197
|
+
};
|
|
198
|
+
type Company = CompanyUserFields & UserFields & Utm & Tracking & Communications & Address<''> & Address<'REG_'> & {
|
|
199
|
+
readonly ID: NumberString;
|
|
200
|
+
readonly TITLE: string;
|
|
201
|
+
readonly COMPANY_TYPE: string | null;
|
|
202
|
+
readonly LOGO: unknown;
|
|
203
|
+
readonly ADDRESS_LEGAL: string | null;
|
|
204
|
+
readonly BANKING_DETAILS: string | null;
|
|
205
|
+
readonly INDUSTRY: string | null;
|
|
206
|
+
readonly EMPLOYEES: string | null;
|
|
207
|
+
readonly CURRENCY_ID: string | null;
|
|
208
|
+
readonly REVENUE: NumberString | null;
|
|
209
|
+
readonly COMMENTS: string | null;
|
|
210
|
+
readonly IS_MY_COMPANY: BoolString;
|
|
211
|
+
readonly CONTACT_ID?: readonly NumberString[];
|
|
212
|
+
readonly LEAD_ID: NumberString | null;
|
|
213
|
+
readonly ORIGIN_VERSION: string | null;
|
|
214
|
+
};
|
|
215
|
+
type ActivityCommunication = {
|
|
216
|
+
readonly ID?: NumberString;
|
|
217
|
+
readonly TYPE: string;
|
|
218
|
+
readonly VALUE: string;
|
|
219
|
+
readonly ENTITY_ID: Id;
|
|
220
|
+
readonly ENTITY_TYPE_ID: Id;
|
|
221
|
+
};
|
|
222
|
+
type Activity = {
|
|
223
|
+
readonly ID: NumberString;
|
|
224
|
+
readonly OWNER_ID: NumberString;
|
|
225
|
+
readonly OWNER_TYPE_ID: NumberString;
|
|
226
|
+
readonly TYPE_ID: NumberString;
|
|
227
|
+
readonly PROVIDER_ID: string;
|
|
228
|
+
readonly PROVIDER_TYPE_ID: string;
|
|
229
|
+
readonly PROVIDER_GROUP_ID: string | null;
|
|
230
|
+
readonly ASSOCIATED_ENTITY_ID: NumberString;
|
|
231
|
+
readonly SUBJECT: string;
|
|
232
|
+
readonly START_TIME: ISODate | null;
|
|
233
|
+
readonly END_TIME: ISODate | null;
|
|
234
|
+
readonly DEADLINE: ISODate | null;
|
|
235
|
+
readonly COMPLETED: BoolString;
|
|
236
|
+
readonly STATUS: NumberString;
|
|
237
|
+
readonly RESPONSIBLE_ID: NumberString;
|
|
238
|
+
readonly PRIORITY: NumberString;
|
|
239
|
+
readonly NOTIFY_TYPE: NumberString;
|
|
240
|
+
readonly NOTIFY_VALUE: NumberString;
|
|
241
|
+
readonly DESCRIPTION: string;
|
|
242
|
+
readonly DESCRIPTION_TYPE: NumberString;
|
|
243
|
+
readonly DIRECTION: NumberString;
|
|
244
|
+
readonly LOCATION: string;
|
|
245
|
+
readonly CREATED: ISODate;
|
|
246
|
+
readonly AUTHOR_ID: NumberString;
|
|
247
|
+
readonly LAST_UPDATED: ISODate;
|
|
248
|
+
readonly EDITOR_ID: NumberString;
|
|
249
|
+
readonly SETTINGS: unknown;
|
|
250
|
+
readonly ORIGIN_ID: string | null;
|
|
251
|
+
readonly ORIGINATOR_ID: string | null;
|
|
252
|
+
readonly RESULT_STATUS: NumberString;
|
|
253
|
+
readonly RESULT_STREAM: NumberString;
|
|
254
|
+
readonly RESULT_SOURCE_ID: string | null;
|
|
255
|
+
readonly PROVIDER_PARAMS: unknown;
|
|
256
|
+
readonly PROVIDER_DATA: string | null;
|
|
257
|
+
readonly RESULT_MARK: NumberString;
|
|
258
|
+
readonly RESULT_VALUE: NumberString | null;
|
|
259
|
+
readonly RESULT_SUM: NumberString | null;
|
|
260
|
+
readonly RESULT_CURRENCY_ID: string | null;
|
|
261
|
+
readonly AUTOCOMPLETE_RULE: NumberString;
|
|
262
|
+
readonly BINDINGS?: ReadonlyArray<{
|
|
263
|
+
readonly OWNER_ID: NumberString;
|
|
264
|
+
readonly OWNER_TYPE_ID: NumberString;
|
|
265
|
+
}>;
|
|
266
|
+
readonly COMMUNICATIONS?: readonly ActivityCommunication[];
|
|
267
|
+
readonly FILES?: readonly unknown[];
|
|
268
|
+
readonly IS_INCOMING_CHANNEL?: BoolString;
|
|
269
|
+
};
|
|
270
|
+
type Status = {
|
|
271
|
+
readonly ID: NumberString;
|
|
272
|
+
readonly ENTITY_ID: string;
|
|
273
|
+
readonly STATUS_ID: string;
|
|
274
|
+
readonly NAME: string;
|
|
275
|
+
readonly NAME_INIT: string;
|
|
276
|
+
readonly SORT: NumberString;
|
|
277
|
+
readonly SYSTEM: BoolString;
|
|
278
|
+
readonly CATEGORY_ID: NumberString | null;
|
|
279
|
+
readonly COLOR: string | null;
|
|
280
|
+
readonly SEMANTICS: string | null;
|
|
281
|
+
readonly DESCRIPTION?: string | null;
|
|
282
|
+
readonly EXTRA?: {
|
|
283
|
+
readonly SEMANTICS?: string;
|
|
284
|
+
readonly COLOR?: string;
|
|
285
|
+
readonly [key: string]: unknown;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
type CurrencyLocalization = {
|
|
289
|
+
readonly FULL_NAME: string;
|
|
290
|
+
readonly FORMAT_STRING: string;
|
|
291
|
+
readonly DEC_POINT: string;
|
|
292
|
+
readonly THOUSANDS_SEP: string | null;
|
|
293
|
+
readonly THOUSANDS_VARIANT?: string | null;
|
|
294
|
+
readonly DECIMALS: NumberString;
|
|
295
|
+
readonly HIDE_ZERO?: BoolString;
|
|
296
|
+
};
|
|
297
|
+
type Currency = CurrencyLocalization & {
|
|
298
|
+
readonly CURRENCY: string;
|
|
299
|
+
readonly AMOUNT_CNT: NumberString;
|
|
300
|
+
readonly AMOUNT: NumberString;
|
|
301
|
+
readonly SORT: NumberString;
|
|
302
|
+
readonly BASE: BoolString;
|
|
303
|
+
readonly LID: string;
|
|
304
|
+
readonly DATE_UPDATE: ISODate;
|
|
305
|
+
readonly LANG?: Readonly<Record<string, CurrencyLocalization>>;
|
|
306
|
+
};
|
|
307
|
+
type ProductRow = {
|
|
308
|
+
readonly ID: NumberString;
|
|
309
|
+
readonly OWNER_ID: NumberString;
|
|
310
|
+
readonly OWNER_TYPE: string;
|
|
311
|
+
readonly PRODUCT_ID: number;
|
|
312
|
+
readonly PRODUCT_NAME: string;
|
|
313
|
+
readonly ORIGINAL_PRODUCT_NAME: string | null;
|
|
314
|
+
readonly PRODUCT_DESCRIPTION: string | null;
|
|
315
|
+
readonly PRICE: number;
|
|
316
|
+
readonly PRICE_EXCLUSIVE: number;
|
|
317
|
+
readonly PRICE_NETTO: number;
|
|
318
|
+
readonly PRICE_BRUTTO: number;
|
|
319
|
+
readonly PRICE_ACCOUNT: string;
|
|
320
|
+
readonly QUANTITY: number;
|
|
321
|
+
readonly DISCOUNT_TYPE_ID: number;
|
|
322
|
+
readonly DISCOUNT_RATE: number;
|
|
323
|
+
readonly DISCOUNT_SUM: number;
|
|
324
|
+
readonly TAX_RATE: number | null;
|
|
325
|
+
readonly TAX_NAME: string;
|
|
326
|
+
readonly TAX_INCLUDED: BoolString;
|
|
327
|
+
readonly CUSTOMIZED: BoolString;
|
|
328
|
+
readonly MEASURE_CODE: number;
|
|
329
|
+
readonly MEASURE_NAME: string;
|
|
330
|
+
readonly SORT: number;
|
|
331
|
+
readonly XML_ID: string;
|
|
332
|
+
readonly TYPE: number;
|
|
333
|
+
readonly STORE_ID: number | null;
|
|
334
|
+
readonly RESERVE_ID: number | null;
|
|
335
|
+
readonly DATE_RESERVE_END: ISODate | null;
|
|
336
|
+
readonly RESERVE_QUANTITY: number | null;
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* Binding between CRM entities, like a contact of a deal under `CONTACT_ID`
|
|
340
|
+
*/
|
|
341
|
+
type Link<K extends string> = { readonly [P in K]: number; } & {
|
|
342
|
+
readonly SORT: number;
|
|
343
|
+
readonly ROLE_ID: number;
|
|
344
|
+
readonly IS_PRIMARY: BoolString;
|
|
345
|
+
};
|
|
346
|
+
type LinkInput<K extends string> = { readonly [P in K]: Id; } & {
|
|
347
|
+
readonly SORT?: number;
|
|
348
|
+
readonly IS_PRIMARY?: BoolString;
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* Item of `crm.item.*`, which covers smart processes and every other CRM type. Fields are camelCase with native
|
|
352
|
+
* numbers, the set depends on the type, and user fields come as `ufCrm<type>_<id>`
|
|
353
|
+
*/
|
|
354
|
+
type CrmItem = {
|
|
355
|
+
readonly [field: `ufCrm${string}`]: unknown;
|
|
356
|
+
readonly id: number;
|
|
357
|
+
readonly entityTypeId?: number;
|
|
358
|
+
readonly xmlId?: string | null;
|
|
359
|
+
readonly title?: string | null;
|
|
360
|
+
readonly createdBy?: number;
|
|
361
|
+
readonly updatedBy?: number;
|
|
362
|
+
readonly movedBy?: number | null;
|
|
363
|
+
readonly createdTime?: ISODate;
|
|
364
|
+
readonly updatedTime?: ISODate;
|
|
365
|
+
readonly movedTime?: ISODate | null;
|
|
366
|
+
readonly categoryId?: number;
|
|
367
|
+
readonly typeId?: string | null;
|
|
368
|
+
readonly opened?: BoolString;
|
|
369
|
+
readonly closed?: BoolString;
|
|
370
|
+
readonly stageId?: string;
|
|
371
|
+
readonly previousStageId?: string | null;
|
|
372
|
+
readonly stageSemanticId?: string;
|
|
373
|
+
readonly begindate?: ISODate;
|
|
374
|
+
readonly closedate?: ISODate;
|
|
375
|
+
readonly leadId?: number | null;
|
|
376
|
+
readonly quoteId?: number | null;
|
|
377
|
+
readonly companyId?: number | null;
|
|
378
|
+
readonly contactId?: number | null;
|
|
379
|
+
readonly contactIds?: readonly number[];
|
|
380
|
+
readonly mycompanyId?: number | null;
|
|
381
|
+
readonly opportunity?: number;
|
|
382
|
+
readonly isManualOpportunity?: BoolString;
|
|
383
|
+
readonly probability?: number | null;
|
|
384
|
+
readonly taxValue?: number | null;
|
|
385
|
+
readonly currencyId?: string;
|
|
386
|
+
readonly comments?: string | null;
|
|
387
|
+
readonly sourceId?: string | null;
|
|
388
|
+
readonly sourceDescription?: string | null;
|
|
389
|
+
readonly originatorId?: string | null;
|
|
390
|
+
readonly originId?: string | null;
|
|
391
|
+
readonly webformId?: number | null;
|
|
392
|
+
readonly assignedById?: number;
|
|
393
|
+
readonly observers?: readonly number[];
|
|
394
|
+
readonly lastActivityTime?: ISODate | null;
|
|
395
|
+
readonly lastActivityBy?: number | null;
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* Shape accepted when creating or updating an entity: every field optional, ids as numbers or strings
|
|
399
|
+
*/
|
|
400
|
+
type Present<T> = Exclude<T, null | undefined | false>;
|
|
401
|
+
type Input<E> = { readonly [K in keyof E]?: Present<E[K]> extends readonly MultiField[] ? readonly MultiFieldInput[] : Present<E[K]> extends UserFieldFile ? UserFieldFileInput | null : Present<E[K]> extends readonly UserFieldFile[] ? readonly UserFieldFileInput[] : Present<E[K]> extends string ? E[K] | number : E[K]; };
|
|
402
|
+
/**
|
|
403
|
+
* Catalog methods use camelCase fields with native numbers. Custom properties come as `property<ID>`
|
|
404
|
+
* and only the selected fields are returned
|
|
405
|
+
*/
|
|
406
|
+
type Product = {
|
|
407
|
+
readonly [field: `property${number}`]: unknown;
|
|
408
|
+
readonly id: number;
|
|
409
|
+
readonly iblockId: number;
|
|
410
|
+
readonly name?: string;
|
|
411
|
+
readonly active?: BoolString;
|
|
412
|
+
readonly available?: BoolString;
|
|
413
|
+
readonly bundle?: BoolString;
|
|
414
|
+
readonly code?: string | null;
|
|
415
|
+
readonly xmlId?: string | null;
|
|
416
|
+
readonly sort?: number;
|
|
417
|
+
readonly type?: number;
|
|
418
|
+
readonly iblockSectionId?: number | null;
|
|
419
|
+
readonly iblockSection?: readonly number[];
|
|
420
|
+
readonly previewText?: string | null;
|
|
421
|
+
readonly previewTextType?: string;
|
|
422
|
+
readonly detailText?: string | null;
|
|
423
|
+
readonly detailTextType?: string;
|
|
424
|
+
readonly previewPicture?: unknown;
|
|
425
|
+
readonly detailPicture?: unknown;
|
|
426
|
+
readonly dateActiveFrom?: ISODate | null;
|
|
427
|
+
readonly dateActiveTo?: ISODate | null;
|
|
428
|
+
readonly dateCreate?: ISODate;
|
|
429
|
+
readonly timestampX?: ISODate;
|
|
430
|
+
readonly createdBy?: number;
|
|
431
|
+
readonly modifiedBy?: number;
|
|
432
|
+
readonly measure?: number;
|
|
433
|
+
readonly quantity?: number;
|
|
434
|
+
readonly purchasingPrice?: number | null;
|
|
435
|
+
readonly purchasingCurrency?: string | null;
|
|
436
|
+
readonly vatId?: number | null;
|
|
437
|
+
readonly vatIncluded?: BoolString;
|
|
438
|
+
readonly weight?: number | null;
|
|
439
|
+
};
|
|
440
|
+
type ProductField = {
|
|
441
|
+
readonly name: string;
|
|
442
|
+
readonly type: string;
|
|
443
|
+
readonly isRequired: boolean;
|
|
444
|
+
readonly isReadOnly: boolean;
|
|
445
|
+
readonly isImmutable: boolean;
|
|
446
|
+
readonly isMultiple?: boolean;
|
|
447
|
+
readonly propertyType?: string;
|
|
448
|
+
readonly values?: unknown;
|
|
449
|
+
};
|
|
450
|
+
/**
|
|
451
|
+
* `user.get` leaves out fields that are empty, so everything except the id is optional
|
|
452
|
+
*/
|
|
453
|
+
type User = {
|
|
454
|
+
readonly [field: `UF_${string}`]: unknown;
|
|
455
|
+
readonly ID: NumberString;
|
|
456
|
+
readonly XML_ID?: string;
|
|
457
|
+
readonly ACTIVE?: boolean;
|
|
458
|
+
readonly NAME?: string;
|
|
459
|
+
readonly LAST_NAME?: string;
|
|
460
|
+
readonly SECOND_NAME?: string;
|
|
461
|
+
readonly TITLE?: string;
|
|
462
|
+
readonly EMAIL?: string;
|
|
463
|
+
readonly LAST_LOGIN?: ISODate;
|
|
464
|
+
readonly DATE_REGISTER?: ISODate;
|
|
465
|
+
readonly TIME_ZONE?: string;
|
|
466
|
+
readonly IS_ONLINE?: 'Y' | 'N';
|
|
467
|
+
readonly TIMESTAMP_X?: unknown;
|
|
468
|
+
readonly LAST_ACTIVITY_DATE?: unknown;
|
|
469
|
+
readonly PERSONAL_GENDER?: 'M' | 'F' | '';
|
|
470
|
+
readonly PERSONAL_PROFESSION?: string;
|
|
471
|
+
readonly PERSONAL_WWW?: string;
|
|
472
|
+
readonly PERSONAL_BIRTHDAY?: ISODate;
|
|
473
|
+
readonly PERSONAL_PHOTO?: string;
|
|
474
|
+
readonly PERSONAL_ICQ?: string;
|
|
475
|
+
readonly PERSONAL_PHONE?: string;
|
|
476
|
+
readonly PERSONAL_FAX?: string;
|
|
477
|
+
readonly PERSONAL_MOBILE?: string;
|
|
478
|
+
readonly PERSONAL_PAGER?: string;
|
|
479
|
+
readonly PERSONAL_STREET?: string;
|
|
480
|
+
readonly PERSONAL_MAILBOX?: string;
|
|
481
|
+
readonly PERSONAL_CITY?: string;
|
|
482
|
+
readonly PERSONAL_STATE?: string;
|
|
483
|
+
readonly PERSONAL_ZIP?: string;
|
|
484
|
+
readonly PERSONAL_COUNTRY?: string;
|
|
485
|
+
readonly PERSONAL_NOTES?: string;
|
|
486
|
+
readonly WORK_COMPANY?: string;
|
|
487
|
+
readonly WORK_POSITION?: string;
|
|
488
|
+
readonly WORK_PHONE?: string;
|
|
489
|
+
readonly WORK_DEPARTMENT?: string;
|
|
490
|
+
readonly WORK_WWW?: string;
|
|
491
|
+
readonly WORK_FAX?: string;
|
|
492
|
+
readonly WORK_PAGER?: string;
|
|
493
|
+
readonly WORK_STREET?: string;
|
|
494
|
+
readonly WORK_MAILBOX?: string;
|
|
495
|
+
readonly WORK_CITY?: string;
|
|
496
|
+
readonly WORK_STATE?: string;
|
|
497
|
+
readonly WORK_ZIP?: string;
|
|
498
|
+
readonly WORK_COUNTRY?: string;
|
|
499
|
+
readonly WORK_PROFILE?: string;
|
|
500
|
+
readonly WORK_LOGO?: string;
|
|
501
|
+
readonly WORK_NOTES?: string;
|
|
502
|
+
readonly UF_DEPARTMENT?: readonly number[];
|
|
503
|
+
readonly USER_TYPE?: string;
|
|
504
|
+
};
|
|
505
|
+
type Empty = Readonly<Record<string, never>>;
|
|
506
|
+
type FilterValue = string | number | boolean | null | ReadonlyArray<string | number>;
|
|
507
|
+
type Filter = Readonly<Record<string, FilterValue>>;
|
|
508
|
+
type Order = 'ASC' | 'DESC' | 'asc' | 'desc';
|
|
509
|
+
type MultiFields = 'PHONE' | 'EMAIL' | 'WEB' | 'IM' | 'LINK';
|
|
510
|
+
type SelectField<E> = (keyof E & string) | '*' | 'UF_*' | MultiFields;
|
|
511
|
+
type ListParams<E, S extends readonly SelectField<E>[] = readonly SelectField<E>[]> = {
|
|
512
|
+
readonly select?: S;
|
|
513
|
+
readonly filter?: Filter;
|
|
514
|
+
readonly order?: { readonly [K in keyof E & string]?: Order; };
|
|
515
|
+
readonly start?: number;
|
|
516
|
+
};
|
|
517
|
+
type Standard<E> = Omit<E, `UF_${string}` | MultiFields>;
|
|
518
|
+
type Nothing = Record<never, never>;
|
|
519
|
+
type Flatten<T> = { [K in keyof T]: T[K]; };
|
|
520
|
+
/**
|
|
521
|
+
* Row type of a CRM list for a given `select`: `*` and no select give the standard fields, `UF_*` adds
|
|
522
|
+
* user fields, named fields are picked as they are
|
|
523
|
+
*/
|
|
524
|
+
type Selected<E, S extends readonly string[]> = Flatten<S extends readonly [] ? Standard<E> : ('*' extends S[number] ? Standard<E> : Nothing) & ('UF_*' extends S[number] ? Pick<E, keyof E & `UF_${string}`> : Nothing) & Pick<E, S[number] & keyof E>>;
|
|
525
|
+
type SonetParams$1 = {
|
|
526
|
+
readonly params?: {
|
|
527
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
528
|
+
};
|
|
529
|
+
};
|
|
530
|
+
type CrmMethods<Name extends string, E> = Record<`crm.${Name}.fields`, {
|
|
531
|
+
params: Empty;
|
|
532
|
+
result: Fields;
|
|
533
|
+
}> & Record<`crm.${Name}.get`, {
|
|
534
|
+
params: {
|
|
535
|
+
readonly id: Id;
|
|
536
|
+
};
|
|
537
|
+
result: E;
|
|
538
|
+
}> & Record<`crm.${Name}.list`, {
|
|
539
|
+
params: ListParams<E>;
|
|
540
|
+
result: E[];
|
|
541
|
+
}> & Record<`crm.${Name}.add`, {
|
|
542
|
+
params: {
|
|
543
|
+
readonly fields: Input<E>;
|
|
544
|
+
} & SonetParams$1;
|
|
545
|
+
result: number;
|
|
546
|
+
}> & Record<`crm.${Name}.update`, {
|
|
547
|
+
params: {
|
|
548
|
+
readonly id: Id;
|
|
549
|
+
readonly fields: Input<E>;
|
|
550
|
+
} & SonetParams$1;
|
|
551
|
+
result: boolean;
|
|
552
|
+
}> & Record<`crm.${Name}.delete`, {
|
|
553
|
+
params: {
|
|
554
|
+
readonly id: Id;
|
|
555
|
+
};
|
|
556
|
+
result: boolean;
|
|
557
|
+
}>;
|
|
558
|
+
type ProductRowMethods<Name extends string> = Record<`crm.${Name}.productrows.get`, {
|
|
559
|
+
params: {
|
|
560
|
+
readonly id: Id;
|
|
561
|
+
};
|
|
562
|
+
result: ProductRow[];
|
|
563
|
+
}> & Record<`crm.${Name}.productrows.set`, {
|
|
564
|
+
params: {
|
|
565
|
+
readonly id: Id;
|
|
566
|
+
readonly rows: ReadonlyArray<Input<ProductRow>>;
|
|
567
|
+
};
|
|
568
|
+
result: boolean;
|
|
569
|
+
}>;
|
|
570
|
+
type LinkMethods<Owner extends string, Linked extends string, K extends string> = Record<`crm.${Owner}.${Linked}.fields`, {
|
|
571
|
+
params: Empty;
|
|
572
|
+
result: Fields;
|
|
573
|
+
}> & Record<`crm.${Owner}.${Linked}.items.get`, {
|
|
574
|
+
params: {
|
|
575
|
+
readonly id: Id;
|
|
576
|
+
};
|
|
577
|
+
result: Link<K>[];
|
|
578
|
+
}> & Record<`crm.${Owner}.${Linked}.items.set`, {
|
|
579
|
+
params: {
|
|
580
|
+
readonly id: Id;
|
|
581
|
+
readonly items: ReadonlyArray<LinkInput<K>>;
|
|
582
|
+
};
|
|
583
|
+
result: boolean;
|
|
584
|
+
}> & Record<`crm.${Owner}.${Linked}.items.delete`, {
|
|
585
|
+
params: {
|
|
586
|
+
readonly id: Id;
|
|
587
|
+
};
|
|
588
|
+
result: boolean;
|
|
589
|
+
}> & Record<`crm.${Owner}.${Linked}.add`, {
|
|
590
|
+
params: {
|
|
591
|
+
readonly id: Id;
|
|
592
|
+
readonly fields: LinkInput<K>;
|
|
593
|
+
};
|
|
594
|
+
result: boolean;
|
|
595
|
+
}> & Record<`crm.${Owner}.${Linked}.delete`, {
|
|
596
|
+
params: {
|
|
597
|
+
readonly id: Id;
|
|
598
|
+
readonly fields: { readonly [P in K]: Id; };
|
|
599
|
+
};
|
|
600
|
+
result: boolean;
|
|
601
|
+
}>;
|
|
602
|
+
type EntityType = {
|
|
603
|
+
readonly entityTypeId: number;
|
|
604
|
+
};
|
|
605
|
+
type CurrencyInput = Input<Omit<Currency, 'LANG'>> & {
|
|
606
|
+
readonly LANG?: Readonly<Record<string, Input<CurrencyLocalization>>>;
|
|
607
|
+
};
|
|
608
|
+
type ProductFilter = Filter & {
|
|
609
|
+
readonly iblockId: number;
|
|
610
|
+
};
|
|
611
|
+
type ProductInput = Input<Product> & {
|
|
612
|
+
readonly iblockId: number;
|
|
613
|
+
readonly name: string;
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* Registry of typed REST methods. Augment it to type methods the client does not cover:
|
|
617
|
+
* ```ts
|
|
618
|
+
* declare module '@2bad/bitrix' {
|
|
619
|
+
* interface Methods {
|
|
620
|
+
* 'tasks.task.get': { params: { taskId: number }; result: { task: Task } }
|
|
621
|
+
* }
|
|
622
|
+
* }
|
|
623
|
+
* ```
|
|
624
|
+
*/
|
|
625
|
+
interface Methods extends CrmMethods<'deal', Deal>, CrmMethods<'lead', Lead>, CrmMethods<'contact', Contact>, CrmMethods<'company', Company>, CrmMethods<'activity', Activity>, ProductRowMethods<'deal'>, ProductRowMethods<'lead'>, LinkMethods<'deal', 'contact', 'CONTACT_ID'>, LinkMethods<'lead', 'contact', 'CONTACT_ID'>, LinkMethods<'company', 'contact', 'CONTACT_ID'>, LinkMethods<'contact', 'company', 'COMPANY_ID'> {
|
|
626
|
+
'crm.status.fields': {
|
|
627
|
+
params: Empty;
|
|
628
|
+
result: Fields;
|
|
629
|
+
};
|
|
630
|
+
'crm.status.get': {
|
|
631
|
+
params: {
|
|
632
|
+
readonly id: Id;
|
|
633
|
+
};
|
|
634
|
+
result: Status;
|
|
635
|
+
};
|
|
636
|
+
'crm.status.list': {
|
|
637
|
+
params: Pick<ListParams<Status>, 'filter' | 'order'>;
|
|
638
|
+
result: Status[];
|
|
639
|
+
};
|
|
640
|
+
'crm.status.add': {
|
|
641
|
+
params: {
|
|
642
|
+
readonly fields: Input<Status>;
|
|
643
|
+
};
|
|
644
|
+
result: number;
|
|
645
|
+
};
|
|
646
|
+
'crm.status.update': {
|
|
647
|
+
params: {
|
|
648
|
+
readonly id: Id;
|
|
649
|
+
readonly fields: Input<Status>;
|
|
650
|
+
};
|
|
651
|
+
result: boolean;
|
|
652
|
+
};
|
|
653
|
+
'crm.status.delete': {
|
|
654
|
+
params: {
|
|
655
|
+
readonly id: Id;
|
|
656
|
+
readonly params?: {
|
|
657
|
+
readonly FORCED?: BoolString;
|
|
658
|
+
};
|
|
659
|
+
};
|
|
660
|
+
result: boolean;
|
|
661
|
+
};
|
|
662
|
+
'crm.currency.fields': {
|
|
663
|
+
params: Empty;
|
|
664
|
+
result: Fields;
|
|
665
|
+
};
|
|
666
|
+
'crm.currency.get': {
|
|
667
|
+
params: {
|
|
668
|
+
readonly id: string;
|
|
669
|
+
};
|
|
670
|
+
result: Currency;
|
|
671
|
+
};
|
|
672
|
+
'crm.currency.list': {
|
|
673
|
+
params: Pick<ListParams<Currency>, 'order'>;
|
|
674
|
+
result: Currency[];
|
|
675
|
+
};
|
|
676
|
+
'crm.currency.add': {
|
|
677
|
+
params: {
|
|
678
|
+
readonly fields: CurrencyInput & {
|
|
679
|
+
readonly CURRENCY: string;
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
result: string;
|
|
683
|
+
};
|
|
684
|
+
'crm.currency.update': {
|
|
685
|
+
params: {
|
|
686
|
+
readonly id: string;
|
|
687
|
+
readonly fields: CurrencyInput;
|
|
688
|
+
};
|
|
689
|
+
result: boolean;
|
|
690
|
+
};
|
|
691
|
+
'crm.currency.delete': {
|
|
692
|
+
params: {
|
|
693
|
+
readonly id: string;
|
|
694
|
+
};
|
|
695
|
+
result: boolean;
|
|
696
|
+
};
|
|
697
|
+
'crm.currency.base.get': {
|
|
698
|
+
params: Empty;
|
|
699
|
+
result: string;
|
|
700
|
+
};
|
|
701
|
+
'crm.currency.base.set': {
|
|
702
|
+
params: {
|
|
703
|
+
readonly id: string;
|
|
704
|
+
};
|
|
705
|
+
result: boolean;
|
|
706
|
+
};
|
|
707
|
+
'crm.item.fields': {
|
|
708
|
+
params: EntityType;
|
|
709
|
+
result: {
|
|
710
|
+
fields: Fields;
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
'crm.item.get': {
|
|
714
|
+
params: EntityType & {
|
|
715
|
+
readonly id: Id;
|
|
716
|
+
};
|
|
717
|
+
result: {
|
|
718
|
+
item: CrmItem;
|
|
719
|
+
};
|
|
720
|
+
};
|
|
721
|
+
'crm.item.list': {
|
|
722
|
+
params: EntityType & {
|
|
723
|
+
readonly select?: ReadonlyArray<(keyof CrmItem & string) | '*'>;
|
|
724
|
+
readonly filter?: Filter;
|
|
725
|
+
readonly order?: { readonly [K in keyof CrmItem & string]?: Order; };
|
|
726
|
+
readonly start?: number;
|
|
727
|
+
};
|
|
728
|
+
result: {
|
|
729
|
+
items: CrmItem[];
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
'crm.item.add': {
|
|
733
|
+
params: EntityType & {
|
|
734
|
+
readonly fields: Input<CrmItem>;
|
|
735
|
+
};
|
|
736
|
+
result: {
|
|
737
|
+
item: CrmItem;
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
'crm.item.update': {
|
|
741
|
+
params: EntityType & {
|
|
742
|
+
readonly id: Id;
|
|
743
|
+
readonly fields: Input<CrmItem>;
|
|
744
|
+
};
|
|
745
|
+
result: {
|
|
746
|
+
item: CrmItem;
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
'crm.item.delete': {
|
|
750
|
+
params: EntityType & {
|
|
751
|
+
readonly id: Id;
|
|
752
|
+
};
|
|
753
|
+
result: readonly [];
|
|
754
|
+
};
|
|
755
|
+
'user.fields': {
|
|
756
|
+
params: Empty;
|
|
757
|
+
result: Record<string, string>;
|
|
758
|
+
};
|
|
759
|
+
'user.current': {
|
|
760
|
+
params: Empty;
|
|
761
|
+
result: User;
|
|
762
|
+
};
|
|
763
|
+
'user.get': {
|
|
764
|
+
params: {
|
|
765
|
+
readonly ID?: Id;
|
|
766
|
+
readonly filter?: Filter;
|
|
767
|
+
readonly sort?: keyof User & string;
|
|
768
|
+
readonly order?: Order;
|
|
769
|
+
readonly start?: number;
|
|
770
|
+
readonly ADMIN_MODE?: boolean;
|
|
771
|
+
};
|
|
772
|
+
result: User[];
|
|
773
|
+
};
|
|
774
|
+
'catalog.product.getFieldsByFilter': {
|
|
775
|
+
params: {
|
|
776
|
+
readonly filter: ProductFilter;
|
|
777
|
+
};
|
|
778
|
+
result: {
|
|
779
|
+
product: Record<string, ProductField>;
|
|
780
|
+
};
|
|
781
|
+
};
|
|
782
|
+
'catalog.product.get': {
|
|
783
|
+
params: {
|
|
784
|
+
readonly id: Id;
|
|
785
|
+
};
|
|
786
|
+
result: {
|
|
787
|
+
product: Product;
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
'catalog.product.list': {
|
|
791
|
+
params: {
|
|
792
|
+
readonly select?: ReadonlyArray<keyof Product & string>;
|
|
793
|
+
readonly filter: ProductFilter;
|
|
794
|
+
readonly order?: { readonly [K in keyof Product & string]?: Order; };
|
|
795
|
+
readonly start?: number;
|
|
796
|
+
};
|
|
797
|
+
result: {
|
|
798
|
+
products: Product[];
|
|
799
|
+
};
|
|
800
|
+
};
|
|
801
|
+
'catalog.product.add': {
|
|
802
|
+
params: {
|
|
803
|
+
readonly fields: ProductInput;
|
|
804
|
+
};
|
|
805
|
+
result: {
|
|
806
|
+
element: Product;
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
'catalog.product.update': {
|
|
810
|
+
params: {
|
|
811
|
+
readonly id: Id;
|
|
812
|
+
readonly fields: Input<Product>;
|
|
813
|
+
};
|
|
814
|
+
result: {
|
|
815
|
+
element: Product;
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
'catalog.product.delete': {
|
|
819
|
+
params: {
|
|
820
|
+
readonly id: Id;
|
|
821
|
+
};
|
|
822
|
+
result: boolean;
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Any method name. Known ones autocomplete and get typed params and results, the rest fall back to loose types
|
|
827
|
+
*/
|
|
828
|
+
type Method = keyof Methods | (string & Record<never, never>);
|
|
829
|
+
type Params<M extends string> = M extends keyof Methods ? Methods[M] extends {
|
|
830
|
+
params: infer P;
|
|
831
|
+
} ? P : never : Readonly<Record<string, unknown>>;
|
|
832
|
+
type Result<M extends string> = M extends keyof Methods ? Methods[M] extends {
|
|
833
|
+
result: infer R;
|
|
834
|
+
} ? R : never : unknown;
|
|
835
|
+
/**
|
|
836
|
+
* Row type of a list method: the array itself, or the single array a catalog style result wraps it in
|
|
837
|
+
*/
|
|
838
|
+
type Item<M extends string> = Result<M> extends readonly (infer I)[] ? I : Result<M> extends Readonly<Record<string, readonly (infer I)[]>> ? I : unknown;
|
|
839
|
+
/**
|
|
840
|
+
* Positional arguments after the method name: params are optional when the method requires none
|
|
841
|
+
*/
|
|
842
|
+
type Args<M extends string, O> = Readonly<Record<string, never>> extends Params<M> ? [params?: Params<M>, options?: O] : [params: Params<M>, options?: O];
|
|
843
|
+
type LimiterOptions = {
|
|
844
|
+
readonly burst?: number;
|
|
845
|
+
readonly refillPerSecond?: number;
|
|
846
|
+
};
|
|
847
|
+
type Time = {
|
|
848
|
+
readonly start: number;
|
|
849
|
+
readonly finish: number;
|
|
850
|
+
readonly duration: number;
|
|
851
|
+
readonly processing: number;
|
|
852
|
+
readonly date_start: string;
|
|
853
|
+
readonly date_finish: string;
|
|
854
|
+
readonly operating?: number;
|
|
855
|
+
readonly operating_reset_at?: number;
|
|
856
|
+
};
|
|
857
|
+
type Envelope<R> = {
|
|
858
|
+
readonly result: R;
|
|
859
|
+
readonly time: Time;
|
|
860
|
+
readonly total?: number;
|
|
861
|
+
readonly next?: number;
|
|
862
|
+
};
|
|
863
|
+
type RetryOptions = {
|
|
864
|
+
readonly retries?: number;
|
|
865
|
+
readonly delay?: number;
|
|
866
|
+
};
|
|
867
|
+
type RequestEvent = {
|
|
868
|
+
readonly method: string;
|
|
869
|
+
readonly params: Readonly<Record<string, unknown>>;
|
|
870
|
+
/** Zero based number of the request within one call, retries and token refreshes included */
|
|
871
|
+
readonly attempt: number;
|
|
872
|
+
};
|
|
873
|
+
type ResponseEvent = {
|
|
874
|
+
readonly method: string;
|
|
875
|
+
readonly attempt: number;
|
|
876
|
+
/** Milliseconds from sending the request to parsing the response */
|
|
877
|
+
readonly duration: number;
|
|
878
|
+
readonly time?: Time;
|
|
879
|
+
readonly error?: unknown;
|
|
880
|
+
};
|
|
881
|
+
type TransportOptions = {
|
|
882
|
+
readonly url: string;
|
|
883
|
+
readonly auth?: string | (() => string | Promise<string>);
|
|
884
|
+
readonly onAuthExpired?: () => void | Promise<void>;
|
|
885
|
+
readonly fetch?: typeof fetch;
|
|
886
|
+
readonly signal?: AbortSignal;
|
|
887
|
+
/** Called right before every HTTP request, after the rate limiter let it through */
|
|
888
|
+
readonly onRequest?: (event: RequestEvent) => void;
|
|
889
|
+
/** Called after every HTTP request, with `error` set when it failed */
|
|
890
|
+
readonly onResponse?: (event: ResponseEvent) => void;
|
|
891
|
+
};
|
|
892
|
+
type Command<M extends Method = Method> = {
|
|
893
|
+
readonly method: M;
|
|
894
|
+
readonly params?: Params<M>;
|
|
895
|
+
};
|
|
896
|
+
type Commands = Readonly<Record<string, Command>> | readonly Command[];
|
|
897
|
+
type Checked<C extends Commands> = { readonly [K in keyof C]: C[K] extends {
|
|
898
|
+
readonly method: infer M extends string;
|
|
899
|
+
} ? Command<M> : C[K]; };
|
|
900
|
+
type BatchResult<C extends Commands> = {
|
|
901
|
+
readonly results: { -readonly [K in keyof C]?: C[K] extends {
|
|
902
|
+
readonly method: infer M extends string;
|
|
903
|
+
} ? Result<M> : never; };
|
|
904
|
+
readonly errors: { -readonly [K in keyof C]?: BitrixError; };
|
|
905
|
+
};
|
|
906
|
+
type BatchOptions = {
|
|
907
|
+
readonly halt?: boolean;
|
|
908
|
+
readonly signal?: AbortSignal;
|
|
909
|
+
};
|
|
910
|
+
type Batch = <const C extends Commands>(commands: C & Checked<C>, options?: BatchOptions) => Promise<BatchResult<C>>;
|
|
911
|
+
type PaginateProgress = {
|
|
912
|
+
/** Rows read so far */
|
|
913
|
+
readonly read: number;
|
|
914
|
+
/** Rows matching the list when the read started, so it can drift when rows change during the read */
|
|
915
|
+
readonly total?: number;
|
|
916
|
+
};
|
|
917
|
+
type CommonOptions = {
|
|
918
|
+
/** Id field: `ID` for CRM methods, `id` for catalog style methods */
|
|
919
|
+
readonly idField?: string;
|
|
920
|
+
readonly signal?: AbortSignal;
|
|
921
|
+
/**
|
|
922
|
+
* Called after every page. In `cursor` and `modified` modes setting it makes the first request count the rows,
|
|
923
|
+
* which Bitrix skips otherwise, so it costs one slower request on large lists
|
|
924
|
+
*/
|
|
925
|
+
readonly onProgress?: (progress: PaginateProgress) => void;
|
|
926
|
+
};
|
|
927
|
+
type PaginateOptions = CommonOptions & ({
|
|
928
|
+
/**
|
|
929
|
+
* `cursor` (default) walks the list by ascending id, which stays fast and consistent on large portals.
|
|
930
|
+
* `offset` uses `start` and allows any `order`
|
|
931
|
+
*/
|
|
932
|
+
readonly mode?: 'cursor' | 'offset';
|
|
933
|
+
} | {
|
|
934
|
+
/**
|
|
935
|
+
* `modified` walks the rows changed at or after `since`, in the order they changed. A row that changes
|
|
936
|
+
* again during the read is returned again
|
|
937
|
+
*/
|
|
938
|
+
readonly mode: 'modified';
|
|
939
|
+
readonly since: Date | string;
|
|
940
|
+
/** Modification time field: `DATE_MODIFY` by default, `LAST_UPDATED` for activities */
|
|
941
|
+
readonly modifiedField?: string;
|
|
942
|
+
});
|
|
943
|
+
type Paginate = <M extends Method>(method: M, ...args: Args<M, PaginateOptions>) => AsyncGenerator<Item<M>, void, undefined>;
|
|
944
|
+
type SonetParams = {
|
|
945
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
946
|
+
};
|
|
947
|
+
/**
|
|
948
|
+
* Outcome of a bulk write, one entry per input item in the same order
|
|
949
|
+
*/
|
|
950
|
+
type BulkResult<R> = {
|
|
951
|
+
readonly results: Array<R | undefined>;
|
|
952
|
+
readonly errors: Array<BitrixError | undefined>;
|
|
953
|
+
};
|
|
954
|
+
type CrmService<E> = {
|
|
955
|
+
readonly fields: () => Promise<Fields>;
|
|
956
|
+
readonly get: (id: Id) => Promise<E>;
|
|
957
|
+
readonly list: <const S extends readonly SelectField<E>[] = []>(params?: ListParams<E, S>, options?: PaginateOptions) => Promise<Selected<E, S>[]>;
|
|
958
|
+
readonly paginate: <const S extends readonly SelectField<E>[] = []>(params?: ListParams<E, S>, options?: PaginateOptions) => AsyncGenerator<Selected<E, S>, void, undefined>;
|
|
959
|
+
/** Rows changed at or after `since`, oldest change first */
|
|
960
|
+
readonly changedSince: <const S extends readonly SelectField<E>[] = []>(since: Date | string, params?: ListParams<E, S>, options?: Pick<PaginateOptions, 'signal' | 'onProgress'>) => AsyncGenerator<Selected<E, S>, void, undefined>;
|
|
961
|
+
readonly create: (fields: Input<E>, params?: SonetParams) => Promise<number>;
|
|
962
|
+
readonly update: (id: Id, fields: Input<E>, params?: SonetParams) => Promise<boolean>;
|
|
963
|
+
readonly delete: (id: Id) => Promise<boolean>;
|
|
964
|
+
readonly createMany: (items: ReadonlyArray<Input<E>>, params?: SonetParams) => Promise<BulkResult<number>>;
|
|
965
|
+
readonly updateMany: (items: ReadonlyArray<{
|
|
966
|
+
readonly id: Id;
|
|
967
|
+
readonly fields: Input<E>;
|
|
968
|
+
}>, params?: SonetParams) => Promise<BulkResult<boolean>>;
|
|
969
|
+
readonly deleteMany: (ids: readonly Id[]) => Promise<BulkResult<boolean>>;
|
|
970
|
+
};
|
|
971
|
+
type ProductRows = {
|
|
972
|
+
readonly get: (id: Id) => Promise<ProductRow[]>;
|
|
973
|
+
readonly set: (id: Id, rows: ReadonlyArray<Input<ProductRow>>) => Promise<boolean>;
|
|
974
|
+
};
|
|
975
|
+
type Links<K extends string> = {
|
|
976
|
+
readonly get: (id: Id) => Promise<Link<K>[]>;
|
|
977
|
+
/** Replaces every link, the first one becomes primary unless another sets `IS_PRIMARY` */
|
|
978
|
+
readonly set: (id: Id, links: ReadonlyArray<LinkInput<K>>) => Promise<boolean>;
|
|
979
|
+
readonly add: (id: Id, link: LinkInput<K>) => Promise<boolean>;
|
|
980
|
+
/** Resolves with `false` when the entities were not linked */
|
|
981
|
+
readonly delete: (id: Id, linkedId: Id) => Promise<boolean>;
|
|
982
|
+
readonly clear: (id: Id) => Promise<boolean>;
|
|
983
|
+
};
|
|
984
|
+
type ClientOptions = TransportOptions & {
|
|
985
|
+
readonly limiter?: LimiterOptions;
|
|
986
|
+
readonly retry?: RetryOptions;
|
|
987
|
+
};
|
|
988
|
+
type CallOptions = {
|
|
989
|
+
readonly signal?: AbortSignal;
|
|
990
|
+
};
|
|
991
|
+
type Call = {
|
|
992
|
+
<M extends Method>(method: M, params: Params<M>, options: CallOptions & {
|
|
993
|
+
readonly raw: true;
|
|
994
|
+
}): Promise<Envelope<Result<M>>>;
|
|
995
|
+
<M extends Method>(method: M, ...args: Args<M, CallOptions & {
|
|
996
|
+
readonly raw?: false;
|
|
997
|
+
}>): Promise<Result<M>>;
|
|
998
|
+
};
|
|
999
|
+
type List = <M extends Method>(method: M, ...args: Args<M, PaginateOptions>) => Promise<Item<M>[]>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Creates a Bitrix24 REST client
|
|
1002
|
+
* @param options endpoint, auth, limiter and retry settings
|
|
1003
|
+
* @example
|
|
1004
|
+
* const bitrix = createClient({ url: 'https://portal.bitrix24.com/rest/1/WEBHOOK_TOKEN' })
|
|
1005
|
+
* const deal = await bitrix.deals.get(77)
|
|
1006
|
+
*/
|
|
1007
|
+
export declare const createClient: (options: ClientOptions) => {
|
|
1008
|
+
call: Call;
|
|
1009
|
+
batch: Batch;
|
|
1010
|
+
paginate: Paginate;
|
|
1011
|
+
list: List;
|
|
1012
|
+
activities: CrmService<Activity>;
|
|
1013
|
+
companies: {
|
|
1014
|
+
fields: () => Promise<Fields>;
|
|
1015
|
+
get: (id: Id) => Promise<Company>;
|
|
1016
|
+
list: <const S extends readonly SelectField<Company>[] = []>(params?: ListParams<Company, S> | undefined, options?: PaginateOptions) => Promise<((S extends readonly [] ? {
|
|
1017
|
+
readonly UTM_SOURCE: string | null;
|
|
1018
|
+
readonly UTM_MEDIUM: string | null;
|
|
1019
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1020
|
+
readonly UTM_CONTENT: string | null;
|
|
1021
|
+
readonly UTM_TERM: string | null;
|
|
1022
|
+
readonly HAS_PHONE: BoolString;
|
|
1023
|
+
readonly HAS_EMAIL: BoolString;
|
|
1024
|
+
readonly HAS_IMOL: BoolString;
|
|
1025
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1026
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1027
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1028
|
+
readonly DATE_CREATE: ISODate;
|
|
1029
|
+
readonly DATE_MODIFY: ISODate;
|
|
1030
|
+
readonly OPENED: BoolString;
|
|
1031
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1032
|
+
readonly ORIGIN_ID: string | null;
|
|
1033
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1034
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1035
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1036
|
+
readonly ID: NumberString;
|
|
1037
|
+
readonly TITLE: string;
|
|
1038
|
+
readonly COMPANY_TYPE: string | null;
|
|
1039
|
+
readonly LOGO: unknown;
|
|
1040
|
+
readonly ADDRESS_LEGAL: string | null;
|
|
1041
|
+
readonly BANKING_DETAILS: string | null;
|
|
1042
|
+
readonly INDUSTRY: string | null;
|
|
1043
|
+
readonly EMPLOYEES: string | null;
|
|
1044
|
+
readonly CURRENCY_ID: string | null;
|
|
1045
|
+
readonly REVENUE: NumberString | null;
|
|
1046
|
+
readonly COMMENTS: string | null;
|
|
1047
|
+
readonly IS_MY_COMPANY: BoolString;
|
|
1048
|
+
readonly CONTACT_ID?: readonly NumberString[];
|
|
1049
|
+
readonly LEAD_ID: NumberString | null;
|
|
1050
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1051
|
+
readonly ADDRESS: string | null;
|
|
1052
|
+
readonly ADDRESS_2: string | null;
|
|
1053
|
+
readonly ADDRESS_CITY: string | null;
|
|
1054
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1055
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1056
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1057
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1058
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1059
|
+
readonly ADDRESS_REGION: string | null;
|
|
1060
|
+
readonly REG_ADDRESS: string | null;
|
|
1061
|
+
readonly REG_ADDRESS_2: string | null;
|
|
1062
|
+
readonly REG_ADDRESS_CITY: string | null;
|
|
1063
|
+
readonly REG_ADDRESS_COUNTRY: string | null;
|
|
1064
|
+
readonly REG_ADDRESS_COUNTRY_CODE: string | null;
|
|
1065
|
+
readonly REG_ADDRESS_LOC_ADDR_ID: string | null;
|
|
1066
|
+
readonly REG_ADDRESS_POSTAL_CODE: string | null;
|
|
1067
|
+
readonly REG_ADDRESS_PROVINCE: string | null;
|
|
1068
|
+
readonly REG_ADDRESS_REGION: string | null;
|
|
1069
|
+
} : ("*" extends S[number] ? {
|
|
1070
|
+
readonly UTM_SOURCE: string | null;
|
|
1071
|
+
readonly UTM_MEDIUM: string | null;
|
|
1072
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1073
|
+
readonly UTM_CONTENT: string | null;
|
|
1074
|
+
readonly UTM_TERM: string | null;
|
|
1075
|
+
readonly HAS_PHONE: BoolString;
|
|
1076
|
+
readonly HAS_EMAIL: BoolString;
|
|
1077
|
+
readonly HAS_IMOL: BoolString;
|
|
1078
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1079
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1080
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1081
|
+
readonly DATE_CREATE: ISODate;
|
|
1082
|
+
readonly DATE_MODIFY: ISODate;
|
|
1083
|
+
readonly OPENED: BoolString;
|
|
1084
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1085
|
+
readonly ORIGIN_ID: string | null;
|
|
1086
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1087
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1088
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1089
|
+
readonly ID: NumberString;
|
|
1090
|
+
readonly TITLE: string;
|
|
1091
|
+
readonly COMPANY_TYPE: string | null;
|
|
1092
|
+
readonly LOGO: unknown;
|
|
1093
|
+
readonly ADDRESS_LEGAL: string | null;
|
|
1094
|
+
readonly BANKING_DETAILS: string | null;
|
|
1095
|
+
readonly INDUSTRY: string | null;
|
|
1096
|
+
readonly EMPLOYEES: string | null;
|
|
1097
|
+
readonly CURRENCY_ID: string | null;
|
|
1098
|
+
readonly REVENUE: NumberString | null;
|
|
1099
|
+
readonly COMMENTS: string | null;
|
|
1100
|
+
readonly IS_MY_COMPANY: BoolString;
|
|
1101
|
+
readonly CONTACT_ID?: readonly NumberString[];
|
|
1102
|
+
readonly LEAD_ID: NumberString | null;
|
|
1103
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1104
|
+
readonly ADDRESS: string | null;
|
|
1105
|
+
readonly ADDRESS_2: string | null;
|
|
1106
|
+
readonly ADDRESS_CITY: string | null;
|
|
1107
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1108
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1109
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1110
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1111
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1112
|
+
readonly ADDRESS_REGION: string | null;
|
|
1113
|
+
readonly REG_ADDRESS: string | null;
|
|
1114
|
+
readonly REG_ADDRESS_2: string | null;
|
|
1115
|
+
readonly REG_ADDRESS_CITY: string | null;
|
|
1116
|
+
readonly REG_ADDRESS_COUNTRY: string | null;
|
|
1117
|
+
readonly REG_ADDRESS_COUNTRY_CODE: string | null;
|
|
1118
|
+
readonly REG_ADDRESS_LOC_ADDR_ID: string | null;
|
|
1119
|
+
readonly REG_ADDRESS_POSTAL_CODE: string | null;
|
|
1120
|
+
readonly REG_ADDRESS_PROVINCE: string | null;
|
|
1121
|
+
readonly REG_ADDRESS_REGION: string | null;
|
|
1122
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Company, `UF_${string}`> : {}) & Pick<Company, S[number] & ("ADDRESS" | "ADDRESS_2" | "ADDRESS_CITY" | "ADDRESS_COUNTRY" | "ADDRESS_COUNTRY_CODE" | "ADDRESS_LEGAL" | "ADDRESS_LOC_ADDR_ID" | "ADDRESS_POSTAL_CODE" | "ADDRESS_PROVINCE" | "ADDRESS_REGION" | "BANKING_DETAILS" | "COMMENTS" | "COMPANY_TYPE" | "CONTACT_ID" | "CURRENCY_ID" | "EMPLOYEES" | "ID" | "INDUSTRY" | "IS_MY_COMPANY" | "LEAD_ID" | "LOGO" | "ORIGIN_VERSION" | "REG_ADDRESS" | "REG_ADDRESS_2" | "REG_ADDRESS_CITY" | "REG_ADDRESS_COUNTRY" | "REG_ADDRESS_COUNTRY_CODE" | "REG_ADDRESS_LOC_ADDR_ID" | "REG_ADDRESS_POSTAL_CODE" | "REG_ADDRESS_PROVINCE" | "REG_ADDRESS_REGION" | "REVENUE" | "TITLE" | `UF_${string}` | keyof {
|
|
1123
|
+
readonly HAS_PHONE: BoolString;
|
|
1124
|
+
readonly HAS_EMAIL: BoolString;
|
|
1125
|
+
readonly HAS_IMOL: BoolString;
|
|
1126
|
+
readonly PHONE?: readonly MultiField[];
|
|
1127
|
+
readonly EMAIL?: readonly MultiField[];
|
|
1128
|
+
readonly WEB?: readonly MultiField[];
|
|
1129
|
+
readonly IM?: readonly MultiField[];
|
|
1130
|
+
readonly LINK?: readonly MultiField[];
|
|
1131
|
+
} | keyof {
|
|
1132
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1133
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1134
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1135
|
+
readonly DATE_CREATE: ISODate;
|
|
1136
|
+
readonly DATE_MODIFY: ISODate;
|
|
1137
|
+
readonly OPENED: BoolString;
|
|
1138
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1139
|
+
readonly ORIGIN_ID: string | null;
|
|
1140
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1141
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1142
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1143
|
+
} | keyof {
|
|
1144
|
+
readonly UTM_SOURCE: string | null;
|
|
1145
|
+
readonly UTM_MEDIUM: string | null;
|
|
1146
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1147
|
+
readonly UTM_CONTENT: string | null;
|
|
1148
|
+
readonly UTM_TERM: string | null;
|
|
1149
|
+
})>) extends (infer T) ? { [K in keyof T]: T[K]; } : never)[]>;
|
|
1150
|
+
paginate: <const S extends readonly SelectField<Company>[] = []>(params?: ListParams<Company, S> | undefined, options?: PaginateOptions) => AsyncGenerator<(S extends readonly [] ? {
|
|
1151
|
+
readonly UTM_SOURCE: string | null;
|
|
1152
|
+
readonly UTM_MEDIUM: string | null;
|
|
1153
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1154
|
+
readonly UTM_CONTENT: string | null;
|
|
1155
|
+
readonly UTM_TERM: string | null;
|
|
1156
|
+
readonly HAS_PHONE: BoolString;
|
|
1157
|
+
readonly HAS_EMAIL: BoolString;
|
|
1158
|
+
readonly HAS_IMOL: BoolString;
|
|
1159
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1160
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1161
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1162
|
+
readonly DATE_CREATE: ISODate;
|
|
1163
|
+
readonly DATE_MODIFY: ISODate;
|
|
1164
|
+
readonly OPENED: BoolString;
|
|
1165
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1166
|
+
readonly ORIGIN_ID: string | null;
|
|
1167
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1168
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1169
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1170
|
+
readonly ID: NumberString;
|
|
1171
|
+
readonly TITLE: string;
|
|
1172
|
+
readonly COMPANY_TYPE: string | null;
|
|
1173
|
+
readonly LOGO: unknown;
|
|
1174
|
+
readonly ADDRESS_LEGAL: string | null;
|
|
1175
|
+
readonly BANKING_DETAILS: string | null;
|
|
1176
|
+
readonly INDUSTRY: string | null;
|
|
1177
|
+
readonly EMPLOYEES: string | null;
|
|
1178
|
+
readonly CURRENCY_ID: string | null;
|
|
1179
|
+
readonly REVENUE: NumberString | null;
|
|
1180
|
+
readonly COMMENTS: string | null;
|
|
1181
|
+
readonly IS_MY_COMPANY: BoolString;
|
|
1182
|
+
readonly CONTACT_ID?: readonly NumberString[];
|
|
1183
|
+
readonly LEAD_ID: NumberString | null;
|
|
1184
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1185
|
+
readonly ADDRESS: string | null;
|
|
1186
|
+
readonly ADDRESS_2: string | null;
|
|
1187
|
+
readonly ADDRESS_CITY: string | null;
|
|
1188
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1189
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1190
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1191
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1192
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1193
|
+
readonly ADDRESS_REGION: string | null;
|
|
1194
|
+
readonly REG_ADDRESS: string | null;
|
|
1195
|
+
readonly REG_ADDRESS_2: string | null;
|
|
1196
|
+
readonly REG_ADDRESS_CITY: string | null;
|
|
1197
|
+
readonly REG_ADDRESS_COUNTRY: string | null;
|
|
1198
|
+
readonly REG_ADDRESS_COUNTRY_CODE: string | null;
|
|
1199
|
+
readonly REG_ADDRESS_LOC_ADDR_ID: string | null;
|
|
1200
|
+
readonly REG_ADDRESS_POSTAL_CODE: string | null;
|
|
1201
|
+
readonly REG_ADDRESS_PROVINCE: string | null;
|
|
1202
|
+
readonly REG_ADDRESS_REGION: string | null;
|
|
1203
|
+
} : ("*" extends S[number] ? {
|
|
1204
|
+
readonly UTM_SOURCE: string | null;
|
|
1205
|
+
readonly UTM_MEDIUM: string | null;
|
|
1206
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1207
|
+
readonly UTM_CONTENT: string | null;
|
|
1208
|
+
readonly UTM_TERM: string | null;
|
|
1209
|
+
readonly HAS_PHONE: BoolString;
|
|
1210
|
+
readonly HAS_EMAIL: BoolString;
|
|
1211
|
+
readonly HAS_IMOL: BoolString;
|
|
1212
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1213
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1214
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1215
|
+
readonly DATE_CREATE: ISODate;
|
|
1216
|
+
readonly DATE_MODIFY: ISODate;
|
|
1217
|
+
readonly OPENED: BoolString;
|
|
1218
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1219
|
+
readonly ORIGIN_ID: string | null;
|
|
1220
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1221
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1222
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1223
|
+
readonly ID: NumberString;
|
|
1224
|
+
readonly TITLE: string;
|
|
1225
|
+
readonly COMPANY_TYPE: string | null;
|
|
1226
|
+
readonly LOGO: unknown;
|
|
1227
|
+
readonly ADDRESS_LEGAL: string | null;
|
|
1228
|
+
readonly BANKING_DETAILS: string | null;
|
|
1229
|
+
readonly INDUSTRY: string | null;
|
|
1230
|
+
readonly EMPLOYEES: string | null;
|
|
1231
|
+
readonly CURRENCY_ID: string | null;
|
|
1232
|
+
readonly REVENUE: NumberString | null;
|
|
1233
|
+
readonly COMMENTS: string | null;
|
|
1234
|
+
readonly IS_MY_COMPANY: BoolString;
|
|
1235
|
+
readonly CONTACT_ID?: readonly NumberString[];
|
|
1236
|
+
readonly LEAD_ID: NumberString | null;
|
|
1237
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1238
|
+
readonly ADDRESS: string | null;
|
|
1239
|
+
readonly ADDRESS_2: string | null;
|
|
1240
|
+
readonly ADDRESS_CITY: string | null;
|
|
1241
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1242
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1243
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1244
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1245
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1246
|
+
readonly ADDRESS_REGION: string | null;
|
|
1247
|
+
readonly REG_ADDRESS: string | null;
|
|
1248
|
+
readonly REG_ADDRESS_2: string | null;
|
|
1249
|
+
readonly REG_ADDRESS_CITY: string | null;
|
|
1250
|
+
readonly REG_ADDRESS_COUNTRY: string | null;
|
|
1251
|
+
readonly REG_ADDRESS_COUNTRY_CODE: string | null;
|
|
1252
|
+
readonly REG_ADDRESS_LOC_ADDR_ID: string | null;
|
|
1253
|
+
readonly REG_ADDRESS_POSTAL_CODE: string | null;
|
|
1254
|
+
readonly REG_ADDRESS_PROVINCE: string | null;
|
|
1255
|
+
readonly REG_ADDRESS_REGION: string | null;
|
|
1256
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Company, `UF_${string}`> : {}) & Pick<Company, S[number] & ("ADDRESS" | "ADDRESS_2" | "ADDRESS_CITY" | "ADDRESS_COUNTRY" | "ADDRESS_COUNTRY_CODE" | "ADDRESS_LEGAL" | "ADDRESS_LOC_ADDR_ID" | "ADDRESS_POSTAL_CODE" | "ADDRESS_PROVINCE" | "ADDRESS_REGION" | "BANKING_DETAILS" | "COMMENTS" | "COMPANY_TYPE" | "CONTACT_ID" | "CURRENCY_ID" | "EMPLOYEES" | "ID" | "INDUSTRY" | "IS_MY_COMPANY" | "LEAD_ID" | "LOGO" | "ORIGIN_VERSION" | "REG_ADDRESS" | "REG_ADDRESS_2" | "REG_ADDRESS_CITY" | "REG_ADDRESS_COUNTRY" | "REG_ADDRESS_COUNTRY_CODE" | "REG_ADDRESS_LOC_ADDR_ID" | "REG_ADDRESS_POSTAL_CODE" | "REG_ADDRESS_PROVINCE" | "REG_ADDRESS_REGION" | "REVENUE" | "TITLE" | `UF_${string}` | keyof {
|
|
1257
|
+
readonly HAS_PHONE: BoolString;
|
|
1258
|
+
readonly HAS_EMAIL: BoolString;
|
|
1259
|
+
readonly HAS_IMOL: BoolString;
|
|
1260
|
+
readonly PHONE?: readonly MultiField[];
|
|
1261
|
+
readonly EMAIL?: readonly MultiField[];
|
|
1262
|
+
readonly WEB?: readonly MultiField[];
|
|
1263
|
+
readonly IM?: readonly MultiField[];
|
|
1264
|
+
readonly LINK?: readonly MultiField[];
|
|
1265
|
+
} | keyof {
|
|
1266
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1267
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1268
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1269
|
+
readonly DATE_CREATE: ISODate;
|
|
1270
|
+
readonly DATE_MODIFY: ISODate;
|
|
1271
|
+
readonly OPENED: BoolString;
|
|
1272
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1273
|
+
readonly ORIGIN_ID: string | null;
|
|
1274
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1275
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1276
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1277
|
+
} | keyof {
|
|
1278
|
+
readonly UTM_SOURCE: string | null;
|
|
1279
|
+
readonly UTM_MEDIUM: string | null;
|
|
1280
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1281
|
+
readonly UTM_CONTENT: string | null;
|
|
1282
|
+
readonly UTM_TERM: string | null;
|
|
1283
|
+
})>) extends (infer T) ? { [K in keyof T]: T[K]; } : never, void, undefined>;
|
|
1284
|
+
changedSince: <const S extends readonly SelectField<Company>[] = []>(since: Date | string, params?: ListParams<Company, S> | undefined, options?: Pick<PaginateOptions, 'signal' | 'onProgress'>) => AsyncGenerator<(S extends readonly [] ? {
|
|
1285
|
+
readonly UTM_SOURCE: string | null;
|
|
1286
|
+
readonly UTM_MEDIUM: string | null;
|
|
1287
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1288
|
+
readonly UTM_CONTENT: string | null;
|
|
1289
|
+
readonly UTM_TERM: string | null;
|
|
1290
|
+
readonly HAS_PHONE: BoolString;
|
|
1291
|
+
readonly HAS_EMAIL: BoolString;
|
|
1292
|
+
readonly HAS_IMOL: BoolString;
|
|
1293
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1294
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1295
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1296
|
+
readonly DATE_CREATE: ISODate;
|
|
1297
|
+
readonly DATE_MODIFY: ISODate;
|
|
1298
|
+
readonly OPENED: BoolString;
|
|
1299
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1300
|
+
readonly ORIGIN_ID: string | null;
|
|
1301
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1302
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1303
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1304
|
+
readonly ID: NumberString;
|
|
1305
|
+
readonly TITLE: string;
|
|
1306
|
+
readonly COMPANY_TYPE: string | null;
|
|
1307
|
+
readonly LOGO: unknown;
|
|
1308
|
+
readonly ADDRESS_LEGAL: string | null;
|
|
1309
|
+
readonly BANKING_DETAILS: string | null;
|
|
1310
|
+
readonly INDUSTRY: string | null;
|
|
1311
|
+
readonly EMPLOYEES: string | null;
|
|
1312
|
+
readonly CURRENCY_ID: string | null;
|
|
1313
|
+
readonly REVENUE: NumberString | null;
|
|
1314
|
+
readonly COMMENTS: string | null;
|
|
1315
|
+
readonly IS_MY_COMPANY: BoolString;
|
|
1316
|
+
readonly CONTACT_ID?: readonly NumberString[];
|
|
1317
|
+
readonly LEAD_ID: NumberString | null;
|
|
1318
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1319
|
+
readonly ADDRESS: string | null;
|
|
1320
|
+
readonly ADDRESS_2: string | null;
|
|
1321
|
+
readonly ADDRESS_CITY: string | null;
|
|
1322
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1323
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1324
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1325
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1326
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1327
|
+
readonly ADDRESS_REGION: string | null;
|
|
1328
|
+
readonly REG_ADDRESS: string | null;
|
|
1329
|
+
readonly REG_ADDRESS_2: string | null;
|
|
1330
|
+
readonly REG_ADDRESS_CITY: string | null;
|
|
1331
|
+
readonly REG_ADDRESS_COUNTRY: string | null;
|
|
1332
|
+
readonly REG_ADDRESS_COUNTRY_CODE: string | null;
|
|
1333
|
+
readonly REG_ADDRESS_LOC_ADDR_ID: string | null;
|
|
1334
|
+
readonly REG_ADDRESS_POSTAL_CODE: string | null;
|
|
1335
|
+
readonly REG_ADDRESS_PROVINCE: string | null;
|
|
1336
|
+
readonly REG_ADDRESS_REGION: string | null;
|
|
1337
|
+
} : ("*" extends S[number] ? {
|
|
1338
|
+
readonly UTM_SOURCE: string | null;
|
|
1339
|
+
readonly UTM_MEDIUM: string | null;
|
|
1340
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1341
|
+
readonly UTM_CONTENT: string | null;
|
|
1342
|
+
readonly UTM_TERM: string | null;
|
|
1343
|
+
readonly HAS_PHONE: BoolString;
|
|
1344
|
+
readonly HAS_EMAIL: BoolString;
|
|
1345
|
+
readonly HAS_IMOL: BoolString;
|
|
1346
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1347
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1348
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1349
|
+
readonly DATE_CREATE: ISODate;
|
|
1350
|
+
readonly DATE_MODIFY: ISODate;
|
|
1351
|
+
readonly OPENED: BoolString;
|
|
1352
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1353
|
+
readonly ORIGIN_ID: string | null;
|
|
1354
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1355
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1356
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1357
|
+
readonly ID: NumberString;
|
|
1358
|
+
readonly TITLE: string;
|
|
1359
|
+
readonly COMPANY_TYPE: string | null;
|
|
1360
|
+
readonly LOGO: unknown;
|
|
1361
|
+
readonly ADDRESS_LEGAL: string | null;
|
|
1362
|
+
readonly BANKING_DETAILS: string | null;
|
|
1363
|
+
readonly INDUSTRY: string | null;
|
|
1364
|
+
readonly EMPLOYEES: string | null;
|
|
1365
|
+
readonly CURRENCY_ID: string | null;
|
|
1366
|
+
readonly REVENUE: NumberString | null;
|
|
1367
|
+
readonly COMMENTS: string | null;
|
|
1368
|
+
readonly IS_MY_COMPANY: BoolString;
|
|
1369
|
+
readonly CONTACT_ID?: readonly NumberString[];
|
|
1370
|
+
readonly LEAD_ID: NumberString | null;
|
|
1371
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1372
|
+
readonly ADDRESS: string | null;
|
|
1373
|
+
readonly ADDRESS_2: string | null;
|
|
1374
|
+
readonly ADDRESS_CITY: string | null;
|
|
1375
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1376
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1377
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1378
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1379
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1380
|
+
readonly ADDRESS_REGION: string | null;
|
|
1381
|
+
readonly REG_ADDRESS: string | null;
|
|
1382
|
+
readonly REG_ADDRESS_2: string | null;
|
|
1383
|
+
readonly REG_ADDRESS_CITY: string | null;
|
|
1384
|
+
readonly REG_ADDRESS_COUNTRY: string | null;
|
|
1385
|
+
readonly REG_ADDRESS_COUNTRY_CODE: string | null;
|
|
1386
|
+
readonly REG_ADDRESS_LOC_ADDR_ID: string | null;
|
|
1387
|
+
readonly REG_ADDRESS_POSTAL_CODE: string | null;
|
|
1388
|
+
readonly REG_ADDRESS_PROVINCE: string | null;
|
|
1389
|
+
readonly REG_ADDRESS_REGION: string | null;
|
|
1390
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Company, `UF_${string}`> : {}) & Pick<Company, S[number] & ("ADDRESS" | "ADDRESS_2" | "ADDRESS_CITY" | "ADDRESS_COUNTRY" | "ADDRESS_COUNTRY_CODE" | "ADDRESS_LEGAL" | "ADDRESS_LOC_ADDR_ID" | "ADDRESS_POSTAL_CODE" | "ADDRESS_PROVINCE" | "ADDRESS_REGION" | "BANKING_DETAILS" | "COMMENTS" | "COMPANY_TYPE" | "CONTACT_ID" | "CURRENCY_ID" | "EMPLOYEES" | "ID" | "INDUSTRY" | "IS_MY_COMPANY" | "LEAD_ID" | "LOGO" | "ORIGIN_VERSION" | "REG_ADDRESS" | "REG_ADDRESS_2" | "REG_ADDRESS_CITY" | "REG_ADDRESS_COUNTRY" | "REG_ADDRESS_COUNTRY_CODE" | "REG_ADDRESS_LOC_ADDR_ID" | "REG_ADDRESS_POSTAL_CODE" | "REG_ADDRESS_PROVINCE" | "REG_ADDRESS_REGION" | "REVENUE" | "TITLE" | `UF_${string}` | keyof {
|
|
1391
|
+
readonly HAS_PHONE: BoolString;
|
|
1392
|
+
readonly HAS_EMAIL: BoolString;
|
|
1393
|
+
readonly HAS_IMOL: BoolString;
|
|
1394
|
+
readonly PHONE?: readonly MultiField[];
|
|
1395
|
+
readonly EMAIL?: readonly MultiField[];
|
|
1396
|
+
readonly WEB?: readonly MultiField[];
|
|
1397
|
+
readonly IM?: readonly MultiField[];
|
|
1398
|
+
readonly LINK?: readonly MultiField[];
|
|
1399
|
+
} | keyof {
|
|
1400
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1401
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1402
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1403
|
+
readonly DATE_CREATE: ISODate;
|
|
1404
|
+
readonly DATE_MODIFY: ISODate;
|
|
1405
|
+
readonly OPENED: BoolString;
|
|
1406
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1407
|
+
readonly ORIGIN_ID: string | null;
|
|
1408
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1409
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1410
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1411
|
+
} | keyof {
|
|
1412
|
+
readonly UTM_SOURCE: string | null;
|
|
1413
|
+
readonly UTM_MEDIUM: string | null;
|
|
1414
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1415
|
+
readonly UTM_CONTENT: string | null;
|
|
1416
|
+
readonly UTM_TERM: string | null;
|
|
1417
|
+
})>) extends (infer T) ? { [K in keyof T]: T[K]; } : never, void, undefined>;
|
|
1418
|
+
create: (fields: Input<Company>, params?: {
|
|
1419
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
1420
|
+
}) => Promise<number>;
|
|
1421
|
+
update: (id: Id, fields: Input<Company>, params?: {
|
|
1422
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
1423
|
+
}) => Promise<boolean>;
|
|
1424
|
+
delete: (id: Id) => Promise<boolean>;
|
|
1425
|
+
createMany: (items: readonly Input<Company>[], params?: {
|
|
1426
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
1427
|
+
}) => Promise<BulkResult<number>>;
|
|
1428
|
+
updateMany: (items: readonly {
|
|
1429
|
+
readonly id: Id;
|
|
1430
|
+
readonly fields: Input<Company>;
|
|
1431
|
+
}[], params?: {
|
|
1432
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
1433
|
+
}) => Promise<BulkResult<boolean>>;
|
|
1434
|
+
deleteMany: (ids: readonly Id[]) => Promise<BulkResult<boolean>>;
|
|
1435
|
+
contacts: Links<"CONTACT_ID">;
|
|
1436
|
+
};
|
|
1437
|
+
contacts: {
|
|
1438
|
+
fields: () => Promise<Fields>;
|
|
1439
|
+
get: (id: Id) => Promise<Contact>;
|
|
1440
|
+
list: <const S extends readonly SelectField<Contact>[] = []>(params?: ListParams<Contact, S> | undefined, options?: PaginateOptions) => Promise<((S extends readonly [] ? {
|
|
1441
|
+
readonly UTM_SOURCE: string | null;
|
|
1442
|
+
readonly UTM_MEDIUM: string | null;
|
|
1443
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1444
|
+
readonly UTM_CONTENT: string | null;
|
|
1445
|
+
readonly UTM_TERM: string | null;
|
|
1446
|
+
readonly HAS_PHONE: BoolString;
|
|
1447
|
+
readonly HAS_EMAIL: BoolString;
|
|
1448
|
+
readonly HAS_IMOL: BoolString;
|
|
1449
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1450
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1451
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1452
|
+
readonly DATE_CREATE: ISODate;
|
|
1453
|
+
readonly DATE_MODIFY: ISODate;
|
|
1454
|
+
readonly OPENED: BoolString;
|
|
1455
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1456
|
+
readonly ORIGIN_ID: string | null;
|
|
1457
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1458
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1459
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1460
|
+
readonly ID: NumberString;
|
|
1461
|
+
readonly HONORIFIC: string | null;
|
|
1462
|
+
readonly NAME: string | null;
|
|
1463
|
+
readonly SECOND_NAME: string | null;
|
|
1464
|
+
readonly LAST_NAME: string | null;
|
|
1465
|
+
readonly PHOTO: unknown;
|
|
1466
|
+
readonly BIRTHDATE: ISODate;
|
|
1467
|
+
readonly TYPE_ID: string | null;
|
|
1468
|
+
readonly SOURCE_ID: string | null;
|
|
1469
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
1470
|
+
readonly POST: string | null;
|
|
1471
|
+
readonly COMMENTS: string | null;
|
|
1472
|
+
readonly EXPORT: BoolString;
|
|
1473
|
+
readonly COMPANY_ID: NumberString | null;
|
|
1474
|
+
readonly COMPANY_IDS?: readonly NumberString[];
|
|
1475
|
+
readonly LEAD_ID: NumberString | null;
|
|
1476
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1477
|
+
readonly ADDRESS: string | null;
|
|
1478
|
+
readonly ADDRESS_2: string | null;
|
|
1479
|
+
readonly ADDRESS_CITY: string | null;
|
|
1480
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1481
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1482
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1483
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1484
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1485
|
+
readonly ADDRESS_REGION: string | null;
|
|
1486
|
+
} : ("*" extends S[number] ? {
|
|
1487
|
+
readonly UTM_SOURCE: string | null;
|
|
1488
|
+
readonly UTM_MEDIUM: string | null;
|
|
1489
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1490
|
+
readonly UTM_CONTENT: string | null;
|
|
1491
|
+
readonly UTM_TERM: string | null;
|
|
1492
|
+
readonly HAS_PHONE: BoolString;
|
|
1493
|
+
readonly HAS_EMAIL: BoolString;
|
|
1494
|
+
readonly HAS_IMOL: BoolString;
|
|
1495
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1496
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1497
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1498
|
+
readonly DATE_CREATE: ISODate;
|
|
1499
|
+
readonly DATE_MODIFY: ISODate;
|
|
1500
|
+
readonly OPENED: BoolString;
|
|
1501
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1502
|
+
readonly ORIGIN_ID: string | null;
|
|
1503
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1504
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1505
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1506
|
+
readonly ID: NumberString;
|
|
1507
|
+
readonly HONORIFIC: string | null;
|
|
1508
|
+
readonly NAME: string | null;
|
|
1509
|
+
readonly SECOND_NAME: string | null;
|
|
1510
|
+
readonly LAST_NAME: string | null;
|
|
1511
|
+
readonly PHOTO: unknown;
|
|
1512
|
+
readonly BIRTHDATE: ISODate;
|
|
1513
|
+
readonly TYPE_ID: string | null;
|
|
1514
|
+
readonly SOURCE_ID: string | null;
|
|
1515
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
1516
|
+
readonly POST: string | null;
|
|
1517
|
+
readonly COMMENTS: string | null;
|
|
1518
|
+
readonly EXPORT: BoolString;
|
|
1519
|
+
readonly COMPANY_ID: NumberString | null;
|
|
1520
|
+
readonly COMPANY_IDS?: readonly NumberString[];
|
|
1521
|
+
readonly LEAD_ID: NumberString | null;
|
|
1522
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1523
|
+
readonly ADDRESS: string | null;
|
|
1524
|
+
readonly ADDRESS_2: string | null;
|
|
1525
|
+
readonly ADDRESS_CITY: string | null;
|
|
1526
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1527
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1528
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1529
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1530
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1531
|
+
readonly ADDRESS_REGION: string | null;
|
|
1532
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Contact, `UF_${string}`> : {}) & Pick<Contact, S[number] & ("ADDRESS" | "ADDRESS_2" | "ADDRESS_CITY" | "ADDRESS_COUNTRY" | "ADDRESS_COUNTRY_CODE" | "ADDRESS_LOC_ADDR_ID" | "ADDRESS_POSTAL_CODE" | "ADDRESS_PROVINCE" | "ADDRESS_REGION" | "BIRTHDATE" | "COMMENTS" | "COMPANY_ID" | "COMPANY_IDS" | "EXPORT" | "HONORIFIC" | "ID" | "LAST_NAME" | "LEAD_ID" | "NAME" | "ORIGIN_VERSION" | "PHOTO" | "POST" | "SECOND_NAME" | "SOURCE_DESCRIPTION" | "SOURCE_ID" | "TYPE_ID" | `UF_${string}` | keyof {
|
|
1533
|
+
readonly HAS_PHONE: BoolString;
|
|
1534
|
+
readonly HAS_EMAIL: BoolString;
|
|
1535
|
+
readonly HAS_IMOL: BoolString;
|
|
1536
|
+
readonly PHONE?: readonly MultiField[];
|
|
1537
|
+
readonly EMAIL?: readonly MultiField[];
|
|
1538
|
+
readonly WEB?: readonly MultiField[];
|
|
1539
|
+
readonly IM?: readonly MultiField[];
|
|
1540
|
+
readonly LINK?: readonly MultiField[];
|
|
1541
|
+
} | keyof {
|
|
1542
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1543
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1544
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1545
|
+
readonly DATE_CREATE: ISODate;
|
|
1546
|
+
readonly DATE_MODIFY: ISODate;
|
|
1547
|
+
readonly OPENED: BoolString;
|
|
1548
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1549
|
+
readonly ORIGIN_ID: string | null;
|
|
1550
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1551
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1552
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1553
|
+
} | keyof {
|
|
1554
|
+
readonly UTM_SOURCE: string | null;
|
|
1555
|
+
readonly UTM_MEDIUM: string | null;
|
|
1556
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1557
|
+
readonly UTM_CONTENT: string | null;
|
|
1558
|
+
readonly UTM_TERM: string | null;
|
|
1559
|
+
})>) extends (infer T) ? { [K in keyof T]: T[K]; } : never)[]>;
|
|
1560
|
+
paginate: <const S extends readonly SelectField<Contact>[] = []>(params?: ListParams<Contact, S> | undefined, options?: PaginateOptions) => AsyncGenerator<(S extends readonly [] ? {
|
|
1561
|
+
readonly UTM_SOURCE: string | null;
|
|
1562
|
+
readonly UTM_MEDIUM: string | null;
|
|
1563
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1564
|
+
readonly UTM_CONTENT: string | null;
|
|
1565
|
+
readonly UTM_TERM: string | null;
|
|
1566
|
+
readonly HAS_PHONE: BoolString;
|
|
1567
|
+
readonly HAS_EMAIL: BoolString;
|
|
1568
|
+
readonly HAS_IMOL: BoolString;
|
|
1569
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1570
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1571
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1572
|
+
readonly DATE_CREATE: ISODate;
|
|
1573
|
+
readonly DATE_MODIFY: ISODate;
|
|
1574
|
+
readonly OPENED: BoolString;
|
|
1575
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1576
|
+
readonly ORIGIN_ID: string | null;
|
|
1577
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1578
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1579
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1580
|
+
readonly ID: NumberString;
|
|
1581
|
+
readonly HONORIFIC: string | null;
|
|
1582
|
+
readonly NAME: string | null;
|
|
1583
|
+
readonly SECOND_NAME: string | null;
|
|
1584
|
+
readonly LAST_NAME: string | null;
|
|
1585
|
+
readonly PHOTO: unknown;
|
|
1586
|
+
readonly BIRTHDATE: ISODate;
|
|
1587
|
+
readonly TYPE_ID: string | null;
|
|
1588
|
+
readonly SOURCE_ID: string | null;
|
|
1589
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
1590
|
+
readonly POST: string | null;
|
|
1591
|
+
readonly COMMENTS: string | null;
|
|
1592
|
+
readonly EXPORT: BoolString;
|
|
1593
|
+
readonly COMPANY_ID: NumberString | null;
|
|
1594
|
+
readonly COMPANY_IDS?: readonly NumberString[];
|
|
1595
|
+
readonly LEAD_ID: NumberString | null;
|
|
1596
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1597
|
+
readonly ADDRESS: string | null;
|
|
1598
|
+
readonly ADDRESS_2: string | null;
|
|
1599
|
+
readonly ADDRESS_CITY: string | null;
|
|
1600
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1601
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1602
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1603
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1604
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1605
|
+
readonly ADDRESS_REGION: string | null;
|
|
1606
|
+
} : ("*" extends S[number] ? {
|
|
1607
|
+
readonly UTM_SOURCE: string | null;
|
|
1608
|
+
readonly UTM_MEDIUM: string | null;
|
|
1609
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1610
|
+
readonly UTM_CONTENT: string | null;
|
|
1611
|
+
readonly UTM_TERM: string | null;
|
|
1612
|
+
readonly HAS_PHONE: BoolString;
|
|
1613
|
+
readonly HAS_EMAIL: BoolString;
|
|
1614
|
+
readonly HAS_IMOL: BoolString;
|
|
1615
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1616
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1617
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1618
|
+
readonly DATE_CREATE: ISODate;
|
|
1619
|
+
readonly DATE_MODIFY: ISODate;
|
|
1620
|
+
readonly OPENED: BoolString;
|
|
1621
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1622
|
+
readonly ORIGIN_ID: string | null;
|
|
1623
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1624
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1625
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1626
|
+
readonly ID: NumberString;
|
|
1627
|
+
readonly HONORIFIC: string | null;
|
|
1628
|
+
readonly NAME: string | null;
|
|
1629
|
+
readonly SECOND_NAME: string | null;
|
|
1630
|
+
readonly LAST_NAME: string | null;
|
|
1631
|
+
readonly PHOTO: unknown;
|
|
1632
|
+
readonly BIRTHDATE: ISODate;
|
|
1633
|
+
readonly TYPE_ID: string | null;
|
|
1634
|
+
readonly SOURCE_ID: string | null;
|
|
1635
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
1636
|
+
readonly POST: string | null;
|
|
1637
|
+
readonly COMMENTS: string | null;
|
|
1638
|
+
readonly EXPORT: BoolString;
|
|
1639
|
+
readonly COMPANY_ID: NumberString | null;
|
|
1640
|
+
readonly COMPANY_IDS?: readonly NumberString[];
|
|
1641
|
+
readonly LEAD_ID: NumberString | null;
|
|
1642
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1643
|
+
readonly ADDRESS: string | null;
|
|
1644
|
+
readonly ADDRESS_2: string | null;
|
|
1645
|
+
readonly ADDRESS_CITY: string | null;
|
|
1646
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1647
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1648
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1649
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1650
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1651
|
+
readonly ADDRESS_REGION: string | null;
|
|
1652
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Contact, `UF_${string}`> : {}) & Pick<Contact, S[number] & ("ADDRESS" | "ADDRESS_2" | "ADDRESS_CITY" | "ADDRESS_COUNTRY" | "ADDRESS_COUNTRY_CODE" | "ADDRESS_LOC_ADDR_ID" | "ADDRESS_POSTAL_CODE" | "ADDRESS_PROVINCE" | "ADDRESS_REGION" | "BIRTHDATE" | "COMMENTS" | "COMPANY_ID" | "COMPANY_IDS" | "EXPORT" | "HONORIFIC" | "ID" | "LAST_NAME" | "LEAD_ID" | "NAME" | "ORIGIN_VERSION" | "PHOTO" | "POST" | "SECOND_NAME" | "SOURCE_DESCRIPTION" | "SOURCE_ID" | "TYPE_ID" | `UF_${string}` | keyof {
|
|
1653
|
+
readonly HAS_PHONE: BoolString;
|
|
1654
|
+
readonly HAS_EMAIL: BoolString;
|
|
1655
|
+
readonly HAS_IMOL: BoolString;
|
|
1656
|
+
readonly PHONE?: readonly MultiField[];
|
|
1657
|
+
readonly EMAIL?: readonly MultiField[];
|
|
1658
|
+
readonly WEB?: readonly MultiField[];
|
|
1659
|
+
readonly IM?: readonly MultiField[];
|
|
1660
|
+
readonly LINK?: readonly MultiField[];
|
|
1661
|
+
} | keyof {
|
|
1662
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1663
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1664
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1665
|
+
readonly DATE_CREATE: ISODate;
|
|
1666
|
+
readonly DATE_MODIFY: ISODate;
|
|
1667
|
+
readonly OPENED: BoolString;
|
|
1668
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1669
|
+
readonly ORIGIN_ID: string | null;
|
|
1670
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1671
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1672
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1673
|
+
} | keyof {
|
|
1674
|
+
readonly UTM_SOURCE: string | null;
|
|
1675
|
+
readonly UTM_MEDIUM: string | null;
|
|
1676
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1677
|
+
readonly UTM_CONTENT: string | null;
|
|
1678
|
+
readonly UTM_TERM: string | null;
|
|
1679
|
+
})>) extends (infer T) ? { [K in keyof T]: T[K]; } : never, void, undefined>;
|
|
1680
|
+
changedSince: <const S extends readonly SelectField<Contact>[] = []>(since: Date | string, params?: ListParams<Contact, S> | undefined, options?: Pick<PaginateOptions, 'signal' | 'onProgress'>) => AsyncGenerator<(S extends readonly [] ? {
|
|
1681
|
+
readonly UTM_SOURCE: string | null;
|
|
1682
|
+
readonly UTM_MEDIUM: string | null;
|
|
1683
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1684
|
+
readonly UTM_CONTENT: string | null;
|
|
1685
|
+
readonly UTM_TERM: string | null;
|
|
1686
|
+
readonly HAS_PHONE: BoolString;
|
|
1687
|
+
readonly HAS_EMAIL: BoolString;
|
|
1688
|
+
readonly HAS_IMOL: BoolString;
|
|
1689
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1690
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1691
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1692
|
+
readonly DATE_CREATE: ISODate;
|
|
1693
|
+
readonly DATE_MODIFY: ISODate;
|
|
1694
|
+
readonly OPENED: BoolString;
|
|
1695
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1696
|
+
readonly ORIGIN_ID: string | null;
|
|
1697
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1698
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1699
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1700
|
+
readonly ID: NumberString;
|
|
1701
|
+
readonly HONORIFIC: string | null;
|
|
1702
|
+
readonly NAME: string | null;
|
|
1703
|
+
readonly SECOND_NAME: string | null;
|
|
1704
|
+
readonly LAST_NAME: string | null;
|
|
1705
|
+
readonly PHOTO: unknown;
|
|
1706
|
+
readonly BIRTHDATE: ISODate;
|
|
1707
|
+
readonly TYPE_ID: string | null;
|
|
1708
|
+
readonly SOURCE_ID: string | null;
|
|
1709
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
1710
|
+
readonly POST: string | null;
|
|
1711
|
+
readonly COMMENTS: string | null;
|
|
1712
|
+
readonly EXPORT: BoolString;
|
|
1713
|
+
readonly COMPANY_ID: NumberString | null;
|
|
1714
|
+
readonly COMPANY_IDS?: readonly NumberString[];
|
|
1715
|
+
readonly LEAD_ID: NumberString | null;
|
|
1716
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1717
|
+
readonly ADDRESS: string | null;
|
|
1718
|
+
readonly ADDRESS_2: string | null;
|
|
1719
|
+
readonly ADDRESS_CITY: string | null;
|
|
1720
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1721
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1722
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1723
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1724
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1725
|
+
readonly ADDRESS_REGION: string | null;
|
|
1726
|
+
} : ("*" extends S[number] ? {
|
|
1727
|
+
readonly UTM_SOURCE: string | null;
|
|
1728
|
+
readonly UTM_MEDIUM: string | null;
|
|
1729
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1730
|
+
readonly UTM_CONTENT: string | null;
|
|
1731
|
+
readonly UTM_TERM: string | null;
|
|
1732
|
+
readonly HAS_PHONE: BoolString;
|
|
1733
|
+
readonly HAS_EMAIL: BoolString;
|
|
1734
|
+
readonly HAS_IMOL: BoolString;
|
|
1735
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1736
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1737
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1738
|
+
readonly DATE_CREATE: ISODate;
|
|
1739
|
+
readonly DATE_MODIFY: ISODate;
|
|
1740
|
+
readonly OPENED: BoolString;
|
|
1741
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1742
|
+
readonly ORIGIN_ID: string | null;
|
|
1743
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1744
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1745
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1746
|
+
readonly ID: NumberString;
|
|
1747
|
+
readonly HONORIFIC: string | null;
|
|
1748
|
+
readonly NAME: string | null;
|
|
1749
|
+
readonly SECOND_NAME: string | null;
|
|
1750
|
+
readonly LAST_NAME: string | null;
|
|
1751
|
+
readonly PHOTO: unknown;
|
|
1752
|
+
readonly BIRTHDATE: ISODate;
|
|
1753
|
+
readonly TYPE_ID: string | null;
|
|
1754
|
+
readonly SOURCE_ID: string | null;
|
|
1755
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
1756
|
+
readonly POST: string | null;
|
|
1757
|
+
readonly COMMENTS: string | null;
|
|
1758
|
+
readonly EXPORT: BoolString;
|
|
1759
|
+
readonly COMPANY_ID: NumberString | null;
|
|
1760
|
+
readonly COMPANY_IDS?: readonly NumberString[];
|
|
1761
|
+
readonly LEAD_ID: NumberString | null;
|
|
1762
|
+
readonly ORIGIN_VERSION: string | null;
|
|
1763
|
+
readonly ADDRESS: string | null;
|
|
1764
|
+
readonly ADDRESS_2: string | null;
|
|
1765
|
+
readonly ADDRESS_CITY: string | null;
|
|
1766
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
1767
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
1768
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
1769
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
1770
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
1771
|
+
readonly ADDRESS_REGION: string | null;
|
|
1772
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Contact, `UF_${string}`> : {}) & Pick<Contact, S[number] & ("ADDRESS" | "ADDRESS_2" | "ADDRESS_CITY" | "ADDRESS_COUNTRY" | "ADDRESS_COUNTRY_CODE" | "ADDRESS_LOC_ADDR_ID" | "ADDRESS_POSTAL_CODE" | "ADDRESS_PROVINCE" | "ADDRESS_REGION" | "BIRTHDATE" | "COMMENTS" | "COMPANY_ID" | "COMPANY_IDS" | "EXPORT" | "HONORIFIC" | "ID" | "LAST_NAME" | "LEAD_ID" | "NAME" | "ORIGIN_VERSION" | "PHOTO" | "POST" | "SECOND_NAME" | "SOURCE_DESCRIPTION" | "SOURCE_ID" | "TYPE_ID" | `UF_${string}` | keyof {
|
|
1773
|
+
readonly HAS_PHONE: BoolString;
|
|
1774
|
+
readonly HAS_EMAIL: BoolString;
|
|
1775
|
+
readonly HAS_IMOL: BoolString;
|
|
1776
|
+
readonly PHONE?: readonly MultiField[];
|
|
1777
|
+
readonly EMAIL?: readonly MultiField[];
|
|
1778
|
+
readonly WEB?: readonly MultiField[];
|
|
1779
|
+
readonly IM?: readonly MultiField[];
|
|
1780
|
+
readonly LINK?: readonly MultiField[];
|
|
1781
|
+
} | keyof {
|
|
1782
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1783
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1784
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1785
|
+
readonly DATE_CREATE: ISODate;
|
|
1786
|
+
readonly DATE_MODIFY: ISODate;
|
|
1787
|
+
readonly OPENED: BoolString;
|
|
1788
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1789
|
+
readonly ORIGIN_ID: string | null;
|
|
1790
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1791
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1792
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1793
|
+
} | keyof {
|
|
1794
|
+
readonly UTM_SOURCE: string | null;
|
|
1795
|
+
readonly UTM_MEDIUM: string | null;
|
|
1796
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1797
|
+
readonly UTM_CONTENT: string | null;
|
|
1798
|
+
readonly UTM_TERM: string | null;
|
|
1799
|
+
})>) extends (infer T) ? { [K in keyof T]: T[K]; } : never, void, undefined>;
|
|
1800
|
+
create: (fields: Input<Contact>, params?: {
|
|
1801
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
1802
|
+
}) => Promise<number>;
|
|
1803
|
+
update: (id: Id, fields: Input<Contact>, params?: {
|
|
1804
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
1805
|
+
}) => Promise<boolean>;
|
|
1806
|
+
delete: (id: Id) => Promise<boolean>;
|
|
1807
|
+
createMany: (items: readonly Input<Contact>[], params?: {
|
|
1808
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
1809
|
+
}) => Promise<BulkResult<number>>;
|
|
1810
|
+
updateMany: (items: readonly {
|
|
1811
|
+
readonly id: Id;
|
|
1812
|
+
readonly fields: Input<Contact>;
|
|
1813
|
+
}[], params?: {
|
|
1814
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
1815
|
+
}) => Promise<BulkResult<boolean>>;
|
|
1816
|
+
deleteMany: (ids: readonly Id[]) => Promise<BulkResult<boolean>>;
|
|
1817
|
+
companies: Links<"COMPANY_ID">;
|
|
1818
|
+
};
|
|
1819
|
+
currencies: {
|
|
1820
|
+
fields: () => Promise<Readonly<Record<string, Field>>>;
|
|
1821
|
+
get: (id: string) => Promise<Currency>;
|
|
1822
|
+
list: (params?: Params<'crm.currency.list'>) => Promise<Currency[]>;
|
|
1823
|
+
create: (fields: Params<'crm.currency.add'>['fields']) => Promise<string>;
|
|
1824
|
+
update: (id: string, fields: Params<'crm.currency.update'>['fields']) => Promise<boolean>;
|
|
1825
|
+
delete: (id: string) => Promise<boolean>;
|
|
1826
|
+
base: () => Promise<string>;
|
|
1827
|
+
setBase: (id: string) => Promise<boolean>;
|
|
1828
|
+
};
|
|
1829
|
+
deals: {
|
|
1830
|
+
fields: () => Promise<Fields>;
|
|
1831
|
+
get: (id: Id) => Promise<Deal>;
|
|
1832
|
+
list: <const S extends readonly SelectField<Deal>[] = []>(params?: ListParams<Deal, S> | undefined, options?: PaginateOptions) => Promise<((S extends readonly [] ? {
|
|
1833
|
+
readonly UTM_SOURCE: string | null;
|
|
1834
|
+
readonly UTM_MEDIUM: string | null;
|
|
1835
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1836
|
+
readonly UTM_CONTENT: string | null;
|
|
1837
|
+
readonly UTM_TERM: string | null;
|
|
1838
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1839
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1840
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1841
|
+
readonly DATE_CREATE: ISODate;
|
|
1842
|
+
readonly DATE_MODIFY: ISODate;
|
|
1843
|
+
readonly OPENED: BoolString;
|
|
1844
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1845
|
+
readonly ORIGIN_ID: string | null;
|
|
1846
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1847
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1848
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1849
|
+
readonly ID: NumberString;
|
|
1850
|
+
readonly TITLE: string | null;
|
|
1851
|
+
readonly TYPE_ID: string | null;
|
|
1852
|
+
readonly CATEGORY_ID: NumberString;
|
|
1853
|
+
readonly STAGE_ID: string;
|
|
1854
|
+
readonly PREVIOUS_STAGE_ID?: string | null;
|
|
1855
|
+
readonly STAGE_SEMANTIC_ID: string;
|
|
1856
|
+
readonly IS_NEW: BoolString;
|
|
1857
|
+
readonly IS_RECURRING: BoolString;
|
|
1858
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
1859
|
+
readonly IS_REPEATED_APPROACH: BoolString;
|
|
1860
|
+
readonly PROBABILITY: NumberString | null;
|
|
1861
|
+
readonly CURRENCY_ID: string;
|
|
1862
|
+
readonly OPPORTUNITY: NumberString;
|
|
1863
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
1864
|
+
readonly TAX_VALUE: NumberString | null;
|
|
1865
|
+
readonly COMPANY_ID: NumberString;
|
|
1866
|
+
readonly MYCOMPANY_ID?: NumberString | null;
|
|
1867
|
+
readonly CONTACT_ID: NumberString | null;
|
|
1868
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
1869
|
+
readonly QUOTE_ID: NumberString | null;
|
|
1870
|
+
readonly BEGINDATE: ISODate;
|
|
1871
|
+
readonly CLOSEDATE: ISODate;
|
|
1872
|
+
readonly CLOSED: BoolString;
|
|
1873
|
+
readonly COMMENTS: string | null;
|
|
1874
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
1875
|
+
readonly MOVED_TIME: ISODate | null;
|
|
1876
|
+
readonly SOURCE_ID: string | null;
|
|
1877
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
1878
|
+
readonly LEAD_ID: NumberString | null;
|
|
1879
|
+
readonly ADDITIONAL_INFO: string | null;
|
|
1880
|
+
readonly LOCATION_ID: string | null;
|
|
1881
|
+
} : ("*" extends S[number] ? {
|
|
1882
|
+
readonly UTM_SOURCE: string | null;
|
|
1883
|
+
readonly UTM_MEDIUM: string | null;
|
|
1884
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1885
|
+
readonly UTM_CONTENT: string | null;
|
|
1886
|
+
readonly UTM_TERM: string | null;
|
|
1887
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1888
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1889
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1890
|
+
readonly DATE_CREATE: ISODate;
|
|
1891
|
+
readonly DATE_MODIFY: ISODate;
|
|
1892
|
+
readonly OPENED: BoolString;
|
|
1893
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1894
|
+
readonly ORIGIN_ID: string | null;
|
|
1895
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1896
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1897
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1898
|
+
readonly ID: NumberString;
|
|
1899
|
+
readonly TITLE: string | null;
|
|
1900
|
+
readonly TYPE_ID: string | null;
|
|
1901
|
+
readonly CATEGORY_ID: NumberString;
|
|
1902
|
+
readonly STAGE_ID: string;
|
|
1903
|
+
readonly PREVIOUS_STAGE_ID?: string | null;
|
|
1904
|
+
readonly STAGE_SEMANTIC_ID: string;
|
|
1905
|
+
readonly IS_NEW: BoolString;
|
|
1906
|
+
readonly IS_RECURRING: BoolString;
|
|
1907
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
1908
|
+
readonly IS_REPEATED_APPROACH: BoolString;
|
|
1909
|
+
readonly PROBABILITY: NumberString | null;
|
|
1910
|
+
readonly CURRENCY_ID: string;
|
|
1911
|
+
readonly OPPORTUNITY: NumberString;
|
|
1912
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
1913
|
+
readonly TAX_VALUE: NumberString | null;
|
|
1914
|
+
readonly COMPANY_ID: NumberString;
|
|
1915
|
+
readonly MYCOMPANY_ID?: NumberString | null;
|
|
1916
|
+
readonly CONTACT_ID: NumberString | null;
|
|
1917
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
1918
|
+
readonly QUOTE_ID: NumberString | null;
|
|
1919
|
+
readonly BEGINDATE: ISODate;
|
|
1920
|
+
readonly CLOSEDATE: ISODate;
|
|
1921
|
+
readonly CLOSED: BoolString;
|
|
1922
|
+
readonly COMMENTS: string | null;
|
|
1923
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
1924
|
+
readonly MOVED_TIME: ISODate | null;
|
|
1925
|
+
readonly SOURCE_ID: string | null;
|
|
1926
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
1927
|
+
readonly LEAD_ID: NumberString | null;
|
|
1928
|
+
readonly ADDITIONAL_INFO: string | null;
|
|
1929
|
+
readonly LOCATION_ID: string | null;
|
|
1930
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Deal, `UF_${string}`> : {}) & Pick<Deal, S[number] & ("ADDITIONAL_INFO" | "ASSIGNED_BY_ID" | "BEGINDATE" | "CATEGORY_ID" | "CLOSED" | "CLOSEDATE" | "COMMENTS" | "COMPANY_ID" | "CONTACT_ID" | "CONTACT_IDS" | "CREATED_BY_ID" | "CURRENCY_ID" | "DATE_CREATE" | "DATE_MODIFY" | "ID" | "IS_MANUAL_OPPORTUNITY" | "IS_NEW" | "IS_RECURRING" | "IS_REPEATED_APPROACH" | "IS_RETURN_CUSTOMER" | "LAST_ACTIVITY_BY" | "LAST_ACTIVITY_TIME" | "LAST_COMMUNICATION_TIME" | "LEAD_ID" | "LOCATION_ID" | "MODIFY_BY_ID" | "MOVED_BY_ID" | "MOVED_TIME" | "MYCOMPANY_ID" | "OPENED" | "OPPORTUNITY" | "ORIGINATOR_ID" | "ORIGIN_ID" | "PREVIOUS_STAGE_ID" | "PROBABILITY" | "QUOTE_ID" | "SOURCE_DESCRIPTION" | "SOURCE_ID" | "STAGE_ID" | "STAGE_SEMANTIC_ID" | "TAX_VALUE" | "TITLE" | "TYPE_ID" | "UTM_CAMPAIGN" | "UTM_CONTENT" | "UTM_MEDIUM" | "UTM_SOURCE" | "UTM_TERM" | `UF_${string}`)>) extends (infer T) ? { [K in keyof T]: T[K]; } : never)[]>;
|
|
1931
|
+
paginate: <const S extends readonly SelectField<Deal>[] = []>(params?: ListParams<Deal, S> | undefined, options?: PaginateOptions) => AsyncGenerator<(S extends readonly [] ? {
|
|
1932
|
+
readonly UTM_SOURCE: string | null;
|
|
1933
|
+
readonly UTM_MEDIUM: string | null;
|
|
1934
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1935
|
+
readonly UTM_CONTENT: string | null;
|
|
1936
|
+
readonly UTM_TERM: string | null;
|
|
1937
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1938
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1939
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1940
|
+
readonly DATE_CREATE: ISODate;
|
|
1941
|
+
readonly DATE_MODIFY: ISODate;
|
|
1942
|
+
readonly OPENED: BoolString;
|
|
1943
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1944
|
+
readonly ORIGIN_ID: string | null;
|
|
1945
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1946
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1947
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1948
|
+
readonly ID: NumberString;
|
|
1949
|
+
readonly TITLE: string | null;
|
|
1950
|
+
readonly TYPE_ID: string | null;
|
|
1951
|
+
readonly CATEGORY_ID: NumberString;
|
|
1952
|
+
readonly STAGE_ID: string;
|
|
1953
|
+
readonly PREVIOUS_STAGE_ID?: string | null;
|
|
1954
|
+
readonly STAGE_SEMANTIC_ID: string;
|
|
1955
|
+
readonly IS_NEW: BoolString;
|
|
1956
|
+
readonly IS_RECURRING: BoolString;
|
|
1957
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
1958
|
+
readonly IS_REPEATED_APPROACH: BoolString;
|
|
1959
|
+
readonly PROBABILITY: NumberString | null;
|
|
1960
|
+
readonly CURRENCY_ID: string;
|
|
1961
|
+
readonly OPPORTUNITY: NumberString;
|
|
1962
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
1963
|
+
readonly TAX_VALUE: NumberString | null;
|
|
1964
|
+
readonly COMPANY_ID: NumberString;
|
|
1965
|
+
readonly MYCOMPANY_ID?: NumberString | null;
|
|
1966
|
+
readonly CONTACT_ID: NumberString | null;
|
|
1967
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
1968
|
+
readonly QUOTE_ID: NumberString | null;
|
|
1969
|
+
readonly BEGINDATE: ISODate;
|
|
1970
|
+
readonly CLOSEDATE: ISODate;
|
|
1971
|
+
readonly CLOSED: BoolString;
|
|
1972
|
+
readonly COMMENTS: string | null;
|
|
1973
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
1974
|
+
readonly MOVED_TIME: ISODate | null;
|
|
1975
|
+
readonly SOURCE_ID: string | null;
|
|
1976
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
1977
|
+
readonly LEAD_ID: NumberString | null;
|
|
1978
|
+
readonly ADDITIONAL_INFO: string | null;
|
|
1979
|
+
readonly LOCATION_ID: string | null;
|
|
1980
|
+
} : ("*" extends S[number] ? {
|
|
1981
|
+
readonly UTM_SOURCE: string | null;
|
|
1982
|
+
readonly UTM_MEDIUM: string | null;
|
|
1983
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
1984
|
+
readonly UTM_CONTENT: string | null;
|
|
1985
|
+
readonly UTM_TERM: string | null;
|
|
1986
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
1987
|
+
readonly CREATED_BY_ID: NumberString;
|
|
1988
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
1989
|
+
readonly DATE_CREATE: ISODate;
|
|
1990
|
+
readonly DATE_MODIFY: ISODate;
|
|
1991
|
+
readonly OPENED: BoolString;
|
|
1992
|
+
readonly ORIGINATOR_ID: string | null;
|
|
1993
|
+
readonly ORIGIN_ID: string | null;
|
|
1994
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
1995
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
1996
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
1997
|
+
readonly ID: NumberString;
|
|
1998
|
+
readonly TITLE: string | null;
|
|
1999
|
+
readonly TYPE_ID: string | null;
|
|
2000
|
+
readonly CATEGORY_ID: NumberString;
|
|
2001
|
+
readonly STAGE_ID: string;
|
|
2002
|
+
readonly PREVIOUS_STAGE_ID?: string | null;
|
|
2003
|
+
readonly STAGE_SEMANTIC_ID: string;
|
|
2004
|
+
readonly IS_NEW: BoolString;
|
|
2005
|
+
readonly IS_RECURRING: BoolString;
|
|
2006
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
2007
|
+
readonly IS_REPEATED_APPROACH: BoolString;
|
|
2008
|
+
readonly PROBABILITY: NumberString | null;
|
|
2009
|
+
readonly CURRENCY_ID: string;
|
|
2010
|
+
readonly OPPORTUNITY: NumberString;
|
|
2011
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
2012
|
+
readonly TAX_VALUE: NumberString | null;
|
|
2013
|
+
readonly COMPANY_ID: NumberString;
|
|
2014
|
+
readonly MYCOMPANY_ID?: NumberString | null;
|
|
2015
|
+
readonly CONTACT_ID: NumberString | null;
|
|
2016
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
2017
|
+
readonly QUOTE_ID: NumberString | null;
|
|
2018
|
+
readonly BEGINDATE: ISODate;
|
|
2019
|
+
readonly CLOSEDATE: ISODate;
|
|
2020
|
+
readonly CLOSED: BoolString;
|
|
2021
|
+
readonly COMMENTS: string | null;
|
|
2022
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
2023
|
+
readonly MOVED_TIME: ISODate | null;
|
|
2024
|
+
readonly SOURCE_ID: string | null;
|
|
2025
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
2026
|
+
readonly LEAD_ID: NumberString | null;
|
|
2027
|
+
readonly ADDITIONAL_INFO: string | null;
|
|
2028
|
+
readonly LOCATION_ID: string | null;
|
|
2029
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Deal, `UF_${string}`> : {}) & Pick<Deal, S[number] & ("ADDITIONAL_INFO" | "ASSIGNED_BY_ID" | "BEGINDATE" | "CATEGORY_ID" | "CLOSED" | "CLOSEDATE" | "COMMENTS" | "COMPANY_ID" | "CONTACT_ID" | "CONTACT_IDS" | "CREATED_BY_ID" | "CURRENCY_ID" | "DATE_CREATE" | "DATE_MODIFY" | "ID" | "IS_MANUAL_OPPORTUNITY" | "IS_NEW" | "IS_RECURRING" | "IS_REPEATED_APPROACH" | "IS_RETURN_CUSTOMER" | "LAST_ACTIVITY_BY" | "LAST_ACTIVITY_TIME" | "LAST_COMMUNICATION_TIME" | "LEAD_ID" | "LOCATION_ID" | "MODIFY_BY_ID" | "MOVED_BY_ID" | "MOVED_TIME" | "MYCOMPANY_ID" | "OPENED" | "OPPORTUNITY" | "ORIGINATOR_ID" | "ORIGIN_ID" | "PREVIOUS_STAGE_ID" | "PROBABILITY" | "QUOTE_ID" | "SOURCE_DESCRIPTION" | "SOURCE_ID" | "STAGE_ID" | "STAGE_SEMANTIC_ID" | "TAX_VALUE" | "TITLE" | "TYPE_ID" | "UTM_CAMPAIGN" | "UTM_CONTENT" | "UTM_MEDIUM" | "UTM_SOURCE" | "UTM_TERM" | `UF_${string}`)>) extends (infer T) ? { [K in keyof T]: T[K]; } : never, void, undefined>;
|
|
2030
|
+
changedSince: <const S extends readonly SelectField<Deal>[] = []>(since: Date | string, params?: ListParams<Deal, S> | undefined, options?: Pick<PaginateOptions, 'signal' | 'onProgress'>) => AsyncGenerator<(S extends readonly [] ? {
|
|
2031
|
+
readonly UTM_SOURCE: string | null;
|
|
2032
|
+
readonly UTM_MEDIUM: string | null;
|
|
2033
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2034
|
+
readonly UTM_CONTENT: string | null;
|
|
2035
|
+
readonly UTM_TERM: string | null;
|
|
2036
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2037
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2038
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2039
|
+
readonly DATE_CREATE: ISODate;
|
|
2040
|
+
readonly DATE_MODIFY: ISODate;
|
|
2041
|
+
readonly OPENED: BoolString;
|
|
2042
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2043
|
+
readonly ORIGIN_ID: string | null;
|
|
2044
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2045
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2046
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2047
|
+
readonly ID: NumberString;
|
|
2048
|
+
readonly TITLE: string | null;
|
|
2049
|
+
readonly TYPE_ID: string | null;
|
|
2050
|
+
readonly CATEGORY_ID: NumberString;
|
|
2051
|
+
readonly STAGE_ID: string;
|
|
2052
|
+
readonly PREVIOUS_STAGE_ID?: string | null;
|
|
2053
|
+
readonly STAGE_SEMANTIC_ID: string;
|
|
2054
|
+
readonly IS_NEW: BoolString;
|
|
2055
|
+
readonly IS_RECURRING: BoolString;
|
|
2056
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
2057
|
+
readonly IS_REPEATED_APPROACH: BoolString;
|
|
2058
|
+
readonly PROBABILITY: NumberString | null;
|
|
2059
|
+
readonly CURRENCY_ID: string;
|
|
2060
|
+
readonly OPPORTUNITY: NumberString;
|
|
2061
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
2062
|
+
readonly TAX_VALUE: NumberString | null;
|
|
2063
|
+
readonly COMPANY_ID: NumberString;
|
|
2064
|
+
readonly MYCOMPANY_ID?: NumberString | null;
|
|
2065
|
+
readonly CONTACT_ID: NumberString | null;
|
|
2066
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
2067
|
+
readonly QUOTE_ID: NumberString | null;
|
|
2068
|
+
readonly BEGINDATE: ISODate;
|
|
2069
|
+
readonly CLOSEDATE: ISODate;
|
|
2070
|
+
readonly CLOSED: BoolString;
|
|
2071
|
+
readonly COMMENTS: string | null;
|
|
2072
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
2073
|
+
readonly MOVED_TIME: ISODate | null;
|
|
2074
|
+
readonly SOURCE_ID: string | null;
|
|
2075
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
2076
|
+
readonly LEAD_ID: NumberString | null;
|
|
2077
|
+
readonly ADDITIONAL_INFO: string | null;
|
|
2078
|
+
readonly LOCATION_ID: string | null;
|
|
2079
|
+
} : ("*" extends S[number] ? {
|
|
2080
|
+
readonly UTM_SOURCE: string | null;
|
|
2081
|
+
readonly UTM_MEDIUM: string | null;
|
|
2082
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2083
|
+
readonly UTM_CONTENT: string | null;
|
|
2084
|
+
readonly UTM_TERM: string | null;
|
|
2085
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2086
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2087
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2088
|
+
readonly DATE_CREATE: ISODate;
|
|
2089
|
+
readonly DATE_MODIFY: ISODate;
|
|
2090
|
+
readonly OPENED: BoolString;
|
|
2091
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2092
|
+
readonly ORIGIN_ID: string | null;
|
|
2093
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2094
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2095
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2096
|
+
readonly ID: NumberString;
|
|
2097
|
+
readonly TITLE: string | null;
|
|
2098
|
+
readonly TYPE_ID: string | null;
|
|
2099
|
+
readonly CATEGORY_ID: NumberString;
|
|
2100
|
+
readonly STAGE_ID: string;
|
|
2101
|
+
readonly PREVIOUS_STAGE_ID?: string | null;
|
|
2102
|
+
readonly STAGE_SEMANTIC_ID: string;
|
|
2103
|
+
readonly IS_NEW: BoolString;
|
|
2104
|
+
readonly IS_RECURRING: BoolString;
|
|
2105
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
2106
|
+
readonly IS_REPEATED_APPROACH: BoolString;
|
|
2107
|
+
readonly PROBABILITY: NumberString | null;
|
|
2108
|
+
readonly CURRENCY_ID: string;
|
|
2109
|
+
readonly OPPORTUNITY: NumberString;
|
|
2110
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
2111
|
+
readonly TAX_VALUE: NumberString | null;
|
|
2112
|
+
readonly COMPANY_ID: NumberString;
|
|
2113
|
+
readonly MYCOMPANY_ID?: NumberString | null;
|
|
2114
|
+
readonly CONTACT_ID: NumberString | null;
|
|
2115
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
2116
|
+
readonly QUOTE_ID: NumberString | null;
|
|
2117
|
+
readonly BEGINDATE: ISODate;
|
|
2118
|
+
readonly CLOSEDATE: ISODate;
|
|
2119
|
+
readonly CLOSED: BoolString;
|
|
2120
|
+
readonly COMMENTS: string | null;
|
|
2121
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
2122
|
+
readonly MOVED_TIME: ISODate | null;
|
|
2123
|
+
readonly SOURCE_ID: string | null;
|
|
2124
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
2125
|
+
readonly LEAD_ID: NumberString | null;
|
|
2126
|
+
readonly ADDITIONAL_INFO: string | null;
|
|
2127
|
+
readonly LOCATION_ID: string | null;
|
|
2128
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Deal, `UF_${string}`> : {}) & Pick<Deal, S[number] & ("ADDITIONAL_INFO" | "ASSIGNED_BY_ID" | "BEGINDATE" | "CATEGORY_ID" | "CLOSED" | "CLOSEDATE" | "COMMENTS" | "COMPANY_ID" | "CONTACT_ID" | "CONTACT_IDS" | "CREATED_BY_ID" | "CURRENCY_ID" | "DATE_CREATE" | "DATE_MODIFY" | "ID" | "IS_MANUAL_OPPORTUNITY" | "IS_NEW" | "IS_RECURRING" | "IS_REPEATED_APPROACH" | "IS_RETURN_CUSTOMER" | "LAST_ACTIVITY_BY" | "LAST_ACTIVITY_TIME" | "LAST_COMMUNICATION_TIME" | "LEAD_ID" | "LOCATION_ID" | "MODIFY_BY_ID" | "MOVED_BY_ID" | "MOVED_TIME" | "MYCOMPANY_ID" | "OPENED" | "OPPORTUNITY" | "ORIGINATOR_ID" | "ORIGIN_ID" | "PREVIOUS_STAGE_ID" | "PROBABILITY" | "QUOTE_ID" | "SOURCE_DESCRIPTION" | "SOURCE_ID" | "STAGE_ID" | "STAGE_SEMANTIC_ID" | "TAX_VALUE" | "TITLE" | "TYPE_ID" | "UTM_CAMPAIGN" | "UTM_CONTENT" | "UTM_MEDIUM" | "UTM_SOURCE" | "UTM_TERM" | `UF_${string}`)>) extends (infer T) ? { [K in keyof T]: T[K]; } : never, void, undefined>;
|
|
2129
|
+
create: (fields: Input<Deal>, params?: {
|
|
2130
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
2131
|
+
}) => Promise<number>;
|
|
2132
|
+
update: (id: Id, fields: Input<Deal>, params?: {
|
|
2133
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
2134
|
+
}) => Promise<boolean>;
|
|
2135
|
+
delete: (id: Id) => Promise<boolean>;
|
|
2136
|
+
createMany: (items: readonly Input<Deal>[], params?: {
|
|
2137
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
2138
|
+
}) => Promise<BulkResult<number>>;
|
|
2139
|
+
updateMany: (items: readonly {
|
|
2140
|
+
readonly id: Id;
|
|
2141
|
+
readonly fields: Input<Deal>;
|
|
2142
|
+
}[], params?: {
|
|
2143
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
2144
|
+
}) => Promise<BulkResult<boolean>>;
|
|
2145
|
+
deleteMany: (ids: readonly Id[]) => Promise<BulkResult<boolean>>;
|
|
2146
|
+
productRows: ProductRows;
|
|
2147
|
+
contacts: Links<"CONTACT_ID">;
|
|
2148
|
+
};
|
|
2149
|
+
items: (entityTypeId: number) => {
|
|
2150
|
+
fields: () => Promise<Readonly<Record<string, Field>>>;
|
|
2151
|
+
get: (id: Id) => Promise<CrmItem>;
|
|
2152
|
+
list: <const S extends readonly ("*" | "assignedById" | "begindate" | "categoryId" | "closed" | "closedate" | "comments" | "companyId" | "contactId" | "contactIds" | "createdBy" | "createdTime" | "currencyId" | "entityTypeId" | "id" | "isManualOpportunity" | "lastActivityBy" | "lastActivityTime" | "leadId" | "movedBy" | "movedTime" | "mycompanyId" | "observers" | "opened" | "opportunity" | "originId" | "originatorId" | "previousStageId" | "probability" | "quoteId" | "sourceDescription" | "sourceId" | "stageId" | "stageSemanticId" | "taxValue" | "title" | "typeId" | "updatedBy" | "updatedTime" | "webformId" | "xmlId" | `ufCrm${string}`)[] = []>(params?: Omit<{
|
|
2153
|
+
readonly entityTypeId: number;
|
|
2154
|
+
} & {
|
|
2155
|
+
readonly select?: ReadonlyArray<(keyof CrmItem & string) | '*'>;
|
|
2156
|
+
readonly filter?: Filter;
|
|
2157
|
+
readonly order?: {
|
|
2158
|
+
readonly [x: `ufCrm${string}`]: Order | undefined;
|
|
2159
|
+
readonly assignedById?: Order | undefined;
|
|
2160
|
+
readonly begindate?: Order | undefined;
|
|
2161
|
+
readonly categoryId?: Order | undefined;
|
|
2162
|
+
readonly closed?: Order | undefined;
|
|
2163
|
+
readonly closedate?: Order | undefined;
|
|
2164
|
+
readonly comments?: Order | undefined;
|
|
2165
|
+
readonly companyId?: Order | undefined;
|
|
2166
|
+
readonly contactId?: Order | undefined;
|
|
2167
|
+
readonly contactIds?: Order | undefined;
|
|
2168
|
+
readonly createdBy?: Order | undefined;
|
|
2169
|
+
readonly createdTime?: Order | undefined;
|
|
2170
|
+
readonly currencyId?: Order | undefined;
|
|
2171
|
+
readonly entityTypeId?: Order | undefined;
|
|
2172
|
+
readonly id?: Order | undefined;
|
|
2173
|
+
readonly isManualOpportunity?: Order | undefined;
|
|
2174
|
+
readonly lastActivityBy?: Order | undefined;
|
|
2175
|
+
readonly lastActivityTime?: Order | undefined;
|
|
2176
|
+
readonly leadId?: Order | undefined;
|
|
2177
|
+
readonly movedBy?: Order | undefined;
|
|
2178
|
+
readonly movedTime?: Order | undefined;
|
|
2179
|
+
readonly mycompanyId?: Order | undefined;
|
|
2180
|
+
readonly observers?: Order | undefined;
|
|
2181
|
+
readonly opened?: Order | undefined;
|
|
2182
|
+
readonly opportunity?: Order | undefined;
|
|
2183
|
+
readonly originId?: Order | undefined;
|
|
2184
|
+
readonly originatorId?: Order | undefined;
|
|
2185
|
+
readonly previousStageId?: Order | undefined;
|
|
2186
|
+
readonly probability?: Order | undefined;
|
|
2187
|
+
readonly quoteId?: Order | undefined;
|
|
2188
|
+
readonly sourceDescription?: Order | undefined;
|
|
2189
|
+
readonly sourceId?: Order | undefined;
|
|
2190
|
+
readonly stageId?: Order | undefined;
|
|
2191
|
+
readonly stageSemanticId?: Order | undefined;
|
|
2192
|
+
readonly taxValue?: Order | undefined;
|
|
2193
|
+
readonly title?: Order | undefined;
|
|
2194
|
+
readonly typeId?: Order | undefined;
|
|
2195
|
+
readonly updatedBy?: Order | undefined;
|
|
2196
|
+
readonly updatedTime?: Order | undefined;
|
|
2197
|
+
readonly webformId?: Order | undefined;
|
|
2198
|
+
readonly xmlId?: Order | undefined;
|
|
2199
|
+
} | undefined;
|
|
2200
|
+
readonly start?: number;
|
|
2201
|
+
}, "entityTypeId" | "select"> & {
|
|
2202
|
+
readonly select?: S | undefined;
|
|
2203
|
+
}, options?: Pick<PaginateOptions, "onProgress" | "signal"> & {
|
|
2204
|
+
readonly mode?: 'cursor' | 'offset';
|
|
2205
|
+
}) => Promise<(S extends readonly [] ? CrmItem : "*" extends S[number] ? CrmItem : Pick<CrmItem, S[number] & keyof CrmItem>)[]>;
|
|
2206
|
+
paginate: <const S extends readonly ("*" | "assignedById" | "begindate" | "categoryId" | "closed" | "closedate" | "comments" | "companyId" | "contactId" | "contactIds" | "createdBy" | "createdTime" | "currencyId" | "entityTypeId" | "id" | "isManualOpportunity" | "lastActivityBy" | "lastActivityTime" | "leadId" | "movedBy" | "movedTime" | "mycompanyId" | "observers" | "opened" | "opportunity" | "originId" | "originatorId" | "previousStageId" | "probability" | "quoteId" | "sourceDescription" | "sourceId" | "stageId" | "stageSemanticId" | "taxValue" | "title" | "typeId" | "updatedBy" | "updatedTime" | "webformId" | "xmlId" | `ufCrm${string}`)[] = []>(params?: Omit<{
|
|
2207
|
+
readonly entityTypeId: number;
|
|
2208
|
+
} & {
|
|
2209
|
+
readonly select?: ReadonlyArray<(keyof CrmItem & string) | '*'>;
|
|
2210
|
+
readonly filter?: Filter;
|
|
2211
|
+
readonly order?: {
|
|
2212
|
+
readonly [x: `ufCrm${string}`]: Order | undefined;
|
|
2213
|
+
readonly assignedById?: Order | undefined;
|
|
2214
|
+
readonly begindate?: Order | undefined;
|
|
2215
|
+
readonly categoryId?: Order | undefined;
|
|
2216
|
+
readonly closed?: Order | undefined;
|
|
2217
|
+
readonly closedate?: Order | undefined;
|
|
2218
|
+
readonly comments?: Order | undefined;
|
|
2219
|
+
readonly companyId?: Order | undefined;
|
|
2220
|
+
readonly contactId?: Order | undefined;
|
|
2221
|
+
readonly contactIds?: Order | undefined;
|
|
2222
|
+
readonly createdBy?: Order | undefined;
|
|
2223
|
+
readonly createdTime?: Order | undefined;
|
|
2224
|
+
readonly currencyId?: Order | undefined;
|
|
2225
|
+
readonly entityTypeId?: Order | undefined;
|
|
2226
|
+
readonly id?: Order | undefined;
|
|
2227
|
+
readonly isManualOpportunity?: Order | undefined;
|
|
2228
|
+
readonly lastActivityBy?: Order | undefined;
|
|
2229
|
+
readonly lastActivityTime?: Order | undefined;
|
|
2230
|
+
readonly leadId?: Order | undefined;
|
|
2231
|
+
readonly movedBy?: Order | undefined;
|
|
2232
|
+
readonly movedTime?: Order | undefined;
|
|
2233
|
+
readonly mycompanyId?: Order | undefined;
|
|
2234
|
+
readonly observers?: Order | undefined;
|
|
2235
|
+
readonly opened?: Order | undefined;
|
|
2236
|
+
readonly opportunity?: Order | undefined;
|
|
2237
|
+
readonly originId?: Order | undefined;
|
|
2238
|
+
readonly originatorId?: Order | undefined;
|
|
2239
|
+
readonly previousStageId?: Order | undefined;
|
|
2240
|
+
readonly probability?: Order | undefined;
|
|
2241
|
+
readonly quoteId?: Order | undefined;
|
|
2242
|
+
readonly sourceDescription?: Order | undefined;
|
|
2243
|
+
readonly sourceId?: Order | undefined;
|
|
2244
|
+
readonly stageId?: Order | undefined;
|
|
2245
|
+
readonly stageSemanticId?: Order | undefined;
|
|
2246
|
+
readonly taxValue?: Order | undefined;
|
|
2247
|
+
readonly title?: Order | undefined;
|
|
2248
|
+
readonly typeId?: Order | undefined;
|
|
2249
|
+
readonly updatedBy?: Order | undefined;
|
|
2250
|
+
readonly updatedTime?: Order | undefined;
|
|
2251
|
+
readonly webformId?: Order | undefined;
|
|
2252
|
+
readonly xmlId?: Order | undefined;
|
|
2253
|
+
} | undefined;
|
|
2254
|
+
readonly start?: number;
|
|
2255
|
+
}, "entityTypeId" | "select"> & {
|
|
2256
|
+
readonly select?: S | undefined;
|
|
2257
|
+
}, options?: Pick<PaginateOptions, "onProgress" | "signal"> & {
|
|
2258
|
+
readonly mode?: 'cursor' | 'offset';
|
|
2259
|
+
}) => AsyncGenerator<S extends readonly [] ? CrmItem : "*" extends S[number] ? CrmItem : Pick<CrmItem, S[number] & keyof CrmItem>, void, undefined>;
|
|
2260
|
+
changedSince: <const S extends readonly ("*" | "assignedById" | "begindate" | "categoryId" | "closed" | "closedate" | "comments" | "companyId" | "contactId" | "contactIds" | "createdBy" | "createdTime" | "currencyId" | "entityTypeId" | "id" | "isManualOpportunity" | "lastActivityBy" | "lastActivityTime" | "leadId" | "movedBy" | "movedTime" | "mycompanyId" | "observers" | "opened" | "opportunity" | "originId" | "originatorId" | "previousStageId" | "probability" | "quoteId" | "sourceDescription" | "sourceId" | "stageId" | "stageSemanticId" | "taxValue" | "title" | "typeId" | "updatedBy" | "updatedTime" | "webformId" | "xmlId" | `ufCrm${string}`)[] = []>(since: Date | string, params?: Omit<{
|
|
2261
|
+
readonly entityTypeId: number;
|
|
2262
|
+
} & {
|
|
2263
|
+
readonly select?: ReadonlyArray<(keyof CrmItem & string) | '*'>;
|
|
2264
|
+
readonly filter?: Filter;
|
|
2265
|
+
readonly order?: {
|
|
2266
|
+
readonly [x: `ufCrm${string}`]: Order | undefined;
|
|
2267
|
+
readonly assignedById?: Order | undefined;
|
|
2268
|
+
readonly begindate?: Order | undefined;
|
|
2269
|
+
readonly categoryId?: Order | undefined;
|
|
2270
|
+
readonly closed?: Order | undefined;
|
|
2271
|
+
readonly closedate?: Order | undefined;
|
|
2272
|
+
readonly comments?: Order | undefined;
|
|
2273
|
+
readonly companyId?: Order | undefined;
|
|
2274
|
+
readonly contactId?: Order | undefined;
|
|
2275
|
+
readonly contactIds?: Order | undefined;
|
|
2276
|
+
readonly createdBy?: Order | undefined;
|
|
2277
|
+
readonly createdTime?: Order | undefined;
|
|
2278
|
+
readonly currencyId?: Order | undefined;
|
|
2279
|
+
readonly entityTypeId?: Order | undefined;
|
|
2280
|
+
readonly id?: Order | undefined;
|
|
2281
|
+
readonly isManualOpportunity?: Order | undefined;
|
|
2282
|
+
readonly lastActivityBy?: Order | undefined;
|
|
2283
|
+
readonly lastActivityTime?: Order | undefined;
|
|
2284
|
+
readonly leadId?: Order | undefined;
|
|
2285
|
+
readonly movedBy?: Order | undefined;
|
|
2286
|
+
readonly movedTime?: Order | undefined;
|
|
2287
|
+
readonly mycompanyId?: Order | undefined;
|
|
2288
|
+
readonly observers?: Order | undefined;
|
|
2289
|
+
readonly opened?: Order | undefined;
|
|
2290
|
+
readonly opportunity?: Order | undefined;
|
|
2291
|
+
readonly originId?: Order | undefined;
|
|
2292
|
+
readonly originatorId?: Order | undefined;
|
|
2293
|
+
readonly previousStageId?: Order | undefined;
|
|
2294
|
+
readonly probability?: Order | undefined;
|
|
2295
|
+
readonly quoteId?: Order | undefined;
|
|
2296
|
+
readonly sourceDescription?: Order | undefined;
|
|
2297
|
+
readonly sourceId?: Order | undefined;
|
|
2298
|
+
readonly stageId?: Order | undefined;
|
|
2299
|
+
readonly stageSemanticId?: Order | undefined;
|
|
2300
|
+
readonly taxValue?: Order | undefined;
|
|
2301
|
+
readonly title?: Order | undefined;
|
|
2302
|
+
readonly typeId?: Order | undefined;
|
|
2303
|
+
readonly updatedBy?: Order | undefined;
|
|
2304
|
+
readonly updatedTime?: Order | undefined;
|
|
2305
|
+
readonly webformId?: Order | undefined;
|
|
2306
|
+
readonly xmlId?: Order | undefined;
|
|
2307
|
+
} | undefined;
|
|
2308
|
+
readonly start?: number;
|
|
2309
|
+
}, "entityTypeId" | "select"> & {
|
|
2310
|
+
readonly select?: S | undefined;
|
|
2311
|
+
}, options?: Pick<PaginateOptions, 'signal' | 'onProgress'>) => AsyncGenerator<S extends readonly [] ? CrmItem : "*" extends S[number] ? CrmItem : Pick<CrmItem, S[number] & keyof CrmItem>, void, undefined>;
|
|
2312
|
+
create: (fields: Input<CrmItem>) => Promise<CrmItem>;
|
|
2313
|
+
update: (id: Id, fields: Input<CrmItem>) => Promise<CrmItem>;
|
|
2314
|
+
delete: (id: Id) => Promise<void>;
|
|
2315
|
+
};
|
|
2316
|
+
leads: {
|
|
2317
|
+
fields: () => Promise<Fields>;
|
|
2318
|
+
get: (id: Id) => Promise<Lead>;
|
|
2319
|
+
list: <const S extends readonly SelectField<Lead>[] = []>(params?: ListParams<Lead, S> | undefined, options?: PaginateOptions) => Promise<((S extends readonly [] ? {
|
|
2320
|
+
readonly UTM_SOURCE: string | null;
|
|
2321
|
+
readonly UTM_MEDIUM: string | null;
|
|
2322
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2323
|
+
readonly UTM_CONTENT: string | null;
|
|
2324
|
+
readonly UTM_TERM: string | null;
|
|
2325
|
+
readonly HAS_PHONE: BoolString;
|
|
2326
|
+
readonly HAS_EMAIL: BoolString;
|
|
2327
|
+
readonly HAS_IMOL: BoolString;
|
|
2328
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2329
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2330
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2331
|
+
readonly DATE_CREATE: ISODate;
|
|
2332
|
+
readonly DATE_MODIFY: ISODate;
|
|
2333
|
+
readonly OPENED: BoolString;
|
|
2334
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2335
|
+
readonly ORIGIN_ID: string | null;
|
|
2336
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2337
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2338
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2339
|
+
readonly ID: NumberString;
|
|
2340
|
+
readonly TITLE: string | null;
|
|
2341
|
+
readonly HONORIFIC: string | null;
|
|
2342
|
+
readonly NAME: string | null;
|
|
2343
|
+
readonly SECOND_NAME: string | null;
|
|
2344
|
+
readonly LAST_NAME: string | null;
|
|
2345
|
+
readonly BIRTHDATE: ISODate;
|
|
2346
|
+
readonly COMPANY_TITLE: string | null;
|
|
2347
|
+
readonly SOURCE_ID: string | null;
|
|
2348
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
2349
|
+
readonly STATUS_ID: string;
|
|
2350
|
+
readonly STATUS_DESCRIPTION: string | null;
|
|
2351
|
+
readonly STATUS_SEMANTIC_ID: string;
|
|
2352
|
+
readonly POST: string | null;
|
|
2353
|
+
readonly CURRENCY_ID: string;
|
|
2354
|
+
readonly OPPORTUNITY: NumberString;
|
|
2355
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
2356
|
+
readonly COMMENTS: string | null;
|
|
2357
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
2358
|
+
readonly MOVED_TIME: ISODate | null;
|
|
2359
|
+
readonly COMPANY_ID: NumberString | null;
|
|
2360
|
+
readonly CONTACT_ID: NumberString | null;
|
|
2361
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
2362
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
2363
|
+
readonly DATE_CLOSED: ISODate;
|
|
2364
|
+
readonly ADDRESS: string | null;
|
|
2365
|
+
readonly ADDRESS_2: string | null;
|
|
2366
|
+
readonly ADDRESS_CITY: string | null;
|
|
2367
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
2368
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
2369
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
2370
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
2371
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
2372
|
+
readonly ADDRESS_REGION: string | null;
|
|
2373
|
+
} : ("*" extends S[number] ? {
|
|
2374
|
+
readonly UTM_SOURCE: string | null;
|
|
2375
|
+
readonly UTM_MEDIUM: string | null;
|
|
2376
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2377
|
+
readonly UTM_CONTENT: string | null;
|
|
2378
|
+
readonly UTM_TERM: string | null;
|
|
2379
|
+
readonly HAS_PHONE: BoolString;
|
|
2380
|
+
readonly HAS_EMAIL: BoolString;
|
|
2381
|
+
readonly HAS_IMOL: BoolString;
|
|
2382
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2383
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2384
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2385
|
+
readonly DATE_CREATE: ISODate;
|
|
2386
|
+
readonly DATE_MODIFY: ISODate;
|
|
2387
|
+
readonly OPENED: BoolString;
|
|
2388
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2389
|
+
readonly ORIGIN_ID: string | null;
|
|
2390
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2391
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2392
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2393
|
+
readonly ID: NumberString;
|
|
2394
|
+
readonly TITLE: string | null;
|
|
2395
|
+
readonly HONORIFIC: string | null;
|
|
2396
|
+
readonly NAME: string | null;
|
|
2397
|
+
readonly SECOND_NAME: string | null;
|
|
2398
|
+
readonly LAST_NAME: string | null;
|
|
2399
|
+
readonly BIRTHDATE: ISODate;
|
|
2400
|
+
readonly COMPANY_TITLE: string | null;
|
|
2401
|
+
readonly SOURCE_ID: string | null;
|
|
2402
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
2403
|
+
readonly STATUS_ID: string;
|
|
2404
|
+
readonly STATUS_DESCRIPTION: string | null;
|
|
2405
|
+
readonly STATUS_SEMANTIC_ID: string;
|
|
2406
|
+
readonly POST: string | null;
|
|
2407
|
+
readonly CURRENCY_ID: string;
|
|
2408
|
+
readonly OPPORTUNITY: NumberString;
|
|
2409
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
2410
|
+
readonly COMMENTS: string | null;
|
|
2411
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
2412
|
+
readonly MOVED_TIME: ISODate | null;
|
|
2413
|
+
readonly COMPANY_ID: NumberString | null;
|
|
2414
|
+
readonly CONTACT_ID: NumberString | null;
|
|
2415
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
2416
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
2417
|
+
readonly DATE_CLOSED: ISODate;
|
|
2418
|
+
readonly ADDRESS: string | null;
|
|
2419
|
+
readonly ADDRESS_2: string | null;
|
|
2420
|
+
readonly ADDRESS_CITY: string | null;
|
|
2421
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
2422
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
2423
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
2424
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
2425
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
2426
|
+
readonly ADDRESS_REGION: string | null;
|
|
2427
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Lead, `UF_${string}`> : {}) & Pick<Lead, S[number] & ("ADDRESS" | "ADDRESS_2" | "ADDRESS_CITY" | "ADDRESS_COUNTRY" | "ADDRESS_COUNTRY_CODE" | "ADDRESS_LOC_ADDR_ID" | "ADDRESS_POSTAL_CODE" | "ADDRESS_PROVINCE" | "ADDRESS_REGION" | "BIRTHDATE" | "COMMENTS" | "COMPANY_ID" | "COMPANY_TITLE" | "CONTACT_ID" | "CONTACT_IDS" | "CURRENCY_ID" | "DATE_CLOSED" | "HONORIFIC" | "ID" | "IS_MANUAL_OPPORTUNITY" | "IS_RETURN_CUSTOMER" | "LAST_NAME" | "MOVED_BY_ID" | "MOVED_TIME" | "NAME" | "OPPORTUNITY" | "POST" | "SECOND_NAME" | "SOURCE_DESCRIPTION" | "SOURCE_ID" | "STATUS_DESCRIPTION" | "STATUS_ID" | "STATUS_SEMANTIC_ID" | "TITLE" | `UF_${string}` | keyof {
|
|
2428
|
+
readonly HAS_PHONE: BoolString;
|
|
2429
|
+
readonly HAS_EMAIL: BoolString;
|
|
2430
|
+
readonly HAS_IMOL: BoolString;
|
|
2431
|
+
readonly PHONE?: readonly MultiField[];
|
|
2432
|
+
readonly EMAIL?: readonly MultiField[];
|
|
2433
|
+
readonly WEB?: readonly MultiField[];
|
|
2434
|
+
readonly IM?: readonly MultiField[];
|
|
2435
|
+
readonly LINK?: readonly MultiField[];
|
|
2436
|
+
} | keyof {
|
|
2437
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2438
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2439
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2440
|
+
readonly DATE_CREATE: ISODate;
|
|
2441
|
+
readonly DATE_MODIFY: ISODate;
|
|
2442
|
+
readonly OPENED: BoolString;
|
|
2443
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2444
|
+
readonly ORIGIN_ID: string | null;
|
|
2445
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2446
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2447
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2448
|
+
} | keyof {
|
|
2449
|
+
readonly UTM_SOURCE: string | null;
|
|
2450
|
+
readonly UTM_MEDIUM: string | null;
|
|
2451
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2452
|
+
readonly UTM_CONTENT: string | null;
|
|
2453
|
+
readonly UTM_TERM: string | null;
|
|
2454
|
+
})>) extends (infer T) ? { [K in keyof T]: T[K]; } : never)[]>;
|
|
2455
|
+
paginate: <const S extends readonly SelectField<Lead>[] = []>(params?: ListParams<Lead, S> | undefined, options?: PaginateOptions) => AsyncGenerator<(S extends readonly [] ? {
|
|
2456
|
+
readonly UTM_SOURCE: string | null;
|
|
2457
|
+
readonly UTM_MEDIUM: string | null;
|
|
2458
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2459
|
+
readonly UTM_CONTENT: string | null;
|
|
2460
|
+
readonly UTM_TERM: string | null;
|
|
2461
|
+
readonly HAS_PHONE: BoolString;
|
|
2462
|
+
readonly HAS_EMAIL: BoolString;
|
|
2463
|
+
readonly HAS_IMOL: BoolString;
|
|
2464
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2465
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2466
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2467
|
+
readonly DATE_CREATE: ISODate;
|
|
2468
|
+
readonly DATE_MODIFY: ISODate;
|
|
2469
|
+
readonly OPENED: BoolString;
|
|
2470
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2471
|
+
readonly ORIGIN_ID: string | null;
|
|
2472
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2473
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2474
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2475
|
+
readonly ID: NumberString;
|
|
2476
|
+
readonly TITLE: string | null;
|
|
2477
|
+
readonly HONORIFIC: string | null;
|
|
2478
|
+
readonly NAME: string | null;
|
|
2479
|
+
readonly SECOND_NAME: string | null;
|
|
2480
|
+
readonly LAST_NAME: string | null;
|
|
2481
|
+
readonly BIRTHDATE: ISODate;
|
|
2482
|
+
readonly COMPANY_TITLE: string | null;
|
|
2483
|
+
readonly SOURCE_ID: string | null;
|
|
2484
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
2485
|
+
readonly STATUS_ID: string;
|
|
2486
|
+
readonly STATUS_DESCRIPTION: string | null;
|
|
2487
|
+
readonly STATUS_SEMANTIC_ID: string;
|
|
2488
|
+
readonly POST: string | null;
|
|
2489
|
+
readonly CURRENCY_ID: string;
|
|
2490
|
+
readonly OPPORTUNITY: NumberString;
|
|
2491
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
2492
|
+
readonly COMMENTS: string | null;
|
|
2493
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
2494
|
+
readonly MOVED_TIME: ISODate | null;
|
|
2495
|
+
readonly COMPANY_ID: NumberString | null;
|
|
2496
|
+
readonly CONTACT_ID: NumberString | null;
|
|
2497
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
2498
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
2499
|
+
readonly DATE_CLOSED: ISODate;
|
|
2500
|
+
readonly ADDRESS: string | null;
|
|
2501
|
+
readonly ADDRESS_2: string | null;
|
|
2502
|
+
readonly ADDRESS_CITY: string | null;
|
|
2503
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
2504
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
2505
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
2506
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
2507
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
2508
|
+
readonly ADDRESS_REGION: string | null;
|
|
2509
|
+
} : ("*" extends S[number] ? {
|
|
2510
|
+
readonly UTM_SOURCE: string | null;
|
|
2511
|
+
readonly UTM_MEDIUM: string | null;
|
|
2512
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2513
|
+
readonly UTM_CONTENT: string | null;
|
|
2514
|
+
readonly UTM_TERM: string | null;
|
|
2515
|
+
readonly HAS_PHONE: BoolString;
|
|
2516
|
+
readonly HAS_EMAIL: BoolString;
|
|
2517
|
+
readonly HAS_IMOL: BoolString;
|
|
2518
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2519
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2520
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2521
|
+
readonly DATE_CREATE: ISODate;
|
|
2522
|
+
readonly DATE_MODIFY: ISODate;
|
|
2523
|
+
readonly OPENED: BoolString;
|
|
2524
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2525
|
+
readonly ORIGIN_ID: string | null;
|
|
2526
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2527
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2528
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2529
|
+
readonly ID: NumberString;
|
|
2530
|
+
readonly TITLE: string | null;
|
|
2531
|
+
readonly HONORIFIC: string | null;
|
|
2532
|
+
readonly NAME: string | null;
|
|
2533
|
+
readonly SECOND_NAME: string | null;
|
|
2534
|
+
readonly LAST_NAME: string | null;
|
|
2535
|
+
readonly BIRTHDATE: ISODate;
|
|
2536
|
+
readonly COMPANY_TITLE: string | null;
|
|
2537
|
+
readonly SOURCE_ID: string | null;
|
|
2538
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
2539
|
+
readonly STATUS_ID: string;
|
|
2540
|
+
readonly STATUS_DESCRIPTION: string | null;
|
|
2541
|
+
readonly STATUS_SEMANTIC_ID: string;
|
|
2542
|
+
readonly POST: string | null;
|
|
2543
|
+
readonly CURRENCY_ID: string;
|
|
2544
|
+
readonly OPPORTUNITY: NumberString;
|
|
2545
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
2546
|
+
readonly COMMENTS: string | null;
|
|
2547
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
2548
|
+
readonly MOVED_TIME: ISODate | null;
|
|
2549
|
+
readonly COMPANY_ID: NumberString | null;
|
|
2550
|
+
readonly CONTACT_ID: NumberString | null;
|
|
2551
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
2552
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
2553
|
+
readonly DATE_CLOSED: ISODate;
|
|
2554
|
+
readonly ADDRESS: string | null;
|
|
2555
|
+
readonly ADDRESS_2: string | null;
|
|
2556
|
+
readonly ADDRESS_CITY: string | null;
|
|
2557
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
2558
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
2559
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
2560
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
2561
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
2562
|
+
readonly ADDRESS_REGION: string | null;
|
|
2563
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Lead, `UF_${string}`> : {}) & Pick<Lead, S[number] & ("ADDRESS" | "ADDRESS_2" | "ADDRESS_CITY" | "ADDRESS_COUNTRY" | "ADDRESS_COUNTRY_CODE" | "ADDRESS_LOC_ADDR_ID" | "ADDRESS_POSTAL_CODE" | "ADDRESS_PROVINCE" | "ADDRESS_REGION" | "BIRTHDATE" | "COMMENTS" | "COMPANY_ID" | "COMPANY_TITLE" | "CONTACT_ID" | "CONTACT_IDS" | "CURRENCY_ID" | "DATE_CLOSED" | "HONORIFIC" | "ID" | "IS_MANUAL_OPPORTUNITY" | "IS_RETURN_CUSTOMER" | "LAST_NAME" | "MOVED_BY_ID" | "MOVED_TIME" | "NAME" | "OPPORTUNITY" | "POST" | "SECOND_NAME" | "SOURCE_DESCRIPTION" | "SOURCE_ID" | "STATUS_DESCRIPTION" | "STATUS_ID" | "STATUS_SEMANTIC_ID" | "TITLE" | `UF_${string}` | keyof {
|
|
2564
|
+
readonly HAS_PHONE: BoolString;
|
|
2565
|
+
readonly HAS_EMAIL: BoolString;
|
|
2566
|
+
readonly HAS_IMOL: BoolString;
|
|
2567
|
+
readonly PHONE?: readonly MultiField[];
|
|
2568
|
+
readonly EMAIL?: readonly MultiField[];
|
|
2569
|
+
readonly WEB?: readonly MultiField[];
|
|
2570
|
+
readonly IM?: readonly MultiField[];
|
|
2571
|
+
readonly LINK?: readonly MultiField[];
|
|
2572
|
+
} | keyof {
|
|
2573
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2574
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2575
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2576
|
+
readonly DATE_CREATE: ISODate;
|
|
2577
|
+
readonly DATE_MODIFY: ISODate;
|
|
2578
|
+
readonly OPENED: BoolString;
|
|
2579
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2580
|
+
readonly ORIGIN_ID: string | null;
|
|
2581
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2582
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2583
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2584
|
+
} | keyof {
|
|
2585
|
+
readonly UTM_SOURCE: string | null;
|
|
2586
|
+
readonly UTM_MEDIUM: string | null;
|
|
2587
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2588
|
+
readonly UTM_CONTENT: string | null;
|
|
2589
|
+
readonly UTM_TERM: string | null;
|
|
2590
|
+
})>) extends (infer T) ? { [K in keyof T]: T[K]; } : never, void, undefined>;
|
|
2591
|
+
changedSince: <const S extends readonly SelectField<Lead>[] = []>(since: Date | string, params?: ListParams<Lead, S> | undefined, options?: Pick<PaginateOptions, 'signal' | 'onProgress'>) => AsyncGenerator<(S extends readonly [] ? {
|
|
2592
|
+
readonly UTM_SOURCE: string | null;
|
|
2593
|
+
readonly UTM_MEDIUM: string | null;
|
|
2594
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2595
|
+
readonly UTM_CONTENT: string | null;
|
|
2596
|
+
readonly UTM_TERM: string | null;
|
|
2597
|
+
readonly HAS_PHONE: BoolString;
|
|
2598
|
+
readonly HAS_EMAIL: BoolString;
|
|
2599
|
+
readonly HAS_IMOL: BoolString;
|
|
2600
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2601
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2602
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2603
|
+
readonly DATE_CREATE: ISODate;
|
|
2604
|
+
readonly DATE_MODIFY: ISODate;
|
|
2605
|
+
readonly OPENED: BoolString;
|
|
2606
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2607
|
+
readonly ORIGIN_ID: string | null;
|
|
2608
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2609
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2610
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2611
|
+
readonly ID: NumberString;
|
|
2612
|
+
readonly TITLE: string | null;
|
|
2613
|
+
readonly HONORIFIC: string | null;
|
|
2614
|
+
readonly NAME: string | null;
|
|
2615
|
+
readonly SECOND_NAME: string | null;
|
|
2616
|
+
readonly LAST_NAME: string | null;
|
|
2617
|
+
readonly BIRTHDATE: ISODate;
|
|
2618
|
+
readonly COMPANY_TITLE: string | null;
|
|
2619
|
+
readonly SOURCE_ID: string | null;
|
|
2620
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
2621
|
+
readonly STATUS_ID: string;
|
|
2622
|
+
readonly STATUS_DESCRIPTION: string | null;
|
|
2623
|
+
readonly STATUS_SEMANTIC_ID: string;
|
|
2624
|
+
readonly POST: string | null;
|
|
2625
|
+
readonly CURRENCY_ID: string;
|
|
2626
|
+
readonly OPPORTUNITY: NumberString;
|
|
2627
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
2628
|
+
readonly COMMENTS: string | null;
|
|
2629
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
2630
|
+
readonly MOVED_TIME: ISODate | null;
|
|
2631
|
+
readonly COMPANY_ID: NumberString | null;
|
|
2632
|
+
readonly CONTACT_ID: NumberString | null;
|
|
2633
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
2634
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
2635
|
+
readonly DATE_CLOSED: ISODate;
|
|
2636
|
+
readonly ADDRESS: string | null;
|
|
2637
|
+
readonly ADDRESS_2: string | null;
|
|
2638
|
+
readonly ADDRESS_CITY: string | null;
|
|
2639
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
2640
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
2641
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
2642
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
2643
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
2644
|
+
readonly ADDRESS_REGION: string | null;
|
|
2645
|
+
} : ("*" extends S[number] ? {
|
|
2646
|
+
readonly UTM_SOURCE: string | null;
|
|
2647
|
+
readonly UTM_MEDIUM: string | null;
|
|
2648
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2649
|
+
readonly UTM_CONTENT: string | null;
|
|
2650
|
+
readonly UTM_TERM: string | null;
|
|
2651
|
+
readonly HAS_PHONE: BoolString;
|
|
2652
|
+
readonly HAS_EMAIL: BoolString;
|
|
2653
|
+
readonly HAS_IMOL: BoolString;
|
|
2654
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2655
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2656
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2657
|
+
readonly DATE_CREATE: ISODate;
|
|
2658
|
+
readonly DATE_MODIFY: ISODate;
|
|
2659
|
+
readonly OPENED: BoolString;
|
|
2660
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2661
|
+
readonly ORIGIN_ID: string | null;
|
|
2662
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2663
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2664
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2665
|
+
readonly ID: NumberString;
|
|
2666
|
+
readonly TITLE: string | null;
|
|
2667
|
+
readonly HONORIFIC: string | null;
|
|
2668
|
+
readonly NAME: string | null;
|
|
2669
|
+
readonly SECOND_NAME: string | null;
|
|
2670
|
+
readonly LAST_NAME: string | null;
|
|
2671
|
+
readonly BIRTHDATE: ISODate;
|
|
2672
|
+
readonly COMPANY_TITLE: string | null;
|
|
2673
|
+
readonly SOURCE_ID: string | null;
|
|
2674
|
+
readonly SOURCE_DESCRIPTION: string | null;
|
|
2675
|
+
readonly STATUS_ID: string;
|
|
2676
|
+
readonly STATUS_DESCRIPTION: string | null;
|
|
2677
|
+
readonly STATUS_SEMANTIC_ID: string;
|
|
2678
|
+
readonly POST: string | null;
|
|
2679
|
+
readonly CURRENCY_ID: string;
|
|
2680
|
+
readonly OPPORTUNITY: NumberString;
|
|
2681
|
+
readonly IS_MANUAL_OPPORTUNITY: BoolString;
|
|
2682
|
+
readonly COMMENTS: string | null;
|
|
2683
|
+
readonly MOVED_BY_ID: NumberString | null;
|
|
2684
|
+
readonly MOVED_TIME: ISODate | null;
|
|
2685
|
+
readonly COMPANY_ID: NumberString | null;
|
|
2686
|
+
readonly CONTACT_ID: NumberString | null;
|
|
2687
|
+
readonly CONTACT_IDS?: readonly NumberString[];
|
|
2688
|
+
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
2689
|
+
readonly DATE_CLOSED: ISODate;
|
|
2690
|
+
readonly ADDRESS: string | null;
|
|
2691
|
+
readonly ADDRESS_2: string | null;
|
|
2692
|
+
readonly ADDRESS_CITY: string | null;
|
|
2693
|
+
readonly ADDRESS_COUNTRY: string | null;
|
|
2694
|
+
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
2695
|
+
readonly ADDRESS_LOC_ADDR_ID: string | null;
|
|
2696
|
+
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
2697
|
+
readonly ADDRESS_PROVINCE: string | null;
|
|
2698
|
+
readonly ADDRESS_REGION: string | null;
|
|
2699
|
+
} : {}) & ("UF_*" extends S[number] ? Pick<Lead, `UF_${string}`> : {}) & Pick<Lead, S[number] & ("ADDRESS" | "ADDRESS_2" | "ADDRESS_CITY" | "ADDRESS_COUNTRY" | "ADDRESS_COUNTRY_CODE" | "ADDRESS_LOC_ADDR_ID" | "ADDRESS_POSTAL_CODE" | "ADDRESS_PROVINCE" | "ADDRESS_REGION" | "BIRTHDATE" | "COMMENTS" | "COMPANY_ID" | "COMPANY_TITLE" | "CONTACT_ID" | "CONTACT_IDS" | "CURRENCY_ID" | "DATE_CLOSED" | "HONORIFIC" | "ID" | "IS_MANUAL_OPPORTUNITY" | "IS_RETURN_CUSTOMER" | "LAST_NAME" | "MOVED_BY_ID" | "MOVED_TIME" | "NAME" | "OPPORTUNITY" | "POST" | "SECOND_NAME" | "SOURCE_DESCRIPTION" | "SOURCE_ID" | "STATUS_DESCRIPTION" | "STATUS_ID" | "STATUS_SEMANTIC_ID" | "TITLE" | `UF_${string}` | keyof {
|
|
2700
|
+
readonly HAS_PHONE: BoolString;
|
|
2701
|
+
readonly HAS_EMAIL: BoolString;
|
|
2702
|
+
readonly HAS_IMOL: BoolString;
|
|
2703
|
+
readonly PHONE?: readonly MultiField[];
|
|
2704
|
+
readonly EMAIL?: readonly MultiField[];
|
|
2705
|
+
readonly WEB?: readonly MultiField[];
|
|
2706
|
+
readonly IM?: readonly MultiField[];
|
|
2707
|
+
readonly LINK?: readonly MultiField[];
|
|
2708
|
+
} | keyof {
|
|
2709
|
+
readonly ASSIGNED_BY_ID: NumberString | null;
|
|
2710
|
+
readonly CREATED_BY_ID: NumberString;
|
|
2711
|
+
readonly MODIFY_BY_ID: NumberString | null;
|
|
2712
|
+
readonly DATE_CREATE: ISODate;
|
|
2713
|
+
readonly DATE_MODIFY: ISODate;
|
|
2714
|
+
readonly OPENED: BoolString;
|
|
2715
|
+
readonly ORIGINATOR_ID: string | null;
|
|
2716
|
+
readonly ORIGIN_ID: string | null;
|
|
2717
|
+
readonly LAST_ACTIVITY_TIME: ISODate | null;
|
|
2718
|
+
readonly LAST_ACTIVITY_BY: NumberString | null;
|
|
2719
|
+
readonly LAST_COMMUNICATION_TIME: string | null;
|
|
2720
|
+
} | keyof {
|
|
2721
|
+
readonly UTM_SOURCE: string | null;
|
|
2722
|
+
readonly UTM_MEDIUM: string | null;
|
|
2723
|
+
readonly UTM_CAMPAIGN: string | null;
|
|
2724
|
+
readonly UTM_CONTENT: string | null;
|
|
2725
|
+
readonly UTM_TERM: string | null;
|
|
2726
|
+
})>) extends (infer T) ? { [K in keyof T]: T[K]; } : never, void, undefined>;
|
|
2727
|
+
create: (fields: Input<Lead>, params?: {
|
|
2728
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
2729
|
+
}) => Promise<number>;
|
|
2730
|
+
update: (id: Id, fields: Input<Lead>, params?: {
|
|
2731
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
2732
|
+
}) => Promise<boolean>;
|
|
2733
|
+
delete: (id: Id) => Promise<boolean>;
|
|
2734
|
+
createMany: (items: readonly Input<Lead>[], params?: {
|
|
2735
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
2736
|
+
}) => Promise<BulkResult<number>>;
|
|
2737
|
+
updateMany: (items: readonly {
|
|
2738
|
+
readonly id: Id;
|
|
2739
|
+
readonly fields: Input<Lead>;
|
|
2740
|
+
}[], params?: {
|
|
2741
|
+
readonly REGISTER_SONET_EVENT?: BoolString;
|
|
2742
|
+
}) => Promise<BulkResult<boolean>>;
|
|
2743
|
+
deleteMany: (ids: readonly Id[]) => Promise<BulkResult<boolean>>;
|
|
2744
|
+
productRows: ProductRows;
|
|
2745
|
+
contacts: Links<"CONTACT_ID">;
|
|
2746
|
+
};
|
|
2747
|
+
products: {
|
|
2748
|
+
fields: (iblockId: number) => Promise<Record<string, ProductField>>;
|
|
2749
|
+
get: (id: Id) => Promise<Product>;
|
|
2750
|
+
list: <const S extends readonly ("active" | "available" | "bundle" | "code" | "createdBy" | "dateActiveFrom" | "dateActiveTo" | "dateCreate" | "detailPicture" | "detailText" | "detailTextType" | "iblockId" | "iblockSection" | "iblockSectionId" | "id" | "measure" | "modifiedBy" | "name" | "previewPicture" | "previewText" | "previewTextType" | "purchasingCurrency" | "purchasingPrice" | "quantity" | "sort" | "timestampX" | "type" | "vatId" | "vatIncluded" | "weight" | "xmlId" | `property${number}`)[] = readonly ['name']>(params: Omit<{
|
|
2751
|
+
readonly select?: ReadonlyArray<keyof Product & string>;
|
|
2752
|
+
readonly filter: Readonly<Record<string, FilterValue>> & {
|
|
2753
|
+
readonly iblockId: number;
|
|
2754
|
+
};
|
|
2755
|
+
readonly order?: {
|
|
2756
|
+
readonly [x: `property${number}`]: Order | undefined;
|
|
2757
|
+
readonly active?: Order | undefined;
|
|
2758
|
+
readonly available?: Order | undefined;
|
|
2759
|
+
readonly bundle?: Order | undefined;
|
|
2760
|
+
readonly code?: Order | undefined;
|
|
2761
|
+
readonly createdBy?: Order | undefined;
|
|
2762
|
+
readonly dateActiveFrom?: Order | undefined;
|
|
2763
|
+
readonly dateActiveTo?: Order | undefined;
|
|
2764
|
+
readonly dateCreate?: Order | undefined;
|
|
2765
|
+
readonly detailPicture?: Order | undefined;
|
|
2766
|
+
readonly detailText?: Order | undefined;
|
|
2767
|
+
readonly detailTextType?: Order | undefined;
|
|
2768
|
+
readonly iblockId?: Order | undefined;
|
|
2769
|
+
readonly iblockSection?: Order | undefined;
|
|
2770
|
+
readonly iblockSectionId?: Order | undefined;
|
|
2771
|
+
readonly id?: Order | undefined;
|
|
2772
|
+
readonly measure?: Order | undefined;
|
|
2773
|
+
readonly modifiedBy?: Order | undefined;
|
|
2774
|
+
readonly name?: Order | undefined;
|
|
2775
|
+
readonly previewPicture?: Order | undefined;
|
|
2776
|
+
readonly previewText?: Order | undefined;
|
|
2777
|
+
readonly previewTextType?: Order | undefined;
|
|
2778
|
+
readonly purchasingCurrency?: Order | undefined;
|
|
2779
|
+
readonly purchasingPrice?: Order | undefined;
|
|
2780
|
+
readonly quantity?: Order | undefined;
|
|
2781
|
+
readonly sort?: Order | undefined;
|
|
2782
|
+
readonly timestampX?: Order | undefined;
|
|
2783
|
+
readonly type?: Order | undefined;
|
|
2784
|
+
readonly vatId?: Order | undefined;
|
|
2785
|
+
readonly vatIncluded?: Order | undefined;
|
|
2786
|
+
readonly weight?: Order | undefined;
|
|
2787
|
+
readonly xmlId?: Order | undefined;
|
|
2788
|
+
} | undefined;
|
|
2789
|
+
readonly start?: number;
|
|
2790
|
+
}, "select"> & {
|
|
2791
|
+
readonly select?: S | undefined;
|
|
2792
|
+
}, options?: Pick<PaginateOptions, "onProgress" | "signal"> & {
|
|
2793
|
+
readonly mode?: 'cursor' | 'offset';
|
|
2794
|
+
}) => Promise<("iblockId" | "id" | S[number] extends (infer T extends keyof Product) ? { [P in T]: Product[P]; } : never)[]>;
|
|
2795
|
+
paginate: <const S extends readonly ("active" | "available" | "bundle" | "code" | "createdBy" | "dateActiveFrom" | "dateActiveTo" | "dateCreate" | "detailPicture" | "detailText" | "detailTextType" | "iblockId" | "iblockSection" | "iblockSectionId" | "id" | "measure" | "modifiedBy" | "name" | "previewPicture" | "previewText" | "previewTextType" | "purchasingCurrency" | "purchasingPrice" | "quantity" | "sort" | "timestampX" | "type" | "vatId" | "vatIncluded" | "weight" | "xmlId" | `property${number}`)[] = readonly ['name']>(params: Omit<{
|
|
2796
|
+
readonly select?: ReadonlyArray<keyof Product & string>;
|
|
2797
|
+
readonly filter: Readonly<Record<string, FilterValue>> & {
|
|
2798
|
+
readonly iblockId: number;
|
|
2799
|
+
};
|
|
2800
|
+
readonly order?: {
|
|
2801
|
+
readonly [x: `property${number}`]: Order | undefined;
|
|
2802
|
+
readonly active?: Order | undefined;
|
|
2803
|
+
readonly available?: Order | undefined;
|
|
2804
|
+
readonly bundle?: Order | undefined;
|
|
2805
|
+
readonly code?: Order | undefined;
|
|
2806
|
+
readonly createdBy?: Order | undefined;
|
|
2807
|
+
readonly dateActiveFrom?: Order | undefined;
|
|
2808
|
+
readonly dateActiveTo?: Order | undefined;
|
|
2809
|
+
readonly dateCreate?: Order | undefined;
|
|
2810
|
+
readonly detailPicture?: Order | undefined;
|
|
2811
|
+
readonly detailText?: Order | undefined;
|
|
2812
|
+
readonly detailTextType?: Order | undefined;
|
|
2813
|
+
readonly iblockId?: Order | undefined;
|
|
2814
|
+
readonly iblockSection?: Order | undefined;
|
|
2815
|
+
readonly iblockSectionId?: Order | undefined;
|
|
2816
|
+
readonly id?: Order | undefined;
|
|
2817
|
+
readonly measure?: Order | undefined;
|
|
2818
|
+
readonly modifiedBy?: Order | undefined;
|
|
2819
|
+
readonly name?: Order | undefined;
|
|
2820
|
+
readonly previewPicture?: Order | undefined;
|
|
2821
|
+
readonly previewText?: Order | undefined;
|
|
2822
|
+
readonly previewTextType?: Order | undefined;
|
|
2823
|
+
readonly purchasingCurrency?: Order | undefined;
|
|
2824
|
+
readonly purchasingPrice?: Order | undefined;
|
|
2825
|
+
readonly quantity?: Order | undefined;
|
|
2826
|
+
readonly sort?: Order | undefined;
|
|
2827
|
+
readonly timestampX?: Order | undefined;
|
|
2828
|
+
readonly type?: Order | undefined;
|
|
2829
|
+
readonly vatId?: Order | undefined;
|
|
2830
|
+
readonly vatIncluded?: Order | undefined;
|
|
2831
|
+
readonly weight?: Order | undefined;
|
|
2832
|
+
readonly xmlId?: Order | undefined;
|
|
2833
|
+
} | undefined;
|
|
2834
|
+
readonly start?: number;
|
|
2835
|
+
}, "select"> & {
|
|
2836
|
+
readonly select?: S | undefined;
|
|
2837
|
+
}, options?: Pick<PaginateOptions, "onProgress" | "signal"> & {
|
|
2838
|
+
readonly mode?: 'cursor' | 'offset';
|
|
2839
|
+
}) => AsyncGenerator<"iblockId" | "id" | S[number] extends (infer T extends keyof Product) ? { [P in T]: Product[P]; } : never, void, undefined>;
|
|
2840
|
+
create: (fields: Params<'catalog.product.add'>['fields']) => Promise<Product>;
|
|
2841
|
+
update: (id: Id, fields: Input<Product>) => Promise<Product>;
|
|
2842
|
+
delete: (id: Id) => Promise<boolean>;
|
|
2843
|
+
};
|
|
2844
|
+
statuses: {
|
|
2845
|
+
fields: () => Promise<Readonly<Record<string, Field>>>;
|
|
2846
|
+
get: (id: Id) => Promise<Status>;
|
|
2847
|
+
list: (params?: Params<'crm.status.list'>) => Promise<Status[]>;
|
|
2848
|
+
create: (fields: Input<Status>) => Promise<number>;
|
|
2849
|
+
update: (id: Id, fields: Input<Status>) => Promise<boolean>;
|
|
2850
|
+
delete: (id: Id, { forced }?: {
|
|
2851
|
+
readonly forced?: boolean;
|
|
2852
|
+
}) => Promise<boolean>;
|
|
2853
|
+
};
|
|
2854
|
+
users: {
|
|
2855
|
+
fields: () => Promise<Record<string, string>>;
|
|
2856
|
+
current: () => Promise<User>;
|
|
2857
|
+
get: (id: Id) => Promise<User>;
|
|
2858
|
+
list: (params?: {
|
|
2859
|
+
readonly filter?: Filter;
|
|
2860
|
+
readonly sort?: keyof User & string;
|
|
2861
|
+
readonly order?: Order;
|
|
2862
|
+
readonly start?: number;
|
|
2863
|
+
readonly ADMIN_MODE?: boolean;
|
|
2864
|
+
}, options?: {
|
|
2865
|
+
readonly signal?: AbortSignal;
|
|
2866
|
+
readonly onProgress?: (progress: PaginateProgress) => void;
|
|
2867
|
+
}) => Promise<User[]>;
|
|
2868
|
+
paginate: (params?: {
|
|
2869
|
+
readonly filter?: Filter;
|
|
2870
|
+
readonly sort?: keyof User & string;
|
|
2871
|
+
readonly order?: Order;
|
|
2872
|
+
readonly start?: number;
|
|
2873
|
+
readonly ADMIN_MODE?: boolean;
|
|
2874
|
+
}, options?: {
|
|
2875
|
+
readonly signal?: AbortSignal;
|
|
2876
|
+
readonly onProgress?: (progress: PaginateProgress) => void;
|
|
2877
|
+
}) => AsyncGenerator<User, void, undefined>;
|
|
2878
|
+
};
|
|
2879
|
+
};
|
|
2880
|
+
type Client = ReturnType<typeof createClient>;
|
|
2881
|
+
export type { Activity, ActivityCommunication, Args, Batch, BatchOptions, BatchResult, BoolString, BulkResult, Call, CallOptions, Client, ClientOptions, Command, Company, CompanyUserFields, Contact, ContactUserFields, CrmItem, CrmService, Currency, CurrencyLocalization, Deal, DealUserFields, Envelope, Field, Fields, Filter, FilterValue, ISODate, Id, Input, Item, Lead, LeadUserFields, LimiterOptions, Link, LinkInput, Links, List, ListParams, Method, Methods, MultiField, MultiFieldInput, NumberString, Order, Paginate, PaginateOptions, PaginateProgress, Params, Product, ProductField, ProductRow, ProductRows, RequestEvent, ResponseEvent, Result, RetryOptions, SelectField, Selected, Status, Time, User, UserFieldFile, UserFieldFileInput };
|