@meerkapp/wms-contracts 0.3.0-beta.13 → 0.3.0-beta.15
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.cjs +380 -169
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1179 -545
- package/dist/index.d.ts +1179 -545
- package/dist/index.js +517 -325
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ __export(index_exports, {
|
|
|
43
43
|
CreateProductTypeSchema: () => CreateProductTypeSchema,
|
|
44
44
|
CreateRoleSchema: () => CreateRoleSchema,
|
|
45
45
|
CreateWarehouseSchema: () => CreateWarehouseSchema,
|
|
46
|
+
CurrencyCodeSchema: () => CurrencyCodeSchema,
|
|
46
47
|
EmployeeRoleSchema: () => EmployeeRoleSchema,
|
|
47
48
|
EmployeeSchema: () => EmployeeSchema,
|
|
48
49
|
FolderSchema: () => FolderSchema,
|
|
@@ -50,32 +51,50 @@ __export(index_exports, {
|
|
|
50
51
|
LoginSchema: () => LoginSchema,
|
|
51
52
|
OrganizationSchema: () => OrganizationSchema,
|
|
52
53
|
PaginationQuerySchema: () => PaginationQuerySchema,
|
|
54
|
+
PriceListAssignmentSchema: () => PriceListAssignmentSchema,
|
|
53
55
|
PriceListSchema: () => PriceListSchema,
|
|
56
|
+
PriceListSummarySchema: () => PriceListSummarySchema,
|
|
54
57
|
ProductBarcodeSchema: () => ProductBarcodeSchema,
|
|
55
58
|
ProductBrandSchema: () => ProductBrandSchema,
|
|
56
59
|
ProductCollectionSchema: () => ProductCollectionSchema,
|
|
57
60
|
ProductItemSchema: () => ProductItemSchema,
|
|
61
|
+
ProductItemStatsChangePayloadSchema: () => ProductItemStatsChangePayloadSchema,
|
|
62
|
+
ProductItemStatsFetchQuerySchema: () => ProductItemStatsFetchQuerySchema,
|
|
63
|
+
ProductItemStatsFetchResponseSchema: () => ProductItemStatsFetchResponseSchema,
|
|
58
64
|
ProductItemStatsQuerySchema: () => ProductItemStatsQuerySchema,
|
|
59
65
|
ProductItemStatsSchema: () => ProductItemStatsSchema,
|
|
66
|
+
ProductItemStatsSocketPayloadSchema: () => ProductItemStatsSocketPayloadSchema,
|
|
60
67
|
ProductItemWithRelationsSchema: () => ProductItemWithRelationsSchema,
|
|
61
68
|
ProductMeasureSchema: () => ProductMeasureSchema,
|
|
62
69
|
ProductPackageSchema: () => ProductPackageSchema,
|
|
70
|
+
ProductPriceInputSchema: () => ProductPriceInputSchema,
|
|
71
|
+
ProductPriceSchema: () => ProductPriceSchema,
|
|
63
72
|
ProductShipmentSchema: () => ProductShipmentSchema,
|
|
64
73
|
ProductTypeSchema: () => ProductTypeSchema,
|
|
65
74
|
RolePermissionItemSchema: () => RolePermissionItemSchema,
|
|
66
75
|
RoleSchema: () => RoleSchema,
|
|
76
|
+
SYNC_TABLE_NAMES: () => SYNC_TABLE_NAMES,
|
|
77
|
+
SetPriceListAssignmentsSchema: () => SetPriceListAssignmentsSchema,
|
|
67
78
|
SetupInitSchema: () => SetupInitSchema,
|
|
79
|
+
SyncCursorSchema: () => SyncCursorSchema,
|
|
80
|
+
SyncEntityIdSchema: () => SyncEntityIdSchema,
|
|
81
|
+
SyncTableNameSchema: () => SyncTableNameSchema,
|
|
68
82
|
UpdateEmployeeSchema: () => UpdateEmployeeSchema,
|
|
69
83
|
UpdateFolderSchema: () => UpdateFolderSchema,
|
|
70
84
|
UpdateOrganizationSchema: () => UpdateOrganizationSchema,
|
|
71
85
|
UpdateOwnPasswordSchema: () => UpdateOwnPasswordSchema,
|
|
72
86
|
UpdateOwnProfileSchema: () => UpdateOwnProfileSchema,
|
|
87
|
+
UpdatePriceListPricesSchema: () => UpdatePriceListPricesSchema,
|
|
73
88
|
UpdatePriceListSchema: () => UpdatePriceListSchema,
|
|
74
89
|
UpdateProductCollectionSchema: () => UpdateProductCollectionSchema,
|
|
75
90
|
UpdateProductTypeSchema: () => UpdateProductTypeSchema,
|
|
76
91
|
UpdateRoleSchema: () => UpdateRoleSchema,
|
|
77
92
|
UpdateWarehouseSchema: () => UpdateWarehouseSchema,
|
|
78
|
-
WarehouseSchema: () => WarehouseSchema
|
|
93
|
+
WarehouseSchema: () => WarehouseSchema,
|
|
94
|
+
createSyncChangePayloadSchema: () => createSyncChangePayloadSchema,
|
|
95
|
+
createSyncFetchResponseSchema: () => createSyncFetchResponseSchema,
|
|
96
|
+
createSyncSocketPayloadSchema: () => createSyncSocketPayloadSchema,
|
|
97
|
+
getCurrencyMinorUnits: () => getCurrencyMinorUnits
|
|
79
98
|
});
|
|
80
99
|
module.exports = __toCommonJS(index_exports);
|
|
81
100
|
|
|
@@ -86,6 +105,40 @@ var PaginationQuerySchema = import_zod.z.object({
|
|
|
86
105
|
limit: import_zod.z.coerce.number().int().min(1).max(100).default(20)
|
|
87
106
|
});
|
|
88
107
|
|
|
108
|
+
// src/generated/schemas/enums/CurrencyCode.schema.ts
|
|
109
|
+
var z2 = __toESM(require("zod"), 1);
|
|
110
|
+
var CurrencyCodeSchema = z2.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLE", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VES", "VND", "VUV", "WST", "XAF", "XCD", "XOF", "XPF", "YER", "ZAR", "ZMW", "ZWL"]);
|
|
111
|
+
|
|
112
|
+
// src/common/currency/index.ts
|
|
113
|
+
var MINOR_UNIT_OVERRIDES = {
|
|
114
|
+
BHD: 3,
|
|
115
|
+
BIF: 0,
|
|
116
|
+
CLP: 0,
|
|
117
|
+
DJF: 0,
|
|
118
|
+
GNF: 0,
|
|
119
|
+
IQD: 3,
|
|
120
|
+
ISK: 0,
|
|
121
|
+
JOD: 3,
|
|
122
|
+
JPY: 0,
|
|
123
|
+
KMF: 0,
|
|
124
|
+
KRW: 0,
|
|
125
|
+
KWD: 3,
|
|
126
|
+
LYD: 3,
|
|
127
|
+
OMR: 3,
|
|
128
|
+
PYG: 0,
|
|
129
|
+
RWF: 0,
|
|
130
|
+
TND: 3,
|
|
131
|
+
UGX: 0,
|
|
132
|
+
VND: 0,
|
|
133
|
+
VUV: 0,
|
|
134
|
+
XAF: 0,
|
|
135
|
+
XOF: 0,
|
|
136
|
+
XPF: 0
|
|
137
|
+
};
|
|
138
|
+
function getCurrencyMinorUnits(currency) {
|
|
139
|
+
return MINOR_UNIT_OVERRIDES[currency] ?? 2;
|
|
140
|
+
}
|
|
141
|
+
|
|
89
142
|
// src/modules/auth/index.ts
|
|
90
143
|
var import_zod2 = require("zod");
|
|
91
144
|
var ALL_PERMISSIONS = [
|
|
@@ -143,14 +196,14 @@ var SetupInitSchema = import_zod2.z.object({
|
|
|
143
196
|
var import_zod3 = require("zod");
|
|
144
197
|
|
|
145
198
|
// src/generated/schemas/variants/pure/Organization.pure.ts
|
|
146
|
-
var
|
|
147
|
-
var OrganizationModelSchema =
|
|
148
|
-
id:
|
|
149
|
-
name:
|
|
150
|
-
website:
|
|
151
|
-
updatedAt:
|
|
152
|
-
warehouses:
|
|
153
|
-
priceListAssignments:
|
|
199
|
+
var z4 = __toESM(require("zod"), 1);
|
|
200
|
+
var OrganizationModelSchema = z4.object({
|
|
201
|
+
id: z4.number().int(),
|
|
202
|
+
name: z4.string(),
|
|
203
|
+
website: z4.string().nullable(),
|
|
204
|
+
updatedAt: z4.date(),
|
|
205
|
+
warehouses: z4.array(z4.unknown()),
|
|
206
|
+
priceListAssignments: z4.array(z4.unknown())
|
|
154
207
|
}).strict();
|
|
155
208
|
|
|
156
209
|
// src/modules/organization/index.ts
|
|
@@ -165,20 +218,21 @@ var OrganizationSchema = OrganizationModelSchema.omit({ warehouses: true }).exte
|
|
|
165
218
|
var import_zod4 = require("zod");
|
|
166
219
|
|
|
167
220
|
// src/generated/schemas/variants/pure/Warehouse.pure.ts
|
|
168
|
-
var
|
|
169
|
-
var WarehouseModelSchema =
|
|
170
|
-
id:
|
|
171
|
-
address:
|
|
172
|
-
note:
|
|
173
|
-
code:
|
|
174
|
-
organizationId:
|
|
175
|
-
localityId:
|
|
176
|
-
updatedAt:
|
|
177
|
-
organization:
|
|
178
|
-
locality:
|
|
179
|
-
employees:
|
|
180
|
-
shipments:
|
|
181
|
-
priceListAssignments:
|
|
221
|
+
var z6 = __toESM(require("zod"), 1);
|
|
222
|
+
var WarehouseModelSchema = z6.object({
|
|
223
|
+
id: z6.number().int(),
|
|
224
|
+
address: z6.string(),
|
|
225
|
+
note: z6.string().nullable(),
|
|
226
|
+
code: z6.string(),
|
|
227
|
+
organizationId: z6.number().int(),
|
|
228
|
+
localityId: z6.number().int(),
|
|
229
|
+
updatedAt: z6.date(),
|
|
230
|
+
organization: z6.unknown(),
|
|
231
|
+
locality: z6.unknown(),
|
|
232
|
+
employees: z6.array(z6.unknown()),
|
|
233
|
+
shipments: z6.array(z6.unknown()),
|
|
234
|
+
priceListAssignments: z6.array(z6.unknown()),
|
|
235
|
+
stats: z6.array(z6.unknown())
|
|
182
236
|
}).strict();
|
|
183
237
|
|
|
184
238
|
// src/modules/warehouse/index.ts
|
|
@@ -196,15 +250,15 @@ var WarehouseSchema = WarehouseModelSchema.omit({ organization: true, locality:
|
|
|
196
250
|
var import_zod5 = require("zod");
|
|
197
251
|
|
|
198
252
|
// src/generated/schemas/variants/pure/Locality.pure.ts
|
|
199
|
-
var
|
|
200
|
-
var LocalityModelSchema =
|
|
201
|
-
id:
|
|
202
|
-
name:
|
|
203
|
-
countryId:
|
|
204
|
-
updatedAt:
|
|
205
|
-
country:
|
|
206
|
-
warehouses:
|
|
207
|
-
priceListAssignments:
|
|
253
|
+
var z8 = __toESM(require("zod"), 1);
|
|
254
|
+
var LocalityModelSchema = z8.object({
|
|
255
|
+
id: z8.number().int(),
|
|
256
|
+
name: z8.string(),
|
|
257
|
+
countryId: z8.number().int(),
|
|
258
|
+
updatedAt: z8.date(),
|
|
259
|
+
country: z8.unknown(),
|
|
260
|
+
warehouses: z8.array(z8.unknown()),
|
|
261
|
+
priceListAssignments: z8.array(z8.unknown())
|
|
208
262
|
}).strict();
|
|
209
263
|
|
|
210
264
|
// src/modules/locality/index.ts
|
|
@@ -218,14 +272,14 @@ var LocalitySchema = LocalityModelSchema.omit({ warehouses: true, country: true
|
|
|
218
272
|
var import_zod6 = require("zod");
|
|
219
273
|
|
|
220
274
|
// src/generated/schemas/variants/pure/Country.pure.ts
|
|
221
|
-
var
|
|
222
|
-
var CountryModelSchema =
|
|
223
|
-
id:
|
|
224
|
-
code:
|
|
225
|
-
updatedAt:
|
|
226
|
-
localities:
|
|
227
|
-
products:
|
|
228
|
-
priceListAssignments:
|
|
275
|
+
var z10 = __toESM(require("zod"), 1);
|
|
276
|
+
var CountryModelSchema = z10.object({
|
|
277
|
+
id: z10.number().int(),
|
|
278
|
+
code: z10.string(),
|
|
279
|
+
updatedAt: z10.date(),
|
|
280
|
+
localities: z10.array(z10.unknown()),
|
|
281
|
+
products: z10.array(z10.unknown()),
|
|
282
|
+
priceListAssignments: z10.array(z10.unknown())
|
|
229
283
|
}).strict();
|
|
230
284
|
|
|
231
285
|
// src/modules/country/index.ts
|
|
@@ -235,32 +289,32 @@ var CountrySchema = CountryModelSchema.omit({ localities: true }).extend({ updat
|
|
|
235
289
|
var import_zod7 = require("zod");
|
|
236
290
|
|
|
237
291
|
// src/generated/schemas/variants/pure/Employee.pure.ts
|
|
238
|
-
var
|
|
239
|
-
var EmployeeModelSchema =
|
|
240
|
-
id:
|
|
241
|
-
email:
|
|
242
|
-
password:
|
|
243
|
-
firstName:
|
|
244
|
-
lastName:
|
|
245
|
-
phone:
|
|
246
|
-
avatarUrl:
|
|
247
|
-
warehouseId:
|
|
248
|
-
isActive:
|
|
249
|
-
lastSeen:
|
|
250
|
-
updatedAt:
|
|
251
|
-
warehouse:
|
|
252
|
-
roleAssignments:
|
|
292
|
+
var z12 = __toESM(require("zod"), 1);
|
|
293
|
+
var EmployeeModelSchema = z12.object({
|
|
294
|
+
id: z12.string(),
|
|
295
|
+
email: z12.string(),
|
|
296
|
+
password: z12.string(),
|
|
297
|
+
firstName: z12.string(),
|
|
298
|
+
lastName: z12.string(),
|
|
299
|
+
phone: z12.string().nullable(),
|
|
300
|
+
avatarUrl: z12.string().nullable(),
|
|
301
|
+
warehouseId: z12.number().int().nullable(),
|
|
302
|
+
isActive: z12.boolean(),
|
|
303
|
+
lastSeen: z12.date().nullable(),
|
|
304
|
+
updatedAt: z12.date(),
|
|
305
|
+
warehouse: z12.unknown().nullable(),
|
|
306
|
+
roleAssignments: z12.array(z12.unknown())
|
|
253
307
|
}).strict();
|
|
254
308
|
|
|
255
309
|
// src/generated/schemas/variants/pure/EmployeeRole.pure.ts
|
|
256
|
-
var
|
|
257
|
-
var EmployeeRoleModelSchema =
|
|
258
|
-
id:
|
|
259
|
-
name:
|
|
260
|
-
color:
|
|
261
|
-
updatedAt:
|
|
262
|
-
assignments:
|
|
263
|
-
permissions:
|
|
310
|
+
var z13 = __toESM(require("zod"), 1);
|
|
311
|
+
var EmployeeRoleModelSchema = z13.object({
|
|
312
|
+
id: z13.number().int(),
|
|
313
|
+
name: z13.string(),
|
|
314
|
+
color: z13.string(),
|
|
315
|
+
updatedAt: z13.date(),
|
|
316
|
+
assignments: z13.array(z13.unknown()),
|
|
317
|
+
permissions: z13.array(z13.unknown())
|
|
264
318
|
}).strict();
|
|
265
319
|
|
|
266
320
|
// src/modules/employee/index.ts
|
|
@@ -457,13 +511,13 @@ var ProductCollectionSchema = import_zod11.z.object({
|
|
|
457
511
|
var import_zod12 = require("zod");
|
|
458
512
|
|
|
459
513
|
// src/generated/schemas/variants/pure/ProductMeasure.pure.ts
|
|
460
|
-
var
|
|
461
|
-
var ProductMeasureModelSchema =
|
|
462
|
-
id:
|
|
463
|
-
name:
|
|
464
|
-
code:
|
|
465
|
-
updatedAt:
|
|
466
|
-
products:
|
|
514
|
+
var z19 = __toESM(require("zod"), 1);
|
|
515
|
+
var ProductMeasureModelSchema = z19.object({
|
|
516
|
+
id: z19.number().int(),
|
|
517
|
+
name: z19.string().nullable(),
|
|
518
|
+
code: z19.string().nullable(),
|
|
519
|
+
updatedAt: z19.date(),
|
|
520
|
+
products: z19.array(z19.unknown())
|
|
467
521
|
}).strict();
|
|
468
522
|
|
|
469
523
|
// src/modules/product-measure/index.ts
|
|
@@ -473,54 +527,104 @@ var ProductMeasureSchema = ProductMeasureModelSchema.omit({ products: true }).ex
|
|
|
473
527
|
var import_zod13 = require("zod");
|
|
474
528
|
|
|
475
529
|
// src/generated/schemas/variants/pure/ProductBrand.pure.ts
|
|
476
|
-
var
|
|
477
|
-
var ProductBrandModelSchema =
|
|
478
|
-
id:
|
|
479
|
-
name:
|
|
480
|
-
updatedAt:
|
|
481
|
-
products:
|
|
530
|
+
var z21 = __toESM(require("zod"), 1);
|
|
531
|
+
var ProductBrandModelSchema = z21.object({
|
|
532
|
+
id: z21.number().int(),
|
|
533
|
+
name: z21.string(),
|
|
534
|
+
updatedAt: z21.date(),
|
|
535
|
+
products: z21.array(z21.unknown())
|
|
482
536
|
}).strict();
|
|
483
537
|
|
|
484
538
|
// src/modules/product-brand/index.ts
|
|
485
539
|
var ProductBrandSchema = ProductBrandModelSchema.omit({ products: true }).extend({ updatedAt: import_zod13.z.string() });
|
|
486
540
|
|
|
487
541
|
// src/modules/product-item/index.ts
|
|
488
|
-
var
|
|
542
|
+
var import_zod15 = require("zod");
|
|
489
543
|
|
|
490
544
|
// src/generated/schemas/variants/pure/ProductItem.pure.ts
|
|
491
|
-
var
|
|
545
|
+
var z24 = __toESM(require("zod"), 1);
|
|
492
546
|
|
|
493
547
|
// src/generated/schemas/enums/WriteoffStrategy.schema.ts
|
|
494
|
-
var
|
|
495
|
-
var WriteoffStrategySchema =
|
|
548
|
+
var z23 = __toESM(require("zod"), 1);
|
|
549
|
+
var WriteoffStrategySchema = z23.enum(["FIFO", "LIFO", "FEFO", "MANUAL"]);
|
|
496
550
|
|
|
497
551
|
// src/generated/schemas/variants/pure/ProductItem.pure.ts
|
|
498
|
-
var ProductItemModelSchema =
|
|
499
|
-
id:
|
|
500
|
-
sku:
|
|
501
|
-
name:
|
|
502
|
-
productCollectionId:
|
|
503
|
-
productTypeId:
|
|
504
|
-
productBrandId:
|
|
505
|
-
productMeasureId:
|
|
506
|
-
countryId:
|
|
507
|
-
characteristics:
|
|
552
|
+
var ProductItemModelSchema = z24.object({
|
|
553
|
+
id: z24.number().int(),
|
|
554
|
+
sku: z24.string(),
|
|
555
|
+
name: z24.string(),
|
|
556
|
+
productCollectionId: z24.number().int().nullable(),
|
|
557
|
+
productTypeId: z24.number().int(),
|
|
558
|
+
productBrandId: z24.number().int().nullable(),
|
|
559
|
+
productMeasureId: z24.number().int().nullable(),
|
|
560
|
+
countryId: z24.number().int().nullable(),
|
|
561
|
+
characteristics: z24.unknown(),
|
|
508
562
|
writeoffStrategy: WriteoffStrategySchema.nullable(),
|
|
509
|
-
isPublic:
|
|
510
|
-
updatedAt:
|
|
511
|
-
productCollection:
|
|
512
|
-
productType:
|
|
513
|
-
productBrand:
|
|
514
|
-
productMeasure:
|
|
515
|
-
country:
|
|
516
|
-
barcodes:
|
|
517
|
-
packages:
|
|
518
|
-
shipments:
|
|
563
|
+
isPublic: z24.boolean(),
|
|
564
|
+
updatedAt: z24.date(),
|
|
565
|
+
productCollection: z24.unknown().nullable(),
|
|
566
|
+
productType: z24.unknown(),
|
|
567
|
+
productBrand: z24.unknown().nullable(),
|
|
568
|
+
productMeasure: z24.unknown().nullable(),
|
|
569
|
+
country: z24.unknown().nullable(),
|
|
570
|
+
barcodes: z24.array(z24.unknown()),
|
|
571
|
+
packages: z24.array(z24.unknown()),
|
|
572
|
+
shipments: z24.array(z24.unknown()),
|
|
573
|
+
stats: z24.array(z24.unknown())
|
|
519
574
|
}).strict();
|
|
520
575
|
|
|
521
|
-
// src/
|
|
522
|
-
var
|
|
523
|
-
var
|
|
576
|
+
// src/modules/sync/index.ts
|
|
577
|
+
var import_zod14 = require("zod");
|
|
578
|
+
var SYNC_TABLE_NAMES = [
|
|
579
|
+
"country",
|
|
580
|
+
"locality",
|
|
581
|
+
"organization",
|
|
582
|
+
"warehouse",
|
|
583
|
+
"folder",
|
|
584
|
+
"product_collection",
|
|
585
|
+
"product_type",
|
|
586
|
+
"product_brand",
|
|
587
|
+
"product_measure",
|
|
588
|
+
"product_package",
|
|
589
|
+
"product_shipment",
|
|
590
|
+
"product_item",
|
|
591
|
+
"product_barcode",
|
|
592
|
+
"product_item_stats"
|
|
593
|
+
];
|
|
594
|
+
var SyncTableNameSchema = import_zod14.z.enum(SYNC_TABLE_NAMES);
|
|
595
|
+
var SyncCursorSchema = import_zod14.z.union([import_zod14.z.string(), import_zod14.z.number(), import_zod14.z.null()]);
|
|
596
|
+
var SyncEntityIdSchema = import_zod14.z.union([import_zod14.z.string(), import_zod14.z.number()]);
|
|
597
|
+
function createSyncFetchResponseSchema(itemSchema) {
|
|
598
|
+
return import_zod14.z.object({
|
|
599
|
+
items: import_zod14.z.array(itemSchema),
|
|
600
|
+
cursor: SyncCursorSchema,
|
|
601
|
+
hasMore: import_zod14.z.boolean()
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
function createSyncChangePayloadSchema(itemSchema) {
|
|
605
|
+
const ids = import_zod14.z.array(SyncEntityIdSchema);
|
|
606
|
+
return import_zod14.z.object({
|
|
607
|
+
added: import_zod14.z.array(itemSchema).optional(),
|
|
608
|
+
modified: import_zod14.z.array(itemSchema).optional(),
|
|
609
|
+
removed: ids.optional(),
|
|
610
|
+
upserted: import_zod14.z.array(itemSchema).optional(),
|
|
611
|
+
deletedIds: ids.optional(),
|
|
612
|
+
deleted: ids.optional(),
|
|
613
|
+
cursor: SyncCursorSchema.optional()
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
function createSyncSocketPayloadSchema(itemSchema) {
|
|
617
|
+
const ids = import_zod14.z.array(SyncEntityIdSchema);
|
|
618
|
+
return import_zod14.z.object({
|
|
619
|
+
added: import_zod14.z.array(itemSchema),
|
|
620
|
+
modified: import_zod14.z.array(itemSchema),
|
|
621
|
+
removed: ids,
|
|
622
|
+
upserted: import_zod14.z.array(itemSchema),
|
|
623
|
+
deletedIds: ids,
|
|
624
|
+
deleted: ids,
|
|
625
|
+
cursor: SyncCursorSchema
|
|
626
|
+
});
|
|
627
|
+
}
|
|
524
628
|
|
|
525
629
|
// src/modules/product-item/index.ts
|
|
526
630
|
var ProductItemSchema = ProductItemModelSchema.omit({
|
|
@@ -532,118 +636,206 @@ var ProductItemSchema = ProductItemModelSchema.omit({
|
|
|
532
636
|
barcodes: true,
|
|
533
637
|
packages: true,
|
|
534
638
|
shipments: true
|
|
535
|
-
}).extend({ updatedAt:
|
|
639
|
+
}).extend({ updatedAt: import_zod15.z.string() });
|
|
536
640
|
var ProductItemWithRelationsSchema = ProductItemSchema.extend({
|
|
537
641
|
productBrand: ProductBrandSchema.nullable(),
|
|
538
642
|
productMeasure: ProductMeasureSchema.nullable()
|
|
539
643
|
});
|
|
540
|
-
var ProductItemStatsQuerySchema =
|
|
541
|
-
productCollectionId:
|
|
542
|
-
warehouseId:
|
|
543
|
-
});
|
|
544
|
-
var
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
644
|
+
var ProductItemStatsQuerySchema = import_zod15.z.object({
|
|
645
|
+
productCollectionId: import_zod15.z.coerce.number().int().positive(),
|
|
646
|
+
warehouseId: import_zod15.z.coerce.number().int().positive()
|
|
647
|
+
});
|
|
648
|
+
var ProductItemStatsFetchQuerySchema = import_zod15.z.object({
|
|
649
|
+
warehouseId: import_zod15.z.coerce.number().int().positive(),
|
|
650
|
+
productCollectionId: import_zod15.z.coerce.number().int().positive().optional(),
|
|
651
|
+
cursor: import_zod15.z.string().min(1).optional(),
|
|
652
|
+
limit: import_zod15.z.coerce.number().int().positive().optional()
|
|
653
|
+
});
|
|
654
|
+
var ProductItemStatsSchema = import_zod15.z.object({
|
|
655
|
+
id: import_zod15.z.number().int(),
|
|
656
|
+
productItemId: import_zod15.z.number().int(),
|
|
657
|
+
warehouseId: import_zod15.z.number().int(),
|
|
658
|
+
quantity: import_zod15.z.string(),
|
|
659
|
+
retailPrice: import_zod15.z.string().nullable(),
|
|
660
|
+
currency: CurrencyCodeSchema.nullable(),
|
|
661
|
+
updatedAt: import_zod15.z.string()
|
|
662
|
+
});
|
|
663
|
+
var ProductItemStatsFetchResponseSchema = createSyncFetchResponseSchema(ProductItemStatsSchema);
|
|
664
|
+
var ProductItemStatsChangePayloadSchema = createSyncChangePayloadSchema(ProductItemStatsSchema);
|
|
665
|
+
var ProductItemStatsSocketPayloadSchema = createSyncSocketPayloadSchema(ProductItemStatsSchema);
|
|
552
666
|
|
|
553
667
|
// src/modules/product-barcode/index.ts
|
|
554
|
-
var
|
|
668
|
+
var import_zod16 = require("zod");
|
|
555
669
|
|
|
556
670
|
// src/generated/schemas/variants/pure/ProductBarcode.pure.ts
|
|
557
|
-
var
|
|
671
|
+
var z28 = __toESM(require("zod"), 1);
|
|
558
672
|
|
|
559
673
|
// src/generated/schemas/enums/BarcodeType.schema.ts
|
|
560
|
-
var
|
|
561
|
-
var BarcodeTypeSchema =
|
|
674
|
+
var z27 = __toESM(require("zod"), 1);
|
|
675
|
+
var BarcodeTypeSchema = z27.enum(["FACTORY", "CUSTOM"]);
|
|
562
676
|
|
|
563
677
|
// src/generated/schemas/variants/pure/ProductBarcode.pure.ts
|
|
564
|
-
var ProductBarcodeModelSchema =
|
|
565
|
-
id:
|
|
566
|
-
code:
|
|
678
|
+
var ProductBarcodeModelSchema = z28.object({
|
|
679
|
+
id: z28.number().int(),
|
|
680
|
+
code: z28.string(),
|
|
567
681
|
type: BarcodeTypeSchema,
|
|
568
|
-
productItemId:
|
|
569
|
-
updatedAt:
|
|
570
|
-
productItem:
|
|
682
|
+
productItemId: z28.number().int(),
|
|
683
|
+
updatedAt: z28.date(),
|
|
684
|
+
productItem: z28.unknown()
|
|
571
685
|
}).strict();
|
|
572
686
|
|
|
573
687
|
// src/modules/product-barcode/index.ts
|
|
574
|
-
var ProductBarcodeSchema = ProductBarcodeModelSchema.omit({ productItem: true }).extend({ updatedAt:
|
|
688
|
+
var ProductBarcodeSchema = ProductBarcodeModelSchema.omit({ productItem: true }).extend({ updatedAt: import_zod16.z.string() });
|
|
575
689
|
|
|
576
690
|
// src/modules/product-package/index.ts
|
|
577
|
-
var
|
|
691
|
+
var import_zod17 = require("zod");
|
|
578
692
|
|
|
579
693
|
// src/generated/schemas/variants/pure/ProductPackage.pure.ts
|
|
580
|
-
var
|
|
581
|
-
var ProductPackageModelSchema =
|
|
582
|
-
id:
|
|
583
|
-
name:
|
|
584
|
-
isBase:
|
|
585
|
-
productItemId:
|
|
586
|
-
conversionFactor:
|
|
587
|
-
updatedAt:
|
|
588
|
-
productItem:
|
|
589
|
-
prices:
|
|
694
|
+
var z30 = __toESM(require("zod"), 1);
|
|
695
|
+
var ProductPackageModelSchema = z30.object({
|
|
696
|
+
id: z30.number().int(),
|
|
697
|
+
name: z30.string().nullable(),
|
|
698
|
+
isBase: z30.boolean(),
|
|
699
|
+
productItemId: z30.number().int(),
|
|
700
|
+
conversionFactor: z30.number(),
|
|
701
|
+
updatedAt: z30.date(),
|
|
702
|
+
productItem: z30.unknown(),
|
|
703
|
+
prices: z30.array(z30.unknown())
|
|
590
704
|
}).strict();
|
|
591
705
|
|
|
592
706
|
// src/modules/product-package/index.ts
|
|
593
|
-
var ProductPackageSchema = ProductPackageModelSchema.omit({ productItem: true }).extend({ updatedAt:
|
|
707
|
+
var ProductPackageSchema = ProductPackageModelSchema.omit({ productItem: true }).extend({ updatedAt: import_zod17.z.string() });
|
|
594
708
|
|
|
595
709
|
// src/modules/product-shipment/index.ts
|
|
596
|
-
var
|
|
710
|
+
var import_zod18 = require("zod");
|
|
597
711
|
|
|
598
712
|
// src/generated/schemas/variants/pure/ProductShipment.pure.ts
|
|
599
|
-
var
|
|
600
|
-
var ProductShipmentModelSchema =
|
|
601
|
-
id:
|
|
602
|
-
warehouseId:
|
|
603
|
-
productItemId:
|
|
604
|
-
arrivalDate:
|
|
605
|
-
expiryDate:
|
|
606
|
-
quantity:
|
|
607
|
-
priceAmount:
|
|
713
|
+
var z32 = __toESM(require("zod"), 1);
|
|
714
|
+
var ProductShipmentModelSchema = z32.object({
|
|
715
|
+
id: z32.number().int(),
|
|
716
|
+
warehouseId: z32.number().int(),
|
|
717
|
+
productItemId: z32.number().int(),
|
|
718
|
+
arrivalDate: z32.date(),
|
|
719
|
+
expiryDate: z32.date().nullable(),
|
|
720
|
+
quantity: z32.number(),
|
|
721
|
+
priceAmount: z32.bigint(),
|
|
608
722
|
currency: CurrencyCodeSchema,
|
|
609
|
-
updatedAt:
|
|
610
|
-
warehouse:
|
|
611
|
-
productItem:
|
|
723
|
+
updatedAt: z32.date(),
|
|
724
|
+
warehouse: z32.unknown(),
|
|
725
|
+
productItem: z32.unknown()
|
|
612
726
|
}).strict();
|
|
613
727
|
|
|
614
728
|
// src/modules/product-shipment/index.ts
|
|
615
729
|
var ProductShipmentSchema = ProductShipmentModelSchema.omit({ warehouse: true, productItem: true }).extend({
|
|
616
|
-
arrivalDate:
|
|
617
|
-
expiryDate:
|
|
618
|
-
updatedAt:
|
|
730
|
+
arrivalDate: import_zod18.z.string(),
|
|
731
|
+
expiryDate: import_zod18.z.string().nullable(),
|
|
732
|
+
updatedAt: import_zod18.z.string()
|
|
619
733
|
});
|
|
620
734
|
|
|
621
735
|
// src/modules/price-list/index.ts
|
|
622
|
-
var
|
|
736
|
+
var import_zod19 = require("zod");
|
|
737
|
+
|
|
738
|
+
// src/generated/schemas/enums/PriceListTargetType.schema.ts
|
|
739
|
+
var z34 = __toESM(require("zod"), 1);
|
|
740
|
+
var PriceListTargetTypeSchema = z34.enum(["WAREHOUSE", "ORGANIZATION", "LOCALITY", "COUNTRY"]);
|
|
623
741
|
|
|
624
742
|
// src/generated/schemas/variants/pure/PriceList.pure.ts
|
|
625
|
-
var
|
|
626
|
-
var PriceListModelSchema =
|
|
627
|
-
id:
|
|
628
|
-
name:
|
|
743
|
+
var z35 = __toESM(require("zod"), 1);
|
|
744
|
+
var PriceListModelSchema = z35.object({
|
|
745
|
+
id: z35.number().int(),
|
|
746
|
+
name: z35.string(),
|
|
629
747
|
currency: CurrencyCodeSchema,
|
|
630
|
-
isDefault:
|
|
631
|
-
createdAt:
|
|
632
|
-
updatedAt:
|
|
633
|
-
prices:
|
|
634
|
-
assignments:
|
|
748
|
+
isDefault: z35.boolean(),
|
|
749
|
+
createdAt: z35.date(),
|
|
750
|
+
updatedAt: z35.date(),
|
|
751
|
+
prices: z35.array(z35.unknown()),
|
|
752
|
+
assignments: z35.array(z35.unknown())
|
|
635
753
|
}).strict();
|
|
636
754
|
|
|
637
755
|
// src/modules/price-list/index.ts
|
|
638
|
-
var CreatePriceListSchema =
|
|
639
|
-
name:
|
|
756
|
+
var CreatePriceListSchema = import_zod19.z.object({
|
|
757
|
+
name: import_zod19.z.string().min(1),
|
|
640
758
|
currency: CurrencyCodeSchema
|
|
641
759
|
});
|
|
642
760
|
var UpdatePriceListSchema = CreatePriceListSchema.partial();
|
|
643
761
|
var PriceListSchema = PriceListModelSchema.omit({
|
|
644
762
|
prices: true,
|
|
645
763
|
assignments: true
|
|
646
|
-
}).extend({
|
|
764
|
+
}).extend({
|
|
765
|
+
createdAt: import_zod19.z.string(),
|
|
766
|
+
updatedAt: import_zod19.z.string()
|
|
767
|
+
});
|
|
768
|
+
var PriceListSummarySchema = PriceListSchema.extend({
|
|
769
|
+
assignmentCount: import_zod19.z.number().int().nonnegative(),
|
|
770
|
+
priceCount: import_zod19.z.number().int().nonnegative()
|
|
771
|
+
});
|
|
772
|
+
var PriceListAssignmentSchema = import_zod19.z.object({
|
|
773
|
+
id: import_zod19.z.number().int().positive(),
|
|
774
|
+
priceListId: import_zod19.z.number().int().positive(),
|
|
775
|
+
targetType: PriceListTargetTypeSchema,
|
|
776
|
+
warehouseId: import_zod19.z.number().int().positive().nullable(),
|
|
777
|
+
organizationId: import_zod19.z.number().int().positive().nullable(),
|
|
778
|
+
localityId: import_zod19.z.number().int().positive().nullable(),
|
|
779
|
+
countryId: import_zod19.z.number().int().positive().nullable()
|
|
780
|
+
});
|
|
781
|
+
var IdArraySchema = import_zod19.z.array(import_zod19.z.number().int().positive());
|
|
782
|
+
var SetPriceListAssignmentsSchema = import_zod19.z.object({
|
|
783
|
+
warehouseIds: IdArraySchema,
|
|
784
|
+
organizationIds: IdArraySchema,
|
|
785
|
+
localityIds: IdArraySchema,
|
|
786
|
+
countryIds: IdArraySchema
|
|
787
|
+
}).superRefine((value, context) => {
|
|
788
|
+
for (const [field, ids] of Object.entries(value)) {
|
|
789
|
+
if (new Set(ids).size !== ids.length) {
|
|
790
|
+
context.addIssue({
|
|
791
|
+
code: import_zod19.z.ZodIssueCode.custom,
|
|
792
|
+
path: [field],
|
|
793
|
+
message: "Target ids must be unique"
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
var ProductPriceSchema = import_zod19.z.object({
|
|
799
|
+
id: import_zod19.z.number().int().positive(),
|
|
800
|
+
priceListId: import_zod19.z.number().int().positive(),
|
|
801
|
+
productPackageId: import_zod19.z.number().int().positive(),
|
|
802
|
+
priceAmount: import_zod19.z.string().regex(/^\d+$/),
|
|
803
|
+
createdAt: import_zod19.z.string(),
|
|
804
|
+
updatedAt: import_zod19.z.string()
|
|
805
|
+
});
|
|
806
|
+
var ProductPriceInputSchema = import_zod19.z.object({
|
|
807
|
+
productPackageId: import_zod19.z.number().int().positive(),
|
|
808
|
+
priceAmount: import_zod19.z.string().regex(/^\d+$/)
|
|
809
|
+
});
|
|
810
|
+
var UpdatePriceListPricesSchema = import_zod19.z.object({
|
|
811
|
+
upserted: import_zod19.z.array(ProductPriceInputSchema),
|
|
812
|
+
removedProductPackageIds: IdArraySchema
|
|
813
|
+
}).superRefine((value, context) => {
|
|
814
|
+
const upsertedIds = value.upserted.map((price) => price.productPackageId);
|
|
815
|
+
if (new Set(upsertedIds).size !== upsertedIds.length) {
|
|
816
|
+
context.addIssue({
|
|
817
|
+
code: import_zod19.z.ZodIssueCode.custom,
|
|
818
|
+
path: ["upserted"],
|
|
819
|
+
message: "Product package ids must be unique"
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
const removedIds = value.removedProductPackageIds;
|
|
823
|
+
if (new Set(removedIds).size !== removedIds.length) {
|
|
824
|
+
context.addIssue({
|
|
825
|
+
code: import_zod19.z.ZodIssueCode.custom,
|
|
826
|
+
path: ["removedProductPackageIds"],
|
|
827
|
+
message: "Product package ids must be unique"
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
const removedIdSet = new Set(removedIds);
|
|
831
|
+
if (upsertedIds.some((id) => removedIdSet.has(id))) {
|
|
832
|
+
context.addIssue({
|
|
833
|
+
code: import_zod19.z.ZodIssueCode.custom,
|
|
834
|
+
path: ["removedProductPackageIds"],
|
|
835
|
+
message: "A product package cannot be updated and removed in the same request"
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
});
|
|
647
839
|
// Annotate the CommonJS export names for ESM import in node:
|
|
648
840
|
0 && (module.exports = {
|
|
649
841
|
ALL_PERMISSIONS,
|
|
@@ -659,6 +851,7 @@ var PriceListSchema = PriceListModelSchema.omit({
|
|
|
659
851
|
CreateProductTypeSchema,
|
|
660
852
|
CreateRoleSchema,
|
|
661
853
|
CreateWarehouseSchema,
|
|
854
|
+
CurrencyCodeSchema,
|
|
662
855
|
EmployeeRoleSchema,
|
|
663
856
|
EmployeeSchema,
|
|
664
857
|
FolderSchema,
|
|
@@ -666,31 +859,49 @@ var PriceListSchema = PriceListModelSchema.omit({
|
|
|
666
859
|
LoginSchema,
|
|
667
860
|
OrganizationSchema,
|
|
668
861
|
PaginationQuerySchema,
|
|
862
|
+
PriceListAssignmentSchema,
|
|
669
863
|
PriceListSchema,
|
|
864
|
+
PriceListSummarySchema,
|
|
670
865
|
ProductBarcodeSchema,
|
|
671
866
|
ProductBrandSchema,
|
|
672
867
|
ProductCollectionSchema,
|
|
673
868
|
ProductItemSchema,
|
|
869
|
+
ProductItemStatsChangePayloadSchema,
|
|
870
|
+
ProductItemStatsFetchQuerySchema,
|
|
871
|
+
ProductItemStatsFetchResponseSchema,
|
|
674
872
|
ProductItemStatsQuerySchema,
|
|
675
873
|
ProductItemStatsSchema,
|
|
874
|
+
ProductItemStatsSocketPayloadSchema,
|
|
676
875
|
ProductItemWithRelationsSchema,
|
|
677
876
|
ProductMeasureSchema,
|
|
678
877
|
ProductPackageSchema,
|
|
878
|
+
ProductPriceInputSchema,
|
|
879
|
+
ProductPriceSchema,
|
|
679
880
|
ProductShipmentSchema,
|
|
680
881
|
ProductTypeSchema,
|
|
681
882
|
RolePermissionItemSchema,
|
|
682
883
|
RoleSchema,
|
|
884
|
+
SYNC_TABLE_NAMES,
|
|
885
|
+
SetPriceListAssignmentsSchema,
|
|
683
886
|
SetupInitSchema,
|
|
887
|
+
SyncCursorSchema,
|
|
888
|
+
SyncEntityIdSchema,
|
|
889
|
+
SyncTableNameSchema,
|
|
684
890
|
UpdateEmployeeSchema,
|
|
685
891
|
UpdateFolderSchema,
|
|
686
892
|
UpdateOrganizationSchema,
|
|
687
893
|
UpdateOwnPasswordSchema,
|
|
688
894
|
UpdateOwnProfileSchema,
|
|
895
|
+
UpdatePriceListPricesSchema,
|
|
689
896
|
UpdatePriceListSchema,
|
|
690
897
|
UpdateProductCollectionSchema,
|
|
691
898
|
UpdateProductTypeSchema,
|
|
692
899
|
UpdateRoleSchema,
|
|
693
900
|
UpdateWarehouseSchema,
|
|
694
|
-
WarehouseSchema
|
|
901
|
+
WarehouseSchema,
|
|
902
|
+
createSyncChangePayloadSchema,
|
|
903
|
+
createSyncFetchResponseSchema,
|
|
904
|
+
createSyncSocketPayloadSchema,
|
|
905
|
+
getCurrencyMinorUnits
|
|
695
906
|
});
|
|
696
907
|
//# sourceMappingURL=index.cjs.map
|