feeef 0.0.19 → 0.0.21
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 +59 -56
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,107 +1,110 @@
|
|
|
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
|
|
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 is the actual value of the option
|
|
96
|
+
// its dynamic and can be any type
|
|
97
|
+
value: any;
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
export enum VariantOptionType {
|
|
98
|
-
color =
|
|
99
|
-
image =
|
|
100
|
-
text =
|
|
101
|
+
color = "color",
|
|
102
|
+
image = "image",
|
|
103
|
+
text = "text",
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
export enum ProductType {
|
|
104
|
-
physical =
|
|
105
|
-
digital =
|
|
106
|
-
service =
|
|
107
|
+
physical = "physical",
|
|
108
|
+
digital = "digital",
|
|
109
|
+
service = "service",
|
|
107
110
|
}
|