minikai 1.8.0 → 1.18.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 (81) hide show
  1. package/README.md +390 -0
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/api/resources/labels/client/Client.d.ts +2 -2
  4. package/dist/cjs/api/resources/labels/client/Client.js +2 -2
  5. package/dist/cjs/api/resources/labels/client/requests/UpdateLabelCommand.d.ts +2 -1
  6. package/dist/cjs/api/resources/minis/client/Client.d.ts +8 -1
  7. package/dist/cjs/api/resources/minis/client/Client.js +44 -1
  8. package/dist/cjs/api/resources/minis/client/requests/SearchMinisFullTextQuery.d.ts +1 -1
  9. package/dist/cjs/api/resources/records/client/Client.d.ts +27 -9
  10. package/dist/cjs/api/resources/records/client/Client.js +108 -31
  11. package/dist/cjs/api/resources/records/client/requests/ExportRecordsForMinisQuery.d.ts +14 -0
  12. package/dist/cjs/api/resources/records/client/requests/ExportRecordsForMinisQuery.js +3 -0
  13. package/dist/cjs/api/resources/records/client/requests/ExportRecordsRequest.d.ts +1 -2
  14. package/dist/cjs/api/resources/records/client/requests/GetRecordsRequest.d.ts +1 -2
  15. package/dist/cjs/api/resources/records/client/requests/SearchRecordsFullTextQuery.d.ts +1 -1
  16. package/dist/cjs/api/resources/records/client/requests/index.d.ts +1 -0
  17. package/dist/cjs/api/resources/skills/client/Client.d.ts +7 -0
  18. package/dist/cjs/api/resources/skills/client/Client.js +43 -0
  19. package/dist/cjs/api/types/CursorPaginatedListOfMiniVersionDto.d.ts +1 -1
  20. package/dist/cjs/api/types/CursorPaginatedListOfRecordDto.d.ts +1 -1
  21. package/dist/cjs/api/types/CursorPaginatedListOfRecordVersionDto.d.ts +1 -1
  22. package/dist/cjs/api/types/HttpValidationProblemDetails.d.ts +1 -1
  23. package/dist/cjs/api/types/IdentityKind.d.ts +1 -0
  24. package/dist/cjs/api/types/IdentityKind.js +1 -0
  25. package/dist/cjs/api/types/LabelDto.d.ts +1 -0
  26. package/dist/cjs/api/types/LabelRenameStateDto.d.ts +3 -0
  27. package/dist/cjs/api/types/LabelRenameStateDto.js +3 -0
  28. package/dist/cjs/api/types/RecordAttachmentDto.d.ts +0 -1
  29. package/dist/cjs/api/types/RecordDto.d.ts +1 -1
  30. package/dist/cjs/api/types/RecordState.d.ts +0 -1
  31. package/dist/cjs/api/types/RecordState.js +0 -1
  32. package/dist/cjs/api/types/SkillDto.d.ts +2 -0
  33. package/dist/cjs/api/types/SkillSummaryDto.d.ts +1 -0
  34. package/dist/cjs/api/types/StringSegment.d.ts +7 -0
  35. package/dist/cjs/api/types/StringSegment.js +3 -0
  36. package/dist/cjs/api/types/UpsertRecordDto.d.ts +1 -1
  37. package/dist/cjs/api/types/index.d.ts +2 -0
  38. package/dist/cjs/api/types/index.js +2 -0
  39. package/dist/cjs/version.d.ts +1 -1
  40. package/dist/cjs/version.js +1 -1
  41. package/dist/esm/BaseClient.mjs +2 -2
  42. package/dist/esm/api/resources/labels/client/Client.d.mts +2 -2
  43. package/dist/esm/api/resources/labels/client/Client.mjs +2 -2
  44. package/dist/esm/api/resources/labels/client/requests/UpdateLabelCommand.d.mts +2 -1
  45. package/dist/esm/api/resources/minis/client/Client.d.mts +8 -1
  46. package/dist/esm/api/resources/minis/client/Client.mjs +44 -1
  47. package/dist/esm/api/resources/minis/client/requests/SearchMinisFullTextQuery.d.mts +1 -1
  48. package/dist/esm/api/resources/records/client/Client.d.mts +27 -9
  49. package/dist/esm/api/resources/records/client/Client.mjs +108 -31
  50. package/dist/esm/api/resources/records/client/requests/ExportRecordsForMinisQuery.d.mts +14 -0
  51. package/dist/esm/api/resources/records/client/requests/ExportRecordsForMinisQuery.mjs +2 -0
  52. package/dist/esm/api/resources/records/client/requests/ExportRecordsRequest.d.mts +1 -2
  53. package/dist/esm/api/resources/records/client/requests/GetRecordsRequest.d.mts +1 -2
  54. package/dist/esm/api/resources/records/client/requests/SearchRecordsFullTextQuery.d.mts +1 -1
  55. package/dist/esm/api/resources/records/client/requests/index.d.mts +1 -0
  56. package/dist/esm/api/resources/skills/client/Client.d.mts +7 -0
  57. package/dist/esm/api/resources/skills/client/Client.mjs +43 -0
  58. package/dist/esm/api/types/CursorPaginatedListOfMiniVersionDto.d.mts +1 -1
  59. package/dist/esm/api/types/CursorPaginatedListOfRecordDto.d.mts +1 -1
  60. package/dist/esm/api/types/CursorPaginatedListOfRecordVersionDto.d.mts +1 -1
  61. package/dist/esm/api/types/HttpValidationProblemDetails.d.mts +1 -1
  62. package/dist/esm/api/types/IdentityKind.d.mts +1 -0
  63. package/dist/esm/api/types/IdentityKind.mjs +1 -0
  64. package/dist/esm/api/types/LabelDto.d.mts +1 -0
  65. package/dist/esm/api/types/LabelRenameStateDto.d.mts +3 -0
  66. package/dist/esm/api/types/LabelRenameStateDto.mjs +2 -0
  67. package/dist/esm/api/types/RecordAttachmentDto.d.mts +0 -1
  68. package/dist/esm/api/types/RecordDto.d.mts +1 -1
  69. package/dist/esm/api/types/RecordState.d.mts +0 -1
  70. package/dist/esm/api/types/RecordState.mjs +0 -1
  71. package/dist/esm/api/types/SkillDto.d.mts +2 -0
  72. package/dist/esm/api/types/SkillSummaryDto.d.mts +1 -0
  73. package/dist/esm/api/types/StringSegment.d.mts +7 -0
  74. package/dist/esm/api/types/StringSegment.mjs +2 -0
  75. package/dist/esm/api/types/UpsertRecordDto.d.mts +1 -1
  76. package/dist/esm/api/types/index.d.mts +2 -0
  77. package/dist/esm/api/types/index.mjs +2 -0
  78. package/dist/esm/version.d.mts +1 -1
  79. package/dist/esm/version.mjs +1 -1
  80. package/package.json +1 -1
  81. package/reference.md +212 -5
