@deliverart/sdk-js-delivery 2.4.1 → 2.4.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/index.cjs CHANGED
@@ -11308,21 +11308,33 @@ var writableDeliveryPositionSchema = deliveryPositionSchema.pick({
11308
11308
  })
11309
11309
  });
11310
11310
  var minMax = external_exports.object({
11311
- min: external_exports.coerce.number().gte(0),
11312
- max: external_exports.coerce.number().gte(0)
11311
+ min: external_exports.coerce.number().gte(0, "min_must_be_gte_0"),
11312
+ max: external_exports.coerce.number().gte(0, "max_must_be_gte_0")
11313
11313
  }).refine((s) => s.max >= s.min, { message: "max_greater_than_min", path: ["max"] });
11314
11314
  var settingsByType = {
11315
11315
  amount: minMax,
11316
11316
  distance: minMax,
11317
11317
  postal_code: external_exports.object({
11318
- values: external_exports.array(external_exports.string().trim()).min(1, "almeno un CAP")
11318
+ values: external_exports.array(external_exports.string().trim()).min(1, "at_least_one_postal_code")
11319
11319
  })
11320
11320
  };
11321
11321
  var commonDeliveryFeeFields = external_exports.object({
11322
- amount: external_exports.string(),
11323
- netAmount: external_exports.string(),
11324
- taxAmount: external_exports.string(),
11325
- taxRate: external_exports.coerce.number(),
11322
+ amount: external_exports.string().default("0.0000").refine((val) => !isNaN(Number(val)), {
11323
+ message: "amount_must_be_a_valid_number"
11324
+ }).refine((val) => Number(val) >= 0, {
11325
+ message: "amount_must_be_gte_0"
11326
+ }),
11327
+ netAmount: external_exports.string().refine((val) => !isNaN(Number(val)), {
11328
+ message: "net_amount_must_be_a_valid_number"
11329
+ }).refine((val) => Number(val) >= 0, {
11330
+ message: "net_amount_must_be_gte_0"
11331
+ }),
11332
+ taxAmount: external_exports.string().refine((val) => !isNaN(Number(val)), {
11333
+ message: "tax_amount_must_be_a_valid_number"
11334
+ }).refine((val) => Number(val) >= 0, {
11335
+ message: "tax_amount_must_be_gte_0"
11336
+ }),
11337
+ taxRate: external_exports.coerce.number().min(0, "tax_rate_must_be_gte_0").describe("The tax rate applied to the delivery fee"),
11326
11338
  createdAt: import_sdk_js_global_types2.datetimeSchema,
11327
11339
  updatedAt: import_sdk_js_global_types2.datetimeSchema
11328
11340
  });
package/dist/index.d.cts CHANGED
@@ -63,7 +63,7 @@ declare const writableDeliveryPositionSchema: z.ZodObject<{
63
63
  }, z.core.$strip>;
64
64
  type WritableDeliveryPosition = z.infer<typeof writableDeliveryPositionSchema>;
65
65
  declare const deliveryFeeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
66
- amount: z.ZodString;
66
+ amount: z.ZodDefault<z.ZodString>;
67
67
  netAmount: z.ZodString;
68
68
  taxAmount: z.ZodString;
69
69
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -75,7 +75,7 @@ declare const deliveryFeeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
75
75
  max: z.ZodCoercedNumber<unknown>;
76
76
  }, z.core.$strip>;
77
77
  }, z.core.$strip>, z.ZodObject<{
78
- amount: z.ZodString;
78
+ amount: z.ZodDefault<z.ZodString>;
79
79
  netAmount: z.ZodString;
80
80
  taxAmount: z.ZodString;
81
81
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -87,7 +87,7 @@ declare const deliveryFeeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
87
87
  max: z.ZodCoercedNumber<unknown>;
88
88
  }, z.core.$strip>;
89
89
  }, z.core.$strip>, z.ZodObject<{
90
- amount: z.ZodString;
90
+ amount: z.ZodDefault<z.ZodString>;
91
91
  netAmount: z.ZodString;
92
92
  taxAmount: z.ZodString;
93
93
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -128,7 +128,7 @@ declare const writableDeliveryFeeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
128
128
  }, z.core.$strip>]>;
129
129
  type WritableDeliveryFee = z.infer<typeof writableDeliveryFeeSchema>;
130
130
  declare const deliveryFeeDetailsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
131
- amount: z.ZodString;
131
+ amount: z.ZodDefault<z.ZodString>;
132
132
  netAmount: z.ZodString;
133
133
  taxAmount: z.ZodString;
134
134
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -142,7 +142,7 @@ declare const deliveryFeeDetailsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
142
142
  max: z.ZodCoercedNumber<unknown>;
143
143
  }, z.core.$strip>;
