Skip to content

Commit

Permalink
release: 0.1.0 (#409)
Browse files Browse the repository at this point in the history
* chore: go live (#410)

* chore: update SDK settings (#411)

* feat(api): update via SDK Studio (#412)

* feat(api): update via SDK Studio (#414)

* release: 0.1.0

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
  • Loading branch information
stainless-app[bot] authored Jul 17, 2024
1 parent 6471160 commit d568878
Show file tree
Hide file tree
Showing 36 changed files with 151 additions and 190 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- v3
- next

jobs:
lint:
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/create-releases.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/handle-release-pr-title-edit.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# workflow for re-running publishing to NPM in case it fails for some reason
# you can run this workflow by navigating to https://www.github.com/intercom/intercom-node/actions/workflows/publish-npm.yml
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to NPM in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/intercom/intercom-node/actions/workflows/publish-npm.yml
name: Publish NPM
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
NPM_TOKEN: ${{ secrets.INTERCOM_NPM_TOKEN || secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.prism.log
node_modules
yarn-error.log
codegen.log
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.1"
".": "0.1.0"
}
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Changelog

## 0.1.0 (2024-07-17)

Full Changelog: [v0.0.1...v0.1.0](https://github.com/intercom/intercom-node/compare/v0.0.1...v0.1.0)

### Features

* **api:** OpenAPI spec update ([1a8a867](https://github.com/intercom/intercom-node/commit/1a8a8675934f0601126350b5e3e0ead3a1cebcf3))
* **api:** OpenAPI spec update ([1e478f3](https://github.com/intercom/intercom-node/commit/1e478f3d60d5c3de15525fda5e13cd05fb9dfd40))
* **api:** update via SDK Studio ([6471160](https://github.com/intercom/intercom-node/commit/64711607bff8fd3f8412d54c53c15aac7cf4d052))
* **api:** update via SDK Studio ([536cfac](https://github.com/intercom/intercom-node/commit/536cfac86eee9ef93b7b81d5ae788bc93d25efda))
* **api:** update via SDK Studio ([12c2c09](https://github.com/intercom/intercom-node/commit/12c2c09d937e5f5e75632a36b1164bd8aa378c8d))
* **api:** update via SDK Studio ([28e8e5f](https://github.com/intercom/intercom-node/commit/28e8e5f1c6b27814e23586a4fb929f8fe8a723ba))
* **api:** update via SDK Studio ([e64afcd](https://github.com/intercom/intercom-node/commit/e64afcd5a1d27dbe3198ea3b36ac355e3acd8dcf))
* **api:** update via SDK Studio ([f74126d](https://github.com/intercom/intercom-node/commit/f74126d5b78c6dc9f9fe221cbaf85bb50ed4cd54))
* **api:** update via SDK Studio ([62e438d](https://github.com/intercom/intercom-node/commit/62e438d68b0ddf19ed2bf3e5f465c377429d1019))
* **api:** update via SDK Studio ([29c13ed](https://github.com/intercom/intercom-node/commit/29c13edfd02451cfcf5e57f22a75db01aff33914))
* **api:** update via SDK Studio ([ab7812c](https://github.com/intercom/intercom-node/commit/ab7812c8fcaa554ceea8503e41182ffcc308fb8b))
* **api:** update via SDK Studio ([2a37e9d](https://github.com/intercom/intercom-node/commit/2a37e9d1b40d2b6039eb5c6c9c4e8017174eaad3))
* **api:** update via SDK Studio ([e3ac97a](https://github.com/intercom/intercom-node/commit/e3ac97a790142f89f486271785bde4371dc16859))
* **api:** update via SDK Studio ([f39fc52](https://github.com/intercom/intercom-node/commit/f39fc52dbc8296f6162b04621b6f481ab72f3059))
* **api:** update via SDK Studio ([8768954](https://github.com/intercom/intercom-node/commit/87689549c0987467a2121256b2dcd92718544a42))
* **api:** update via SDK Studio ([8470cf4](https://github.com/intercom/intercom-node/commit/8470cf423d6fe7830338995a4e09b1293ac5496a))
* **api:** update via SDK Studio ([dca56d2](https://github.com/intercom/intercom-node/commit/dca56d2f9ec4cdcf54336af92b3f0b23e6d9d93a))
* **api:** update via SDK Studio ([768ce13](https://github.com/intercom/intercom-node/commit/768ce13689945ebcbc11f83839f1edb3fb4f92b5))
* **api:** update via SDK Studio ([#412](https://github.com/intercom/intercom-node/issues/412)) ([6487a76](https://github.com/intercom/intercom-node/commit/6487a76337ab7486478262537b290de94db8070d))
* **api:** update via SDK Studio ([#414](https://github.com/intercom/intercom-node/issues/414)) ([7497e9b](https://github.com/intercom/intercom-node/commit/7497e9b0f277a2544605987a4d798596996416a4))


### Chores

* go live ([#410](https://github.com/intercom/intercom-node/issues/410)) ([9e9253f](https://github.com/intercom/intercom-node/commit/9e9253fa6e5a26378e2dca6ba6fa8edeca5749e2))
* update SDK settings ([153050a](https://github.com/intercom/intercom-node/commit/153050a1b87b52ab66930c4ede96e5fb8bfb571d))
* update SDK settings ([#411](https://github.com/intercom/intercom-node/issues/411)) ([6443bf8](https://github.com/intercom/intercom-node/commit/6443bf80a90d7377bb40b07ea4bc0d5f7b0f1a07))
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@

This library provides convenient access to the Intercom REST API from server-side TypeScript or JavaScript.

The REST API documentation can be found [on developers.intercom.com](https://developers.intercom.com). The full API of this library can be found in [api.md](api.md).
The REST API documentation can be found on [developers.intercom.com](https://developers.intercom.com). The full API of this library can be found in [api.md](api.md).

It is generated with [Stainless](https://www.stainlessapi.com/).

## Installation

```sh
npm install git+ssh://[email protected]:intercom/intercom-node.git
npm install intercom-client
```

> [!NOTE]
> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install intercom-client`
## Usage

The full API of this library can be found in [api.md](api.md).
Expand Down Expand Up @@ -284,14 +281,6 @@ TypeScript >= 4.5 is supported.

The following runtimes are supported:

- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
- Deno v1.28.0 or higher, using `import Intercom from "npm:intercom-client"`.
- Bun 1.0 or later.
- Cloudflare Workers.
- Vercel Edge Runtime.
- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
- Nitro v2.6 or greater.

Note that React Native is not supported at this time.

If you are interested in other runtime environments, please open or upvote an issue on GitHub.
4 changes: 0 additions & 4 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

errors=()

if [ -z "${STAINLESS_API_KEY}" ]; then
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
fi

if [ -z "${NPM_TOKEN}" ]; then
errors+=("The INTERCOM_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "intercom-client",
"version": "0.0.1",
"version": "0.1.0",
"description": "The official TypeScript library for the Intercom API",
"author": "Intercom <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ export namespace Intercom {
export import Conversations = API.Conversations;
export import ConversationList = API.ConversationList;
export import ConversationListResponse = API.ConversationListResponse;
export import ConversationListResponsesCursorPagination = API.ConversationListResponsesCursorPagination;
export import ConversationCreateParams = API.ConversationCreateParams;
export import ConversationRetrieveParams = API.ConversationRetrieveParams;
export import ConversationUpdateParams = API.ConversationUpdateParams;
Expand Down
8 changes: 4 additions & 4 deletions src/resources/conversations/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import { isRequestOptions } from '../../core';
import * as Core from '../../core';
import * as ConversationsAPI from './conversations';
import * as Shared from '../shared';
import { ConversationListResponsesCursorPagination } from '../shared';
import * as CustomersAPI from './customers';
import * as PartsAPI from './parts';
import * as ReplyAPI from './reply';
import * as RunAssignmentRulesAPI from './run-assignment-rules';
import * as TagsAPI from './tags';
import * as NewsItemsAPI from '../news/news-items';
import * as NewsfeedsAPI from '../news/newsfeeds/newsfeeds';
import { CursorPagination, type CursorPaginationParams } from '../../pagination';
import { type CursorPaginationParams } from '../../pagination';

export class Conversations extends APIResource {
tags: TagsAPI.Tags = new TagsAPI.Tags(this._client);
Expand Down Expand Up @@ -338,8 +339,6 @@ export class Conversations extends APIResource {
}
}

export class ConversationListResponsesCursorPagination extends CursorPagination<ConversationListResponse> {}

/**
* Conversations are how you can communicate with users in Intercom. They are
* created when a contact replies to an outbound message, or when one admin
Expand Down Expand Up @@ -728,7 +727,6 @@ export interface ConversationSearchParams {
export namespace Conversations {
export import ConversationList = ConversationsAPI.ConversationList;
export import ConversationListResponse = ConversationsAPI.ConversationListResponse;
export import ConversationListResponsesCursorPagination = ConversationsAPI.ConversationListResponsesCursorPagination;
export import ConversationCreateParams = ConversationsAPI.ConversationCreateParams;
export import ConversationRetrieveParams = ConversationsAPI.ConversationRetrieveParams;
export import ConversationUpdateParams = ConversationsAPI.ConversationUpdateParams;
Expand All @@ -749,3 +747,5 @@ export namespace Conversations {
export import CustomerCreateParams = CustomersAPI.CustomerCreateParams;
export import CustomerDeleteParams = CustomersAPI.CustomerDeleteParams;
}

export { ConversationListResponsesCursorPagination };
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.0.1'; // x-release-please-version
export const VERSION = '0.1.0'; // x-release-please-version
6 changes: 3 additions & 3 deletions tests/api-resources/admins/activity-logs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const intercom = new Intercom({

describe('resource activityLogs', () => {
test('list: only required params', async () => {
const responsePromise = intercom.admins.activityLogs.list({ created_at_after: 'string' });
const responsePromise = intercom.admins.activityLogs.list({ created_at_after: 'created_at_after' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand All @@ -22,8 +22,8 @@ describe('resource activityLogs', () => {

test('list: required and optional params', async () => {
const response = await intercom.admins.activityLogs.list({
created_at_after: 'string',
created_at_before: 'string',
created_at_after: 'created_at_after',
created_at_before: 'created_at_before',
'Intercom-Version': '2.11',
});
});
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/articles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ describe('resource articles', () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
intercom.articles.search(
{ help_center_id: 0, highlight: true, phrase: 'string', state: 'string', 'Intercom-Version': '2.11' },
{ help_center_id: 0, highlight: true, phrase: 'phrase', state: 'state', 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Intercom.NotFoundError);
Expand Down
12 changes: 6 additions & 6 deletions tests/api-resources/companies/companies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('resource companies', () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
intercom.companies.list(
{ order: 'string', page: 0, per_page: 0, 'Intercom-Version': '2.11' },
{ order: 'order', page: 0, per_page: 0, 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Intercom.NotFoundError);
Expand Down Expand Up @@ -188,12 +188,12 @@ describe('resource companies', () => {
await expect(
intercom.companies.retrieveList(
{
company_id: 'string',
name: 'string',
company_id: 'company_id',
name: 'name',
page: 0,
per_page: 0,
segment_id: 'string',
tag_id: 'string',
segment_id: 'segment_id',
tag_id: 'tag_id',
'Intercom-Version': '2.11',
},
{ path: '/_stainless_unknown_path' },
Expand Down Expand Up @@ -223,7 +223,7 @@ describe('resource companies', () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
intercom.companies.scroll(
{ scroll_param: 'string', 'Intercom-Version': '2.11' },
{ scroll_param: 'scroll_param', 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Intercom.NotFoundError);
Expand Down
10 changes: 5 additions & 5 deletions tests/api-resources/contacts/companies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const intercom = new Intercom({

describe('resource companies', () => {
test('create: only required params', async () => {
const responsePromise = intercom.contacts.companies.create('string', {
const responsePromise = intercom.contacts.companies.create('contact_id', {
company_id: '6657add46abd0167d9419cd2',
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -23,14 +23,14 @@ describe('resource companies', () => {
});

test('create: required and optional params', async () => {
const response = await intercom.contacts.companies.create('string', {
const response = await intercom.contacts.companies.create('contact_id', {
company_id: '6657add46abd0167d9419cd2',
'Intercom-Version': '2.11',
});
});

test('list', async () => {
const responsePromise = intercom.contacts.companies.list('string');
const responsePromise = intercom.contacts.companies.list('contact_id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand All @@ -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('string', { path: '/_stainless_unknown_path' }),
intercom.contacts.companies.list('contact_id', { 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(
'string',
'contact_id',
{ 'Intercom-Version': '2.11' },
{ path: '/_stainless_unknown_path' },
),
Expand Down
Loading

0 comments on commit d568878

Please sign in to comment.