@heymantle/core-api-client 0.1.11 → 0.1.13

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 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 with social profiles
237
- const { contact } = await client.contacts.create({
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
@@ -1815,11 +1823,30 @@ interface AgentResponse {
1815
1823
  /**
1816
1824
  * Task status
1817
1825
  */
1818
- type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'canceled';
1826
+ type TaskStatus = 'new' | 'in_progress' | 'complete';
1819
1827
  /**
1820
1828
  * Task priority
1821
1829
  */
1822
- type TaskPriority = 'low' | 'medium' | 'high' | 'urgent';
1830
+ type TaskPriority = 'low' | 'medium' | 'high';
1831
+ /**
1832
+ * Task todo item entity
1833
+ */
1834
+ interface TodoItem {
1835
+ id: string;
1836
+ content: string;
1837
+ completed: boolean;
1838
+ completedAt?: string | null;
1839
+ displayOrder: number;
1840
+ }
1841
+ /**
1842
+ * Parameters for creating a todo item (used in task creation/update)
1843
+ */
1844
+ interface TodoItemInput {
1845
+ id?: string;
1846
+ content: string;
1847
+ completed?: boolean;
1848
+ displayOrder?: number;
1849
+ }
1823
1850
  /**
1824
1851
  * Task entity
1825
1852
  */
@@ -1831,6 +1858,7 @@ interface Task {
1831
1858
  priority: TaskPriority;
1832
1859
  status: TaskStatus;
1833
1860
  dueDate?: string;
1861
+ completedAt?: string | null;
1834
1862
  assigneeId?: string;
1835
1863
  customerId?: string;
1836
1864
  contactId?: string;
@@ -1844,19 +1872,33 @@ interface Task {
1844
1872
  id: string;
1845
1873
  name?: string;
1846
1874
  email?: string;
1847
- };
1875
+ } | null;
1876
+ createdBy?: {
1877
+ id: string;
1878
+ name?: string;
1879
+ email?: string;
1880
+ } | null;
1848
1881
  customer?: {
1849
1882
  id: string;
1850
1883
  name?: string;
1851
- };
1884
+ } | null;
1852
1885
  contact?: {
1853
1886
  id: string;
1854
1887
  name?: string;
1855
- };
1888
+ } | null;
1856
1889
  deal?: {
1857
1890
  id: string;
1858
1891
  name?: string;
1859
- };
1892
+ dealStage?: {
1893
+ id: string;
1894
+ name?: string;
1895
+ } | null;
1896
+ } | null;
1897
+ dealActivity?: {
1898
+ id: string;
1899
+ name?: string;
1900
+ } | null;
1901
+ todoItems?: TodoItem[];
1860
1902
  }
1861
1903
  /**
1862
1904
  * Parameters for listing tasks
@@ -1891,12 +1933,59 @@ interface TaskCreateParams {
1891
1933
  dealActivityId?: string;
1892
1934
  appInstallationId?: string;
1893
1935
  tags?: string[];
1936
+ todoItems?: TodoItemInput[];
1894
1937
  }
1895
1938
  /**
1896
1939
  * Parameters for updating a task
1897
1940
  */
1898
1941
  interface TaskUpdateParams extends Partial<TaskCreateParams> {
1899
1942
  }
1943
+ /**
1944
+ * Response from listing todo items
1945
+ */
1946
+ interface TodoItemListResponse {
1947
+ items: TodoItem[];
1948
+ total: number;
1949
+ }
1950
+ /**
1951
+ * Deal progression information returned when a task update triggers deal stage change
1952
+ */
1953
+ interface DealProgression {
1954
+ dealId: string;
1955
+ dealName: string;
1956
+ previousStage: {
1957
+ id: string;
1958
+ name: string;
1959
+ } | null;
1960
+ nextStage: {
1961
+ id: string;
1962
+ name: string;
1963
+ } | null;
1964
+ }
1965
+ /**
1966
+ * Response from updating a task
1967
+ */
1968
+ interface TaskUpdateResponse {
1969
+ task: Task;
1970
+ dealProgressed: boolean;
1971
+ dealProgression: DealProgression | null;
1972
+ }
1973
+ /**
1974
+ * Parameters for creating a todo item via the dedicated endpoint
1975
+ */
1976
+ interface TodoItemCreateParams {
1977
+ content: string;
1978
+ completed?: boolean;
1979
+ displayOrder?: number;
1980
+ }
1981
+ /**
1982
+ * Parameters for updating a todo item
1983
+ */
1984
+ interface TodoItemUpdateParams {
1985
+ content?: string;
1986
+ completed?: boolean;
1987
+ displayOrder?: number;
1988
+ }
1900
1989
 
