@deliverart/sdk-js-point-of-sale 0.0.2 → 0.0.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @deliverart/sdk-js-point-of-sale
2
2
 
3
+ ## 0.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 27c1b05: Expose pointOfSale path schema
8
+
3
9
  ## 0.0.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -40,8 +40,10 @@ __export(index_exports, {
40
40
  pointOfSaleCapabilitySchema: () => pointOfSaleCapabilitySchema,
41
41
  pointOfSaleDetailsSchema: () => pointOfSaleDetailsSchema,
42
42
  pointOfSaleIntervalValues: () => pointOfSaleIntervalValues,
43
+ pointOfSaleNullablePathSchema: () => pointOfSaleNullablePathSchema,
43
44
  pointOfSaleOpeningStatusSchema: () => pointOfSaleOpeningStatusSchema,
44
45
  pointOfSaleOpeningStatuses: () => pointOfSaleOpeningStatuses,
46
+ pointOfSalePathSchema: () => pointOfSalePathSchema,
45
47
  pointOfSaleSchema: () => pointOfSaleSchema,
46
48
  pointOfSaleUserRoleSchema: () => pointOfSaleUserRoleSchema,
47
49
  pointOfSaleUserRoles: () => pointOfSaleUserRoles,
@@ -55,6 +57,7 @@ __export(index_exports, {
55
57
  module.exports = __toCommonJS(index_exports);
56
58
 
57
59
  // src/models.ts
60
+ var import_sdk_js_company = require("@deliverart/sdk-js-company");
58
61
  var import_sdk_js_global_types = require("@deliverart/sdk-js-global-types");
59
62
  var import_zod2 = require("zod");
60
63
 
@@ -66,6 +69,18 @@ var pointOfSaleCapabilities = ["DELIVERY_OPTIMIZATION"];
66
69
  var pointOfSaleCapabilitySchema = import_zod.z.enum(pointOfSaleCapabilities);
67
70
  var pointOfSaleUserRoles = ["ROLE_ADMIN", "ROLE_READER"];
68
71
  var pointOfSaleUserRoleSchema = import_zod.z.enum(pointOfSaleUserRoles);
72
+ var pointOfSalePathSchema = import_zod.z.string().refine((val) => /^\/point_of_sales\/[a-z_]+\/[0-9a-fA-F-]{36}$/.test(val), {
73
+ message: "Invalid integration path format"
74
+ });
75
+ var pointOfSaleNullablePathSchema = import_zod.z.string().nullable().refine(
76
+ (val) => {
77
+ if (!val) return true;
78
+ return /^\/point_of_sales\/[a-z_]+\/[0-9a-fA-F-]{36}$/.test(val);
79
+ },
80
+ {
81
+ message: "Invalid integration path format"
82
+ }
83
+ );
69
84
 
70
85
  // src/models.ts
71
86
  var timeSettingSchema = import_zod2.z.object({
@@ -104,9 +119,7 @@ var userPointOfSaleSchema = import_zod2.z.object({
104
119
  var pointOfSaleIntervalValues = [5, 10, 15, 20, 30, 60];
105
120
  var pointOfSaleAutoAcceptOrderValues = [0, 5, 10, 15];
106
121
  var pointOfSaleDetailsSchema = pointOfSaleSchema.extend({
107
- company: import_zod2.z.string().regex(
108
- /^\/companies\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
109
- ),
122
+ company: import_sdk_js_company.companyPathSchema,
110
123
  settings: import_zod2.z.object({
111
124
  menuLocales: import_zod2.z.any().array(),
112
125
  deliveryTimesInterval: import_zod2.z.number().positive().refine((value) => pointOfSaleIntervalValues.includes(value)),
@@ -290,8 +303,10 @@ var UpdatePointOfSale = class extends import_sdk_js_core5.AbstractApiRequest {
290
303
  pointOfSaleCapabilitySchema,
291
304
  pointOfSaleDetailsSchema,
292
305
  pointOfSaleIntervalValues,
306
+ pointOfSaleNullablePathSchema,
293
307
  pointOfSaleOpeningStatusSchema,
294
308
  pointOfSaleOpeningStatuses,
309
+ pointOfSalePathSchema,
295
310
  pointOfSaleSchema,
296
311
  pointOfSaleUserRoleSchema,
297
312
  pointOfSaleUserRoles,
package/dist/index.d.cts CHANGED
@@ -316,7 +316,7 @@ declare const pointOfSaleDetailsSchema: z.ZodObject<{
316
316
  createdAt: z.ZodEffects<z.ZodString, string, string>;
317
317
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
318
318
  } & {
319
- company: z.ZodString;
319
+ company: z.ZodEffects<z.ZodString, string, string>;
320
320
  settings: z.ZodObject<{
321
321
  menuLocales: z.ZodArray<z.ZodAny, "many">;
322
322
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -582,7 +582,7 @@ declare const writablePointOfSaleSchema: z.ZodObject<Pick<{
582
582
  createdAt: z.ZodEffects<z.ZodString, string, string>;
583
583
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
584
584
  } & {
585
- company: z.ZodString;
585
+ company: z.ZodEffects<z.ZodString, string, string>;
586
586
  settings: z.ZodObject<{
587
587
  menuLocales: z.ZodArray<z.ZodAny, "many">;
588
588
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -790,7 +790,7 @@ declare const writablePointOfSaleSchema: z.ZodObject<Pick<{
790
790
  }>;
791
791
  type WritablePointOfSale = z.infer<typeof writablePointOfSaleSchema>;
792
792
  declare const writableCreatePointOfSaleSchema: z.ZodObject<{
793
- company: z.ZodString;
793
+ company: z.ZodEffects<z.ZodString, string, string>;
794
794
  name: z.ZodString;
795
795
  address: z.ZodObject<{
796
796
  line1: z.ZodString;
@@ -1026,7 +1026,7 @@ declare const writableCreatePointOfSaleSchema: z.ZodObject<{
1026
1026
  type WritableCreatePointOfSale = z.infer<typeof writableCreatePointOfSaleSchema>;
1027
1027
 
1028
1028
  declare const createPointOfSaleInputSchema: z.ZodObject<{
1029
- company: z.ZodString;
1029
+ company: z.ZodEffects<z.ZodString, string, string>;
1030
1030
  name: z.ZodString;
1031
1031
  address: z.ZodObject<{
1032
1032
  line1: z.ZodString;
@@ -1301,7 +1301,7 @@ declare const createPointOfSaleResponseSchema: z.ZodObject<{
1301
1301
  createdAt: z.ZodEffects<z.ZodString, string, string>;
1302
1302
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
1303
1303
  } & {
1304
- company: z.ZodString;
1304
+ company: z.ZodEffects<z.ZodString, string, string>;
1305
1305
  settings: z.ZodObject<{
1306
1306
  menuLocales: z.ZodArray<z.ZodAny, "many">;
1307
1307
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -1531,7 +1531,7 @@ declare class CreatePointOfSale extends AbstractApiRequest<CreatePointOfSaleInpu
1531
1531
  readonly contentType = "application/json";
1532
1532
  readonly accept = "application/json";
1533
1533
  readonly inputSchema: z.ZodObject<{
1534
- company: z.ZodString;
1534
+ company: z.ZodEffects<z.ZodString, string, string>;
1535
1535
  name: z.ZodString;
1536
1536
  address: z.ZodObject<{
1537
1537
  line1: z.ZodString;
@@ -1805,7 +1805,7 @@ declare class CreatePointOfSale extends AbstractApiRequest<CreatePointOfSaleInpu
1805
1805
  createdAt: z.ZodEffects<z.ZodString, string, string>;
1806
1806
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
1807
1807
  } & {
1808
- company: z.ZodString;
1808
+ company: z.ZodEffects<z.ZodString, string, string>;
1809
1809
  settings: z.ZodObject<{
1810
1810
  menuLocales: z.ZodArray<z.ZodAny, "many">;
1811
1811
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -2092,7 +2092,7 @@ declare const getPointOfSaleDetailsResponseSchema: z.ZodObject<{
2092
2092
  createdAt: z.ZodEffects<z.ZodString, string, string>;
2093
2093
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
2094
2094
  } & {
2095
- company: z.ZodString;
2095
+ company: z.ZodEffects<z.ZodString, string, string>;
2096
2096
  settings: z.ZodObject<{
2097
2097
  menuLocales: z.ZodArray<z.ZodAny, "many">;
2098
2098
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -2363,7 +2363,7 @@ declare class GetPointOfSaleDetails extends AbstractApiRequest<void, GetPointOfS
2363
2363
  createdAt: z.ZodEffects<z.ZodString, string, string>;
2364
2364
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
2365
2365
  } & {
2366
- company: z.ZodString;
2366
+ company: z.ZodEffects<z.ZodString, string, string>;
2367
2367
  settings: z.ZodObject<{
2368
2368
  menuLocales: z.ZodArray<z.ZodAny, "many">;
2369
2369
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -3275,7 +3275,7 @@ declare const updatePointOfSaleResponseSchema: z.ZodObject<{
3275
3275
  createdAt: z.ZodEffects<z.ZodString, string, string>;
3276
3276
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
3277
3277
  } & {
3278
- company: z.ZodString;
3278
+ company: z.ZodEffects<z.ZodString, string, string>;
3279
3279
  settings: z.ZodObject<{
3280
3280
  menuLocales: z.ZodArray<z.ZodAny, "many">;
3281
3281
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -3776,7 +3776,7 @@ declare class UpdatePointOfSale extends AbstractApiRequest<UpdatePointOfSaleInpu
3776
3776
  createdAt: z.ZodEffects<z.ZodString, string, string>;
3777
3777
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
3778
3778
  } & {
3779
- company: z.ZodString;
3779
+ company: z.ZodEffects<z.ZodString, string, string>;
3780
3780
  settings: z.ZodObject<{
3781
3781
  menuLocales: z.ZodArray<z.ZodAny, "many">;
3782
3782
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -4016,5 +4016,9 @@ type PointOfSaleCapability = z.infer<typeof pointOfSaleCapabilitySchema>;
4016
4016
  declare const pointOfSaleUserRoles: readonly ["ROLE_ADMIN", "ROLE_READER"];
4017
4017
  declare const pointOfSaleUserRoleSchema: z.ZodEnum<["ROLE_ADMIN", "ROLE_READER"]>;
4018
4018
  type PointOfSaleUserRole = z.infer<typeof pointOfSaleUserRoleSchema>;
4019
+ declare const pointOfSalePathSchema: z.ZodEffects<z.ZodString, string, string>;
4020
+ type PointOfSalePath = z.infer<typeof pointOfSalePathSchema>;
4021
+ declare const pointOfSaleNullablePathSchema: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, string | null>;
4022
+ type PointOfSaleNullablePath = z.infer<typeof pointOfSaleNullablePathSchema>;
4019
4023
 
4020
- export { CreatePointOfSale, type CreatePointOfSaleInput, type CreatePointOfSaleResponse, DeletePointOfSale, type DeliveryTimeSetting, GetPointOfSaleDetails, type GetPointOfSaleDetailsResponse, GetPointOfSales, type GetPointOfSalesQueryParams, type GetPointOfSalesResponse, type PointOfSale, type PointOfSaleCapability, type PointOfSaleDetails, type PointOfSaleOpeningStatus, type PointOfSaleUserRole, type TimeSetting, UpdatePointOfSale, type UpdatePointOfSaleInput, type UpdatePointOfSaleResponse, type UserPointOfSale, type WritableCreatePointOfSale, type WritablePointOfSale, createPointOfSaleInputSchema, createPointOfSaleResponseSchema, deletePointOfSaleInputSchema, deletePointOfSaleResponseSchema, deliveryTimeSettingSchema, getPointOfSaleDetailsInputSchema, getPointOfSaleDetailsResponseSchema, getPointOfSalesInputSchema, getPointOfSalesQuerySchema, getPointOfSalesResponseSchema, pointOfSaleAutoAcceptOrderValues, pointOfSaleCapabilities, pointOfSaleCapabilitySchema, pointOfSaleDetailsSchema, pointOfSaleIntervalValues, pointOfSaleOpeningStatusSchema, pointOfSaleOpeningStatuses, pointOfSaleSchema, pointOfSaleUserRoleSchema, pointOfSaleUserRoles, timeSettingSchema, updatePointOfSaleInputSchema, updatePointOfSaleResponseSchema, userPointOfSaleSchema, writableCreatePointOfSaleSchema, writablePointOfSaleSchema };
4024
+ export { CreatePointOfSale, type CreatePointOfSaleInput, type CreatePointOfSaleResponse, DeletePointOfSale, type DeliveryTimeSetting, GetPointOfSaleDetails, type GetPointOfSaleDetailsResponse, GetPointOfSales, type GetPointOfSalesQueryParams, type GetPointOfSalesResponse, type PointOfSale, type PointOfSaleCapability, type PointOfSaleDetails, type PointOfSaleNullablePath, type PointOfSaleOpeningStatus, type PointOfSalePath, type PointOfSaleUserRole, type TimeSetting, UpdatePointOfSale, type UpdatePointOfSaleInput, type UpdatePointOfSaleResponse, type UserPointOfSale, type WritableCreatePointOfSale, type WritablePointOfSale, createPointOfSaleInputSchema, createPointOfSaleResponseSchema, deletePointOfSaleInputSchema, deletePointOfSaleResponseSchema, deliveryTimeSettingSchema, getPointOfSaleDetailsInputSchema, getPointOfSaleDetailsResponseSchema, getPointOfSalesInputSchema, getPointOfSalesQuerySchema, getPointOfSalesResponseSchema, pointOfSaleAutoAcceptOrderValues, pointOfSaleCapabilities, pointOfSaleCapabilitySchema, pointOfSaleDetailsSchema, pointOfSaleIntervalValues, pointOfSaleNullablePathSchema, pointOfSaleOpeningStatusSchema, pointOfSaleOpeningStatuses, pointOfSalePathSchema, pointOfSaleSchema, pointOfSaleUserRoleSchema, pointOfSaleUserRoles, timeSettingSchema, updatePointOfSaleInputSchema, updatePointOfSaleResponseSchema, userPointOfSaleSchema, writableCreatePointOfSaleSchema, writablePointOfSaleSchema };
package/dist/index.d.ts CHANGED
@@ -316,7 +316,7 @@ declare const pointOfSaleDetailsSchema: z.ZodObject<{
316
316
  createdAt: z.ZodEffects<z.ZodString, string, string>;
317
317
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
318
318
  } & {
319
- company: z.ZodString;
319
+ company: z.ZodEffects<z.ZodString, string, string>;
320
320
  settings: z.ZodObject<{
321
321
  menuLocales: z.ZodArray<z.ZodAny, "many">;
322
322
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -582,7 +582,7 @@ declare const writablePointOfSaleSchema: z.ZodObject<Pick<{
582
582
  createdAt: z.ZodEffects<z.ZodString, string, string>;
583
583
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
584
584
  } & {
585
- company: z.ZodString;
585
+ company: z.ZodEffects<z.ZodString, string, string>;
586
586
  settings: z.ZodObject<{
587
587
  menuLocales: z.ZodArray<z.ZodAny, "many">;
588
588
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -790,7 +790,7 @@ declare const writablePointOfSaleSchema: z.ZodObject<Pick<{
790
790
  }>;
791
791
  type WritablePointOfSale = z.infer<typeof writablePointOfSaleSchema>;
792
792
  declare const writableCreatePointOfSaleSchema: z.ZodObject<{
793
- company: z.ZodString;
793
+ company: z.ZodEffects<z.ZodString, string, string>;
794
794
  name: z.ZodString;
795
795
  address: z.ZodObject<{
796
796
  line1: z.ZodString;
@@ -1026,7 +1026,7 @@ declare const writableCreatePointOfSaleSchema: z.ZodObject<{
1026
1026
  type WritableCreatePointOfSale = z.infer<typeof writableCreatePointOfSaleSchema>;
1027
1027
 
1028
1028
  declare const createPointOfSaleInputSchema: z.ZodObject<{
1029
- company: z.ZodString;
1029
+ company: z.ZodEffects<z.ZodString, string, string>;
1030
1030
  name: z.ZodString;
1031
1031
  address: z.ZodObject<{
1032
1032
  line1: z.ZodString;
@@ -1301,7 +1301,7 @@ declare const createPointOfSaleResponseSchema: z.ZodObject<{
1301
1301
  createdAt: z.ZodEffects<z.ZodString, string, string>;
1302
1302
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
1303
1303
  } & {
1304
- company: z.ZodString;
1304
+ company: z.ZodEffects<z.ZodString, string, string>;
1305
1305
  settings: z.ZodObject<{
1306
1306
  menuLocales: z.ZodArray<z.ZodAny, "many">;
1307
1307
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -1531,7 +1531,7 @@ declare class CreatePointOfSale extends AbstractApiRequest<CreatePointOfSaleInpu
1531
1531
  readonly contentType = "application/json";
1532
1532
  readonly accept = "application/json";
1533
1533
  readonly inputSchema: z.ZodObject<{
1534
- company: z.ZodString;
1534
+ company: z.ZodEffects<z.ZodString, string, string>;
1535
1535
  name: z.ZodString;
1536
1536
  address: z.ZodObject<{
1537
1537
  line1: z.ZodString;
@@ -1805,7 +1805,7 @@ declare class CreatePointOfSale extends AbstractApiRequest<CreatePointOfSaleInpu
1805
1805
  createdAt: z.ZodEffects<z.ZodString, string, string>;
1806
1806
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
1807
1807
  } & {
1808
- company: z.ZodString;
1808
+ company: z.ZodEffects<z.ZodString, string, string>;
1809
1809
  settings: z.ZodObject<{
1810
1810
  menuLocales: z.ZodArray<z.ZodAny, "many">;
1811
1811
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -2092,7 +2092,7 @@ declare const getPointOfSaleDetailsResponseSchema: z.ZodObject<{
2092
2092
  createdAt: z.ZodEffects<z.ZodString, string, string>;
2093
2093
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
2094
2094
  } & {
2095
- company: z.ZodString;
2095
+ company: z.ZodEffects<z.ZodString, string, string>;
2096
2096
  settings: z.ZodObject<{
2097
2097
  menuLocales: z.ZodArray<z.ZodAny, "many">;
2098
2098
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -2363,7 +2363,7 @@ declare class GetPointOfSaleDetails extends AbstractApiRequest<void, GetPointOfS
2363
2363
  createdAt: z.ZodEffects<z.ZodString, string, string>;
2364
2364
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
2365
2365
  } & {
2366
- company: z.ZodString;
2366
+ company: z.ZodEffects<z.ZodString, string, string>;
2367
2367
  settings: z.ZodObject<{
2368
2368
  menuLocales: z.ZodArray<z.ZodAny, "many">;
2369
2369
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -3275,7 +3275,7 @@ declare const updatePointOfSaleResponseSchema: z.ZodObject<{
3275
3275
  createdAt: z.ZodEffects<z.ZodString, string, string>;
3276
3276
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
3277
3277
  } & {
3278
- company: z.ZodString;
3278
+ company: z.ZodEffects<z.ZodString, string, string>;
3279
3279
  settings: z.ZodObject<{
3280
3280
  menuLocales: z.ZodArray<z.ZodAny, "many">;
3281
3281
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -3776,7 +3776,7 @@ declare class UpdatePointOfSale extends AbstractApiRequest<UpdatePointOfSaleInpu
3776
3776
  createdAt: z.ZodEffects<z.ZodString, string, string>;
3777
3777
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
3778
3778
  } & {
3779
- company: z.ZodString;
3779
+ company: z.ZodEffects<z.ZodString, string, string>;
3780
3780
  settings: z.ZodObject<{
3781
3781
  menuLocales: z.ZodArray<z.ZodAny, "many">;
3782
3782
  deliveryTimesInterval: z.ZodEffects<z.ZodNumber, number, number>;
@@ -4016,5 +4016,9 @@ type PointOfSaleCapability = z.infer<typeof pointOfSaleCapabilitySchema>;
4016
4016
  declare const pointOfSaleUserRoles: readonly ["ROLE_ADMIN", "ROLE_READER"];
4017
4017
  declare const pointOfSaleUserRoleSchema: z.ZodEnum<["ROLE_ADMIN", "ROLE_READER"]>;
4018
4018
  type PointOfSaleUserRole = z.infer<typeof pointOfSaleUserRoleSchema>;
4019
+ declare const pointOfSalePathSchema: z.ZodEffects<z.ZodString, string, string>;
4020
+ type PointOfSalePath = z.infer<typeof pointOfSalePathSchema>;
4021
+ declare const pointOfSaleNullablePathSchema: z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, string | null>;
4022
+ type PointOfSaleNullablePath = z.infer<typeof pointOfSaleNullablePathSchema>;
4019
4023
 
4020
- export { CreatePointOfSale, type CreatePointOfSaleInput, type CreatePointOfSaleResponse, DeletePointOfSale, type DeliveryTimeSetting, GetPointOfSaleDetails, type GetPointOfSaleDetailsResponse, GetPointOfSales, type GetPointOfSalesQueryParams, type GetPointOfSalesResponse, type PointOfSale, type PointOfSaleCapability, type PointOfSaleDetails, type PointOfSaleOpeningStatus, type PointOfSaleUserRole, type TimeSetting, UpdatePointOfSale, type UpdatePointOfSaleInput, type UpdatePointOfSaleResponse, type UserPointOfSale, type WritableCreatePointOfSale, type WritablePointOfSale, createPointOfSaleInputSchema, createPointOfSaleResponseSchema, deletePointOfSaleInputSchema, deletePointOfSaleResponseSchema, deliveryTimeSettingSchema, getPointOfSaleDetailsInputSchema, getPointOfSaleDetailsResponseSchema, getPointOfSalesInputSchema, getPointOfSalesQuerySchema, getPointOfSalesResponseSchema, pointOfSaleAutoAcceptOrderValues, pointOfSaleCapabilities, pointOfSaleCapabilitySchema, pointOfSaleDetailsSchema, pointOfSaleIntervalValues, pointOfSaleOpeningStatusSchema, pointOfSaleOpeningStatuses, pointOfSaleSchema, pointOfSaleUserRoleSchema, pointOfSaleUserRoles, timeSettingSchema, updatePointOfSaleInputSchema, updatePointOfSaleResponseSchema, userPointOfSaleSchema, writableCreatePointOfSaleSchema, writablePointOfSaleSchema };
4024
+ export { CreatePointOfSale, type CreatePointOfSaleInput, type CreatePointOfSaleResponse, DeletePointOfSale, type DeliveryTimeSetting, GetPointOfSaleDetails, type GetPointOfSaleDetailsResponse, GetPointOfSales, type GetPointOfSalesQueryParams, type GetPointOfSalesResponse, type PointOfSale, type PointOfSaleCapability, type PointOfSaleDetails, type PointOfSaleNullablePath, type PointOfSaleOpeningStatus, type PointOfSalePath, type PointOfSaleUserRole, type TimeSetting, UpdatePointOfSale, type UpdatePointOfSaleInput, type UpdatePointOfSaleResponse, type UserPointOfSale, type WritableCreatePointOfSale, type WritablePointOfSale, createPointOfSaleInputSchema, createPointOfSaleResponseSchema, deletePointOfSaleInputSchema, deletePointOfSaleResponseSchema, deliveryTimeSettingSchema, getPointOfSaleDetailsInputSchema, getPointOfSaleDetailsResponseSchema, getPointOfSalesInputSchema, getPointOfSalesQuerySchema, getPointOfSalesResponseSchema, pointOfSaleAutoAcceptOrderValues, pointOfSaleCapabilities, pointOfSaleCapabilitySchema, pointOfSaleDetailsSchema, pointOfSaleIntervalValues, pointOfSaleNullablePathSchema, pointOfSaleOpeningStatusSchema, pointOfSaleOpeningStatuses, pointOfSalePathSchema, pointOfSaleSchema, pointOfSaleUserRoleSchema, pointOfSaleUserRoles, timeSettingSchema, updatePointOfSaleInputSchema, updatePointOfSaleResponseSchema, userPointOfSaleSchema, writableCreatePointOfSaleSchema, writablePointOfSaleSchema };
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // src/models.ts
2
+ import { companyPathSchema } from "@deliverart/sdk-js-company";
2
3
  import { addressSchema, datetimeSchema, dayOfWeekSchema } from "@deliverart/sdk-js-global-types";
3
4
  import { z as z2 } from "zod";
4
5
 
@@ -10,6 +11,18 @@ var pointOfSaleCapabilities = ["DELIVERY_OPTIMIZATION"];
10
11
  var pointOfSaleCapabilitySchema = z.enum(pointOfSaleCapabilities);
11
12
  var pointOfSaleUserRoles = ["ROLE_ADMIN", "ROLE_READER"];
12
13
  var pointOfSaleUserRoleSchema = z.enum(pointOfSaleUserRoles);
14
+ var pointOfSalePathSchema = z.string().refine((val) => /^\/point_of_sales\/[a-z_]+\/[0-9a-fA-F-]{36}$/.test(val), {
15
+ message: "Invalid integration path format"
16
+ });
17
+ var pointOfSaleNullablePathSchema = z.string().nullable().refine(
18
+ (val) => {
19
+ if (!val) return true;
20
+ return /^\/point_of_sales\/[a-z_]+\/[0-9a-fA-F-]{36}$/.test(val);
21
+ },
22
+ {
23
+ message: "Invalid integration path format"
24
+ }
25
+ );
13
26
 
14
27
  // src/models.ts
15
28
  var timeSettingSchema = z2.object({
@@ -48,9 +61,7 @@ var userPointOfSaleSchema = z2.object({
48
61
  var pointOfSaleIntervalValues = [5, 10, 15, 20, 30, 60];
49
62
  var pointOfSaleAutoAcceptOrderValues = [0, 5, 10, 15];
50
63
  var pointOfSaleDetailsSchema = pointOfSaleSchema.extend({
51
- company: z2.string().regex(
52
- /^\/companies\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
53
- ),
64
+ company: companyPathSchema,
54
65
  settings: z2.object({
55
66
  menuLocales: z2.any().array(),
56
67
  deliveryTimesInterval: z2.number().positive().refine((value) => pointOfSaleIntervalValues.includes(value)),
@@ -237,8 +248,10 @@ export {
237
248
  pointOfSaleCapabilitySchema,
238
249
  pointOfSaleDetailsSchema,
239
250
  pointOfSaleIntervalValues,
251
+ pointOfSaleNullablePathSchema,
240
252
  pointOfSaleOpeningStatusSchema,
241
253
  pointOfSaleOpeningStatuses,
254
+ pointOfSalePathSchema,
242
255
  pointOfSaleSchema,
243
256
  pointOfSaleUserRoleSchema,
244
257
  pointOfSaleUserRoles,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deliverart/sdk-js-point-of-sale",
3
3
  "description": "Deliverart JavaScript SDK for Point of Sale Management",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -12,10 +12,11 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "zod": "3.25.67",
16
- "axios": "1.9.0",
15
+ "@deliverart/sdk-js-company": "0.0.6",
17
16
  "@deliverart/sdk-js-core": "0.1.3",
18
- "@deliverart/sdk-js-global-types": "0.0.12"
17
+ "@deliverart/sdk-js-global-types": "0.0.12",
18
+ "axios": "1.9.0",
19
+ "zod": "3.25.67"
19
20
  },
20
21
  "devDependencies": {
21
22
  "@changesets/cli": "^2.29.4",
package/src/models.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { companyPathSchema } from '@deliverart/sdk-js-company'
1
2
  import { addressSchema, datetimeSchema, dayOfWeekSchema } from '@deliverart/sdk-js-global-types'
2
3
  import { z } from 'zod'
3
4
 
@@ -56,11 +57,7 @@ export const pointOfSaleIntervalValues = [5, 10, 15, 20, 30, 60]
56
57
  export const pointOfSaleAutoAcceptOrderValues = [0, 5, 10, 15]
57
58
 
58
59
  export const pointOfSaleDetailsSchema = pointOfSaleSchema.extend({
59
- company: z
60
- .string()
61
- .regex(
62
- /^\/companies\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
63
- ),
60
+ company: companyPathSchema,
64
61
  settings: z.object({
65
62
  menuLocales: z.any().array(),
66
63
  deliveryTimesInterval: z
package/src/types.ts CHANGED
@@ -11,3 +11,24 @@ export type PointOfSaleCapability = z.infer<typeof pointOfSaleCapabilitySchema>
11
11
  export const pointOfSaleUserRoles = ['ROLE_ADMIN', 'ROLE_READER'] as const
12
12
  export const pointOfSaleUserRoleSchema = z.enum(pointOfSaleUserRoles)
13
13
  export type PointOfSaleUserRole = z.infer<typeof pointOfSaleUserRoleSchema>
14
+
15
+ export const pointOfSalePathSchema = z
16
+ .string()
17
+ .refine(val => /^\/point_of_sales\/[a-z_]+\/[0-9a-fA-F-]{36}$/.test(val), {
18
+ message: 'Invalid integration path format',
19
+ })
20
+ export type PointOfSalePath = z.infer<typeof pointOfSalePathSchema>
21
+
22
+ export const pointOfSaleNullablePathSchema = z
23
+ .string()
24
+ .nullable()
25
+ .refine(
26
+ val => {
27
+ if (!val) return true
28
+ return /^\/point_of_sales\/[a-z_]+\/[0-9a-fA-F-]{36}$/.test(val)
29
+ },
30
+ {
31
+ message: 'Invalid integration path format',
32
+ },
33
+ )
34
+ export type PointOfSaleNullablePath = z.infer<typeof pointOfSaleNullablePathSchema>