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
package/Client.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ import { News } from "./api/resources/news/client/Client";
|
|
|
26
26
|
export declare namespace IntercomClient {
|
|
27
27
|
interface Options {
|
|
28
28
|
environment?: core.Supplier<environments.IntercomEnvironment | string>;
|
|
29
|
+
/** Specify a custom URL to connect the client to. */
|
|
30
|
+
baseUrl?: core.Supplier<string>;
|
|
29
31
|
token?: core.Supplier<core.BearerToken | undefined>;
|
|
30
32
|
/** Override the Intercom-Version header */
|
|
31
33
|
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";
|
package/README.md
CHANGED
|
@@ -105,14 +105,14 @@ const response = await client.articles.create(..., {
|
|
|
105
105
|
### Retries
|
|
106
106
|
|
|
107
107
|
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
108
|
-
as the request is deemed
|
|
108
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
109
109
|
retry limit (default: 2).
|
|
110
110
|
|
|
111
|
-
A request is deemed
|
|
111
|
+
A request is deemed retryable when any of the following HTTP status codes is returned:
|
|
112
112
|
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
113
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
114
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
115
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
|
116
116
|
|
|
117
117
|
Use the `maxRetries` request option to configure this behavior.
|
|
118
118
|
|
|
@@ -149,12 +149,12 @@ controller.abort(); // aborts the request
|
|
|
149
149
|
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
|
|
150
150
|
runtimes:
|
|
151
151
|
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
152
|
+
- Node.js 18+
|
|
153
|
+
- Vercel
|
|
154
|
+
- Cloudflare Workers
|
|
155
|
+
- Deno v1.25+
|
|
156
|
+
- Bun 1.0+
|
|
157
|
+
- React Native
|
|
158
158
|
|
|
159
159
|
### Customizing Fetch Client
|
|
160
160
|
|
|
@@ -170,6 +170,16 @@ const client = new IntercomClient({
|
|
|
170
170
|
});
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
+
## Contributing
|
|
174
|
+
|
|
175
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
176
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
177
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
178
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
179
|
+
an issue first to discuss with us!
|
|
180
|
+
|
|
181
|
+
On the other hand, contributions to the README are always very welcome!
|
|
182
|
+
|
|
173
183
|
## Request Options
|
|
174
184
|
|
|
175
185
|
This client library also supports passing in [`request` options](https://github.com/axios/axios#request-config):
|
|
@@ -191,13 +201,3 @@ client.useRequestOpts({
|
|
|
191
201
|
baseURL: "https://api.eu.intercom.io",
|
|
192
202
|
});
|
|
193
203
|
```
|
|
194
|
-
|
|
195
|
-
## Contributing
|
|
196
|
-
|
|
197
|
-
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
198
|
-
Additions made directly to this library would have to be moved over to our generation code,
|
|
199
|
-
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
200
|
-
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
201
|
-
an issue first to discuss with us!
|
|
202
|
-
|
|
203
|
-
On the other hand, contributions to the README are always very welcome!
|
|
@@ -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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.BadRequestError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../errors/index"));
|
|
@@ -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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.ForbiddenError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../errors/index"));
|
|
@@ -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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.NotFoundError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../errors/index"));
|
|
@@ -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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.UnauthorizedError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../errors/index"));
|
|
@@ -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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.UnprocessableEntityError = void 0;
|
|
30
40
|
const errors = __importStar(require("../../errors/index"));
|
|
@@ -7,6 +7,8 @@ import * as Intercom from "../../../index";
|
|
|
7
7
|
export declare namespace Admins {
|
|
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";
|
|
@@ -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) {
|
|
@@ -76,12 +86,12 @@ class Admins {
|
|
|
76
86
|
* await client.admins.identify()
|
|
77
87
|
*/
|
|
78
88
|
identify(requestOptions) {
|
|
79
|
-
var _a, _b, _c, _d, _e;
|
|
80
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
var _a, _b, _c, _d, _e, _f;
|
|
81
91
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
82
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
92
|
+
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, "me"),
|
|
83
93
|
method: "GET",
|
|
84
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
94
|
+
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),
|
|
85
95
|
contentType: "application/json",
|
|
86
96
|
requestType: "json",
|
|
87
97
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -129,13 +139,13 @@ class Admins {
|
|
|
129
139
|
* })
|
|
130
140
|
*/
|
|
131
141
|
away(request, requestOptions) {
|
|
132
|
-
var _a, _b, _c, _d, _e;
|
|
133
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
var _a, _b, _c, _d, _e, _f;
|
|
134
144
|
const { admin_id: adminId } = request, _body = __rest(request, ["admin_id"]);
|
|
135
145
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
136
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
146
|
+
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, `admins/${encodeURIComponent(adminId)}/away`),
|
|
137
147
|
method: "PUT",
|
|
138
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
148
|
+
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),
|
|
139
149
|
contentType: "application/json",
|
|
140
150
|
requestType: "json",
|
|
141
151
|
body: _body,
|
|
@@ -189,8 +199,8 @@ class Admins {
|
|
|
189
199
|
* })
|
|
190
200
|
*/
|
|
191
201
|
listAllActivityLogs(request, requestOptions) {
|
|
192
|
-
var _a, _b, _c, _d, _e;
|
|
193
202
|
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
+
var _a, _b, _c, _d, _e, _f;
|
|
194
204
|
const { created_at_after: createdAtAfter, created_at_before: createdAtBefore } = request;
|
|
195
205
|
const _queryParams = {};
|
|
196
206
|
_queryParams["created_at_after"] = createdAtAfter;
|
|
@@ -198,9 +208,9 @@ class Admins {
|
|
|
198
208
|
_queryParams["created_at_before"] = createdAtBefore;
|
|
199
209
|
}
|
|
200
210
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
201
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
211
|
+
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, "admins/activity_logs"),
|
|
202
212
|
method: "GET",
|
|
203
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
213
|
+
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),
|
|
204
214
|
contentType: "application/json",
|
|
205
215
|
queryParameters: _queryParams,
|
|
206
216
|
requestType: "json",
|
|
@@ -248,12 +258,12 @@ class Admins {
|
|
|
248
258
|
* await client.admins.list()
|
|
249
259
|
*/
|
|
250
260
|
list(requestOptions) {
|
|
251
|
-
var _a, _b, _c, _d, _e;
|
|
252
261
|
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
+
var _a, _b, _c, _d, _e, _f;
|
|
253
263
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
254
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
264
|
+
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, "admins"),
|
|
255
265
|
method: "GET",
|
|
256
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
266
|
+
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),
|
|
257
267
|
contentType: "application/json",
|
|
258
268
|
requestType: "json",
|
|
259
269
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -304,13 +314,13 @@ class Admins {
|
|
|
304
314
|
* })
|
|
305
315
|
*/
|
|
306
316
|
find(request, requestOptions) {
|
|
307
|
-
var _a, _b, _c, _d, _e;
|
|
308
317
|
return __awaiter(this, void 0, void 0, function* () {
|
|
318
|
+
var _a, _b, _c, _d, _e, _f;
|
|
309
319
|
const { admin_id: adminId } = request;
|
|
310
320
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
311
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
321
|
+
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, `admins/${encodeURIComponent(adminId)}`),
|
|
312
322
|
method: "GET",
|
|
313
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
323
|
+
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),
|
|
314
324
|
contentType: "application/json",
|
|
315
325
|
requestType: "json",
|
|
316
326
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -349,12 +359,12 @@ class Admins {
|
|
|
349
359
|
});
|
|
350
360
|
}
|
|
351
361
|
_getAuthorizationHeader() {
|
|
352
|
-
var _a;
|
|
353
362
|
return __awaiter(this, void 0, void 0, function* () {
|
|
363
|
+
var _a;
|
|
354
364
|
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"];
|
|
355
365
|
if (bearer == null) {
|
|
356
366
|
throw new errors.IntercomError({
|
|
357
|
-
message: "Please specify
|
|
367
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a INTERCOM_API_KEY environment variable",
|
|
358
368
|
});
|
|
359
369
|
}
|
|
360
370
|
return `Bearer ${bearer}`;
|
|
@@ -7,6 +7,8 @@ import * as Intercom from "../../../index";
|
|
|
7
7
|
export declare namespace Articles {
|
|
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";
|
|
@@ -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) {
|
|
@@ -77,10 +87,10 @@ class Articles {
|
|
|
77
87
|
* @example
|
|
78
88
|
* await client.articles.list()
|
|
79
89
|
*/
|
|
80
|
-
list(
|
|
81
|
-
return __awaiter(this,
|
|
90
|
+
list() {
|
|
91
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
82
92
|
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
var _a, _b, _c, _d, _e;
|
|
93
|
+
var _a, _b, _c, _d, _e, _f;
|
|
84
94
|
const { page, per_page: perPage } = request;
|
|
85
95
|
const _queryParams = {};
|
|
86
96
|
if (page != null) {
|
|
@@ -90,9 +100,9 @@ class Articles {
|
|
|
90
100
|
_queryParams["per_page"] = perPage.toString();
|
|
91
101
|
}
|
|
92
102
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
93
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
103
|
+
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, "articles"),
|
|
94
104
|
method: "GET",
|
|
95
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
105
|
+
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),
|
|
96
106
|
contentType: "application/json",
|
|
97
107
|
queryParameters: _queryParams,
|
|
98
108
|
requestType: "json",
|
|
@@ -180,12 +190,12 @@ class Articles {
|
|
|
180
190
|
* })
|
|
181
191
|
*/
|
|
182
192
|
create(request, requestOptions) {
|
|
183
|
-
var _a, _b, _c, _d, _e;
|
|
184
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
var _a, _b, _c, _d, _e, _f;
|
|
185
195
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
186
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
196
|
+
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, "articles"),
|
|
187
197
|
method: "POST",
|
|
188
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
198
|
+
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),
|
|
189
199
|
contentType: "application/json",
|
|
190
200
|
requestType: "json",
|
|
191
201
|
body: request,
|
|
@@ -239,13 +249,13 @@ class Articles {
|
|
|
239
249
|
* })
|
|
240
250
|
*/
|
|
241
251
|
find(request, requestOptions) {
|
|
242
|
-
var _a, _b, _c, _d, _e;
|
|
243
252
|
return __awaiter(this, void 0, void 0, function* () {
|
|
253
|
+
var _a, _b, _c, _d, _e, _f;
|
|
244
254
|
const { article_id: articleId } = request;
|
|
245
255
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
246
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
256
|
+
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, `articles/${encodeURIComponent(articleId)}`),
|
|
247
257
|
method: "GET",
|
|
248
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
258
|
+
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),
|
|
249
259
|
contentType: "application/json",
|
|
250
260
|
requestType: "json",
|
|
251
261
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -300,13 +310,13 @@ class Articles {
|
|
|
300
310
|
* })
|
|
301
311
|
*/
|
|
302
312
|
update(request, requestOptions) {
|
|
303
|
-
var _a, _b, _c, _d, _e;
|
|
304
313
|
return __awaiter(this, void 0, void 0, function* () {
|
|
314
|
+
var _a, _b, _c, _d, _e, _f;
|
|
305
315
|
const { article_id: articleId } = request, _body = __rest(request, ["article_id"]);
|
|
306
316
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
307
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
317
|
+
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, `articles/${encodeURIComponent(articleId)}`),
|
|
308
318
|
method: "PUT",
|
|
309
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
319
|
+
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),
|
|
310
320
|
contentType: "application/json",
|
|
311
321
|
requestType: "json",
|
|
312
322
|
body: _body,
|
|
@@ -360,13 +370,13 @@ class Articles {
|
|
|
360
370
|
* })
|
|
361
371
|
*/
|
|
362
372
|
delete(request, requestOptions) {
|
|
363
|
-
var _a, _b, _c, _d, _e;
|
|
364
373
|
return __awaiter(this, void 0, void 0, function* () {
|
|
374
|
+
var _a, _b, _c, _d, _e, _f;
|
|
365
375
|
const { article_id: articleId } = request;
|
|
366
376
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
367
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
377
|
+
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, `articles/${encodeURIComponent(articleId)}`),
|
|
368
378
|
method: "DELETE",
|
|
369
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
379
|
+
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),
|
|
370
380
|
contentType: "application/json",
|
|
371
381
|
requestType: "json",
|
|
372
382
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 20000,
|
|
@@ -418,9 +428,9 @@ class Articles {
|
|
|
418
428
|
* state: "published"
|
|
419
429
|
* })
|
|
420
430
|
*/
|
|
421
|
-
search(
|
|
422
|
-
|
|
423
|
-
|
|
431
|
+
search() {
|
|
432
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
433
|
+
var _a, _b, _c, _d, _e, _f;
|
|
424
434
|
const { phrase, state, help_center_id: helpCenterId, highlight } = request;
|
|
425
435
|
const _queryParams = {};
|
|
426
436
|
if (phrase != null) {
|
|
@@ -436,9 +446,9 @@ class Articles {
|
|
|
436
446
|
_queryParams["highlight"] = highlight.toString();
|
|
437
447
|
}
|
|
438
448
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
439
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
449
|
+
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, "articles/search"),
|
|
440
450
|
method: "GET",
|
|
441
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "intercom-client", "X-Fern-SDK-Version": "
|
|
451
|
+
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),
|
|
442
452
|
contentType: "application/json",
|
|
443
453
|
queryParameters: _queryParams,
|
|
444
454
|
requestType: "json",
|
|
@@ -476,12 +486,12 @@ class Articles {
|
|
|
476
486
|
});
|
|
477
487
|
}
|
|
478
488
|
_getAuthorizationHeader() {
|
|
479
|
-
var _a;
|
|
480
489
|
return __awaiter(this, void 0, void 0, function* () {
|
|
490
|
+
var _a;
|
|
481
491
|
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"];
|
|
482
492
|
if (bearer == null) {
|
|
483
493
|
throw new errors.IntercomError({
|
|
484
|
-
message: "Please specify
|
|
494
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a INTERCOM_API_KEY environment variable",
|
|
485
495
|
});
|
|
486
496
|
}
|
|
487
497
|
return `Bearer ${bearer}`;
|
|
@@ -14,4 +14,4 @@ var CreateArticleRequest;
|
|
|
14
14
|
Collection: "collection",
|
|
15
15
|
Section: "section",
|
|
16
16
|
};
|
|
17
|
-
})(CreateArticleRequest
|
|
17
|
+
})(CreateArticleRequest || (exports.CreateArticleRequest = CreateArticleRequest = {}));
|
|
@@ -14,4 +14,4 @@ var UpdateArticleRequest;
|
|
|
14
14
|
Collection: "collection",
|
|
15
15
|
Section: "section",
|
|
16
16
|
};
|
|
17
|
-
})(UpdateArticleRequest
|
|
17
|
+
})(UpdateArticleRequest || (exports.UpdateArticleRequest = UpdateArticleRequest = {}));
|