@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.
- package/dist/index.d.mts +12907 -10579
- package/dist/index.d.ts +12907 -10579
- package/dist/index.js +604 -752
- package/dist/index.mjs +604 -752
- 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/
|
|
107
|
-
var
|
|
106
|
+
// src/resources/affiliate-commissions.ts
|
|
107
|
+
var AffiliateCommissionsResource = class extends BaseResource {
|
|
108
108
|
async list(params) {
|
|
109
|
-
return this.unwrap(this.api.GET("/
|
|
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
|
|
151
|
-
return this.unwrap(this.api.
|
|
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/
|
|
156
|
-
var
|
|
116
|
+
// src/resources/affiliate-payouts.ts
|
|
117
|
+
var AffiliatePayoutsResource = class extends BaseResource {
|
|
157
118
|
async list(params) {
|
|
158
|
-
return this.unwrap(this.api.GET("/
|
|
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
|
|
164
|
-
return this.unwrap(this.api.
|
|
121
|
+
async get(payoutId) {
|
|
122
|
+
return this.unwrap(this.api.GET("/affiliate_payouts/{id}", { params: { path: { id: payoutId } } }));
|
|
165
123
|
}
|
|
166
|
-
|
|
167
|
-
|
|
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
|
|
170
|
-
return this.unwrap(this.api.
|
|
131
|
+
async get(programId) {
|
|
132
|
+
return this.unwrap(this.api.GET("/affiliate_programs/{id}", { params: { path: { id: programId } } }));
|
|
171
133
|
}
|
|
172
|
-
|
|
173
|
-
|
|
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
|
|
176
|
-
return this.unwrap(this.api.
|
|
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/
|
|
181
|
-
var
|
|
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("/
|
|
149
|
+
return this.unwrap(this.api.GET("/affiliates", { params: { query: params } }));
|
|
187
150
|
}
|
|
188
|
-
|
|
189
|
-
|
|
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/
|
|
197
|
-
var
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
async
|
|
202
|
-
return this.unwrap(this.api.GET("/
|
|
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
|
|
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
|
|
226
|
-
|
|
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
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
282
|
-
|
|
283
|
-
|
|
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
|
-
|
|
298
|
-
|
|
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
|
|
302
|
-
return this.unwrap(this.api.
|
|
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
|
-
|
|
305
|
-
|
|
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/
|
|
310
|
-
var
|
|
287
|
+
// src/resources/channels.ts
|
|
288
|
+
var ChannelsResource = class extends BaseResource {
|
|
311
289
|
async list(params) {
|
|
312
|
-
return this.unwrap(this.api.GET("/
|
|
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("/
|
|
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/
|
|
338
|
-
var
|
|
297
|
+
// src/resources/charges.ts
|
|
298
|
+
var ChargesResource = class extends BaseResource {
|
|
339
299
|
async list(params) {
|
|
340
|
-
return this.unwrap(this.api.GET("/
|
|
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/
|
|
357
|
-
var
|
|
304
|
+
// src/resources/companies.ts
|
|
305
|
+
var CompaniesResource = class extends BaseResource {
|
|
358
306
|
async list(params) {
|
|
359
|
-
return this.unwrap(this.api.GET("/
|
|
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("/
|
|
310
|
+
return this.unwrap(this.api.POST("/companies", { body: data }));
|
|
366
311
|
}
|
|
367
|
-
async
|
|
368
|
-
return this.unwrap(this.api.
|
|
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(
|
|
371
|
-
return this.unwrap(this.api.DELETE("/
|
|
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/
|
|
376
|
-
var
|
|
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("/
|
|
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("/
|
|
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
|
|
395
|
-
return this.unwrap(this.api.
|
|
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
|
|
398
|
-
return this.unwrap(this.api.
|
|
334
|
+
async get(contactId) {
|
|
335
|
+
return this.unwrap(this.api.GET("/contacts/{id}", { params: { path: { id: contactId } } }));
|
|
399
336
|
}
|
|
400
|
-
async
|
|
401
|
-
return this.unwrap(this.api.PUT("/
|
|
337
|
+
async update(contactId, data) {
|
|
338
|
+
return this.unwrap(this.api.PUT("/contacts/{id}", { params: { path: { id: contactId } }, body: data }));
|
|
402
339
|
}
|
|
403
|
-
|
|
404
|
-
|
|
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
|
|
408
|
-
return this.unwrap(this.api.POST("/
|
|
343
|
+
async removeTags(contactId, data) {
|
|
344
|
+
return this.unwrap(this.api.POST("/contacts/{id}/removeTags", { params: { path: { id: contactId } }, body: data }));
|
|
409
345
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
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
|
|
415
|
-
return this.unwrap(this.api.
|
|
353
|
+
async set(data) {
|
|
354
|
+
return this.unwrap(this.api.PUT("/custom_data", { body: data }));
|
|
416
355
|
}
|
|
417
356
|
};
|
|
418
357
|
|
|
419
|
-
// src/resources/
|
|
420
|
-
var
|
|
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("/
|
|
361
|
+
return this.unwrap(this.api.GET("/customer_segments", { params: { query: params } }));
|
|
426
362
|
}
|
|
427
|
-
|
|
428
|
-
|
|
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/
|
|
436
|
-
var
|
|
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("/
|
|
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("/
|
|
374
|
+
return this.unwrap(this.api.POST("/customers", { body: data }));
|
|
454
375
|
}
|
|
455
|
-
|
|
456
|
-
|
|
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
|
-
|
|
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
|
|
476
|
-
return this.unwrap(this.api.
|
|
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
|
|
479
|
-
return this.unwrap(this.api.POST("/
|
|
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
|
|
482
|
-
return this.unwrap(this.api.
|
|
391
|
+
async get(customerId) {
|
|
392
|
+
return this.unwrap(this.api.GET("/customers/{id}", { params: { path: { id: customerId } } }));
|
|
483
393
|
}
|
|
484
|
-
async
|
|
485
|
-
return this.unwrap(this.api.
|
|
394
|
+
async update(customerId, data) {
|
|
395
|
+
return this.unwrap(this.api.PUT("/customers/{id}", { params: { path: { id: customerId } }, body: data }));
|
|
486
396
|
}
|
|
487
|
-
|
|
488
|
-
|
|
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
|
|
492
|
-
return this.unwrap(this.api.GET("/
|
|
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
|
|
495
|
-
return this.unwrap(this.api.
|
|
403
|
+
async listAccountOwners(customerId) {
|
|
404
|
+
return this.unwrap(this.api.GET("/customers/{id}/account_owners", { params: { path: { id: customerId } } }));
|
|
496
405
|
}
|
|
497
|
-
async
|
|
498
|
-
return this.unwrap(this.api.
|
|
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
|
|
501
|
-
return this.unwrap(this.api.
|
|
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/
|
|
506
|
-
var
|
|
507
|
-
|
|
508
|
-
|
|
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("/
|
|
426
|
+
return this.unwrap(this.api.POST("/deal_activities", { body: data }));
|
|
518
427
|
}
|
|
519
|
-
|
|
520
|
-
|
|
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
|
-
|
|
527
|
-
|
|
528
|
-
async del(
|
|
529
|
-
return this.unwrap(this.api.DELETE("/
|
|
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/
|
|
534
|
-
var
|
|
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("/
|
|
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("/
|
|
445
|
+
return this.unwrap(this.api.POST("/deal_flows", { body: data }));
|
|
552
446
|
}
|
|
553
|
-
|
|
554
|
-
|
|
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
|
-
|
|
561
|
-
|
|
562
|
-
async del(
|
|
563
|
-
return this.unwrap(this.api.DELETE("/
|
|
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/
|
|
568
|
-
var
|
|
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("/
|
|
461
|
+
return this.unwrap(this.api.GET("/deals", { params: { query: params } }));
|
|
574
462
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
async
|
|
579
|
-
return this.unwrap(this.api.GET("/
|
|
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/
|
|
584
|
-
var
|
|
585
|
-
|
|
586
|
-
|
|
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
|
-
|
|
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
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
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/
|
|
607
|
-
var
|
|
608
|
-
|
|
609
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
async
|
|
639
|
-
return this.unwrap(this.
|
|
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/
|
|
644
|
-
var
|
|
645
|
-
|
|
646
|
-
|
|
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
|
-
|
|
653
|
-
|
|
654
|
-
async
|
|
655
|
-
return this.unwrap(this.api.GET("/
|
|
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/
|
|
660
|
-
var
|
|
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("/
|
|
604
|
+
return this.unwrap(this.api.GET("/flows", { params: { query: params } }));
|
|
666
605
|
}
|
|
667
|
-
|
|
668
|
-
|
|
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
|
-
|
|
685
|
-
|
|
686
|
-
async
|
|
687
|
-
return this.unwrap(this.api.
|
|
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/
|
|
692
|
-
var
|
|
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("/
|
|
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/
|
|
702
|
-
var
|
|
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("/
|
|
642
|
+
return this.unwrap(this.api.GET("/lists", { params: { query: params } }));
|
|
708
643
|
}
|
|
709
|
-
|
|
710
|
-
|
|
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
|
|
723
|
-
return this.unwrap(this.api.GET("/
|
|
650
|
+
async get(listId, params) {
|
|
651
|
+
return this.unwrap(this.api.GET("/lists/{id}", { params: { path: { id: listId }, query: params } }));
|
|
724
652
|
}
|
|
725
|
-
async
|
|
726
|
-
return this.unwrap(this.api.
|
|
653
|
+
async update(listId, data) {
|
|
654
|
+
return this.unwrap(this.api.PUT("/lists/{id}", { params: { path: { id: listId } }, body: data }));
|
|
727
655
|
}
|
|
728
|
-
async
|
|
729
|
-
return this.unwrap(this.api.
|
|
656
|
+
async del(listId) {
|
|
657
|
+
return this.unwrap(this.api.DELETE("/lists/{id}", { params: { path: { id: listId } } }));
|
|
730
658
|
}
|
|
731
|
-
async
|
|
732
|
-
return this.unwrap(this.api.
|
|
659
|
+
async remove(listId, data) {
|
|
660
|
+
return this.unwrap(this.api.POST("/lists/{id}/remove", { params: { path: { id: listId } }, body: data }));
|
|
733
661
|
}
|
|
734
|
-
|
|
735
|
-
|
|
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
|
|
738
|
-
return this.unwrap(this.api.
|
|
669
|
+
async create(data) {
|
|
670
|
+
return this.unwrap(this.api.POST("/meetings", { body: data }));
|
|
739
671
|
}
|
|
740
|
-
async
|
|
741
|
-
return this.unwrap(this.api.GET("/
|
|
672
|
+
async getRecordingUrl(meetingId) {
|
|
673
|
+
return this.unwrap(this.api.GET("/meetings/{id}/recording-url", { params: { path: { id: meetingId } } }));
|
|
742
674
|
}
|
|
743
|
-
async
|
|
744
|
-
return this.unwrap(this.api.
|
|
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
|
|
747
|
-
return this.unwrap(this.api.
|
|
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
|
|
750
|
-
return this.unwrap(this.api.
|
|
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
|
|
753
|
-
return this.unwrap(this.api.GET("/
|
|
684
|
+
async transcribeGet(meetingId) {
|
|
685
|
+
return this.unwrap(this.api.GET("/meetings/{id}/transcribe", { params: { path: { id: meetingId } } }));
|
|
754
686
|
}
|
|
755
|
-
async
|
|
756
|
-
return this.unwrap(this.api.
|
|
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
|
|
759
|
-
return this.unwrap(this.api.
|
|
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
|
|
762
|
-
return this.unwrap(this.api.GET("/
|
|
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
|
-
|
|
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/
|
|
790
|
-
var
|
|
791
|
-
|
|
792
|
-
|
|
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
|
|
822
|
-
return this.unwrap(this.api.
|
|
716
|
+
async activeInstalls(params) {
|
|
717
|
+
return this.unwrap(this.api.GET("/api/core/v1/metrics/activeInstalls", { params: { query: params } }));
|
|
823
718
|
}
|
|
824
|
-
async
|
|
825
|
-
return this.unwrap(this.api.
|
|
719
|
+
async activeSubscriptions(params) {
|
|
720
|
+
return this.unwrap(this.api.GET("/api/core/v1/metrics/activeSubscriptions", { params: { query: params } }));
|
|
826
721
|
}
|
|
827
|
-
async
|
|
828
|
-
return this.unwrap(this.api.
|
|
722
|
+
async arpu(params) {
|
|
723
|
+
return this.unwrap(this.api.GET("/api/core/v1/metrics/arpu", { params: { query: params } }));
|
|
829
724
|
}
|
|
830
|
-
|
|
831
|
-
|
|
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
|
|
835
|
-
return this.unwrap(this.api.
|
|
728
|
+
async logoChurn(params) {
|
|
729
|
+
return this.unwrap(this.api.GET("/api/core/v1/metrics/logoChurn", { params: { query: params } }));
|
|
836
730
|
}
|
|
837
|
-
async
|
|
838
|
-
return this.unwrap(this.api.
|
|
731
|
+
async mrr(params) {
|
|
732
|
+
return this.unwrap(this.api.GET("/api/core/v1/metrics/mrr", { params: { query: params } }));
|
|
839
733
|
}
|
|
840
|
-
async
|
|
841
|
-
return this.unwrap(this.api.
|
|
734
|
+
async netInstalls(params) {
|
|
735
|
+
return this.unwrap(this.api.GET("/api/core/v1/metrics/netInstalls", { params: { query: params } }));
|
|
842
736
|
}
|
|
843
|
-
|
|
844
|
-
|
|
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
|
|
848
|
-
return this.unwrap(this.api.GET("/
|
|
740
|
+
async netRevenueRetention(params) {
|
|
741
|
+
return this.unwrap(this.api.GET("/api/core/v1/metrics/netRevenueRetention", { params: { query: params } }));
|
|
849
742
|
}
|
|
850
|
-
async
|
|
851
|
-
return this.unwrap(this.api.
|
|
743
|
+
async payout(params) {
|
|
744
|
+
return this.unwrap(this.api.GET("/api/core/v1/metrics/payout", { params: { query: params } }));
|
|
852
745
|
}
|
|
853
|
-
async
|
|
854
|
-
return this.unwrap(this.api.
|
|
746
|
+
async predictedLtv(params) {
|
|
747
|
+
return this.unwrap(this.api.GET("/api/core/v1/metrics/predictedLtv", { params: { query: params } }));
|
|
855
748
|
}
|
|
856
|
-
async
|
|
857
|
-
return this.unwrap(this.api.
|
|
749
|
+
async revenueChurn(params) {
|
|
750
|
+
return this.unwrap(this.api.GET("/api/core/v1/metrics/revenueChurn", { params: { query: params } }));
|
|
858
751
|
}
|
|
859
|
-
|
|
860
|
-
|
|
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
|
|
864
|
-
return this.unwrap(this.api.GET("/
|
|
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/
|
|
880
|
-
var
|
|
881
|
-
async
|
|
882
|
-
return this.unwrap(this.api.
|
|
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/
|
|
890
|
-
var
|
|
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("/
|
|
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
|
-
|
|
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/
|
|
924
|
-
var
|
|
780
|
+
// src/resources/synced-emails.ts
|
|
781
|
+
var SyncedEmailsResource = class extends BaseResource {
|
|
925
782
|
async list(params) {
|
|
926
|
-
return this.unwrap(this.api.GET("/
|
|
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("/
|
|
786
|
+
return this.unwrap(this.api.POST("/synced_emails", { body: data }));
|
|
933
787
|
}
|
|
934
|
-
async
|
|
935
|
-
return this.unwrap(this.api.
|
|
788
|
+
async listMessages(syncedEmailId) {
|
|
789
|
+
return this.unwrap(this.api.GET("/synced_emails/{id}/messages", { params: { path: { id: syncedEmailId } } }));
|
|
936
790
|
}
|
|
937
|
-
async
|
|
938
|
-
return this.unwrap(this.api.
|
|
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
|
|
941
|
-
return this.unwrap(this.api.
|
|
794
|
+
async get(syncedEmailId) {
|
|
795
|
+
return this.unwrap(this.api.GET("/synced_emails/{id}", { params: { path: { id: syncedEmailId } } }));
|
|
942
796
|
}
|
|
943
|
-
async
|
|
944
|
-
return this.unwrap(this.api.
|
|
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/
|
|
949
|
-
var
|
|
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("/
|
|
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("/
|
|
811
|
+
return this.unwrap(this.api.POST("/tasks", { body: data }));
|
|
967
812
|
}
|
|
968
|
-
|
|
969
|
-
|
|
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
|
-
|
|
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
|
|
988
|
-
return this.unwrap(this.api.GET("/
|
|
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
|
|
991
|
-
return this.unwrap(this.api.
|
|
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
|
|
994
|
-
return this.unwrap(this.api.
|
|
831
|
+
async getTodoItems(taskId) {
|
|
832
|
+
return this.unwrap(this.api.GET("/tasks/{id}/todo-items", { params: { path: { id: taskId } } }));
|
|
995
833
|
}
|
|
996
|
-
async
|
|
997
|
-
return this.unwrap(this.api.
|
|
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/
|
|
1002
|
-
var
|
|
1003
|
-
|
|
1004
|
-
|
|
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
|
|
1008
|
-
return this.unwrap(this.api.POST("/
|
|
844
|
+
async create(data) {
|
|
845
|
+
return this.unwrap(this.api.POST("/tickets", { body: data }));
|
|
1009
846
|
}
|
|
1010
|
-
async
|
|
1011
|
-
return this.unwrap(this.api.
|
|
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
|
|
1014
|
-
return this.unwrap(this.api.
|
|
850
|
+
async createEvent(ticketId, data) {
|
|
851
|
+
return this.unwrap(this.api.POST("/tickets/{id}/events", { params: { path: { id: ticketId } }, body: data }));
|
|
1015
852
|
}
|
|
1016
|
-
|
|
1017
|
-
|
|
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
|
-
|
|
1021
|
-
|
|
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
|
|
1025
|
-
return this.unwrap(this.api.GET("/
|
|
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
|
|
1028
|
-
return this.unwrap(this.api.
|
|
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
|
|
1031
|
-
return this.unwrap(this.api.
|
|
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
|
|
1034
|
-
return this.unwrap(this.api.
|
|
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
|
|
1037
|
-
return this.unwrap(this.api.
|
|
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/
|
|
1042
|
-
var
|
|
1043
|
-
async
|
|
1044
|
-
return this.unwrap(this.api.
|
|
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
|
|
1047
|
-
return this.unwrap(this.api.
|
|
887
|
+
async create(data) {
|
|
888
|
+
return this.unwrap(this.api.POST("/timeline_comments", { body: data }));
|
|
1048
889
|
}
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
async
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
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/
|
|
1071
|
-
var
|
|
901
|
+
// src/resources/transactions.ts
|
|
902
|
+
var TransactionsResource = class extends BaseResource {
|
|
1072
903
|
async list(params) {
|
|
1073
|
-
return this.unwrap(this.api.GET("/
|
|
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
|
|
1079
|
-
return this.unwrap(this.api.
|
|
906
|
+
async get(transactionId) {
|
|
907
|
+
return this.unwrap(this.api.GET("/transactions/{id}", { params: { path: { id: transactionId } } }));
|
|
1080
908
|
}
|
|
1081
|
-
|
|
1082
|
-
|
|
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
|
|
1085
|
-
return this.unwrap(this.api.
|
|
916
|
+
async create(data) {
|
|
917
|
+
return this.unwrap(this.api.POST("/usage_events", { body: data }));
|
|
1086
918
|
}
|
|
1087
919
|
};
|
|
1088
920
|
|
|
1089
|
-
// src/resources/
|
|
1090
|
-
var
|
|
921
|
+
// src/resources/users.ts
|
|
922
|
+
var UsersResource = class extends BaseResource {
|
|
1091
923
|
async list(params) {
|
|
1092
|
-
return this.unwrap(this.
|
|
924
|
+
return this.unwrap(this.api.GET("/users", { params: { query: params } }));
|
|
1093
925
|
}
|
|
1094
|
-
async get(
|
|
1095
|
-
return this.unwrap(this.
|
|
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.
|
|
937
|
+
return this.unwrap(this.api.POST("/webhooks", { body: data }));
|
|
1099
938
|
}
|
|
1100
|
-
async update(
|
|
1101
|
-
return this.unwrap(this.
|
|
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(
|
|
1104
|
-
return this.unwrap(this.
|
|
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
|
|
1107
|
-
return this.unwrap(this.untypedApi.POST("/
|
|
955
|
+
async create(params) {
|
|
956
|
+
return this.unwrap(this.untypedApi.POST("/agents", { body: params }));
|
|
1108
957
|
}
|
|
1109
|
-
async
|
|
1110
|
-
return this.unwrap(this.untypedApi.
|
|
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
|
|
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.
|
|
1180
|
-
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.
|
|
1189
|
-
this.
|
|
1190
|
-
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.
|
|
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
|