crisp-api 10.0.8 → 10.0.10
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 +14 -2
- package/dist/crisp.d.ts +1 -1
- package/dist/crisp.js +1 -1
- package/dist/resources/WebsiteAvailability.d.ts +3 -3
- package/dist/resources/WebsiteBase.d.ts +3 -3
- package/dist/resources/WebsiteBatch.d.ts +2 -2
- package/dist/resources/WebsiteCampaign.d.ts +17 -17
- package/lib/crisp.ts +1 -1
- package/lib/resources/WebsiteAvailability.ts +3 -3
- package/lib/resources/WebsiteBase.ts +3 -3
- package/lib/resources/WebsiteBatch.ts +2 -2
- package/lib/resources/WebsiteCampaign.ts +17 -17
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## v10.0.10
|
|
5
|
+
|
|
6
|
+
### Changes
|
|
7
|
+
|
|
8
|
+
* Allow any as return type to the Websocket .on() callback.
|
|
9
|
+
|
|
10
|
+
## v10.0.9
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
* Export missing types.
|
|
15
|
+
|
|
4
16
|
## v10.0.8
|
|
5
17
|
|
|
6
18
|
### Changes
|
|
7
19
|
|
|
8
|
-
* `nickname` is now optional on ConversationMeta
|
|
20
|
+
* `nickname` is now optional on ConversationMeta.
|
|
9
21
|
|
|
10
22
|
## v10.0.7
|
|
11
23
|
|
|
12
24
|
### Changes
|
|
13
25
|
|
|
14
|
-
* Support types for `address`, `subject` and `origin` on ConversationMeta
|
|
26
|
+
* Support types for `address`, `subject` and `origin` on ConversationMeta.
|
|
15
27
|
|
|
16
28
|
## v10.0.6
|
|
17
29
|
|
package/dist/crisp.d.ts
CHANGED
|
@@ -108,7 +108,7 @@ export declare class Crisp {
|
|
|
108
108
|
/**
|
|
109
109
|
* Binds RTM event
|
|
110
110
|
*/
|
|
111
|
-
on(event: string, callback: (data: any) =>
|
|
111
|
+
on(event: string, callback: (data: any) => any): Promise<unknown>;
|
|
112
112
|
/**
|
|
113
113
|
* Receives a raw event and dispatches it to the listener (used for Web Hooks)
|
|
114
114
|
*/
|
package/dist/crisp.js
CHANGED
|
@@ -5,16 +5,16 @@ import BaseResource from "./BaseResource";
|
|
|
5
5
|
/**************************************************************************
|
|
6
6
|
* TYPES
|
|
7
7
|
***************************************************************************/
|
|
8
|
-
type WebsiteAvailabilityStatus = {
|
|
8
|
+
export type WebsiteAvailabilityStatus = {
|
|
9
9
|
status?: string;
|
|
10
10
|
since?: number;
|
|
11
11
|
};
|
|
12
|
-
type WebsiteAvailabilityOperator = {
|
|
12
|
+
export type WebsiteAvailabilityOperator = {
|
|
13
13
|
user_id?: string;
|
|
14
14
|
type?: string;
|
|
15
15
|
time?: WebsiteAvailabilityOperatorTime;
|
|
16
16
|
};
|
|
17
|
-
type WebsiteAvailabilityOperatorTime = {
|
|
17
|
+
export type WebsiteAvailabilityOperatorTime = {
|
|
18
18
|
for?: number;
|
|
19
19
|
since?: number;
|
|
20
20
|
};
|
|
@@ -5,17 +5,17 @@ import BaseResource from "./BaseResource";
|
|
|
5
5
|
/**************************************************************************
|
|
6
6
|
* TYPES
|
|
7
7
|
***************************************************************************/
|
|
8
|
-
type Website = {
|
|
8
|
+
export type Website = {
|
|
9
9
|
website_id?: string;
|
|
10
10
|
name?: string;
|
|
11
11
|
domain?: string;
|
|
12
12
|
logo?: string;
|
|
13
13
|
};
|
|
14
|
-
type WebsiteCreate = {
|
|
14
|
+
export type WebsiteCreate = {
|
|
15
15
|
name?: string;
|
|
16
16
|
domain?: string;
|
|
17
17
|
};
|
|
18
|
-
type WebsiteRemoveVerify = {
|
|
18
|
+
export type WebsiteRemoveVerify = {
|
|
19
19
|
method?: string;
|
|
20
20
|
secret?: string;
|
|
21
21
|
};
|
|
@@ -5,11 +5,11 @@ import BaseResource from "./BaseResource";
|
|
|
5
5
|
/**************************************************************************
|
|
6
6
|
* TYPES
|
|
7
7
|
***************************************************************************/
|
|
8
|
-
type WebsiteBatchConversationsOperation = {
|
|
8
|
+
export type WebsiteBatchConversationsOperation = {
|
|
9
9
|
inbox_id?: string;
|
|
10
10
|
sessions?: string[];
|
|
11
11
|
};
|
|
12
|
-
type WebsiteBatchPeopleOperationInner = {
|
|
12
|
+
export type WebsiteBatchPeopleOperationInner = {
|
|
13
13
|
profiles?: string[];
|
|
14
14
|
search?: string;
|
|
15
15
|
};
|
|
@@ -6,7 +6,7 @@ import { WebsiteFilter } from "./WebsiteBase";
|
|
|
6
6
|
/**************************************************************************
|
|
7
7
|
* TYPES
|
|
8
8
|
***************************************************************************/
|
|
9
|
-
type WebsiteCampaignExcerpt = {
|
|
9
|
+
export type WebsiteCampaignExcerpt = {
|
|
10
10
|
campaign_id?: string;
|
|
11
11
|
type?: string;
|
|
12
12
|
format?: string;
|
|
@@ -23,7 +23,7 @@ type WebsiteCampaignExcerpt = {
|
|
|
23
23
|
updated_at: number;
|
|
24
24
|
dispatched_at?: number;
|
|
25
25
|
};
|
|
26
|
-
type WebsiteCampaignTemplateExcerpt = {
|
|
26
|
+
export type WebsiteCampaignTemplateExcerpt = {
|
|
27
27
|
template_id?: string;
|
|
28
28
|
type?: string;
|
|
29
29
|
name?: string;
|
|
@@ -31,13 +31,13 @@ type WebsiteCampaignTemplateExcerpt = {
|
|
|
31
31
|
created_at?: number;
|
|
32
32
|
updated_at?: number;
|
|
33
33
|
};
|
|
34
|
-
type WebsiteCampaignTemplateNew = {
|
|
34
|
+
export type WebsiteCampaignTemplateNew = {
|
|
35
35
|
template_id?: string;
|
|
36
36
|
};
|
|
37
|
-
interface WebsiteCampaignTemplateItem extends WebsiteCampaignTemplateExcerpt {
|
|
37
|
+
export interface WebsiteCampaignTemplateItem extends WebsiteCampaignTemplateExcerpt {
|
|
38
38
|
content?: string;
|
|
39
39
|
}
|
|
40
|
-
interface WebsiteCampaignItem extends WebsiteCampaignExcerpt {
|
|
40
|
+
export interface WebsiteCampaignItem extends WebsiteCampaignExcerpt {
|
|
41
41
|
sender?: WebsiteCampaignItemSender;
|
|
42
42
|
recipients?: WebsiteCampaignItemRecipients;
|
|
43
43
|
flow?: WebsiteCampaignItemFlow;
|
|
@@ -45,67 +45,67 @@ interface WebsiteCampaignItem extends WebsiteCampaignExcerpt {
|
|
|
45
45
|
options?: WebsiteCampaignItemOptions;
|
|
46
46
|
statistics?: WebsiteCampaignItemStatistics;
|
|
47
47
|
}
|
|
48
|
-
type WebsiteCampaignItemSender = {
|
|
48
|
+
export type WebsiteCampaignItemSender = {
|
|
49
49
|
user_id?: string;
|
|
50
50
|
};
|
|
51
|
-
type WebsiteCampaignItemRecipients = {
|
|
51
|
+
export type WebsiteCampaignItemRecipients = {
|
|
52
52
|
type?: string;
|
|
53
53
|
segments?: string[];
|
|
54
54
|
people?: string[];
|
|
55
55
|
filter?: WebsiteFilter[];
|
|
56
56
|
};
|
|
57
|
-
type WebsiteCampaignItemFlow = {
|
|
57
|
+
export type WebsiteCampaignItemFlow = {
|
|
58
58
|
launch_event?: string;
|
|
59
59
|
assert_filter?: WebsiteFilter[];
|
|
60
60
|
assert_delay?: number;
|
|
61
61
|
deliver_once?: boolean;
|
|
62
62
|
deliver_delay?: number;
|
|
63
63
|
};
|
|
64
|
-
type WebsiteCampaignItemOptions = {
|
|
64
|
+
export type WebsiteCampaignItemOptions = {
|
|
65
65
|
deliver_to_chatbox?: boolean;
|
|
66
66
|
deliver_to_email?: boolean;
|
|
67
67
|
sender_name_website?: boolean;
|
|
68
68
|
sender_email_reply?: boolean;
|
|
69
69
|
tracking?: boolean;
|
|
70
70
|
};
|
|
71
|
-
type WebsiteCampaignItemStatistics = {
|
|
71
|
+
export type WebsiteCampaignItemStatistics = {
|
|
72
72
|
opened?: number;
|
|
73
73
|
clicked?: number;
|
|
74
74
|
unsubscribed?: number;
|
|
75
75
|
};
|
|
76
|
-
type WebsiteCampaignRecipient = {
|
|
76
|
+
export type WebsiteCampaignRecipient = {
|
|
77
77
|
people_id?: string;
|
|
78
78
|
email?: string;
|
|
79
79
|
person?: WebsiteCampaignRecipientPerson;
|
|
80
80
|
subscribed?: boolean;
|
|
81
81
|
};
|
|
82
|
-
type WebsiteCampaignRecipientPerson = {
|
|
82
|
+
export type WebsiteCampaignRecipientPerson = {
|
|
83
83
|
nickname?: string;
|
|
84
84
|
avatar?: string;
|
|
85
85
|
};
|
|
86
|
-
type WebsiteCampaignStatistic = {
|
|
86
|
+
export type WebsiteCampaignStatistic = {
|
|
87
87
|
profile?: WebsiteCampaignStatisticProfile;
|
|
88
88
|
data?: Record<string, unknown>;
|
|
89
89
|
created_at?: number;
|
|
90
90
|
updated_at?: number;
|
|
91
91
|
};
|
|
92
|
-
type WebsiteCampaignStatisticProfile = {
|
|
92
|
+
export type WebsiteCampaignStatisticProfile = {
|
|
93
93
|
people_id?: string;
|
|
94
94
|
email?: string;
|
|
95
95
|
person?: WebsiteCampaignStatisticProfilePerson;
|
|
96
96
|
};
|
|
97
|
-
type WebsiteCampaignStatisticProfilePerson = {
|
|
97
|
+
export type WebsiteCampaignStatisticProfilePerson = {
|
|
98
98
|
nickname?: string;
|
|
99
99
|
avatar?: string;
|
|
100
100
|
geolocation?: WebsiteCampaignStatisticProfilePersonGeolocation;
|
|
101
101
|
};
|
|
102
|
-
type WebsiteCampaignStatisticProfilePersonGeolocation = {
|
|
102
|
+
export type WebsiteCampaignStatisticProfilePersonGeolocation = {
|
|
103
103
|
country?: string;
|
|
104
104
|
region?: string;
|
|
105
105
|
city?: string;
|
|
106
106
|
coordinates?: WebsiteCampaignStatisticProfilePersonGeolocationCoordinates;
|
|
107
107
|
};
|
|
108
|
-
type WebsiteCampaignStatisticProfilePersonGeolocationCoordinates = {
|
|
108
|
+
export type WebsiteCampaignStatisticProfilePersonGeolocationCoordinates = {
|
|
109
109
|
latitude?: number;
|
|
110
110
|
longitude?: number;
|
|
111
111
|
};
|
package/lib/crisp.ts
CHANGED
|
@@ -406,7 +406,7 @@ export class Crisp {
|
|
|
406
406
|
* Binds RTM event
|
|
407
407
|
*/
|
|
408
408
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, no-unused-vars
|
|
409
|
-
on(event: string, callback: (data: any) =>
|
|
409
|
+
on(event: string, callback: (data: any) => any) {
|
|
410
410
|
// Ensure all input arguments are set
|
|
411
411
|
if (typeof event !== "string") {
|
|
412
412
|
throw new Error("[Crisp] on: parameter event should be a string");
|
|
@@ -16,18 +16,18 @@ import BaseResource from "./BaseResource";
|
|
|
16
16
|
* TYPES
|
|
17
17
|
***************************************************************************/
|
|
18
18
|
|
|
19
|
-
type WebsiteAvailabilityStatus = {
|
|
19
|
+
export type WebsiteAvailabilityStatus = {
|
|
20
20
|
status?: string;
|
|
21
21
|
since?: number;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
type WebsiteAvailabilityOperator = {
|
|
24
|
+
export type WebsiteAvailabilityOperator = {
|
|
25
25
|
user_id?: string;
|
|
26
26
|
type?: string;
|
|
27
27
|
time?: WebsiteAvailabilityOperatorTime;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
type WebsiteAvailabilityOperatorTime = {
|
|
30
|
+
export type WebsiteAvailabilityOperatorTime = {
|
|
31
31
|
for?: number;
|
|
32
32
|
since?: number;
|
|
33
33
|
}
|
|
@@ -16,19 +16,19 @@ import BaseResource from "./BaseResource";
|
|
|
16
16
|
* TYPES
|
|
17
17
|
***************************************************************************/
|
|
18
18
|
|
|
19
|
-
type Website = {
|
|
19
|
+
export type Website = {
|
|
20
20
|
website_id?: string;
|
|
21
21
|
name?: string;
|
|
22
22
|
domain?: string;
|
|
23
23
|
logo?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
type WebsiteCreate = {
|
|
26
|
+
export type WebsiteCreate = {
|
|
27
27
|
name?: string;
|
|
28
28
|
domain?: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
type WebsiteRemoveVerify = {
|
|
31
|
+
export type WebsiteRemoveVerify = {
|
|
32
32
|
method?: string;
|
|
33
33
|
secret?: string;
|
|
34
34
|
}
|
|
@@ -16,12 +16,12 @@ import BaseResource from "./BaseResource";
|
|
|
16
16
|
* TYPES
|
|
17
17
|
***************************************************************************/
|
|
18
18
|
|
|
19
|
-
type WebsiteBatchConversationsOperation = {
|
|
19
|
+
export type WebsiteBatchConversationsOperation = {
|
|
20
20
|
inbox_id?: string;
|
|
21
21
|
sessions?: string[];
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
type WebsiteBatchPeopleOperationInner = {
|
|
24
|
+
export type WebsiteBatchPeopleOperationInner = {
|
|
25
25
|
profiles?: string[];
|
|
26
26
|
search?: string;
|
|
27
27
|
}
|
|
@@ -17,7 +17,7 @@ import { WebsiteFilter } from "./WebsiteBase";
|
|
|
17
17
|
* TYPES
|
|
18
18
|
***************************************************************************/
|
|
19
19
|
|
|
20
|
-
type WebsiteCampaignExcerpt = {
|
|
20
|
+
export type WebsiteCampaignExcerpt = {
|
|
21
21
|
campaign_id?: string;
|
|
22
22
|
type?: string;
|
|
23
23
|
format?: string;
|
|
@@ -35,7 +35,7 @@ type WebsiteCampaignExcerpt = {
|
|
|
35
35
|
dispatched_at?: number;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
type WebsiteCampaignTemplateExcerpt = {
|
|
38
|
+
export type WebsiteCampaignTemplateExcerpt = {
|
|
39
39
|
template_id?: string;
|
|
40
40
|
type?: string;
|
|
41
41
|
name?: string;
|
|
@@ -44,15 +44,15 @@ type WebsiteCampaignTemplateExcerpt = {
|
|
|
44
44
|
updated_at?: number;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
type WebsiteCampaignTemplateNew = {
|
|
47
|
+
export type WebsiteCampaignTemplateNew = {
|
|
48
48
|
template_id?: string;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
interface WebsiteCampaignTemplateItem extends WebsiteCampaignTemplateExcerpt {
|
|
51
|
+
export interface WebsiteCampaignTemplateItem extends WebsiteCampaignTemplateExcerpt {
|
|
52
52
|
content?: string;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
interface WebsiteCampaignItem extends WebsiteCampaignExcerpt {
|
|
55
|
+
export interface WebsiteCampaignItem extends WebsiteCampaignExcerpt {
|
|
56
56
|
sender?: WebsiteCampaignItemSender;
|
|
57
57
|
recipients?: WebsiteCampaignItemRecipients;
|
|
58
58
|
flow?: WebsiteCampaignItemFlow;
|
|
@@ -61,18 +61,18 @@ interface WebsiteCampaignItem extends WebsiteCampaignExcerpt {
|
|
|
61
61
|
statistics?: WebsiteCampaignItemStatistics;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
type WebsiteCampaignItemSender = {
|
|
64
|
+
export type WebsiteCampaignItemSender = {
|
|
65
65
|
user_id?: string;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
type WebsiteCampaignItemRecipients = {
|
|
68
|
+
export type WebsiteCampaignItemRecipients = {
|
|
69
69
|
type?: string;
|
|
70
70
|
segments?: string[];
|
|
71
71
|
people?: string[];
|
|
72
72
|
filter?: WebsiteFilter[];
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
type WebsiteCampaignItemFlow = {
|
|
75
|
+
export type WebsiteCampaignItemFlow = {
|
|
76
76
|
launch_event?: string;
|
|
77
77
|
assert_filter?: WebsiteFilter[];
|
|
78
78
|
assert_delay?: number;
|
|
@@ -80,7 +80,7 @@ type WebsiteCampaignItemFlow = {
|
|
|
80
80
|
deliver_delay?: number;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
type WebsiteCampaignItemOptions = {
|
|
83
|
+
export type WebsiteCampaignItemOptions = {
|
|
84
84
|
deliver_to_chatbox?: boolean;
|
|
85
85
|
deliver_to_email?: boolean;
|
|
86
86
|
sender_name_website?: boolean;
|
|
@@ -88,51 +88,51 @@ type WebsiteCampaignItemOptions = {
|
|
|
88
88
|
tracking?: boolean;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
type WebsiteCampaignItemStatistics = {
|
|
91
|
+
export type WebsiteCampaignItemStatistics = {
|
|
92
92
|
opened?: number;
|
|
93
93
|
clicked?: number;
|
|
94
94
|
unsubscribed?: number;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
type WebsiteCampaignRecipient = {
|
|
97
|
+
export type WebsiteCampaignRecipient = {
|
|
98
98
|
people_id?: string;
|
|
99
99
|
email?: string;
|
|
100
100
|
person?: WebsiteCampaignRecipientPerson;
|
|
101
101
|
subscribed?: boolean;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
type WebsiteCampaignRecipientPerson = {
|
|
104
|
+
export type WebsiteCampaignRecipientPerson = {
|
|
105
105
|
nickname?: string;
|
|
106
106
|
avatar?: string;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
type WebsiteCampaignStatistic = {
|
|
109
|
+
export type WebsiteCampaignStatistic = {
|
|
110
110
|
profile?: WebsiteCampaignStatisticProfile;
|
|
111
111
|
data?: Record<string, unknown>;
|
|
112
112
|
created_at?: number;
|
|
113
113
|
updated_at?: number;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
type WebsiteCampaignStatisticProfile = {
|
|
116
|
+
export type WebsiteCampaignStatisticProfile = {
|
|
117
117
|
people_id?: string;
|
|
118
118
|
email?: string;
|
|
119
119
|
person?: WebsiteCampaignStatisticProfilePerson;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
type WebsiteCampaignStatisticProfilePerson = {
|
|
122
|
+
export type WebsiteCampaignStatisticProfilePerson = {
|
|
123
123
|
nickname?: string;
|
|
124
124
|
avatar?: string;
|
|
125
125
|
geolocation?: WebsiteCampaignStatisticProfilePersonGeolocation;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
type WebsiteCampaignStatisticProfilePersonGeolocation = {
|
|
128
|
+
export type WebsiteCampaignStatisticProfilePersonGeolocation = {
|
|
129
129
|
country?: string;
|
|
130
130
|
region?: string;
|
|
131
131
|
city?: string;
|
|
132
132
|
coordinates?: WebsiteCampaignStatisticProfilePersonGeolocationCoordinates;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
type WebsiteCampaignStatisticProfilePersonGeolocationCoordinates = {
|
|
135
|
+
export type WebsiteCampaignStatisticProfilePersonGeolocationCoordinates = {
|
|
136
136
|
latitude?: number;
|
|
137
137
|
longitude?: number;
|
|
138
138
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crisp-api",
|
|
3
3
|
"description": "Crisp API wrapper for Node - official, maintained by Crisp",
|
|
4
|
-
"version": "10.0.
|
|
4
|
+
"version": "10.0.10",
|
|
5
5
|
"homepage": "https://github.com/crisp-im/node-crisp-api",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"typescript": "5.9.2",
|
|
50
50
|
"eslint": "9.29.0",
|
|
51
51
|
"eslint-plugin-crisp": "1.1.13",
|
|
52
|
-
"eslint-plugin-jsdoc": "
|
|
52
|
+
"eslint-plugin-jsdoc": "50.8.0",
|
|
53
53
|
"globals": "15.15.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|