erpnext-queue-client 1.39.2 → 2.0.0-beta.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 (138) hide show
  1. package/dist/client.js +3 -6
  2. package/dist/constants.d.ts +1 -1
  3. package/dist/constants.js +16 -2
  4. package/dist/erpnext/doctypeResourceRequest.d.ts +12 -11
  5. package/dist/erpnext/doctypeResourceRequest.js +3 -2
  6. package/dist/erpnext/doctypeSubmittableResourceRequest.d.ts +161 -4
  7. package/dist/erpnext/doctypeSubmittableResourceRequest.js +16 -1
  8. package/dist/erpnext/doctypes/address.d.ts +160 -225
  9. package/dist/erpnext/doctypes/address.js +0 -2
  10. package/dist/erpnext/doctypes/contact.d.ts +157 -314
  11. package/dist/erpnext/doctypes/contact.js +1 -1
  12. package/dist/erpnext/doctypes/deliveryNote.d.ts +705 -505
  13. package/dist/erpnext/doctypes/deliveryNote.js +4 -10
  14. package/dist/erpnext/doctypes/item.d.ts +231 -324
  15. package/dist/erpnext/doctypes/paymentEntry.d.ts +820 -0
  16. package/dist/erpnext/doctypes/paymentEntry.js +72 -0
  17. package/dist/erpnext/doctypes/productBundle.d.ts +48 -58
  18. package/dist/erpnext/doctypes/purchaseInvoice.d.ts +717 -745
  19. package/dist/erpnext/doctypes/purchaseReceipt.d.ts +282 -332
  20. package/dist/erpnext/doctypes/salesInvoice.d.ts +3334 -0
  21. package/dist/erpnext/doctypes/salesInvoice.js +72 -0
  22. package/dist/erpnext/doctypes/servicecase.d.ts +191 -134
  23. package/dist/erpnext/doctypes/servicecase.js +4 -6
  24. package/dist/erpnext/doctypes/shipment.d.ts +193 -251
  25. package/dist/erpnext/doctypes/tags.d.ts +10 -0
  26. package/dist/erpnext/doctypes/tags.js +102 -0
  27. package/dist/erpnext/model/Account.d.ts +0 -33
  28. package/dist/erpnext/model/Account.js +0 -11
  29. package/dist/erpnext/model/Address.d.ts +112 -233
  30. package/dist/erpnext/model/Address.js +11 -49
  31. package/dist/erpnext/model/Attachment.d.ts +0 -3
  32. package/dist/erpnext/model/Attachment.js +0 -1
  33. package/dist/erpnext/model/Boolean.d.ts +4 -0
  34. package/dist/erpnext/model/Boolean.js +9 -0
  35. package/dist/erpnext/model/Compliance.d.ts +0 -112
  36. package/dist/erpnext/model/Compliance.js +0 -19
  37. package/dist/erpnext/model/ConsolidatedCustomsInvoice.d.ts +26 -138
  38. package/dist/erpnext/model/ConsolidatedCustomsInvoice.js +0 -19
  39. package/dist/erpnext/model/Contact.d.ts +166 -416
  40. package/dist/erpnext/model/Contact.js +16 -69
  41. package/dist/erpnext/model/Country.d.ts +0 -64
  42. package/dist/erpnext/model/Country.js +0 -10
  43. package/dist/erpnext/model/Customer.d.ts +39 -64
  44. package/dist/erpnext/model/Customer.js +11 -25
  45. package/dist/erpnext/model/DeliveryNote.d.ts +125 -1168
  46. package/dist/erpnext/model/DeliveryNote.js +5 -51
  47. package/dist/erpnext/model/DispatchRun.d.ts +4 -110
  48. package/dist/erpnext/model/DispatchRun.js +1 -30
  49. package/dist/erpnext/model/DispatcherPreset.d.ts +0 -119
  50. package/dist/erpnext/model/DispatcherPreset.js +1 -27
  51. package/dist/erpnext/model/DocInfo.d.ts +41 -339
  52. package/dist/erpnext/model/DocInfo.js +5 -6
  53. package/dist/erpnext/model/DocTypeHelpers.d.ts +160 -2
  54. package/dist/erpnext/model/DocTypeHelpers.js +124 -1
  55. package/dist/erpnext/model/ERPNextDocTypeMeta.d.ts +137 -0
  56. package/dist/erpnext/model/ERPNextDocTypeMeta.js +42 -0
  57. package/dist/erpnext/model/ERPNextRequest.d.ts +5 -5
  58. package/dist/erpnext/model/File.d.ts +0 -48
  59. package/dist/erpnext/model/File.js +0 -8
  60. package/dist/erpnext/model/Fulfiller.d.ts +0 -121
  61. package/dist/erpnext/model/Fulfiller.js +1 -56
  62. package/dist/erpnext/model/FulfillerSettings.d.ts +0 -39
  63. package/dist/erpnext/model/FulfillerSettings.js +0 -6
  64. package/dist/erpnext/model/InternalReasons.d.ts +0 -3
  65. package/dist/erpnext/model/InternalReasons.js +0 -1
  66. package/dist/erpnext/model/Item.d.ts +488 -1847
  67. package/dist/erpnext/model/Item.js +18 -142
  68. package/dist/erpnext/model/ItemTaxTemplate.d.ts +57 -0
  69. package/dist/erpnext/model/ItemTaxTemplate.js +25 -0
  70. package/dist/erpnext/model/Logs.d.ts +0 -9
  71. package/dist/erpnext/model/Logs.js +0 -3
  72. package/dist/erpnext/model/PartList.d.ts +0 -15
  73. package/dist/erpnext/model/PartList.js +0 -5
  74. package/dist/erpnext/model/PaymentEntry.d.ts +302 -122
  75. package/dist/erpnext/model/PaymentEntry.js +52 -48
  76. package/dist/erpnext/model/Permissions.d.ts +3 -3
  77. package/dist/erpnext/model/Permissions.js +1 -1
  78. package/dist/erpnext/model/ProductBundle.d.ts +6 -107
  79. package/dist/erpnext/model/ProductBundle.js +0 -17
  80. package/dist/erpnext/model/PurchaseInvoice.d.ts +319 -389
  81. package/dist/erpnext/model/PurchaseInvoice.js +5 -24
  82. package/dist/erpnext/model/PurchaseOrder.d.ts +38 -184
  83. package/dist/erpnext/model/PurchaseOrder.js +0 -34
  84. package/dist/erpnext/model/Receipt.d.ts +32 -123
  85. package/dist/erpnext/model/Receipt.js +2 -25
  86. package/dist/erpnext/model/ReceiptDraft.d.ts +28 -70
  87. package/dist/erpnext/model/ReceiptDraft.js +2 -12
  88. package/dist/erpnext/model/Report.d.ts +0 -40
  89. package/dist/erpnext/model/Report.js +0 -8
  90. package/dist/erpnext/model/SalesInvoice.d.ts +2445 -0
  91. package/dist/erpnext/model/SalesInvoice.js +330 -0
  92. package/dist/erpnext/model/SalesOrder.d.ts +1061 -0
  93. package/dist/erpnext/model/SalesOrder.js +272 -0
  94. package/dist/erpnext/model/SalesTaxesAndCharges.d.ts +47 -0
  95. package/dist/erpnext/model/SalesTaxesAndCharges.js +30 -0
  96. package/dist/erpnext/model/Servicecase.d.ts +283 -728
  97. package/dist/erpnext/model/Servicecase.js +30 -108
  98. package/dist/erpnext/model/ServicecaseReason.d.ts +0 -8
  99. package/dist/erpnext/model/ServicecaseReason.js +0 -2
  100. package/dist/erpnext/model/ServicecaseSolution.d.ts +0 -3
  101. package/dist/erpnext/model/ServicecaseSolution.js +0 -1
  102. package/dist/erpnext/model/ServiceportalProductConfiguration.d.ts +27 -452
  103. package/dist/erpnext/model/ServiceportalProductConfiguration.js +16 -47
  104. package/dist/erpnext/model/Shipment.d.ts +18 -715
  105. package/dist/erpnext/model/Shipment.js +1 -69
  106. package/dist/erpnext/model/ShippingFees.d.ts +2 -2
  107. package/dist/erpnext/model/ShippingLabel.d.ts +0 -32
  108. package/dist/erpnext/model/ShippingLabel.js +0 -8
  109. package/dist/erpnext/model/ShippingProvider.d.ts +6 -87
  110. package/dist/erpnext/model/ShippingProvider.js +3 -6
  111. package/dist/erpnext/model/Stock.d.ts +0 -40
  112. package/dist/erpnext/model/Stock.js +0 -8
  113. package/dist/erpnext/model/StockEntry.d.ts +14 -47
  114. package/dist/erpnext/model/StockEntry.js +0 -11
  115. package/dist/erpnext/model/StockReconciliation.d.ts +5 -32
  116. package/dist/erpnext/model/StockReconciliation.js +0 -10
  117. package/dist/erpnext/model/Supplier.d.ts +0 -79
  118. package/dist/erpnext/model/Supplier.js +0 -8
  119. package/dist/erpnext/model/TaxCategory.d.ts +20 -0
  120. package/dist/erpnext/model/TaxCategory.js +16 -0
  121. package/dist/erpnext/model/Version.d.ts +0 -9
  122. package/dist/erpnext/model/Version.js +0 -3
  123. package/dist/erpnext/model/Waitlist.d.ts +0 -3
  124. package/dist/erpnext/model/Waitlist.js +0 -1
  125. package/dist/erpnext/model/WarehouseCategory.d.ts +0 -11
  126. package/dist/erpnext/model/WarehouseCategory.js +1 -7
  127. package/dist/erpnext/reports.js +3 -7
  128. package/dist/erpnext/resourceRequest.d.ts +13 -11
  129. package/dist/erpnext/resourceRequest.js +34 -23
  130. package/dist/index.d.ts +23 -11
  131. package/dist/index.js +31 -12
  132. package/dist/index.test.d.ts +1 -0
  133. package/dist/index.test.js +261 -0
  134. package/dist/utils/utils.d.ts +3 -0
  135. package/dist/utils/zodContextOptionals.d.ts +14 -0
  136. package/dist/utils/zodContextOptionals.js +45 -0
  137. package/dist/utils/zodUtils.js +16 -3
  138. package/package.json +6 -1