144
144
  }, z.core.$strip>, z.ZodObject<{
145
- amount: z.ZodString;
145
+ amount: z.ZodDefault<z.ZodString>;
146
146
  netAmount: z.ZodString;
147
147
  taxAmount: z.ZodString;
148
148
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -156,7 +156,7 @@ declare const deliveryFeeDetailsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
156
156
  max: z.ZodCoercedNumber<unknown>;
157
157
  }, z.core.$strip>;
158
158
  }, z.core.$strip>, z.ZodObject<{
159
- amount: z.ZodString;
159
+ amount: z.ZodDefault<z.ZodString>;
160
160
  netAmount: z.ZodString;
161
161
  taxAmount: z.ZodString;
162
162
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -909,7 +909,7 @@ declare const createDeliveryFeeInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
909
909
  }, z.core.$strip>]>;
910
910
  type CreateDeliveryFeeInput = z.input<typeof createDeliveryFeeInputSchema>;
911
911
  declare const createDeliveryFeeResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
912
- amount: z.ZodString;
912
+ amount: z.ZodDefault<z.ZodString>;
913
913
  netAmount: z.ZodString;
914
914
  taxAmount: z.ZodString;
915
915
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -923,7 +923,7 @@ declare const createDeliveryFeeResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObj
923
923
  max: z.ZodCoercedNumber<unknown>;
924
924
  }, z.core.$strip>;
925
925
  }, z.core.$strip>, z.ZodObject<{
926
- amount: z.ZodString;
926
+ amount: z.ZodDefault<z.ZodString>;
927
927
  netAmount: z.ZodString;
928
928
  taxAmount: z.ZodString;
929
929
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -937,7 +937,7 @@ declare const createDeliveryFeeResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObj
937
937
  max: z.ZodCoercedNumber<unknown>;
938
938
  }, z.core.$strip>;
939
939
  }, z.core.$strip>, z.ZodObject<{
940
- amount: z.ZodString;
940
+ amount: z.ZodDefault<z.ZodString>;
941
941
  netAmount: z.ZodString;
942
942
  taxAmount: z.ZodString;
943
943
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -983,7 +983,7 @@ declare class CreateDeliveryFee extends AbstractApiRequest<typeof createDelivery
983
983
  }, z.core.$strip>;
984
984
  }, z.core.$strip>]>;
985
985
  readonly outputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
986
- amount: z.ZodString;
986
+ amount: z.ZodDefault<z.ZodString>;
987
987
  netAmount: z.ZodString;
988
988
  taxAmount: z.ZodString;
989
989
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -997,7 +997,7 @@ declare class CreateDeliveryFee extends AbstractApiRequest<typeof createDelivery
997
997
  max: z.ZodCoercedNumber<unknown>;
998
998
  }, z.core.$strip>;
999
999
  }, z.core.$strip>, z.ZodObject<{
1000
- amount: z.ZodString;
1000
+ amount: z.ZodDefault<z.ZodString>;
1001
1001
  netAmount: z.ZodString;
1002
1002
  taxAmount: z.ZodString;
1003
1003
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1011,7 +1011,7 @@ declare class CreateDeliveryFee extends AbstractApiRequest<typeof createDelivery
1011
1011
  max: z.ZodCoercedNumber<unknown>;
1012
1012
  }, z.core.$strip>;
