crisp-api 10.0.18 → 10.1.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 +12 -0
- package/README.md +6 -2
- package/dist/crisp.js +17 -5
- package/dist/resources/BaseResource.js +3 -3
- package/dist/resources/BucketURL.js +3 -3
- package/dist/resources/MediaAnimation.js +3 -3
- package/dist/resources/PluginConnect.js +3 -3
- package/dist/resources/PluginSubscription.js +3 -3
- package/dist/resources/WebsiteAnalytics.js +3 -3
- package/dist/resources/WebsiteAvailability.js +3 -3
- package/dist/resources/WebsiteBase.js +3 -3
- package/dist/resources/WebsiteBatch.js +3 -3
- package/dist/resources/WebsiteCampaign.js +3 -3
- package/dist/resources/WebsiteConversation.d.ts +34 -1
- package/dist/resources/WebsiteConversation.js +7 -5
- package/dist/resources/WebsiteHelpdesk.js +3 -3
- package/dist/resources/WebsiteOperator.js +3 -3
- package/dist/resources/WebsitePeople.js +3 -3
- package/dist/resources/WebsiteSettings.js +3 -3
- package/dist/resources/WebsiteVerify.js +3 -3
- package/dist/resources/WebsiteVisitors.js +3 -3
- package/dist/resources/index.js +3 -3
- package/dist/services/bucket.js +3 -3
- package/dist/services/media.js +3 -3
- package/dist/services/plugin.js +3 -3
- package/dist/services/website.js +3 -3
- package/lib/crisp.ts +18 -4
- package/lib/resources/BaseResource.ts +3 -3
- package/lib/resources/BucketURL.ts +3 -3
- package/lib/resources/MediaAnimation.ts +3 -3
- package/lib/resources/PluginConnect.ts +3 -3
- package/lib/resources/PluginSubscription.ts +3 -3
- package/lib/resources/WebsiteAnalytics.ts +3 -3
- package/lib/resources/WebsiteAvailability.ts +3 -3
- package/lib/resources/WebsiteBase.ts +3 -3
- package/lib/resources/WebsiteBatch.ts +3 -3
- package/lib/resources/WebsiteCampaign.ts +3 -3
- package/lib/resources/WebsiteConversation.ts +50 -5
- package/lib/resources/WebsiteHelpdesk.ts +3 -3
- package/lib/resources/WebsiteOperator.ts +3 -3
- package/lib/resources/WebsitePeople.ts +3 -3
- package/lib/resources/WebsiteSettings.ts +3 -3
- package/lib/resources/WebsiteVerify.ts +3 -3
- package/lib/resources/WebsiteVisitors.ts +3 -3
- package/lib/resources/index.ts +3 -3
- package/lib/services/bucket.ts +3 -3
- package/lib/services/media.ts +3 -3
- package/lib/services/plugin.ts +3 -3
- package/lib/services/website.ts +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## v10.1.0
|
|
5
|
+
|
|
6
|
+
### New Features
|
|
7
|
+
|
|
8
|
+
* Added `options` to `CrispClient.website.listConversations`.
|
|
9
|
+
|
|
4
10
|
## v10.0.18
|
|
5
11
|
|
|
12
|
+
### New Features
|
|
13
|
+
|
|
6
14
|
* Added the new `CrispClient.setCustomHeaders` method to set custom headers for all API requests.
|
|
7
15
|
|
|
8
16
|
## v10.0.17
|
|
9
17
|
|
|
18
|
+
### New Features
|
|
19
|
+
|
|
10
20
|
* Add `stamped` to `ConversationMessage`.
|
|
11
21
|
|
|
12
22
|
## v10.0.16
|
|
13
23
|
|
|
24
|
+
### Changes
|
|
25
|
+
|
|
14
26
|
* Harden types on `ConversationVerifyIdentityRequest` and `ConversationVerifyIdentityRedeem`.
|
|
15
27
|
|
|
16
28
|
## v10.0.15
|
package/README.md
CHANGED
|
@@ -168,7 +168,7 @@ All methods that you will most likely need when building a Crisp integration are
|
|
|
168
168
|
|
|
169
169
|
* #### **Website Conversations**
|
|
170
170
|
* **⭐ List Conversations** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-conversations)
|
|
171
|
-
* `CrispClient.website.listConversations(websiteID, pageNumber)`
|
|
171
|
+
* `CrispClient.website.listConversations(websiteID, pageNumber, options)`
|
|
172
172
|
* <details>
|
|
173
173
|
<summary>See Example</summary>
|
|
174
174
|
|
|
@@ -176,7 +176,11 @@ All methods that you will most likely need when building a Crisp integration are
|
|
|
176
176
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
177
177
|
var pageNumber = 1;
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
var options = {
|
|
180
|
+
per_page: 50
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
CrispClient.website.listConversations(websiteID, pageNumber, options);
|
|
180
184
|
```
|
|
181
185
|
</details>
|
|
182
186
|
|
package/dist/crisp.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
9
|
if (k2 === undefined) k2 = k;
|
|
@@ -45,7 +45,7 @@ const AVAILABLE_RTM_MODES = [
|
|
|
45
45
|
"websockets",
|
|
46
46
|
"webhooks"
|
|
47
47
|
];
|
|
48
|
-
const VERSION = "10.0
|
|
48
|
+
const VERSION = "10.1.0";
|
|
49
49
|
// Base configuration
|
|
50
50
|
const DEFAULT_REQUEST_TIMEOUT = 10000;
|
|
51
51
|
const DEFAULT_SOCKET_TIMEOUT = 10000;
|
|
@@ -685,8 +685,20 @@ class Crisp {
|
|
|
685
685
|
}
|
|
686
686
|
// Add query?
|
|
687
687
|
if (query) {
|
|
688
|
+
const params = new URLSearchParams();
|
|
689
|
+
Object.entries(query).forEach(([key, value]) => {
|
|
690
|
+
if (value === null || value === undefined) {
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
if (typeof value === "object") {
|
|
694
|
+
params.append(key, JSON.stringify(value));
|
|
695
|
+
}
|
|
696
|
+
else {
|
|
697
|
+
params.append(key, String(value));
|
|
698
|
+
}
|
|
699
|
+
});
|
|
688
700
|
// @ts-ignore
|
|
689
|
-
requestParameters.searchParams =
|
|
701
|
+
requestParameters.searchParams = params;
|
|
690
702
|
}
|
|
691
703
|
// Proceed request
|
|
692
704
|
got_1.default[method](resource, requestParameters)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
/**************************************************************************
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -396,6 +396,39 @@ export interface ConversationBrowsing {
|
|
|
396
396
|
export interface ConversationCall {
|
|
397
397
|
call_id?: string;
|
|
398
398
|
}
|
|
399
|
+
export interface BaseConversationsListOptions {
|
|
400
|
+
per_page?: number;
|
|
401
|
+
include_empty?: 0 | 1;
|
|
402
|
+
filter_inbox_id?: string;
|
|
403
|
+
filter_unread?: 0 | 1;
|
|
404
|
+
filter_resolved?: 0 | 1;
|
|
405
|
+
filter_not_resolved?: 0 | 1;
|
|
406
|
+
filter_mention?: 0 | 1;
|
|
407
|
+
filter_assigned?: string;
|
|
408
|
+
filter_unassigned?: 0 | 1;
|
|
409
|
+
filter_date_start?: string;
|
|
410
|
+
filter_date_end?: string;
|
|
411
|
+
order_date_created?: 0 | 1;
|
|
412
|
+
order_date_updated?: 0 | 1;
|
|
413
|
+
order_date_waiting?: 0 | 1;
|
|
414
|
+
}
|
|
415
|
+
export interface StandardSearchOptions extends BaseConversationsListOptions {
|
|
416
|
+
search_type: "text" | "segment";
|
|
417
|
+
search_query: string;
|
|
418
|
+
search_operator?: never;
|
|
419
|
+
}
|
|
420
|
+
export interface FilterSearchOptions extends BaseConversationsListOptions {
|
|
421
|
+
search_type: "filter";
|
|
422
|
+
search_query: FilterSearchQuery[];
|
|
423
|
+
search_operator?: "and" | "or";
|
|
424
|
+
}
|
|
425
|
+
export interface FilterSearchQuery {
|
|
426
|
+
criterion: string;
|
|
427
|
+
query: string[];
|
|
428
|
+
model: string;
|
|
429
|
+
operator: string;
|
|
430
|
+
}
|
|
431
|
+
export type ConversationsListOptions = BaseConversationsListOptions | StandardSearchOptions | FilterSearchOptions;
|
|
399
432
|
/**************************************************************************
|
|
400
433
|
* CLASSES
|
|
401
434
|
***************************************************************************/
|
|
@@ -407,7 +440,7 @@ declare class WebsiteConversation extends BaseResource {
|
|
|
407
440
|
/**
|
|
408
441
|
* List Conversations
|
|
409
442
|
*/
|
|
410
|
-
listConversations(websiteID: string, pageNumber?: number): Promise<Conversation[]>;
|
|
443
|
+
listConversations(websiteID: string, pageNumber?: number, options?: ConversationsListOptions): Promise<Conversation[]>;
|
|
411
444
|
/**
|
|
412
445
|
* List Suggested Conversation Segments
|
|
413
446
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -25,8 +25,10 @@ class WebsiteConversation extends BaseResource_1.default {
|
|
|
25
25
|
/**
|
|
26
26
|
* List Conversations
|
|
27
27
|
*/
|
|
28
|
-
listConversations(websiteID, pageNumber = 1) {
|
|
29
|
-
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
28
|
+
listConversations(websiteID, pageNumber = 1, options) {
|
|
29
|
+
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
30
|
+
"website", websiteID, "conversations", String(pageNumber)
|
|
31
|
+
]), options);
|
|
30
32
|
}
|
|
31
33
|
;
|
|
32
34
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
package/dist/resources/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
9
|
if (k2 === undefined) k2 = k;
|
package/dist/services/bucket.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
package/dist/services/media.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
package/dist/services/plugin.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
package/dist/services/website.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* node-crisp-api
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
5
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
7
|
*/
|
|
8
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
package/lib/crisp.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -900,8 +900,22 @@ class Crisp {
|
|
|
900
900
|
|
|
901
901
|
// Add query?
|
|
902
902
|
if (query) {
|
|
903
|
+
const params = new URLSearchParams();
|
|
904
|
+
|
|
905
|
+
Object.entries(query).forEach(([ key, value ]) => {
|
|
906
|
+
if (value === null || value === undefined) {
|
|
907
|
+
return;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
if (typeof value === "object") {
|
|
911
|
+
params.append(key, JSON.stringify(value));
|
|
912
|
+
} else {
|
|
913
|
+
params.append(key, String(value));
|
|
914
|
+
}
|
|
915
|
+
});
|
|
916
|
+
|
|
903
917
|
// @ts-ignore
|
|
904
|
-
requestParameters.searchParams =
|
|
918
|
+
requestParameters.searchParams = params;
|
|
905
919
|
}
|
|
906
920
|
|
|
907
921
|
// Proceed request
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -511,6 +511,47 @@ export interface ConversationCall {
|
|
|
511
511
|
call_id?: string;
|
|
512
512
|
}
|
|
513
513
|
|
|
514
|
+
export interface BaseConversationsListOptions {
|
|
515
|
+
per_page?: number;
|
|
516
|
+
include_empty?: 0 | 1;
|
|
517
|
+
filter_inbox_id?: string;
|
|
518
|
+
filter_unread?: 0 | 1;
|
|
519
|
+
filter_resolved?: 0 | 1;
|
|
520
|
+
filter_not_resolved?: 0 | 1;
|
|
521
|
+
filter_mention?: 0 | 1;
|
|
522
|
+
filter_assigned?: string;
|
|
523
|
+
filter_unassigned?: 0 | 1;
|
|
524
|
+
filter_date_start?: string;
|
|
525
|
+
filter_date_end?: string;
|
|
526
|
+
order_date_created?: 0 | 1;
|
|
527
|
+
order_date_updated?: 0 | 1;
|
|
528
|
+
order_date_waiting?: 0 | 1;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export interface StandardSearchOptions extends BaseConversationsListOptions {
|
|
532
|
+
search_type: "text" | "segment";
|
|
533
|
+
search_query: string;
|
|
534
|
+
search_operator?: never;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export interface FilterSearchOptions extends BaseConversationsListOptions {
|
|
538
|
+
search_type: "filter";
|
|
539
|
+
search_query: FilterSearchQuery[];
|
|
540
|
+
search_operator?: "and" | "or";
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export interface FilterSearchQuery {
|
|
544
|
+
criterion: string;
|
|
545
|
+
query: string[];
|
|
546
|
+
model: string;
|
|
547
|
+
operator: string;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export type ConversationsListOptions =
|
|
551
|
+
| BaseConversationsListOptions
|
|
552
|
+
| StandardSearchOptions
|
|
553
|
+
| FilterSearchOptions;
|
|
554
|
+
|
|
514
555
|
/**************************************************************************
|
|
515
556
|
* CLASSES
|
|
516
557
|
***************************************************************************/
|
|
@@ -524,10 +565,14 @@ class WebsiteConversation extends BaseResource {
|
|
|
524
565
|
* List Conversations
|
|
525
566
|
*/
|
|
526
567
|
listConversations(
|
|
527
|
-
websiteID: string, pageNumber: number = 1
|
|
568
|
+
websiteID: string, pageNumber: number = 1, options?: ConversationsListOptions
|
|
528
569
|
): Promise<Conversation[]> {
|
|
529
570
|
return this.crisp.get(
|
|
530
|
-
this.crisp.prepareRestUrl([
|
|
571
|
+
this.crisp.prepareRestUrl([
|
|
572
|
+
"website", websiteID, "conversations", String(pageNumber)
|
|
573
|
+
]),
|
|
574
|
+
|
|
575
|
+
options
|
|
531
576
|
);
|
|
532
577
|
};
|
|
533
578
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
package/lib/resources/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
package/lib/services/bucket.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
package/lib/services/media.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
package/lib/services/plugin.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
package/lib/services/website.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* node-crisp-api
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
3
|
*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
4
|
+
* Copyright (c) 2025 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**************************************************************************
|
package/package.json
CHANGED