feeef 0.0.12 → 0.0.13
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/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import vine from
|
|
1
|
+
import vine from "@vinejs/vine";
|
|
2
2
|
import {
|
|
3
3
|
AvatarFileSchema,
|
|
4
4
|
ContactSchema,
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
EmbaddedAddressSchema,
|
|
7
7
|
EmbaddedCategorySchema,
|
|
8
8
|
StoreDecorationSchema,
|
|
9
|
-
} from
|
|
10
|
-
import { DefaultShippingRatesSchema } from
|
|
9
|
+
} from "./helpers.js";
|
|
10
|
+
import { DefaultShippingRatesSchema } from "./user_stores.js";
|
|
11
11
|
|
|
12
12
|
export const CreateStoreSchema = vine.object({
|
|
13
13
|
name: vine.string().minLength(2).maxLength(32),
|
|
@@ -15,12 +15,11 @@ export const CreateStoreSchema = vine.object({
|
|
|
15
15
|
.string()
|
|
16
16
|
.regex(/^[a-z0-9-]+$/)
|
|
17
17
|
.minLength(2)
|
|
18
|
-
.maxLength(32)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
,
|
|
18
|
+
.maxLength(32),
|
|
19
|
+
// .unique(async (db, value, field) => {
|
|
20
|
+
// const store = await db.from('stores').where('slug', value).first()
|
|
21
|
+
// return !store
|
|
22
|
+
// })
|
|
24
23
|
domain: vine
|
|
25
24
|
.object({
|
|
26
25
|
name: vine.string().minLength(2).maxLength(32),
|
|
@@ -28,22 +27,16 @@ export const CreateStoreSchema = vine.object({
|
|
|
28
27
|
metadata: vine.object({}).optional(),
|
|
29
28
|
})
|
|
30
29
|
.optional(),
|
|
31
|
-
decoration:
|
|
32
|
-
.object({
|
|
33
|
-
primaryColor: vine.number().min(0x0).max(0xffffffff),
|
|
34
|
-
metadata: vine.any().optional(),
|
|
35
|
-
})
|
|
36
|
-
.optional(),
|
|
30
|
+
decoration: StoreDecorationSchema.optional(),
|
|
37
31
|
logoUrl: vine.string().optional(),
|
|
38
32
|
ondarkLogoUrl: vine.string().optional(),
|
|
39
33
|
logoFile: AvatarFileSchema.optional(),
|
|
40
34
|
ondarkLogoFile: AvatarFileSchema.optional(),
|
|
41
|
-
userId: vine.string()
|
|
35
|
+
userId: vine.string(),
|
|
42
36
|
// .exists(async (db, value, field) => {
|
|
43
37
|
// const user = await db.from('users').where('id', value).first()
|
|
44
38
|
// return !!user
|
|
45
39
|
// })
|
|
46
|
-
,
|
|
47
40
|
categories: vine.array(EmbaddedCategorySchema).optional(),
|
|
48
41
|
title: vine.string().minLength(2).maxLength(255).optional(),
|
|
49
42
|
description: vine.string().minLength(2).maxLength(255).optional(),
|
|
@@ -58,13 +51,15 @@ export const CreateStoreSchema = vine.object({
|
|
|
58
51
|
})
|
|
59
52
|
)
|
|
60
53
|
.optional(),
|
|
61
|
-
shippingRates: vine
|
|
54
|
+
shippingRates: vine
|
|
55
|
+
.array(vine.string().minLength(2).maxLength(48))
|
|
56
|
+
.optional(),
|
|
62
57
|
verifiedAt: vine.date().optional(),
|
|
63
58
|
blockedAt: vine.date().optional(),
|
|
64
59
|
integrations: vine.array(vine.any()).optional(),
|
|
65
60
|
// default_shipping_rates
|
|
66
61
|
defaultShippingRates: DefaultShippingRatesSchema.optional(),
|
|
67
|
-
})
|
|
62
|
+
});
|
|
68
63
|
|
|
69
64
|
// UpdateStoreSchema
|
|
70
65
|
export const UpdateStoreSchema = vine.object({
|
|
@@ -98,11 +93,13 @@ export const UpdateStoreSchema = vine.object({
|
|
|
98
93
|
addresses: vine.array(EmbaddedAddressSchema).optional(),
|
|
99
94
|
metadata: vine.object({}).optional(),
|
|
100
95
|
contacts: vine.array(ContactSchema).optional(),
|
|
101
|
-
shippingRates: vine
|
|
96
|
+
shippingRates: vine
|
|
97
|
+
.array(vine.string().minLength(2).maxLength(48))
|
|
98
|
+
.optional(),
|
|
102
99
|
verifiedAt: vine.date().optional(),
|
|
103
100
|
blockedAt: vine.date().optional(),
|
|
104
101
|
// integrations
|
|
105
102
|
integrations: vine.array(vine.any()).optional(),
|
|
106
103
|
// default_shipping_rates
|
|
107
104
|
defaultShippingRates: DefaultShippingRatesSchema.optional(),
|
|
108
|
-
})
|
|
105
|
+
});
|
|
@@ -30,12 +30,7 @@ export const CreateUserStoreSchema = vine.object({
|
|
|
30
30
|
name: vine.string().minLength(2).maxLength(32),
|
|
31
31
|
})
|
|
32
32
|
.optional(),
|
|
33
|
-
decoration:
|
|
34
|
-
.object({
|
|
35
|
-
primaryColor: vine.number().min(0x0).max(0xffffffff),
|
|
36
|
-
})
|
|
37
|
-
.optional(),
|
|
38
|
-
|
|
33
|
+
decoration: StoreDecorationSchema.optional(),
|
|
39
34
|
logoUrl: vine.string().optional(),
|
|
40
35
|
ondarkLogoUrl: vine.string().optional(),
|
|
41
36
|
logoFile: AvatarFileSchema.optional(),
|