diff --git a/api.md b/api.md index f98ac686..8acece46 100644 --- a/api.md +++ b/api.md @@ -15,7 +15,6 @@ Types: - Message - MultipleFilterSearchRequest - Note -- PaginatedResponse - PartAttachment - Reference - SearchRequest @@ -340,6 +339,7 @@ Methods: Types: - NewsItem +- NewsItemListResponse - NewsItemDeleteResponse Methods: @@ -347,7 +347,7 @@ Methods: - client.news.newsItems.create({ ...params }) -> NewsItem - client.news.newsItems.retrieve(id, { ...params }) -> NewsItem - client.news.newsItems.update(id, { ...params }) -> NewsItem -- client.news.newsItems.list({ ...params }) -> PaginatedResponse +- client.news.newsItems.list({ ...params }) -> NewsItemListResponse - client.news.newsItems.delete(id, { ...params }) -> NewsItemDeleteResponse ## Newsfeeds @@ -355,17 +355,22 @@ Methods: Types: - Newsfeed +- NewsfeedListResponse Methods: - client.news.newsfeeds.retrieve(id, { ...params }) -> Newsfeed -- client.news.newsfeeds.list({ ...params }) -> PaginatedResponse +- client.news.newsfeeds.list({ ...params }) -> NewsfeedListResponse ### Items +Types: + +- ItemListResponse + Methods: -- client.news.newsfeeds.items.list(id, { ...params }) -> PaginatedResponse +- client.news.newsfeeds.items.list(id, { ...params }) -> ItemListResponse # Notes diff --git a/src/index.ts b/src/index.ts index ffd4b8d2..fec3f739 100644 --- a/src/index.ts +++ b/src/index.ts @@ -292,6 +292,7 @@ export namespace Intercom { export import Conversations = API.Conversations; export import ConversationListResponse = API.ConversationListResponse; export import ConversationSearchResponse = API.ConversationSearchResponse; + export import ConversationListResponsesCursorPagination = API.ConversationListResponsesCursorPagination; export import ConversationCreateParams = API.ConversationCreateParams; export import ConversationRetrieveParams = API.ConversationRetrieveParams; export import ConversationUpdateParams = API.ConversationUpdateParams; @@ -392,7 +393,6 @@ export namespace Intercom { export import Message = API.Message; export import MultipleFilterSearchRequest = API.MultipleFilterSearchRequest; export import Note = API.Note; - export import PaginatedResponse = API.PaginatedResponse; export import PartAttachment = API.PartAttachment; export import Reference = API.Reference; export import SearchRequest = API.SearchRequest; diff --git a/src/resources/conversations/conversations.ts b/src/resources/conversations/conversations.ts index f3ca0b58..7c189a15 100644 --- a/src/resources/conversations/conversations.ts +++ b/src/resources/conversations/conversations.ts @@ -5,7 +5,6 @@ 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'; @@ -13,7 +12,7 @@ import * as RunAssignmentRulesAPI from './run-assignment-rules'; import * as TagsAPI from './tags'; import * as NewsItemsAPI from '../news/news-items'; import * as NewsfeedsAPI from '../news/newsfeeds/newsfeeds'; -import { type CursorPaginationParams } from '../../pagination'; +import { CursorPagination, type CursorPaginationParams } from '../../pagination'; export class Conversations extends APIResource { tags: TagsAPI.Tags = new TagsAPI.Tags(this._client); @@ -342,6 +341,8 @@ export class Conversations extends APIResource { } } +export class ConversationListResponsesCursorPagination extends CursorPagination {} + /** * A News Item is a content type in Intercom enabling you to announce product * updates, company news, promotions, events and more with your customers. @@ -730,6 +731,7 @@ export interface ConversationSearchParams { export namespace Conversations { export import ConversationListResponse = ConversationsAPI.ConversationListResponse; export import ConversationSearchResponse = ConversationsAPI.ConversationSearchResponse; + export import ConversationListResponsesCursorPagination = ConversationsAPI.ConversationListResponsesCursorPagination; export import ConversationCreateParams = ConversationsAPI.ConversationCreateParams; export import ConversationRetrieveParams = ConversationsAPI.ConversationRetrieveParams; export import ConversationUpdateParams = ConversationsAPI.ConversationUpdateParams; @@ -750,5 +752,3 @@ export namespace Conversations { export import CustomerCreateParams = CustomersAPI.CustomerCreateParams; export import CustomerDeleteParams = CustomersAPI.CustomerDeleteParams; } - -export { ConversationListResponsesCursorPagination }; diff --git a/src/resources/news/index.ts b/src/resources/news/index.ts index 28fb5254..1f665092 100644 --- a/src/resources/news/index.ts +++ b/src/resources/news/index.ts @@ -3,6 +3,7 @@ export { News } from './news'; export { NewsItem, + NewsItemListResponse, NewsItemDeleteResponse, NewsItemCreateParams, NewsItemRetrieveParams, @@ -11,4 +12,10 @@ export { NewsItemDeleteParams, NewsItems, } from './news-items'; -export { Newsfeed, NewsfeedRetrieveParams, NewsfeedListParams, Newsfeeds } from './newsfeeds/index'; +export { + Newsfeed, + NewsfeedListResponse, + NewsfeedRetrieveParams, + NewsfeedListParams, + Newsfeeds, +} from './newsfeeds/index'; diff --git a/src/resources/news/news-items.ts b/src/resources/news/news-items.ts index ff1b642b..ab6635b9 100644 --- a/src/resources/news/news-items.ts +++ b/src/resources/news/news-items.ts @@ -5,6 +5,7 @@ import { isRequestOptions } from '../../core'; import * as Core from '../../core'; import * as NewsItemsAPI from './news-items'; import * as Shared from '../shared'; +import * as NewsfeedsAPI from './newsfeeds/newsfeeds'; export class NewsItems extends APIResource { /** @@ -73,12 +74,12 @@ export class NewsItems extends APIResource { /** * You can fetch a list of all news items */ - list(params?: NewsItemListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; + list(params?: NewsItemListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; list( params: NewsItemListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(params)) { return this.list({}, params); } @@ -224,6 +225,34 @@ export namespace NewsItem { } } +/** + * Paginated Response + */ +export interface NewsItemListResponse { + /** + * An array of Objects + */ + data?: Array; + + /** + * 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?: Shared.CursorPages | null; + + /** + * A count of the total number of objects. + */ + total_count?: number; + + /** + * The type of object + */ + type?: 'list' | 'conversation.list'; +} + /** * Response returned when an object is deleted */ @@ -506,6 +535,7 @@ export interface NewsItemDeleteParams { export namespace NewsItems { export import NewsItem = NewsItemsAPI.NewsItem; + export import NewsItemListResponse = NewsItemsAPI.NewsItemListResponse; export import NewsItemDeleteResponse = NewsItemsAPI.NewsItemDeleteResponse; export import NewsItemCreateParams = NewsItemsAPI.NewsItemCreateParams; export import NewsItemRetrieveParams = NewsItemsAPI.NewsItemRetrieveParams; diff --git a/src/resources/news/news.ts b/src/resources/news/news.ts index 4e08ea1d..bb45b9e1 100644 --- a/src/resources/news/news.ts +++ b/src/resources/news/news.ts @@ -12,6 +12,7 @@ export class News extends APIResource { export namespace News { export import NewsItems = NewsItemsAPI.NewsItems; export import NewsItem = NewsItemsAPI.NewsItem; + export import NewsItemListResponse = NewsItemsAPI.NewsItemListResponse; export import NewsItemDeleteResponse = NewsItemsAPI.NewsItemDeleteResponse; export import NewsItemCreateParams = NewsItemsAPI.NewsItemCreateParams; export import NewsItemRetrieveParams = NewsItemsAPI.NewsItemRetrieveParams; @@ -20,6 +21,7 @@ export namespace News { export import NewsItemDeleteParams = NewsItemsAPI.NewsItemDeleteParams; export import Newsfeeds = NewsfeedsAPI.Newsfeeds; export import Newsfeed = NewsfeedsAPI.Newsfeed; + export import NewsfeedListResponse = NewsfeedsAPI.NewsfeedListResponse; export import NewsfeedRetrieveParams = NewsfeedsAPI.NewsfeedRetrieveParams; export import NewsfeedListParams = NewsfeedsAPI.NewsfeedListParams; } diff --git a/src/resources/news/newsfeeds/index.ts b/src/resources/news/newsfeeds/index.ts index 060cd639..b88068f0 100644 --- a/src/resources/news/newsfeeds/index.ts +++ b/src/resources/news/newsfeeds/index.ts @@ -1,4 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { ItemListParams, Items } from './items'; -export { Newsfeed, NewsfeedRetrieveParams, NewsfeedListParams, Newsfeeds } from './newsfeeds'; +export { ItemListResponse, ItemListParams, Items } from './items'; +export { + Newsfeed, + NewsfeedListResponse, + NewsfeedRetrieveParams, + NewsfeedListParams, + Newsfeeds, +} from './newsfeeds'; diff --git a/src/resources/news/newsfeeds/items.ts b/src/resources/news/newsfeeds/items.ts index 8af3ffb4..95904b2c 100644 --- a/src/resources/news/newsfeeds/items.ts +++ b/src/resources/news/newsfeeds/items.ts @@ -5,22 +5,20 @@ import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; import * as ItemsAPI from './items'; import * as Shared from '../../shared'; +import * as NewsItemsAPI from '../news-items'; +import * as NewsfeedsAPI from './newsfeeds'; export class Items extends APIResource { /** * You can fetch a list of all news items that are live on a given newsfeed */ - list( - id: string, - params?: ItemListParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - list(id: string, options?: Core.RequestOptions): Core.APIPromise; + list(id: string, params?: ItemListParams, options?: Core.RequestOptions): Core.APIPromise; + list(id: string, options?: Core.RequestOptions): Core.APIPromise; list( id: string, params: ItemListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(params)) { return this.list(id, {}, params); } @@ -37,6 +35,34 @@ export class Items extends APIResource { } } +/** + * Paginated Response + */ +export interface ItemListResponse { + /** + * An array of Objects + */ + data?: Array; + + /** + * 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?: Shared.CursorPages | null; + + /** + * A count of the total number of objects. + */ + total_count?: number; + + /** + * The type of object + */ + type?: 'list' | 'conversation.list'; +} + export interface ItemListParams { /** * Intercom API version.By default, it's equal to the version set in the app @@ -64,5 +90,6 @@ export interface ItemListParams { } export namespace Items { + export import ItemListResponse = ItemsAPI.ItemListResponse; export import ItemListParams = ItemsAPI.ItemListParams; } diff --git a/src/resources/news/newsfeeds/newsfeeds.ts b/src/resources/news/newsfeeds/newsfeeds.ts index 9445db6b..5a762628 100644 --- a/src/resources/news/newsfeeds/newsfeeds.ts +++ b/src/resources/news/newsfeeds/newsfeeds.ts @@ -5,6 +5,7 @@ import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; import * as NewsfeedsAPI from './newsfeeds'; import * as Shared from '../../shared'; +import * as NewsItemsAPI from '../news-items'; import * as ItemsAPI from './items'; export class Newsfeeds extends APIResource { @@ -42,12 +43,12 @@ export class Newsfeeds extends APIResource { /** * You can fetch a list of all newsfeeds */ - list(params?: NewsfeedListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; + list(params?: NewsfeedListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; list( params: NewsfeedListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(params)) { return this.list({}, params); } @@ -98,6 +99,34 @@ export interface Newsfeed { updated_at?: number; } +/** + * Paginated Response + */ +export interface NewsfeedListResponse { + /** + * An array of Objects + */ + data?: Array; + + /** + * 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?: Shared.CursorPages | null; + + /** + * A count of the total number of objects. + */ + total_count?: number; + + /** + * The type of object + */ + type?: 'list' | 'conversation.list'; +} + export interface NewsfeedRetrieveParams { /** * Intercom API version.By default, it's equal to the version set in the app @@ -152,8 +181,10 @@ export interface NewsfeedListParams { export namespace Newsfeeds { export import Newsfeed = NewsfeedsAPI.Newsfeed; + export import NewsfeedListResponse = NewsfeedsAPI.NewsfeedListResponse; export import NewsfeedRetrieveParams = NewsfeedsAPI.NewsfeedRetrieveParams; export import NewsfeedListParams = NewsfeedsAPI.NewsfeedListParams; export import Items = ItemsAPI.Items; + export import ItemListResponse = ItemsAPI.ItemListResponse; export import ItemListParams = ItemsAPI.ItemListParams; } diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 34513059..f7886b44 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -3,9 +3,7 @@ import * as Shared from './shared'; import * as SegmentsAPI from './segments'; import * as SubscriptionsAPI from './contacts/subscriptions'; -import * as NewsItemsAPI from './news/news-items'; import * as TicketTypesAPI from './ticket-types/ticket-types'; -import * as NewsfeedsAPI from './news/newsfeeds/newsfeeds'; /** * Admins are teammate accounts that have access to a workspace. @@ -2034,34 +2032,6 @@ export namespace Note { } } -/** - * Paginated Response - */ -export interface PaginatedResponse { - /** - * An array of Objects - */ - data?: Array; - - /** - * 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 */