1013
1013
  }, z.core.$strip>, z.ZodObject<{
1014
- amount: z.ZodString;
1014
+ amount: z.ZodDefault<z.ZodString>;
1015
1015
  netAmount: z.ZodString;
1016
1016
  taxAmount: z.ZodString;
1017
1017
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1048,7 +1048,7 @@ declare class DeleteDeliveryFee extends AbstractApiRequest<typeof deleteDelivery
1048
1048
  declare const getDeliveryFeeDetailsInputSchema: z.ZodUndefined;
1049
1049
  type GetDeliveryFeeDetailsInput = z.infer<typeof getDeliveryFeeDetailsInputSchema>;
1050
1050
  declare const getDeliveryFeeDetailsResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1051
- amount: z.ZodString;
1051
+ amount: z.ZodDefault<z.ZodString>;
1052
1052
  netAmount: z.ZodString;
1053
1053
  taxAmount: z.ZodString;
1054
1054
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1062,7 +1062,7 @@ declare const getDeliveryFeeDetailsResponseSchema: z.ZodDiscriminatedUnion<[z.Zo
1062
1062
  max: z.ZodCoercedNumber<unknown>;
1063
1063
  }, z.core.$strip>;
1064
1064
  }, z.core.$strip>, z.ZodObject<{
1065
- amount: z.ZodString;
1065
+ amount: z.ZodDefault<z.ZodString>;
1066
1066
  netAmount: z.ZodString;
1067
1067
  taxAmount: z.ZodString;
1068
1068
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1076,7 +1076,7 @@ declare const getDeliveryFeeDetailsResponseSchema: z.ZodDiscriminatedUnion<[z.Zo
1076
1076
  max: z.ZodCoercedNumber<unknown>;
1077
1077
  }, z.core.$strip>;
1078
1078
  }, z.core.$strip>, z.ZodObject<{
1079
- amount: z.ZodString;
1079
+ amount: z.ZodDefault<z.ZodString>;
1080
1080
  netAmount: z.ZodString;
1081
1081
  taxAmount: z.ZodString;
1082
1082
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1096,7 +1096,7 @@ declare class GetDeliveryFeeDetails extends AbstractApiRequest<typeof getDeliver
1096
1096
  readonly accept = "application/json";
1097
1097
  readonly inputSchema: z.ZodUndefined;
1098
1098
  readonly outputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1099
- amount: z.ZodString;
1099
+ amount: z.ZodDefault<z.ZodString>;
1100
1100
  netAmount: z.ZodString;
1101
1101
  taxAmount: z.ZodString;
1102
1102
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1110,7 +1110,7 @@ declare class GetDeliveryFeeDetails extends AbstractApiRequest<typeof getDeliver
1110
1110
  max: z.ZodCoercedNumber<unknown>;
1111
1111
  }, z.core.$strip>;
1112
1112
  }, z.core.$strip>, z.ZodObject<{
1113
- amount: z.ZodString;
1113
+ amount: z.ZodDefault<z.ZodString>;
1114
1114
  netAmount: z.ZodString;
1115
1115
  taxAmount: z.ZodString;
1116
1116
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1124,7 +1124,7 @@ declare class GetDeliveryFeeDetails extends AbstractApiRequest<typeof getDeliver
1124
1124
  max: z.ZodCoercedNumber<unknown>;
1125
1125
  }, z.core.$strip>;
1126
1126
  }, z.core.$strip>, z.ZodObject<{
1127
- amount: z.ZodString;
1127
+ amount: z.ZodDefault<z.ZodString>;
1128
1128
  netAmount: z.ZodString;
1129
1129
  taxAmount: z.ZodString;
1130
1130
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1190,7 +1190,7 @@ declare const getDeliveryFeesInputSchema: z.ZodUndefined;
1190
1190
  type GetDeliveryFeesInput = z.infer<typeof getDeliveryFeesInputSchema>;
1191
1191
  declare const getDeliveryFeesResponseSchema: z.ZodObject<{
1192
1192
  data: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1193
- amount: z.ZodString;
1193
+ amount: z.ZodDefault<z.ZodString>;
1194
1194
  netAmount: z.ZodString;
1195
1195
  taxAmount: z.ZodString;
1196
1196
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1202,7 +1202,7 @@ declare const getDeliveryFeesResponseSchema: z.ZodObject<{
1202
1202
  max: z.ZodCoercedNumber<unknown>;
1203
1203
  }, z.core.$strip>;
1204
1204
  }, z.core.$strip>, z.ZodObject<{
1205
- amount: z.ZodString;
1205
+ amount: z.ZodDefault<z.ZodString>;
1206
1206
  netAmount: z.ZodString;
1207
1207
  taxAmount: z.ZodString;
1208
1208
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1214,7 +1214,7 @@ declare const getDeliveryFeesResponseSchema: z.ZodObject<{
1214
1214
  max: z.ZodCoercedNumber<unknown>;
1215
1215
  }, z.core.$strip>;
1216
1216
  }, z.core.$strip>, z.ZodObject<{
1217
- amount: z.ZodString;
1217
+ amount: z.ZodDefault<z.ZodString>;
1218
1218
  netAmount: z.ZodString;
1219
1219
  taxAmount: z.ZodString;
1220
1220
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1242,7 +1242,7 @@ declare class GetDeliveryFees extends AbstractApiRequest<typeof getDeliveryFeesI
1242
1242
  readonly inputSchema: z.ZodUndefined;
1243
1243
  readonly outputSchema: z.ZodObject<{
1244
1244
  data: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1245
- amount: z.ZodString;
1245
+ amount: z.ZodDefault<z.ZodString>;
1246
1246
  netAmount: z.ZodString;
1247
1247
  taxAmount: z.ZodString;
1248
1248
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1254,7 +1254,7 @@ declare class GetDeliveryFees extends AbstractApiRequest<typeof getDeliveryFeesI
1254
1254
  max: z.ZodCoercedNumber<unknown>;
1255
1255
  }, z.core.$strip>;
1256
1256
  }, z.core.$strip>, z.ZodObject<{
1257
- amount: z.ZodString;
1257
+ amount: z.ZodDefault<z.ZodString>;
1258
1258
  netAmount: z.ZodString;
1259
1259
  taxAmount: z.ZodString;
1260
1260
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1266,7 +1266,7 @@ declare class GetDeliveryFees extends AbstractApiRequest<typeof getDeliveryFeesI
1266
1266
  max: z.ZodCoercedNumber<unknown>;
1267
1267
  }, z.core.$strip>;
1268
1268
  }, z.core.$strip>, z.ZodObject<{
1269
- amount: z.ZodString;
1269
+ amount: z.ZodDefault<z.ZodString>;
1270
1270
  netAmount: z.ZodString;
1271
1271
  taxAmount: z.ZodString;
1272
1272
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1380,7 +1380,7 @@ type GetDeliveryFeesFromPointOfSaleQueryParams = z.infer<typeof getDeliveryFeesF
1380
1380
  declare const getDeliveryFeesFromPointOfSaleInputSchema: z.ZodUndefined;
1381
1381
  type GetDeliveryFeesFromPointOfSaleInput = z.infer<typeof getDeliveryFeesFromPointOfSaleInputSchema>;
1382
1382
  declare const getDeliveryFeesFromPointOfSaleResponseSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1383
- amount: z.ZodString;
1383
+ amount: z.ZodDefault<z.ZodString>;
1384
1384
  netAmount: z.ZodString;
1385
1385
  taxAmount: z.ZodString;
1386
1386
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1392,7 +1392,7 @@ declare const getDeliveryFeesFromPointOfSaleResponseSchema: z.ZodArray<z.ZodDisc
1392
1392
  max: z.ZodCoercedNumber<unknown>;
1393
1393
  }, z.core.$strip>;
