@longvansoftware/storefront-js-client 2.9.5 โ†’ 2.9.7

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.
Files changed (33) hide show
  1. package/README.md +185 -185
  2. package/dist/config/config.d.ts +2 -0
  3. package/dist/config/config.js +2 -0
  4. package/dist/src/graphql/auth/mutations.js +130 -130
  5. package/dist/src/graphql/auth/queries.js +55 -55
  6. package/dist/src/graphql/campaign/mutations.js +26 -26
  7. package/dist/src/graphql/campaign/queries.js +375 -375
  8. package/dist/src/graphql/cashbook/queries.d.ts +2 -0
  9. package/dist/src/graphql/cashbook/queries.js +99 -0
  10. package/dist/src/graphql/cloud/mutations.js +103 -103
  11. package/dist/src/graphql/cloud/queries.js +112 -112
  12. package/dist/src/graphql/computing/mutations.js +96 -96
  13. package/dist/src/graphql/computing/queries.js +41 -41
  14. package/dist/src/graphql/crm/mutations.js +813 -813
  15. package/dist/src/graphql/crm/queries.js +661 -661
  16. package/dist/src/graphql/payment/mutations.js +146 -146
  17. package/dist/src/graphql/payment/queries.js +116 -116
  18. package/dist/src/graphql/paymentV2/mutations.js +47 -47
  19. package/dist/src/graphql/paymentV2/queries.js +176 -176
  20. package/dist/src/graphql/product/mutations.js +94 -94
  21. package/dist/src/graphql/product/queries.js +472 -468
  22. package/dist/src/graphql/service/mutations.js +304 -304
  23. package/dist/src/graphql/service/queries.js +131 -131
  24. package/dist/src/graphql/user/mutations.js +142 -142
  25. package/dist/src/graphql/user/queries.js +298 -298
  26. package/dist/src/lib/SDK.d.ts +3 -0
  27. package/dist/src/lib/SDK.js +5 -0
  28. package/dist/src/lib/cashbook/index.d.ts +6 -0
  29. package/dist/src/lib/cashbook/index.js +56 -0
  30. package/dist/src/lib/serviceSDK.js +12 -12
  31. package/dist/src/lib/shareZalo/index.d.ts +5 -0
  32. package/dist/src/lib/shareZalo/index.js +32 -0
  33. package/package.json +43 -44
