@deliverart/sdk-js-point-of-sale 0.0.1 → 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 +13 -0
- package/dist/index.cjs +30 -15
- package/dist/index.d.cts +23 -19
- package/dist/index.d.ts +23 -19
- package/dist/index.js +25 -12
- package/package.json +5 -4
- package/src/models.ts +2 -5
- package/src/requests/GetPointOfSales.ts +11 -11
- package/src/types.ts +21 -0
package/CHANGELOG.md
ADDED
package/dist/index.cjs
CHANGED
|
@@ -30,18 +30,20 @@ __export(index_exports, {
|
|
|
30
30
|
deletePointOfSaleInputSchema: () => deletePointOfSaleInputSchema,
|
|
31
31
|
deletePointOfSaleResponseSchema: () => deletePointOfSaleResponseSchema,
|
|
32
32
|
deliveryTimeSettingSchema: () => deliveryTimeSettingSchema,
|
|
33
|
-
getCompaniesInputSchema: () => getCompaniesInputSchema,
|
|
34
|
-
getCompaniesQuerySchema: () => getCompaniesQuerySchema,
|
|
35
|
-
getCompaniesResponseSchema: () => getCompaniesResponseSchema,
|
|
36
33
|
getPointOfSaleDetailsInputSchema: () => getPointOfSaleDetailsInputSchema,
|
|
37
34
|
getPointOfSaleDetailsResponseSchema: () => getPointOfSaleDetailsResponseSchema,
|
|
35
|
+
getPointOfSalesInputSchema: () => getPointOfSalesInputSchema,
|
|
36
|
+
getPointOfSalesQuerySchema: () => getPointOfSalesQuerySchema,
|
|
37
|
+
getPointOfSalesResponseSchema: () => getPointOfSalesResponseSchema,
|
|
38
38
|
pointOfSaleAutoAcceptOrderValues: () => pointOfSaleAutoAcceptOrderValues,
|
|
39
39
|
pointOfSaleCapabilities: () => pointOfSaleCapabilities,
|
|
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:
|
|
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)),
|
|
@@ -211,7 +224,7 @@ var GetPointOfSaleDetails = class extends import_sdk_js_core3.AbstractApiRequest
|
|
|
211
224
|
var import_sdk_js_core4 = require("@deliverart/sdk-js-core");
|
|
212
225
|
var import_sdk_js_global_types2 = require("@deliverart/sdk-js-global-types");
|
|
213
226
|
var import_zod5 = require("zod");
|
|
214
|
-
var
|
|
227
|
+
var getPointOfSalesQuerySchema = import_zod5.z.object({
|
|
215
228
|
name: import_zod5.z.string().optional(),
|
|
216
229
|
openingStatus: pointOfSaleOpeningStatusSchema.optional(),
|
|
217
230
|
"integrationActivationRequests.connectionId": import_zod5.z.string().optional(),
|
|
@@ -222,15 +235,15 @@ var getCompaniesQuerySchema = import_zod5.z.object({
|
|
|
222
235
|
"order[updatedAt]": import_sdk_js_global_types2.sortDirSchema.optional(),
|
|
223
236
|
page: import_zod5.z.coerce.number().optional()
|
|
224
237
|
});
|
|
225
|
-
var
|
|
226
|
-
var
|
|
238
|
+
var getPointOfSalesResponseSchema = (0, import_sdk_js_global_types2.createPaginatedSchema)(pointOfSaleSchema);
|
|
239
|
+
var getPointOfSalesInputSchema = import_zod5.z.undefined();
|
|
227
240
|
var GetPointOfSales = class extends import_sdk_js_core4.AbstractApiRequest {
|
|
228
241
|
method = "GET";
|
|
229
242
|
contentType = "application/json";
|
|
230
243
|
accept = "application/json";
|
|
231
|
-
inputSchema =
|
|
232
|
-
outputSchema =
|
|
233
|
-
querySchema =
|
|
244
|
+
inputSchema = getPointOfSalesInputSchema;
|
|
245
|
+
outputSchema = getPointOfSalesResponseSchema;
|
|
246
|
+
querySchema = getPointOfSalesQuerySchema;
|
|
234
247
|
headersSchema = void 0;
|
|
235
248
|
constructor(options) {
|
|
236
249
|
super(void 0, options);
|
|
@@ -280,18 +293,20 @@ var UpdatePointOfSale = class extends import_sdk_js_core5.AbstractApiRequest {
|
|
|
280
293
|
deletePointOfSaleInputSchema,
|
|
281
294
|
deletePointOfSaleResponseSchema,
|
|
282
295
|
deliveryTimeSettingSchema,
|
|
283
|
-
getCompaniesInputSchema,
|
|
284
|
-
getCompaniesQuerySchema,
|
|
285
|
-
getCompaniesResponseSchema,
|
|
286
296
|
getPointOfSaleDetailsInputSchema,
|
|
287
297
|
getPointOfSaleDetailsResponseSchema,
|
|
298
|
+
getPointOfSalesInputSchema,
|
|
299
|
+
getPointOfSalesQuerySchema,
|
|
300
|
+
getPointOfSalesResponseSchema,
|
|
288
301
|
pointOfSaleAutoAcceptOrderValues,
|
|
289
302
|
pointOfSaleCapabilities,
|
|
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>;
|
|
@@ -2594,7 +2594,7 @@ declare class GetPointOfSaleDetails extends AbstractApiRequest<void, GetPointOfS
|
|
|
2594
2594
|
getPath(): string;
|
|
2595
2595
|
}
|
|
2596
2596
|
|
|
2597
|
-
declare const
|
|
2597
|
+
declare const getPointOfSalesQuerySchema: z.ZodObject<{
|
|
2598
2598
|
name: z.ZodOptional<z.ZodString>;
|
|
2599
2599
|
openingStatus: z.ZodOptional<z.ZodEnum<["OPEN", "CLOSED"]>>;
|
|
2600
2600
|
'integrationActivationRequests.connectionId': z.ZodOptional<z.ZodString>;
|
|
@@ -2625,8 +2625,8 @@ declare const getCompaniesQuerySchema: z.ZodObject<{
|
|
|
2625
2625
|
'order[updatedAt]'?: "asc" | "desc" | undefined;
|
|
2626
2626
|
page?: number | undefined;
|
|
2627
2627
|
}>;
|
|
2628
|
-
type
|
|
2629
|
-
declare const
|
|
2628
|
+
type GetPointOfSalesQueryParams = z.infer<typeof getPointOfSalesQuerySchema>;
|
|
2629
|
+
declare const getPointOfSalesResponseSchema: z.ZodObject<{
|
|
2630
2630
|
data: z.ZodArray<z.ZodObject<{
|
|
2631
2631
|
id: z.ZodString;
|
|
2632
2632
|
name: z.ZodString;
|
|
@@ -2791,9 +2791,9 @@ declare const getCompaniesResponseSchema: z.ZodObject<{
|
|
|
2791
2791
|
lastPage: number;
|
|
2792
2792
|
};
|
|
2793
2793
|
}>;
|
|
2794
|
-
type
|
|
2795
|
-
declare const
|
|
2796
|
-
declare class GetPointOfSales extends AbstractApiRequest<void,
|
|
2794
|
+
type GetPointOfSalesResponse = z.infer<typeof getPointOfSalesResponseSchema>;
|
|
2795
|
+
declare const getPointOfSalesInputSchema: z.ZodUndefined;
|
|
2796
|
+
declare class GetPointOfSales extends AbstractApiRequest<void, GetPointOfSalesResponse, GetPointOfSalesQueryParams> {
|
|
2797
2797
|
readonly method = "GET";
|
|
2798
2798
|
readonly contentType = "application/json";
|
|
2799
2799
|
readonly accept = "application/json";
|
|
@@ -2996,7 +2996,7 @@ declare class GetPointOfSales extends AbstractApiRequest<void, GetCompaniesRespo
|
|
|
2996
2996
|
}>;
|
|
2997
2997
|
readonly headersSchema: undefined;
|
|
2998
2998
|
constructor(options?: {
|
|
2999
|
-
query?:
|
|
2999
|
+
query?: GetPointOfSalesQueryParams;
|
|
3000
3000
|
});
|
|
3001
3001
|
getPath(): string;
|
|
3002
3002
|
parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<PointOfSale>;
|
|
@@ -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,
|
|
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>;
|
|
@@ -2594,7 +2594,7 @@ declare class GetPointOfSaleDetails extends AbstractApiRequest<void, GetPointOfS
|
|
|
2594
2594
|
getPath(): string;
|
|
2595
2595
|
}
|
|
2596
2596
|
|
|
2597
|
-
declare const
|
|
2597
|
+
declare const getPointOfSalesQuerySchema: z.ZodObject<{
|
|
2598
2598
|
name: z.ZodOptional<z.ZodString>;
|
|
2599
2599
|
openingStatus: z.ZodOptional<z.ZodEnum<["OPEN", "CLOSED"]>>;
|
|
2600
2600
|
'integrationActivationRequests.connectionId': z.ZodOptional<z.ZodString>;
|
|
@@ -2625,8 +2625,8 @@ declare const getCompaniesQuerySchema: z.ZodObject<{
|
|
|
2625
2625
|
'order[updatedAt]'?: "asc" | "desc" | undefined;
|
|
2626
2626
|
page?: number | undefined;
|
|
2627
2627
|
}>;
|
|
2628
|
-
type
|
|
2629
|
-
declare const
|
|
2628
|
+
type GetPointOfSalesQueryParams = z.infer<typeof getPointOfSalesQuerySchema>;
|
|
2629
|
+
declare const getPointOfSalesResponseSchema: z.ZodObject<{
|
|
2630
2630
|
data: z.ZodArray<z.ZodObject<{
|
|
2631
2631
|
id: z.ZodString;
|
|
2632
2632
|
name: z.ZodString;
|
|
@@ -2791,9 +2791,9 @@ declare const getCompaniesResponseSchema: z.ZodObject<{
|
|
|
2791
2791
|
lastPage: number;
|
|
2792
2792
|
};
|
|
2793
2793
|
}>;
|
|
2794
|
-
type
|
|
2795
|
-
declare const
|
|
2796
|
-
declare class GetPointOfSales extends AbstractApiRequest<void,
|
|
2794
|
+
type GetPointOfSalesResponse = z.infer<typeof getPointOfSalesResponseSchema>;
|
|
2795
|
+
declare const getPointOfSalesInputSchema: z.ZodUndefined;
|
|
2796
|
+
declare class GetPointOfSales extends AbstractApiRequest<void, GetPointOfSalesResponse, GetPointOfSalesQueryParams> {
|
|
2797
2797
|
readonly method = "GET";
|
|
2798
2798
|
readonly contentType = "application/json";
|
|
2799
2799
|
readonly accept = "application/json";
|
|
@@ -2996,7 +2996,7 @@ declare class GetPointOfSales extends AbstractApiRequest<void, GetCompaniesRespo
|
|
|
2996
2996
|
}>;
|
|
2997
2997
|
readonly headersSchema: undefined;
|
|
2998
2998
|
constructor(options?: {
|
|
2999
|
-
query?:
|
|
2999
|
+
query?: GetPointOfSalesQueryParams;
|
|
3000
3000
|
});
|
|
3001
3001
|
getPath(): string;
|
|
3002
3002
|
parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<PointOfSale>;
|
|
@@ -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,
|
|
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:
|
|
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)),
|
|
@@ -159,7 +170,7 @@ import {
|
|
|
159
170
|
sortDirSchema
|
|
160
171
|
} from "@deliverart/sdk-js-global-types";
|
|
161
172
|
import { z as z5 } from "zod";
|
|
162
|
-
var
|
|
173
|
+
var getPointOfSalesQuerySchema = z5.object({
|
|
163
174
|
name: z5.string().optional(),
|
|
164
175
|
openingStatus: pointOfSaleOpeningStatusSchema.optional(),
|
|
165
176
|
"integrationActivationRequests.connectionId": z5.string().optional(),
|
|
@@ -170,15 +181,15 @@ var getCompaniesQuerySchema = z5.object({
|
|
|
170
181
|
"order[updatedAt]": sortDirSchema.optional(),
|
|
171
182
|
page: z5.coerce.number().optional()
|
|
172
183
|
});
|
|
173
|
-
var
|
|
174
|
-
var
|
|
184
|
+
var getPointOfSalesResponseSchema = createPaginatedSchema(pointOfSaleSchema);
|
|
185
|
+
var getPointOfSalesInputSchema = z5.undefined();
|
|
175
186
|
var GetPointOfSales = class extends AbstractApiRequest4 {
|
|
176
187
|
method = "GET";
|
|
177
188
|
contentType = "application/json";
|
|
178
189
|
accept = "application/json";
|
|
179
|
-
inputSchema =
|
|
180
|
-
outputSchema =
|
|
181
|
-
querySchema =
|
|
190
|
+
inputSchema = getPointOfSalesInputSchema;
|
|
191
|
+
outputSchema = getPointOfSalesResponseSchema;
|
|
192
|
+
querySchema = getPointOfSalesQuerySchema;
|
|
182
193
|
headersSchema = void 0;
|
|
183
194
|
constructor(options) {
|
|
184
195
|
super(void 0, options);
|
|
@@ -227,18 +238,20 @@ export {
|
|
|
227
238
|
deletePointOfSaleInputSchema,
|
|
228
239
|
deletePointOfSaleResponseSchema,
|
|
229
240
|
deliveryTimeSettingSchema,
|
|
230
|
-
getCompaniesInputSchema,
|
|
231
|
-
getCompaniesQuerySchema,
|
|
232
|
-
getCompaniesResponseSchema,
|
|
233
241
|
getPointOfSaleDetailsInputSchema,
|
|
234
242
|
getPointOfSaleDetailsResponseSchema,
|
|
243
|
+
getPointOfSalesInputSchema,
|
|
244
|
+
getPointOfSalesQuerySchema,
|
|
245
|
+
getPointOfSalesResponseSchema,
|
|
235
246
|
pointOfSaleAutoAcceptOrderValues,
|
|
236
247
|
pointOfSaleCapabilities,
|
|
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.
|
|
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
|
-
"
|
|
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:
|
|
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
|
|
@@ -11,7 +11,7 @@ import { z } from 'zod'
|
|
|
11
11
|
import { PointOfSale, pointOfSaleSchema } from '../models'
|
|
12
12
|
import { pointOfSaleOpeningStatusSchema } from '../types'
|
|
13
13
|
|
|
14
|
-
export const
|
|
14
|
+
export const getPointOfSalesQuerySchema = z.object({
|
|
15
15
|
name: z.string().optional(),
|
|
16
16
|
openingStatus: pointOfSaleOpeningStatusSchema.optional(),
|
|
17
17
|
'integrationActivationRequests.connectionId': z.string().optional(),
|
|
@@ -22,28 +22,28 @@ export const getCompaniesQuerySchema = z.object({
|
|
|
22
22
|
'order[updatedAt]': sortDirSchema.optional(),
|
|
23
23
|
page: z.coerce.number().optional(),
|
|
24
24
|
})
|
|
25
|
-
export type
|
|
25
|
+
export type GetPointOfSalesQueryParams = z.infer<typeof getPointOfSalesQuerySchema>
|
|
26
26
|
|
|
27
|
-
export const
|
|
28
|
-
export type
|
|
27
|
+
export const getPointOfSalesResponseSchema = createPaginatedSchema(pointOfSaleSchema)
|
|
28
|
+
export type GetPointOfSalesResponse = z.infer<typeof getPointOfSalesResponseSchema>
|
|
29
29
|
|
|
30
|
-
export const
|
|
30
|
+
export const getPointOfSalesInputSchema = z.undefined()
|
|
31
31
|
|
|
32
32
|
export class GetPointOfSales extends AbstractApiRequest<
|
|
33
33
|
void,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
GetPointOfSalesResponse,
|
|
35
|
+
GetPointOfSalesQueryParams
|
|
36
36
|
> {
|
|
37
37
|
readonly method = 'GET'
|
|
38
38
|
readonly contentType = 'application/json'
|
|
39
39
|
readonly accept = 'application/json'
|
|
40
40
|
|
|
41
|
-
readonly inputSchema =
|
|
42
|
-
readonly outputSchema =
|
|
43
|
-
readonly querySchema =
|
|
41
|
+
readonly inputSchema = getPointOfSalesInputSchema
|
|
42
|
+
readonly outputSchema = getPointOfSalesResponseSchema
|
|
43
|
+
readonly querySchema = getPointOfSalesQuerySchema
|
|
44
44
|
readonly headersSchema = undefined
|
|
45
45
|
|
|
46
|
-
constructor(options?: { query?:
|
|
46
|
+
constructor(options?: { query?: GetPointOfSalesQueryParams }) {
|
|
47
47
|
super(undefined, options)
|
|
48
48
|
}
|
|
49
49
|
|
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>
|