1394
1394
  }, z.core.$strip>, z.ZodObject<{
1395
- amount: z.ZodString;
1395
+ amount: z.ZodDefault<z.ZodString>;
1396
1396
  netAmount: z.ZodString;
1397
1397
  taxAmount: z.ZodString;
1398
1398
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1404,7 +1404,7 @@ declare const getDeliveryFeesFromPointOfSaleResponseSchema: z.ZodArray<z.ZodDisc
1404
1404
  max: z.ZodCoercedNumber<unknown>;
1405
1405
  }, z.core.$strip>;
1406
1406
  }, z.core.$strip>, z.ZodObject<{
1407
- amount: z.ZodString;
1407
+ amount: z.ZodDefault<z.ZodString>;
1408
1408
  netAmount: z.ZodString;
1409
1409
  taxAmount: z.ZodString;
1410
1410
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1422,7 +1422,7 @@ declare class GetDeliveryFeesFromPointOfSale extends AbstractApiRequest<typeof g
1422
1422
  readonly accept = "application/json";
1423
1423
  readonly inputSchema: z.ZodUndefined;
1424
1424
  readonly outputSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1425
- amount: z.ZodString;
1425
+ amount: z.ZodDefault<z.ZodString>;
1426
1426
  netAmount: z.ZodString;
1427
1427
  taxAmount: z.ZodString;
1428
1428
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1434,7 +1434,7 @@ declare class GetDeliveryFeesFromPointOfSale extends AbstractApiRequest<typeof g
1434
1434
  max: z.ZodCoercedNumber<unknown>;
1435
1435
  }, z.core.$strip>;
1436
1436
  }, z.core.$strip>, z.ZodObject<{
1437
- amount: z.ZodString;
1437
+ amount: z.ZodDefault<z.ZodString>;
1438
1438
  netAmount: z.ZodString;
1439
1439
  taxAmount: z.ZodString;
1440
1440
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1446,7 +1446,7 @@ declare class GetDeliveryFeesFromPointOfSale extends AbstractApiRequest<typeof g
1446
1446
  max: z.ZodCoercedNumber<unknown>;
1447
1447
  }, z.core.$strip>;
1448
1448
  }, z.core.$strip>, z.ZodObject<{
1449
- amount: z.ZodString;
1449
+ amount: z.ZodDefault<z.ZodString>;
1450
1450
  netAmount: z.ZodString;
1451
1451
  taxAmount: z.ZodString;
1452
1452
  taxRate: z.ZodCoercedNumber<unknown>;
package/dist/index.d.ts CHANGED
@@ -63,7 +63,7 @@ declare const writableDeliveryPositionSchema: z.ZodObject<{
63
63
  }, z.core.$strip>;
64
64
  type WritableDeliveryPosition = z.infer<typeof writableDeliveryPositionSchema>;
65
65
  declare const deliveryFeeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
66
- amount: z.ZodString;
66
+ amount: z.ZodDefault<z.ZodString>;
67
67
  netAmount: z.ZodString;
68
68
  taxAmount: z.ZodString;
69
69
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -75,7 +75,7 @@ declare const deliveryFeeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
75
75
  max: z.ZodCoercedNumber<unknown>;
76
76
  }, z.core.$strip>;