package/README.md CHANGED
@@ -1,186 +1,186 @@
1
- # Longvan Storefront JavaScript Client SDK
2
-
3
- [![npm version](https://badge.fury.io/js/%40longvansoftware%2Fstorefront-js-client.svg)](https://badge.fury.io/js/%40longvansoftware%2Fstorefront-js-client)
4
- [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
5
- [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](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
-
150
- ## ๐ŸŒŸ What's New in v2.9.0
151
-
152
- - โœจ Enhanced TypeScript support with stricter types
153
- - ๐Ÿš€ Improved error handling and debugging capabilities
154
- - ๐Ÿ”ง New utility services for better platform integration
155
- - โšก Performance optimizations and caching improvements
156
- - ๐Ÿ”’ Updated dependencies and security enhancements
157
- - ๐Ÿ“– Comprehensive documentation with real-world examples
158
-
159
- ## ๐Ÿค Community & Support
160
-
161
- - **๐Ÿ“– Documentation**: [Complete Documentation](./docs/README.md)
162
- - **๐Ÿ› Issues**: [GitLab Issues](https://gitlab.longvan.vn/long-van-platform-2.0/website/storefront-js-client/-/issues)
163
- - **๐Ÿ’ฌ Discussions**: [GitLab Discussions](https://gitlab.longvan.vn/long-van-platform-2.0/website/storefront-js-client/-/issues)
164
- - **๐Ÿ“ง Support**: Contact the Longvan development team
165
-
166
- ## ๐Ÿš€ Contributing
167
-
168
- We welcome contributions! Please see our [Contributing Guide](./docs/contributing/README.md) for details on:
169
-
170
- - ๐Ÿ”ง Setting up the development environment
171
- - ๐Ÿ“ Code style and conventions
172
- - ๐Ÿงช Running tests and quality checks
173
- - ๐Ÿ“ค Submitting pull requests
174
-
175
- ## ๐Ÿ“„ License
176
-
177
- This project is licensed under the ISC License - see the [LICENSE](./LICENSE) file for details.
178
-
179
- ---
180
-
181
- **Ready to get started?**
182
- - ๐Ÿš€ [Quick Start Guide](./docs/getting-started/quick-start.md)
183
- - ๐Ÿ“– [Complete Documentation](./docs/README.md)
184
- - ๐Ÿ” [API Reference](./docs/api/README.md)
185
-
1
+ # Longvan Storefront JavaScript Client SDK
2
+
3
+ [![npm version](https://badge.fury.io/js/%40longvansoftware%2Fstorefront-js-client.svg)](https://badge.fury.io/js/%40longvansoftware%2Fstorefront-js-client)
4
+ [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
5
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](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
+
150
+ ## ๐ŸŒŸ What's New in v2.9.0
151
+
152
+ - โœจ Enhanced TypeScript support with stricter types
153
+ - ๐Ÿš€ Improved error handling and debugging capabilities
154
+ - ๐Ÿ”ง New utility services for better platform integration
155
+ - โšก Performance optimizations and caching improvements
156
+ - ๐Ÿ”’ Updated dependencies and security enhancements
157
+ - ๐Ÿ“– Comprehensive documentation with real-world examples
158
+
159
+ ## ๐Ÿค Community & Support
160
+
161
+ - **๐Ÿ“– Documentation**: [Complete Documentation](./docs/README.md)
162
+ - **๐Ÿ› Issues**: [GitLab Issues](https://gitlab.longvan.vn/long-van-platform-2.0/website/storefront-js-client/-/issues)
163
+ - **๐Ÿ’ฌ Discussions**: [GitLab Discussions](https://gitlab.longvan.vn/long-van-platform-2.0/website/storefront-js-client/-/issues)
164
+ - **๐Ÿ“ง Support**: Contact the Longvan development team
165
+
166
+ ## ๐Ÿš€ Contributing
167
+
168
+ We welcome contributions! Please see our [Contributing Guide](./docs/contributing/README.md) for details on:
169
+
170
+ - ๐Ÿ”ง Setting up the development environment
171
+ - ๐Ÿ“ Code style and conventions
172
+ - ๐Ÿงช Running tests and quality checks
173
+ - ๐Ÿ“ค Submitting pull requests
174
+
175
+ ## ๐Ÿ“„ License
176
+
177
+ This project is licensed under the ISC License - see the [LICENSE](./LICENSE) file for details.
178
+
179
+ ---
180
+
181
+ **Ready to get started?**
182
+ - ๐Ÿš€ [Quick Start Guide](./docs/getting-started/quick-start.md)
183
+ - ๐Ÿ“– [Complete Documentation](./docs/README.md)
184
+ - ๐Ÿ” [API Reference](./docs/api/README.md)
185
+
186
186
  **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).
@@ -22,6 +22,7 @@ export declare const environmentEndpoints: {
22
22
  omnigateway: string;
23
23
  authorization: string;
24
24
  zca: string;
25
+ cashbook: string;
25
26
  };
26
27
  live: {
27
28
  product: string;
@@ -46,5 +47,6 @@ export declare const environmentEndpoints: {
46
47
  omnigateway: string;
47
48
  authorization: string;
48
49
  zca: string;
50
+ cashbook: string;
49
51
  };
50
52
  };
@@ -25,6 +25,7 @@ exports.environmentEndpoints = {
25
25
  omnigateway: "https://omni-gateway.dev.longvan.vn/omni-gateway/v1",
26
26
  authorization: "https://id.dev.longvan.vn/authorization/public",
27
27
  zca: "https://zca.dev.longvan.vn",
28
+ cashbook: 'https://api-gateway.dev.longvan.vn/cashbook-service/graphql'
28
29
  },
29
30
  live: {
30
31
  product: "https://product-service.longvan.vn/product-service/graphql",
@@ -49,5 +50,6 @@ exports.environmentEndpoints = {
49
50
  omnigateway: "https://omni-gateway.longvan.vn/omni-gateway/v1",
50
51
  authorization: "https://id.longvan.vn/authorization/public",
51
52
  zca: "https://zca.longvan.vn",
53
+ cashbook: 'https://api-gateway.dev.longvan.vn/cashbook-service/graphql'
52
54
  },
53
55
  };