package/README.md CHANGED
@@ -14,6 +14,7 @@ The Minikai TypeScript library provides convenient access to the Minikai APIs fr
14
14
  - [Request and Response Types](#request-and-response-types)
15
15
  - [Exception Handling](#exception-handling)
16
16
  - [File Uploads](#file-uploads)
17
+ - [Binary Response](#binary-response)
17
18
  - [Advanced](#advanced)
18
19
  - [Subpackage Exports](#subpackage-exports)
19
20
  - [Additional Headers](#additional-headers)
@@ -140,6 +141,395 @@ The metadata is used to set the `Content-Length`, `Content-Type`, and `Content-D
140
141
  For example, `fs.ReadStream` has a `path` property which the SDK uses to retrieve the file size from the filesystem without loading it into memory.
141
142
 
142
143
 
144
+ ## Binary Response
145
+
146
+ You can consume binary data from endpoints using the `BinaryResponse` type which lets you choose how to consume the data:
147
+
148
+ ```typescript
149
+ const response = await client.minis.downloadMiniProfilePicture(...);
150
+ const stream: ReadableStream<Uint8Array> = response.stream();
151
+ // const arrayBuffer: ArrayBuffer = await response.arrayBuffer();
152
+ // const blob: Blob = response.blob();
153
+ // const bytes: Uint8Array = response.bytes();
154
+ // You can only use the response body once, so you must choose one of the above methods.
155
+ // If you want to check if the response body has been used, you can use the following property.
156
+ const bodyUsed = response.bodyUsed;
157
+ ```
158
+ <details>
159
+ <summary>Save binary response to a file</summary>
160
+
161
+ <blockquote>
162
+ <details>
163
+ <summary>Node.js</summary>
164
+
165
+ <blockquote>
166
+ <details>
167
+ <summary>ReadableStream (most-efficient)</summary>
168
+
169
+ ```ts
170
+ import { createWriteStream } from 'fs';
171
+ import { Readable } from 'stream';
172
+ import { pipeline } from 'stream/promises';
173
+
174
+ const response = await client.minis.downloadMiniProfilePicture(...);
175
+
176
+ const stream = response.stream();
177
+ const nodeStream = Readable.fromWeb(stream);
178
+ const writeStream = createWriteStream('path/to/file');
179
+
180
+ await pipeline(nodeStream, writeStream);
181
+ ```
182
+
183
+ </details>
184
+ </blockquote>
185
+
186
+ <blockquote>
187
+ <details>
188
+ <summary>ArrayBuffer</summary>
189
+
190
+ ```ts
191
+ import { writeFile } from 'fs/promises';
192
+
193
+ const response = await client.minis.downloadMiniProfilePicture(...);
194
+
195
+ const arrayBuffer = await response.arrayBuffer();
196
+ await writeFile('path/to/file', Buffer.from(arrayBuffer));
197
+ ```
198
+
199
+ </details>
200
+ </blockquote>
201
+
202
+ <blockquote>
203
+ <details>
204
+ <summary>Blob</summary>
205
+
206
+ ```ts
207
+ import { writeFile } from 'fs/promises';
208
+
209
+ const response = await client.minis.downloadMiniProfilePicture(...);
210
+
211
+ const blob = await response.blob();
212
+ const arrayBuffer = await blob.arrayBuffer();
213
+ await writeFile('output.bin', Buffer.from(arrayBuffer));
214
+ ```
215
+
216
+ </details>
217
+ </blockquote>
218
+
219
+ <blockquote>
220
+ <details>
221
+ <summary>Bytes (UIntArray8)</summary>
222
+
223
+ ```ts
224
+ import { writeFile } from 'fs/promises';
225
+
226
+ const response = await client.minis.downloadMiniProfilePicture(...);
227
+
228
+ const bytes = await response.bytes();
229
+ await writeFile('path/to/file', bytes);
230
+ ```
231
+
232
+ </details>
233
+ </blockquote>
234
+
235
+ </details>
236
+ </blockquote>
237
+
238
+ <blockquote>
239
+ <details>
240
+ <summary>Bun</summary>
241
+
242
+ <blockquote>
243
+ <details>
244
+ <summary>ReadableStream (most-efficient)</summary>
245
+
246
+ ```ts
247
+ const response = await client.minis.downloadMiniProfilePicture(...);
248
+
249
+ const stream = response.stream();
250
+ await Bun.write('path/to/file', stream);
251
+ ```
252
+
253
+ </details>
254
+ </blockquote>
255
+
256
+ <blockquote>
257
+ <details>
258
+ <summary>ArrayBuffer</summary>
259
+
260
+ ```ts
261
+ const response = await client.minis.downloadMiniProfilePicture(...);
262
+
263
+ const arrayBuffer = await response.arrayBuffer();
264
+ await Bun.write('path/to/file', arrayBuffer);
265
+ ```
266
+
267
+ </details>
268
+ </blockquote>
269
+
270
+ <blockquote>
271
+ <details>
272
+ <summary>Blob</summary>
273
+
274
+ ```ts
275
+ const response = await client.minis.downloadMiniProfilePicture(...);
276
+
277
+ const blob = await response.blob();
278
+ await Bun.write('path/to/file', blob);
279
+ ```
280
+
281
+ </details>
282
+ </blockquote>
283
+
284
+ <blockquote>
285
+ <details>
286
+ <summary>Bytes (UIntArray8)</summary>
287
+
288
+ ```ts
289
+ const response = await client.minis.downloadMiniProfilePicture(...);
290
+
291
+ const bytes = await response.bytes();
292
+ await Bun.write('path/to/file', bytes);
293
+ ```
294
+
295
+ </details>
296
+ </blockquote>
297
+
298
+ </details>
299
+ </blockquote>
300
+
301
+ <blockquote>
302
+ <details>
303
+ <summary>Deno</summary>
304
+
305
+ <blockquote>
306
+ <details>
307
+ <summary>ReadableStream (most-efficient)</summary>
308
+
309
+ ```ts
310
+ const response = await client.minis.downloadMiniProfilePicture(...);
311
+
312
+ const stream = response.stream();
313
+ const file = await Deno.open('path/to/file', { write: true, create: true });
314
+ await stream.pipeTo(file.writable);
315
+ ```
316
+
317
+ </details>
318
+ </blockquote>
319
+
320
+ <blockquote>
321
+ <details>
322
+ <summary>ArrayBuffer</summary>
323
+
324
+ ```ts
325
+ const response = await client.minis.downloadMiniProfilePicture(...);
326
+
327
+ const arrayBuffer = await response.arrayBuffer();
328
+ await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer));
329
+ ```
330
+
331
+ </details>
332
+ </blockquote>
333
+
334
+ <blockquote>
335
+ <details>
336
+ <summary>Blob</summary>
337
+
338
+ ```ts
339
+ const response = await client.minis.downloadMiniProfilePicture(...);
340
+
341
+ const blob = await response.blob();
342
+ const arrayBuffer = await blob.arrayBuffer();
343
+ await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer));
344
+ ```
345
+
346
+ </details>
347
+ </blockquote>
348
+
349
+ <blockquote>
350
+ <details>
351
+ <summary>Bytes (UIntArray8)</summary>
352
+
353
+ ```ts
354
+ const response = await client.minis.downloadMiniProfilePicture(...);
355
+
356
+ const bytes = await response.bytes();
357
+ await Deno.writeFile('path/to/file', bytes);
358
+ ```
359
+
360
+ </details>
361
+ </blockquote>
362
+
363
+ </details>
364
+ </blockquote>
365
+
366
+ <blockquote>
367
+ <details>
368
+ <summary>Browser</summary>
369
+
370
+ <blockquote>
371
+ <details>
372
+ <summary>Blob (most-efficient)</summary>
373
+
374
+ ```ts
375
+ const response = await client.minis.downloadMiniProfilePicture(...);
376
+
377
+ const blob = await response.blob();
378
+ const url = URL.createObjectURL(blob);
379
+
380
+ // trigger download
381
+ const a = document.createElement('a');
382
+ a.href = url;
383
+ a.download = 'filename';
384
+ a.click();
385
+ URL.revokeObjectURL(url);
386
+ ```
387
+
388
+ </details>
389
+ </blockquote>
390
+
391
+ <blockquote>
392
+ <details>
393
+ <summary>ReadableStream</summary>
394
+
395
+ ```ts
396
+ const response = await client.minis.downloadMiniProfilePicture(...);
397
+
398
+ const stream = response.stream();
399
+ const reader = stream.getReader();
400
+ const chunks = [];
401
+
402
+ while (true) {
403
+ const { done, value } = await reader.read();
404
+ if (done) break;
405
+ chunks.push(value);
406
+ }
407
+
408
+ const blob = new Blob(chunks);
409
+ const url = URL.createObjectURL(blob);
410
+
411
+ // trigger download
412
+ const a = document.createElement('a');
413
+ a.href = url;
414
+ a.download = 'filename';
415
+ a.click();
416
+ URL.revokeObjectURL(url);
417
+ ```
418
+
419
+ </details>
420
+ </blockquote>
421
+
422
+ <blockquote>
423
+ <details>
424
+ <summary>ArrayBuffer</summary>
425
+
426
+ ```ts
427
+ const response = await client.minis.downloadMiniProfilePicture(...);
428
+
429
+ const arrayBuffer = await response.arrayBuffer();
430
+ const blob = new Blob([arrayBuffer]);
431
+ const url = URL.createObjectURL(blob);
432
+
433
+ // trigger download
434
+ const a = document.createElement('a');
435
+ a.href = url;
436
+ a.download = 'filename';
437
+ a.click();
438
+ URL.revokeObjectURL(url);
439
+ ```
440
+
441
+ </details>
442
+ </blockquote>
443
+
444
+ <blockquote>
445
+ <details>
446
+ <summary>Bytes (UIntArray8)</summary>
447
+
448
+ ```ts
449
+ const response = await client.minis.downloadMiniProfilePicture(...);
450
+
451
+ const bytes = await response.bytes();
452
+ const blob = new Blob([bytes]);
453
+ const url = URL.createObjectURL(blob);
454
+
455
+ // trigger download
456
+ const a = document.createElement('a');
457
+ a.href = url;
458
+ a.download = 'filename';
459
+ a.click();
460
+ URL.revokeObjectURL(url);
461
+ ```
462
+
463
+ </details>
464
+ </blockquote>
465
+
466
+ </details>
467
+ </blockquote>
468
+
469
+ </details>
470
+ </blockquote>
471
+
472
+ <details>
473
+ <summary>Convert binary response to text</summary>
474
+
475
+ <blockquote>
476
+ <details>
477
+ <summary>ReadableStream</summary>
478
+
479
+ ```ts
480
+ const response = await client.minis.downloadMiniProfilePicture(...);
481
+
482
+ const stream = response.stream();
483
+ const text = await new Response(stream).text();
484
+ ```
485
+
486
+ </details>
487
+ </blockquote>
488
+
489
+ <blockquote>
490
+ <details>
491
+ <summary>ArrayBuffer</summary>
492
+
493
+ ```ts
494
+ const response = await client.minis.downloadMiniProfilePicture(...);
495
+
496
+ const arrayBuffer = await response.arrayBuffer();
497
+ const text = new TextDecoder().decode(arrayBuffer);
498
+ ```
499
+
500
+ </details>
501
+ </blockquote>
502
+
503
+ <blockquote>
504
+ <details>
505
+ <summary>Blob</summary>
506
+
507
+ ```ts
508
+ const response = await client.minis.downloadMiniProfilePicture(...);
509
+
510
+ const blob = await response.blob();
511
+ const text = await blob.text();
512
+ ```
513
+
514
+ </details>
515
+ </blockquote>
516
+
517
+ <blockquote>
518
+ <details>
519
+ <summary>Bytes (UIntArray8)</summary>
520
+
521
+ ```ts
522
+ const response = await client.minis.downloadMiniProfilePicture(...);
523
+
524
+ const bytes = await response.bytes();
525
+ const text = new TextDecoder().decode(bytes);
526
+ ```
527
+
528
+ </details>
529
+ </blockquote>
530
+
531
+ </details>
532
+
143
533
  ## Advanced
144
534
 
145
535
  ### Subpackage Exports
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "minikai",
46
- "X-Fern-SDK-Version": "1.8.0",
47
- "User-Agent": "minikai/1.8.0",
46
+ "X-Fern-SDK-Version": "1.18.0",
47
+ "User-Agent": "minikai/1.18.0",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -40,7 +40,7 @@ export declare class LabelsClient {
40
40
  createLabel(request: Minikai.CreateLabelCommand, requestOptions?: LabelsClient.RequestOptions): core.HttpResponsePromise<Minikai.LabelDto>;
41
41
  private __createLabel;
42
42
  /**
43
- * Update a label.
43
+ * Update a label. Records and Minis reference labels by name, so changing the name moves them onto the new one in the background: the response carries a rename state that clears once they have all moved, and further edits are refused until then.
44
44
  *
45
45
  * @param {string} id
46
46
  * @param {Minikai.UpdateLabelCommand} request
@@ -57,7 +57,7 @@ export declare class LabelsClient {
57
57
  updateLabel(id: string, request: Minikai.UpdateLabelCommand, requestOptions?: LabelsClient.RequestOptions): core.HttpResponsePromise<Minikai.LabelDto>;
58
58
  private __updateLabel;
59
59
  /**
60
- * Delete a label.
60
+ * Delete a label. Refused with a 409 while any record or Mini still carries it, naming how many. Remove it from them first.
61
61
  *
62
62
  * @param {string} id
63
63
  * @param {LabelsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -166,7 +166,7 @@ class LabelsClient {
166
166
  });
167
167
  }
168
168
  /**
169
- * Update a label.
169
+ * Update a label. Records and Minis reference labels by name, so changing the name moves them onto the new one in the background: the response carries a rename state that clears once they have all moved, and further edits are refused until then.
170
170
  *
171
171
  * @param {string} id
172
172
  * @param {Minikai.UpdateLabelCommand} request
@@ -223,7 +223,7 @@ class LabelsClient {
223
223
  });
224
224
  }
225
225
  /**
226
- * Delete a label.
226
+ * Delete a label. Refused with a 409 while any record or Mini still carries it, naming how many. Remove it from them first.
227
227
  *
228
228
  * @param {string} id
229
229
  * @param {LabelsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -1,3 +1,4 @@
1
+ import type * as Minikai from "../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -10,6 +11,6 @@ export interface UpdateLabelCommand {
10
11
  description?: string | null;
11
12
  colour?: string | null;
12
13
  icon?: string | null;
13
- resourceType?: string | null;
14
+ resourceType?: Minikai.LabelResourceType | null;
14
15
  labelGroupId?: string | null;
15
16
  }
@@ -176,7 +176,7 @@ export declare class MinisClient {
176
176
  * Retrieve a single version of a Mini.
177
177
  *
178
178
  * @param {string} id - Either the Minikai-assigned Guid for this resource (e.g. `abc12345-1234-1234-1234-123456789abc`) or the resource's `externalUri`, URL-encoded (e.g. `https%3A%2F%2Fpartner.example.com%2Fpatients%2F48291`). Responses always return the canonical Guid in the `id` field.
179
- * @param {string} versionId - Either the Minikai-assigned Guid for this resource (e.g. `abc12345-1234-1234-1234-123456789abc`) or the resource's `externalUri`, URL-encoded (e.g. `https%3A%2F%2Fpartner.example.com%2Fpatients%2F48291`). Responses always return the canonical Guid in the `id` field.
179
+ * @param {string} versionId
180
180
  * @param {MinisClient.RequestOptions} requestOptions - Request-specific configuration.
181
181
  *
182
182
  * @throws {@link Minikai.NotFoundError}
@@ -217,4 +217,11 @@ export declare class MinisClient {
217
217
  */
218
218
  deleteMiniProfilePicture(id: string, requestOptions?: MinisClient.RequestOptions): core.HttpResponsePromise<void>;
219
219
  private __deleteMiniProfilePicture;
220
+ /**
221
+ * Download a Mini's profile picture by its stored picture id.
222
+ *
223
+ * @throws {@link Minikai.NotFoundError}
224
+ */
225
+ downloadMiniProfilePicture(id: string, pictureId: string, requestOptions?: MinisClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
226
+ private __downloadMiniProfilePicture;
220
227
  }
@@ -656,7 +656,7 @@ class MinisClient {
656
656
  * Retrieve a single version of a Mini.
657
657
  *
658
658
  * @param {string} id - Either the Minikai-assigned Guid for this resource (e.g. `abc12345-1234-1234-1234-123456789abc`) or the resource's `externalUri`, URL-encoded (e.g. `https%3A%2F%2Fpartner.example.com%2Fpatients%2F48291`). Responses always return the canonical Guid in the `id` field.
659
- * @param {string} versionId - Either the Minikai-assigned Guid for this resource (e.g. `abc12345-1234-1234-1234-123456789abc`) or the resource's `externalUri`, URL-encoded (e.g. `https%3A%2F%2Fpartner.example.com%2Fpatients%2F48291`). Responses always return the canonical Guid in the `id` field.
659
+ * @param {string} versionId
660
660
  * @param {MinisClient.RequestOptions} requestOptions - Request-specific configuration.
661
661
  *
662
662
  * @throws {@link Minikai.NotFoundError}
@@ -810,5 +810,48 @@ class MinisClient {
810
810
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/api/v1/Minis/{id}/profile-picture");
811
811
  });
812
812
  }
813
+ /**
814
+ * Download a Mini's profile picture by its stored picture id.
815
+ *
816
+ * @throws {@link Minikai.NotFoundError}
817
+ */
818
+ downloadMiniProfilePicture(id, pictureId, requestOptions) {
819
+ return core.HttpResponsePromise.fromPromise(this.__downloadMiniProfilePicture(id, pictureId, requestOptions));
820
+ }
821
+ __downloadMiniProfilePicture(id, pictureId, requestOptions) {
822
+ return __awaiter(this, void 0, void 0, function* () {
823
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
824
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
825
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
826
+ const _response = yield core.fetcher({
827
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MinikaiEnvironment.Default, `api/v1/Minis/${core.url.encodePathParam(id)}/profile-picture/${core.url.encodePathParam(pictureId)}`),
828
+ method: "GET",
829
+ headers: _headers,
830
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
831
+ responseType: "binary-response",
832
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
833
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
834
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
835
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
836
+ logging: this._options.logging,
837
+ });
838
+ if (_response.ok) {
839
+ return { data: _response.body, rawResponse: _response.rawResponse };
840
+ }
841
+ if (_response.error.reason === "status-code") {
842
+ switch (_response.error.statusCode) {
843
+ case 404:
844
+ throw new Minikai.NotFoundError(_response.error.body, _response.rawResponse);
845
+ default:
846
+ throw new errors.MinikaiError({
847
+ statusCode: _response.error.statusCode,
848
+ body: _response.error.body,
849
+ rawResponse: _response.rawResponse,
850
+ });
851
+ }
852
+ }
853
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/api/v1/Minis/{id}/profile-picture/{pictureId}");
854
+ });
855
+ }
813
856
  }
814
857
  exports.MinisClient = MinisClient;
@@ -6,7 +6,7 @@ import type * as Minikai from "../../../../index.js";
6
6
  export interface SearchMinisFullTextQuery {
7
7
  text?: string;
8
8
  labels?: string[] | null;
9
- agentType?: string | null;
9
+ agentType?: Minikai.AgentType | null;
10
10
  cursor?: string | null;
11
11
  limit?: unknown;
12
12
  sort?: Minikai.SearchSort;
@@ -37,7 +37,9 @@ export declare class RecordsClient {
37
37
  createRecord(request?: Minikai.CreateRecordCommand, requestOptions?: RecordsClient.RequestOptions): core.HttpResponsePromise<string>;
38
38
  private __createRecord;
39
39
  /**
40
- * Export a Mini's Records as a CSV file.
40
+ * @deprecated
41
+ *
42
+ * Deprecated. Export a single Mini's Records as a CSV file. Use POST /api/v1/Records/export, which exports one or more Minis in a single file.
41
43
  *
42
44
  * @param {Minikai.ExportRecordsRequest} request
43
45
  * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -49,6 +51,21 @@ export declare class RecordsClient {
49
51
  */
50
52
  exportRecords(request: Minikai.ExportRecordsRequest, requestOptions?: RecordsClient.RequestOptions): core.HttpResponsePromise<void>;
51
53
  private __exportRecords;
54
+ /**
55
+ * Export Records across one or more Minis as a single CSV file, with a Mini Name column identifying the person on each row. Pass one Mini id to export a single Mini. Mini ids outside your organisation or access are omitted.
56
+ *
57
+ * @param {Minikai.ExportRecordsForMinisQuery} request
58
+ * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
59
+ *
60
+ * @throws {@link Minikai.BadRequestError}
61
+ *
62
+ * @example
63
+ * await client.records.exportRecordsForMinis({
64
+ * miniIds: ["miniIds"]
65
+ * })
66
+ */
67
+ exportRecordsForMinis(request: Minikai.ExportRecordsForMinisQuery, requestOptions?: RecordsClient.RequestOptions): core.HttpResponsePromise<void>;
68
+ private __exportRecordsForMinis;
52
69
  /**
53
70
  * Full-text search across a Mini's Records.
54
71
  *
@@ -356,16 +373,9 @@ export declare class RecordsClient {
356
373
  /**
357
374
  * Download a Record's attachment.
358
375
  *
359
- * @param {string} recordId - Either the Minikai-assigned Guid for this resource (e.g. `abc12345-1234-1234-1234-123456789abc`) or the resource's `externalUri`, URL-encoded (e.g. `https%3A%2F%2Fpartner.example.com%2Fpatients%2F48291`). Responses always return the canonical Guid in the `id` field.
360
- * @param {string} attachmentId
361
- * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
362
- *
363
376
  * @throws {@link Minikai.NotFoundError}
364
- *
365
- * @example
366
- * await client.records.downloadAttachment("recordId", "attachmentId")
367
377
  */
368
- downloadAttachment(recordId: string, attachmentId: string, requestOptions?: RecordsClient.RequestOptions): core.HttpResponsePromise<void>;
378
+ downloadAttachment(recordId: string, attachmentId: string, requestOptions?: RecordsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
369
379
  private __downloadAttachment;
370
380
  /**
371
381
  * Link a Record to other Records.
@@ -421,6 +431,8 @@ export declare class RecordsClient {
421
431
  * @param {Minikai.GetLabelsRequest} request
422
432
  * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
423
433
  *
434
+ * @throws {@link Minikai.BadRequestError}
435
+ *
424
436
  * @example
425
437
  * await client.records.getLabels({
426
438
  * miniId: "miniId"
@@ -434,6 +446,8 @@ export declare class RecordsClient {
434
446
  * @param {Minikai.GetCreatedByRequest} request
435
447
  * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
436
448
  *
449
+ * @throws {@link Minikai.BadRequestError}
450
+ *
437
451
  * @example
438
452
  * await client.records.getCreatedBy({
439
453
  * miniId: "miniId"
@@ -447,6 +461,8 @@ export declare class RecordsClient {
447
461
  * @param {Minikai.GetUpdatedByRequest} request
448
462
  * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
449
463
  *
464
+ * @throws {@link Minikai.BadRequestError}
465
+ *
450
466
  * @example
451
467
  * await client.records.getUpdatedBy({
452
468
  * miniId: "miniId"
@@ -460,6 +476,8 @@ export declare class RecordsClient {
460
476
  * @param {Minikai.GetStatesRequest} request
461
477
  * @param {RecordsClient.RequestOptions} requestOptions - Request-specific configuration.
462
478
  *
479
+ * @throws {@link Minikai.BadRequestError}
480
+ *
463
481
  * @example
464
482
  * await client.records.getStates({
465
483
  * miniId: "miniId"