@longvansoftware/storefront-js-client 3.1.7 โ 3.1.9
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/README.md +221 -221
- package/dist/src/graphql/auth/mutations.js +219 -219
- package/dist/src/graphql/auth/queries.js +63 -63
- package/dist/src/graphql/campaign/mutations.js +26 -26
- package/dist/src/graphql/campaign/queries.js +381 -375
- package/dist/src/graphql/cashbook/queries.js +93 -93
- package/dist/src/graphql/cloud/mutations.js +103 -103
- package/dist/src/graphql/cloud/queries.js +112 -112
- package/dist/src/graphql/computing/mutations.js +96 -96
- package/dist/src/graphql/computing/queries.js +41 -41
- package/dist/src/graphql/crm/mutations.js +813 -813
- package/dist/src/graphql/crm/queries.js +661 -661
- package/dist/src/graphql/fragments/product.d.ts +38 -0
- package/dist/src/graphql/fragments/product.js +196 -0
- package/dist/src/graphql/payment/mutations.js +146 -146
- package/dist/src/graphql/payment/queries.js +116 -116
- package/dist/src/graphql/paymentV2/mutations.js +47 -47
- package/dist/src/graphql/paymentV2/queries.js +176 -176
- package/dist/src/graphql/product/mutations.js +94 -94
- package/dist/src/graphql/product/queries.d.ts +1 -0
- package/dist/src/graphql/product/queries.js +516 -473
- package/dist/src/graphql/service/mutations.js +304 -304
- package/dist/src/graphql/service/queries.js +131 -131
- package/dist/src/graphql/store/mutations.js +24 -24
- package/dist/src/graphql/store/queries.js +24 -24
- package/dist/src/graphql/user/mutations.js +142 -142
- package/dist/src/graphql/user/queries.d.ts +1 -0
- package/dist/src/graphql/user/queries.js +319 -299
- package/dist/src/lib/campaign/index.d.ts +1 -1
- package/dist/src/lib/campaign/index.js +2 -1
- package/dist/src/lib/product/index.d.ts +1 -0
- package/dist/src/lib/product/index.js +17 -0
- package/dist/src/lib/serviceSDK.js +12 -12
- package/dist/src/lib/shareZalo/index.d.ts +5 -0
- package/dist/src/lib/shareZalo/index.js +32 -0
- package/dist/src/lib/user/index.d.ts +2 -1
- package/dist/src/lib/user/index.js +20 -2
- package/dist/src/types/common.d.ts +264 -0
- package/dist/src/types/common.js +35 -0
- package/dist/src/utils/errorHandler.d.ts +64 -0
- package/dist/src/utils/errorHandler.js +197 -0
- package/package.json +44 -44
package/README.md
CHANGED
|
@@ -1,222 +1,222 @@
|
|
|
1
|
-
# Longvan Storefront JavaScript Client SDK
|
|
2
|
-
|
|
3
|
-
[](https://badge.fury.io/js/%40longvansoftware%2Fstorefront-js-client)
|
|
4
|
-
[](http://www.typescriptlang.org/)
|
|
5
|
-
[](https://opensource.org/licenses/ISC)
|
|
6
|
-
|
|
7
|
-
A comprehensive TypeScript/JavaScript SDK for integrating with the Longvan e-commerce platform. This SDK provides easy-to-use interfaces for managing products, orders, users, payments, and other e-commerce functionalities.
|
|
8
|
-
|
|
9
|
-
## ๐ Quick Start
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @longvansoftware/storefront-js-client
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
```typescript
|
|
16
|
-
import { SDK } from '@longvansoftware/storefront-js-client';
|
|
17
|
-
|
|
18
|
-
const sdk = new SDK('your-org-id', 'your-store-id', 'dev');
|
|
19
|
-
sdk.setToken('your-access-token');
|
|
20
|
-
|
|
21
|
-
// Ready to use!
|
|
22
|
-
const products = await sdk.product.getSimpleProducts({ currentPage: 1, maxResult: 10 });
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## ๐ Documentation
|
|
26
|
-
|
|
27
|
-
### ๐ฏ Getting Started
|
|
28
|
-
- **[Installation & Setup](./docs/getting-started/installation.md)** - Complete installation guide
|
|
29
|
-
- **[Quick Start Guide](./docs/getting-started/quick-start.md)** - Get running in 5 minutes
|
|
30
|
-
- **[Configuration](./docs/getting-started/configuration.md)** - Environment and SDK configuration
|
|
31
|
-
- **[Authentication](./docs/getting-started/authentication.md)** - Authentication setup and patterns
|
|
32
|
-
|
|
33
|
-
### ๐ง Core Services
|
|
34
|
-
- **[Authentication Service](./docs/services/auth.md)** - User authentication and authorization
|
|
35
|
-
- **[Product Service](./docs/services/product.md)** - Product catalog management
|
|
36
|
-
- **[Order Service](./docs/services/order.md)** - Order lifecycle management
|
|
37
|
-
- **[User Service](./docs/services/user.md)** - Customer and user management
|
|
38
|
-
- **[Payment Service](./docs/services/payment.md)** - Payment processing and invoicing
|
|
39
|
-
- **[CRM Service](./docs/services/crm.md)** - Customer relationship management
|
|
40
|
-
|
|
41
|
-
### ๐ ๏ธ Extended Services
|
|
42
|
-
- **[Warehouse Service](./docs/services/warehouse.md)** - Inventory management
|
|
43
|
-
- **[Computing Service](./docs/services/computing.md)** - Cloud computing services
|
|
44
|
-
- **[Campaign Service](./docs/services/campaign.md)** - Marketing campaigns
|
|
45
|
-
- **[Image Service](./docs/services/image.md)** - Image and media management
|
|
46
|
-
- **[Upload Service](./docs/services/upload.md)** - File upload handling
|
|
47
|
-
|
|
48
|
-
### ๐ Advanced Topics
|
|
49
|
-
- **[Error Handling](./docs/advanced/error-handling.md)** - Robust error handling patterns
|
|
50
|
-
- **[TypeScript Support](./docs/advanced/typescript.md)** - Full TypeScript integration
|
|
51
|
-
- **[Testing](./docs/advanced/testing.md)** - Testing your integration
|
|
52
|
-
- **[Performance](./docs/advanced/performance.md)** - Optimization and best practices
|
|
53
|
-
|
|
54
|
-
### ๐ก Examples & Patterns
|
|
55
|
-
- **[E-commerce Flow](./docs/examples/ecommerce-flow.md)** - Complete workflow examples
|
|
56
|
-
- **[Authentication Patterns](./docs/examples/auth-patterns.md)** - Auth implementation patterns
|
|
57
|
-
- **[Product Management](./docs/examples/product-management.md)** - Product handling examples
|
|
58
|
-
- **[Order Processing](./docs/examples/order-processing.md)** - Order workflow examples
|
|
59
|
-
|
|
60
|
-
### ๐ API Reference
|
|
61
|
-
- **[Complete API Reference](./docs/api/README.md)** - Full API documentation
|
|
62
|
-
- **[Type Definitions](./docs/api/types.md)** - TypeScript type definitions
|
|
63
|
-
- **[Interfaces](./docs/api/interfaces.md)** - Interface specifications
|
|
64
|
-
|
|
65
|
-
## ๐๏ธ Architecture Overview
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
Longvan SDK
|
|
69
|
-
โโโ ๐ Authentication Layer
|
|
70
|
-
โโโ ๐๏ธ Core E-commerce Services
|
|
71
|
-
โ โโโ Product Management
|
|
72
|
-
โ โโโ Order Processing
|
|
73
|
-
โ โโโ User Management
|
|
74
|
-
โ โโโ Payment Processing
|
|
75
|
-
โโโ ๐ง Extended Services
|
|
76
|
-
โ โโโ Warehouse & Inventory
|
|
77
|
-
โ โโโ CRM & Customer Support
|
|
78
|
-
โ โโโ Marketing & Campaigns
|
|
79
|
-
โ โโโ Media & File Management
|
|
80
|
-
โโโ ๐ Infrastructure
|
|
81
|
-
โโโ GraphQL Client
|
|
82
|
-
โโโ REST API Client
|
|
83
|
-
โโโ Error Handling
|
|
84
|
-
โโโ TypeScript Support
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## โจ Key Features
|
|
88
|
-
|
|
89
|
-
- **๐ฏ Type-Safe**: Full TypeScript support with comprehensive type definitions
|
|
90
|
-
- **๐ Multi-Protocol**: Supports both GraphQL and REST APIs
|
|
91
|
-
- **๐ Secure**: Built-in authentication and token management
|
|
92
|
-
- **โก Performance**: Optimized for speed with caching and batching
|
|
93
|
-
- **๐ ๏ธ Developer-Friendly**: Intuitive API design with excellent IntelliSense
|
|
94
|
-
- **๐ฑ Cross-Platform**: Works in Node.js, browsers, and React Native
|
|
95
|
-
- **๐งช Well-Tested**: Comprehensive test suite with high coverage
|
|
96
|
-
- **๐ Well-Documented**: Extensive documentation with real-world examples
|
|
97
|
-
|
|
98
|
-
## ๐ Installation
|
|
99
|
-
|
|
100
|
-
### Using npm
|
|
101
|
-
```bash
|
|
102
|
-
npm install @longvansoftware/storefront-js-client
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### Using yarn
|
|
106
|
-
```bash
|
|
107
|
-
yarn add @longvansoftware/storefront-js-client
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Using pnpm
|
|
111
|
-
```bash
|
|
112
|
-
pnpm add @longvansoftware/storefront-js-client
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## โก Quick Example
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
import { SDK } from '@longvansoftware/storefront-js-client';
|
|
119
|
-
|
|
120
|
-
// Initialize SDK
|
|
121
|
-
const sdk = new SDK('your-org-id', 'your-store-id', 'dev');
|
|
122
|
-
|
|
123
|
-
// Authenticate user
|
|
124
|
-
const loginResponse = await sdk.auth.login({
|
|
125
|
-
username: 'user@example.com',
|
|
126
|
-
password: 'password123'
|
|
127
|
-
});
|
|
128
|
-
sdk.setToken(loginResponse.accessToken);
|
|
129
|
-
|
|
130
|
-
// Browse products
|
|
131
|
-
const products = await sdk.product.getSimpleProducts({
|
|
132
|
-
keyword: 'laptop',
|
|
133
|
-
currentPage: 1,
|
|
134
|
-
maxResult: 20
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
// Create order
|
|
138
|
-
const order = await sdk.order.createOrder({
|
|
139
|
-
customer_id: loginResponse.partyId,
|
|
140
|
-
line_items: [{
|
|
141
|
-
product_id: products[0].id,
|
|
142
|
-
quantity: 1,
|
|
143
|
-
input_price: products[0].price
|
|
144
|
-
}]
|
|
145
|
-
}, 'web', false, loginResponse.partyId);
|
|
146
|
-
|
|
147
|
-
console.log('Order created:', order.id);
|
|
148
|
-
|
|
149
|
-
// Manage stores
|
|
150
|
-
const newStore = await sdk.store.createStore('FOX', 'My New Store');
|
|
151
|
-
const channels = await sdk.store.getStoreChannelByEmpId('emp-123');
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## ๐ฆ TypeScript Support
|
|
155
|
-
|
|
156
|
-
Import types for full TypeScript support:
|
|
157
|
-
|
|
158
|
-
```typescript
|
|
159
|
-
// Import specific types
|
|
160
|
-
import type {
|
|
161
|
-
Product,
|
|
162
|
-
ProductFilterOptions,
|
|
163
|
-
} from '@longvansoftware/storefront-js-client/dist/src/types/product';
|
|
164
|
-
|
|
165
|
-
import type {
|
|
166
|
-
StoreDTO,
|
|
167
|
-
CreateStoreRequest,
|
|
168
|
-
StoreConfiguration,
|
|
169
|
-
} from '@longvansoftware/storefront-js-client/dist/src/types/store';
|
|
170
|
-
|
|
171
|
-
import type {
|
|
172
|
-
LoginRequest,
|
|
173
|
-
LoginResponse,
|
|
174
|
-
} from '@longvansoftware/storefront-js-client/dist/src/types/auth';
|
|
175
|
-
|
|
176
|
-
// Use with full type safety
|
|
177
|
-
const products: Product[] = await sdk.product.getSimpleProducts({
|
|
178
|
-
keyword: 'laptop',
|
|
179
|
-
currentPage: 1,
|
|
180
|
-
maxResult: 10
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
const stores: StoreDTO[] = await sdk.store.getStoreChannelByEmpId('emp-123');
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
## ๐ What's New in v2.9.0
|
|
187
|
-
|
|
188
|
-
- โจ Enhanced TypeScript support with stricter types
|
|
189
|
-
- ๐ Improved error handling and debugging capabilities
|
|
190
|
-
- ๐ง New utility services for better platform integration
|
|
191
|
-
- โก Performance optimizations and caching improvements
|
|
192
|
-
- ๐ Updated dependencies and security enhancements
|
|
193
|
-
- ๐ Comprehensive documentation with real-world examples
|
|
194
|
-
|
|
195
|
-
## ๐ค Community & Support
|
|
196
|
-
|
|
197
|
-
- **๐ Documentation**: [Complete Documentation](./docs/README.md)
|
|
198
|
-
- **๐ Issues**: [GitLab Issues](https://gitlab.longvan.vn/long-van-platform-2.0/website/storefront-js-client/-/issues)
|
|
199
|
-
- **๐ฌ Discussions**: [GitLab Discussions](https://gitlab.longvan.vn/long-van-platform-2.0/website/storefront-js-client/-/issues)
|
|
200
|
-
- **๐ง Support**: Contact the Longvan development team
|
|
201
|
-
|
|
202
|
-
## ๐ Contributing
|
|
203
|
-
|
|
204
|
-
We welcome contributions! Please see our [Contributing Guide](./docs/contributing/README.md) for details on:
|
|
205
|
-
|
|
206
|
-
- ๐ง Setting up the development environment
|
|
207
|
-
- ๐ Code style and conventions
|
|
208
|
-
- ๐งช Running tests and quality checks
|
|
209
|
-
- ๐ค Submitting pull requests
|
|
210
|
-
|
|
211
|
-
## ๐ License
|
|
212
|
-
|
|
213
|
-
This project is licensed under the ISC License - see the [LICENSE](./LICENSE) file for details.
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
**Ready to get started?**
|
|
218
|
-
- ๐ [Quick Start Guide](./docs/getting-started/quick-start.md)
|
|
219
|
-
- ๐ [Complete Documentation](./docs/README.md)
|
|
220
|
-
- ๐ [API Reference](./docs/api/README.md)
|
|
221
|
-
|
|
1
|
+
# Longvan Storefront JavaScript Client SDK
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/%40longvansoftware%2Fstorefront-js-client)
|
|
4
|
+
[](http://www.typescriptlang.org/)
|
|
5
|
+
[](https://opensource.org/licenses/ISC)
|
|
6
|
+
|
|
7
|
+
A comprehensive TypeScript/JavaScript SDK for integrating with the Longvan e-commerce platform. This SDK provides easy-to-use interfaces for managing products, orders, users, payments, and other e-commerce functionalities.
|
|
8
|
+
|
|
9
|
+
## ๐ Quick Start
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @longvansoftware/storefront-js-client
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { SDK } from '@longvansoftware/storefront-js-client';
|
|
17
|
+
|
|
18
|
+
const sdk = new SDK('your-org-id', 'your-store-id', 'dev');
|
|
19
|
+
sdk.setToken('your-access-token');
|
|
20
|
+
|
|
21
|
+
// Ready to use!
|
|
22
|
+
const products = await sdk.product.getSimpleProducts({ currentPage: 1, maxResult: 10 });
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ๐ Documentation
|
|
26
|
+
|
|
27
|
+
### ๐ฏ Getting Started
|
|
28
|
+
- **[Installation & Setup](./docs/getting-started/installation.md)** - Complete installation guide
|
|
29
|
+
- **[Quick Start Guide](./docs/getting-started/quick-start.md)** - Get running in 5 minutes
|
|
30
|
+
- **[Configuration](./docs/getting-started/configuration.md)** - Environment and SDK configuration
|
|
31
|
+
- **[Authentication](./docs/getting-started/authentication.md)** - Authentication setup and patterns
|
|
32
|
+
|
|
33
|
+
### ๐ง Core Services
|
|
34
|
+
- **[Authentication Service](./docs/services/auth.md)** - User authentication and authorization
|
|
35
|
+
- **[Product Service](./docs/services/product.md)** - Product catalog management
|
|
36
|
+
- **[Order Service](./docs/services/order.md)** - Order lifecycle management
|
|
37
|
+
- **[User Service](./docs/services/user.md)** - Customer and user management
|
|
38
|
+
- **[Payment Service](./docs/services/payment.md)** - Payment processing and invoicing
|
|
39
|
+
- **[CRM Service](./docs/services/crm.md)** - Customer relationship management
|
|
40
|
+
|
|
41
|
+
### ๐ ๏ธ Extended Services
|
|
42
|
+
- **[Warehouse Service](./docs/services/warehouse.md)** - Inventory management
|
|
43
|
+
- **[Computing Service](./docs/services/computing.md)** - Cloud computing services
|
|
44
|
+
- **[Campaign Service](./docs/services/campaign.md)** - Marketing campaigns
|
|
45
|
+
- **[Image Service](./docs/services/image.md)** - Image and media management
|
|
46
|
+
- **[Upload Service](./docs/services/upload.md)** - File upload handling
|
|
47
|
+
|
|
48
|
+
### ๐ Advanced Topics
|
|
49
|
+
- **[Error Handling](./docs/advanced/error-handling.md)** - Robust error handling patterns
|
|
50
|
+
- **[TypeScript Support](./docs/advanced/typescript.md)** - Full TypeScript integration
|
|
51
|
+
- **[Testing](./docs/advanced/testing.md)** - Testing your integration
|
|
52
|
+
- **[Performance](./docs/advanced/performance.md)** - Optimization and best practices
|
|
53
|
+
|
|
54
|
+
### ๐ก Examples & Patterns
|
|
55
|
+
- **[E-commerce Flow](./docs/examples/ecommerce-flow.md)** - Complete workflow examples
|
|
56
|
+
- **[Authentication Patterns](./docs/examples/auth-patterns.md)** - Auth implementation patterns
|
|
57
|
+
- **[Product Management](./docs/examples/product-management.md)** - Product handling examples
|
|
58
|
+
- **[Order Processing](./docs/examples/order-processing.md)** - Order workflow examples
|
|
59
|
+
|
|
60
|
+
### ๐ API Reference
|
|
61
|
+
- **[Complete API Reference](./docs/api/README.md)** - Full API documentation
|
|
62
|
+
- **[Type Definitions](./docs/api/types.md)** - TypeScript type definitions
|
|
63
|
+
- **[Interfaces](./docs/api/interfaces.md)** - Interface specifications
|
|
64
|
+
|
|
65
|
+
## ๐๏ธ Architecture Overview
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Longvan SDK
|
|
69
|
+
โโโ ๐ Authentication Layer
|
|
70
|
+
โโโ ๐๏ธ Core E-commerce Services
|
|
71
|
+
โ โโโ Product Management
|
|
72
|
+
โ โโโ Order Processing
|
|
73
|
+
โ โโโ User Management
|
|
74
|
+
โ โโโ Payment Processing
|
|
75
|
+
โโโ ๐ง Extended Services
|
|
76
|
+
โ โโโ Warehouse & Inventory
|
|
77
|
+
โ โโโ CRM & Customer Support
|
|
78
|
+
โ โโโ Marketing & Campaigns
|
|
79
|
+
โ โโโ Media & File Management
|
|
80
|
+
โโโ ๐ Infrastructure
|
|
81
|
+
โโโ GraphQL Client
|
|
82
|
+
โโโ REST API Client
|
|
83
|
+
โโโ Error Handling
|
|
84
|
+
โโโ TypeScript Support
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## โจ Key Features
|
|
88
|
+
|
|
89
|
+
- **๐ฏ Type-Safe**: Full TypeScript support with comprehensive type definitions
|
|
90
|
+
- **๐ Multi-Protocol**: Supports both GraphQL and REST APIs
|
|
91
|
+
- **๐ Secure**: Built-in authentication and token management
|
|
92
|
+
- **โก Performance**: Optimized for speed with caching and batching
|
|
93
|
+
- **๐ ๏ธ Developer-Friendly**: Intuitive API design with excellent IntelliSense
|
|
94
|
+
- **๐ฑ Cross-Platform**: Works in Node.js, browsers, and React Native
|
|
95
|
+
- **๐งช Well-Tested**: Comprehensive test suite with high coverage
|
|
96
|
+
- **๐ Well-Documented**: Extensive documentation with real-world examples
|
|
97
|
+
|
|
98
|
+
## ๐ Installation
|
|
99
|
+
|
|
100
|
+
### Using npm
|
|
101
|
+
```bash
|
|
102
|
+
npm install @longvansoftware/storefront-js-client
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Using yarn
|
|
106
|
+
```bash
|
|
107
|
+
yarn add @longvansoftware/storefront-js-client
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Using pnpm
|
|
111
|
+
```bash
|
|
112
|
+
pnpm add @longvansoftware/storefront-js-client
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## โก Quick Example
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { SDK } from '@longvansoftware/storefront-js-client';
|
|
119
|
+
|
|
120
|
+
// Initialize SDK
|
|
121
|
+
const sdk = new SDK('your-org-id', 'your-store-id', 'dev');
|
|
122
|
+
|
|
123
|
+
// Authenticate user
|
|
124
|
+
const loginResponse = await sdk.auth.login({
|
|
125
|
+
username: 'user@example.com',
|
|
126
|
+
password: 'password123'
|
|
127
|
+
});
|
|
128
|
+
sdk.setToken(loginResponse.accessToken);
|
|
129
|
+
|
|
130
|
+
// Browse products
|
|
131
|
+
const products = await sdk.product.getSimpleProducts({
|
|
132
|
+
keyword: 'laptop',
|
|
133
|
+
currentPage: 1,
|
|
134
|
+
maxResult: 20
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// Create order
|
|
138
|
+
const order = await sdk.order.createOrder({
|
|
139
|
+
customer_id: loginResponse.partyId,
|
|
140
|
+
line_items: [{
|
|
141
|
+
product_id: products[0].id,
|
|
142
|
+
quantity: 1,
|
|
143
|
+
input_price: products[0].price
|
|
144
|
+
}]
|
|
145
|
+
}, 'web', false, loginResponse.partyId);
|
|
146
|
+
|
|
147
|
+
console.log('Order created:', order.id);
|
|
148
|
+
|
|
149
|
+
// Manage stores
|
|
150
|
+
const newStore = await sdk.store.createStore('FOX', 'My New Store');
|
|
151
|
+
const channels = await sdk.store.getStoreChannelByEmpId('emp-123');
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## ๐ฆ TypeScript Support
|
|
155
|
+
|
|
156
|
+
Import types for full TypeScript support:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
// Import specific types
|
|
160
|
+
import type {
|
|
161
|
+
Product,
|
|
162
|
+
ProductFilterOptions,
|
|
163
|
+
} from '@longvansoftware/storefront-js-client/dist/src/types/product';
|
|
164
|
+
|
|
165
|
+
import type {
|
|
166
|
+
StoreDTO,
|
|
167
|
+
CreateStoreRequest,
|
|
168
|
+
StoreConfiguration,
|
|
169
|
+
} from '@longvansoftware/storefront-js-client/dist/src/types/store';
|
|
170
|
+
|
|
171
|
+
import type {
|
|
172
|
+
LoginRequest,
|
|
173
|
+
LoginResponse,
|
|
174
|
+
} from '@longvansoftware/storefront-js-client/dist/src/types/auth';
|
|
175
|
+
|
|
176
|
+
// Use with full type safety
|
|
177
|
+
const products: Product[] = await sdk.product.getSimpleProducts({
|
|
178
|
+
keyword: 'laptop',
|
|
179
|
+
currentPage: 1,
|
|
180
|
+
maxResult: 10
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const stores: StoreDTO[] = await sdk.store.getStoreChannelByEmpId('emp-123');
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## ๐ What's New in v2.9.0
|
|
187
|
+
|
|
188
|
+
- โจ Enhanced TypeScript support with stricter types
|
|
189
|
+
- ๐ Improved error handling and debugging capabilities
|
|
190
|
+
- ๐ง New utility services for better platform integration
|
|
191
|
+
- โก Performance optimizations and caching improvements
|
|
192
|
+
- ๐ Updated dependencies and security enhancements
|
|
193
|
+
- ๐ Comprehensive documentation with real-world examples
|
|
194
|
+
|
|
195
|
+
## ๐ค Community & Support
|
|
196
|
+
|
|
197
|
+
- **๐ Documentation**: [Complete Documentation](./docs/README.md)
|
|
198
|
+
- **๐ Issues**: [GitLab Issues](https://gitlab.longvan.vn/long-van-platform-2.0/website/storefront-js-client/-/issues)
|
|
199
|
+
- **๐ฌ Discussions**: [GitLab Discussions](https://gitlab.longvan.vn/long-van-platform-2.0/website/storefront-js-client/-/issues)
|
|
200
|
+
- **๐ง Support**: Contact the Longvan development team
|
|
201
|
+
|
|
202
|
+
## ๐ Contributing
|
|
203
|
+
|
|
204
|
+
We welcome contributions! Please see our [Contributing Guide](./docs/contributing/README.md) for details on:
|
|
205
|
+
|
|
206
|
+
- ๐ง Setting up the development environment
|
|
207
|
+
- ๐ Code style and conventions
|
|
208
|
+
- ๐งช Running tests and quality checks
|
|
209
|
+
- ๐ค Submitting pull requests
|
|
210
|
+
|
|
211
|
+
## ๐ License
|
|
212
|
+
|
|
213
|
+
This project is licensed under the ISC License - see the [LICENSE](./LICENSE) file for details.
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
**Ready to get started?**
|
|
218
|
+
- ๐ [Quick Start Guide](./docs/getting-started/quick-start.md)
|
|
219
|
+
- ๐ [Complete Documentation](./docs/README.md)
|
|
220
|
+
- ๐ [API Reference](./docs/api/README.md)
|
|
221
|
+
|
|
222
222
|
**Need help?** Open an issue on [GitLab](https://gitlab.longvan.vn/long-van-platform-2.0/website/storefront-js-client/-/issues) or check our [documentation](./docs/README.md).
|