crisp-api 9.13.0 → 10.0.3
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 +12 -0
- package/README.md +2 -2
- package/dist/crisp.d.ts +179 -0
- package/dist/crisp.js +773 -0
- package/dist/resources/BaseResource.d.ts +21 -0
- package/dist/resources/BaseResource.js +26 -0
- package/dist/resources/BucketURL.d.ts +37 -0
- package/dist/resources/BucketURL.js +35 -0
- package/dist/resources/MediaAnimation.d.ts +20 -0
- package/dist/resources/MediaAnimation.js +40 -0
- package/dist/resources/PluginConnect.d.ts +59 -0
- package/dist/resources/PluginConnect.js +79 -0
- package/dist/resources/PluginSubscription.d.ts +112 -0
- package/dist/resources/PluginSubscription.js +130 -0
- package/dist/resources/WebsiteAnalytics.d.ts +20 -0
- package/dist/resources/WebsiteAnalytics.js +37 -0
- package/dist/resources/WebsiteAvailability.d.ts +40 -0
- package/dist/resources/WebsiteAvailability.js +46 -0
- package/dist/resources/WebsiteBase.d.ts +69 -0
- package/dist/resources/WebsiteBase.js +77 -0
- package/dist/resources/WebsiteBatch.d.ts +61 -0
- package/dist/resources/WebsiteBatch.js +76 -0
- package/dist/resources/WebsiteCampaign.d.ts +208 -0
- package/dist/resources/WebsiteCampaign.js +201 -0
- package/dist/resources/WebsiteConversation.d.ts +710 -0
- package/dist/resources/WebsiteConversation.js +607 -0
- package/dist/resources/WebsiteHelpdesk.d.ts +356 -0
- package/dist/resources/WebsiteHelpdesk.js +593 -0
- package/dist/resources/WebsiteOperator.d.ts +88 -0
- package/dist/resources/WebsiteOperator.js +99 -0
- package/dist/resources/WebsitePeople.d.ts +257 -0
- package/dist/resources/WebsitePeople.js +282 -0
- package/dist/resources/WebsiteSettings.d.ts +168 -0
- package/dist/resources/WebsiteSettings.js +42 -0
- package/dist/resources/WebsiteVerify.d.ts +47 -0
- package/dist/resources/WebsiteVerify.js +56 -0
- package/dist/resources/WebsiteVisitors.d.ts +122 -0
- package/dist/resources/WebsiteVisitors.js +98 -0
- package/dist/resources/index.d.ts +20 -0
- package/dist/resources/index.js +42 -0
- package/dist/services/bucket.d.ts +19 -0
- package/dist/services/bucket.js +31 -0
- package/dist/services/media.d.ts +19 -0
- package/dist/services/media.js +31 -0
- package/dist/services/plugin.d.ts +20 -0
- package/dist/services/plugin.js +33 -0
- package/dist/services/website.d.ts +30 -0
- package/dist/services/website.js +53 -0
- package/eslint.config.mjs +208 -0
- package/lib/crisp.ts +1006 -0
- package/lib/resources/BaseResource.ts +37 -0
- package/lib/resources/BucketURL.ts +58 -0
- package/lib/resources/MediaAnimation.ts +44 -0
- package/lib/resources/PluginConnect.ts +135 -0
- package/lib/resources/PluginSubscription.ts +236 -0
- package/lib/resources/WebsiteAnalytics.ts +41 -0
- package/lib/resources/WebsiteAvailability.ts +74 -0
- package/lib/resources/WebsiteBase.ts +119 -0
- package/lib/resources/WebsiteBatch.ts +116 -0
- package/lib/resources/WebsiteCampaign.ts +432 -0
- package/lib/resources/WebsiteConversation.ts +1507 -0
- package/lib/resources/WebsiteHelpdesk.ts +1024 -0
- package/lib/resources/WebsiteOperator.ts +183 -0
- package/lib/resources/WebsitePeople.ts +568 -0
- package/lib/resources/WebsiteSettings.ts +207 -0
- package/lib/resources/WebsiteVerify.ts +90 -0
- package/lib/resources/WebsiteVisitors.ts +219 -0
- package/lib/resources/index.ts +28 -0
- package/lib/services/bucket.ts +36 -0
- package/lib/services/media.ts +36 -0
- package/lib/services/plugin.ts +40 -0
- package/lib/services/website.ts +70 -0
- package/package.json +16 -11
- package/tsconfig.json +12 -5
- package/lib/crisp.js +0 -1171
- package/lib/resources/BucketURL.js +0 -34
- package/lib/resources/MediaAnimation.js +0 -41
- package/lib/resources/PluginConnect.js +0 -119
- package/lib/resources/PluginSubscription.js +0 -234
- package/lib/resources/WebsiteAnalytics.js +0 -37
- package/lib/resources/WebsiteAvailability.js +0 -48
- package/lib/resources/WebsiteBase.js +0 -100
- package/lib/resources/WebsiteBatch.js +0 -92
- package/lib/resources/WebsiteCampaign.js +0 -396
- package/lib/resources/WebsiteConversation.js +0 -1261
- package/lib/resources/WebsiteHelpdesk.js +0 -1198
- package/lib/resources/WebsiteOperator.js +0 -167
- package/lib/resources/WebsitePeople.js +0 -516
- package/lib/resources/WebsiteSettings.js +0 -50
- package/lib/resources/WebsiteVerify.js +0 -79
- package/lib/resources/WebsiteVisitors.js +0 -148
- package/lib/services/Bucket.js +0 -28
- package/lib/services/Media.js +0 -28
- package/lib/services/Plugin.js +0 -29
- package/lib/services/Website.js +0 -39
- package/types/crisp.d.ts +0 -151
- package/types/resources/BucketURL.d.ts +0 -15
- package/types/resources/MediaAnimation.d.ts +0 -15
- package/types/resources/PluginConnect.d.ts +0 -15
- package/types/resources/PluginSubscription.d.ts +0 -15
- package/types/resources/WebsiteAnalytics.d.ts +0 -15
- package/types/resources/WebsiteAvailability.d.ts +0 -15
- package/types/resources/WebsiteBase.d.ts +0 -15
- package/types/resources/WebsiteBatch.d.ts +0 -15
- package/types/resources/WebsiteCampaign.d.ts +0 -15
- package/types/resources/WebsiteConversation.d.ts +0 -15
- package/types/resources/WebsiteHelpdesk.d.ts +0 -15
- package/types/resources/WebsiteOperator.d.ts +0 -15
- package/types/resources/WebsitePeople.d.ts +0 -15
- package/types/resources/WebsiteSettings.d.ts +0 -15
- package/types/resources/WebsiteVerify.d.ts +0 -15
- package/types/resources/WebsiteVisitors.d.ts +0 -15
- package/types/services/Bucket.d.ts +0 -14
- package/types/services/Media.d.ts +0 -14
- package/types/services/Plugin.d.ts +0 -14
- package/types/services/Website.d.ts +0 -14
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* node-crisp-api
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2022, Crisp IM SAS
|
|
6
|
+
* Author: Valerian Saliou <valerian@valeriansaliou.name>
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
/**************************************************************************
|
|
13
|
+
* IMPORTS
|
|
14
|
+
***************************************************************************/
|
|
15
|
+
// PROJECT: RESOURCES
|
|
16
|
+
const BaseResource_1 = __importDefault(require("./BaseResource"));
|
|
17
|
+
/**************************************************************************
|
|
18
|
+
* CLASSES
|
|
19
|
+
***************************************************************************/
|
|
20
|
+
/**
|
|
21
|
+
* Crisp WebsiteAvailability Resource
|
|
22
|
+
*/
|
|
23
|
+
class WebsiteAvailability extends BaseResource_1.default {
|
|
24
|
+
/**
|
|
25
|
+
* Get Website Availability Status
|
|
26
|
+
*/
|
|
27
|
+
getWebsiteAvailabilityStatus(websiteID) {
|
|
28
|
+
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
29
|
+
"website", websiteID, "availability", "status"
|
|
30
|
+
]));
|
|
31
|
+
}
|
|
32
|
+
;
|
|
33
|
+
/**
|
|
34
|
+
* List Website Operator Availabilities
|
|
35
|
+
*/
|
|
36
|
+
listWebsiteOperatorAvailabilities(websiteID) {
|
|
37
|
+
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
38
|
+
"website", websiteID, "availability", "operators"
|
|
39
|
+
]));
|
|
40
|
+
}
|
|
41
|
+
;
|
|
42
|
+
}
|
|
43
|
+
/**************************************************************************
|
|
44
|
+
* EXPORTS
|
|
45
|
+
***************************************************************************/
|
|
46
|
+
exports.default = WebsiteAvailability;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* IMPORTS
|
|
3
|
+
***************************************************************************/
|
|
4
|
+
import BaseResource from "./BaseResource";
|
|
5
|
+
/**************************************************************************
|
|
6
|
+
* TYPES
|
|
7
|
+
***************************************************************************/
|
|
8
|
+
type Website = {
|
|
9
|
+
website_id?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
domain?: string;
|
|
12
|
+
logo?: string;
|
|
13
|
+
};
|
|
14
|
+
type WebsiteCreate = {
|
|
15
|
+
name?: string;
|
|
16
|
+
domain?: string;
|
|
17
|
+
};
|
|
18
|
+
type WebsiteRemoveVerify = {
|
|
19
|
+
method?: string;
|
|
20
|
+
secret?: string;
|
|
21
|
+
};
|
|
22
|
+
export type WebsiteFilter = {
|
|
23
|
+
model?: string;
|
|
24
|
+
criterion?: string;
|
|
25
|
+
operator?: string;
|
|
26
|
+
query?: Record<string, unknown>;
|
|
27
|
+
};
|
|
28
|
+
/**************************************************************************
|
|
29
|
+
* CLASSES
|
|
30
|
+
***************************************************************************/
|
|
31
|
+
/**
|
|
32
|
+
* Crisp WebsiteBase Resource
|
|
33
|
+
*/
|
|
34
|
+
declare class WebsiteBase extends BaseResource {
|
|
35
|
+
/**
|
|
36
|
+
* Check If Website Exists
|
|
37
|
+
* @memberof WebsiteBase
|
|
38
|
+
* @public
|
|
39
|
+
* @method checkWebsiteExists
|
|
40
|
+
* @param {string} domain
|
|
41
|
+
* @return {Promise}
|
|
42
|
+
*/
|
|
43
|
+
checkWebsiteExists(domain: string): Promise<any>;
|
|
44
|
+
/**
|
|
45
|
+
* Create Website
|
|
46
|
+
*/
|
|
47
|
+
createWebsite(websiteData: WebsiteCreate): Promise<Website>;
|
|
48
|
+
/**
|
|
49
|
+
* Get A Website
|
|
50
|
+
* @memberof WebsiteBase
|
|
51
|
+
* @public
|
|
52
|
+
* @method getWebsite
|
|
53
|
+
* @param {string} websiteID
|
|
54
|
+
* @return {Promise}
|
|
55
|
+
*/
|
|
56
|
+
getWebsite(websiteID: string): Promise<Website>;
|
|
57
|
+
/**
|
|
58
|
+
* Delete A Website
|
|
59
|
+
*/
|
|
60
|
+
deleteWebsite(websiteID: string, verify: WebsiteRemoveVerify): Promise<any>;
|
|
61
|
+
/**
|
|
62
|
+
* Abort Website Deletion
|
|
63
|
+
*/
|
|
64
|
+
abortWebsiteDeletion(websiteID: string): Promise<any>;
|
|
65
|
+
}
|
|
66
|
+
/**************************************************************************
|
|
67
|
+
* EXPORTS
|
|
68
|
+
***************************************************************************/
|
|
69
|
+
export default WebsiteBase;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* node-crisp-api
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2022, Crisp IM SAS
|
|
6
|
+
* Author: Baptiste Jamin <baptiste@crisp.chat>
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
/**************************************************************************
|
|
13
|
+
* IMPORTS
|
|
14
|
+
***************************************************************************/
|
|
15
|
+
// PROJECT: RESOURCES
|
|
16
|
+
const BaseResource_1 = __importDefault(require("./BaseResource"));
|
|
17
|
+
/**************************************************************************
|
|
18
|
+
* CLASSES
|
|
19
|
+
***************************************************************************/
|
|
20
|
+
/**
|
|
21
|
+
* Crisp WebsiteBase Resource
|
|
22
|
+
*/
|
|
23
|
+
class WebsiteBase extends BaseResource_1.default {
|
|
24
|
+
/**
|
|
25
|
+
* Check If Website Exists
|
|
26
|
+
* @memberof WebsiteBase
|
|
27
|
+
* @public
|
|
28
|
+
* @method checkWebsiteExists
|
|
29
|
+
* @param {string} domain
|
|
30
|
+
* @return {Promise}
|
|
31
|
+
*/
|
|
32
|
+
checkWebsiteExists(domain) {
|
|
33
|
+
return this.crisp.head(this.crisp.prepareRestUrl(["website"]), {
|
|
34
|
+
domain: domain
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
;
|
|
38
|
+
/**
|
|
39
|
+
* Create Website
|
|
40
|
+
*/
|
|
41
|
+
createWebsite(websiteData) {
|
|
42
|
+
return this.crisp.post(this.crisp.prepareRestUrl(["website"]), null, websiteData);
|
|
43
|
+
}
|
|
44
|
+
;
|
|
45
|
+
/**
|
|
46
|
+
* Get A Website
|
|
47
|
+
* @memberof WebsiteBase
|
|
48
|
+
* @public
|
|
49
|
+
* @method getWebsite
|
|
50
|
+
* @param {string} websiteID
|
|
51
|
+
* @return {Promise}
|
|
52
|
+
*/
|
|
53
|
+
getWebsite(websiteID) {
|
|
54
|
+
return this.crisp.get(this.crisp.prepareRestUrl(["website", websiteID]));
|
|
55
|
+
}
|
|
56
|
+
;
|
|
57
|
+
/**
|
|
58
|
+
* Delete A Website
|
|
59
|
+
*/
|
|
60
|
+
deleteWebsite(websiteID, verify) {
|
|
61
|
+
return this.crisp.delete(this.crisp.prepareRestUrl(["website", websiteID]), undefined, {
|
|
62
|
+
verify: verify
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
;
|
|
66
|
+
/**
|
|
67
|
+
* Abort Website Deletion
|
|
68
|
+
*/
|
|
69
|
+
abortWebsiteDeletion(websiteID) {
|
|
70
|
+
return this.crisp.delete(this.crisp.prepareRestUrl(["website", websiteID, "expunge"]));
|
|
71
|
+
}
|
|
72
|
+
;
|
|
73
|
+
}
|
|
74
|
+
/**************************************************************************
|
|
75
|
+
* EXPORTS
|
|
76
|
+
***************************************************************************/
|
|
77
|
+
exports.default = WebsiteBase;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* IMPORTS
|
|
3
|
+
***************************************************************************/
|
|
4
|
+
import BaseResource from "./BaseResource";
|
|
5
|
+
/**************************************************************************
|
|
6
|
+
* TYPES
|
|
7
|
+
***************************************************************************/
|
|
8
|
+
type WebsiteBatchConversationsOperation = {
|
|
9
|
+
inbox_id?: string;
|
|
10
|
+
sessions?: string[];
|
|
11
|
+
};
|
|
12
|
+
type WebsiteBatchPeopleOperationInner = {
|
|
13
|
+
profiles?: string[];
|
|
14
|
+
search?: string;
|
|
15
|
+
};
|
|
16
|
+
/**************************************************************************
|
|
17
|
+
* CLASSES
|
|
18
|
+
***************************************************************************/
|
|
19
|
+
/**
|
|
20
|
+
* Crisp WebsiteBatch Resource
|
|
21
|
+
*/
|
|
22
|
+
declare class WebsiteBatch extends BaseResource {
|
|
23
|
+
/**
|
|
24
|
+
* Batch Resolve Conversations
|
|
25
|
+
*/
|
|
26
|
+
batchResolveConversations(websiteID: string, operation: WebsiteBatchConversationsOperation): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Batch Read Conversations
|
|
29
|
+
* @memberof WebsiteBatch
|
|
30
|
+
* @public
|
|
31
|
+
* @method batchReadConversations
|
|
32
|
+
* @param {string} websiteID
|
|
33
|
+
* @param {object} operation
|
|
34
|
+
* @return {Promise}
|
|
35
|
+
*/
|
|
36
|
+
batchReadConversations(websiteID: string, operation: WebsiteBatchConversationsOperation): Promise<any>;
|
|
37
|
+
/**
|
|
38
|
+
* Batch Remove Conversations
|
|
39
|
+
* @memberof WebsiteBatch
|
|
40
|
+
* @public
|
|
41
|
+
* @method batchRemoveConversations
|
|
42
|
+
* @param {string} websiteID
|
|
43
|
+
* @param {object} operation
|
|
44
|
+
* @return {Promise}
|
|
45
|
+
*/
|
|
46
|
+
batchRemoveConversations(websiteID: string, operation: WebsiteBatchConversationsOperation): Promise<any>;
|
|
47
|
+
/**
|
|
48
|
+
* Batch Remove People
|
|
49
|
+
* @memberof WebsiteBatch
|
|
50
|
+
* @public
|
|
51
|
+
* @method batchRemovePeople
|
|
52
|
+
* @param {string} websiteID
|
|
53
|
+
* @param {object} people
|
|
54
|
+
* @return {Promise}
|
|
55
|
+
*/
|
|
56
|
+
batchRemovePeople(websiteID: string, people: WebsiteBatchPeopleOperationInner): Promise<any>;
|
|
57
|
+
}
|
|
58
|
+
/**************************************************************************
|
|
59
|
+
* EXPORTS
|
|
60
|
+
***************************************************************************/
|
|
61
|
+
export default WebsiteBatch;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* node-crisp-api
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2022, Crisp IM SAS
|
|
6
|
+
* Author: Valerian Saliou <valerian@valeriansaliou.name>
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
/**************************************************************************
|
|
13
|
+
* IMPORTS
|
|
14
|
+
***************************************************************************/
|
|
15
|
+
// PROJECT: RESOURCES
|
|
16
|
+
const BaseResource_1 = __importDefault(require("./BaseResource"));
|
|
17
|
+
/**************************************************************************
|
|
18
|
+
* CLASSES
|
|
19
|
+
***************************************************************************/
|
|
20
|
+
/**
|
|
21
|
+
* Crisp WebsiteBatch Resource
|
|
22
|
+
*/
|
|
23
|
+
class WebsiteBatch extends BaseResource_1.default {
|
|
24
|
+
/**
|
|
25
|
+
* Batch Resolve Conversations
|
|
26
|
+
*/
|
|
27
|
+
batchResolveConversations(websiteID, operation) {
|
|
28
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "resolve"]), null, operation);
|
|
29
|
+
}
|
|
30
|
+
;
|
|
31
|
+
/**
|
|
32
|
+
* Batch Read Conversations
|
|
33
|
+
* @memberof WebsiteBatch
|
|
34
|
+
* @public
|
|
35
|
+
* @method batchReadConversations
|
|
36
|
+
* @param {string} websiteID
|
|
37
|
+
* @param {object} operation
|
|
38
|
+
* @return {Promise}
|
|
39
|
+
*/
|
|
40
|
+
batchReadConversations(websiteID, operation) {
|
|
41
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "read"]), null, operation);
|
|
42
|
+
}
|
|
43
|
+
;
|
|
44
|
+
/**
|
|
45
|
+
* Batch Remove Conversations
|
|
46
|
+
* @memberof WebsiteBatch
|
|
47
|
+
* @public
|
|
48
|
+
* @method batchRemoveConversations
|
|
49
|
+
* @param {string} websiteID
|
|
50
|
+
* @param {object} operation
|
|
51
|
+
* @return {Promise}
|
|
52
|
+
*/
|
|
53
|
+
batchRemoveConversations(websiteID, operation) {
|
|
54
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "remove"]), null, operation);
|
|
55
|
+
}
|
|
56
|
+
;
|
|
57
|
+
/**
|
|
58
|
+
* Batch Remove People
|
|
59
|
+
* @memberof WebsiteBatch
|
|
60
|
+
* @public
|
|
61
|
+
* @method batchRemovePeople
|
|
62
|
+
* @param {string} websiteID
|
|
63
|
+
* @param {object} people
|
|
64
|
+
* @return {Promise}
|
|
65
|
+
*/
|
|
66
|
+
batchRemovePeople(websiteID, people) {
|
|
67
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "remove"]), null, {
|
|
68
|
+
people: people
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
;
|
|
72
|
+
}
|
|
73
|
+
/**************************************************************************
|
|
74
|
+
* EXPORTS
|
|
75
|
+
***************************************************************************/
|
|
76
|
+
exports.default = WebsiteBatch;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* IMPORTS
|
|
3
|
+
***************************************************************************/
|
|
4
|
+
import BaseResource from "./BaseResource";
|
|
5
|
+
import { WebsiteFilter } from "./WebsiteBase";
|
|
6
|
+
/**************************************************************************
|
|
7
|
+
* TYPES
|
|
8
|
+
***************************************************************************/
|
|
9
|
+
type WebsiteCampaignExcerpt = {
|
|
10
|
+
campaign_id?: string;
|
|
11
|
+
type?: string;
|
|
12
|
+
format?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
subject?: string;
|
|
15
|
+
tag?: string;
|
|
16
|
+
ready?: boolean;
|
|
17
|
+
dispatched?: boolean;
|
|
18
|
+
running?: boolean;
|
|
19
|
+
progress?: number;
|
|
20
|
+
targets?: number;
|
|
21
|
+
reached?: number;
|
|
22
|
+
created_at: number;
|
|
23
|
+
updated_at: number;
|
|
24
|
+
dispatched_at?: number;
|
|
25
|
+
};
|
|
26
|
+
type WebsiteCampaignTemplateExcerpt = {
|
|
27
|
+
template_id?: string;
|
|
28
|
+
type?: string;
|
|
29
|
+
name?: string;
|
|
30
|
+
format?: string;
|
|
31
|
+
created_at?: number;
|
|
32
|
+
updated_at?: number;
|
|
33
|
+
};
|
|
34
|
+
type WebsiteCampaignTemplateNew = {
|
|
35
|
+
template_id?: string;
|
|
36
|
+
};
|
|
37
|
+
interface WebsiteCampaignTemplateItem extends WebsiteCampaignTemplateExcerpt {
|
|
38
|
+
content?: string;
|
|
39
|
+
}
|
|
40
|
+
interface WebsiteCampaignItem extends WebsiteCampaignExcerpt {
|
|
41
|
+
sender?: WebsiteCampaignItemSender;
|
|
42
|
+
recipients?: WebsiteCampaignItemRecipients;
|
|
43
|
+
flow?: WebsiteCampaignItemFlow;
|
|
44
|
+
message?: string;
|
|
45
|
+
options?: WebsiteCampaignItemOptions;
|
|
46
|
+
statistics?: WebsiteCampaignItemStatistics;
|
|
47
|
+
}
|
|
48
|
+
type WebsiteCampaignItemSender = {
|
|
49
|
+
user_id?: string;
|
|
50
|
+
};
|
|
51
|
+
type WebsiteCampaignItemRecipients = {
|
|
52
|
+
type?: string;
|
|
53
|
+
segments?: string[];
|
|
54
|
+
people?: string[];
|
|
55
|
+
filter?: WebsiteFilter[];
|
|
56
|
+
};
|
|
57
|
+
type WebsiteCampaignItemFlow = {
|
|
58
|
+
launch_event?: string;
|
|
59
|
+
assert_filter?: WebsiteFilter[];
|
|
60
|
+
assert_delay?: number;
|
|
61
|
+
deliver_once?: boolean;
|
|
62
|
+
deliver_delay?: number;
|
|
63
|
+
};
|
|
64
|
+
type WebsiteCampaignItemOptions = {
|
|
65
|
+
deliver_to_chatbox?: boolean;
|
|
66
|
+
deliver_to_email?: boolean;
|
|
67
|
+
sender_name_website?: boolean;
|
|
68
|
+
sender_email_reply?: boolean;
|
|
69
|
+
tracking?: boolean;
|
|
70
|
+
};
|
|
71
|
+
type WebsiteCampaignItemStatistics = {
|
|
72
|
+
opened?: number;
|
|
73
|
+
clicked?: number;
|
|
74
|
+
unsubscribed?: number;
|
|
75
|
+
};
|
|
76
|
+
type WebsiteCampaignRecipient = {
|
|
77
|
+
people_id?: string;
|
|
78
|
+
email?: string;
|
|
79
|
+
person?: WebsiteCampaignRecipientPerson;
|
|
80
|
+
subscribed?: boolean;
|
|
81
|
+
};
|
|
82
|
+
type WebsiteCampaignRecipientPerson = {
|
|
83
|
+
nickname?: string;
|
|
84
|
+
avatar?: string;
|
|
85
|
+
};
|
|
86
|
+
type WebsiteCampaignStatistic = {
|
|
87
|
+
profile?: WebsiteCampaignStatisticProfile;
|
|
88
|
+
data?: Record<string, unknown>;
|
|
89
|
+
created_at?: number;
|
|
90
|
+
updated_at?: number;
|
|
91
|
+
};
|
|
92
|
+
type WebsiteCampaignStatisticProfile = {
|
|
93
|
+
people_id?: string;
|
|
94
|
+
email?: string;
|
|
95
|
+
person?: WebsiteCampaignStatisticProfilePerson;
|
|
96
|
+
};
|
|
97
|
+
type WebsiteCampaignStatisticProfilePerson = {
|
|
98
|
+
nickname?: string;
|
|
99
|
+
avatar?: string;
|
|
100
|
+
geolocation?: WebsiteCampaignStatisticProfilePersonGeolocation;
|
|
101
|
+
};
|
|
102
|
+
type WebsiteCampaignStatisticProfilePersonGeolocation = {
|
|
103
|
+
country?: string;
|
|
104
|
+
region?: string;
|
|
105
|
+
city?: string;
|
|
106
|
+
coordinates?: WebsiteCampaignStatisticProfilePersonGeolocationCoordinates;
|
|
107
|
+
};
|
|
108
|
+
type WebsiteCampaignStatisticProfilePersonGeolocationCoordinates = {
|
|
109
|
+
latitude?: number;
|
|
110
|
+
longitude?: number;
|
|
111
|
+
};
|
|
112
|
+
/**************************************************************************
|
|
113
|
+
* CLASSES
|
|
114
|
+
***************************************************************************/
|
|
115
|
+
/**
|
|
116
|
+
* Crisp WebsiteCampaign Resource
|
|
117
|
+
*/
|
|
118
|
+
declare class WebsiteCampaign extends BaseResource {
|
|
119
|
+
/**
|
|
120
|
+
* List Campaigns
|
|
121
|
+
*/
|
|
122
|
+
listCampaigns(websiteID: string, pageNumber?: number): Promise<WebsiteCampaignExcerpt[]>;
|
|
123
|
+
/**
|
|
124
|
+
* List Campaign Tags
|
|
125
|
+
*/
|
|
126
|
+
listCampaignTags(websiteID: string): Promise<string[]>;
|
|
127
|
+
/**
|
|
128
|
+
* List Campaign Templates
|
|
129
|
+
*/
|
|
130
|
+
listCampaignTemplates(websiteID: string, pageNumber?: number): Promise<WebsiteCampaignTemplateExcerpt[]>;
|
|
131
|
+
/**
|
|
132
|
+
* Create A New Campaign Template
|
|
133
|
+
*/
|
|
134
|
+
createNewCampaignTemplate(websiteID: string, templateFormat: string, templateName: string): Promise<WebsiteCampaignTemplateNew>;
|
|
135
|
+
/**
|
|
136
|
+
* Check If Campaign Template Exists
|
|
137
|
+
*/
|
|
138
|
+
checkCampaignTemplateExists(websiteID: string, templateID: string): Promise<any>;
|
|
139
|
+
/**
|
|
140
|
+
* Get A Campaign Template
|
|
141
|
+
*/
|
|
142
|
+
getCampaignTemplate(websiteID: string, templateID: string): Promise<WebsiteCampaignTemplateItem>;
|
|
143
|
+
/**
|
|
144
|
+
* Save A Campaign Template
|
|
145
|
+
*/
|
|
146
|
+
saveCampaignTemplate(websiteID: string, templateID: string, template: WebsiteCampaignTemplateItem): Promise<any>;
|
|
147
|
+
/**
|
|
148
|
+
* Update A Campaign Template
|
|
149
|
+
*/
|
|
150
|
+
updateCampaignTemplate(websiteID: string, templateID: string, template: WebsiteCampaignTemplateItem): Promise<any>;
|
|
151
|
+
/**
|
|
152
|
+
* Remove A Campaign Template
|
|
153
|
+
*/
|
|
154
|
+
removeCampaignTemplate(websiteID: string, templateID: string): Promise<any>;
|
|
155
|
+
/**
|
|
156
|
+
* Create A New Campaign
|
|
157
|
+
*/
|
|
158
|
+
createNewCampaign(websiteID: string, campaignType: string, campaignName: string): Promise<any>;
|
|
159
|
+
/**
|
|
160
|
+
* Check If Campaign Exists
|
|
161
|
+
*/
|
|
162
|
+
checkCampaignExists(websiteID: string, campaignID: string): Promise<any>;
|
|
163
|
+
/**
|
|
164
|
+
* Get A Campaign
|
|
165
|
+
*/
|
|
166
|
+
getCampaign(websiteID: string, campaignID: string): Promise<WebsiteCampaignItem>;
|
|
167
|
+
/**
|
|
168
|
+
* Save A Campaign
|
|
169
|
+
*/
|
|
170
|
+
saveCampaign(websiteID: string, campaignID: string, campaign: WebsiteCampaignItem): Promise<any>;
|
|
171
|
+
/**
|
|
172
|
+
* Update A Campaign
|
|
173
|
+
*/
|
|
174
|
+
updateCampaign(websiteID: string, campaignID: string, campaign: WebsiteCampaignItem): Promise<any>;
|
|
175
|
+
/**
|
|
176
|
+
* Remove A Campaign
|
|
177
|
+
*/
|
|
178
|
+
removeCampaign(websiteID: string, campaignID: string): Promise<any>;
|
|
179
|
+
/**
|
|
180
|
+
* Dispatch A Campaign
|
|
181
|
+
* @return {Promise}
|
|
182
|
+
*/
|
|
183
|
+
dispatchCampaign(websiteID: string, campaignID: string): Promise<any>;
|
|
184
|
+
/**
|
|
185
|
+
* Resume A Campaign
|
|
186
|
+
*/
|
|
187
|
+
resumeCampaign(websiteID: string, campaignID: string): Promise<any>;
|
|
188
|
+
/**
|
|
189
|
+
* Pause A Campaign
|
|
190
|
+
*/
|
|
191
|
+
pauseCampaign(websiteID: string, campaignID: string): Promise<any>;
|
|
192
|
+
/**
|
|
193
|
+
* Test A Campaign
|
|
194
|
+
*/
|
|
195
|
+
testCampaign(websiteID: string, campaignID: string): Promise<any>;
|
|
196
|
+
/**
|
|
197
|
+
* List Campaign Recipients
|
|
198
|
+
*/
|
|
199
|
+
listCampaignRecipients(websiteID: string, campaignID: string, pageNumber?: number): Promise<WebsiteCampaignRecipient[]>;
|
|
200
|
+
/**
|
|
201
|
+
* List Campaign Statistics
|
|
202
|
+
*/
|
|
203
|
+
listCampaignStatistics(websiteID: string, campaignID: string, action: string, pageNumber?: number): Promise<WebsiteCampaignStatistic[]>;
|
|
204
|
+
}
|
|
205
|
+
/**************************************************************************
|
|
206
|
+
* EXPORTS
|
|
207
|
+
***************************************************************************/
|
|
208
|
+
export default WebsiteCampaign;
|