@deliverart/sdk-js-printer 0.0.0-dev-20260721002647
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/README.md +1 -0
- package/dist/index.cjs +270 -0
- package/dist/index.d.cts +820 -0
- package/dist/index.d.ts +820 -0
- package/dist/index.js +225 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @deliverart/sdk-js-printer
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
CreatePrinter: () => CreatePrinter,
|
|
24
|
+
DeletePrinter: () => DeletePrinter,
|
|
25
|
+
GetPrinterDetails: () => GetPrinterDetails,
|
|
26
|
+
GetPrinters: () => GetPrinters,
|
|
27
|
+
GetPrintersFromPointOfSale: () => GetPrintersFromPointOfSale,
|
|
28
|
+
UpdatePrinter: () => UpdatePrinter,
|
|
29
|
+
createPrinterInputSchema: () => createPrinterInputSchema,
|
|
30
|
+
createPrinterResponseSchema: () => createPrinterResponseSchema,
|
|
31
|
+
deletePrinterInputSchema: () => deletePrinterInputSchema,
|
|
32
|
+
deletePrinterResponseSchema: () => deletePrinterResponseSchema,
|
|
33
|
+
getPrinterDetailsInputSchema: () => getPrinterDetailsInputSchema,
|
|
34
|
+
getPrinterDetailsResponseSchema: () => getPrinterDetailsResponseSchema,
|
|
35
|
+
getPrintersFromPointOfSaleInputSchema: () => getPrintersFromPointOfSaleInputSchema,
|
|
36
|
+
getPrintersFromPointOfSaleQuerySchema: () => getPrintersFromPointOfSaleQuerySchema,
|
|
37
|
+
getPrintersFromPointOfSaleResponseSchema: () => getPrintersFromPointOfSaleResponseSchema,
|
|
38
|
+
getPrintersInputSchema: () => getPrintersInputSchema,
|
|
39
|
+
getPrintersQuerySchema: () => getPrintersQuerySchema,
|
|
40
|
+
getPrintersResponseSchema: () => getPrintersResponseSchema,
|
|
41
|
+
printerIriSchema: () => printerIriSchema,
|
|
42
|
+
printerNullableIriSchema: () => printerNullableIriSchema,
|
|
43
|
+
printerSchema: () => printerSchema,
|
|
44
|
+
printersQuerySchema: () => printersQuerySchema,
|
|
45
|
+
updatePrinterInputSchema: () => updatePrinterInputSchema,
|
|
46
|
+
updatePrinterResponseSchema: () => updatePrinterResponseSchema,
|
|
47
|
+
writableCreatePrinterSchema: () => writableCreatePrinterSchema,
|
|
48
|
+
writablePrinterSchema: () => writablePrinterSchema
|
|
49
|
+
});
|
|
50
|
+
module.exports = __toCommonJS(index_exports);
|
|
51
|
+
|
|
52
|
+
// src/models.ts
|
|
53
|
+
var import_sdk_js_global_types = require("@deliverart/sdk-js-global-types");
|
|
54
|
+
var import_sdk_js_point_of_sale = require("@deliverart/sdk-js-point-of-sale");
|
|
55
|
+
var import_zod = require("zod");
|
|
56
|
+
var printerSchema = import_zod.z.object({
|
|
57
|
+
id: import_zod.z.string(),
|
|
58
|
+
pointOfSale: import_sdk_js_point_of_sale.pointOfSaleIriSchema,
|
|
59
|
+
name: import_zod.z.string(),
|
|
60
|
+
ip: import_zod.z.ipv4(),
|
|
61
|
+
tls: import_zod.z.boolean(),
|
|
62
|
+
deviceId: import_zod.z.string(),
|
|
63
|
+
protocol: import_sdk_js_global_types.printerProtocolSchema,
|
|
64
|
+
driver: import_sdk_js_global_types.printerDriverSchema,
|
|
65
|
+
receiptProfile: import_sdk_js_global_types.printerReceiptProfileSchema,
|
|
66
|
+
createdAt: import_sdk_js_global_types.datetimeSchema,
|
|
67
|
+
updatedAt: import_sdk_js_global_types.datetimeSchema
|
|
68
|
+
});
|
|
69
|
+
var writablePrinterSchema = printerSchema.pick({
|
|
70
|
+
name: true,
|
|
71
|
+
ip: true,
|
|
72
|
+
deviceId: true,
|
|
73
|
+
protocol: true,
|
|
74
|
+
driver: true,
|
|
75
|
+
receiptProfile: true,
|
|
76
|
+
tls: true
|
|
77
|
+
});
|
|
78
|
+
var writableCreatePrinterSchema = printerSchema.pick({
|
|
79
|
+
pointOfSale: true,
|
|
80
|
+
name: true,
|
|
81
|
+
ip: true,
|
|
82
|
+
deviceId: true,
|
|
83
|
+
protocol: true,
|
|
84
|
+
driver: true,
|
|
85
|
+
receiptProfile: true,
|
|
86
|
+
tls: true
|
|
87
|
+
});
|
|
88
|
+
var printersQuerySchema = import_zod.z.object({
|
|
89
|
+
id: import_zod.z.union([import_zod.z.string(), import_zod.z.array(import_zod.z.string())]).optional(),
|
|
90
|
+
name: import_zod.z.string().optional(),
|
|
91
|
+
tls: import_zod.z.boolean().optional(),
|
|
92
|
+
deviceId: import_zod.z.union([import_zod.z.string(), import_zod.z.array(import_zod.z.string())]).optional(),
|
|
93
|
+
protocol: import_zod.z.union([import_sdk_js_global_types.printerProtocolSchema, import_zod.z.array(import_sdk_js_global_types.printerProtocolSchema)]).optional(),
|
|
94
|
+
driver: import_zod.z.union([import_sdk_js_global_types.printerDriverSchema, import_zod.z.array(import_sdk_js_global_types.printerDriverSchema)]).optional(),
|
|
95
|
+
receiptProfile: import_zod.z.union([import_sdk_js_global_types.printerReceiptProfileSchema, import_zod.z.array(import_sdk_js_global_types.printerReceiptProfileSchema)]).optional(),
|
|
96
|
+
"order[name]": import_sdk_js_global_types.sortDirSchema.optional(),
|
|
97
|
+
"order[createdAt]": import_sdk_js_global_types.sortDirSchema.optional(),
|
|
98
|
+
"order[updatedAt]": import_sdk_js_global_types.sortDirSchema.optional(),
|
|
99
|
+
page: import_zod.z.coerce.number().optional()
|
|
100
|
+
}).extend(import_sdk_js_global_types.timestampsFilterSchema.shape);
|
|
101
|
+
|
|
102
|
+
// src/requests/CreatePrinter.ts
|
|
103
|
+
var import_sdk_js_core = require("@deliverart/sdk-js-core");
|
|
104
|
+
var createPrinterInputSchema = writableCreatePrinterSchema.required();
|
|
105
|
+
var createPrinterResponseSchema = printerSchema;
|
|
106
|
+
var CreatePrinter = class extends import_sdk_js_core.AbstractApiRequest {
|
|
107
|
+
constructor(input) {
|
|
108
|
+
super(input);
|
|
109
|
+
this.method = "POST";
|
|
110
|
+
this.contentType = "application/json";
|
|
111
|
+
this.accept = "application/json";
|
|
112
|
+
this.inputSchema = createPrinterInputSchema;
|
|
113
|
+
this.outputSchema = createPrinterResponseSchema;
|
|
114
|
+
this.querySchema = void 0;
|
|
115
|
+
this.headersSchema = void 0;
|
|
116
|
+
}
|
|
117
|
+
getPath() {
|
|
118
|
+
return "/printers";
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// src/requests/DeletePrinter.ts
|
|
123
|
+
var import_sdk_js_core2 = require("@deliverart/sdk-js-core");
|
|
124
|
+
var import_sdk_js_global_types2 = require("@deliverart/sdk-js-global-types");
|
|
125
|
+
var import_zod2 = require("zod");
|
|
126
|
+
var deletePrinterInputSchema = import_zod2.z.undefined();
|
|
127
|
+
var deletePrinterResponseSchema = import_sdk_js_global_types2.emptyResponseSchema;
|
|
128
|
+
var DeletePrinter = class extends import_sdk_js_core2.AbstractApiRequest {
|
|
129
|
+
constructor(printerId) {
|
|
130
|
+
super(void 0);
|
|
131
|
+
this.method = "DELETE";
|
|
132
|
+
this.contentType = "application/json";
|
|
133
|
+
this.accept = "application/json";
|
|
134
|
+
this.inputSchema = deletePrinterInputSchema;
|
|
135
|
+
this.outputSchema = deletePrinterResponseSchema;
|
|
136
|
+
this.querySchema = void 0;
|
|
137
|
+
this.headersSchema = void 0;
|
|
138
|
+
this.printerId = printerId;
|
|
139
|
+
}
|
|
140
|
+
getPath() {
|
|
141
|
+
return `/printers/${this.printerId}`;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// src/requests/GetPrinterDetails.ts
|
|
146
|
+
var import_sdk_js_core3 = require("@deliverart/sdk-js-core");
|
|
147
|
+
var import_zod3 = require("zod");
|
|
148
|
+
var getPrinterDetailsInputSchema = import_zod3.z.undefined();
|
|
149
|
+
var getPrinterDetailsResponseSchema = printerSchema;
|
|
150
|
+
var GetPrinterDetails = class extends import_sdk_js_core3.AbstractApiRequest {
|
|
151
|
+
constructor(printerId) {
|
|
152
|
+
super(void 0);
|
|
153
|
+
this.method = "GET";
|
|
154
|
+
this.contentType = "application/json";
|
|
155
|
+
this.accept = "application/json";
|
|
156
|
+
this.inputSchema = getPrinterDetailsInputSchema;
|
|
157
|
+
this.outputSchema = getPrinterDetailsResponseSchema;
|
|
158
|
+
this.querySchema = void 0;
|
|
159
|
+
this.headersSchema = void 0;
|
|
160
|
+
this.printerId = printerId;
|
|
161
|
+
}
|
|
162
|
+
getPath() {
|
|
163
|
+
return `/printers/${this.printerId}`;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// src/requests/GetPrinters.ts
|
|
168
|
+
var import_sdk_js_core4 = require("@deliverart/sdk-js-core");
|
|
169
|
+
var import_sdk_js_global_types3 = require("@deliverart/sdk-js-global-types");
|
|
170
|
+
var import_zod4 = require("zod");
|
|
171
|
+
var getPrintersQuerySchema = printersQuerySchema;
|
|
172
|
+
var getPrintersInputSchema = import_zod4.z.undefined();
|
|
173
|
+
var getPrintersResponseSchema = (0, import_sdk_js_global_types3.createPaginatedSchema)(printerSchema);
|
|
174
|
+
var GetPrinters = class extends import_sdk_js_core4.AbstractApiRequest {
|
|
175
|
+
constructor(options) {
|
|
176
|
+
super(void 0, options);
|
|
177
|
+
this.method = "GET";
|
|
178
|
+
this.contentType = "application/json";
|
|
179
|
+
this.accept = "application/json";
|
|
180
|
+
this.inputSchema = getPrintersInputSchema;
|
|
181
|
+
this.outputSchema = getPrintersResponseSchema;
|
|
182
|
+
this.querySchema = getPrintersQuerySchema;
|
|
183
|
+
this.headersSchema = void 0;
|
|
184
|
+
this.listItemSchema = printerSchema;
|
|
185
|
+
this.paginationDefaultEnabled = true;
|
|
186
|
+
}
|
|
187
|
+
getPath() {
|
|
188
|
+
return "/printers";
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// src/requests/GetPrintersFromPointOfSale.ts
|
|
193
|
+
var import_sdk_js_core5 = require("@deliverart/sdk-js-core");
|
|
194
|
+
var import_zod5 = require("zod");
|
|
195
|
+
var getPrintersFromPointOfSaleQuerySchema = printersQuerySchema;
|
|
196
|
+
var getPrintersFromPointOfSaleInputSchema = import_zod5.z.undefined();
|
|
197
|
+
var getPrintersFromPointOfSaleResponseSchema = import_zod5.z.array(printerSchema);
|
|
198
|
+
var GetPrintersFromPointOfSale = class extends import_sdk_js_core5.AbstractApiRequest {
|
|
199
|
+
constructor(pointOfSaleId, options) {
|
|
200
|
+
super(void 0, options);
|
|
201
|
+
this.method = "GET";
|
|
202
|
+
this.contentType = "application/json";
|
|
203
|
+
this.accept = "application/json";
|
|
204
|
+
this.inputSchema = getPrintersFromPointOfSaleInputSchema;
|
|
205
|
+
this.outputSchema = getPrintersFromPointOfSaleResponseSchema;
|
|
206
|
+
this.querySchema = getPrintersFromPointOfSaleQuerySchema;
|
|
207
|
+
this.headersSchema = void 0;
|
|
208
|
+
this.listItemSchema = printerSchema;
|
|
209
|
+
this.paginationDefaultEnabled = false;
|
|
210
|
+
this.pointOfSaleId = pointOfSaleId;
|
|
211
|
+
}
|
|
212
|
+
getPath() {
|
|
213
|
+
return `/point_of_sales/${this.pointOfSaleId}/printers`;
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
// src/requests/UpdatePrinter.ts
|
|
218
|
+
var import_sdk_js_core6 = require("@deliverart/sdk-js-core");
|
|
219
|
+
var updatePrinterInputSchema = writablePrinterSchema.partial();
|
|
220
|
+
var updatePrinterResponseSchema = printerSchema;
|
|
221
|
+
var UpdatePrinter = class extends import_sdk_js_core6.AbstractApiRequest {
|
|
222
|
+
constructor(printerId, input) {
|
|
223
|
+
super(input);
|
|
224
|
+
this.method = "PATCH";
|
|
225
|
+
this.contentType = "application/merge-patch+json";
|
|
226
|
+
this.accept = "application/json";
|
|
227
|
+
this.inputSchema = updatePrinterInputSchema;
|
|
228
|
+
this.outputSchema = updatePrinterResponseSchema;
|
|
229
|
+
this.querySchema = void 0;
|
|
230
|
+
this.headersSchema = void 0;
|
|
231
|
+
this.printerId = printerId;
|
|
232
|
+
}
|
|
233
|
+
getPath() {
|
|
234
|
+
return `/printers/${this.printerId}`;
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// src/types.ts
|
|
239
|
+
var import_sdk_js_global_types4 = require("@deliverart/sdk-js-global-types");
|
|
240
|
+
var printerIriSchema = (0, import_sdk_js_global_types4.iriSchema)("/printers/:id");
|
|
241
|
+
var printerNullableIriSchema = (0, import_sdk_js_global_types4.iriNullableSchema)("/printers/:id");
|
|
242
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
243
|
+
0 && (module.exports = {
|
|
244
|
+
CreatePrinter,
|
|
245
|
+
DeletePrinter,
|
|
246
|
+
GetPrinterDetails,
|
|
247
|
+
GetPrinters,
|
|
248
|
+
GetPrintersFromPointOfSale,
|
|
249
|
+
UpdatePrinter,
|
|
250
|
+
createPrinterInputSchema,
|
|
251
|
+
createPrinterResponseSchema,
|
|
252
|
+
deletePrinterInputSchema,
|
|
253
|
+
deletePrinterResponseSchema,
|
|
254
|
+
getPrinterDetailsInputSchema,
|
|
255
|
+
getPrinterDetailsResponseSchema,
|
|
256
|
+
getPrintersFromPointOfSaleInputSchema,
|
|
257
|
+
getPrintersFromPointOfSaleQuerySchema,
|
|
258
|
+
getPrintersFromPointOfSaleResponseSchema,
|
|
259
|
+
getPrintersInputSchema,
|
|
260
|
+
getPrintersQuerySchema,
|
|
261
|
+
getPrintersResponseSchema,
|
|
262
|
+
printerIriSchema,
|
|
263
|
+
printerNullableIriSchema,
|
|
264
|
+
printerSchema,
|
|
265
|
+
printersQuerySchema,
|
|
266
|
+
updatePrinterInputSchema,
|
|
267
|
+
updatePrinterResponseSchema,
|
|
268
|
+
writableCreatePrinterSchema,
|
|
269
|
+
writablePrinterSchema
|
|
270
|
+
});
|