erpnext-queue-client 2.0.0-beta.0 → 2.0.0-beta.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.
- package/dist/client.js +1 -4
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +4 -4
- package/dist/erpnext/doctypeResourceRequest.d.ts +1 -1
- package/dist/erpnext/doctypeSubmittableResourceRequest.d.ts +56 -16
- package/dist/erpnext/doctypeSubmittableResourceRequest.js +10 -8
- package/dist/erpnext/doctypes/address.d.ts +18 -18
- package/dist/erpnext/doctypes/contact.d.ts +18 -18
- package/dist/erpnext/doctypes/deliveryNote.d.ts +44 -33
- package/dist/erpnext/doctypes/item.d.ts +49 -49
- package/dist/erpnext/doctypes/paymentEntry.d.ts +820 -0
- package/dist/erpnext/doctypes/paymentEntry.js +72 -0
- package/dist/erpnext/doctypes/productBundle.d.ts +16 -16
- package/dist/erpnext/doctypes/purchaseInvoice.d.ts +99 -99
- package/dist/erpnext/doctypes/purchaseReceipt.d.ts +48 -49
- package/dist/erpnext/doctypes/salesInvoice.d.ts +2205 -2203
- package/dist/erpnext/doctypes/servicecase.d.ts +56 -56
- package/dist/erpnext/doctypes/shipment.d.ts +76 -44
- package/dist/erpnext/doctypes/stock.d.ts +2 -0
- package/dist/erpnext/doctypes/stock.js +19 -3
- package/dist/erpnext/model/ConsolidatedCustomsInvoice.d.ts +321 -0
- package/dist/erpnext/model/ConsolidatedCustomsInvoice.js +83 -0
- package/dist/erpnext/model/DeliveryNote.d.ts +3 -0
- package/dist/erpnext/model/DeliveryNote.js +1 -0
- package/dist/erpnext/model/DispatchRun.d.ts +3 -3
- package/dist/erpnext/model/DispatchRun.js +1 -1
- package/dist/erpnext/model/DocTypeHelpers.d.ts +26 -7
- package/dist/erpnext/model/DocTypeHelpers.js +0 -8
- package/dist/erpnext/model/ERPNextDocTypeMeta.d.ts +28 -15
- package/dist/erpnext/model/ERPNextDocTypeMeta.js +12 -7
- package/dist/erpnext/model/FulfillmentStation.d.ts +3 -0
- package/dist/erpnext/model/FulfillmentStation.js +1 -0
- package/dist/erpnext/model/Item.d.ts +35 -25
- package/dist/erpnext/model/ItemTaxTemplate.d.ts +57 -0
- package/dist/erpnext/model/ItemTaxTemplate.js +25 -0
- package/dist/erpnext/model/PaymentEntry.d.ts +183 -16
- package/dist/erpnext/model/PaymentEntry.js +6 -1
- package/dist/erpnext/model/PurchaseInvoice.d.ts +49 -47
- package/dist/erpnext/model/PurchaseInvoice.js +0 -1
- package/dist/erpnext/model/PurchaseOrder.d.ts +10 -10
- package/dist/erpnext/model/Receipt.d.ts +2 -2
- package/dist/erpnext/model/ReceiptDraft.d.ts +0 -3
- package/dist/erpnext/model/ReceiptDraft.js +0 -1
- package/dist/erpnext/model/SalesInvoice.d.ts +1530 -1526
- package/dist/erpnext/model/SalesInvoice.js +182 -178
- package/dist/erpnext/model/SalesOrder.d.ts +778 -748
- package/dist/erpnext/model/SalesOrder.js +151 -149
- package/dist/erpnext/model/Servicecase.d.ts +30 -30
- package/dist/erpnext/model/Servicecase.js +8 -1
- package/dist/erpnext/model/ServiceportalProductConfiguration.d.ts +128 -3
- package/dist/erpnext/model/ServiceportalProductConfiguration.js +34 -2
- package/dist/erpnext/model/Shipment.d.ts +14 -0
- package/dist/erpnext/model/Shipment.js +14 -1
- package/dist/erpnext/model/ShippingFees.d.ts +36 -0
- package/dist/erpnext/model/ShippingFees.js +18 -0
- package/dist/erpnext/model/ShippingProvider.d.ts +2 -2
- package/dist/erpnext/model/Stock.d.ts +6 -6
- package/dist/erpnext/model/StockEntry.d.ts +2 -2
- package/dist/erpnext/model/TaxCategory.d.ts +20 -0
- package/dist/erpnext/model/TaxCategory.js +16 -0
- package/dist/erpnext/resourceRequest.d.ts +1 -1
- package/dist/erpnext/resourceRequest.js +11 -5
- package/dist/index.d.ts +8 -2
- package/dist/index.js +9 -2
- package/dist/index.test.js +104 -70
- package/dist/utils/zodContextOptionals.js +7 -4
- package/dist/utils/zodUtils.js +14 -2
- package/package.json +7 -2
|
@@ -5,7 +5,14 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const Boolean_1 = require("./Boolean");
|
|
6
6
|
const DocTypeHelpers_1 = require("./DocTypeHelpers");
|
|
7
7
|
const zodContextOptionals_1 = require("../../utils/zodContextOptionals");
|
|
8
|
-
const Shop = zod_1.z.enum([
|
|
8
|
+
const Shop = zod_1.z.enum([
|
|
9
|
+
"Shopify",
|
|
10
|
+
"Amazon FBA",
|
|
11
|
+
"Amazon FBM",
|
|
12
|
+
"Otto",
|
|
13
|
+
"Amazon",
|
|
14
|
+
"WordPress",
|
|
15
|
+
]);
|
|
9
16
|
const Status = zod_1.z.enum(["EDITING", "SUBMITTED", "COMPLETED"]);
|
|
10
17
|
const CreatedWith = zod_1.z.enum([
|
|
11
18
|
"Serviceportal",
|
|
@@ -10,6 +10,40 @@ export declare const ServiceportalProductConfiguration: z.ZodObject<{
|
|
|
10
10
|
title: z.ZodString;
|
|
11
11
|
return_fee: z.ZodNumber;
|
|
12
12
|
return_fee_explanation: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
13
|
+
return_fees: z.ZodArray<z.ZodObject<{
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
owner: z.ZodString;
|
|
16
|
+
creation: z.ZodString;
|
|
17
|
+
modified: z.ZodString;
|
|
18
|
+
modified_by: z.ZodString;
|
|
19
|
+
idx: z.ZodNumber;
|
|
20
|
+
docstatus: z.ZodNumber;
|
|
21
|
+
shipping_provider: z.ZodString;
|
|
22
|
+
country: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
23
|
+
fee: z.ZodNumber;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
docstatus: number;
|
|
26
|
+
name: string;
|
|
27
|
+
owner: string;
|
|
28
|
+
creation: string;
|
|
29
|
+
modified: string;
|
|
30
|
+
modified_by: string;
|
|
31
|
+
idx: number;
|
|
32
|
+
shipping_provider: string;
|
|
33
|
+
fee: number;
|
|
34
|
+
country?: string | null | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
docstatus: number;
|
|
37
|
+
name: string;
|
|
38
|
+
owner: string;
|
|
39
|
+
creation: string;
|
|
40
|
+
modified: string;
|
|
41
|
+
modified_by: string;
|
|
42
|
+
idx: number;
|
|
43
|
+
shipping_provider: string;
|
|
44
|
+
fee: number;
|
|
45
|
+
country?: string | null | undefined;
|
|
46
|
+
}>, "many">;
|
|
13
47
|
is_ask_for_batch_number: z.ZodNumber;
|
|
14
48
|
batch_number_location_description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
15
49
|
return_conditions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -29,13 +63,24 @@ export declare const ServiceportalProductConfiguration: z.ZodObject<{
|
|
|
29
63
|
}>, "many">;
|
|
30
64
|
return_shipping_provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
31
65
|
return_instructions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
32
|
-
internal_reasons_section: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
33
66
|
}, "strip", z.ZodTypeAny, {
|
|
34
67
|
title: string;
|
|
35
68
|
internal_reasons: {
|
|
36
69
|
internal_reason: string;
|
|
37
70
|
}[];
|
|
38
71
|
return_fee: number;
|
|
72
|
+
return_fees: {
|
|
73
|
+
docstatus: number;
|
|
74
|
+
name: string;
|
|
75
|
+
owner: string;
|
|
76
|
+
creation: string;
|
|
77
|
+
modified: string;
|
|
78
|
+
modified_by: string;
|
|
79
|
+
idx: number;
|
|
80
|
+
shipping_provider: string;
|
|
81
|
+
fee: number;
|
|
82
|
+
country?: string | null | undefined;
|
|
83
|
+
}[];
|
|
39
84
|
is_ask_for_batch_number: number;
|
|
40
85
|
batch_numbers: {
|
|
41
86
|
batch_number: string;
|
|
@@ -45,13 +90,24 @@ export declare const ServiceportalProductConfiguration: z.ZodObject<{
|
|
|
45
90
|
return_conditions?: string | null | undefined;
|
|
46
91
|
return_shipping_provider?: string | null | undefined;
|
|
47
92
|
return_instructions?: string | null | undefined;
|
|
48
|
-
internal_reasons_section?: string | null | undefined;
|
|
49
93
|
}, {
|
|
50
94
|
title: string;
|
|
51
95
|
internal_reasons: {
|
|
52
96
|
internal_reason: string;
|
|
53
97
|
}[];
|
|
54
98
|
return_fee: number;
|
|
99
|
+
return_fees: {
|
|
100
|
+
docstatus: number;
|
|
101
|
+
name: string;
|
|
102
|
+
owner: string;
|
|
103
|
+
creation: string;
|
|
104
|
+
modified: string;
|
|
105
|
+
modified_by: string;
|
|
106
|
+
idx: number;
|
|
107
|
+
shipping_provider: string;
|
|
108
|
+
fee: number;
|
|
109
|
+
country?: string | null | undefined;
|
|
110
|
+
}[];
|
|
55
111
|
is_ask_for_batch_number: number;
|
|
56
112
|
batch_numbers: {
|
|
57
113
|
batch_number: string;
|
|
@@ -61,6 +117,75 @@ export declare const ServiceportalProductConfiguration: z.ZodObject<{
|
|
|
61
117
|
return_conditions?: string | null | undefined;
|
|
62
118
|
return_shipping_provider?: string | null | undefined;
|
|
63
119
|
return_instructions?: string | null | undefined;
|
|
64
|
-
internal_reasons_section?: string | null | undefined;
|
|
65
120
|
}>;
|
|
66
121
|
export type ServiceportalProductConfigurationType = z.infer<typeof ServiceportalProductConfiguration>;
|
|
122
|
+
export declare const ServiceportalProductConfigurationMethodResponse: z.ZodObject<{
|
|
123
|
+
name: z.ZodString;
|
|
124
|
+
doctype: z.ZodString;
|
|
125
|
+
title: z.ZodString;
|
|
126
|
+
return_fee: z.ZodNumber;
|
|
127
|
+
return_fee_explanation: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
128
|
+
is_ask_for_batch_number: z.ZodNumber;
|
|
129
|
+
batch_number_location_description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
130
|
+
return_conditions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
131
|
+
return_shipping_provider: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
132
|
+
return_instructions: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
133
|
+
} & {
|
|
134
|
+
return_fees: z.ZodArray<z.ZodObject<Pick<{
|
|
135
|
+
[x: string]: z.ZodTypeAny;
|
|
136
|
+
} & {
|
|
137
|
+
name: z.ZodString;
|
|
138
|
+
owner: z.ZodString;
|
|
139
|
+
creation: z.ZodString;
|
|
140
|
+
modified: z.ZodString;
|
|
141
|
+
modified_by: z.ZodString;
|
|
142
|
+
idx: z.ZodNumber;
|
|
143
|
+
docstatus: z.ZodDefault<z.ZodNumber> & {
|
|
144
|
+
__optionalForInput: true;
|
|
145
|
+
};
|
|
146
|
+
doctype: z.ZodString;
|
|
147
|
+
_user_tags: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
148
|
+
}, never>, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>, "many">;
|
|
149
|
+
batch_numbers: z.ZodArray<z.ZodObject<Pick<{
|
|
150
|
+
[x: string]: z.ZodTypeAny;
|
|
151
|
+
} & {
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
owner: z.ZodString;
|
|
154
|
+
creation: z.ZodString;
|
|
155
|
+
modified: z.ZodString;
|
|
156
|
+
modified_by: z.ZodString;
|
|
157
|
+
idx: z.ZodNumber;
|
|
158
|
+
docstatus: z.ZodDefault<z.ZodNumber> & {
|
|
159
|
+
__optionalForInput: true;
|
|
160
|
+
};
|
|
161
|
+
doctype: z.ZodString;
|
|
162
|
+
_user_tags: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
163
|
+
}, never>, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>, "many">;
|
|
164
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
165
|
+
name: string;
|
|
166
|
+
doctype: string;
|
|
167
|
+
title: string;
|
|
168
|
+
return_fee: number;
|
|
169
|
+
return_fees: {}[];
|
|
170
|
+
is_ask_for_batch_number: number;
|
|
171
|
+
batch_numbers: {}[];
|
|
172
|
+
return_fee_explanation?: string | null | undefined;
|
|
173
|
+
batch_number_location_description?: string | null | undefined;
|
|
174
|
+
return_conditions?: string | null | undefined;
|
|
175
|
+
return_shipping_provider?: string | null | undefined;
|
|
176
|
+
return_instructions?: string | null | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
name: string;
|
|
179
|
+
doctype: string;
|
|
180
|
+
title: string;
|
|
181
|
+
return_fee: number;
|
|
182
|
+
return_fees: {}[];
|
|
183
|
+
is_ask_for_batch_number: number;
|
|
184
|
+
batch_numbers: {}[];
|
|
185
|
+
return_fee_explanation?: string | null | undefined;
|
|
186
|
+
batch_number_location_description?: string | null | undefined;
|
|
187
|
+
return_conditions?: string | null | undefined;
|
|
188
|
+
return_shipping_provider?: string | null | undefined;
|
|
189
|
+
return_instructions?: string | null | undefined;
|
|
190
|
+
}>;
|
|
191
|
+
export type ServiceportalProductConfigurationMethodResponseType = z.infer<typeof ServiceportalProductConfigurationMethodResponse>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceportalProductConfiguration = exports.InternalReasonList = void 0;
|
|
3
|
+
exports.ServiceportalProductConfigurationMethodResponse = exports.ServiceportalProductConfiguration = exports.InternalReasonList = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const DocTypeHelpers_1 = require("./DocTypeHelpers");
|
|
6
|
+
const ShippingFees_1 = require("./ShippingFees");
|
|
5
7
|
const BatchNumberList = zod_1.z
|
|
6
8
|
.object({
|
|
7
9
|
batch_number: zod_1.z.string(),
|
|
@@ -17,6 +19,7 @@ exports.ServiceportalProductConfiguration = zod_1.z
|
|
|
17
19
|
title: zod_1.z.string(),
|
|
18
20
|
return_fee: zod_1.z.number(),
|
|
19
21
|
return_fee_explanation: zod_1.z.string().optional().nullable(),
|
|
22
|
+
return_fees: zod_1.z.array(ShippingFees_1.ShippingFee),
|
|
20
23
|
is_ask_for_batch_number: zod_1.z.number(),
|
|
21
24
|
batch_number_location_description: zod_1.z.string().optional().nullable(),
|
|
22
25
|
return_conditions: zod_1.z.string().optional().nullable(),
|
|
@@ -24,6 +27,35 @@ exports.ServiceportalProductConfiguration = zod_1.z
|
|
|
24
27
|
internal_reasons: zod_1.z.array(exports.InternalReasonList),
|
|
25
28
|
return_shipping_provider: zod_1.z.string().optional().nullable(),
|
|
26
29
|
return_instructions: zod_1.z.string().optional().nullable(),
|
|
27
|
-
internal_reasons_section: zod_1.z.string().optional().nullable(),
|
|
28
30
|
})
|
|
29
31
|
.describe("ServiceportalProductConfiguration");
|
|
32
|
+
exports.ServiceportalProductConfigurationMethodResponse = (0, DocTypeHelpers_1.DocModel)(exports.ServiceportalProductConfiguration)
|
|
33
|
+
.pick({
|
|
34
|
+
name: true,
|
|
35
|
+
title: true,
|
|
36
|
+
doctype: true,
|
|
37
|
+
return_fee: true,
|
|
38
|
+
return_fee_explanation: true,
|
|
39
|
+
return_fees: true,
|
|
40
|
+
is_ask_for_batch_number: true,
|
|
41
|
+
batch_number_location_description: true,
|
|
42
|
+
return_conditions: true,
|
|
43
|
+
batch_numbers: true,
|
|
44
|
+
return_shipping_provider: true,
|
|
45
|
+
return_instructions: true,
|
|
46
|
+
})
|
|
47
|
+
.extend({
|
|
48
|
+
return_fees: zod_1.z.array((0, DocTypeHelpers_1.DocModel)((0, DocTypeHelpers_1.AugmentChildTableArrays)(ShippingFees_1.ShippingFee)).pick({
|
|
49
|
+
shipping_provider: true,
|
|
50
|
+
country: true,
|
|
51
|
+
fee: true,
|
|
52
|
+
})),
|
|
53
|
+
batch_numbers: zod_1.z.array((0, DocTypeHelpers_1.DocModel)((0, DocTypeHelpers_1.AugmentChildTableArrays)(BatchNumberList)).pick({
|
|
54
|
+
idx: true,
|
|
55
|
+
batch_number: true,
|
|
56
|
+
parent: true,
|
|
57
|
+
parentfield: true,
|
|
58
|
+
parenttype: true,
|
|
59
|
+
doctype: true,
|
|
60
|
+
})),
|
|
61
|
+
});
|
|
@@ -138,6 +138,8 @@ export declare const ShipmentParcel: z.ZodObject<{
|
|
|
138
138
|
weight: number;
|
|
139
139
|
count: number;
|
|
140
140
|
}>;
|
|
141
|
+
export declare const ShipmentExportStatus: z.ZodNullable<z.ZodOptional<z.ZodDefault<z.ZodEnum<["Open", "Customs Declaration in Progress", "Customs Declaration Submitted", "Customs Declaration Confirmed"]>>>>;
|
|
142
|
+
export type ShipmentExportStatusType = z.infer<typeof ShipmentExportStatus>;
|
|
141
143
|
export declare const Shipment: z.ZodObject<{
|
|
142
144
|
__onload: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
143
145
|
load_after_mapping: z.ZodBoolean;
|
|
@@ -224,6 +226,9 @@ export declare const Shipment: z.ZodObject<{
|
|
|
224
226
|
tracking_status: z.ZodString;
|
|
225
227
|
tracking_url: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
226
228
|
value_of_goods: z.ZodNumber;
|
|
229
|
+
custom_delivery_country: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
230
|
+
custom_is_export: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
231
|
+
custom_export_status: z.ZodNullable<z.ZodOptional<z.ZodDefault<z.ZodEnum<["Open", "Customs Declaration in Progress", "Customs Declaration Submitted", "Customs Declaration Confirmed"]>>>>;
|
|
227
232
|
}, "strip", z.ZodTypeAny, {
|
|
228
233
|
status: string;
|
|
229
234
|
creation: string;
|
|
@@ -286,6 +291,9 @@ export declare const Shipment: z.ZodObject<{
|
|
|
286
291
|
custom_return_shipping_provider?: string | null | undefined;
|
|
287
292
|
tracking_status_info?: string | null | undefined;
|
|
288
293
|
tracking_url?: string | null | undefined;
|
|
294
|
+
custom_delivery_country?: string | null | undefined;
|
|
295
|
+
custom_is_export?: number | null | undefined;
|
|
296
|
+
custom_export_status?: "Open" | "Customs Declaration in Progress" | "Customs Declaration Submitted" | "Customs Declaration Confirmed" | null | undefined;
|
|
289
297
|
}, {
|
|
290
298
|
status: string;
|
|
291
299
|
creation: string;
|
|
@@ -348,6 +356,9 @@ export declare const Shipment: z.ZodObject<{
|
|
|
348
356
|
custom_return_shipping_provider?: string | null | undefined;
|
|
349
357
|
tracking_status_info?: string | null | undefined;
|
|
350
358
|
tracking_url?: string | null | undefined;
|
|
359
|
+
custom_delivery_country?: string | null | undefined;
|
|
360
|
+
custom_is_export?: number | null | undefined;
|
|
361
|
+
custom_export_status?: "Open" | "Customs Declaration in Progress" | "Customs Declaration Submitted" | "Customs Declaration Confirmed" | null | undefined;
|
|
351
362
|
}>;
|
|
352
363
|
export type ShipmentType = z.infer<typeof Shipment>;
|
|
353
364
|
export type ShipmentDraftFromDeliveryNoteType = z.infer<typeof ShipmentDraftFromDeliveryNote>;
|
|
@@ -437,6 +448,9 @@ export declare const ShipmentAddShippingLabelAndSubmitBody: z.ZodObject<Pick<{
|
|
|
437
448
|
tracking_status: z.ZodString;
|
|
438
449
|
tracking_url: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
439
450
|
value_of_goods: z.ZodNumber;
|
|
451
|
+
custom_delivery_country: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
452
|
+
custom_is_export: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
453
|
+
custom_export_status: z.ZodNullable<z.ZodOptional<z.ZodDefault<z.ZodEnum<["Open", "Customs Declaration in Progress", "Customs Declaration Submitted", "Customs Declaration Confirmed"]>>>>;
|
|
440
454
|
}, "shipping_provider" | "shipping_label" | "custom_return_label" | "custom_return_shipping_provider">, "strip", z.ZodTypeAny, {
|
|
441
455
|
shipping_provider?: string | null | undefined;
|
|
442
456
|
shipping_label?: string | null | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ShipmentInfoByOrderNumberMethodResponseData = exports.ShipmentAddShippingLabelAndSubmitBody = exports.Shipment = exports.ShipmentParcel = exports.ShipmentDraftFromDeliveryNote = void 0;
|
|
3
|
+
exports.ShipmentInfoByOrderNumberMethodResponseData = exports.ShipmentAddShippingLabelAndSubmitBody = exports.Shipment = exports.ShipmentExportStatus = exports.ShipmentParcel = exports.ShipmentDraftFromDeliveryNote = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const Onload = zod_1.z
|
|
6
6
|
.object({
|
|
@@ -62,6 +62,16 @@ exports.ShipmentParcel = zod_1.z
|
|
|
62
62
|
count: zod_1.z.number(),
|
|
63
63
|
})
|
|
64
64
|
.describe("Shipment Parcel");
|
|
65
|
+
exports.ShipmentExportStatus = zod_1.z
|
|
66
|
+
.enum([
|
|
67
|
+
"Open",
|
|
68
|
+
"Customs Declaration in Progress",
|
|
69
|
+
"Customs Declaration Submitted",
|
|
70
|
+
"Customs Declaration Confirmed",
|
|
71
|
+
])
|
|
72
|
+
.default("Open")
|
|
73
|
+
.optional()
|
|
74
|
+
.nullable();
|
|
65
75
|
exports.Shipment = zod_1.z
|
|
66
76
|
.object({
|
|
67
77
|
__onload: Onload.optional().nullable(),
|
|
@@ -113,6 +123,9 @@ exports.Shipment = zod_1.z
|
|
|
113
123
|
tracking_status: zod_1.z.string(),
|
|
114
124
|
tracking_url: zod_1.z.string().optional().nullable(),
|
|
115
125
|
value_of_goods: zod_1.z.number(),
|
|
126
|
+
custom_delivery_country: zod_1.z.string().optional().nullable(),
|
|
127
|
+
custom_is_export: zod_1.z.number().optional().nullable(),
|
|
128
|
+
custom_export_status: exports.ShipmentExportStatus,
|
|
116
129
|
})
|
|
117
130
|
.describe("Shipment");
|
|
118
131
|
exports.ShipmentAddShippingLabelAndSubmitBody = exports.Shipment.pick({
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ShippingFee: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
owner: z.ZodString;
|
|
5
|
+
creation: z.ZodString;
|
|
6
|
+
modified: z.ZodString;
|
|
7
|
+
modified_by: z.ZodString;
|
|
8
|
+
idx: z.ZodNumber;
|
|
9
|
+
docstatus: z.ZodNumber;
|
|
10
|
+
shipping_provider: z.ZodString;
|
|
11
|
+
country: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
fee: z.ZodNumber;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
docstatus: number;
|
|
15
|
+
name: string;
|
|
16
|
+
owner: string;
|
|
17
|
+
creation: string;
|
|
18
|
+
modified: string;
|
|
19
|
+
modified_by: string;
|
|
20
|
+
idx: number;
|
|
21
|
+
shipping_provider: string;
|
|
22
|
+
fee: number;
|
|
23
|
+
country?: string | null | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
docstatus: number;
|
|
26
|
+
name: string;
|
|
27
|
+
owner: string;
|
|
28
|
+
creation: string;
|
|
29
|
+
modified: string;
|
|
30
|
+
modified_by: string;
|
|
31
|
+
idx: number;
|
|
32
|
+
shipping_provider: string;
|
|
33
|
+
fee: number;
|
|
34
|
+
country?: string | null | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
export type ShippingFeeType = z.infer<typeof ShippingFee>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ShippingFee = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ShippingFee = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
name: zod_1.z.string(),
|
|
8
|
+
owner: zod_1.z.string(),
|
|
9
|
+
creation: zod_1.z.string(),
|
|
10
|
+
modified: zod_1.z.string(),
|
|
11
|
+
modified_by: zod_1.z.string(),
|
|
12
|
+
idx: zod_1.z.number(),
|
|
13
|
+
docstatus: zod_1.z.number(),
|
|
14
|
+
shipping_provider: zod_1.z.string(),
|
|
15
|
+
country: zod_1.z.string().optional().nullable(),
|
|
16
|
+
fee: zod_1.z.number(),
|
|
17
|
+
})
|
|
18
|
+
.describe("Shipping Fee");
|
|
@@ -277,13 +277,13 @@ export declare const ShippingProviderList: z.ZodEffects<z.ZodArray<import("./Doc
|
|
|
277
277
|
return_label_instructions?: string | null | undefined;
|
|
278
278
|
shopify_carrier_mapping?: "" | ShopifyCarrier | null | undefined;
|
|
279
279
|
}>>, "many">, {
|
|
280
|
+
docstatus: number;
|
|
280
281
|
name: string;
|
|
281
282
|
owner: string;
|
|
282
283
|
creation: string;
|
|
283
284
|
modified: string;
|
|
284
285
|
modified_by: string;
|
|
285
286
|
idx: number;
|
|
286
|
-
docstatus: number;
|
|
287
287
|
title: string;
|
|
288
288
|
is_active: boolean;
|
|
289
289
|
is_transport_by_freight_forwarding: boolean;
|
|
@@ -295,7 +295,7 @@ export declare const ShippingProviderList: z.ZodEffects<z.ZodArray<import("./Doc
|
|
|
295
295
|
sender_address: string;
|
|
296
296
|
is_return_shipping_provider: boolean;
|
|
297
297
|
is_self_service: boolean;
|
|
298
|
-
_user_tags?: string | undefined;
|
|
298
|
+
_user_tags?: string | null | undefined;
|
|
299
299
|
dhl_ekp_number?: string | null | undefined;
|
|
300
300
|
api_user?: string | null | undefined;
|
|
301
301
|
api_password?: string | null | undefined;
|
|
@@ -23,9 +23,9 @@ export declare const StockBalanceReportItem: z.ZodObject<{
|
|
|
23
23
|
warehouse: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
25
|
item_code: string;
|
|
26
|
-
name?: string | null | undefined;
|
|
27
26
|
description?: string | null | undefined;
|
|
28
27
|
brand?: string | null | undefined;
|
|
28
|
+
name?: string | null | undefined;
|
|
29
29
|
company?: string | null | undefined;
|
|
30
30
|
item_name?: string | null | undefined;
|
|
31
31
|
item_group?: string | null | undefined;
|
|
@@ -45,9 +45,9 @@ export declare const StockBalanceReportItem: z.ZodObject<{
|
|
|
45
45
|
val_rate?: number | null | undefined;
|
|
46
46
|
}, {
|
|
47
47
|
item_code: string;
|
|
48
|
-
name?: string | null | undefined;
|
|
49
48
|
description?: string | null | undefined;
|
|
50
49
|
brand?: string | null | undefined;
|
|
50
|
+
name?: string | null | undefined;
|
|
51
51
|
company?: string | null | undefined;
|
|
52
52
|
item_name?: string | null | undefined;
|
|
53
53
|
item_group?: string | null | undefined;
|
|
@@ -123,9 +123,9 @@ export declare const StockBalanceReport: z.ZodObject<{
|
|
|
123
123
|
warehouse: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
124
124
|
}, "strip", z.ZodTypeAny, {
|
|
125
125
|
item_code: string;
|
|
126
|
-
name?: string | null | undefined;
|
|
127
126
|
description?: string | null | undefined;
|
|
128
127
|
brand?: string | null | undefined;
|
|
128
|
+
name?: string | null | undefined;
|
|
129
129
|
company?: string | null | undefined;
|
|
130
130
|
item_name?: string | null | undefined;
|
|
131
131
|
item_group?: string | null | undefined;
|
|
@@ -145,9 +145,9 @@ export declare const StockBalanceReport: z.ZodObject<{
|
|
|
145
145
|
val_rate?: number | null | undefined;
|
|
146
146
|
}, {
|
|
147
147
|
item_code: string;
|
|
148
|
-
name?: string | null | undefined;
|
|
149
148
|
description?: string | null | undefined;
|
|
150
149
|
brand?: string | null | undefined;
|
|
150
|
+
name?: string | null | undefined;
|
|
151
151
|
company?: string | null | undefined;
|
|
152
152
|
item_name?: string | null | undefined;
|
|
153
153
|
item_group?: string | null | undefined;
|
|
@@ -196,9 +196,9 @@ export declare const StockBalanceReport: z.ZodObject<{
|
|
|
196
196
|
}, "strip", z.ZodTypeAny, {
|
|
197
197
|
result: ((string | number)[] | {
|
|
198
198
|
item_code: string;
|
|
199
|
-
name?: string | null | undefined;
|
|
200
199
|
description?: string | null | undefined;
|
|
201
200
|
brand?: string | null | undefined;
|
|
201
|
+
name?: string | null | undefined;
|
|
202
202
|
company?: string | null | undefined;
|
|
203
203
|
item_name?: string | null | undefined;
|
|
204
204
|
item_group?: string | null | undefined;
|
|
@@ -239,9 +239,9 @@ export declare const StockBalanceReport: z.ZodObject<{
|
|
|
239
239
|
}, {
|
|
240
240
|
result: ((string | number)[] | {
|
|
241
241
|
item_code: string;
|
|
242
|
-
name?: string | null | undefined;
|
|
243
242
|
description?: string | null | undefined;
|
|
244
243
|
brand?: string | null | undefined;
|
|
244
|
+
name?: string | null | undefined;
|
|
245
245
|
company?: string | null | undefined;
|
|
246
246
|
item_name?: string | null | undefined;
|
|
247
247
|
item_group?: string | null | undefined;
|
|
@@ -134,8 +134,8 @@ export declare const StockEntry: z.ZodObject<{
|
|
|
134
134
|
letter_head?: string | undefined;
|
|
135
135
|
select_print_heading?: string | undefined;
|
|
136
136
|
supplier?: string | undefined;
|
|
137
|
-
purchase_order?: string | undefined;
|
|
138
137
|
remarks?: string | undefined;
|
|
138
|
+
purchase_order?: string | undefined;
|
|
139
139
|
from_warehouse?: string | undefined;
|
|
140
140
|
supplier_address?: string | undefined;
|
|
141
141
|
bom_no?: string | undefined;
|
|
@@ -192,8 +192,8 @@ export declare const StockEntry: z.ZodObject<{
|
|
|
192
192
|
letter_head?: string | undefined;
|
|
193
193
|
select_print_heading?: string | undefined;
|
|
194
194
|
supplier?: string | undefined;
|
|
195
|
-
purchase_order?: string | undefined;
|
|
196
195
|
remarks?: string | undefined;
|
|
196
|
+
purchase_order?: string | undefined;
|
|
197
197
|
from_warehouse?: string | undefined;
|
|
198
198
|
supplier_address?: string | undefined;
|
|
199
199
|
bom_no?: string | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export declare const TaxCategory: z.ZodObject<{
|
|
3
|
+
title: z.ZodString;
|
|
4
|
+
disabled: z.ZodDefault<z.ZodEffects<z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>, 0 | 1, unknown>> & {
|
|
5
|
+
__optionalForInput: true;
|
|
6
|
+
};
|
|
7
|
+
country: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
custom_type: z.ZodEnum<["Sales", "Purchase"]>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
disabled: 0 | 1;
|
|
11
|
+
title: string;
|
|
12
|
+
custom_type: "Sales" | "Purchase";
|
|
13
|
+
country?: string | null | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
title: string;
|
|
16
|
+
custom_type: "Sales" | "Purchase";
|
|
17
|
+
country?: string | null | undefined;
|
|
18
|
+
disabled?: unknown;
|
|
19
|
+
}>;
|
|
20
|
+
export type TaxCategoryType = z.infer<typeof TaxCategory>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TaxCategory = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const Boolean_1 = require("./Boolean");
|
|
9
|
+
exports.TaxCategory = zod_1.default
|
|
10
|
+
.object({
|
|
11
|
+
title: zod_1.default.string(),
|
|
12
|
+
disabled: Boolean_1.ERPNextBoolean,
|
|
13
|
+
country: zod_1.default.string().optional().nullable(),
|
|
14
|
+
custom_type: zod_1.default.enum(["Sales", "Purchase"]),
|
|
15
|
+
})
|
|
16
|
+
.describe("Tax Category");
|
|
@@ -24,7 +24,7 @@ export declare class ERPNextResourceRequest {
|
|
|
24
24
|
resourceId: string;
|
|
25
25
|
resourceModel?: TModel;
|
|
26
26
|
priority?: number;
|
|
27
|
-
}): Promise<Prettify<TModel extends AnyZodObject ? z.infer<DocModelType<TModel>> : any
|
|
27
|
+
}): Promise<Prettify<TModel extends AnyZodObject ? z.infer<DocModelType<TModel>> : any> | undefined>;
|
|
28
28
|
updateById<TModel extends AnyZodObject, TInput extends TInputModel extends undefined ? Partial<z.TypeOf<TModel>> : TInputModel extends ZodTypeAny ? z.TypeOf<TInputModel> : any, TInputModel extends ZodTypeAny | undefined = undefined>({ resourceName, resourceId, inputValidationModel, resourceModel, body, priority, }: {
|
|
29
29
|
resourceName: string;
|
|
30
30
|
resourceId: string;
|
|
@@ -98,7 +98,8 @@ class ERPNextResourceRequest {
|
|
|
98
98
|
throw new Error("Resource model must have a description");
|
|
99
99
|
if (!resourceId)
|
|
100
100
|
throw new Error("Resource id is required");
|
|
101
|
-
const result = yield this.temporalClient
|
|
101
|
+
const result = yield this.temporalClient
|
|
102
|
+
.executeERPNextRequestWorkflow(`GET-${resourceName}-${resourceId}`, {
|
|
102
103
|
requestMethod: "GET",
|
|
103
104
|
resourceName,
|
|
104
105
|
resourceId,
|
|
@@ -107,10 +108,15 @@ class ERPNextResourceRequest {
|
|
|
107
108
|
.object({ data: (0, DocTypeHelpers_1.DocModel)(resourceModel) })
|
|
108
109
|
.describe(resourceName + " Response")
|
|
109
110
|
: undefined,
|
|
110
|
-
}, "erpnext", priority)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
}, "erpnext", priority)
|
|
112
|
+
.catch((err) => {
|
|
113
|
+
if (err.message.includes("Error 404")) {
|
|
114
|
+
logger_1.lg.error(`Resource ${resourceName} with id ${resourceId} not found`);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
throw err;
|
|
118
|
+
});
|
|
119
|
+
return result === null || result === void 0 ? void 0 : result.data;
|
|
114
120
|
});
|
|
115
121
|
}
|
|
116
122
|
updateById(_a) {
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { ERPNextAddress } from "./erpnext/doctypes/address";
|
|
|
4
4
|
import { ERPNextContact } from "./erpnext/doctypes/contact";
|
|
5
5
|
import { ERPNextDeliveryNote } from "./erpnext/doctypes/deliveryNote";
|
|
6
6
|
import { ERPNextItem } from "./erpnext/doctypes/item";
|
|
7
|
+
import { ERPNextPaymentEntry } from "./erpnext/doctypes/paymentEntry";
|
|
7
8
|
import { ERPNextProductBundle } from "./erpnext/doctypes/productBundle";
|
|
8
9
|
import { ERPNextPurchaseInvoice } from "./erpnext/doctypes/purchaseInvoice";
|
|
9
10
|
import { ERPNextPurchaseReceipt } from "./erpnext/doctypes/purchaseReceipt";
|
|
@@ -16,13 +17,14 @@ import { ERPNextDoctypeSubmittableResourceRequest } from "./erpnext/doctypeSubmi
|
|
|
16
17
|
import { ERPNextFileRequests } from "./erpnext/fileRequests";
|
|
17
18
|
import { ERPNextMethodRequest } from "./erpnext/methodRequest";
|
|
18
19
|
import { Compliance } from "./erpnext/model/Compliance";
|
|
20
|
+
import { ConsolidatedCustomsInvoice } from "./erpnext/model/ConsolidatedCustomsInvoice";
|
|
19
21
|
import { Country } from "./erpnext/model/Country";
|
|
20
22
|
import { Customer } from "./erpnext/model/Customer";
|
|
21
23
|
import { ERPNextQueueClientContructorOptions } from "./erpnext/model/ERPNextQueue";
|
|
22
24
|
import { ERPNextFile } from "./erpnext/model/File";
|
|
23
25
|
import { InternalReason } from "./erpnext/model/InternalReasons";
|
|
26
|
+
import { ItemTaxTemplate } from "./erpnext/model/ItemTaxTemplate";
|
|
24
27
|
import { PartList } from "./erpnext/model/PartList";
|
|
25
|
-
import { PaymentEntry } from "./erpnext/model/PaymentEntry";
|
|
26
28
|
import { PurchaseOrder } from "./erpnext/model/PurchaseOrder";
|
|
27
29
|
import { SalesOrder } from "./erpnext/model/SalesOrder";
|
|
28
30
|
import { ServicecaseReason } from "./erpnext/model/ServicecaseReason";
|
|
@@ -33,6 +35,7 @@ import { ShippingProvider } from "./erpnext/model/ShippingProvider";
|
|
|
33
35
|
import { StockEntry } from "./erpnext/model/StockEntry";
|
|
34
36
|
import { StockReconciliation } from "./erpnext/model/StockReconciliation";
|
|
35
37
|
import { Supplier } from "./erpnext/model/Supplier";
|
|
38
|
+
import { TaxCategory } from "./erpnext/model/TaxCategory";
|
|
36
39
|
import { Waitlist } from "./erpnext/model/Waitlist";
|
|
37
40
|
import { ERPNextReports } from "./erpnext/reports";
|
|
38
41
|
import { ERPNextResourceRequest } from "./erpnext/resourceRequest";
|
|
@@ -57,7 +60,7 @@ export declare class ERPNextQueueClient {
|
|
|
57
60
|
waitlist: ERPNextDoctypeResourceRequest<typeof Waitlist>;
|
|
58
61
|
stockEntry: ERPNextDoctypeSubmittableResourceRequest<typeof StockEntry>;
|
|
59
62
|
supplier: ERPNextDoctypeResourceRequest<typeof Supplier>;
|
|
60
|
-
paymentEntry:
|
|
63
|
+
paymentEntry: ERPNextPaymentEntry;
|
|
61
64
|
stockReconciliation: ERPNextDoctypeSubmittableResourceRequest<typeof StockReconciliation>;
|
|
62
65
|
stock: ERPNextStock;
|
|
63
66
|
reports: ERPNextReports;
|
|
@@ -72,6 +75,9 @@ export declare class ERPNextQueueClient {
|
|
|
72
75
|
internalReason: ERPNextDoctypeResourceRequest<typeof InternalReason>;
|
|
73
76
|
shippingLabel: ERPNextDoctypeResourceRequest<typeof ShippingLabel>;
|
|
74
77
|
file: ERPNextDoctypeResourceRequest<typeof ERPNextFile>;
|
|
78
|
+
consolidatedCustomsInvoice: ERPNextDoctypeSubmittableResourceRequest<typeof ConsolidatedCustomsInvoice>;
|
|
79
|
+
itemTaxTemplate: ERPNextDoctypeResourceRequest<typeof ItemTaxTemplate>;
|
|
80
|
+
taxCategory: ERPNextDoctypeResourceRequest<typeof TaxCategory>;
|
|
75
81
|
tags: ERPNextTags;
|
|
76
82
|
/**
|
|
77
83
|
* @description Provide either a temporal client or connection details to create a new client
|