@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/dist/index.js ADDED
@@ -0,0 +1,225 @@
1
+ // src/models.ts
2
+ import {
3
+ datetimeSchema,
4
+ printerDriverSchema,
5
+ printerProtocolSchema,
6
+ printerReceiptProfileSchema,
7
+ sortDirSchema,
8
+ timestampsFilterSchema
9
+ } from "@deliverart/sdk-js-global-types";
10
+ import { pointOfSaleIriSchema } from "@deliverart/sdk-js-point-of-sale";
11
+ import { z } from "zod";
12
+ var printerSchema = z.object({
13
+ id: z.string(),
14
+ pointOfSale: pointOfSaleIriSchema,
15
+ name: z.string(),
16
+ ip: z.ipv4(),
17
+ tls: z.boolean(),
18
+ deviceId: z.string(),
19
+ protocol: printerProtocolSchema,
20
+ driver: printerDriverSchema,
21
+ receiptProfile: printerReceiptProfileSchema,
22
+ createdAt: datetimeSchema,
23
+ updatedAt: datetimeSchema
24
+ });
25
+ var writablePrinterSchema = printerSchema.pick({
26
+ name: true,
27
+ ip: true,
28
+ deviceId: true,
29
+ protocol: true,
30
+ driver: true,
31
+ receiptProfile: true,
32
+ tls: true
33
+ });
34
+ var writableCreatePrinterSchema = printerSchema.pick({
35
+ pointOfSale: true,
36
+ name: true,
37
+ ip: true,
38
+ deviceId: true,
39
+ protocol: true,
40
+ driver: true,
41
+ receiptProfile: true,
42
+ tls: true
43
+ });
44
+ var printersQuerySchema = z.object({
45
+ id: z.union([z.string(), z.array(z.string())]).optional(),
46
+ name: z.string().optional(),
47
+ tls: z.boolean().optional(),
48
+ deviceId: z.union([z.string(), z.array(z.string())]).optional(),
49
+ protocol: z.union([printerProtocolSchema, z.array(printerProtocolSchema)]).optional(),
50
+ driver: z.union([printerDriverSchema, z.array(printerDriverSchema)]).optional(),
51
+ receiptProfile: z.union([printerReceiptProfileSchema, z.array(printerReceiptProfileSchema)]).optional(),
52
+ "order[name]": sortDirSchema.optional(),
53
+ "order[createdAt]": sortDirSchema.optional(),
54
+ "order[updatedAt]": sortDirSchema.optional(),
55
+ page: z.coerce.number().optional()
56
+ }).extend(timestampsFilterSchema.shape);
57
+
58
+ // src/requests/CreatePrinter.ts
59
+ import { AbstractApiRequest } from "@deliverart/sdk-js-core";
60
+ var createPrinterInputSchema = writableCreatePrinterSchema.required();
61
+ var createPrinterResponseSchema = printerSchema;
62
+ var CreatePrinter = class extends AbstractApiRequest {
63
+ constructor(input) {
64
+ super(input);
65
+ this.method = "POST";
66
+ this.contentType = "application/json";
67
+ this.accept = "application/json";
68
+ this.inputSchema = createPrinterInputSchema;
69
+ this.outputSchema = createPrinterResponseSchema;
70
+ this.querySchema = void 0;
71
+ this.headersSchema = void 0;
72
+ }
73
+ getPath() {
74
+ return "/printers";
75
+ }
76
+ };
77
+
78
+ // src/requests/DeletePrinter.ts
79
+ import { AbstractApiRequest as AbstractApiRequest2 } from "@deliverart/sdk-js-core";
80
+ import { emptyResponseSchema } from "@deliverart/sdk-js-global-types";
81
+ import { z as z2 } from "zod";
82
+ var deletePrinterInputSchema = z2.undefined();
83
+ var deletePrinterResponseSchema = emptyResponseSchema;
84
+ var DeletePrinter = class extends AbstractApiRequest2 {
85
+ constructor(printerId) {
86
+ super(void 0);
87
+ this.method = "DELETE";
88
+ this.contentType = "application/json";
89
+ this.accept = "application/json";
90
+ this.inputSchema = deletePrinterInputSchema;
91
+ this.outputSchema = deletePrinterResponseSchema;
92
+ this.querySchema = void 0;
93
+ this.headersSchema = void 0;
94
+ this.printerId = printerId;
95
+ }
96
+ getPath() {
97
+ return `/printers/${this.printerId}`;
98
+ }
99
+ };
100
+
101
+ // src/requests/GetPrinterDetails.ts
102
+ import { AbstractApiRequest as AbstractApiRequest3 } from "@deliverart/sdk-js-core";
103
+ import { z as z3 } from "zod";
104
+ var getPrinterDetailsInputSchema = z3.undefined();
105
+ var getPrinterDetailsResponseSchema = printerSchema;
106
+ var GetPrinterDetails = class extends AbstractApiRequest3 {
107
+ constructor(printerId) {
108
+ super(void 0);
109
+ this.method = "GET";
110
+ this.contentType = "application/json";
111
+ this.accept = "application/json";
112
+ this.inputSchema = getPrinterDetailsInputSchema;
113
+ this.outputSchema = getPrinterDetailsResponseSchema;
114
+ this.querySchema = void 0;
115
+ this.headersSchema = void 0;
116
+ this.printerId = printerId;
117
+ }
118
+ getPath() {
119
+ return `/printers/${this.printerId}`;
120
+ }
121
+ };
122
+
123
+ // src/requests/GetPrinters.ts
124
+ import { AbstractApiRequest as AbstractApiRequest4 } from "@deliverart/sdk-js-core";
125
+ import { createPaginatedSchema } from "@deliverart/sdk-js-global-types";
126
+ import { z as z4 } from "zod";
127
+ var getPrintersQuerySchema = printersQuerySchema;
128
+ var getPrintersInputSchema = z4.undefined();
129
+ var getPrintersResponseSchema = createPaginatedSchema(printerSchema);
130
+ var GetPrinters = class extends AbstractApiRequest4 {
131
+ constructor(options) {
132
+ super(void 0, options);
133
+ this.method = "GET";
134
+ this.contentType = "application/json";
135
+ this.accept = "application/json";
136
+ this.inputSchema = getPrintersInputSchema;
137
+ this.outputSchema = getPrintersResponseSchema;
138
+ this.querySchema = getPrintersQuerySchema;
139
+ this.headersSchema = void 0;
140
+ this.listItemSchema = printerSchema;
141
+ this.paginationDefaultEnabled = true;
142
+ }
143
+ getPath() {
144
+ return "/printers";
145
+ }
146
+ };
147
+
148
+ // src/requests/GetPrintersFromPointOfSale.ts
149
+ import { AbstractApiRequest as AbstractApiRequest5 } from "@deliverart/sdk-js-core";
150
+ import { z as z5 } from "zod";
151
+ var getPrintersFromPointOfSaleQuerySchema = printersQuerySchema;
152
+ var getPrintersFromPointOfSaleInputSchema = z5.undefined();
153
+ var getPrintersFromPointOfSaleResponseSchema = z5.array(printerSchema);
154
+ var GetPrintersFromPointOfSale = class extends AbstractApiRequest5 {
155
+ constructor(pointOfSaleId, options) {
156
+ super(void 0, options);
157
+ this.method = "GET";
158
+ this.contentType = "application/json";
159
+ this.accept = "application/json";
160
+ this.inputSchema = getPrintersFromPointOfSaleInputSchema;
161
+ this.outputSchema = getPrintersFromPointOfSaleResponseSchema;
162
+ this.querySchema = getPrintersFromPointOfSaleQuerySchema;
163
+ this.headersSchema = void 0;
164
+ this.listItemSchema = printerSchema;
165
+ this.paginationDefaultEnabled = false;
166
+ this.pointOfSaleId = pointOfSaleId;
167
+ }
168
+ getPath() {
169
+ return `/point_of_sales/${this.pointOfSaleId}/printers`;
170
+ }
171
+ };
172
+
173
+ // src/requests/UpdatePrinter.ts
174
+ import { AbstractApiRequest as AbstractApiRequest6 } from "@deliverart/sdk-js-core";
175
+ var updatePrinterInputSchema = writablePrinterSchema.partial();
176
+ var updatePrinterResponseSchema = printerSchema;
177
+ var UpdatePrinter = class extends AbstractApiRequest6 {
178
+ constructor(printerId, input) {
179
+ super(input);
180
+ this.method = "PATCH";
181
+ this.contentType = "application/merge-patch+json";
182
+ this.accept = "application/json";
183
+ this.inputSchema = updatePrinterInputSchema;
184
+ this.outputSchema = updatePrinterResponseSchema;
185
+ this.querySchema = void 0;
186
+ this.headersSchema = void 0;
187
+ this.printerId = printerId;
188
+ }
189
+ getPath() {
190
+ return `/printers/${this.printerId}`;
191
+ }
192
+ };
193
+
194
+ // src/types.ts
195
+ import { iriNullableSchema, iriSchema } from "@deliverart/sdk-js-global-types";
196
+ var printerIriSchema = iriSchema("/printers/:id");
197
+ var printerNullableIriSchema = iriNullableSchema("/printers/:id");
198
+ export {
199
+ CreatePrinter,
200
+ DeletePrinter,
201
+ GetPrinterDetails,
202
+ GetPrinters,
203
+ GetPrintersFromPointOfSale,
204
+ UpdatePrinter,
205
+ createPrinterInputSchema,
206
+ createPrinterResponseSchema,
207
+ deletePrinterInputSchema,
208
+ deletePrinterResponseSchema,
209
+ getPrinterDetailsInputSchema,
210
+ getPrinterDetailsResponseSchema,
211
+ getPrintersFromPointOfSaleInputSchema,
212
+ getPrintersFromPointOfSaleQuerySchema,
213
+ getPrintersFromPointOfSaleResponseSchema,
214
+ getPrintersInputSchema,
215
+ getPrintersQuerySchema,
216
+ getPrintersResponseSchema,
217
+ printerIriSchema,
218
+ printerNullableIriSchema,
219
+ printerSchema,
220
+ printersQuerySchema,
221
+ updatePrinterInputSchema,
222
+ updatePrinterResponseSchema,
223
+ writableCreatePrinterSchema,
224
+ writablePrinterSchema
225
+ };
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@deliverart/sdk-js-printer",
3
+ "description": "Deliverart JavaScript SDK for Printer Management",
4
+ "version": "0.0.0-dev-20260721002647",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "tsup": {
9
+ "tsconfig": "./tsconfig.json"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "dependencies": {
21
+ "zod": "4.3.5",
22
+ "@deliverart/sdk-js-core": "0.0.0-dev-20260721002647",
23
+ "@deliverart/sdk-js-global-types": "0.0.0-dev-20260721002647",
24
+ "@deliverart/sdk-js-point-of-sale": "0.0.0-dev-20260721002647"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "scripts": {
30
+ "build": "tsup src/index.ts --dts --format esm,cjs",
31
+ "dev": "tsup src/index.ts --dts --watch"
32
+ }
33
+ }