@hirefinn/sdk 0.1.0 → 0.3.0

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 (38) hide show
  1. package/README.md +79 -9
  2. package/dist/cjs/client.d.ts +13 -1
  3. package/dist/cjs/client.js +5 -0
  4. package/dist/cjs/core.d.ts +14 -2
  5. package/dist/cjs/core.js +41 -4
  6. package/dist/cjs/generated/openapi.d.ts +17426 -5875
  7. package/dist/cjs/generated/operations.d.ts +26 -0
  8. package/dist/cjs/generated/operations.js +165 -0
  9. package/dist/cjs/generated/resources.d.ts +887 -0
  10. package/dist/cjs/generated/resources.js +737 -0
  11. package/dist/cjs/index.d.ts +4 -2
  12. package/dist/cjs/index.js +12 -1
  13. package/dist/cjs/resource.d.ts +30 -0
  14. package/dist/cjs/resource.js +23 -0
  15. package/dist/cjs/resources.d.ts +52 -59
  16. package/dist/cjs/resources.js +27 -37
  17. package/dist/cjs/types.d.ts +17 -5
  18. package/dist/cjs/webhooks.d.ts +57 -0
  19. package/dist/cjs/webhooks.js +181 -0
  20. package/dist/esm/client.d.ts +13 -1
  21. package/dist/esm/client.js +6 -1
  22. package/dist/esm/core.d.ts +14 -2
  23. package/dist/esm/core.js +39 -3
  24. package/dist/esm/generated/openapi.d.ts +17426 -5875
  25. package/dist/esm/generated/operations.d.ts +26 -0
  26. package/dist/esm/generated/operations.js +162 -0
  27. package/dist/esm/generated/resources.d.ts +887 -0
  28. package/dist/esm/generated/resources.js +716 -0
  29. package/dist/esm/index.d.ts +4 -2
  30. package/dist/esm/index.js +2 -1
  31. package/dist/esm/resource.d.ts +30 -0
  32. package/dist/esm/resource.js +19 -0
  33. package/dist/esm/resources.d.ts +52 -59
  34. package/dist/esm/resources.js +20 -35
  35. package/dist/esm/types.d.ts +17 -5
  36. package/dist/esm/webhooks.d.ts +57 -0
  37. package/dist/esm/webhooks.js +140 -0
  38. package/package.json +4 -1
