intercom-client 6.1.1 → 6.2.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/Client.d.ts +2 -0
- package/README.md +21 -21
- package/api/errors/BadRequestError.js +17 -7
- package/api/errors/ForbiddenError.js +17 -7
- package/api/errors/NotFoundError.js +17 -7
- package/api/errors/UnauthorizedError.js +17 -7
- package/api/errors/UnprocessableEntityError.js +17 -7
- package/api/resources/admins/client/Client.d.ts +2 -0
- package/api/resources/admins/client/Client.js +34 -24
- package/api/resources/aiAgent/types/AiAgent.js +1 -1
- package/api/resources/aiContentSource/types/ContentSource.js +1 -1
- package/api/resources/articles/client/Client.d.ts +2 -0
- package/api/resources/articles/client/Client.js +41 -31
- package/api/resources/articles/client/requests/CreateArticleRequest.js +1 -1
- package/api/resources/articles/client/requests/UpdateArticleRequest.js +1 -1
- package/api/resources/articles/types/ArticleListItem.js +1 -1
- package/api/resources/articles/types/ArticleSearchHighlights.js +1 -1
- package/api/resources/companies/client/Client.d.ts +2 -0
- package/api/resources/companies/client/Client.js +60 -50
- package/api/resources/contacts/client/Client.d.ts +2 -0
- package/api/resources/contacts/client/Client.js +66 -56
- package/api/resources/conversations/client/Client.d.ts +2 -0
- package/api/resources/conversations/client/Client.js +57 -47
- package/api/resources/conversations/client/requests/CreateConversationRequest.js +1 -1
- package/api/resources/conversations/types/Conversation.js +1 -1
- package/api/resources/conversations/types/ConversationsManageRequestBody.d.ts +1 -1
- package/api/resources/dataAttributes/client/Client.d.ts +2 -0
- package/api/resources/dataAttributes/client/Client.js +30 -20
- package/api/resources/dataAttributes/client/requests/CreateDataAttributeRequest.js +1 -1
- package/api/resources/dataAttributes/types/DataAttribute.js +1 -1
- package/api/resources/dataAttributes/types/DataAttributesListRequestModel.d.ts +1 -1
- package/api/resources/dataExport/client/Client.d.ts +2 -0
- package/api/resources/dataExport/client/Client.js +31 -21
- package/api/resources/dataExport/types/DataExport.js +1 -1
- package/api/resources/events/client/Client.d.ts +2 -0
- package/api/resources/events/client/Client.js +30 -20
- package/api/resources/helpCenters/client/Client.d.ts +2 -0
- package/api/resources/helpCenters/client/Client.js +27 -17
- package/api/resources/helpCenters/resources/collections/client/Client.d.ts +2 -0
- package/api/resources/helpCenters/resources/collections/client/Client.js +36 -26
- package/api/resources/helpCenters/resources/index.js +17 -7
- package/api/resources/index.js +17 -7
- package/api/resources/messages/client/Client.d.ts +2 -0
- package/api/resources/messages/client/Client.js +22 -12
- package/api/resources/messages/types/Message.js +1 -1
- package/api/resources/news/client/Client.d.ts +2 -12
- package/api/resources/news/resources/feeds/client/Client.d.ts +2 -0
- package/api/resources/news/resources/feeds/client/Client.js +28 -18
- package/api/resources/news/resources/index.js +17 -7
- package/api/resources/news/resources/items/client/Client.d.ts +2 -0
- package/api/resources/news/resources/items/client/Client.js +34 -24
- package/api/resources/news/types/NewsItem.js +1 -1
- package/api/resources/notes/client/Client.d.ts +2 -0
- package/api/resources/notes/client/Client.js +28 -18
- package/api/resources/phoneCallRedirects/client/Client.d.ts +2 -0
- package/api/resources/phoneCallRedirects/client/Client.js +22 -12
- package/api/resources/segments/client/Client.d.ts +2 -0
- package/api/resources/segments/client/Client.js +27 -17
- package/api/resources/segments/types/Segment.js +1 -1
- package/api/resources/subscriptionTypes/client/Client.d.ts +2 -0
- package/api/resources/subscriptionTypes/client/Client.js +22 -12
- package/api/resources/subscriptionTypes/types/SubscriptionType.js +1 -1
- package/api/resources/tags/client/Client.d.ts +2 -0
- package/api/resources/tags/client/Client.js +49 -39
- package/api/resources/tags/types/TagsCreateRequestBody.d.ts +1 -1
- package/api/resources/teams/client/Client.d.ts +2 -0
- package/api/resources/teams/client/Client.js +25 -15
- package/api/resources/ticketTypes/client/Client.d.ts +2 -0
- package/api/resources/ticketTypes/client/Client.js +31 -21
- package/api/resources/ticketTypes/client/requests/CreateTicketTypeRequest.js +1 -1
- package/api/resources/ticketTypes/client/requests/UpdateTicketTypeRequest.js +1 -1
- package/api/resources/ticketTypes/resources/attributes/client/Client.d.ts +2 -0
- package/api/resources/ticketTypes/resources/attributes/client/Client.js +25 -15
- package/api/resources/ticketTypes/resources/attributes/client/requests/CreateTicketTypeAttributeRequest.js +1 -1
- package/api/resources/ticketTypes/resources/index.js +17 -7
- package/api/resources/tickets/client/Client.d.ts +2 -0
- package/api/resources/tickets/client/Client.js +34 -24
- package/api/resources/tickets/client/requests/UpdateTicketRequest.js +1 -1
- package/api/resources/tickets/types/Ticket.js +1 -1
- package/api/resources/tickets/types/TicketPart.js +1 -1
- package/api/resources/tickets/types/TicketType.js +1 -1
- package/api/resources/tickets/types/TicketsReplyRequestBody.d.ts +1 -1
- package/api/resources/visitors/client/Client.d.ts +2 -0
- package/api/resources/visitors/client/Client.js +28 -18
- package/api/types/ActionComponent.d.ts +1 -1
- package/api/types/ActivityLog.js +1 -1
- package/api/types/AdminReplyConversationRequest.js +1 -1
- package/api/types/AdminReplyTicketRequest.js +1 -1
- package/api/types/ArticleContent.js +1 -1
- package/api/types/AssignConversationRequest.js +1 -1
- package/api/types/ButtonComponent.js +1 -1
- package/api/types/CheckboxComponent.js +1 -1
- package/api/types/Component.d.ts +1 -1
- package/api/types/ConfigureRequest.d.ts +1 -1
- package/api/types/ConfigureResponse.d.ts +1 -1
- package/api/types/ContactReplyConversationRequest.d.ts +1 -1
- package/api/types/ContactReplyTicketRequest.d.ts +1 -1
- package/api/types/Context.js +1 -1
- package/api/types/ConversationSource.js +1 -1
- package/api/types/CreateContactRequest.d.ts +1 -1
- package/api/types/CreateDataEventRequest.d.ts +1 -1
- package/api/types/CreateMessageRequest.d.ts +1 -1
- package/api/types/CreateMessageRequest.js +1 -1
- package/api/types/CreateTicketReplyWithCommentRequest.d.ts +1 -1
- package/api/types/CustomAttributes.d.ts +1 -1
- package/api/types/CustomerRequest.d.ts +1 -1
- package/api/types/DropdownComponent.js +1 -1
- package/api/types/ImageComponent.js +1 -1
- package/api/types/InputComponent.js +1 -1
- package/api/types/LinkedObject.js +1 -1
- package/api/types/MultipleFilterSearchRequest.js +1 -1
- package/api/types/MultipleOrSingleFilterSearchRequest.d.ts +1 -1
- package/api/types/NewsItemRequest.js +1 -1
- package/api/types/RedactConversationRequest.d.ts +1 -1
- package/api/types/ReplyConversationRequest.d.ts +1 -1
- package/api/types/SingleFilterSearchRequest.js +1 -1
- package/api/types/SingleSelectComponent.js +1 -1
- package/api/types/SlaApplied.js +1 -1
- package/api/types/SpacerComponent.js +1 -1
- package/api/types/TextComponent.js +1 -1
- package/api/types/TicketCustomAttributes.d.ts +1 -1
- package/api/types/TicketPartAuthor.js +1 -1
- package/api/types/TicketReply.js +1 -1
- package/api/types/TicketRequestCustomAttributes.d.ts +1 -1
- package/api/types/TicketTypeAttribute.js +1 -1
- package/api/types/UpdateVisitorRequest.d.ts +1 -1
- package/api/version.d.ts +1 -1
- package/core/auth/BearerToken.d.ts +1 -1
- package/core/fetcher/APIResponse.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts +2 -2
- package/core/fetcher/Fetcher.js +6 -5
- package/core/fetcher/Supplier.d.ts +1 -1
- package/core/fetcher/createRequestUrl.d.ts +1 -1
- package/core/fetcher/createRequestUrl.js +1 -2
- package/core/fetcher/getFetchFn.js +18 -9
- package/core/fetcher/getHeader.js +1 -2
- package/core/fetcher/getRequestBody.js +5 -5
- package/core/fetcher/getResponseBody.js +1 -2
- package/core/fetcher/makeRequest.d.ts +1 -1
- package/core/fetcher/requestWithRetries.js +4 -5
- package/core/fetcher/signals.d.ts +0 -1
- package/core/fetcher/signals.js +2 -3
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/pagination/Page.js +9 -6
- package/core/runtime/runtime.d.ts +1 -1
- package/core/runtime/runtime.js +51 -41
- package/core/utils/setObjectProperty.js +1 -2
- package/dist/Client.d.ts +2 -0
- package/dist/api/errors/BadRequestError.js +17 -7
- package/dist/api/errors/ForbiddenError.js +17 -7
- package/dist/api/errors/NotFoundError.js +17 -7
- package/dist/api/errors/UnauthorizedError.js +17 -7
- package/dist/api/errors/UnprocessableEntityError.js +17 -7
- package/dist/api/resources/admins/client/Client.d.ts +2 -0
- package/dist/api/resources/admins/client/Client.js +34 -24
- package/dist/api/resources/aiAgent/types/AiAgent.js +1 -1
- package/dist/api/resources/aiContentSource/types/ContentSource.js +1 -1
- package/dist/api/resources/articles/client/Client.d.ts +2 -0
- package/dist/api/resources/articles/client/Client.js +41 -31
- package/dist/api/resources/articles/client/requests/CreateArticleRequest.js +1 -1
- package/dist/api/resources/articles/client/requests/UpdateArticleRequest.js +1 -1
- package/dist/api/resources/articles/types/ArticleListItem.js +1 -1
- package/dist/api/resources/articles/types/ArticleSearchHighlights.js +1 -1
- package/dist/api/resources/companies/client/Client.d.ts +2 -0
- package/dist/api/resources/companies/client/Client.js +60 -50
- package/dist/api/resources/contacts/client/Client.d.ts +2 -0
- package/dist/api/resources/contacts/client/Client.js +66 -56
- package/dist/api/resources/conversations/client/Client.d.ts +2 -0
- package/dist/api/resources/conversations/client/Client.js +57 -47
- package/dist/api/resources/conversations/client/requests/CreateConversationRequest.js +1 -1
- package/dist/api/resources/conversations/types/Conversation.js +1 -1
- package/dist/api/resources/conversations/types/ConversationsManageRequestBody.d.ts +1 -1
- package/dist/api/resources/dataAttributes/client/Client.d.ts +2 -0
- package/dist/api/resources/dataAttributes/client/Client.js +30 -20
- package/dist/api/resources/dataAttributes/client/requests/CreateDataAttributeRequest.js +1 -1
- package/dist/api/resources/dataAttributes/types/DataAttribute.js +1 -1
- package/dist/api/resources/dataAttributes/types/DataAttributesListRequestModel.d.ts +1 -1
- package/dist/api/resources/dataExport/client/Client.d.ts +2 -0
- package/dist/api/resources/dataExport/client/Client.js +31 -21
- package/dist/api/resources/dataExport/types/DataExport.js +1 -1
- package/dist/api/resources/events/client/Client.d.ts +2 -0
- package/dist/api/resources/events/client/Client.js +30 -20
- package/dist/api/resources/helpCenters/client/Client.d.ts +2 -0
- package/dist/api/resources/helpCenters/client/Client.js +27 -17
- package/dist/api/resources/helpCenters/resources/collections/client/Client.d.ts +2 -0
- package/dist/api/resources/helpCenters/resources/collections/client/Client.js +36 -26
- package/dist/api/resources/helpCenters/resources/index.js +17 -7
- package/dist/api/resources/index.js +17 -7
- package/dist/api/resources/messages/client/Client.d.ts +2 -0
- package/dist/api/resources/messages/client/Client.js +22 -12
- package/dist/api/resources/messages/types/Message.js +1 -1
- package/dist/api/resources/news/client/Client.d.ts +2 -12
- package/dist/api/resources/news/resources/feeds/client/Client.d.ts +2 -0
- package/dist/api/resources/news/resources/feeds/client/Client.js +28 -18
- package/dist/api/resources/news/resources/index.js +17 -7
- package/dist/api/resources/news/resources/items/client/Client.d.ts +2 -0
- package/dist/api/resources/news/resources/items/client/Client.js +34 -24
- package/dist/api/resources/news/types/NewsItem.js +1 -1
- package/dist/api/resources/notes/client/Client.d.ts +2 -0
- package/dist/api/resources/notes/client/Client.js +28 -18
- package/dist/api/resources/phoneCallRedirects/client/Client.d.ts +2 -0
- package/dist/api/resources/phoneCallRedirects/client/Client.js +22 -12
- package/dist/api/resources/segments/client/Client.d.ts +2 -0
- package/dist/api/resources/segments/client/Client.js +27 -17
- package/dist/api/resources/segments/types/Segment.js +1 -1
- package/dist/api/resources/subscriptionTypes/client/Client.d.ts +2 -0
- package/dist/api/resources/subscriptionTypes/client/Client.js +22 -12
- package/dist/api/resources/subscriptionTypes/types/SubscriptionType.js +1 -1
- package/dist/api/resources/tags/client/Client.d.ts +2 -0
- package/dist/api/resources/tags/client/Client.js +49 -39
- package/dist/api/resources/tags/types/TagsCreateRequestBody.d.ts +1 -1
- package/dist/api/resources/teams/client/Client.d.ts +2 -0
- package/dist/api/resources/teams/client/Client.js +25 -15
- package/dist/api/resources/ticketTypes/client/Client.d.ts +2 -0
- package/dist/api/resources/ticketTypes/client/Client.js +31 -21
- package/dist/api/resources/ticketTypes/client/requests/CreateTicketTypeRequest.js +1 -1
- package/dist/api/resources/ticketTypes/client/requests/UpdateTicketTypeRequest.js +1 -1
- package/dist/api/resources/ticketTypes/resources/attributes/client/Client.d.ts +2 -0
- package/dist/api/resources/ticketTypes/resources/attributes/client/Client.js +25 -15
- package/dist/api/resources/ticketTypes/resources/attributes/client/requests/CreateTicketTypeAttributeRequest.js +1 -1
- package/dist/api/resources/ticketTypes/resources/index.js +17 -7
- package/dist/api/resources/tickets/client/Client.d.ts +2 -0
- package/dist/api/resources/tickets/client/Client.js +34 -24
- package/dist/api/resources/tickets/client/requests/UpdateTicketRequest.js +1 -1
- package/dist/api/resources/tickets/types/Ticket.js +1 -1
- package/dist/api/resources/tickets/types/TicketPart.js +1 -1
- package/dist/api/resources/tickets/types/TicketType.js +1 -1
- package/dist/api/resources/tickets/types/TicketsReplyRequestBody.d.ts +1 -1
- package/dist/api/resources/visitors/client/Client.d.ts +2 -0
- package/dist/api/resources/visitors/client/Client.js +28 -18
- package/dist/api/types/ActionComponent.d.ts +1 -1
- package/dist/api/types/ActivityLog.js +1 -1
- package/dist/api/types/AdminReplyConversationRequest.js +1 -1
- package/dist/api/types/AdminReplyTicketRequest.js +1 -1
- package/dist/api/types/ArticleContent.js +1 -1
- package/dist/api/types/AssignConversationRequest.js +1 -1
- package/dist/api/types/ButtonComponent.js +1 -1
- package/dist/api/types/CheckboxComponent.js +1 -1
- package/dist/api/types/Component.d.ts +1 -1
- package/dist/api/types/ConfigureRequest.d.ts +1 -1
- package/dist/api/types/ConfigureResponse.d.ts +1 -1
- package/dist/api/types/ContactReplyConversationRequest.d.ts +1 -1
- package/dist/api/types/ContactReplyTicketRequest.d.ts +1 -1
- package/dist/api/types/Context.js +1 -1
- package/dist/api/types/ConversationSource.js +1 -1
- package/dist/api/types/CreateContactRequest.d.ts +1 -1
- package/dist/api/types/CreateDataEventRequest.d.ts +1 -1
- package/dist/api/types/CreateMessageRequest.d.ts +1 -1
- package/dist/api/types/CreateMessageRequest.js +1 -1
- package/dist/api/types/CreateTicketReplyWithCommentRequest.d.ts +1 -1
- package/dist/api/types/CustomAttributes.d.ts +1 -1
- package/dist/api/types/CustomerRequest.d.ts +1 -1
- package/dist/api/types/DropdownComponent.js +1 -1
- package/dist/api/types/ImageComponent.js +1 -1
- package/dist/api/types/InputComponent.js +1 -1
- package/dist/api/types/LinkedObject.js +1 -1
- package/dist/api/types/MultipleFilterSearchRequest.js +1 -1
- package/dist/api/types/MultipleOrSingleFilterSearchRequest.d.ts +1 -1
- package/dist/api/types/NewsItemRequest.js +1 -1
- package/dist/api/types/RedactConversationRequest.d.ts +1 -1
- package/dist/api/types/ReplyConversationRequest.d.ts +1 -1
- package/dist/api/types/SingleFilterSearchRequest.js +1 -1
- package/dist/api/types/SingleSelectComponent.js +1 -1
- package/dist/api/types/SlaApplied.js +1 -1
- package/dist/api/types/SpacerComponent.js +1 -1
- package/dist/api/types/TextComponent.js +1 -1
- package/dist/api/types/TicketCustomAttributes.d.ts +1 -1
- package/dist/api/types/TicketPartAuthor.js +1 -1
- package/dist/api/types/TicketReply.js +1 -1
- package/dist/api/types/TicketRequestCustomAttributes.d.ts +1 -1
- package/dist/api/types/TicketTypeAttribute.js +1 -1
- package/dist/api/types/UpdateVisitorRequest.d.ts +1 -1
- package/dist/api/version.d.ts +1 -1
- package/dist/core/auth/BearerToken.d.ts +1 -1
- package/dist/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.d.ts +2 -2
- package/dist/core/fetcher/Fetcher.js +6 -5
- package/dist/core/fetcher/Supplier.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.js +1 -2
- package/dist/core/fetcher/getFetchFn.js +18 -9
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.js +5 -5
- package/dist/core/fetcher/getResponseBody.js +1 -2
- package/dist/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/core/fetcher/requestWithRetries.js +4 -5
- package/dist/core/fetcher/signals.d.ts +0 -1
- package/dist/core/fetcher/signals.js +2 -3
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/pagination/Page.js +9 -6
- package/dist/core/runtime/runtime.d.ts +1 -1
- package/dist/core/runtime/runtime.js +51 -41
- package/dist/core/utils/setObjectProperty.js +1 -2
- package/dist/environments.d.ts +1 -1
- package/dist/errors/IntercomError.js +2 -1
- package/dist/index.js +17 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/environments.d.ts +1 -1
- package/errors/IntercomError.js +2 -1
- package/index.js +17 -7
- package/{jest.config.js → jest.config.mjs} +4 -1
- package/package.json +16 -16
- package/reference.md +32 -32
- package/scripts/rename-to-esm-files.js +115 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -79,7 +89,7 @@ class Contacts {
|
|
|
79
89
|
listAttachedCompanies(request, requestOptions) {
|
|
80
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
91
|
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
var _a, _b, _c, _d, _e;
|
|
92
|
+
var _a, _b, _c, _d, _e, _f;
|
|
83
93
|
const { contact_id: contactId, page, per_page: perPage } = request;
|
|
84
94
|
const _queryParams = {};
|
|
85
95
|
if (page != null) {
|
|
@@ -89,9 +99,9 @@ class Contacts {
|
|
|
89
99
|
_queryParams["per_page"] = perPage.toString();
|
|
90
100
|
}
|
|
91
101
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
92
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
102
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}/companies`),
|
|
93
103
|
method: "GET",
|
|
94
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
104
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
95
105
|
contentType: "application/json",
|
|
96
106
|
queryParameters: _queryParams,
|
|
97
107
|
requestType: "json",
|
|
@@ -156,13 +166,13 @@ class Contacts {
|
|
|
156
166
|
* })
|
|
157
167
|
*/
|
|
158
168
|
listAttachedSegments(request, requestOptions) {
|
|
159
|
-
var _a, _b, _c, _d, _e;
|
|
160
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
var _a, _b, _c, _d, _e, _f;
|
|
161
171
|
const { contact_id: contactId } = request;
|
|
162
172
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
163
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
173
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}/segments`),
|
|
164
174
|
method: "GET",
|
|
165
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
175
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
166
176
|
contentType: "application/json",
|
|
167
177
|
requestType: "json",
|
|
168
178
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -221,13 +231,13 @@ class Contacts {
|
|
|
221
231
|
* })
|
|
222
232
|
*/
|
|
223
233
|
listAttachedSubscriptions(request, requestOptions) {
|
|
224
|
-
var _a, _b, _c, _d, _e;
|
|
225
234
|
return __awaiter(this, void 0, void 0, function* () {
|
|
235
|
+
var _a, _b, _c, _d, _e, _f;
|
|
226
236
|
const { contact_id: contactId } = request;
|
|
227
237
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
228
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
238
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}/subscriptions`),
|
|
229
239
|
method: "GET",
|
|
230
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
240
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
231
241
|
contentType: "application/json",
|
|
232
242
|
requestType: "json",
|
|
233
243
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -295,13 +305,13 @@ class Contacts {
|
|
|
295
305
|
* })
|
|
296
306
|
*/
|
|
297
307
|
attachSubscription(request, requestOptions) {
|
|
298
|
-
var _a, _b, _c, _d, _e;
|
|
299
308
|
return __awaiter(this, void 0, void 0, function* () {
|
|
309
|
+
var _a, _b, _c, _d, _e, _f;
|
|
300
310
|
const { contact_id: contactId } = request, _body = __rest(request, ["contact_id"]);
|
|
301
311
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
302
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
312
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}/subscriptions`),
|
|
303
313
|
method: "POST",
|
|
304
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
314
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
305
315
|
contentType: "application/json",
|
|
306
316
|
requestType: "json",
|
|
307
317
|
body: _body,
|
|
@@ -356,13 +366,13 @@ class Contacts {
|
|
|
356
366
|
* })
|
|
357
367
|
*/
|
|
358
368
|
detachSubscription(request, requestOptions) {
|
|
359
|
-
var _a, _b, _c, _d, _e;
|
|
360
369
|
return __awaiter(this, void 0, void 0, function* () {
|
|
370
|
+
var _a, _b, _c, _d, _e, _f;
|
|
361
371
|
const { contact_id: contactId, subscription_id: subscriptionId } = request;
|
|
362
372
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
363
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
373
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}/subscriptions/${encodeURIComponent(subscriptionId)}`),
|
|
364
374
|
method: "DELETE",
|
|
365
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
375
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
366
376
|
contentType: "application/json",
|
|
367
377
|
requestType: "json",
|
|
368
378
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -415,13 +425,13 @@ class Contacts {
|
|
|
415
425
|
* })
|
|
416
426
|
*/
|
|
417
427
|
listAttachedTags(request, requestOptions) {
|
|
418
|
-
var _a, _b, _c, _d, _e;
|
|
419
428
|
return __awaiter(this, void 0, void 0, function* () {
|
|
429
|
+
var _a, _b, _c, _d, _e, _f;
|
|
420
430
|
const { contact_id: contactId } = request;
|
|
421
431
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
422
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
432
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}/tags`),
|
|
423
433
|
method: "GET",
|
|
424
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
434
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
425
435
|
contentType: "application/json",
|
|
426
436
|
requestType: "json",
|
|
427
437
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -473,13 +483,13 @@ class Contacts {
|
|
|
473
483
|
* })
|
|
474
484
|
*/
|
|
475
485
|
find(request, requestOptions) {
|
|
476
|
-
var _a, _b, _c, _d, _e;
|
|
477
486
|
return __awaiter(this, void 0, void 0, function* () {
|
|
487
|
+
var _a, _b, _c, _d, _e, _f;
|
|
478
488
|
const { contact_id: contactId } = request;
|
|
479
489
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
480
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
490
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}`),
|
|
481
491
|
method: "GET",
|
|
482
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
492
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
483
493
|
contentType: "application/json",
|
|
484
494
|
requestType: "json",
|
|
485
495
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -531,13 +541,13 @@ class Contacts {
|
|
|
531
541
|
* })
|
|
532
542
|
*/
|
|
533
543
|
update(request, requestOptions) {
|
|
534
|
-
var _a, _b, _c, _d, _e;
|
|
535
544
|
return __awaiter(this, void 0, void 0, function* () {
|
|
545
|
+
var _a, _b, _c, _d, _e, _f;
|
|
536
546
|
const { contact_id: contactId } = request, _body = __rest(request, ["contact_id"]);
|
|
537
547
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
538
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
548
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}`),
|
|
539
549
|
method: "PUT",
|
|
540
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
550
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
541
551
|
contentType: "application/json",
|
|
542
552
|
requestType: "json",
|
|
543
553
|
body: _body,
|
|
@@ -588,13 +598,13 @@ class Contacts {
|
|
|
588
598
|
* })
|
|
589
599
|
*/
|
|
590
600
|
delete(request, requestOptions) {
|
|
591
|
-
var _a, _b, _c, _d, _e;
|
|
592
601
|
return __awaiter(this, void 0, void 0, function* () {
|
|
602
|
+
var _a, _b, _c, _d, _e, _f;
|
|
593
603
|
const { contact_id: contactId } = request;
|
|
594
604
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
595
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
605
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}`),
|
|
596
606
|
method: "DELETE",
|
|
597
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
607
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
598
608
|
contentType: "application/json",
|
|
599
609
|
requestType: "json",
|
|
600
610
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -645,12 +655,12 @@ class Contacts {
|
|
|
645
655
|
* })
|
|
646
656
|
*/
|
|
647
657
|
mergeLeadInUser(request, requestOptions) {
|
|
648
|
-
var _a, _b, _c, _d, _e;
|
|
649
658
|
return __awaiter(this, void 0, void 0, function* () {
|
|
659
|
+
var _a, _b, _c, _d, _e, _f;
|
|
650
660
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
651
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
661
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, "contacts/merge"),
|
|
652
662
|
method: "POST",
|
|
653
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
663
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
654
664
|
contentType: "application/json",
|
|
655
665
|
requestType: "json",
|
|
656
666
|
body: request,
|
|
@@ -811,11 +821,11 @@ class Contacts {
|
|
|
811
821
|
search(request, requestOptions) {
|
|
812
822
|
return __awaiter(this, void 0, void 0, function* () {
|
|
813
823
|
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
814
|
-
var _a, _b, _c, _d, _e;
|
|
824
|
+
var _a, _b, _c, _d, _e, _f;
|
|
815
825
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
816
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
826
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, "contacts/search"),
|
|
817
827
|
method: "POST",
|
|
818
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
828
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
819
829
|
contentType: "application/json",
|
|
820
830
|
requestType: "json",
|
|
821
831
|
body: request,
|
|
@@ -877,10 +887,10 @@ class Contacts {
|
|
|
877
887
|
* @example
|
|
878
888
|
* await client.contacts.list()
|
|
879
889
|
*/
|
|
880
|
-
list(
|
|
881
|
-
return __awaiter(this,
|
|
890
|
+
list() {
|
|
891
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
882
892
|
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
883
|
-
var _a, _b, _c, _d, _e;
|
|
893
|
+
var _a, _b, _c, _d, _e, _f;
|
|
884
894
|
const { page, per_page: perPage, starting_after: startingAfter } = request;
|
|
885
895
|
const _queryParams = {};
|
|
886
896
|
if (page != null) {
|
|
@@ -893,9 +903,9 @@ class Contacts {
|
|
|
893
903
|
_queryParams["starting_after"] = startingAfter;
|
|
894
904
|
}
|
|
895
905
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
896
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
906
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, "contacts"),
|
|
897
907
|
method: "GET",
|
|
898
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
908
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
899
909
|
contentType: "application/json",
|
|
900
910
|
queryParameters: _queryParams,
|
|
901
911
|
requestType: "json",
|
|
@@ -956,12 +966,12 @@ class Contacts {
|
|
|
956
966
|
* })
|
|
957
967
|
*/
|
|
958
968
|
create(request, requestOptions) {
|
|
959
|
-
var _a, _b, _c, _d, _e;
|
|
960
969
|
return __awaiter(this, void 0, void 0, function* () {
|
|
970
|
+
var _a, _b, _c, _d, _e, _f;
|
|
961
971
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
962
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
972
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, "contacts"),
|
|
963
973
|
method: "POST",
|
|
964
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
974
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
965
975
|
contentType: "application/json",
|
|
966
976
|
requestType: "json",
|
|
967
977
|
body: request,
|
|
@@ -1010,13 +1020,13 @@ class Contacts {
|
|
|
1010
1020
|
* })
|
|
1011
1021
|
*/
|
|
1012
1022
|
archive(request, requestOptions) {
|
|
1013
|
-
var _a, _b, _c, _d, _e;
|
|
1014
1023
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1024
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1015
1025
|
const { contact_id: contactId } = request;
|
|
1016
1026
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1017
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
1027
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}/archive`),
|
|
1018
1028
|
method: "POST",
|
|
1019
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
1029
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1020
1030
|
contentType: "application/json",
|
|
1021
1031
|
requestType: "json",
|
|
1022
1032
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -1059,13 +1069,13 @@ class Contacts {
|
|
|
1059
1069
|
* })
|
|
1060
1070
|
*/
|
|
1061
1071
|
unarchive(request, requestOptions) {
|
|
1062
|
-
var _a, _b, _c, _d, _e;
|
|
1063
1072
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1073
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1064
1074
|
const { contact_id: contactId } = request;
|
|
1065
1075
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1066
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
1076
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.IntercomEnvironment.UsProduction, `contacts/${encodeURIComponent(contactId)}/unarchive`),
|
|
1067
1077
|
method: "POST",
|
|
1068
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
1078
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "6.2.0", "User-Agent": "intercom-client/6.2.0", "Intercom-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.version) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.version) !== null && _f !== void 0 ? _f : "2.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1069
1079
|
contentType: "application/json",
|
|
1070
1080
|
requestType: "json",
|
|
1071
1081
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -1097,12 +1107,12 @@ class Contacts {
|
|
|
1097
1107
|
});
|
|
1098
1108
|
}
|
|
1099
1109
|
_getAuthorizationHeader() {
|
|
1100
|
-
var _a;
|
|
1101
1110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1111
|
+
var _a;
|
|
1102
1112
|
const bearer = (_a = (yield core.Supplier.get(this._options.token))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["INTERCOM_API_KEY"];
|
|
1103
1113
|
if (bearer == null) {
|
|
1104
1114
|
throw new errors.IntercomError({
|
|
1105
|
-
message: "Please specify
|
|
1115
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a INTERCOM_API_KEY environment variable",
|
|
1106
1116
|
});
|
|
1107
1117
|
}
|
|
1108
1118
|
return `Bearer ${bearer}`;
|
|
@@ -7,6 +7,8 @@ import * as Intercom from "../../../index";
|
|
|
7
7
|
export declare namespace Conversations {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.IntercomEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
token?: core.Supplier<core.BearerToken | undefined>;
|
|
11
13
|
/** Override the Intercom-Version header */
|
|
12
14
|
version?: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "2.0" | "2.1" | "2.2" | "2.3" | "2.4" | "2.5" | "2.6" | "2.7" | "2.8" | "2.9" | "2.10" | "2.11" | "Unstable";
|