feeef 0.0.6 → 0.0.8

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.
@@ -1,108 +0,0 @@
1
- import vine from '@vinejs/vine'
2
- import {
3
- AvatarFileSchema,
4
- ContactSchema,
5
- DomainSchema,
6
- EmbaddedAddressSchema,
7
- EmbaddedCategorySchema,
8
- StoreDecorationSchema,
9
- } from './helpers.js'
10
- import { DefaultShippingRatesSchema } from './user_stores.js'
11
-
12
- export const CreateStoreSchema = vine.object({
13
- name: vine.string().minLength(2).maxLength(32),
14
- slug: vine
15
- .string()
16
- .regex(/^[a-z0-9-]+$/)
17
- .minLength(2)
18
- .maxLength(32)
19
- // .unique(async (db, value, field) => {
20
- // const store = await db.from('stores').where('slug', value).first()
21
- // return !store
22
- // })
23
- ,
24
- domain: vine
25
- .object({
26
- name: vine.string().minLength(2).maxLength(32),
27
- verifiedAt: vine.date().optional(),
28
- metadata: vine.object({}).optional(),
29
- })
30
- .optional(),
31
- decoration: vine
32
- .object({
33
- primaryColor: vine.number().min(0x0).max(0xffffffff),
34
- metadata: vine.any().optional(),
35
- })
36
- .optional(),
37
- logoUrl: vine.string().optional(),
38
- ondarkLogoUrl: vine.string().optional(),
39
- logoFile: AvatarFileSchema.optional(),
40
- ondarkLogoFile: AvatarFileSchema.optional(),
41
- userId: vine.string()
42
- // .exists(async (db, value, field) => {
43
- // const user = await db.from('users').where('id', value).first()
44
- // return !!user
45
- // })
46
- ,
47
- categories: vine.array(EmbaddedCategorySchema).optional(),
48
- title: vine.string().minLength(2).maxLength(255).optional(),
49
- description: vine.string().minLength(2).maxLength(255).optional(),
50
- addresses: vine.array(EmbaddedAddressSchema).optional(),
51
- metadata: vine.object({}).optional(),
52
- contacts: vine
53
- .array(
54
- vine.object({
55
- type: vine.string().minLength(2).maxLength(32),
56
- value: vine.string().minLength(2).maxLength(255),
57
- metadata: vine.object({}).optional(),
58
- })
59
- )
60
- .optional(),
61
- shippingRates: vine.array(vine.string().minLength(2).maxLength(48)).optional(),
62
- verifiedAt: vine.date().optional(),
63
- blockedAt: vine.date().optional(),
64
- integrations: vine.array(vine.any()).optional(),
65
- // default_shipping_rates
66
- defaultShippingRates: DefaultShippingRatesSchema.optional(),
67
- })
68
-
69
- // UpdateStoreSchema
70
- export const UpdateStoreSchema = vine.object({
71
- name: vine.string().minLength(2).maxLength(32).optional(),
72
- slug: vine
73
- .string()
74
- .regex(/^[a-z0-9-]+$/)
75
- .minLength(2)
76
- .maxLength(32)
77
- // .unique(async (db, value, field) => {
78
- // const store = await db.from('stores').where('slug', value).first()
79
- // return !store
80
- // })
81
- .optional(),
82
- domain: DomainSchema.optional(),
83
- decoration: StoreDecorationSchema.optional(),
84
- logoUrl: vine.string().optional(),
85
- ondarkLogoUrl: vine.string().optional(),
86
- logoFile: AvatarFileSchema.optional(),
87
- ondarkLogoFile: AvatarFileSchema.optional(),
88
- userId: vine
89
- .string()
90
- // .exists(async (db, value, field) => {
91
- // const user = await db.from('users').where('id', value).first()
92
- // return !!user
93
- // })
94
- .optional(),
95
- categories: vine.array(EmbaddedCategorySchema).optional(),
96
- title: vine.string().minLength(2).maxLength(255).optional(),
97
- description: vine.string().minLength(2).maxLength(255).optional(),
98
- addresses: vine.array(EmbaddedAddressSchema).optional(),
99
- metadata: vine.object({}).optional(),
100
- contacts: vine.array(ContactSchema).optional(),
101
- shippingRates: vine.array(vine.string().minLength(2).maxLength(48)).optional(),
102
- verifiedAt: vine.date().optional(),
103
- blockedAt: vine.date().optional(),
104
- // integrations
105
- integrations: vine.array(vine.any()).optional(),
106
- // default_shipping_rates
107
- defaultShippingRates: DefaultShippingRatesSchema.optional(),
108
- })
@@ -1,89 +0,0 @@
1
- import vine from "@vinejs/vine";
2
- import {
3
- AvatarFileSchema,
4
- ContactSchema,
5
- DomainSchema,
6
- EmbaddedAddressSchema,
7
- EmbaddedCategorySchema,
8
- StoreBunner,
9
- StoreDecorationSchema,
10
- } from "./helpers.js";
11
- // "defaultShippingRates.1"
12
- export const DefaultShippingRatesSchema = vine.array(
13
- vine.array(vine.number().min(0).max(10000).nullable()).nullable()
14
- );
15
-
16
- export const CreateUserStoreSchema = vine.object({
17
- name: vine.string().minLength(2).maxLength(32),
18
- slug: vine
19
- .string()
20
- .regex(/^[a-z0-9-]+$/)
21
- .minLength(2)
22
- .maxLength(32),
23
- // .unique(async (db, value, field) => {
24
- // const store = await db.from('stores').where('slug', value).first()
25
- // return !store
26
- // })
27
- domain: vine
28
- .object({
29
- name: vine.string().minLength(2).maxLength(32),
30
- })
31
- .optional(),
32
- decoration: vine
33
- .object({
34
- primaryColor: vine.number().min(0x0).max(0xffffffff),
35
- })
36
- .optional(),
37
-
38
- banner: StoreBunner.optional(),
39
- logoUrl: vine.string().optional(),
40
- ondarkLogoUrl: vine.string().optional(),
41
- logoFile: AvatarFileSchema.optional(),
42
- ondarkLogoFile: AvatarFileSchema.optional(),
43
- categories: vine.array(EmbaddedCategorySchema).optional(),
44
- title: vine.string().minLength(2).maxLength(255).optional(),
45
- description: vine.string().minLength(2).maxLength(255).optional(),
46
- addresses: vine.array(EmbaddedAddressSchema).optional(),
47
- metadata: vine.object({}).optional(),
48
- contacts: vine
49
- .array(
50
- vine.object({
51
- type: vine.string().minLength(2).maxLength(32),
52
- value: vine.string().minLength(2).maxLength(255),
53
- metadata: vine.object({}).optional(),
54
- })
55
- )
56
- .optional(),
57
- defaultShippingRates: DefaultShippingRatesSchema.optional(),
58
- integrations: vine.array(vine.any()).optional(),
59
- });
60
-
61
- // UpdateStoreSchema
62
- export const UpdateUserStoreSchema = vine.object({
63
- name: vine.string().minLength(2).maxLength(32).optional(),
64
- slug: vine
65
- .string()
66
- .regex(/^[a-z0-9-]+$/)
67
- .minLength(2)
68
- .maxLength(32)
69
- // .unique(async (db, value, field) => {
70
- // const store = await db.from('stores').where('slug', value).first()
71
- // return !store
72
- // })
73
- .optional(),
74
- domain: DomainSchema.optional(),
75
- decoration: StoreDecorationSchema.optional(),
76
- banner: StoreBunner.optional(),
77
- logoUrl: vine.string().nullable().optional(),
78
- ondarkLogoUrl: vine.string().nullable().optional(),
79
- logoFile: AvatarFileSchema.optional(),
80
- ondarkLogoFile: AvatarFileSchema.optional(),
81
- categories: vine.array(EmbaddedCategorySchema).optional(),
82
- title: vine.string().minLength(2).maxLength(255).optional(),
83
- description: vine.string().minLength(2).maxLength(255).optional(),
84
- addresses: vine.array(EmbaddedAddressSchema).optional(),
85
- metadata: vine.object({}).optional(),
86
- contacts: vine.array(ContactSchema).optional(),
87
- defaultShippingRates: DefaultShippingRatesSchema.optional(),
88
- integrations: vine.array(vine.any()).optional(),
89
- });
@@ -1,69 +0,0 @@
1
- import vine from "@vinejs/vine";
2
-
3
- // User Schemas
4
- //CreateUserSchema
5
- export const CreateUserSchema = vine.object({
6
- name: vine.string().minLength(2).maxLength(32),
7
- email: vine.string(),
8
- // .unique(async (db, value, field) => {
9
- // const user = await db.from('users').where('email', value).first()
10
- // return !user
11
- // }),
12
- phone: vine
13
- .string()
14
- .regex(/^0(5|6|7)\d{8}$|^0(2)\d{7}$/)
15
- // .unique(async (db, value, field) => {
16
- // const user = await db.from('users').where('phone', value).first()
17
- // return !user
18
- // })
19
- .optional(),
20
- password: vine.string().minLength(8).maxLength(32),
21
- // for upload file
22
- photoFile: vine.any(),
23
- // .file({
24
- // size: '1mb',
25
- // extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],
26
- // })
27
- // .optional(),
28
- photoUrl: vine.string().optional(),
29
- // metadata (any object)
30
- metadata: vine.object({}).optional(),
31
- // dates
32
- emailVerifiedAt: vine.date().optional(),
33
- phoneVerifiedAt: vine.date().optional(),
34
- verifiedAt: vine.date().optional(),
35
- blockedAt: vine.date().optional(),
36
- });
37
-
38
- //UpdateUserSchema
39
- export const UpdateUserSchema = vine.object({
40
- name: vine.string().minLength(2).maxLength(32).optional(),
41
- email: vine
42
- .string()
43
- // .unique(async (db, value, field) => {
44
- // const user = await db.from('users').where('email', value).first()
45
- // return !user
46
- // })
47
- .optional(),
48
- phone: vine
49
- .string()
50
- // must start with 0 then if secend is (5|6|7) then 8 digits and if secend is (2) then 7 digits
51
- .regex(/^0(5|6|7)\d{8}$|^0(2)\d{7}$/)
52
- .optional(),
53
- password: vine.string().minLength(8).maxLength(32).confirmed().optional(),
54
- // for upload file
55
- photoFile: vine
56
- // .file({
57
- // size: '1mb',
58
- // extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],
59
- // })
60
- .any(),
61
- photoUrl: vine.string().optional(),
62
- // metadata (any object)
63
- metadata: vine.object({}).optional(),
64
- // dates
65
- emailVerifiedAt: vine.date().optional(),
66
- phoneVerifiedAt: vine.date().optional(),
67
- verifiedAt: vine.string().optional(),
68
- blockedAt: vine.date().optional(),
69
- });
package/src/index.ts DELETED
File without changes
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
package/tsconfig.json DELETED
@@ -1,36 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "declaration": false,
4
- "emitDecoratorMetadata": true,
5
- "types": ["@types/node"],
6
- "module": "NodeNext",
7
- "lib": ["ESNext"],
8
- "noUnusedParameters": true,
9
- "isolatedModules": true,
10
- "removeComments": true,
11
- "strictNullChecks": true,
12
- "allowSyntheticDefaultImports": true,
13
- "forceConsistentCasingInFileNames": true,
14
- "strictPropertyInitialization": true,
15
- "experimentalDecorators": true,
16
- "noImplicitAny": true,
17
- "strictBindCallApply": true,
18
- "strictFunctionTypes": true,
19
- "noImplicitThis": true,
20
- "skipLibCheck": true,
21
- "noImplicitReturns": true,
22
- "noUnusedLocals": true,
23
- "sourceMap": true,
24
- "strict": false,
25
- "target": "es2017",
26
- "esModuleInterop": true,
27
- "rootDir": "./",
28
- "outDir": "./build",
29
- "moduleResolution": "NodeNext",
30
- },
31
- "ts-node": {
32
- "swc": true,
33
- "skipIgnore": true,
34
- },
35
- "include": ["./**/*.ts"],
36
- }
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "skipLibCheck": true,
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "allowSyntheticDefaultImports": true
8
- },
9
- "include": ["vite.config.ts"]
10
- }
package/vite.config.ts DELETED
@@ -1,6 +0,0 @@
1
- import { defineConfig } from "vite";
2
-
3
- // https://vitejs.dev/config/
4
- export default defineConfig({
5
- plugins: [],
6
- });