erpnext-queue-client 1.0.6 → 1.1.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/dist/client.js +41 -16
- package/dist/erpnext/decryptFromErpNext.server.d.ts +1 -1
- package/dist/erpnext/doctypeResourceRequest.d.ts +38 -0
- package/dist/erpnext/doctypeResourceRequest.js +59 -0
- package/dist/erpnext/doctypeSubmittableResourceRequest.d.ts +8 -0
- package/dist/erpnext/doctypeSubmittableResourceRequest.js +39 -0
- package/dist/erpnext/doctypes/address.d.ts +263 -0
- package/dist/erpnext/doctypes/address.js +46 -0
- package/dist/erpnext/doctypes/contact.d.ts +383 -0
- package/dist/erpnext/doctypes/contact.js +46 -0
- package/dist/erpnext/doctypes/deliveryNote.d.ts +985 -0
- package/dist/erpnext/doctypes/deliveryNote.js +38 -0
- package/dist/erpnext/doctypes/item.d.ts +572 -0
- package/dist/erpnext/doctypes/item.js +95 -0
- package/dist/erpnext/doctypes/purchaseReceipt.d.ts +743 -0
- package/dist/erpnext/doctypes/purchaseReceipt.js +50 -0
- package/dist/erpnext/doctypes/shipment.d.ts +752 -0
- package/dist/erpnext/doctypes/shipment.js +51 -0
- package/dist/erpnext/erpnextRequestWrapper.js +15 -13
- package/dist/erpnext/fileRequests.d.ts +10 -0
- package/dist/erpnext/fileRequests.js +42 -0
- package/dist/erpnext/methodRequest.d.ts +15 -0
- package/dist/erpnext/methodRequest.js +32 -0
- package/dist/erpnext/model/Address.d.ts +200 -198
- package/dist/erpnext/model/Address.js +3 -2
- package/dist/erpnext/model/Contact.d.ts +343 -344
- package/dist/erpnext/model/Contact.js +2 -2
- package/dist/erpnext/model/Country.d.ts +83 -31
- package/dist/erpnext/model/Country.js +2 -6
- package/dist/erpnext/model/Customer.d.ts +64 -65
- package/dist/erpnext/model/Customer.js +2 -2
- package/dist/erpnext/model/DeliveryNote.d.ts +1048 -1048
- package/dist/erpnext/model/DispatchRun.d.ts +399 -399
- package/dist/erpnext/model/DispatcherPreset.d.ts +94 -94
- package/dist/erpnext/model/ERPNextRequest.d.ts +47 -30
- package/dist/erpnext/model/ERPNextResponse.d.ts +4 -4
- package/dist/erpnext/model/File.d.ts +88 -88
- package/dist/erpnext/model/Fulfiller.d.ts +97 -97
- package/dist/erpnext/model/FulfillerSettings.d.ts +66 -66
- package/dist/erpnext/model/FulfillmentStation.d.ts +2 -2
- package/dist/erpnext/model/Item.d.ts +819 -819
- package/dist/erpnext/model/Item.js +2 -2
- package/dist/erpnext/model/PaymentEntry.d.ts +197 -0
- package/dist/erpnext/model/PaymentEntry.js +63 -0
- package/dist/erpnext/model/ProjectedQuantityReport.d.ts +178 -178
- package/dist/erpnext/model/PurchaseOrder.d.ts +528 -528
- package/dist/erpnext/model/Receipt.d.ts +448 -448
- package/dist/erpnext/model/Receipt.js +2 -2
- package/dist/erpnext/model/ReceiptDraft.d.ts +392 -392
- package/dist/erpnext/model/Shipment.d.ts +709 -709
- package/dist/erpnext/model/ShippingProvider.d.ts +198 -198
- package/dist/erpnext/model/StockEntry.d.ts +248 -0
- package/dist/erpnext/model/StockEntry.js +76 -0
- package/dist/erpnext/model/StockReconciliation.d.ts +187 -0
- package/dist/erpnext/model/StockReconciliation.js +44 -0
- package/dist/erpnext/model/Supplier.d.ts +105 -0
- package/dist/erpnext/model/Supplier.js +39 -0
- package/dist/erpnext/model/Waitlist.d.ts +32 -0
- package/dist/erpnext/model/Waitlist.js +19 -0
- package/dist/erpnext/model/WarehouseCategory.d.ts +6 -6
- package/dist/erpnext/resourceRequest.d.ts +39 -10
- package/dist/erpnext/resourceRequest.js +115 -14
- package/dist/index.d.ts +39 -4
- package/dist/index.js +43 -8
- package/dist/utils/fernet.server.d.ts +11 -11
- package/dist/utils/fernet.server.js +0 -1
- package/dist/utils/request.js +2 -2
- package/dist/utils/zodUtils.d.ts +2 -1
- package/dist/utils/zodUtils.js +14 -1
- package/package.json +4 -1
- package/dist/erpnext/doctypes/country.d.ts +0 -9
- package/dist/erpnext/doctypes/country.js +0 -28
- package/dist/erpnext/erpnextRequests.d.ts +0 -1
- package/dist/erpnext/erpnextRequests.js +0 -15
- package/dist/erpnext.d.ts +0 -20
- package/dist/erpnext.js +0 -45
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { TemporalClient } from "../../client";
|
|
2
|
+
import { ERPNextDoctypeResourceRequest } from "../doctypeResourceRequest";
|
|
3
|
+
import { Contact, ContactPostBodyType } from "../model/Contact";
|
|
4
|
+
export declare class ERPNextContact {
|
|
5
|
+
protected temporalClient: TemporalClient;
|
|
6
|
+
protected baseRequest: ERPNextDoctypeResourceRequest<typeof Contact>;
|
|
7
|
+
getList: <K extends ("name" | "email_id" | "owner" | "creation" | "modified" | "modified_by" | "idx" | "docstatus" | "doctype" | "first_name" | "email_ids" | "sync_with_google_contacts" | "pulled_from_google_contacts" | "is_primary_contact" | "is_billing_contact" | "unsubscribed") | ("status" | "links" | "phone" | "last_name" | "middle_name" | "company" | "mobile_no" | "image" | "phone_nos"), B extends boolean>({ fields, filters, skip, limit, priority, asDict, params, }: {
|
|
8
|
+
fields?: K[];
|
|
9
|
+
filters?: string[][];
|
|
10
|
+
skip?: number;
|
|
11
|
+
limit?: number;
|
|
12
|
+
priority?: number;
|
|
13
|
+
asDict?: B;
|
|
14
|
+
params?: string;
|
|
15
|
+
}) => Promise<B extends false ? string[][] : Pick<{
|
|
16
|
+
name: string;
|
|
17
|
+
email_id: string;
|
|
18
|
+
owner: string;
|
|
19
|
+
creation: string;
|
|
20
|
+
modified: string;
|
|
21
|
+
modified_by: string;
|
|
22
|
+
idx: number;
|
|
23
|
+
docstatus: number;
|
|
24
|
+
doctype: string;
|
|
25
|
+
first_name: string;
|
|
26
|
+
email_ids: {
|
|
27
|
+
name: string;
|
|
28
|
+
email_id: string;
|
|
29
|
+
owner: string;
|
|
30
|
+
creation: string;
|
|
31
|
+
modified: string;
|
|
32
|
+
modified_by: string;
|
|
33
|
+
parent: string;
|
|
34
|
+
parentfield: string;
|
|
35
|
+
parenttype: string;
|
|
36
|
+
idx: number;
|
|
37
|
+
docstatus: number;
|
|
38
|
+
doctype: string;
|
|
39
|
+
is_primary: boolean;
|
|
40
|
+
}[];
|
|
41
|
+
sync_with_google_contacts: number;
|
|
42
|
+
pulled_from_google_contacts: boolean;
|
|
43
|
+
is_primary_contact: boolean;
|
|
44
|
+
is_billing_contact: boolean;
|
|
45
|
+
unsubscribed: boolean;
|
|
46
|
+
status?: string | null | undefined;
|
|
47
|
+
links?: {
|
|
48
|
+
name: string;
|
|
49
|
+
link_doctype: string;
|
|
50
|
+
link_name: string;
|
|
51
|
+
owner: string;
|
|
52
|
+
creation: string;
|
|
53
|
+
modified: string;
|
|
54
|
+
modified_by: string;
|
|
55
|
+
parent: string;
|
|
56
|
+
parentfield: string;
|
|
57
|
+
parenttype: string;
|
|
58
|
+
idx: number;
|
|
59
|
+
docstatus: number;
|
|
60
|
+
link_title: string;
|
|
61
|
+
doctype: string;
|
|
62
|
+
}[] | null | undefined;
|
|
63
|
+
phone?: string | null | undefined;
|
|
64
|
+
last_name?: string | null | undefined;
|
|
65
|
+
middle_name?: string | null | undefined;
|
|
66
|
+
company?: string | null | undefined;
|
|
67
|
+
mobile_no?: string | null | undefined;
|
|
68
|
+
image?: string | null | undefined;
|
|
69
|
+
phone_nos?: {
|
|
70
|
+
name: string;
|
|
71
|
+
owner: string;
|
|
72
|
+
creation: string;
|
|
73
|
+
modified: string;
|
|
74
|
+
modified_by: string;
|
|
75
|
+
parent: string;
|
|
76
|
+
parentfield: string;
|
|
77
|
+
parenttype: string;
|
|
78
|
+
idx: number;
|
|
79
|
+
docstatus: number;
|
|
80
|
+
doctype: string;
|
|
81
|
+
phone: string;
|
|
82
|
+
is_primary_phone: boolean;
|
|
83
|
+
is_primary_mobile_no: boolean;
|
|
84
|
+
}[] | null | undefined;
|
|
85
|
+
}, K extends ("name" | "email_id" | "owner" | "creation" | "modified" | "modified_by" | "idx" | "docstatus" | "doctype" | "first_name" | "email_ids" | "sync_with_google_contacts" | "pulled_from_google_contacts" | "is_primary_contact" | "is_billing_contact" | "unsubscribed") | ("status" | "links" | "phone" | "last_name" | "middle_name" | "company" | "mobile_no" | "image" | "phone_nos") ? K : never>[]>;
|
|
86
|
+
getById: <T extends import("zod").ZodTypeAny>({ resourceId, priority, }: {
|
|
87
|
+
resourceId: string;
|
|
88
|
+
priority?: number;
|
|
89
|
+
}) => Promise<import("zod").TypeOf<T>>;
|
|
90
|
+
updateById: <K extends import("zod").ZodTypeAny>({ resourceId, inputValidationModel, body, priority, }: {
|
|
91
|
+
resourceId: string;
|
|
92
|
+
inputValidationModel?: K;
|
|
93
|
+
priority?: number;
|
|
94
|
+
body: import("zod").TypeOf<K>;
|
|
95
|
+
}) => Promise<{
|
|
96
|
+
name: string;
|
|
97
|
+
email_id: string;
|
|
98
|
+
owner: string;
|
|
99
|
+
creation: string;
|
|
100
|
+
modified: string;
|
|
101
|
+
modified_by: string;
|
|
102
|
+
idx: number;
|
|
103
|
+
docstatus: number;
|
|
104
|
+
doctype: string;
|
|
105
|
+
first_name: string;
|
|
106
|
+
email_ids: {
|
|
107
|
+
name: string;
|
|
108
|
+
email_id: string;
|
|
109
|
+
owner: string;
|
|
110
|
+
creation: string;
|
|
111
|
+
modified: string;
|
|
112
|
+
modified_by: string;
|
|
113
|
+
parent: string;
|
|
114
|
+
parentfield: string;
|
|
115
|
+
parenttype: string;
|
|
116
|
+
idx: number;
|
|
117
|
+
docstatus: number;
|
|
118
|
+
doctype: string;
|
|
119
|
+
is_primary: boolean;
|
|
120
|
+
}[];
|
|
121
|
+
sync_with_google_contacts: number;
|
|
122
|
+
pulled_from_google_contacts: boolean;
|
|
123
|
+
is_primary_contact: boolean;
|
|
124
|
+
is_billing_contact: boolean;
|
|
125
|
+
unsubscribed: boolean;
|
|
126
|
+
status?: string | null | undefined;
|
|
127
|
+
links?: {
|
|
128
|
+
name: string;
|
|
129
|
+
link_doctype: string;
|
|
130
|
+
link_name: string;
|
|
131
|
+
owner: string;
|
|
132
|
+
creation: string;
|
|
133
|
+
modified: string;
|
|
134
|
+
modified_by: string;
|
|
135
|
+
parent: string;
|
|
136
|
+
parentfield: string;
|
|
137
|
+
parenttype: string;
|
|
138
|
+
idx: number;
|
|
139
|
+
docstatus: number;
|
|
140
|
+
link_title: string;
|
|
141
|
+
doctype: string;
|
|
142
|
+
}[] | null | undefined;
|
|
143
|
+
phone?: string | null | undefined;
|
|
144
|
+
last_name?: string | null | undefined;
|
|
145
|
+
middle_name?: string | null | undefined;
|
|
146
|
+
company?: string | null | undefined;
|
|
147
|
+
mobile_no?: string | null | undefined;
|
|
148
|
+
image?: string | null | undefined;
|
|
149
|
+
phone_nos?: {
|
|
150
|
+
name: string;
|
|
151
|
+
owner: string;
|
|
152
|
+
creation: string;
|
|
153
|
+
modified: string;
|
|
154
|
+
modified_by: string;
|
|
155
|
+
parent: string;
|
|
156
|
+
parentfield: string;
|
|
157
|
+
parenttype: string;
|
|
158
|
+
idx: number;
|
|
159
|
+
docstatus: number;
|
|
160
|
+
doctype: string;
|
|
161
|
+
phone: string;
|
|
162
|
+
is_primary_phone: boolean;
|
|
163
|
+
is_primary_mobile_no: boolean;
|
|
164
|
+
}[] | null | undefined;
|
|
165
|
+
}>;
|
|
166
|
+
deleteById: ({ resourceId, priority, }: {
|
|
167
|
+
resourceId: string;
|
|
168
|
+
priority?: number;
|
|
169
|
+
}) => Promise<{
|
|
170
|
+
name: string;
|
|
171
|
+
email_id: string;
|
|
172
|
+
owner: string;
|
|
173
|
+
creation: string;
|
|
174
|
+
modified: string;
|
|
175
|
+
modified_by: string;
|
|
176
|
+
idx: number;
|
|
177
|
+
docstatus: number;
|
|
178
|
+
doctype: string;
|
|
179
|
+
first_name: string;
|
|
180
|
+
email_ids: {
|
|
181
|
+
name: string;
|
|
182
|
+
email_id: string;
|
|
183
|
+
owner: string;
|
|
184
|
+
creation: string;
|
|
185
|
+
modified: string;
|
|
186
|
+
modified_by: string;
|
|
187
|
+
parent: string;
|
|
188
|
+
parentfield: string;
|
|
189
|
+
parenttype: string;
|
|
190
|
+
idx: number;
|
|
191
|
+
docstatus: number;
|
|
192
|
+
doctype: string;
|
|
193
|
+
is_primary: boolean;
|
|
194
|
+
}[];
|
|
195
|
+
sync_with_google_contacts: number;
|
|
196
|
+
pulled_from_google_contacts: boolean;
|
|
197
|
+
is_primary_contact: boolean;
|
|
198
|
+
is_billing_contact: boolean;
|
|
199
|
+
unsubscribed: boolean;
|
|
200
|
+
status?: string | null | undefined;
|
|
201
|
+
links?: {
|
|
202
|
+
name: string;
|
|
203
|
+
link_doctype: string;
|
|
204
|
+
link_name: string;
|
|
205
|
+
owner: string;
|
|
206
|
+
creation: string;
|
|
207
|
+
modified: string;
|
|
208
|
+
modified_by: string;
|
|
209
|
+
parent: string;
|
|
210
|
+
parentfield: string;
|
|
211
|
+
parenttype: string;
|
|
212
|
+
idx: number;
|
|
213
|
+
docstatus: number;
|
|
214
|
+
link_title: string;
|
|
215
|
+
doctype: string;
|
|
216
|
+
}[] | null | undefined;
|
|
217
|
+
phone?: string | null | undefined;
|
|
218
|
+
last_name?: string | null | undefined;
|
|
219
|
+
middle_name?: string | null | undefined;
|
|
220
|
+
company?: string | null | undefined;
|
|
221
|
+
mobile_no?: string | null | undefined;
|
|
222
|
+
image?: string | null | undefined;
|
|
223
|
+
phone_nos?: {
|
|
224
|
+
name: string;
|
|
225
|
+
owner: string;
|
|
226
|
+
creation: string;
|
|
227
|
+
modified: string;
|
|
228
|
+
modified_by: string;
|
|
229
|
+
parent: string;
|
|
230
|
+
parentfield: string;
|
|
231
|
+
parenttype: string;
|
|
232
|
+
idx: number;
|
|
233
|
+
docstatus: number;
|
|
234
|
+
doctype: string;
|
|
235
|
+
phone: string;
|
|
236
|
+
is_primary_phone: boolean;
|
|
237
|
+
is_primary_mobile_no: boolean;
|
|
238
|
+
}[] | null | undefined;
|
|
239
|
+
}>;
|
|
240
|
+
constructor(temporalClient: TemporalClient);
|
|
241
|
+
getContactsByAddressEmail: <K extends keyof (typeof Contact)["_type"]>(email: string, fields?: K[]) => Promise<string[][] | Pick<{
|
|
242
|
+
name: string;
|
|
243
|
+
email_id: string;
|
|
244
|
+
owner: string;
|
|
245
|
+
creation: string;
|
|
246
|
+
modified: string;
|
|
247
|
+
modified_by: string;
|
|
248
|
+
idx: number;
|
|
249
|
+
docstatus: number;
|
|
250
|
+
doctype: string;
|
|
251
|
+
first_name: string;
|
|
252
|
+
email_ids: {
|
|
253
|
+
name: string;
|
|
254
|
+
email_id: string;
|
|
255
|
+
owner: string;
|
|
256
|
+
creation: string;
|
|
257
|
+
modified: string;
|
|
258
|
+
modified_by: string;
|
|
259
|
+
parent: string;
|
|
260
|
+
parentfield: string;
|
|
261
|
+
parenttype: string;
|
|
262
|
+
idx: number;
|
|
263
|
+
docstatus: number;
|
|
264
|
+
doctype: string;
|
|
265
|
+
is_primary: boolean;
|
|
266
|
+
}[];
|
|
267
|
+
sync_with_google_contacts: number;
|
|
268
|
+
pulled_from_google_contacts: boolean;
|
|
269
|
+
is_primary_contact: boolean;
|
|
270
|
+
is_billing_contact: boolean;
|
|
271
|
+
unsubscribed: boolean;
|
|
272
|
+
status?: string | null | undefined;
|
|
273
|
+
links?: {
|
|
274
|
+
name: string;
|
|
275
|
+
link_doctype: string;
|
|
276
|
+
link_name: string;
|
|
277
|
+
owner: string;
|
|
278
|
+
creation: string;
|
|
279
|
+
modified: string;
|
|
280
|
+
modified_by: string;
|
|
281
|
+
parent: string;
|
|
282
|
+
parentfield: string;
|
|
283
|
+
parenttype: string;
|
|
284
|
+
idx: number;
|
|
285
|
+
docstatus: number;
|
|
286
|
+
link_title: string;
|
|
287
|
+
doctype: string;
|
|
288
|
+
}[] | null | undefined;
|
|
289
|
+
phone?: string | null | undefined;
|
|
290
|
+
last_name?: string | null | undefined;
|
|
291
|
+
middle_name?: string | null | undefined;
|
|
292
|
+
company?: string | null | undefined;
|
|
293
|
+
mobile_no?: string | null | undefined;
|
|
294
|
+
image?: string | null | undefined;
|
|
295
|
+
phone_nos?: {
|
|
296
|
+
name: string;
|
|
297
|
+
owner: string;
|
|
298
|
+
creation: string;
|
|
299
|
+
modified: string;
|
|
300
|
+
modified_by: string;
|
|
301
|
+
parent: string;
|
|
302
|
+
parentfield: string;
|
|
303
|
+
parenttype: string;
|
|
304
|
+
idx: number;
|
|
305
|
+
docstatus: number;
|
|
306
|
+
doctype: string;
|
|
307
|
+
phone: string;
|
|
308
|
+
is_primary_phone: boolean;
|
|
309
|
+
is_primary_mobile_no: boolean;
|
|
310
|
+
}[] | null | undefined;
|
|
311
|
+
}, K extends ("name" | "email_id" | "owner" | "creation" | "modified" | "modified_by" | "idx" | "docstatus" | "doctype" | "first_name" | "email_ids" | "sync_with_google_contacts" | "pulled_from_google_contacts" | "is_primary_contact" | "is_billing_contact" | "unsubscribed") | ("status" | "links" | "phone" | "last_name" | "middle_name" | "company" | "mobile_no" | "image" | "phone_nos") ? K : never>[]>;
|
|
312
|
+
create: (contact: Omit<ContactPostBodyType, "links">, customerName: string) => Promise<{
|
|
313
|
+
name: string;
|
|
314
|
+
email_id: string;
|
|
315
|
+
owner: string;
|
|
316
|
+
creation: string;
|
|
317
|
+
modified: string;
|
|
318
|
+
modified_by: string;
|
|
319
|
+
idx: number;
|
|
320
|
+
docstatus: number;
|
|
321
|
+
doctype: string;
|
|
322
|
+
first_name: string;
|
|
323
|
+
email_ids: {
|
|
324
|
+
name: string;
|
|
325
|
+
email_id: string;
|
|
326
|
+
owner: string;
|
|
327
|
+
creation: string;
|
|
328
|
+
modified: string;
|
|
329
|
+
modified_by: string;
|
|
330
|
+
parent: string;
|
|
331
|
+
parentfield: string;
|
|
332
|
+
parenttype: string;
|
|
333
|
+
idx: number;
|
|
334
|
+
docstatus: number;
|
|
335
|
+
doctype: string;
|
|
336
|
+
is_primary: boolean;
|
|
337
|
+
}[];
|
|
338
|
+
sync_with_google_contacts: number;
|
|
339
|
+
pulled_from_google_contacts: boolean;
|
|
340
|
+
is_primary_contact: boolean;
|
|
341
|
+
is_billing_contact: boolean;
|
|
342
|
+
unsubscribed: boolean;
|
|
343
|
+
status?: string | null | undefined;
|
|
344
|
+
links?: {
|
|
345
|
+
name: string;
|
|
346
|
+
link_doctype: string;
|
|
347
|
+
link_name: string;
|
|
348
|
+
owner: string;
|
|
349
|
+
creation: string;
|
|
350
|
+
modified: string;
|
|
351
|
+
modified_by: string;
|
|
352
|
+
parent: string;
|
|
353
|
+
parentfield: string;
|
|
354
|
+
parenttype: string;
|
|
355
|
+
idx: number;
|
|
356
|
+
docstatus: number;
|
|
357
|
+
link_title: string;
|
|
358
|
+
doctype: string;
|
|
359
|
+
}[] | null | undefined;
|
|
360
|
+
phone?: string | null | undefined;
|
|
361
|
+
last_name?: string | null | undefined;
|
|
362
|
+
middle_name?: string | null | undefined;
|
|
363
|
+
company?: string | null | undefined;
|
|
364
|
+
mobile_no?: string | null | undefined;
|
|
365
|
+
image?: string | null | undefined;
|
|
366
|
+
phone_nos?: {
|
|
367
|
+
name: string;
|
|
368
|
+
owner: string;
|
|
369
|
+
creation: string;
|
|
370
|
+
modified: string;
|
|
371
|
+
modified_by: string;
|
|
372
|
+
parent: string;
|
|
373
|
+
parentfield: string;
|
|
374
|
+
parenttype: string;
|
|
375
|
+
idx: number;
|
|
376
|
+
docstatus: number;
|
|
377
|
+
doctype: string;
|
|
378
|
+
phone: string;
|
|
379
|
+
is_primary_phone: boolean;
|
|
380
|
+
is_primary_mobile_no: boolean;
|
|
381
|
+
}[] | null | undefined;
|
|
382
|
+
}>;
|
|
383
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ERPNextContact = void 0;
|
|
13
|
+
const doctypeResourceRequest_1 = require("../doctypeResourceRequest");
|
|
14
|
+
const Contact_1 = require("../model/Contact");
|
|
15
|
+
class ERPNextContact {
|
|
16
|
+
constructor(temporalClient) {
|
|
17
|
+
this.getContactsByAddressEmail = (email_1, ...args_1) => __awaiter(this, [email_1, ...args_1], void 0, function* (email, fields = ["name"]) {
|
|
18
|
+
const filters = [];
|
|
19
|
+
filters.push(["Contact", "email_id", "=", email]);
|
|
20
|
+
const result = yield this.getList({
|
|
21
|
+
fields,
|
|
22
|
+
filters,
|
|
23
|
+
});
|
|
24
|
+
return result;
|
|
25
|
+
});
|
|
26
|
+
this.create = (contact, customerName) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const result = yield this.baseRequest.create({
|
|
28
|
+
inputValidationModel: Contact_1.ContactPostBody,
|
|
29
|
+
body: Object.assign(Object.assign({}, contact), { links: [
|
|
30
|
+
{
|
|
31
|
+
link_doctype: "Customer",
|
|
32
|
+
link_name: customerName,
|
|
33
|
+
},
|
|
34
|
+
] }),
|
|
35
|
+
});
|
|
36
|
+
return result;
|
|
37
|
+
});
|
|
38
|
+
this.temporalClient = temporalClient;
|
|
39
|
+
this.baseRequest = new doctypeResourceRequest_1.ERPNextDoctypeResourceRequest(temporalClient, "Contact", Contact_1.Contact);
|
|
40
|
+
this.getList = this.baseRequest.getList;
|
|
41
|
+
this.getById = this.baseRequest.getById;
|
|
42
|
+
this.updateById = this.baseRequest.updateById;
|
|
43
|
+
this.deleteById = this.baseRequest.deleteById;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.ERPNextContact = ERPNextContact;
|