@khoahaha7903/zalo-oa 0.1.1 → 0.1.2

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 (108) hide show
  1. package/manifest.json +690 -0
  2. package/package.json +1 -1
  3. package/src/front-components/zalo-chat-stream.front-component.mjs +160 -0
  4. package/src/front-components/zalo-chat-stream.front-component.mjs.map +7 -0
  5. package/src/front-components/zalo-settings.front-component.mjs +202 -0
  6. package/src/front-components/zalo-settings.front-component.mjs.map +7 -0
  7. package/src/front-components/zalo-sync-sidebar.front-component.mjs +146 -0
  8. package/src/front-components/zalo-sync-sidebar.front-component.mjs.map +7 -0
  9. package/src/logic-functions/health-check.mjs +38 -0
  10. package/src/logic-functions/health-check.mjs.map +7 -0
  11. package/src/logic-functions/zalo-customer-sync.logic-function.mjs +338 -0
  12. package/src/logic-functions/zalo-customer-sync.logic-function.mjs.map +7 -0
  13. package/src/logic-functions/zalo-message-sender.logic-function.mjs +115 -0
  14. package/src/logic-functions/zalo-message-sender.logic-function.mjs.map +7 -0
  15. package/src/logic-functions/zalo-message-sync.logic-function.mjs +261 -0
  16. package/src/logic-functions/zalo-message-sync.logic-function.mjs.map +7 -0
  17. package/src/logic-functions/zalo-oauth-exchange.logic-function.mjs +116 -0
  18. package/src/logic-functions/zalo-oauth-exchange.logic-function.mjs.map +7 -0
  19. package/src/logic-functions/zalo-template-sync.logic-function.mjs +311 -0
  20. package/src/logic-functions/zalo-template-sync.logic-function.mjs.map +7 -0
  21. package/src/logic-functions/zalo-token-refresh.logic-function.mjs +236 -0
  22. package/src/logic-functions/zalo-token-refresh.logic-function.mjs.map +7 -0
  23. package/.github/workflows/cd.yml +0 -42
  24. package/.github/workflows/ci.yml +0 -60
  25. package/.github/workflows/publish.yml +0 -52
  26. package/.nvmrc +0 -1
  27. package/.oxlintrc.json +0 -37
  28. package/.yarnrc.yml +0 -1
  29. package/AGENTS.md +0 -85
  30. package/CHANGELOG.md +0 -7
  31. package/CLAUDE.md +0 -85
  32. package/SETUP.md +0 -47
  33. package/docs/superpowers/plans/2026-10-13-zalo-oa-phase-1-stages-1-2.md +0 -275
  34. package/docs/superpowers/plans/2026-10-13-zalo-oa-phase-2.md +0 -311
  35. package/docs/superpowers/specs/2026-10-13-zalo-oa-phase-1-stage-1-2-design.md +0 -225
  36. package/docs/superpowers/specs/2026-10-13-zalo-oa-phase-2-design.md +0 -203
  37. package/docs/zalo-oa/break-tasks-v0.md +0 -150
  38. package/docs/zalo-oa/design/anh-zalooa-credential.png +0 -0
  39. package/docs/zalo-oa/design/config-node.png +0 -0
  40. package/docs/zalo-oa/design/content-and-variable.png +0 -0
  41. package/docs/zalo-oa/design/detail-zbs-message-template.png +0 -0
  42. package/docs/zalo-oa/design/dropdown-choose-template.png +0 -0
  43. package/docs/zalo-oa/design/list-oa-account-empty-state.png +0 -0
  44. package/docs/zalo-oa/design/list-oa-account.png +0 -0
  45. package/docs/zalo-oa/design/more-options.png +0 -0
  46. package/docs/zalo-oa/design/new-note-send-zalooa.png +0 -0
  47. package/docs/zalo-oa/design/zbs-message-template-filter.png +0 -0
  48. package/docs/zalo-oa/design/zbs-message-template.png +0 -0
  49. package/docs/zalo-oa/public-domain.md +0 -186
  50. package/docs/zalo-oa/requirements/sync-person.md +0 -49
  51. package/docs/zalo-oa/spec-v0.md +0 -532
  52. package/locales/en.json +0 -1
  53. package/src/__tests__/application-config.test.ts +0 -14
  54. package/src/__tests__/global-setup.ts +0 -56
  55. package/src/__tests__/run-twenty.ts +0 -66
  56. package/src/__tests__/schema.integration-test.ts +0 -46
  57. package/src/application-config.ts +0 -20
  58. package/src/command-menu-items/zalo-sync.command-menu-item.ts +0 -14
  59. package/src/constants/universal-identifiers.ts +0 -46
  60. package/src/default-role.ts +0 -23
  61. package/src/front-components/__tests__/zalo-sync-sidebar.spec.tsx +0 -51
  62. package/src/front-components/chat/__tests__/zalo-chat-stream.spec.tsx +0 -89
  63. package/src/front-components/chat/zalo-chat-stream-view.tsx +0 -359
  64. package/src/front-components/settings/__tests__/zalo-settings.spec.tsx +0 -75
  65. package/src/front-components/settings/zalo-settings-view.tsx +0 -633
  66. package/src/logic-functions/__tests__/token-refresh-and-sender.spec.ts +0 -64
  67. package/src/logic-functions/__tests__/zalo-customer-sync.logic-function.spec.ts +0 -69
  68. package/src/logic-functions/__tests__/zalo-message-sync.logic-function.spec.ts +0 -114
  69. package/src/logic-functions/__tests__/zalo-oauth-exchange.logic-function.spec.ts +0 -50
  70. package/src/logic-functions/__tests__/zalo-template-sync.logic-function.spec.ts +0 -81
  71. package/src/objects/__tests__/app-and-connection-objects.spec.ts +0 -37
  72. package/src/objects/__tests__/remaining-objects.spec.ts +0 -38
  73. package/src/objects/zalo-app.object.ts +0 -95
  74. package/src/objects/zalo-message.object.ts +0 -109
  75. package/src/objects/zalo-oa-connection.object.ts +0 -158
  76. package/src/objects/zalo-user-identity.object.ts +0 -107
  77. package/src/objects/zalo-zbs-template.object.ts +0 -113
  78. package/src/page-layout-tabs/person-zalo-chat.page-layout-tab.ts +0 -35
  79. package/src/settings-menu-items/zalo-settings.settings-menu-item.ts +0 -15
  80. package/src/types/zalo-conversation-response.type.ts +0 -22
  81. package/src/types/zalo-message-send-response.type.ts +0 -8
  82. package/src/types/zalo-oa-profile-response.type.ts +0 -10
  83. package/src/types/zalo-parsed-shared-info.type.ts +0 -5
  84. package/src/types/zalo-template-response.type.ts +0 -48
  85. package/src/types/zalo-token-response.type.ts +0 -8
  86. package/src/types/zalo-user-detail-response.type.ts +0 -21
  87. package/src/types/zalo-user-list-response.type.ts +0 -10
  88. package/src/utils/__tests__/execute-workspace-graphql.util.spec.ts +0 -48
  89. package/src/utils/__tests__/format-phone-for-zalo.util.spec.ts +0 -22
  90. package/src/utils/__tests__/parse-zalo-shared-info-text.util.spec.ts +0 -42
  91. package/src/utils/__tests__/verify-zalo-webhook-signature.util.spec.ts +0 -71
  92. package/src/utils/calculate-zalo-webhook-signature.util.ts +0 -13
  93. package/src/utils/execute-workspace-graphql.util.ts +0 -101
  94. package/src/utils/format-phone-for-zalo.util.ts +0 -18
  95. package/src/utils/parse-zalo-shared-info-text.util.ts +0 -23
  96. package/src/utils/verify-zalo-webhook-signature.util.ts +0 -81
  97. package/src/zalo-client/exchange-zalo-code.client.ts +0 -30
  98. package/src/zalo-client/fetch-zalo-conversation.client.ts +0 -31
  99. package/src/zalo-client/fetch-zalo-oa-info.client.ts +0 -18
  100. package/src/zalo-client/fetch-zalo-templates.client.ts +0 -160
  101. package/src/zalo-client/fetch-zalo-user-detail.client.ts +0 -24
  102. package/src/zalo-client/fetch-zalo-user-list.client.ts +0 -34
  103. package/src/zalo-client/refresh-zalo-token.client.ts +0 -28
  104. package/src/zalo-client/send-zalo-message.client.ts +0 -45
  105. package/tsconfig.json +0 -37
  106. package/tsconfig.spec.json +0 -9
  107. package/vitest.config.ts +0 -31
  108. package/vitest.unit.config.ts +0 -14
