feeef 0.0.24 → 0.0.27

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
@@ -3,7 +3,7 @@
3
3
  "description": "feeef sdk for the web",
4
4
  "main": "src/index.ts",
5
5
  "private": false,
6
- "version": "0.0.24",
6
+ "version": "0.0.27",
7
7
  "type": "module",
8
8
  "scripts": {
9
9
  "dev": "vite --host",
@@ -14,9 +14,11 @@
14
14
  "dependencies": {
15
15
  "@vinejs/vine": "^2.0.0",
16
16
  "axios": "^1.6.8",
17
- "axios-cache-interceptor": "^1.5.1"
17
+ "axios-cache-interceptor": "^1.5.1",
18
+ "luxon": "^3.5.0"
18
19
  },
19
20
  "devDependencies": {
21
+ "@types/luxon": "^3.4.2",
20
22
  "@typescript-eslint/eslint-plugin": "^6.0.0",
21
23
  "@typescript-eslint/parser": "^6.0.0",
22
24
  "@vitejs/plugin-react-swc": "^3.3.2",
@@ -1,107 +1,108 @@
1
- import { EmbaddedCategory } from '../embadded/category.js'
2
- import { ShippingMethodEntity } from './shipping_method.js'
3
- import { StoreEntity } from './store.js'
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 = 'draft',
70
- published = 'published',
71
- archived = 'archived',
72
- deleted = '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?: any;
95
96
  }
96
97
 
97
98
  export enum VariantOptionType {
98
- color = 'color',
99
- image = 'image',
100
- text = 'text',
99
+ color = "color",
100
+ image = "image",
101
+ text = "text",
101
102
  }
102
103
 
103
104
  export enum ProductType {
104
- physical = 'physical',
105
- digital = 'digital',
106
- service = 'service',
105
+ physical = "physical",
106
+ digital = "digital",
107
+ service = "service",
107
108
  }
@@ -1,138 +1,155 @@
1
- import { EmbaddedAddress } from '../embadded/address.js'
2
- import { EmbaddedCategory } from '../embadded/category.js'
3
- import { EmbaddedContact } from '../embadded/contact.js'
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 './user.js'
7
- import { DateTime } from 'luxon'
6
+ import { UserEntity } from "./user.js";
7
+ import { DateTime } from "luxon";
8
8
 
9
9
  export interface StoreEntity {
10
- id: string
11
- slug: string
12
- banner: StoreBanner | null
13
- action: StoreAction | null
14
- domain: StoreDomain | null
15
- decoration: StoreDecoration | null
16
- name: string
17
- logoUrl: string | null
18
- ondarkLogoUrl: string | null
19
- userId: string
20
- categories: EmbaddedCategory[]
21
- title: string | null
22
- description: string | null
23
- addresses: EmbaddedAddress[]
24
- metadata: Record<string, any>
25
- contacts: EmbaddedContact[]
26
- integrations: StoreIntegrations
27
- verifiedAt: any | null
28
- blockedAt: any | null
29
- createdAt: any
30
- updatedAt: any
10
+ id: string;
11
+ slug: string;
12
+ banner: StoreBanner | null;
13
+ action: StoreAction | null;
14
+ domain: StoreDomain | null;
15
+ decoration: StoreDecoration | null;
16
+ name: string;
17
+ logoUrl: string | null;
18
+ ondarkLogoUrl: string | null;
19
+ userId: string;
20
+ categories: EmbaddedCategory[];
21
+ title: string | null;
22
+ description: string | null;
23
+ addresses: EmbaddedAddress[];
24
+ metadata: Record<string, any>;
25
+ contacts: EmbaddedContact[];
26
+ integrations: StoreIntegrations;
27
+ verifiedAt: any | null;
28
+ blockedAt: any | null;
29
+ createdAt: any;
30
+ updatedAt: any;
31
31
  // products: ProductEntity[];
32
- user?: UserEntity
32
+ user?: UserEntity;
33
33
  // orders: OrderEntity[];
34
34
  // shippingMethods: ShippingMethodEntity[];
35
- defaultShippingRates: (number | null)[][] | null
35
+ defaultShippingRates: (number | null)[][] | null;
36
36
 
37
37
  // subscription
38
- subscriptio?: any
39
- due?: number
38
+ subscription?: any;
39
+ due?: number;
40
40
 
41
41
  // StoreConfigs
42
- configs?: StoreConfigs
42
+ configs?: StoreConfigs;
43
+
44
+ // metaPixelIds
45
+ metaPixelIds?: string[];
43
46
  }
44
47
 
45
48
  export interface StoreConfigs {
46
- currencies: StoreCurrencyConfig[]
47
- defaultCurrency: number
49
+ currencies: StoreCurrencyConfig[];
50
+ defaultCurrency: number;
48
51
  }
49
52
 
50
53
  export interface StoreCurrencyConfig {
51
- code: string
52
- symbol: string
53
- precision: number
54
- rate: number
54
+ code: string;
55
+ symbol: string;
56
+ precision: number;
57
+ rate: number;
55
58
  }
56
59
 
57
60
  export interface StoreDomain {
58
- name: string
59
- verifiedAt: any | null
60
- metadata: Record<string, any>
61
+ name: string;
62
+ verifiedAt: any | null;
63
+ metadata: Record<string, any>;
61
64
  }
62
65
  export interface StoreBanner {
63
- title: string
64
- url?: string | null
65
- enabled: boolean
66
- metadata: Record<string, any>
66
+ title: string;
67
+ url?: string | null;
68
+ enabled: boolean;
69
+ metadata: Record<string, any>;
67
70
  }
68
71
 
69
72
  export interface StoreDecoration {
70
- primary: number
71
- onPrimary?: number
72
- showStoreLogoInHeader?: boolean
73
- logoFullHeight?: boolean
74
- showStoreNameInHeader?: boolean
75
- metadata?: Record<string, any>
73
+ primary: number;
74
+ onPrimary?: number;
75
+ showStoreLogoInHeader?: boolean;
76
+ logoFullHeight?: boolean;
77
+ showStoreNameInHeader?: boolean;
78
+ metadata?: Record<string, any>;
76
79
  }
77
80
 
78
81
  export interface StoreAction {
79
- label: string
80
- url: string
81
- type: StoreActionType
82
+ label: string;
83
+ url: string;
84
+ type: StoreActionType;
82
85
  }
83
86
 
84
87
  export enum StoreActionType {
85
- link = 'link',
86
- whatsapp = 'whatsapp',
87
- telegram = 'telegram',
88
- phone = 'phone',
88
+ link = "link",
89
+ whatsapp = "whatsapp",
90
+ telegram = "telegram",
91
+ phone = "phone",
92
+ }
93
+ export interface MetaPixel {
94
+ id: string;
95
+ key?: string;
96
+ }
97
+ export interface MetaPixelIntegration {
98
+ id: string;
99
+ pixels: MetaPixel[];
100
+ active: boolean;
101
+ metadata: Record<string, any>;
89
102
  }
90
103
 
91
104
  export interface StoreIntegrations {
92
- [key: string]: any
93
- metadata?: Record<string, any>
94
-
95
- metaPixel?: any
96
- googleAnalytics?: any
97
- googleSheet?: any
98
- sms?: any
99
- telegram?: any
100
- yalidine?: any
101
- maystroDelivery?: any
102
- echotrak?: any
103
- procolis?: any
104
- noest?: any
105
+ [key: string]: any;
106
+ metadata?: Record<string, any>;
107
+
108
+ // @Default('default') String id,
109
+ // @Default([]) List<MetaPixel> pixels,
110
+ // @Default(true) bool active,
111
+ // @Default({}) Map<String, dynamic> metadata,
112
+ metaPixel?: MetaPixelIntegration;
113
+ googleAnalytics?: any;
114
+ googleSheet?: any;
115
+ sms?: any;
116
+ telegram?: any;
117
+ yalidine?: any;
118
+ maystroDelivery?: any;
119
+ echotrak?: any;
120
+ procolis?: any;
121
+ noest?: any;
105
122
  }
106
123
 
107
124
  export enum StoreSubscriptionStatus {
108
- active = 'active',
109
- inactive = 'inactive',
125
+ active = "active",
126
+ inactive = "inactive",
110
127
  }
111
128
 
112
129
  export enum StoreSubscriptionType {
113
- free = 'free',
114
- quota = 'quota',
115
- percentage = 'percentage',
130
+ free = "free",
131
+ quota = "quota",
132
+ percentage = "percentage",
116
133
  }
117
134
 
118
135
  export interface StoreSubscription {
119
- type: StoreSubscriptionType
120
- status: StoreSubscriptionStatus
121
- startedAt: DateTime
122
- expiresAt: DateTime | null
123
- metadata: Record<string, any>
136
+ type: StoreSubscriptionType;
137
+ status: StoreSubscriptionStatus;
138
+ startedAt: DateTime;
139
+ expiresAt: DateTime | null;
140
+ metadata: Record<string, any>;
124
141
  }
125
142
 
126
143
  export interface StoreFreeSubscription extends StoreSubscription {
127
- type: StoreSubscriptionType.free
144
+ type: StoreSubscriptionType.free;
128
145
  }
129
146
 
130
147
  export interface StoreQuotaSubscription extends StoreSubscription {
131
- type: StoreSubscriptionType.quota
132
- quota: number
148
+ type: StoreSubscriptionType.quota;
149
+ quota: number;
133
150
  }
134
151
  // another way is by taking percentage of the sales
135
152
  export interface StorePercentageSubscription extends StoreSubscription {
136
- type: StoreSubscriptionType.percentage
137
- percentage: number
153
+ type: StoreSubscriptionType.percentage;
154
+ percentage: number;
138
155
  }