feeef 0.0.23 → 0.0.25

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.23",
6
+ "version": "0.0.25",
7
7
  "type": "module",
8
8
  "scripts": {
9
9
  "dev": "vite --host",
@@ -1,6 +1,7 @@
1
1
  export enum OrderStatus {
2
2
  draft = 'draft',
3
3
  pending = 'pending',
4
+ accepted = 'accepted',
4
5
  processing = 'processing',
5
6
  completed = 'completed',
6
7
  cancelled = 'cancelled',
@@ -50,3 +51,29 @@ export interface OrderItem {
50
51
  quantity: number
51
52
  price: number
52
53
  }
54
+
55
+ // order track entity
56
+ export interface OrderTrackEntity {
57
+ id: string
58
+ customerName?: string | null
59
+ customerPhone: string
60
+ customerIp?: string | null
61
+ shippingAddress?: string | null
62
+ shippingCity?: string | null
63
+ shippingState?: string | null
64
+ shippingMethodId?: string | null
65
+ paymentMethodId?: string | null
66
+ items: OrderItem[]
67
+ subtotal: number
68
+ shippingPrice: number
69
+ total: number
70
+ discount: number
71
+ coupon?: string | null
72
+ storeId: string
73
+ metadata: any
74
+ status: OrderStatus
75
+ paymentStatus: PaymentStatus
76
+ deliveryStatus: DeliveryStatus
77
+ createdAt: any
78
+ updatedAt: any
79
+ }
@@ -92,9 +92,7 @@ export interface ProductVariantOption {
92
92
  child?: ProductVariant | null;
93
93
  mediaIndex?: number | null;
94
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
+ value?: any;
98
96
  }
99
97
 
100
98
  export enum VariantOptionType {
@@ -4,6 +4,7 @@ import { EmbaddedContact } from '../embadded/contact.js'
4
4
  // import { OrderEntity } from "./order.js";
5
5
  // import { ShippingMethodEntity } from "./shipping_method.js";
6
6
  import { UserEntity } from './user.js'
7
+ import { DateTime } from 'luxon'
7
8
 
8
9
  export interface StoreEntity {
9
10
  id: string
@@ -32,6 +33,25 @@ export interface StoreEntity {
32
33
  // orders: OrderEntity[];
33
34
  // shippingMethods: ShippingMethodEntity[];
34
35
  defaultShippingRates: (number | null)[][] | null
36
+
37
+ // subscription
38
+ subscriptio?: any
39
+ due?: number
40
+
41
+ // StoreConfigs
42
+ configs?: StoreConfigs
43
+ }
44
+
45
+ export interface StoreConfigs {
46
+ currencies: StoreCurrencyConfig[]
47
+ defaultCurrency: number
48
+ }
49
+
50
+ export interface StoreCurrencyConfig {
51
+ code: string
52
+ symbol: string
53
+ precision: number
54
+ rate: number
35
55
  }
36
56
 
37
57
  export interface StoreDomain {
@@ -80,4 +100,39 @@ export interface StoreIntegrations {
80
100
  yalidine?: any
81
101
  maystroDelivery?: any
82
102
  echotrak?: any
103
+ procolis?: any
104
+ noest?: any
105
+ }
106
+
107
+ export enum StoreSubscriptionStatus {
108
+ active = 'active',
109
+ inactive = 'inactive',
110
+ }
111
+
112
+ export enum StoreSubscriptionType {
113
+ free = 'free',
114
+ quota = 'quota',
115
+ percentage = 'percentage',
116
+ }
117
+
118
+ export interface StoreSubscription {
119
+ type: StoreSubscriptionType
120
+ status: StoreSubscriptionStatus
121
+ startedAt: DateTime
122
+ expiresAt: DateTime | null
123
+ metadata: Record<string, any>
124
+ }
125
+
126
+ export interface StoreFreeSubscription extends StoreSubscription {
127
+ type: StoreSubscriptionType.free
128
+ }
129
+
130
+ export interface StoreQuotaSubscription extends StoreSubscription {
131
+ type: StoreSubscriptionType.quota
132
+ quota: number
133
+ }
134
+ // another way is by taking percentage of the sales
135
+ export interface StorePercentageSubscription extends StoreSubscription {
136
+ type: StoreSubscriptionType.percentage
137
+ percentage: number
83
138
  }
@@ -12,6 +12,12 @@ export interface UserEntity {
12
12
  createdAt: any
13
13
  updatedAt: any | null
14
14
  metadata: Record<string, any>
15
+ wallet: EmbaddedWallet
16
+ }
17
+
18
+ export interface EmbaddedWallet {
19
+ currency: 'DZD' | 'USD' | 'EUR'
20
+ balance: number
15
21
  }
16
22
 
17
23
  export interface AuthToken {