crisp-api 7.2.0 → 7.4.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 +16 -0
- package/EXAMPLES.md +10 -0
- package/LICENSE +1 -1
- package/README.md +17 -3
- package/lib/crisp.js +153 -36
- package/lib/resources/BucketURL.js +3 -1
- package/lib/resources/MediaAnimation.js +5 -1
- package/lib/resources/PluginConnect.js +11 -4
- package/lib/resources/PluginSubscription.js +41 -10
- package/lib/resources/WebsiteAnalytics.js +28 -4
- package/lib/resources/WebsiteAvailability.js +6 -2
- package/lib/resources/WebsiteBase.js +13 -4
- package/lib/resources/WebsiteBatch.js +16 -4
- package/lib/resources/WebsiteCampaign.js +92 -21
- package/lib/resources/WebsiteConversation.js +257 -49
- package/lib/resources/WebsiteOperator.js +33 -8
- package/lib/resources/WebsitePeople.js +112 -25
- package/lib/resources/WebsiteSettings.js +7 -2
- package/lib/resources/WebsiteVerify.js +13 -4
- package/lib/resources/WebsiteVisitors.js +28 -7
- package/package.json +5 -5
- package/tsconfig.json +1 -1
- package/types/crisp.d.ts +98 -40
|
@@ -18,8 +18,9 @@ function PluginSubscription(service, crisp) {
|
|
|
18
18
|
/**
|
|
19
19
|
* List All Active Subscriptions
|
|
20
20
|
* @memberof PluginSubscription
|
|
21
|
+
* @public
|
|
21
22
|
* @method listAllActiveSubscriptions
|
|
22
|
-
* @return Promise
|
|
23
|
+
* @return {Promise}
|
|
23
24
|
*/
|
|
24
25
|
service.listAllActiveSubscriptions = function() {
|
|
25
26
|
return crisp.get(
|
|
@@ -30,8 +31,10 @@ function PluginSubscription(service, crisp) {
|
|
|
30
31
|
/**
|
|
31
32
|
* List Subscriptions For A Website
|
|
32
33
|
* @memberof PluginSubscription
|
|
34
|
+
* @public
|
|
33
35
|
* @method listSubscriptionsForWebsite
|
|
34
|
-
* @
|
|
36
|
+
* @param {string} websiteID
|
|
37
|
+
* @return {Promise}
|
|
35
38
|
*/
|
|
36
39
|
service.listSubscriptionsForWebsite = function(websiteID) {
|
|
37
40
|
return crisp.get(
|
|
@@ -42,8 +45,11 @@ function PluginSubscription(service, crisp) {
|
|
|
42
45
|
/**
|
|
43
46
|
* Get Subscription Details
|
|
44
47
|
* @memberof PluginSubscription
|
|
48
|
+
* @public
|
|
45
49
|
* @method getSubscriptionDetails
|
|
46
|
-
* @
|
|
50
|
+
* @param {string} websiteID
|
|
51
|
+
* @param {string} pluginID
|
|
52
|
+
* @return {Promise}
|
|
47
53
|
*/
|
|
48
54
|
service.getSubscriptionDetails = function(websiteID, pluginID) {
|
|
49
55
|
return crisp.get(
|
|
@@ -54,8 +60,11 @@ function PluginSubscription(service, crisp) {
|
|
|
54
60
|
/**
|
|
55
61
|
* Subscribe Website To Plugin
|
|
56
62
|
* @memberof PluginSubscription
|
|
63
|
+
* @public
|
|
57
64
|
* @method subscribeWebsiteToPlugin
|
|
58
|
-
* @
|
|
65
|
+
* @param {string} websiteID
|
|
66
|
+
* @param {string} pluginID
|
|
67
|
+
* @return {Promise}
|
|
59
68
|
*/
|
|
60
69
|
service.subscribeWebsiteToPlugin = function(websiteID, pluginID) {
|
|
61
70
|
return crisp.post(
|
|
@@ -72,8 +81,11 @@ function PluginSubscription(service, crisp) {
|
|
|
72
81
|
/**
|
|
73
82
|
* Unsubscribe Plugin From Website
|
|
74
83
|
* @memberof PluginSubscription
|
|
84
|
+
* @public
|
|
75
85
|
* @method unsubscribePluginFromWebsite
|
|
76
|
-
* @
|
|
86
|
+
* @param {string} websiteID
|
|
87
|
+
* @param {string} pluginID
|
|
88
|
+
* @return {Promise}
|
|
77
89
|
*/
|
|
78
90
|
service.unsubscribePluginFromWebsite = function(websiteID, pluginID) {
|
|
79
91
|
return crisp.delete(
|
|
@@ -84,8 +96,11 @@ function PluginSubscription(service, crisp) {
|
|
|
84
96
|
/**
|
|
85
97
|
* Get Subscription Settings
|
|
86
98
|
* @memberof PluginSubscription
|
|
99
|
+
* @public
|
|
87
100
|
* @method getSubscriptionSettings
|
|
88
|
-
* @
|
|
101
|
+
* @param {string} websiteID
|
|
102
|
+
* @param {string} pluginID
|
|
103
|
+
* @return {Promise}
|
|
89
104
|
*/
|
|
90
105
|
service.getSubscriptionSettings = function(websiteID, pluginID) {
|
|
91
106
|
return crisp.get(
|
|
@@ -98,8 +113,12 @@ function PluginSubscription(service, crisp) {
|
|
|
98
113
|
/**
|
|
99
114
|
* Save Subscription Settings
|
|
100
115
|
* @memberof PluginSubscription
|
|
116
|
+
* @public
|
|
101
117
|
* @method saveSubscriptionSettings
|
|
102
|
-
* @
|
|
118
|
+
* @param {string} websiteID
|
|
119
|
+
* @param {string} pluginID
|
|
120
|
+
* @param {object} settings
|
|
121
|
+
* @return {Promise}
|
|
103
122
|
*/
|
|
104
123
|
service.saveSubscriptionSettings = function(websiteID, pluginID, settings) {
|
|
105
124
|
return crisp.put(
|
|
@@ -114,8 +133,12 @@ function PluginSubscription(service, crisp) {
|
|
|
114
133
|
/**
|
|
115
134
|
* Update Subscription Settings
|
|
116
135
|
* @memberof PluginSubscription
|
|
136
|
+
* @public
|
|
117
137
|
* @method updateSubscriptionSettings
|
|
118
|
-
* @
|
|
138
|
+
* @param {string} websiteID
|
|
139
|
+
* @param {string} pluginID
|
|
140
|
+
* @param {object} settings
|
|
141
|
+
* @return {Promise}
|
|
119
142
|
*/
|
|
120
143
|
service.updateSubscriptionSettings = function(websiteID, pluginID, settings) {
|
|
121
144
|
return crisp.patch(
|
|
@@ -130,8 +153,12 @@ function PluginSubscription(service, crisp) {
|
|
|
130
153
|
/**
|
|
131
154
|
* Forward Plugin Payload To Channel
|
|
132
155
|
* @memberof PluginSubscription
|
|
156
|
+
* @public
|
|
133
157
|
* @method forwardPluginPayloadToChannel
|
|
134
|
-
* @
|
|
158
|
+
* @param {string} websiteID
|
|
159
|
+
* @param {string} pluginID
|
|
160
|
+
* @param {object} payload
|
|
161
|
+
* @return {Promise}
|
|
135
162
|
*/
|
|
136
163
|
service.forwardPluginPayloadToChannel = function(
|
|
137
164
|
websiteID, pluginID, payload
|
|
@@ -148,8 +175,12 @@ function PluginSubscription(service, crisp) {
|
|
|
148
175
|
/**
|
|
149
176
|
* Dispatch Plugin Event
|
|
150
177
|
* @memberof PluginSubscription
|
|
178
|
+
* @public
|
|
151
179
|
* @method dispatchPluginEvent
|
|
152
|
-
* @
|
|
180
|
+
* @param {string} websiteID
|
|
181
|
+
* @param {string} pluginID
|
|
182
|
+
* @param {object} payload
|
|
183
|
+
* @return {Promise}
|
|
153
184
|
*/
|
|
154
185
|
service.dispatchPluginEvent = function(websiteID, pluginID, payload) {
|
|
155
186
|
return crisp.post(
|
|
@@ -18,8 +18,18 @@ function WebsiteAnalytics(service, crisp) {
|
|
|
18
18
|
/**
|
|
19
19
|
* Acquire Analytics Points
|
|
20
20
|
* @memberof WebsiteAnalytics
|
|
21
|
+
* @public
|
|
21
22
|
* @method acquireAnalyticsPoints
|
|
22
|
-
* @
|
|
23
|
+
* @param {string} websiteID
|
|
24
|
+
* @param {string} pointType
|
|
25
|
+
* @param {string} pointMetric
|
|
26
|
+
* @param {string} dateFrom
|
|
27
|
+
* @param {string} dateTo
|
|
28
|
+
* @param {string} dateSplit
|
|
29
|
+
* @param {string} classifier
|
|
30
|
+
* @param {string} filterSecondary
|
|
31
|
+
* @param {string} filterTertiary
|
|
32
|
+
* @return {Promise}
|
|
23
33
|
*/
|
|
24
34
|
service.acquireAnalyticsPoints = function(
|
|
25
35
|
websiteID, pointType, pointMetric, dateFrom, dateTo, dateSplit, classifier,
|
|
@@ -45,8 +55,15 @@ function WebsiteAnalytics(service, crisp) {
|
|
|
45
55
|
/**
|
|
46
56
|
* List Analytics Filters
|
|
47
57
|
* @memberof WebsiteAnalytics
|
|
58
|
+
* @public
|
|
48
59
|
* @method listAnalyticsFilters
|
|
49
|
-
* @
|
|
60
|
+
* @param {string} websiteID
|
|
61
|
+
* @param {number} pageNumber
|
|
62
|
+
* @param {string} pointType
|
|
63
|
+
* @param {string} pointMetric
|
|
64
|
+
* @param {string} dateFrom
|
|
65
|
+
* @param {string} dateTo
|
|
66
|
+
* @return {Promise}
|
|
50
67
|
*/
|
|
51
68
|
service.listAnalyticsFilters = function(
|
|
52
69
|
websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo
|
|
@@ -58,7 +75,7 @@ function WebsiteAnalytics(service, crisp) {
|
|
|
58
75
|
|
|
59
76
|
{
|
|
60
77
|
date_from : dateFrom,
|
|
61
|
-
date_to
|
|
78
|
+
date_to : dateTo
|
|
62
79
|
}
|
|
63
80
|
);
|
|
64
81
|
};
|
|
@@ -66,8 +83,15 @@ function WebsiteAnalytics(service, crisp) {
|
|
|
66
83
|
/**
|
|
67
84
|
* List Analytics Classifiers
|
|
68
85
|
* @memberof WebsiteAnalytics
|
|
86
|
+
* @public
|
|
69
87
|
* @method listAnalyticsClassifiers
|
|
70
|
-
* @
|
|
88
|
+
* @param {string} websiteID
|
|
89
|
+
* @param {number} pageNumber
|
|
90
|
+
* @param {string} pointType
|
|
91
|
+
* @param {string} pointMetric
|
|
92
|
+
* @param {string} dateFrom
|
|
93
|
+
* @param {string} dateTo
|
|
94
|
+
* @return {Promise}
|
|
71
95
|
*/
|
|
72
96
|
service.listAnalyticsClassifiers = function(
|
|
73
97
|
websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo
|
|
@@ -18,8 +18,10 @@ function WebsiteAvailability(service, crisp) {
|
|
|
18
18
|
/**
|
|
19
19
|
* Get Website Availability Status
|
|
20
20
|
* @memberof WebsiteAvailability
|
|
21
|
+
* @public
|
|
21
22
|
* @method getWebsiteAvailabilityStatus
|
|
22
|
-
* @
|
|
23
|
+
* @param {string} websiteID
|
|
24
|
+
* @return {Promise}
|
|
23
25
|
*/
|
|
24
26
|
service.getWebsiteAvailabilityStatus = function(websiteID) {
|
|
25
27
|
return crisp.get(
|
|
@@ -30,8 +32,10 @@ function WebsiteAvailability(service, crisp) {
|
|
|
30
32
|
/**
|
|
31
33
|
* List Website Operator Availabilities
|
|
32
34
|
* @memberof WebsiteAvailability
|
|
35
|
+
* @public
|
|
33
36
|
* @method listWebsiteOperatorAvailabilities
|
|
34
|
-
* @
|
|
37
|
+
* @param {string} websiteID
|
|
38
|
+
* @return {Promise}
|
|
35
39
|
*/
|
|
36
40
|
service.listWebsiteOperatorAvailabilities = function(websiteID) {
|
|
37
41
|
return crisp.get(
|
|
@@ -18,8 +18,10 @@ function WebsiteBase(service, crisp) {
|
|
|
18
18
|
/**
|
|
19
19
|
* Check If Website Exists
|
|
20
20
|
* @memberof WebsiteBase
|
|
21
|
+
* @public
|
|
21
22
|
* @method checkWebsiteExists
|
|
22
|
-
* @
|
|
23
|
+
* @param {string} domain
|
|
24
|
+
* @return {Promise}
|
|
23
25
|
*/
|
|
24
26
|
service.checkWebsiteExists = function(domain) {
|
|
25
27
|
return crisp.head(
|
|
@@ -34,8 +36,10 @@ function WebsiteBase(service, crisp) {
|
|
|
34
36
|
/**
|
|
35
37
|
* Create Website
|
|
36
38
|
* @memberof WebsiteBase
|
|
39
|
+
* @public
|
|
37
40
|
* @method createWebsite
|
|
38
|
-
* @
|
|
41
|
+
* @param {object} websiteData
|
|
42
|
+
* @return {Promise}
|
|
39
43
|
*/
|
|
40
44
|
service.createWebsite = function(websiteData) {
|
|
41
45
|
return crisp.post(
|
|
@@ -46,8 +50,10 @@ function WebsiteBase(service, crisp) {
|
|
|
46
50
|
/**
|
|
47
51
|
* Get A Website
|
|
48
52
|
* @memberof WebsiteBase
|
|
53
|
+
* @public
|
|
49
54
|
* @method getWebsite
|
|
50
|
-
* @
|
|
55
|
+
* @param {string} websiteID
|
|
56
|
+
* @return {Promise}
|
|
51
57
|
*/
|
|
52
58
|
service.getWebsite = function(websiteID) {
|
|
53
59
|
return crisp.get(
|
|
@@ -58,8 +64,11 @@ function WebsiteBase(service, crisp) {
|
|
|
58
64
|
/**
|
|
59
65
|
* Delete A Website
|
|
60
66
|
* @memberof WebsiteBase
|
|
67
|
+
* @public
|
|
61
68
|
* @method deleteWebsite
|
|
62
|
-
* @
|
|
69
|
+
* @param {string} websiteID
|
|
70
|
+
* @param {string} verify
|
|
71
|
+
* @return {Promise}
|
|
63
72
|
*/
|
|
64
73
|
service.deleteWebsite = function(websiteID, verify) {
|
|
65
74
|
return crisp.delete(
|
|
@@ -18,8 +18,11 @@ function WebsiteBatch(service, crisp) {
|
|
|
18
18
|
/**
|
|
19
19
|
* Batch Resolve Conversations
|
|
20
20
|
* @memberof WebsiteBatch
|
|
21
|
+
* @public
|
|
21
22
|
* @method batchResolveConversations
|
|
22
|
-
* @
|
|
23
|
+
* @param {string} websiteID
|
|
24
|
+
* @param {object} sessions
|
|
25
|
+
* @return {Promise}
|
|
23
26
|
*/
|
|
24
27
|
service.batchResolveConversations = function(websiteID, sessions) {
|
|
25
28
|
return crisp.patch(
|
|
@@ -36,8 +39,11 @@ function WebsiteBatch(service, crisp) {
|
|
|
36
39
|
/**
|
|
37
40
|
* Batch Read Conversations
|
|
38
41
|
* @memberof WebsiteBatch
|
|
42
|
+
* @public
|
|
39
43
|
* @method batchReadConversations
|
|
40
|
-
* @
|
|
44
|
+
* @param {string} websiteID
|
|
45
|
+
* @param {object} sessions
|
|
46
|
+
* @return {Promise}
|
|
41
47
|
*/
|
|
42
48
|
service.batchReadConversations = function(websiteID, sessions) {
|
|
43
49
|
return crisp.patch(
|
|
@@ -54,8 +60,11 @@ function WebsiteBatch(service, crisp) {
|
|
|
54
60
|
/**
|
|
55
61
|
* Batch Remove Conversations
|
|
56
62
|
* @memberof WebsiteBatch
|
|
63
|
+
* @public
|
|
57
64
|
* @method batchRemoveConversations
|
|
58
|
-
* @
|
|
65
|
+
* @param {string} websiteID
|
|
66
|
+
* @param {object} sessions
|
|
67
|
+
* @return {Promise}
|
|
59
68
|
*/
|
|
60
69
|
service.batchRemoveConversations = function(websiteID, sessions) {
|
|
61
70
|
return crisp.patch(
|
|
@@ -72,8 +81,11 @@ function WebsiteBatch(service, crisp) {
|
|
|
72
81
|
/**
|
|
73
82
|
* Batch Remove People
|
|
74
83
|
* @memberof WebsiteBatch
|
|
84
|
+
* @public
|
|
75
85
|
* @method batchRemovePeople
|
|
76
|
-
* @
|
|
86
|
+
* @param {string} websiteID
|
|
87
|
+
* @param {object} people
|
|
88
|
+
* @return {Promise}
|
|
77
89
|
*/
|
|
78
90
|
service.batchRemovePeople = function(websiteID, people) {
|
|
79
91
|
return crisp.patch(
|
|
@@ -18,8 +18,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
18
18
|
/**
|
|
19
19
|
* List Campaigns
|
|
20
20
|
* @memberof WebsiteCampaign
|
|
21
|
+
* @public
|
|
21
22
|
* @method listCampaigns
|
|
22
|
-
* @
|
|
23
|
+
* @param {string} websiteID
|
|
24
|
+
* @param {number} pageNumber
|
|
25
|
+
* @return {Promise}
|
|
23
26
|
*/
|
|
24
27
|
service.listCampaigns = function(websiteID, pageNumber) {
|
|
25
28
|
return crisp.get(
|
|
@@ -32,8 +35,10 @@ function WebsiteCampaign(service, crisp) {
|
|
|
32
35
|
/**
|
|
33
36
|
* List Campaign Tags
|
|
34
37
|
* @memberof WebsiteCampaign
|
|
38
|
+
* @public
|
|
35
39
|
* @method listCampaignTags
|
|
36
|
-
* @
|
|
40
|
+
* @param {string} websiteID
|
|
41
|
+
* @return {Promise}
|
|
37
42
|
*/
|
|
38
43
|
service.listCampaignTags = function(websiteID) {
|
|
39
44
|
return crisp.get(
|
|
@@ -44,8 +49,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
44
49
|
/**
|
|
45
50
|
* List Campaign Templates
|
|
46
51
|
* @memberof WebsiteCampaign
|
|
52
|
+
* @public
|
|
47
53
|
* @method listCampaignTemplates
|
|
48
|
-
* @
|
|
54
|
+
* @param {string} websiteID
|
|
55
|
+
* @param {number} pageNumber
|
|
56
|
+
* @return {Promise}
|
|
49
57
|
*/
|
|
50
58
|
service.listCampaignTemplates = function(websiteID, pageNumber) {
|
|
51
59
|
return crisp.get(
|
|
@@ -58,8 +66,12 @@ function WebsiteCampaign(service, crisp) {
|
|
|
58
66
|
/**
|
|
59
67
|
* Create A New Campaign Template
|
|
60
68
|
* @memberof WebsiteCampaign
|
|
69
|
+
* @public
|
|
61
70
|
* @method createNewCampaignTemplate
|
|
62
|
-
* @
|
|
71
|
+
* @param {string} websiteID
|
|
72
|
+
* @param {string} templateFormat
|
|
73
|
+
* @param {string} templateName
|
|
74
|
+
* @return {Promise}
|
|
63
75
|
*/
|
|
64
76
|
service.createNewCampaignTemplate = function(
|
|
65
77
|
websiteID, templateFormat, templateName
|
|
@@ -79,8 +91,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
79
91
|
/**
|
|
80
92
|
* Check If Campaign Template Exists
|
|
81
93
|
* @memberof WebsiteCampaign
|
|
94
|
+
* @public
|
|
82
95
|
* @method checkCampaignTemplateExists
|
|
83
|
-
* @
|
|
96
|
+
* @param {string} websiteID
|
|
97
|
+
* @param {string} templateID
|
|
98
|
+
* @return {Promise}
|
|
84
99
|
*/
|
|
85
100
|
service.checkCampaignTemplateExists = function(websiteID, templateID) {
|
|
86
101
|
return crisp.head(
|
|
@@ -93,8 +108,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
93
108
|
/**
|
|
94
109
|
* Get A Campaign Template
|
|
95
110
|
* @memberof WebsiteCampaign
|
|
111
|
+
* @public
|
|
96
112
|
* @method getCampaignTemplate
|
|
97
|
-
* @
|
|
113
|
+
* @param {string} websiteID
|
|
114
|
+
* @param {string} templateID
|
|
115
|
+
* @return {Promise}
|
|
98
116
|
*/
|
|
99
117
|
service.getCampaignTemplate = function(websiteID, templateID) {
|
|
100
118
|
return crisp.get(
|
|
@@ -107,8 +125,12 @@ function WebsiteCampaign(service, crisp) {
|
|
|
107
125
|
/**
|
|
108
126
|
* Save A Campaign Template
|
|
109
127
|
* @memberof WebsiteCampaign
|
|
128
|
+
* @public
|
|
110
129
|
* @method saveCampaignTemplate
|
|
111
|
-
* @
|
|
130
|
+
* @param {string} websiteID
|
|
131
|
+
* @param {string} templateID
|
|
132
|
+
* @param {object} template
|
|
133
|
+
* @return {Promise}
|
|
112
134
|
*/
|
|
113
135
|
service.saveCampaignTemplate = function(websiteID, templateID, template) {
|
|
114
136
|
return crisp.put(
|
|
@@ -123,8 +145,12 @@ function WebsiteCampaign(service, crisp) {
|
|
|
123
145
|
/**
|
|
124
146
|
* Update A Campaign Template
|
|
125
147
|
* @memberof WebsiteCampaign
|
|
148
|
+
* @public
|
|
126
149
|
* @method updateCampaignTemplate
|
|
127
|
-
* @
|
|
150
|
+
* @param {string} websiteID
|
|
151
|
+
* @param {string} templateID
|
|
152
|
+
* @param {object} template
|
|
153
|
+
* @return {Promise}
|
|
128
154
|
*/
|
|
129
155
|
service.updateCampaignTemplate = function(websiteID, templateID, template) {
|
|
130
156
|
return crisp.patch(
|
|
@@ -139,8 +165,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
139
165
|
/**
|
|
140
166
|
* Remove A Campaign Template
|
|
141
167
|
* @memberof WebsiteCampaign
|
|
168
|
+
* @public
|
|
142
169
|
* @method removeCampaignTemplate
|
|
143
|
-
* @
|
|
170
|
+
* @param {string} websiteID
|
|
171
|
+
* @param {string} templateID
|
|
172
|
+
* @return {Promise}
|
|
144
173
|
*/
|
|
145
174
|
service.removeCampaignTemplate = function(websiteID, templateID) {
|
|
146
175
|
return crisp.delete(
|
|
@@ -153,8 +182,12 @@ function WebsiteCampaign(service, crisp) {
|
|
|
153
182
|
/**
|
|
154
183
|
* Create A New Campaign
|
|
155
184
|
* @memberof WebsiteCampaign
|
|
185
|
+
* @public
|
|
156
186
|
* @method createNewCampaign
|
|
157
|
-
* @
|
|
187
|
+
* @param {string} websiteID
|
|
188
|
+
* @param {string} campaignType
|
|
189
|
+
* @param {string} campaignName
|
|
190
|
+
* @return {Promise}
|
|
158
191
|
*/
|
|
159
192
|
service.createNewCampaign = function(websiteID, campaignType, campaignName) {
|
|
160
193
|
return crisp.post(
|
|
@@ -172,8 +205,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
172
205
|
/**
|
|
173
206
|
* Check If Campaign Exists
|
|
174
207
|
* @memberof WebsiteCampaign
|
|
208
|
+
* @public
|
|
175
209
|
* @method checkCampaignExists
|
|
176
|
-
* @
|
|
210
|
+
* @param {string} websiteID
|
|
211
|
+
* @param {string} campaignID
|
|
212
|
+
* @return {Promise}
|
|
177
213
|
*/
|
|
178
214
|
service.checkCampaignExists = function(websiteID, campaignID) {
|
|
179
215
|
return crisp.head(
|
|
@@ -184,8 +220,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
184
220
|
/**
|
|
185
221
|
* Get A Campaign
|
|
186
222
|
* @memberof WebsiteCampaign
|
|
223
|
+
* @public
|
|
187
224
|
* @method getCampaign
|
|
188
|
-
* @
|
|
225
|
+
* @param {string} websiteID
|
|
226
|
+
* @param {string} campaignID
|
|
227
|
+
* @return {Promise}
|
|
189
228
|
*/
|
|
190
229
|
service.getCampaign = function(websiteID, campaignID) {
|
|
191
230
|
return crisp.get(
|
|
@@ -196,8 +235,12 @@ function WebsiteCampaign(service, crisp) {
|
|
|
196
235
|
/**
|
|
197
236
|
* Save A Campaign
|
|
198
237
|
* @memberof WebsiteCampaign
|
|
238
|
+
* @public
|
|
199
239
|
* @method saveCampaign
|
|
200
|
-
* @
|
|
240
|
+
* @param {string} websiteID
|
|
241
|
+
* @param {string} campaignID
|
|
242
|
+
* @param {object} campaign
|
|
243
|
+
* @return {Promise}
|
|
201
244
|
*/
|
|
202
245
|
service.saveCampaign = function(websiteID, campaignID, campaign) {
|
|
203
246
|
return crisp.put(
|
|
@@ -210,8 +253,12 @@ function WebsiteCampaign(service, crisp) {
|
|
|
210
253
|
/**
|
|
211
254
|
* Update A Campaign
|
|
212
255
|
* @memberof WebsiteCampaign
|
|
256
|
+
* @public
|
|
213
257
|
* @method updateCampaign
|
|
214
|
-
* @
|
|
258
|
+
* @param {string} websiteID
|
|
259
|
+
* @param {string} campaignID
|
|
260
|
+
* @param {object} campaign
|
|
261
|
+
* @return {Promise}
|
|
215
262
|
*/
|
|
216
263
|
service.updateCampaign = function(websiteID, campaignID, campaign) {
|
|
217
264
|
return crisp.patch(
|
|
@@ -224,8 +271,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
224
271
|
/**
|
|
225
272
|
* Remove A Campaign
|
|
226
273
|
* @memberof WebsiteCampaign
|
|
274
|
+
* @public
|
|
227
275
|
* @method removeCampaign
|
|
228
|
-
* @
|
|
276
|
+
* @param {string} websiteID
|
|
277
|
+
* @param {string} campaignID
|
|
278
|
+
* @return {Promise}
|
|
229
279
|
*/
|
|
230
280
|
service.removeCampaign = function(websiteID, campaignID) {
|
|
231
281
|
return crisp.delete(
|
|
@@ -236,8 +286,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
236
286
|
/**
|
|
237
287
|
* Dispatch A Campaign
|
|
238
288
|
* @memberof WebsiteCampaign
|
|
289
|
+
* @public
|
|
239
290
|
* @method dispatchCampaign
|
|
240
|
-
* @
|
|
291
|
+
* @param {string} websiteID
|
|
292
|
+
* @param {string} campaignID
|
|
293
|
+
* @return {Promise}
|
|
241
294
|
*/
|
|
242
295
|
service.dispatchCampaign = function(websiteID, campaignID) {
|
|
243
296
|
return crisp.post(
|
|
@@ -250,8 +303,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
250
303
|
/**
|
|
251
304
|
* Resume A Campaign
|
|
252
305
|
* @memberof WebsiteCampaign
|
|
306
|
+
* @public
|
|
253
307
|
* @method resumeCampaign
|
|
254
|
-
* @
|
|
308
|
+
* @param {string} websiteID
|
|
309
|
+
* @param {string} campaignID
|
|
310
|
+
* @return {Promise}
|
|
255
311
|
*/
|
|
256
312
|
service.resumeCampaign = function(websiteID, campaignID) {
|
|
257
313
|
return crisp.post(
|
|
@@ -264,8 +320,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
264
320
|
/**
|
|
265
321
|
* Pause A Campaign
|
|
266
322
|
* @memberof WebsiteCampaign
|
|
323
|
+
* @public
|
|
267
324
|
* @method pauseCampaign
|
|
268
|
-
* @
|
|
325
|
+
* @param {string} websiteID
|
|
326
|
+
* @param {string} campaignID
|
|
327
|
+
* @return {Promise}
|
|
269
328
|
*/
|
|
270
329
|
service.pauseCampaign = function(websiteID, campaignID) {
|
|
271
330
|
return crisp.post(
|
|
@@ -278,8 +337,11 @@ function WebsiteCampaign(service, crisp) {
|
|
|
278
337
|
/**
|
|
279
338
|
* Test A Campaign
|
|
280
339
|
* @memberof WebsiteCampaign
|
|
340
|
+
* @public
|
|
281
341
|
* @method testCampaign
|
|
282
|
-
* @
|
|
342
|
+
* @param {string} websiteID
|
|
343
|
+
* @param {string} campaignID
|
|
344
|
+
* @return {Promise}
|
|
283
345
|
*/
|
|
284
346
|
service.testCampaign = function(websiteID, campaignID) {
|
|
285
347
|
return crisp.post(
|
|
@@ -292,8 +354,12 @@ function WebsiteCampaign(service, crisp) {
|
|
|
292
354
|
/**
|
|
293
355
|
* List Campaign Recipients
|
|
294
356
|
* @memberof WebsiteCampaign
|
|
357
|
+
* @public
|
|
295
358
|
* @method listCampaignRecipients
|
|
296
|
-
* @
|
|
359
|
+
* @param {string} websiteID
|
|
360
|
+
* @param {string} campaignID
|
|
361
|
+
* @param {number} pageNumber
|
|
362
|
+
* @return {Promise}
|
|
297
363
|
*/
|
|
298
364
|
service.listCampaignRecipients = function(websiteID, campaignID, pageNumber) {
|
|
299
365
|
return crisp.get(
|
|
@@ -306,8 +372,13 @@ function WebsiteCampaign(service, crisp) {
|
|
|
306
372
|
/**
|
|
307
373
|
* List Campaign Statistics
|
|
308
374
|
* @memberof WebsiteCampaign
|
|
375
|
+
* @public
|
|
309
376
|
* @method listCampaignStatistics
|
|
310
|
-
* @
|
|
377
|
+
* @param {string} websiteID
|
|
378
|
+
* @param {string} campaignID
|
|
379
|
+
* @param {string} action
|
|
380
|
+
* @param {number} pageNumber
|
|
381
|
+
* @return {Promise}
|
|
311
382
|
*/
|
|
312
383
|
service.listCampaignStatistics = function(
|
|
313
384
|
websiteID, campaignID, action, pageNumber
|