From 03f71a29f2cb968e7eb218953fb4d62ac9f12711 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 17 Jul 2024 10:49:39 +0000 Subject: [PATCH] feat(api): update via SDK Studio --- .github/workflows/ci.yml | 1 + README.md | 10 +------ src/index.ts | 1 - src/resources/conversations/conversations.ts | 8 +++--- .../admins/activity-logs.test.ts | 6 ++--- tests/api-resources/articles.test.ts | 2 +- .../api-resources/companies/companies.test.ts | 12 ++++----- .../api-resources/contacts/companies.test.ts | 10 +++---- tests/api-resources/contacts/contacts.test.ts | 16 +++++------- tests/api-resources/contacts/notes.test.ts | 2 +- .../contacts/subscriptions.test.ts | 4 +-- tests/api-resources/contacts/tags.test.ts | 4 +-- .../conversations/conversations.test.ts | 8 +++--- .../conversations/customers.test.ts | 6 ++--- .../api-resources/conversations/reply.test.ts | 4 +-- .../api-resources/conversations/tags.test.ts | 12 ++++----- tests/api-resources/data-events.test.ts | 6 ++--- .../download/content/data.test.ts | 6 ++--- .../api-resources/export/content/data.test.ts | 6 ++--- tests/api-resources/export/export.test.ts | 14 ++++++---- .../ticket-types/attributes.test.ts | 12 ++++----- .../ticket-types/ticket-types.test.ts | 16 ++++++------ tests/api-resources/tickets/tags.test.ts | 14 +++++----- tests/api-resources/tickets/tickets.test.ts | 26 +++++++++---------- tests/api-resources/visitors.test.ts | 4 +-- 25 files changed, 102 insertions(+), 108 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e925df62..5301319b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: pull_request: branches: - v3 + - next jobs: lint: diff --git a/README.md b/README.md index da63bf4d..569e83de 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This library provides convenient access to the Intercom REST API from server-side TypeScript or JavaScript. -The REST API documentation can be found [on developers.intercom.com](https://developers.intercom.com). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [developers.intercom.com](https://developers.intercom.com). The full API of this library can be found in [api.md](api.md). It is generated with [Stainless](https://www.stainlessapi.com/). @@ -281,14 +281,6 @@ TypeScript >= 4.5 is supported. The following runtimes are supported: -- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. -- Deno v1.28.0 or higher, using `import Intercom from "npm:intercom-client"`. -- Bun 1.0 or later. -- Cloudflare Workers. -- Vercel Edge Runtime. -- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time). -- Nitro v2.6 or greater. - Note that React Native is not supported at this time. If you are interested in other runtime environments, please open or upvote an issue on GitHub. diff --git a/src/index.ts b/src/index.ts index f3185ba4..2e716495 100644 --- a/src/index.ts +++ b/src/index.ts @@ -289,7 +289,6 @@ export namespace Intercom { export import Conversations = API.Conversations; export import ConversationList = API.ConversationList; export import ConversationListResponse = API.ConversationListResponse; - export import ConversationListResponsesCursorPagination = API.ConversationListResponsesCursorPagination; export import ConversationCreateParams = API.ConversationCreateParams; export import ConversationRetrieveParams = API.ConversationRetrieveParams; export import ConversationUpdateParams = API.ConversationUpdateParams; diff --git a/src/resources/conversations/conversations.ts b/src/resources/conversations/conversations.ts index f840c4f3..8473d24a 100644 --- a/src/resources/conversations/conversations.ts +++ b/src/resources/conversations/conversations.ts @@ -5,6 +5,7 @@ import { isRequestOptions } from '../../core'; import * as Core from '../../core'; import * as ConversationsAPI from './conversations'; import * as Shared from '../shared'; +import { ConversationListResponsesCursorPagination } from '../shared'; import * as CustomersAPI from './customers'; import * as PartsAPI from './parts'; import * as ReplyAPI from './reply'; @@ -12,7 +13,7 @@ import * as RunAssignmentRulesAPI from './run-assignment-rules'; import * as TagsAPI from './tags'; import * as NewsItemsAPI from '../news/news-items'; import * as NewsfeedsAPI from '../news/newsfeeds/newsfeeds'; -import { CursorPagination, type CursorPaginationParams } from '../../pagination'; +import { type CursorPaginationParams } from '../../pagination'; export class Conversations extends APIResource { tags: TagsAPI.Tags = new TagsAPI.Tags(this._client); @@ -338,8 +339,6 @@ export class Conversations extends APIResource { } } -export class ConversationListResponsesCursorPagination extends CursorPagination {} - /** * Conversations are how you can communicate with users in Intercom. They are * created when a contact replies to an outbound message, or when one admin @@ -728,7 +727,6 @@ export interface ConversationSearchParams { export namespace Conversations { export import ConversationList = ConversationsAPI.ConversationList; export import ConversationListResponse = ConversationsAPI.ConversationListResponse; - export import ConversationListResponsesCursorPagination = ConversationsAPI.ConversationListResponsesCursorPagination; export import ConversationCreateParams = ConversationsAPI.ConversationCreateParams; export import ConversationRetrieveParams = ConversationsAPI.ConversationRetrieveParams; export import ConversationUpdateParams = ConversationsAPI.ConversationUpdateParams; @@ -749,3 +747,5 @@ export namespace Conversations { export import CustomerCreateParams = CustomersAPI.CustomerCreateParams; export import CustomerDeleteParams = CustomersAPI.CustomerDeleteParams; } + +export { ConversationListResponsesCursorPagination }; diff --git a/tests/api-resources/admins/activity-logs.test.ts b/tests/api-resources/admins/activity-logs.test.ts index 4388ef2a..e2e84223 100644 --- a/tests/api-resources/admins/activity-logs.test.ts +++ b/tests/api-resources/admins/activity-logs.test.ts @@ -10,7 +10,7 @@ const intercom = new Intercom({ describe('resource activityLogs', () => { test('list: only required params', async () => { - const responsePromise = intercom.admins.activityLogs.list({ created_at_after: 'string' }); + const responsePromise = intercom.admins.activityLogs.list({ created_at_after: 'created_at_after' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,8 +22,8 @@ describe('resource activityLogs', () => { test('list: required and optional params', async () => { const response = await intercom.admins.activityLogs.list({ - created_at_after: 'string', - created_at_before: 'string', + created_at_after: 'created_at_after', + created_at_before: 'created_at_before', 'Intercom-Version': '2.11', }); }); diff --git a/tests/api-resources/articles.test.ts b/tests/api-resources/articles.test.ts index 8b51fcbe..2b47337a 100644 --- a/tests/api-resources/articles.test.ts +++ b/tests/api-resources/articles.test.ts @@ -991,7 +991,7 @@ describe('resource articles', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.articles.search( - { help_center_id: 0, highlight: true, phrase: 'string', state: 'string', 'Intercom-Version': '2.11' }, + { help_center_id: 0, highlight: true, phrase: 'phrase', state: 'state', 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Intercom.NotFoundError); diff --git a/tests/api-resources/companies/companies.test.ts b/tests/api-resources/companies/companies.test.ts index dc275cf9..b8e259df 100644 --- a/tests/api-resources/companies/companies.test.ts +++ b/tests/api-resources/companies/companies.test.ts @@ -130,7 +130,7 @@ describe('resource companies', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.companies.list( - { order: 'string', page: 0, per_page: 0, 'Intercom-Version': '2.11' }, + { order: 'order', page: 0, per_page: 0, 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Intercom.NotFoundError); @@ -188,12 +188,12 @@ describe('resource companies', () => { await expect( intercom.companies.retrieveList( { - company_id: 'string', - name: 'string', + company_id: 'company_id', + name: 'name', page: 0, per_page: 0, - segment_id: 'string', - tag_id: 'string', + segment_id: 'segment_id', + tag_id: 'tag_id', 'Intercom-Version': '2.11', }, { path: '/_stainless_unknown_path' }, @@ -223,7 +223,7 @@ describe('resource companies', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.companies.scroll( - { scroll_param: 'string', 'Intercom-Version': '2.11' }, + { scroll_param: 'scroll_param', 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Intercom.NotFoundError); diff --git a/tests/api-resources/contacts/companies.test.ts b/tests/api-resources/contacts/companies.test.ts index 731132a6..4f2254cc 100644 --- a/tests/api-resources/contacts/companies.test.ts +++ b/tests/api-resources/contacts/companies.test.ts @@ -10,7 +10,7 @@ const intercom = new Intercom({ describe('resource companies', () => { test('create: only required params', async () => { - const responsePromise = intercom.contacts.companies.create('string', { + const responsePromise = intercom.contacts.companies.create('contact_id', { company_id: '6657add46abd0167d9419cd2', }); const rawResponse = await responsePromise.asResponse(); @@ -23,14 +23,14 @@ describe('resource companies', () => { }); test('create: required and optional params', async () => { - const response = await intercom.contacts.companies.create('string', { + const response = await intercom.contacts.companies.create('contact_id', { company_id: '6657add46abd0167d9419cd2', 'Intercom-Version': '2.11', }); }); test('list', async () => { - const responsePromise = intercom.contacts.companies.list('string'); + const responsePromise = intercom.contacts.companies.list('contact_id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -43,7 +43,7 @@ describe('resource companies', () => { test('list: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - intercom.contacts.companies.list('string', { path: '/_stainless_unknown_path' }), + intercom.contacts.companies.list('contact_id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Intercom.NotFoundError); }); @@ -51,7 +51,7 @@ describe('resource companies', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.contacts.companies.list( - 'string', + 'contact_id', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/contacts/contacts.test.ts b/tests/api-resources/contacts/contacts.test.ts index a69df9a4..9a0a582f 100644 --- a/tests/api-resources/contacts/contacts.test.ts +++ b/tests/api-resources/contacts/contacts.test.ts @@ -80,12 +80,12 @@ describe('resource contacts', () => { avatar: 'https://www.example.com/avatar_image.jpg', custom_attributes: {}, email: 'jdoe@example.com', - external_id: 'string', + external_id: 'external_id', last_seen_at: 1571672154, name: 'John Doe', owner_id: 123, phone: '+353871234567', - role: 'string', + role: 'role', signed_up_at: 1571672154, unsubscribed_from_emails: true, 'Intercom-Version': '2.11', @@ -121,7 +121,7 @@ describe('resource contacts', () => { }); test('delete', async () => { - const responsePromise = intercom.contacts.delete('string'); + const responsePromise = intercom.contacts.delete('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -133,7 +133,7 @@ describe('resource contacts', () => { test('delete: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(intercom.contacts.delete('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(intercom.contacts.delete('id', { path: '/_stainless_unknown_path' })).rejects.toThrow( Intercom.NotFoundError, ); }); @@ -141,11 +141,7 @@ describe('resource contacts', () => { test('delete: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - intercom.contacts.delete( - 'string', - { 'Intercom-Version': '2.11' }, - { path: '/_stainless_unknown_path' }, - ), + intercom.contacts.delete('id', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Intercom.NotFoundError); }); @@ -219,7 +215,7 @@ describe('resource contacts', () => { test('search: required and optional params', async () => { const response = await intercom.contacts.search({ - query: { field: 'created_at', operator: '=', value: 'string' }, + query: { field: 'created_at', operator: '=', value: 'value' }, pagination: { per_page: 5, starting_after: 'your-cursor-from-response' }, 'Intercom-Version': '2.11', }); diff --git a/tests/api-resources/contacts/notes.test.ts b/tests/api-resources/contacts/notes.test.ts index 54ab3009..9cdac8c2 100644 --- a/tests/api-resources/contacts/notes.test.ts +++ b/tests/api-resources/contacts/notes.test.ts @@ -23,7 +23,7 @@ describe('resource notes', () => { test('create: required and optional params', async () => { const response = await intercom.contacts.notes.create(0, { body: 'Hello', - admin_id: 'string', + admin_id: 'admin_id', contact_id: '6657adde6abd0167d9419d00', 'Intercom-Version': '2.11', }); diff --git a/tests/api-resources/contacts/subscriptions.test.ts b/tests/api-resources/contacts/subscriptions.test.ts index 060b989b..40e58e3d 100644 --- a/tests/api-resources/contacts/subscriptions.test.ts +++ b/tests/api-resources/contacts/subscriptions.test.ts @@ -11,7 +11,7 @@ const intercom = new Intercom({ describe('resource subscriptions', () => { test('create: only required params', async () => { const responsePromise = intercom.contacts.subscriptions.create('63a07ddf05a32042dffac965', { - id: 'string', + id: 'id', consent_type: 'opt_in', }); const rawResponse = await responsePromise.asResponse(); @@ -25,7 +25,7 @@ describe('resource subscriptions', () => { test('create: required and optional params', async () => { const response = await intercom.contacts.subscriptions.create('63a07ddf05a32042dffac965', { - id: 'string', + id: 'id', consent_type: 'opt_in', 'Intercom-Version': '2.11', }); diff --git a/tests/api-resources/contacts/tags.test.ts b/tests/api-resources/contacts/tags.test.ts index b7e48a28..38afc850 100644 --- a/tests/api-resources/contacts/tags.test.ts +++ b/tests/api-resources/contacts/tags.test.ts @@ -10,7 +10,7 @@ const intercom = new Intercom({ describe('resource tags', () => { test('create: only required params', async () => { - const responsePromise = intercom.contacts.tags.create('63a07ddf05a32042dffac965', { id: 'string' }); + const responsePromise = intercom.contacts.tags.create('63a07ddf05a32042dffac965', { id: 'id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,7 +22,7 @@ describe('resource tags', () => { test('create: required and optional params', async () => { const response = await intercom.contacts.tags.create('63a07ddf05a32042dffac965', { - id: 'string', + id: 'id', 'Intercom-Version': '2.11', }); }); diff --git a/tests/api-resources/conversations/conversations.test.ts b/tests/api-resources/conversations/conversations.test.ts index 0b569cc5..987469b9 100644 --- a/tests/api-resources/conversations/conversations.test.ts +++ b/tests/api-resources/conversations/conversations.test.ts @@ -54,7 +54,7 @@ describe('resource conversations', () => { await expect( intercom.conversations.retrieve( 123, - { display_as: 'string', 'Intercom-Version': '2.11' }, + { display_as: 'display_as', 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Intercom.NotFoundError); @@ -84,7 +84,7 @@ describe('resource conversations', () => { intercom.conversations.update( 123, { - display_as: 'string', + display_as: 'display_as', custom_attributes: { issue_type: 'Billing', priority: 'High' }, read: true, 'Intercom-Version': '2.11', @@ -116,7 +116,7 @@ describe('resource conversations', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.conversations.list( - { per_page: 0, starting_after: 'string', 'Intercom-Version': '2.11' }, + { per_page: 0, starting_after: 'starting_after', 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Intercom.NotFoundError); @@ -178,7 +178,7 @@ describe('resource conversations', () => { test('search: required and optional params', async () => { const response = await intercom.conversations.search({ - query: { field: 'created_at', operator: '=', value: 'string' }, + query: { field: 'created_at', operator: '=', value: 'value' }, pagination: { per_page: 5, starting_after: 'your-cursor-from-response' }, 'Intercom-Version': '2.11', }); diff --git a/tests/api-resources/conversations/customers.test.ts b/tests/api-resources/conversations/customers.test.ts index c75cf270..3afa6091 100644 --- a/tests/api-resources/conversations/customers.test.ts +++ b/tests/api-resources/conversations/customers.test.ts @@ -33,7 +33,7 @@ describe('resource customers', () => { intercom.conversations.customers.create( '123', { - admin_id: 'string', + admin_id: 'admin_id', customer: { intercom_user_id: '6657ae626abd0167d9419d6f', customer: { intercom_user_id: '6329bd9ffe4e2e91dac76188' }, @@ -46,7 +46,7 @@ describe('resource customers', () => { }); test('delete: only required params', async () => { - const responsePromise = intercom.conversations.customers.delete('123', '123', { admin_id: 'string' }); + const responsePromise = intercom.conversations.customers.delete('123', '123', { admin_id: 'admin_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -58,7 +58,7 @@ describe('resource customers', () => { test('delete: required and optional params', async () => { const response = await intercom.conversations.customers.delete('123', '123', { - admin_id: 'string', + admin_id: 'admin_id', 'Intercom-Version': '2.11', }); }); diff --git a/tests/api-resources/conversations/reply.test.ts b/tests/api-resources/conversations/reply.test.ts index b29a06d0..146a4612 100644 --- a/tests/api-resources/conversations/reply.test.ts +++ b/tests/api-resources/conversations/reply.test.ts @@ -11,7 +11,7 @@ const intercom = new Intercom({ describe('resource reply', () => { test('create: only required params', async () => { const responsePromise = intercom.conversations.reply.create('123 or "last"', { - body: 'string', + body: 'body', message_type: 'comment', type: 'user', }); @@ -26,7 +26,7 @@ describe('resource reply', () => { test('create: required and optional params', async () => { const response = await intercom.conversations.reply.create('123 or "last"', { - body: 'string', + body: 'body', message_type: 'comment', type: 'user', attachment_urls: ['https://example.com', 'https://example.com', 'https://example.com'], diff --git a/tests/api-resources/conversations/tags.test.ts b/tests/api-resources/conversations/tags.test.ts index 03619a1a..255d7774 100644 --- a/tests/api-resources/conversations/tags.test.ts +++ b/tests/api-resources/conversations/tags.test.ts @@ -11,8 +11,8 @@ const intercom = new Intercom({ describe('resource tags', () => { test('create: only required params', async () => { const responsePromise = intercom.conversations.tags.create('64619700005694', { - id: 'string', - admin_id: 'string', + id: 'id', + admin_id: 'admin_id', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -25,15 +25,15 @@ describe('resource tags', () => { test('create: required and optional params', async () => { const response = await intercom.conversations.tags.create('64619700005694', { - id: 'string', - admin_id: 'string', + id: 'id', + admin_id: 'admin_id', 'Intercom-Version': '2.11', }); }); test('delete: only required params', async () => { const responsePromise = intercom.conversations.tags.delete('64619700005694', '7522907', { - admin_id: 'string', + admin_id: 'admin_id', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -46,7 +46,7 @@ describe('resource tags', () => { test('delete: required and optional params', async () => { const response = await intercom.conversations.tags.delete('64619700005694', '7522907', { - admin_id: 'string', + admin_id: 'admin_id', 'Intercom-Version': '2.11', }); }); diff --git a/tests/api-resources/data-events.test.ts b/tests/api-resources/data-events.test.ts index 92bc7982..b3a5cb01 100644 --- a/tests/api-resources/data-events.test.ts +++ b/tests/api-resources/data-events.test.ts @@ -25,7 +25,7 @@ describe('resource dataEvents', () => { }); test('list: only required params', async () => { - const responsePromise = intercom.dataEvents.list({ filter: { user_id: 'string' }, type: 'string' }); + const responsePromise = intercom.dataEvents.list({ filter: { user_id: 'user_id' }, type: 'type' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -37,8 +37,8 @@ describe('resource dataEvents', () => { test('list: required and optional params', async () => { const response = await intercom.dataEvents.list({ - filter: { user_id: 'string' }, - type: 'string', + filter: { user_id: 'user_id' }, + type: 'type', summary: true, 'Intercom-Version': '2.11', }); diff --git a/tests/api-resources/download/content/data.test.ts b/tests/api-resources/download/content/data.test.ts index cca4caea..0b5b087b 100644 --- a/tests/api-resources/download/content/data.test.ts +++ b/tests/api-resources/download/content/data.test.ts @@ -10,7 +10,7 @@ const intercom = new Intercom({ describe('resource data', () => { test('retrieve', async () => { - const responsePromise = intercom.download.content.data.retrieve('string'); + const responsePromise = intercom.download.content.data.retrieve('job_identifier'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,7 +23,7 @@ describe('resource data', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - intercom.download.content.data.retrieve('string', { path: '/_stainless_unknown_path' }), + intercom.download.content.data.retrieve('job_identifier', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Intercom.NotFoundError); }); @@ -31,7 +31,7 @@ describe('resource data', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.download.content.data.retrieve( - 'string', + 'job_identifier', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/export/content/data.test.ts b/tests/api-resources/export/content/data.test.ts index 1b836b99..738f9371 100644 --- a/tests/api-resources/export/content/data.test.ts +++ b/tests/api-resources/export/content/data.test.ts @@ -10,7 +10,7 @@ const intercom = new Intercom({ describe('resource data', () => { test('retrieve', async () => { - const responsePromise = intercom.export.content.data.retrieve('string'); + const responsePromise = intercom.export.content.data.retrieve('job_identifier'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,7 +23,7 @@ describe('resource data', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - intercom.export.content.data.retrieve('string', { path: '/_stainless_unknown_path' }), + intercom.export.content.data.retrieve('job_identifier', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Intercom.NotFoundError); }); @@ -31,7 +31,7 @@ describe('resource data', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.export.content.data.retrieve( - 'string', + 'job_identifier', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }, ), diff --git a/tests/api-resources/export/export.test.ts b/tests/api-resources/export/export.test.ts index 8de803e9..6da63c2f 100644 --- a/tests/api-resources/export/export.test.ts +++ b/tests/api-resources/export/export.test.ts @@ -10,7 +10,7 @@ const intercom = new Intercom({ describe('resource export', () => { test('cancel', async () => { - const responsePromise = intercom.export.cancel('string'); + const responsePromise = intercom.export.cancel('job_identifier'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,15 +22,19 @@ describe('resource export', () => { test('cancel: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(intercom.export.cancel('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Intercom.NotFoundError, - ); + await expect( + intercom.export.cancel('job_identifier', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Intercom.NotFoundError); }); test('cancel: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - intercom.export.cancel('string', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }), + intercom.export.cancel( + 'job_identifier', + { 'Intercom-Version': '2.11' }, + { path: '/_stainless_unknown_path' }, + ), ).rejects.toThrow(Intercom.NotFoundError); }); }); diff --git a/tests/api-resources/ticket-types/attributes.test.ts b/tests/api-resources/ticket-types/attributes.test.ts index 687361dd..e6e52c08 100644 --- a/tests/api-resources/ticket-types/attributes.test.ts +++ b/tests/api-resources/ticket-types/attributes.test.ts @@ -10,7 +10,7 @@ const intercom = new Intercom({ describe('resource attributes', () => { test('create: only required params', async () => { - const responsePromise = intercom.ticketTypes.attributes.create('string', { + const responsePromise = intercom.ticketTypes.attributes.create('ticket_type_id', { data_type: 'string', description: 'Attribute Description', name: 'Attribute Title', @@ -25,7 +25,7 @@ describe('resource attributes', () => { }); test('create: required and optional params', async () => { - const response = await intercom.ticketTypes.attributes.create('string', { + const response = await intercom.ticketTypes.attributes.create('ticket_type_id', { data_type: 'string', description: 'Attribute Description', name: 'Attribute Title', @@ -41,7 +41,7 @@ describe('resource attributes', () => { }); test('update', async () => { - const responsePromise = intercom.ticketTypes.attributes.update('string', 'string'); + const responsePromise = intercom.ticketTypes.attributes.update('ticket_type_id', 'id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -54,7 +54,7 @@ describe('resource attributes', () => { test('update: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - intercom.ticketTypes.attributes.update('string', 'string', { path: '/_stainless_unknown_path' }), + intercom.ticketTypes.attributes.update('ticket_type_id', 'id', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Intercom.NotFoundError); }); @@ -62,8 +62,8 @@ describe('resource attributes', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.ticketTypes.attributes.update( - 'string', - 'string', + 'ticket_type_id', + 'id', { allow_multiple_values: false, archived: false, diff --git a/tests/api-resources/ticket-types/ticket-types.test.ts b/tests/api-resources/ticket-types/ticket-types.test.ts index 5cfabe54..df5bfdd3 100644 --- a/tests/api-resources/ticket-types/ticket-types.test.ts +++ b/tests/api-resources/ticket-types/ticket-types.test.ts @@ -32,7 +32,7 @@ describe('resource ticketTypes', () => { }); test('retrieve', async () => { - const responsePromise = intercom.ticketTypes.retrieve('string'); + const responsePromise = intercom.ticketTypes.retrieve('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -44,16 +44,16 @@ describe('resource ticketTypes', () => { test('retrieve: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - intercom.ticketTypes.retrieve('string', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Intercom.NotFoundError); + await expect(intercom.ticketTypes.retrieve('id', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Intercom.NotFoundError, + ); }); test('retrieve: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.ticketTypes.retrieve( - 'string', + 'id', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }, ), @@ -61,7 +61,7 @@ describe('resource ticketTypes', () => { }); test('update', async () => { - const responsePromise = intercom.ticketTypes.update('string'); + const responsePromise = intercom.ticketTypes.update('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -73,7 +73,7 @@ describe('resource ticketTypes', () => { test('update: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(intercom.ticketTypes.update('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(intercom.ticketTypes.update('id', { path: '/_stainless_unknown_path' })).rejects.toThrow( Intercom.NotFoundError, ); }); @@ -82,7 +82,7 @@ describe('resource ticketTypes', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.ticketTypes.update( - 'string', + 'id', { archived: false, category: 'Customer', diff --git a/tests/api-resources/tickets/tags.test.ts b/tests/api-resources/tickets/tags.test.ts index fe6e5e11..1cb6910b 100644 --- a/tests/api-resources/tickets/tags.test.ts +++ b/tests/api-resources/tickets/tags.test.ts @@ -11,8 +11,8 @@ const intercom = new Intercom({ describe('resource tags', () => { test('create: only required params', async () => { const responsePromise = intercom.tickets.tags.create('64619700005694', { - id: 'string', - admin_id: 'string', + id: 'id', + admin_id: 'admin_id', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -25,14 +25,16 @@ describe('resource tags', () => { test('create: required and optional params', async () => { const response = await intercom.tickets.tags.create('64619700005694', { - id: 'string', - admin_id: 'string', + id: 'id', + admin_id: 'admin_id', 'Intercom-Version': '2.11', }); }); test('remove: only required params', async () => { - const responsePromise = intercom.tickets.tags.remove('64619700005694', '7522907', { admin_id: 'string' }); + const responsePromise = intercom.tickets.tags.remove('64619700005694', '7522907', { + admin_id: 'admin_id', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -44,7 +46,7 @@ describe('resource tags', () => { test('remove: required and optional params', async () => { const response = await intercom.tickets.tags.remove('64619700005694', '7522907', { - admin_id: 'string', + admin_id: 'admin_id', 'Intercom-Version': '2.11', }); }); diff --git a/tests/api-resources/tickets/tickets.test.ts b/tests/api-resources/tickets/tickets.test.ts index c2125696..9b716fad 100644 --- a/tests/api-resources/tickets/tickets.test.ts +++ b/tests/api-resources/tickets/tickets.test.ts @@ -12,7 +12,7 @@ describe('resource tickets', () => { test('create: only required params', async () => { const responsePromise = intercom.tickets.create({ contacts: [{ id: '6657af026abd0167d9419def' }], - ticket_type_id: 'string', + ticket_type_id: 'ticket_type_id', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -26,7 +26,7 @@ describe('resource tickets', () => { test('create: required and optional params', async () => { const response = await intercom.tickets.create({ contacts: [{ id: '6657af026abd0167d9419def' }], - ticket_type_id: 'string', + ticket_type_id: 'ticket_type_id', company_id: '1234', created_at: 1590000000, ticket_attributes: { _default_title_: 'example', _default_description_: 'there is a problem' }, @@ -36,7 +36,7 @@ describe('resource tickets', () => { test('reply: only required params', async () => { const responsePromise = intercom.tickets.reply('123', { - body: 'string', + body: 'body', message_type: 'comment', type: 'user', }); @@ -51,7 +51,7 @@ describe('resource tickets', () => { test('reply: required and optional params', async () => { const response = await intercom.tickets.reply('123', { - body: 'string', + body: 'body', message_type: 'comment', type: 'user', attachment_urls: ['https://example.com', 'https://example.com', 'https://example.com'], @@ -61,7 +61,7 @@ describe('resource tickets', () => { }); test('retrieveById', async () => { - const responsePromise = intercom.tickets.retrieveById('string'); + const responsePromise = intercom.tickets.retrieveById('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -73,16 +73,16 @@ describe('resource tickets', () => { test('retrieveById: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - intercom.tickets.retrieveById('string', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Intercom.NotFoundError); + await expect(intercom.tickets.retrieveById('id', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Intercom.NotFoundError, + ); }); test('retrieveById: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.tickets.retrieveById( - 'string', + 'id', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }, ), @@ -102,14 +102,14 @@ describe('resource tickets', () => { test('search: required and optional params', async () => { const response = await intercom.tickets.search({ - query: { field: 'created_at', operator: '=', value: 'string' }, + query: { field: 'created_at', operator: '=', value: 'value' }, pagination: { per_page: 5, starting_after: 'your-cursor-from-response' }, 'Intercom-Version': '2.11', }); }); test('updateById', async () => { - const responsePromise = intercom.tickets.updateById('string'); + const responsePromise = intercom.tickets.updateById('id'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -121,7 +121,7 @@ describe('resource tickets', () => { test('updateById: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(intercom.tickets.updateById('string', { path: '/_stainless_unknown_path' })).rejects.toThrow( + await expect(intercom.tickets.updateById('id', { path: '/_stainless_unknown_path' })).rejects.toThrow( Intercom.NotFoundError, ); }); @@ -130,7 +130,7 @@ describe('resource tickets', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( intercom.tickets.updateById( - 'string', + 'id', { assignment: { admin_id: '991268839', assignee_id: '991268841' }, is_shared: true, diff --git a/tests/api-resources/visitors.test.ts b/tests/api-resources/visitors.test.ts index 0999a639..0c57fa61 100644 --- a/tests/api-resources/visitors.test.ts +++ b/tests/api-resources/visitors.test.ts @@ -10,7 +10,7 @@ const intercom = new Intercom({ describe('resource visitors', () => { test('retrieve: only required params', async () => { - const responsePromise = intercom.visitors.retrieve({ user_id: 'string' }); + const responsePromise = intercom.visitors.retrieve({ user_id: 'user_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,7 +21,7 @@ describe('resource visitors', () => { }); test('retrieve: required and optional params', async () => { - const response = await intercom.visitors.retrieve({ user_id: 'string', 'Intercom-Version': '2.11' }); + const response = await intercom.visitors.retrieve({ user_id: 'user_id', 'Intercom-Version': '2.11' }); }); test('update: only required params', async () => {