@@ -1,306 +1,212 @@
1
1
  import { TemporalClient } from "../../client";
2
2
  import { ERPNextDoctypeResourceRequest } from "../doctypeResourceRequest";
3
- import { Contact, ContactPostBodyType } from "../model/Contact";
3
+ import { Contact, ContactInputType } from "../model/Contact";
4
4
  export declare class ERPNextContact {
5
5
  protected temporalClient: TemporalClient;
6
6
  protected baseRequest: ERPNextDoctypeResourceRequest<typeof Contact>;
7
- getList: <TField extends ("name" | "doctype" | "email_id" | "owner" | "creation" | "modified" | "modified_by" | "idx" | "docstatus" | "first_name" | "email_ids" | "sync_with_google_contacts" | "pulled_from_google_contacts" | "is_primary_contact" | "is_billing_contact" | "unsubscribed") | ("status" | "links" | "phone" | "image" | "company" | "last_name" | "middle_name" | "mobile_no" | "phone_nos"), TAsDict extends boolean | undefined = undefined>({ fields, filters, skip, limit, priority, asDict, params, }?: {
8
- fields?: TField[] | undefined;
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 ["*"] | TFieldOptions[] | undefined = undefined, TAsDict extends boolean | undefined = undefined>({ fields, filters, skip, limit, priority, asDict, params, }?: {
8
+ fields?: TSelectedFields;
9
9
  filters?: (string | string[])[][];
10
10
  skip?: number;
11
11
  limit?: number;
12
12
  priority?: number;
13
13
  asDict?: TAsDict;
14
14
  params?: Record<string, string>;
15
- }) => Promise<TAsDict extends false ? string[][] : Pick<{
15
+ }) => Promise<(TAsDict extends false ? string[][] : TSelectedFields extends undefined ? {
16
+ name: string;
17
+ }[] : TSelectedFields extends readonly ["*"] ? {
18
+ docstatus: number;
16
19
  name: string;
17
- doctype: string;
18
- email_id: string;
19
20
  owner: string;
20
21
  creation: string;
21
22
  modified: string;
22
23
  modified_by: string;
23
24
  idx: number;
24
- docstatus: number;
25
- first_name: string;
26
- email_ids: {
27
- name: string;
28
- doctype: string;
29
- email_id: string;
30
- owner: string;
31
- creation: string;
32
- modified: string;
33
- modified_by: string;
34
- parent: string;
35
- parentfield: string;
36
- parenttype: string;
37
- idx: number;
38
- docstatus: number;
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;
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;
46
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;
47
35
  links?: {
48
- name: string;
49
- doctype: string;
50
36
  link_doctype: string;
51
37
  link_name: string;
52
- owner: string;
53
- creation: string;
54
- modified: string;
55
- modified_by: string;
56
- parent: string;
57
- parentfield: string;
58
- parenttype: string;
59
- idx: number;
60
- docstatus: number;
61
38
  link_title: string;
62
39
  }[] | null | undefined;
63
- phone?: string | null | undefined;
64
40
  image?: string | null | undefined;
65
41
  company?: string | null | undefined;
66
- last_name?: string | null | undefined;
42
+ first_name?: string | null | undefined;
67
43
  middle_name?: string | null | undefined;
44
+ last_name?: string | null | undefined;
68
45
  mobile_no?: string | null | undefined;
46
+ email_ids?: {
47
+ email_id: string;
48
+ is_primary: 0 | 1;
49
+ }[] | null | undefined;
69
50
  phone_nos?: {
70
- name: string;
71
- doctype: string;
72
- owner: string;
73
- creation: string;
74
- modified: string;
75
- modified_by: string;
76
- parent: string;
77
- parentfield: string;
78
- parenttype: string;
79
- idx: number;
80
- docstatus: number;
81
51
  phone: string;
82
- is_primary_phone: boolean;
83
- is_primary_mobile_no: boolean;
52
+ is_primary_phone: 0 | 1;
53
+ is_primary_mobile_no: 0 | 1;
84
54
  }[] | null | undefined;
85
- }, TField>[]>;
86
- getById: ({ resourceId, priority, }: {
87
- resourceId: string;
88
- priority?: number;
89
- }) => Promise<{
55
+ }[] : TSelectedFields extends 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") ? {
56
+ docstatus: number;
90
57
  name: string;
91
- doctype: string;
92
- email_id: string;
93
58
  owner: string;
94
59
  creation: string;
95
60
  modified: string;
96
61
  modified_by: string;
97
62
  idx: number;
98
- docstatus: number;
99
- first_name: string;
100
- email_ids: {
101
- name: string;
102
- doctype: string;
103
- email_id: string;
104
- owner: string;
105
- creation: string;
106
- modified: string;
107
- modified_by: string;
108
- parent: string;
109
- parentfield: string;
110
- parenttype: string;
111
- idx: number;
112
- docstatus: number;
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;
63
+ sync_with_google_contacts: 0 | 1;
64
+ pulled_from_google_contacts: 0 | 1;
65
+ is_primary_contact: 0 | 1;
66
+ is_billing_contact: 0 | 1;
67
+ unsubscribed: 0 | 1;
120
68
  status?: string | null | undefined;
69
+ address?: string | null | undefined;
70
+ _user_tags?: string | null | undefined;
71
+ phone?: string | null | undefined;
72
+ email_id?: string | null | undefined;
121
73
  links?: {
122
- name: string;
123
- doctype: string;
124
74
  link_doctype: string;
125
75
  link_name: string;
126
- owner: string;
127
- creation: string;
128
- modified: string;
129
- modified_by: string;
130
- parent: string;
131
- parentfield: string;
132
- parenttype: string;
133
- idx: number;
134
- docstatus: number;
135
76
  link_title: string;
136
77
  }[] | null | undefined;
137
- phone?: string | null | undefined;
138
78
  image?: string | null | undefined;
139
79
  company?: string | null | undefined;
140
- last_name?: string | null | undefined;
80
+ first_name?: string | null | undefined;
141
81
  middle_name?: string | null | undefined;
82
+ last_name?: string | null | undefined;
142
83
  mobile_no?: string | null | undefined;
84
+ email_ids?: {
85
+ email_id: string;
86
+ is_primary: 0 | 1;
87
+ }[] | null | undefined;
143
88
  phone_nos?: {
144
- name: string;
145
- doctype: string;
146
- owner: string;
147
- creation: string;
148
- modified: string;
149
- modified_by: string;
150
- parent: string;
151
- parentfield: string;
152
- parenttype: string;
153
- idx: number;
154
- docstatus: number;
155
89
  phone: string;
156
- is_primary_phone: boolean;
157
- is_primary_mobile_no: boolean;
90
+ is_primary_phone: 0 | 1;
91
+ is_primary_mobile_no: 0 | 1;
158
92
  }[] | null | undefined;
159
- }>;
160
- updateById: <TInput extends TInputModel extends undefined ? Partial<{
93
+ }[(("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>;
94
+ getById: ({ resourceId, priority, }: {
95
+ resourceId: string;
96
+ priority?: number;
97
+ }) => Promise<{
98
+ docstatus: number;
161
99
  name: string;
162
- doctype: string;
163
- email_id: string;
164
100
  owner: string;
165
101
  creation: string;
166
102
  modified: string;
167
103
  modified_by: string;
168
104
  idx: number;
169
- docstatus: number;
170
- first_name: string;
171
- email_ids: {
172
- name: string;
173
- doctype: string;
174
- email_id: string;
175
- owner: string;
176
- creation: string;
177
- modified: string;
178
- modified_by: string;
179
- parent: string;
180
- parentfield: string;
181
- parenttype: string;
182
- idx: number;
183
- docstatus: number;
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;
105
+ doctype: string;
106
+ sync_with_google_contacts: 0 | 1;
107
+ pulled_from_google_contacts: 0 | 1;
108
+ is_primary_contact: 0 | 1;
109
+ is_billing_contact: 0 | 1;
110
+ unsubscribed: 0 | 1;
191
111
  status?: string | null | undefined;
112
+ address?: string | null | undefined;
113
+ _user_tags?: string | null | undefined;
114
+ phone?: string | null | undefined;
115
+ email_id?: string | null | undefined;
192
116
  links?: {
193
- name: string;
194
- doctype: string;
195
117
  link_doctype: string;
196
118
  link_name: string;
197
- owner: string;
198
- creation: string;
199
- modified: string;
200
- modified_by: string;
201
- parent: string;
202
- parentfield: string;
203
- parenttype: string;
204
- idx: number;
205
- docstatus: number;
206
119
  link_title: string;
207
120
  }[] | null | undefined;
208
- phone?: string | null | undefined;
209
121
  image?: string | null | undefined;
210
122
  company?: string | null | undefined;
123
+ first_name?: string | null | undefined;
124
+ middle_name?: string | null | undefined;
211
125
  last_name?: string | null | undefined;
126
+ mobile_no?: string | null | undefined;
127
+ email_ids?: {
128
+ email_id: string;
129
+ is_primary: 0 | 1;
130
+ }[] | null | undefined;
131
+ phone_nos?: {
132
+ phone: string;
133
+ is_primary_phone: 0 | 1;
134
+ is_primary_mobile_no: 0 | 1;
135
+ }[] | null | undefined;
136
+ } | undefined>;
137
+ updateById: <TInput extends TInputModel extends undefined ? Partial<{
138
+ status?: string | null | undefined;
139
+ address?: string | null | undefined;
140
+ phone?: string | null | undefined;
141
+ email_id?: string | null | undefined;
142
+ links?: {
143
+ link_doctype: string;
144
+ link_name: string;
145
+ link_title: string;
146
+ }[] | null | undefined;
147
+ image?: string | null | undefined;
148
+ company?: string | null | undefined;
149
+ first_name?: string | null | undefined;
212
150
  middle_name?: string | null | undefined;
151
+ last_name?: string | null | undefined;
152
+ sync_with_google_contacts?: 0 | 1 | undefined;
213
153
  mobile_no?: string | null | undefined;
154
+ pulled_from_google_contacts?: 0 | 1 | undefined;
155
+ is_primary_contact?: 0 | 1 | undefined;
156
+ is_billing_contact?: 0 | 1 | undefined;
157
+ unsubscribed?: 0 | 1 | undefined;
158
+ email_ids?: {
159
+ email_id: string;
160
+ is_primary: 0 | 1;
161
+ }[] | null | undefined;
214
162
  phone_nos?: {
215
- name: string;
216
- doctype: string;
217
- owner: string;
218
- creation: string;
219
- modified: string;
220
- modified_by: string;
221
- parent: string;
222
- parentfield: string;
223
- parenttype: string;
224
- idx: number;
225
- docstatus: number;
226
163
  phone: string;
227
- is_primary_phone: boolean;
228
- is_primary_mobile_no: boolean;
164
+ is_primary_phone: 0 | 1;
165
+ is_primary_mobile_no: 0 | 1;
229
166
  }[] | null | undefined;
230
- }> : TInputModel extends import("zod").ZodTypeAny ? Partial<import("zod").TypeOf<TInputModel>> : any, TInputModel extends import("zod").ZodTypeAny | undefined = undefined>({ resourceId, inputValidationModel, body, priority, }: {
167
+ }> : TInputModel extends import("zod").ZodTypeAny ? import("zod").TypeOf<TInputModel> : any, TInputModel extends import("zod").ZodTypeAny | undefined = undefined>({ resourceId, inputValidationModel, body, priority, }: {
231
168
  resourceId: string;
232
169
  inputValidationModel?: TInputModel;
233
170
  priority?: number;
234
171
  body: TInput;
235
172
  }) => Promise<{
173
+ docstatus: number;
236
174
  name: string;
237
- doctype: string;
238
- email_id: string;
239
175
  owner: string;
240
176
  creation: string;
241
177
  modified: string;
242
178
  modified_by: string;
243
179
  idx: number;
244
- docstatus: number;
245
- first_name: string;
246
- email_ids: {
247
- name: string;
248
- doctype: string;
249
- email_id: string;
250
- owner: string;
251
- creation: string;
252
- modified: string;
253
- modified_by: string;
254
- parent: string;
255
- parentfield: string;
256
- parenttype: string;
257
- idx: number;
258
- docstatus: number;
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;
180
+ doctype: string;
181
+ sync_with_google_contacts: 0 | 1;
182
+ pulled_from_google_contacts: 0 | 1;
183
+ is_primary_contact: 0 | 1;
184
+ is_billing_contact: 0 | 1;
185
+ unsubscribed: 0 | 1;
266
186
  status?: string | null | undefined;
187
+ address?: string | null | undefined;
188
+ _user_tags?: string | null | undefined;
189
+ phone?: string | null | undefined;
190
+ email_id?: string | null | undefined;
267
191
  links?: {
268
- name: string;
269
- doctype: string;
270
192
  link_doctype: string;
271
193
  link_name: string;
272
- owner: string;
273
- creation: string;
274
- modified: string;
275
- modified_by: string;
276
- parent: string;
277
- parentfield: string;
278
- parenttype: string;
279
- idx: number;
280
- docstatus: number;
281
194
  link_title: string;
282
195
  }[] | null | undefined;
283
- phone?: string | null | undefined;
284
196
  image?: string | null | undefined;
285
197
  company?: string | null | undefined;
286
- last_name?: string | null | undefined;
198
+ first_name?: string | null | undefined;
287
199
  middle_name?: string | null | undefined;
200
+ last_name?: string | null | undefined;
288
201
  mobile_no?: string | null | undefined;
202
+ email_ids?: {
203
+ email_id: string;
204
+ is_primary: 0 | 1;
205
+ }[] | null | undefined;
289
206
  phone_nos?: {
290
- name: string;
291
- doctype: string;
292
- owner: string;
293
- creation: string;
294
- modified: string;
295
- modified_by: string;
296
- parent: string;
297
- parentfield: string;
298
- parenttype: string;
299
- idx: number;
300
- docstatus: number;
301
207
  phone: string;
302
- is_primary_phone: boolean;
303
- is_primary_mobile_no: boolean;
208
+ is_primary_phone: 0 | 1;
209
+ is_primary_mobile_no: 0 | 1;
304
210
  }[] | null | undefined;
305
211
  }>;
306
212
  deleteById: ({ resourceId, priority, }: {
@@ -308,146 +214,83 @@ export declare class ERPNextContact {
308
214
  priority?: number;
309
215
  }) => Promise<import("zod").TypeOf<typeof import("../model/ERPNextResponse").DeleteResponseModel>>;
310
216
  constructor(temporalClient: TemporalClient);
311
- getContactsByAddressEmail: <K extends keyof (typeof Contact)["_type"]>(email: string, fields?: K[]) => Promise<Pick<{
217
+ getContactsByAddressEmail: <K extends keyof (typeof Contact)["_type"]>(email: string, fields?: K[]) => Promise<(K[] extends infer T_1 ? T_1 extends K[] ? T_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"))[] ? { [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") ? {
218
+ docstatus: number;
312
219
  name: string;
313
- doctype: string;
314
- email_id: string;
315
220
  owner: string;
316
221
  creation: string;
317
222
  modified: string;
318
223
  modified_by: string;
319
224
  idx: number;
320
- docstatus: number;
321
- first_name: string;
322
- email_ids: {
323
- name: string;
324
- doctype: 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
- 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;
225
+ sync_with_google_contacts: 0 | 1;
226
+ pulled_from_google_contacts: 0 | 1;
227
+ is_primary_contact: 0 | 1;
228
+ is_billing_contact: 0 | 1;
229
+ unsubscribed: 0 | 1;
342
230
  status?: string | null | undefined;
231
+ address?: string | null | undefined;
232
+ _user_tags?: string | null | undefined;
233
+ phone?: string | null | undefined;
234
+ email_id?: string | null | undefined;
343
235
  links?: {
344
- name: string;
345
- doctype: string;
346
236
  link_doctype: string;
347
237
  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
238
  link_title: string;
358
239
  }[] | null | undefined;
359
- phone?: string | null | undefined;
360
240
  image?: string | null | undefined;
361
241
  company?: string | null | undefined;
362
- last_name?: string | null | undefined;
242
+ first_name?: string | null | undefined;
363
243
  middle_name?: string | null | undefined;
244
+ last_name?: string | null | undefined;
364
245
  mobile_no?: string | null | undefined;
246
+ email_ids?: {
247
+ email_id: string;
248
+ is_primary: 0 | 1;
249
+ }[] | null | undefined;
365
250
  phone_nos?: {
366
- name: string;
367
- doctype: 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
251
  phone: string;
378
- is_primary_phone: boolean;
379
- is_primary_mobile_no: boolean;
252
+ is_primary_phone: 0 | 1;
253
+ is_primary_mobile_no: 0 | 1;
380
254
  }[] | null | undefined;
381
- }, K>[]>;
382
- create: (contact: Omit<ContactPostBodyType, "links">, customerName: string) => Promise<{
255
+ }[(("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>;
256
+ create: (contact: Omit<ContactInputType, "links">, customerName: string) => Promise<{
257
+ docstatus: number;
383
258
  name: string;
384
- doctype: string;
385
- email_id: string;
386
259
  owner: string;
387
260
  creation: string;
388
261
  modified: string;
389
262
  modified_by: string;
390
263
  idx: number;
391
- docstatus: number;
392
- first_name: string;
393
- email_ids: {
394
- name: string;
395
- doctype: string;
396
- email_id: string;
397
- owner: string;
398
- creation: string;
399
- modified: string;
400
- modified_by: string;
401
- parent: string;
402
- parentfield: string;
403
- parenttype: string;
404
- idx: number;
405
- docstatus: number;
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;
264
+ doctype: string;
265
+ sync_with_google_contacts: 0 | 1;
266
+ pulled_from_google_contacts: 0 | 1;
267
+ is_primary_contact: 0 | 1;
268
+ is_billing_contact: 0 | 1;
269
+ unsubscribed: 0 | 1;
413
270
  status?: string | null | undefined;
271
+ address?: string | null | undefined;
272
+ _user_tags?: string | null | undefined;
273
+ phone?: string | null | undefined;
274
+ email_id?: string | null | undefined;
414
275
  links?: {
415
- name: string;
416
- doctype: string;
417
276
  link_doctype: string;
418
277
  link_name: string;
419
- owner: string;
420
- creation: string;
421
- modified: string;
422
- modified_by: string;
423
- parent: string;
424
- parentfield: string;
425
- parenttype: string;
426
- idx: number;
427
- docstatus: number;
428
278
  link_title: string;
429
279
  }[] | null | undefined;
430
- phone?: string | null | undefined;
431
280
  image?: string | null | undefined;
432
281
  company?: string | null | undefined;
433
- last_name?: string | null | undefined;
282
+ first_name?: string | null | undefined;
434
283
  middle_name?: string | null | undefined;
284
+ last_name?: string | null | undefined;
435
285
  mobile_no?: string | null | undefined;
286
+ email_ids?: {
287
+ email_id: string;
288
+ is_primary: 0 | 1;
289
+ }[] | null | undefined;
436
290
  phone_nos?: {
437
- name: string;
438
- doctype: string;
439
- owner: string;
440
- creation: string;
441
- modified: string;
442
- modified_by: string;
443
- parent: string;
444
- parentfield: string;
445
- parenttype: string;
446
- idx: number;
447
- docstatus: number;
448
291
  phone: string;
449
- is_primary_phone: boolean;
450
- is_primary_mobile_no: boolean;
292
+ is_primary_phone: 0 | 1;
293
+ is_primary_mobile_no: 0 | 1;
451
294
  }[] | null | undefined;
452
295
  }>;
453
296
  }
@@ -25,11 +25,11 @@ class ERPNextContact {
25
25
  });
26
26
  this.create = (contact, customerName) => __awaiter(this, void 0, void 0, function* () {
27
27
  const result = yield this.baseRequest.create({
28
- inputValidationModel: Contact_1.ContactPostBody,
29
28
  body: Object.assign(Object.assign({}, contact), { links: [
30
29
  {
31
30
  link_doctype: "Customer",
32
31
  link_name: customerName,
32
+ link_title: customerName,
33
33
  },
34
34
  ] }),
35
35
  });