@heymantle/core-api-client 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/index.d.mts +166 -5
- package/dist/index.d.ts +166 -5
- package/dist/index.js +54 -1
- package/dist/index.mjs +54 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -233,8 +233,9 @@ const { contacts, hasNextPage } = await client.contacts.list({
|
|
|
233
233
|
socialProfileUrl: 'https://linkedin.com/in/johndoe',
|
|
234
234
|
});
|
|
235
235
|
|
|
236
|
-
// Create a contact
|
|
237
|
-
|
|
236
|
+
// Create or update a contact (upsert by email)
|
|
237
|
+
// If a contact with the same email exists, it will be updated
|
|
238
|
+
const { contact, created } = await client.contacts.create({
|
|
238
239
|
name: 'John Doe',
|
|
239
240
|
email: 'john@acme.com',
|
|
240
241
|
phone: '+1-555-123-4567',
|
|
@@ -248,6 +249,7 @@ const { contact } = await client.contacts.create({
|
|
|
248
249
|
{ key: 'website', value: 'https://johndoe.com' },
|
|
249
250
|
],
|
|
250
251
|
});
|
|
252
|
+
console.log(created ? 'New contact created' : 'Existing contact updated');
|
|
251
253
|
|
|
252
254
|
// Update a contact
|
|
253
255
|
const { contact } = await client.contacts.update('contact_123', {
|
package/dist/index.d.mts
CHANGED
|
@@ -403,6 +403,14 @@ interface ContactCreateParams {
|
|
|
403
403
|
*/
|
|
404
404
|
interface ContactUpdateParams extends Partial<ContactCreateParams> {
|
|
405
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* Response from creating/upserting a contact
|
|
408
|
+
*/
|
|
409
|
+
interface ContactCreateResponse {
|
|
410
|
+
contact: Contact;
|
|
411
|
+
/** True if a new contact was created, false if an existing contact was updated */
|
|
412
|
+
created: boolean;
|
|
413
|
+
}
|
|
406
414
|
|
|
407
415
|
/**
|
|
408
416
|
* Subscription entity
|
|
@@ -2196,6 +2204,129 @@ interface CustomDataDeleteParams {
|
|
|
2196
2204
|
key: string;
|
|
2197
2205
|
}
|
|
2198
2206
|
|
|
2207
|
+
/**
|
|
2208
|
+
* User information attached to a timeline comment
|
|
2209
|
+
*/
|
|
2210
|
+
interface TimelineCommentUser {
|
|
2211
|
+
id: string;
|
|
2212
|
+
name?: string;
|
|
2213
|
+
email?: string;
|
|
2214
|
+
}
|
|
2215
|
+
/**
|
|
2216
|
+
* Attachment on a timeline comment
|
|
2217
|
+
*/
|
|
2218
|
+
interface TimelineCommentAttachment {
|
|
2219
|
+
id: string;
|
|
2220
|
+
fileName: string;
|
|
2221
|
+
fileKey: string;
|
|
2222
|
+
fileType: string;
|
|
2223
|
+
fileSize: number;
|
|
2224
|
+
url?: string;
|
|
2225
|
+
}
|
|
2226
|
+
/**
|
|
2227
|
+
* Tagged user on a timeline comment
|
|
2228
|
+
*/
|
|
2229
|
+
interface TimelineCommentTaggedUser {
|
|
2230
|
+
id: string;
|
|
2231
|
+
userId: string;
|
|
2232
|
+
}
|
|
2233
|
+
/**
|
|
2234
|
+
* Timeline comment entity
|
|
2235
|
+
*/
|
|
2236
|
+
interface TimelineComment {
|
|
2237
|
+
id: string;
|
|
2238
|
+
comment?: string;
|
|
2239
|
+
commentHtml?: string;
|
|
2240
|
+
appInstallationId?: string | null;
|
|
2241
|
+
customerId?: string | null;
|
|
2242
|
+
dealId?: string | null;
|
|
2243
|
+
userId?: string | null;
|
|
2244
|
+
user?: TimelineCommentUser | null;
|
|
2245
|
+
originalCommentId?: string | null;
|
|
2246
|
+
attachments?: TimelineCommentAttachment[];
|
|
2247
|
+
taggedUsers?: TimelineCommentTaggedUser[];
|
|
2248
|
+
createdAt: string;
|
|
2249
|
+
updatedAt: string;
|
|
2250
|
+
}
|
|
2251
|
+
/**
|
|
2252
|
+
* Parameters for listing timeline comments
|
|
2253
|
+
*/
|
|
2254
|
+
interface TimelineCommentListParams extends ListParams {
|
|
2255
|
+
/** Filter by app installation ID */
|
|
2256
|
+
appInstallationId?: string;
|
|
2257
|
+
/** Filter by customer ID */
|
|
2258
|
+
customerId?: string;
|
|
2259
|
+
/** Filter by deal ID */
|
|
2260
|
+
dealId?: string;
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2263
|
+
* Response from listing timeline comments
|
|
2264
|
+
*/
|
|
2265
|
+
interface TimelineCommentListResponse extends PaginatedResponse {
|
|
2266
|
+
timelineComments: TimelineComment[];
|
|
2267
|
+
}
|
|
2268
|
+
/**
|
|
2269
|
+
* Attachment input for creating a timeline comment
|
|
2270
|
+
*/
|
|
2271
|
+
interface TimelineCommentAttachmentInput {
|
|
2272
|
+
fileKey: string;
|
|
2273
|
+
fileName: string;
|
|
2274
|
+
fileType: string;
|
|
2275
|
+
fileSize: number;
|
|
2276
|
+
}
|
|
2277
|
+
/**
|
|
2278
|
+
* Tagged user input for creating a timeline comment
|
|
2279
|
+
*/
|
|
2280
|
+
interface TimelineCommentTaggedUserInput {
|
|
2281
|
+
id: string;
|
|
2282
|
+
}
|
|
2283
|
+
/**
|
|
2284
|
+
* Parameters for creating a timeline comment
|
|
2285
|
+
*/
|
|
2286
|
+
interface TimelineCommentCreateParams {
|
|
2287
|
+
/** App installation to associate with the comment */
|
|
2288
|
+
appInstallationId?: string;
|
|
2289
|
+
/** Customer to associate with the comment */
|
|
2290
|
+
customerId?: string;
|
|
2291
|
+
/** Deal to associate with the comment */
|
|
2292
|
+
dealId?: string;
|
|
2293
|
+
/** Plain text version of the comment */
|
|
2294
|
+
comment?: string;
|
|
2295
|
+
/** HTML content of the comment (required) */
|
|
2296
|
+
commentHtml: string;
|
|
2297
|
+
/** File attachments */
|
|
2298
|
+
attachments?: TimelineCommentAttachmentInput[];
|
|
2299
|
+
/** Users to tag in the comment */
|
|
2300
|
+
taggedUsers?: TimelineCommentTaggedUserInput[];
|
|
2301
|
+
}
|
|
2302
|
+
/**
|
|
2303
|
+
* Parameters for updating a timeline comment
|
|
2304
|
+
*/
|
|
2305
|
+
interface TimelineCommentUpdateParams {
|
|
2306
|
+
/** Updated HTML content of the comment */
|
|
2307
|
+
commentHtml: string;
|
|
2308
|
+
/** App event ID to update (optional) */
|
|
2309
|
+
appEventId?: string;
|
|
2310
|
+
/** Deal event ID to update (optional) */
|
|
2311
|
+
dealEventId?: string;
|
|
2312
|
+
}
|
|
2313
|
+
/**
|
|
2314
|
+
* Response from creating a timeline comment
|
|
2315
|
+
*/
|
|
2316
|
+
interface TimelineCommentCreateResponse {
|
|
2317
|
+
timelineComment: TimelineComment;
|
|
2318
|
+
appEventId?: string | null;
|
|
2319
|
+
dealEventId?: string | null;
|
|
2320
|
+
}
|
|
2321
|
+
/**
|
|
2322
|
+
* Response from updating a timeline comment
|
|
2323
|
+
*/
|
|
2324
|
+
interface TimelineCommentUpdateResponse {
|
|
2325
|
+
timelineComment: TimelineComment;
|
|
2326
|
+
appEventId?: string | null;
|
|
2327
|
+
dealEventId?: string | null;
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2199
2330
|
/**
|
|
2200
2331
|
* Resource for managing customers
|
|
2201
2332
|
*/
|
|
@@ -2306,11 +2437,12 @@ declare class ContactsResource extends BaseResource {
|
|
|
2306
2437
|
contact: Contact;
|
|
2307
2438
|
}>;
|
|
2308
2439
|
/**
|
|
2309
|
-
* Create a
|
|
2440
|
+
* Create or update a contact.
|
|
2441
|
+
* If a contact with the same email exists in the organization, it will be updated.
|
|
2442
|
+
* Otherwise, a new contact will be created.
|
|
2443
|
+
* @returns The contact and a boolean indicating if it was newly created
|
|
2310
2444
|
*/
|
|
2311
|
-
create(data: ContactCreateParams): Promise<
|
|
2312
|
-
contact: Contact;
|
|
2313
|
-
}>;
|
|
2445
|
+
create(data: ContactCreateParams): Promise<ContactCreateResponse>;
|
|
2314
2446
|
/**
|
|
2315
2447
|
* Update an existing contact
|
|
2316
2448
|
*/
|
|
@@ -3414,6 +3546,34 @@ declare class CustomDataResource extends BaseResource {
|
|
|
3414
3546
|
del(params: CustomDataDeleteParams): Promise<void>;
|
|
3415
3547
|
}
|
|
3416
3548
|
|
|
3549
|
+
/**
|
|
3550
|
+
* Resource for managing timeline comments
|
|
3551
|
+
*/
|
|
3552
|
+
declare class TimelineCommentsResource extends BaseResource {
|
|
3553
|
+
/**
|
|
3554
|
+
* List timeline comments with optional filters and pagination
|
|
3555
|
+
*/
|
|
3556
|
+
list(params?: TimelineCommentListParams): Promise<TimelineCommentListResponse>;
|
|
3557
|
+
/**
|
|
3558
|
+
* Retrieve a single timeline comment by ID
|
|
3559
|
+
*/
|
|
3560
|
+
retrieve(id: string): Promise<{
|
|
3561
|
+
timelineComment: TimelineComment;
|
|
3562
|
+
}>;
|
|
3563
|
+
/**
|
|
3564
|
+
* Create a new timeline comment
|
|
3565
|
+
*/
|
|
3566
|
+
create(data: TimelineCommentCreateParams): Promise<TimelineCommentCreateResponse>;
|
|
3567
|
+
/**
|
|
3568
|
+
* Update an existing timeline comment
|
|
3569
|
+
*/
|
|
3570
|
+
update(id: string, data: TimelineCommentUpdateParams): Promise<TimelineCommentUpdateResponse>;
|
|
3571
|
+
/**
|
|
3572
|
+
* Delete a timeline comment
|
|
3573
|
+
*/
|
|
3574
|
+
del(id: string): Promise<DeleteResponse>;
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3417
3577
|
/**
|
|
3418
3578
|
* Mantle Core API Client
|
|
3419
3579
|
*
|
|
@@ -3469,6 +3629,7 @@ declare class MantleCoreClient {
|
|
|
3469
3629
|
readonly docs: DocsResource;
|
|
3470
3630
|
readonly entities: EntitiesResource;
|
|
3471
3631
|
readonly customData: CustomDataResource;
|
|
3632
|
+
readonly timelineComments: TimelineCommentsResource;
|
|
3472
3633
|
constructor(config: MantleCoreClientConfig);
|
|
3473
3634
|
/**
|
|
3474
3635
|
* Register a middleware function
|
|
@@ -3757,4 +3918,4 @@ interface RateLimitOptions {
|
|
|
3757
3918
|
*/
|
|
3758
3919
|
declare function createRateLimitMiddleware(options?: RateLimitOptions): Middleware;
|
|
3759
3920
|
|
|
3760
|
-
export { type AccountOwner, type AccountOwnersListResponse, type Affiliate, type AffiliateCommission, type AffiliateCommissionListParams, type AffiliateCommissionListResponse, AffiliateCommissionsResource, type AffiliateListParams, type AffiliateListResponse, type AffiliatePayout, type AffiliatePayoutListParams, type AffiliatePayoutListResponse, AffiliatePayoutsResource, type AffiliateProgram, type AffiliateProgramCreateParams, type AffiliateProgramUpdateParams, AffiliateProgramsResource, type AffiliateReferral, type AffiliateReferralListParams, type AffiliateReferralListResponse, AffiliateReferralsResource, type AffiliateUpdateParams, AffiliatesResource, type Agent, type AgentCreateParams, type AgentListResponse, type AgentResponse, AgentsResource, type App, type AppEvent, type AppEventListParams, type AppEventListResponse, type AppInstallation, type AppInstallationParams, type AppListParams, AppsResource, type AuthRefreshOptions, BaseResource, type Channel, type ChannelCreateParams, type ChannelListParams, ChannelsResource, type Charge, type ChargeListParams, type ChargeListResponse, ChargesResource, CompaniesResource, type Company, type CompanyCreateParams, type CompanyListParams, type CompanyListResponse, type CompanyUpdateParams, type Contact, type ContactCreateParams, type ContactEntity, type ContactListParams, type ContactListResponse, type ContactUpdateParams, ContactsResource, type CustomDataDeleteParams, type CustomDataGetParams, CustomDataResource, type CustomDataResourceType, type CustomDataResponse, type CustomDataSetParams, type CustomField, type CustomFieldCreateParams, type CustomFieldUpdateParams, type Customer, type CustomerCreateParams, type CustomerEntity, type CustomerListParams, type CustomerListResponse, type CustomerRetrieveParams, type CustomerSegment, type CustomerSegmentListParams, type CustomerSegmentListResponse, CustomerSegmentsResource, type CustomerUpdateParams, CustomersResource, type DateRangeType, type Deal, DealActivitiesResource, type DealActivity, type DealActivityCreateParams, type DealActivityUpdateParams, type DealContactInput, type DealCreateParams, type DealCustomerInput, type DealEvent, type DealEventCreateParams, type DealEventCreateResponse, type DealEventListResponse, type DealFlow, type DealFlowCreateParams, type DealFlowUpdateParams, DealFlowsResource, type DealListParams, type DealListResponse, type DealProgression, type DealStage, type DealUpdateParams, DealsResource, type DeleteResponse, type DocCollection, type DocCollectionCreateParams, type DocCollectionUpdateParams, type DocGroup, type DocGroupCreateParams, type DocGroupUpdateParams, type DocPage, type DocPageCreateParams, type DocPageListParams, type DocPageListResponse, type DocPageStatus, type DocPageUpdateParams, type DocTreeNode, type DocTreeResponse, DocsResource, EntitiesResource, type EntitiesSearchParams, type EntitiesSearchResponse, type Entity, type EntityType, type Feature, type FeatureCreateParams, type FeatureUpdateParams, type Flow, type FlowCreateParams, type FlowListParams, type FlowListResponse, type FlowStatus, type FlowUpdateParams, FlowsResource, type HttpMethod, type ListParams, MantleAPIError, MantleAuthenticationError, MantleCoreClient, type MantleCoreClientConfig, MantleNotFoundError, MantlePermissionError, MantleRateLimitError, MantleValidationError, MeResource, type MeResponse, type MessageAttachment, type MetricDataPoint, type MetricType, type MetricsBaseParams, type MetricsGetParams, MetricsResource, type MetricsResponse, type Middleware, type MiddlewareContext, MiddlewareManager, type MiddlewareOptions, type MiddlewareRequest, type MiddlewareResponse, type NextFunction, type Organization, OrganizationResource, type PaginatedResponse, type Plan, type PlanCreateParams, type PlanFeature, type PlanListParams, type PlanListResponse, type PlanUpdateParams, type PlanUsageCharge, type RateLimitOptions, type RequestOptions, type Review, type ReviewCreateParams, type ReviewUpdateParams, type SocialProfile, type SocialProfileType, type Subscription, type SubscriptionListParams, type SubscriptionListResponse, SubscriptionsResource, type Task, type TaskCreateParams, type TaskListParams, type TaskListResponse, type TaskPriority, type TaskStatus, type TaskUpdateParams, type TaskUpdateResponse, TasksResource, type Ticket, type TicketContactData, type TicketCreateParams, type TicketListParams, type TicketListResponse, type TicketMessage, type TicketMessageCreateParams, type TicketMessageUpdateParams, type TicketUpdateParams, TicketsResource, type TimelineEvent, type TimelineListParams, type TimelineListResponse, type TodoItem, type TodoItemCreateParams, type TodoItemInput, type TodoItemListResponse, type TodoItemUpdateParams, type Transaction, type TransactionListParams, type TransactionListResponse, TransactionsResource, type UsageEvent, type UsageEventCreateData, type UsageEventCreateParams, type UsageEventCreateResponse, type UsageEventListParams, type UsageEventListResponse, type UsageEventMetricsParams, UsageEventsResource, type UsageMetric, type UsageMetricCreateParams, type UsageMetricParams, type UsageMetricUpdateParams, type User, type UserListParams, type UserListResponse, UsersResource, type Webhook, type WebhookCreateParams, type WebhookFilter, type WebhookListResponse, type WebhookTopic, type WebhookUpdateParams, WebhooksResource, createAuthRefreshMiddleware, createRateLimitMiddleware };
|
|
3921
|
+
export { type AccountOwner, type AccountOwnersListResponse, type Affiliate, type AffiliateCommission, type AffiliateCommissionListParams, type AffiliateCommissionListResponse, AffiliateCommissionsResource, type AffiliateListParams, type AffiliateListResponse, type AffiliatePayout, type AffiliatePayoutListParams, type AffiliatePayoutListResponse, AffiliatePayoutsResource, type AffiliateProgram, type AffiliateProgramCreateParams, type AffiliateProgramUpdateParams, AffiliateProgramsResource, type AffiliateReferral, type AffiliateReferralListParams, type AffiliateReferralListResponse, AffiliateReferralsResource, type AffiliateUpdateParams, AffiliatesResource, type Agent, type AgentCreateParams, type AgentListResponse, type AgentResponse, AgentsResource, type App, type AppEvent, type AppEventListParams, type AppEventListResponse, type AppInstallation, type AppInstallationParams, type AppListParams, AppsResource, type AuthRefreshOptions, BaseResource, type Channel, type ChannelCreateParams, type ChannelListParams, ChannelsResource, type Charge, type ChargeListParams, type ChargeListResponse, ChargesResource, CompaniesResource, type Company, type CompanyCreateParams, type CompanyListParams, type CompanyListResponse, type CompanyUpdateParams, type Contact, type ContactCreateParams, type ContactCreateResponse, type ContactEntity, type ContactListParams, type ContactListResponse, type ContactUpdateParams, ContactsResource, type CustomDataDeleteParams, type CustomDataGetParams, CustomDataResource, type CustomDataResourceType, type CustomDataResponse, type CustomDataSetParams, type CustomField, type CustomFieldCreateParams, type CustomFieldUpdateParams, type Customer, type CustomerCreateParams, type CustomerEntity, type CustomerListParams, type CustomerListResponse, type CustomerRetrieveParams, type CustomerSegment, type CustomerSegmentListParams, type CustomerSegmentListResponse, CustomerSegmentsResource, type CustomerUpdateParams, CustomersResource, type DateRangeType, type Deal, DealActivitiesResource, type DealActivity, type DealActivityCreateParams, type DealActivityUpdateParams, type DealContactInput, type DealCreateParams, type DealCustomerInput, type DealEvent, type DealEventCreateParams, type DealEventCreateResponse, type DealEventListResponse, type DealFlow, type DealFlowCreateParams, type DealFlowUpdateParams, DealFlowsResource, type DealListParams, type DealListResponse, type DealProgression, type DealStage, type DealUpdateParams, DealsResource, type DeleteResponse, type DocCollection, type DocCollectionCreateParams, type DocCollectionUpdateParams, type DocGroup, type DocGroupCreateParams, type DocGroupUpdateParams, type DocPage, type DocPageCreateParams, type DocPageListParams, type DocPageListResponse, type DocPageStatus, type DocPageUpdateParams, type DocTreeNode, type DocTreeResponse, DocsResource, EntitiesResource, type EntitiesSearchParams, type EntitiesSearchResponse, type Entity, type EntityType, type Feature, type FeatureCreateParams, type FeatureUpdateParams, type Flow, type FlowCreateParams, type FlowListParams, type FlowListResponse, type FlowStatus, type FlowUpdateParams, FlowsResource, type HttpMethod, type ListParams, MantleAPIError, MantleAuthenticationError, MantleCoreClient, type MantleCoreClientConfig, MantleNotFoundError, MantlePermissionError, MantleRateLimitError, MantleValidationError, MeResource, type MeResponse, type MessageAttachment, type MetricDataPoint, type MetricType, type MetricsBaseParams, type MetricsGetParams, MetricsResource, type MetricsResponse, type Middleware, type MiddlewareContext, MiddlewareManager, type MiddlewareOptions, type MiddlewareRequest, type MiddlewareResponse, type NextFunction, type Organization, OrganizationResource, type PaginatedResponse, type Plan, type PlanCreateParams, type PlanFeature, type PlanListParams, type PlanListResponse, type PlanUpdateParams, type PlanUsageCharge, type RateLimitOptions, type RequestOptions, type Review, type ReviewCreateParams, type ReviewUpdateParams, type SocialProfile, type SocialProfileType, type Subscription, type SubscriptionListParams, type SubscriptionListResponse, SubscriptionsResource, type Task, type TaskCreateParams, type TaskListParams, type TaskListResponse, type TaskPriority, type TaskStatus, type TaskUpdateParams, type TaskUpdateResponse, TasksResource, type Ticket, type TicketContactData, type TicketCreateParams, type TicketListParams, type TicketListResponse, type TicketMessage, type TicketMessageCreateParams, type TicketMessageUpdateParams, type TicketUpdateParams, TicketsResource, type TimelineComment, type TimelineCommentAttachment, type TimelineCommentAttachmentInput, type TimelineCommentCreateParams, type TimelineCommentCreateResponse, type TimelineCommentListParams, type TimelineCommentListResponse, type TimelineCommentTaggedUser, type TimelineCommentTaggedUserInput, type TimelineCommentUpdateParams, type TimelineCommentUpdateResponse, type TimelineCommentUser, type TimelineEvent, type TimelineListParams, type TimelineListResponse, type TodoItem, type TodoItemCreateParams, type TodoItemInput, type TodoItemListResponse, type TodoItemUpdateParams, type Transaction, type TransactionListParams, type TransactionListResponse, TransactionsResource, type UsageEvent, type UsageEventCreateData, type UsageEventCreateParams, type UsageEventCreateResponse, type UsageEventListParams, type UsageEventListResponse, type UsageEventMetricsParams, UsageEventsResource, type UsageMetric, type UsageMetricCreateParams, type UsageMetricParams, type UsageMetricUpdateParams, type User, type UserListParams, type UserListResponse, UsersResource, type Webhook, type WebhookCreateParams, type WebhookFilter, type WebhookListResponse, type WebhookTopic, type WebhookUpdateParams, WebhooksResource, createAuthRefreshMiddleware, createRateLimitMiddleware };
|
package/dist/index.d.ts
CHANGED
|
@@ -403,6 +403,14 @@ interface ContactCreateParams {
|
|
|
403
403
|
*/
|
|
404
404
|
interface ContactUpdateParams extends Partial<ContactCreateParams> {
|
|
405
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* Response from creating/upserting a contact
|
|
408
|
+
*/
|
|
409
|
+
interface ContactCreateResponse {
|
|
410
|
+
contact: Contact;
|
|
411
|
+
/** True if a new contact was created, false if an existing contact was updated */
|
|
412
|
+
created: boolean;
|
|
413
|
+
}
|
|
406
414
|
|
|
407
415
|
/**
|
|
408
416
|
* Subscription entity
|
|
@@ -2196,6 +2204,129 @@ interface CustomDataDeleteParams {
|
|
|
2196
2204
|
key: string;
|
|
2197
2205
|
}
|
|
2198
2206
|
|
|
2207
|
+
/**
|
|
2208
|
+
* User information attached to a timeline comment
|
|
2209
|
+
*/
|
|
2210
|
+
interface TimelineCommentUser {
|
|
2211
|
+
id: string;
|
|
2212
|
+
name?: string;
|
|
2213
|
+
email?: string;
|
|
2214
|
+
}
|
|
2215
|
+
/**
|
|
2216
|
+
* Attachment on a timeline comment
|
|
2217
|
+
*/
|
|
2218
|
+
interface TimelineCommentAttachment {
|
|
2219
|
+
id: string;
|
|
2220
|
+
fileName: string;
|
|
2221
|
+
fileKey: string;
|
|
2222
|
+
fileType: string;
|
|
2223
|
+
fileSize: number;
|
|
2224
|
+
url?: string;
|
|
2225
|
+
}
|
|
2226
|
+
/**
|
|
2227
|
+
* Tagged user on a timeline comment
|
|
2228
|
+
*/
|
|
2229
|
+
interface TimelineCommentTaggedUser {
|
|
2230
|
+
id: string;
|
|
2231
|
+
userId: string;
|
|
2232
|
+
}
|
|
2233
|
+
/**
|
|
2234
|
+
* Timeline comment entity
|
|
2235
|
+
*/
|
|
2236
|
+
interface TimelineComment {
|
|
2237
|
+
id: string;
|
|
2238
|
+
comment?: string;
|
|
2239
|
+
commentHtml?: string;
|
|
2240
|
+
appInstallationId?: string | null;
|
|
2241
|
+
customerId?: string | null;
|
|
2242
|
+
dealId?: string | null;
|
|
2243
|
+
userId?: string | null;
|
|
2244
|
+
user?: TimelineCommentUser | null;
|
|
2245
|
+
originalCommentId?: string | null;
|
|
2246
|
+
attachments?: TimelineCommentAttachment[];
|
|
2247
|
+
taggedUsers?: TimelineCommentTaggedUser[];
|
|
2248
|
+
createdAt: string;
|
|
2249
|
+
updatedAt: string;
|
|
2250
|
+
}
|
|
2251
|
+
/**
|
|
2252
|
+
* Parameters for listing timeline comments
|
|
2253
|
+
*/
|
|
2254
|
+
interface TimelineCommentListParams extends ListParams {
|
|
2255
|
+
/** Filter by app installation ID */
|
|
2256
|
+
appInstallationId?: string;
|
|
2257
|
+
/** Filter by customer ID */
|
|
2258
|
+
customerId?: string;
|
|
2259
|
+
/** Filter by deal ID */
|
|
2260
|
+
dealId?: string;
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2263
|
+
* Response from listing timeline comments
|
|
2264
|
+
*/
|
|
2265
|
+
interface TimelineCommentListResponse extends PaginatedResponse {
|
|
2266
|
+
timelineComments: TimelineComment[];
|
|
2267
|
+
}
|
|
2268
|
+
/**
|
|
2269
|
+
* Attachment input for creating a timeline comment
|
|
2270
|
+
*/
|
|
2271
|
+
interface TimelineCommentAttachmentInput {
|
|
2272
|
+
fileKey: string;
|
|
2273
|
+
fileName: string;
|
|
2274
|
+
fileType: string;
|
|
2275
|
+
fileSize: number;
|
|
2276
|
+
}
|
|
2277
|
+
/**
|
|
2278
|
+
* Tagged user input for creating a timeline comment
|
|
2279
|
+
*/
|
|
2280
|
+
interface TimelineCommentTaggedUserInput {
|
|
2281
|
+
id: string;
|
|
2282
|
+
}
|
|
2283
|
+
/**
|
|
2284
|
+
* Parameters for creating a timeline comment
|
|
2285
|
+
*/
|
|
2286
|
+
interface TimelineCommentCreateParams {
|
|
2287
|
+
/** App installation to associate with the comment */
|
|
2288
|
+
appInstallationId?: string;
|
|
2289
|
+
/** Customer to associate with the comment */
|
|
2290
|
+
customerId?: string;
|
|
2291
|
+
/** Deal to associate with the comment */
|
|
2292
|
+
dealId?: string;
|
|
2293
|
+
/** Plain text version of the comment */
|
|
2294
|
+
comment?: string;
|
|
2295
|
+
/** HTML content of the comment (required) */
|
|
2296
|
+
commentHtml: string;
|
|
2297
|
+
/** File attachments */
|
|
2298
|
+
attachments?: TimelineCommentAttachmentInput[];
|
|
2299
|
+
/** Users to tag in the comment */
|
|
2300
|
+
taggedUsers?: TimelineCommentTaggedUserInput[];
|
|
2301
|
+
}
|
|
2302
|
+
/**
|
|
2303
|
+
* Parameters for updating a timeline comment
|
|
2304
|
+
*/
|
|
2305
|
+
interface TimelineCommentUpdateParams {
|
|
2306
|
+
/** Updated HTML content of the comment */
|
|
2307
|
+
commentHtml: string;
|
|
2308
|
+
/** App event ID to update (optional) */
|
|
2309
|
+
appEventId?: string;
|
|
2310
|
+
/** Deal event ID to update (optional) */
|
|
2311
|
+
dealEventId?: string;
|
|
2312
|
+
}
|
|
2313
|
+
/**
|
|
2314
|
+
* Response from creating a timeline comment
|
|
2315
|
+
*/
|
|
2316
|
+
interface TimelineCommentCreateResponse {
|
|
2317
|
+
timelineComment: TimelineComment;
|
|
2318
|
+
appEventId?: string | null;
|
|
2319
|
+
dealEventId?: string | null;
|
|
2320
|
+
}
|
|
2321
|
+
/**
|
|
2322
|
+
* Response from updating a timeline comment
|
|
2323
|
+
*/
|
|
2324
|
+
interface TimelineCommentUpdateResponse {
|
|
2325
|
+
timelineComment: TimelineComment;
|
|
2326
|
+
appEventId?: string | null;
|
|
2327
|
+
dealEventId?: string | null;
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2199
2330
|
/**
|
|
2200
2331
|
* Resource for managing customers
|
|
2201
2332
|
*/
|
|
@@ -2306,11 +2437,12 @@ declare class ContactsResource extends BaseResource {
|
|
|
2306
2437
|
contact: Contact;
|
|
2307
2438
|
}>;
|
|
2308
2439
|
/**
|
|
2309
|
-
* Create a
|
|
2440
|
+
* Create or update a contact.
|
|
2441
|
+
* If a contact with the same email exists in the organization, it will be updated.
|
|
2442
|
+
* Otherwise, a new contact will be created.
|
|
2443
|
+
* @returns The contact and a boolean indicating if it was newly created
|
|
2310
2444
|
*/
|
|
2311
|
-
create(data: ContactCreateParams): Promise<
|
|
2312
|
-
contact: Contact;
|
|
2313
|
-
}>;
|
|
2445
|
+
create(data: ContactCreateParams): Promise<ContactCreateResponse>;
|
|
2314
2446
|
/**
|
|
2315
2447
|
* Update an existing contact
|
|
2316
2448
|
*/
|
|
@@ -3414,6 +3546,34 @@ declare class CustomDataResource extends BaseResource {
|
|
|
3414
3546
|
del(params: CustomDataDeleteParams): Promise<void>;
|
|
3415
3547
|
}
|
|
3416
3548
|
|
|
3549
|
+
/**
|
|
3550
|
+
* Resource for managing timeline comments
|
|
3551
|
+
*/
|
|
3552
|
+
declare class TimelineCommentsResource extends BaseResource {
|
|
3553
|
+
/**
|
|
3554
|
+
* List timeline comments with optional filters and pagination
|
|
3555
|
+
*/
|
|
3556
|
+
list(params?: TimelineCommentListParams): Promise<TimelineCommentListResponse>;
|
|
3557
|
+
/**
|
|
3558
|
+
* Retrieve a single timeline comment by ID
|
|
3559
|
+
*/
|
|
3560
|
+
retrieve(id: string): Promise<{
|
|
3561
|
+
timelineComment: TimelineComment;
|
|
3562
|
+
}>;
|
|
3563
|
+
/**
|
|
3564
|
+
* Create a new timeline comment
|
|
3565
|
+
*/
|
|
3566
|
+
create(data: TimelineCommentCreateParams): Promise<TimelineCommentCreateResponse>;
|
|
3567
|
+
/**
|
|
3568
|
+
* Update an existing timeline comment
|
|
3569
|
+
*/
|
|
3570
|
+
update(id: string, data: TimelineCommentUpdateParams): Promise<TimelineCommentUpdateResponse>;
|
|
3571
|
+
/**
|
|
3572
|
+
* Delete a timeline comment
|
|
3573
|
+
*/
|
|
3574
|
+
del(id: string): Promise<DeleteResponse>;
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3417
3577
|
/**
|
|
3418
3578
|
* Mantle Core API Client
|
|
3419
3579
|
*
|
|
@@ -3469,6 +3629,7 @@ declare class MantleCoreClient {
|
|
|
3469
3629
|
readonly docs: DocsResource;
|
|
3470
3630
|
readonly entities: EntitiesResource;
|
|
3471
3631
|
readonly customData: CustomDataResource;
|
|
3632
|
+
readonly timelineComments: TimelineCommentsResource;
|
|
3472
3633
|
constructor(config: MantleCoreClientConfig);
|
|
3473
3634
|
/**
|
|
3474
3635
|
* Register a middleware function
|
|
@@ -3757,4 +3918,4 @@ interface RateLimitOptions {
|
|
|
3757
3918
|
*/
|
|
3758
3919
|
declare function createRateLimitMiddleware(options?: RateLimitOptions): Middleware;
|
|
3759
3920
|
|
|
3760
|
-
export { type AccountOwner, type AccountOwnersListResponse, type Affiliate, type AffiliateCommission, type AffiliateCommissionListParams, type AffiliateCommissionListResponse, AffiliateCommissionsResource, type AffiliateListParams, type AffiliateListResponse, type AffiliatePayout, type AffiliatePayoutListParams, type AffiliatePayoutListResponse, AffiliatePayoutsResource, type AffiliateProgram, type AffiliateProgramCreateParams, type AffiliateProgramUpdateParams, AffiliateProgramsResource, type AffiliateReferral, type AffiliateReferralListParams, type AffiliateReferralListResponse, AffiliateReferralsResource, type AffiliateUpdateParams, AffiliatesResource, type Agent, type AgentCreateParams, type AgentListResponse, type AgentResponse, AgentsResource, type App, type AppEvent, type AppEventListParams, type AppEventListResponse, type AppInstallation, type AppInstallationParams, type AppListParams, AppsResource, type AuthRefreshOptions, BaseResource, type Channel, type ChannelCreateParams, type ChannelListParams, ChannelsResource, type Charge, type ChargeListParams, type ChargeListResponse, ChargesResource, CompaniesResource, type Company, type CompanyCreateParams, type CompanyListParams, type CompanyListResponse, type CompanyUpdateParams, type Contact, type ContactCreateParams, type ContactEntity, type ContactListParams, type ContactListResponse, type ContactUpdateParams, ContactsResource, type CustomDataDeleteParams, type CustomDataGetParams, CustomDataResource, type CustomDataResourceType, type CustomDataResponse, type CustomDataSetParams, type CustomField, type CustomFieldCreateParams, type CustomFieldUpdateParams, type Customer, type CustomerCreateParams, type CustomerEntity, type CustomerListParams, type CustomerListResponse, type CustomerRetrieveParams, type CustomerSegment, type CustomerSegmentListParams, type CustomerSegmentListResponse, CustomerSegmentsResource, type CustomerUpdateParams, CustomersResource, type DateRangeType, type Deal, DealActivitiesResource, type DealActivity, type DealActivityCreateParams, type DealActivityUpdateParams, type DealContactInput, type DealCreateParams, type DealCustomerInput, type DealEvent, type DealEventCreateParams, type DealEventCreateResponse, type DealEventListResponse, type DealFlow, type DealFlowCreateParams, type DealFlowUpdateParams, DealFlowsResource, type DealListParams, type DealListResponse, type DealProgression, type DealStage, type DealUpdateParams, DealsResource, type DeleteResponse, type DocCollection, type DocCollectionCreateParams, type DocCollectionUpdateParams, type DocGroup, type DocGroupCreateParams, type DocGroupUpdateParams, type DocPage, type DocPageCreateParams, type DocPageListParams, type DocPageListResponse, type DocPageStatus, type DocPageUpdateParams, type DocTreeNode, type DocTreeResponse, DocsResource, EntitiesResource, type EntitiesSearchParams, type EntitiesSearchResponse, type Entity, type EntityType, type Feature, type FeatureCreateParams, type FeatureUpdateParams, type Flow, type FlowCreateParams, type FlowListParams, type FlowListResponse, type FlowStatus, type FlowUpdateParams, FlowsResource, type HttpMethod, type ListParams, MantleAPIError, MantleAuthenticationError, MantleCoreClient, type MantleCoreClientConfig, MantleNotFoundError, MantlePermissionError, MantleRateLimitError, MantleValidationError, MeResource, type MeResponse, type MessageAttachment, type MetricDataPoint, type MetricType, type MetricsBaseParams, type MetricsGetParams, MetricsResource, type MetricsResponse, type Middleware, type MiddlewareContext, MiddlewareManager, type MiddlewareOptions, type MiddlewareRequest, type MiddlewareResponse, type NextFunction, type Organization, OrganizationResource, type PaginatedResponse, type Plan, type PlanCreateParams, type PlanFeature, type PlanListParams, type PlanListResponse, type PlanUpdateParams, type PlanUsageCharge, type RateLimitOptions, type RequestOptions, type Review, type ReviewCreateParams, type ReviewUpdateParams, type SocialProfile, type SocialProfileType, type Subscription, type SubscriptionListParams, type SubscriptionListResponse, SubscriptionsResource, type Task, type TaskCreateParams, type TaskListParams, type TaskListResponse, type TaskPriority, type TaskStatus, type TaskUpdateParams, type TaskUpdateResponse, TasksResource, type Ticket, type TicketContactData, type TicketCreateParams, type TicketListParams, type TicketListResponse, type TicketMessage, type TicketMessageCreateParams, type TicketMessageUpdateParams, type TicketUpdateParams, TicketsResource, type TimelineEvent, type TimelineListParams, type TimelineListResponse, type TodoItem, type TodoItemCreateParams, type TodoItemInput, type TodoItemListResponse, type TodoItemUpdateParams, type Transaction, type TransactionListParams, type TransactionListResponse, TransactionsResource, type UsageEvent, type UsageEventCreateData, type UsageEventCreateParams, type UsageEventCreateResponse, type UsageEventListParams, type UsageEventListResponse, type UsageEventMetricsParams, UsageEventsResource, type UsageMetric, type UsageMetricCreateParams, type UsageMetricParams, type UsageMetricUpdateParams, type User, type UserListParams, type UserListResponse, UsersResource, type Webhook, type WebhookCreateParams, type WebhookFilter, type WebhookListResponse, type WebhookTopic, type WebhookUpdateParams, WebhooksResource, createAuthRefreshMiddleware, createRateLimitMiddleware };
|
|
3921
|
+
export { type AccountOwner, type AccountOwnersListResponse, type Affiliate, type AffiliateCommission, type AffiliateCommissionListParams, type AffiliateCommissionListResponse, AffiliateCommissionsResource, type AffiliateListParams, type AffiliateListResponse, type AffiliatePayout, type AffiliatePayoutListParams, type AffiliatePayoutListResponse, AffiliatePayoutsResource, type AffiliateProgram, type AffiliateProgramCreateParams, type AffiliateProgramUpdateParams, AffiliateProgramsResource, type AffiliateReferral, type AffiliateReferralListParams, type AffiliateReferralListResponse, AffiliateReferralsResource, type AffiliateUpdateParams, AffiliatesResource, type Agent, type AgentCreateParams, type AgentListResponse, type AgentResponse, AgentsResource, type App, type AppEvent, type AppEventListParams, type AppEventListResponse, type AppInstallation, type AppInstallationParams, type AppListParams, AppsResource, type AuthRefreshOptions, BaseResource, type Channel, type ChannelCreateParams, type ChannelListParams, ChannelsResource, type Charge, type ChargeListParams, type ChargeListResponse, ChargesResource, CompaniesResource, type Company, type CompanyCreateParams, type CompanyListParams, type CompanyListResponse, type CompanyUpdateParams, type Contact, type ContactCreateParams, type ContactCreateResponse, type ContactEntity, type ContactListParams, type ContactListResponse, type ContactUpdateParams, ContactsResource, type CustomDataDeleteParams, type CustomDataGetParams, CustomDataResource, type CustomDataResourceType, type CustomDataResponse, type CustomDataSetParams, type CustomField, type CustomFieldCreateParams, type CustomFieldUpdateParams, type Customer, type CustomerCreateParams, type CustomerEntity, type CustomerListParams, type CustomerListResponse, type CustomerRetrieveParams, type CustomerSegment, type CustomerSegmentListParams, type CustomerSegmentListResponse, CustomerSegmentsResource, type CustomerUpdateParams, CustomersResource, type DateRangeType, type Deal, DealActivitiesResource, type DealActivity, type DealActivityCreateParams, type DealActivityUpdateParams, type DealContactInput, type DealCreateParams, type DealCustomerInput, type DealEvent, type DealEventCreateParams, type DealEventCreateResponse, type DealEventListResponse, type DealFlow, type DealFlowCreateParams, type DealFlowUpdateParams, DealFlowsResource, type DealListParams, type DealListResponse, type DealProgression, type DealStage, type DealUpdateParams, DealsResource, type DeleteResponse, type DocCollection, type DocCollectionCreateParams, type DocCollectionUpdateParams, type DocGroup, type DocGroupCreateParams, type DocGroupUpdateParams, type DocPage, type DocPageCreateParams, type DocPageListParams, type DocPageListResponse, type DocPageStatus, type DocPageUpdateParams, type DocTreeNode, type DocTreeResponse, DocsResource, EntitiesResource, type EntitiesSearchParams, type EntitiesSearchResponse, type Entity, type EntityType, type Feature, type FeatureCreateParams, type FeatureUpdateParams, type Flow, type FlowCreateParams, type FlowListParams, type FlowListResponse, type FlowStatus, type FlowUpdateParams, FlowsResource, type HttpMethod, type ListParams, MantleAPIError, MantleAuthenticationError, MantleCoreClient, type MantleCoreClientConfig, MantleNotFoundError, MantlePermissionError, MantleRateLimitError, MantleValidationError, MeResource, type MeResponse, type MessageAttachment, type MetricDataPoint, type MetricType, type MetricsBaseParams, type MetricsGetParams, MetricsResource, type MetricsResponse, type Middleware, type MiddlewareContext, MiddlewareManager, type MiddlewareOptions, type MiddlewareRequest, type MiddlewareResponse, type NextFunction, type Organization, OrganizationResource, type PaginatedResponse, type Plan, type PlanCreateParams, type PlanFeature, type PlanListParams, type PlanListResponse, type PlanUpdateParams, type PlanUsageCharge, type RateLimitOptions, type RequestOptions, type Review, type ReviewCreateParams, type ReviewUpdateParams, type SocialProfile, type SocialProfileType, type Subscription, type SubscriptionListParams, type SubscriptionListResponse, SubscriptionsResource, type Task, type TaskCreateParams, type TaskListParams, type TaskListResponse, type TaskPriority, type TaskStatus, type TaskUpdateParams, type TaskUpdateResponse, TasksResource, type Ticket, type TicketContactData, type TicketCreateParams, type TicketListParams, type TicketListResponse, type TicketMessage, type TicketMessageCreateParams, type TicketMessageUpdateParams, type TicketUpdateParams, TicketsResource, type TimelineComment, type TimelineCommentAttachment, type TimelineCommentAttachmentInput, type TimelineCommentCreateParams, type TimelineCommentCreateResponse, type TimelineCommentListParams, type TimelineCommentListResponse, type TimelineCommentTaggedUser, type TimelineCommentTaggedUserInput, type TimelineCommentUpdateParams, type TimelineCommentUpdateResponse, type TimelineCommentUser, type TimelineEvent, type TimelineListParams, type TimelineListResponse, type TodoItem, type TodoItemCreateParams, type TodoItemInput, type TodoItemListResponse, type TodoItemUpdateParams, type Transaction, type TransactionListParams, type TransactionListResponse, TransactionsResource, type UsageEvent, type UsageEventCreateData, type UsageEventCreateParams, type UsageEventCreateResponse, type UsageEventListParams, type UsageEventListResponse, type UsageEventMetricsParams, UsageEventsResource, type UsageMetric, type UsageMetricCreateParams, type UsageMetricParams, type UsageMetricUpdateParams, type User, type UserListParams, type UserListResponse, UsersResource, type Webhook, type WebhookCreateParams, type WebhookFilter, type WebhookListResponse, type WebhookTopic, type WebhookUpdateParams, WebhooksResource, createAuthRefreshMiddleware, createRateLimitMiddleware };
|
package/dist/index.js
CHANGED
|
@@ -423,7 +423,10 @@ var ContactsResource = class extends BaseResource {
|
|
|
423
423
|
return this.get(`/contacts/${contactId}`);
|
|
424
424
|
}
|
|
425
425
|
/**
|
|
426
|
-
* Create a
|
|
426
|
+
* Create or update a contact.
|
|
427
|
+
* If a contact with the same email exists in the organization, it will be updated.
|
|
428
|
+
* Otherwise, a new contact will be created.
|
|
429
|
+
* @returns The contact and a boolean indicating if it was newly created
|
|
427
430
|
*/
|
|
428
431
|
async create(data) {
|
|
429
432
|
return this.post("/contacts", data);
|
|
@@ -1961,6 +1964,55 @@ var CustomDataResource = class extends BaseResource {
|
|
|
1961
1964
|
}
|
|
1962
1965
|
};
|
|
1963
1966
|
|
|
1967
|
+
// src/resources/timelineComments.ts
|
|
1968
|
+
var TimelineCommentsResource = class extends BaseResource {
|
|
1969
|
+
/**
|
|
1970
|
+
* List timeline comments with optional filters and pagination
|
|
1971
|
+
*/
|
|
1972
|
+
async list(params) {
|
|
1973
|
+
const response = await this.get(
|
|
1974
|
+
"/timeline_comments",
|
|
1975
|
+
params
|
|
1976
|
+
);
|
|
1977
|
+
return {
|
|
1978
|
+
timelineComments: response.timelineComments || [],
|
|
1979
|
+
hasNextPage: response.hasNextPage || false,
|
|
1980
|
+
hasPreviousPage: response.hasPreviousPage || false,
|
|
1981
|
+
total: response.total,
|
|
1982
|
+
cursor: response.cursor
|
|
1983
|
+
};
|
|
1984
|
+
}
|
|
1985
|
+
/**
|
|
1986
|
+
* Retrieve a single timeline comment by ID
|
|
1987
|
+
*/
|
|
1988
|
+
async retrieve(id) {
|
|
1989
|
+
return this.get(
|
|
1990
|
+
`/timeline_comments/${id}`
|
|
1991
|
+
);
|
|
1992
|
+
}
|
|
1993
|
+
/**
|
|
1994
|
+
* Create a new timeline comment
|
|
1995
|
+
*/
|
|
1996
|
+
async create(data) {
|
|
1997
|
+
return this.post("/timeline_comments", data);
|
|
1998
|
+
}
|
|
1999
|
+
/**
|
|
2000
|
+
* Update an existing timeline comment
|
|
2001
|
+
*/
|
|
2002
|
+
async update(id, data) {
|
|
2003
|
+
return this.put(
|
|
2004
|
+
`/timeline_comments/${id}`,
|
|
2005
|
+
data
|
|
2006
|
+
);
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* Delete a timeline comment
|
|
2010
|
+
*/
|
|
2011
|
+
async del(id) {
|
|
2012
|
+
return this._delete(`/timeline_comments/${id}`);
|
|
2013
|
+
}
|
|
2014
|
+
};
|
|
2015
|
+
|
|
1964
2016
|
// src/client.ts
|
|
1965
2017
|
var MantleCoreClient = class {
|
|
1966
2018
|
constructor(config) {
|
|
@@ -2013,6 +2065,7 @@ var MantleCoreClient = class {
|
|
|
2013
2065
|
this.docs = new DocsResource(this);
|
|
2014
2066
|
this.entities = new EntitiesResource(this);
|
|
2015
2067
|
this.customData = new CustomDataResource(this);
|
|
2068
|
+
this.timelineComments = new TimelineCommentsResource(this);
|
|
2016
2069
|
}
|
|
2017
2070
|
/**
|
|
2018
2071
|
* Register a middleware function
|
package/dist/index.mjs
CHANGED
|
@@ -357,7 +357,10 @@ var ContactsResource = class extends BaseResource {
|
|
|
357
357
|
return this.get(`/contacts/${contactId}`);
|
|
358
358
|
}
|
|
359
359
|
/**
|
|
360
|
-
* Create a
|
|
360
|
+
* Create or update a contact.
|
|
361
|
+
* If a contact with the same email exists in the organization, it will be updated.
|
|
362
|
+
* Otherwise, a new contact will be created.
|
|
363
|
+
* @returns The contact and a boolean indicating if it was newly created
|
|
361
364
|
*/
|
|
362
365
|
async create(data) {
|
|
363
366
|
return this.post("/contacts", data);
|
|
@@ -1895,6 +1898,55 @@ var CustomDataResource = class extends BaseResource {
|
|
|
1895
1898
|
}
|
|
1896
1899
|
};
|
|
1897
1900
|
|
|
1901
|
+
// src/resources/timelineComments.ts
|
|
1902
|
+
var TimelineCommentsResource = class extends BaseResource {
|
|
1903
|
+
/**
|
|
1904
|
+
* List timeline comments with optional filters and pagination
|
|
1905
|
+
*/
|
|
1906
|
+
async list(params) {
|
|
1907
|
+
const response = await this.get(
|
|
1908
|
+
"/timeline_comments",
|
|
1909
|
+
params
|
|
1910
|
+
);
|
|
1911
|
+
return {
|
|
1912
|
+
timelineComments: response.timelineComments || [],
|
|
1913
|
+
hasNextPage: response.hasNextPage || false,
|
|
1914
|
+
hasPreviousPage: response.hasPreviousPage || false,
|
|
1915
|
+
total: response.total,
|
|
1916
|
+
cursor: response.cursor
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* Retrieve a single timeline comment by ID
|
|
1921
|
+
*/
|
|
1922
|
+
async retrieve(id) {
|
|
1923
|
+
return this.get(
|
|
1924
|
+
`/timeline_comments/${id}`
|
|
1925
|
+
);
|
|
1926
|
+
}
|
|
1927
|
+
/**
|
|
1928
|
+
* Create a new timeline comment
|
|
1929
|
+
*/
|
|
1930
|
+
async create(data) {
|
|
1931
|
+
return this.post("/timeline_comments", data);
|
|
1932
|
+
}
|
|
1933
|
+
/**
|
|
1934
|
+
* Update an existing timeline comment
|
|
1935
|
+
*/
|
|
1936
|
+
async update(id, data) {
|
|
1937
|
+
return this.put(
|
|
1938
|
+
`/timeline_comments/${id}`,
|
|
1939
|
+
data
|
|
1940
|
+
);
|
|
1941
|
+
}
|
|
1942
|
+
/**
|
|
1943
|
+
* Delete a timeline comment
|
|
1944
|
+
*/
|
|
1945
|
+
async del(id) {
|
|
1946
|
+
return this._delete(`/timeline_comments/${id}`);
|
|
1947
|
+
}
|
|
1948
|
+
};
|
|
1949
|
+
|
|
1898
1950
|
// src/client.ts
|
|
1899
1951
|
var MantleCoreClient = class {
|
|
1900
1952
|
constructor(config) {
|
|
@@ -1947,6 +1999,7 @@ var MantleCoreClient = class {
|
|
|
1947
1999
|
this.docs = new DocsResource(this);
|
|
1948
2000
|
this.entities = new EntitiesResource(this);
|
|
1949
2001
|
this.customData = new CustomDataResource(this);
|
|
2002
|
+
this.timelineComments = new TimelineCommentsResource(this);
|
|
1950
2003
|
}
|
|
1951
2004
|
/**
|
|
1952
2005
|
* Register a middleware function
|