@unchainedshop/core 4.8.0 → 4.8.1
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/lib/bulk-exporter/createBulkExporter.d.ts +2 -2
- package/lib/bulk-exporter/createBulkExporter.js +2 -2
- package/lib/bulk-exporter/handlers/exportAssortmentsHandler.d.ts +19 -19
- package/lib/bulk-exporter/handlers/exportAssortmentsHandler.js +9 -9
- package/lib/bulk-exporter/handlers/exportFiltersHandler.d.ts +11 -11
- package/lib/bulk-exporter/handlers/exportFiltersHandler.js +5 -5
- package/lib/bulk-exporter/handlers/exportProductsHandler.d.ts +19 -19
- package/lib/bulk-exporter/handlers/exportProductsHandler.js +9 -9
- package/lib/bulk-exporter/handlers/exportUsersHandler.d.ts +17 -17
- package/lib/bulk-exporter/handlers/exportUsersHandler.js +8 -8
- package/lib/bulk-importer/createBulkImporter.d.ts +2 -2
- package/lib/bulk-importer/createBulkImporter.js +4 -2
- package/lib/bulk-importer/handlers/assortment/create.d.ts +87 -87
- package/lib/bulk-importer/handlers/assortment/create.js +13 -15
- package/lib/bulk-importer/handlers/assortment/remove.d.ts +5 -5
- package/lib/bulk-importer/handlers/assortment/remove.js +1 -1
- package/lib/bulk-importer/handlers/assortment/update.d.ts +87 -87
- package/lib/bulk-importer/handlers/assortment/update.js +17 -21
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.d.ts +7 -7
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.js +5 -5
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.d.ts +7 -7
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.js +5 -5
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.d.ts +7 -7
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.js +5 -5
- package/lib/bulk-importer/handlers/assortment/upsertMedia.d.ts +14 -14
- package/lib/bulk-importer/handlers/assortment/upsertMedia.js +8 -10
- package/lib/bulk-importer/handlers/filter/create.d.ts +19 -19
- package/lib/bulk-importer/handlers/filter/create.js +8 -10
- package/lib/bulk-importer/handlers/filter/remove.d.ts +3 -3
- package/lib/bulk-importer/handlers/filter/remove.js +1 -1
- package/lib/bulk-importer/handlers/filter/update.d.ts +19 -19
- package/lib/bulk-importer/handlers/filter/update.js +8 -10
- package/lib/bulk-importer/handlers/product/create.d.ts +175 -175
- package/lib/bulk-importer/handlers/product/create.js +35 -45
- package/lib/bulk-importer/handlers/product/remove.d.ts +5 -5
- package/lib/bulk-importer/handlers/product/remove.js +1 -1
- package/lib/bulk-importer/handlers/product/update.d.ts +175 -175
- package/lib/bulk-importer/handlers/product/update.js +40 -52
- package/lib/bulk-importer/handlers/product/upsertMedia.d.ts +14 -14
- package/lib/bulk-importer/handlers/product/upsertMedia.js +8 -10
- package/lib/bulk-importer/handlers/product/upsertVariations.d.ts +13 -13
- package/lib/bulk-importer/handlers/product/upsertVariations.js +10 -14
- package/lib/bulk-importer/upsertAsset.d.ts +7 -7
- package/lib/bulk-importer/upsertAsset.js +4 -4
- package/package.json +1 -1
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Modules } from '../../../modules.ts';
|
|
3
3
|
import type { Services } from '../../../services/index.ts';
|
|
4
|
-
export declare const AssortmentUpdatePayloadSchema: z.
|
|
5
|
-
_id: z.
|
|
6
|
-
specification: z.
|
|
7
|
-
isActive: z.
|
|
8
|
-
isRoot: z.
|
|
9
|
-
sequence: z.
|
|
10
|
-
tags: z.
|
|
11
|
-
meta: z.
|
|
12
|
-
content: z.
|
|
13
|
-
title: z.
|
|
14
|
-
subtitle: z.
|
|
15
|
-
slug: z.
|
|
4
|
+
export declare const AssortmentUpdatePayloadSchema: z.ZodMiniObject<{
|
|
5
|
+
_id: z.ZodMiniString<string>;
|
|
6
|
+
specification: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
7
|
+
isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
8
|
+
isRoot: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
9
|
+
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
10
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
11
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
12
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
13
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
14
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
15
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
16
16
|
}, z.core.$strip>>>;
|
|
17
17
|
}, z.core.$strip>>;
|
|
18
|
-
media: z.
|
|
19
|
-
_id: z.
|
|
20
|
-
asset: z.
|
|
21
|
-
_id: z.
|
|
22
|
-
url: z.
|
|
23
|
-
meta: z.
|
|
24
|
-
fileName: z.
|
|
25
|
-
headers: z.
|
|
18
|
+
media: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
19
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
20
|
+
asset: z.ZodMiniObject<{
|
|
21
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
22
|
+
url: z.ZodMiniString<string>;
|
|
23
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
24
|
+
fileName: z.ZodMiniString<string>;
|
|
25
|
+
headers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
26
26
|
}, z.core.$strip>;
|
|
27
|
-
content: z.
|
|
28
|
-
title: z.
|
|
29
|
-
subtitle: z.
|
|
27
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
28
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
30
30
|
}, z.core.$strip>>>;
|
|
31
|
-
tags: z.
|
|
32
|
-
sortKey: z.
|
|
31
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
32
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
33
33
|
}, z.core.$strip>>>;
|
|
34
|
-
products: z.
|
|
35
|
-
_id: z.
|
|
36
|
-
productId: z.
|
|
37
|
-
tags: z.
|
|
38
|
-
sortKey: z.
|
|
39
|
-
meta: z.
|
|
34
|
+
products: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
35
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
36
|
+
productId: z.ZodMiniString<string>;
|
|
37
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
38
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
39
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
40
40
|
}, z.core.$strip>>>;
|
|
41
|
-
children: z.
|
|
42
|
-
_id: z.
|
|
43
|
-
assortmentId: z.
|
|
44
|
-
tags: z.
|
|
45
|
-
sortKey: z.
|
|
46
|
-
meta: z.
|
|
41
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
42
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
43
|
+
assortmentId: z.ZodMiniString<string>;
|
|
44
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
45
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
46
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
47
47
|
}, z.core.$strip>>>;
|
|
48
|
-
filters: z.
|
|
49
|
-
_id: z.
|
|
50
|
-
filterId: z.
|
|
51
|
-
tags: z.
|
|
52
|
-
sortKey: z.
|
|
53
|
-
meta: z.
|
|
48
|
+
filters: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
49
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
50
|
+
filterId: z.ZodMiniString<string>;
|
|
51
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
52
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
53
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
54
54
|
}, z.core.$strip>>>;
|
|
55
55
|
}, z.core.$strip>;
|
|
56
56
|
declare function updateAssortment(payload: z.infer<typeof AssortmentUpdatePayloadSchema>, { logger, createShouldUpsertIfIDExists, updateShouldUpsertIfIDNotExists }: {
|
|
@@ -67,56 +67,56 @@ declare function updateAssortment(payload: z.infer<typeof AssortmentUpdatePayloa
|
|
|
67
67
|
success: boolean;
|
|
68
68
|
}>;
|
|
69
69
|
declare namespace updateAssortment {
|
|
70
|
-
var payloadSchema: z.
|
|
71
|
-
_id: z.
|
|
72
|
-
specification: z.
|
|
73
|
-
isActive: z.
|
|
74
|
-
isRoot: z.
|
|
75
|
-
sequence: z.
|
|
76
|
-
tags: z.
|
|
77
|
-
meta: z.
|
|
78
|
-
content: z.
|
|
79
|
-
title: z.
|
|
80
|
-
subtitle: z.
|
|
81
|
-
slug: z.
|
|
70
|
+
var payloadSchema: z.ZodMiniObject<{
|
|
71
|
+
_id: z.ZodMiniString<string>;
|
|
72
|
+
specification: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
73
|
+
isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
74
|
+
isRoot: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
75
|
+
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
76
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
77
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
78
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
79
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
80
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
81
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
82
82
|
}, z.core.$strip>>>;
|
|
83
83
|
}, z.core.$strip>>;
|
|
84
|
-
media: z.
|
|
85
|
-
_id: z.
|
|
86
|
-
asset: z.
|
|
87
|
-
_id: z.
|
|
88
|
-
url: z.
|
|
89
|
-
meta: z.
|
|
90
|
-
fileName: z.
|
|
91
|
-
headers: z.
|
|
84
|
+
media: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
85
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
86
|
+
asset: z.ZodMiniObject<{
|
|
87
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
88
|
+
url: z.ZodMiniString<string>;
|
|
89
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
90
|
+
fileName: z.ZodMiniString<string>;
|
|
91
|
+
headers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
92
92
|
}, z.core.$strip>;
|
|
93
|
-
content: z.
|
|
94
|
-
title: z.
|
|
95
|
-
subtitle: z.
|
|
93
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
94
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
95
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
96
96
|
}, z.core.$strip>>>;
|
|
97
|
-
tags: z.
|
|
98
|
-
sortKey: z.
|
|
97
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
98
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
99
99
|
}, z.core.$strip>>>;
|
|
100
|
-
products: z.
|
|
101
|
-
_id: z.
|
|
102
|
-
productId: z.
|
|
103
|
-
tags: z.
|
|
104
|
-
sortKey: z.
|
|
105
|
-
meta: z.
|
|
100
|
+
products: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
101
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
102
|
+
productId: z.ZodMiniString<string>;
|
|
103
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
104
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
105
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
106
106
|
}, z.core.$strip>>>;
|
|
107
|
-
children: z.
|
|
108
|
-
_id: z.
|
|
109
|
-
assortmentId: z.
|
|
110
|
-
tags: z.
|
|
111
|
-
sortKey: z.
|
|
112
|
-
meta: z.
|
|
107
|
+
children: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
108
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
109
|
+
assortmentId: z.ZodMiniString<string>;
|
|
110
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
111
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
112
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
113
113
|
}, z.core.$strip>>>;
|
|
114
|
-
filters: z.
|
|
115
|
-
_id: z.
|
|
116
|
-
filterId: z.
|
|
117
|
-
tags: z.
|
|
118
|
-
sortKey: z.
|
|
119
|
-
meta: z.
|
|
114
|
+
filters: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
115
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
116
|
+
filterId: z.ZodMiniString<string>;
|
|
117
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
118
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
119
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
120
120
|
}, z.core.$strip>>>;
|
|
121
121
|
}, z.core.$strip>;
|
|
122
122
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import upsertAssortmentProducts, { AssortmentProductSchema } from "./upsertAssortmentProducts.js";
|
|
3
3
|
import upsertAssortmentChildren, { AssortmentLinkSchema } from "./upsertAssortmentChildren.js";
|
|
4
4
|
import upsertAssortmentFilters, { AssortmentFilterSchema } from "./upsertAssortmentFilters.js";
|
|
@@ -7,26 +7,22 @@ import convertTagsToLowerCase from "../utils/convertTagsToLowerCase.js";
|
|
|
7
7
|
import createAssortment, { AssortmentCreatePayloadSchema } from "./create.js";
|
|
8
8
|
export const AssortmentUpdatePayloadSchema = z.object({
|
|
9
9
|
_id: z.string(),
|
|
10
|
-
specification: z
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
media: z.array(MediaSchema).optional(),
|
|
27
|
-
products: z.array(AssortmentProductSchema).optional(),
|
|
28
|
-
children: z.array(AssortmentLinkSchema).optional(),
|
|
29
|
-
filters: z.array(AssortmentFilterSchema).optional(),
|
|
10
|
+
specification: z.optional(z.object({
|
|
11
|
+
isActive: z.optional(z.boolean()),
|
|
12
|
+
isRoot: z.optional(z.boolean()),
|
|
13
|
+
sequence: z.optional(z.number()),
|
|
14
|
+
tags: z.optional(z.array(z.string())),
|
|
15
|
+
meta: z.optional(z.record(z.any(), z.any())),
|
|
16
|
+
content: z.optional(z.record(z.string(), z.object({
|
|
17
|
+
title: z.optional(z.string()),
|
|
18
|
+
subtitle: z.optional(z.string()),
|
|
19
|
+
slug: z.optional(z.string()),
|
|
20
|
+
}))),
|
|
21
|
+
})),
|
|
22
|
+
media: z.optional(z.array(MediaSchema)),
|
|
23
|
+
products: z.optional(z.array(AssortmentProductSchema)),
|
|
24
|
+
children: z.optional(z.array(AssortmentLinkSchema)),
|
|
25
|
+
filters: z.optional(z.array(AssortmentFilterSchema)),
|
|
30
26
|
});
|
|
31
27
|
export default async function updateAssortment(payload, { logger, createShouldUpsertIfIDExists, updateShouldUpsertIfIDNotExists }, unchainedAPI) {
|
|
32
28
|
const { modules } = unchainedAPI;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Modules } from '../../../modules.ts';
|
|
3
|
-
export declare const AssortmentLinkSchema: z.
|
|
4
|
-
_id: z.
|
|
5
|
-
assortmentId: z.
|
|
6
|
-
tags: z.
|
|
7
|
-
sortKey: z.
|
|
8
|
-
meta: z.
|
|
3
|
+
export declare const AssortmentLinkSchema: z.ZodMiniObject<{
|
|
4
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
5
|
+
assortmentId: z.ZodMiniString<string>;
|
|
6
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
7
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
8
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
declare const _default: ({ children, assortmentId: parentAssortmentId, }: {
|
|
11
11
|
children: z.infer<typeof AssortmentLinkSchema>[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import convertTagsToLowerCase from "../utils/convertTagsToLowerCase.js";
|
|
3
3
|
export const AssortmentLinkSchema = z.object({
|
|
4
|
-
_id: z.
|
|
4
|
+
_id: z.optional(z.string()),
|
|
5
5
|
assortmentId: z.string(),
|
|
6
|
-
tags: z.array(z.string())
|
|
7
|
-
sortKey: z.
|
|
8
|
-
meta: z.record(z.any(), z.any())
|
|
6
|
+
tags: z.optional(z.array(z.string())),
|
|
7
|
+
sortKey: z.optional(z.number()),
|
|
8
|
+
meta: z.optional(z.record(z.any(), z.any())),
|
|
9
9
|
});
|
|
10
10
|
const upsert = async (assortmentLink, { modules }) => {
|
|
11
11
|
if (!(await modules.assortments.assortmentExists({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Modules } from '../../../modules.ts';
|
|
3
|
-
export declare const AssortmentFilterSchema: z.
|
|
4
|
-
_id: z.
|
|
5
|
-
filterId: z.
|
|
6
|
-
tags: z.
|
|
7
|
-
sortKey: z.
|
|
8
|
-
meta: z.
|
|
3
|
+
export declare const AssortmentFilterSchema: z.ZodMiniObject<{
|
|
4
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
5
|
+
filterId: z.ZodMiniString<string>;
|
|
6
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
7
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
8
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
declare const _default: ({ filters, assortmentId, }: {
|
|
11
11
|
filters: z.infer<typeof AssortmentFilterSchema>[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import convertTagsToLowerCase from "../utils/convertTagsToLowerCase.js";
|
|
3
3
|
export const AssortmentFilterSchema = z.object({
|
|
4
|
-
_id: z.
|
|
4
|
+
_id: z.optional(z.string()),
|
|
5
5
|
filterId: z.string(),
|
|
6
|
-
tags: z.array(z.string())
|
|
7
|
-
sortKey: z.
|
|
8
|
-
meta: z.record(z.any(), z.any())
|
|
6
|
+
tags: z.optional(z.array(z.string())),
|
|
7
|
+
sortKey: z.optional(z.number()),
|
|
8
|
+
meta: z.optional(z.record(z.any(), z.any())),
|
|
9
9
|
});
|
|
10
10
|
const upsert = async (assortmentFilter, { modules }) => {
|
|
11
11
|
if (!(await modules.filters.filterExists({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Modules } from '../../../modules.ts';
|
|
3
|
-
export declare const AssortmentProductSchema: z.
|
|
4
|
-
_id: z.
|
|
5
|
-
productId: z.
|
|
6
|
-
tags: z.
|
|
7
|
-
sortKey: z.
|
|
8
|
-
meta: z.
|
|
3
|
+
export declare const AssortmentProductSchema: z.ZodMiniObject<{
|
|
4
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
5
|
+
productId: z.ZodMiniString<string>;
|
|
6
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
7
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
8
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
declare const _default: ({ products, assortmentId, }: {
|
|
11
11
|
products: z.infer<typeof AssortmentProductSchema>[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import convertTagsToLowerCase from "../utils/convertTagsToLowerCase.js";
|
|
3
3
|
export const AssortmentProductSchema = z.object({
|
|
4
|
-
_id: z.
|
|
4
|
+
_id: z.optional(z.string()),
|
|
5
5
|
productId: z.string(),
|
|
6
|
-
tags: z.array(z.string())
|
|
7
|
-
sortKey: z.
|
|
8
|
-
meta: z.record(z.any(), z.any())
|
|
6
|
+
tags: z.optional(z.array(z.string())),
|
|
7
|
+
sortKey: z.optional(z.number()),
|
|
8
|
+
meta: z.optional(z.record(z.any(), z.any())),
|
|
9
9
|
});
|
|
10
10
|
const upsert = async (assortmentProduct, unchainedAPI) => {
|
|
11
11
|
const { modules } = unchainedAPI;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Services } from '../../../services/index.ts';
|
|
3
3
|
import type { Modules } from '../../../modules.ts';
|
|
4
|
-
export declare const MediaSchema: z.
|
|
5
|
-
_id: z.
|
|
6
|
-
asset: z.
|
|
7
|
-
_id: z.
|
|
8
|
-
url: z.
|
|
9
|
-
meta: z.
|
|
10
|
-
fileName: z.
|
|
11
|
-
headers: z.
|
|
4
|
+
export declare const MediaSchema: z.ZodMiniObject<{
|
|
5
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
6
|
+
asset: z.ZodMiniObject<{
|
|
7
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
8
|
+
url: z.ZodMiniString<string>;
|
|
9
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
10
|
+
fileName: z.ZodMiniString<string>;
|
|
11
|
+
headers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
|
-
content: z.
|
|
14
|
-
title: z.
|
|
15
|
-
subtitle: z.
|
|
13
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
14
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
15
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
16
16
|
}, z.core.$strip>>>;
|
|
17
|
-
tags: z.
|
|
18
|
-
sortKey: z.
|
|
17
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
18
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
declare const _default: ({ media, assortmentId }: {
|
|
21
21
|
media: z.infer<typeof MediaSchema>[];
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import upsertAsset, { AssetSchema } from "../../upsertAsset.js";
|
|
3
3
|
export const MediaSchema = z.object({
|
|
4
|
-
_id: z.
|
|
4
|
+
_id: z.optional(z.string()),
|
|
5
5
|
asset: AssetSchema,
|
|
6
|
-
content: z
|
|
7
|
-
.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
tags: z.array(z.string()).optional(),
|
|
13
|
-
sortKey: z.number().optional(),
|
|
6
|
+
content: z.optional(z.record(z.string(), z.object({
|
|
7
|
+
title: z.optional(z.string()),
|
|
8
|
+
subtitle: z.optional(z.string()),
|
|
9
|
+
}))),
|
|
10
|
+
tags: z.optional(z.array(z.string())),
|
|
11
|
+
sortKey: z.optional(z.number()),
|
|
14
12
|
});
|
|
15
13
|
const upsertMediaObject = async (media, unchainedAPI) => {
|
|
16
14
|
const { modules } = unchainedAPI;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Modules } from '../../../modules.ts';
|
|
3
|
-
export declare const LocalizedContentSchema: z.
|
|
4
|
-
title: z.
|
|
5
|
-
subtitle: z.
|
|
3
|
+
export declare const LocalizedContentSchema: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
4
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
5
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
6
6
|
}, z.core.$strip>>;
|
|
7
|
-
export declare const FilterCreatePayloadSchema: z.
|
|
8
|
-
_id: z.
|
|
9
|
-
specification: z.
|
|
10
|
-
type: z.
|
|
7
|
+
export declare const FilterCreatePayloadSchema: z.ZodMiniObject<{
|
|
8
|
+
_id: z.ZodMiniString<string>;
|
|
9
|
+
specification: z.ZodMiniObject<{
|
|
10
|
+
type: z.ZodMiniEnum<{
|
|
11
11
|
readonly SWITCH: "SWITCH";
|
|
12
12
|
readonly SINGLE_CHOICE: "SINGLE_CHOICE";
|
|
13
13
|
readonly MULTI_CHOICE: "MULTI_CHOICE";
|
|
14
14
|
readonly RANGE: "RANGE";
|
|
15
15
|
}>;
|
|
16
|
-
key: z.
|
|
17
|
-
isActive: z.
|
|
18
|
-
options: z.
|
|
19
|
-
value: z.
|
|
20
|
-
content: z.
|
|
21
|
-
title: z.
|
|
22
|
-
subtitle: z.
|
|
16
|
+
key: z.ZodMiniString<string>;
|
|
17
|
+
isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
18
|
+
options: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
19
|
+
value: z.ZodMiniString<string>;
|
|
20
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
21
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
22
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
23
23
|
}, z.core.$strip>>>;
|
|
24
24
|
}, z.core.$strip>>>;
|
|
25
|
-
meta: z.
|
|
26
|
-
content: z.
|
|
27
|
-
title: z.
|
|
28
|
-
subtitle: z.
|
|
25
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
26
|
+
content: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
27
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
28
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
29
|
}, z.core.$strip>>;
|
|
30
30
|
}, z.core.$strip>;
|
|
31
31
|
}, z.core.$strip>;
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import { FilterType } from '@unchainedshop/core-filters';
|
|
3
3
|
export const LocalizedContentSchema = z.record(z.string(), z.object({
|
|
4
|
-
title: z.
|
|
5
|
-
subtitle: z.
|
|
4
|
+
title: z.optional(z.string()),
|
|
5
|
+
subtitle: z.optional(z.string()),
|
|
6
6
|
}));
|
|
7
7
|
export const FilterCreatePayloadSchema = z.object({
|
|
8
8
|
_id: z.string(),
|
|
9
9
|
specification: z.object({
|
|
10
10
|
type: z.enum(FilterType),
|
|
11
11
|
key: z.string(),
|
|
12
|
-
isActive: z.
|
|
13
|
-
options: z
|
|
14
|
-
.array(z.object({
|
|
12
|
+
isActive: z.optional(z.boolean()),
|
|
13
|
+
options: z.optional(z.array(z.object({
|
|
15
14
|
value: z.string(),
|
|
16
|
-
content:
|
|
17
|
-
}))
|
|
18
|
-
|
|
19
|
-
meta: z.record(z.any(), z.any()).optional(),
|
|
15
|
+
content: z.optional(LocalizedContentSchema),
|
|
16
|
+
}))),
|
|
17
|
+
meta: z.optional(z.record(z.any(), z.any())),
|
|
20
18
|
content: LocalizedContentSchema,
|
|
21
19
|
}),
|
|
22
20
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Modules } from '../../../modules.ts';
|
|
3
|
-
export declare const FilterRemovePayloadSchema: z.
|
|
4
|
-
_id: z.
|
|
3
|
+
export declare const FilterRemovePayloadSchema: z.ZodMiniObject<{
|
|
4
|
+
_id: z.ZodMiniString<string>;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export default function removeFilter(payload: z.infer<typeof FilterRemovePayloadSchema>, { logger }: {
|
|
7
7
|
logger: any;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Modules } from '../../../modules.ts';
|
|
3
|
-
export declare const LocalizedContentSchema: z.
|
|
4
|
-
title: z.
|
|
5
|
-
subtitle: z.
|
|
3
|
+
export declare const LocalizedContentSchema: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
4
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
5
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
6
6
|
}, z.core.$strip>>;
|
|
7
|
-
export declare const FilterUpdatePayloadSchema: z.
|
|
8
|
-
_id: z.
|
|
9
|
-
specification: z.
|
|
10
|
-
type: z.
|
|
11
|
-
key: z.
|
|
12
|
-
isActive: z.
|
|
13
|
-
options: z.
|
|
14
|
-
value: z.
|
|
15
|
-
content: z.
|
|
16
|
-
title: z.
|
|
17
|
-
subtitle: z.
|
|
7
|
+
export declare const FilterUpdatePayloadSchema: z.ZodMiniObject<{
|
|
8
|
+
_id: z.ZodMiniString<string>;
|
|
9
|
+
specification: z.ZodMiniObject<{
|
|
10
|
+
type: z.ZodMiniString<string>;
|
|
11
|
+
key: z.ZodMiniString<string>;
|
|
12
|
+
isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
13
|
+
options: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
14
|
+
value: z.ZodMiniString<string>;
|
|
15
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
16
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
17
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
18
18
|
}, z.core.$strip>>>;
|
|
19
19
|
}, z.core.$strip>>>;
|
|
20
|
-
meta: z.
|
|
21
|
-
content: z.
|
|
22
|
-
title: z.
|
|
23
|
-
subtitle: z.
|
|
20
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
21
|
+
content: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
22
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
23
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
24
24
|
}, z.core.$strip>>;
|
|
25
25
|
}, z.core.$strip>;
|
|
26
26
|
}, z.core.$strip>;
|