erpnext-queue-client 2.5.0 → 2.5.2

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 (34) hide show
  1. package/dist/client.js +1 -1
  2. package/dist/erpnext/doctypeResourceRequest.d.ts +12 -1
  3. package/dist/erpnext/doctypeResourceRequest.js +3 -3
  4. package/dist/erpnext/doctypes/address.d.ts +3 -233
  5. package/dist/erpnext/doctypes/address.js +5 -16
  6. package/dist/erpnext/doctypes/consolidatedCustomsInvoice.d.ts +3 -486
  7. package/dist/erpnext/doctypes/consolidatedCustomsInvoice.js +4 -18
  8. package/dist/erpnext/doctypes/contact.d.ts +3 -358
  9. package/dist/erpnext/doctypes/contact.js +6 -17
  10. package/dist/erpnext/doctypes/deliveryNote.d.ts +1 -1575
  11. package/dist/erpnext/doctypes/deliveryNote.js +2 -19
  12. package/dist/erpnext/doctypes/item.d.ts +1 -1019
  13. package/dist/erpnext/doctypes/item.js +3 -16
  14. package/dist/erpnext/doctypes/paymentEntry.d.ts +1 -728
  15. package/dist/erpnext/doctypes/paymentEntry.js +4 -21
  16. package/dist/erpnext/doctypes/productBundle.d.ts +1 -143
  17. package/dist/erpnext/doctypes/productBundle.js +2 -13
  18. package/dist/erpnext/doctypes/purchaseInvoice.d.ts +1 -1395
  19. package/dist/erpnext/doctypes/purchaseInvoice.js +4 -19
  20. package/dist/erpnext/doctypes/purchaseReceipt.d.ts +1 -1204
  21. package/dist/erpnext/doctypes/purchaseReceipt.js +4 -19
  22. package/dist/erpnext/doctypes/salesInvoice.d.ts +1 -2517
  23. package/dist/erpnext/doctypes/salesInvoice.js +4 -21
  24. package/dist/erpnext/doctypes/servicecase.d.ts +24 -425
  25. package/dist/erpnext/doctypes/servicecase.js +14 -15
  26. package/dist/erpnext/doctypes/shipment.d.ts +3 -760
  27. package/dist/erpnext/doctypes/shipment.js +3 -20
  28. package/dist/erpnext/item.getList.alias-parsing.test.d.ts +1 -0
  29. package/dist/erpnext/item.getList.alias-parsing.test.js +66 -0
  30. package/dist/erpnext/model/Shipment.d.ts +4 -4
  31. package/dist/erpnext/model/Shipment.js +1 -1
  32. package/dist/index.test.js +3 -2
  33. package/dist/utils/zodUtils.js +14 -6
  34. package/package.json +1 -1
@@ -1,363 +1,7 @@
1
1
  import { TemporalClient } from "../../client";
2
2
  import { ERPNextDoctypeResourceRequest } from "../doctypeResourceRequest";
3
3
  import { Contact, ContactInputType } from "../model/Contact";
