erpnext-queue-client 1.0.6 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/client.js +41 -16
  2. package/dist/erpnext/decryptFromErpNext.server.d.ts +1 -1
  3. package/dist/erpnext/doctypeResourceRequest.d.ts +40 -0
  4. package/dist/erpnext/doctypeResourceRequest.js +59 -0
  5. package/dist/erpnext/doctypeSubmittableResourceRequest.d.ts +8 -0
  6. package/dist/erpnext/doctypeSubmittableResourceRequest.js +39 -0
  7. package/dist/erpnext/doctypes/address.d.ts +309 -0
  8. package/dist/erpnext/doctypes/address.js +46 -0
  9. package/dist/erpnext/doctypes/contact.d.ts +453 -0
  10. package/dist/erpnext/doctypes/contact.js +46 -0
  11. package/dist/erpnext/doctypes/deliveryNote.d.ts +1363 -0
  12. package/dist/erpnext/doctypes/deliveryNote.js +38 -0
  13. package/dist/erpnext/doctypes/item.d.ts +836 -0
  14. package/dist/erpnext/doctypes/item.js +95 -0
  15. package/dist/erpnext/doctypes/purchaseReceipt.d.ts +1566 -0
  16. package/dist/erpnext/doctypes/purchaseReceipt.js +51 -0
  17. package/dist/erpnext/doctypes/shipment.d.ts +942 -0
  18. package/dist/erpnext/doctypes/shipment.js +51 -0
  19. package/dist/erpnext/erpnextRequestWrapper.js +15 -13
  20. package/dist/erpnext/fileRequests.d.ts +10 -0
  21. package/dist/erpnext/fileRequests.js +42 -0
  22. package/dist/erpnext/methodRequest.d.ts +15 -0
  23. package/dist/erpnext/methodRequest.js +32 -0
  24. package/dist/erpnext/model/Address.d.ts +200 -198
  25. package/dist/erpnext/model/Address.js +3 -2
  26. package/dist/erpnext/model/Contact.d.ts +343 -344
  27. package/dist/erpnext/model/Contact.js +2 -2
  28. package/dist/erpnext/model/Country.d.ts +83 -31
  29. package/dist/erpnext/model/Country.js +2 -6
  30. package/dist/erpnext/model/Customer.d.ts +64 -65
  31. package/dist/erpnext/model/Customer.js +2 -2
  32. package/dist/erpnext/model/DeliveryNote.d.ts +1048 -1048
  33. package/dist/erpnext/model/DispatchRun.d.ts +399 -399
  34. package/dist/erpnext/model/DispatcherPreset.d.ts +94 -94
  35. package/dist/erpnext/model/ERPNextRequest.d.ts +47 -30
  36. package/dist/erpnext/model/ERPNextResponse.d.ts +11 -4
  37. package/dist/erpnext/model/ERPNextResponse.js +6 -1
  38. package/dist/erpnext/model/File.d.ts +88 -88
  39. package/dist/erpnext/model/Fulfiller.d.ts +97 -97
  40. package/dist/erpnext/model/FulfillerSettings.d.ts +66 -66
  41. package/dist/erpnext/model/FulfillmentStation.d.ts +2 -2
  42. package/dist/erpnext/model/Item.d.ts +819 -819
  43. package/dist/erpnext/model/Item.js +2 -2
  44. package/dist/erpnext/model/PaymentEntry.d.ts +197 -0
  45. package/dist/erpnext/model/PaymentEntry.js +63 -0
  46. package/dist/erpnext/model/ProjectedQuantityReport.d.ts +178 -178
  47. package/dist/erpnext/model/PurchaseOrder.d.ts +528 -528
  48. package/dist/erpnext/model/Receipt.d.ts +448 -448
  49. package/dist/erpnext/model/Receipt.js +2 -2
  50. package/dist/erpnext/model/ReceiptDraft.d.ts +392 -392
  51. package/dist/erpnext/model/Shipment.d.ts +709 -709
  52. package/dist/erpnext/model/ShippingProvider.d.ts +198 -198
  53. package/dist/erpnext/model/StockEntry.d.ts +248 -0
  54. package/dist/erpnext/model/StockEntry.js +76 -0
  55. package/dist/erpnext/model/StockReconciliation.d.ts +187 -0
  56. package/dist/erpnext/model/StockReconciliation.js +44 -0
  57. package/dist/erpnext/model/Supplier.d.ts +105 -0
  58. package/dist/erpnext/model/Supplier.js +39 -0
  59. package/dist/erpnext/model/Waitlist.d.ts +32 -0
  60. package/dist/erpnext/model/Waitlist.js +19 -0
  61. package/dist/erpnext/model/WarehouseCategory.d.ts +6 -6
  62. package/dist/erpnext/resourceRequest.d.ts +41 -10
  63. package/dist/erpnext/resourceRequest.js +113 -14
  64. package/dist/index.d.ts +39 -4
  65. package/dist/index.js +43 -8
  66. package/dist/utils/fernet.server.d.ts +11 -11
  67. package/dist/utils/fernet.server.js +0 -1
  68. package/dist/utils/request.js +2 -2
  69. package/dist/utils/zodUtils.d.ts +3 -1
  70. package/dist/utils/zodUtils.js +14 -1
  71. package/package.json +4 -1
  72. package/dist/erpnext/doctypes/country.d.ts +0 -9
  73. package/dist/erpnext/doctypes/country.js +0 -28
  74. package/dist/erpnext/erpnextRequests.d.ts +0 -1
  75. package/dist/erpnext/erpnextRequests.js +0 -15
  76. package/dist/erpnext.d.ts +0 -20
  77. package/dist/erpnext.js +0 -45