77
77
  }, z.core.$strip>, z.ZodObject<{
78
- amount: z.ZodString;
78
+ amount: z.ZodDefault<z.ZodString>;
79
79
  netAmount: z.ZodString;
80
80
  taxAmount: z.ZodString;
81
81
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -87,7 +87,7 @@ declare const deliveryFeeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
87
87
  max: z.ZodCoercedNumber<unknown>;
88
88
  }, z.core.$strip>;
89
89
  }, z.core.$strip>, z.ZodObject<{
90
- amount: z.ZodString;
90
+ amount: z.ZodDefault<z.ZodString>;
91
91
  netAmount: z.ZodString;
92
92
  taxAmount: z.ZodString;
93
93
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -128,7 +128,7 @@ declare const writableDeliveryFeeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
128
128
  }, z.core.$strip>]>;
129
129
  type WritableDeliveryFee = z.infer<typeof writableDeliveryFeeSchema>;
130
130
  declare const deliveryFeeDetailsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
131
- amount: z.ZodString;
131
+ amount: z.ZodDefault<z.ZodString>;
132
132
  netAmount: z.ZodString;
133
133
  taxAmount: z.ZodString;
134
134
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -142,7 +142,7 @@ declare const deliveryFeeDetailsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
142
142
  max: z.ZodCoercedNumber<unknown>;
143
143
  }, z.core.$strip>;
144
144
  }, z.core.$strip>, z.ZodObject<{
145
- amount: z.ZodString;
145
+ amount: z.ZodDefault<z.ZodString>;
146
146
  netAmount: z.ZodString;
147
147
  taxAmount: z.ZodString;
148
148
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -156,7 +156,7 @@ declare const deliveryFeeDetailsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
156
156
  max: z.ZodCoercedNumber<unknown>;
157
157
  }, z.core.$strip>;
158
158
  }, z.core.$strip>, z.ZodObject<{
159
- amount: z.ZodString;
159
+ amount: z.ZodDefault<z.ZodString>;
160
160
  netAmount: z.ZodString;
161
161
  taxAmount: z.ZodString;
162
162
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -909,7 +909,7 @@ declare const createDeliveryFeeInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
909
909
  }, z.core.$strip>]>;
910
910
  type CreateDeliveryFeeInput = z.input<typeof createDeliveryFeeInputSchema>;
911
911
  declare const createDeliveryFeeResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
912
- amount: z.ZodString;
912
+ amount: z.ZodDefault<z.ZodString>;
913
913
  netAmount: z.ZodString;
914
914
  taxAmount: z.ZodString;
915
915
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -923,7 +923,7 @@ declare const createDeliveryFeeResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObj
923
923
  max: z.ZodCoercedNumber<unknown>;
924
924
  }, z.core.$strip>;
925
925
  }, z.core.$strip>, z.ZodObject<{
926
- amount: z.ZodString;
926
+ amount: z.ZodDefault<z.ZodString>;
927
927
  netAmount: z.ZodString;
928
928
  taxAmount: z.ZodString;
929
929
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -937,7 +937,7 @@ declare const createDeliveryFeeResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObj
937
937
  max: z.ZodCoercedNumber<unknown>;
938
938
  }, z.core.$strip>;
939
939
  }, z.core.$strip>, z.ZodObject<{
940
- amount: z.ZodString;
940
+ amount: z.ZodDefault<z.ZodString>;
941
941
  netAmount: z.ZodString;
942
942
  taxAmount: z.ZodString;
943
943
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -983,7 +983,7 @@ declare class CreateDeliveryFee extends AbstractApiRequest<typeof createDelivery
983
983
  }, z.core.$strip>;
984
984
  }, z.core.$strip>]>;
985
985
  readonly outputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
986
- amount: z.ZodString;
986
+ amount: z.ZodDefault<z.ZodString>;
987
987
  netAmount: z.ZodString;
988
988
  taxAmount: z.ZodString;
989
989
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -997,7 +997,7 @@ declare class CreateDeliveryFee extends AbstractApiRequest<typeof createDelivery
997
997
  max: z.ZodCoercedNumber<unknown>;
998
998
  }, z.core.$strip>;
999
999
  }, z.core.$strip>, z.ZodObject<{
1000
- amount: z.ZodString;
1000
+ amount: z.ZodDefault<z.ZodString>;
1001
1001
  netAmount: z.ZodString;
1002
1002
  taxAmount: z.ZodString;
1003
1003
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1011,7 +1011,7 @@ declare class CreateDeliveryFee extends AbstractApiRequest<typeof createDelivery
1011
1011
  max: z.ZodCoercedNumber<unknown>;
1012
1012
  }, z.core.$strip>;