package/manifest.json ADDED
@@ -0,0 +1,690 @@
1
+ {
2
+ "application": {
3
+ "universalIdentifier": "a797eb95-3a08-406b-a188-e669ace70739",
4
+ "displayName": "Zalo OA",
5
+ "description": "Kết nối Zalo Official Account với TinaCRM để quản lý OA, đồng bộ khách hàng và hội thoại, xem lịch sử tương tác và gửi tin nhắn theo mẫu.",
6
+ "logo": "public/logo.svg",
7
+ "author": "TinaSoft",
8
+ "category": "Productivity",
9
+ "galleryImages": [
10
+ "public/gallery/zalo-oa-overview.png",
11
+ "public/gallery/zalo-oa-customer-care.png"
12
+ ],
13
+ "defaultRoleUniversalIdentifier": "830728c9-e2c6-4dd6-8a0d-5a521e850dd0",
14
+ "aboutDescription": "# Zalo OA cho TinaCRM\n\nKết nối Zalo Official Account với TinaCRM để tập trung thông tin khách hàng và lịch sử tương tác trong CRM. Phù hợp cho đội ngũ kinh doanh, chăm sóc khách hàng và các doanh nghiệp sử dụng Zalo OA.\n\n## Tính năng nổi bật\n\n- **Quản lý kết nối OA:** Cấu hình Zalo App và kết nối các Official Account qua luồng cấp quyền.\n- **Đồng bộ khách hàng:** Lấy danh sách và thông tin người dùng từ Zalo, liên kết với hồ sơ khách hàng trong CRM theo dữ liệu API được cấp quyền trả về.\n- **Lịch sử tương tác:** Đồng bộ hội thoại và xem nội dung trao đổi tại hồ sơ khách hàng qua giao diện Chat Stream.\n- **Tin nhắn theo mẫu:** Đồng bộ mẫu tin ZBS và cung cấp logic function gửi tin với tham số động để tích hợp vào quy trình chăm sóc khách hàng.\n- **Quản lý token:** Có logic làm mới token và tiện ích kiểm tra chữ ký webhook phục vụ tích hợp.\n\n## Điều kiện sử dụng\n\n- Có tài khoản Zalo Developers, Zalo App và OA đủ điều kiện/cấp quyền sử dụng API tương ứng.\n- Cấu hình App ID, App Secret, callback và các endpoint theo hướng dẫn quản trị. Cài App vào CRM không tự kết nối với Zalo OA.\n- Khả năng gửi tin, dữ liệu trả về, hạn mức và chi phí phụ thuộc chính sách/gói dịch vụ của Zalo. Không bảo đảm lấy được số điện thoại hoặc thông tin người dùng chưa chia sẻ.\n- Quản trị viên cần cấu hình quyền workspace và bảo vệ credential. Không đưa secret vào npm package.\n\n## Hình ảnh giới thiệu\n\nHai ảnh gallery là đồ họa minh họa tính năng, không phải ảnh chụp giao diện đang chạy. Icon là biểu tượng tích hợp tùy chỉnh, không phải logo chính thức của Zalo. Ứng dụng do TinaSoft phát triển, không tuyên bố được Zalo chứng nhận.\n\n## Hướng dẫn kết nối nhanh\n\n1. **Cấu hình Zalo App:** Nhập `App ID` và `App Secret Key` được cấp từ cổng nhà phát triển Zalo Developers.\n2. **Khai báo Endpoints:** Sao chép `OAuth Redirect URI` và `Webhook URL` do ứng dụng cung cấp vào cấu hình Zalo App.\n3. **Kết nối Official Account:** Nhấn nút **Kết nối tài khoản Zalo OA**, đăng nhập và cấp quyền cho OA của bạn.\n4. **Sử dụng:** Trải nghiệm đồng bộ khách hàng tự động, xem lịch sử chat và thiết lập gửi tin nhắn ZBS trong quy trình tự động hóa.\n\n## Thông tin phiên bản\n\n- Phiên bản: `0.1.0`\n- Nhà phát triển: TinaSoft\n- Chuẩn giao tiếp: Zalo OpenAPI v3.0 / ZBS API\n",
15
+ "yarnLockChecksum": "68d4594726a683a0cad189d72e588d96",
16
+ "packageJsonChecksum": "b854eb8baf2f821f55d7a8f2f6e74a10",
17
+ "requiredServerVersionRange": ">=2.36.0",
18
+ "healthCheckLogicFunction": {
19
+ "universalIdentifier": "aa8f8a95-0cb4-43de-9a38-4308aa7c2f52"
20
+ }
21
+ },
22
+ "objects": [
23
+ {
24
+ "universalIdentifier": "078f1557-d506-4c7a-be0c-69992abe5b29",
25
+ "nameSingular": "zaloUserIdentity",
26
+ "namePlural": "zaloUserIdentities",
27
+ "labelSingular": "Zalo User Identity",
28
+ "labelPlural": "Zalo User Identities",
29
+ "icon": "IconUser",
30
+ "labelIdentifierFieldMetadataUniversalIdentifier": "d71931d1-7519-44a1-abe2-c645e0ddefd2",
31
+ "fields": [
32
+ {
33
+ "universalIdentifier": "0fdcb969-3f37-45d9-9121-cf62b749f945",
34
+ "type": "UUID",
35
+ "name": "targetRecordId",
36
+ "label": "Target Record ID",
37
+ "icon": "IconId"
38
+ },
39
+ {
40
+ "universalIdentifier": "01f940fe-985f-4cb8-a08d-493ebc710071",
41
+ "type": "TEXT",
42
+ "name": "oaId",
43
+ "label": "OA ID",
44
+ "icon": "IconHash"
45
+ },
46
+ {
47
+ "universalIdentifier": "fd1f11f7-95a7-497d-ad5e-d09b3ae6fe12",
48
+ "type": "TEXT",
49
+ "name": "zaloUserId",
50
+ "label": "Zalo User ID",
51
+ "icon": "IconUser"
52
+ },
53
+ {
54
+ "universalIdentifier": "5d1b50a4-d229-48f0-a363-331e620e9eee",
55
+ "type": "TEXT",
56
+ "name": "userIdByApp",
57
+ "label": "User ID By App",
58
+ "icon": "IconUserCheck"
59
+ },
60
+ {
61
+ "universalIdentifier": "d71931d1-7519-44a1-abe2-c645e0ddefd2",
62
+ "type": "TEXT",
63
+ "name": "displayName",
64
+ "label": "Display Name",
65
+ "icon": "IconAbc"
66
+ },
67
+ {
68
+ "universalIdentifier": "9ab48d79-1aa6-4d13-bdb5-f5726b0ea732",
69
+ "type": "TEXT",
70
+ "name": "avatarUrl",
71
+ "label": "Avatar URL",
72
+ "icon": "IconPhoto"
73
+ },
74
+ {
75
+ "universalIdentifier": "0e99491b-6718-4a95-9dfe-4b7be9a58acf",
76
+ "type": "BOOLEAN",
77
+ "name": "isFollower",
78
+ "label": "Is Follower",
79
+ "defaultValue": false,
80
+ "icon": "IconUserCheck"
81
+ },
82
+ {
83
+ "universalIdentifier": "407108c1-6100-4ea7-aa32-5f4df6538f82",
84
+ "type": "RAW_JSON",
85
+ "name": "sharedInfo",
86
+ "label": "Shared Info",
87
+ "icon": "IconFileText"
88
+ },
89
+ {
90
+ "universalIdentifier": "6b83fdd8-2052-466c-a13c-27287d9a0166",
91
+ "type": "DATE_TIME",
92
+ "name": "lastInteractedAt",
93
+ "label": "Last Interacted At",
94
+ "icon": "IconCalendarTime"
95
+ },
96
+ {
97
+ "name": "name",
98
+ "label": "Name",
99
+ "description": "Name",
100
+ "icon": "IconAbc",
101
+ "isNullable": true,
102
+ "defaultValue": null,
103
+ "type": "TEXT",
104
+ "universalIdentifier": "698f45b6-4d0c-5fa4-9a2a-599fc6cfb0ff"
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "universalIdentifier": "1a4bba82-e874-42a8-9bc3-186d4dfe030e",
110
+ "nameSingular": "zaloApp",
111
+ "namePlural": "zaloApps",
112
+ "labelSingular": "Zalo App",
113
+ "labelPlural": "Zalo Apps",
114
+ "icon": "IconSettings",
115
+ "labelIdentifierFieldMetadataUniversalIdentifier": "51f1fd37-2429-4657-88c0-f66884a3a1ca",
116
+ "fields": [
117
+ {
118
+ "universalIdentifier": "51f1fd37-2429-4657-88c0-f66884a3a1ca",
119
+ "type": "TEXT",
120
+ "name": "appId",
121
+ "label": "App ID",
122
+ "icon": "IconKey"
123
+ },
124
+ {
125
+ "universalIdentifier": "5d9eba61-8f73-4adc-97e7-a3041e4b6451",
126
+ "type": "TEXT",
127
+ "name": "serverUrl",
128
+ "label": "Server URL",
129
+ "icon": "IconWorld"
130
+ },
131
+ {
132
+ "universalIdentifier": "b7a69e6a-9ae8-41b8-9d1a-ba8c8f04e85e",
133
+ "type": "TEXT",
134
+ "name": "secretKey",
135
+ "label": "Secret Key",
136
+ "icon": "IconLock"
137
+ },
138
+ {
139
+ "universalIdentifier": "cee16949-72cc-42d9-8a26-52a539bfc7b0",
140
+ "type": "TEXT",
141
+ "name": "webhookSecretKey",
142
+ "label": "Webhook Secret Key",
143
+ "icon": "IconLock"
144
+ },
145
+ {
146
+ "universalIdentifier": "261b9af8-624b-4d0a-aafa-3168af4e5aee",
147
+ "type": "TEXT",
148
+ "name": "targetObject",
149
+ "label": "Target Object",
150
+ "defaultValue": "'person'",
151
+ "icon": "IconDatabase"
152
+ },
153
+ {
154
+ "universalIdentifier": "856dd548-3dac-4bdb-ac32-c1fea4faa5bb",
155
+ "type": "BOOLEAN",
156
+ "name": "syncOnFollow",
157
+ "label": "Sync On Follow",
158
+ "defaultValue": true,
159
+ "icon": "IconUserCheck"
160
+ },
161
+ {
162
+ "universalIdentifier": "7df1f0d6-c386-4a1d-a02e-a44a6ae37f55",
163
+ "type": "BOOLEAN",
164
+ "name": "autoRequestUserInfo",
165
+ "label": "Auto Request User Info",
166
+ "defaultValue": true,
167
+ "icon": "IconMessagePlus"
168
+ },
169
+ {
170
+ "universalIdentifier": "bfc13401-e3af-4964-ac2d-966952ddd384",
171
+ "type": "BOOLEAN",
172
+ "name": "syncMessages",
173
+ "label": "Sync Messages",
174
+ "defaultValue": true,
175
+ "icon": "IconMessageCircle"
176
+ },
177
+ {
178
+ "name": "name",
179
+ "label": "Name",
180
+ "description": "Name",
181
+ "icon": "IconAbc",
182
+ "isNullable": true,
183
+ "defaultValue": null,
184
+ "type": "TEXT",
185
+ "universalIdentifier": "4936deb0-4846-5f52-b266-875acc5c8a28"
186
+ }
187
+ ]
188
+ },
189
+ {
190
+ "universalIdentifier": "3cd777d8-720d-4bd7-b573-6772811c2989",
191
+ "nameSingular": "zaloZbsTemplate",
192
+ "namePlural": "zaloZbsTemplates",
193
+ "labelSingular": "Zalo ZBS Template",
194
+ "labelPlural": "Zalo ZBS Templates",
195
+ "icon": "IconTemplate",
196
+ "labelIdentifierFieldMetadataUniversalIdentifier": "49697772-fcb0-4e7e-98b7-56b624db475d",
197
+ "fields": [
198
+ {
199
+ "universalIdentifier": "288f28c0-d4ba-44a0-ab13-b64f521037b8",
200
+ "type": "TEXT",
201
+ "name": "oaId",
202
+ "label": "OA ID",
203
+ "icon": "IconHash"
204
+ },
205
+ {
206
+ "universalIdentifier": "b965e1de-77cf-4de8-9ead-7f1fa5ff0502",
207
+ "type": "TEXT",
208
+ "name": "templateId",
209
+ "label": "Template ID",
210
+ "icon": "IconKey"
211
+ },
212
+ {
213
+ "universalIdentifier": "49697772-fcb0-4e7e-98b7-56b624db475d",
214
+ "type": "TEXT",
215
+ "name": "templateName",
216
+ "label": "Template Name",
217
+ "icon": "IconAbc"
218
+ },
219
+ {
220
+ "universalIdentifier": "23cf9960-6f6b-4579-853b-80d1c3cd1ddc",
221
+ "type": "TEXT",
222
+ "name": "status",
223
+ "label": "Status",
224
+ "icon": "IconActivity"
225
+ },
226
+ {
227
+ "universalIdentifier": "ce1d9ee4-1838-4a89-aca9-3db11047d929",
228
+ "type": "TEXT",
229
+ "name": "templateTag",
230
+ "label": "Template Tag",
231
+ "icon": "IconTag"
232
+ },
233
+ {
234
+ "universalIdentifier": "4c02d68a-e178-4e5c-9f8a-5fbc20e376be",
235
+ "type": "TEXT",
236
+ "name": "priceSdt",
237
+ "label": "Price SDT",
238
+ "icon": "IconCoin"
239
+ },
240
+ {
241
+ "universalIdentifier": "60df4627-c2d0-4057-8807-ad976e9fd0c8",
242
+ "type": "TEXT",
243
+ "name": "priceUid",
244
+ "label": "Price UID",
245
+ "icon": "IconCoin"
246
+ },
247
+ {
248
+ "universalIdentifier": "b4d4414b-b1d5-4811-ae89-131be7fc736e",
249
+ "type": "TEXT",
250
+ "name": "previewUrl",
251
+ "label": "Preview URL",
252
+ "icon": "IconExternalLink"
253
+ },
254
+ {
255
+ "universalIdentifier": "b5cef2d1-c4bd-44c7-aced-b9bc1907a7f2",
256
+ "type": "RAW_JSON",
257
+ "name": "params",
258
+ "label": "Params",
259
+ "icon": "IconList"
260
+ },
261
+ {
262
+ "universalIdentifier": "62b3533d-9a49-4d19-9846-21a6e6b5b411",
263
+ "type": "RAW_JSON",
264
+ "name": "buttons",
265
+ "label": "Buttons",
266
+ "icon": "IconClick"
267
+ },
268
+ {
269
+ "name": "name",
270
+ "label": "Name",
271
+ "description": "Name",
272
+ "icon": "IconAbc",
273
+ "isNullable": true,
274
+ "defaultValue": null,
275
+ "type": "TEXT",
276
+ "universalIdentifier": "82682aac-57ad-5f5d-8a5e-6145952ab68e"
277
+ }
278
+ ]
279
+ },
280
+ {
281
+ "universalIdentifier": "679f0e01-e8ce-4744-b386-63cdf5282449",
282
+ "nameSingular": "zaloOaConnection",
283
+ "namePlural": "zaloOaConnections",
284
+ "labelSingular": "Zalo OA Connection",
285
+ "labelPlural": "Zalo OA Connections",
286
+ "icon": "IconPlug",
287
+ "labelIdentifierFieldMetadataUniversalIdentifier": "1eb29cc8-0cdd-4a58-a7b3-baa8aef1aa7a",
288
+ "fields": [
289
+ {
290
+ "universalIdentifier": "3fa7f0d4-6f43-4087-a930-fadbdbcd2fae",
291
+ "type": "TEXT",
292
+ "name": "oaId",
293
+ "label": "OA ID",
294
+ "icon": "IconHash"
295
+ },
296
+ {
297
+ "universalIdentifier": "1eb29cc8-0cdd-4a58-a7b3-baa8aef1aa7a",
298
+ "type": "TEXT",
299
+ "name": "name",
300
+ "label": "Name",
301
+ "icon": "IconAbc"
302
+ },
303
+ {
304
+ "universalIdentifier": "547c5f38-1bfe-4317-b39c-d0820d00e7ed",
305
+ "type": "TEXT",
306
+ "name": "avatarUrl",
307
+ "label": "Avatar URL",
308
+ "icon": "IconPhoto"
309
+ },
310
+ {
311
+ "universalIdentifier": "08765996-107a-47fa-ac8a-ee2eba867967",
312
+ "type": "TEXT",
313
+ "name": "accessToken",
314
+ "label": "Access Token",
315
+ "icon": "IconKey"
316
+ },
317
+ {
318
+ "universalIdentifier": "e0a89dca-3cbe-48e5-a393-a8f3dd609c9e",
319
+ "type": "TEXT",
320
+ "name": "refreshToken",
321
+ "label": "Refresh Token",
322
+ "icon": "IconRefresh"
323
+ },
324
+ {
325
+ "universalIdentifier": "8a09b8c6-657a-4e80-9d4e-a1235d2fcf04",
326
+ "type": "DATE_TIME",
327
+ "name": "accessTokenExpiresAt",
328
+ "label": "Access Token Expires At",
329
+ "icon": "IconCalendar"
330
+ },
331
+ {
332
+ "universalIdentifier": "8bb1f220-76a4-46d2-afbf-4c6e63ed188a",
333
+ "type": "DATE_TIME",
334
+ "name": "refreshTokenExpiresAt",
335
+ "label": "Refresh Token Expires At",
336
+ "icon": "IconCalendar"
337
+ },
338
+ {
339
+ "universalIdentifier": "9be211ef-48e0-4dc6-8975-1d4a6076dc57",
340
+ "type": "TEXT",
341
+ "name": "status",
342
+ "label": "Status",
343
+ "defaultValue": "'Synced'",
344
+ "icon": "IconActivity"
345
+ },
346
+ {
347
+ "universalIdentifier": "6b9d2d91-c292-406b-bda4-47d6fe2ae85e",
348
+ "type": "BOOLEAN",
349
+ "name": "needsReauth",
350
+ "label": "Needs Reauth",
351
+ "defaultValue": false,
352
+ "icon": "IconAlertCircle"
353
+ },
354
+ {
355
+ "universalIdentifier": "954966f1-81a6-42e5-8dfc-3d4c6eb810c7",
356
+ "type": "NUMBER",
357
+ "name": "totalFollowers",
358
+ "label": "Total Followers",
359
+ "defaultValue": 0,
360
+ "icon": "IconUsers"
361
+ },
362
+ {
363
+ "universalIdentifier": "cdc59a8c-50c5-4d7d-8307-fbd5777fbd16",
364
+ "type": "DATE_TIME",
365
+ "name": "lastFollowersSyncedAt",
366
+ "label": "Last Followers Synced At",
367
+ "icon": "IconCalendarTime"
368
+ },
369
+ {
370
+ "universalIdentifier": "9a8e539a-a6e0-48c7-9615-b73c82079e75",
371
+ "type": "DATE_TIME",
372
+ "name": "lastMessagesSyncedAt",
373
+ "label": "Last Messages Synced At",
374
+ "icon": "IconCalendarTime"
375
+ },
376
+ {
377
+ "universalIdentifier": "79f8512a-2da1-4202-8127-37f51c2678af",
378
+ "type": "BOOLEAN",
379
+ "name": "syncMessagesEnabled",
380
+ "label": "Sync Messages Enabled",
381
+ "defaultValue": true,
382
+ "icon": "IconMessageCircle"
383
+ },
384
+ {
385
+ "universalIdentifier": "b6aea2e2-2751-4bd3-b45c-41db0b1d9c67",
386
+ "type": "DATE_TIME",
387
+ "name": "lastSyncedAt",
388
+ "label": "Last Synced At",
389
+ "icon": "IconCalendarTime"
390
+ }
391
+ ]
392
+ },
393
+ {
394
+ "universalIdentifier": "da0dd444-dd1a-4e0b-b4d7-3c0302cd6694",
395
+ "nameSingular": "zaloMessage",
396
+ "namePlural": "zaloMessages",
397
+ "labelSingular": "Zalo Message",
398
+ "labelPlural": "Zalo Messages",
399
+ "icon": "IconMessageCircle",
400
+ "labelIdentifierFieldMetadataUniversalIdentifier": "2bfddd07-7f9b-4a94-a24a-42b06b2cf14d",
401
+ "fields": [
402
+ {
403
+ "universalIdentifier": "4803a2d0-c6c2-42a7-93e3-49a44b1d544d",
404
+ "type": "TEXT",
405
+ "name": "oaId",
406
+ "label": "OA ID",
407
+ "icon": "IconHash"
408
+ },
409
+ {
410
+ "universalIdentifier": "a8cc86ba-ccfe-4083-bbb4-590484610bf0",
411
+ "type": "TEXT",
412
+ "name": "zaloUserId",
413
+ "label": "Zalo User ID",
414
+ "icon": "IconUser"
415
+ },
416
+ {
417
+ "universalIdentifier": "aea22f35-071c-42c8-9133-8a58118a0c67",
418
+ "type": "UUID",
419
+ "name": "personId",
420
+ "label": "Person ID",
421
+ "icon": "IconId"
422
+ },
423
+ {
424
+ "universalIdentifier": "2bfddd07-7f9b-4a94-a24a-42b06b2cf14d",
425
+ "type": "TEXT",
426
+ "name": "zaloMessageId",
427
+ "label": "Zalo Message ID",
428
+ "icon": "IconKey"
429
+ },
430
+ {
431
+ "universalIdentifier": "27a53a8f-c5ca-4cc4-9018-36d60ccae6f3",
432
+ "type": "TEXT",
433
+ "name": "direction",
434
+ "label": "Direction",
435
+ "icon": "IconArrowsExchange"
436
+ },
437
+ {
438
+ "universalIdentifier": "2faeece2-7aea-4803-9f91-da2e1194fa08",
439
+ "type": "TEXT",
440
+ "name": "messageType",
441
+ "label": "Message Type",
442
+ "icon": "IconFileText"
443
+ },
444
+ {
445
+ "universalIdentifier": "8c963f55-d409-41c9-a63e-72b58f660486",
446
+ "type": "TEXT",
447
+ "name": "content",
448
+ "label": "Content",
449
+ "icon": "IconAlignLeft"
450
+ },
451
+ {
452
+ "universalIdentifier": "b68a4de4-0dc9-4302-beb2-114ba6d719c0",
453
+ "type": "RAW_JSON",
454
+ "name": "mediaAttachments",
455
+ "label": "Media Attachments",
456
+ "icon": "IconPaperclip"
457
+ },
458
+ {
459
+ "universalIdentifier": "214dd7a2-c0ac-4692-953a-b99932859d69",
460
+ "type": "DATE_TIME",
461
+ "name": "sentAt",
462
+ "label": "Sent At",
463
+ "icon": "IconCalendarTime"
464
+ },
465
+ {
466
+ "universalIdentifier": "6896a2b5-a528-4166-b4ad-189392405094",
467
+ "type": "RAW_JSON",
468
+ "name": "rawPayload",
469
+ "label": "Raw Payload",
470
+ "icon": "IconCode"
471
+ },
472
+ {
473
+ "name": "name",
474
+ "label": "Name",
475
+ "description": "Name",
476
+ "icon": "IconAbc",
477
+ "isNullable": true,
478
+ "defaultValue": null,
479
+ "type": "TEXT",
480
+ "universalIdentifier": "4eea2518-4aa2-5274-a3cc-5ae9827dc46e"
481
+ }
482
+ ]
483
+ }
484
+ ],
485
+ "fields": [],
486
+ "indexes": [],
487
+ "permissionFlags": [],
488
+ "roles": [
489
+ {
490
+ "universalIdentifier": "830728c9-e2c6-4dd6-8a0d-5a521e850dd0",
491
+ "label": "Zalo OA default function role",
492
+ "description": "Zalo OA default function role",
493
+ "canReadAllObjectRecords": true,
494
+ "canUpdateAllObjectRecords": true,
495
+ "canSoftDeleteAllObjectRecords": true,
496
+ "canDestroyAllObjectRecords": false,
497
+ "permissionFlagUniversalIdentifiers": [
498
+ "beb99803-9a0e-588d-9c4b-3dd14d9cdf21",
499
+ "e5f63b2d-5369-5df6-8f32-a8bd9e79e653",
500
+ "6189e7bd-4051-5752-b6b1-5f31358fbaf1",
501
+ "dc6931a9-44bd-5164-a983-3db5db837f54",
502
+ "6edf252f-228e-5e2f-9706-7bab7a796fd3"
503
+ ],
504
+ "objectPermissions": [],
505
+ "fieldPermissions": [],
506
+ "rowLevelPermissionPredicateGroups": [],
507
+ "rowLevelPermissionPredicates": []
508
+ }
509
+ ],
510
+ "skills": [],
511
+ "agents": [],
512
+ "workflows": [],
513
+ "connectionProviders": [],
514
+ "logicFunctions": [
515
+ {
516
+ "universalIdentifier": "0c7ee8cd-06ac-43cc-83a6-f996420e19af",
517
+ "name": "zalo-message-sync",
518
+ "description": "Syncs the last 100 messages from Zalo OA conversations with early exit",
519
+ "cronTriggerSettings": {
520
+ "pattern": "30 * * * *"
521
+ },
522
+ "handlerName": "default.config.handler",
523
+ "sourceHandlerPath": "src/logic-functions/zalo-message-sync.logic-function.ts",
524
+ "builtHandlerPath": "src/logic-functions/zalo-message-sync.logic-function.mjs",
525
+ "builtHandlerChecksum": "033eabc4f90b8836a7a21c2688400be8"
526
+ },
527
+ {
528
+ "universalIdentifier": "0dfcb2b6-b83f-4232-bbc7-5488244fd57b",
529
+ "name": "zalo-token-refresh",
530
+ "description": "Refreshes Zalo OA access token before expiration hourly",
531
+ "cronTriggerSettings": {
532
+ "pattern": "0 * * * *"
533
+ },
534
+ "handlerName": "default.config.handler",
535
+ "sourceHandlerPath": "src/logic-functions/zalo-token-refresh.logic-function.ts",
536
+ "builtHandlerPath": "src/logic-functions/zalo-token-refresh.logic-function.mjs",
537
+ "builtHandlerChecksum": "981af720f2f2604eaf5e2cd001af243a"
538
+ },
539
+ {
540
+ "universalIdentifier": "9e6c1e5d-16ef-46c9-a1b7-95e2d1d03bb6",
541
+ "name": "zalo-template-sync",
542
+ "description": "Syncs Zalo ZBS templates from Zalo Cloud for active OAs",
543
+ "handlerName": "default.config.handler",
544
+ "sourceHandlerPath": "src/logic-functions/zalo-template-sync.logic-function.ts",
545
+ "builtHandlerPath": "src/logic-functions/zalo-template-sync.logic-function.mjs",
546
+ "builtHandlerChecksum": "5feb5bcc69f010179a46533178698bb7"
547
+ },
548
+ {
549
+ "universalIdentifier": "aa8f8a95-0cb4-43de-9a38-4308aa7c2f52",
550
+ "name": "health-check",
551
+ "handlerName": "default.config.handler",
552
+ "sourceHandlerPath": "src/logic-functions/health-check.ts",
553
+ "builtHandlerPath": "src/logic-functions/health-check.mjs",
554
+ "builtHandlerChecksum": "6b486985c0e761d308472b8315187432"
555
+ },
556
+ {
557
+ "universalIdentifier": "e5e0c5f4-6ea6-4f5a-87cf-b6407e8fdc11",
558
+ "name": "zalo-message-sender",
559
+ "description": "Sends Zalo ZBS template message to customer via phone or UID",
560
+ "handlerName": "default.config.handler",
561
+ "sourceHandlerPath": "src/logic-functions/zalo-message-sender.logic-function.ts",
562
+ "builtHandlerPath": "src/logic-functions/zalo-message-sender.logic-function.mjs",
563
+ "builtHandlerChecksum": "5cdc847080dfce76ec5640deda17b7a6"
564
+ },
565
+ {
566
+ "universalIdentifier": "f5c2d5a5-83d0-4c81-b40e-4240a4d5b3ba",
567
+ "name": "zalo-oauth-exchange",
568
+ "description": "Exchanges authorization code for access and refresh tokens",
569
+ "handlerName": "default.config.handler",
570
+ "sourceHandlerPath": "src/logic-functions/zalo-oauth-exchange.logic-function.ts",
571
+ "builtHandlerPath": "src/logic-functions/zalo-oauth-exchange.logic-function.mjs",
572
+ "builtHandlerChecksum": "b02b379f46fa75f7d8b4e16e8c0dee1c"
573
+ },
574
+ {
575
+ "universalIdentifier": "fa68e86e-ace6-4923-a059-63d62b63c402",
576
+ "name": "zalo-customer-sync",
577
+ "description": "Syncs followers and interacted customers from Zalo OA v3.0 API hourly",
578
+ "cronTriggerSettings": {
579
+ "pattern": "15 * * * *"
580
+ },
581
+ "handlerName": "default.config.handler",
582
+ "sourceHandlerPath": "src/logic-functions/zalo-customer-sync.logic-function.ts",
583
+ "builtHandlerPath": "src/logic-functions/zalo-customer-sync.logic-function.mjs",
584
+ "builtHandlerChecksum": "e4c5bb67f66eb438f25515177025dc2f"
585
+ }
586
+ ],
587
+ "frontComponents": [
588
+ {
589
+ "universalIdentifier": "3d3a0df1-fc9f-4dc0-a58a-006b73b60ad3",
590
+ "name": "zalo-chat-stream",
591
+ "description": "Clean minimalist Zalo chat stream for Person record page",
592
+ "widgetAvailability": {
593
+ "pageLayoutType": "RECORD_PAGE"
594
+ },
595
+ "componentName": "ZaloChatStreamFrontComponent",
596
+ "sourceComponentPath": "src/front-components/zalo-chat-stream.front-component.tsx",
597
+ "builtComponentPath": "src/front-components/zalo-chat-stream.front-component.mjs",
598
+ "builtComponentChecksum": "0c63d4474062bb4a34d8421f09bb9d091765591dd8e3e0449f5d1a10148d0ea0",
599
+ "isHeadless": false,
600
+ "usesSdkClient": false
601
+ },
602
+ {
603
+ "universalIdentifier": "5b6a7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8d",
604
+ "name": "zalo-sync-sidebar",
605
+ "description": "Zalo OA sync control panel for side panel with contextual single person and global actions",
606
+ "componentName": "ZaloSyncSidebarComponent",
607
+ "sourceComponentPath": "src/front-components/zalo-sync-sidebar.front-component.tsx",
608
+ "builtComponentPath": "src/front-components/zalo-sync-sidebar.front-component.mjs",
609
+ "builtComponentChecksum": "39a02a845a89d0a623394b9e0864fc002313343c274613d8e4465af657dbf04c",
610
+ "isHeadless": false,
611
+ "usesSdkClient": false
612
+ },
613
+ {
614
+ "universalIdentifier": "a7265290-58e4-4b11-bb76-7e3bbdbbd1d7",
615
+ "name": "zalo-settings",
616
+ "description": "Zalo OA Settings configuration and account management view",
617
+ "componentName": "ZaloSettingsFrontComponent",
618
+ "sourceComponentPath": "src/front-components/zalo-settings.front-component.tsx",
619
+ "builtComponentPath": "src/front-components/zalo-settings.front-component.mjs",
620
+ "builtComponentChecksum": "a2db2c302125eab7c407a8b22a0a14dc0794a8bc802b79c5044ff6619c0422cf",
621
+ "isHeadless": false,
622
+ "usesSdkClient": false
623
+ }
624
+ ],
625
+ "publicAssets": [
626
+ {
627
+ "filePath": "public/gallery/zalo-oa-customer-care.png",
628
+ "fileName": "zalo-oa-customer-care.png",
629
+ "fileType": "png",
630
+ "checksum": "604b5cc5878d10acff832a6b414e8e71"
631
+ },
632
+ {
633
+ "filePath": "public/gallery/zalo-oa-overview.png",
634
+ "fileName": "zalo-oa-overview.png",
635
+ "fileType": "png",
636
+ "checksum": "3c78b3a6377e66bc78b086504a88d117"
637
+ },
638
+ {
639
+ "filePath": "public/logo.svg",
640
+ "fileName": "logo.svg",
641
+ "fileType": "svg",
642
+ "checksum": "5458102fdab77ae010f2c0e029a385d5"
643
+ }
644
+ ],
645
+ "views": [],
646
+ "viewFields": [],
647
+ "navigationMenuItems": [],
648
+ "pageLayouts": [],
649
+ "pageLayoutTabs": [
650
+ {
651
+ "universalIdentifier": "478ff917-5127-4f6f-bf77-7db50ee3f132",
652
+ "pageLayoutUniversalIdentifier": "4223fadb-97f1-5c61-ba41-401ba8641eb5",
653
+ "title": "Zalo Chat",
654
+ "icon": "IconMessageCircle",
655
+ "position": 65,
656
+ "layoutMode": "VERTICAL_LIST",
657
+ "widgets": [
658
+ {
659
+ "universalIdentifier": "b41ec1cb-7e97-4697-b855-bec9bb6a68f3",
660
+ "title": "Zalo Chat",
661
+ "type": "FRONT_COMPONENT",
662
+ "configuration": {
663
+ "configurationType": "FRONT_COMPONENT",
664
+ "frontComponentUniversalIdentifier": "3d3a0df1-fc9f-4dc0-a58a-006b73b60ad3"
665
+ }
666
+ }
667
+ ]
668
+ }
669
+ ],
670
+ "pageLayoutWidgets": [],
671
+ "commandMenuItems": [
672
+ {
673
+ "universalIdentifier": "6c7d8e9f-0a1b-4c2d-8e3f-4a5b6c7d8e9f",
674
+ "label": "Đồng bộ Zalo OA",
675
+ "shortLabel": "Zalo Sync",
676
+ "frontComponentUniversalIdentifier": "5b6a7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8d"
677
+ }
678
+ ],
679
+ "timelineActivityTypes": [],
680
+ "settingsMenuItems": [
681
+ {
682
+ "universalIdentifier": "e7f60e4d-cc87-4609-a909-7a38d6c81f9c",
683
+ "title": "Zalo OA",
684
+ "icon": "IconPlug",
685
+ "position": 1,
686
+ "frontComponentUniversalIdentifier": "a7265290-58e4-4b11-bb76-7e3bbdbbd1d7"
687
+ }
688
+ ],
689
+ "translations": {}
690
+ }