@heymantle/core-api-client 0.1.14 → 0.1.16
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/dist/index.d.mts +137 -6
- package/dist/index.d.ts +137 -6
- package/dist/index.js +85 -0
- package/dist/index.mjs +85 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -306,7 +306,7 @@ interface AccountOwnersListResponse {
|
|
|
306
306
|
interface CustomField {
|
|
307
307
|
id: string;
|
|
308
308
|
name: string;
|
|
309
|
-
type: 'string' | 'number' | 'boolean' | 'date' | 'select';
|
|
309
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'select' | 'select_single' | 'select_multiple' | 'url' | 'date_time' | 'json' | 'number_integer' | 'number_decimal';
|
|
310
310
|
defaultValue?: unknown;
|
|
311
311
|
options?: string[];
|
|
312
312
|
appLevel?: boolean;
|
|
@@ -322,7 +322,7 @@ interface CustomField {
|
|
|
322
322
|
interface CustomFieldCreateParams {
|
|
323
323
|
appId: string;
|
|
324
324
|
name: string;
|
|
325
|
-
type: 'string' | 'number' | 'boolean' | 'date' | 'select';
|
|
325
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'select' | 'select_single' | 'select_multiple' | 'url' | 'date_time' | 'json' | 'number_integer' | 'number_decimal';
|
|
326
326
|
defaultValue?: unknown;
|
|
327
327
|
options?: string[];
|
|
328
328
|
appLevel?: boolean;
|
|
@@ -2168,7 +2168,11 @@ interface EntitiesSearchResponse {
|
|
|
2168
2168
|
/**
|
|
2169
2169
|
* Resource type for custom data
|
|
2170
2170
|
*/
|
|
2171
|
-
type CustomDataResourceType = 'ticket' | 'customer' | 'contact';
|
|
2171
|
+
type CustomDataResourceType = 'ticket' | 'customer' | 'contact' | 'deal' | 'conversation';
|
|
2172
|
+
/**
|
|
2173
|
+
* Field type for custom data
|
|
2174
|
+
*/
|
|
2175
|
+
type CustomDataFieldType = 'string' | 'boolean' | 'url' | 'date' | 'date_time' | 'json' | 'number_integer' | 'number_decimal' | 'select_single' | 'select_multiple';
|
|
2172
2176
|
/**
|
|
2173
2177
|
* Parameters for setting custom data
|
|
2174
2178
|
*/
|
|
@@ -2176,7 +2180,7 @@ interface CustomDataSetParams {
|
|
|
2176
2180
|
resourceId: string;
|
|
2177
2181
|
resourceType: CustomDataResourceType;
|
|
2178
2182
|
key: string;
|
|
2179
|
-
value: string;
|
|
2183
|
+
value: string | string[];
|
|
2180
2184
|
}
|
|
2181
2185
|
/**
|
|
2182
2186
|
* Parameters for getting custom data
|
|
@@ -2193,7 +2197,10 @@ interface CustomDataResponse {
|
|
|
2193
2197
|
resourceId: string;
|
|
2194
2198
|
resourceType: CustomDataResourceType;
|
|
2195
2199
|
key: string;
|
|
2196
|
-
value: string;
|
|
2200
|
+
value: string | boolean | number | object | string[];
|
|
2201
|
+
type?: CustomDataFieldType;
|
|
2202
|
+
name?: string;
|
|
2203
|
+
options?: string[] | null;
|
|
2197
2204
|
}
|
|
2198
2205
|
/**
|
|
2199
2206
|
* Parameters for deleting custom data
|
|
@@ -2327,6 +2334,69 @@ interface TimelineCommentUpdateResponse {
|
|
|
2327
2334
|
dealEventId?: string | null;
|
|
2328
2335
|
}
|
|
2329
2336
|
|
|
2337
|
+
interface List {
|
|
2338
|
+
id: string;
|
|
2339
|
+
name: string;
|
|
2340
|
+
description: string | null;
|
|
2341
|
+
customerCount?: number;
|
|
2342
|
+
contactCount?: number;
|
|
2343
|
+
createdAt: string;
|
|
2344
|
+
updatedAt: string;
|
|
2345
|
+
}
|
|
2346
|
+
interface ListEntity {
|
|
2347
|
+
_type: 'customer' | 'contact';
|
|
2348
|
+
id: string;
|
|
2349
|
+
name: string;
|
|
2350
|
+
email: string;
|
|
2351
|
+
tags: string[];
|
|
2352
|
+
createdAt: string;
|
|
2353
|
+
domain?: string;
|
|
2354
|
+
shopifyDomain?: string;
|
|
2355
|
+
phone?: string;
|
|
2356
|
+
jobTitle?: string;
|
|
2357
|
+
}
|
|
2358
|
+
interface ListListParams extends ListParams {
|
|
2359
|
+
all?: boolean;
|
|
2360
|
+
}
|
|
2361
|
+
interface ListListResponse extends PaginatedResponse {
|
|
2362
|
+
lists: List[];
|
|
2363
|
+
}
|
|
2364
|
+
interface ListRetrieveParams {
|
|
2365
|
+
page?: number;
|
|
2366
|
+
take?: number;
|
|
2367
|
+
type?: 'customer' | 'contact';
|
|
2368
|
+
search?: string;
|
|
2369
|
+
sort?: 'name' | 'email' | 'createdAt' | 'updatedAt';
|
|
2370
|
+
sortDirection?: 'asc' | 'desc';
|
|
2371
|
+
}
|
|
2372
|
+
interface ListRetrieveResponse extends PaginatedResponse {
|
|
2373
|
+
list: List;
|
|
2374
|
+
entities: ListEntity[];
|
|
2375
|
+
}
|
|
2376
|
+
interface ListCreateParams {
|
|
2377
|
+
name: string;
|
|
2378
|
+
description?: string;
|
|
2379
|
+
}
|
|
2380
|
+
interface ListUpdateParams {
|
|
2381
|
+
name?: string;
|
|
2382
|
+
description?: string;
|
|
2383
|
+
}
|
|
2384
|
+
interface ListAddEntitiesParams {
|
|
2385
|
+
customerIds?: string[];
|
|
2386
|
+
contactIds?: string[];
|
|
2387
|
+
}
|
|
2388
|
+
interface ListAddEntitiesResponse {
|
|
2389
|
+
added: number;
|
|
2390
|
+
skipped: number;
|
|
2391
|
+
}
|
|
2392
|
+
interface ListRemoveEntitiesParams {
|
|
2393
|
+
customerIds?: string[];
|
|
2394
|
+
contactIds?: string[];
|
|
2395
|
+
}
|
|
2396
|
+
interface ListRemoveEntitiesResponse {
|
|
2397
|
+
removed: number;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2330
2400
|
/**
|
|
2331
2401
|
* Resource for managing customers
|
|
2332
2402
|
*/
|
|
@@ -3574,6 +3644,66 @@ declare class TimelineCommentsResource extends BaseResource {
|
|
|
3574
3644
|
del(id: string): Promise<DeleteResponse>;
|
|
3575
3645
|
}
|
|
3576
3646
|
|
|
3647
|
+
declare class ListsResource extends BaseResource {
|
|
3648
|
+
/**
|
|
3649
|
+
* List all lists
|
|
3650
|
+
*
|
|
3651
|
+
* @param params - Optional list parameters
|
|
3652
|
+
* @returns Paginated list of lists
|
|
3653
|
+
*/
|
|
3654
|
+
list(params?: ListListParams): Promise<ListListResponse>;
|
|
3655
|
+
/**
|
|
3656
|
+
* Retrieve a specific list with its entities
|
|
3657
|
+
*
|
|
3658
|
+
* @param listId - The ID of the list
|
|
3659
|
+
* @param params - Optional parameters to filter entities
|
|
3660
|
+
* @returns The list with its entities
|
|
3661
|
+
*/
|
|
3662
|
+
retrieve(listId: string, params?: ListRetrieveParams): Promise<ListRetrieveResponse>;
|
|
3663
|
+
/**
|
|
3664
|
+
* Create a new list
|
|
3665
|
+
*
|
|
3666
|
+
* @param data - List creation parameters
|
|
3667
|
+
* @returns The created list
|
|
3668
|
+
*/
|
|
3669
|
+
create(data: ListCreateParams): Promise<{
|
|
3670
|
+
list: List;
|
|
3671
|
+
}>;
|
|
3672
|
+
/**
|
|
3673
|
+
* Update an existing list
|
|
3674
|
+
*
|
|
3675
|
+
* @param listId - The ID of the list to update
|
|
3676
|
+
* @param data - List update parameters
|
|
3677
|
+
* @returns The updated list
|
|
3678
|
+
*/
|
|
3679
|
+
update(listId: string, data: ListUpdateParams): Promise<{
|
|
3680
|
+
list: List;
|
|
3681
|
+
}>;
|
|
3682
|
+
/**
|
|
3683
|
+
* Delete a list
|
|
3684
|
+
*
|
|
3685
|
+
* @param listId - The ID of the list to delete
|
|
3686
|
+
* @returns Delete confirmation
|
|
3687
|
+
*/
|
|
3688
|
+
del(listId: string): Promise<DeleteResponse>;
|
|
3689
|
+
/**
|
|
3690
|
+
* Add customers and/or contacts to a list
|
|
3691
|
+
*
|
|
3692
|
+
* @param listId - The ID of the list
|
|
3693
|
+
* @param data - IDs of customers and/or contacts to add
|
|
3694
|
+
* @returns Count of added and skipped entities
|
|
3695
|
+
*/
|
|
3696
|
+
addEntities(listId: string, data: ListAddEntitiesParams): Promise<ListAddEntitiesResponse>;
|
|
3697
|
+
/**
|
|
3698
|
+
* Remove customers and/or contacts from a list
|
|
3699
|
+
*
|
|
3700
|
+
* @param listId - The ID of the list
|
|
3701
|
+
* @param data - IDs of customers and/or contacts to remove
|
|
3702
|
+
* @returns Count of removed entities
|
|
3703
|
+
*/
|
|
3704
|
+
removeEntities(listId: string, data: ListRemoveEntitiesParams): Promise<ListRemoveEntitiesResponse>;
|
|
3705
|
+
}
|
|
3706
|
+
|
|
3577
3707
|
/**
|
|
3578
3708
|
* Mantle Core API Client
|
|
3579
3709
|
*
|
|
@@ -3630,6 +3760,7 @@ declare class MantleCoreClient {
|
|
|
3630
3760
|
readonly entities: EntitiesResource;
|
|
3631
3761
|
readonly customData: CustomDataResource;
|
|
3632
3762
|
readonly timelineComments: TimelineCommentsResource;
|
|
3763
|
+
readonly lists: ListsResource;
|
|
3633
3764
|
constructor(config: MantleCoreClientConfig);
|
|
3634
3765
|
/**
|
|
3635
3766
|
* Register a middleware function
|
|
@@ -3918,4 +4049,4 @@ interface RateLimitOptions {
|
|
|
3918
4049
|
*/
|
|
3919
4050
|
declare function createRateLimitMiddleware(options?: RateLimitOptions): Middleware;
|
|
3920
4051
|
|
|
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 };
|
|
4052
|
+
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 List, type ListAddEntitiesParams, type ListAddEntitiesResponse, type ListCreateParams, type ListEntity, type ListListParams, type ListListResponse, type ListParams, type ListRemoveEntitiesParams, type ListRemoveEntitiesResponse, type ListRetrieveParams, type ListRetrieveResponse, type ListUpdateParams, 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
|
@@ -306,7 +306,7 @@ interface AccountOwnersListResponse {
|
|
|
306
306
|
interface CustomField {
|
|
307
307
|
id: string;
|
|
308
308
|
name: string;
|
|
309
|
-
type: 'string' | 'number' | 'boolean' | 'date' | 'select';
|
|
309
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'select' | 'select_single' | 'select_multiple' | 'url' | 'date_time' | 'json' | 'number_integer' | 'number_decimal';
|
|
310
310
|
defaultValue?: unknown;
|
|
311
311
|
options?: string[];
|
|
312
312
|
appLevel?: boolean;
|
|
@@ -322,7 +322,7 @@ interface CustomField {
|
|
|
322
322
|
interface CustomFieldCreateParams {
|
|
323
323
|
appId: string;
|
|
324
324
|
name: string;
|
|
325
|
-
type: 'string' | 'number' | 'boolean' | 'date' | 'select';
|
|
325
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'select' | 'select_single' | 'select_multiple' | 'url' | 'date_time' | 'json' | 'number_integer' | 'number_decimal';
|
|
326
326
|
defaultValue?: unknown;
|
|
327
327
|
options?: string[];
|
|
328
328
|
appLevel?: boolean;
|
|
@@ -2168,7 +2168,11 @@ interface EntitiesSearchResponse {
|
|
|
2168
2168
|
/**
|
|
2169
2169
|
* Resource type for custom data
|
|
2170
2170
|
*/
|
|
2171
|
-
type CustomDataResourceType = 'ticket' | 'customer' | 'contact';
|
|
2171
|
+
type CustomDataResourceType = 'ticket' | 'customer' | 'contact' | 'deal' | 'conversation';
|
|
2172
|
+
/**
|
|
2173
|
+
* Field type for custom data
|
|
2174
|
+
*/
|
|
2175
|
+
type CustomDataFieldType = 'string' | 'boolean' | 'url' | 'date' | 'date_time' | 'json' | 'number_integer' | 'number_decimal' | 'select_single' | 'select_multiple';
|
|
2172
2176
|
/**
|
|
2173
2177
|
* Parameters for setting custom data
|
|
2174
2178
|
*/
|
|
@@ -2176,7 +2180,7 @@ interface CustomDataSetParams {
|
|
|
2176
2180
|
resourceId: string;
|
|
2177
2181
|
resourceType: CustomDataResourceType;
|
|
2178
2182
|
key: string;
|
|
2179
|
-
value: string;
|
|
2183
|
+
value: string | string[];
|
|
2180
2184
|
}
|
|
2181
2185
|
/**
|
|
2182
2186
|
* Parameters for getting custom data
|
|
@@ -2193,7 +2197,10 @@ interface CustomDataResponse {
|
|
|
2193
2197
|
resourceId: string;
|
|
2194
2198
|
resourceType: CustomDataResourceType;
|
|
2195
2199
|
key: string;
|
|
2196
|
-
value: string;
|
|
2200
|
+
value: string | boolean | number | object | string[];
|
|
2201
|
+
type?: CustomDataFieldType;
|
|
2202
|
+
name?: string;
|
|
2203
|
+
options?: string[] | null;
|
|
2197
2204
|
}
|
|
2198
2205
|
/**
|
|
2199
2206
|
* Parameters for deleting custom data
|
|
@@ -2327,6 +2334,69 @@ interface TimelineCommentUpdateResponse {
|
|
|
2327
2334
|
dealEventId?: string | null;
|
|
2328
2335
|
}
|
|
2329
2336
|
|
|
2337
|
+
interface List {
|
|
2338
|
+
id: string;
|
|
2339
|
+
name: string;
|
|
2340
|
+
description: string | null;
|
|
2341
|
+
customerCount?: number;
|
|
2342
|
+
contactCount?: number;
|
|
2343
|
+
createdAt: string;
|
|
2344
|
+
updatedAt: string;
|
|
2345
|
+
}
|
|
2346
|
+
interface ListEntity {
|
|
2347
|
+
_type: 'customer' | 'contact';
|
|
2348
|
+
id: string;
|
|
2349
|
+
name: string;
|
|
2350
|
+
email: string;
|
|
2351
|
+
tags: string[];
|
|
2352
|
+
createdAt: string;
|
|
2353
|
+
domain?: string;
|
|
2354
|
+
shopifyDomain?: string;
|
|
2355
|
+
phone?: string;
|
|
2356
|
+
jobTitle?: string;
|
|
2357
|
+
}
|
|
2358
|
+
interface ListListParams extends ListParams {
|
|
2359
|
+
all?: boolean;
|
|
2360
|
+
}
|
|
2361
|
+
interface ListListResponse extends PaginatedResponse {
|
|
2362
|
+
lists: List[];
|
|
2363
|
+
}
|
|
2364
|
+
interface ListRetrieveParams {
|
|
2365
|
+
page?: number;
|
|
2366
|
+
take?: number;
|
|
2367
|
+
type?: 'customer' | 'contact';
|
|
2368
|
+
search?: string;
|
|
2369
|
+
sort?: 'name' | 'email' | 'createdAt' | 'updatedAt';
|
|
2370
|
+
sortDirection?: 'asc' | 'desc';
|
|
2371
|
+
}
|
|
2372
|
+
interface ListRetrieveResponse extends PaginatedResponse {
|
|
2373
|
+
list: List;
|
|
2374
|
+
entities: ListEntity[];
|
|
2375
|
+
}
|
|
2376
|
+
interface ListCreateParams {
|
|
2377
|
+
name: string;
|
|
2378
|
+
description?: string;
|
|
2379
|
+
}
|
|
2380
|
+
interface ListUpdateParams {
|
|
2381
|
+
name?: string;
|
|
2382
|
+
description?: string;
|
|
2383
|
+
}
|
|
2384
|
+
interface ListAddEntitiesParams {
|
|
2385
|
+
customerIds?: string[];
|
|
2386
|
+
contactIds?: string[];
|
|
2387
|
+
}
|
|
2388
|
+
interface ListAddEntitiesResponse {
|
|
2389
|
+
added: number;
|
|
2390
|
+
skipped: number;
|
|
2391
|
+
}
|
|
2392
|
+
interface ListRemoveEntitiesParams {
|
|
2393
|
+
customerIds?: string[];
|
|
2394
|
+
contactIds?: string[];
|
|
2395
|
+
}
|
|
2396
|
+
interface ListRemoveEntitiesResponse {
|
|
2397
|
+
removed: number;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2330
2400
|
/**
|
|
2331
2401
|
* Resource for managing customers
|
|
2332
2402
|
*/
|
|
@@ -3574,6 +3644,66 @@ declare class TimelineCommentsResource extends BaseResource {
|
|
|
3574
3644
|
del(id: string): Promise<DeleteResponse>;
|
|
3575
3645
|
}
|
|
3576
3646
|
|
|
3647
|
+
declare class ListsResource extends BaseResource {
|
|
3648
|
+
/**
|
|
3649
|
+
* List all lists
|
|
3650
|
+
*
|
|
3651
|
+
* @param params - Optional list parameters
|
|
3652
|
+
* @returns Paginated list of lists
|
|
3653
|
+
*/
|
|
3654
|
+
list(params?: ListListParams): Promise<ListListResponse>;
|
|
3655
|
+
/**
|
|
3656
|
+
* Retrieve a specific list with its entities
|
|
3657
|
+
*
|
|
3658
|
+
* @param listId - The ID of the list
|
|
3659
|
+
* @param params - Optional parameters to filter entities
|
|
3660
|
+
* @returns The list with its entities
|
|
3661
|
+
*/
|
|
3662
|
+
retrieve(listId: string, params?: ListRetrieveParams): Promise<ListRetrieveResponse>;
|
|
3663
|
+
/**
|
|
3664
|
+
* Create a new list
|
|
3665
|
+
*
|
|
3666
|
+
* @param data - List creation parameters
|
|
3667
|
+
* @returns The created list
|
|
3668
|
+
*/
|
|
3669
|
+
create(data: ListCreateParams): Promise<{
|
|
3670
|
+
list: List;
|
|
3671
|
+
}>;
|
|
3672
|
+
/**
|
|
3673
|
+
* Update an existing list
|
|
3674
|
+
*
|
|
3675
|
+
* @param listId - The ID of the list to update
|
|
3676
|
+
* @param data - List update parameters
|
|
3677
|
+
* @returns The updated list
|
|
3678
|
+
*/
|
|
3679
|
+
update(listId: string, data: ListUpdateParams): Promise<{
|
|
3680
|
+
list: List;
|
|
3681
|
+
}>;
|
|
3682
|
+
/**
|
|
3683
|
+
* Delete a list
|
|
3684
|
+
*
|
|
3685
|
+
* @param listId - The ID of the list to delete
|
|
3686
|
+
* @returns Delete confirmation
|
|
3687
|
+
*/
|
|
3688
|
+
del(listId: string): Promise<DeleteResponse>;
|
|
3689
|
+
/**
|
|
3690
|
+
* Add customers and/or contacts to a list
|
|
3691
|
+
*
|
|
3692
|
+
* @param listId - The ID of the list
|
|
3693
|
+
* @param data - IDs of customers and/or contacts to add
|
|
3694
|
+
* @returns Count of added and skipped entities
|
|
3695
|
+
*/
|
|
3696
|
+
addEntities(listId: string, data: ListAddEntitiesParams): Promise<ListAddEntitiesResponse>;
|
|
3697
|
+
/**
|
|
3698
|
+
* Remove customers and/or contacts from a list
|
|
3699
|
+
*
|
|
3700
|
+
* @param listId - The ID of the list
|
|
3701
|
+
* @param data - IDs of customers and/or contacts to remove
|
|
3702
|
+
* @returns Count of removed entities
|
|
3703
|
+
*/
|
|
3704
|
+
removeEntities(listId: string, data: ListRemoveEntitiesParams): Promise<ListRemoveEntitiesResponse>;
|
|
3705
|
+
}
|
|
3706
|
+
|
|
3577
3707
|
/**
|
|
3578
3708
|
* Mantle Core API Client
|
|
3579
3709
|
*
|
|
@@ -3630,6 +3760,7 @@ declare class MantleCoreClient {
|
|
|
3630
3760
|
readonly entities: EntitiesResource;
|
|
3631
3761
|
readonly customData: CustomDataResource;
|
|
3632
3762
|
readonly timelineComments: TimelineCommentsResource;
|
|
3763
|
+
readonly lists: ListsResource;
|
|
3633
3764
|
constructor(config: MantleCoreClientConfig);
|
|
3634
3765
|
/**
|
|
3635
3766
|
* Register a middleware function
|
|
@@ -3918,4 +4049,4 @@ interface RateLimitOptions {
|
|
|
3918
4049
|
*/
|
|
3919
4050
|
declare function createRateLimitMiddleware(options?: RateLimitOptions): Middleware;
|
|
3920
4051
|
|
|
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 };
|
|
4052
|
+
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 List, type ListAddEntitiesParams, type ListAddEntitiesResponse, type ListCreateParams, type ListEntity, type ListListParams, type ListListResponse, type ListParams, type ListRemoveEntitiesParams, type ListRemoveEntitiesResponse, type ListRetrieveParams, type ListRetrieveResponse, type ListUpdateParams, 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
|
@@ -2013,6 +2013,90 @@ var TimelineCommentsResource = class extends BaseResource {
|
|
|
2013
2013
|
}
|
|
2014
2014
|
};
|
|
2015
2015
|
|
|
2016
|
+
// src/resources/lists.ts
|
|
2017
|
+
var ListsResource = class extends BaseResource {
|
|
2018
|
+
/**
|
|
2019
|
+
* List all lists
|
|
2020
|
+
*
|
|
2021
|
+
* @param params - Optional list parameters
|
|
2022
|
+
* @returns Paginated list of lists
|
|
2023
|
+
*/
|
|
2024
|
+
async list(params) {
|
|
2025
|
+
const response = await this.get("/lists", params);
|
|
2026
|
+
return {
|
|
2027
|
+
lists: response.lists || [],
|
|
2028
|
+
hasNextPage: response.hasNextPage || false,
|
|
2029
|
+
hasPreviousPage: response.hasPreviousPage || false,
|
|
2030
|
+
total: response.total
|
|
2031
|
+
};
|
|
2032
|
+
}
|
|
2033
|
+
/**
|
|
2034
|
+
* Retrieve a specific list with its entities
|
|
2035
|
+
*
|
|
2036
|
+
* @param listId - The ID of the list
|
|
2037
|
+
* @param params - Optional parameters to filter entities
|
|
2038
|
+
* @returns The list with its entities
|
|
2039
|
+
*/
|
|
2040
|
+
async retrieve(listId, params) {
|
|
2041
|
+
const response = await this.get(`/lists/${listId}`, params);
|
|
2042
|
+
return {
|
|
2043
|
+
list: response.list,
|
|
2044
|
+
entities: response.entities || [],
|
|
2045
|
+
hasNextPage: response.hasNextPage || false,
|
|
2046
|
+
hasPreviousPage: response.hasPreviousPage || false,
|
|
2047
|
+
total: response.total
|
|
2048
|
+
};
|
|
2049
|
+
}
|
|
2050
|
+
/**
|
|
2051
|
+
* Create a new list
|
|
2052
|
+
*
|
|
2053
|
+
* @param data - List creation parameters
|
|
2054
|
+
* @returns The created list
|
|
2055
|
+
*/
|
|
2056
|
+
async create(data) {
|
|
2057
|
+
return this.post("/lists", data);
|
|
2058
|
+
}
|
|
2059
|
+
/**
|
|
2060
|
+
* Update an existing list
|
|
2061
|
+
*
|
|
2062
|
+
* @param listId - The ID of the list to update
|
|
2063
|
+
* @param data - List update parameters
|
|
2064
|
+
* @returns The updated list
|
|
2065
|
+
*/
|
|
2066
|
+
async update(listId, data) {
|
|
2067
|
+
return this.put(`/lists/${listId}`, data);
|
|
2068
|
+
}
|
|
2069
|
+
/**
|
|
2070
|
+
* Delete a list
|
|
2071
|
+
*
|
|
2072
|
+
* @param listId - The ID of the list to delete
|
|
2073
|
+
* @returns Delete confirmation
|
|
2074
|
+
*/
|
|
2075
|
+
async del(listId) {
|
|
2076
|
+
return this._delete(`/lists/${listId}`);
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* Add customers and/or contacts to a list
|
|
2080
|
+
*
|
|
2081
|
+
* @param listId - The ID of the list
|
|
2082
|
+
* @param data - IDs of customers and/or contacts to add
|
|
2083
|
+
* @returns Count of added and skipped entities
|
|
2084
|
+
*/
|
|
2085
|
+
async addEntities(listId, data) {
|
|
2086
|
+
return this.post(`/lists/${listId}/add`, data);
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* Remove customers and/or contacts from a list
|
|
2090
|
+
*
|
|
2091
|
+
* @param listId - The ID of the list
|
|
2092
|
+
* @param data - IDs of customers and/or contacts to remove
|
|
2093
|
+
* @returns Count of removed entities
|
|
2094
|
+
*/
|
|
2095
|
+
async removeEntities(listId, data) {
|
|
2096
|
+
return this.post(`/lists/${listId}/remove`, data);
|
|
2097
|
+
}
|
|
2098
|
+
};
|
|
2099
|
+
|
|
2016
2100
|
// src/client.ts
|
|
2017
2101
|
var MantleCoreClient = class {
|
|
2018
2102
|
constructor(config) {
|
|
@@ -2066,6 +2150,7 @@ var MantleCoreClient = class {
|
|
|
2066
2150
|
this.entities = new EntitiesResource(this);
|
|
2067
2151
|
this.customData = new CustomDataResource(this);
|
|
2068
2152
|
this.timelineComments = new TimelineCommentsResource(this);
|
|
2153
|
+
this.lists = new ListsResource(this);
|
|
2069
2154
|
}
|
|
2070
2155
|
/**
|
|
2071
2156
|
* Register a middleware function
|
package/dist/index.mjs
CHANGED
|
@@ -1947,6 +1947,90 @@ var TimelineCommentsResource = class extends BaseResource {
|
|
|
1947
1947
|
}
|
|
1948
1948
|
};
|
|
1949
1949
|
|
|
1950
|
+
// src/resources/lists.ts
|
|
1951
|
+
var ListsResource = class extends BaseResource {
|
|
1952
|
+
/**
|
|
1953
|
+
* List all lists
|
|
1954
|
+
*
|
|
1955
|
+
* @param params - Optional list parameters
|
|
1956
|
+
* @returns Paginated list of lists
|
|
1957
|
+
*/
|
|
1958
|
+
async list(params) {
|
|
1959
|
+
const response = await this.get("/lists", params);
|
|
1960
|
+
return {
|
|
1961
|
+
lists: response.lists || [],
|
|
1962
|
+
hasNextPage: response.hasNextPage || false,
|
|
1963
|
+
hasPreviousPage: response.hasPreviousPage || false,
|
|
1964
|
+
total: response.total
|
|
1965
|
+
};
|
|
1966
|
+
}
|
|
1967
|
+
/**
|
|
1968
|
+
* Retrieve a specific list with its entities
|
|
1969
|
+
*
|
|
1970
|
+
* @param listId - The ID of the list
|
|
1971
|
+
* @param params - Optional parameters to filter entities
|
|
1972
|
+
* @returns The list with its entities
|
|
1973
|
+
*/
|
|
1974
|
+
async retrieve(listId, params) {
|
|
1975
|
+
const response = await this.get(`/lists/${listId}`, params);
|
|
1976
|
+
return {
|
|
1977
|
+
list: response.list,
|
|
1978
|
+
entities: response.entities || [],
|
|
1979
|
+
hasNextPage: response.hasNextPage || false,
|
|
1980
|
+
hasPreviousPage: response.hasPreviousPage || false,
|
|
1981
|
+
total: response.total
|
|
1982
|
+
};
|
|
1983
|
+
}
|
|
1984
|
+
/**
|
|
1985
|
+
* Create a new list
|
|
1986
|
+
*
|
|
1987
|
+
* @param data - List creation parameters
|
|
1988
|
+
* @returns The created list
|
|
1989
|
+
*/
|
|
1990
|
+
async create(data) {
|
|
1991
|
+
return this.post("/lists", data);
|
|
1992
|
+
}
|
|
1993
|
+
/**
|
|
1994
|
+
* Update an existing list
|
|
1995
|
+
*
|
|
1996
|
+
* @param listId - The ID of the list to update
|
|
1997
|
+
* @param data - List update parameters
|
|
1998
|
+
* @returns The updated list
|
|
1999
|
+
*/
|
|
2000
|
+
async update(listId, data) {
|
|
2001
|
+
return this.put(`/lists/${listId}`, data);
|
|
2002
|
+
}
|
|
2003
|
+
/**
|
|
2004
|
+
* Delete a list
|
|
2005
|
+
*
|
|
2006
|
+
* @param listId - The ID of the list to delete
|
|
2007
|
+
* @returns Delete confirmation
|
|
2008
|
+
*/
|
|
2009
|
+
async del(listId) {
|
|
2010
|
+
return this._delete(`/lists/${listId}`);
|
|
2011
|
+
}
|
|
2012
|
+
/**
|
|
2013
|
+
* Add customers and/or contacts to a list
|
|
2014
|
+
*
|
|
2015
|
+
* @param listId - The ID of the list
|
|
2016
|
+
* @param data - IDs of customers and/or contacts to add
|
|
2017
|
+
* @returns Count of added and skipped entities
|
|
2018
|
+
*/
|
|
2019
|
+
async addEntities(listId, data) {
|
|
2020
|
+
return this.post(`/lists/${listId}/add`, data);
|
|
2021
|
+
}
|
|
2022
|
+
/**
|
|
2023
|
+
* Remove customers and/or contacts from a list
|
|
2024
|
+
*
|
|
2025
|
+
* @param listId - The ID of the list
|
|
2026
|
+
* @param data - IDs of customers and/or contacts to remove
|
|
2027
|
+
* @returns Count of removed entities
|
|
2028
|
+
*/
|
|
2029
|
+
async removeEntities(listId, data) {
|
|
2030
|
+
return this.post(`/lists/${listId}/remove`, data);
|
|
2031
|
+
}
|
|
2032
|
+
};
|
|
2033
|
+
|
|
1950
2034
|
// src/client.ts
|
|
1951
2035
|
var MantleCoreClient = class {
|
|
1952
2036
|
constructor(config) {
|
|
@@ -2000,6 +2084,7 @@ var MantleCoreClient = class {
|
|
|
2000
2084
|
this.entities = new EntitiesResource(this);
|
|
2001
2085
|
this.customData = new CustomDataResource(this);
|
|
2002
2086
|
this.timelineComments = new TimelineCommentsResource(this);
|
|
2087
|
+
this.lists = new ListsResource(this);
|
|
2003
2088
|
}
|
|
2004
2089
|
/**
|
|
2005
2090
|
* Register a middleware function
|