1013
1013
  }, z.core.$strip>, z.ZodObject<{
1014
- amount: z.ZodString;
1014
+ amount: z.ZodDefault<z.ZodString>;
1015
1015
  netAmount: z.ZodString;
1016
1016
  taxAmount: z.ZodString;
1017
1017
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1048,7 +1048,7 @@ declare class DeleteDeliveryFee extends AbstractApiRequest<typeof deleteDelivery
1048
1048
  declare const getDeliveryFeeDetailsInputSchema: z.ZodUndefined;
1049
1049
  type GetDeliveryFeeDetailsInput = z.infer<typeof getDeliveryFeeDetailsInputSchema>;
1050
1050
  declare const getDeliveryFeeDetailsResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1051
- amount: z.ZodString;
1051
+ amount: z.ZodDefault<z.ZodString>;
1052
1052
  netAmount: z.ZodString;
1053
1053
  taxAmount: z.ZodString;
1054
1054
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1062,7 +1062,7 @@ declare const getDeliveryFeeDetailsResponseSchema: z.ZodDiscriminatedUnion<[z.Zo
1062
1062
  max: z.ZodCoercedNumber<unknown>;
1063
1063
  }, z.core.$strip>;
1064
1064
  }, z.core.$strip>, z.ZodObject<{
1065
- amount: z.ZodString;
1065
+ amount: z.ZodDefault<z.ZodString>;
1066
1066
  netAmount: z.ZodString;
1067
1067
  taxAmount: z.ZodString;
1068
1068
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1076,7 +1076,7 @@ declare const getDeliveryFeeDetailsResponseSchema: z.ZodDiscriminatedUnion<[z.Zo
1076
1076
  max: z.ZodCoercedNumber<unknown>;
1077
1077
  }, z.core.$strip>;
1078
1078
  }, z.core.$strip>, z.ZodObject<{
1079
- amount: z.ZodString;
1079
+ amount: z.ZodDefault<z.ZodString>;
1080
1080
  netAmount: z.ZodString;
1081
1081
  taxAmount: z.ZodString;
1082
1082
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1096,7 +1096,7 @@ declare class GetDeliveryFeeDetails extends AbstractApiRequest<typeof getDeliver
1096
1096
  readonly accept = "application/json";
1097
1097
  readonly inputSchema: z.ZodUndefined;
1098
1098
  readonly outputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1099
- amount: z.ZodString;
1099
+ amount: z.ZodDefault<z.ZodString>;
1100
1100
  netAmount: z.ZodString;
1101
1101
  taxAmount: z.ZodString;
1102
1102
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1110,7 +1110,7 @@ declare class GetDeliveryFeeDetails extends AbstractApiRequest<typeof getDeliver
1110
1110
  max: z.ZodCoercedNumber<unknown>;
1111
1111
  }, z.core.$strip>;
1112
1112
  }, z.core.$strip>, z.ZodObject<{
1113
- amount: z.ZodString;
1113
+ amount: z.ZodDefault<z.ZodString>;
1114
1114
  netAmount: z.ZodString;
1115
1115
  taxAmount: z.ZodString;
1116
1116
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1124,7 +1124,7 @@ declare class GetDeliveryFeeDetails extends AbstractApiRequest<typeof getDeliver
1124
1124
  max: z.ZodCoercedNumber<unknown>;
1125
1125
  }, z.core.$strip>;