@@ -0,0 +1,453 @@
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: <TField 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"), TAsDict extends boolean | undefined = undefined>({ fields, filters, skip, limit, priority, asDict, params, }: {
8
+ fields?: TField[] | undefined;
9
+ filters?: string[][];
10
+ skip?: number;
11
+ limit?: number;
12
+ priority?: number;
13
+ asDict?: TAsDict;
14
+ params?: string;
15
+ }) => Promise<TAsDict 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
+ }, TField>[]>;
86
+ getById: ({ resourceId, priority, }: {
87
+ resourceId: string;
88
+ priority?: number;
89
+ }) => Promise<{
90
+ name: string;
91
+ email_id: string;
92
+ owner: string;
93
+ creation: string;
94
+ modified: string;
95
+ modified_by: string;
96
+ idx: number;
97
+ docstatus: number;
98
+ doctype: string;
99
+ first_name: string;
100
+ email_ids: {
101
+ name: string;
102
+ email_id: string;
103
+ owner: string;
104
+ creation: string;
105
+ modified: string;
106
+ modified_by: string;
107
+ parent: string;
108
+ parentfield: string;
109
+ parenttype: string;
110
+ idx: number;
111
+ docstatus: number;
112
+ doctype: string;
113
+ is_primary: boolean;
114
+ }[];
115
+ sync_with_google_contacts: number;
116
+ pulled_from_google_contacts: boolean;
117
+ is_primary_contact: boolean;
118
+ is_billing_contact: boolean;
119
+ unsubscribed: boolean;
120
+ status?: string | null | undefined;
121
+ links?: {
122
+ name: string;
123
+ link_doctype: string;
124
+ link_name: string;
125
+ owner: string;
126
+ creation: string;
127
+ modified: string;
128
+ modified_by: string;
129
+ parent: string;
130
+ parentfield: string;
131
+ parenttype: string;
132
+ idx: number;
133
+ docstatus: number;
134
+ link_title: string;
135
+ doctype: string;
136
+ }[] | null | undefined;
137
+ phone?: string | null | undefined;
138
+ last_name?: string | null | undefined;
139
+ middle_name?: string | null | undefined;
140
+ company?: string | null | undefined;
141
+ mobile_no?: string | null | undefined;
142
+ image?: string | null | undefined;
143
+ phone_nos?: {
144
+ name: string;
145
+ owner: string;
146
+ creation: string;
147
+ modified: string;
148
+ modified_by: string;
149
+ parent: string;
150
+ parentfield: string;
151
+ parenttype: string;
152
+ idx: number;
153
+ docstatus: number;
154
+ doctype: string;
155
+ phone: string;
156
+ is_primary_phone: boolean;
157
+ is_primary_mobile_no: boolean;
158
+ }[] | null | undefined;
159
+ }>;
160
+ updateById: <TInput extends TInputModel extends undefined ? Partial<{
161
+ name: string;
162
+ email_id: string;
163
+ owner: string;
164
+ creation: string;
165
+ modified: string;
166
+ modified_by: string;
167
+ idx: number;
168
+ docstatus: number;
169
+ doctype: string;
170
+ first_name: string;
171
+ email_ids: {
172
+ name: string;
173
+ email_id: string;
174
+ owner: string;
175
+ creation: string;
176
+ modified: string;
177
+ modified_by: string;
178
+ parent: string;
179
+ parentfield: string;
180
+ parenttype: string;
181
+ idx: number;
182
+ docstatus: number;
183
+ doctype: string;
184
+ is_primary: boolean;
185
+ }[];
186
+ sync_with_google_contacts: number;
187
+ pulled_from_google_contacts: boolean;
188
+ is_primary_contact: boolean;
189
+ is_billing_contact: boolean;
190
+ unsubscribed: boolean;
191
+ status?: string | null | undefined;
192
+ links?: {
193
+ name: string;
194
+ link_doctype: string;
195
+ link_name: string;
196
+ owner: string;
197
+ creation: string;
198
+ modified: string;
199
+ modified_by: string;
200
+ parent: string;
201
+ parentfield: string;
202
+ parenttype: string;
203
+ idx: number;
204
+ docstatus: number;
205
+ link_title: string;
206
+ doctype: string;
207
+ }[] | null | undefined;
208
+ phone?: string | null | undefined;
209
+ last_name?: string | null | undefined;
210
+ middle_name?: string | null | undefined;
211
+ company?: string | null | undefined;
212
+ mobile_no?: string | null | undefined;
213
+ image?: string | null | undefined;
214
+ phone_nos?: {
215
+ name: string;
216
+ owner: string;
217
+ creation: string;
218
+ modified: string;
219
+ modified_by: string;
220
+ parent: string;
221
+ parentfield: string;
222
+ parenttype: string;
223
+ idx: number;
224
+ docstatus: number;
225
+ doctype: string;
226
+ phone: string;
227
+ is_primary_phone: boolean;
228
+ is_primary_mobile_no: boolean;
229
+ }[] | null | undefined;
230
+ }> : TInputModel extends import("zod").ZodTypeAny ? import("zod").TypeOf<TInputModel> : any, TInputModel extends import("zod").ZodTypeAny | undefined = undefined>({ resourceId, inputValidationModel, body, priority, }: {
231
+ resourceId: string;
232
+ inputValidationModel?: TInputModel;
233
+ priority?: number;
234
+ body: TInput;
235
+ }) => Promise<{
236
+ name: string;
237
+ email_id: string;
238
+ owner: string;
239
+ creation: string;
240
+ modified: string;
241
+ modified_by: string;
242
+ idx: number;
243
+ docstatus: number;
244
+ doctype: string;
245
+ first_name: string;
246
+ email_ids: {
247
+ name: string;
248
+ email_id: string;
249
+ owner: string;
250
+ creation: string;
251
+ modified: string;
252
+ modified_by: string;
253
+ parent: string;
254
+ parentfield: string;
255
+ parenttype: string;
256
+ idx: number;
257
+ docstatus: number;
258
+ doctype: string;
259
+ is_primary: boolean;
260
+ }[];
261
+ sync_with_google_contacts: number;
262
+ pulled_from_google_contacts: boolean;
263
+ is_primary_contact: boolean;
264
+ is_billing_contact: boolean;
265
+ unsubscribed: boolean;
266
+ status?: string | null | undefined;
267
+ links?: {
268
+ name: string;
269
+ link_doctype: string;
270
+ link_name: string;
271
+ owner: string;
272
+ creation: string;
273
+ modified: string;
274
+ modified_by: string;
275
+ parent: string;
276
+ parentfield: string;
277
+ parenttype: string;
278
+ idx: number;
279
+ docstatus: number;
280
+ link_title: string;
281
+ doctype: string;
282
+ }[] | null | undefined;
283
+ phone?: string | null | undefined;
284
+ last_name?: string | null | undefined;
285
+ middle_name?: string | null | undefined;
286
+ company?: string | null | undefined;
287
+ mobile_no?: string | null | undefined;
288
+ image?: string | null | undefined;
289
+ phone_nos?: {
290
+ name: string;
291
+ owner: string;
292
+ creation: string;
293
+ modified: string;
294
+ modified_by: string;
295
+ parent: string;
296
+ parentfield: string;
297
+ parenttype: string;
298
+ idx: number;
299
+ docstatus: number;
300
+ doctype: string;
301
+ phone: string;
302
+ is_primary_phone: boolean;
303
+ is_primary_mobile_no: boolean;
304
+ }[] | null | undefined;
305
+ }>;
306
+ deleteById: ({ resourceId, priority, }: {
307
+ resourceId: string;
308
+ priority?: number;
309
+ }) => Promise<import("zod").TypeOf<typeof import("../model/ERPNextResponse").DeleteResponseModel>>;
310
+ constructor(temporalClient: TemporalClient);
311
+ getContactsByAddressEmail: <K extends keyof (typeof Contact)["_type"]>(email: string, fields?: K[]) => Promise<Pick<{
312
+ name: string;
313
+ email_id: string;
314
+ owner: string;
315
+ creation: string;
316
+ modified: string;
317
+ modified_by: string;
318
+ idx: number;
319
+ docstatus: number;
320
+ doctype: string;
321
+ first_name: string;
322
+ email_ids: {
323
+ name: string;
324
+ email_id: string;
325
+ owner: string;
326
+ creation: string;
327
+ modified: string;
328
+ modified_by: string;
329
+ parent: string;
330
+ parentfield: string;
331
+ parenttype: string;
332
+ idx: number;
333
+ docstatus: number;
334
+ doctype: string;
335
+ is_primary: boolean;
336
+ }[];
337
+ sync_with_google_contacts: number;
338
+ pulled_from_google_contacts: boolean;
339
+ is_primary_contact: boolean;
340
+ is_billing_contact: boolean;
341
+ unsubscribed: boolean;
342
+ status?: string | null | undefined;
343
+ links?: {
344
+ name: string;
345
+ link_doctype: string;
346
+ link_name: string;
347
+ owner: string;
348
+ creation: string;
349
+ modified: string;
350
+ modified_by: string;
351
+ parent: string;
352
+ parentfield: string;
353
+ parenttype: string;
354
+ idx: number;
355
+ docstatus: number;
356
+ link_title: string;
357
+ doctype: string;
358
+ }[] | null | undefined;
359
+ phone?: string | null | undefined;
360
+ last_name?: string | null | undefined;
361
+ middle_name?: string | null | undefined;
362
+ company?: string | null | undefined;
363
+ mobile_no?: string | null | undefined;
364
+ image?: string | null | undefined;
365
+ phone_nos?: {
366
+ name: string;
367
+ owner: string;
368
+ creation: string;
369
+ modified: string;
370
+ modified_by: string;
371
+ parent: string;
372
+ parentfield: string;
373
+ parenttype: string;
374
+ idx: number;
375
+ docstatus: number;
376
+ doctype: string;
377
+ phone: string;
378
+ is_primary_phone: boolean;
379
+ is_primary_mobile_no: boolean;
380
+ }[] | null | undefined;
381
+ }, K>[]>;
382
+ create: (contact: Omit<ContactPostBodyType, "links">, customerName: string) => Promise<{
383
+ name: string;
384
+ email_id: string;
385
+ owner: string;
386
+ creation: string;
387
+ modified: string;
388
+ modified_by: string;
389
+ idx: number;
390
+ docstatus: number;
391
+ doctype: string;
392
+ first_name: string;
393
+ email_ids: {
394
+ name: string;
395
+ email_id: string;
396
+ owner: string;
397
+ creation: string;
398
+ modified: string;
399
+ modified_by: string;
400
+ parent: string;
401
+ parentfield: string;
402
+ parenttype: string;
403
+ idx: number;
404
+ docstatus: number;
405
+ doctype: string;
406
+ is_primary: boolean;
407
+ }[];
408
+ sync_with_google_contacts: number;
409
+ pulled_from_google_contacts: boolean;
410
+ is_primary_contact: boolean;
411
+ is_billing_contact: boolean;
412
+ unsubscribed: boolean;
413
+ status?: string | null | undefined;
414
+ links?: {
415
+ name: string;
416
+ link_doctype: string;
417
+ link_name: string;
418
+ owner: string;
419
+ creation: string;
420
+ modified: string;
421
+ modified_by: string;
422
+ parent: string;
423
+ parentfield: string;
424
+ parenttype: string;
425
+ idx: number;
426
+ docstatus: number;
427
+ link_title: string;
428
+ doctype: string;
429
+ }[] | null | undefined;
430
+ phone?: string | null | undefined;
431
+ last_name?: string | null | undefined;
432
+ middle_name?: string | null | undefined;
433
+ company?: string | null | undefined;
434
+ mobile_no?: string | null | undefined;
435
+ image?: string | null | undefined;
436
+ phone_nos?: {
437
+ name: string;
438
+ owner: string;
439
+ creation: string;
440
+ modified: string;
441
+ modified_by: string;
442
+ parent: string;
443
+ parentfield: string;
444
+ parenttype: string;
445
+ idx: number;
446
+ docstatus: number;
447
+ doctype: string;
448
+ phone: string;
449
+ is_primary_phone: boolean;
450
+ is_primary_mobile_no: boolean;
451
+ }[] | null | undefined;
452
+ }>;
453
+ }
@@ -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;