@@ -0,0 +1,737 @@
1
+ "use strict";
2
+ /**
3
+ * Resource methods for every operation src/resources.ts does not hand-write. Hand-written classes extend the
4
+ * `*Generated` bases; the other classes are used as they are.
5
+ * Generated by scripts/generate.mjs from spec/openapi.json. Do not edit by hand: run `npm run generate`.
6
+ * Spec: Finn API v1 (OpenAPI 3.1.0)
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.Sales = exports.Organization = exports.Webhooks = exports.Dialer = exports.Crm = exports.ChatGenerated = exports.AgentsGenerated = exports.ApprovalsGenerated = exports.CasesGenerated = exports.ContactsGenerated = exports.DoNotCallGenerated = exports.WalletGenerated = exports.DeploymentsGenerated = exports.AudiencesGenerated = exports.PhoneNumbersGenerated = exports.VoicesGenerated = exports.FinnsGenerated = exports.CallsGenerated = void 0;
10
+ const pagination_js_1 = require("../pagination.js");
11
+ const resource_js_1 = require("../resource.js");
12
+ /**
13
+ * Generated methods for the Calls tag; `Calls` in src/resources.ts adds the hand-written ones.
14
+ */
15
+ class CallsGenerated extends resource_js_1.Resource {
16
+ }
17
+ exports.CallsGenerated = CallsGenerated;
18
+ /**
19
+ * Generated methods for the Finns tag; `Finns` in src/resources.ts adds the hand-written ones.
20
+ */
21
+ class FinnsGenerated extends resource_js_1.Resource {
22
+ /**
23
+ * Draft a Finn with AI.
24
+ * `POST /finns/generate`, operationId `generateFinn`.
25
+ */
26
+ generate(body, options) {
27
+ return this.do('post', '/finns/generate', { body }, options);
28
+ }
29
+ /**
30
+ * Read a Finn's call flow.
31
+ * `GET /finns/{finn_id}/flow`, operationId `getFinnFlow`.
32
+ */
33
+ getFlow(finnId, options) {
34
+ return this.do('get', '/finns/{finn_id}/flow', { path: { finn_id: finnId } }, options);
35
+ }
36
+ /**
37
+ * Turn a Finn's call flow on.
38
+ * `POST /finns/{finn_id}/flow/enable`, operationId `enableFinnFlow`.
39
+ */
40
+ enableFlow(finnId, options) {
41
+ return this.do('post', '/finns/{finn_id}/flow/enable', { path: { finn_id: finnId } }, options);
42
+ }
43
+ /**
44
+ * Turn a Finn's call flow off.
45
+ * `POST /finns/{finn_id}/flow/disable`, operationId `disableFinnFlow`.
46
+ */
47
+ disableFlow(finnId, options) {
48
+ return this.do('post', '/finns/{finn_id}/flow/disable', { path: { finn_id: finnId } }, options);
49
+ }
50
+ /**
51
+ * Read a Finn's settings.
52
+ * `GET /finns/{finn_id}/settings`, operationId `getFinnSettings`.
53
+ */
54
+ getSettings(finnId, options) {
55
+ return this.do('get', '/finns/{finn_id}/settings', { path: { finn_id: finnId } }, options);
56
+ }
57
+ /**
58
+ * Read a Finn's variables.
59
+ * `GET /finns/{finn_id}/variables`, operationId `getFinnVariables`.
60
+ */
61
+ getVariables(finnId, options) {
62
+ return this.do('get', '/finns/{finn_id}/variables', { path: { finn_id: finnId } }, options);
63
+ }
64
+ /**
65
+ * Edit a Finn's variables.
66
+ * `PATCH /finns/{finn_id}/variables`, operationId `updateFinnVariables`.
67
+ */
68
+ updateVariables(finnId, body, options) {
69
+ return this.do('patch', '/finns/{finn_id}/variables', { path: { finn_id: finnId }, body }, options);
70
+ }
71
+ /**
72
+ * Edit a Finn's agent handbook.
73
+ * `PATCH /finns/{finn_id}/handbook`, operationId `updateFinnHandbook`.
74
+ */
75
+ updateHandbook(finnId, body, options) {
76
+ return this.do('patch', '/finns/{finn_id}/handbook', { path: { finn_id: finnId }, body }, options);
77
+ }
78
+ /**
79
+ * Edit a Finn's speech settings.
80
+ * `PATCH /finns/{finn_id}/speech_settings`, operationId `updateFinnSpeechSettings`.
81
+ */
82
+ updateSpeechSettings(finnId, body, options) {
83
+ return this.do('patch', '/finns/{finn_id}/speech_settings', { path: { finn_id: finnId }, body }, options);
84
+ }
85
+ /**
86
+ * Edit a draft Finn.
87
+ * `PATCH /finns/{finn_id}/draft`, operationId `updateFinnDraft`.
88
+ */
89
+ updateDraft(finnId, body, options) {
90
+ return this.do('patch', '/finns/{finn_id}/draft', { path: { finn_id: finnId }, body }, options);
91
+ }
92
+ /**
93
+ * Copy a Finn.
94
+ * `POST /finns/{finn_id}/duplicate`, operationId `duplicateFinn`.
95
+ */
96
+ duplicate(finnId, body, options) {
97
+ return this.do('post', '/finns/{finn_id}/duplicate', { path: { finn_id: finnId }, body }, options);
98
+ }
99
+ /**
100
+ * Read a Finn's share link.
101
+ * `GET /finns/{finn_id}/share_link`, operationId `getFinnShareLink`.
102
+ */
103
+ getShareLink(finnId, options) {
104
+ return this.do('get', '/finns/{finn_id}/share_link', { path: { finn_id: finnId } }, options);
105
+ }
106
+ /**
107
+ * Get or make a Finn's share link.
108
+ * `POST /finns/{finn_id}/share_link`, operationId `createFinnShareLink`.
109
+ */
110
+ createShareLink(finnId, options) {
111
+ return this.do('post', '/finns/{finn_id}/share_link', { path: { finn_id: finnId } }, options);
112
+ }
113
+ /**
114
+ * A Finn's call stats.
115
+ * `GET /finns/{finn_id}/stats`, operationId `getFinnStats`.
116
+ */
117
+ getStats(finnId, query, options) {
118
+ return this.do('get', '/finns/{finn_id}/stats', { path: { finn_id: finnId }, query }, options);
119
+ }
120
+ /**
121
+ * Summarize a Finn's call outcomes.
122
+ * `GET /finns/{finn_id}/outcomes`, operationId `getFinnOutcomes`.
123
+ */
124
+ getOutcomes(finnId, query, options) {
125
+ return this.do('get', '/finns/{finn_id}/outcomes', { path: { finn_id: finnId }, query }, options);
126
+ }
127
+ }
128
+ exports.FinnsGenerated = FinnsGenerated;
129
+ /**
130
+ * Generated methods for the Voices tag; `Voices` in src/resources.ts adds the hand-written ones.
131
+ */
132
+ class VoicesGenerated extends resource_js_1.Resource {
133
+ }
134
+ exports.VoicesGenerated = VoicesGenerated;
135
+ /**
136
+ * Generated methods for the Phone numbers tag; `PhoneNumbers` in src/resources.ts adds the hand-written ones.
137
+ */
138
+ class PhoneNumbersGenerated extends resource_js_1.Resource {
139
+ }
140
+ exports.PhoneNumbersGenerated = PhoneNumbersGenerated;
141
+ /**
142
+ * Generated methods for the Audiences tag; `Audiences` in src/resources.ts adds the hand-written ones.
143
+ */
144
+ class AudiencesGenerated extends resource_js_1.Resource {
145
+ }
146
+ exports.AudiencesGenerated = AudiencesGenerated;
147
+ /**
148
+ * Generated methods for the Deployments tag; `Deployments` in src/resources.ts adds the hand-written ones.
149
+ */
150
+ class DeploymentsGenerated extends resource_js_1.Resource {
151
+ }
152
+ exports.DeploymentsGenerated = DeploymentsGenerated;
153
+ /**
154
+ * Generated methods for the Wallet tag; `Wallet` in src/resources.ts adds the hand-written ones.
155
+ */
156
+ class WalletGenerated extends resource_js_1.Resource {
157
+ }
158
+ exports.WalletGenerated = WalletGenerated;
159
+ /**
160
+ * Generated methods for the Do not call tag; `DoNotCall` in src/resources.ts adds the hand-written ones.
161
+ */
162
+ class DoNotCallGenerated extends resource_js_1.Resource {
163
+ }
164
+ exports.DoNotCallGenerated = DoNotCallGenerated;
165
+ /**
166
+ * Generated methods for the Records tag; `Contacts` in src/resources.ts adds the hand-written ones.
167
+ */
168
+ class ContactsGenerated extends resource_js_1.Resource {
169
+ }
170
+ exports.ContactsGenerated = ContactsGenerated;
171
+ /**
172
+ * Generated methods for the Cases tag; `Cases` in src/resources.ts adds the hand-written ones.
173
+ */
174
+ class CasesGenerated extends resource_js_1.Resource {
175
+ }
176
+ exports.CasesGenerated = CasesGenerated;
177
+ /**
178
+ * Generated methods for the Approvals tag; `Approvals` in src/resources.ts adds the hand-written ones.
179
+ */
180
+ class ApprovalsGenerated extends resource_js_1.Resource {
181
+ }
182
+ exports.ApprovalsGenerated = ApprovalsGenerated;
183
+ /**
184
+ * Generated methods for the Agents tag; `Agents` in src/resources.ts adds the hand-written ones.
185
+ */
186
+ class AgentsGenerated extends resource_js_1.Resource {
187
+ }
188
+ exports.AgentsGenerated = AgentsGenerated;
189
+ /**
190
+ * Generated methods for the Chat tag; `Chat` in src/resources.ts adds the hand-written ones.
191
+ */
192
+ class ChatGenerated extends resource_js_1.Resource {
193
+ }
194
+ exports.ChatGenerated = ChatGenerated;
195
+ /**
196
+ * CRM: records, stages, forms, documents, follow-ups, views and imports (`/crm`). Reached as `finn.crm`.
197
+ */
198
+ class Crm extends resource_js_1.Resource {
199
+ /**
200
+ * Get the CRM setup.
201
+ * `GET /crm/setup`, operationId `getCrmSetup`, scope `crm:read`.
202
+ */
203
+ getSetup(options) {
204
+ return this.do('get', '/crm/setup', {}, options);
205
+ }
206
+ /**
207
+ * Get the filter schema.
208
+ * `GET /crm/filter_schema`, operationId `getCrmFilterSchema`, scope `crm:read`.
209
+ */
210
+ getFilterSchema(options) {
211
+ return this.do('get', '/crm/filter_schema', {}, options);
212
+ }
213
+ /**
214
+ * Search records.
215
+ * `POST /crm/records/search`, operationId `searchCrmRecords`, scope `crm:read`.
216
+ */
217
+ searchRecords(body, options) {
218
+ return this.do('post', '/crm/records/search', { body }, options);
219
+ }
220
+ /**
221
+ * Query records.
222
+ * `POST /crm/records/query`, operationId `queryCrmRecords`, scope `crm:read`.
223
+ */
224
+ queryRecords(body, query, options) {
225
+ return this.do('post', '/crm/records/query', { query, body }, options);
226
+ }
227
+ /**
228
+ * Count records.
229
+ * `POST /crm/records/query/count`, operationId `countCrmRecords`, scope `crm:read`.
230
+ */
231
+ countRecords(body, options) {
232
+ return this.do('post', '/crm/records/query/count', { body }, options);
233
+ }
234
+ /**
235
+ * Count records by stage.
236
+ * `POST /crm/records/query/stage_counts`, operationId `countCrmRecordsByStage`, scope `crm:read`.
237
+ */
238
+ countRecordsByStage(body, options) {
239
+ return this.do('post', '/crm/records/query/stage_counts', { body }, options);
240
+ }
241
+ /**
242
+ * Get a record.
243
+ * `GET /crm/records/{id}`, operationId `getCrmRecord`, scope `crm:read`.
244
+ */
245
+ getRecord(id, options) {
246
+ return this.do('get', '/crm/records/{id}', { path: { id } }, options);
247
+ }
248
+ /**
249
+ * Update a record's fields.
250
+ * `PATCH /crm/records/{id}`, operationId `updateCrmRecord`, scope `crm:write`.
251
+ */
252
+ updateRecord(id, body, options) {
253
+ return this.do('patch', '/crm/records/{id}', { path: { id }, body }, options);
254
+ }
255
+ /**
256
+ * Get a record's timeline.
257
+ * `GET /crm/records/{id}/timeline`, operationId `getCrmRecordTimeline`, scope `crm:read`.
258
+ */
259
+ getRecordTimeline(id, query, options) {
260
+ return this.do('get', '/crm/records/{id}/timeline', { path: { id }, query }, options);
261
+ }
262
+ /**
263
+ * Get a stage gate.
264
+ * `GET /crm/records/{id}/stage_gate`, operationId `getCrmStageGate`, scope `crm:read`.
265
+ */
266
+ getStageGate(id, query, options) {
267
+ return this.do('get', '/crm/records/{id}/stage_gate', { path: { id }, query }, options);
268
+ }
269
+ /**
270
+ * List a record's documents.
271
+ * `GET /crm/records/{id}/documents`, operationId `listCrmRecordDocuments`, scope `crm:read`.
272
+ */
273
+ listRecordDocuments(id, options) {
274
+ return this.do('get', '/crm/records/{id}/documents', { path: { id } }, options);
275
+ }
276
+ /**
277
+ * List a record's files.
278
+ * `GET /crm/records/{id}/files`, operationId `listCrmRecordFiles`, scope `crm:read`.
279
+ */
280
+ listRecordFiles(id, options) {
281
+ return this.do('get', '/crm/records/{id}/files', { path: { id } }, options);
282
+ }
283
+ /**
284
+ * Attach a file.
285
+ * `POST /crm/records/{id}/files`, operationId `attachCrmFile`, scope `crm:docs:write`.
286
+ */
287
+ attachFile(id, body, options) {
288
+ return this.do('post', '/crm/records/{id}/files', { path: { id }, body }, options);
289
+ }
290
+ /**
291
+ * Get a record's forms checklist.
292
+ * `GET /crm/records/{id}/forms_checklist`, operationId `getCrmFormsChecklist`, scope `crm:read`.
293
+ */
294
+ getFormsChecklist(id, options) {
295
+ return this.do('get', '/crm/records/{id}/forms_checklist', { path: { id } }, options);
296
+ }
297
+ /**
298
+ * List a record's form submissions.
299
+ * `GET /crm/records/{id}/submissions`, operationId `listCrmFormSubmissions`, scope `crm:read`.
300
+ */
301
+ listFormSubmissions(id, options) {
302
+ return this.do('get', '/crm/records/{id}/submissions', { path: { id } }, options);
303
+ }
304
+ /**
305
+ * List a record's form drafts.
306
+ * `GET /crm/records/{id}/form_drafts`, operationId `listCrmFormDrafts`, scope `crm:read`.
307
+ */
308
+ listFormDrafts(id, options) {
309
+ return this.do('get', '/crm/records/{id}/form_drafts', { path: { id } }, options);
310
+ }
311
+ /**
312
+ * List forms.
313
+ * `GET /crm/forms`, operationId `listCrmForms`, scope `crm:read`.
314
+ */
315
+ listForms(options) {
316
+ return this.do('get', '/crm/forms', {}, options);
317
+ }
318
+ /**
319
+ * List follow-ups.
320
+ * `GET /crm/follow_ups`, operationId `listCrmFollowUps`, scope `crm:read`.
321
+ */
322
+ listFollowUps(query, options) {
323
+ return this.do('get', '/crm/follow_ups', { query }, options);
324
+ }
325
+ /** Every item of `listFollowUps`, page by page (follows `next_cursor`). */
326
+ listAllFollowUps(query, options) {
327
+ return this.pager('/crm/follow_ups', (0, pagination_js_1.cursorStrategy)('data'), query, undefined, options);
328
+ }
329
+ /**
330
+ * Get follow-up counts.
331
+ * `GET /crm/follow_ups/stats`, operationId `getCrmFollowUpStats`, scope `crm:read`.
332
+ */
333
+ getFollowUpStats(query, options) {
334
+ return this.do('get', '/crm/follow_ups/stats', { query }, options);
335
+ }
336
+ /**
337
+ * Get my work.
338
+ * `GET /crm/my_work`, operationId `getCrmMyWork`, scope `crm:read`.
339
+ */
340
+ getMyWork(options) {
341
+ return this.do('get', '/crm/my_work', {}, options);
342
+ }
343
+ /**
344
+ * List saved views.
345
+ * `GET /crm/views`, operationId `listCrmViews`, scope `crm:read`.
346
+ */
347
+ listViews(options) {
348
+ return this.do('get', '/crm/views', {}, options);
349
+ }
350
+ /**
351
+ * Save a view.
352
+ * `POST /crm/views`, operationId `saveCrmView`, scope `crm:write`.
353
+ */
354
+ saveView(body, options) {
355
+ return this.do('post', '/crm/views', { body }, options);
356
+ }
357
+ /**
358
+ * Get the pipeline summary.
359
+ * `GET /crm/summary`, operationId `getCrmSummary`, scope `crm:read`.
360
+ */
361
+ getSummary(options) {
362
+ return this.do('get', '/crm/summary', {}, options);
363
+ }
364
+ /**
365
+ * Get counts per stage.
366
+ * `GET /crm/stage_counts`, operationId `getCrmStageCounts`, scope `crm:read`.
367
+ */
368
+ getStageCounts(options) {
369
+ return this.do('get', '/crm/stage_counts', {}, options);
370
+ }
371
+ /**
372
+ * Get speed to lead.
373
+ * `GET /crm/speed`, operationId `getCrmSpeed`, scope `crm:read`.
374
+ */
375
+ getSpeed(query, options) {
376
+ return this.do('get', '/crm/speed', { query }, options);
377
+ }
378
+ /**
379
+ * Find duplicates.
380
+ * `GET /crm/duplicates`, operationId `listCrmDuplicates`, scope `crm:read`.
381
+ */
382
+ listDuplicates(options) {
383
+ return this.do('get', '/crm/duplicates', {}, options);
384
+ }
385
+ /**
386
+ * Ask the CRM.
387
+ * `POST /crm/ask`, operationId `askCrm`, scope `crm:read`.
388
+ */
389
+ ask(body, options) {
390
+ return this.do('post', '/crm/ask', { body }, options);
391
+ }
392
+ /**
393
+ * Add a note.
394
+ * `POST /crm/records/{id}/notes`, operationId `addCrmNote`, scope `crm:write`.
395
+ */
396
+ addNote(id, body, options) {
397
+ return this.do('post', '/crm/records/{id}/notes', { path: { id }, body }, options);
398
+ }
399
+ /**
400
+ * Create a follow-up.
401
+ * `POST /crm/records/{id}/follow_ups`, operationId `createCrmFollowUp`, scope `crm:write`.
402
+ */
403
+ createFollowUp(id, body, options) {
404
+ return this.do('post', '/crm/records/{id}/follow_ups', { path: { id }, body }, options);
405
+ }
406
+ /**
407
+ * Update a follow-up.
408
+ * `PATCH /crm/follow_ups/{id}`, operationId `updateCrmFollowUp`, scope `crm:write`.
409
+ */
410
+ updateFollowUp(id, body, options) {
411
+ return this.do('patch', '/crm/follow_ups/{id}', { path: { id }, body }, options);
412
+ }
413
+ /**
414
+ * Create a record.
415
+ * `POST /crm/records`, operationId `createCrmRecord`, scope `crm:write`.
416
+ */
417
+ createRecord(body, options) {
418
+ return this.do('post', '/crm/records', { body }, options);
419
+ }
420
+ /**
421
+ * Tick a stage check.
422
+ * `PUT /crm/records/{id}/stage_checks/{stage}/{check}`, operationId `setCrmStageCheck`, scope `crm:write`.
423
+ */
424
+ setStageCheck(id, stage, check, body, options) {
425
+ return this.do('put', '/crm/records/{id}/stage_checks/{stage}/{check}', { path: { id, stage, check }, body }, options);
426
+ }
427
+ /**
428
+ * Assign a reference number.
429
+ * `POST /crm/records/{id}/ref_no`, operationId `assignCrmReferenceNo`, scope `crm:write`.
430
+ */
431
+ assignReferenceNo(id, options) {
432
+ return this.do('post', '/crm/records/{id}/ref_no', { path: { id } }, options);
433
+ }
434
+ /**
435
+ * Set a document status.
436
+ * `POST /crm/records/{id}/documents/{type}/status`, operationId `setCrmDocumentStatus`, scope `crm:write`.
437
+ */
438
+ setDocumentStatus(id, type, body, options) {
439
+ return this.do('post', '/crm/records/{id}/documents/{type}/status', { path: { id, type }, body }, options);
440
+ }
441
+ /**
442
+ * Save a form draft.
443
+ * `PUT /crm/records/{id}/forms/{form_id}/draft`, operationId `saveCrmFormDraft`, scope `crm:write`.
444
+ */
445
+ saveFormDraft(id, formId, body, options) {
446
+ return this.do('put', '/crm/records/{id}/forms/{form_id}/draft', { path: { id, form_id: formId }, body }, options);
447
+ }
448
+ /**
449
+ * Draft a document.
450
+ * `POST /crm/records/{id}/doc_drafts`, operationId `draftCrmDocument`, scope `crm:write`.
451
+ */
452
+ draftDocument(id, body, options) {
453
+ return this.do('post', '/crm/records/{id}/doc_drafts', { path: { id }, body }, options);
454
+ }
455
+ /**
456
+ * Move a record to another stage.
457
+ * `POST /crm/records/{id}/stage_moves`, operationId `moveCrmRecordStage`, scope `crm:stage`.
458
+ * May answer `pending_approval` (see isPendingApproval).
459
+ */
460
+ moveRecordStage(id, body, options) {
461
+ return this.do('post', '/crm/records/{id}/stage_moves', { path: { id }, body }, options);
462
+ }
463
+ /**
464
+ * Submit a form.
465
+ * `POST /crm/records/{id}/forms/{form_id}/submissions`, operationId `submitCrmForm`, scope `crm:stage`.
466
+ * May answer `pending_approval` (see isPendingApproval).
467
+ */
468
+ submitForm(id, formId, body, options) {
469
+ return this.do('post', '/crm/records/{id}/forms/{form_id}/submissions', { path: { id, form_id: formId }, body }, options);
470
+ }
471
+ /**
472
+ * Share a form link.
473
+ * `POST /crm/records/{id}/forms/{form_id}/links`, operationId `createCrmFormLink`, scope `crm:share`.
474
+ * May answer `pending_approval` (see isPendingApproval).
475
+ */
476
+ createFormLink(id, formId, body, options) {
477
+ return this.do('post', '/crm/records/{id}/forms/{form_id}/links', { path: { id, form_id: formId }, body }, options);
478
+ }
479
+ /**
480
+ * Share an upload link.
481
+ * `POST /crm/records/{id}/upload_links`, operationId `createCrmUploadLink`, scope `crm:share`.
482
+ * May answer `pending_approval` (see isPendingApproval).
483
+ */
484
+ createUploadLink(id, body, options) {
485
+ return this.do('post', '/crm/records/{id}/upload_links', { path: { id }, body }, options);
486
+ }
487
+ /**
488
+ * Map import columns.
489
+ * `POST /crm/imports/columns`, operationId `guessCrmImportColumns`, scope `crm:import`.
490
+ */
491
+ guessImportColumns(body, options) {
492
+ return this.do('post', '/crm/imports/columns', { body }, options);
493
+ }
494
+ /**
495
+ * Import records.
496
+ * `POST /crm/imports`, operationId `importCrmRecords`, scope `crm:import`.
497
+ * May answer `pending_approval` (see isPendingApproval).
498
+ */
499
+ importRecords(body, options) {
500
+ return this.do('post', '/crm/imports', { body }, options);
501
+ }
502
+ }
503
+ exports.Crm = Crm;
504
+ /**
505
+ * Dialer sessions, analytics, follow-ups and lead briefs (`/dialer`). Reached as `finn.dialer`.
506
+ */
507
+ class Dialer extends resource_js_1.Resource {
508
+ /**
509
+ * List dialer sessions.
510
+ * `GET /dialer/sessions`, operationId `listDialerSessions`, scope `dialer:read`.
511
+ */
512
+ listSessions(query, options) {
513
+ return this.do('get', '/dialer/sessions', { query }, options);
514
+ }
515
+ /** Every item of `listSessions`, page by page (follows `next_cursor`). */
516
+ listAllSessions(query, options) {
517
+ return this.pager('/dialer/sessions', (0, pagination_js_1.cursorStrategy)('data'), query, undefined, options);
518
+ }
519
+ /**
520
+ * Get a dialer session.
521
+ * `GET /dialer/sessions/{id}`, operationId `getDialerSession`, scope `dialer:read`.
522
+ */
523
+ getSession(id, options) {
524
+ return this.do('get', '/dialer/sessions/{id}', { path: { id } }, options);
525
+ }
526
+ /**
527
+ * Dialer analytics.
528
+ * `GET /dialer/analytics`, operationId `getDialerAnalytics`, scope `dialer:read`.
529
+ */
530
+ getAnalytics(query, options) {
531
+ return this.do('get', '/dialer/analytics', { query }, options);
532
+ }
533
+ /**
534
+ * List dialer follow-ups.
535
+ * `GET /dialer/follow-ups`, operationId `listDialerFollowUps`, scope `dialer:read`.
536
+ */
537
+ listFollowUps(options) {
538
+ return this.do('get', '/dialer/follow-ups', {}, options);
539
+ }
540
+ /**
541
+ * Get a lead's cached brief.
542
+ * `GET /dialer/leads/{id}/brief`, operationId `getDialerLeadBrief`, scope `dialer:read`.
543
+ */
544
+ getLeadBrief(id, query, options) {
545
+ return this.do('get', '/dialer/leads/{id}/brief', { path: { id }, query }, options);
546
+ }
547
+ }
548
+ exports.Dialer = Dialer;
549
+ /**
550
+ * Webhook endpoints, their deliveries, and the event types (`/webhook_endpoints`, `/events`). Reached as `finn.webhooks`.
551
+ */
552
+ class Webhooks extends resource_js_1.Resource {
553
+ /**
554
+ * List webhook endpoints.
555
+ * `GET /webhook_endpoints`, operationId `listWebhookEndpoints`, scope `admin:webhooks`.
556
+ */
557
+ listEndpoints(query, options) {
558
+ return this.do('get', '/webhook_endpoints', { query }, options);
559
+ }
560
+ /** Every item of `listEndpoints`, page by page (follows `next_cursor`). */
561
+ listAllEndpoints(query, options) {
562
+ return this.pager('/webhook_endpoints', (0, pagination_js_1.cursorStrategy)('data'), query, undefined, options);
563
+ }
564
+ /**
565
+ * Create a webhook endpoint.
566
+ * `POST /webhook_endpoints`, operationId `createWebhookEndpoint`, scope `admin:webhooks`.
567
+ */
568
+ createEndpoint(body, options) {
569
+ return this.do('post', '/webhook_endpoints', { body }, options);
570
+ }
571
+ /**
572
+ * Get a webhook endpoint.
573
+ * `GET /webhook_endpoints/{id}`, operationId `getWebhookEndpoint`, scope `admin:webhooks`.
574
+ */
575
+ getEndpoint(id, options) {
576
+ return this.do('get', '/webhook_endpoints/{id}', { path: { id } }, options);
577
+ }
578
+ /**
579
+ * Update, enable or disable a webhook endpoint.
580
+ * `PATCH /webhook_endpoints/{id}`, operationId `updateWebhookEndpoint`, scope `admin:webhooks`.
581
+ */
582
+ updateEndpoint(id, body, options) {
583
+ return this.do('patch', '/webhook_endpoints/{id}', { path: { id }, body }, options);
584
+ }
585
+ /**
586
+ * Delete a webhook endpoint.
587
+ * `DELETE /webhook_endpoints/{id}`, operationId `deleteWebhookEndpoint`, scope `admin:webhooks`.
588
+ */
589
+ deleteEndpoint(id, options) {
590
+ return this.do('delete', '/webhook_endpoints/{id}', { path: { id } }, options);
591
+ }
592
+ /**
593
+ * List an endpoint's deliveries.
594
+ * `GET /webhook_endpoints/{id}/deliveries`, operationId `listWebhookDeliveries`, scope `admin:webhooks`.
595
+ */
596
+ listDeliveries(id, query, options) {
597
+ return this.do('get', '/webhook_endpoints/{id}/deliveries', { path: { id }, query }, options);
598
+ }
599
+ /** Every item of `listDeliveries`, page by page (follows `next_cursor`). */
600
+ listAllDeliveries(id, query, options) {
601
+ return this.pager('/webhook_endpoints/{id}/deliveries', (0, pagination_js_1.cursorStrategy)('data'), query, { id }, options);
602
+ }
603
+ /**
604
+ * List webhook events.
605
+ * `GET /events`, operationId `listEventTypes`, scope `admin:webhooks`.
606
+ */
607
+ listEventTypes(options) {
608
+ return this.do('get', '/events', {}, options);
609
+ }
610
+ }
611
+ exports.Webhooks = Webhooks;
612
+ /**
613
+ * The organization, its members, integrations and API keys (read only). Reached as `finn.organization`.
614
+ */
615
+ class Organization extends resource_js_1.Resource {
616
+ /**
617
+ * Get the organization.
618
+ * `GET /organization`, operationId `getOrganization`, scope `admin:read`.
619
+ */
620
+ get(options) {
621
+ return this.do('get', '/organization', {}, options);
622
+ }
623
+ /**
624
+ * List members.
625
+ * `GET /organization/members`, operationId `listOrganizationMembers`, scope `admin:read`.
626
+ */
627
+ listMembers(query, options) {
628
+ return this.do('get', '/organization/members', { query }, options);
629
+ }
630
+ /** Every item of `listMembers`, page by page (follows `next_cursor`). */
631
+ listAllMembers(query, options) {
632
+ return this.pager('/organization/members', (0, pagination_js_1.cursorStrategy)('data'), query, undefined, options);
633
+ }
634
+ /**
635
+ * List integrations.
636
+ * `GET /organization/integrations`, operationId `listOrganizationIntegrations`, scope `admin:read`.
637
+ */
638
+ listIntegrations(query, options) {
639
+ return this.do('get', '/organization/integrations', { query }, options);
640
+ }
641
+ /** Every item of `listIntegrations`, page by page (follows `next_cursor`). */
642
+ listAllIntegrations(query, options) {
643
+ return this.pager('/organization/integrations', (0, pagination_js_1.cursorStrategy)('data'), query, undefined, options);
644
+ }
645
+ /**
646
+ * List API keys.
647
+ * `GET /organization/api_keys`, operationId `listOrganizationApiKeys`, scope `admin:read`.
648
+ */
649
+ listApiKeys(query, options) {
650
+ return this.do('get', '/organization/api_keys', { query }, options);
651
+ }
652
+ /** Every item of `listApiKeys`, page by page (follows `next_cursor`). */
653
+ listAllApiKeys(query, options) {
654
+ return this.pager('/organization/api_keys', (0, pagination_js_1.cursorStrategy)('data'), query, undefined, options);
655
+ }
656
+ }
657
+ exports.Organization = Organization;
658
+ /**
659
+ * Sales plays, prospects, drafts and threads (`/sales`). Reached as `finn.sales`.
660
+ *
661
+ * @experimental The Sales API is switched off for every organization, so these calls answer an error until it is switched on for yours. Names and shapes may change without a major version.
662
+ */
663
+ class Sales extends resource_js_1.Resource {
664
+ /**
665
+ * List Sales AI plays.
666
+ * `GET /sales/plays`, operationId `listSalesPlays`, scope `sales:read`.
667
+ * @experimental The Sales API is switched off for every organization, so these calls answer an error until it is switched on for yours. Names and shapes may change without a major version.
668
+ */
669
+ listPlays(options) {
670
+ return this.do('get', '/sales/plays', {}, options);
671
+ }
672
+ /**
673
+ * List a play's runs.
674
+ * `GET /sales/plays/{slug}/runs`, operationId `listSalesPlayRuns`, scope `sales:read`.
675
+ * @experimental The Sales API is switched off for every organization, so these calls answer an error until it is switched on for yours. Names and shapes may change without a major version.
676
+ */
677
+ listPlayRuns(slug, query, options) {
678
+ return this.do('get', '/sales/plays/{slug}/runs', { path: { slug }, query }, options);
679
+ }
680
+ /**
681
+ * List a play's prospects.
682
+ * `GET /sales/plays/{slug}/prospects`, operationId `listSalesProspects`, scope `sales:read`.
683
+ * @experimental The Sales API is switched off for every organization, so these calls answer an error until it is switched on for yours. Names and shapes may change without a major version.
684
+ */
685
+ listProspects(slug, query, options) {
686
+ return this.do('get', '/sales/plays/{slug}/prospects', { path: { slug }, query }, options);
687
+ }
688
+ /**
689
+ * Run a play.
690
+ * `POST /sales/plays/{slug}/run`, operationId `runSalesPlay`, scope `sales:write`.
691
+ * @experimental The Sales API is switched off for every organization, so these calls answer an error until it is switched on for yours. Names and shapes may change without a major version.
692
+ */
693
+ runPlay(slug, options) {
694
+ return this.do('post', '/sales/plays/{slug}/run', { path: { slug } }, options);
695
+ }
696
+ /**
697
+ * List drafts.
698
+ * `GET /sales/drafts`, operationId `listSalesDrafts`, scope `sales:read`.
699
+ * @experimental The Sales API is switched off for every organization, so these calls answer an error until it is switched on for yours. Names and shapes may change without a major version.
700
+ */
701
+ listDrafts(query, options) {
702
+ return this.do('get', '/sales/drafts', { query }, options);
703
+ }
704
+ /**
705
+ * Edit a draft.
706
+ * `PATCH /sales/drafts/{id}`, operationId `updateSalesDraft`, scope `sales:write`.
707
+ * @experimental The Sales API is switched off for every organization, so these calls answer an error until it is switched on for yours. Names and shapes may change without a major version.
708
+ */
709
+ updateDraft(id, body, options) {
710
+ return this.do('patch', '/sales/drafts/{id}', { path: { id }, body }, options);
711
+ }
712
+ /**
713
+ * Skip a draft.
714
+ * `POST /sales/drafts/{id}/skip`, operationId `skipSalesDraft`, scope `sales:write`.
715
+ * @experimental The Sales API is switched off for every organization, so these calls answer an error until it is switched on for yours. Names and shapes may change without a major version.
716
+ */
717
+ skipDraft(id, body, options) {
718
+ return this.do('post', '/sales/drafts/{id}/skip', { path: { id }, body }, options);
719
+ }
720
+ /**
721
+ * List threads.
722
+ * `GET /sales/threads`, operationId `listSalesThreads`, scope `sales:read`.
723
+ * @experimental The Sales API is switched off for every organization, so these calls answer an error until it is switched on for yours. Names and shapes may change without a major version.
724
+ */
725
+ listThreads(query, options) {
726
+ return this.do('get', '/sales/threads', { query }, options);
727
+ }
728
+ /**
729
+ * Get a thread.
730
+ * `GET /sales/threads/{id}`, operationId `getSalesThread`, scope `sales:read`.
731
+ * @experimental The Sales API is switched off for every organization, so these calls answer an error until it is switched on for yours. Names and shapes may change without a major version.
732
+ */
733
+ getThread(id, options) {
734
+ return this.do('get', '/sales/threads/{id}', { path: { id } }, options);
735
+ }
736
+ }
737
+ exports.Sales = Sales;