@recovr/sdk 0.0.0-stage → 1.0.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 (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +139 -2
  3. package/dist/cjs/client.d.ts +36 -0
  4. package/dist/cjs/client.js +100 -0
  5. package/dist/cjs/errors.d.ts +31 -0
  6. package/dist/cjs/errors.js +69 -0
  7. package/dist/cjs/generated/client/client.gen.d.ts +2 -0
  8. package/dist/cjs/generated/client/client.gen.js +220 -0
  9. package/dist/cjs/generated/client/index.d.ts +10 -0
  10. package/dist/cjs/generated/client/index.js +17 -0
  11. package/dist/cjs/generated/client/types.gen.d.ts +120 -0
  12. package/dist/cjs/generated/client/types.gen.js +3 -0
  13. package/dist/cjs/generated/client/utils.gen.d.ts +37 -0
  14. package/dist/cjs/generated/client/utils.gen.js +239 -0
  15. package/dist/cjs/generated/client.gen.d.ts +12 -0
  16. package/dist/cjs/generated/client.gen.js +6 -0
  17. package/dist/cjs/generated/core/auth.gen.d.ts +25 -0
  18. package/dist/cjs/generated/core/auth.gen.js +18 -0
  19. package/dist/cjs/generated/core/bodySerializer.gen.d.ts +25 -0
  20. package/dist/cjs/generated/core/bodySerializer.gen.js +60 -0
  21. package/dist/cjs/generated/core/params.gen.d.ts +43 -0
  22. package/dist/cjs/generated/core/params.gen.js +112 -0
  23. package/dist/cjs/generated/core/pathSerializer.gen.d.ts +33 -0
  24. package/dist/cjs/generated/core/pathSerializer.gen.js +115 -0
  25. package/dist/cjs/generated/core/queryKeySerializer.gen.d.ts +18 -0
  26. package/dist/cjs/generated/core/queryKeySerializer.gen.js +98 -0
  27. package/dist/cjs/generated/core/serverSentEvents.gen.d.ts +71 -0
  28. package/dist/cjs/generated/core/serverSentEvents.gen.js +135 -0
  29. package/dist/cjs/generated/core/types.gen.d.ts +83 -0
  30. package/dist/cjs/generated/core/types.gen.js +3 -0
  31. package/dist/cjs/generated/core/utils.gen.d.ts +19 -0
  32. package/dist/cjs/generated/core/utils.gen.js +93 -0
  33. package/dist/cjs/generated/index.d.ts +2 -0
  34. package/dist/cjs/generated/index.js +6 -0
  35. package/dist/cjs/generated/sdk.gen.d.ts +225 -0
  36. package/dist/cjs/generated/sdk.gen.js +825 -0
  37. package/dist/cjs/generated/types.gen.d.ts +2455 -0
  38. package/dist/cjs/generated/types.gen.js +3 -0
  39. package/dist/cjs/index.d.ts +4 -0
  40. package/dist/cjs/index.js +11 -0
  41. package/dist/cjs/package.json +3 -0
  42. package/dist/cjs/paginate.d.ts +24 -0
  43. package/dist/cjs/paginate.js +18 -0
  44. package/dist/esm/client.d.ts +36 -0
  45. package/dist/esm/client.js +95 -0
  46. package/dist/esm/errors.d.ts +31 -0
  47. package/dist/esm/errors.js +64 -0
  48. package/dist/esm/generated/client/client.gen.d.ts +2 -0
  49. package/dist/esm/generated/client/client.gen.js +216 -0
  50. package/dist/esm/generated/client/index.d.ts +10 -0
  51. package/dist/esm/generated/client/index.js +6 -0
  52. package/dist/esm/generated/client/types.gen.d.ts +120 -0
  53. package/dist/esm/generated/client/types.gen.js +2 -0
  54. package/dist/esm/generated/client/utils.gen.d.ts +37 -0
  55. package/dist/esm/generated/client/utils.gen.js +228 -0
  56. package/dist/esm/generated/client.gen.d.ts +12 -0
  57. package/dist/esm/generated/client.gen.js +3 -0
  58. package/dist/esm/generated/core/auth.gen.d.ts +25 -0
  59. package/dist/esm/generated/core/auth.gen.js +14 -0
  60. package/dist/esm/generated/core/bodySerializer.gen.d.ts +25 -0
  61. package/dist/esm/generated/core/bodySerializer.gen.js +57 -0
  62. package/dist/esm/generated/core/params.gen.d.ts +43 -0
  63. package/dist/esm/generated/core/params.gen.js +109 -0
  64. package/dist/esm/generated/core/pathSerializer.gen.d.ts +33 -0
  65. package/dist/esm/generated/core/pathSerializer.gen.js +106 -0
  66. package/dist/esm/generated/core/queryKeySerializer.gen.d.ts +18 -0
  67. package/dist/esm/generated/core/queryKeySerializer.gen.js +92 -0
  68. package/dist/esm/generated/core/serverSentEvents.gen.d.ts +71 -0
  69. package/dist/esm/generated/core/serverSentEvents.gen.js +132 -0
  70. package/dist/esm/generated/core/types.gen.d.ts +83 -0
  71. package/dist/esm/generated/core/types.gen.js +2 -0
  72. package/dist/esm/generated/core/utils.gen.d.ts +19 -0
  73. package/dist/esm/generated/core/utils.gen.js +87 -0
  74. package/dist/esm/generated/index.d.ts +2 -0
  75. package/dist/esm/generated/index.js +2 -0
  76. package/dist/esm/generated/sdk.gen.d.ts +225 -0
  77. package/dist/esm/generated/sdk.gen.js +821 -0
  78. package/dist/esm/generated/types.gen.d.ts +2455 -0
  79. package/dist/esm/generated/types.gen.js +2 -0
  80. package/dist/esm/index.d.ts +4 -0
  81. package/dist/esm/index.js +3 -0
  82. package/dist/esm/paginate.d.ts +24 -0
  83. package/dist/esm/paginate.js +15 -0
  84. package/package.json +56 -4
@@ -0,0 +1,825 @@
1
+ "use strict";
2
+ // This file is auto-generated by @hey-api/openapi-ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RecovrSdk = void 0;
5
+ const client_gen_js_1 = require("./client.gen.js");
6
+ class HeyApiClient {
7
+ client;
8
+ constructor(args) {
9
+ this.client = args?.client ?? client_gen_js_1.client;
10
+ }
11
+ }
12
+ class HeyApiRegistry {
13
+ defaultKey = 'default';
14
+ instances = new Map();
15
+ get(key) {
16
+ const instance = this.instances.get(key ?? this.defaultKey);
17
+ if (!instance) {
18
+ throw new Error(`No SDK client found. Create one with "new RecovrSdk()" to fix this error.`);
19
+ }
20
+ return instance;
21
+ }
22
+ set(value, key) {
23
+ this.instances.set(key ?? this.defaultKey, value);
24
+ }
25
+ }
26
+ class RecovrSdk extends HeyApiClient {
27
+ static __registry = new HeyApiRegistry();
28
+ constructor(args) {
29
+ super(args);
30
+ RecovrSdk.__registry.set(this, args?.key);
31
+ }
32
+ /**
33
+ * The credential making this request
34
+ *
35
+ * How this request authenticated (a personal access token or an OAuth app), the credential's name, the permissions that apply, its location and rate-limit state. A good first call to check a credential works. Any valid personal access token or OAuth token can call it.
36
+ */
37
+ getMe(options) {
38
+ return (options?.client ?? this.client).get({
39
+ security: [
40
+ {
41
+ key: 'oauth2',
42
+ scheme: 'bearer',
43
+ type: 'http'
44
+ },
45
+ { name: 'x-api-key', type: 'apiKey' },
46
+ {
47
+ key: 'bearerAuth',
48
+ scheme: 'bearer',
49
+ type: 'http'
50
+ }
51
+ ],
52
+ url: '/me',
53
+ ...options
54
+ });
55
+ }
56
+ /**
57
+ * The key's location
58
+ *
59
+ * The one location this key belongs to; every other endpoint reads and writes only there. Any valid key can call it.
60
+ */
61
+ getLocation(options) {
62
+ return (options?.client ?? this.client).get({
63
+ security: [
64
+ {
65
+ key: 'oauth2',
66
+ scheme: 'bearer',
67
+ type: 'http'
68
+ },
69
+ { name: 'x-api-key', type: 'apiKey' },
70
+ {
71
+ key: 'bearerAuth',
72
+ scheme: 'bearer',
73
+ type: 'http'
74
+ }
75
+ ],
76
+ url: '/location',
77
+ ...options
78
+ });
79
+ }
80
+ /**
81
+ * List team members
82
+ *
83
+ * The team at the key's location, for assigning clients (POST /clients/{id}/assign) and filtering by `assigned_to`. Needs `clients:read`.
84
+ */
85
+ listTeamMembers(options) {
86
+ return (options?.client ?? this.client).get({
87
+ security: [
88
+ {
89
+ key: 'oauth2',
90
+ scheme: 'bearer',
91
+ type: 'http'
92
+ },
93
+ { name: 'x-api-key', type: 'apiKey' },
94
+ {
95
+ key: 'bearerAuth',
96
+ scheme: 'bearer',
97
+ type: 'http'
98
+ }
99
+ ],
100
+ url: '/team-members',
101
+ ...options
102
+ });
103
+ }
104
+ /**
105
+ * Get a client
106
+ *
107
+ * One client at the key's location, read fresh. Needs `clients:read`; `email` and `phone` are included only with `contact_details:read`. A client at another location is a 404.
108
+ */
109
+ getClient(options) {
110
+ return (options.client ?? this.client).get({
111
+ security: [
112
+ {
113
+ key: 'oauth2',
114
+ scheme: 'bearer',
115
+ type: 'http'
116
+ },
117
+ { name: 'x-api-key', type: 'apiKey' },
118
+ {
119
+ key: 'bearerAuth',
120
+ scheme: 'bearer',
121
+ type: 'http'
122
+ }
123
+ ],
124
+ url: '/clients/{id}',
125
+ ...options
126
+ });
127
+ }
128
+ /**
129
+ * List clients
130
+ *
131
+ * Clients at the key's location, filtered the way the Clients page filters them. Needs `clients:read`; filtering by `email` or `phone` also needs `contact_details:read`.
132
+ *
133
+ * Every filter you send must match (AND). Includes leads and former members unless you filter by `lifecycle_stage` or `is_active_member`. Exact filters (`external_client_id`, `email`, `phone`) can match several clients, for example a family sharing an email: all of them are returned.
134
+ *
135
+ * Pages are stable: a client added or removed between pages doesn't make the next page repeat or skip anyone else. Lists are read from data that can be up to a minute old; GET /clients/{id} reads one client fresh.
136
+ */
137
+ listClients(options) {
138
+ return (options?.client ?? this.client).get({
139
+ security: [
140
+ {
141
+ key: 'oauth2',
142
+ scheme: 'bearer',
143
+ type: 'http'
144
+ },
145
+ { name: 'x-api-key', type: 'apiKey' },
146
+ {
147
+ key: 'bearerAuth',
148
+ scheme: 'bearer',
149
+ type: 'http'
150
+ }
151
+ ],
152
+ url: '/clients',
153
+ ...options
154
+ });
155
+ }
156
+ /**
157
+ * Assign a client to a team member
158
+ *
159
+ * Sets who looks after this client, as assigning a coach does on their profile. The team member is emailed unless they've turned assignment emails off. Send `assigned_to: null` to unassign. An id that isn't on the location's team is a 400. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
160
+ */
161
+ assignClient(options) {
162
+ return (options.client ?? this.client).post({
163
+ security: [
164
+ {
165
+ key: 'oauth2',
166
+ scheme: 'bearer',
167
+ type: 'http'
168
+ },
169
+ { name: 'x-api-key', type: 'apiKey' },
170
+ {
171
+ key: 'bearerAuth',
172
+ scheme: 'bearer',
173
+ type: 'http'
174
+ }
175
+ ],
176
+ url: '/clients/{id}/assign',
177
+ ...options,
178
+ headers: {
179
+ 'Content-Type': 'application/json',
180
+ ...options.headers
181
+ }
182
+ });
183
+ }
184
+ /**
185
+ * Flag a client
186
+ *
187
+ * Flags the client for the team's attention from now, and records it on their timeline. The body is optional. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
188
+ */
189
+ flagClient(options) {
190
+ return (options.client ?? this.client).post({
191
+ security: [
192
+ {
193
+ key: 'oauth2',
194
+ scheme: 'bearer',
195
+ type: 'http'
196
+ },
197
+ { name: 'x-api-key', type: 'apiKey' },
198
+ {
199
+ key: 'bearerAuth',
200
+ scheme: 'bearer',
201
+ type: 'http'
202
+ }
203
+ ],
204
+ url: '/clients/{id}/flag',
205
+ ...options,
206
+ headers: {
207
+ 'Content-Type': 'application/json',
208
+ ...options.headers
209
+ }
210
+ });
211
+ }
212
+ /**
213
+ * Remove a client's flag
214
+ *
215
+ * Unflagging a client who isn't flagged changes nothing. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
216
+ */
217
+ unflagClient(options) {
218
+ return (options.client ?? this.client).post({
219
+ security: [
220
+ {
221
+ key: 'oauth2',
222
+ scheme: 'bearer',
223
+ type: 'http'
224
+ },
225
+ { name: 'x-api-key', type: 'apiKey' },
226
+ {
227
+ key: 'bearerAuth',
228
+ scheme: 'bearer',
229
+ type: 'http'
230
+ }
231
+ ],
232
+ url: '/clients/{id}/unflag',
233
+ ...options
234
+ });
235
+ }
236
+ /**
237
+ * Snooze a client
238
+ *
239
+ * Takes the client out of Next Up until the snooze ends. Send `days` or `until`, not both. Snoozing a snoozed client replaces the end. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
240
+ */
241
+ snoozeClient(options) {
242
+ return (options.client ?? this.client).post({
243
+ security: [
244
+ {
245
+ key: 'oauth2',
246
+ scheme: 'bearer',
247
+ type: 'http'
248
+ },
249
+ { name: 'x-api-key', type: 'apiKey' },
250
+ {
251
+ key: 'bearerAuth',
252
+ scheme: 'bearer',
253
+ type: 'http'
254
+ }
255
+ ],
256
+ url: '/clients/{id}/snooze',
257
+ ...options,
258
+ headers: {
259
+ 'Content-Type': 'application/json',
260
+ ...options.headers
261
+ }
262
+ });
263
+ }
264
+ /**
265
+ * End a client's snooze
266
+ *
267
+ * Ends the snooze now. Unsnoozing a client who isn't snoozed changes nothing. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
268
+ */
269
+ unsnoozeClient(options) {
270
+ return (options.client ?? this.client).post({
271
+ security: [
272
+ {
273
+ key: 'oauth2',
274
+ scheme: 'bearer',
275
+ type: 'http'
276
+ },
277
+ { name: 'x-api-key', type: 'apiKey' },
278
+ {
279
+ key: 'bearerAuth',
280
+ scheme: 'bearer',
281
+ type: 'http'
282
+ }
283
+ ],
284
+ url: '/clients/{id}/unsnooze',
285
+ ...options
286
+ });
287
+ }
288
+ /**
289
+ * Set a client's do-not-contact channels
290
+ *
291
+ * Stops (or allows again) messages and calls to the client on the channels you name; the client's `do_not_contact` shows the result. Every send from Recovr, including workflows, checks this. At a location connected to GoHighLevel, a later sync from GoHighLevel can change it, and this doesn't change it in GoHighLevel. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
292
+ */
293
+ setClientDoNotContact(options) {
294
+ return (options.client ?? this.client).post({
295
+ security: [
296
+ {
297
+ key: 'oauth2',
298
+ scheme: 'bearer',
299
+ type: 'http'
300
+ },
301
+ { name: 'x-api-key', type: 'apiKey' },
302
+ {
303
+ key: 'bearerAuth',
304
+ scheme: 'bearer',
305
+ type: 'http'
306
+ }
307
+ ],
308
+ url: '/clients/{id}/do-not-contact',
309
+ ...options,
310
+ headers: {
311
+ 'Content-Type': 'application/json',
312
+ ...options.headers
313
+ }
314
+ });
315
+ }
316
+ /**
317
+ * Add a label to a client
318
+ *
319
+ * Applies one of the location's labels, which can start workflows that trigger on it. Adding a label the client already has changes nothing. An archived label is restored. Smart labels can't be added by hand. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
320
+ */
321
+ addClientLabel(options) {
322
+ return (options.client ?? this.client).post({
323
+ security: [
324
+ {
325
+ key: 'oauth2',
326
+ scheme: 'bearer',
327
+ type: 'http'
328
+ },
329
+ { name: 'x-api-key', type: 'apiKey' },
330
+ {
331
+ key: 'bearerAuth',
332
+ scheme: 'bearer',
333
+ type: 'http'
334
+ }
335
+ ],
336
+ url: '/clients/{id}/labels',
337
+ ...options,
338
+ headers: {
339
+ 'Content-Type': 'application/json',
340
+ ...options.headers
341
+ }
342
+ });
343
+ }
344
+ /**
345
+ * Remove a label from a client
346
+ *
347
+ * Removing a label the client doesn't have changes nothing. Recovr won't re-apply a label you removed by itself. Smart labels can't be removed by hand. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
348
+ */
349
+ removeClientLabel(options) {
350
+ return (options.client ?? this.client).delete({
351
+ security: [
352
+ {
353
+ key: 'oauth2',
354
+ scheme: 'bearer',
355
+ type: 'http'
356
+ },
357
+ { name: 'x-api-key', type: 'apiKey' },
358
+ {
359
+ key: 'bearerAuth',
360
+ scheme: 'bearer',
361
+ type: 'http'
362
+ }
363
+ ],
364
+ url: '/clients/{id}/labels/{label_id}',
365
+ ...options
366
+ });
367
+ }
368
+ /**
369
+ * Get a client's suspension details
370
+ *
371
+ * The Suspended Member details on the client's profile. A client who isn't suspended has `is_suspended: false`; details from an earlier suspension aren't returned. Needs `clients:read`. Works only on clients at the key's location: any other id is a 404.
372
+ */
373
+ getClientSuspension(options) {
374
+ return (options.client ?? this.client).get({
375
+ security: [
376
+ {
377
+ key: 'oauth2',
378
+ scheme: 'bearer',
379
+ type: 'http'
380
+ },
381
+ { name: 'x-api-key', type: 'apiKey' },
382
+ {
383
+ key: 'bearerAuth',
384
+ scheme: 'bearer',
385
+ type: 'http'
386
+ }
387
+ ],
388
+ url: '/clients/{id}/suspension',
389
+ ...options
390
+ });
391
+ }
392
+ /**
393
+ * Update a client's suspension details
394
+ *
395
+ * Sets the reason, expected return date and notes on the client's Suspended Member card. Fields you leave out keep their value; null clears one. The client must already be Suspended in Recovr, which follows the booking platform: a hold made there shows up after Recovr's next sync of that client, and until then this returns 409 `client_not_suspended`. Needs `clients:write`. Works only on clients at the key's location: any other id is a 404.
396
+ */
397
+ updateClientSuspension(options) {
398
+ return (options.client ?? this.client).patch({
399
+ security: [
400
+ {
401
+ key: 'oauth2',
402
+ scheme: 'bearer',
403
+ type: 'http'
404
+ },
405
+ { name: 'x-api-key', type: 'apiKey' },
406
+ {
407
+ key: 'bearerAuth',
408
+ scheme: 'bearer',
409
+ type: 'http'
410
+ }
411
+ ],
412
+ url: '/clients/{id}/suspension',
413
+ ...options,
414
+ headers: {
415
+ 'Content-Type': 'application/json',
416
+ ...options.headers
417
+ }
418
+ });
419
+ }
420
+ /**
421
+ * List client labels
422
+ *
423
+ * The location's labels, for `label_id` in GET /clients and POST /clients/{id}/labels. Archived labels only with `include_archived=true`. Needs `clients:read`.
424
+ */
425
+ listClientLabels(options) {
426
+ return (options?.client ?? this.client).get({
427
+ security: [
428
+ {
429
+ key: 'oauth2',
430
+ scheme: 'bearer',
431
+ type: 'http'
432
+ },
433
+ { name: 'x-api-key', type: 'apiKey' },
434
+ {
435
+ key: 'bearerAuth',
436
+ scheme: 'bearer',
437
+ type: 'http'
438
+ }
439
+ ],
440
+ url: '/client-labels',
441
+ ...options
442
+ });
443
+ }
444
+ /**
445
+ * List a client's notes
446
+ *
447
+ * Newest first; pages don't repeat or skip items when new ones are added meanwhile. Includes notes imported from the booking platform. Needs `notes:read`. Only for clients at the key's location: any other id is a 404.
448
+ */
449
+ listClientNotes(options) {
450
+ return (options.client ?? this.client).get({
451
+ security: [
452
+ {
453
+ key: 'oauth2',
454
+ scheme: 'bearer',
455
+ type: 'http'
456
+ },
457
+ { name: 'x-api-key', type: 'apiKey' },
458
+ {
459
+ key: 'bearerAuth',
460
+ scheme: 'bearer',
461
+ type: 'http'
462
+ }
463
+ ],
464
+ url: '/clients/{id}/notes',
465
+ ...options
466
+ });
467
+ }
468
+ /**
469
+ * Add a note
470
+ *
471
+ * Adds a note as the key's owner, exactly as the Note tab does: it shows on the client's timeline and counts as the team being in touch. Needs `notes:write`. Only for clients at the key's location: any other id is a 404.
472
+ */
473
+ createClientNote(options) {
474
+ return (options.client ?? this.client).post({
475
+ security: [
476
+ {
477
+ key: 'oauth2',
478
+ scheme: 'bearer',
479
+ type: 'http'
480
+ },
481
+ { name: 'x-api-key', type: 'apiKey' },
482
+ {
483
+ key: 'bearerAuth',
484
+ scheme: 'bearer',
485
+ type: 'http'
486
+ }
487
+ ],
488
+ url: '/clients/{id}/notes',
489
+ ...options,
490
+ headers: {
491
+ 'Content-Type': 'application/json',
492
+ ...options.headers
493
+ }
494
+ });
495
+ }
496
+ /**
497
+ * Pin a note
498
+ *
499
+ * Pins it to the top of the client's profile, unpinning whichever note was pinned before. Needs `notes:write`. Only for notes at the key's location: any other id is a 404.
500
+ */
501
+ pinNote(options) {
502
+ return (options.client ?? this.client).post({
503
+ security: [
504
+ {
505
+ key: 'oauth2',
506
+ scheme: 'bearer',
507
+ type: 'http'
508
+ },
509
+ { name: 'x-api-key', type: 'apiKey' },
510
+ {
511
+ key: 'bearerAuth',
512
+ scheme: 'bearer',
513
+ type: 'http'
514
+ }
515
+ ],
516
+ url: '/notes/{note_id}/pin',
517
+ ...options
518
+ });
519
+ }
520
+ /**
521
+ * Unpin a note
522
+ *
523
+ * Unpinning a note that isn't pinned changes nothing. Needs `notes:write`. Only for notes at the key's location: any other id is a 404.
524
+ */
525
+ unpinNote(options) {
526
+ return (options.client ?? this.client).post({
527
+ security: [
528
+ {
529
+ key: 'oauth2',
530
+ scheme: 'bearer',
531
+ type: 'http'
532
+ },
533
+ { name: 'x-api-key', type: 'apiKey' },
534
+ {
535
+ key: 'bearerAuth',
536
+ scheme: 'bearer',
537
+ type: 'http'
538
+ }
539
+ ],
540
+ url: '/notes/{note_id}/unpin',
541
+ ...options
542
+ });
543
+ }
544
+ /**
545
+ * List a client's interactions
546
+ *
547
+ * Calls, in-person conversations and messages the team logged, including contact logs imported from the booking platform. Snoozes, flags, assignments and other changes on the profile aren't contact and aren't listed. Newest first; pages don't repeat or skip items when new ones are added meanwhile. (ordered by when they were logged). Notes are at /clients/{id}/notes; messages sent through Recovr aren't listed here. Needs `notes:read`. Only for clients at the key's location: any other id is a 404.
548
+ */
549
+ listClientInteractions(options) {
550
+ return (options.client ?? this.client).get({
551
+ security: [
552
+ {
553
+ key: 'oauth2',
554
+ scheme: 'bearer',
555
+ type: 'http'
556
+ },
557
+ { name: 'x-api-key', type: 'apiKey' },
558
+ {
559
+ key: 'bearerAuth',
560
+ scheme: 'bearer',
561
+ type: 'http'
562
+ }
563
+ ],
564
+ url: '/clients/{id}/interactions',
565
+ ...options
566
+ });
567
+ }
568
+ /**
569
+ * Log an interaction
570
+ *
571
+ * Records contact the team had with the client, as the key's owner: a `call` (as the profile's Call tab logs it), an `in_person` conversation (the Interact tab) or a `message` sent outside Recovr by `email`, `sms` or `whatsapp`. It counts as contact made in reports and Next Up, and doesn't send anything to the client. Needs `notes:write`. Only for clients at the key's location: any other id is a 404.
572
+ */
573
+ createClientInteraction(options) {
574
+ return (options.client ?? this.client).post({
575
+ security: [
576
+ {
577
+ key: 'oauth2',
578
+ scheme: 'bearer',
579
+ type: 'http'
580
+ },
581
+ { name: 'x-api-key', type: 'apiKey' },
582
+ {
583
+ key: 'bearerAuth',
584
+ scheme: 'bearer',
585
+ type: 'http'
586
+ }
587
+ ],
588
+ url: '/clients/{id}/interactions',
589
+ ...options,
590
+ headers: {
591
+ 'Content-Type': 'application/json',
592
+ ...options.headers
593
+ }
594
+ });
595
+ }
596
+ /**
597
+ * List a client's open reminders
598
+ *
599
+ * Reminders the team still has to tick off for this client. Newest first; pages don't repeat or skip items when new ones are added meanwhile. Closed reminders aren't listed. Answers 404 `reminders_unavailable` where the location doesn't have reminders turned on. Needs `notes:read`. Only for clients at the key's location: any other id is a 404.
600
+ */
601
+ listClientReminders(options) {
602
+ return (options.client ?? this.client).get({
603
+ security: [
604
+ {
605
+ key: 'oauth2',
606
+ scheme: 'bearer',
607
+ type: 'http'
608
+ },
609
+ { name: 'x-api-key', type: 'apiKey' },
610
+ {
611
+ key: 'bearerAuth',
612
+ scheme: 'bearer',
613
+ type: 'http'
614
+ }
615
+ ],
616
+ url: '/clients/{id}/reminders',
617
+ ...options
618
+ });
619
+ }
620
+ /**
621
+ * Set a reminder
622
+ *
623
+ * A reminder for the team about this client, set as the key's owner: due at a time (`due_kind: "date"`, it comes up in Next Up) or at their next class (`due_kind: "next_class"`, it's shown on the class list). Answers 404 `reminders_unavailable` where the location doesn't have reminders turned on. Needs `notes:write`. Only for clients at the key's location: any other id is a 404.
624
+ */
625
+ createClientReminder(options) {
626
+ return (options.client ?? this.client).post({
627
+ security: [
628
+ {
629
+ key: 'oauth2',
630
+ scheme: 'bearer',
631
+ type: 'http'
632
+ },
633
+ { name: 'x-api-key', type: 'apiKey' },
634
+ {
635
+ key: 'bearerAuth',
636
+ scheme: 'bearer',
637
+ type: 'http'
638
+ }
639
+ ],
640
+ url: '/clients/{id}/reminders',
641
+ ...options,
642
+ headers: {
643
+ 'Content-Type': 'application/json',
644
+ ...options.headers
645
+ }
646
+ });
647
+ }
648
+ /**
649
+ * Change a reminder
650
+ *
651
+ * Changes the due time, the note, or both, on an open dated reminder; what you leave out stays. Moving the time re-arms it. A next-class reminder has no time to change (400). Answers 404 `reminders_unavailable` where the location doesn't have reminders turned on. Needs `notes:write`. Only for reminders at the key's location: any other id is a 404.
652
+ */
653
+ updateReminder(options) {
654
+ return (options.client ?? this.client).patch({
655
+ security: [
656
+ {
657
+ key: 'oauth2',
658
+ scheme: 'bearer',
659
+ type: 'http'
660
+ },
661
+ { name: 'x-api-key', type: 'apiKey' },
662
+ {
663
+ key: 'bearerAuth',
664
+ scheme: 'bearer',
665
+ type: 'http'
666
+ }
667
+ ],
668
+ url: '/reminders/{id}',
669
+ ...options,
670
+ headers: {
671
+ 'Content-Type': 'application/json',
672
+ ...options.headers
673
+ }
674
+ });
675
+ }
676
+ /**
677
+ * Close a reminder
678
+ *
679
+ * Ticks it off as the key's owner. It doesn't snooze the client. The body is optional. Answers 404 `reminders_unavailable` where the location doesn't have reminders turned on. Needs `notes:write`. Only for reminders at the key's location: any other id is a 404.
680
+ */
681
+ closeReminder(options) {
682
+ return (options.client ?? this.client).post({
683
+ security: [
684
+ {
685
+ key: 'oauth2',
686
+ scheme: 'bearer',
687
+ type: 'http'
688
+ },
689
+ { name: 'x-api-key', type: 'apiKey' },
690
+ {
691
+ key: 'bearerAuth',
692
+ scheme: 'bearer',
693
+ type: 'http'
694
+ }
695
+ ],
696
+ url: '/reminders/{id}/close',
697
+ ...options,
698
+ headers: {
699
+ 'Content-Type': 'application/json',
700
+ ...options.headers
701
+ }
702
+ });
703
+ }
704
+ /**
705
+ * List forms
706
+ *
707
+ * The location's published forms, newest first. Use a form's id to list its submissions.
708
+ */
709
+ listForms(options) {
710
+ return (options?.client ?? this.client).get({
711
+ security: [
712
+ {
713
+ key: 'oauth2',
714
+ scheme: 'bearer',
715
+ type: 'http'
716
+ },
717
+ { name: 'x-api-key', type: 'apiKey' },
718
+ {
719
+ key: 'bearerAuth',
720
+ scheme: 'bearer',
721
+ type: 'http'
722
+ }
723
+ ],
724
+ url: '/forms',
725
+ ...options
726
+ });
727
+ }
728
+ /**
729
+ * Get a form
730
+ *
731
+ * One form with the questions it asks. Works for forms that are no longer published, so older submissions can still be read.
732
+ */
733
+ getForm(options) {
734
+ return (options.client ?? this.client).get({
735
+ security: [
736
+ {
737
+ key: 'oauth2',
738
+ scheme: 'bearer',
739
+ type: 'http'
740
+ },
741
+ { name: 'x-api-key', type: 'apiKey' },
742
+ {
743
+ key: 'bearerAuth',
744
+ scheme: 'bearer',
745
+ type: 'http'
746
+ }
747
+ ],
748
+ url: '/forms/{id}',
749
+ ...options
750
+ });
751
+ }
752
+ /**
753
+ * List a form's submissions
754
+ *
755
+ * Newest first, or with `after_id` oldest first from that id, which is how to fetch new submissions. Includes anonymous answers (for example to the Feedback form), which have a null `client_id`. Answers can contain contact and health details. Pages hold steady while new submissions arrive: none is repeated or skipped.
756
+ */
757
+ listFormSubmissions(options) {
758
+ return (options.client ?? this.client).get({
759
+ security: [
760
+ {
761
+ key: 'oauth2',
762
+ scheme: 'bearer',
763
+ type: 'http'
764
+ },
765
+ { name: 'x-api-key', type: 'apiKey' },
766
+ {
767
+ key: 'bearerAuth',
768
+ scheme: 'bearer',
769
+ type: 'http'
770
+ }
771
+ ],
772
+ url: '/forms/{id}/submissions',
773
+ ...options
774
+ });
775
+ }
776
+ /**
777
+ * List a client's form submissions
778
+ *
779
+ * Every form this client has submitted, newest first (or with `after_id`, oldest first from that id), with their answers. Anonymous answers are never attached to a client. Answers can contain contact and health details.
780
+ */
781
+ listClientFormSubmissions(options) {
782
+ return (options.client ?? this.client).get({
783
+ security: [
784
+ {
785
+ key: 'oauth2',
786
+ scheme: 'bearer',
787
+ type: 'http'
788
+ },
789
+ { name: 'x-api-key', type: 'apiKey' },
790
+ {
791
+ key: 'bearerAuth',
792
+ scheme: 'bearer',
793
+ type: 'http'
794
+ }
795
+ ],
796
+ url: '/clients/{id}/form-submissions',
797
+ ...options
798
+ });
799
+ }
800
+ /**
801
+ * Get a form submission
802
+ *
803
+ * One submission with its answers. Answers can contain contact and health details.
804
+ */
805
+ getFormSubmission(options) {
806
+ return (options.client ?? this.client).get({
807
+ security: [
808
+ {
809
+ key: 'oauth2',
810
+ scheme: 'bearer',
811
+ type: 'http'
812
+ },
813
+ { name: 'x-api-key', type: 'apiKey' },
814
+ {
815
+ key: 'bearerAuth',
816
+ scheme: 'bearer',
817
+ type: 'http'
818
+ }
819
+ ],
820
+ url: '/form-submissions/{id}',
821
+ ...options
822
+ });
823
+ }
824
+ }
825
+ exports.RecovrSdk = RecovrSdk;