@heymantle/core-api-client 0.2.0 → 0.2.1

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.
Files changed (5) hide show
  1. package/dist/index.d.mts +12907 -10579
  2. package/dist/index.d.ts +12907 -10579
  3. package/dist/index.js +604 -752
  4. package/dist/index.mjs +604 -752
  5. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -103,679 +103,601 @@ var BaseResource = class {
103
103
  }
104
104
  };
105
105
 
106
- // src/resources/customers.ts
107
- var CustomersResource = class extends BaseResource {
106
+ // src/resources/affiliate-commissions.ts
107
+ var AffiliateCommissionsResource = class extends BaseResource {
108
108
  async list(params) {
109
- return this.unwrap(this.api.GET("/customers", { params: { query: params } }));
110
- }
111
- async get(customerId) {
112
- return this.unwrap(this.api.GET("/customers/{id}", { params: { path: { id: customerId } } }));
113
- }
114
- async create(data) {
115
- return this.unwrap(this.api.POST("/customers", { body: data }));
116
- }
117
- async update(customerId, data) {
118
- return this.unwrap(this.api.PUT("/customers/{id}", { params: { path: { id: customerId } }, body: data }));
119
- }
120
- async addTags(customerId, tags) {
121
- return this.unwrap(this.api.POST("/customers/{id}/addTags", { params: { path: { id: customerId } }, body: { tags } }));
122
- }
123
- async removeTags(customerId, tags) {
124
- return this.unwrap(this.api.POST("/customers/{id}/removeTags", { params: { path: { id: customerId } }, body: { tags } }));
125
- }
126
- async getTimeline(customerId, params) {
127
- return this.unwrap(this.api.GET("/customers/{id}/timeline", { params: { path: { id: customerId }, query: params } }));
128
- }
129
- async listAccountOwners(customerId) {
130
- return this.unwrap(this.api.GET("/customers/{id}/account_owners", { params: { path: { id: customerId } } }));
131
- }
132
- async addAccountOwner(customerId, data) {
133
- return this.unwrap(this.api.POST("/customers/{id}/account_owners", { params: { path: { id: customerId } }, body: data }));
134
- }
135
- async removeAccountOwner(customerId, ownerId) {
136
- return this.unwrap(this.api.DELETE("/customers/{id}/account_owners/{ownerId}", { params: { path: { id: customerId, ownerId } } }));
137
- }
138
- async listCustomFields(params) {
139
- return this.unwrap(this.api.GET("/customers/custom_fields", { params: { query: params } }));
140
- }
141
- async createCustomField(data) {
142
- return this.unwrap(this.api.POST("/customers/custom_fields", { body: data }));
143
- }
144
- async getCustomField(fieldId) {
145
- return this.unwrap(this.api.GET("/customers/custom_fields/{id}", { params: { path: { id: fieldId } } }));
146
- }
147
- async updateCustomField(fieldId, data) {
148
- return this.unwrap(this.api.PUT("/customers/custom_fields/{id}", { params: { path: { id: fieldId } }, body: data }));
109
+ return this.unwrap(this.api.GET("/affiliate_commissions", { params: { query: params } }));
149
110
  }
150
- async deleteCustomField(fieldId) {
151
- return this.unwrap(this.api.DELETE("/customers/custom_fields/{id}", { params: { path: { id: fieldId } } }));
111
+ async get(commissionId) {
112
+ return this.unwrap(this.api.GET("/affiliate_commissions/{id}", { params: { path: { id: commissionId } } }));
152
113
  }
153
114
  };
154
115
 
155
- // src/resources/contacts.ts
156
- var ContactsResource = class extends BaseResource {
116
+ // src/resources/affiliate-payouts.ts
117
+ var AffiliatePayoutsResource = class extends BaseResource {
157
118
  async list(params) {
158
- return this.unwrap(this.api.GET("/contacts", { params: { query: params } }));
159
- }
160
- async get(contactId) {
161
- return this.unwrap(this.api.GET("/contacts/{id}", { params: { path: { id: contactId } } }));
119
+ return this.unwrap(this.api.GET("/affiliate_payouts", { params: { query: params } }));
162
120
  }
163
- async create(data) {
164
- return this.unwrap(this.api.POST("/contacts", { body: data }));
121
+ async get(payoutId) {
122
+ return this.unwrap(this.api.GET("/affiliate_payouts/{id}", { params: { path: { id: payoutId } } }));
165
123
  }
166
- async update(contactId, data) {
167
- return this.unwrap(this.api.PUT("/contacts/{id}", { params: { path: { id: contactId } }, body: data }));
124
+ };
125
+
126
+ // src/resources/affiliate-programs.ts
127
+ var AffiliateProgramsResource = class extends BaseResource {
128
+ async list(params) {
129
+ return this.unwrap(this.api.GET("/affiliate_programs", { params: { query: params } }));
168
130
  }
169
- async del(contactId) {
170
- return this.unwrap(this.api.DELETE("/contacts/{id}", { params: { path: { id: contactId } } }));
131
+ async get(programId) {
132
+ return this.unwrap(this.api.GET("/affiliate_programs/{id}", { params: { path: { id: programId } } }));
171
133
  }
172
- async addTags(contactId, tags) {
173
- return this.unwrap(this.api.POST("/contacts/{id}/addTags", { params: { path: { id: contactId } }, body: { tags } }));
134
+ };
135
+
136
+ // src/resources/affiliate-referrals.ts
137
+ var AffiliateReferralsResource = class extends BaseResource {
138
+ async list(params) {
139
+ return this.unwrap(this.api.GET("/affiliate_referrals", { params: { query: params } }));
174
140
  }
175
- async removeTags(contactId, tags) {
176
- return this.unwrap(this.api.POST("/contacts/{id}/removeTags", { params: { path: { id: contactId } }, body: { tags } }));
141
+ async get(referralId) {
142
+ return this.unwrap(this.api.GET("/affiliate_referrals/{id}", { params: { path: { id: referralId } } }));
177
143
  }
178
144
  };
179
145
 
180
- // src/resources/subscriptions.ts
181
- var SubscriptionsResource = class extends BaseResource {
182
- /**
183
- * List subscriptions with optional filters and pagination
184
- */
146
+ // src/resources/affiliates.ts
147
+ var AffiliatesResource = class extends BaseResource {
185
148
  async list(params) {
186
- return this.unwrap(this.api.GET("/subscriptions", { params: { query: params } }));
149
+ return this.unwrap(this.api.GET("/affiliates", { params: { query: params } }));
187
150
  }
188
- /**
189
- * Get a single subscription by ID
190
- */
191
- async get(subscriptionId) {
192
- return this.unwrap(this.api.GET("/subscriptions/{id}", { params: { path: { id: subscriptionId } } }));
151
+ async get(affiliateId) {
152
+ return this.unwrap(this.api.GET("/affiliates/{id}", { params: { path: { id: affiliateId } } }));
193
153
  }
194
154
  };
195
155
 
196
- // src/resources/usage-events.ts
197
- var UsageEventsResource = class extends BaseResource {
198
- /**
199
- * List usage events with optional filters and pagination
200
- */
201
- async list(params) {
202
- return this.unwrap(this.api.GET("/usage_events", { params: { query: params } }));
156
+ // src/resources/ai-agent-runs.ts
157
+ var AiAgentRunsResource = class extends BaseResource {
158
+ async create(agentId, data) {
159
+ return this.unwrap(this.api.POST("/ai/agents/{agentId}/runs", { params: { path: { agentId } }, body: data }));
160
+ }
161
+ async get(agentId, runId) {
162
+ return this.unwrap(this.api.GET("/ai/agents/{agentId}/runs/{runId}", { params: { path: { agentId, runId } } }));
203
163
  }
204
164
  /**
205
- * Create usage event(s)
206
- *
207
- * @example
208
- * // Single event
209
- * await client.usageEvents.create({
210
- * eventName: 'api_call',
211
- * customerId: 'cust_123',
212
- * appId: 'app_456',
213
- * properties: { endpoint: '/users' },
214
- * });
215
- *
216
- * @example
217
- * // Multiple events
218
- * await client.usageEvents.create({
219
- * events: [
220
- * { eventName: 'api_call', customerId: 'cust_123', appId: 'app_456' },
221
- * { eventName: 'api_call', customerId: 'cust_789', appId: 'app_456' },
222
- * ],
223
- * });
165
+ * Create an agent run and poll until it reaches a terminal status.
224
166
  */
225
- async create(data) {
226
- return this.unwrap(this.api.POST("/usage_events", { body: data }));
167
+ async createAndWait(agentId, data, options) {
168
+ const { timeout = 3e5, pollInterval = 2e3 } = options ?? {};
169
+ const result = await this.create(agentId, data);
170
+ const run = result.run;
171
+ if (!run?.id) throw new Error("Agent run ID not returned");
172
+ const start = Date.now();
173
+ while (Date.now() - start < timeout) {
174
+ const response = await this.get(agentId, run.id);
175
+ const agentRun = response.run;
176
+ if (agentRun.status === "completed" || agentRun.status === "error") return agentRun;
177
+ await new Promise((resolve) => setTimeout(resolve, pollInterval));
178
+ }
179
+ throw new Error(`Agent run timed out after ${timeout}ms`);
227
180
  }
228
181
  };
229
182
 
230
183
  // src/resources/apps.ts
231
184
  var AppsResource = class extends BaseResource {
232
- // Apps
233
185
  async list(params) {
234
186
  return this.unwrap(this.api.GET("/apps", { params: { query: params } }));
235
187
  }
188
+ async analyze(appId, data) {
189
+ return this.unwrap(this.api.POST("/apps/{id}/analyze", { params: { path: { id: appId } }, body: data }));
190
+ }
236
191
  async get(appId) {
237
192
  return this.unwrap(this.api.GET("/apps/{id}", { params: { path: { id: appId } } }));
238
193
  }
239
- // Plans
240
- async listPlans(appId, params) {
241
- return this.unwrap(this.api.GET("/apps/{id}/plans", { params: { path: { id: appId }, query: params } }));
242
- }
243
194
  async getPlan(appId, planId) {
244
195
  return this.unwrap(this.api.GET("/apps/{id}/plans/{planId}", { params: { path: { id: appId, planId } } }));
245
196
  }
246
- async createPlan(appId, data) {
247
- return this.unwrap(this.api.POST("/apps/{id}/plans", { params: { path: { id: appId } }, body: data }));
248
- }
249
197
  async updatePlan(appId, planId, data) {
250
198
  return this.unwrap(this.api.PUT("/apps/{id}/plans/{planId}", { params: { path: { id: appId, planId } }, body: data }));
251
199
  }
200
+ async getAppEvent(appId, appEventId) {
201
+ return this.unwrap(this.api.GET("/apps/{id}/app_events/{appEventId}", { params: { path: { id: appId, appEventId } } }));
202
+ }
203
+ async listAppEvents(appId, params) {
204
+ return this.unwrap(this.api.GET("/apps/{id}/app_events", { params: { path: { id: appId }, query: params } }));
205
+ }
206
+ async createAppEvent(appId, data) {
207
+ return this.unwrap(this.api.POST("/apps/{id}/app_events", { params: { path: { id: appId } }, body: data }));
208
+ }
209
+ async getChecklist(appId, checklistId) {
210
+ return this.unwrap(this.api.GET("/apps/{appId}/checklists/{checklistId}", { params: { path: { appId, checklistId } } }));
211
+ }
212
+ async updateChecklist(appId, checklistId, data) {
213
+ return this.unwrap(this.api.PUT("/apps/{appId}/checklists/{checklistId}", { params: { path: { appId, checklistId } }, body: data }));
214
+ }
215
+ async deleteChecklist(appId, checklistId) {
216
+ return this.unwrap(this.api.DELETE("/apps/{appId}/checklists/{checklistId}", { params: { path: { appId, checklistId } } }));
217
+ }
218
+ async listChecklists(appId) {
219
+ return this.unwrap(this.api.GET("/apps/{appId}/checklists", { params: { path: { appId } } }));
220
+ }
221
+ async createChecklist(appId, data) {
222
+ return this.unwrap(this.api.POST("/apps/{appId}/checklists", { params: { path: { appId } }, body: data }));
223
+ }
252
224
  async archivePlan(appId, planId) {
253
225
  return this.unwrap(this.api.PUT("/apps/{id}/plans/{planId}/archive", { params: { path: { id: appId, planId } } }));
254
226
  }
255
227
  async unarchivePlan(appId, planId) {
256
228
  return this.unwrap(this.api.PUT("/apps/{id}/plans/{planId}/unarchive", { params: { path: { id: appId, planId } } }));
257
229
  }
258
- // Features
259
- async listFeatures(appId) {
260
- return this.unwrap(this.api.GET("/apps/{appId}/plans/features", { params: { path: { appId } } }));
261
- }
262
230
  async getFeature(appId, featureId) {
263
231
  return this.unwrap(this.api.GET("/apps/{appId}/plans/features/{featureId}", { params: { path: { appId, featureId } } }));
264
232
  }
265
- async createFeature(appId, data) {
266
- return this.unwrap(this.api.POST("/apps/{appId}/plans/features", { params: { path: { appId } }, body: data }));
267
- }
268
233
  async updateFeature(appId, featureId, data) {
269
234
  return this.unwrap(this.api.PUT("/apps/{appId}/plans/features/{featureId}", { params: { path: { appId, featureId } }, body: data }));
270
235
  }
271
236
  async deleteFeature(appId, featureId) {
272
237
  return this.unwrap(this.api.DELETE("/apps/{appId}/plans/features/{featureId}", { params: { path: { appId, featureId } } }));
273
238
  }
274
- // Reviews
275
- async listReviews(appId) {
276
- return this.unwrap(this.api.GET("/apps/{id}/reviews", { params: { path: { id: appId } } }));
239
+ async listFeatures(appId) {
240
+ return this.unwrap(this.api.GET("/apps/{appId}/plans/features", { params: { path: { appId } } }));
241
+ }
242
+ async createFeature(appId, data) {
243
+ return this.unwrap(this.api.POST("/apps/{appId}/plans/features", { params: { path: { appId } }, body: data }));
244
+ }
245
+ async listPlans(appId, params) {
246
+ return this.unwrap(this.api.GET("/apps/{id}/plans", { params: { path: { id: appId }, query: params } }));
247
+ }
248
+ async createPlan(appId, data) {
249
+ return this.unwrap(this.api.POST("/apps/{id}/plans", { params: { path: { id: appId } }, body: data }));
277
250
  }
278
251
  async getReview(appId, reviewId) {
279
252
  return this.unwrap(this.api.GET("/apps/{id}/reviews/{reviewId}", { params: { path: { id: appId, reviewId } } }));
280
253
  }
281
- // Usage Metrics
282
- async listUsageMetrics(appId) {
283
- return this.unwrap(this.api.GET("/apps/{id}/usage_metrics", { params: { path: { id: appId } } }));
254
+ async listReviews(appId, params) {
255
+ return this.unwrap(this.api.GET("/apps/{id}/reviews", { params: { path: { id: appId }, query: params } }));
256
+ }
257
+ async getSkill(appId, skillId, params) {
258
+ return this.unwrap(this.api.GET("/apps/{id}/skills/{skillId}", { params: { path: { id: appId, skillId }, query: params } }));
259
+ }
260
+ async createSkill(appId, skillId, data) {
261
+ return this.unwrap(this.api.POST("/apps/{id}/skills/{skillId}", { params: { path: { id: appId, skillId } }, body: data }));
284
262
  }
285
263
  async getUsageMetric(appId, usageMetricId) {
286
264
  return this.unwrap(this.api.GET("/apps/{id}/usage_metrics/{usageMetricId}", { params: { path: { id: appId, usageMetricId } } }));
287
265
  }
288
- async createUsageMetric(appId, data) {
289
- return this.unwrap(this.api.POST("/apps/{id}/usage_metrics", { params: { path: { id: appId } }, body: data }));
290
- }
291
266
  async updateUsageMetric(appId, usageMetricId, data) {
292
267
  return this.unwrap(this.api.PUT("/apps/{id}/usage_metrics/{usageMetricId}", { params: { path: { id: appId, usageMetricId } }, body: data }));
293
268
  }
294
269
  async deleteUsageMetric(appId, usageMetricId) {
295
270
  return this.unwrap(this.api.DELETE("/apps/{id}/usage_metrics/{usageMetricId}", { params: { path: { id: appId, usageMetricId } } }));
296
271
  }
297
- // App Events
298
- async listAppEvents(appId, params) {
299
- return this.unwrap(this.api.GET("/apps/{id}/app_events", { params: { path: { id: appId }, query: params } }));
272
+ async listUsageMetrics(appId) {
273
+ return this.unwrap(this.api.GET("/apps/{id}/usage_metrics", { params: { path: { id: appId } } }));
300
274
  }
301
- async getAppEvent(appId, appEventId) {
302
- return this.unwrap(this.api.GET("/apps/{id}/app_events/{appEventId}", { params: { path: { id: appId, appEventId } } }));
275
+ async createUsageMetric(appId, data) {
276
+ return this.unwrap(this.api.POST("/apps/{id}/usage_metrics", { params: { path: { id: appId } }, body: data }));
303
277
  }
304
- async createAppEvent(appId, data) {
305
- return this.unwrap(this.api.POST("/apps/{id}/app_events", { params: { path: { id: appId } }, body: data }));
278
+ };
279
+
280
+ // src/resources/assistant.ts
281
+ var AssistantResource = class extends BaseResource {
282
+ async getConversation(conversationId) {
283
+ return this.unwrap(this.api.GET("/assistant/conversations/{id}", { params: { path: { id: conversationId } } }));
306
284
  }
307
285
  };
308
286
 
309
- // src/resources/deals.ts
310
- var DealsResource = class extends BaseResource {
287
+ // src/resources/channels.ts
288
+ var ChannelsResource = class extends BaseResource {
311
289
  async list(params) {
312
- return this.unwrap(this.api.GET("/deals", { params: { query: params } }));
313
- }
314
- async get(dealId) {
315
- return this.unwrap(this.api.GET("/deals/{id}", { params: { path: { id: dealId } } }));
290
+ return this.unwrap(this.api.GET("/channels", { params: { query: params } }));
316
291
  }
317
292
  async create(data) {
318
- return this.unwrap(this.api.POST("/deals", { body: data }));
319
- }
320
- async update(dealId, data) {
321
- return this.unwrap(this.api.PUT("/deals/{id}", { params: { path: { id: dealId } }, body: data }));
322
- }
323
- async del(dealId) {
324
- return this.unwrap(this.api.DELETE("/deals/{id}", { params: { path: { id: dealId } } }));
325
- }
326
- async timeline(dealId) {
327
- return this.unwrap(this.api.GET("/deals/{id}/timeline", { params: { path: { id: dealId } } }));
328
- }
329
- async listEvents(dealId) {
330
- return this.unwrap(this.api.GET("/deals/{id}/events", { params: { path: { id: dealId } } }));
331
- }
332
- async createEvent(dealId, data) {
333
- return this.unwrap(this.api.POST("/deals/{id}/events", { params: { path: { id: dealId } }, body: data }));
293
+ return this.unwrap(this.api.POST("/channels", { body: data }));
334
294
  }
335
295
  };
336
296
 
337
- // src/resources/deal-flows.ts
338
- var DealFlowsResource = class extends BaseResource {
297
+ // src/resources/charges.ts
298
+ var ChargesResource = class extends BaseResource {
339
299
  async list(params) {
340
- return this.unwrap(this.api.GET("/deal_flows", { params: { query: params } }));
341
- }
342
- async get(dealFlowId) {
343
- return this.unwrap(this.api.GET("/deal_flows/{id}", { params: { path: { id: dealFlowId } } }));
344
- }
345
- async create(data) {
346
- return this.unwrap(this.api.POST("/deal_flows", { body: data }));
347
- }
348
- async update(dealFlowId, data) {
349
- return this.unwrap(this.api.PUT("/deal_flows/{id}", { params: { path: { id: dealFlowId } }, body: data }));
350
- }
351
- async del(dealFlowId) {
352
- return this.unwrap(this.api.DELETE("/deal_flows/{id}", { params: { path: { id: dealFlowId } } }));
300
+ return this.unwrap(this.api.GET("/charges", { params: { query: params } }));
353
301
  }
354
302
  };
355
303
 
356
- // src/resources/deal-activities.ts
357
- var DealActivitiesResource = class extends BaseResource {
304
+ // src/resources/companies.ts
305
+ var CompaniesResource = class extends BaseResource {
358
306
  async list(params) {
359
- return this.unwrap(this.api.GET("/deal_activities", { params: { query: params } }));
360
- }
361
- async get(dealActivityId) {
362
- return this.unwrap(this.api.GET("/deal_activities/{id}", { params: { path: { id: dealActivityId } } }));
307
+ return this.unwrap(this.api.GET("/companies", { params: { query: params } }));
363
308
  }
364
309
  async create(data) {
365
- return this.unwrap(this.api.POST("/deal_activities", { body: data }));
310
+ return this.unwrap(this.api.POST("/companies", { body: data }));
366
311
  }
367
- async update(dealActivityId, data) {
368
- return this.unwrap(this.api.PUT("/deal_activities/{id}", { params: { path: { id: dealActivityId } }, body: data }));
312
+ async get(companyId) {
313
+ return this.unwrap(this.api.GET("/companies/{id}", { params: { path: { id: companyId } } }));
314
+ }
315
+ async update(companyId, data) {
316
+ return this.unwrap(this.api.PUT("/companies/{id}", { params: { path: { id: companyId } }, body: data }));
369
317
  }
370
- async del(dealActivityId) {
371
- return this.unwrap(this.api.DELETE("/deal_activities/{id}", { params: { path: { id: dealActivityId } } }));
318
+ async del(companyId) {
319
+ return this.unwrap(this.api.DELETE("/companies/{id}", { params: { path: { id: companyId } } }));
372
320
  }
373
321
  };
374
322
 
375
- // src/resources/tickets.ts
376
- var TicketsResource = class extends BaseResource {
377
- // Tickets
323
+ // src/resources/contacts.ts
324
+ var ContactsResource = class extends BaseResource {
378
325
  async list(params) {
379
- return this.unwrap(this.api.GET("/tickets", { params: { query: params } }));
380
- }
381
- async get(ticketId) {
382
- return this.unwrap(this.api.GET("/tickets/{id}", { params: { path: { id: ticketId } } }));
326
+ return this.unwrap(this.api.GET("/contacts", { params: { query: params } }));
383
327
  }
384
328
  async create(data) {
385
- return this.unwrap(this.api.POST("/tickets", { body: data }));
386
- }
387
- async update(ticketId, data) {
388
- return this.unwrap(this.api.PUT("/tickets/{id}", { params: { path: { id: ticketId } }, body: data }));
389
- }
390
- // Messages
391
- async listMessages(ticketId, params) {
392
- return this.unwrap(this.api.GET("/tickets/{id}/messages", { params: { path: { id: ticketId }, query: params } }));
329
+ return this.unwrap(this.api.POST("/contacts", { body: data }));
393
330
  }
394
- async getMessage(ticketId, messageId) {
395
- return this.unwrap(this.api.GET("/tickets/{id}/messages/{messageId}", { params: { path: { id: ticketId, messageId } } }));
331
+ async addTags(contactId, data) {
332
+ return this.unwrap(this.api.POST("/contacts/{id}/addTags", { params: { path: { id: contactId } }, body: data }));
396
333
  }
397
- async createMessage(ticketId, data) {
398
- return this.unwrap(this.api.POST("/tickets/{id}/messages", { params: { path: { id: ticketId } }, body: data }));
334
+ async get(contactId) {
335
+ return this.unwrap(this.api.GET("/contacts/{id}", { params: { path: { id: contactId } } }));
399
336
  }
400
- async updateMessage(ticketId, data) {
401
- return this.unwrap(this.api.PUT("/tickets/{id}/messages", { params: { path: { id: ticketId } }, body: data }));
337
+ async update(contactId, data) {
338
+ return this.unwrap(this.api.PUT("/contacts/{id}", { params: { path: { id: contactId } }, body: data }));
402
339
  }
403
- // Events
404
- async listEvents(ticketId, params) {
405
- return this.unwrap(this.api.GET("/tickets/{id}/events", { params: { path: { id: ticketId }, query: params } }));
340
+ async del(contactId) {
341
+ return this.unwrap(this.api.DELETE("/contacts/{id}", { params: { path: { id: contactId } } }));
406
342
  }
407
- async createEvent(ticketId, data) {
408
- return this.unwrap(this.api.POST("/tickets/{id}/events", { params: { path: { id: ticketId } }, body: data }));
343
+ async removeTags(contactId, data) {
344
+ return this.unwrap(this.api.POST("/contacts/{id}/removeTags", { params: { path: { id: contactId } }, body: data }));
409
345
  }
410
- // Loops
411
- async listLoops(ticketId) {
412
- return this.unwrap(this.api.GET("/tickets/{id}/loops", { params: { path: { id: ticketId } } }));
346
+ };
347
+
348
+ // src/resources/custom-data.ts
349
+ var CustomDataResource = class extends BaseResource {
350
+ async getValue(params) {
351
+ return this.unwrap(this.api.GET("/custom_data", { params: { query: params } }));
413
352
  }
414
- async getLoop(ticketId, loopId) {
415
- return this.unwrap(this.api.GET("/tickets/{id}/loops/{loopId}", { params: { path: { id: ticketId, loopId } } }));
353
+ async set(data) {
354
+ return this.unwrap(this.api.PUT("/custom_data", { body: data }));
416
355
  }
417
356
  };
418
357
 
419
- // src/resources/channels.ts
420
- var ChannelsResource = class extends BaseResource {
421
- /**
422
- * List CX channels with optional filters
423
- */
358
+ // src/resources/customer-segments.ts
359
+ var CustomerSegmentsResource = class extends BaseResource {
424
360
  async list(params) {
425
- return this.unwrap(this.api.GET("/channels", { params: { query: params } }));
361
+ return this.unwrap(this.api.GET("/customer_segments", { params: { query: params } }));
426
362
  }
427
- /**
428
- * Create a new CX channel
429
- */
430
- async create(data) {
431
- return this.unwrap(this.api.POST("/channels", { body: data }));
363
+ async get(segmentId) {
364
+ return this.unwrap(this.api.GET("/customer_segments/{id}", { params: { path: { id: segmentId } } }));
432
365
  }
433
366
  };
434
367
 
435
- // src/resources/flows.ts
436
- var FlowsResource = class extends BaseResource {
437
- /**
438
- * List flows with optional filters and pagination
439
- */
368
+ // src/resources/customers.ts
369
+ var CustomersResource = class extends BaseResource {
440
370
  async list(params) {
441
- return this.unwrap(this.api.GET("/flows", { params: { query: params } }));
442
- }
443
- /**
444
- * Get a single flow by ID
445
- */
446
- async get(flowId) {
447
- return this.unwrap(this.api.GET("/flows/{id}", { params: { path: { id: flowId } } }));
371
+ return this.unwrap(this.api.GET("/customers", { params: { query: params } }));
448
372
  }
449
- /**
450
- * Create a new flow
451
- */
452
373
  async create(data) {
453
- return this.unwrap(this.api.POST("/flows", { body: data }));
374
+ return this.unwrap(this.api.POST("/customers", { body: data }));
454
375
  }
455
- /**
456
- * Update an existing flow
457
- */
458
- async update(flowId, data) {
459
- return this.unwrap(this.api.PATCH("/flows/{id}", { params: { path: { id: flowId } }, body: data }));
376
+ async listCustomFields(params) {
377
+ return this.unwrap(this.api.GET("/customers/custom_fields", { params: { query: params } }));
460
378
  }
461
- /**
462
- * Delete a flow
463
- */
464
- async del(flowId) {
465
- return this.unwrap(this.api.DELETE("/flows/{id}", { params: { path: { id: flowId } } }));
379
+ async createCustomField(data) {
380
+ return this.unwrap(this.api.POST("/customers/custom_fields", { body: data }));
466
381
  }
467
- };
468
-
469
- // src/resources/tasks.ts
470
- var TasksResource = class extends BaseResource {
471
- // Tasks
472
- async list(params) {
473
- return this.unwrap(this.api.GET("/tasks", { params: { query: params } }));
382
+ async updateAccountOwner(customerId, ownerId, data) {
383
+ return this.unwrap(this.api.PUT("/customers/{id}/account_owners/{ownerId}", { params: { path: { id: customerId, ownerId } }, body: data }));
474
384
  }
475
- async get(taskId) {
476
- return this.unwrap(this.api.GET("/tasks/{id}", { params: { path: { id: taskId } } }));
385
+ async deleteAccountOwner(customerId, ownerId) {
386
+ return this.unwrap(this.api.DELETE("/customers/{id}/account_owners/{ownerId}", { params: { path: { id: customerId, ownerId } } }));
477
387
  }
478
- async create(data) {
479
- return this.unwrap(this.api.POST("/tasks", { body: data }));
388
+ async addTags(customerId, data) {
389
+ return this.unwrap(this.api.POST("/customers/{id}/addTags", { params: { path: { id: customerId } }, body: data }));
480
390
  }
481
- async update(taskId, data) {
482
- return this.unwrap(this.api.PUT("/tasks/{id}", { params: { path: { id: taskId } }, body: data }));
391
+ async get(customerId) {
392
+ return this.unwrap(this.api.GET("/customers/{id}", { params: { path: { id: customerId } } }));
483
393
  }
484
- async del(taskId) {
485
- return this.unwrap(this.api.DELETE("/tasks/{id}", { params: { path: { id: taskId } } }));
394
+ async update(customerId, data) {
395
+ return this.unwrap(this.api.PUT("/customers/{id}", { params: { path: { id: customerId } }, body: data }));
486
396
  }
487
- // Todo Items
488
- async listTodoItems(taskId) {
489
- return this.unwrap(this.api.GET("/tasks/{id}/todo-items", { params: { path: { id: taskId } } }));
397
+ async removeTags(customerId, data) {
398
+ return this.unwrap(this.api.POST("/customers/{id}/removeTags", { params: { path: { id: customerId } }, body: data }));
490
399
  }
491
- async getTodoItem(taskId, itemId) {
492
- return this.unwrap(this.api.GET("/tasks/{id}/todo-items/{itemId}", { params: { path: { id: taskId, itemId } } }));
400
+ async getTimeline(customerId, params) {
401
+ return this.unwrap(this.api.GET("/customers/{id}/timeline", { params: { path: { id: customerId }, query: params } }));
493
402
  }
494
- async createTodoItem(taskId, data) {
495
- return this.unwrap(this.api.POST("/tasks/{id}/todo-items", { params: { path: { id: taskId } }, body: data }));
403
+ async listAccountOwners(customerId) {
404
+ return this.unwrap(this.api.GET("/customers/{id}/account_owners", { params: { path: { id: customerId } } }));
496
405
  }
497
- async updateTodoItem(taskId, itemId, data) {
498
- return this.unwrap(this.api.PUT("/tasks/{id}/todo-items/{itemId}", { params: { path: { id: taskId, itemId } }, body: data }));
406
+ async createAccountOwner(customerId, data) {
407
+ return this.unwrap(this.api.POST("/customers/{id}/account_owners", { params: { path: { id: customerId } }, body: data }));
499
408
  }
500
- async deleteTodoItem(taskId, itemId) {
501
- return this.unwrap(this.api.DELETE("/tasks/{id}/todo-items/{itemId}", { params: { path: { id: taskId, itemId } } }));
409
+ async getCustomField(customerId) {
410
+ return this.unwrap(this.api.GET("/customers/custom_fields/{id}", { params: { path: { id: customerId } } }));
411
+ }
412
+ async updateCustomField(customerId, data) {
413
+ return this.unwrap(this.api.PUT("/customers/custom_fields/{id}", { params: { path: { id: customerId } }, body: data }));
414
+ }
415
+ async deleteCustomField(customerId) {
416
+ return this.unwrap(this.api.DELETE("/customers/custom_fields/{id}", { params: { path: { id: customerId } } }));
502
417
  }
503
418
  };
504
419
 
505
- // src/resources/webhooks.ts
506
- var WebhooksResource = class extends BaseResource {
507
- /**
508
- * List all webhooks
509
- */
510
- async list() {
511
- return this.unwrap(this.api.GET("/webhooks"));
420
+ // src/resources/deal-activities.ts
421
+ var DealActivitiesResource = class extends BaseResource {
422
+ async list(params) {
423
+ return this.unwrap(this.api.GET("/deal_activities", { params: { query: params } }));
512
424
  }
513
- /**
514
- * Create a new webhook
515
- */
516
425
  async create(data) {
517
- return this.unwrap(this.api.POST("/webhooks", { body: data }));
426
+ return this.unwrap(this.api.POST("/deal_activities", { body: data }));
518
427
  }
519
- /**
520
- * Update an existing webhook
521
- */
522
- async update(webhookId, data) {
523
- return this.unwrap(this.api.PUT("/webhooks/{id}", { params: { path: { id: webhookId } }, body: data }));
428
+ async get(activityId) {
429
+ return this.unwrap(this.api.GET("/deal_activities/{id}", { params: { path: { id: activityId } } }));
524
430
  }
525
- /**
526
- * Delete a webhook
527
- */
528
- async del(webhookId) {
529
- return this.unwrap(this.api.DELETE("/webhooks/{id}", { params: { path: { id: webhookId } } }));
431
+ async update(activityId, data) {
432
+ return this.unwrap(this.api.PUT("/deal_activities/{id}", { params: { path: { id: activityId } }, body: data }));
433
+ }
434
+ async del(activityId) {
435
+ return this.unwrap(this.api.DELETE("/deal_activities/{id}", { params: { path: { id: activityId } } }));
530
436
  }
531
437
  };
532
438
 
533
- // src/resources/companies.ts
534
- var CompaniesResource = class extends BaseResource {
535
- /**
536
- * List companies with optional pagination
537
- */
439
+ // src/resources/deal-flows.ts
440
+ var DealFlowsResource = class extends BaseResource {
538
441
  async list(params) {
539
- return this.unwrap(this.api.GET("/companies", { params: { query: params } }));
540
- }
541
- /**
542
- * Get a single company by ID
543
- */
544
- async get(companyId) {
545
- return this.unwrap(this.api.GET("/companies/{id}", { params: { path: { id: companyId } } }));
442
+ return this.unwrap(this.api.GET("/deal_flows", { params: { query: params } }));
546
443
  }
547
- /**
548
- * Create a new company
549
- */
550
444
  async create(data) {
551
- return this.unwrap(this.api.POST("/companies", { body: data }));
445
+ return this.unwrap(this.api.POST("/deal_flows", { body: data }));
552
446
  }
553
- /**
554
- * Update an existing company
555
- */
556
- async update(companyId, data) {
557
- return this.unwrap(this.api.PUT("/companies/{id}", { params: { path: { id: companyId } }, body: data }));
447
+ async get(dealFlowId) {
448
+ return this.unwrap(this.api.GET("/deal_flows/{id}", { params: { path: { id: dealFlowId } } }));
558
449
  }
559
- /**
560
- * Delete a company
561
- */
562
- async del(companyId) {
563
- return this.unwrap(this.api.DELETE("/companies/{id}", { params: { path: { id: companyId } } }));
450
+ async update(dealFlowId, data) {
451
+ return this.unwrap(this.api.PUT("/deal_flows/{id}", { params: { path: { id: dealFlowId } }, body: data }));
452
+ }
453
+ async del(dealFlowId) {
454
+ return this.unwrap(this.api.DELETE("/deal_flows/{id}", { params: { path: { id: dealFlowId } } }));
564
455
  }
565
456
  };
566
457
 
567
- // src/resources/customer-segments.ts
568
- var CustomerSegmentsResource = class extends BaseResource {
569
- /**
570
- * List public customer segments with optional pagination
571
- */
458
+ // src/resources/deals.ts
459
+ var DealsResource = class extends BaseResource {
572
460
  async list(params) {
573
- return this.unwrap(this.api.GET("/customer_segments", { params: { query: params } }));
461
+ return this.unwrap(this.api.GET("/deals", { params: { query: params } }));
574
462
  }
575
- /**
576
- * Get a single customer segment by ID
577
- */
578
- async get(segmentId) {
579
- return this.unwrap(this.api.GET("/customer_segments/{id}", { params: { path: { id: segmentId } } }));
463
+ async create(data) {
464
+ return this.unwrap(this.api.POST("/deals", { body: data }));
465
+ }
466
+ async listEvents(dealId, params) {
467
+ return this.unwrap(this.api.GET("/deals/{id}/events", { params: { path: { id: dealId }, query: params } }));
468
+ }
469
+ async createEvent(dealId, data) {
470
+ return this.unwrap(this.api.POST("/deals/{id}/events", { params: { path: { id: dealId } }, body: data }));
471
+ }
472
+ async get(dealId) {
473
+ return this.unwrap(this.api.GET("/deals/{id}", { params: { path: { id: dealId } } }));
474
+ }
475
+ async update(dealId, data) {
476
+ return this.unwrap(this.api.PUT("/deals/{id}", { params: { path: { id: dealId } }, body: data }));
477
+ }
478
+ async del(dealId) {
479
+ return this.unwrap(this.api.DELETE("/deals/{id}", { params: { path: { id: dealId } } }));
480
+ }
481
+ async getTimeline(dealId, params) {
482
+ return this.unwrap(this.api.GET("/deals/{id}/timeline", { params: { path: { id: dealId }, query: params } }));
580
483
  }
581
484
  };
582
485
 
583
- // src/resources/affiliates.ts
584
- var AffiliatesResource = class extends BaseResource {
585
- /**
586
- * List affiliates with optional filters and pagination
587
- */
588
- async list(params) {
589
- return this.unwrap(this.api.GET("/affiliates", { params: { query: params } }));
486
+ // src/resources/docs.ts
487
+ var DocsResource = class extends BaseResource {
488
+ async listCollections(params) {
489
+ return this.unwrap(this.api.GET("/docs/collections", { params: { query: params } }));
590
490
  }
591
- /**
592
- * Get a single affiliate by ID
593
- */
594
- async get(affiliateId) {
595
- return this.unwrap(this.api.GET("/affiliates/{id}", { params: { path: { id: affiliateId } } }));
491
+ async createCollection(data) {
492
+ return this.unwrap(this.api.POST("/docs/collections", { body: data }));
596
493
  }
597
- /**
598
- * Update an existing affiliate
599
- * Note: PUT not in OpenAPI spec but kept for backwards compatibility
600
- */
601
- async update(affiliateId, data) {
602
- return this.unwrap(this.untypedApi.PUT("/affiliates/{id}", { params: { path: { id: affiliateId } }, body: data }));
494
+ async listGroups(params) {
495
+ return this.unwrap(this.api.GET("/docs/groups", { params: { query: params } }));
496
+ }
497
+ async createGroup(data) {
498
+ return this.unwrap(this.api.POST("/docs/groups", { body: data }));
499
+ }
500
+ async listPages(params) {
501
+ return this.unwrap(this.api.GET("/docs/pages", { params: { query: params } }));
502
+ }
503
+ async createPage(data) {
504
+ return this.unwrap(this.api.POST("/docs/pages", { body: data }));
505
+ }
506
+ async listRepositories(params) {
507
+ return this.unwrap(this.api.GET("/docs/repositories", { params: { query: params } }));
508
+ }
509
+ async updateCollection(collectionId, data) {
510
+ return this.unwrap(this.api.PUT("/docs/collections/{collection_id}", { params: { path: { collection_id: collectionId } }, body: data }));
511
+ }
512
+ async deleteCollection(collectionId) {
513
+ return this.unwrap(this.api.DELETE("/docs/collections/{collection_id}", { params: { path: { collection_id: collectionId } } }));
514
+ }
515
+ async updateGroup(groupId, data) {
516
+ return this.unwrap(this.api.PUT("/docs/groups/{group_id}", { params: { path: { group_id: groupId } }, body: data }));
517
+ }
518
+ async deleteGroup(groupId) {
519
+ return this.unwrap(this.api.DELETE("/docs/groups/{group_id}", { params: { path: { group_id: groupId } } }));
520
+ }
521
+ async getPage(pageId, params) {
522
+ return this.unwrap(this.api.GET("/docs/pages/{page_id}", { params: { path: { page_id: pageId }, query: params } }));
523
+ }
524
+ async updatePage(pageId, data) {
525
+ return this.unwrap(this.api.PUT("/docs/pages/{page_id}", { params: { path: { page_id: pageId } }, body: data }));
526
+ }
527
+ async deletePage(pageId) {
528
+ return this.unwrap(this.api.DELETE("/docs/pages/{page_id}", { params: { path: { page_id: pageId } } }));
529
+ }
530
+ async getRepository(docId, params) {
531
+ return this.unwrap(this.api.GET("/docs/repositories/{id}", { params: { path: { id: docId }, query: params } }));
603
532
  }
604
533
  };
605
534
 
606
- // src/resources/affiliate-programs.ts
607
- var AffiliateProgramsResource = class extends BaseResource {
608
- /**
609
- * List affiliate programs with optional filters and pagination
610
- */
611
- async list(params) {
612
- return this.unwrap(this.api.GET("/affiliate_programs", { params: { query: params } }));
535
+ // src/resources/email-unsubscribe-groups.ts
536
+ var EmailUnsubscribeGroupsResource = class extends BaseResource {
537
+ async list() {
538
+ return this.unwrap(this.api.GET("/email/unsubscribe_groups"));
613
539
  }
614
- /**
615
- * Get a single affiliate program by ID
616
- */
617
- async get(programId) {
618
- return this.unwrap(this.api.GET("/affiliate_programs/{id}", { params: { path: { id: programId } } }));
540
+ async deleteMemberDelete(groupId, memberId) {
541
+ return this.unwrap(this.api.DELETE("/email/unsubscribe_groups/{id}/members/{member_id}", { params: { path: { id: groupId, member_id: memberId } } }));
619
542
  }
620
- /**
621
- * Create a new affiliate program
622
- * Note: POST not yet in OpenAPI spec
623
- */
624
- async create(data) {
625
- return this.unwrap(this.untypedApi.POST("/affiliate_programs", { body: data }));
543
+ async listMembers(groupId) {
544
+ return this.unwrap(this.api.GET("/email/unsubscribe_groups/{id}/members", { params: { path: { id: groupId } } }));
626
545
  }
627
- /**
628
- * Update an existing affiliate program
629
- * Note: PUT not yet in OpenAPI spec
630
- */
631
- async update(programId, data) {
632
- return this.unwrap(this.untypedApi.PUT("/affiliate_programs/{id}", { params: { path: { id: programId } }, body: data }));
546
+ async createMember(groupId, data) {
547
+ return this.unwrap(this.api.POST("/email/unsubscribe_groups/{id}/members", { params: { path: { id: groupId } }, body: data }));
633
548
  }
634
- /**
635
- * Delete an affiliate program
636
- * Note: DELETE not yet in OpenAPI spec
637
- */
638
- async del(programId) {
639
- return this.unwrap(this.untypedApi.DELETE("/affiliate_programs/{id}", { params: { path: { id: programId } } }));
549
+ };
550
+
551
+ // src/resources/entities.ts
552
+ var EntitiesResource = class extends BaseResource {
553
+ async search(params) {
554
+ return this.unwrap(this.api.GET("/entities", { params: { query: params } }));
640
555
  }
641
556
  };
642
557
 
643
- // src/resources/affiliate-commissions.ts
644
- var AffiliateCommissionsResource = class extends BaseResource {
645
- /**
646
- * List affiliate commissions with optional filters and pagination
647
- */
648
- async list(params) {
649
- return this.unwrap(this.api.GET("/affiliate_commissions", { params: { query: params } }));
558
+ // src/resources/flow-extensions.ts
559
+ var FlowExtensionsResource = class extends BaseResource {
560
+ async listActions() {
561
+ return this.unwrap(this.api.GET("/flow/extensions/actions"));
650
562
  }
651
- /**
652
- * Get a single affiliate commission by ID
653
- */
654
- async get(commissionId) {
655
- return this.unwrap(this.api.GET("/affiliate_commissions/{id}", { params: { path: { id: commissionId } } }));
563
+ async createAction(data) {
564
+ return this.unwrap(this.api.POST("/flow/extensions/actions", { body: data }));
565
+ }
566
+ async listTriggers() {
567
+ return this.unwrap(this.api.GET("/flow/extensions/triggers"));
568
+ }
569
+ async createTriggerPost(data) {
570
+ return this.unwrap(this.api.POST("/flow/extensions/triggers", { body: data }));
571
+ }
572
+ async validateSchema(data) {
573
+ return this.unwrap(this.api.POST("/flow/extensions/triggers/validate-schema", { body: data }));
574
+ }
575
+ async updateRun(extensionId, data) {
576
+ return this.unwrap(this.api.PUT("/flow/actions/runs/{id}", { params: { path: { id: extensionId } }, body: data }));
577
+ }
578
+ async fireTrigger(handle, data) {
579
+ return this.unwrap(this.api.POST("/flow/extensions/triggers/{handle}/fire", { params: { path: { handle } }, body: data }));
580
+ }
581
+ async updateAction(extensionId, data) {
582
+ return this.unwrap(this.api.PUT("/flow/extensions/actions/{id}", { params: { path: { id: extensionId } }, body: data }));
583
+ }
584
+ async deleteAction(extensionId) {
585
+ return this.unwrap(this.api.DELETE("/flow/extensions/actions/{id}", { params: { path: { id: extensionId } } }));
586
+ }
587
+ async getTrigger(handle) {
588
+ return this.unwrap(this.api.GET("/flow/extensions/triggers/{handle}", { params: { path: { handle } } }));
589
+ }
590
+ async replaceTrigger(handle, data) {
591
+ return this.unwrap(this.api.PUT("/flow/extensions/triggers/{handle}", { params: { path: { handle } }, body: data }));
592
+ }
593
+ async updateTrigger(handle, data) {
594
+ return this.unwrap(this.api.PATCH("/flow/extensions/triggers/{handle}", { params: { path: { handle } }, body: data }));
595
+ }
596
+ async deleteTrigger(handle) {
597
+ return this.unwrap(this.api.DELETE("/flow/extensions/triggers/{handle}", { params: { path: { handle } } }));
656
598
  }
657
599
  };
658
600
 
659
- // src/resources/affiliate-payouts.ts
660
- var AffiliatePayoutsResource = class extends BaseResource {
661
- /**
662
- * List affiliate payouts with optional filters and pagination
663
- */
601
+ // src/resources/flows.ts
602
+ var FlowsResource = class extends BaseResource {
664
603
  async list(params) {
665
- return this.unwrap(this.api.GET("/affiliate_payouts", { params: { query: params } }));
604
+ return this.unwrap(this.api.GET("/flows", { params: { query: params } }));
666
605
  }
667
- /**
668
- * Get a single affiliate payout by ID
669
- */
670
- async get(payoutId) {
671
- return this.unwrap(this.api.GET("/affiliate_payouts/{id}", { params: { path: { id: payoutId } } }));
606
+ async create(data) {
607
+ return this.unwrap(this.api.POST("/flows", { body: data }));
672
608
  }
673
- };
674
-
675
- // src/resources/affiliate-referrals.ts
676
- var AffiliateReferralsResource = class extends BaseResource {
677
- /**
678
- * List affiliate referrals with optional filters and pagination
679
- */
680
- async list(params) {
681
- return this.unwrap(this.api.GET("/affiliate_referrals", { params: { query: params } }));
609
+ async get(flowId) {
610
+ return this.unwrap(this.api.GET("/flows/{id}", { params: { path: { id: flowId } } }));
682
611
  }
683
- /**
684
- * Get a single affiliate referral by ID
685
- */
686
- async get(referralId) {
687
- return this.unwrap(this.api.GET("/affiliate_referrals/{id}", { params: { path: { id: referralId } } }));
612
+ async update(flowId, data) {
613
+ return this.unwrap(this.api.PATCH("/flows/{id}", { params: { path: { id: flowId } }, body: data }));
614
+ }
615
+ async del(flowId) {
616
+ return this.unwrap(this.api.DELETE("/flows/{id}", { params: { path: { id: flowId } } }));
688
617
  }
689
618
  };
690
619
 
691
- // src/resources/charges.ts
692
- var ChargesResource = class extends BaseResource {
693
- /**
694
- * List charges with optional filters and pagination
695
- */
620
+ // src/resources/journal-entries.ts
621
+ var JournalEntriesResource = class extends BaseResource {
696
622
  async list(params) {
697
- return this.unwrap(this.api.GET("/charges", { params: { query: params } }));
623
+ return this.unwrap(this.api.GET("/journal_entries", { params: { query: params } }));
624
+ }
625
+ async create(data) {
626
+ return this.unwrap(this.api.POST("/journal_entries", { body: data }));
627
+ }
628
+ async get(entryId, params) {
629
+ return this.unwrap(this.api.GET("/journal_entries/{id}", { params: { path: { id: entryId }, query: params } }));
630
+ }
631
+ async update(entryId, data) {
632
+ return this.unwrap(this.api.PUT("/journal_entries/{id}", { params: { path: { id: entryId } }, body: data }));
633
+ }
634
+ async del(entryId) {
635
+ return this.unwrap(this.api.DELETE("/journal_entries/{id}", { params: { path: { id: entryId } } }));
698
636
  }
699
637
  };
700
638
 
701
- // src/resources/transactions.ts
702
- var TransactionsResource = class extends BaseResource {
703
- /**
704
- * List transactions with optional filters and pagination
705
- */
639
+ // src/resources/lists.ts
640
+ var ListsResource = class extends BaseResource {
706
641
  async list(params) {
707
- return this.unwrap(this.api.GET("/transactions", { params: { query: params } }));
642
+ return this.unwrap(this.api.GET("/lists", { params: { query: params } }));
708
643
  }
709
- /**
710
- * Get a single transaction by ID
711
- */
712
- async get(transactionId) {
713
- return this.unwrap(this.api.GET("/transactions/{id}", { params: { path: { id: transactionId } } }));
644
+ async create(data) {
645
+ return this.unwrap(this.api.POST("/lists", { body: data }));
714
646
  }
715
- };
716
-
717
- // src/resources/metrics.ts
718
- var MetricsResource = class extends BaseResource {
719
- async mrr(params) {
720
- return this.unwrap(this.api.GET("/api/core/v1/metrics/mrr", { params: { query: params } }));
647
+ async add(listId, data) {
648
+ return this.unwrap(this.api.POST("/lists/{id}/add", { params: { path: { id: listId } }, body: data }));
721
649
  }
722
- async arr(params) {
723
- return this.unwrap(this.api.GET("/api/core/v1/metrics/arr", { params: { query: params } }));
650
+ async get(listId, params) {
651
+ return this.unwrap(this.api.GET("/lists/{id}", { params: { path: { id: listId }, query: params } }));
724
652
  }
725
- async arpu(params) {
726
- return this.unwrap(this.api.GET("/api/core/v1/metrics/arpu", { params: { query: params } }));
653
+ async update(listId, data) {
654
+ return this.unwrap(this.api.PUT("/lists/{id}", { params: { path: { id: listId } }, body: data }));
727
655
  }
728
- async activeSubscriptions(params) {
729
- return this.unwrap(this.api.GET("/api/core/v1/metrics/activeSubscriptions", { params: { query: params } }));
656
+ async del(listId) {
657
+ return this.unwrap(this.api.DELETE("/lists/{id}", { params: { path: { id: listId } } }));
730
658
  }
731
- async activeInstalls(params) {
732
- return this.unwrap(this.api.GET("/api/core/v1/metrics/activeInstalls", { params: { query: params } }));
659
+ async remove(listId, data) {
660
+ return this.unwrap(this.api.POST("/lists/{id}/remove", { params: { path: { id: listId } }, body: data }));
733
661
  }
734
- async netInstalls(params) {
735
- return this.unwrap(this.api.GET("/api/core/v1/metrics/netInstalls", { params: { query: params } }));
662
+ };
663
+
664
+ // src/resources/meetings.ts
665
+ var MeetingsResource = class extends BaseResource {
666
+ async list(params) {
667
+ return this.unwrap(this.api.GET("/meetings", { params: { query: params } }));
736
668
  }
737
- async logoChurn(params) {
738
- return this.unwrap(this.api.GET("/api/core/v1/metrics/logoChurn", { params: { query: params } }));
669
+ async create(data) {
670
+ return this.unwrap(this.api.POST("/meetings", { body: data }));
739
671
  }
740
- async revenueChurn(params) {
741
- return this.unwrap(this.api.GET("/api/core/v1/metrics/revenueChurn", { params: { query: params } }));
672
+ async getRecordingUrl(meetingId) {
673
+ return this.unwrap(this.api.GET("/meetings/{id}/recording-url", { params: { path: { id: meetingId } } }));
742
674
  }
743
- async revenueRetention(params) {
744
- return this.unwrap(this.api.GET("/api/core/v1/metrics/revenueRetention", { params: { query: params } }));
675
+ async acceptTaskSuggestion(meetingId, suggestionId, data) {
676
+ return this.unwrap(this.api.POST("/meetings/{id}/task-suggestions/{suggestionId}/accept", { params: { path: { id: meetingId, suggestionId } }, body: data }));
745
677
  }
746
- async netRevenueRetention(params) {
747
- return this.unwrap(this.api.GET("/api/core/v1/metrics/netRevenueRetention", { params: { query: params } }));
678
+ async dismissTaskSuggestion(meetingId, suggestionId) {
679
+ return this.unwrap(this.api.POST("/meetings/{id}/task-suggestions/{suggestionId}/dismiss", { params: { path: { id: meetingId, suggestionId } } }));
748
680
  }
749
- async netRevenue(params) {
750
- return this.unwrap(this.api.GET("/api/core/v1/metrics/netRevenue", { params: { query: params } }));
681
+ async updateAttendee(meetingId, attendeeId, data) {
682
+ return this.unwrap(this.api.PUT("/meetings/{id}/attendees/{attendeeId}", { params: { path: { id: meetingId, attendeeId } }, body: data }));
751
683
  }
752
- async payout(params) {
753
- return this.unwrap(this.api.GET("/api/core/v1/metrics/payout", { params: { query: params } }));
684
+ async transcribeGet(meetingId) {
685
+ return this.unwrap(this.api.GET("/meetings/{id}/transcribe", { params: { path: { id: meetingId } } }));
754
686
  }
755
- async predictedLtv(params) {
756
- return this.unwrap(this.api.GET("/api/core/v1/metrics/predictedLtv", { params: { query: params } }));
687
+ async transcribePost(meetingId, data) {
688
+ return this.unwrap(this.api.POST("/meetings/{id}/transcribe", { params: { path: { id: meetingId } }, body: data }));
757
689
  }
758
- async usageEvent(params) {
759
- return this.unwrap(this.api.GET("/api/core/v1/metrics/usageEvent", { params: { query: params } }));
690
+ async transcribeUpload(meetingId, data) {
691
+ return this.unwrap(this.api.POST("/meetings/{id}/transcribe/upload", { params: { path: { id: meetingId } }, body: data }));
760
692
  }
761
- async usageMetric(params) {
762
- return this.unwrap(this.api.GET("/api/core/v1/metrics/usageMetric", { params: { query: params } }));
693
+ async get(meetingId) {
694
+ return this.unwrap(this.api.GET("/meetings/{id}", { params: { path: { id: meetingId } } }));
763
695
  }
764
- };
765
-
766
- // src/resources/users.ts
767
- var UsersResource = class extends BaseResource {
768
- /**
769
- * List organization users with optional pagination
770
- */
771
- async list(params) {
772
- return this.unwrap(this.api.GET("/users", { params: { query: params } }));
696
+ async update(meetingId, data) {
697
+ return this.unwrap(this.api.PUT("/meetings/{id}", { params: { path: { id: meetingId } }, body: data }));
773
698
  }
774
- /**
775
- * Get a single user by ID
776
- */
777
- async get(userId) {
778
- return this.unwrap(this.api.GET("/users/{id}", { params: { path: { id: userId } } }));
699
+ async del(meetingId) {
700
+ return this.unwrap(this.api.DELETE("/meetings/{id}", { params: { path: { id: meetingId } } }));
779
701
  }
780
702
  };
781
703
 
@@ -786,328 +708,255 @@ var MeResource = class extends BaseResource {
786
708
  }
787
709
  };
788
710
 
789
- // src/resources/organization.ts
790
- var OrganizationResource = class extends BaseResource {
791
- /**
792
- * Get organization details
793
- */
794
- async get() {
795
- return this.unwrap(this.api.GET("/organization"));
796
- }
797
- };
798
-
799
- // src/resources/agents.ts
800
- var AgentsResource = class extends BaseResource {
801
- async list() {
802
- return this.unwrap(this.untypedApi.GET("/agents", {}));
803
- }
804
- async get(agentId) {
805
- return this.unwrap(this.untypedApi.GET("/agents/{id}", { params: { path: { id: agentId } } }));
806
- }
807
- async create(params) {
808
- return this.unwrap(this.untypedApi.POST("/agents", { body: params }));
809
- }
810
- async findOrCreate(params) {
811
- return this.unwrap(this.untypedApi.POST("/agents/find_or_create", { body: params }));
812
- }
813
- };
814
-
815
- // src/resources/docs.ts
816
- var DocsResource = class extends BaseResource {
817
- // Collections
818
- async listCollections(params) {
819
- return this.unwrap(this.api.GET("/docs/collections", { params: { query: params } }));
711
+ // src/resources/metrics.ts
712
+ var MetricsResource = class extends BaseResource {
713
+ async sales(params) {
714
+ return this.unwrap(this.api.GET("/metrics/sales", { params: { query: params } }));
820
715
  }
821
- async createCollection(data) {
822
- return this.unwrap(this.api.POST("/docs/collections", { body: data }));
716
+ async activeInstalls(params) {
717
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/activeInstalls", { params: { query: params } }));
823
718
  }
824
- async updateCollection(collectionId, data) {
825
- return this.unwrap(this.api.PUT("/docs/collections/{collection_id}", { params: { path: { collection_id: collectionId } }, body: data }));
719
+ async activeSubscriptions(params) {
720
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/activeSubscriptions", { params: { query: params } }));
826
721
  }
827
- async deleteCollection(collectionId) {
828
- return this.unwrap(this.api.DELETE("/docs/collections/{collection_id}", { params: { path: { collection_id: collectionId } } }));
722
+ async arpu(params) {
723
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/arpu", { params: { query: params } }));
829
724
  }
830
- // Groups
831
- async listGroups(params) {
832
- return this.unwrap(this.api.GET("/docs/groups", { params: { query: params } }));
725
+ async arr(params) {
726
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/arr", { params: { query: params } }));
833
727
  }
834
- async createGroup(data) {
835
- return this.unwrap(this.api.POST("/docs/groups", { body: data }));
728
+ async logoChurn(params) {
729
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/logoChurn", { params: { query: params } }));
836
730
  }
837
- async updateGroup(groupId, data) {
838
- return this.unwrap(this.api.PUT("/docs/groups/{group_id}", { params: { path: { group_id: groupId } }, body: data }));
731
+ async mrr(params) {
732
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/mrr", { params: { query: params } }));
839
733
  }
840
- async deleteGroup(groupId) {
841
- return this.unwrap(this.api.DELETE("/docs/groups/{group_id}", { params: { path: { group_id: groupId } } }));
734
+ async netInstalls(params) {
735
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/netInstalls", { params: { query: params } }));
842
736
  }
843
- // Pages
844
- async listPages(params) {
845
- return this.unwrap(this.api.GET("/docs/pages", { params: { query: params } }));
737
+ async netRevenue(params) {
738
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/netRevenue", { params: { query: params } }));
846
739
  }
847
- async getPage(pageId) {
848
- return this.unwrap(this.api.GET("/docs/pages/{page_id}", { params: { path: { page_id: pageId } } }));
740
+ async netRevenueRetention(params) {
741
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/netRevenueRetention", { params: { query: params } }));
849
742
  }
850
- async createPage(data) {
851
- return this.unwrap(this.api.POST("/docs/pages", { body: data }));
743
+ async payout(params) {
744
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/payout", { params: { query: params } }));
852
745
  }
853
- async updatePage(pageId, data) {
854
- return this.unwrap(this.api.PUT("/docs/pages/{page_id}", { params: { path: { page_id: pageId } }, body: data }));
746
+ async predictedLtv(params) {
747
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/predictedLtv", { params: { query: params } }));
855
748
  }
856
- async deletePage(pageId) {
857
- return this.unwrap(this.api.DELETE("/docs/pages/{page_id}", { params: { path: { page_id: pageId } } }));
749
+ async revenueChurn(params) {
750
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/revenueChurn", { params: { query: params } }));
858
751
  }
859
- // Repositories
860
- async listRepositories(params) {
861
- return this.unwrap(this.api.GET("/docs/repositories", { params: { query: params } }));
752
+ async revenueRetention(params) {
753
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/revenueRetention", { params: { query: params } }));
862
754
  }
863
- async getRepository(repositoryId, params) {
864
- return this.unwrap(this.api.GET("/docs/repositories/{id}", { params: { path: { id: repositoryId }, query: params } }));
755
+ async usageEvent(params) {
756
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/usageEvent", { params: { query: params } }));
865
757
  }
866
- };
867
-
868
- // src/resources/entities.ts
869
- var EntitiesResource = class extends BaseResource {
870
- /**
871
- * Search across contacts and customers
872
- * Returns entities with a _type discriminator field
873
- */
874
- async search(params) {
875
- return this.unwrap(this.api.GET("/entities", { params: { query: params } }));
758
+ async usageMetric(params) {
759
+ return this.unwrap(this.api.GET("/api/core/v1/metrics/usageMetric", { params: { query: params } }));
876
760
  }
877
761
  };
878
762
 
879
- // src/resources/custom-data.ts
880
- var CustomDataResource = class extends BaseResource {
881
- async set(data) {
882
- return this.unwrap(this.api.PUT("/custom_data", { body: data }));
883
- }
884
- async getValue(params) {
885
- return this.unwrap(this.api.GET("/custom_data", { params: { query: params } }));
763
+ // src/resources/organization.ts
764
+ var OrganizationResource = class extends BaseResource {
765
+ async list() {
766
+ return this.unwrap(this.api.GET("/organization"));
886
767
  }
887
768
  };
888
769
 
889
- // src/resources/timelineComments.ts
890
- var TimelineCommentsResource = class extends BaseResource {
891
- /**
892
- * List timeline comments with optional filters and pagination
893
- */
770
+ // src/resources/subscriptions.ts
771
+ var SubscriptionsResource = class extends BaseResource {
894
772
  async list(params) {
895
- return this.unwrap(this.api.GET("/timeline_comments", { params: { query: params } }));
896
- }
897
- /**
898
- * Get a single timeline comment by ID
899
- */
900
- async get(id) {
901
- return this.unwrap(this.api.GET("/timeline_comments/{id}", { params: { path: { id } } }));
902
- }
903
- /**
904
- * Create a new timeline comment
905
- */
906
- async create(data) {
907
- return this.unwrap(this.api.POST("/timeline_comments", { body: data }));
908
- }
909
- /**
910
- * Update an existing timeline comment
911
- */
912
- async update(id, data) {
913
- return this.unwrap(this.api.PUT("/timeline_comments/{id}", { params: { path: { id } }, body: data }));
773
+ return this.unwrap(this.api.GET("/subscriptions", { params: { query: params } }));
914
774
  }
915
- /**
916
- * Delete a timeline comment
917
- */
918
- async del(id, data) {
919
- return this.unwrap(this.api.DELETE("/timeline_comments/{id}", { params: { path: { id } }, body: data }));
775
+ async get(subscriptionId) {
776
+ return this.unwrap(this.api.GET("/subscriptions/{id}", { params: { path: { id: subscriptionId } } }));
920
777
  }
921
778
  };
922
779
 
923
- // src/resources/lists.ts
924
- var ListsResource = class extends BaseResource {
780
+ // src/resources/synced-emails.ts
781
+ var SyncedEmailsResource = class extends BaseResource {
925
782
  async list(params) {
926
- return this.unwrap(this.api.GET("/lists", { params: { query: params } }));
927
- }
928
- async get(listId) {
929
- return this.unwrap(this.api.GET("/lists/{id}", { params: { path: { id: listId } } }));
783
+ return this.unwrap(this.api.GET("/synced_emails", { params: { query: params } }));
930
784
  }
931
785
  async create(data) {
932
- return this.unwrap(this.api.POST("/lists", { body: data }));
786
+ return this.unwrap(this.api.POST("/synced_emails", { body: data }));
933
787
  }
934
- async update(listId, data) {
935
- return this.unwrap(this.api.PUT("/lists/{id}", { params: { path: { id: listId } }, body: data }));
788
+ async listMessages(syncedEmailId) {
789
+ return this.unwrap(this.api.GET("/synced_emails/{id}/messages", { params: { path: { id: syncedEmailId } } }));
936
790
  }
937
- async del(listId) {
938
- return this.unwrap(this.api.DELETE("/lists/{id}", { params: { path: { id: listId } } }));
791
+ async createMessage(syncedEmailId, data) {
792
+ return this.unwrap(this.api.POST("/synced_emails/{id}/messages", { params: { path: { id: syncedEmailId } }, body: data }));
939
793
  }
940
- async addEntities(listId, data) {
941
- return this.unwrap(this.api.POST("/lists/{id}/add", { params: { path: { id: listId } }, body: data }));
794
+ async get(syncedEmailId) {
795
+ return this.unwrap(this.api.GET("/synced_emails/{id}", { params: { path: { id: syncedEmailId } } }));
942
796
  }
943
- async removeEntities(listId, data) {
944
- return this.unwrap(this.api.POST("/lists/{id}/remove", { params: { path: { id: listId } }, body: data }));
797
+ async update(syncedEmailId, data) {
798
+ return this.unwrap(this.api.PUT("/synced_emails/{id}", { params: { path: { id: syncedEmailId } }, body: data }));
799
+ }
800
+ async del(syncedEmailId) {
801
+ return this.unwrap(this.api.DELETE("/synced_emails/{id}", { params: { path: { id: syncedEmailId } } }));
945
802
  }
946
803
  };
947
804
 
948
- // src/resources/journal-entries.ts
949
- var JournalEntriesResource = class extends BaseResource {
950
- /**
951
- * List journal entries with optional filters and pagination
952
- */
805
+ // src/resources/tasks.ts
806
+ var TasksResource = class extends BaseResource {
953
807
  async list(params) {
954
- return this.unwrap(this.api.GET("/journal_entries", { params: { query: params } }));
955
- }
956
- /**
957
- * Get a single journal entry by ID
958
- */
959
- async get(entryId, params) {
960
- return this.unwrap(this.api.GET("/journal_entries/{id}", { params: { path: { id: entryId }, query: params } }));
808
+ return this.unwrap(this.api.GET("/tasks", { params: { query: params } }));
961
809
  }
962
- /**
963
- * Create a new journal entry
964
- */
965
810
  async create(data) {
966
- return this.unwrap(this.api.POST("/journal_entries", { body: data }));
811
+ return this.unwrap(this.api.POST("/tasks", { body: data }));
967
812
  }
968
- /**
969
- * Update an existing journal entry
970
- */
971
- async update(entryId, data) {
972
- return this.unwrap(this.api.PUT("/journal_entries/{id}", { params: { path: { id: entryId } }, body: data }));
813
+ async get(taskId) {
814
+ return this.unwrap(this.api.GET("/tasks/{id}", { params: { path: { id: taskId } } }));
973
815
  }
974
- /**
975
- * Delete a journal entry
976
- */
977
- async del(entryId) {
978
- return this.unwrap(this.api.DELETE("/journal_entries/{id}", { params: { path: { id: entryId } } }));
816
+ async update(taskId, data) {
817
+ return this.unwrap(this.api.PUT("/tasks/{id}", { params: { path: { id: taskId } }, body: data }));
979
818
  }
980
- };
981
-
982
- // src/resources/email-unsubscribe-groups.ts
983
- var EmailUnsubscribeGroupsResource = class extends BaseResource {
984
- async list(params) {
985
- return this.unwrap(this.api.GET("/email/unsubscribe_groups", { params: { query: params } }));
819
+ async del(taskId) {
820
+ return this.unwrap(this.api.DELETE("/tasks/{id}", { params: { path: { id: taskId } } }));
986
821
  }
987
- async listMembers(groupId, params) {
988
- return this.unwrap(this.api.GET("/email/unsubscribe_groups/{id}/members", { params: { path: { id: groupId }, query: params } }));
822
+ async getTodoItem(taskId, itemId) {
823
+ return this.unwrap(this.api.GET("/tasks/{id}/todo-items/{itemId}", { params: { path: { id: taskId, itemId } } }));
989
824
  }
990
- async addMembers(groupId, data) {
991
- return this.unwrap(this.api.POST("/email/unsubscribe_groups/{id}/members", { params: { path: { id: groupId } }, body: data }));
825
+ async updateTodoItem(taskId, itemId, data) {
826
+ return this.unwrap(this.api.PUT("/tasks/{id}/todo-items/{itemId}", { params: { path: { id: taskId, itemId } }, body: data }));
827
+ }
828
+ async deleteTodoItem(taskId, itemId) {
829
+ return this.unwrap(this.api.DELETE("/tasks/{id}/todo-items/{itemId}", { params: { path: { id: taskId, itemId } } }));
992
830
  }
993
- async removeMembers(groupId, data) {
994
- return this.unwrap(this.api.DELETE("/email/unsubscribe_groups/{id}/members", { params: { path: { id: groupId } }, body: data }));
831
+ async getTodoItems(taskId) {
832
+ return this.unwrap(this.api.GET("/tasks/{id}/todo-items", { params: { path: { id: taskId } } }));
995
833
  }
996
- async removeMember(groupId, memberId) {
997
- return this.unwrap(this.api.DELETE("/email/unsubscribe_groups/{id}/members/{member_id}", { params: { path: { id: groupId, member_id: memberId } } }));
834
+ async createTodoItems(taskId, data) {
835
+ return this.unwrap(this.api.POST("/tasks/{id}/todo-items", { params: { path: { id: taskId } }, body: data }));
998
836
  }
999
837
  };
1000
838
 
1001
- // src/resources/flow-extensions.ts
1002
- var FlowExtensionsResource = class extends BaseResource {
1003
- // Actions
1004
- async listActions(params) {
1005
- return this.unwrap(this.api.GET("/flow/extensions/actions", { params: { query: params } }));
839
+ // src/resources/tickets.ts
840
+ var TicketsResource = class extends BaseResource {
841
+ async list(params) {
842
+ return this.unwrap(this.api.GET("/tickets", { params: { query: params } }));
1006
843
  }
1007
- async createAction(data) {
1008
- return this.unwrap(this.api.POST("/flow/extensions/actions", { body: data }));
844
+ async create(data) {
845
+ return this.unwrap(this.api.POST("/tickets", { body: data }));
1009
846
  }
1010
- async updateAction(actionId, data) {
1011
- return this.unwrap(this.api.PUT("/flow/extensions/actions/{id}", { params: { path: { id: actionId } }, body: data }));
847
+ async listEvents(ticketId, params) {
848
+ return this.unwrap(this.api.GET("/tickets/{id}/events", { params: { path: { id: ticketId }, query: params } }));
1012
849
  }
1013
- async deleteAction(actionId) {
1014
- return this.unwrap(this.api.DELETE("/flow/extensions/actions/{id}", { params: { path: { id: actionId } } }));
850
+ async createEvent(ticketId, data) {
851
+ return this.unwrap(this.api.POST("/tickets/{id}/events", { params: { path: { id: ticketId } }, body: data }));
1015
852
  }
1016
- // Action Runs
1017
- async updateActionRun(runId, data) {
1018
- return this.unwrap(this.api.PUT("/flow/actions/runs/{id}", { params: { path: { id: runId } }, body: data }));
853
+ async updateEvent(ticketId, data) {
854
+ return this.unwrap(this.api.PUT("/tickets/{id}/events", { params: { path: { id: ticketId } }, body: data }));
1019
855
  }
1020
- // Triggers
1021
- async listTriggers() {
1022
- return this.unwrap(this.api.GET("/flow/extensions/triggers"));
856
+ async getLoop(ticketId, loopId) {
857
+ return this.unwrap(this.api.GET("/tickets/{id}/loops/{loopId}", { params: { path: { id: ticketId, loopId } } }));
1023
858
  }
1024
- async getTrigger(handle) {
1025
- return this.unwrap(this.api.GET("/flow/extensions/triggers/{handle}", { params: { path: { handle } } }));
859
+ async listLoops(ticketId, params) {
860
+ return this.unwrap(this.api.GET("/tickets/{id}/loops", { params: { path: { id: ticketId }, query: params } }));
1026
861
  }
1027
- async createTrigger(data) {
1028
- return this.unwrap(this.api.POST("/flow/extensions/triggers", { body: data }));
862
+ async getMessage(ticketId, messageId) {
863
+ return this.unwrap(this.api.GET("/tickets/{id}/messages/{messageId}", { params: { path: { id: ticketId, messageId } } }));
1029
864
  }
1030
- async updateTrigger(handle, data) {
1031
- return this.unwrap(this.api.PUT("/flow/extensions/triggers/{handle}", { params: { path: { handle } }, body: data }));
865
+ async listMessages(ticketId, params) {
866
+ return this.unwrap(this.api.GET("/tickets/{id}/messages", { params: { path: { id: ticketId }, query: params } }));
1032
867
  }
1033
- async deleteTrigger(handle) {
1034
- return this.unwrap(this.api.DELETE("/flow/extensions/triggers/{handle}", { params: { path: { handle } } }));
868
+ async createMessage(ticketId, data) {
869
+ return this.unwrap(this.api.POST("/tickets/{id}/messages", { params: { path: { id: ticketId } }, body: data }));
1035
870
  }
1036
- async fireTrigger(handle, data) {
1037
- return this.unwrap(this.api.POST("/flow/extensions/triggers/{handle}/fire", { params: { path: { handle } }, body: data }));
871
+ async updateMessage(ticketId, data) {
872
+ return this.unwrap(this.api.PUT("/tickets/{id}/messages", { params: { path: { id: ticketId } }, body: data }));
873
+ }
874
+ async get(ticketId) {
875
+ return this.unwrap(this.api.GET("/tickets/{id}", { params: { path: { id: ticketId } } }));
876
+ }
877
+ async update(ticketId, data) {
878
+ return this.unwrap(this.api.PUT("/tickets/{id}", { params: { path: { id: ticketId } }, body: data }));
1038
879
  }
1039
880
  };
1040
881
 
1041
- // src/resources/ai-agent-runs.ts
1042
- var AiAgentRunsResource = class extends BaseResource {
1043
- async create(agentId, data) {
1044
- return this.unwrap(this.api.POST("/ai/agents/{agentId}/runs", { params: { path: { agentId } }, body: data }));
882
+ // src/resources/timeline-comments.ts
883
+ var TimelineCommentsResource = class extends BaseResource {
884
+ async list(params) {
885
+ return this.unwrap(this.api.GET("/timeline_comments", { params: { query: params } }));
1045
886
  }
1046
- async get(agentId, runId) {
1047
- return this.unwrap(this.api.GET("/ai/agents/{agentId}/runs/{runId}", { params: { path: { agentId, runId } } }));
887
+ async create(data) {
888
+ return this.unwrap(this.api.POST("/timeline_comments", { body: data }));
1048
889
  }
1049
- /**
1050
- * Create an agent run and poll until it completes or errors.
1051
- */
1052
- async createAndWait(agentId, data, options) {
1053
- const { timeout = 3e5, pollInterval = 2e3 } = options || {};
1054
- const result = await this.create(agentId, data);
1055
- const run = result.run;
1056
- if (!run?.id) throw new Error("Agent run ID not returned");
1057
- const start = Date.now();
1058
- while (Date.now() - start < timeout) {
1059
- const response = await this.get(agentId, run.id);
1060
- const agentRun = response.run;
1061
- if (agentRun.status === "completed" || agentRun.status === "error") {
1062
- return agentRun;
1063
- }
1064
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
1065
- }
1066
- throw new Error(`Agent run timed out after ${timeout}ms`);
890
+ async get(commentId) {
891
+ return this.unwrap(this.api.GET("/timeline_comments/{id}", { params: { path: { id: commentId } } }));
892
+ }
893
+ async update(commentId, data) {
894
+ return this.unwrap(this.api.PUT("/timeline_comments/{id}", { params: { path: { id: commentId } }, body: data }));
895
+ }
896
+ async del(commentId, params) {
897
+ return this.unwrap(this.api.DELETE("/timeline_comments/{id}", { params: { path: { id: commentId }, query: params } }));
1067
898
  }
1068
899
  };
1069
900
 
1070
- // src/resources/meetings.ts
1071
- var MeetingsResource = class extends BaseResource {
901
+ // src/resources/transactions.ts
902
+ var TransactionsResource = class extends BaseResource {
1072
903
  async list(params) {
1073
- return this.unwrap(this.api.GET("/meetings", { params: { query: params } }));
1074
- }
1075
- async get(meetingId) {
1076
- return this.unwrap(this.api.GET("/meetings/{id}", { params: { path: { id: meetingId } } }));
904
+ return this.unwrap(this.api.GET("/transactions", { params: { query: params } }));
1077
905
  }
1078
- async create(data) {
1079
- return this.unwrap(this.api.POST("/meetings", { body: data }));
906
+ async get(transactionId) {
907
+ return this.unwrap(this.api.GET("/transactions/{id}", { params: { path: { id: transactionId } } }));
1080
908
  }
1081
- async update(meetingId, data) {
1082
- return this.unwrap(this.api.PUT("/meetings/{id}", { params: { path: { id: meetingId } }, body: data }));
909
+ };
910
+
911
+ // src/resources/usage-events.ts
912
+ var UsageEventsResource = class extends BaseResource {
913
+ async list(params) {
914
+ return this.unwrap(this.api.GET("/usage_events", { params: { query: params } }));
1083
915
  }
1084
- async del(meetingId) {
1085
- return this.unwrap(this.api.DELETE("/meetings/{id}", { params: { path: { id: meetingId } } }));
916
+ async create(data) {
917
+ return this.unwrap(this.api.POST("/usage_events", { body: data }));
1086
918
  }
1087
919
  };
1088
920
 
1089
- // src/resources/synced-emails.ts
1090
- var SyncedEmailsResource = class extends BaseResource {
921
+ // src/resources/users.ts
922
+ var UsersResource = class extends BaseResource {
1091
923
  async list(params) {
1092
- return this.unwrap(this.untypedApi.GET("/synced_emails", { params: { query: params } }));
924
+ return this.unwrap(this.api.GET("/users", { params: { query: params } }));
1093
925
  }
1094
- async get(syncedEmailId) {
1095
- return this.unwrap(this.untypedApi.GET("/synced_emails/{id}", { params: { path: { id: syncedEmailId } } }));
926
+ async get(userId) {
927
+ return this.unwrap(this.api.GET("/users/{id}", { params: { path: { id: userId } } }));
928
+ }
929
+ };
930
+
931
+ // src/resources/webhooks.ts
932
+ var WebhooksResource = class extends BaseResource {
933
+ async list() {
934
+ return this.unwrap(this.api.GET("/webhooks"));
1096
935
  }
1097
936
  async create(data) {
1098
- return this.unwrap(this.untypedApi.POST("/synced_emails", { body: data }));
937
+ return this.unwrap(this.api.POST("/webhooks", { body: data }));
1099
938
  }
1100
- async update(syncedEmailId, data) {
1101
- return this.unwrap(this.untypedApi.PUT("/synced_emails/{id}", { params: { path: { id: syncedEmailId } }, body: data }));
939
+ async update(webhookId, data) {
940
+ return this.unwrap(this.api.PUT("/webhooks/{id}", { params: { path: { id: webhookId } }, body: data }));
1102
941
  }
1103
- async del(syncedEmailId) {
1104
- return this.unwrap(this.untypedApi.DELETE("/synced_emails/{id}", { params: { path: { id: syncedEmailId } } }));
942
+ async del(webhookId) {
943
+ return this.unwrap(this.api.DELETE("/webhooks/{id}", { params: { path: { id: webhookId } } }));
944
+ }
945
+ };
946
+
947
+ // src/resources/agents.ts
948
+ var AgentsResource = class extends BaseResource {
949
+ async list() {
950
+ return this.unwrap(this.untypedApi.GET("/agents", {}));
951
+ }
952
+ async get(agentId) {
953
+ return this.unwrap(this.untypedApi.GET("/agents/{id}", { params: { path: { id: agentId } } }));
1105
954
  }
1106
- async addMessages(syncedEmailId, data) {
1107
- return this.unwrap(this.untypedApi.POST("/synced_emails/{id}/messages", { params: { path: { id: syncedEmailId } }, body: data }));
955
+ async create(params) {
956
+ return this.unwrap(this.untypedApi.POST("/agents", { body: params }));
1108
957
  }
1109
- async getMessages(syncedEmailId) {
1110
- return this.unwrap(this.untypedApi.GET("/synced_emails/{id}/messages", { params: { path: { id: syncedEmailId } } }));
958
+ async findOrCreate(params) {
959
+ return this.unwrap(this.untypedApi.POST("/agents/find_or_create", { body: params }));
1111
960
  }
1112
961
  };
1113
962
 
@@ -1118,10 +967,11 @@ function createTimeoutSignal(ms) {
1118
967
  return controller.signal;
1119
968
  }
1120
969
  var MantleCoreClient = class {
970
+ // @generated-resource-properties-end
1121
971
  constructor(config) {
1122
- if (!config.apiKey && !config.accessToken) {
972
+ if (!config.apiKey && !config.accessToken && !config.fetch) {
1123
973
  throw new Error(
1124
- "MantleCoreClient requires either apiKey or accessToken"
974
+ "MantleCoreClient requires either apiKey, accessToken, or a custom fetch function"
1125
975
  );
1126
976
  }
1127
977
  this.apiKey = config.apiKey;
@@ -1131,7 +981,8 @@ var MantleCoreClient = class {
1131
981
  baseUrl: config.baseURL || "https://api.heymantle.com/v1",
1132
982
  headers: {
1133
983
  "Content-Type": "application/json"
1134
- }
984
+ },
985
+ ...config.fetch ? { fetch: config.fetch } : {}
1135
986
  });
1136
987
  this._api.use({
1137
988
  onRequest: ({ request }) => {
@@ -1155,44 +1006,45 @@ var MantleCoreClient = class {
1155
1006
  this._api.use(mw);
1156
1007
  }
1157
1008
  }
1158
- this.customers = new CustomersResource(this);
1159
- this.contacts = new ContactsResource(this);
1160
- this.subscriptions = new SubscriptionsResource(this);
1161
- this.usageEvents = new UsageEventsResource(this);
1162
- this.apps = new AppsResource(this);
1163
- this.deals = new DealsResource(this);
1164
- this.dealFlows = new DealFlowsResource(this);
1165
- this.dealActivities = new DealActivitiesResource(this);
1166
- this.tickets = new TicketsResource(this);
1167
- this.channels = new ChannelsResource(this);
1168
- this.flows = new FlowsResource(this);
1169
- this.tasks = new TasksResource(this);
1170
- this.webhooks = new WebhooksResource(this);
1171
- this.companies = new CompaniesResource(this);
1172
- this.customerSegments = new CustomerSegmentsResource(this);
1173
- this.affiliates = new AffiliatesResource(this);
1174
- this.affiliatePrograms = new AffiliateProgramsResource(this);
1175
1009
  this.affiliateCommissions = new AffiliateCommissionsResource(this);
1176
1010
  this.affiliatePayouts = new AffiliatePayoutsResource(this);
1011
+ this.affiliatePrograms = new AffiliateProgramsResource(this);
1177
1012
  this.affiliateReferrals = new AffiliateReferralsResource(this);
1013
+ this.affiliates = new AffiliatesResource(this);
1014
+ this.aiAgentRuns = new AiAgentRunsResource(this);
1015
+ this.apps = new AppsResource(this);
1016
+ this.assistant = new AssistantResource(this);
1017
+ this.channels = new ChannelsResource(this);
1178
1018
  this.charges = new ChargesResource(this);
1179
- this.transactions = new TransactionsResource(this);
1180
- this.metrics = new MetricsResource(this);
1181
- this.users = new UsersResource(this);
1182
- this.me = new MeResource(this);
1183
- this.organization = new OrganizationResource(this);
1184
- this.agents = new AgentsResource(this);
1185
- this.docs = new DocsResource(this);
1186
- this.entities = new EntitiesResource(this);
1019
+ this.companies = new CompaniesResource(this);
1020
+ this.contacts = new ContactsResource(this);
1187
1021
  this.customData = new CustomDataResource(this);
1188
- this.timelineComments = new TimelineCommentsResource(this);
1189
- this.lists = new ListsResource(this);
1190
- this.journalEntries = new JournalEntriesResource(this);
1022
+ this.customerSegments = new CustomerSegmentsResource(this);
1023
+ this.customers = new CustomersResource(this);
1024
+ this.dealActivities = new DealActivitiesResource(this);
1025
+ this.dealFlows = new DealFlowsResource(this);
1026
+ this.deals = new DealsResource(this);
1027
+ this.docs = new DocsResource(this);
1191
1028
  this.emailUnsubscribeGroups = new EmailUnsubscribeGroupsResource(this);
1029
+ this.entities = new EntitiesResource(this);
1192
1030
  this.flowExtensions = new FlowExtensionsResource(this);
1193
- this.aiAgentRuns = new AiAgentRunsResource(this);
1031
+ this.flows = new FlowsResource(this);
1032
+ this.journalEntries = new JournalEntriesResource(this);
1033
+ this.lists = new ListsResource(this);
1194
1034
  this.meetings = new MeetingsResource(this);
1035
+ this.me = new MeResource(this);
1036
+ this.metrics = new MetricsResource(this);
1037
+ this.organization = new OrganizationResource(this);
1038
+ this.subscriptions = new SubscriptionsResource(this);
1195
1039
  this.syncedEmails = new SyncedEmailsResource(this);
1040
+ this.tasks = new TasksResource(this);
1041
+ this.tickets = new TicketsResource(this);
1042
+ this.timelineComments = new TimelineCommentsResource(this);
1043
+ this.transactions = new TransactionsResource(this);
1044
+ this.usageEvents = new UsageEventsResource(this);
1045
+ this.users = new UsersResource(this);
1046
+ this.webhooks = new WebhooksResource(this);
1047
+ this.agents = new AgentsResource(this);
1196
1048
  }
1197
1049
  /**
1198
1050
  * Register an openapi-fetch middleware