1901
1990
  /**
1902
1991
  * Company entity
@@ -2225,11 +2314,12 @@ declare class ContactsResource extends BaseResource {
2225
2314
  contact: Contact;
2226
2315
  }>;
2227
2316
  /**
2228
- * Create a new contact
2317
+ * Create or update a contact.
2318
+ * If a contact with the same email exists in the organization, it will be updated.
2319
+ * Otherwise, a new contact will be created.
2320
+ * @returns The contact and a boolean indicating if it was newly created
2229
2321
  */
2230
- create(data: ContactCreateParams): Promise<{
2231
- contact: Contact;
2232
- }>;
2322
+ create(data: ContactCreateParams): Promise<ContactCreateResponse>;
2233
2323
  /**
2234
2324
  * Update an existing contact
2235
2325
  */
@@ -2771,19 +2861,41 @@ declare class TasksResource extends BaseResource {
2771
2861
  /**
2772
2862
  * Create a new task
2773
2863
  */
2774
- create(data: TaskCreateParams): Promise<{
2775
- task: Task;
2776
- }>;
2864
+ create(data: TaskCreateParams): Promise<Task>;
2777
2865
  /**
2778
2866
  * Update an existing task
2779
2867
  */
2780
- update(taskId: string, data: TaskUpdateParams): Promise<{
2781
- task: Task;
2782
- }>;
2868
+ update(taskId: string, data: TaskUpdateParams): Promise<TaskUpdateResponse>;
2783
2869
  /**
2784
2870
  * Delete a task
2785
2871
  */
2786
2872
  del(taskId: string): Promise<DeleteResponse>;
2873
+ /**
2874
+ * List todo items for a task
2875
+ */
2876
+ listTodoItems(taskId: string): Promise<TodoItemListResponse>;
2877
+ /**
2878
+ * Retrieve a single todo item
2879
+ */
2880
+ retrieveTodoItem(taskId: string, itemId: string): Promise<{
2881
+ item: TodoItem;
2882
+ }>;
2883
+ /**
2884
+ * Create a todo item for a task
2885
+ */
2886
+ createTodoItem(taskId: string, data: TodoItemCreateParams): Promise<{
2887
+ item: TodoItem;
2888
+ }>;
2889
+ /**
2890
+ * Update a todo item
2891
+ */
2892
+ updateTodoItem(taskId: string, itemId: string, data: TodoItemUpdateParams): Promise<{
2893
+ item: TodoItem;
2894
+ }>;
2895
+ /**
2896
+ * Delete a todo item
2897
+ */
2898
+ deleteTodoItem(taskId: string, itemId: string): Promise<DeleteResponse>;
2787
2899
  }
2788
2900
 
2789
2901
  /**
@@ -3654,4 +3766,4 @@ interface RateLimitOptions {
3654
3766
  */
3655
3767
  declare function createRateLimitMiddleware(options?: RateLimitOptions): Middleware;
3656
3768
 
3657
- 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 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, 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 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 };
3769
+ 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 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
@@ -1815,11 +1823,30 @@ interface AgentResponse {
1815
1823
  /**
1816
1824
  * Task status
1817
1825
  */
1818
- type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'canceled';
1826
+ type TaskStatus = 'new' | 'in_progress' | 'complete';
1819
1827
  /**
1820
1828
  * Task priority
1821
1829
  */
1822
- type TaskPriority = 'low' | 'medium' | 'high' | 'urgent';
1830
+ type TaskPriority = 'low' | 'medium' | 'high';
1831
+ /**
1832
+ * Task todo item entity
1833
+ */
1834
+ interface TodoItem {
1835
+ id: string;
1836
+ content: string;
1837
+ completed: boolean;
1838
+ completedAt?: string | null;
1839
+ displayOrder: number;
1840
+ }
1841
+ /**
1842
+ * Parameters for creating a todo item (used in task creation/update)
1843
+ */
1844
+ interface TodoItemInput {
1845
+ id?: string;
1846
+ content: string;
1847
+ completed?: boolean;
1848
+ displayOrder?: number;
1849
+ }
1823
1850
  /**
1824
1851
  * Task entity
1825
1852
  */
@@ -1831,6 +1858,7 @@ interface Task {
1831
1858
  priority: TaskPriority;
1832
1859
  status: TaskStatus;
1833
1860
  dueDate?: string;
1861
+ completedAt?: string | null;
1834
1862
  assigneeId?: string;
1835
1863
  customerId?: string;
1836
1864
  contactId?: string;
@@ -1844,19 +1872,33 @@ interface Task {
1844
1872
  id: string;
1845
1873
  name?: string;
1846
1874
  email?: string;
1847
- };
1875
+ } | null;
1876
+ createdBy?: {
1877
+ id: string;
1878
+ name?: string;
1879
+ email?: string;
1880
+ } | null;
1848
1881
  customer?: {
1849
1882
  id: string;
1850
1883
  name?: string;
1851
- };
1884
+ } | null;
1852
1885
  contact?: {
1853
1886
  id: string;
1854
1887
  name?: string;
1855
- };
1888
+ } | null;
1856
1889
  deal?: {
1857
1890
  id: string;
1858
1891
  name?: string;
1859
- };
1892
+ dealStage?: {
1893
+ id: string;
1894
+ name?: string;
1895
+ } | null;
1896
+ } | null;
1897
+ dealActivity?: {
1898
+ id: string;
1899
+ name?: string;
1900
+ } | null;
1901
+ todoItems?: TodoItem[];
1860
1902
  }
