@warriorteam/redai-zalo-sdk 1.8.0 → 1.9.0
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/CHANGELOG.md +95 -0
- package/README.md +39 -0
- package/dist/constants/zns.constants.d.ts +205 -0
- package/dist/constants/zns.constants.d.ts.map +1 -0
- package/dist/constants/zns.constants.js +238 -0
- package/dist/constants/zns.constants.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/services/message-management.service.d.ts +34 -14
- package/dist/services/message-management.service.d.ts.map +1 -1
- package/dist/services/message-management.service.js +39 -12
- package/dist/services/message-management.service.js.map +1 -1
- package/dist/services/zns.service.d.ts +11 -7
- package/dist/services/zns.service.d.ts.map +1 -1
- package/dist/services/zns.service.js +43 -4
- package/dist/services/zns.service.js.map +1 -1
- package/dist/types/zns.d.ts +233 -25
- package/dist/types/zns.d.ts.map +1 -1
- package/dist/types/zns.js +79 -0
- package/dist/types/zns.js.map +1 -1
- package/examples/zns-template-edit.example.ts +317 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,101 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.0] - 2025-01-11
|
|
9
|
+
|
|
10
|
+
### 🚨 BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
#### ZNS Template API Complete Restructure
|
|
13
|
+
- **FIXED**: `ZNSUpdateTemplateRequest` interface to match Zalo API docs 100%
|
|
14
|
+
- **FIXED**: `ZNSCreateTemplateRequest` interface to match Zalo API docs 100%
|
|
15
|
+
- **CHANGED**: Field names from camelCase to snake_case (e.g., `templateId` → `template_id`)
|
|
16
|
+
- **ADDED**: Required fields: `template_type`, `tag`, `layout`, `tracking_id`
|
|
17
|
+
- **REMOVED**: Non-existent fields: `templateContent`, `timeout`, `previewUrl`
|
|
18
|
+
- **FIXED**: `params` structure to match Zalo API specification
|
|
19
|
+
|
|
20
|
+
#### New ZNS Template Structure
|
|
21
|
+
- **ADDED**: `ZNSTemplateLayout` interface with proper header/body/footer components
|
|
22
|
+
- **ADDED**: `ZNSLayoutComponent` interface supporting all Zalo component types
|
|
23
|
+
- **ADDED**: `ZNSTemplateParam` interface with correct param type structure
|
|
24
|
+
- **ADDED**: `ZNSTemplateCreateEditResponse` interface for API responses
|
|
25
|
+
|
|
26
|
+
#### New Enums and Constants
|
|
27
|
+
- **ADDED**: `ZNSTemplateType` enum (1-5 for different template types)
|
|
28
|
+
- **ADDED**: `ZNSTemplateTag` enum ("1"-"3" for Transaction/Customer Care/Promotion)
|
|
29
|
+
- **ADDED**: `ZNSButtonType` enum (1-8 for different button types)
|
|
30
|
+
- **ADDED**: `ZNSParamType` enum ("1"-"15" for different parameter types)
|
|
31
|
+
- **ADDED**: `ZNS_TEMPLATE_TYPES`, `ZNS_TEMPLATE_TAGS`, `ZNS_BUTTON_TYPES`, `ZNS_PARAM_TYPES` constants
|
|
32
|
+
- **ADDED**: `ZNSValidation` helper functions for validation
|
|
33
|
+
|
|
34
|
+
### 📋 Migration Guide
|
|
35
|
+
|
|
36
|
+
**Before (v1.8.1) - BROKEN:**
|
|
37
|
+
```typescript
|
|
38
|
+
const templateData: ZNSUpdateTemplateRequest = {
|
|
39
|
+
templateId: "123",
|
|
40
|
+
templateName: "Test",
|
|
41
|
+
templateContent: "Hello", // ❌ Field doesn't exist in Zalo API
|
|
42
|
+
templateTag: "1" // ❌ Wrong field name
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**After (v1.9.0) - CORRECT:**
|
|
47
|
+
```typescript
|
|
48
|
+
const templateData: ZNSUpdateTemplateRequest = {
|
|
49
|
+
template_id: "123",
|
|
50
|
+
template_name: "Test Template",
|
|
51
|
+
template_type: ZNSTemplateType.CUSTOM,
|
|
52
|
+
tag: ZNSTemplateTag.TRANSACTION,
|
|
53
|
+
layout: {
|
|
54
|
+
body: {
|
|
55
|
+
components: [
|
|
56
|
+
{ TITLE: { value: "Hello World" } }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
tracking_id: "track_001"
|
|
61
|
+
};
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 🔧 Technical Details
|
|
65
|
+
|
|
66
|
+
- **API Compliance**: Now 100% matches official Zalo API documentation
|
|
67
|
+
- **Validation**: Added comprehensive validation functions
|
|
68
|
+
- **Type Safety**: Improved TypeScript types with proper enums
|
|
69
|
+
- **Constants**: Added helper constants for easier development
|
|
70
|
+
|
|
71
|
+
## [1.8.1] - 2025-01-10
|
|
72
|
+
|
|
73
|
+
### 🔧 FIXED
|
|
74
|
+
|
|
75
|
+
#### Upload Image API Corrections
|
|
76
|
+
- **Fixed**: `UploadImageResult` interface to match Zalo API docs exactly
|
|
77
|
+
- **Removed**: Unnecessary fields (`url`, `type`, `size`) from response interface
|
|
78
|
+
- **Fixed**: File size limit from 5MB → 1MB (as per Zalo docs)
|
|
79
|
+
- **Fixed**: Supported formats from "JPG, PNG, GIF" → "JPG, PNG" only
|
|
80
|
+
- **Updated**: Comments and documentation to reflect correct specifications
|
|
81
|
+
|
|
82
|
+
### 📋 Migration Guide
|
|
83
|
+
|
|
84
|
+
If you're using `uploadImage()` API, note these changes:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// Before (v1.8.0)
|
|
88
|
+
const result = await messageService.uploadImage(token, imageData, 'image.gif'); // ❌ GIF not supported
|
|
89
|
+
// result.url, result.type, result.size // ❌ These fields no longer exist
|
|
90
|
+
|
|
91
|
+
// After (v1.8.1)
|
|
92
|
+
const result = await messageService.uploadImage(token, imageData, 'image.png'); // ✅ Only JPG/PNG
|
|
93
|
+
// result.attachment_id // ✅ Only this field exists
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 🔧 Technical Details
|
|
97
|
+
|
|
98
|
+
- **API Endpoint**: `https://openapi.zalo.me/v2.0/oa/upload/image` (unchanged)
|
|
99
|
+
- **Max File Size**: 1MB (corrected from 5MB)
|
|
100
|
+
- **Supported Formats**: JPG, PNG (removed GIF support)
|
|
101
|
+
- **Response Structure**: Now 100% matches official Zalo API documentation
|
|
102
|
+
|
|
8
103
|
## [1.8.0] - 2025-01-10
|
|
9
104
|
|
|
10
105
|
### 🚨 BREAKING CHANGES
|
package/README.md
CHANGED
|
@@ -29,6 +29,45 @@ A comprehensive TypeScript/JavaScript SDK for Zalo APIs, providing easy-to-use i
|
|
|
29
29
|
npm install @warriorteam/redai-zalo-sdk
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
## 🚨 Version 1.9.0 - Breaking Changes
|
|
33
|
+
|
|
34
|
+
**ZNS Template API has been completely restructured to match Zalo API 100%**
|
|
35
|
+
|
|
36
|
+
### What Changed:
|
|
37
|
+
- ✅ **Fixed**: All ZNS template interfaces now match official Zalo API docs
|
|
38
|
+
- ✅ **Added**: Proper `layout` structure with header/body/footer components
|
|
39
|
+
- ✅ **Added**: Complete enum support for template types, tags, buttons, and params
|
|
40
|
+
- ✅ **Added**: Validation helpers and constants
|
|
41
|
+
- ❌ **Removed**: Non-existent fields like `templateContent`, `timeout`, `previewUrl`
|
|
42
|
+
- 🔄 **Changed**: Field names from camelCase to snake_case (e.g., `templateId` → `template_id`)
|
|
43
|
+
|
|
44
|
+
### Migration Required:
|
|
45
|
+
```typescript
|
|
46
|
+
// ❌ Before v1.9.0 (BROKEN)
|
|
47
|
+
const templateData = {
|
|
48
|
+
templateId: "123",
|
|
49
|
+
templateContent: "Hello" // Field doesn't exist in Zalo API
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// ✅ After v1.9.0 (CORRECT)
|
|
53
|
+
import { ZNSTemplateType, ZNSTemplateTag } from '@warriorteam/redai-zalo-sdk';
|
|
54
|
+
|
|
55
|
+
const templateData = {
|
|
56
|
+
template_id: "123",
|
|
57
|
+
template_name: "My Template",
|
|
58
|
+
template_type: ZNSTemplateType.CUSTOM,
|
|
59
|
+
tag: ZNSTemplateTag.TRANSACTION,
|
|
60
|
+
layout: {
|
|
61
|
+
body: {
|
|
62
|
+
components: [{ TITLE: { value: "Hello" } }]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
tracking_id: "track_001"
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
See [CHANGELOG.md](./CHANGELOG.md) for complete migration guide.
|
|
70
|
+
|
|
32
71
|
## 📚 Documentation
|
|
33
72
|
|
|
34
73
|
### 🚀 Getting Started
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZNS Constants - Các hằng số theo chuẩn Zalo API
|
|
3
|
+
*/
|
|
4
|
+
import { ZNSTemplateType, ZNSTemplateTag, ZNSButtonType, ZNSParamType } from '../types/zns';
|
|
5
|
+
/**
|
|
6
|
+
* Template Type mapping với description
|
|
7
|
+
*/
|
|
8
|
+
export declare const ZNS_TEMPLATE_TYPES: {
|
|
9
|
+
readonly 1: {
|
|
10
|
+
readonly value: ZNSTemplateType.CUSTOM;
|
|
11
|
+
readonly name: "ZNS tùy chỉnh";
|
|
12
|
+
readonly description: "Template tùy chỉnh cho các mục đích khác nhau";
|
|
13
|
+
};
|
|
14
|
+
readonly 2: {
|
|
15
|
+
readonly value: ZNSTemplateType.AUTHENTICATION;
|
|
16
|
+
readonly name: "ZNS xác thực";
|
|
17
|
+
readonly description: "Template cho việc xác thực OTP, mã PIN";
|
|
18
|
+
};
|
|
19
|
+
readonly 3: {
|
|
20
|
+
readonly value: ZNSTemplateType.PAYMENT_REQUEST;
|
|
21
|
+
readonly name: "ZNS yêu cầu thanh toán";
|
|
22
|
+
readonly description: "Template yêu cầu thanh toán";
|
|
23
|
+
};
|
|
24
|
+
readonly 4: {
|
|
25
|
+
readonly value: ZNSTemplateType.VOUCHER;
|
|
26
|
+
readonly name: "ZNS voucher";
|
|
27
|
+
readonly description: "Template gửi voucher, khuyến mãi";
|
|
28
|
+
};
|
|
29
|
+
readonly 5: {
|
|
30
|
+
readonly value: ZNSTemplateType.SERVICE_RATING;
|
|
31
|
+
readonly name: "ZNS đánh giá dịch vụ";
|
|
32
|
+
readonly description: "Template yêu cầu đánh giá dịch vụ";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Template Tag mapping với description
|
|
37
|
+
*/
|
|
38
|
+
export declare const ZNS_TEMPLATE_TAGS: {
|
|
39
|
+
readonly "1": {
|
|
40
|
+
readonly value: ZNSTemplateTag.TRANSACTION;
|
|
41
|
+
readonly name: "Transaction";
|
|
42
|
+
readonly description: "Giao dịch, thanh toán";
|
|
43
|
+
};
|
|
44
|
+
readonly "2": {
|
|
45
|
+
readonly value: ZNSTemplateTag.CUSTOMER_CARE;
|
|
46
|
+
readonly name: "Customer Care";
|
|
47
|
+
readonly description: "Chăm sóc khách hàng";
|
|
48
|
+
};
|
|
49
|
+
readonly "3": {
|
|
50
|
+
readonly value: ZNSTemplateTag.PROMOTION;
|
|
51
|
+
readonly name: "Promotion";
|
|
52
|
+
readonly description: "Khuyến mãi, quảng cáo";
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Button Type mapping với description
|
|
57
|
+
*/
|
|
58
|
+
export declare const ZNS_BUTTON_TYPES: {
|
|
59
|
+
readonly 1: {
|
|
60
|
+
readonly value: ZNSButtonType.URL;
|
|
61
|
+
readonly name: "URL";
|
|
62
|
+
readonly description: "Mở đường link";
|
|
63
|
+
};
|
|
64
|
+
readonly 2: {
|
|
65
|
+
readonly value: ZNSButtonType.PHONE;
|
|
66
|
+
readonly name: "Phone";
|
|
67
|
+
readonly description: "Gọi điện thoại";
|
|
68
|
+
};
|
|
69
|
+
readonly 3: {
|
|
70
|
+
readonly value: ZNSButtonType.SMS;
|
|
71
|
+
readonly name: "SMS";
|
|
72
|
+
readonly description: "Gửi tin nhắn SMS";
|
|
73
|
+
};
|
|
74
|
+
readonly 4: {
|
|
75
|
+
readonly value: ZNSButtonType.APP;
|
|
76
|
+
readonly name: "App";
|
|
77
|
+
readonly description: "Mở ứng dụng";
|
|
78
|
+
};
|
|
79
|
+
readonly 5: {
|
|
80
|
+
readonly value: ZNSButtonType.DEEPLINK;
|
|
81
|
+
readonly name: "Deeplink";
|
|
82
|
+
readonly description: "Mở deeplink";
|
|
83
|
+
};
|
|
84
|
+
readonly 6: {
|
|
85
|
+
readonly value: ZNSButtonType.MAP;
|
|
86
|
+
readonly name: "Map";
|
|
87
|
+
readonly description: "Mở bản đồ";
|
|
88
|
+
};
|
|
89
|
+
readonly 7: {
|
|
90
|
+
readonly value: ZNSButtonType.CALENDAR;
|
|
91
|
+
readonly name: "Calendar";
|
|
92
|
+
readonly description: "Thêm vào lịch";
|
|
93
|
+
};
|
|
94
|
+
readonly 8: {
|
|
95
|
+
readonly value: ZNSButtonType.COPY;
|
|
96
|
+
readonly name: "Copy";
|
|
97
|
+
readonly description: "Sao chép nội dung";
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Parameter Type mapping với description và max length
|
|
102
|
+
*/
|
|
103
|
+
export declare const ZNS_PARAM_TYPES: {
|
|
104
|
+
readonly "1": {
|
|
105
|
+
readonly value: ZNSParamType.CUSTOMER_NAME;
|
|
106
|
+
readonly name: "Tên khách hàng";
|
|
107
|
+
readonly maxLength: 30;
|
|
108
|
+
};
|
|
109
|
+
readonly "2": {
|
|
110
|
+
readonly value: ZNSParamType.PHONE_NUMBER;
|
|
111
|
+
readonly name: "Số điện thoại";
|
|
112
|
+
readonly maxLength: 15;
|
|
113
|
+
};
|
|
114
|
+
readonly "3": {
|
|
115
|
+
readonly value: ZNSParamType.ADDRESS;
|
|
116
|
+
readonly name: "Địa chỉ";
|
|
117
|
+
readonly maxLength: 200;
|
|
118
|
+
};
|
|
119
|
+
readonly "4": {
|
|
120
|
+
readonly value: ZNSParamType.CODE;
|
|
121
|
+
readonly name: "Mã số";
|
|
122
|
+
readonly maxLength: 30;
|
|
123
|
+
};
|
|
124
|
+
readonly "5": {
|
|
125
|
+
readonly value: ZNSParamType.CUSTOM_LABEL;
|
|
126
|
+
readonly name: "Nhãn tùy chỉnh";
|
|
127
|
+
readonly maxLength: 30;
|
|
128
|
+
};
|
|
129
|
+
readonly "6": {
|
|
130
|
+
readonly value: ZNSParamType.TRANSACTION_STATUS;
|
|
131
|
+
readonly name: "Trạng thái giao dịch";
|
|
132
|
+
readonly maxLength: 30;
|
|
133
|
+
};
|
|
134
|
+
readonly "7": {
|
|
135
|
+
readonly value: ZNSParamType.CONTACT_INFO;
|
|
136
|
+
readonly name: "Thông tin liên hệ";
|
|
137
|
+
readonly maxLength: 50;
|
|
138
|
+
};
|
|
139
|
+
readonly "8": {
|
|
140
|
+
readonly value: ZNSParamType.GENDER_TITLE;
|
|
141
|
+
readonly name: "Giới tính / Danh xưng";
|
|
142
|
+
readonly maxLength: 5;
|
|
143
|
+
};
|
|
144
|
+
readonly "9": {
|
|
145
|
+
readonly value: ZNSParamType.PRODUCT_BRAND;
|
|
146
|
+
readonly name: "Tên sản phẩm / Thương hiệu";
|
|
147
|
+
readonly maxLength: 200;
|
|
148
|
+
};
|
|
149
|
+
readonly "10": {
|
|
150
|
+
readonly value: ZNSParamType.QUANTITY_AMOUNT;
|
|
151
|
+
readonly name: "Số lượng / Số tiền";
|
|
152
|
+
readonly maxLength: 20;
|
|
153
|
+
};
|
|
154
|
+
readonly "11": {
|
|
155
|
+
readonly value: ZNSParamType.TIME;
|
|
156
|
+
readonly name: "Thời gian";
|
|
157
|
+
readonly maxLength: 20;
|
|
158
|
+
};
|
|
159
|
+
readonly "12": {
|
|
160
|
+
readonly value: ZNSParamType.OTP;
|
|
161
|
+
readonly name: "OTP";
|
|
162
|
+
readonly maxLength: 10;
|
|
163
|
+
};
|
|
164
|
+
readonly "13": {
|
|
165
|
+
readonly value: ZNSParamType.URL;
|
|
166
|
+
readonly name: "URL";
|
|
167
|
+
readonly maxLength: 200;
|
|
168
|
+
};
|
|
169
|
+
readonly "14": {
|
|
170
|
+
readonly value: ZNSParamType.CURRENCY;
|
|
171
|
+
readonly name: "Tiền tệ (VNĐ)";
|
|
172
|
+
readonly maxLength: 12;
|
|
173
|
+
};
|
|
174
|
+
readonly "15": {
|
|
175
|
+
readonly value: ZNSParamType.BANK_TRANSFER_NOTE;
|
|
176
|
+
readonly name: "Bank transfer note";
|
|
177
|
+
readonly maxLength: 90;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Template Type và Tag compatibility matrix
|
|
182
|
+
*/
|
|
183
|
+
export declare const ZNS_TEMPLATE_TAG_COMPATIBILITY: Record<ZNSTemplateType, ZNSTemplateTag[]>;
|
|
184
|
+
/**
|
|
185
|
+
* Validation functions
|
|
186
|
+
*/
|
|
187
|
+
export declare const ZNSValidation: {
|
|
188
|
+
/**
|
|
189
|
+
* Kiểm tra template name hợp lệ
|
|
190
|
+
*/
|
|
191
|
+
readonly isValidTemplateName: (name: string) => boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Kiểm tra note hợp lệ
|
|
194
|
+
*/
|
|
195
|
+
readonly isValidNote: (note: string) => boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Kiểm tra tag có tương thích với template type không
|
|
198
|
+
*/
|
|
199
|
+
readonly isTagCompatibleWithType: (templateType: ZNSTemplateType, tag: ZNSTemplateTag) => boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Kiểm tra param value có hợp lệ với type không
|
|
202
|
+
*/
|
|
203
|
+
readonly isValidParamValue: (paramType: ZNSParamType, value: string) => boolean;
|
|
204
|
+
};
|
|
205
|
+
//# sourceMappingURL=zns.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zns.constants.d.ts","sourceRoot":"","sources":["../../src/constants/zns.constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,EACb,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BrB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;CAgBpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCnB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ElB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,eAAe,EAAE,cAAc,EAAE,CAoBpF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;yCACyB,MAAM,KAAG,OAAO;IAI5C;;OAEG;iCACiB,MAAM,KAAG,OAAO;IAIpC;;OAEG;qDACqC,eAAe,OAAO,cAAc,KAAG,OAAO;IAKtF;;OAEG;4CAC4B,YAAY,SAAS,MAAM,KAAG,OAAO;CAI5D,CAAC"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ZNS Constants - Các hằng số theo chuẩn Zalo API
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ZNSValidation = exports.ZNS_TEMPLATE_TAG_COMPATIBILITY = exports.ZNS_PARAM_TYPES = exports.ZNS_BUTTON_TYPES = exports.ZNS_TEMPLATE_TAGS = exports.ZNS_TEMPLATE_TYPES = void 0;
|
|
7
|
+
const zns_1 = require("../types/zns");
|
|
8
|
+
/**
|
|
9
|
+
* Template Type mapping với description
|
|
10
|
+
*/
|
|
11
|
+
exports.ZNS_TEMPLATE_TYPES = {
|
|
12
|
+
[zns_1.ZNSTemplateType.CUSTOM]: {
|
|
13
|
+
value: zns_1.ZNSTemplateType.CUSTOM,
|
|
14
|
+
name: 'ZNS tùy chỉnh',
|
|
15
|
+
description: 'Template tùy chỉnh cho các mục đích khác nhau'
|
|
16
|
+
},
|
|
17
|
+
[zns_1.ZNSTemplateType.AUTHENTICATION]: {
|
|
18
|
+
value: zns_1.ZNSTemplateType.AUTHENTICATION,
|
|
19
|
+
name: 'ZNS xác thực',
|
|
20
|
+
description: 'Template cho việc xác thực OTP, mã PIN'
|
|
21
|
+
},
|
|
22
|
+
[zns_1.ZNSTemplateType.PAYMENT_REQUEST]: {
|
|
23
|
+
value: zns_1.ZNSTemplateType.PAYMENT_REQUEST,
|
|
24
|
+
name: 'ZNS yêu cầu thanh toán',
|
|
25
|
+
description: 'Template yêu cầu thanh toán'
|
|
26
|
+
},
|
|
27
|
+
[zns_1.ZNSTemplateType.VOUCHER]: {
|
|
28
|
+
value: zns_1.ZNSTemplateType.VOUCHER,
|
|
29
|
+
name: 'ZNS voucher',
|
|
30
|
+
description: 'Template gửi voucher, khuyến mãi'
|
|
31
|
+
},
|
|
32
|
+
[zns_1.ZNSTemplateType.SERVICE_RATING]: {
|
|
33
|
+
value: zns_1.ZNSTemplateType.SERVICE_RATING,
|
|
34
|
+
name: 'ZNS đánh giá dịch vụ',
|
|
35
|
+
description: 'Template yêu cầu đánh giá dịch vụ'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Template Tag mapping với description
|
|
40
|
+
*/
|
|
41
|
+
exports.ZNS_TEMPLATE_TAGS = {
|
|
42
|
+
[zns_1.ZNSTemplateTag.TRANSACTION]: {
|
|
43
|
+
value: zns_1.ZNSTemplateTag.TRANSACTION,
|
|
44
|
+
name: 'Transaction',
|
|
45
|
+
description: 'Giao dịch, thanh toán'
|
|
46
|
+
},
|
|
47
|
+
[zns_1.ZNSTemplateTag.CUSTOMER_CARE]: {
|
|
48
|
+
value: zns_1.ZNSTemplateTag.CUSTOMER_CARE,
|
|
49
|
+
name: 'Customer Care',
|
|
50
|
+
description: 'Chăm sóc khách hàng'
|
|
51
|
+
},
|
|
52
|
+
[zns_1.ZNSTemplateTag.PROMOTION]: {
|
|
53
|
+
value: zns_1.ZNSTemplateTag.PROMOTION,
|
|
54
|
+
name: 'Promotion',
|
|
55
|
+
description: 'Khuyến mãi, quảng cáo'
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Button Type mapping với description
|
|
60
|
+
*/
|
|
61
|
+
exports.ZNS_BUTTON_TYPES = {
|
|
62
|
+
[zns_1.ZNSButtonType.URL]: {
|
|
63
|
+
value: zns_1.ZNSButtonType.URL,
|
|
64
|
+
name: 'URL',
|
|
65
|
+
description: 'Mở đường link'
|
|
66
|
+
},
|
|
67
|
+
[zns_1.ZNSButtonType.PHONE]: {
|
|
68
|
+
value: zns_1.ZNSButtonType.PHONE,
|
|
69
|
+
name: 'Phone',
|
|
70
|
+
description: 'Gọi điện thoại'
|
|
71
|
+
},
|
|
72
|
+
[zns_1.ZNSButtonType.SMS]: {
|
|
73
|
+
value: zns_1.ZNSButtonType.SMS,
|
|
74
|
+
name: 'SMS',
|
|
75
|
+
description: 'Gửi tin nhắn SMS'
|
|
76
|
+
},
|
|
77
|
+
[zns_1.ZNSButtonType.APP]: {
|
|
78
|
+
value: zns_1.ZNSButtonType.APP,
|
|
79
|
+
name: 'App',
|
|
80
|
+
description: 'Mở ứng dụng'
|
|
81
|
+
},
|
|
82
|
+
[zns_1.ZNSButtonType.DEEPLINK]: {
|
|
83
|
+
value: zns_1.ZNSButtonType.DEEPLINK,
|
|
84
|
+
name: 'Deeplink',
|
|
85
|
+
description: 'Mở deeplink'
|
|
86
|
+
},
|
|
87
|
+
[zns_1.ZNSButtonType.MAP]: {
|
|
88
|
+
value: zns_1.ZNSButtonType.MAP,
|
|
89
|
+
name: 'Map',
|
|
90
|
+
description: 'Mở bản đồ'
|
|
91
|
+
},
|
|
92
|
+
[zns_1.ZNSButtonType.CALENDAR]: {
|
|
93
|
+
value: zns_1.ZNSButtonType.CALENDAR,
|
|
94
|
+
name: 'Calendar',
|
|
95
|
+
description: 'Thêm vào lịch'
|
|
96
|
+
},
|
|
97
|
+
[zns_1.ZNSButtonType.COPY]: {
|
|
98
|
+
value: zns_1.ZNSButtonType.COPY,
|
|
99
|
+
name: 'Copy',
|
|
100
|
+
description: 'Sao chép nội dung'
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Parameter Type mapping với description và max length
|
|
105
|
+
*/
|
|
106
|
+
exports.ZNS_PARAM_TYPES = {
|
|
107
|
+
[zns_1.ZNSParamType.CUSTOMER_NAME]: {
|
|
108
|
+
value: zns_1.ZNSParamType.CUSTOMER_NAME,
|
|
109
|
+
name: 'Tên khách hàng',
|
|
110
|
+
maxLength: 30
|
|
111
|
+
},
|
|
112
|
+
[zns_1.ZNSParamType.PHONE_NUMBER]: {
|
|
113
|
+
value: zns_1.ZNSParamType.PHONE_NUMBER,
|
|
114
|
+
name: 'Số điện thoại',
|
|
115
|
+
maxLength: 15
|
|
116
|
+
},
|
|
117
|
+
[zns_1.ZNSParamType.ADDRESS]: {
|
|
118
|
+
value: zns_1.ZNSParamType.ADDRESS,
|
|
119
|
+
name: 'Địa chỉ',
|
|
120
|
+
maxLength: 200
|
|
121
|
+
},
|
|
122
|
+
[zns_1.ZNSParamType.CODE]: {
|
|
123
|
+
value: zns_1.ZNSParamType.CODE,
|
|
124
|
+
name: 'Mã số',
|
|
125
|
+
maxLength: 30
|
|
126
|
+
},
|
|
127
|
+
[zns_1.ZNSParamType.CUSTOM_LABEL]: {
|
|
128
|
+
value: zns_1.ZNSParamType.CUSTOM_LABEL,
|
|
129
|
+
name: 'Nhãn tùy chỉnh',
|
|
130
|
+
maxLength: 30
|
|
131
|
+
},
|
|
132
|
+
[zns_1.ZNSParamType.TRANSACTION_STATUS]: {
|
|
133
|
+
value: zns_1.ZNSParamType.TRANSACTION_STATUS,
|
|
134
|
+
name: 'Trạng thái giao dịch',
|
|
135
|
+
maxLength: 30
|
|
136
|
+
},
|
|
137
|
+
[zns_1.ZNSParamType.CONTACT_INFO]: {
|
|
138
|
+
value: zns_1.ZNSParamType.CONTACT_INFO,
|
|
139
|
+
name: 'Thông tin liên hệ',
|
|
140
|
+
maxLength: 50
|
|
141
|
+
},
|
|
142
|
+
[zns_1.ZNSParamType.GENDER_TITLE]: {
|
|
143
|
+
value: zns_1.ZNSParamType.GENDER_TITLE,
|
|
144
|
+
name: 'Giới tính / Danh xưng',
|
|
145
|
+
maxLength: 5
|
|
146
|
+
},
|
|
147
|
+
[zns_1.ZNSParamType.PRODUCT_BRAND]: {
|
|
148
|
+
value: zns_1.ZNSParamType.PRODUCT_BRAND,
|
|
149
|
+
name: 'Tên sản phẩm / Thương hiệu',
|
|
150
|
+
maxLength: 200
|
|
151
|
+
},
|
|
152
|
+
[zns_1.ZNSParamType.QUANTITY_AMOUNT]: {
|
|
153
|
+
value: zns_1.ZNSParamType.QUANTITY_AMOUNT,
|
|
154
|
+
name: 'Số lượng / Số tiền',
|
|
155
|
+
maxLength: 20
|
|
156
|
+
},
|
|
157
|
+
[zns_1.ZNSParamType.TIME]: {
|
|
158
|
+
value: zns_1.ZNSParamType.TIME,
|
|
159
|
+
name: 'Thời gian',
|
|
160
|
+
maxLength: 20
|
|
161
|
+
},
|
|
162
|
+
[zns_1.ZNSParamType.OTP]: {
|
|
163
|
+
value: zns_1.ZNSParamType.OTP,
|
|
164
|
+
name: 'OTP',
|
|
165
|
+
maxLength: 10
|
|
166
|
+
},
|
|
167
|
+
[zns_1.ZNSParamType.URL]: {
|
|
168
|
+
value: zns_1.ZNSParamType.URL,
|
|
169
|
+
name: 'URL',
|
|
170
|
+
maxLength: 200
|
|
171
|
+
},
|
|
172
|
+
[zns_1.ZNSParamType.CURRENCY]: {
|
|
173
|
+
value: zns_1.ZNSParamType.CURRENCY,
|
|
174
|
+
name: 'Tiền tệ (VNĐ)',
|
|
175
|
+
maxLength: 12
|
|
176
|
+
},
|
|
177
|
+
[zns_1.ZNSParamType.BANK_TRANSFER_NOTE]: {
|
|
178
|
+
value: zns_1.ZNSParamType.BANK_TRANSFER_NOTE,
|
|
179
|
+
name: 'Bank transfer note',
|
|
180
|
+
maxLength: 90
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Template Type và Tag compatibility matrix
|
|
185
|
+
*/
|
|
186
|
+
exports.ZNS_TEMPLATE_TAG_COMPATIBILITY = {
|
|
187
|
+
[zns_1.ZNSTemplateType.CUSTOM]: [
|
|
188
|
+
zns_1.ZNSTemplateTag.TRANSACTION,
|
|
189
|
+
zns_1.ZNSTemplateTag.CUSTOMER_CARE,
|
|
190
|
+
zns_1.ZNSTemplateTag.PROMOTION
|
|
191
|
+
],
|
|
192
|
+
[zns_1.ZNSTemplateType.AUTHENTICATION]: [
|
|
193
|
+
zns_1.ZNSTemplateTag.TRANSACTION
|
|
194
|
+
],
|
|
195
|
+
[zns_1.ZNSTemplateType.PAYMENT_REQUEST]: [
|
|
196
|
+
zns_1.ZNSTemplateTag.TRANSACTION
|
|
197
|
+
],
|
|
198
|
+
[zns_1.ZNSTemplateType.VOUCHER]: [
|
|
199
|
+
zns_1.ZNSTemplateTag.TRANSACTION,
|
|
200
|
+
zns_1.ZNSTemplateTag.CUSTOMER_CARE,
|
|
201
|
+
zns_1.ZNSTemplateTag.PROMOTION
|
|
202
|
+
],
|
|
203
|
+
[zns_1.ZNSTemplateType.SERVICE_RATING]: [
|
|
204
|
+
zns_1.ZNSTemplateTag.CUSTOMER_CARE
|
|
205
|
+
]
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Validation functions
|
|
209
|
+
*/
|
|
210
|
+
exports.ZNSValidation = {
|
|
211
|
+
/**
|
|
212
|
+
* Kiểm tra template name hợp lệ
|
|
213
|
+
*/
|
|
214
|
+
isValidTemplateName: (name) => {
|
|
215
|
+
return name.length >= 10 && name.length <= 60;
|
|
216
|
+
},
|
|
217
|
+
/**
|
|
218
|
+
* Kiểm tra note hợp lệ
|
|
219
|
+
*/
|
|
220
|
+
isValidNote: (note) => {
|
|
221
|
+
return note.length >= 1 && note.length <= 400;
|
|
222
|
+
},
|
|
223
|
+
/**
|
|
224
|
+
* Kiểm tra tag có tương thích với template type không
|
|
225
|
+
*/
|
|
226
|
+
isTagCompatibleWithType: (templateType, tag) => {
|
|
227
|
+
const compatibleTags = exports.ZNS_TEMPLATE_TAG_COMPATIBILITY[templateType];
|
|
228
|
+
return compatibleTags ? compatibleTags.includes(tag) : false;
|
|
229
|
+
},
|
|
230
|
+
/**
|
|
231
|
+
* Kiểm tra param value có hợp lệ với type không
|
|
232
|
+
*/
|
|
233
|
+
isValidParamValue: (paramType, value) => {
|
|
234
|
+
const typeInfo = exports.ZNS_PARAM_TYPES[paramType];
|
|
235
|
+
return typeInfo ? value.length <= typeInfo.maxLength : false;
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
//# sourceMappingURL=zns.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zns.constants.js","sourceRoot":"","sources":["../../src/constants/zns.constants.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,sCAKsB;AAEtB;;GAEG;AACU,QAAA,kBAAkB,GAAG;IAChC,CAAC,qBAAe,CAAC,MAAM,CAAC,EAAE;QACxB,KAAK,EAAE,qBAAe,CAAC,MAAM;QAC7B,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,+CAA+C;KAC7D;IACD,CAAC,qBAAe,CAAC,cAAc,CAAC,EAAE;QAChC,KAAK,EAAE,qBAAe,CAAC,cAAc;QACrC,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,wCAAwC;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AI,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,uBAAuB,EAAE,CAAC,YAA6B,EAAE,GAAmB,EAAW,EAAE;QACvF,MAAM,cAAc,GAAG,sCAA8B,CAAC,YAAY,CAAC,CAAC;QACpE,OAAO,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC/D,CAAC;IAED;;OAEG;IACH,iBAAiB,EAAE,CAAC,SAAuB,EAAE,KAAa,EAAW,EAAE;QACrE,MAAM,QAAQ,GAAG,uBAAe,CAAC,SAAS,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;IAC/D,CAAC;CACO,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from "./types/oa";
|
|
|
14
14
|
export * from "./types/user";
|
|
15
15
|
export * from "./types/zns";
|
|
16
16
|
export * from "./types/article";
|
|
17
|
+
export * from "./constants/zns.constants";
|
|
17
18
|
export type { BaseMessage, TextMessage, ImageMessage, FileMessage, StickerMessage, TemplateMessage as MessageTemplateMessage, ReactionMessage as MessageReactionMessage, Message, MessageRecipient, SendMessageRequest, SendMessageResponse, UploadFileResponse, MessageStatus, MessageEvent, ConsultationTextMessage, ConsultationImageMessage, ConsultationFileMessage, ConsultationStickerMessage, ConsultationQuoteMessage, ConsultationRequestInfoMessage, TransactionMessage, PromotionMessage, AnonymousTextMessage, AnonymousImageMessage, AnonymousFileMessage, AnonymousStickerMessage, MiniAppMessage, ExtendedMessage, } from "./types/message";
|
|
18
19
|
export * from "./types/webhook";
|
|
19
20
|
export type { GroupMessage, GroupTextMessage, GroupImageMessage, GroupFileMessage, GroupStickerMessage, GroupMentionMessage, GroupMessageResult, GroupInfo as GroupManagementInfo, GroupMember, GroupMemberList, GroupSettings, GroupJoinRequest, GroupJoinRequestList, GroupInvitation, GroupActivity, GroupActivityList, GroupStatistics, GroupMessageTemplate, GroupMessageSchedule, GroupBroadcast, GroupPermission, GroupWebhookEvent as GroupManagementWebhookEvent, GroupApiResponse, GroupCreateResponse, GroupUpdateResponse, GroupDeleteResponse, GroupMemberActionResponse, GroupCreateRequest, GroupCreateResult, GroupUpdateRequest, GroupAvatarUpdateRequest, GroupMemberInviteRequest, GroupMemberActionRequest, GroupAdminActionRequest, GroupDeleteRequest, GroupPendingMember, GroupQuota, GroupQuotaAsset, GroupRecentChat, GroupConversationMessage, GroupsOfOAResponse, GroupDetailResponse, GroupPendingMembersResponse, GroupAcceptPendingMembersRequest, GroupAcceptPendingMembersResponse, GroupRemoveMembersRequest, GroupRemoveMembersResponse, GroupMembersResponse, GroupQuotaMessageRequest, GroupQuotaMessageResponse, } from "./types/group";
|
|
@@ -32,7 +33,7 @@ export { ConsultationService } from "./services/consultation.service";
|
|
|
32
33
|
export { TransactionService } from "./services/transaction.service";
|
|
33
34
|
export { PromotionService } from "./services/promotion.service";
|
|
34
35
|
export { GeneralMessageService } from "./services/general-message.service";
|
|
35
|
-
export { MessageManagementService } from "./services/message-management.service";
|
|
36
|
+
export { MessageManagementService, UploadFileResult, UploadImageResult, MessageQuotaInfo, ConversationMessage, Conversation, MessagePagination } from "./services/message-management.service";
|
|
36
37
|
export { ZaloSDK } from "./zalo-sdk";
|
|
37
38
|
export { ZaloSDK as default } from "./zalo-sdk";
|
|
38
39
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;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C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,8 @@ __exportStar(require("./types/oa"), exports);
|
|
|
32
32
|
__exportStar(require("./types/user"), exports);
|
|
33
33
|
__exportStar(require("./types/zns"), exports);
|
|
34
34
|
__exportStar(require("./types/article"), exports);
|
|
35
|
+
// Export ZNS constants and helpers
|
|
36
|
+
__exportStar(require("./constants/zns.constants"), exports);
|
|
35
37
|
// Export webhook types (avoiding conflicts with message and group types)
|
|
36
38
|
__exportStar(require("./types/webhook"), exports);
|
|
37
39
|
// Export clients
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;AAEH,eAAe;AACf,iDAA+B;AAC/B,+CAA6B;AAC7B,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,kDAAgC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;AAEH,eAAe;AACf,iDAA+B;AAC/B,+CAA6B;AAC7B,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,kDAAgC;AAEhC,mCAAmC;AACnC,4DAA0C;AAkC1C,yEAAyE;AACzE,kDAAgC;AA8EhC,iBAAiB;AACjB,qDAAmD;AAA1C,yGAAA,UAAU,OAAA;AACnB,qDAAmD;AAA1C,yGAAA,UAAU,OAAA;AAEnB,kBAAkB;AAClB,wDAAsD;AAA7C,2GAAA,WAAW,OAAA;AACpB,oDAAkD;AAAzC,uGAAA,SAAS,OAAA;AAClB,2GAA2G;AAC3G,wDAAsD;AAA7C,2GAAA,WAAW,OAAA;AACpB,+DA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