4
- export declare class ERPNextContact {
5
- protected temporalClient: TemporalClient;
6
- protected baseRequest: ERPNextDoctypeResourceRequest<typeof Contact>;
7
- getList: <TFieldOptions extends ("docstatus" | "name" | "owner" | "creation" | "modified" | "modified_by" | "idx" | "sync_with_google_contacts" | "pulled_from_google_contacts" | "is_primary_contact" | "is_billing_contact" | "unsubscribed") | ("status" | "address" | "_user_tags" | "phone" | "email_id" | "links" | "image" | "company" | "first_name" | "middle_name" | "last_name" | "mobile_no" | "email_ids" | "phone_nos"), TSelectedFields extends readonly ["*"] | readonly TFieldOptions[] | undefined = undefined, TAsDict extends boolean | undefined = undefined>({ fields, filters, skip, limit, priority, asDict, params, }?: {
8
- fields?: TSelectedFields;
9
- filters?: (string | string[])[][];
10
- skip?: number;
11
- limit?: number;
12
- priority?: number;
13
- asDict?: TAsDict;
14
- params?: Record<string, string>;
15
- }) => Promise<(TAsDict extends false ? string[][] : TSelectedFields extends undefined ? {
16
- name: string;
17
- }[] : TSelectedFields extends readonly ["*"] ? {
18
- docstatus: number;
19
- name: string;
20
- owner: string;
21
- creation: string;
22
- modified: string;
23
- modified_by: string;
24
- idx: number;
25
- sync_with_google_contacts: 0 | 1;
26
- pulled_from_google_contacts: 0 | 1;
27
- is_primary_contact: 0 | 1;
28
- is_billing_contact: 0 | 1;
29
- unsubscribed: 0 | 1;
30
- status?: string | null | undefined;
31
- address?: string | null | undefined;
32
- _user_tags?: string | null | undefined;
33
- phone?: string | null | undefined;
34
- email_id?: string | null | undefined;
35
- links?: {
36
- docstatus: number;
37
- name: string;
38
- owner: string;
39
- creation: string;
40
- modified: string;
41
- modified_by: string;
42
- idx: number;
43
- doctype: string;
44
- parent: string;
45
- parenttype: string;
46
- parentfield: string;
47
- link_doctype: string;
48
- link_name: string;
49
- link_title: string;
50
- _user_tags?: string | null | undefined;
51
- }[] | null | undefined;
52
- image?: string | null | undefined;
53
- company?: string | null | undefined;
54
- first_name?: string | null | undefined;
55
- middle_name?: string | null | undefined;
56
- last_name?: string | null | undefined;
57
- mobile_no?: string | null | undefined;
58
- email_ids?: {
59
- docstatus: number;
60
- name: string;
61
- owner: string;
62
- creation: string;
63
- modified: string;
64
- modified_by: string;
65
- idx: number;
66
- doctype: string;
67
- parent: string;
68
- parenttype: string;
69
- parentfield: string;
70
- email_id: string;
71
- is_primary: 0 | 1;
72
- _user_tags?: string | null | undefined;
73
- }[] | null | undefined;
74
- phone_nos?: {
75
- docstatus: number;
76
- name: string;
77
- owner: string;
78
- creation: string;
79
- modified: string;
80
- modified_by: string;
81
- idx: number;
82
- doctype: string;
83
- parent: string;
84
- parenttype: string;
85
- parentfield: string;
86
- phone: string;
87
- is_primary_phone: 0 | 1;
88
- is_primary_mobile_no: 0 | 1;
89
- _user_tags?: string | null | undefined;
90
- }[] | null | undefined;
91
- }[] : TSelectedFields extends readonly TFieldOptions[] ? { [K_1 in TSelectedFields[number] as K_1 extends `${infer _Before} as ${infer Alias}` ? Alias : K_1]: (K_1 extends `${infer _Before} as ${infer Alias}` ? Alias : K_1) extends ("docstatus" | "name" | "owner" | "creation" | "modified" | "modified_by" | "idx" | "sync_with_google_contacts" | "pulled_from_google_contacts" | "is_primary_contact" | "is_billing_contact" | "unsubscribed") | ("status" | "address" | "_user_tags" | "phone" | "email_id" | "links" | "image" | "company" | "first_name" | "middle_name" | "last_name" | "mobile_no" | "email_ids" | "phone_nos") ? {
92
- docstatus: number;
93
- name: string;
94
- owner: string;
95
- creation: string;
96
- modified: string;
97
- modified_by: string;
98
- idx: number;
99
- sync_with_google_contacts: 0 | 1;
100
- pulled_from_google_contacts: 0 | 1;
101
- is_primary_contact: 0 | 1;
102
- is_billing_contact: 0 | 1;
103
- unsubscribed: 0 | 1;
104
- status?: string | null | undefined;
105
- address?: string | null | undefined;
106
- _user_tags?: string | null | undefined;
107
- phone?: string | null | undefined;
108
- email_id?: string | null | undefined;
109
- links?: {
110
- docstatus: number;
111
- name: string;
112
- owner: string;
113
- creation: string;
114
- modified: string;
115
- modified_by: string;
116
- idx: number;
117
- doctype: string;
118
- parent: string;
119
- parenttype: string;
120
- parentfield: string;
121
- link_doctype: string;
122
- link_name: string;
123
- link_title: string;
124
- _user_tags?: string | null | undefined;
125
- }[] | null | undefined;
126
- image?: string | null | undefined;
127
- company?: string | null | undefined;
128
- first_name?: string | null | undefined;
129
- middle_name?: string | null | undefined;
130
- last_name?: string | null | undefined;
131
- mobile_no?: string | null | undefined;
132
- email_ids?: {
133
- docstatus: number;
134
- name: string;
135
- owner: string;
136
- creation: string;
137
- modified: string;
138
- modified_by: string;
139
- idx: number;
140
- doctype: string;
141
- parent: string;
142
- parenttype: string;
143
- parentfield: string;
144
- email_id: string;
145
- is_primary: 0 | 1;
146
- _user_tags?: string | null | undefined;
147
- }[] | null | undefined;
148
- phone_nos?: {
149
- docstatus: number;
150
- name: string;
151
- owner: string;
152
- creation: string;
153
- modified: string;
154
- modified_by: string;
155
- idx: number;
156
- doctype: string;
157
- parent: string;
158
- parenttype: string;
159
- parentfield: string;
160
- phone: string;
161
- is_primary_phone: 0 | 1;
162
- is_primary_mobile_no: 0 | 1;
163
- _user_tags?: string | null | undefined;
164
- }[] | null | undefined;
165
- }[(("docstatus" | "name" | "owner" | "creation" | "modified" | "modified_by" | "idx" | "sync_with_google_contacts" | "pulled_from_google_contacts" | "is_primary_contact" | "is_billing_contact" | "unsubscribed") | ("status" | "address" | "_user_tags" | "phone" | "email_id" | "links" | "image" | "company" | "first_name" | "middle_name" | "last_name" | "mobile_no" | "email_ids" | "phone_nos")) & (K_1 extends `${infer _Before} as ${infer Alias}` ? Alias : K_1)] : never; }[] : any) extends infer T ? { [K in keyof T]: T[K]; } : never>;
166
- getById: ({ resourceId, priority, }: {
167
- resourceId: string;
168
- priority?: number;
169
- }) => Promise<{
170
- docstatus: number;
171
- name: string;
172
- owner: string;
173
- creation: string;
174
- modified: string;
175
- modified_by: string;
176
- idx: number;
177
- doctype: string;
178
- sync_with_google_contacts: 0 | 1;
179
- pulled_from_google_contacts: 0 | 1;
180
- is_primary_contact: 0 | 1;
181
- is_billing_contact: 0 | 1;
182
- unsubscribed: 0 | 1;
183
- status?: string | null | undefined;
184
- address?: string | null | undefined;
185
- _user_tags?: string | null | undefined;
186
- phone?: string | null | undefined;
187
- email_id?: string | null | undefined;
188
- links?: {
189
- docstatus: number;
190
- name: string;
191
- owner: string;
192
- creation: string;
193
- modified: string;
194
- modified_by: string;
195
- idx: number;
196
- doctype: string;
197
- parent: string;
198
- parenttype: string;
199
- parentfield: string;
200
- link_doctype: string;
201
- link_name: string;
202
- link_title: string;
203
- _user_tags?: string | null | undefined;
204
- }[] | null | undefined;
205
- image?: string | null | undefined;
206
- company?: string | null | undefined;
207
- first_name?: string | null | undefined;
208
- middle_name?: string | null | undefined;
209
- last_name?: string | null | undefined;
210
- mobile_no?: string | null | undefined;
211
- email_ids?: {
212
- docstatus: number;
213
- name: string;
214
- owner: string;
215
- creation: string;
216
- modified: string;
217
- modified_by: string;
218
- idx: number;
219
- doctype: string;
220
- parent: string;
221
- parenttype: string;
222
- parentfield: string;
223
- email_id: string;
224
- is_primary: 0 | 1;
225
- _user_tags?: string | null | undefined;
226
- }[] | null | undefined;
227
- phone_nos?: {
228
- docstatus: number;
229
- name: string;
230
- owner: string;
231
- creation: string;
232
- modified: string;
233
- modified_by: string;
234
- idx: number;
235
- doctype: string;
236
- parent: string;
237
- parenttype: string;
238
- parentfield: string;
239
- phone: string;
240
- is_primary_phone: 0 | 1;
241
- is_primary_mobile_no: 0 | 1;
242
- _user_tags?: string | null | undefined;
243
- }[] | null | undefined;
244
- } | undefined>;
245
- updateById: <TInput extends TInputModel extends undefined ? Partial<{
246
- status?: string | null | undefined;
247
- address?: string | null | undefined;
248
- docstatus?: number | undefined;
249
- phone?: string | null | undefined;
250
- email_id?: string | null | undefined;
251
- links?: {
252
- link_doctype: string;
253
- link_name: string;
254
- link_title: string;
255
- }[] | null | undefined;
256
- image?: string | null | undefined;
257
- company?: string | null | undefined;
258
- first_name?: string | null | undefined;
259
- middle_name?: string | null | undefined;
260
- last_name?: string | null | undefined;
261
- sync_with_google_contacts?: 0 | 1 | undefined;
262
- mobile_no?: string | null | undefined;
263
- pulled_from_google_contacts?: 0 | 1 | undefined;
264
- is_primary_contact?: 0 | 1 | undefined;
265
- is_billing_contact?: 0 | 1 | undefined;
266
- unsubscribed?: 0 | 1 | undefined;
267
- email_ids?: {
268
- email_id: string;
269
- is_primary: 0 | 1;
270
- }[] | null | undefined;
271
- phone_nos?: {
272
- phone: string;
273
- is_primary_phone: 0 | 1;
274
- is_primary_mobile_no: 0 | 1;
275
- }[] | null | undefined;
276
- }> : TInputModel extends import("zod").ZodTypeAny ? import("zod").TypeOf<TInputModel> : any, TInputModel extends import("zod").ZodTypeAny | undefined = undefined>({ resourceId, inputValidationModel, body, priority, }: {
277
- resourceId: string;
278
- inputValidationModel?: TInputModel;
279
- priority?: number;
280
- body: TInput;
281
- }) => Promise<{
282
- docstatus: number;
283
- name: string;
284
- owner: string;
285
- creation: string;
286
- modified: string;
287
- modified_by: string;
288
- idx: number;
289
- doctype: string;
290
- sync_with_google_contacts: 0 | 1;
291
- pulled_from_google_contacts: 0 | 1;
292
- is_primary_contact: 0 | 1;
293
- is_billing_contact: 0 | 1;
294
- unsubscribed: 0 | 1;
295
- status?: string | null | undefined;
296
- address?: string | null | undefined;
297
- _user_tags?: string | null | undefined;
298
- phone?: string | null | undefined;
299
- email_id?: string | null | undefined;
300
- links?: {
301
- docstatus: number;
302
- name: string;
303
- owner: string;
304
- creation: string;
305
- modified: string;
306
- modified_by: string;
307
- idx: number;
308
- doctype: string;
309
- parent: string;
310
- parenttype: string;
311
- parentfield: string;
312
- link_doctype: string;
313
- link_name: string;
314
- link_title: string;
315
- _user_tags?: string | null | undefined;
316
- }[] | null | undefined;
317
- image?: string | null | undefined;
318
- company?: string | null | undefined;
319
- first_name?: string | null | undefined;
320
- middle_name?: string | null | undefined;
321
- last_name?: string | null | undefined;
322
- mobile_no?: string | null | undefined;
323
- email_ids?: {
324
- docstatus: number;
325
- name: string;
326
- owner: string;
327
- creation: string;
328
- modified: string;
329
- modified_by: string;
330
- idx: number;
331
- doctype: string;
332
- parent: string;
333
- parenttype: string;
334
- parentfield: string;
335
- email_id: string;
336
- is_primary: 0 | 1;
337
- _user_tags?: string | null | undefined;
338
- }[] | null | undefined;
339
- phone_nos?: {
340
- docstatus: number;
341
- name: string;
342
- owner: string;
343
- creation: string;
344
- modified: string;
345
- modified_by: string;
346
- idx: number;
347
- doctype: string;
348
- parent: string;
349
- parenttype: string;
350
- parentfield: string;
351
- phone: string;
352
- is_primary_phone: 0 | 1;
353
- is_primary_mobile_no: 0 | 1;
354
- _user_tags?: string | null | undefined;
355
- }[] | null | undefined;
356
- }>;
357
- deleteById: ({ resourceId, priority, }: {
358
- resourceId: string;
359
- priority?: number;
360
- }) => Promise<import("zod").TypeOf<typeof import("../model/ERPNextResponse").DeleteResponseModel>>;
4
+ export declare class ERPNextContact extends ERPNextDoctypeResourceRequest<typeof Contact> {
361
5
  constructor(temporalClient: TemporalClient);
362
6
  getContactsByAddressEmail: <K extends keyof (typeof Contact)["_type"]>(email: string, fields?: K[]) => Promise<(K[] extends infer T_1 ? T_1 extends K[] ? T_1 extends readonly (("docstatus" | "name" | "owner" | "creation" | "modified" | "modified_by" | "idx" | "sync_with_google_contacts" | "pulled_from_google_contacts" | "is_primary_contact" | "is_billing_contact" | "unsubscribed") | ("status" | "address" | "_user_tags" | "phone" | "email_id" | "links" | "image" | "company" | "first_name" | "middle_name" | "last_name" | "mobile_no" | "email_ids" | "phone_nos"))[] ? { [K_2 in T_1[number] as K_2 extends `${infer _Before} as ${infer Alias}` ? Alias : K_2]: (K_2 extends `${infer _Before} as ${infer Alias}` ? Alias : K_2) extends ("docstatus" | "name" | "owner" | "creation" | "modified" | "modified_by" | "idx" | "sync_with_google_contacts" | "pulled_from_google_contacts" | "is_primary_contact" | "is_billing_contact" | "unsubscribed") | ("status" | "address" | "_user_tags" | "phone" | "email_id" | "links" | "image" | "company" | "first_name" | "middle_name" | "last_name" | "mobile_no" | "email_ids" | "phone_nos") ? {
363
7
  docstatus: number;
@@ -434,7 +78,8 @@ export declare class ERPNextContact {
434
78
  _user_tags?: string | null | undefined;
435
79
  }[] | null | undefined;
436
80
  }[(("docstatus" | "name" | "owner" | "creation" | "modified" | "modified_by" | "idx" | "sync_with_google_contacts" | "pulled_from_google_contacts" | "is_primary_contact" | "is_billing_contact" | "unsubscribed") | ("status" | "address" | "_user_tags" | "phone" | "email_id" | "links" | "image" | "company" | "first_name" | "middle_name" | "last_name" | "mobile_no" | "email_ids" | "phone_nos")) & (K_2 extends `${infer _Before} as ${infer Alias}` ? Alias : K_2)] : never; }[] : any : never : never) extends infer T ? { [K_1 in keyof T]: T[K_1]; } : never>;
437
- create: (contact: Omit<ContactInputType, "links">, customerName: string) => Promise<{
81
+ /** Create a contact linked to a customer. */
82
+ createForCustomer(contact: Omit<ContactInputType, "links">, customerName: string): Promise<{
438
83
  docstatus: number;
439
84
  name: string;
440
85
  owner: string;
@@ -3,20 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ERPNextContact = void 0;
4
4
  const doctypeResourceRequest_1 = require("../doctypeResourceRequest");
5
5
  const Contact_1 = require("../model/Contact");
6
- class ERPNextContact {
7
- temporalClient;
8
- baseRequest;
9
- getList;
10
- getById;
11
- updateById;
12
- deleteById;
6
+ class ERPNextContact extends doctypeResourceRequest_1.ERPNextDoctypeResourceRequest {
13
7
  constructor(temporalClient) {
14
- this.temporalClient = temporalClient;
15
- this.baseRequest = new doctypeResourceRequest_1.ERPNextDoctypeResourceRequest(temporalClient, "Contact", Contact_1.Contact);
16
- this.getList = this.baseRequest.getList;
17
- this.getById = this.baseRequest.getById;
18
- this.updateById = this.baseRequest.updateById;
19
- this.deleteById = this.baseRequest.deleteById;
8
+ super(temporalClient, "Contact", Contact_1.Contact);
20
9
  }
21
10
  getContactsByAddressEmail = async (email, fields = ["name"]) => {
22
11
  const filters = [];
@@ -27,8 +16,9 @@ class ERPNextContact {
27
16
  });
28
17
  return result;
29
18
  };
30
- create = async (contact, customerName) => {
31
- const result = await this.baseRequest.create({
19
+ /** Create a contact linked to a customer. */
20
+ async createForCustomer(contact, customerName) {
21
+ return this.create({
32
22
  body: {
33
23
  ...contact,
34
24
  links: [
@@ -40,7 +30,6 @@ class ERPNextContact {
40
30
  ],
41
31
  },
42
32
  });
43
- return result;
44
- };
33
+ }
45
34
  }
46
35
  exports.ERPNextContact = ERPNextContact;