1861
1903
  /**
1862
1904
  * Parameters for listing tasks
@@ -1891,12 +1933,59 @@ interface TaskCreateParams {
1891
1933
  dealActivityId?: string;
1892
1934
  appInstallationId?: string;
1893
1935
  tags?: string[];
1936
+ todoItems?: TodoItemInput[];
1894
1937
  }
1895
1938
  /**
1896
1939
  * Parameters for updating a task
1897
1940
  */
1898
1941
  interface TaskUpdateParams extends Partial<TaskCreateParams> {
1899
1942
  }
1943
+ /**
1944
+ * Response from listing todo items
1945
+ */
1946
+ interface TodoItemListResponse {
1947
+ items: TodoItem[];
1948
+ total: number;
1949
+ }
1950
+ /**
1951
+ * Deal progression information returned when a task update triggers deal stage change
1952
+ */
1953
+ interface DealProgression {
1954
+ dealId: string;
1955
+ dealName: string;
1956
+ previousStage: {
1957
+ id: string;
1958
+ name: string;
1959
+ } | null;
1960
+ nextStage: {
1961
+ id: string;
1962
+ name: string;
1963
+ } | null;
1964
+ }
1965
+ /**
1966
+ * Response from updating a task
1967
+ */
1968
+ interface TaskUpdateResponse {
1969
+ task: Task;
1970
+ dealProgressed: boolean;
1971
+ dealProgression: DealProgression | null;
1972
+ }
1973
+ /**
1974
+ * Parameters for creating a todo item via the dedicated endpoint
1975
+ */
1976
+ interface TodoItemCreateParams {
1977
+ content: string;
1978
+ completed?: boolean;
1979
+ displayOrder?: number;
1980
+ }
1981
+ /**
1982
+ * Parameters for updating a todo item
1983
+ */
1984
+ interface TodoItemUpdateParams {
1985
+ content?: string;
1986
+ completed?: boolean;
1987
+ displayOrder?: number;
1988
+ }
1900
1989
 
1901
1990
  /**
1902
1991
  * Company entity
@@ -2225,11 +2314,12 @@ declare class ContactsResource extends BaseResource {
2225
2314
  contact: Contact;
2226
2315
  }>;
2227
2316
  /**
2228
- * Create a new contact
2317
+ * Create or update a contact.
2318
+ * If a contact with the same email exists in the organization, it will be updated.
2319
+ * Otherwise, a new contact will be created.
2320
+ * @returns The contact and a boolean indicating if it was newly created
2229
2321
  */
2230
- create(data: ContactCreateParams): Promise<{
2231
- contact: Contact;
2232
- }>;
2322
+ create(data: ContactCreateParams): Promise<ContactCreateResponse>;
2233
2323
  /**
2234
2324
  * Update an existing contact
2235
2325
  */
