;
-
- /**
- * Cursor-based pagination is a technique used in the Intercom API to navigate
- * through large amounts of data. A "cursor" or pointer is used to keep track of
- * the current position in the result set, allowing the API to return the data in
- * small chunks or "pages" as needed.
- */
- pages?: CursorPages | null;
-
- /**
- * A count of the total number of objects.
- */
- total_count?: number;
-
- /**
- * The type of object
- */
- type?: 'list' | 'conversation.list';
-}
-
/**
* The file attached to a part
*/
diff --git a/src/version.ts b/src/version.ts
index 7057947b..040a9049 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const VERSION = '6.0.0-beta.1'; // x-release-please-version
+export const VERSION = '6.0.0-beta.2'; // x-release-please-version
diff --git a/tests/api-resources/admins/activity-logs.test.ts b/tests/api-resources/admins/activity-logs.test.ts
index e2e84223..3a4c4a36 100644
--- a/tests/api-resources/admins/activity-logs.test.ts
+++ b/tests/api-resources/admins/activity-logs.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource activityLogs', () => {
test('list: only required params', async () => {
- const responsePromise = intercom.admins.activityLogs.list({ created_at_after: 'created_at_after' });
+ const responsePromise = client.admins.activityLogs.list({ created_at_after: 'created_at_after' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -21,7 +21,7 @@ describe('resource activityLogs', () => {
});
test('list: required and optional params', async () => {
- const response = await intercom.admins.activityLogs.list({
+ const response = await client.admins.activityLogs.list({
created_at_after: 'created_at_after',
created_at_before: 'created_at_before',
'Intercom-Version': '2.11',
diff --git a/tests/api-resources/admins/admins.test.ts b/tests/api-resources/admins/admins.test.ts
index 56f307c5..43e3105a 100644
--- a/tests/api-resources/admins/admins.test.ts
+++ b/tests/api-resources/admins/admins.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource admins', () => {
test('retrieve', async () => {
- const responsePromise = intercom.admins.retrieve(123);
+ const responsePromise = client.admins.retrieve(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -22,7 +22,7 @@ describe('resource admins', () => {
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.admins.retrieve(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.admins.retrieve(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -30,12 +30,12 @@ describe('resource admins', () => {
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.admins.retrieve(123, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.admins.retrieve(123, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('list', async () => {
- const responsePromise = intercom.admins.list();
+ const responsePromise = client.admins.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -47,7 +47,7 @@ describe('resource admins', () => {
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.admins.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.admins.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -55,12 +55,12 @@ describe('resource admins', () => {
test('list: 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.admins.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.admins.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('setAway: only required params', async () => {
- const responsePromise = intercom.admins.setAway(0, { away_mode_enabled: true, away_mode_reassign: true });
+ const responsePromise = client.admins.setAway(0, { away_mode_enabled: true, away_mode_reassign: true });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -71,7 +71,7 @@ describe('resource admins', () => {
});
test('setAway: required and optional params', async () => {
- const response = await intercom.admins.setAway(0, {
+ const response = await client.admins.setAway(0, {
away_mode_enabled: true,
away_mode_reassign: true,
'Intercom-Version': '2.11',
diff --git a/tests/api-resources/articles.test.ts b/tests/api-resources/articles.test.ts
index 2b47337a..75a4dca2 100644
--- a/tests/api-resources/articles.test.ts
+++ b/tests/api-resources/articles.test.ts
@@ -3,17 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource articles', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.articles.create({
- author_id: 991268363,
- title: 'Thanks for everything',
- });
+ const responsePromise = client.articles.create({ author_id: 991268363, title: 'Thanks for everything' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -24,7 +21,7 @@ describe('resource articles', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.articles.create({
+ const response = await client.articles.create({
author_id: 991268363,
title: 'Thanks for everything',
body: 'Body of the Article',
@@ -447,7 +444,7 @@ describe('resource articles', () => {
});
test('retrieve', async () => {
- const responsePromise = intercom.articles.retrieve(123);
+ const responsePromise = client.articles.retrieve(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -459,7 +456,7 @@ describe('resource articles', () => {
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.articles.retrieve(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.articles.retrieve(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -467,12 +464,12 @@ describe('resource articles', () => {
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.articles.retrieve(123, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.articles.retrieve(123, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('update', async () => {
- const responsePromise = intercom.articles.update(123);
+ const responsePromise = client.articles.update(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -484,7 +481,7 @@ describe('resource articles', () => {
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.articles.update(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.articles.update(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -492,7 +489,7 @@ describe('resource articles', () => {
test('update: 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.articles.update(
+ client.articles.update(
123,
{
author_id: 1295,
@@ -920,7 +917,7 @@ describe('resource articles', () => {
});
test('list', async () => {
- const responsePromise = intercom.articles.list();
+ const responsePromise = client.articles.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -932,7 +929,7 @@ describe('resource articles', () => {
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.articles.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.articles.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -940,12 +937,12 @@ describe('resource articles', () => {
test('list: 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.articles.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.articles.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('remove', async () => {
- const responsePromise = intercom.articles.remove(123);
+ const responsePromise = client.articles.remove(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -957,7 +954,7 @@ describe('resource articles', () => {
test('remove: 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.articles.remove(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.articles.remove(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -965,12 +962,12 @@ describe('resource articles', () => {
test('remove: 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.articles.remove(123, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.articles.remove(123, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('search', async () => {
- const responsePromise = intercom.articles.search();
+ const responsePromise = client.articles.search();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -982,7 +979,7 @@ describe('resource articles', () => {
test('search: 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.articles.search({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.articles.search({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -990,7 +987,7 @@ describe('resource articles', () => {
test('search: 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.articles.search(
+ client.articles.search(
{ help_center_id: 0, highlight: true, phrase: 'phrase', state: 'state', 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
diff --git a/tests/api-resources/companies/companies.test.ts b/tests/api-resources/companies/companies.test.ts
index b8e259df..4ba4a25a 100644
--- a/tests/api-resources/companies/companies.test.ts
+++ b/tests/api-resources/companies/companies.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource companies', () => {
test('create', async () => {
- const responsePromise = intercom.companies.create();
+ const responsePromise = client.companies.create();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -22,7 +22,7 @@ describe('resource companies', () => {
test('create: 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.companies.create({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.companies.create({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -30,7 +30,7 @@ describe('resource companies', () => {
test('create: 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.companies.create(
+ client.companies.create(
{
company_id: 'company_remote_id',
custom_attributes: { paid_subscriber: 'string', monthly_spend: 'string', team_mates: 'string' },
@@ -49,7 +49,7 @@ describe('resource companies', () => {
});
test('retrieve', async () => {
- const responsePromise = intercom.companies.retrieve('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632');
+ const responsePromise = client.companies.retrieve('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -62,16 +62,14 @@ describe('resource companies', () => {
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.companies.retrieve('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632', {
- path: '/_stainless_unknown_path',
- }),
+ client.companies.retrieve('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632', { 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.companies.retrieve(
+ client.companies.retrieve(
'5f4d3c1c-7b1b-4d7d-a97e-6095715c6632',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -80,7 +78,7 @@ describe('resource companies', () => {
});
test('update', async () => {
- const responsePromise = intercom.companies.update('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632');
+ const responsePromise = client.companies.update('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -93,14 +91,14 @@ describe('resource companies', () => {
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.companies.update('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632', { path: '/_stainless_unknown_path' }),
+ client.companies.update('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('update: 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.companies.update(
+ client.companies.update(
'5f4d3c1c-7b1b-4d7d-a97e-6095715c6632',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -109,7 +107,7 @@ describe('resource companies', () => {
});
test('list', async () => {
- const responsePromise = intercom.companies.list();
+ const responsePromise = client.companies.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -121,7 +119,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.companies.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.companies.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -129,7 +127,7 @@ describe('resource companies', () => {
test('list: 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.companies.list(
+ client.companies.list(
{ order: 'order', page: 0, per_page: 0, 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
@@ -137,7 +135,7 @@ describe('resource companies', () => {
});
test('delete', async () => {
- const responsePromise = intercom.companies.delete('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632');
+ const responsePromise = client.companies.delete('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -150,14 +148,14 @@ describe('resource companies', () => {
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.companies.delete('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632', { path: '/_stainless_unknown_path' }),
+ client.companies.delete('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
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.companies.delete(
+ client.companies.delete(
'5f4d3c1c-7b1b-4d7d-a97e-6095715c6632',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -166,7 +164,7 @@ describe('resource companies', () => {
});
test('retrieveList', async () => {
- const responsePromise = intercom.companies.retrieveList();
+ const responsePromise = client.companies.retrieveList();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -178,7 +176,7 @@ describe('resource companies', () => {
test('retrieveList: 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.companies.retrieveList({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.companies.retrieveList({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -186,7 +184,7 @@ describe('resource companies', () => {
test('retrieveList: 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.companies.retrieveList(
+ client.companies.retrieveList(
{
company_id: 'company_id',
name: 'name',
@@ -202,7 +200,7 @@ describe('resource companies', () => {
});
test('scroll', async () => {
- const responsePromise = intercom.companies.scroll();
+ const responsePromise = client.companies.scroll();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -214,7 +212,7 @@ describe('resource companies', () => {
test('scroll: 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.companies.scroll({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.companies.scroll({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -222,7 +220,7 @@ describe('resource companies', () => {
test('scroll: 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.companies.scroll(
+ client.companies.scroll(
{ scroll_param: 'scroll_param', 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
diff --git a/tests/api-resources/companies/contacts.test.ts b/tests/api-resources/companies/contacts.test.ts
index d025797a..ddb61d76 100644
--- a/tests/api-resources/companies/contacts.test.ts
+++ b/tests/api-resources/companies/contacts.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource contacts', () => {
test('list', async () => {
- const responsePromise = intercom.companies.contacts.list('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632');
+ const responsePromise = client.companies.contacts.list('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -23,7 +23,7 @@ describe('resource contacts', () => {
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.companies.contacts.list('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632', {
+ client.companies.contacts.list('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632', {
path: '/_stainless_unknown_path',
}),
).rejects.toThrow(Intercom.NotFoundError);
@@ -32,7 +32,7 @@ describe('resource contacts', () => {
test('list: 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.companies.contacts.list(
+ client.companies.contacts.list(
'5f4d3c1c-7b1b-4d7d-a97e-6095715c6632',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
diff --git a/tests/api-resources/companies/segments.test.ts b/tests/api-resources/companies/segments.test.ts
index 91d5e9b5..611aeea7 100644
--- a/tests/api-resources/companies/segments.test.ts
+++ b/tests/api-resources/companies/segments.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource segments', () => {
test('list', async () => {
- const responsePromise = intercom.companies.segments.list('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632');
+ const responsePromise = client.companies.segments.list('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -23,7 +23,7 @@ describe('resource segments', () => {
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.companies.segments.list('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632', {
+ client.companies.segments.list('5f4d3c1c-7b1b-4d7d-a97e-6095715c6632', {
path: '/_stainless_unknown_path',
}),
).rejects.toThrow(Intercom.NotFoundError);
@@ -32,7 +32,7 @@ describe('resource segments', () => {
test('list: 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.companies.segments.list(
+ client.companies.segments.list(
'5f4d3c1c-7b1b-4d7d-a97e-6095715c6632',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
diff --git a/tests/api-resources/contacts/companies.test.ts b/tests/api-resources/contacts/companies.test.ts
index 4f2254cc..6e986d1a 100644
--- a/tests/api-resources/contacts/companies.test.ts
+++ b/tests/api-resources/contacts/companies.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource companies', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.contacts.companies.create('contact_id', {
+ const responsePromise = client.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('contact_id', {
+ const response = await client.contacts.companies.create('contact_id', {
company_id: '6657add46abd0167d9419cd2',
'Intercom-Version': '2.11',
});
});
test('list', async () => {
- const responsePromise = intercom.contacts.companies.list('contact_id');
+ const responsePromise = client.contacts.companies.list('63a07ddf05a32042dffac965');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -43,15 +43,15 @@ 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('contact_id', { path: '/_stainless_unknown_path' }),
+ client.contacts.companies.list('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('list: 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.companies.list(
- 'contact_id',
+ client.contacts.companies.list(
+ '63a07ddf05a32042dffac965',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
@@ -59,7 +59,7 @@ describe('resource companies', () => {
});
test('delete', async () => {
- const responsePromise = intercom.contacts.companies.delete(
+ const responsePromise = client.contacts.companies.delete(
'58a430d35458202d41b1e65b',
'58a430d35458202d41b1e65b',
);
@@ -75,7 +75,7 @@ describe('resource companies', () => {
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.companies.delete('58a430d35458202d41b1e65b', '58a430d35458202d41b1e65b', {
+ client.contacts.companies.delete('58a430d35458202d41b1e65b', '58a430d35458202d41b1e65b', {
path: '/_stainless_unknown_path',
}),
).rejects.toThrow(Intercom.NotFoundError);
@@ -84,7 +84,7 @@ describe('resource companies', () => {
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.companies.delete(
+ client.contacts.companies.delete(
'58a430d35458202d41b1e65b',
'58a430d35458202d41b1e65b',
{ 'Intercom-Version': '2.11' },
diff --git a/tests/api-resources/contacts/contacts.test.ts b/tests/api-resources/contacts/contacts.test.ts
index 9a0a582f..382d5007 100644
--- a/tests/api-resources/contacts/contacts.test.ts
+++ b/tests/api-resources/contacts/contacts.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource contacts', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.contacts.create({ body: {} });
+ const responsePromise = client.contacts.create({ body: {} });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -21,11 +21,11 @@ describe('resource contacts', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.contacts.create({ body: {}, 'Intercom-Version': '2.11' });
+ const response = await client.contacts.create({ body: {}, 'Intercom-Version': '2.11' });
});
test('retrieve', async () => {
- const responsePromise = intercom.contacts.retrieve('63a07ddf05a32042dffac965');
+ const responsePromise = client.contacts.retrieve('63a07ddf05a32042dffac965');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -38,14 +38,14 @@ describe('resource contacts', () => {
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.contacts.retrieve('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
+ client.contacts.retrieve('63a07ddf05a32042dffac965', { 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.contacts.retrieve(
+ client.contacts.retrieve(
'63a07ddf05a32042dffac965',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -54,7 +54,7 @@ describe('resource contacts', () => {
});
test('update', async () => {
- const responsePromise = intercom.contacts.update('63a07ddf05a32042dffac965');
+ const responsePromise = client.contacts.update('63a07ddf05a32042dffac965');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -67,14 +67,14 @@ describe('resource contacts', () => {
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.contacts.update('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
+ client.contacts.update('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('update: 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.update(
+ client.contacts.update(
'63a07ddf05a32042dffac965',
{
avatar: 'https://www.example.com/avatar_image.jpg',
@@ -96,7 +96,7 @@ describe('resource contacts', () => {
});
test('list', async () => {
- const responsePromise = intercom.contacts.list();
+ const responsePromise = client.contacts.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -108,7 +108,7 @@ describe('resource contacts', () => {
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.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.contacts.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -116,12 +116,12 @@ describe('resource contacts', () => {
test('list: 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.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.contacts.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('delete', async () => {
- const responsePromise = intercom.contacts.delete('id');
+ const responsePromise = client.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('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.contacts.delete('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -141,12 +141,12 @@ 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('id', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.contacts.delete('id', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('archive', async () => {
- const responsePromise = intercom.contacts.archive('63a07ddf05a32042dffac965');
+ const responsePromise = client.contacts.archive('63a07ddf05a32042dffac965');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -159,14 +159,14 @@ describe('resource contacts', () => {
test('archive: 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.archive('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
+ client.contacts.archive('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('archive: 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.archive(
+ client.contacts.archive(
'63a07ddf05a32042dffac965',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -175,7 +175,7 @@ describe('resource contacts', () => {
});
test('merge', async () => {
- const responsePromise = intercom.contacts.merge();
+ const responsePromise = client.contacts.merge();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -187,7 +187,7 @@ describe('resource contacts', () => {
test('merge: 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.merge({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.contacts.merge({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -195,7 +195,7 @@ describe('resource contacts', () => {
test('merge: 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.merge(
+ client.contacts.merge(
{ from: '6657adf76abd0167d9419d1d', into: '6657adf76abd0167d9419d1e', 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
@@ -203,7 +203,7 @@ describe('resource contacts', () => {
});
test('search: only required params', async () => {
- const responsePromise = intercom.contacts.search({ query: {} });
+ const responsePromise = client.contacts.search({ query: {} });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -214,7 +214,7 @@ describe('resource contacts', () => {
});
test('search: required and optional params', async () => {
- const response = await intercom.contacts.search({
+ const response = await client.contacts.search({
query: { field: 'created_at', operator: '=', value: 'value' },
pagination: { per_page: 5, starting_after: 'your-cursor-from-response' },
'Intercom-Version': '2.11',
@@ -222,7 +222,7 @@ describe('resource contacts', () => {
});
test('unarchive', async () => {
- const responsePromise = intercom.contacts.unarchive('63a07ddf05a32042dffac965');
+ const responsePromise = client.contacts.unarchive('63a07ddf05a32042dffac965');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -235,14 +235,14 @@ describe('resource contacts', () => {
test('unarchive: 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.unarchive('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
+ client.contacts.unarchive('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('unarchive: 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.unarchive(
+ client.contacts.unarchive(
'63a07ddf05a32042dffac965',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
diff --git a/tests/api-resources/contacts/notes.test.ts b/tests/api-resources/contacts/notes.test.ts
index 9cdac8c2..396c93bf 100644
--- a/tests/api-resources/contacts/notes.test.ts
+++ b/tests/api-resources/contacts/notes.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource notes', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.contacts.notes.create(0, { body: 'Hello' });
+ const responsePromise = client.contacts.notes.create(0, { body: 'Hello' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -21,7 +21,7 @@ describe('resource notes', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.contacts.notes.create(0, {
+ const response = await client.contacts.notes.create(0, {
body: 'Hello',
admin_id: 'admin_id',
contact_id: '6657adde6abd0167d9419d00',
@@ -30,7 +30,7 @@ describe('resource notes', () => {
});
test('list', async () => {
- const responsePromise = intercom.contacts.notes.list(0);
+ const responsePromise = client.contacts.notes.list(0);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -42,7 +42,7 @@ describe('resource notes', () => {
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.notes.list(0, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.contacts.notes.list(0, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -50,7 +50,7 @@ describe('resource notes', () => {
test('list: 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.notes.list(0, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.contacts.notes.list(0, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
});
diff --git a/tests/api-resources/contacts/segments.test.ts b/tests/api-resources/contacts/segments.test.ts
index ac646a6c..a295ee8d 100644
--- a/tests/api-resources/contacts/segments.test.ts
+++ b/tests/api-resources/contacts/segments.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource segments', () => {
test('list', async () => {
- const responsePromise = intercom.contacts.segments.list('63a07ddf05a32042dffac965');
+ const responsePromise = client.contacts.segments.list('63a07ddf05a32042dffac965');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -23,14 +23,14 @@ describe('resource segments', () => {
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.segments.list('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
+ client.contacts.segments.list('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('list: 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.segments.list(
+ client.contacts.segments.list(
'63a07ddf05a32042dffac965',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
diff --git a/tests/api-resources/contacts/subscriptions.test.ts b/tests/api-resources/contacts/subscriptions.test.ts
index 40e58e3d..32b84f7b 100644
--- a/tests/api-resources/contacts/subscriptions.test.ts
+++ b/tests/api-resources/contacts/subscriptions.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource subscriptions', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.contacts.subscriptions.create('63a07ddf05a32042dffac965', {
+ const responsePromise = client.contacts.subscriptions.create('63a07ddf05a32042dffac965', {
id: 'id',
consent_type: 'opt_in',
});
@@ -24,7 +24,7 @@ describe('resource subscriptions', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.contacts.subscriptions.create('63a07ddf05a32042dffac965', {
+ const response = await client.contacts.subscriptions.create('63a07ddf05a32042dffac965', {
id: 'id',
consent_type: 'opt_in',
'Intercom-Version': '2.11',
@@ -32,7 +32,7 @@ describe('resource subscriptions', () => {
});
test('list', async () => {
- const responsePromise = intercom.contacts.subscriptions.list('63a07ddf05a32042dffac965');
+ const responsePromise = client.contacts.subscriptions.list('63a07ddf05a32042dffac965');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -45,14 +45,14 @@ describe('resource subscriptions', () => {
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.subscriptions.list('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
+ client.contacts.subscriptions.list('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('list: 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.subscriptions.list(
+ client.contacts.subscriptions.list(
'63a07ddf05a32042dffac965',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -61,7 +61,7 @@ describe('resource subscriptions', () => {
});
test('delete', async () => {
- const responsePromise = intercom.contacts.subscriptions.delete('63a07ddf05a32042dffac965', '37846');
+ const responsePromise = client.contacts.subscriptions.delete('63a07ddf05a32042dffac965', '37846');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -74,7 +74,7 @@ describe('resource subscriptions', () => {
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.subscriptions.delete('63a07ddf05a32042dffac965', '37846', {
+ client.contacts.subscriptions.delete('63a07ddf05a32042dffac965', '37846', {
path: '/_stainless_unknown_path',
}),
).rejects.toThrow(Intercom.NotFoundError);
@@ -83,7 +83,7 @@ describe('resource subscriptions', () => {
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.subscriptions.delete(
+ client.contacts.subscriptions.delete(
'63a07ddf05a32042dffac965',
'37846',
{ 'Intercom-Version': '2.11' },
diff --git a/tests/api-resources/contacts/tags.test.ts b/tests/api-resources/contacts/tags.test.ts
index 38afc850..ce7e2d51 100644
--- a/tests/api-resources/contacts/tags.test.ts
+++ b/tests/api-resources/contacts/tags.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource tags', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.contacts.tags.create('63a07ddf05a32042dffac965', { id: 'id' });
+ const responsePromise = client.contacts.tags.create('63a07ddf05a32042dffac965', { id: 'id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -21,14 +21,14 @@ describe('resource tags', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.contacts.tags.create('63a07ddf05a32042dffac965', {
+ const response = await client.contacts.tags.create('63a07ddf05a32042dffac965', {
id: 'id',
'Intercom-Version': '2.11',
});
});
test('list', async () => {
- const responsePromise = intercom.contacts.tags.list('63a07ddf05a32042dffac965');
+ const responsePromise = client.contacts.tags.list('63a07ddf05a32042dffac965');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -41,14 +41,14 @@ describe('resource tags', () => {
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.tags.list('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
+ client.contacts.tags.list('63a07ddf05a32042dffac965', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('list: 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.tags.list(
+ client.contacts.tags.list(
'63a07ddf05a32042dffac965',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -57,7 +57,7 @@ describe('resource tags', () => {
});
test('delete', async () => {
- const responsePromise = intercom.contacts.tags.delete('63a07ddf05a32042dffac965', '7522907');
+ const responsePromise = client.contacts.tags.delete('63a07ddf05a32042dffac965', '7522907');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -70,7 +70,7 @@ describe('resource tags', () => {
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.tags.delete('63a07ddf05a32042dffac965', '7522907', {
+ client.contacts.tags.delete('63a07ddf05a32042dffac965', '7522907', {
path: '/_stainless_unknown_path',
}),
).rejects.toThrow(Intercom.NotFoundError);
@@ -79,7 +79,7 @@ describe('resource tags', () => {
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.tags.delete(
+ client.contacts.tags.delete(
'63a07ddf05a32042dffac965',
'7522907',
{ 'Intercom-Version': '2.11' },
diff --git a/tests/api-resources/conversations/conversations.test.ts b/tests/api-resources/conversations/conversations.test.ts
index 987469b9..5668bf42 100644
--- a/tests/api-resources/conversations/conversations.test.ts
+++ b/tests/api-resources/conversations/conversations.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource conversations', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.conversations.create({
+ const responsePromise = client.conversations.create({
body: 'Hello there',
from: { type: 'user', id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
});
@@ -24,7 +24,7 @@ describe('resource conversations', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.conversations.create({
+ const response = await client.conversations.create({
body: 'Hello there',
from: { type: 'user', id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
'Intercom-Version': '2.11',
@@ -32,7 +32,7 @@ describe('resource conversations', () => {
});
test('retrieve', async () => {
- const responsePromise = intercom.conversations.retrieve(123);
+ const responsePromise = client.conversations.retrieve(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -44,7 +44,7 @@ describe('resource conversations', () => {
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.conversations.retrieve(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.conversations.retrieve(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -52,7 +52,7 @@ describe('resource conversations', () => {
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.conversations.retrieve(
+ client.conversations.retrieve(
123,
{ display_as: 'display_as', 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -61,7 +61,7 @@ describe('resource conversations', () => {
});
test('update', async () => {
- const responsePromise = intercom.conversations.update(123);
+ const responsePromise = client.conversations.update(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -73,7 +73,7 @@ describe('resource conversations', () => {
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.conversations.update(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.conversations.update(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -81,7 +81,7 @@ describe('resource conversations', () => {
test('update: 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.conversations.update(
+ client.conversations.update(
123,
{
display_as: 'display_as',
@@ -95,7 +95,7 @@ describe('resource conversations', () => {
});
test('list', async () => {
- const responsePromise = intercom.conversations.list();
+ const responsePromise = client.conversations.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -107,7 +107,7 @@ describe('resource conversations', () => {
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.conversations.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.conversations.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -115,7 +115,7 @@ describe('resource conversations', () => {
test('list: 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.conversations.list(
+ client.conversations.list(
{ per_page: 0, starting_after: 'starting_after', 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
@@ -123,7 +123,7 @@ describe('resource conversations', () => {
});
test('convert: only required params', async () => {
- const responsePromise = intercom.conversations.convert(123, { ticket_type_id: '120' });
+ const responsePromise = client.conversations.convert(123, { ticket_type_id: '120' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -134,7 +134,7 @@ describe('resource conversations', () => {
});
test('convert: required and optional params', async () => {
- const response = await intercom.conversations.convert(123, {
+ const response = await client.conversations.convert(123, {
ticket_type_id: '120',
attributes: { _default_title_: 'Found a bug', _default_description_: 'The button is not working' },
'Intercom-Version': '2.11',
@@ -142,7 +142,7 @@ describe('resource conversations', () => {
});
test('redact: only required params', async () => {
- const responsePromise = intercom.conversations.redact({
+ const responsePromise = client.conversations.redact({
conversation_id: '19894788788',
conversation_part_id: '19381789428',
type: 'conversation_part',
@@ -157,7 +157,7 @@ describe('resource conversations', () => {
});
test('redact: required and optional params', async () => {
- const response = await intercom.conversations.redact({
+ const response = await client.conversations.redact({
conversation_id: '19894788788',
conversation_part_id: '19381789428',
type: 'conversation_part',
@@ -166,7 +166,7 @@ describe('resource conversations', () => {
});
test('search: only required params', async () => {
- const responsePromise = intercom.conversations.search({ query: {} });
+ const responsePromise = client.conversations.search({ query: {} });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -177,7 +177,7 @@ describe('resource conversations', () => {
});
test('search: required and optional params', async () => {
- const response = await intercom.conversations.search({
+ const response = await client.conversations.search({
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 3afa6091..0fe51393 100644
--- a/tests/api-resources/conversations/customers.test.ts
+++ b/tests/api-resources/conversations/customers.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource customers', () => {
test('create', async () => {
- const responsePromise = intercom.conversations.customers.create('123');
+ const responsePromise = client.conversations.customers.create('123');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -23,14 +23,14 @@ describe('resource customers', () => {
test('create: 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.conversations.customers.create('123', { path: '/_stainless_unknown_path' }),
+ client.conversations.customers.create('123', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('create: 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.conversations.customers.create(
+ client.conversations.customers.create(
'123',
{
admin_id: 'admin_id',
@@ -46,7 +46,7 @@ describe('resource customers', () => {
});
test('delete: only required params', async () => {
- const responsePromise = intercom.conversations.customers.delete('123', '123', { admin_id: 'admin_id' });
+ const responsePromise = client.conversations.customers.delete('123', '123', { admin_id: 'admin_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -57,7 +57,7 @@ describe('resource customers', () => {
});
test('delete: required and optional params', async () => {
- const response = await intercom.conversations.customers.delete('123', '123', {
+ const response = await client.conversations.customers.delete('123', '123', {
admin_id: 'admin_id',
'Intercom-Version': '2.11',
});
diff --git a/tests/api-resources/conversations/parts.test.ts b/tests/api-resources/conversations/parts.test.ts
index 910b2e7f..e6a93f15 100644
--- a/tests/api-resources/conversations/parts.test.ts
+++ b/tests/api-resources/conversations/parts.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource parts', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.conversations.parts.create('123', {
+ const responsePromise = client.conversations.parts.create('123', {
admin_id: '12345',
message_type: 'close',
type: 'admin',
@@ -25,7 +25,7 @@ describe('resource parts', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.conversations.parts.create('123', {
+ const response = await client.conversations.parts.create('123', {
admin_id: '12345',
message_type: 'close',
type: 'admin',
diff --git a/tests/api-resources/conversations/reply.test.ts b/tests/api-resources/conversations/reply.test.ts
index 146a4612..70f7c637 100644
--- a/tests/api-resources/conversations/reply.test.ts
+++ b/tests/api-resources/conversations/reply.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource reply', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.conversations.reply.create('123 or "last"', {
+ const responsePromise = client.conversations.reply.create('123 or "last"', {
body: 'body',
message_type: 'comment',
type: 'user',
@@ -25,7 +25,7 @@ describe('resource reply', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.conversations.reply.create('123 or "last"', {
+ const response = await client.conversations.reply.create('123 or "last"', {
body: 'body',
message_type: 'comment',
type: 'user',
diff --git a/tests/api-resources/conversations/run-assignment-rules.test.ts b/tests/api-resources/conversations/run-assignment-rules.test.ts
index c9efec1a..e4cdfecb 100644
--- a/tests/api-resources/conversations/run-assignment-rules.test.ts
+++ b/tests/api-resources/conversations/run-assignment-rules.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource runAssignmentRules', () => {
test('create', async () => {
- const responsePromise = intercom.conversations.runAssignmentRules.create('123');
+ const responsePromise = client.conversations.runAssignmentRules.create('123');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -23,14 +23,14 @@ describe('resource runAssignmentRules', () => {
test('create: 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.conversations.runAssignmentRules.create('123', { path: '/_stainless_unknown_path' }),
+ client.conversations.runAssignmentRules.create('123', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('create: 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.conversations.runAssignmentRules.create(
+ client.conversations.runAssignmentRules.create(
'123',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
diff --git a/tests/api-resources/conversations/tags.test.ts b/tests/api-resources/conversations/tags.test.ts
index 255d7774..6b462288 100644
--- a/tests/api-resources/conversations/tags.test.ts
+++ b/tests/api-resources/conversations/tags.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource tags', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.conversations.tags.create('64619700005694', {
+ const responsePromise = client.conversations.tags.create('64619700005694', {
id: 'id',
admin_id: 'admin_id',
});
@@ -24,7 +24,7 @@ describe('resource tags', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.conversations.tags.create('64619700005694', {
+ const response = await client.conversations.tags.create('64619700005694', {
id: 'id',
admin_id: 'admin_id',
'Intercom-Version': '2.11',
@@ -32,7 +32,7 @@ describe('resource tags', () => {
});
test('delete: only required params', async () => {
- const responsePromise = intercom.conversations.tags.delete('64619700005694', '7522907', {
+ const responsePromise = client.conversations.tags.delete('64619700005694', '7522907', {
admin_id: 'admin_id',
});
const rawResponse = await responsePromise.asResponse();
@@ -45,7 +45,7 @@ describe('resource tags', () => {
});
test('delete: required and optional params', async () => {
- const response = await intercom.conversations.tags.delete('64619700005694', '7522907', {
+ const response = await client.conversations.tags.delete('64619700005694', '7522907', {
admin_id: 'admin_id',
'Intercom-Version': '2.11',
});
diff --git a/tests/api-resources/data-attributes.test.ts b/tests/api-resources/data-attributes.test.ts
index f037eef3..5cba46a5 100644
--- a/tests/api-resources/data-attributes.test.ts
+++ b/tests/api-resources/data-attributes.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource dataAttributes', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.dataAttributes.create({
+ const responsePromise = client.dataAttributes.create({
data_type: 'string',
model: 'company',
name: 'Mithril Shirt',
@@ -25,7 +25,7 @@ describe('resource dataAttributes', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.dataAttributes.create({
+ const response = await client.dataAttributes.create({
data_type: 'string',
model: 'company',
name: 'Mithril Shirt',
@@ -37,7 +37,7 @@ describe('resource dataAttributes', () => {
});
test('update', async () => {
- const responsePromise = intercom.dataAttributes.update(1);
+ const responsePromise = client.dataAttributes.update(1);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -49,7 +49,7 @@ describe('resource dataAttributes', () => {
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.dataAttributes.update(1, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.dataAttributes.update(1, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -57,7 +57,7 @@ describe('resource dataAttributes', () => {
test('update: 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.dataAttributes.update(
+ client.dataAttributes.update(
1,
{
archived: false,
@@ -72,7 +72,7 @@ describe('resource dataAttributes', () => {
});
test('list', async () => {
- const responsePromise = intercom.dataAttributes.list();
+ const responsePromise = client.dataAttributes.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -84,7 +84,7 @@ describe('resource dataAttributes', () => {
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.dataAttributes.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.dataAttributes.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -92,7 +92,7 @@ describe('resource dataAttributes', () => {
test('list: 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.dataAttributes.list(
+ client.dataAttributes.list(
{ include_archived: true, model: 'contact', 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
diff --git a/tests/api-resources/data-events.test.ts b/tests/api-resources/data-events.test.ts
index b3a5cb01..2c347bce 100644
--- a/tests/api-resources/data-events.test.ts
+++ b/tests/api-resources/data-events.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource dataEvents', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.dataEvents.create({ body: {} });
+ const responsePromise = client.dataEvents.create({ body: {} });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -21,11 +21,11 @@ describe('resource dataEvents', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.dataEvents.create({ body: {}, 'Intercom-Version': '2.11' });
+ const response = await client.dataEvents.create({ body: {}, 'Intercom-Version': '2.11' });
});
test('list: only required params', async () => {
- const responsePromise = intercom.dataEvents.list({ filter: { user_id: 'user_id' }, type: 'type' });
+ const responsePromise = client.dataEvents.list({ filter: { user_id: 'user_id' }, type: 'type' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -36,7 +36,7 @@ describe('resource dataEvents', () => {
});
test('list: required and optional params', async () => {
- const response = await intercom.dataEvents.list({
+ const response = await client.dataEvents.list({
filter: { user_id: 'user_id' },
type: 'type',
summary: true,
@@ -45,7 +45,7 @@ describe('resource dataEvents', () => {
});
test('summaries', async () => {
- const responsePromise = intercom.dataEvents.summaries();
+ const responsePromise = client.dataEvents.summaries();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -57,7 +57,7 @@ describe('resource dataEvents', () => {
test('summaries: 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.dataEvents.summaries({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.dataEvents.summaries({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -65,7 +65,7 @@ describe('resource dataEvents', () => {
test('summaries: 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.dataEvents.summaries(
+ client.dataEvents.summaries(
{
event_summaries: { event_name: 'invited-friend', count: 1, first: 1671028894, last: 1671028894 },
user_id: '314159',
diff --git a/tests/api-resources/data-exports.test.ts b/tests/api-resources/data-exports.test.ts
index 6e525971..0c126881 100644
--- a/tests/api-resources/data-exports.test.ts
+++ b/tests/api-resources/data-exports.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource dataExports', () => {
test('contentData: only required params', async () => {
- const responsePromise = intercom.dataExports.contentData({
+ const responsePromise = client.dataExports.contentData({
created_at_after: 1717004390,
created_at_before: 1717022390,
});
@@ -24,7 +24,7 @@ describe('resource dataExports', () => {
});
test('contentData: required and optional params', async () => {
- const response = await intercom.dataExports.contentData({
+ const response = await client.dataExports.contentData({
created_at_after: 1717004390,
created_at_before: 1717022390,
'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 0b5b087b..bab30d1a 100644
--- a/tests/api-resources/download/content/data.test.ts
+++ b/tests/api-resources/download/content/data.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource data', () => {
test('retrieve', async () => {
- const responsePromise = intercom.download.content.data.retrieve('job_identifier');
+ const responsePromise = client.download.content.data.retrieve('job_identifier');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -23,14 +23,14 @@ 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('job_identifier', { path: '/_stainless_unknown_path' }),
+ client.download.content.data.retrieve('job_identifier', { 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.download.content.data.retrieve(
+ client.download.content.data.retrieve(
'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 738f9371..2c8fbedd 100644
--- a/tests/api-resources/export/content/data.test.ts
+++ b/tests/api-resources/export/content/data.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource data', () => {
test('retrieve', async () => {
- const responsePromise = intercom.export.content.data.retrieve('job_identifier');
+ const responsePromise = client.export.content.data.retrieve('job_identifier');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -23,14 +23,14 @@ 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('job_identifier', { path: '/_stainless_unknown_path' }),
+ client.export.content.data.retrieve('job_identifier', { 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.export.content.data.retrieve(
+ client.export.content.data.retrieve(
'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 6da63c2f..1d684164 100644
--- a/tests/api-resources/export/export.test.ts
+++ b/tests/api-resources/export/export.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource export', () => {
test('cancel', async () => {
- const responsePromise = intercom.export.cancel('job_identifier');
+ const responsePromise = client.export.cancel('job_identifier');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -23,14 +23,14 @@ 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('job_identifier', { path: '/_stainless_unknown_path' }),
+ client.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(
+ client.export.cancel(
'job_identifier',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
diff --git a/tests/api-resources/help-center/collections.test.ts b/tests/api-resources/help-center/collections.test.ts
index e44d4ed5..b481ceb5 100644
--- a/tests/api-resources/help-center/collections.test.ts
+++ b/tests/api-resources/help-center/collections.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource collections', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.helpCenter.collections.create({ name: 'Thanks for everything' });
+ const responsePromise = client.helpCenter.collections.create({ name: 'Thanks for everything' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -21,7 +21,7 @@ describe('resource collections', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.helpCenter.collections.create({
+ const response = await client.helpCenter.collections.create({
name: 'Thanks for everything',
description: 'English description',
help_center_id: 0,
@@ -71,7 +71,7 @@ describe('resource collections', () => {
});
test('retrieve', async () => {
- const responsePromise = intercom.helpCenter.collections.retrieve(123);
+ const responsePromise = client.helpCenter.collections.retrieve(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -84,14 +84,14 @@ describe('resource collections', () => {
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.helpCenter.collections.retrieve(123, { path: '/_stainless_unknown_path' }),
+ client.helpCenter.collections.retrieve(123, { 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.helpCenter.collections.retrieve(
+ client.helpCenter.collections.retrieve(
123,
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -100,7 +100,7 @@ describe('resource collections', () => {
});
test('update', async () => {
- const responsePromise = intercom.helpCenter.collections.update(123);
+ const responsePromise = client.helpCenter.collections.update(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -113,14 +113,14 @@ describe('resource collections', () => {
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.helpCenter.collections.update(123, { path: '/_stainless_unknown_path' }),
+ client.helpCenter.collections.update(123, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('update: 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.helpCenter.collections.update(
+ client.helpCenter.collections.update(
123,
{
description: 'English description',
@@ -186,7 +186,7 @@ describe('resource collections', () => {
});
test('list', async () => {
- const responsePromise = intercom.helpCenter.collections.list();
+ const responsePromise = client.helpCenter.collections.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -198,7 +198,7 @@ describe('resource collections', () => {
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.helpCenter.collections.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.helpCenter.collections.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -206,7 +206,7 @@ describe('resource collections', () => {
test('list: 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.helpCenter.collections.list(
+ client.helpCenter.collections.list(
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
@@ -214,7 +214,7 @@ describe('resource collections', () => {
});
test('delete', async () => {
- const responsePromise = intercom.helpCenter.collections.delete(123);
+ const responsePromise = client.helpCenter.collections.delete(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -227,14 +227,14 @@ describe('resource collections', () => {
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.helpCenter.collections.delete(123, { path: '/_stainless_unknown_path' }),
+ client.helpCenter.collections.delete(123, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
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.helpCenter.collections.delete(
+ client.helpCenter.collections.delete(
123,
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
diff --git a/tests/api-resources/help-center/help-centers.test.ts b/tests/api-resources/help-center/help-centers.test.ts
index 7abfcf01..9f3abe74 100644
--- a/tests/api-resources/help-center/help-centers.test.ts
+++ b/tests/api-resources/help-center/help-centers.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource helpCenters', () => {
test('retrieve', async () => {
- const responsePromise = intercom.helpCenter.helpCenters.retrieve(123);
+ const responsePromise = client.helpCenter.helpCenters.retrieve(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -23,14 +23,14 @@ describe('resource helpCenters', () => {
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.helpCenter.helpCenters.retrieve(123, { path: '/_stainless_unknown_path' }),
+ client.helpCenter.helpCenters.retrieve(123, { 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.helpCenter.helpCenters.retrieve(
+ client.helpCenter.helpCenters.retrieve(
123,
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -39,7 +39,7 @@ describe('resource helpCenters', () => {
});
test('list', async () => {
- const responsePromise = intercom.helpCenter.helpCenters.list();
+ const responsePromise = client.helpCenter.helpCenters.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -51,7 +51,7 @@ describe('resource helpCenters', () => {
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.helpCenter.helpCenters.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.helpCenter.helpCenters.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -59,7 +59,7 @@ describe('resource helpCenters', () => {
test('list: 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.helpCenter.helpCenters.list(
+ client.helpCenter.helpCenters.list(
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
diff --git a/tests/api-resources/me.test.ts b/tests/api-resources/me.test.ts
index 6361fb3c..d4ad2666 100644
--- a/tests/api-resources/me.test.ts
+++ b/tests/api-resources/me.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource me', () => {
test('retrieve', async () => {
- const responsePromise = intercom.me.retrieve();
+ const responsePromise = client.me.retrieve();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -22,7 +22,7 @@ describe('resource me', () => {
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.me.retrieve({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.me.retrieve({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -30,7 +30,7 @@ describe('resource me', () => {
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.me.retrieve({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.me.retrieve({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
});
diff --git a/tests/api-resources/messages.test.ts b/tests/api-resources/messages.test.ts
index af190ca1..afb89e9b 100644
--- a/tests/api-resources/messages.test.ts
+++ b/tests/api-resources/messages.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource messages', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.messages.create({ body: {} });
+ const responsePromise = client.messages.create({ body: {} });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -21,6 +21,6 @@ describe('resource messages', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.messages.create({ body: {}, 'Intercom-Version': '2.11' });
+ const response = await client.messages.create({ body: {}, 'Intercom-Version': '2.11' });
});
});
diff --git a/tests/api-resources/news/news-items.test.ts b/tests/api-resources/news/news-items.test.ts
index f0275ce5..f7275466 100644
--- a/tests/api-resources/news/news-items.test.ts
+++ b/tests/api-resources/news/news-items.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource newsItems', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.news.newsItems.create({
+ const responsePromise = client.news.newsItems.create({
sender_id: 991268690,
title: 'Halloween is here!',
});
@@ -24,7 +24,7 @@ describe('resource newsItems', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.news.newsItems.create({
+ const response = await client.news.newsItems.create({
sender_id: 991268690,
title: 'Halloween is here!',
body: 'New costumes in store for this spooky season
',
@@ -38,7 +38,7 @@ describe('resource newsItems', () => {
});
test('retrieve', async () => {
- const responsePromise = intercom.news.newsItems.retrieve(123);
+ const responsePromise = client.news.newsItems.retrieve(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -50,7 +50,7 @@ describe('resource newsItems', () => {
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.news.newsItems.retrieve(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.news.newsItems.retrieve(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -58,7 +58,7 @@ describe('resource newsItems', () => {
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.news.newsItems.retrieve(
+ client.news.newsItems.retrieve(
123,
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -67,7 +67,7 @@ describe('resource newsItems', () => {
});
test('update: only required params', async () => {
- const responsePromise = intercom.news.newsItems.update(123, {
+ const responsePromise = client.news.newsItems.update(123, {
sender_id: 991268701,
title: 'Christmas is here!',
});
@@ -81,7 +81,7 @@ describe('resource newsItems', () => {
});
test('update: required and optional params', async () => {
- const response = await intercom.news.newsItems.update(123, {
+ const response = await client.news.newsItems.update(123, {
sender_id: 991268701,
title: 'Christmas is here!',
body: 'New gifts in store for the jolly season
',
@@ -99,7 +99,7 @@ describe('resource newsItems', () => {
});
test('list', async () => {
- const responsePromise = intercom.news.newsItems.list();
+ const responsePromise = client.news.newsItems.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -111,7 +111,7 @@ describe('resource newsItems', () => {
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.news.newsItems.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.news.newsItems.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -119,12 +119,12 @@ describe('resource newsItems', () => {
test('list: 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.news.newsItems.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.news.newsItems.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('delete', async () => {
- const responsePromise = intercom.news.newsItems.delete(123);
+ const responsePromise = client.news.newsItems.delete(123);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -136,7 +136,7 @@ describe('resource newsItems', () => {
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.news.newsItems.delete(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.news.newsItems.delete(123, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -144,11 +144,7 @@ describe('resource newsItems', () => {
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.news.newsItems.delete(
- 123,
- { 'Intercom-Version': '2.11' },
- { path: '/_stainless_unknown_path' },
- ),
+ client.news.newsItems.delete(123, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
});
diff --git a/tests/api-resources/news/newsfeeds/items.test.ts b/tests/api-resources/news/newsfeeds/items.test.ts
index 827855f8..91ec34c8 100644
--- a/tests/api-resources/news/newsfeeds/items.test.ts
+++ b/tests/api-resources/news/newsfeeds/items.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource items', () => {
test('list', async () => {
- const responsePromise = intercom.news.newsfeeds.items.list('123');
+ const responsePromise = client.news.newsfeeds.items.list('123');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -23,14 +23,14 @@ describe('resource items', () => {
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.news.newsfeeds.items.list('123', { path: '/_stainless_unknown_path' }),
+ client.news.newsfeeds.items.list('123', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('list: 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.news.newsfeeds.items.list(
+ client.news.newsfeeds.items.list(
'123',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
diff --git a/tests/api-resources/news/newsfeeds/newsfeeds.test.ts b/tests/api-resources/news/newsfeeds/newsfeeds.test.ts
index 3476f82e..b5d0c844 100644
--- a/tests/api-resources/news/newsfeeds/newsfeeds.test.ts
+++ b/tests/api-resources/news/newsfeeds/newsfeeds.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource newsfeeds', () => {
test('retrieve', async () => {
- const responsePromise = intercom.news.newsfeeds.retrieve('123');
+ const responsePromise = client.news.newsfeeds.retrieve('123');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -22,15 +22,15 @@ describe('resource newsfeeds', () => {
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.news.newsfeeds.retrieve('123', { path: '/_stainless_unknown_path' }),
- ).rejects.toThrow(Intercom.NotFoundError);
+ await expect(client.news.newsfeeds.retrieve('123', { 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.news.newsfeeds.retrieve(
+ client.news.newsfeeds.retrieve(
'123',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
@@ -39,7 +39,7 @@ describe('resource newsfeeds', () => {
});
test('list', async () => {
- const responsePromise = intercom.news.newsfeeds.list();
+ const responsePromise = client.news.newsfeeds.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -51,7 +51,7 @@ describe('resource newsfeeds', () => {
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.news.newsfeeds.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.news.newsfeeds.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -59,7 +59,7 @@ describe('resource newsfeeds', () => {
test('list: 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.news.newsfeeds.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.news.newsfeeds.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
});
diff --git a/tests/api-resources/notes.test.ts b/tests/api-resources/notes.test.ts
index 5e6c0456..52250332 100644
--- a/tests/api-resources/notes.test.ts
+++ b/tests/api-resources/notes.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource notes', () => {
test('retrieve', async () => {
- const responsePromise = intercom.notes.retrieve(1);
+ const responsePromise = client.notes.retrieve(1);
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -22,7 +22,7 @@ describe('resource notes', () => {
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.notes.retrieve(1, { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.notes.retrieve(1, { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -30,7 +30,7 @@ describe('resource notes', () => {
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.notes.retrieve(1, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.notes.retrieve(1, { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
});
diff --git a/tests/api-resources/phone-call-redirects.test.ts b/tests/api-resources/phone-call-redirects.test.ts
index 04f6e6a6..90fb9d6c 100644
--- a/tests/api-resources/phone-call-redirects.test.ts
+++ b/tests/api-resources/phone-call-redirects.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource phoneCallRedirects', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.phoneCallRedirects.create({ phone: '+353832345678' });
+ const responsePromise = client.phoneCallRedirects.create({ phone: '+353832345678' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -21,7 +21,7 @@ describe('resource phoneCallRedirects', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.phoneCallRedirects.create({
+ const response = await client.phoneCallRedirects.create({
phone: '+353832345678',
custom_attributes: { issue_type: 'Billing', priority: 'High' },
'Intercom-Version': '2.11',
diff --git a/tests/api-resources/segments.test.ts b/tests/api-resources/segments.test.ts
index 9ef3ff6c..510a4788 100644
--- a/tests/api-resources/segments.test.ts
+++ b/tests/api-resources/segments.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource segments', () => {
test('retrieve', async () => {
- const responsePromise = intercom.segments.retrieve('123');
+ const responsePromise = client.segments.retrieve('123');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -22,7 +22,7 @@ describe('resource segments', () => {
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.segments.retrieve('123', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.segments.retrieve('123', { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -30,12 +30,12 @@ describe('resource segments', () => {
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.segments.retrieve('123', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.segments.retrieve('123', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('list', async () => {
- const responsePromise = intercom.segments.list();
+ const responsePromise = client.segments.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -47,7 +47,7 @@ describe('resource segments', () => {
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.segments.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.segments.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -55,7 +55,7 @@ describe('resource segments', () => {
test('list: 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.segments.list(
+ client.segments.list(
{ include_count: true, 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
diff --git a/tests/api-resources/subscription-types.test.ts b/tests/api-resources/subscription-types.test.ts
index 9b60a25b..8cf81d01 100644
--- a/tests/api-resources/subscription-types.test.ts
+++ b/tests/api-resources/subscription-types.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource subscriptionTypes', () => {
test('list', async () => {
- const responsePromise = intercom.subscriptionTypes.list();
+ const responsePromise = client.subscriptionTypes.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -22,7 +22,7 @@ describe('resource subscriptionTypes', () => {
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.subscriptionTypes.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.subscriptionTypes.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -30,7 +30,7 @@ describe('resource subscriptionTypes', () => {
test('list: 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.subscriptionTypes.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.subscriptionTypes.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
});
diff --git a/tests/api-resources/tags.test.ts b/tests/api-resources/tags.test.ts
index 2c97ea0b..f057f08f 100644
--- a/tests/api-resources/tags.test.ts
+++ b/tests/api-resources/tags.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource tags', () => {
test('retrieve', async () => {
- const responsePromise = intercom.tags.retrieve('123');
+ const responsePromise = client.tags.retrieve('123');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -22,7 +22,7 @@ describe('resource tags', () => {
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.tags.retrieve('123', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.tags.retrieve('123', { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -30,12 +30,12 @@ describe('resource tags', () => {
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.tags.retrieve('123', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.tags.retrieve('123', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('list', async () => {
- const responsePromise = intercom.tags.list();
+ const responsePromise = client.tags.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -47,7 +47,7 @@ describe('resource tags', () => {
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.tags.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.tags.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -55,12 +55,12 @@ describe('resource tags', () => {
test('list: 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.tags.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.tags.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('delete', async () => {
- const responsePromise = intercom.tags.delete('123');
+ const responsePromise = client.tags.delete('123');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -72,7 +72,7 @@ describe('resource tags', () => {
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.tags.delete('123', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.tags.delete('123', { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -80,12 +80,12 @@ describe('resource tags', () => {
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.tags.delete('123', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.tags.delete('123', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('createOrUpdate: only required params', async () => {
- const responsePromise = intercom.tags.createOrUpdate({ name: 'Independent' });
+ const responsePromise = client.tags.createOrUpdate({ name: 'Independent' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -96,7 +96,7 @@ describe('resource tags', () => {
});
test('createOrUpdate: required and optional params', async () => {
- const response = await intercom.tags.createOrUpdate({
+ const response = await client.tags.createOrUpdate({
name: 'Independent',
id: '656452352',
'Intercom-Version': '2.11',
diff --git a/tests/api-resources/teams.test.ts b/tests/api-resources/teams.test.ts
index f75fb9a4..93aef350 100644
--- a/tests/api-resources/teams.test.ts
+++ b/tests/api-resources/teams.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource teams', () => {
test('retrieve', async () => {
- const responsePromise = intercom.teams.retrieve('123');
+ const responsePromise = client.teams.retrieve('123');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -22,7 +22,7 @@ describe('resource teams', () => {
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.teams.retrieve('123', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.teams.retrieve('123', { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -30,12 +30,12 @@ describe('resource teams', () => {
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.teams.retrieve('123', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.teams.retrieve('123', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('list', async () => {
- const responsePromise = intercom.teams.list();
+ const responsePromise = client.teams.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -47,7 +47,7 @@ describe('resource teams', () => {
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.teams.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.teams.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -55,7 +55,7 @@ describe('resource teams', () => {
test('list: 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.teams.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.teams.list({ '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 e6e52c08..3f4693db 100644
--- a/tests/api-resources/ticket-types/attributes.test.ts
+++ b/tests/api-resources/ticket-types/attributes.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource attributes', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.ticketTypes.attributes.create('ticket_type_id', {
+ const responsePromise = client.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('ticket_type_id', {
+ const response = await client.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('ticket_type_id', 'id');
+ const responsePromise = client.ticketTypes.attributes.update('ticket_type_id', 'id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -54,14 +54,14 @@ 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('ticket_type_id', 'id', { path: '/_stainless_unknown_path' }),
+ client.ticketTypes.attributes.update('ticket_type_id', 'id', { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('update: 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.attributes.update(
+ client.ticketTypes.attributes.update(
'ticket_type_id',
'id',
{
diff --git a/tests/api-resources/ticket-types/ticket-types.test.ts b/tests/api-resources/ticket-types/ticket-types.test.ts
index df5bfdd3..b682a9c9 100644
--- a/tests/api-resources/ticket-types/ticket-types.test.ts
+++ b/tests/api-resources/ticket-types/ticket-types.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource ticketTypes', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.ticketTypes.create({ name: 'Customer Issue' });
+ const responsePromise = client.ticketTypes.create({ name: 'Customer Issue' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -21,7 +21,7 @@ describe('resource ticketTypes', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.ticketTypes.create({
+ const response = await client.ticketTypes.create({
name: 'Customer Issue',
category: 'Customer',
description: 'Customer Report Template',
@@ -32,7 +32,7 @@ describe('resource ticketTypes', () => {
});
test('retrieve', async () => {
- const responsePromise = intercom.ticketTypes.retrieve('id');
+ const responsePromise = client.ticketTypes.retrieve('id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -44,7 +44,7 @@ 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('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.ticketTypes.retrieve('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -52,16 +52,12 @@ describe('resource ticketTypes', () => {
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(
- 'id',
- { 'Intercom-Version': '2.11' },
- { path: '/_stainless_unknown_path' },
- ),
+ client.ticketTypes.retrieve('id', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('update', async () => {
- const responsePromise = intercom.ticketTypes.update('id');
+ const responsePromise = client.ticketTypes.update('id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -73,7 +69,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('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.ticketTypes.update('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -81,7 +77,7 @@ describe('resource ticketTypes', () => {
test('update: 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.update(
+ client.ticketTypes.update(
'id',
{
archived: false,
@@ -98,7 +94,7 @@ describe('resource ticketTypes', () => {
});
test('list', async () => {
- const responsePromise = intercom.ticketTypes.list();
+ const responsePromise = client.ticketTypes.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -110,7 +106,7 @@ describe('resource ticketTypes', () => {
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.ticketTypes.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.ticketTypes.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -118,7 +114,7 @@ describe('resource ticketTypes', () => {
test('list: 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.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
+ client.ticketTypes.list({ 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
});
diff --git a/tests/api-resources/tickets/tags.test.ts b/tests/api-resources/tickets/tags.test.ts
index 1cb6910b..0cae5b55 100644
--- a/tests/api-resources/tickets/tags.test.ts
+++ b/tests/api-resources/tickets/tags.test.ts
@@ -3,17 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource tags', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.tickets.tags.create('64619700005694', {
- id: 'id',
- admin_id: 'admin_id',
- });
+ const responsePromise = client.tickets.tags.create('64619700005694', { id: 'id', admin_id: 'admin_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -24,7 +21,7 @@ describe('resource tags', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.tickets.tags.create('64619700005694', {
+ const response = await client.tickets.tags.create('64619700005694', {
id: 'id',
admin_id: 'admin_id',
'Intercom-Version': '2.11',
@@ -32,9 +29,7 @@ describe('resource tags', () => {
});
test('remove: only required params', async () => {
- const responsePromise = intercom.tickets.tags.remove('64619700005694', '7522907', {
- admin_id: 'admin_id',
- });
+ const responsePromise = client.tickets.tags.remove('64619700005694', '7522907', { admin_id: 'admin_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -45,7 +40,7 @@ describe('resource tags', () => {
});
test('remove: required and optional params', async () => {
- const response = await intercom.tickets.tags.remove('64619700005694', '7522907', {
+ const response = await client.tickets.tags.remove('64619700005694', '7522907', {
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 9b716fad..f71f5dd5 100644
--- a/tests/api-resources/tickets/tickets.test.ts
+++ b/tests/api-resources/tickets/tickets.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource tickets', () => {
test('create: only required params', async () => {
- const responsePromise = intercom.tickets.create({
+ const responsePromise = client.tickets.create({
contacts: [{ id: '6657af026abd0167d9419def' }],
ticket_type_id: 'ticket_type_id',
});
@@ -24,7 +24,7 @@ describe('resource tickets', () => {
});
test('create: required and optional params', async () => {
- const response = await intercom.tickets.create({
+ const response = await client.tickets.create({
contacts: [{ id: '6657af026abd0167d9419def' }],
ticket_type_id: 'ticket_type_id',
company_id: '1234',
@@ -35,7 +35,7 @@ describe('resource tickets', () => {
});
test('reply: only required params', async () => {
- const responsePromise = intercom.tickets.reply('123', {
+ const responsePromise = client.tickets.reply('123', {
body: 'body',
message_type: 'comment',
type: 'user',
@@ -50,7 +50,7 @@ describe('resource tickets', () => {
});
test('reply: required and optional params', async () => {
- const response = await intercom.tickets.reply('123', {
+ const response = await client.tickets.reply('123', {
body: 'body',
message_type: 'comment',
type: 'user',
@@ -61,7 +61,7 @@ describe('resource tickets', () => {
});
test('retrieveById', async () => {
- const responsePromise = intercom.tickets.retrieveById('id');
+ const responsePromise = client.tickets.retrieveById('id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -73,7 +73,7 @@ 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('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.tickets.retrieveById('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -81,16 +81,12 @@ describe('resource tickets', () => {
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(
- 'id',
- { 'Intercom-Version': '2.11' },
- { path: '/_stainless_unknown_path' },
- ),
+ client.tickets.retrieveById('id', { 'Intercom-Version': '2.11' }, { path: '/_stainless_unknown_path' }),
).rejects.toThrow(Intercom.NotFoundError);
});
test('search: only required params', async () => {
- const responsePromise = intercom.tickets.search({ query: {} });
+ const responsePromise = client.tickets.search({ query: {} });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -101,7 +97,7 @@ describe('resource tickets', () => {
});
test('search: required and optional params', async () => {
- const response = await intercom.tickets.search({
+ const response = await client.tickets.search({
query: { field: 'created_at', operator: '=', value: 'value' },
pagination: { per_page: 5, starting_after: 'your-cursor-from-response' },
'Intercom-Version': '2.11',
@@ -109,7 +105,7 @@ describe('resource tickets', () => {
});
test('updateById', async () => {
- const responsePromise = intercom.tickets.updateById('id');
+ const responsePromise = client.tickets.updateById('id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -121,7 +117,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('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
+ await expect(client.tickets.updateById('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
Intercom.NotFoundError,
);
});
@@ -129,7 +125,7 @@ describe('resource tickets', () => {
test('updateById: 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.updateById(
+ client.tickets.updateById(
'id',
{
assignment: { admin_id: '991268839', assignee_id: '991268841' },
diff --git a/tests/api-resources/visitors.test.ts b/tests/api-resources/visitors.test.ts
index 0c57fa61..b3f217b3 100644
--- a/tests/api-resources/visitors.test.ts
+++ b/tests/api-resources/visitors.test.ts
@@ -3,14 +3,14 @@
import Intercom from 'intercom-client';
import { Response } from 'node-fetch';
-const intercom = new Intercom({
+const client = new Intercom({
accessToken: 'My Access Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});
describe('resource visitors', () => {
test('retrieve: only required params', async () => {
- const responsePromise = intercom.visitors.retrieve({ user_id: 'user_id' });
+ const responsePromise = client.visitors.retrieve({ user_id: 'user_id' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -21,11 +21,11 @@ describe('resource visitors', () => {
});
test('retrieve: required and optional params', async () => {
- const response = await intercom.visitors.retrieve({ user_id: 'user_id', 'Intercom-Version': '2.11' });
+ const response = await client.visitors.retrieve({ user_id: 'user_id', 'Intercom-Version': '2.11' });
});
test('update: only required params', async () => {
- const responsePromise = intercom.visitors.update({ body: {} });
+ const responsePromise = client.visitors.update({ body: {} });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -36,11 +36,11 @@ describe('resource visitors', () => {
});
test('update: required and optional params', async () => {
- const response = await intercom.visitors.update({ body: {}, 'Intercom-Version': '2.11' });
+ const response = await client.visitors.update({ body: {}, 'Intercom-Version': '2.11' });
});
test('convert: only required params', async () => {
- const responsePromise = intercom.visitors.convert({ type: 'user', user: {}, visitor: {} });
+ const responsePromise = client.visitors.convert({ type: 'user', user: {}, visitor: {} });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
@@ -51,7 +51,7 @@ describe('resource visitors', () => {
});
test('convert: required and optional params', async () => {
- const response = await intercom.visitors.convert({
+ const response = await client.visitors.convert({
type: 'user',
user: {
id: '8a88a590-e1c3-41e2-a502-e0649dbf721c',
diff --git a/yarn.lock b/yarn.lock
index 648fb3cc..91bd58e5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3518,11 +3518,6 @@ web-streams-polyfill@4.0.0-beta.1:
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.1.tgz#3b19b9817374b7cee06d374ba7eeb3aeb80e8c95"
integrity sha512-3ux37gEX670UUphBF9AMCq8XM6iQ8Ac6A+DSRRjDoRBm1ufCkaCDdNVbaqq60PsEkdNlLKrGtv/YBP4EJXqNtQ==
-web-streams-polyfill@^3.2.1:
- version "3.2.1"
- resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6"
- integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==
-
webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"