1126
1126
  }, z.core.$strip>, z.ZodObject<{
1127
- amount: z.ZodString;
1127
+ amount: z.ZodDefault<z.ZodString>;
1128
1128
  netAmount: z.ZodString;
1129
1129
  taxAmount: z.ZodString;
1130
1130
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1190,7 +1190,7 @@ declare const getDeliveryFeesInputSchema: z.ZodUndefined;
1190
1190
  type GetDeliveryFeesInput = z.infer<typeof getDeliveryFeesInputSchema>;
1191
1191
  declare const getDeliveryFeesResponseSchema: z.ZodObject<{
1192
1192
  data: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1193
- amount: z.ZodString;
1193
+ amount: z.ZodDefault<z.ZodString>;
1194
1194
  netAmount: z.ZodString;
1195
1195
  taxAmount: z.ZodString;
1196
1196
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1202,7 +1202,7 @@ declare const getDeliveryFeesResponseSchema: z.ZodObject<{
1202
1202
  max: z.ZodCoercedNumber<unknown>;
1203
1203
  }, z.core.$strip>;
1204
1204
  }, z.core.$strip>, z.ZodObject<{
1205
- amount: z.ZodString;
1205
+ amount: z.ZodDefault<z.ZodString>;
1206
1206
  netAmount: z.ZodString;
1207
1207
  taxAmount: z.ZodString;
1208
1208
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1214,7 +1214,7 @@ declare const getDeliveryFeesResponseSchema: z.ZodObject<{
1214
1214
  max: z.ZodCoercedNumber<unknown>;
1215
1215
  }, z.core.$strip>;
1216
1216
  }, z.core.$strip>, z.ZodObject<{
1217
- amount: z.ZodString;
1217
+ amount: z.ZodDefault<z.ZodString>;
1218
1218
  netAmount: z.ZodString;
1219
1219
  taxAmount: z.ZodString;
1220
1220
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1242,7 +1242,7 @@ declare class GetDeliveryFees extends AbstractApiRequest<typeof getDeliveryFeesI
1242
1242
  readonly inputSchema: z.ZodUndefined;
1243
1243
  readonly outputSchema: z.ZodObject<{
1244
1244
  data: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1245
- amount: z.ZodString;
1245
+ amount: z.ZodDefault<z.ZodString>;
1246
1246
  netAmount: z.ZodString;
1247
1247
  taxAmount: z.ZodString;
1248
1248
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1254,7 +1254,7 @@ declare class GetDeliveryFees extends AbstractApiRequest<typeof getDeliveryFeesI
1254
1254
  max: z.ZodCoercedNumber<unknown>;
1255
1255
  }, z.core.$strip>;
1256
1256
  }, z.core.$strip>, z.ZodObject<{
1257
- amount: z.ZodString;
1257
+ amount: z.ZodDefault<z.ZodString>;
1258
1258
  netAmount: z.ZodString;
1259
1259
  taxAmount: z.ZodString;
1260
1260
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1266,7 +1266,7 @@ declare class GetDeliveryFees extends AbstractApiRequest<typeof getDeliveryFeesI
1266
1266
  max: z.ZodCoercedNumber<unknown>;
1267
1267
  }, z.core.$strip>;
1268
1268
  }, z.core.$strip>, z.ZodObject<{
1269
- amount: z.ZodString;
1269
+ amount: z.ZodDefault<z.ZodString>;
1270
1270
  netAmount: z.ZodString;
1271
1271
  taxAmount: z.ZodString;
1272
1272
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1380,7 +1380,7 @@ type GetDeliveryFeesFromPointOfSaleQueryParams = z.infer<typeof getDeliveryFeesF
1380
1380
  declare const getDeliveryFeesFromPointOfSaleInputSchema: z.ZodUndefined;
1381
1381
  type GetDeliveryFeesFromPointOfSaleInput = z.infer<typeof getDeliveryFeesFromPointOfSaleInputSchema>;
1382
1382
  declare const getDeliveryFeesFromPointOfSaleResponseSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1383
- amount: z.ZodString;
1383
+ amount: z.ZodDefault<z.ZodString>;
1384
1384
  netAmount: z.ZodString;
1385
1385
  taxAmount: z.ZodString;
1386
1386
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1392,7 +1392,7 @@ declare const getDeliveryFeesFromPointOfSaleResponseSchema: z.ZodArray<z.ZodDisc
1392
1392
  max: z.ZodCoercedNumber<unknown>;
1393
1393
  }, z.core.$strip>;
1394
1394
  }, z.core.$strip>, z.ZodObject<{
1395
- amount: z.ZodString;
1395
+ amount: z.ZodDefault<z.ZodString>;
1396
1396
  netAmount: z.ZodString;
1397
1397
  taxAmount: z.ZodString;
1398
1398
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1404,7 +1404,7 @@ declare const getDeliveryFeesFromPointOfSaleResponseSchema: z.ZodArray<z.ZodDisc
1404
1404
  max: z.ZodCoercedNumber<unknown>;
1405
1405
  }, z.core.$strip>;
1406
1406
  }, z.core.$strip>, z.ZodObject<{
1407
- amount: z.ZodString;
1407
+ amount: z.ZodDefault<z.ZodString>;
1408
1408
  netAmount: z.ZodString;
1409
1409
  taxAmount: z.ZodString;
1410
1410
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1422,7 +1422,7 @@ declare class GetDeliveryFeesFromPointOfSale extends AbstractApiRequest<typeof g
1422
1422
  readonly accept = "application/json";
1423
1423
  readonly inputSchema: z.ZodUndefined;
1424
1424
  readonly outputSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1425
- amount: z.ZodString;
1425
+ amount: z.ZodDefault<z.ZodString>;
1426
1426
  netAmount: z.ZodString;
1427
1427
  taxAmount: z.ZodString;
1428
1428
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1434,7 +1434,7 @@ declare class GetDeliveryFeesFromPointOfSale extends AbstractApiRequest<typeof g
1434
1434
  max: z.ZodCoercedNumber<unknown>;
1435
1435
  }, z.core.$strip>;