@@ -2771,19 +2861,41 @@ declare class TasksResource extends BaseResource {
2771
2861
  /**
2772
2862
  * Create a new task
2773
2863
  */
2774
- create(data: TaskCreateParams): Promise<{
2775
- task: Task;
2776
- }>;
2864
+ create(data: TaskCreateParams): Promise<Task>;
2777
2865
  /**
2778
2866
  * Update an existing task
2779
2867
  */
2780
- update(taskId: string, data: TaskUpdateParams): Promise<{
2781
- task: Task;
2782
- }>;
2868
+ update(taskId: string, data: TaskUpdateParams): Promise<TaskUpdateResponse>;
2783
2869
  /**
2784
2870
  * Delete a task
2785
2871
  */
2786
2872
  del(taskId: string): Promise<DeleteResponse>;
2873
+ /**
2874
+ * List todo items for a task
2875
+ */
2876
+ listTodoItems(taskId: string): Promise<TodoItemListResponse>;
2877
+ /**
2878
+ * Retrieve a single todo item
2879
+ */
2880
+ retrieveTodoItem(taskId: string, itemId: string): Promise<{
2881
+ item: TodoItem;
2882
+ }>;
2883
+ /**
2884
+ * Create a todo item for a task
2885
+ */
2886
+ createTodoItem(taskId: string, data: TodoItemCreateParams): Promise<{
2887
+ item: TodoItem;
2888
+ }>;
2889
+ /**
2890
+ * Update a todo item
2891
+ */
2892
+ updateTodoItem(taskId: string, itemId: string, data: TodoItemUpdateParams): Promise<{
2893
+ item: TodoItem;
2894
+ }>;
2895
+ /**
2896
+ * Delete a todo item
2897
+ */
2898
+ deleteTodoItem(taskId: string, itemId: string): Promise<DeleteResponse>;
2787
2899
  }
2788
2900
 
2789
2901
  /**
@@ -3654,4 +3766,4 @@ interface RateLimitOptions {
3654
3766
  */
3655
3767
  declare function createRateLimitMiddleware(options?: RateLimitOptions): Middleware;
3656
3768
 
3657
- 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 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, 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 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 };
3769
+ 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 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 new contact
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);
@@ -1155,6 +1158,40 @@ var TasksResource = class extends BaseResource {
1155
1158
  async del(taskId) {
1156
1159
  return this._delete(`/tasks/${taskId}`);
1157
1160
  }
1161
+ // ========== Todo Items ==========
1162
+ /**
1163
+ * List todo items for a task
1164
+ */
1165
+ async listTodoItems(taskId) {
1166
+ return this.get(`/tasks/${taskId}/todo-items`);
1167
+ }
1168
+ /**
1169
+ * Retrieve a single todo item
1170
+ */
1171
+ async retrieveTodoItem(taskId, itemId) {
1172
+ return this.get(`/tasks/${taskId}/todo-items/${itemId}`);
1173
+ }
1174
+ /**
1175
+ * Create a todo item for a task
1176
+ */
1177
+ async createTodoItem(taskId, data) {
1178
+ return this.post(`/tasks/${taskId}/todo-items`, data);
1179
+ }
1180
+ /**
1181
+ * Update a todo item
1182
+ */
1183
+ async updateTodoItem(taskId, itemId, data) {
1184
+ return this.put(
1185
+ `/tasks/${taskId}/todo-items/${itemId}`,
1186
+ data
1187
+ );
1188
+ }
1189
+ /**
1190
+ * Delete a todo item
1191
+ */
1192
+ async deleteTodoItem(taskId, itemId) {
1193
+ return this._delete(`/tasks/${taskId}/todo-items/${itemId}`);
1194
+ }
1158
1195
  };
1159
1196
 
1160
1197
  // src/resources/webhooks.ts
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 new contact
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);
@@ -1089,6 +1092,40 @@ var TasksResource = class extends BaseResource {
1089
1092
  async del(taskId) {
1090
1093
  return this._delete(`/tasks/${taskId}`);
1091
1094
  }
1095
+ // ========== Todo Items ==========
1096
+ /**
1097
+ * List todo items for a task
1098
+ */
1099
+ async listTodoItems(taskId) {
1100
+ return this.get(`/tasks/${taskId}/todo-items`);
1101
+ }
1102
+ /**
1103
+ * Retrieve a single todo item
1104
+ */
1105
+ async retrieveTodoItem(taskId, itemId) {
1106
+ return this.get(`/tasks/${taskId}/todo-items/${itemId}`);
1107
+ }
1108
+ /**
1109
+ * Create a todo item for a task
1110
+ */
1111
+ async createTodoItem(taskId, data) {
1112
+ return this.post(`/tasks/${taskId}/todo-items`, data);
1113
+ }
1114
+ /**
1115
+ * Update a todo item
1116
+ */
1117
+ async updateTodoItem(taskId, itemId, data) {
1118
+ return this.put(
1119
+ `/tasks/${taskId}/todo-items/${itemId}`,
1120
+ data
1121
+ );
1122
+ }
1123
+ /**
1124
+ * Delete a todo item
1125
+ */
1126
+ async deleteTodoItem(taskId, itemId) {
1127
+ return this._delete(`/tasks/${taskId}/todo-items/${itemId}`);
1128
+ }
1092
1129
  };
1093
1130
 
1094
1131
  // src/resources/webhooks.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heymantle/core-api-client",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "TypeScript SDK for the Mantle Core API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",