feeef 0.0.18 → 0.0.20
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 +1 -1
- package/src/core/core.ts +2 -0
- package/src/core/entities/product.ts +56 -57
- package/src/core/entities/store.ts +60 -63
package/package.json
CHANGED
package/src/core/core.ts
CHANGED
|
@@ -8,3 +8,5 @@ export * from "./entities/shipping_method.js";
|
|
|
8
8
|
export * from "./embadded/address.js";
|
|
9
9
|
export * from "./embadded/category.js";
|
|
10
10
|
export * from "./embadded/contact.js";
|
|
11
|
+
|
|
12
|
+
export type { StoreIntegrations } from "./entities/store.js"; // or wherever StoreIntegrations is defined
|
|
@@ -1,108 +1,107 @@
|
|
|
1
|
-
import { EmbaddedCategory } from
|
|
2
|
-
import { ShippingMethodEntity } from
|
|
3
|
-
import { StoreEntity } from
|
|
1
|
+
import { EmbaddedCategory } from '../embadded/category.js'
|
|
2
|
+
import { ShippingMethodEntity } from './shipping_method.js'
|
|
3
|
+
import { StoreEntity } from './store.js'
|
|
4
4
|
|
|
5
5
|
export interface ProductEntity {
|
|
6
|
-
id: string
|
|
6
|
+
id: string
|
|
7
7
|
|
|
8
|
-
slug: string
|
|
8
|
+
slug: string
|
|
9
9
|
|
|
10
|
-
decoration: ProductDecoration | null
|
|
10
|
+
decoration: ProductDecoration | null
|
|
11
11
|
|
|
12
|
-
name: string | null
|
|
12
|
+
name: string | null
|
|
13
13
|
|
|
14
|
-
photoUrl: string | null
|
|
14
|
+
photoUrl: string | null
|
|
15
15
|
|
|
16
|
-
media: string[]
|
|
16
|
+
media: string[]
|
|
17
17
|
|
|
18
|
-
storeId: string
|
|
18
|
+
storeId: string
|
|
19
19
|
|
|
20
|
-
shippingMethodId?: string | null
|
|
20
|
+
shippingMethodId?: string | null
|
|
21
21
|
|
|
22
|
-
category: EmbaddedCategory
|
|
22
|
+
category: EmbaddedCategory
|
|
23
23
|
|
|
24
|
-
title: string | null
|
|
24
|
+
title: string | null
|
|
25
25
|
|
|
26
|
-
description: string | null
|
|
26
|
+
description: string | null
|
|
27
27
|
|
|
28
|
-
body: string | null
|
|
28
|
+
body: string | null
|
|
29
29
|
|
|
30
30
|
// sku
|
|
31
|
-
sku: string | null
|
|
31
|
+
sku: string | null
|
|
32
32
|
|
|
33
|
-
price: number
|
|
33
|
+
price: number
|
|
34
34
|
|
|
35
|
-
discount: number | null
|
|
35
|
+
discount: number | null
|
|
36
36
|
|
|
37
|
-
stock: number
|
|
37
|
+
stock: number
|
|
38
38
|
|
|
39
|
-
sold: number
|
|
39
|
+
sold: number
|
|
40
40
|
|
|
41
|
-
views: number
|
|
41
|
+
views: number
|
|
42
42
|
|
|
43
|
-
likes: number
|
|
43
|
+
likes: number
|
|
44
44
|
|
|
45
|
-
dislikes: number
|
|
45
|
+
dislikes: number
|
|
46
46
|
|
|
47
|
-
variant?: ProductVariant | null
|
|
47
|
+
variant?: ProductVariant | null
|
|
48
48
|
|
|
49
|
-
metadata: Record<string, any
|
|
49
|
+
metadata: Record<string, any>
|
|
50
50
|
|
|
51
|
-
status: ProductStatus
|
|
51
|
+
status: ProductStatus
|
|
52
52
|
|
|
53
|
-
type: ProductType
|
|
53
|
+
type: ProductType
|
|
54
54
|
|
|
55
|
-
verifiedAt: any | null
|
|
55
|
+
verifiedAt: any | null
|
|
56
56
|
|
|
57
|
-
blockedAt: any | null
|
|
57
|
+
blockedAt: any | null
|
|
58
58
|
|
|
59
|
-
createdAt: any
|
|
59
|
+
createdAt: any
|
|
60
60
|
|
|
61
|
-
updatedAt: any
|
|
61
|
+
updatedAt: any
|
|
62
62
|
|
|
63
63
|
// relations
|
|
64
|
-
store?: StoreEntity
|
|
65
|
-
shippingMethod?: ShippingMethodEntity
|
|
64
|
+
store?: StoreEntity
|
|
65
|
+
shippingMethod?: ShippingMethodEntity
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export enum ProductStatus {
|
|
69
|
-
draft =
|
|
70
|
-
published =
|
|
71
|
-
archived =
|
|
72
|
-
deleted =
|
|
69
|
+
draft = 'draft',
|
|
70
|
+
published = 'published',
|
|
71
|
+
archived = 'archived',
|
|
72
|
+
deleted = 'deleted',
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export interface ProductDecoration {
|
|
76
|
-
metadata: Record<string, any
|
|
76
|
+
metadata: Record<string, any>
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export interface ProductVariant {
|
|
80
|
-
name: string
|
|
81
|
-
options: ProductVariantOption[]
|
|
80
|
+
name: string
|
|
81
|
+
options: ProductVariantOption[]
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
export interface ProductVariantOption {
|
|
85
|
-
name: string
|
|
86
|
-
sku?: string | null
|
|
87
|
-
price?: number | null
|
|
88
|
-
discount?: number | null
|
|
89
|
-
stock?: number | null
|
|
90
|
-
sold?: number | null
|
|
91
|
-
type?: VariantOptionType
|
|
92
|
-
child?: ProductVariant | null
|
|
93
|
-
mediaIndex?: number | null
|
|
94
|
-
hint?: string | null
|
|
95
|
-
value?: any;
|
|
85
|
+
name: string
|
|
86
|
+
sku?: string | null
|
|
87
|
+
price?: number | null
|
|
88
|
+
discount?: number | null
|
|
89
|
+
stock?: number | null
|
|
90
|
+
sold?: number | null
|
|
91
|
+
type?: VariantOptionType
|
|
92
|
+
child?: ProductVariant | null
|
|
93
|
+
mediaIndex?: number | null
|
|
94
|
+
hint?: string | null
|
|
96
95
|
}
|
|
97
96
|
|
|
98
97
|
export enum VariantOptionType {
|
|
99
|
-
color =
|
|
100
|
-
image =
|
|
101
|
-
text =
|
|
98
|
+
color = 'color',
|
|
99
|
+
image = 'image',
|
|
100
|
+
text = 'text',
|
|
102
101
|
}
|
|
103
102
|
|
|
104
103
|
export enum ProductType {
|
|
105
|
-
physical =
|
|
106
|
-
digital =
|
|
107
|
-
service =
|
|
104
|
+
physical = 'physical',
|
|
105
|
+
digital = 'digital',
|
|
106
|
+
service = 'service',
|
|
108
107
|
}
|
|
@@ -1,86 +1,83 @@
|
|
|
1
|
-
import { EmbaddedAddress } from
|
|
2
|
-
import { EmbaddedCategory } from
|
|
3
|
-
import { EmbaddedContact } from
|
|
1
|
+
import { EmbaddedAddress } from '../embadded/address.js'
|
|
2
|
+
import { EmbaddedCategory } from '../embadded/category.js'
|
|
3
|
+
import { EmbaddedContact } from '../embadded/contact.js'
|
|
4
4
|
// import { OrderEntity } from "./order.js";
|
|
5
5
|
// import { ShippingMethodEntity } from "./shipping_method.js";
|
|
6
|
-
import { UserEntity } from
|
|
6
|
+
import { UserEntity } from './user.js'
|
|
7
7
|
|
|
8
8
|
export interface StoreEntity {
|
|
9
|
-
id: string
|
|
10
|
-
slug: string
|
|
11
|
-
banner: StoreBanner | null
|
|
12
|
-
action: StoreAction | null
|
|
13
|
-
domain: StoreDomain | null
|
|
14
|
-
decoration: StoreDecoration | null
|
|
15
|
-
name: string
|
|
16
|
-
logoUrl: string | null
|
|
17
|
-
ondarkLogoUrl: string | null
|
|
18
|
-
userId: string
|
|
19
|
-
categories: EmbaddedCategory[]
|
|
20
|
-
title: string | null
|
|
21
|
-
description: string | null
|
|
22
|
-
addresses: EmbaddedAddress[]
|
|
23
|
-
metadata: Record<string, any
|
|
24
|
-
contacts: EmbaddedContact[]
|
|
25
|
-
integrations:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
updatedAt: any;
|
|
9
|
+
id: string
|
|
10
|
+
slug: string
|
|
11
|
+
banner: StoreBanner | null
|
|
12
|
+
action: StoreAction | null
|
|
13
|
+
domain: StoreDomain | null
|
|
14
|
+
decoration: StoreDecoration | null
|
|
15
|
+
name: string
|
|
16
|
+
logoUrl: string | null
|
|
17
|
+
ondarkLogoUrl: string | null
|
|
18
|
+
userId: string
|
|
19
|
+
categories: EmbaddedCategory[]
|
|
20
|
+
title: string | null
|
|
21
|
+
description: string | null
|
|
22
|
+
addresses: EmbaddedAddress[]
|
|
23
|
+
metadata: Record<string, any>
|
|
24
|
+
contacts: EmbaddedContact[]
|
|
25
|
+
integrations: StoreIntegrations
|
|
26
|
+
verifiedAt: any | null
|
|
27
|
+
blockedAt: any | null
|
|
28
|
+
createdAt: any
|
|
29
|
+
updatedAt: any
|
|
31
30
|
// products: ProductEntity[];
|
|
32
|
-
user
|
|
31
|
+
user?: UserEntity
|
|
33
32
|
// orders: OrderEntity[];
|
|
34
33
|
// shippingMethods: ShippingMethodEntity[];
|
|
35
|
-
defaultShippingRates: (number | null)[][] | null
|
|
34
|
+
defaultShippingRates: (number | null)[][] | null
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
export interface StoreDomain {
|
|
39
|
-
name: string
|
|
40
|
-
verifiedAt: any | null
|
|
41
|
-
metadata: Record<string, any
|
|
38
|
+
name: string
|
|
39
|
+
verifiedAt: any | null
|
|
40
|
+
metadata: Record<string, any>
|
|
42
41
|
}
|
|
43
42
|
export interface StoreBanner {
|
|
44
|
-
title: string
|
|
45
|
-
url?: string | null
|
|
46
|
-
enabled: boolean
|
|
47
|
-
metadata: Record<string, any
|
|
43
|
+
title: string
|
|
44
|
+
url?: string | null
|
|
45
|
+
enabled: boolean
|
|
46
|
+
metadata: Record<string, any>
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
export interface StoreDecoration {
|
|
51
|
-
primary: number
|
|
52
|
-
onPrimary?: number
|
|
53
|
-
showStoreLogoInHeader?: boolean
|
|
54
|
-
logoFullHeight?: boolean
|
|
55
|
-
showStoreNameInHeader?: boolean
|
|
56
|
-
metadata?: Record<string, any
|
|
50
|
+
primary: number
|
|
51
|
+
onPrimary?: number
|
|
52
|
+
showStoreLogoInHeader?: boolean
|
|
53
|
+
logoFullHeight?: boolean
|
|
54
|
+
showStoreNameInHeader?: boolean
|
|
55
|
+
metadata?: Record<string, any>
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
export interface
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
metadata: Record<string, any>;
|
|
64
|
-
public: Record<string, any>;
|
|
58
|
+
export interface StoreAction {
|
|
59
|
+
label: string
|
|
60
|
+
url: string
|
|
61
|
+
type: StoreActionType
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
export enum
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
sms = "sms",
|
|
64
|
+
export enum StoreActionType {
|
|
65
|
+
link = 'link',
|
|
66
|
+
whatsapp = 'whatsapp',
|
|
67
|
+
telegram = 'telegram',
|
|
68
|
+
phone = 'phone',
|
|
73
69
|
}
|
|
74
70
|
|
|
75
|
-
export interface
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
type: StoreActionType;
|
|
79
|
-
}
|
|
71
|
+
export interface StoreIntegrations {
|
|
72
|
+
[key: string]: any
|
|
73
|
+
metadata?: Record<string, any>
|
|
80
74
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
metaPixel?: any
|
|
76
|
+
googleAnalytics?: any
|
|
77
|
+
googleSheet?: any
|
|
78
|
+
sms?: any
|
|
79
|
+
telegram?: any
|
|
80
|
+
yalidine?: any
|
|
81
|
+
maystroDelivery?: any
|
|
82
|
+
echotrak?: any
|
|
86
83
|
}
|