1436
1436
  }, z.core.$strip>, z.ZodObject<{
1437
- amount: z.ZodString;
1437
+ amount: z.ZodDefault<z.ZodString>;
1438
1438
  netAmount: z.ZodString;
1439
1439
  taxAmount: z.ZodString;
1440
1440
  taxRate: z.ZodCoercedNumber<unknown>;
@@ -1446,7 +1446,7 @@ declare class GetDeliveryFeesFromPointOfSale extends AbstractApiRequest<typeof g
1446
1446
  max: z.ZodCoercedNumber<unknown>;
1447
1447
  }, z.core.$strip>;
1448
1448
  }, z.core.$strip>, z.ZodObject<{
1449
- amount: z.ZodString;
1449
+ amount: z.ZodDefault<z.ZodString>;
1450
1450
  netAmount: z.ZodString;
1451
1451
  taxAmount: z.ZodString;
1452
1452
  taxRate: z.ZodCoercedNumber<unknown>;
package/dist/index.js CHANGED
@@ -11206,21 +11206,33 @@ var writableDeliveryPositionSchema = deliveryPositionSchema.pick({
11206
11206
  })
11207
11207
  });
11208
11208
  var minMax = external_exports.object({
11209
- min: external_exports.coerce.number().gte(0),
11210
- max: external_exports.coerce.number().gte(0)
11209
+ min: external_exports.coerce.number().gte(0, "min_must_be_gte_0"),
11210
+ max: external_exports.coerce.number().gte(0, "max_must_be_gte_0")
11211
11211
  }).refine((s) => s.max >= s.min, { message: "max_greater_than_min", path: ["max"] });
11212
11212
  var settingsByType = {
11213
11213
  amount: minMax,
11214
11214
  distance: minMax,
11215
11215
  postal_code: external_exports.object({
11216
- values: external_exports.array(external_exports.string().trim()).min(1, "almeno un CAP")
11216
+ values: external_exports.array(external_exports.string().trim()).min(1, "at_least_one_postal_code")
11217
11217
  })
11218
11218
  };
11219
11219
  var commonDeliveryFeeFields = external_exports.object({
11220
- amount: external_exports.string(),
11221
- netAmount: external_exports.string(),
11222
- taxAmount: external_exports.string(),
11223
- taxRate: external_exports.coerce.number(),
11220
+ amount: external_exports.string().default("0.0000").refine((val) => !isNaN(Number(val)), {
11221
+ message: "amount_must_be_a_valid_number"
11222
+ }).refine((val) => Number(val) >= 0, {
11223
+ message: "amount_must_be_gte_0"
11224
+ }),
11225
+ netAmount: external_exports.string().refine((val) => !isNaN(Number(val)), {
11226
+ message: "net_amount_must_be_a_valid_number"
11227
+ }).refine((val) => Number(val) >= 0, {
11228
+ message: "net_amount_must_be_gte_0"
11229
+ }),
11230
+ taxAmount: external_exports.string().refine((val) => !isNaN(Number(val)), {
11231
+ message: "tax_amount_must_be_a_valid_number"
11232
+ }).refine((val) => Number(val) >= 0, {
11233
+ message: "tax_amount_must_be_gte_0"
11234
+ }),
11235
+ taxRate: external_exports.coerce.number().min(0, "tax_rate_must_be_gte_0").describe("The tax rate applied to the delivery fee"),
11224
11236
  createdAt: datetimeSchema,
11225
11237
  updatedAt: datetimeSchema
11226
11238
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deliverart/sdk-js-delivery",
3
3
  "description": "Deliverart JavaScript SDK for Delivery Management",
4
- "version": "2.4.1",
4
+ "version": "2.4.2",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -18,11 +18,11 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "@deliverart/sdk-js-core": "2.4.1",
22
- "@deliverart/sdk-js-order": "2.4.1",
23
- "@deliverart/sdk-js-global-types": "2.3.10",
24
- "@deliverart/sdk-js-point-of-sale": "2.4.1",
25
- "@deliverart/sdk-js-user": "2.4.1"
21
+ "@deliverart/sdk-js-core": "2.4.2",
22
+ "@deliverart/sdk-js-global-types": "2.3.11",
23
+ "@deliverart/sdk-js-order": "2.4.2",
24
+ "@deliverart/sdk-js-point-of-sale": "2.4.2",
25
+ "@deliverart/sdk-js-user": "2.4.2"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"