@@ -60,6 +60,7 @@ const MOBILE_APP_UPDATE_AVAILABLE_MESSAGE_PUSH_TYPE = 'MOBILE_APP_UPDATE_AVAILAB
60
60
const CUSTOM_CONTENT_MESSAGE_EMAIL_TYPE = 'CUSTOM_CONTENT_MESSAGE_EMAIL'
61
61
const CUSTOM_CONTENT_MESSAGE_SMS_TYPE = 'CUSTOM_CONTENT_MESSAGE_SMS'
62
62
const VOIP_INCOMING_CALL_MESSAGE_TYPE = 'VOIP_INCOMING_CALL_MESSAGE'
63
+ const CANCELED_CALL_MESSAGE_PUSH_TYPE = 'CANCELED_CALL_MESSAGE_PUSH'
63
64
const RECURRENT_PAYMENT_PROCEEDING_SUCCESS_RESULT_MESSAGE_TYPE = 'RECURRENT_PAYMENT_PROCEEDING_SUCCESS_RESULT_MESSAGE'
64
65
const RECURRENT_PAYMENT_PROCEEDING_UNKNOWN_ERROR_MESSAGE_TYPE = 'RECURRENT_PAYMENT_PROCEEDING_UNKNOWN_ERROR_MESSAGE'
65
66
const RECURRENT_PAYMENT_PROCEEDING_ACQUIRING_PAYMENT_PROCEED_ERROR_MESSAGE_TYPE = 'RECURRENT_PAYMENT_PROCEEDING_ACQUIRING_PAYMENT_PROCEED_ERROR_MESSAGE'
@@ -89,6 +90,101 @@ const SEND_DAILY_STATISTICS_MESSAGE_TYPE = 'SEND_DAILY_STATISTICS'
89
90
const B2B_APP_MESSAGE_PUSH_TYPE = 'B2B_APP_MESSAGE_PUSH'
90
91
const PASS_TICKET_CREATED_MESSAGE_TYPE = 'PASS_TICKET_CREATED'
91
92
93
+
94
+ const MESSAGE_SENDING_STATUS = 'sending'
95
+ const MESSAGE_RESENDING_STATUS = 'resending'
96
+ const MESSAGE_PROCESSING_STATUS = 'processing'
97
+ const MESSAGE_ERROR_STATUS = 'error'
98
+ const MESSAGE_BLACKLISTED_STATUS = 'blacklisted'
99
+ const MESSAGE_DELIVERED_STATUS = 'delivered'
100
+ const MESSAGE_CANCELED_STATUS = 'canceled'
101
+ const MESSAGE_SENT_STATUS = 'sent'
102
+ const MESSAGE_READ_STATUS = 'read'
103
+ const MESSAGE_DISABLED_BY_USER_STATUS = 'disabledByUser'
104
+ const MESSAGE_THROTTLED_STATUS = 'throttled'
105
+ const MESSAGE_STATUSES = [
106
+ MESSAGE_SENDING_STATUS ,
107
+ MESSAGE_RESENDING_STATUS ,
108
+ MESSAGE_PROCESSING_STATUS ,
109
+ MESSAGE_ERROR_STATUS ,
110
+ MESSAGE_BLACKLISTED_STATUS ,
111
+ MESSAGE_SENT_STATUS ,
112
+ MESSAGE_DELIVERED_STATUS ,
113
+ MESSAGE_READ_STATUS ,
114
+ MESSAGE_CANCELED_STATUS ,
115
+ MESSAGE_DISABLED_BY_USER_STATUS ,
116
+ MESSAGE_THROTTLED_STATUS ,
117
+ ]
118
+
119
+ const MESSAGE_BATCH_CREATED_STATUS = 'created'
120
+ const MESSAGE_BATCH_PROCESSING_STATUS = 'processing'
121
+ const MESSAGE_BATCH_FAILED_STATUS = 'failed'
122
+ const MESSAGE_BATCH_DONE_STATUS = 'done'
123
+ const MESSAGE_BATCH_STATUSES = [ MESSAGE_BATCH_CREATED_STATUS , MESSAGE_BATCH_PROCESSING_STATUS , MESSAGE_BATCH_FAILED_STATUS , MESSAGE_BATCH_DONE_STATUS ]
124
+ const MESSAGE_BATCH_TYPE_OPTIONS = [ CUSTOM_CONTENT_MESSAGE_TYPE , MOBILE_APP_UPDATE_AVAILABLE_MESSAGE_PUSH_TYPE , CUSTOM_CONTENT_MESSAGE_PUSH_TYPE , CUSTOM_CONTENT_MESSAGE_EMAIL_TYPE , CUSTOM_CONTENT_MESSAGE_SMS_TYPE ]
125
+
126
+ const DEVICE_PLATFORM_ANDROID = 'android'
127
+ const DEVICE_PLATFORM_IOS = 'ios'
128
+ const DEVICE_PLATFORM_WEB = 'web'
129
+ const DEVICE_PLATFORM_TYPES = [ DEVICE_PLATFORM_ANDROID , DEVICE_PLATFORM_IOS , DEVICE_PLATFORM_WEB ]
130
+
131
+ const PUSH_TYPE_DEFAULT = 'default'
132
+ const PUSH_TYPE_SILENT_DATA = 'silent_data'
133
+ const PUSH_TYPES = [ PUSH_TYPE_DEFAULT , PUSH_TYPE_SILENT_DATA ]
134
+
135
+ const PUSH_TRANSPORT_FIREBASE = 'firebase'
136
+ const PUSH_TRANSPORT_REDSTORE = 'redstore'
137
+ const PUSH_TRANSPORT_APPLE = 'apple'
138
+ const PUSH_TRANSPORT_HUAWEI = 'huawei'
139
+ const PUSH_TRANSPORT_TYPES = [ PUSH_TRANSPORT_FIREBASE , PUSH_TRANSPORT_APPLE , PUSH_TRANSPORT_HUAWEI , PUSH_TRANSPORT_REDSTORE ]
140
+ const PUSH_FAKE_TOKEN_SUCCESS = 'PUSH_FAKE_TOKEN_SUCCESS'
141
+ const PUSH_FAKE_TOKEN_FAIL = 'PUSH_FAKE_TOKEN_FAIL'
142
+
143
+ const FIREBASE_CONFIG_ENV = 'FIREBASE_CONFIG_JSON'
144
+ const FIREBASE_CONFIG_TEST_PUSHTOKEN_ENV = 'FIREBASE_PUSH_TOKEN_TEST'
145
+
146
+ const REDSTORE_CONFIG_ENV = 'REDSTORE_CONFIG_JSON'
147
+ const REDSTORE_CONFIG_TEST_PUSHTOKEN_ENV = 'REDSTORE_PUSH_TOKEN_TEST'
148
+
149
+ const HCM_CONFIG_ENV = 'HCM_CONFIG_JSON'
150
+ const HCM_CONFIG_TEST_PUSHTOKEN_ENV_RESIDENT = 'HCM_PUSH_TOKEN_TEST_RESIDENT'
151
+ const HCM_CONFIG_TEST_PUSHTOKEN_ENV_MASTER = 'HCM_PUSH_TOKEN_TEST_MASTER'
152
+
153
+ const APPLE_CONFIG_ENV = 'APPLE_CONFIG_JSON'
154
+ const APPLE_CONFIG_TEST_PUSHTOKEN_ENV = 'APPLE_PUSH_TOKEN_TEST'
155
+ const APPLE_CONFIG_TEST_VOIP_PUSHTOKEN_ENV = 'APPLE_VOIP_PUSH_TOKEN_TEST'
156
+
157
+ const APPS_WITH_DISABLED_NOTIFICATIONS_ENV = 'APPS_WITH_DISABLED_NOTIFICATIONS'
158
+ /**
159
+ * Each account in Huawei is capable to send push-notifications to only one corresponding mobile app
160
+ * These constants represent app type (master/resident) and connect app types to appIds (remoteClient schema)
161
+ */
162
+ const APP_MASTER_KEY = 'master'
163
+ const APP_RESIDENT_KEY = 'resident'
164
+ const APP_CONFIG_KEY_ENV = 'MOBILE_APP_IDS'
165
+
166
+ const APP_IDS = JSON . parse ( get ( conf , APP_CONFIG_KEY_ENV , '{}' ) )
167
+ const APP_RESIDENT_ID_ANDROID = get ( APP_IDS , [ APP_RESIDENT_KEY , DEVICE_PLATFORM_ANDROID ] ) || 'ai.doma.client'
168
+ const APP_RESIDENT_ID_IOS = get ( APP_IDS , [ APP_RESIDENT_KEY , DEVICE_PLATFORM_IOS ] ) || 'ai.doma.clients'
169
+ const APP_MASTER_ID_ANDROID = get ( APP_IDS , [ APP_MASTER_KEY , DEVICE_PLATFORM_ANDROID ] ) || 'ai.doma.master'
170
+ const APP_MASTER_ID_IOS = get ( APP_IDS , [ APP_MASTER_KEY , DEVICE_PLATFORM_IOS ] ) || 'ai.doma.master'
171
+
172
+ const HUAWEI_SUPPORTED_APP_NAMES = [ APP_RESIDENT_ID_ANDROID , APP_RESIDENT_ID_IOS , APP_MASTER_ID_ANDROID ]
173
+ const HUAWEI_APP_TYPE_BY_APP_ID = {
174
+ [ APP_RESIDENT_ID_ANDROID ] : APP_RESIDENT_KEY ,
175
+ [ APP_RESIDENT_ID_IOS ] : APP_RESIDENT_KEY ,
176
+ [ APP_MASTER_ID_ANDROID ] : APP_MASTER_KEY ,
177
+ }
178
+
179
+ const DEFAULT_TEMPLATE_FILE_EXTENSION = 'njk'
180
+ const DEFAULT_TEMPLATE_FILE_NAME = `default.${ DEFAULT_TEMPLATE_FILE_EXTENSION } `
181
+
182
+ const DIRECTLY_AVAILABLE_TYPES = [
183
+ B2C_APP_MESSAGE_PUSH_TYPE ,
184
+ VOIP_INCOMING_CALL_MESSAGE_TYPE ,
185
+ CANCELED_CALL_MESSAGE_PUSH_TYPE ,
186
+ ]
187
+
92
188
const SMS_FORBIDDEN_SYMBOLS_REGEXP = / [ & # | « » ] + / gim
93
189
94
190
const newsItemMessageMeta = {
@@ -516,6 +612,18 @@ const MESSAGE_META = {
516
612
voipDtfmCommand : { required : false } ,
517
613
} ,
518
614
} ,
615
+ [ CANCELED_CALL_MESSAGE_PUSH_TYPE ] : {
616
+ dv : { required : true } ,
617
+ title : { required : false } ,
618
+ body : { required : true } ,
619
+ data : {
620
+ B2CAppId : { required : true } ,
621
+ B2CAppContext : { required : false } ,
622
+ B2CAppName : { required : true } ,
623
+ residentId : { required : true } ,
624
+ callId : { required : false } ,
625
+ } ,
626
+ } ,
519
627
[ B2C_APP_MESSAGE_PUSH_TYPE ] : {
520
628
dv : { required : true } ,
521
629
title : { required : false } ,
@@ -819,6 +927,13 @@ const MESSAGE_DELIVERY_OPTIONS = {
819
927
isAllowedToChangeDefaultTransport : false ,
820
928
isVoIP : true ,
821
929
} ,
930
+ [ CANCELED_CALL_MESSAGE_PUSH_TYPE ] : {
931
+ priority : MESSAGE_DELIVERY_FAST_PRIORITY ,
932
+ allowedTransports : [ PUSH_TRANSPORT ] ,
933
+ defaultTransports : [ PUSH_TRANSPORT ] ,
934
+ isAllowedToChangeDefaultTransport : false ,
935
+ preferredPushType : PUSH_TYPE_SILENT_DATA ,
936
+ } ,
822
937
[ B2C_APP_MESSAGE_PUSH_TYPE ] : {
823
938
allowedTransports : [ PUSH_TRANSPORT ] ,
824
939
defaultTransports : [ PUSH_TRANSPORT ] ,
@@ -948,98 +1063,6 @@ const MESSAGE_DELIVERY_OPTIONS = {
948
1063
} ,
949
1064
}
950
1065
951
- const MESSAGE_SENDING_STATUS = 'sending'
952
- const MESSAGE_RESENDING_STATUS = 'resending'
953
- const MESSAGE_PROCESSING_STATUS = 'processing'
954
- const MESSAGE_ERROR_STATUS = 'error'
955
- const MESSAGE_BLACKLISTED_STATUS = 'blacklisted'
956
- const MESSAGE_DELIVERED_STATUS = 'delivered'
957
- const MESSAGE_CANCELED_STATUS = 'canceled'
958
- const MESSAGE_SENT_STATUS = 'sent'
959
- const MESSAGE_READ_STATUS = 'read'
960
- const MESSAGE_DISABLED_BY_USER_STATUS = 'disabledByUser'
961
- const MESSAGE_THROTTLED_STATUS = 'throttled'
962
- const MESSAGE_STATUSES = [
963
- MESSAGE_SENDING_STATUS ,
964
- MESSAGE_RESENDING_STATUS ,
965
- MESSAGE_PROCESSING_STATUS ,
966
- MESSAGE_ERROR_STATUS ,
967
- MESSAGE_BLACKLISTED_STATUS ,
968
- MESSAGE_SENT_STATUS ,
969
- MESSAGE_DELIVERED_STATUS ,
970
- MESSAGE_READ_STATUS ,
971
- MESSAGE_CANCELED_STATUS ,
972
- MESSAGE_DISABLED_BY_USER_STATUS ,
973
- MESSAGE_THROTTLED_STATUS ,
974
- ]
975
-
976
- const MESSAGE_BATCH_CREATED_STATUS = 'created'
977
- const MESSAGE_BATCH_PROCESSING_STATUS = 'processing'
978
- const MESSAGE_BATCH_FAILED_STATUS = 'failed'
979
- const MESSAGE_BATCH_DONE_STATUS = 'done'
980
- const MESSAGE_BATCH_STATUSES = [ MESSAGE_BATCH_CREATED_STATUS , MESSAGE_BATCH_PROCESSING_STATUS , MESSAGE_BATCH_FAILED_STATUS , MESSAGE_BATCH_DONE_STATUS ]
981
- const MESSAGE_BATCH_TYPE_OPTIONS = [ CUSTOM_CONTENT_MESSAGE_TYPE , MOBILE_APP_UPDATE_AVAILABLE_MESSAGE_PUSH_TYPE , CUSTOM_CONTENT_MESSAGE_PUSH_TYPE , CUSTOM_CONTENT_MESSAGE_EMAIL_TYPE , CUSTOM_CONTENT_MESSAGE_SMS_TYPE ]
982
-
983
- const DEVICE_PLATFORM_ANDROID = 'android'
984
- const DEVICE_PLATFORM_IOS = 'ios'
985
- const DEVICE_PLATFORM_WEB = 'web'
986
- const DEVICE_PLATFORM_TYPES = [ DEVICE_PLATFORM_ANDROID , DEVICE_PLATFORM_IOS , DEVICE_PLATFORM_WEB ]
987
-
988
- const PUSH_TYPE_DEFAULT = 'default'
989
- const PUSH_TYPE_SILENT_DATA = 'silent_data'
990
- const PUSH_TYPES = [ PUSH_TYPE_DEFAULT , PUSH_TYPE_SILENT_DATA ]
991
-
992
- const PUSH_TRANSPORT_FIREBASE = 'firebase'
993
- const PUSH_TRANSPORT_REDSTORE = 'redstore'
994
- const PUSH_TRANSPORT_APPLE = 'apple'
995
- const PUSH_TRANSPORT_HUAWEI = 'huawei'
996
- const PUSH_TRANSPORT_TYPES = [ PUSH_TRANSPORT_FIREBASE , PUSH_TRANSPORT_APPLE , PUSH_TRANSPORT_HUAWEI , PUSH_TRANSPORT_REDSTORE ]
997
- const PUSH_FAKE_TOKEN_SUCCESS = 'PUSH_FAKE_TOKEN_SUCCESS'
998
- const PUSH_FAKE_TOKEN_FAIL = 'PUSH_FAKE_TOKEN_FAIL'
999
-
1000
- const FIREBASE_CONFIG_ENV = 'FIREBASE_CONFIG_JSON'
1001
- const FIREBASE_CONFIG_TEST_PUSHTOKEN_ENV = 'FIREBASE_PUSH_TOKEN_TEST'
1002
-
1003
- const REDSTORE_CONFIG_ENV = 'REDSTORE_CONFIG_JSON'
1004
- const REDSTORE_CONFIG_TEST_PUSHTOKEN_ENV = 'REDSTORE_PUSH_TOKEN_TEST'
1005
-
1006
- const HCM_CONFIG_ENV = 'HCM_CONFIG_JSON'
1007
- const HCM_CONFIG_TEST_PUSHTOKEN_ENV_RESIDENT = 'HCM_PUSH_TOKEN_TEST_RESIDENT'
1008
- const HCM_CONFIG_TEST_PUSHTOKEN_ENV_MASTER = 'HCM_PUSH_TOKEN_TEST_MASTER'
1009
-
1010
- const APPLE_CONFIG_ENV = 'APPLE_CONFIG_JSON'
1011
- const APPLE_CONFIG_TEST_PUSHTOKEN_ENV = 'APPLE_PUSH_TOKEN_TEST'
1012
- const APPLE_CONFIG_TEST_VOIP_PUSHTOKEN_ENV = 'APPLE_VOIP_PUSH_TOKEN_TEST'
1013
-
1014
- const APPS_WITH_DISABLED_NOTIFICATIONS_ENV = 'APPS_WITH_DISABLED_NOTIFICATIONS'
1015
- /**
1016
- * Each account in Huawei is capable to send push-notifications to only one corresponding mobile app
1017
- * These constants represent app type (master/resident) and connect app types to appIds (remoteClient schema)
1018
- */
1019
- const APP_MASTER_KEY = 'master'
1020
- const APP_RESIDENT_KEY = 'resident'
1021
- const APP_CONFIG_KEY_ENV = 'MOBILE_APP_IDS'
1022
-
1023
- const APP_IDS = JSON . parse ( get ( conf , APP_CONFIG_KEY_ENV , '{}' ) )
1024
- const APP_RESIDENT_ID_ANDROID = get ( APP_IDS , [ APP_RESIDENT_KEY , DEVICE_PLATFORM_ANDROID ] ) || 'ai.doma.client'
1025
- const APP_RESIDENT_ID_IOS = get ( APP_IDS , [ APP_RESIDENT_KEY , DEVICE_PLATFORM_IOS ] ) || 'ai.doma.clients'
1026
- const APP_MASTER_ID_ANDROID = get ( APP_IDS , [ APP_MASTER_KEY , DEVICE_PLATFORM_ANDROID ] ) || 'ai.doma.master'
1027
- const APP_MASTER_ID_IOS = get ( APP_IDS , [ APP_MASTER_KEY , DEVICE_PLATFORM_IOS ] ) || 'ai.doma.master'
1028
-
1029
- const HUAWEI_SUPPORTED_APP_NAMES = [ APP_RESIDENT_ID_ANDROID , APP_RESIDENT_ID_IOS , APP_MASTER_ID_ANDROID ]
1030
- const HUAWEI_APP_TYPE_BY_APP_ID = {
1031
- [ APP_RESIDENT_ID_ANDROID ] : APP_RESIDENT_KEY ,
1032
- [ APP_RESIDENT_ID_IOS ] : APP_RESIDENT_KEY ,
1033
- [ APP_MASTER_ID_ANDROID ] : APP_MASTER_KEY ,
1034
- }
1035
-
1036
- const DEFAULT_TEMPLATE_FILE_EXTENSION = 'njk'
1037
- const DEFAULT_TEMPLATE_FILE_NAME = `default.${ DEFAULT_TEMPLATE_FILE_EXTENSION } `
1038
-
1039
- const DIRECTLY_AVAILABLE_TYPES = [
1040
- B2C_APP_MESSAGE_PUSH_TYPE ,
1041
- VOIP_INCOMING_CALL_MESSAGE_TYPE ,
1042
- ]
1043
1066
1044
1067
module . exports = {
1045
1068
JSON_NO_REQUIRED_ATTR_ERROR ,
@@ -1149,6 +1172,7 @@ module.exports = {
1149
1172
MESSAGE_DELIVERY_FAST_PRIORITY ,
1150
1173
MESSAGE_DELIVERY_PRIORITY_TO_TASK_QUEUE_MAP ,
1151
1174
VOIP_INCOMING_CALL_MESSAGE_TYPE ,
1175
+ CANCELED_CALL_MESSAGE_PUSH_TYPE ,
1152
1176
B2C_APP_MESSAGE_PUSH_TYPE ,
1153
1177
APPLE_CONFIG_ENV ,
1154
1178
APPLE_CONFIG_TEST_PUSHTOKEN_ENV ,
0 commit comments