web-push-notifications 3.44.7 → 3.44.8
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/core/Pushwoosh.d.ts +199 -0
- package/core/Pushwoosh.types.d.ts +213 -0
- package/core/Safari.types.d.ts +17 -0
- package/core/constants.d.ts +41 -0
- package/core/events.types.d.ts +55 -0
- package/core/functions.d.ts +5 -0
- package/core/legacyEventsMap.d.ts +5 -0
- package/core/logger.d.ts +14 -0
- package/core/modules/EventBus/EventBus.d.ts +10 -0
- package/core/storage.d.ts +27 -0
- package/helpers/logger.d.ts +11 -0
- package/helpers/pwlogger/Logger.constants.d.ts +21 -0
- package/helpers/pwlogger/Logger.d.ts +37 -0
- package/helpers/pwlogger/Logger.types.d.ts +44 -0
- package/helpers/pwlogger/handlers/handler-console/handler-console.d.ts +2 -0
- package/{src/helpers/unescape.ts → helpers/unescape.d.ts} +1 -18
- package/models/InboxMessages.d.ts +82 -0
- package/models/InboxMessages.types.d.ts +83 -0
- package/models/NotificationPayload.d.ts +39 -0
- package/models/NotificationPayload.types.d.ts +63 -0
- package/modules/Api/Api.d.ts +45 -0
- package/modules/Api/Api.types.d.ts +7 -0
- package/modules/ApiClient/ApiClient.d.ts +29 -0
- package/modules/ApiClient/ApiClient.types.d.ts +188 -0
- package/modules/Data/Data.d.ts +76 -0
- package/modules/DateModule.d.ts +27 -0
- package/modules/InboxMessagesPublic.d.ts +64 -0
- package/modules/PlatformChecker/PlatformChecker.d.ts +45 -0
- package/modules/PlatformChecker/PlatformChecker.types.d.ts +5 -0
- package/modules/storage/Storage.d.ts +63 -0
- package/{src/modules/storage/Storage.types.ts → modules/storage/Storage.types.d.ts} +7 -25
- package/modules/storage/Store.d.ts +22 -0
- package/modules/storage/migrations/26-11-2018.d.ts +2 -0
- package/modules/storage/migrations/MigrationExecutor.d.ts +9 -0
- package/modules/storage/migrations/Migrations.d.ts +15 -0
- package/modules/storage/migrations/constants.d.ts +6 -0
- package/modules/storage/migrations/helpers.d.ts +7 -0
- package/modules/storage/migrations/initial.d.ts +2 -0
- package/modules/storage/version.d.ts +2 -0
- package/npm.js +2 -0
- package/npm.js.map +1 -0
- package/package.json +1 -1
- package/service-worker.d.ts +1 -0
- package/service-worker.js +2 -0
- package/service-worker.js.map +1 -0
- package/services/PushService/PushService.types.d.ts +64 -0
- package/services/PushService/drivers/PushServiceDefault/PushServiceDefault.d.ts +29 -0
- package/{src/services/PushService/drivers/PushServiceDefault/PushServiceDefault.types.ts → services/PushService/drivers/PushServiceDefault/PushServiceDefault.types.d.ts} +1 -1
- package/services/PushService/drivers/PushServiceSafari/PushServiceSafari.d.ts +21 -0
- package/services/PushService/drivers/PushServiceSafari/PushServiceSafari.types.d.ts +4 -0
- package/widget-inbox.js +2 -0
- package/widget-inbox.js.map +1 -0
- package/widget-subscribe-popup.js +2 -0
- package/widget-subscribe-popup.js.map +1 -0
- package/widget-subscription-button.js +2 -0
- package/widget-subscription-button.js.map +1 -0
- package/widget-subscription-prompt.d.ts +2 -0
- package/widget-subscription-prompt.js +2 -0
- package/widget-subscription-prompt.js.map +1 -0
- package/widgets/Inbox/InboxWidget.d.ts +49 -0
- package/widgets/Inbox/constants.d.ts +7 -0
- package/widgets/Inbox/helpers.d.ts +4 -0
- package/widgets/Inbox/inbox_widget.types.d.ts +34 -0
- package/widgets/Inbox/widgetTemplates.d.ts +4 -0
- package/widgets/SubscribePopup/SubscribePopup.d.ts +20 -0
- package/widgets/SubscribePopup/constants.d.ts +6 -0
- package/widgets/SubscribePopup/helpers.d.ts +1 -0
- package/widgets/SubscribePopup/popupTemplates.d.ts +9 -0
- package/widgets/SubscribePopup/types/subscribe-popup.d.ts +43 -0
- package/widgets/SubscriptionButton/bell.d.ts +2 -0
- package/widgets/SubscriptionButton/constants.d.ts +7 -0
- package/widgets/SubscriptionButton/index.d.ts +90 -0
- package/widgets/SubscriptionButton/positioning.d.ts +11 -0
- package/widgets/SubscriptionButton/subscribe_widget.types.d.ts +35 -0
- package/widgets/SubscriptionPrompt/SubscriptionPromptWidget.constants.d.ts +1 -0
- package/widgets/SubscriptionPrompt/SubscriptionPromptWidget.d.ts +14 -0
- package/widgets/SubscriptionPrompt/SubscriptionPromptWidget.helpers.d.ts +3 -0
- package/widgets/SubscriptionPrompt/SubscriptionPromptWidget.types.d.ts +19 -0
- package/widgets/SubscriptionPrompt/constants.d.ts +21 -0
- package/widgets/SubscriptionPrompt/helpers.d.ts +5 -0
- package/worker/global.d.ts +16 -0
- package/worker/notification.d.ts +9 -0
- package/worker/worker.types.d.ts +4 -0
- package/.editorconfig +0 -11
- package/.gitlab-ci.yml +0 -193
- package/babel.config.js +0 -7
- package/ci/cdn/Dockerfile +0 -12
- package/ci/dev/Dockerfile +0 -30
- package/ci/dev/rootfs/entrypoint.sh +0 -18
- package/ci/dev/rootfs/entrypoint.sh.d/nginx.sh +0 -6
- package/ci/dev/rootfs/entrypoint.sh.d/supervisor.sh +0 -5
- package/ci/dev/rootfs/etc/nginx/_real_ip.conf +0 -2
- package/ci/dev/rootfs/etc/nginx/conf.d/default.conf +0 -20
- package/ci/dev/rootfs/etc/supervisor.d/nginx.ini +0 -11
- package/ci/github/Dockerfile +0 -59
- package/ci/github/release-zip.js +0 -61
- package/ci/npm/Dockerfile +0 -22
- package/config/config.js +0 -24
- package/config/configBuilder.js +0 -126
- package/config/helpers.js +0 -9
- package/config/index.js +0 -1
- package/develop/README.md +0 -42
- package/develop/favicon.png +0 -0
- package/develop/index.html +0 -511
- package/eslint.config.mjs +0 -114
- package/public/index.d.ts +0 -337
- package/scripts/zip.js +0 -26
- package/src/core/Pushwoosh.ts +0 -768
- package/src/core/Pushwoosh.types.ts +0 -254
- package/src/core/Safari.types.ts +0 -26
- package/src/core/constants.ts +0 -58
- package/src/core/events.types.ts +0 -46
- package/src/core/functions.ts +0 -33
- package/src/core/legacyEventsMap.ts +0 -64
- package/src/core/logger.ts +0 -64
- package/src/core/modules/EventBus/EventBus.ts +0 -66
- package/src/core/storage.ts +0 -254
- package/src/helpers/logger.ts +0 -81
- package/src/helpers/pwlogger/Logger.constants.ts +0 -31
- package/src/helpers/pwlogger/Logger.ts +0 -218
- package/src/helpers/pwlogger/Logger.types.ts +0 -66
- package/src/helpers/pwlogger/handlers/handler-console/handler-console.ts +0 -40
- package/src/models/InboxMessages.ts +0 -202
- package/src/models/InboxMessages.types.ts +0 -111
- package/src/models/NotificationPayload.ts +0 -216
- package/src/models/NotificationPayload.types.ts +0 -65
- package/src/modules/Api/Api.ts +0 -386
- package/src/modules/Api/Api.types.ts +0 -7
- package/src/modules/ApiClient/ApiClient.ts +0 -153
- package/src/modules/ApiClient/ApiClient.types.ts +0 -222
- package/src/modules/Data/Data.ts +0 -345
- package/src/modules/DateModule.ts +0 -53
- package/src/modules/InboxMessagesPublic.ts +0 -222
- package/src/modules/PlatformChecker/PlatformChecker.ts +0 -170
- package/src/modules/PlatformChecker/PlatformChecker.types.ts +0 -5
- package/src/modules/storage/Storage.ts +0 -164
- package/src/modules/storage/Store.ts +0 -104
- package/src/modules/storage/migrations/26-11-2018.ts +0 -25
- package/src/modules/storage/migrations/MigrationExecutor.ts +0 -31
- package/src/modules/storage/migrations/Migrations.ts +0 -41
- package/src/modules/storage/migrations/constants.ts +0 -8
- package/src/modules/storage/migrations/helpers.ts +0 -16
- package/src/modules/storage/migrations/initial.ts +0 -47
- package/src/modules/storage/version.ts +0 -2
- package/src/pushwoosh-web-notifications.ts +0 -47
- package/src/pushwoosh-widget-inbox.ts +0 -8
- package/src/pushwoosh-widget-subscribe-popup.ts +0 -9
- package/src/pushwoosh-widget-subscription-button.ts +0 -8
- package/src/pushwoosh-widget-subscription-prompt.ts +0 -6
- package/src/service-worker.ts +0 -455
- package/src/services/PushService/PushService.types.ts +0 -74
- package/src/services/PushService/drivers/PushServiceDefault/PushServiceDefault.ts +0 -235
- package/src/services/PushService/drivers/PushServiceSafari/PushServiceSafari.ts +0 -125
- package/src/services/PushService/drivers/PushServiceSafari/PushServiceSafari.types.ts +0 -4
- package/src/widget-subscription-prompt.ts +0 -33
- package/src/widgets/Inbox/InboxWidget.ts +0 -564
- package/src/widgets/Inbox/constants.ts +0 -49
- package/src/widgets/Inbox/css/inboxWidgetStyle.css +0 -274
- package/src/widgets/Inbox/helpers.ts +0 -63
- package/src/widgets/Inbox/inbox.d.ts +0 -9
- package/src/widgets/Inbox/inbox_widget.types.ts +0 -41
- package/src/widgets/Inbox/widgetTemplates.ts +0 -55
- package/src/widgets/SubscribePopup/SubscribePopup.ts +0 -241
- package/src/widgets/SubscribePopup/constants.ts +0 -66
- package/src/widgets/SubscribePopup/helpers.ts +0 -11
- package/src/widgets/SubscribePopup/popupTemplates.ts +0 -24
- package/src/widgets/SubscribePopup/styles/popup.css +0 -226
- package/src/widgets/SubscribePopup/types/subscribe-popup.ts +0 -68
- package/src/widgets/SubscriptionButton/assets/css/main.css +0 -205
- package/src/widgets/SubscriptionButton/bell.ts +0 -67
- package/src/widgets/SubscriptionButton/constants.ts +0 -28
- package/src/widgets/SubscriptionButton/index.ts +0 -377
- package/src/widgets/SubscriptionButton/positioning.ts +0 -165
- package/src/widgets/SubscriptionButton/subscribe_widget.types.ts +0 -53
- package/src/widgets/SubscriptionPrompt/SubscriptionPromptWidget.constants.ts +0 -1
- package/src/widgets/SubscriptionPrompt/SubscriptionPromptWidget.helpers.ts +0 -110
- package/src/widgets/SubscriptionPrompt/SubscriptionPromptWidget.ts +0 -102
- package/src/widgets/SubscriptionPrompt/SubscriptionPromptWidget.types.ts +0 -23
- package/src/widgets/SubscriptionPrompt/constants.ts +0 -22
- package/src/widgets/SubscriptionPrompt/helpers.ts +0 -42
- package/src/widgets/widgets.d.ts +0 -4
- package/src/worker/global.ts +0 -36
- package/src/worker/notification.ts +0 -34
- package/src/worker/worker.types.ts +0 -4
- package/test/__helpers__/apiHelpers.ts +0 -22
- package/test/__helpers__/keyValueHelpers.ts +0 -15
- package/test/__helpers__/platformHelpers.ts +0 -54
- package/test/__helpers__/sinonHelpers.ts +0 -7
- package/test/__helpers__/storageHelpers.ts +0 -56
- package/test/__mocks__/apiRequests.ts +0 -26
- package/test/__mocks__/idbMock.ts +0 -12
- package/test/__mocks__/idbObjectStoreMock.ts +0 -38
- package/test/__mocks__/inboxMessages.ts +0 -292
- package/test/__mocks__/models/inboxModel.ts +0 -71
- package/test/__mocks__/modules/apiClientModule.ts +0 -18
- package/test/__mocks__/modules/dateModule.ts +0 -34
- package/test/__mocks__/modules/inboxParamsModule.ts +0 -21
- package/test/__mocks__/modules/paramsBuilder.ts +0 -12
- package/test/__mocks__/modules/paramsModule.ts +0 -35
- package/test/__mocks__/modules/payloadBuilderModule.ts +0 -15
- package/test/__mocks__/modules/storageModule.ts +0 -58
- package/test/__mocks__/navigator.ts +0 -38
- package/test/__mocks__/notification.ts +0 -84
- package/test/__mocks__/pushwoosh.ts +0 -12
- package/test/__mocks__/userAgents +0 -8
- package/test/functions.test.ts +0 -22
- package/test/ignore-html.js +0 -6
- package/test/mocha.opts +0 -6
- package/test/modules/DateModule/unit.test.ts +0 -80
- package/test/modules/storage/Storage/unit.test.ts +0 -180
- package/test/modules/storage/Store/unit.test.ts +0 -192
- package/testRegister.js +0 -24
- package/tsconfig.json +0 -31
- package/webpack.config.js +0 -163
- /package/{src/core/modules/EventBus/index.ts → core/modules/EventBus/index.d.ts} +0 -0
- /package/{src/helpers/pwlogger/index.ts → helpers/pwlogger/index.d.ts} +0 -0
- /package/{src/modules/PlatformChecker/index.ts → modules/PlatformChecker/index.d.ts} +0 -0
- /package/{src/npm.ts → npm.d.ts} +0 -0
- /package/{src/services/PushService/PushService.ts → services/PushService/PushService.d.ts} +0 -0
- /package/{src/widget-inbox.ts → widget-inbox.d.ts} +0 -0
- /package/{src/widget-subscribe-popup.ts → widget-subscribe-popup.d.ts} +0 -0
- /package/{src/widget-subscription-button.ts → widget-subscription-button.d.ts} +0 -0
- /package/{src/widgets/Inbox/index.ts → widgets/Inbox/index.d.ts} +0 -0
- /package/{src/widgets/SubscribePopup/index.ts → widgets/SubscribePopup/index.d.ts} +0 -0
package/public/index.d.ts
DELETED
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
export = PW;
|
|
2
|
-
export as namespace PW;
|
|
3
|
-
|
|
4
|
-
declare namespace PW {
|
|
5
|
-
class Pushwoosh {
|
|
6
|
-
constructor();
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Method that puts the stored error/info messages to browser console.
|
|
10
|
-
* @type {{showLog: (() => Promise<any>); showKeyValues: (() => Promise<any>); showMessages: (() => Promise<any>)}}
|
|
11
|
-
*/
|
|
12
|
-
debug: any;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Polymorph PW method.
|
|
16
|
-
* Can get an array in the format of [string, params | callback] or a function.
|
|
17
|
-
*
|
|
18
|
-
* // with callback:
|
|
19
|
-
* Pushwoosh.push(['onNotificationClick', function(api, payload) {
|
|
20
|
-
* // click on the notification
|
|
21
|
-
* }]);
|
|
22
|
-
*
|
|
23
|
-
* // with function:
|
|
24
|
-
* Pushwoosh.push(function(api) {
|
|
25
|
-
* // this is a bit easier way to subscribe to onReady
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* // with params:
|
|
29
|
-
* // initiates Pushwoosh service and notification subscription
|
|
30
|
-
* Pushwoosh.push(['init', {
|
|
31
|
-
* applicationCode: 'XXXXX-XXXXX',
|
|
32
|
-
* // see more about params in documentation
|
|
33
|
-
* // https://docs.pushwoosh.com/docs/web-push-sdk-30#section-integration
|
|
34
|
-
* }]);
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
push(input: EventHandler | [EventName, EventHandler] | ['init', InitParams]): void;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Checks device's subscription status
|
|
41
|
-
* @returns {boolean | Promise<boolean>}
|
|
42
|
-
*/
|
|
43
|
-
isSubscribed(): boolean | Promise<boolean>;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Method returns hardware id.
|
|
47
|
-
* @returns {Promise<string>}
|
|
48
|
-
*/
|
|
49
|
-
getHWID(): Promise<string>;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Method returns push token.
|
|
53
|
-
* @returns {Promise<string>}
|
|
54
|
-
*/
|
|
55
|
-
getPushToken(): Promise<string>;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Method returns userId
|
|
59
|
-
* @returns {Promise<string | null>}
|
|
60
|
-
*/
|
|
61
|
-
getUserId(): Promise<string>;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Method returns an object with all params.
|
|
65
|
-
* @returns {Promise<PWParams>}
|
|
66
|
-
*/
|
|
67
|
-
getParams(): Promise<PWParams>;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Method initializes the permission dialog on the device
|
|
71
|
-
* and registers through the API in case the device hasn't been registered before.
|
|
72
|
-
* @param {{registerLess?: boolean}} params
|
|
73
|
-
* @returns {Promise<void>}
|
|
74
|
-
*/
|
|
75
|
-
subscribe(): Promise<void>;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Unsubscribes the device.
|
|
79
|
-
* @returns {Promise<void>}
|
|
80
|
-
*/
|
|
81
|
-
unsubscribe(): Promise<void>;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
type EventHandler = (api: API, params?: any) => void;
|
|
85
|
-
|
|
86
|
-
type EventName = 'onReady'
|
|
87
|
-
| 'onSubscribe'
|
|
88
|
-
| 'onUnsubscribe'
|
|
89
|
-
| 'onRegister'
|
|
90
|
-
| 'onPermissionPrompt'
|
|
91
|
-
| 'onPermissionDenied'
|
|
92
|
-
| 'onPermissionGranted'
|
|
93
|
-
| 'onNotificationClick'
|
|
94
|
-
| 'onPushDelivery'
|
|
95
|
-
| 'onNotificationClose'
|
|
96
|
-
| 'onSWInitError'
|
|
97
|
-
| 'onChangeCommunicationEnabled';
|
|
98
|
-
|
|
99
|
-
interface API {
|
|
100
|
-
/**
|
|
101
|
-
* Calls API method applicationOpen with device parameters.
|
|
102
|
-
* @returns {Promise<void>}
|
|
103
|
-
*/
|
|
104
|
-
applicationOpen(): Promise<void>;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Calls Pushwoosh API method.
|
|
108
|
-
* @param {string} methodName
|
|
109
|
-
* @param params
|
|
110
|
-
* @returns {Promise<any>}
|
|
111
|
-
*/
|
|
112
|
-
callAPI(methodName: string, params?: any): Promise<any>;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Calls API method getTags.
|
|
116
|
-
* Retrieves a list of Tags with corresponding values for the device.
|
|
117
|
-
* @returns {{[p: string]: any}}
|
|
118
|
-
*/
|
|
119
|
-
getTags(): { [key: string]: any };
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Calls API method messageDeliveryEvent.
|
|
123
|
-
* Registers push delivery event for the device.
|
|
124
|
-
* @param {string} hash
|
|
125
|
-
* @param {boolean} isTrackingLogOnFailure
|
|
126
|
-
* @returns {Promise<void>}
|
|
127
|
-
*/
|
|
128
|
-
messageDeliveryEvent(hash: string, isTrackingLogOnFailure: boolean): Promise<void>;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Calls API method postEvent.
|
|
132
|
-
* Calls the event within the particular application.
|
|
133
|
-
* Event name is humanized, and should match the event name in Pushwoosh Control Panel.
|
|
134
|
-
* @param {string} eventName
|
|
135
|
-
* @param {{[p: string]: any}} params
|
|
136
|
-
* @returns {Promise<void>}
|
|
137
|
-
*/
|
|
138
|
-
postEvent(eventName: string, params: { [key: string]: any }): Promise<void>;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Calls API method pushStat.
|
|
142
|
-
* Registers a push open event
|
|
143
|
-
* @param {string} hash
|
|
144
|
-
* @param {boolean} isTrackingLogOnFailure
|
|
145
|
-
* @returns {Promise<void>}
|
|
146
|
-
*/
|
|
147
|
-
pushStat(hash: string, isTrackingLogOnFailure: boolean): Promise<void>;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Calls API method registerDevice with device parameters.
|
|
151
|
-
* Saves the registration status to localStorage.
|
|
152
|
-
* @returns {Promise<void>}
|
|
153
|
-
*/
|
|
154
|
-
registerDevice(): Promise<void>;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Calls API method registerUser with user parameters.
|
|
158
|
-
* Sets new user data to IndexedDB if needed.
|
|
159
|
-
* @param {string} userId
|
|
160
|
-
* @returns {Promise<void>}
|
|
161
|
-
*/
|
|
162
|
-
registerUser(userId: string): Promise<void>;
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Calls API method setTags.
|
|
166
|
-
* Sets Tag values for the device.
|
|
167
|
-
* @param {{[p: string]: any}} tags
|
|
168
|
-
* @returns {Promise<void>}
|
|
169
|
-
*/
|
|
170
|
-
setTags(tags: { [key: string]: any }): Promise<void>;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Calls API method unregisterDevice.
|
|
174
|
-
* Removes the registration status from localStorage.
|
|
175
|
-
* @returns {Promise<void>}
|
|
176
|
-
*/
|
|
177
|
-
unregisterDevice(): Promise<void>;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Send "GDPRConsent" postEvent and depends on param "isEnabled"
|
|
181
|
-
* device will be registered/unregistered from all communication channels.
|
|
182
|
-
* @param {boolean} isEnabled
|
|
183
|
-
* @returns {Promise<void>}
|
|
184
|
-
*/
|
|
185
|
-
setCommunicationEnabled(isEnabled: boolean): Promise<void>;
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Check current communication enabled
|
|
189
|
-
* @returns {Promise<boolean>}
|
|
190
|
-
*/
|
|
191
|
-
isCommunicationEnabled(): Promise<boolean>;
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Send "GDPRDelete" postEvent and remove all device device data from Pushwoosh.
|
|
195
|
-
* @returns {Promise<void>}
|
|
196
|
-
*/
|
|
197
|
-
removeAllDeviceData(): Promise<void>;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Calls API method checkDevice with code and hwid parameters.
|
|
201
|
-
* @param {string} code
|
|
202
|
-
* @param {string} hwid
|
|
203
|
-
* @returns {Promise<any>}
|
|
204
|
-
*/
|
|
205
|
-
checkDevice(code: string, hwid: string): Promise<any>;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Initialization parameters.
|
|
210
|
-
*/
|
|
211
|
-
interface InitParams {
|
|
212
|
-
applicationCode: string;
|
|
213
|
-
autoSubscribe?: boolean;
|
|
214
|
-
defaultNotificationImage?: string;
|
|
215
|
-
defaultNotificationTitle?: string;
|
|
216
|
-
driversSettings?: {
|
|
217
|
-
worker?: {
|
|
218
|
-
serviceWorkerUrl?: string;
|
|
219
|
-
applicationServerPublicKey?: string;
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
|
-
logLevel?: 'error' | 'info' | 'debug';
|
|
223
|
-
pushwooshApiUrl?: string;
|
|
224
|
-
pushwooshUrl?: string;
|
|
225
|
-
safariWebsitePushID?: string;
|
|
226
|
-
scope?: string;
|
|
227
|
-
serviceWorkerUrl?: string | null;
|
|
228
|
-
subscribeWidget?: SubscribeWidget;
|
|
229
|
-
inboxWidget?: InboxWidget;
|
|
230
|
-
tags?: { [key: string]: any };
|
|
231
|
-
userId?: string;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Init params and driver api params
|
|
236
|
-
*/
|
|
237
|
-
interface PWParams {
|
|
238
|
-
applicationCode: string;
|
|
239
|
-
autoSubscribe?: boolean;
|
|
240
|
-
defaultNotificationImage?: string;
|
|
241
|
-
defaultNotificationTitle?: string;
|
|
242
|
-
logLevel?: 'error' | 'info' | 'debug';
|
|
243
|
-
pushwooshApiUrl?: string;
|
|
244
|
-
safariWebsitePushID?: string;
|
|
245
|
-
scope?: string;
|
|
246
|
-
subscribeWidget?: SubscribeWidget;
|
|
247
|
-
inboxWidget?: InboxWidget;
|
|
248
|
-
tags?: {
|
|
249
|
-
Language: string;
|
|
250
|
-
'Device Model': string;
|
|
251
|
-
[key: string]: any;
|
|
252
|
-
};
|
|
253
|
-
userId?: string;
|
|
254
|
-
pushwooshUrl?: string;
|
|
255
|
-
deviceType?: number;
|
|
256
|
-
serviceWorkerUrl?: string | null;
|
|
257
|
-
authToken?: string;
|
|
258
|
-
hwid?: string;
|
|
259
|
-
publicKey?: string;
|
|
260
|
-
pushToken?: string;
|
|
261
|
-
driversSettings?: {
|
|
262
|
-
worker: {
|
|
263
|
-
serviceWorkerUrl: string;
|
|
264
|
-
applicationServerPublicKey?: string;
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Sets subscription widget interface parameters.
|
|
271
|
-
*/
|
|
272
|
-
interface SubscribeWidget {
|
|
273
|
-
enable: boolean;
|
|
274
|
-
position?: string;
|
|
275
|
-
bgColor?: string;
|
|
276
|
-
bellColor?: string;
|
|
277
|
-
shadow?: string;
|
|
278
|
-
size?: string;
|
|
279
|
-
indent?: string;
|
|
280
|
-
zIndex?: string;
|
|
281
|
-
tooltipText?: TooltipText;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Sets inbox widget interface parameters.
|
|
286
|
-
*/
|
|
287
|
-
interface InboxWidget {
|
|
288
|
-
enable: boolean;
|
|
289
|
-
triggerId?: string;
|
|
290
|
-
position?: string;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Sets subscribe widget tooltip interface parameters.
|
|
295
|
-
*/
|
|
296
|
-
interface TooltipText {
|
|
297
|
-
successSubscribe?: string;
|
|
298
|
-
needSubscribe?: string;
|
|
299
|
-
blockSubscribe?: string;
|
|
300
|
-
alreadySubscribed?: string;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Payload for onPushDelivery event callback.
|
|
305
|
-
*
|
|
306
|
-
* Pushwoosh.push['onPushDelivery', (api: PW.API, payload: PW.onPushDeliveryPayload) => {}]
|
|
307
|
-
*/
|
|
308
|
-
interface onPushDeliveryPayload {
|
|
309
|
-
title: string;
|
|
310
|
-
body: string;
|
|
311
|
-
icon: string;
|
|
312
|
-
openUrl: string;
|
|
313
|
-
messageHash: string;
|
|
314
|
-
customData?: { [key: string]: any };
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* Payload for onNotificationClick event callback.
|
|
319
|
-
*
|
|
320
|
-
* Pushwoosh.push['onNotificationClick', (api: PW.API, payload: PW.onNotificationClickPayload) => {}]
|
|
321
|
-
*/
|
|
322
|
-
interface onNotificationClickPayload {
|
|
323
|
-
url: string;
|
|
324
|
-
messageHash: string;
|
|
325
|
-
customData?: { [key: string]: any };
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Payload for onNotificationClose event callback.
|
|
330
|
-
*
|
|
331
|
-
* Pushwoosh.push['onNotificationClose', (api: PW.API, payload: PW.onNotificationClosePayload) => {}]
|
|
332
|
-
*/
|
|
333
|
-
interface onNotificationClosePayload {
|
|
334
|
-
url: string;
|
|
335
|
-
messageHash: string;
|
|
336
|
-
}
|
|
337
|
-
}
|
package/scripts/zip.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const archiver = require('archiver');
|
|
5
|
-
|
|
6
|
-
const { version } = require('../package.json');
|
|
7
|
-
|
|
8
|
-
const distPath = path.normalize(path.resolve(__dirname, '..', 'output/cdn'));
|
|
9
|
-
const zipName = `PushwooshWebSDK-${version}.zip`;
|
|
10
|
-
|
|
11
|
-
const output = fs.createWriteStream(zipName);
|
|
12
|
-
const archive = archiver('zip', { zlib: { level: 9 } });
|
|
13
|
-
|
|
14
|
-
output.on('close', function () {
|
|
15
|
-
console.log(archive.pointer() + ' total bytes');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
archive.on('error', function (err) {
|
|
19
|
-
throw err;
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
archive.pipe(output);
|
|
23
|
-
archive.directory(distPath, false);
|
|
24
|
-
archive.finalize().then(() => {
|
|
25
|
-
fs.rename(zipName, path.resolve(distPath, zipName), () => console.log(`Moved to ${distPath}`));
|
|
26
|
-
});
|