erpnext-queue-client 1.0.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.d.ts +25 -0
- package/dist/client.js +141 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.js +26 -0
- package/dist/erpnext/decryptFromErpNext.server.d.ts +2 -0
- package/dist/erpnext/decryptFromErpNext.server.js +17 -0
- package/dist/erpnext/decryptFromErpNext.server.test.d.ts +1 -0
- package/dist/erpnext/decryptFromErpNext.server.test.js +30 -0
- package/dist/erpnext/erpnextRequestWrapper.d.ts +5 -0
- package/dist/erpnext/erpnextRequestWrapper.js +91 -0
- package/dist/erpnext/erpnextRequests.d.ts +1786 -0
- package/dist/erpnext/erpnextRequests.js +339 -0
- package/dist/erpnext/model/Address.d.ts +349 -0
- package/dist/erpnext/model/Address.js +99 -0
- package/dist/erpnext/model/Contact.d.ts +546 -0
- package/dist/erpnext/model/Contact.js +118 -0
- package/dist/erpnext/model/Country.d.ts +78 -0
- package/dist/erpnext/model/Country.js +30 -0
- package/dist/erpnext/model/Customer.d.ts +99 -0
- package/dist/erpnext/model/Customer.js +42 -0
- package/dist/erpnext/model/DateSchema.d.ts +2 -0
- package/dist/erpnext/model/DateSchema.js +8 -0
- package/dist/erpnext/model/DeliveryNote.d.ts +1648 -0
- package/dist/erpnext/model/DeliveryNote.js +219 -0
- package/dist/erpnext/model/DispatchRun.d.ts +688 -0
- package/dist/erpnext/model/DispatchRun.js +167 -0
- package/dist/erpnext/model/DispatcherPreset.d.ts +159 -0
- package/dist/erpnext/model/DispatcherPreset.js +43 -0
- package/dist/erpnext/model/ERPNextQueue.d.ts +48 -0
- package/dist/erpnext/model/ERPNextQueue.js +5 -0
- package/dist/erpnext/model/ERPNextRequest.d.ts +29 -0
- package/dist/erpnext/model/ERPNextRequest.js +2 -0
- package/dist/erpnext/model/ERPNextResponse.d.ts +17 -0
- package/dist/erpnext/model/ERPNextResponse.js +18 -0
- package/dist/erpnext/model/File.d.ts +146 -0
- package/dist/erpnext/model/File.js +36 -0
- package/dist/erpnext/model/Fulfiller.d.ts +175 -0
- package/dist/erpnext/model/Fulfiller.js +79 -0
- package/dist/erpnext/model/FulfillerSettings.d.ts +130 -0
- package/dist/erpnext/model/FulfillerSettings.js +34 -0
- package/dist/erpnext/model/FulfillmentStation.d.ts +9 -0
- package/dist/erpnext/model/FulfillmentStation.js +9 -0
- package/dist/erpnext/model/Item.d.ts +1710 -0
- package/dist/erpnext/model/Item.js +239 -0
- package/dist/erpnext/model/ProjectedQuantityReport.d.ts +281 -0
- package/dist/erpnext/model/ProjectedQuantityReport.js +72 -0
- package/dist/erpnext/model/PurchaseOrder.d.ts +906 -0
- package/dist/erpnext/model/PurchaseOrder.js +248 -0
- package/dist/erpnext/model/Receipt.d.ts +790 -0
- package/dist/erpnext/model/Receipt.js +212 -0
- package/dist/erpnext/model/ReceiptDraft.d.ts +541 -0
- package/dist/erpnext/model/ReceiptDraft.js +149 -0
- package/dist/erpnext/model/Shipment.d.ts +1139 -0
- package/dist/erpnext/model/Shipment.js +191 -0
- package/dist/erpnext/model/ShippingProvider.d.ts +434 -0
- package/dist/erpnext/model/ShippingProvider.js +204 -0
- package/dist/erpnext/model/StockDict.d.ts +3 -0
- package/dist/erpnext/model/StockDict.js +7 -0
- package/dist/erpnext/model/WarehouseCategory.d.ts +20 -0
- package/dist/erpnext/model/WarehouseCategory.js +15 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -0
- package/dist/utils/fernet.server.d.ts +150 -0
- package/dist/utils/fernet.server.js +344 -0
- package/dist/utils/logger.d.ts +5 -0
- package/dist/utils/logger.js +45 -0
- package/dist/utils/request.d.ts +28 -0
- package/dist/utils/request.js +107 -0
- package/dist/utils/utils.d.ts +4 -0
- package/dist/utils/utils.js +23 -0
- package/dist/utils/zodUtils.d.ts +2 -0
- package/dist/utils/zodUtils.js +17 -0
- package/package.json +32 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DispatchRunMatchesByOrderNumber = exports.DispatchRun = exports.DispatchRunPostFilteredResponse = exports.ERPNextDispatchRunPostBody = exports.ShipstormRun = exports.ERPNextShipstormRun = exports.Trigger = exports.ShipstormRunOptions = exports.ERPNextDispatcherPreset = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const DateSchema_1 = require("./DateSchema");
|
|
6
|
+
// A shipstormRun has ERPNextDispatcherPreset data AND the shipstorm run options
|
|
7
|
+
// Dispatch Run Response from ERPNext
|
|
8
|
+
const DispatcherPresetFulfillerPriority = zod_1.z.object({
|
|
9
|
+
name: zod_1.z.string(),
|
|
10
|
+
owner: zod_1.z.string(),
|
|
11
|
+
creation: DateSchema_1.dateSchema,
|
|
12
|
+
modified: DateSchema_1.dateSchema,
|
|
13
|
+
modified_by: zod_1.z.string(),
|
|
14
|
+
parent: zod_1.z.string(),
|
|
15
|
+
parentfield: zod_1.z.string(),
|
|
16
|
+
parenttype: zod_1.z.string(),
|
|
17
|
+
idx: zod_1.z.number().int(),
|
|
18
|
+
docstatus: zod_1.z.number().int(),
|
|
19
|
+
fulfiller: zod_1.z.string(),
|
|
20
|
+
doctype: zod_1.z.string(),
|
|
21
|
+
});
|
|
22
|
+
// Dispatcher Preset Response from ERPNext
|
|
23
|
+
exports.ERPNextDispatcherPreset = zod_1.z
|
|
24
|
+
.object({
|
|
25
|
+
name: zod_1.z.string(),
|
|
26
|
+
owner: zod_1.z.string(),
|
|
27
|
+
creation: DateSchema_1.dateSchema,
|
|
28
|
+
modified: DateSchema_1.dateSchema,
|
|
29
|
+
modified_by: zod_1.z.string(),
|
|
30
|
+
idx: zod_1.z.number().int(),
|
|
31
|
+
docstatus: zod_1.z.number().int(),
|
|
32
|
+
is_active: zod_1.z.number().transform(Boolean),
|
|
33
|
+
title: zod_1.z.string(),
|
|
34
|
+
fulfiller: zod_1.z.string(),
|
|
35
|
+
doctype: zod_1.z.string(),
|
|
36
|
+
is_simulation_mode: zod_1.z.number().optional().nullable(),
|
|
37
|
+
fulfiller_priority: zod_1.z.array(DispatcherPresetFulfillerPriority),
|
|
38
|
+
})
|
|
39
|
+
.describe("ERPNextDispatcherPreset");
|
|
40
|
+
// Options needed to create a shipstorm run
|
|
41
|
+
exports.ShipstormRunOptions = zod_1.z
|
|
42
|
+
.object({
|
|
43
|
+
dispatcherPresetId: zod_1.z.string(),
|
|
44
|
+
warehouseCategories: zod_1.z.array(zod_1.z.string()).min(0).optional(),
|
|
45
|
+
fulfillmentStation: zod_1.z.string().optional(),
|
|
46
|
+
skus: zod_1.z.array(zod_1.z.string()).min(0).optional(),
|
|
47
|
+
limit: zod_1.z.number().min(1).optional(),
|
|
48
|
+
isAutoBundling: zod_1.z.boolean(),
|
|
49
|
+
strategy: zod_1.z.literal("multiOrder").or(zod_1.z.literal("singleOrder")).optional(),
|
|
50
|
+
orderNumber: zod_1.z.string().optional(),
|
|
51
|
+
})
|
|
52
|
+
.describe("ShipstormRunOptions");
|
|
53
|
+
exports.Trigger = zod_1.z
|
|
54
|
+
.literal("UI")
|
|
55
|
+
.or(zod_1.z.literal("API"))
|
|
56
|
+
.or(zod_1.z.literal("API-TEST"))
|
|
57
|
+
.or(zod_1.z.literal("REAL-DATA-TEST"))
|
|
58
|
+
.or(zod_1.z.literal("SCHEDULE"));
|
|
59
|
+
// A shipstormRun has ERPNextDispatcherPreset data AND the shipstorm run options
|
|
60
|
+
exports.ERPNextShipstormRun = exports.ERPNextDispatcherPreset.omit({
|
|
61
|
+
is_active: true,
|
|
62
|
+
})
|
|
63
|
+
.merge(zod_1.z.object({
|
|
64
|
+
dispatch_run_id: zod_1.z.string(),
|
|
65
|
+
warehouse_categories: zod_1.z.array(zod_1.z.string()).min(0).optional().nullable(),
|
|
66
|
+
fulfillment_station: zod_1.z.string().optional().nullable(),
|
|
67
|
+
items: zod_1.z.array(zod_1.z.string()).min(0).optional(),
|
|
68
|
+
limit: zod_1.z.number().min(1).optional(),
|
|
69
|
+
is_auto_bundling: zod_1.z.number(),
|
|
70
|
+
dispatcher_preset: zod_1.z.string(),
|
|
71
|
+
picking_strategy: zod_1.z
|
|
72
|
+
.literal("Single Order")
|
|
73
|
+
.or(zod_1.z.literal("Multi Order"))
|
|
74
|
+
.optional()
|
|
75
|
+
.nullable(),
|
|
76
|
+
trigger: exports.Trigger,
|
|
77
|
+
order_number: zod_1.z.string().optional().nullable(),
|
|
78
|
+
status: zod_1.z
|
|
79
|
+
.literal("Processing")
|
|
80
|
+
.or(zod_1.z.literal("Failed"))
|
|
81
|
+
.or(zod_1.z.literal("Completed")),
|
|
82
|
+
}))
|
|
83
|
+
.describe("ShipstormRun");
|
|
84
|
+
exports.ShipstormRun = exports.ERPNextShipstormRun.omit({
|
|
85
|
+
name: true,
|
|
86
|
+
creation: true,
|
|
87
|
+
docstatus: true,
|
|
88
|
+
doctype: true,
|
|
89
|
+
idx: true,
|
|
90
|
+
modified: true,
|
|
91
|
+
modified_by: true,
|
|
92
|
+
owner: true,
|
|
93
|
+
}).extend({
|
|
94
|
+
fulfiller_priority: zod_1.z.array(zod_1.z.object({
|
|
95
|
+
fulfiller: zod_1.z.string(),
|
|
96
|
+
})),
|
|
97
|
+
});
|
|
98
|
+
exports.ERPNextDispatchRunPostBody = exports.ERPNextShipstormRun.pick({
|
|
99
|
+
fulfiller: true,
|
|
100
|
+
trigger: true,
|
|
101
|
+
picking_strategy: true,
|
|
102
|
+
is_auto_bundling: true,
|
|
103
|
+
warehouse_categories: true,
|
|
104
|
+
items: true,
|
|
105
|
+
limit: true,
|
|
106
|
+
title: true,
|
|
107
|
+
dispatcher_preset: true,
|
|
108
|
+
})
|
|
109
|
+
.merge(zod_1.z.object({
|
|
110
|
+
fulfiller_priority: zod_1.z.array(zod_1.z.object({
|
|
111
|
+
fulfiller: zod_1.z.string(),
|
|
112
|
+
})),
|
|
113
|
+
}))
|
|
114
|
+
.describe("ERPNextDispatchRunPostBody");
|
|
115
|
+
exports.DispatchRunPostFilteredResponse = zod_1.z
|
|
116
|
+
.object({
|
|
117
|
+
name: zod_1.z.string(),
|
|
118
|
+
})
|
|
119
|
+
.describe("DispatchRunPostFilteredResponse");
|
|
120
|
+
const FulfillerPriority = zod_1.z
|
|
121
|
+
.object({
|
|
122
|
+
name: zod_1.z.string(),
|
|
123
|
+
owner: zod_1.z.string(),
|
|
124
|
+
creation: zod_1.z.string().transform((i) => new Date(i)),
|
|
125
|
+
modified: zod_1.z.string().transform((i) => new Date(i)),
|
|
126
|
+
modified_by: zod_1.z.string(),
|
|
127
|
+
parent: zod_1.z.string(),
|
|
128
|
+
parentfield: zod_1.z.string(),
|
|
129
|
+
parenttype: zod_1.z.string(),
|
|
130
|
+
idx: zod_1.z.number(),
|
|
131
|
+
docstatus: zod_1.z.number(),
|
|
132
|
+
fulfiller: zod_1.z.string(),
|
|
133
|
+
doctype: zod_1.z.string(),
|
|
134
|
+
})
|
|
135
|
+
.describe("WarehousePriority");
|
|
136
|
+
exports.DispatchRun = zod_1.z
|
|
137
|
+
.object({
|
|
138
|
+
name: zod_1.z.string(),
|
|
139
|
+
owner: zod_1.z.string(),
|
|
140
|
+
creation: zod_1.z.string().transform((i) => new Date(i)),
|
|
141
|
+
modified: zod_1.z.string().transform((i) => new Date(i)),
|
|
142
|
+
modified_by: zod_1.z.string(),
|
|
143
|
+
idx: zod_1.z.number(),
|
|
144
|
+
docstatus: zod_1.z.number(),
|
|
145
|
+
title: zod_1.z.string(),
|
|
146
|
+
fulfiller: zod_1.z.string(),
|
|
147
|
+
picking_strategy: zod_1.z.string(),
|
|
148
|
+
limit: zod_1.z.number().optional().nullable(),
|
|
149
|
+
items: zod_1.z.array(zod_1.z.string()).min(0).optional().nullable(),
|
|
150
|
+
warehouse_categories: zod_1.z.array(zod_1.z.string()).min(0).optional().nullable(),
|
|
151
|
+
trigger: zod_1.z.string(),
|
|
152
|
+
doctype: zod_1.z.string(),
|
|
153
|
+
fulfiller_priority: zod_1.z.array(FulfillerPriority),
|
|
154
|
+
is_auto_bundling: zod_1.z.number().transform(Boolean),
|
|
155
|
+
dispatcher_preset: zod_1.z.string(),
|
|
156
|
+
is_simulation_mode: zod_1.z.number(),
|
|
157
|
+
})
|
|
158
|
+
.describe("DispatchRun");
|
|
159
|
+
exports.DispatchRunMatchesByOrderNumber = zod_1.z
|
|
160
|
+
.array(zod_1.z.object({
|
|
161
|
+
name: zod_1.z.string(),
|
|
162
|
+
picking_strategy: zod_1.z.string(),
|
|
163
|
+
order_number: zod_1.z.string(),
|
|
164
|
+
customer_name: zod_1.z.string(),
|
|
165
|
+
status: zod_1.z.enum(["Processing", "Completed", "Failed"]),
|
|
166
|
+
}))
|
|
167
|
+
.describe("DispatchRunMatchesByOrderNumber");
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const DispatcherPresetFulfillerPriority: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
owner: z.ZodString;
|
|
5
|
+
creation: z.ZodEffects<z.ZodDate, Date, unknown>;
|
|
6
|
+
modified: z.ZodEffects<z.ZodDate, Date, unknown>;
|
|
7
|
+
modified_by: z.ZodString;
|
|
8
|
+
parent: z.ZodString;
|
|
9
|
+
parentfield: z.ZodString;
|
|
10
|
+
parenttype: z.ZodString;
|
|
11
|
+
idx: z.ZodNumber;
|
|
12
|
+
docstatus: z.ZodNumber;
|
|
13
|
+
fulfiller: z.ZodString;
|
|
14
|
+
doctype: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
name?: string;
|
|
17
|
+
owner?: string;
|
|
18
|
+
creation?: Date;
|
|
19
|
+
modified?: Date;
|
|
20
|
+
modified_by?: string;
|
|
21
|
+
parent?: string;
|
|
22
|
+
parentfield?: string;
|
|
23
|
+
parenttype?: string;
|
|
24
|
+
idx?: number;
|
|
25
|
+
docstatus?: number;
|
|
26
|
+
doctype?: string;
|
|
27
|
+
fulfiller?: string;
|
|
28
|
+
}, {
|
|
29
|
+
name?: string;
|
|
30
|
+
owner?: string;
|
|
31
|
+
creation?: unknown;
|
|
32
|
+
modified?: unknown;
|
|
33
|
+
modified_by?: string;
|
|
34
|
+
parent?: string;
|
|
35
|
+
parentfield?: string;
|
|
36
|
+
parenttype?: string;
|
|
37
|
+
idx?: number;
|
|
38
|
+
docstatus?: number;
|
|
39
|
+
doctype?: string;
|
|
40
|
+
fulfiller?: string;
|
|
41
|
+
}>;
|
|
42
|
+
export type DispatcherPresetFulfillerPriorityType = z.infer<typeof DispatcherPresetFulfillerPriority>;
|
|
43
|
+
export declare const ERPNextDispatcherPreset: z.ZodObject<{
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
owner: z.ZodString;
|
|
46
|
+
creation: z.ZodEffects<z.ZodDate, Date, unknown>;
|
|
47
|
+
modified: z.ZodEffects<z.ZodDate, Date, unknown>;
|
|
48
|
+
modified_by: z.ZodString;
|
|
49
|
+
idx: z.ZodNumber;
|
|
50
|
+
docstatus: z.ZodNumber;
|
|
51
|
+
is_active: z.ZodEffects<z.ZodNumber, boolean, number>;
|
|
52
|
+
title: z.ZodString;
|
|
53
|
+
fulfiller: z.ZodString;
|
|
54
|
+
doctype: z.ZodString;
|
|
55
|
+
is_simulation_mode: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
56
|
+
fulfiller_priority: z.ZodArray<z.ZodObject<{
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
owner: z.ZodString;
|
|
59
|
+
creation: z.ZodEffects<z.ZodDate, Date, unknown>;
|
|
60
|
+
modified: z.ZodEffects<z.ZodDate, Date, unknown>;
|
|
61
|
+
modified_by: z.ZodString;
|
|
62
|
+
parent: z.ZodString;
|
|
63
|
+
parentfield: z.ZodString;
|
|
64
|
+
parenttype: z.ZodString;
|
|
65
|
+
idx: z.ZodNumber;
|
|
66
|
+
docstatus: z.ZodNumber;
|
|
67
|
+
fulfiller: z.ZodString;
|
|
68
|
+
doctype: z.ZodString;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
name?: string;
|
|
71
|
+
owner?: string;
|
|
72
|
+
creation?: Date;
|
|
73
|
+
modified?: Date;
|
|
74
|
+
modified_by?: string;
|
|
75
|
+
parent?: string;
|
|
76
|
+
parentfield?: string;
|
|
77
|
+
parenttype?: string;
|
|
78
|
+
idx?: number;
|
|
79
|
+
docstatus?: number;
|
|
80
|
+
doctype?: string;
|
|
81
|
+
fulfiller?: string;
|
|
82
|
+
}, {
|
|
83
|
+
name?: string;
|
|
84
|
+
owner?: string;
|
|
85
|
+
creation?: unknown;
|
|
86
|
+
modified?: unknown;
|
|
87
|
+
modified_by?: string;
|
|
88
|
+
parent?: string;
|
|
89
|
+
parentfield?: string;
|
|
90
|
+
parenttype?: string;
|
|
91
|
+
idx?: number;
|
|
92
|
+
docstatus?: number;
|
|
93
|
+
doctype?: string;
|
|
94
|
+
fulfiller?: string;
|
|
95
|
+
}>, "many">;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
name?: string;
|
|
98
|
+
owner?: string;
|
|
99
|
+
creation?: Date;
|
|
100
|
+
modified?: Date;
|
|
101
|
+
modified_by?: string;
|
|
102
|
+
idx?: number;
|
|
103
|
+
docstatus?: number;
|
|
104
|
+
doctype?: string;
|
|
105
|
+
title?: string;
|
|
106
|
+
fulfiller?: string;
|
|
107
|
+
is_active?: boolean;
|
|
108
|
+
is_simulation_mode?: number;
|
|
109
|
+
fulfiller_priority?: {
|
|
110
|
+
name?: string;
|
|
111
|
+
owner?: string;
|
|
112
|
+
creation?: Date;
|
|
113
|
+
modified?: Date;
|
|
114
|
+
modified_by?: string;
|
|
115
|
+
parent?: string;
|
|
116
|
+
parentfield?: string;
|
|
117
|
+
parenttype?: string;
|
|
118
|
+
idx?: number;
|
|
119
|
+
docstatus?: number;
|
|
120
|
+
doctype?: string;
|
|
121
|
+
fulfiller?: string;
|
|
122
|
+
}[];
|
|
123
|
+
}, {
|
|
124
|
+
name?: string;
|
|
125
|
+
owner?: string;
|
|
126
|
+
creation?: unknown;
|
|
127
|
+
modified?: unknown;
|
|
128
|
+
modified_by?: string;
|
|
129
|
+
idx?: number;
|
|
130
|
+
docstatus?: number;
|
|
131
|
+
doctype?: string;
|
|
132
|
+
title?: string;
|
|
133
|
+
fulfiller?: string;
|
|
134
|
+
is_active?: number;
|
|
135
|
+
is_simulation_mode?: number;
|
|
136
|
+
fulfiller_priority?: {
|
|
137
|
+
name?: string;
|
|
138
|
+
owner?: string;
|
|
139
|
+
creation?: unknown;
|
|
140
|
+
modified?: unknown;
|
|
141
|
+
modified_by?: string;
|
|
142
|
+
parent?: string;
|
|
143
|
+
parentfield?: string;
|
|
144
|
+
parenttype?: string;
|
|
145
|
+
idx?: number;
|
|
146
|
+
docstatus?: number;
|
|
147
|
+
doctype?: string;
|
|
148
|
+
fulfiller?: string;
|
|
149
|
+
}[];
|
|
150
|
+
}>;
|
|
151
|
+
export type DispatcherPresetType = z.infer<typeof ERPNextDispatcherPreset>;
|
|
152
|
+
export declare const ERPNextDispatcherPresetList: z.ZodArray<z.ZodObject<{
|
|
153
|
+
name: z.ZodString;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
name?: string;
|
|
156
|
+
}, {
|
|
157
|
+
name?: string;
|
|
158
|
+
}>, "many">;
|
|
159
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERPNextDispatcherPresetList = exports.ERPNextDispatcherPreset = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const DateSchema_1 = require("./DateSchema");
|
|
6
|
+
const DispatcherPresetFulfillerPriority = zod_1.z.object({
|
|
7
|
+
name: zod_1.z.string(),
|
|
8
|
+
owner: zod_1.z.string(),
|
|
9
|
+
creation: DateSchema_1.dateSchema,
|
|
10
|
+
modified: DateSchema_1.dateSchema,
|
|
11
|
+
modified_by: zod_1.z.string(),
|
|
12
|
+
parent: zod_1.z.string(),
|
|
13
|
+
parentfield: zod_1.z.string(),
|
|
14
|
+
parenttype: zod_1.z.string(),
|
|
15
|
+
idx: zod_1.z.number().int(),
|
|
16
|
+
docstatus: zod_1.z.number().int(),
|
|
17
|
+
fulfiller: zod_1.z.string(),
|
|
18
|
+
doctype: zod_1.z.string(),
|
|
19
|
+
});
|
|
20
|
+
// Dispatcher Preset Response from ERPNext
|
|
21
|
+
exports.ERPNextDispatcherPreset = zod_1.z
|
|
22
|
+
.object({
|
|
23
|
+
name: zod_1.z.string(),
|
|
24
|
+
owner: zod_1.z.string(),
|
|
25
|
+
creation: DateSchema_1.dateSchema,
|
|
26
|
+
modified: DateSchema_1.dateSchema,
|
|
27
|
+
modified_by: zod_1.z.string(),
|
|
28
|
+
idx: zod_1.z.number().int(),
|
|
29
|
+
docstatus: zod_1.z.number().int(),
|
|
30
|
+
is_active: zod_1.z.number().transform(Boolean),
|
|
31
|
+
title: zod_1.z.string(),
|
|
32
|
+
fulfiller: zod_1.z.string(),
|
|
33
|
+
doctype: zod_1.z.string(),
|
|
34
|
+
is_simulation_mode: zod_1.z.number().optional().nullable(),
|
|
35
|
+
fulfiller_priority: zod_1.z.array(DispatcherPresetFulfillerPriority),
|
|
36
|
+
})
|
|
37
|
+
.describe("ERPNextDispatcherPreset");
|
|
38
|
+
// Dispatcher Preset Response from ERPNext
|
|
39
|
+
exports.ERPNextDispatcherPresetList = zod_1.z
|
|
40
|
+
.array(zod_1.z.object({
|
|
41
|
+
name: zod_1.z.string(),
|
|
42
|
+
}))
|
|
43
|
+
.describe("ERPNextDispatcherPresetList");
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Client } from "@temporalio/client";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export interface ERPNextQueueClientContructorOptions {
|
|
4
|
+
/**
|
|
5
|
+
* @description You can provide either an existing temporal client or temporalCredentials to initialize a new one.
|
|
6
|
+
*/
|
|
7
|
+
client?: Client;
|
|
8
|
+
/**
|
|
9
|
+
* @description You can provide either temporalCredentials or an existing temporal client.
|
|
10
|
+
*/
|
|
11
|
+
temporalCredentials?: {
|
|
12
|
+
temporalHost?: string;
|
|
13
|
+
temporalCert?: string;
|
|
14
|
+
temporalKey?: string;
|
|
15
|
+
temporalNamespace?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @description Downloading and uploading files requires a direct connection to ERPNext
|
|
19
|
+
* Please provide the credentials to enable features related to file transfers to or from ERPNext
|
|
20
|
+
*/
|
|
21
|
+
erpnextCredentials?: ERPNextCredentials;
|
|
22
|
+
}
|
|
23
|
+
export interface ERPNextCredentials {
|
|
24
|
+
erpnextUrl: string;
|
|
25
|
+
erpnextApiKey: string;
|
|
26
|
+
erpnextApiSecret: string;
|
|
27
|
+
/**
|
|
28
|
+
* @description The ERPNext encryption key is needed when trying to decrypt passwords from ERPNext
|
|
29
|
+
* using the decryptFromErpNext() function. Make sure to set this if you need this functionality.
|
|
30
|
+
*/
|
|
31
|
+
erpnextEncryptionKey?: string;
|
|
32
|
+
/**
|
|
33
|
+
* @description Cloudflare Access credentials are needed when trying to access ERPNext through Cloudflare Access
|
|
34
|
+
*/
|
|
35
|
+
cloudflareAccessClientId?: string;
|
|
36
|
+
/**
|
|
37
|
+
* @description Cloudflare Access credentials are needed when trying to access ERPNext through Cloudflare Access
|
|
38
|
+
*/
|
|
39
|
+
cloudflareAccessClientSecret?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface TemporalClientOptions {
|
|
42
|
+
temporalHost?: string;
|
|
43
|
+
temporalCert?: string;
|
|
44
|
+
temporalKey?: string;
|
|
45
|
+
temporalNamespace?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare const ERPNextQueue: z.ZodLiteral<"erpnext">;
|
|
48
|
+
export type ERPNextQueueType = z.infer<typeof ERPNextQueue>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TypeOf, ZodTypeAny } from "zod";
|
|
2
|
+
export interface ERPNextRequestOptions<T extends ZodTypeAny, K extends ZodTypeAny> {
|
|
3
|
+
url?: string;
|
|
4
|
+
/**
|
|
5
|
+
* In case of a resource route: the type of resource to be called
|
|
6
|
+
*/
|
|
7
|
+
resourceName?: string;
|
|
8
|
+
/**
|
|
9
|
+
* In case of a resource route: the id of the resource to be called or undefined for list calls
|
|
10
|
+
*/
|
|
11
|
+
resourceId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The method name to be called
|
|
14
|
+
*/
|
|
15
|
+
methodName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Custom URI to be called, baseUrl will be prepended
|
|
18
|
+
*/
|
|
19
|
+
uri?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Custom params to be appended to the URI, starting with a question mark
|
|
22
|
+
*/
|
|
23
|
+
params?: string;
|
|
24
|
+
requestMethod: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
25
|
+
responseValidationModel: T | false;
|
|
26
|
+
inputValidationModel?: K | false;
|
|
27
|
+
body?: TypeOf<K>;
|
|
28
|
+
headers?: Record<string, string>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ERPNextResourceResponse: z.ZodObject<{
|
|
3
|
+
data: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">, z.ZodArray<z.ZodTuple<[z.ZodString], null>, "many">]>;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
data?: Record<string, unknown> | Record<string, unknown>[] | [string, ...unknown[]][];
|
|
6
|
+
}, {
|
|
7
|
+
data?: Record<string, unknown> | Record<string, unknown>[] | [string, ...unknown[]][];
|
|
8
|
+
}>;
|
|
9
|
+
export type ERPNextResourceResponseType = z.infer<typeof ERPNextResourceResponse>;
|
|
10
|
+
export declare const ERPNextMethodResponse: z.ZodObject<{
|
|
11
|
+
message: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">]>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
message?: Record<string, unknown> | Record<string, unknown>[];
|
|
14
|
+
}, {
|
|
15
|
+
message?: Record<string, unknown> | Record<string, unknown>[];
|
|
16
|
+
}>;
|
|
17
|
+
export type ERPNextMethodResponseType = z.infer<typeof ERPNextMethodResponse>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERPNextMethodResponse = exports.ERPNextResourceResponse = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ERPNextResourceResponse = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
data: zod_1.z.union([
|
|
8
|
+
zod_1.z.record(zod_1.z.unknown()),
|
|
9
|
+
zod_1.z.array(zod_1.z.record(zod_1.z.unknown())),
|
|
10
|
+
zod_1.z.array(zod_1.z.tuple([zod_1.z.string()])), // for query param option: as_dict=False
|
|
11
|
+
]),
|
|
12
|
+
})
|
|
13
|
+
.describe("ERPNextResourceResponse");
|
|
14
|
+
exports.ERPNextMethodResponse = zod_1.z
|
|
15
|
+
.object({
|
|
16
|
+
message: zod_1.z.union([zod_1.z.record(zod_1.z.unknown()), zod_1.z.array(zod_1.z.record(zod_1.z.unknown()))]),
|
|
17
|
+
})
|
|
18
|
+
.describe("ERPNextMethodResponse");
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ERPNextFile: 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
|
+
file_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
11
|
+
is_private: z.ZodNumber;
|
|
12
|
+
is_home_folder: z.ZodNumber;
|
|
13
|
+
is_attachments_folder: z.ZodNumber;
|
|
14
|
+
file_size: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
15
|
+
file_url: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
16
|
+
folder: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
17
|
+
is_folder: z.ZodNumber;
|
|
18
|
+
attached_to_doctype: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
19
|
+
attached_to_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
20
|
+
content_hash: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
21
|
+
s3_file_key: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
22
|
+
uploaded_to_dropbox: z.ZodNumber;
|
|
23
|
+
uploaded_to_google_drive: z.ZodNumber;
|
|
24
|
+
doctype: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
name?: string;
|
|
27
|
+
owner?: string;
|
|
28
|
+
creation?: string;
|
|
29
|
+
modified?: string;
|
|
30
|
+
modified_by?: string;
|
|
31
|
+
idx?: number;
|
|
32
|
+
docstatus?: number;
|
|
33
|
+
doctype?: string;
|
|
34
|
+
file_name?: string;
|
|
35
|
+
is_private?: number;
|
|
36
|
+
is_home_folder?: number;
|
|
37
|
+
is_attachments_folder?: number;
|
|
38
|
+
file_size?: number;
|
|
39
|
+
file_url?: string;
|
|
40
|
+
folder?: string;
|
|
41
|
+
is_folder?: number;
|
|
42
|
+
attached_to_doctype?: string;
|
|
43
|
+
attached_to_name?: string;
|
|
44
|
+
content_hash?: string;
|
|
45
|
+
s3_file_key?: string;
|
|
46
|
+
uploaded_to_dropbox?: number;
|
|
47
|
+
uploaded_to_google_drive?: number;
|
|
48
|
+
}, {
|
|
49
|
+
name?: string;
|
|
50
|
+
owner?: string;
|
|
51
|
+
creation?: string;
|
|
52
|
+
modified?: string;
|
|
53
|
+
modified_by?: string;
|
|
54
|
+
idx?: number;
|
|
55
|
+
docstatus?: number;
|
|
56
|
+
doctype?: string;
|
|
57
|
+
file_name?: string;
|
|
58
|
+
is_private?: number;
|
|
59
|
+
is_home_folder?: number;
|
|
60
|
+
is_attachments_folder?: number;
|
|
61
|
+
file_size?: number;
|
|
62
|
+
file_url?: string;
|
|
63
|
+
folder?: string;
|
|
64
|
+
is_folder?: number;
|
|
65
|
+
attached_to_doctype?: string;
|
|
66
|
+
attached_to_name?: string;
|
|
67
|
+
content_hash?: string;
|
|
68
|
+
s3_file_key?: string;
|
|
69
|
+
uploaded_to_dropbox?: number;
|
|
70
|
+
uploaded_to_google_drive?: number;
|
|
71
|
+
}>;
|
|
72
|
+
export type ERPNextFileType = z.infer<typeof ERPNextFile>;
|
|
73
|
+
export declare const ERPNextValidatedFile: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
owner: z.ZodString;
|
|
76
|
+
creation: z.ZodString;
|
|
77
|
+
modified: z.ZodString;
|
|
78
|
+
modified_by: z.ZodString;
|
|
79
|
+
idx: z.ZodNumber;
|
|
80
|
+
docstatus: z.ZodNumber;
|
|
81
|
+
file_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
82
|
+
is_private: z.ZodNumber;
|
|
83
|
+
is_home_folder: z.ZodNumber;
|
|
84
|
+
is_attachments_folder: z.ZodNumber;
|
|
85
|
+
file_size: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
86
|
+
file_url: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
87
|
+
folder: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
88
|
+
is_folder: z.ZodNumber;
|
|
89
|
+
attached_to_doctype: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
90
|
+
attached_to_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
91
|
+
content_hash: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
92
|
+
s3_file_key: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
93
|
+
uploaded_to_dropbox: z.ZodNumber;
|
|
94
|
+
uploaded_to_google_drive: z.ZodNumber;
|
|
95
|
+
doctype: z.ZodString;
|
|
96
|
+
}, "file_name" | "file_url">, {
|
|
97
|
+
file_name: z.ZodString;
|
|
98
|
+
file_url: z.ZodString;
|
|
99
|
+
}>, "strip", z.ZodTypeAny, {
|
|
100
|
+
name?: string;
|
|
101
|
+
owner?: string;
|
|
102
|
+
creation?: string;
|
|
103
|
+
modified?: string;
|
|
104
|
+
modified_by?: string;
|
|
105
|
+
idx?: number;
|
|
106
|
+
docstatus?: number;
|
|
107
|
+
doctype?: string;
|
|
108
|
+
file_name?: string;
|
|
109
|
+
is_private?: number;
|
|
110
|
+
is_home_folder?: number;
|
|
111
|
+
is_attachments_folder?: number;
|
|
112
|
+
file_size?: number;
|
|
113
|
+
file_url?: string;
|
|
114
|
+
folder?: string;
|
|
115
|
+
is_folder?: number;
|
|
116
|
+
attached_to_doctype?: string;
|
|
117
|
+
attached_to_name?: string;
|
|
118
|
+
content_hash?: string;
|
|
119
|
+
s3_file_key?: string;
|
|
120
|
+
uploaded_to_dropbox?: number;
|
|
121
|
+
uploaded_to_google_drive?: number;
|
|
122
|
+
}, {
|
|
123
|
+
name?: string;
|
|
124
|
+
owner?: string;
|
|
125
|
+
creation?: string;
|
|
126
|
+
modified?: string;
|
|
127
|
+
modified_by?: string;
|
|
128
|
+
idx?: number;
|
|
129
|
+
docstatus?: number;
|
|
130
|
+
doctype?: string;
|
|
131
|
+
file_name?: string;
|
|
132
|
+
is_private?: number;
|
|
133
|
+
is_home_folder?: number;
|
|
134
|
+
is_attachments_folder?: number;
|
|
135
|
+
file_size?: number;
|
|
136
|
+
file_url?: string;
|
|
137
|
+
folder?: string;
|
|
138
|
+
is_folder?: number;
|
|
139
|
+
attached_to_doctype?: string;
|
|
140
|
+
attached_to_name?: string;
|
|
141
|
+
content_hash?: string;
|
|
142
|
+
s3_file_key?: string;
|
|
143
|
+
uploaded_to_dropbox?: number;
|
|
144
|
+
uploaded_to_google_drive?: number;
|
|
145
|
+
}>;
|
|
146
|
+
export type ERPNextValidatedFileType = z.infer<typeof ERPNextValidatedFile>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERPNextValidatedFile = exports.ERPNextFile = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ERPNextFile = 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
|
+
file_name: zod_1.z.string().optional().nullable(),
|
|
15
|
+
is_private: zod_1.z.number(),
|
|
16
|
+
is_home_folder: zod_1.z.number(),
|
|
17
|
+
is_attachments_folder: zod_1.z.number(),
|
|
18
|
+
file_size: zod_1.z.number().optional().nullable(),
|
|
19
|
+
file_url: zod_1.z.string().optional().nullable(),
|
|
20
|
+
folder: zod_1.z.string().optional().nullable(),
|
|
21
|
+
is_folder: zod_1.z.number(),
|
|
22
|
+
attached_to_doctype: zod_1.z.string().optional().nullable(),
|
|
23
|
+
attached_to_name: zod_1.z.string().optional().nullable(),
|
|
24
|
+
content_hash: zod_1.z.string().optional().nullable(),
|
|
25
|
+
s3_file_key: zod_1.z.string().optional().nullable(),
|
|
26
|
+
uploaded_to_dropbox: zod_1.z.number(),
|
|
27
|
+
uploaded_to_google_drive: zod_1.z.number(),
|
|
28
|
+
doctype: zod_1.z.string(),
|
|
29
|
+
})
|
|
30
|
+
.describe("ERPNextFile");
|
|
31
|
+
exports.ERPNextValidatedFile = exports.ERPNextFile.omit({
|
|
32
|
+
file_name: true,
|
|
33
|
+
file_url: true,
|
|
34
|
+
})
|
|
35
|
+
.extend({ file_name: zod_1.z.string(), file_url: zod_1.z.string() })
|
|
36
|
+
.describe("ERPNextFile");
|