feeef 0.0.10 → 0.0.12
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/.eslintrc.cjs +19 -0
- package/package.json +4 -24
- package/src/core/core.ts +10 -0
- package/src/core/embadded/address.ts +13 -0
- package/src/core/embadded/category.ts +7 -0
- package/src/core/embadded/contact.ts +24 -0
- package/src/core/entities/order.ts +52 -0
- package/src/core/entities/product.ts +99 -0
- package/src/core/entities/shipping_method.ts +32 -0
- package/src/core/entities/store.ts +84 -0
- package/src/core/entities/user.ts +24 -0
- package/src/core/sdk/fif.ts +3 -0
- package/src/feeef/feeef.ts +99 -0
- package/src/feeef/repositories/orders.ts +37 -0
- package/src/feeef/repositories/products.ts +25 -0
- package/src/feeef/repositories/repository.ts +175 -0
- package/src/feeef/repositories/stores.ts +39 -0
- package/src/feeef/repositories/users.ts +92 -0
- package/src/feeef/validators/auth.ts +50 -0
- package/{build/src/feeef/validators/custom/datetime.js → src/feeef/validators/custom/datetime.ts} +3 -1
- package/src/feeef/validators/helpers.ts +76 -0
- package/src/feeef/validators/order.ts +89 -0
- package/src/feeef/validators/product.ts +95 -0
- package/src/feeef/validators/shipping_method.ts +44 -0
- package/src/feeef/validators/stores.ts +108 -0
- package/src/feeef/validators/user_stores.ts +89 -0
- package/src/feeef/validators/users.ts +69 -0
- package/src/index.ts +0 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +24 -0
- package/tsconfig.node.json +10 -0
- package/{build/vite.config.js → vite.config.ts} +2 -1
- package/build/index.d.ts +0 -1
- package/build/index.js +0 -1
- package/build/src/core/core.d.ts +0 -8
- package/build/src/core/core.js +0 -10
- package/build/src/core/embadded/address.d.ts +0 -13
- package/build/src/core/embadded/address.js +0 -1
- package/build/src/core/embadded/category.d.ts +0 -7
- package/build/src/core/embadded/category.js +0 -1
- package/build/src/core/embadded/contact.d.ts +0 -21
- package/build/src/core/embadded/contact.js +0 -17
- package/build/src/core/entities/order.d.ts +0 -49
- package/build/src/core/entities/order.js +0 -22
- package/build/src/core/entities/product.d.ts +0 -65
- package/build/src/core/entities/product.js +0 -19
- package/build/src/core/entities/shipping_method.d.ts +0 -29
- package/build/src/core/entities/shipping_method.js +0 -11
- package/build/src/core/entities/store.d.ts +0 -71
- package/build/src/core/entities/store.js +0 -15
- package/build/src/core/entities/user.d.ts +0 -23
- package/build/src/core/entities/user.js +0 -1
- package/build/src/core/sdk/fif.d.ts +0 -1
- package/build/src/core/sdk/fif.js +0 -4
- package/build/src/feeef/feeef.d.ts +0 -62
- package/build/src/feeef/feeef.js +0 -65
- package/build/src/feeef/repositories/orders.d.ts +0 -21
- package/build/src/feeef/repositories/orders.js +0 -27
- package/build/src/feeef/repositories/products.d.ts +0 -15
- package/build/src/feeef/repositories/products.js +0 -13
- package/build/src/feeef/repositories/repository.d.ts +0 -112
- package/build/src/feeef/repositories/repository.js +0 -96
- package/build/src/feeef/repositories/stores.d.ts +0 -22
- package/build/src/feeef/repositories/stores.js +0 -25
- package/build/src/feeef/repositories/users.d.ts +0 -51
- package/build/src/feeef/repositories/users.js +0 -65
- package/build/src/feeef/validators/auth.js +0 -46
- package/build/src/feeef/validators/custom/datetime.d.ts +0 -1
- package/build/src/feeef/validators/helpers.js +0 -65
- package/build/src/feeef/validators/order.js +0 -84
- package/build/src/feeef/validators/product.js +0 -92
- package/build/src/feeef/validators/shipping_method.js +0 -41
- package/build/src/feeef/validators/stores.js +0 -97
- package/build/src/feeef/validators/user_stores.js +0 -74
- package/build/src/feeef/validators/users.js +0 -67
- package/build/vite.config.d.ts +0 -2
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import vine from "@vinejs/vine";
|
|
2
|
+
import {
|
|
3
|
+
AvatarFileSchema,
|
|
4
|
+
ContactSchema,
|
|
5
|
+
DomainSchema,
|
|
6
|
+
EmbaddedAddressSchema,
|
|
7
|
+
EmbaddedCategorySchema,
|
|
8
|
+
StoreBunnerSchema,
|
|
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
|
+
banner: StoreBunnerSchema.optional(),
|
|
19
|
+
slug: vine
|
|
20
|
+
.string()
|
|
21
|
+
.regex(/^[a-z0-9-]+$/)
|
|
22
|
+
.minLength(2)
|
|
23
|
+
.maxLength(32),
|
|
24
|
+
// .unique(async (db, value, field) => {
|
|
25
|
+
// const store = await db.from('stores').where('slug', value).first()
|
|
26
|
+
// return !store
|
|
27
|
+
// })
|
|
28
|
+
domain: vine
|
|
29
|
+
.object({
|
|
30
|
+
name: vine.string().minLength(2).maxLength(32),
|
|
31
|
+
})
|
|
32
|
+
.optional(),
|
|
33
|
+
decoration: vine
|
|
34
|
+
.object({
|
|
35
|
+
primaryColor: vine.number().min(0x0).max(0xffffffff),
|
|
36
|
+
})
|
|
37
|
+
.optional(),
|
|
38
|
+
|
|
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: StoreBunnerSchema.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
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
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
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["src"],
|
|
23
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
24
|
+
}
|
package/build/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as core from "./src/core/core.js";
|
package/build/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as core from "./src/core/core.js";
|
package/build/src/core/core.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './entities/order.js';
|
|
2
|
-
export * from './entities/store.js';
|
|
3
|
-
export * from './entities/product.js';
|
|
4
|
-
export * from './entities/user.js';
|
|
5
|
-
export * from './entities/shipping_method.js';
|
|
6
|
-
export * from './embadded/address.js';
|
|
7
|
-
export * from './embadded/category.js';
|
|
8
|
-
export * from './embadded/contact.js';
|
package/build/src/core/core.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// entities
|
|
2
|
-
export * from './entities/order.js';
|
|
3
|
-
export * from './entities/store.js';
|
|
4
|
-
export * from './entities/product.js';
|
|
5
|
-
export * from './entities/user.js';
|
|
6
|
-
export * from './entities/shipping_method.js';
|
|
7
|
-
// embaddeds
|
|
8
|
-
export * from './embadded/address.js';
|
|
9
|
-
export * from './embadded/category.js';
|
|
10
|
-
export * from './embadded/contact.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare enum EmbaddedContactType {
|
|
2
|
-
phone = "phone",
|
|
3
|
-
email = "email",
|
|
4
|
-
facebook = "facebook",
|
|
5
|
-
twitter = "twitter",
|
|
6
|
-
instagram = "instagram",
|
|
7
|
-
linkedin = "linkedin",
|
|
8
|
-
website = "website",
|
|
9
|
-
whatsapp = "whatsapp",
|
|
10
|
-
telegram = "telegram",
|
|
11
|
-
signal = "signal",
|
|
12
|
-
viber = "viber",
|
|
13
|
-
skype = "skype",
|
|
14
|
-
zoom = "zoom",
|
|
15
|
-
other = "other"
|
|
16
|
-
}
|
|
17
|
-
export interface EmbaddedContact {
|
|
18
|
-
type: EmbaddedContactType;
|
|
19
|
-
value: string;
|
|
20
|
-
metadata?: Record<string, any>;
|
|
21
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export var EmbaddedContactType;
|
|
2
|
-
(function (EmbaddedContactType) {
|
|
3
|
-
EmbaddedContactType["phone"] = "phone";
|
|
4
|
-
EmbaddedContactType["email"] = "email";
|
|
5
|
-
EmbaddedContactType["facebook"] = "facebook";
|
|
6
|
-
EmbaddedContactType["twitter"] = "twitter";
|
|
7
|
-
EmbaddedContactType["instagram"] = "instagram";
|
|
8
|
-
EmbaddedContactType["linkedin"] = "linkedin";
|
|
9
|
-
EmbaddedContactType["website"] = "website";
|
|
10
|
-
EmbaddedContactType["whatsapp"] = "whatsapp";
|
|
11
|
-
EmbaddedContactType["telegram"] = "telegram";
|
|
12
|
-
EmbaddedContactType["signal"] = "signal";
|
|
13
|
-
EmbaddedContactType["viber"] = "viber";
|
|
14
|
-
EmbaddedContactType["skype"] = "skype";
|
|
15
|
-
EmbaddedContactType["zoom"] = "zoom";
|
|
16
|
-
EmbaddedContactType["other"] = "other";
|
|
17
|
-
})(EmbaddedContactType || (EmbaddedContactType = {}));
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export declare enum OrderStatus {
|
|
2
|
-
draft = "draft",
|
|
3
|
-
pending = "pending",
|
|
4
|
-
processing = "processing",
|
|
5
|
-
completed = "completed",
|
|
6
|
-
cancelled = "cancelled"
|
|
7
|
-
}
|
|
8
|
-
export declare enum PaymentStatus {
|
|
9
|
-
unpaid = "unpaid",
|
|
10
|
-
paid = "paid",
|
|
11
|
-
received = "received"
|
|
12
|
-
}
|
|
13
|
-
export declare enum DeliveryStatus {
|
|
14
|
-
pending = "pending",
|
|
15
|
-
delivering = "delivering",
|
|
16
|
-
delivered = "delivered",
|
|
17
|
-
returned = "returned"
|
|
18
|
-
}
|
|
19
|
-
export interface OrderEntity {
|
|
20
|
-
id: string;
|
|
21
|
-
customerName: string | null;
|
|
22
|
-
customerPhone: string;
|
|
23
|
-
customerIp: string | null;
|
|
24
|
-
shippingAddress: string | null;
|
|
25
|
-
shippingCity: string | null;
|
|
26
|
-
shippingState: string | null;
|
|
27
|
-
shippingMethodId: string | null;
|
|
28
|
-
paymentMethodId: string | null;
|
|
29
|
-
items: OrderItem[];
|
|
30
|
-
subtotal: number;
|
|
31
|
-
shippingPrice: number;
|
|
32
|
-
total: number;
|
|
33
|
-
discount: number;
|
|
34
|
-
coupon: string | null;
|
|
35
|
-
storeId: string;
|
|
36
|
-
metadata: any;
|
|
37
|
-
status: OrderStatus;
|
|
38
|
-
paymentStatus: PaymentStatus;
|
|
39
|
-
deliveryStatus: DeliveryStatus;
|
|
40
|
-
createdAt: any;
|
|
41
|
-
updatedAt: any;
|
|
42
|
-
}
|
|
43
|
-
export interface OrderItem {
|
|
44
|
-
productId: string;
|
|
45
|
-
productName: string;
|
|
46
|
-
variantPath?: string;
|
|
47
|
-
quantity: number;
|
|
48
|
-
price: number;
|
|
49
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export var OrderStatus;
|
|
2
|
-
(function (OrderStatus) {
|
|
3
|
-
OrderStatus["draft"] = "draft";
|
|
4
|
-
OrderStatus["pending"] = "pending";
|
|
5
|
-
OrderStatus["processing"] = "processing";
|
|
6
|
-
OrderStatus["completed"] = "completed";
|
|
7
|
-
OrderStatus["cancelled"] = "cancelled";
|
|
8
|
-
})(OrderStatus || (OrderStatus = {}));
|
|
9
|
-
// PaymentStatus
|
|
10
|
-
export var PaymentStatus;
|
|
11
|
-
(function (PaymentStatus) {
|
|
12
|
-
PaymentStatus["unpaid"] = "unpaid";
|
|
13
|
-
PaymentStatus["paid"] = "paid";
|
|
14
|
-
PaymentStatus["received"] = "received";
|
|
15
|
-
})(PaymentStatus || (PaymentStatus = {}));
|
|
16
|
-
export var DeliveryStatus;
|
|
17
|
-
(function (DeliveryStatus) {
|
|
18
|
-
DeliveryStatus["pending"] = "pending";
|
|
19
|
-
DeliveryStatus["delivering"] = "delivering";
|
|
20
|
-
DeliveryStatus["delivered"] = "delivered";
|
|
21
|
-
DeliveryStatus["returned"] = "returned";
|
|
22
|
-
})(DeliveryStatus || (DeliveryStatus = {}));
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { EmbaddedCategory } from "../embadded/category.js";
|
|
2
|
-
export interface ProductEntity {
|
|
3
|
-
id: string;
|
|
4
|
-
slug: string;
|
|
5
|
-
decoration: ProductDecoration | null;
|
|
6
|
-
name: string | null;
|
|
7
|
-
photoUrl: string | null;
|
|
8
|
-
media: string[];
|
|
9
|
-
storeId: string;
|
|
10
|
-
category: EmbaddedCategory;
|
|
11
|
-
title: string | null;
|
|
12
|
-
description: string | null;
|
|
13
|
-
body: string | null;
|
|
14
|
-
sku: string | null;
|
|
15
|
-
price: number;
|
|
16
|
-
discount: number | null;
|
|
17
|
-
stock: number;
|
|
18
|
-
sold: number;
|
|
19
|
-
views: number;
|
|
20
|
-
likes: number;
|
|
21
|
-
dislikes: number;
|
|
22
|
-
variant?: ProductVariant | null;
|
|
23
|
-
metadata: Record<string, any>;
|
|
24
|
-
status: ProductStatus;
|
|
25
|
-
type: ProductType;
|
|
26
|
-
verifiedAt: any | null;
|
|
27
|
-
blockedAt: any | null;
|
|
28
|
-
createdAt: any;
|
|
29
|
-
updatedAt: any;
|
|
30
|
-
}
|
|
31
|
-
export declare enum ProductStatus {
|
|
32
|
-
draft = "draft",
|
|
33
|
-
published = "published",
|
|
34
|
-
archived = "archived",
|
|
35
|
-
deleted = "deleted"
|
|
36
|
-
}
|
|
37
|
-
export interface ProductDecoration {
|
|
38
|
-
metadata: Record<string, any>;
|
|
39
|
-
}
|
|
40
|
-
export interface ProductVariant {
|
|
41
|
-
name: string;
|
|
42
|
-
options: ProductVariantOption[];
|
|
43
|
-
}
|
|
44
|
-
export interface ProductVariantOption {
|
|
45
|
-
name: string;
|
|
46
|
-
sku?: string | null;
|
|
47
|
-
price?: number | null;
|
|
48
|
-
discount?: number | null;
|
|
49
|
-
stock?: number | null;
|
|
50
|
-
sold?: number | null;
|
|
51
|
-
type?: VariantOptionType;
|
|
52
|
-
child?: ProductVariant | null;
|
|
53
|
-
mediaIndex?: number | null;
|
|
54
|
-
hint?: string | null;
|
|
55
|
-
}
|
|
56
|
-
export declare enum VariantOptionType {
|
|
57
|
-
color = "color",
|
|
58
|
-
image = "image",
|
|
59
|
-
text = "text"
|
|
60
|
-
}
|
|
61
|
-
export declare enum ProductType {
|
|
62
|
-
physical = "physical",
|
|
63
|
-
digital = "digital",
|
|
64
|
-
service = "service"
|
|
65
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export var ProductStatus;
|
|
2
|
-
(function (ProductStatus) {
|
|
3
|
-
ProductStatus["draft"] = "draft";
|
|
4
|
-
ProductStatus["published"] = "published";
|
|
5
|
-
ProductStatus["archived"] = "archived";
|
|
6
|
-
ProductStatus["deleted"] = "deleted";
|
|
7
|
-
})(ProductStatus || (ProductStatus = {}));
|
|
8
|
-
export var VariantOptionType;
|
|
9
|
-
(function (VariantOptionType) {
|
|
10
|
-
VariantOptionType["color"] = "color";
|
|
11
|
-
VariantOptionType["image"] = "image";
|
|
12
|
-
VariantOptionType["text"] = "text";
|
|
13
|
-
})(VariantOptionType || (VariantOptionType = {}));
|
|
14
|
-
export var ProductType;
|
|
15
|
-
(function (ProductType) {
|
|
16
|
-
ProductType["physical"] = "physical";
|
|
17
|
-
ProductType["digital"] = "digital";
|
|
18
|
-
ProductType["service"] = "service";
|
|
19
|
-
})(ProductType || (ProductType = {}));
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { OrderEntity } from "./order.js";
|
|
2
|
-
export interface ShippingMethodEntity {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
description: string | null;
|
|
6
|
-
logoUrl: string | null;
|
|
7
|
-
ondarkLogoUrl: string | null;
|
|
8
|
-
price: number;
|
|
9
|
-
forks: number;
|
|
10
|
-
sourceId: string;
|
|
11
|
-
storeId: string;
|
|
12
|
-
rates: (number | null)[];
|
|
13
|
-
status: ShippingMethodStatus;
|
|
14
|
-
policy: ShippingMethodPolicy;
|
|
15
|
-
verifiedAt: any;
|
|
16
|
-
createdAt: any;
|
|
17
|
-
updatedAt: any;
|
|
18
|
-
orders: OrderEntity[];
|
|
19
|
-
source: ShippingMethodEntity | null;
|
|
20
|
-
}
|
|
21
|
-
export declare enum ShippingMethodStatus {
|
|
22
|
-
draft = "draft",
|
|
23
|
-
published = "published",
|
|
24
|
-
archived = "archived"
|
|
25
|
-
}
|
|
26
|
-
export declare enum ShippingMethodPolicy {
|
|
27
|
-
private = "private",
|
|
28
|
-
public = "public"
|
|
29
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export var ShippingMethodStatus;
|
|
2
|
-
(function (ShippingMethodStatus) {
|
|
3
|
-
ShippingMethodStatus["draft"] = "draft";
|
|
4
|
-
ShippingMethodStatus["published"] = "published";
|
|
5
|
-
ShippingMethodStatus["archived"] = "archived";
|
|
6
|
-
})(ShippingMethodStatus || (ShippingMethodStatus = {}));
|
|
7
|
-
export var ShippingMethodPolicy;
|
|
8
|
-
(function (ShippingMethodPolicy) {
|
|
9
|
-
ShippingMethodPolicy["private"] = "private";
|
|
10
|
-
ShippingMethodPolicy["public"] = "public";
|
|
11
|
-
})(ShippingMethodPolicy || (ShippingMethodPolicy = {}));
|