diff --git a/.fern/metadata.json b/.fern/metadata.json index 0c216a00f..03717472a 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "3.35.1", + "cliVersion": "4.65.1", "generatorName": "fernapi/fern-typescript-sdk", - "generatorVersion": "3.43.1", + "generatorVersion": "3.51.3", "generatorConfig": { "namespaceExport": "Vital", "inlineFileProperties": false, @@ -11,5 +11,6 @@ "omitUndefined": false, "skipResponseValidation": false }, - "sdkVersion": "3.1.551" + "originGitCommit": "93b118c09288b028a3a9676ad6adfbbcb23a7f8c", + "sdkVersion": "4.0.0" } diff --git a/.fernignore b/.fernignore index 43ca0d22b..07281cd76 100644 --- a/.fernignore +++ b/.fernignore @@ -1,3 +1,4 @@ # Specify files that shouldn't be modified by Fern README.md +changelog.md diff --git a/biome.json b/biome.json index a777468e4..5084b70a9 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.3.1/schema.json", + "$schema": "https://biomejs.dev/schemas/2.4.3/schema.json", "root": true, "vcs": { "enabled": false diff --git a/changelog.md b/changelog.md new file mode 100644 index 000000000..bccc37555 --- /dev/null +++ b/changelog.md @@ -0,0 +1,22 @@ +## 4.0.0 - 2026-04-09 +* Several breaking changes have been made to the Link bulk operation request types and enum values: +* The `teamId` optional property has been removed from `BulkExportConnectionsBody`, `BulkImportConnectionsBody`, `BulkPauseConnectionsBody`, and `BulkTriggerHistoricalPullBody`. Remove any usage of this field from your request objects. +* The exported enum types `LinkBulkExportRequestTeamId`, `LinkBulkImportRequestTeamId`, `LinkBulkPauseRequestTeamId`, `LinkBulkTriggerHistoricalPullRequestTeamId`, and `LinkListBulkOpsRequestTeamId` have been deleted. Remove any imports or references to these types. +* The `insulin_injection` value has been removed from the `IntervalTimeseriesExprTimeseries` enum. Update any code that references `IntervalTimeseriesExprTimeseries.InsulinInjection`. +* New enum values have also been added: `sonora_quest` is now available in `AppointmentPscLabs`, `AppointmentProvider`, and `ClientFacingLabs`; `apero` and `pverify` have been added to `PayorCodeExternalProvider`; and `derived_readiness` has been added to `IndexColumnExprIndex`. +* The `labReport.parserCreateJob` method now accepts an **array** of files (`core.file.Uploadable[]`) instead of a single file, allowing multiple files to be uploaded in one parse job. Callers must wrap existing single-file arguments in an array (e.g., `parserCreateJob([file], request)`). +* Three new resource namespaces are now available on the SDK client: `compendium`, `labAccount`, and `orderTransaction`. +* The `bookPscAppointment` method on `LabTestsClient` now accepts a `LabTestsBookPscAppointmentRequest` instead of `AppointmentBookingRequest`. The booking payload should be passed under the `body` key of the new request object, and the new object also supports optional `idempotencyKey` and `idempotencyError` fields for idempotency header control. Additionally, new optional fields have been added: `clinicalNotes` on `CreateOrderRequestCompatible`, `orderTransactionId` on the get-orders request, `allowStale` on the PSC appointment availability request, and `labSlug` on the get-markers request. +* The `teamId` field has been removed from `LinkListBulkOpsRequest`, `BulkImportConnectionsBody`, `BulkTriggerHistoricalPullBody`, `BulkExportConnectionsBody`, and `BulkPauseConnectionsBody` — remove any `teamId` property from calls to `listBulkOps`, `bulkImport`, `bulkTriggerHistoricalPull`, `bulkExport`, and `bulkPause`. The `address` field in `UserInfoCreateRequest` now requires type `Vital.UserAddress` instead of `Vital.Address` — update any code passing an `address` to that request type accordingly. The `connectManualProvider` method now reads `vitalIosSdkVersion` and `vitalAndroidSdkVersion` from the request object and sends them as HTTP headers rather than body fields. +* Several breaking type changes have been introduced in this release: +* **`ParsingJob.jobId`** (required `string`) has been **removed**. Update any code reading this field; the new optional `failureReason` field is available for error context. +* **`ResultMetadata`** fields `patientFirstName`, `patientLastName`, `dob`, and `labName` changed from **required to optional**. Existing code that treats these as always-present will need null-guard updates. A new optional `gender` field has also been added. +* **`UserInfo.address`** type changed from `Vital.Address` to `Vital.UserAddress`. Update type annotations accordingly. +* Several boolean fields have been narrowed to literal types (`true`/`false`): `ClientFacingActivity.wheelchairUse`, `ClientFacingProfile.wheelchairUse`, `HistoricalPullCompleted.isFinal`, `Placeholder.placeholder`, `UserRefreshSuccessResponse.success`, and `UserRefreshErrorResponse.success`. Code relying on these as `boolean` may require type annotation updates. +* New additions include optional `deliveryMode`, `deliveryForm`, and `bolusPurpose` fields on `ClientFacingInsulinInjectionSample`; new `OrderStatus` and `OrderLowLevelStatus` enum values for corrected results and lab processing blocks; new labs (`sonora_quest`, `crl`); and new providers (`samsung_health`, `tandem_source`). +* Three new resource clients are now available on `VitalClient`: `compendium` (with `search()` and `convert()` methods), `labAccount` (with `getTeamLabAccounts()`), and `orderTransaction`. Several existing types have been updated: `ResultMetadata` fields `patientFirstName`, `patientLastName`, `dob`, and `labName` are now optional (previously required), and `UserRefreshSuccessResponse.success` / `UserRefreshErrorResponse.success` have been narrowed to boolean literals `true` / `false` respectively — callers relying on `success: boolean` may need type updates. `UserInfo` now uses `UserAddress` instead of `Address` for the `address` field. +* The SDK now includes a new `OrderTransactionClient` (accessible via `client.orderTransaction`) with methods to retrieve order transactions (`getTransaction`), raw lab results (`getTransactionResult`), and PDF results (`getTransactionResultPdf`). New types and enum values have been added across the board, including insulin injection timeseries support, lab account management types (`ClientFacingLabAccount`, `LabAccountStatus`, `LabAccountDelegatedFlow`), order transaction status tracking, and expanded enums for `AppointmentProvider`, `Labs`, `ManualProviders`, and device source types. Several existing types have been extended with new optional fields such as `ClientFacingOrder.lastEvent`, `ClientFacingOrder.origin`, `ClientFacingSleep.recoveryReadinessScore`, and appointment booking/reschedule notes. +* The SDK now supports compendium search and conversion with new `SearchCompendiumResponse`, `ConvertCompendiumResponse`, `CanonicalCandidate`, `PerLabCandidate`, and `RelatedCandidate` types. New providers `TandemSource` and `SamsungHealth` have been added, along with `Apero` and `Pverify` for `PayorCodeExternalProvider`. Several address types now include an optional `accessNotes` field, new query expression variants (`DerivedReadinessColumnExpr`, `AwakeningsValueMacroExpr`, `InsulinInjectionTimeseriesExpr`) are available in `QuerySelectItem` and `QueryGroupByItem`, and appointment and order types have been expanded with additional optional fields and new event types. +* The SDK now supports insulin pump as a source type across ECG, menstrual cycle, and sleep cycle data. New optional fields have been added to `ClientFacingInsulinInjectionSample` (`deliveryMode`, `deliveryForm`, `bolusPurpose`), `ClientFacingOrder` (`clinicalNotes`, `lastEvent`, `origin`, `orderTransaction`), `ClientFacingOrderEvent` (`statusDetail`), and `ClientFacingSleep` (`recoveryReadinessScore`). New types are available for order transactions (`ClientFacingOrderTransaction`, `GetOrderTransactionResponse`), lab accounts (`ClientFacingLabAccount`, `GetTeamLabAccountsResponse`), lab report parsing job events, and compendium conversion responses. +* The SDK now supports lab compendium search with new types (`SearchCompendiumResponse`, `SearchMode`, `PerLabCandidate`, `RelatedCandidate`, `ProviderIdConversionResponse`) and order transaction tracking (`ClientFacingOrderTransaction`, `GetOrderTransactionResponse`, `OrderTransactionStatus`). New providers `tandem_source` and `samsung_health` are available in the `Providers` enum, address types now include an optional `accessNotes` field, and new query expression types (`DerivedReadinessColumnExpr`, `AwakeningsValueMacroExpr`, `InsulinInjectionTimeseriesExpr`) are supported in select and group-by queries. + diff --git a/package.json b/package.json index 55020f023..cb91150ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tryvital/vital-node", - "version": "3.1.551", + "version": "4.0.0", "private": false, "repository": { "type": "git", @@ -65,13 +65,14 @@ "msw": "2.11.2", "@types/node": "^18.19.70", "typescript": "~5.7.2", - "@biomejs/biome": "2.3.1" + "@biomejs/biome": "2.4.3" }, "browser": { "fs": false, "os": false, "path": false, - "stream": false + "stream": false, + "crypto": false }, "packageManager": "pnpm@10.20.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7120f014f..6c717191a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: devDependencies: '@biomejs/biome': - specifier: 2.3.1 - version: 2.3.1 + specifier: 2.4.3 + version: 2.4.3 '@types/node': specifier: ^18.19.70 version: 18.19.130 @@ -19,68 +19,68 @@ importers: version: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) ts-loader: specifier: ^9.5.1 - version: 9.5.4(typescript@5.7.3)(webpack@5.104.1) + version: 9.5.4(typescript@5.7.3)(webpack@5.105.2) typescript: specifier: ~5.7.2 version: 5.7.3 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.44.1) + version: 3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.0) webpack: specifier: ^5.97.1 - version: 5.104.1 + version: 5.105.2 packages: - '@biomejs/biome@2.3.1': - resolution: {integrity: sha512-A29evf1R72V5bo4o2EPxYMm5mtyGvzp2g+biZvRFx29nWebGyyeOSsDWGx3tuNNMFRepGwxmA9ZQ15mzfabK2w==} + '@biomejs/biome@2.4.3': + resolution: {integrity: sha512-cBrjf6PNF6yfL8+kcNl85AjiK2YHNsbU0EvDOwiZjBPbMbQ5QcgVGFpjD0O52p8nec5O8NYw7PKw3xUR7fPAkQ==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@2.3.1': - resolution: {integrity: sha512-ombSf3MnTUueiYGN1SeI9tBCsDUhpWzOwS63Dove42osNh0PfE1cUtHFx6eZ1+MYCCLwXzlFlYFdrJ+U7h6LcA==} + '@biomejs/cli-darwin-arm64@2.4.3': + resolution: {integrity: sha512-eOafSFlI/CF4id2tlwq9CVHgeEqvTL5SrhWff6ZORp6S3NL65zdsR3ugybItkgF8Pf4D9GSgtbB6sE3UNgOM9w==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@2.3.1': - resolution: {integrity: sha512-pcOfwyoQkrkbGvXxRvZNe5qgD797IowpJPovPX5biPk2FwMEV+INZqfCaz4G5bVq9hYnjwhRMamg11U4QsRXrQ==} + '@biomejs/cli-darwin-x64@2.4.3': + resolution: {integrity: sha512-V2+av4ilbWcBMNufTtMMXVW00nPwyIjI5qf7n9wSvUaZ+tt0EvMGk46g9sAFDJBEDOzSyoRXiSP6pCvKTOEbPA==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@2.3.1': - resolution: {integrity: sha512-+DZYv8l7FlUtTrWs1Tdt1KcNCAmRO87PyOnxKGunbWm5HKg1oZBSbIIPkjrCtDZaeqSG1DiGx7qF+CPsquQRcg==} + '@biomejs/cli-linux-arm64-musl@2.4.3': + resolution: {integrity: sha512-QuFzvsGo8BA4Xm7jGX5idkw6BqFblcCPySMTvq0AhGYnhUej5VJIDJbmTKfHqwjHepZiC4fA+T5i6wmiZolZNw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@2.3.1': - resolution: {integrity: sha512-td5O8pFIgLs8H1sAZsD6v+5quODihyEw4nv2R8z7swUfIK1FKk+15e4eiYVLcAE4jUqngvh4j3JCNgg0Y4o4IQ==} + '@biomejs/cli-linux-arm64@2.4.3': + resolution: {integrity: sha512-0m+O0x9FgK99FAwDK+fiDtjs2wnqq7bvfj17KJVeCkTwT/liI+Q9njJG7lwXK0iSJVXeFNRIxukpVI3SifMYAA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@2.3.1': - resolution: {integrity: sha512-Y3Ob4nqgv38Mh+6EGHltuN+Cq8aj/gyMTJYzkFZV2AEj+9XzoXB9VNljz9pjfFNHUxvLEV4b55VWyxozQTBaUQ==} + '@biomejs/cli-linux-x64-musl@2.4.3': + resolution: {integrity: sha512-qEc0OCpj/uytruQ4wLM0yWNJLZy0Up8H1Er5MW3SrstqM6J2d4XqdNA86xzCy8MQCHpoVZ3lFye3GBlIL4/ljw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@2.3.1': - resolution: {integrity: sha512-PYWgEO7up7XYwSAArOpzsVCiqxBCXy53gsReAb1kKYIyXaoAlhBaBMvxR/k2Rm9aTuZ662locXUmPk/Aj+Xu+Q==} + '@biomejs/cli-linux-x64@2.4.3': + resolution: {integrity: sha512-NVqh0saIU0u5OfOp/0jFdlKRE59+XyMvWmtx0f6Nm/2OpdxBl04coRIftBbY9d1gfu+23JVv4CItAqPYrjYh5w==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@2.3.1': - resolution: {integrity: sha512-RHIG/zgo+69idUqVvV3n8+j58dKYABRpMyDmfWu2TITC+jwGPiEaT0Q3RKD+kQHiS80mpBrST0iUGeEXT0bU9A==} + '@biomejs/cli-win32-arm64@2.4.3': + resolution: {integrity: sha512-gRO96vrIARilv/Cp2ZnmNNL5LSZg3RO75GPp13hsLO3N4YVpE7saaMDp2bcyV48y2N2Pbit1brkGVGta0yd6VQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@2.3.1': - resolution: {integrity: sha512-izl30JJ5Dp10mi90Eko47zhxE6pYyWPcnX1NQxKpL/yMhXxf95oLTzfpu4q+MDBh/gemNqyJEwjBpe0MT5iWPA==} + '@biomejs/cli-win32-x64@2.4.3': + resolution: {integrity: sha512-vSm/vOJe06pf14aGHfHl3Ar91Nlx4YYmohElDJ+17UbRwe99n987S/MhAlQOkONqf1utJor04ChkCPmKb8SWdw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -91,158 +91,158 @@ packages: '@bundled-es-modules/statuses@1.0.1': resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} - '@esbuild/aix-ppc64@0.27.2': - resolution: {integrity: sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==} + '@esbuild/aix-ppc64@0.27.3': + resolution: {integrity: sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.27.2': - resolution: {integrity: sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==} + '@esbuild/android-arm64@0.27.3': + resolution: {integrity: sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.27.2': - resolution: {integrity: sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==} + '@esbuild/android-arm@0.27.3': + resolution: {integrity: sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.27.2': - resolution: {integrity: sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==} + '@esbuild/android-x64@0.27.3': + resolution: {integrity: sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.27.2': - resolution: {integrity: sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==} + '@esbuild/darwin-arm64@0.27.3': + resolution: {integrity: sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.27.2': - resolution: {integrity: sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==} + '@esbuild/darwin-x64@0.27.3': + resolution: {integrity: sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.27.2': - resolution: {integrity: sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==} + '@esbuild/freebsd-arm64@0.27.3': + resolution: {integrity: sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.27.2': - resolution: {integrity: sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==} + '@esbuild/freebsd-x64@0.27.3': + resolution: {integrity: sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.27.2': - resolution: {integrity: sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==} + '@esbuild/linux-arm64@0.27.3': + resolution: {integrity: sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.27.2': - resolution: {integrity: sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==} + '@esbuild/linux-arm@0.27.3': + resolution: {integrity: sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.27.2': - resolution: {integrity: sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==} + '@esbuild/linux-ia32@0.27.3': + resolution: {integrity: sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.27.2': - resolution: {integrity: sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==} + '@esbuild/linux-loong64@0.27.3': + resolution: {integrity: sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.27.2': - resolution: {integrity: sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==} + '@esbuild/linux-mips64el@0.27.3': + resolution: {integrity: sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.27.2': - resolution: {integrity: sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==} + '@esbuild/linux-ppc64@0.27.3': + resolution: {integrity: sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.27.2': - resolution: {integrity: sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==} + '@esbuild/linux-riscv64@0.27.3': + resolution: {integrity: sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.27.2': - resolution: {integrity: sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==} + '@esbuild/linux-s390x@0.27.3': + resolution: {integrity: sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.27.2': - resolution: {integrity: sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==} + '@esbuild/linux-x64@0.27.3': + resolution: {integrity: sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.27.2': - resolution: {integrity: sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==} + '@esbuild/netbsd-arm64@0.27.3': + resolution: {integrity: sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-x64@0.27.2': - resolution: {integrity: sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==} + '@esbuild/netbsd-x64@0.27.3': + resolution: {integrity: sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.27.2': - resolution: {integrity: sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==} + '@esbuild/openbsd-arm64@0.27.3': + resolution: {integrity: sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.27.2': - resolution: {integrity: sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==} + '@esbuild/openbsd-x64@0.27.3': + resolution: {integrity: sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/openharmony-arm64@0.27.2': - resolution: {integrity: sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==} + '@esbuild/openharmony-arm64@0.27.3': + resolution: {integrity: sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] - '@esbuild/sunos-x64@0.27.2': - resolution: {integrity: sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==} + '@esbuild/sunos-x64@0.27.3': + resolution: {integrity: sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.27.2': - resolution: {integrity: sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==} + '@esbuild/win32-arm64@0.27.3': + resolution: {integrity: sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.27.2': - resolution: {integrity: sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==} + '@esbuild/win32-ia32@0.27.3': + resolution: {integrity: sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.27.2': - resolution: {integrity: sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==} + '@esbuild/win32-x64@0.27.3': + resolution: {integrity: sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -311,113 +311,128 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@rollup/rollup-android-arm-eabi@4.54.0': - resolution: {integrity: sha512-OywsdRHrFvCdvsewAInDKCNyR3laPA2mc9bRYJ6LBp5IyvF3fvXbbNR0bSzHlZVFtn6E0xw2oZlyjg4rKCVcng==} + '@rollup/rollup-android-arm-eabi@4.59.0': + resolution: {integrity: sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.54.0': - resolution: {integrity: sha512-Skx39Uv+u7H224Af+bDgNinitlmHyQX1K/atIA32JP3JQw6hVODX5tkbi2zof/E69M1qH2UoN3Xdxgs90mmNYw==} + '@rollup/rollup-android-arm64@4.59.0': + resolution: {integrity: sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.54.0': - resolution: {integrity: sha512-k43D4qta/+6Fq+nCDhhv9yP2HdeKeP56QrUUTW7E6PhZP1US6NDqpJj4MY0jBHlJivVJD5P8NxrjuobZBJTCRw==} + '@rollup/rollup-darwin-arm64@4.59.0': + resolution: {integrity: sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.54.0': - resolution: {integrity: sha512-cOo7biqwkpawslEfox5Vs8/qj83M/aZCSSNIWpVzfU2CYHa2G3P1UN5WF01RdTHSgCkri7XOlTdtk17BezlV3A==} + '@rollup/rollup-darwin-x64@4.59.0': + resolution: {integrity: sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.54.0': - resolution: {integrity: sha512-miSvuFkmvFbgJ1BevMa4CPCFt5MPGw094knM64W9I0giUIMMmRYcGW/JWZDriaw/k1kOBtsWh1z6nIFV1vPNtA==} + '@rollup/rollup-freebsd-arm64@4.59.0': + resolution: {integrity: sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.54.0': - resolution: {integrity: sha512-KGXIs55+b/ZfZsq9aR026tmr/+7tq6VG6MsnrvF4H8VhwflTIuYh+LFUlIsRdQSgrgmtM3fVATzEAj4hBQlaqQ==} + '@rollup/rollup-freebsd-x64@4.59.0': + resolution: {integrity: sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.54.0': - resolution: {integrity: sha512-EHMUcDwhtdRGlXZsGSIuXSYwD5kOT9NVnx9sqzYiwAc91wfYOE1g1djOEDseZJKKqtHAHGwnGPQu3kytmfaXLQ==} + '@rollup/rollup-linux-arm-gnueabihf@4.59.0': + resolution: {integrity: sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.54.0': - resolution: {integrity: sha512-+pBrqEjaakN2ySv5RVrj/qLytYhPKEUwk+e3SFU5jTLHIcAtqh2rLrd/OkbNuHJpsBgxsD8ccJt5ga/SeG0JmA==} + '@rollup/rollup-linux-arm-musleabihf@4.59.0': + resolution: {integrity: sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.54.0': - resolution: {integrity: sha512-NSqc7rE9wuUaRBsBp5ckQ5CVz5aIRKCwsoa6WMF7G01sX3/qHUw/z4pv+D+ahL1EIKy6Enpcnz1RY8pf7bjwng==} + '@rollup/rollup-linux-arm64-gnu@4.59.0': + resolution: {integrity: sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.54.0': - resolution: {integrity: sha512-gr5vDbg3Bakga5kbdpqx81m2n9IX8M6gIMlQQIXiLTNeQW6CucvuInJ91EuCJ/JYvc+rcLLsDFcfAD1K7fMofg==} + '@rollup/rollup-linux-arm64-musl@4.59.0': + resolution: {integrity: sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loong64-gnu@4.54.0': - resolution: {integrity: sha512-gsrtB1NA3ZYj2vq0Rzkylo9ylCtW/PhpLEivlgWe0bpgtX5+9j9EZa0wtZiCjgu6zmSeZWyI/e2YRX1URozpIw==} + '@rollup/rollup-linux-loong64-gnu@4.59.0': + resolution: {integrity: sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.54.0': - resolution: {integrity: sha512-y3qNOfTBStmFNq+t4s7Tmc9hW2ENtPg8FeUD/VShI7rKxNW7O4fFeaYbMsd3tpFlIg1Q8IapFgy7Q9i2BqeBvA==} + '@rollup/rollup-linux-loong64-musl@4.59.0': + resolution: {integrity: sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-ppc64-gnu@4.59.0': + resolution: {integrity: sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-ppc64-musl@4.59.0': + resolution: {integrity: sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.54.0': - resolution: {integrity: sha512-89sepv7h2lIVPsFma8iwmccN7Yjjtgz0Rj/Ou6fEqg3HDhpCa+Et+YSufy27i6b0Wav69Qv4WBNl3Rs6pwhebQ==} + '@rollup/rollup-linux-riscv64-gnu@4.59.0': + resolution: {integrity: sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.54.0': - resolution: {integrity: sha512-ZcU77ieh0M2Q8Ur7D5X7KvK+UxbXeDHwiOt/CPSBTI1fBmeDMivW0dPkdqkT4rOgDjrDDBUed9x4EgraIKoR2A==} + '@rollup/rollup-linux-riscv64-musl@4.59.0': + resolution: {integrity: sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.54.0': - resolution: {integrity: sha512-2AdWy5RdDF5+4YfG/YesGDDtbyJlC9LHmL6rZw6FurBJ5n4vFGupsOBGfwMRjBYH7qRQowT8D/U4LoSvVwOhSQ==} + '@rollup/rollup-linux-s390x-gnu@4.59.0': + resolution: {integrity: sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.54.0': - resolution: {integrity: sha512-WGt5J8Ij/rvyqpFexxk3ffKqqbLf9AqrTBbWDk7ApGUzaIs6V+s2s84kAxklFwmMF/vBNGrVdYgbblCOFFezMQ==} + '@rollup/rollup-linux-x64-gnu@4.59.0': + resolution: {integrity: sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.54.0': - resolution: {integrity: sha512-JzQmb38ATzHjxlPHuTH6tE7ojnMKM2kYNzt44LO/jJi8BpceEC8QuXYA908n8r3CNuG/B3BV8VR3Hi1rYtmPiw==} + '@rollup/rollup-linux-x64-musl@4.59.0': + resolution: {integrity: sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==} cpu: [x64] os: [linux] - '@rollup/rollup-openharmony-arm64@4.54.0': - resolution: {integrity: sha512-huT3fd0iC7jigGh7n3q/+lfPcXxBi+om/Rs3yiFxjvSxbSB6aohDFXbWvlspaqjeOh+hx7DDHS+5Es5qRkWkZg==} + '@rollup/rollup-openbsd-x64@4.59.0': + resolution: {integrity: sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.59.0': + resolution: {integrity: sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.54.0': - resolution: {integrity: sha512-c2V0W1bsKIKfbLMBu/WGBz6Yci8nJ/ZJdheE0EwB73N3MvHYKiKGs3mVilX4Gs70eGeDaMqEob25Tw2Gb9Nqyw==} + '@rollup/rollup-win32-arm64-msvc@4.59.0': + resolution: {integrity: sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.54.0': - resolution: {integrity: sha512-woEHgqQqDCkAzrDhvDipnSirm5vxUXtSKDYTVpZG3nUdW/VVB5VdCYA2iReSj/u3yCZzXID4kuKG7OynPnB3WQ==} + '@rollup/rollup-win32-ia32-msvc@4.59.0': + resolution: {integrity: sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.54.0': - resolution: {integrity: sha512-dzAc53LOuFvHwbCEOS0rPbXp6SIhAf2txMP5p6mGyOXXw5mWY8NGGbPMPrs4P1WItkfApDathBj/NzMLUZ9rtQ==} + '@rollup/rollup-win32-x64-gnu@4.59.0': + resolution: {integrity: sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.54.0': - resolution: {integrity: sha512-hYT5d3YNdSh3mbCU1gwQyPgQd3T2ne0A3KG8KSBdav5TiBg6eInVmV+TeR5uHufiIgSFg0XsOWGW5/RhNcSvPg==} + '@rollup/rollup-win32-x64-msvc@4.59.0': + resolution: {integrity: sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==} cpu: [x64] os: [win32] @@ -534,8 +549,8 @@ packages: peerDependencies: acorn: ^8.14.0 - acorn@8.15.0: - resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} + acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} engines: {node: '>=0.4.0'} hasBin: true @@ -552,8 +567,8 @@ packages: peerDependencies: ajv: ^8.8.2 - ajv@8.17.1: - resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + ajv@8.18.0: + resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} @@ -567,8 +582,9 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - baseline-browser-mapping@2.9.11: - resolution: {integrity: sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ==} + baseline-browser-mapping@2.10.0: + resolution: {integrity: sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==} + engines: {node: '>=6.0.0'} hasBin: true braces@3.0.3: @@ -587,8 +603,8 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - caniuse-lite@1.0.30001761: - resolution: {integrity: sha512-JF9ptu1vP2coz98+5051jZ4PwQgd2ni8A+gYSN7EA7dPKIMf0pDlSUxhdmVOaV3/fYK5uWBkgSXJaRLr4+3A6g==} + caniuse-lite@1.0.30001774: + resolution: {integrity: sha512-DDdwPGz99nmIEv216hKSgLD+D4ikHQHjBC/seF98N9CPqRX4M5mSxT9eTV6oyisnJcuzxtZy4n17yKKQYmYQOA==} chai@5.3.3: resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} @@ -598,8 +614,8 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - check-error@2.1.1: - resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} + check-error@2.1.3: + resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} engines: {node: '>= 16'} chrome-trace-event@1.0.4: @@ -641,14 +657,14 @@ packages: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} - electron-to-chromium@1.5.267: - resolution: {integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==} + electron-to-chromium@1.5.302: + resolution: {integrity: sha512-sM6HAN2LyK82IyPBpznDRqlTQAtuSaO+ShzFiWTvoMJLHyZ+Y39r8VMfHzwbU8MVBzQ4Wdn85+wlZl2TLGIlwg==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - enhanced-resolve@5.18.4: - resolution: {integrity: sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==} + enhanced-resolve@5.19.0: + resolution: {integrity: sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==} engines: {node: '>=10.13.0'} es-module-lexer@1.7.0: @@ -657,8 +673,8 @@ packages: es-module-lexer@2.0.0: resolution: {integrity: sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==} - esbuild@0.27.2: - resolution: {integrity: sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==} + esbuild@0.27.3: + resolution: {integrity: sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==} engines: {node: '>=18'} hasBin: true @@ -727,8 +743,8 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - graphql@16.12.0: - resolution: {integrity: sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ==} + graphql@16.13.0: + resolution: {integrity: sha512-uSisMYERbaB9bkA9M4/4dnqyktaEkf1kMHNKq/7DHyxVeWqHQ2mBmVqm5u6/FVHwF3iCNalKcg82Zfl+tffWoA==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} has-flag@4.0.0: @@ -857,8 +873,8 @@ packages: rettime@0.7.0: resolution: {integrity: sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw==} - rollup@4.54.0: - resolution: {integrity: sha512-3nk8Y3a9Ea8szgKhinMlGMhGMw89mqule3KWczxhIzqudyHdCIOHw8WJlj/r329fACjKLEh13ZSk7oE22kyeIw==} + rollup@4.59.0: + resolution: {integrity: sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -869,8 +885,8 @@ packages: resolution: {integrity: sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==} engines: {node: '>= 10.13.0'} - semver@7.7.3: - resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} + semver@7.7.4: + resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} engines: {node: '>=10'} hasBin: true @@ -951,8 +967,8 @@ packages: uglify-js: optional: true - terser@5.44.1: - resolution: {integrity: sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==} + terser@5.46.0: + resolution: {integrity: sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==} engines: {node: '>=10'} hasBin: true @@ -978,11 +994,11 @@ packages: resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} - tldts-core@7.0.19: - resolution: {integrity: sha512-lJX2dEWx0SGH4O6p+7FPwYmJ/bu1JbcGJ8RLaG9b7liIgZ85itUVEPbMtWRVrde/0fnDPEPHW10ZsKW3kVsE9A==} + tldts-core@7.0.23: + resolution: {integrity: sha512-0g9vrtDQLrNIiCj22HSe9d4mLVG3g5ph5DZ8zCKBr4OtrspmNB6ss7hVyzArAeE88ceZocIEGkyW1Ime7fxPtQ==} - tldts@7.0.19: - resolution: {integrity: sha512-8PWx8tvC4jDB39BQw1m4x8y5MH1BcQ5xHeL2n7UVFulMPH/3Q0uiamahFJ3lXA0zO2SUyRXuVVbWSDmstlt9YA==} + tldts@7.0.23: + resolution: {integrity: sha512-ASdhgQIBSay0R/eXggAkQ53G4nTJqTXqC2kbaBbdDwM7SkjyZyO0OaaN1/FH7U/yCeqOHDwFO5j8+Os/IS1dXw==} hasBin: true to-regex-range@5.0.1: @@ -1023,8 +1039,8 @@ packages: engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true - vite@7.3.0: - resolution: {integrity: sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==} + vite@7.3.1: + resolution: {integrity: sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -1091,16 +1107,16 @@ packages: jsdom: optional: true - watchpack@2.4.4: - resolution: {integrity: sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==} + watchpack@2.5.1: + resolution: {integrity: sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==} engines: {node: '>=10.13.0'} - webpack-sources@3.3.3: - resolution: {integrity: sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==} + webpack-sources@3.3.4: + resolution: {integrity: sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q==} engines: {node: '>=10.13.0'} - webpack@5.104.1: - resolution: {integrity: sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA==} + webpack@5.105.2: + resolution: {integrity: sha512-dRXm0a2qcHPUBEzVk8uph0xWSjV/xZxenQQbLwnwP7caQCYpqG1qddwlyEkIDkYn0K8tvmcrZ+bOrzoQ3HxCDw==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -1140,39 +1156,39 @@ packages: snapshots: - '@biomejs/biome@2.3.1': + '@biomejs/biome@2.4.3': optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.3.1 - '@biomejs/cli-darwin-x64': 2.3.1 - '@biomejs/cli-linux-arm64': 2.3.1 - '@biomejs/cli-linux-arm64-musl': 2.3.1 - '@biomejs/cli-linux-x64': 2.3.1 - '@biomejs/cli-linux-x64-musl': 2.3.1 - '@biomejs/cli-win32-arm64': 2.3.1 - '@biomejs/cli-win32-x64': 2.3.1 - - '@biomejs/cli-darwin-arm64@2.3.1': + '@biomejs/cli-darwin-arm64': 2.4.3 + '@biomejs/cli-darwin-x64': 2.4.3 + '@biomejs/cli-linux-arm64': 2.4.3 + '@biomejs/cli-linux-arm64-musl': 2.4.3 + '@biomejs/cli-linux-x64': 2.4.3 + '@biomejs/cli-linux-x64-musl': 2.4.3 + '@biomejs/cli-win32-arm64': 2.4.3 + '@biomejs/cli-win32-x64': 2.4.3 + + '@biomejs/cli-darwin-arm64@2.4.3': optional: true - '@biomejs/cli-darwin-x64@2.3.1': + '@biomejs/cli-darwin-x64@2.4.3': optional: true - '@biomejs/cli-linux-arm64-musl@2.3.1': + '@biomejs/cli-linux-arm64-musl@2.4.3': optional: true - '@biomejs/cli-linux-arm64@2.3.1': + '@biomejs/cli-linux-arm64@2.4.3': optional: true - '@biomejs/cli-linux-x64-musl@2.3.1': + '@biomejs/cli-linux-x64-musl@2.4.3': optional: true - '@biomejs/cli-linux-x64@2.3.1': + '@biomejs/cli-linux-x64@2.4.3': optional: true - '@biomejs/cli-win32-arm64@2.3.1': + '@biomejs/cli-win32-arm64@2.4.3': optional: true - '@biomejs/cli-win32-x64@2.3.1': + '@biomejs/cli-win32-x64@2.4.3': optional: true '@bundled-es-modules/cookie@2.0.1': @@ -1183,82 +1199,82 @@ snapshots: dependencies: statuses: 2.0.2 - '@esbuild/aix-ppc64@0.27.2': + '@esbuild/aix-ppc64@0.27.3': optional: true - '@esbuild/android-arm64@0.27.2': + '@esbuild/android-arm64@0.27.3': optional: true - '@esbuild/android-arm@0.27.2': + '@esbuild/android-arm@0.27.3': optional: true - '@esbuild/android-x64@0.27.2': + '@esbuild/android-x64@0.27.3': optional: true - '@esbuild/darwin-arm64@0.27.2': + '@esbuild/darwin-arm64@0.27.3': optional: true - '@esbuild/darwin-x64@0.27.2': + '@esbuild/darwin-x64@0.27.3': optional: true - '@esbuild/freebsd-arm64@0.27.2': + '@esbuild/freebsd-arm64@0.27.3': optional: true - '@esbuild/freebsd-x64@0.27.2': + '@esbuild/freebsd-x64@0.27.3': optional: true - '@esbuild/linux-arm64@0.27.2': + '@esbuild/linux-arm64@0.27.3': optional: true - '@esbuild/linux-arm@0.27.2': + '@esbuild/linux-arm@0.27.3': optional: true - '@esbuild/linux-ia32@0.27.2': + '@esbuild/linux-ia32@0.27.3': optional: true - '@esbuild/linux-loong64@0.27.2': + '@esbuild/linux-loong64@0.27.3': optional: true - '@esbuild/linux-mips64el@0.27.2': + '@esbuild/linux-mips64el@0.27.3': optional: true - '@esbuild/linux-ppc64@0.27.2': + '@esbuild/linux-ppc64@0.27.3': optional: true - '@esbuild/linux-riscv64@0.27.2': + '@esbuild/linux-riscv64@0.27.3': optional: true - '@esbuild/linux-s390x@0.27.2': + '@esbuild/linux-s390x@0.27.3': optional: true - '@esbuild/linux-x64@0.27.2': + '@esbuild/linux-x64@0.27.3': optional: true - '@esbuild/netbsd-arm64@0.27.2': + '@esbuild/netbsd-arm64@0.27.3': optional: true - '@esbuild/netbsd-x64@0.27.2': + '@esbuild/netbsd-x64@0.27.3': optional: true - '@esbuild/openbsd-arm64@0.27.2': + '@esbuild/openbsd-arm64@0.27.3': optional: true - '@esbuild/openbsd-x64@0.27.2': + '@esbuild/openbsd-x64@0.27.3': optional: true - '@esbuild/openharmony-arm64@0.27.2': + '@esbuild/openharmony-arm64@0.27.3': optional: true - '@esbuild/sunos-x64@0.27.2': + '@esbuild/sunos-x64@0.27.3': optional: true - '@esbuild/win32-arm64@0.27.2': + '@esbuild/win32-arm64@0.27.3': optional: true - '@esbuild/win32-ia32@0.27.2': + '@esbuild/win32-ia32@0.27.3': optional: true - '@esbuild/win32-x64@0.27.2': + '@esbuild/win32-x64@0.27.3': optional: true '@inquirer/ansi@1.0.2': {} @@ -1326,70 +1342,79 @@ snapshots: '@open-draft/until@2.1.0': {} - '@rollup/rollup-android-arm-eabi@4.54.0': + '@rollup/rollup-android-arm-eabi@4.59.0': + optional: true + + '@rollup/rollup-android-arm64@4.59.0': + optional: true + + '@rollup/rollup-darwin-arm64@4.59.0': + optional: true + + '@rollup/rollup-darwin-x64@4.59.0': optional: true - '@rollup/rollup-android-arm64@4.54.0': + '@rollup/rollup-freebsd-arm64@4.59.0': optional: true - '@rollup/rollup-darwin-arm64@4.54.0': + '@rollup/rollup-freebsd-x64@4.59.0': optional: true - '@rollup/rollup-darwin-x64@4.54.0': + '@rollup/rollup-linux-arm-gnueabihf@4.59.0': optional: true - '@rollup/rollup-freebsd-arm64@4.54.0': + '@rollup/rollup-linux-arm-musleabihf@4.59.0': optional: true - '@rollup/rollup-freebsd-x64@4.54.0': + '@rollup/rollup-linux-arm64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.54.0': + '@rollup/rollup-linux-arm64-musl@4.59.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.54.0': + '@rollup/rollup-linux-loong64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.54.0': + '@rollup/rollup-linux-loong64-musl@4.59.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.54.0': + '@rollup/rollup-linux-ppc64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-loong64-gnu@4.54.0': + '@rollup/rollup-linux-ppc64-musl@4.59.0': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.54.0': + '@rollup/rollup-linux-riscv64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.54.0': + '@rollup/rollup-linux-riscv64-musl@4.59.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.54.0': + '@rollup/rollup-linux-s390x-gnu@4.59.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.54.0': + '@rollup/rollup-linux-x64-gnu@4.59.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.54.0': + '@rollup/rollup-linux-x64-musl@4.59.0': optional: true - '@rollup/rollup-linux-x64-musl@4.54.0': + '@rollup/rollup-openbsd-x64@4.59.0': optional: true - '@rollup/rollup-openharmony-arm64@4.54.0': + '@rollup/rollup-openharmony-arm64@4.59.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.54.0': + '@rollup/rollup-win32-arm64-msvc@4.59.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.54.0': + '@rollup/rollup-win32-ia32-msvc@4.59.0': optional: true - '@rollup/rollup-win32-x64-gnu@4.54.0': + '@rollup/rollup-win32-x64-gnu@4.59.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.54.0': + '@rollup/rollup-win32-x64-msvc@4.59.0': optional: true '@types/chai@5.2.3': @@ -1429,14 +1454,14 @@ snapshots: chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.0(@types/node@18.19.130)(terser@5.44.1))': + '@vitest/mocker@3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.1(@types/node@18.19.130)(terser@5.46.0))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: msw: 2.11.2(@types/node@18.19.130)(typescript@5.7.3) - vite: 7.3.0(@types/node@18.19.130)(terser@5.44.1) + vite: 7.3.1(@types/node@18.19.130)(terser@5.46.0) '@vitest/pretty-format@3.2.4': dependencies: @@ -1544,22 +1569,22 @@ snapshots: '@xtuc/long@4.2.2': {} - acorn-import-phases@1.0.4(acorn@8.15.0): + acorn-import-phases@1.0.4(acorn@8.16.0): dependencies: - acorn: 8.15.0 + acorn: 8.16.0 - acorn@8.15.0: {} + acorn@8.16.0: {} - ajv-formats@2.1.1(ajv@8.17.1): + ajv-formats@2.1.1(ajv@8.18.0): optionalDependencies: - ajv: 8.17.1 + ajv: 8.18.0 - ajv-keywords@5.1.0(ajv@8.17.1): + ajv-keywords@5.1.0(ajv@8.18.0): dependencies: - ajv: 8.17.1 + ajv: 8.18.0 fast-deep-equal: 3.1.3 - ajv@8.17.1: + ajv@8.18.0: dependencies: fast-deep-equal: 3.1.3 fast-uri: 3.1.0 @@ -1574,7 +1599,7 @@ snapshots: assertion-error@2.0.1: {} - baseline-browser-mapping@2.9.11: {} + baseline-browser-mapping@2.10.0: {} braces@3.0.3: dependencies: @@ -1582,9 +1607,9 @@ snapshots: browserslist@4.28.1: dependencies: - baseline-browser-mapping: 2.9.11 - caniuse-lite: 1.0.30001761 - electron-to-chromium: 1.5.267 + baseline-browser-mapping: 2.10.0 + caniuse-lite: 1.0.30001774 + electron-to-chromium: 1.5.302 node-releases: 2.0.27 update-browserslist-db: 1.2.3(browserslist@4.28.1) @@ -1592,12 +1617,12 @@ snapshots: cac@6.7.14: {} - caniuse-lite@1.0.30001761: {} + caniuse-lite@1.0.30001774: {} chai@5.3.3: dependencies: assertion-error: 2.0.1 - check-error: 2.1.1 + check-error: 2.1.3 deep-eql: 5.0.2 loupe: 3.2.1 pathval: 2.0.1 @@ -1607,7 +1632,7 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 - check-error@2.1.1: {} + check-error@2.1.3: {} chrome-trace-event@1.0.4: {} @@ -1635,11 +1660,11 @@ snapshots: deep-eql@5.0.2: {} - electron-to-chromium@1.5.267: {} + electron-to-chromium@1.5.302: {} emoji-regex@8.0.0: {} - enhanced-resolve@5.18.4: + enhanced-resolve@5.19.0: dependencies: graceful-fs: 4.2.11 tapable: 2.3.0 @@ -1648,34 +1673,34 @@ snapshots: es-module-lexer@2.0.0: {} - esbuild@0.27.2: + esbuild@0.27.3: optionalDependencies: - '@esbuild/aix-ppc64': 0.27.2 - '@esbuild/android-arm': 0.27.2 - '@esbuild/android-arm64': 0.27.2 - '@esbuild/android-x64': 0.27.2 - '@esbuild/darwin-arm64': 0.27.2 - '@esbuild/darwin-x64': 0.27.2 - '@esbuild/freebsd-arm64': 0.27.2 - '@esbuild/freebsd-x64': 0.27.2 - '@esbuild/linux-arm': 0.27.2 - '@esbuild/linux-arm64': 0.27.2 - '@esbuild/linux-ia32': 0.27.2 - '@esbuild/linux-loong64': 0.27.2 - '@esbuild/linux-mips64el': 0.27.2 - '@esbuild/linux-ppc64': 0.27.2 - '@esbuild/linux-riscv64': 0.27.2 - '@esbuild/linux-s390x': 0.27.2 - '@esbuild/linux-x64': 0.27.2 - '@esbuild/netbsd-arm64': 0.27.2 - '@esbuild/netbsd-x64': 0.27.2 - '@esbuild/openbsd-arm64': 0.27.2 - '@esbuild/openbsd-x64': 0.27.2 - '@esbuild/openharmony-arm64': 0.27.2 - '@esbuild/sunos-x64': 0.27.2 - '@esbuild/win32-arm64': 0.27.2 - '@esbuild/win32-ia32': 0.27.2 - '@esbuild/win32-x64': 0.27.2 + '@esbuild/aix-ppc64': 0.27.3 + '@esbuild/android-arm': 0.27.3 + '@esbuild/android-arm64': 0.27.3 + '@esbuild/android-x64': 0.27.3 + '@esbuild/darwin-arm64': 0.27.3 + '@esbuild/darwin-x64': 0.27.3 + '@esbuild/freebsd-arm64': 0.27.3 + '@esbuild/freebsd-x64': 0.27.3 + '@esbuild/linux-arm': 0.27.3 + '@esbuild/linux-arm64': 0.27.3 + '@esbuild/linux-ia32': 0.27.3 + '@esbuild/linux-loong64': 0.27.3 + '@esbuild/linux-mips64el': 0.27.3 + '@esbuild/linux-ppc64': 0.27.3 + '@esbuild/linux-riscv64': 0.27.3 + '@esbuild/linux-s390x': 0.27.3 + '@esbuild/linux-x64': 0.27.3 + '@esbuild/netbsd-arm64': 0.27.3 + '@esbuild/netbsd-x64': 0.27.3 + '@esbuild/openbsd-arm64': 0.27.3 + '@esbuild/openbsd-x64': 0.27.3 + '@esbuild/openharmony-arm64': 0.27.3 + '@esbuild/sunos-x64': 0.27.3 + '@esbuild/win32-arm64': 0.27.3 + '@esbuild/win32-ia32': 0.27.3 + '@esbuild/win32-x64': 0.27.3 escalade@3.2.0: {} @@ -1721,7 +1746,7 @@ snapshots: graceful-fs@4.2.11: {} - graphql@16.12.0: {} + graphql@16.13.0: {} has-flag@4.0.0: {} @@ -1778,7 +1803,7 @@ snapshots: '@open-draft/until': 2.1.0 '@types/cookie': 0.6.0 '@types/statuses': 2.0.6 - graphql: 16.12.0 + graphql: 16.13.0 headers-polyfill: 4.0.3 is-node-process: 1.2.0 outvariant: 1.4.3 @@ -1832,32 +1857,35 @@ snapshots: rettime@0.7.0: {} - rollup@4.54.0: + rollup@4.59.0: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.54.0 - '@rollup/rollup-android-arm64': 4.54.0 - '@rollup/rollup-darwin-arm64': 4.54.0 - '@rollup/rollup-darwin-x64': 4.54.0 - '@rollup/rollup-freebsd-arm64': 4.54.0 - '@rollup/rollup-freebsd-x64': 4.54.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.54.0 - '@rollup/rollup-linux-arm-musleabihf': 4.54.0 - '@rollup/rollup-linux-arm64-gnu': 4.54.0 - '@rollup/rollup-linux-arm64-musl': 4.54.0 - '@rollup/rollup-linux-loong64-gnu': 4.54.0 - '@rollup/rollup-linux-ppc64-gnu': 4.54.0 - '@rollup/rollup-linux-riscv64-gnu': 4.54.0 - '@rollup/rollup-linux-riscv64-musl': 4.54.0 - '@rollup/rollup-linux-s390x-gnu': 4.54.0 - '@rollup/rollup-linux-x64-gnu': 4.54.0 - '@rollup/rollup-linux-x64-musl': 4.54.0 - '@rollup/rollup-openharmony-arm64': 4.54.0 - '@rollup/rollup-win32-arm64-msvc': 4.54.0 - '@rollup/rollup-win32-ia32-msvc': 4.54.0 - '@rollup/rollup-win32-x64-gnu': 4.54.0 - '@rollup/rollup-win32-x64-msvc': 4.54.0 + '@rollup/rollup-android-arm-eabi': 4.59.0 + '@rollup/rollup-android-arm64': 4.59.0 + '@rollup/rollup-darwin-arm64': 4.59.0 + '@rollup/rollup-darwin-x64': 4.59.0 + '@rollup/rollup-freebsd-arm64': 4.59.0 + '@rollup/rollup-freebsd-x64': 4.59.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.59.0 + '@rollup/rollup-linux-arm-musleabihf': 4.59.0 + '@rollup/rollup-linux-arm64-gnu': 4.59.0 + '@rollup/rollup-linux-arm64-musl': 4.59.0 + '@rollup/rollup-linux-loong64-gnu': 4.59.0 + '@rollup/rollup-linux-loong64-musl': 4.59.0 + '@rollup/rollup-linux-ppc64-gnu': 4.59.0 + '@rollup/rollup-linux-ppc64-musl': 4.59.0 + '@rollup/rollup-linux-riscv64-gnu': 4.59.0 + '@rollup/rollup-linux-riscv64-musl': 4.59.0 + '@rollup/rollup-linux-s390x-gnu': 4.59.0 + '@rollup/rollup-linux-x64-gnu': 4.59.0 + '@rollup/rollup-linux-x64-musl': 4.59.0 + '@rollup/rollup-openbsd-x64': 4.59.0 + '@rollup/rollup-openharmony-arm64': 4.59.0 + '@rollup/rollup-win32-arm64-msvc': 4.59.0 + '@rollup/rollup-win32-ia32-msvc': 4.59.0 + '@rollup/rollup-win32-x64-gnu': 4.59.0 + '@rollup/rollup-win32-x64-msvc': 4.59.0 fsevents: 2.3.3 safe-buffer@5.2.1: {} @@ -1865,11 +1893,11 @@ snapshots: schema-utils@4.3.3: dependencies: '@types/json-schema': 7.0.15 - ajv: 8.17.1 - ajv-formats: 2.1.1(ajv@8.17.1) - ajv-keywords: 5.1.0(ajv@8.17.1) + ajv: 8.18.0 + ajv-formats: 2.1.1(ajv@8.18.0) + ajv-keywords: 5.1.0(ajv@8.18.0) - semver@7.7.3: {} + semver@7.7.4: {} serialize-javascript@6.0.2: dependencies: @@ -1922,19 +1950,19 @@ snapshots: tapable@2.3.0: {} - terser-webpack-plugin@5.3.16(webpack@5.104.1): + terser-webpack-plugin@5.3.16(webpack@5.105.2): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 serialize-javascript: 6.0.2 - terser: 5.44.1 - webpack: 5.104.1 + terser: 5.46.0 + webpack: 5.105.2 - terser@5.44.1: + terser@5.46.0: dependencies: '@jridgewell/source-map': 0.3.11 - acorn: 8.15.0 + acorn: 8.16.0 commander: 2.20.3 source-map-support: 0.5.21 @@ -1953,11 +1981,11 @@ snapshots: tinyspy@4.0.4: {} - tldts-core@7.0.19: {} + tldts-core@7.0.23: {} - tldts@7.0.19: + tldts@7.0.23: dependencies: - tldts-core: 7.0.19 + tldts-core: 7.0.23 to-regex-range@5.0.1: dependencies: @@ -1965,17 +1993,17 @@ snapshots: tough-cookie@6.0.0: dependencies: - tldts: 7.0.19 + tldts: 7.0.23 - ts-loader@9.5.4(typescript@5.7.3)(webpack@5.104.1): + ts-loader@9.5.4(typescript@5.7.3)(webpack@5.105.2): dependencies: chalk: 4.1.2 - enhanced-resolve: 5.18.4 + enhanced-resolve: 5.19.0 micromatch: 4.0.8 - semver: 7.7.3 + semver: 7.7.4 source-map: 0.7.6 typescript: 5.7.3 - webpack: 5.104.1 + webpack: 5.105.2 type-fest@4.41.0: {} @@ -1989,13 +2017,13 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 - vite-node@3.2.4(@types/node@18.19.130)(terser@5.44.1): + vite-node@3.2.4(@types/node@18.19.130)(terser@5.46.0): dependencies: cac: 6.7.14 debug: 4.4.3 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.3.0(@types/node@18.19.130)(terser@5.44.1) + vite: 7.3.1(@types/node@18.19.130)(terser@5.46.0) transitivePeerDependencies: - '@types/node' - jiti @@ -2010,24 +2038,24 @@ snapshots: - tsx - yaml - vite@7.3.0(@types/node@18.19.130)(terser@5.44.1): + vite@7.3.1(@types/node@18.19.130)(terser@5.46.0): dependencies: - esbuild: 0.27.2 + esbuild: 0.27.3 fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.54.0 + rollup: 4.59.0 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 18.19.130 fsevents: 2.3.3 - terser: 5.44.1 + terser: 5.46.0 - vitest@3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.44.1): + vitest@3.2.4(@types/node@18.19.130)(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(terser@5.46.0): dependencies: '@types/chai': 5.2.3 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.0(@types/node@18.19.130)(terser@5.44.1)) + '@vitest/mocker': 3.2.4(msw@2.11.2(@types/node@18.19.130)(typescript@5.7.3))(vite@7.3.1(@types/node@18.19.130)(terser@5.46.0)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 @@ -2045,8 +2073,8 @@ snapshots: tinyglobby: 0.2.15 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.3.0(@types/node@18.19.130)(terser@5.44.1) - vite-node: 3.2.4(@types/node@18.19.130)(terser@5.44.1) + vite: 7.3.1(@types/node@18.19.130)(terser@5.46.0) + vite-node: 3.2.4(@types/node@18.19.130)(terser@5.46.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 18.19.130 @@ -2064,14 +2092,14 @@ snapshots: - tsx - yaml - watchpack@2.4.4: + watchpack@2.5.1: dependencies: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 - webpack-sources@3.3.3: {} + webpack-sources@3.3.4: {} - webpack@5.104.1: + webpack@5.105.2: dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.8 @@ -2079,11 +2107,11 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 - acorn: 8.15.0 - acorn-import-phases: 1.0.4(acorn@8.15.0) + acorn: 8.16.0 + acorn-import-phases: 1.0.4(acorn@8.16.0) browserslist: 4.28.1 chrome-trace-event: 1.0.4 - enhanced-resolve: 5.18.4 + enhanced-resolve: 5.19.0 es-module-lexer: 2.0.0 eslint-scope: 5.1.1 events: 3.3.0 @@ -2095,9 +2123,9 @@ snapshots: neo-async: 2.6.2 schema-utils: 4.3.3 tapable: 2.3.0 - terser-webpack-plugin: 5.3.16(webpack@5.104.1) - watchpack: 2.4.4 - webpack-sources: 3.3.3 + terser-webpack-plugin: 5.3.16(webpack@5.105.2) + watchpack: 2.5.1 + webpack-sources: 3.3.4 transitivePeerDependencies: - '@swc/core' - esbuild diff --git a/reference.md b/reference.md index d9f9b4572..30e648f95 100644 --- a/reference.md +++ b/reference.md @@ -15,8 +15,7 @@ ```typescript await client.link.listBulkOps({ nextCursor: "next_cursor", - pageSize: 1, - teamId: "infer_from_context" + pageSize: 1 }); ``` @@ -67,7 +66,6 @@ await client.link.listBulkOps({ ```typescript await client.link.bulkImport({ - teamId: "infer_from_context", provider: "oura", connections: [{ userId: "user_id", @@ -126,7 +124,6 @@ await client.link.bulkImport({ ```typescript await client.link.bulkTriggerHistoricalPull({ - teamId: "infer_from_context", userIds: ["user_ids"], provider: "oura" }); @@ -179,7 +176,6 @@ await client.link.bulkTriggerHistoricalPull({ ```typescript await client.link.bulkExport({ - teamId: "infer_from_context", provider: "oura" }); @@ -231,7 +227,6 @@ await client.link.bulkExport({ ```typescript await client.link.bulkPause({ - teamId: "infer_from_context", userIds: ["user_ids"], provider: "oura" }); @@ -340,7 +335,7 @@ await client.link.token({ -
client.link.isTokenValid({ ...params }) -> Record +
client.link.isTokenValid({ ...params }) -> Record<string, unknown>
@@ -457,7 +452,7 @@ await client.link.codeCreate({
-
client.link.startConnect({ ...params }) -> Record +
client.link.startConnect({ ...params }) -> Record<string, unknown>
@@ -524,7 +519,7 @@ await client.link.startConnect({
-
client.link.tokenState({ ...params }) -> Record +
client.link.tokenState({ ...params }) -> Record<string, unknown>
@@ -552,9 +547,7 @@ Check link token state - can be hit continuously used as heartbeat
```typescript -await client.link.tokenState({ - vitalLinkToken: "x-vital-link-token" -}); +await client.link.tokenState(); ```
@@ -618,7 +611,6 @@ Deprecated. Use `POST /v2/link/provider/email/{provider}` instead. ```typescript await client.link.emailAuth({ - vitalLinkToken: "x-vital-link-token", email: "email", provider: "oura", authType: "password" @@ -686,7 +678,6 @@ Deprecated. Use `POST /v2/link/provider/password/{provider}` instead. ```typescript await client.link.passwordAuth({ - vitalLinkToken: "x-vital-link-token", username: "username", password: "password", provider: "oura", @@ -754,9 +745,7 @@ This endpoint generates an OAuth link for oauth provider
```typescript -await client.link.generateOauthLink("oura", { - vitalLinkToken: "x-vital-link-token" -}); +await client.link.generateOauthLink("oura"); ```
@@ -828,7 +817,6 @@ This connects auth providers that are password based. ```typescript await client.link.connectPasswordProvider("whoop", { - vitalLinkToken: "x-vital-link-token", username: "username", password: "password" }); @@ -903,7 +891,6 @@ This connects auth providers that are password based. ```typescript await client.link.completePasswordProviderMfa("whoop", { - vitalLinkToken: "x-vital-link-token", mfaCode: "mfa_code" }); @@ -977,7 +964,6 @@ This connects auth providers that are email based. ```typescript await client.link.connectEmailAuthProvider("freestyle_libre", { - vitalLinkToken: "x-vital-link-token", email: "email" }); @@ -1050,9 +1036,7 @@ GET List of all available providers given the generated link token.
```typescript -await client.link.getAllProviders({ - vitalLinkToken: "x-vital-link-token" -}); +await client.link.getAllProviders(); ```
@@ -1088,7 +1072,7 @@ await client.link.getAllProviders({
-
client.link.connectManualProvider(provider, { ...params }) -> Record +
client.link.connectManualProvider(provider, { ...params }) -> Record<string, boolean>
@@ -7488,7 +7472,7 @@ await client.user.getTeamMetrics();
-
client.user.getConnectedProviders(user_id) -> Record +
client.user.getConnectedProviders(user_id) -> Record<string, Vital.ClientFacingProviderWithStatus[]>
@@ -8421,7 +8405,7 @@ await client.user.createPortalUrl("user_id", {
## Team -
client.team.getLinkConfig({ ...params }) -> Record +
client.team.getLinkConfig({ ...params }) -> Record<string, unknown>
@@ -8448,9 +8432,7 @@ Post teams.
```typescript -await client.team.getLinkConfig({ - vitalLinkToken: "x-vital-link-token" -}); +await client.team.getLinkConfig(); ```
@@ -8614,7 +8596,7 @@ await client.team.getUserById({
-
client.team.getSvixUrl() -> Record +
client.team.getSvixUrl() -> Record<string, unknown>
@@ -8655,7 +8637,7 @@ await client.team.getSvixUrl();
-
client.team.getSourcePriorities({ ...params }) -> Record[] +
client.team.getSourcePriorities({ ...params }) -> Record<string, unknown>[]
@@ -8720,7 +8702,7 @@ await client.team.getSourcePriorities({
-
client.team.updateSourcePriorities() -> Record[] +
client.team.updateSourcePriorities() -> Record<string, unknown>[]
@@ -9268,7 +9250,7 @@ await client.labTests.updateLabTest("lab_test_id");
-GET all the markers for the given lab. +List active and orderable markers for a given Lab. Note that reflex markers are not included.
@@ -9284,6 +9266,7 @@ GET all the markers for the given lab. ```typescript await client.labTests.getMarkers({ + labSlug: "lab_slug", name: "name", aLaCarteEnabled: true, labAccountId: "lab_account_id", @@ -9382,6 +9365,20 @@ await client.labTests.getMarkersForOrderSet({
+#### 📝 Description + +
+
+ +
+
+ +List all markers for a given Lab Test, as well as any associated reflex markers. +
+
+
+
+ #### 🔌 Usage
@@ -9737,6 +9734,7 @@ await client.labTests.getOrders({ userId: "user_id", patientName: "patient_name", shippingRecipientName: "shipping_recipient_name", + orderTransactionId: "order_transaction_id", page: 1, size: 1 }); @@ -10728,7 +10726,8 @@ await client.labTests.getPscAppointmentAvailability({ lab: "quest", startDate: "start_date", zipCode: "zip_code", - radius: "10" + radius: "10", + allowStale: true }); ``` @@ -10779,7 +10778,9 @@ await client.labTests.getPscAppointmentAvailability({ ```typescript await client.labTests.bookPscAppointment("order_id", { - bookingKey: "booking_key" + body: { + bookingKey: "booking_key" + } }); ``` @@ -10804,7 +10805,7 @@ await client.labTests.bookPscAppointment("order_id", {
-**request:** `Vital.AppointmentBookingRequest` +**request:** `Vital.LabTestsBookPscAppointmentRequest`
@@ -11312,8 +11313,6 @@ await client.labTests.getOrder("order_id"); ```typescript await client.labTests.createOrder({ - idempotencyKey: "X-Idempotency-Key", - idempotencyError: "no-cache", userId: "user_id", patientDetails: { firstName: "first_name", @@ -11685,6 +11684,310 @@ await client.labTests.validateIcdCodes({
+
+
+
+ +## Compendium +
client.compendium.search({ ...params }) -> Vital.SearchCompendiumResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.compendium.search({ + mode: "canonical" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Vital.SearchCompendiumBody` + +
+
+ +
+
+ +**requestOptions:** `CompendiumClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.compendium.convert({ ...params }) -> Vital.ConvertCompendiumResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.compendium.convert({ + targetLab: "labcorp" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Vital.ConvertCompendiumBody` + +
+
+ +
+
+ +**requestOptions:** `CompendiumClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## LabAccount +
client.labAccount.getTeamLabAccounts({ ...params }) -> Vital.GetTeamLabAccountsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.labAccount.getTeamLabAccounts({ + labAccountId: "lab_account_id", + status: "active" +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Vital.LabAccountGetTeamLabAccountsRequest` + +
+
+ +
+
+ +**requestOptions:** `LabAccountClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## OrderTransaction +
client.orderTransaction.getTransaction(transaction_id) -> Vital.GetOrderTransactionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.orderTransaction.getTransaction("transaction_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**transaction_id:** `string` + +
+
+ +
+
+ +**requestOptions:** `OrderTransactionClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.orderTransaction.getTransactionResult(transaction_id) -> Vital.LabResultsRaw +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.orderTransaction.getTransactionResult("transaction_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**transaction_id:** `string` + +
+
+ +
+
+ +**requestOptions:** `OrderTransactionClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.orderTransaction.getTransactionResultPdf(transaction_id) -> core.BinaryResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.orderTransaction.getTransactionResultPdf("transaction_id"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**transaction_id:** `string` + +
+
+ +
+
+ +**requestOptions:** `OrderTransactionClient.RequestOptions` + +
+
+
+
+ +
@@ -12121,7 +12424,7 @@ await client.payor.createPayor({
-Creates a parse job, uploads the file to provider, persists the job row, +Creates a parse job, uploads the file(s) to provider, persists the job row, and starts the ParseLabReport. Returns a generated job_id.
@@ -12137,7 +12440,7 @@ and starts the ParseLabReport. Returns a generated job_id.
```typescript -await client.labReport.parserCreateJob(createReadStream("path/to/file"), { +await client.labReport.parserCreateJob([createReadStream("path/to/file")], { userId: "user_id" }); @@ -12155,7 +12458,7 @@ await client.labReport.parserCreateJob(createReadStream("path/to/file"), {
-**file:** `core.file.Uploadable` +**file:** `core.file.Uploadable[]`
@@ -12447,3 +12750,4 @@ await client.aggregate.getTaskHistoryForContinuousQuery("user_id", "query_id_or_
+ diff --git a/src/BaseClient.ts b/src/BaseClient.ts index b2a57501c..d16eb9ae2 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -51,8 +51,8 @@ export function normalizeClientOptions> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -156,16 +151,11 @@ export class ActivityClient { requestOptions?: ActivityClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/aggregate/client/Client.ts b/src/api/resources/aggregate/client/Client.ts index 34c28120e..c632aba63 100644 --- a/src/api/resources/aggregate/client/Client.ts +++ b/src/api/resources/aggregate/client/Client.ts @@ -250,15 +250,10 @@ export class AggregateClient { requestOptions?: AggregateClient.RequestOptions, ): Promise> { const { nextCursor, limit } = request; - const _queryParams: Record = {}; - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (limit != null) { - _queryParams.limit = limit; - } - + const _queryParams: Record = { + next_cursor: nextCursor, + limit, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/body/client/Client.ts b/src/api/resources/body/client/Client.ts index 676b17d15..d3c408544 100644 --- a/src/api/resources/body/client/Client.ts +++ b/src/api/resources/body/client/Client.ts @@ -53,16 +53,11 @@ export class BodyClient { requestOptions?: BodyClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -151,16 +146,11 @@ export class BodyClient { requestOptions?: BodyClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/compendium/client/Client.ts b/src/api/resources/compendium/client/Client.ts new file mode 100644 index 000000000..51c45d9fa --- /dev/null +++ b/src/api/resources/compendium/client/Client.ts @@ -0,0 +1,191 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as serializers from "../../../../serialization/index.js"; +import * as Vital from "../../../index.js"; + +export declare namespace CompendiumClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class CompendiumClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: CompendiumClient.Options = {}) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Vital.SearchCompendiumBody} request + * @param {CompendiumClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Vital.UnprocessableEntityError} + * + * @example + * await client.compendium.search({ + * mode: "canonical" + * }) + */ + public search( + request: Vital.SearchCompendiumBody, + requestOptions?: CompendiumClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); + } + + private async __search( + request: Vital.SearchCompendiumBody, + requestOptions?: CompendiumClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.VitalEnvironment.Production, + "v3/compendium/search", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.SearchCompendiumBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.SearchCompendiumResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Vital.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.VitalError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v3/compendium/search"); + } + + /** + * @param {Vital.ConvertCompendiumBody} request + * @param {CompendiumClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Vital.UnprocessableEntityError} + * + * @example + * await client.compendium.convert({ + * targetLab: "labcorp" + * }) + */ + public convert( + request: Vital.ConvertCompendiumBody, + requestOptions?: CompendiumClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__convert(request, requestOptions)); + } + + private async __convert( + request: Vital.ConvertCompendiumBody, + requestOptions?: CompendiumClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.VitalEnvironment.Production, + "v3/compendium/convert", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.ConvertCompendiumBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ConvertCompendiumResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Vital.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.VitalError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v3/compendium/convert"); + } +} diff --git a/src/api/resources/compendium/client/index.ts b/src/api/resources/compendium/client/index.ts new file mode 100644 index 000000000..195f9aa8a --- /dev/null +++ b/src/api/resources/compendium/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/compendium/client/requests/ConvertCompendiumBody.ts b/src/api/resources/compendium/client/requests/ConvertCompendiumBody.ts new file mode 100644 index 000000000..80c10bea9 --- /dev/null +++ b/src/api/resources/compendium/client/requests/ConvertCompendiumBody.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../../../index.js"; + +/** + * @example + * { + * targetLab: "labcorp" + * } + */ +export interface ConvertCompendiumBody { + labTestId?: string; + providerIds?: string[]; + targetLab: Vital.CompendiumSearchLabs; + limit?: number; +} diff --git a/src/api/resources/compendium/client/requests/SearchCompendiumBody.ts b/src/api/resources/compendium/client/requests/SearchCompendiumBody.ts new file mode 100644 index 000000000..f8d5883b4 --- /dev/null +++ b/src/api/resources/compendium/client/requests/SearchCompendiumBody.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../../../index.js"; + +/** + * @example + * { + * mode: "canonical" + * } + */ +export interface SearchCompendiumBody { + mode: Vital.SearchMode; + query?: string; + cptCodes?: string[]; + loincSetHash?: string; + labs?: Vital.CompendiumSearchLabs[]; + includeRelated?: boolean; + limit?: number; +} diff --git a/src/api/resources/compendium/client/requests/index.ts b/src/api/resources/compendium/client/requests/index.ts new file mode 100644 index 000000000..0d2543a48 --- /dev/null +++ b/src/api/resources/compendium/client/requests/index.ts @@ -0,0 +1,2 @@ +export type { ConvertCompendiumBody } from "./ConvertCompendiumBody.js"; +export type { SearchCompendiumBody } from "./SearchCompendiumBody.js"; diff --git a/src/api/resources/compendium/index.ts b/src/api/resources/compendium/index.ts new file mode 100644 index 000000000..914b8c3c7 --- /dev/null +++ b/src/api/resources/compendium/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/devices/client/Client.ts b/src/api/resources/devices/client/Client.ts index 6688fed3d..85e17d753 100644 --- a/src/api/resources/devices/client/Client.ts +++ b/src/api/resources/devices/client/Client.ts @@ -51,11 +51,9 @@ export class DevicesClient { requestOptions?: DevicesClient.RequestOptions, ): Promise> { const { provider } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - + const _queryParams: Record = { + provider, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/electrocardiogram/client/Client.ts b/src/api/resources/electrocardiogram/client/Client.ts index 24b578e9b..abcd37065 100644 --- a/src/api/resources/electrocardiogram/client/Client.ts +++ b/src/api/resources/electrocardiogram/client/Client.ts @@ -53,16 +53,11 @@ export class ElectrocardiogramClient { requestOptions?: ElectrocardiogramClient.RequestOptions, ): Promise> { const { startDate, endDate, provider } = request; - const _queryParams: Record = {}; - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - - if (provider != null) { - _queryParams.provider = provider; - } - + const _queryParams: Record = { + start_date: startDate, + end_date: endDate, + provider, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 9a264f368..fc09f1f1d 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -5,6 +5,8 @@ export * as aggregate from "./aggregate/index.js"; export * from "./aggregate/types/index.js"; export * from "./body/client/requests/index.js"; export * as body from "./body/index.js"; +export * from "./compendium/client/requests/index.js"; +export * as compendium from "./compendium/index.js"; export * from "./devices/client/requests/index.js"; export * as devices from "./devices/index.js"; export * from "./electrocardiogram/client/requests/index.js"; @@ -13,6 +15,8 @@ export * from "./insurance/client/requests/index.js"; export * as insurance from "./insurance/index.js"; export * from "./introspect/client/requests/index.js"; export * as introspect from "./introspect/index.js"; +export * from "./labAccount/client/requests/index.js"; +export * as labAccount from "./labAccount/index.js"; export * from "./labReport/client/requests/index.js"; export * as labReport from "./labReport/index.js"; export * from "./labTests/client/requests/index.js"; @@ -20,13 +24,13 @@ export * as labTests from "./labTests/index.js"; export * from "./labTests/types/index.js"; export * from "./link/client/requests/index.js"; export * as link from "./link/index.js"; -export * from "./link/types/index.js"; export * from "./meal/client/requests/index.js"; export * as meal from "./meal/index.js"; export * from "./menstrualCycle/client/requests/index.js"; export * as menstrualCycle from "./menstrualCycle/index.js"; export * from "./order/client/requests/index.js"; export * as order from "./order/index.js"; +export * as orderTransaction from "./orderTransaction/index.js"; export * from "./payor/client/requests/index.js"; export * as payor from "./payor/index.js"; export * from "./profile/client/requests/index.js"; diff --git a/src/api/resources/insurance/client/Client.ts b/src/api/resources/insurance/client/Client.ts index 7f12d8c14..783c1adaf 100644 --- a/src/api/resources/insurance/client/Client.ts +++ b/src/api/resources/insurance/client/Client.ts @@ -48,21 +48,14 @@ export class InsuranceClient { requestOptions?: InsuranceClient.RequestOptions, ): Promise> { const { insuranceName, provider, providerPayorId } = request; - const _queryParams: Record = {}; - if (insuranceName != null) { - _queryParams.insurance_name = insuranceName; - } - - if (provider != null) { - _queryParams.provider = serializers.PayorCodeExternalProvider.jsonOrThrow(provider, { - unrecognizedObjectKeys: "strip", - }); - } - - if (providerPayorId != null) { - _queryParams.provider_payor_id = providerPayorId; - } - + const _queryParams: Record = { + insurance_name: insuranceName, + provider: + provider != null + ? serializers.PayorCodeExternalProvider.jsonOrThrow(provider, { unrecognizedObjectKeys: "strip" }) + : undefined, + provider_payor_id: providerPayorId, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -225,8 +218,9 @@ export class InsuranceClient { requestOptions?: InsuranceClient.RequestOptions, ): Promise> { const { diagnosisQuery } = request; - const _queryParams: Record = {}; - _queryParams.diagnosis_query = diagnosisQuery; + const _queryParams: Record = { + diagnosis_query: diagnosisQuery, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/introspect/client/Client.ts b/src/api/resources/introspect/client/Client.ts index b4c136218..72abffffc 100644 --- a/src/api/resources/introspect/client/Client.ts +++ b/src/api/resources/introspect/client/Client.ts @@ -50,27 +50,16 @@ export class IntrospectClient { requestOptions?: IntrospectClient.RequestOptions, ): Promise> { const { userId, provider, userLimit, cursor, nextCursor } = request; - const _queryParams: Record = {}; - if (userId != null) { - _queryParams.user_id = userId; - } - - if (provider != null) { - _queryParams.provider = serializers.Providers.jsonOrThrow(provider, { unrecognizedObjectKeys: "strip" }); - } - - if (userLimit != null) { - _queryParams.user_limit = userLimit; - } - - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - + const _queryParams: Record = { + user_id: userId, + provider: + provider != null + ? serializers.Providers.jsonOrThrow(provider, { unrecognizedObjectKeys: "strip" }) + : undefined, + user_limit: userLimit, + cursor, + next_cursor: nextCursor, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -156,27 +145,16 @@ export class IntrospectClient { requestOptions?: IntrospectClient.RequestOptions, ): Promise> { const { userId, provider, userLimit, cursor, nextCursor } = request; - const _queryParams: Record = {}; - if (userId != null) { - _queryParams.user_id = userId; - } - - if (provider != null) { - _queryParams.provider = serializers.Providers.jsonOrThrow(provider, { unrecognizedObjectKeys: "strip" }); - } - - if (userLimit != null) { - _queryParams.user_limit = userLimit; - } - - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - + const _queryParams: Record = { + user_id: userId, + provider: + provider != null + ? serializers.Providers.jsonOrThrow(provider, { unrecognizedObjectKeys: "strip" }) + : undefined, + user_limit: userLimit, + cursor, + next_cursor: nextCursor, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/labAccount/client/Client.ts b/src/api/resources/labAccount/client/Client.ts new file mode 100644 index 000000000..6c1a47af8 --- /dev/null +++ b/src/api/resources/labAccount/client/Client.ts @@ -0,0 +1,114 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as serializers from "../../../../serialization/index.js"; +import * as Vital from "../../../index.js"; + +export declare namespace LabAccountClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class LabAccountClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: LabAccountClient.Options = {}) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {Vital.LabAccountGetTeamLabAccountsRequest} request + * @param {LabAccountClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Vital.UnprocessableEntityError} + * + * @example + * await client.labAccount.getTeamLabAccounts({ + * labAccountId: "lab_account_id", + * status: "active" + * }) + */ + public getTeamLabAccounts( + request: Vital.LabAccountGetTeamLabAccountsRequest = {}, + requestOptions?: LabAccountClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTeamLabAccounts(request, requestOptions)); + } + + private async __getTeamLabAccounts( + request: Vital.LabAccountGetTeamLabAccountsRequest = {}, + requestOptions?: LabAccountClient.RequestOptions, + ): Promise> { + const { labAccountId, status } = request; + const _queryParams: Record = { + lab_account_id: labAccountId, + status: + status != null + ? serializers.LabAccountStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.VitalEnvironment.Production, + "v3/lab_test/lab_account", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GetTeamLabAccountsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Vital.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.VitalError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v3/lab_test/lab_account"); + } +} diff --git a/src/api/resources/labAccount/client/index.ts b/src/api/resources/labAccount/client/index.ts new file mode 100644 index 000000000..195f9aa8a --- /dev/null +++ b/src/api/resources/labAccount/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/labAccount/client/requests/LabAccountGetTeamLabAccountsRequest.ts b/src/api/resources/labAccount/client/requests/LabAccountGetTeamLabAccountsRequest.ts new file mode 100644 index 000000000..0aec2a2c6 --- /dev/null +++ b/src/api/resources/labAccount/client/requests/LabAccountGetTeamLabAccountsRequest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../../../index.js"; + +/** + * @example + * { + * labAccountId: "lab_account_id", + * status: "active" + * } + */ +export interface LabAccountGetTeamLabAccountsRequest { + labAccountId?: string; + status?: Vital.LabAccountStatus; +} diff --git a/src/api/resources/labAccount/client/requests/index.ts b/src/api/resources/labAccount/client/requests/index.ts new file mode 100644 index 000000000..49ac642bd --- /dev/null +++ b/src/api/resources/labAccount/client/requests/index.ts @@ -0,0 +1 @@ +export type { LabAccountGetTeamLabAccountsRequest } from "./LabAccountGetTeamLabAccountsRequest.js"; diff --git a/src/api/resources/labAccount/index.ts b/src/api/resources/labAccount/index.ts new file mode 100644 index 000000000..914b8c3c7 --- /dev/null +++ b/src/api/resources/labAccount/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/labReport/client/Client.ts b/src/api/resources/labReport/client/Client.ts index 7e1db7108..525af5579 100644 --- a/src/api/resources/labReport/client/Client.ts +++ b/src/api/resources/labReport/client/Client.ts @@ -24,10 +24,10 @@ export class LabReportClient { } /** - * Creates a parse job, uploads the file to provider, persists the job row, + * Creates a parse job, uploads the file(s) to provider, persists the job row, * and starts the ParseLabReport. Returns a generated job_id. * - * @param {core.file.Uploadable} file + * @param {core.file.Uploadable[]} file * @param {Vital.BodyCreateLabReportParserJob} request * @param {LabReportClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -35,12 +35,12 @@ export class LabReportClient { * * @example * import { createReadStream } from "fs"; - * await client.labReport.parserCreateJob(createReadStream("path/to/file"), { + * await client.labReport.parserCreateJob([createReadStream("path/to/file")], { * userId: "user_id" * }) */ public parserCreateJob( - file: core.file.Uploadable, + file: core.file.Uploadable[], request: Vital.BodyCreateLabReportParserJob, requestOptions?: LabReportClient.RequestOptions, ): core.HttpResponsePromise { @@ -48,18 +48,21 @@ export class LabReportClient { } private async __parserCreateJob( - file: core.file.Uploadable, + file: core.file.Uploadable[], request: Vital.BodyCreateLabReportParserJob, requestOptions?: LabReportClient.RequestOptions, ): Promise> { - const _request = await core.newFormData(); - await _request.appendFile("file", file); - _request.append("user_id", request.userId); + const _body = await core.newFormData(); + for (const _file of file) { + await _body.appendFile("file", _file); + } + + _body.append("user_id", request.userId); if (request.needsHumanReview != null) { - _request.append("needs_human_review", request.needsHumanReview.toString()); + _body.append("needs_human_review", request.needsHumanReview?.toString()); } - const _maybeEncodedRequest = await _request.getRequest(); + const _maybeEncodedRequest = await _body.getRequest(); const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/labTests/client/Client.ts b/src/api/resources/labTests/client/Client.ts index f07c1da67..3f214efea 100644 --- a/src/api/resources/labTests/client/Client.ts +++ b/src/api/resources/labTests/client/Client.ts @@ -64,59 +64,38 @@ export class LabTestsClient { orderKey, orderDirection, } = request; - const _queryParams: Record = {}; - if (generationMethod != null) { - _queryParams.generation_method = serializers.LabTestGenerationMethodFilter.jsonOrThrow(generationMethod, { - unrecognizedObjectKeys: "strip", - }); - } - - if (labSlug != null) { - _queryParams.lab_slug = labSlug; - } - - if (collectionMethod != null) { - _queryParams.collection_method = serializers.LabTestCollectionMethod.jsonOrThrow(collectionMethod, { - unrecognizedObjectKeys: "strip", - }); - } - - if (status != null) { - _queryParams.status = serializers.LabTestStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }); - } - - if (markerIds != null) { - if (Array.isArray(markerIds)) { - _queryParams.marker_ids = markerIds.map((item) => item.toString()); - } else { - _queryParams.marker_ids = markerIds; - } - } - - if (providerIds != null) { - if (Array.isArray(providerIds)) { - _queryParams.provider_ids = providerIds.map((item) => item); - } else { - _queryParams.provider_ids = providerIds; - } - } - - if (name != null) { - _queryParams.name = name; - } - - if (orderKey != null) { - _queryParams.order_key = serializers.LabTestsGetRequestOrderKey.jsonOrThrow(orderKey, { - unrecognizedObjectKeys: "strip", - }); - } - - if (orderDirection != null) { - _queryParams.order_direction = serializers.LabTestsGetRequestOrderDirection.jsonOrThrow(orderDirection, { - unrecognizedObjectKeys: "strip", - }); - } - + const _queryParams: Record = { + generation_method: + generationMethod != null + ? serializers.LabTestGenerationMethodFilter.jsonOrThrow(generationMethod, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + lab_slug: labSlug, + collection_method: + collectionMethod != null + ? serializers.LabTestCollectionMethod.jsonOrThrow(collectionMethod, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + status: + status != null + ? serializers.LabTestStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + marker_ids: markerIds, + provider_ids: providerIds, + name, + order_key: + orderKey != null + ? serializers.LabTestsGetRequestOrderKey.jsonOrThrow(orderKey, { unrecognizedObjectKeys: "strip" }) + : undefined, + order_direction: + orderDirection != null + ? serializers.LabTestsGetRequestOrderDirection.jsonOrThrow(orderDirection, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -288,11 +267,9 @@ export class LabTestsClient { requestOptions?: LabTestsClient.RequestOptions, ): Promise> { const { labAccountId } = request; - const _queryParams: Record = {}; - if (labAccountId != null) { - _queryParams.lab_account_id = labAccountId; - } - + const _queryParams: Record = { + lab_account_id: labAccountId, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -436,7 +413,7 @@ export class LabTestsClient { } /** - * GET all the markers for the given lab. + * List active and orderable markers for a given Lab. Note that reflex markers are not included. * * @param {Vital.LabTestsGetMarkersRequest} request * @param {LabTestsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -445,6 +422,7 @@ export class LabTestsClient { * * @example * await client.labTests.getMarkers({ + * labSlug: "lab_slug", * name: "name", * aLaCarteEnabled: true, * labAccountId: "lab_account_id", @@ -463,36 +441,16 @@ export class LabTestsClient { request: Vital.LabTestsGetMarkersRequest = {}, requestOptions?: LabTestsClient.RequestOptions, ): Promise> { - const { labId, name, aLaCarteEnabled, labAccountId, page, size } = request; - const _queryParams: Record = {}; - if (labId != null) { - if (Array.isArray(labId)) { - _queryParams.lab_id = labId.map((item) => item.toString()); - } else { - _queryParams.lab_id = labId; - } - } - - if (name != null) { - _queryParams.name = name; - } - - if (aLaCarteEnabled != null) { - _queryParams.a_la_carte_enabled = aLaCarteEnabled; - } - - if (labAccountId != null) { - _queryParams.lab_account_id = labAccountId; - } - - if (page != null) { - _queryParams.page = page; - } - - if (size != null) { - _queryParams.size = size; - } - + const { labId, labSlug, name, aLaCarteEnabled, labAccountId, page, size } = request; + const _queryParams: Record = { + lab_id: labId, + lab_slug: labSlug, + name, + a_la_carte_enabled: aLaCarteEnabled, + lab_account_id: labAccountId, + page, + size, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -576,15 +534,10 @@ export class LabTestsClient { requestOptions?: LabTestsClient.RequestOptions, ): Promise> { const { page, size, body: _body } = request; - const _queryParams: Record = {}; - if (page != null) { - _queryParams.page = page; - } - - if (size != null) { - _queryParams.size = size; - } - + const _queryParams: Record = { + page, + size, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -652,6 +605,8 @@ export class LabTestsClient { } /** + * List all markers for a given Lab Test, as well as any associated reflex markers. + * * @param {string} lab_test_id * @param {Vital.LabTestsGetMarkersForLabTestRequest} request * @param {LabTestsClient.RequestOptions} requestOptions - Request-specific configuration. @@ -679,19 +634,11 @@ export class LabTestsClient { requestOptions?: LabTestsClient.RequestOptions, ): Promise> { const { labAccountId, page, size } = request; - const _queryParams: Record = {}; - if (labAccountId != null) { - _queryParams.lab_account_id = labAccountId; - } - - if (page != null) { - _queryParams.page = page; - } - - if (size != null) { - _queryParams.size = size; - } - + const _queryParams: Record = { + lab_account_id: labAccountId, + page, + size, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -788,11 +735,9 @@ export class LabTestsClient { requestOptions?: LabTestsClient.RequestOptions, ): Promise> { const { labAccountId } = request; - const _queryParams: Record = {}; - if (labAccountId != null) { - _queryParams.lab_account_id = labAccountId; - } - + const _queryParams: Record = { + lab_account_id: labAccountId, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -961,68 +906,42 @@ export class LabTestsClient { orderKey, orderDirection, } = request; - const _queryParams: Record = {}; - if (labTestLimit != null) { - _queryParams.lab_test_limit = labTestLimit; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (generationMethod != null) { - _queryParams.generation_method = serializers.LabTestGenerationMethodFilter.jsonOrThrow(generationMethod, { - unrecognizedObjectKeys: "strip", - }); - } - - if (labSlug != null) { - _queryParams.lab_slug = labSlug; - } - - if (collectionMethod != null) { - _queryParams.collection_method = serializers.LabTestCollectionMethod.jsonOrThrow(collectionMethod, { - unrecognizedObjectKeys: "strip", - }); - } - - if (status != null) { - _queryParams.status = serializers.LabTestStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }); - } - - if (markerIds != null) { - if (Array.isArray(markerIds)) { - _queryParams.marker_ids = markerIds.map((item) => item.toString()); - } else { - _queryParams.marker_ids = markerIds; - } - } - - if (providerIds != null) { - if (Array.isArray(providerIds)) { - _queryParams.provider_ids = providerIds.map((item) => item); - } else { - _queryParams.provider_ids = providerIds; - } - } - - if (name != null) { - _queryParams.name = name; - } - - if (orderKey != null) { - _queryParams.order_key = serializers.LabTestsGetPaginatedRequestOrderKey.jsonOrThrow(orderKey, { - unrecognizedObjectKeys: "strip", - }); - } - - if (orderDirection != null) { - _queryParams.order_direction = serializers.LabTestsGetPaginatedRequestOrderDirection.jsonOrThrow( - orderDirection, - { unrecognizedObjectKeys: "strip" }, - ); - } - + const _queryParams: Record = { + lab_test_limit: labTestLimit, + next_cursor: nextCursor, + generation_method: + generationMethod != null + ? serializers.LabTestGenerationMethodFilter.jsonOrThrow(generationMethod, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + lab_slug: labSlug, + collection_method: + collectionMethod != null + ? serializers.LabTestCollectionMethod.jsonOrThrow(collectionMethod, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + status: + status != null + ? serializers.LabTestStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + marker_ids: markerIds, + provider_ids: providerIds, + name, + order_key: + orderKey != null + ? serializers.LabTestsGetPaginatedRequestOrderKey.jsonOrThrow(orderKey, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + order_direction: + orderDirection != null + ? serializers.LabTestsGetPaginatedRequestOrderDirection.jsonOrThrow(orderDirection, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1175,6 +1094,7 @@ export class LabTestsClient { * userId: "user_id", * patientName: "patient_name", * shippingRecipientName: "shipping_recipient_name", + * orderTransactionId: "order_transaction_id", * page: 1, * size: 1 * }) @@ -1207,118 +1127,64 @@ export class LabTestsClient { patientName, shippingRecipientName, orderIds, + orderTransactionId, page, size, } = request; - const _queryParams: Record = {}; - if (searchInput != null) { - _queryParams.search_input = searchInput; - } - - if (startDate != null) { - _queryParams.start_date = startDate.toISOString(); - } - - if (endDate != null) { - _queryParams.end_date = endDate.toISOString(); - } - - if (updatedStartDate != null) { - _queryParams.updated_start_date = updatedStartDate.toISOString(); - } - - if (updatedEndDate != null) { - _queryParams.updated_end_date = updatedEndDate.toISOString(); - } - - if (status != null) { - if (Array.isArray(status)) { - _queryParams.status = status.map((item) => - serializers.OrderLowLevelStatus.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.status = serializers.OrderLowLevelStatus.jsonOrThrow(status, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (orderKey != null) { - _queryParams.order_key = serializers.LabTestsGetOrdersRequestOrderKey.jsonOrThrow(orderKey, { - unrecognizedObjectKeys: "strip", - }); - } - - if (orderDirection != null) { - _queryParams.order_direction = serializers.LabTestsGetOrdersRequestOrderDirection.jsonOrThrow( - orderDirection, - { unrecognizedObjectKeys: "strip" }, - ); - } - - if (orderType != null) { - if (Array.isArray(orderType)) { - _queryParams.order_type = orderType.map((item) => - serializers.LabTestCollectionMethod.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.order_type = serializers.LabTestCollectionMethod.jsonOrThrow(orderType, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (isCritical != null) { - _queryParams.is_critical = isCritical; - } - - if (interpretation != null) { - _queryParams.interpretation = serializers.Interpretation.jsonOrThrow(interpretation, { - unrecognizedObjectKeys: "strip", - }); - } - - if (orderActivationTypes != null) { - if (Array.isArray(orderActivationTypes)) { - _queryParams.order_activation_types = orderActivationTypes.map((item) => - serializers.OrderActivationType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.order_activation_types = serializers.OrderActivationType.jsonOrThrow( - orderActivationTypes, - { unrecognizedObjectKeys: "strip" }, - ); - } - } - - if (userId != null) { - _queryParams.user_id = userId; - } - - if (patientName != null) { - _queryParams.patient_name = patientName; - } - - if (shippingRecipientName != null) { - _queryParams.shipping_recipient_name = shippingRecipientName; - } - - if (orderIds != null) { - if (Array.isArray(orderIds)) { - _queryParams.order_ids = orderIds.map((item) => item); - } else { - _queryParams.order_ids = orderIds; - } - } - - if (page != null) { - _queryParams.page = page; - } - - if (size != null) { - _queryParams.size = size; - } - + const _queryParams: Record = { + search_input: searchInput, + start_date: startDate != null ? startDate?.toISOString() : undefined, + end_date: endDate != null ? endDate?.toISOString() : undefined, + updated_start_date: updatedStartDate != null ? updatedStartDate?.toISOString() : undefined, + updated_end_date: updatedEndDate != null ? updatedEndDate?.toISOString() : undefined, + status: Array.isArray(status) + ? status.map((item) => + serializers.OrderLowLevelStatus.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : status != null + ? serializers.OrderLowLevelStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + order_key: + orderKey != null + ? serializers.LabTestsGetOrdersRequestOrderKey.jsonOrThrow(orderKey, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + order_direction: + orderDirection != null + ? serializers.LabTestsGetOrdersRequestOrderDirection.jsonOrThrow(orderDirection, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + order_type: Array.isArray(orderType) + ? orderType.map((item) => + serializers.LabTestCollectionMethod.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : orderType != null + ? serializers.LabTestCollectionMethod.jsonOrThrow(orderType, { unrecognizedObjectKeys: "strip" }) + : undefined, + is_critical: isCritical, + interpretation: + interpretation != null + ? serializers.Interpretation.jsonOrThrow(interpretation, { unrecognizedObjectKeys: "strip" }) + : undefined, + order_activation_types: Array.isArray(orderActivationTypes) + ? orderActivationTypes.map((item) => + serializers.OrderActivationType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : orderActivationTypes != null + ? serializers.OrderActivationType.jsonOrThrow(orderActivationTypes, { + unrecognizedObjectKeys: "strip", + }) + : undefined, + user_id: userId, + patient_name: patientName, + shipping_recipient_name: shippingRecipientName, + order_ids: orderIds, + order_transaction_id: orderTransactionId, + page, + size, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1411,11 +1277,9 @@ export class LabTestsClient { requestOptions?: LabTestsClient.RequestOptions, ): Promise> { const { startDate, body: _body } = request; - const _queryParams: Record = {}; - if (startDate != null) { - _queryParams.start_date = startDate; - } - + const _queryParams: Record = { + start_date: startDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2058,30 +1922,25 @@ export class LabTestsClient { requestOptions?: LabTestsClient.RequestOptions, ): Promise> { const { zipCode, radius, lab, labs, labAccountId } = request; - const _queryParams: Record = {}; - _queryParams.zip_code = zipCode; - if (radius != null) { - _queryParams.radius = serializers.AllowedRadius.jsonOrThrow(radius, { unrecognizedObjectKeys: "strip" }); - } - - if (lab != null) { - _queryParams.lab = serializers.ClientFacingLabs.jsonOrThrow(lab, { unrecognizedObjectKeys: "strip" }); - } - - if (labs != null) { - if (Array.isArray(labs)) { - _queryParams.labs = labs.map((item) => - serializers.ClientFacingLabs.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.labs = serializers.ClientFacingLabs.jsonOrThrow(labs, { unrecognizedObjectKeys: "strip" }); - } - } - - if (labAccountId != null) { - _queryParams.lab_account_id = labAccountId; - } - + const _queryParams: Record = { + zip_code: zipCode, + radius: + radius != null + ? serializers.AllowedRadius.jsonOrThrow(radius, { unrecognizedObjectKeys: "strip" }) + : undefined, + lab: + lab != null + ? serializers.ClientFacingLabs.jsonOrThrow(lab, { unrecognizedObjectKeys: "strip" }) + : undefined, + labs: Array.isArray(labs) + ? labs.map((item) => + serializers.ClientFacingLabs.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : labs != null + ? serializers.ClientFacingLabs.jsonOrThrow(labs, { unrecognizedObjectKeys: "strip" }) + : undefined, + lab_account_id: labAccountId, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2166,29 +2025,22 @@ export class LabTestsClient { requestOptions?: LabTestsClient.RequestOptions, ): Promise> { const { zipCode, labId, radius, capabilities, labAccountId } = request; - const _queryParams: Record = {}; - _queryParams.zip_code = zipCode; - _queryParams.lab_id = labId; - if (radius != null) { - _queryParams.radius = serializers.AllowedRadius.jsonOrThrow(radius, { unrecognizedObjectKeys: "strip" }); - } - - if (capabilities != null) { - if (Array.isArray(capabilities)) { - _queryParams.capabilities = capabilities.map((item) => - serializers.LabLocationCapability.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.capabilities = serializers.LabLocationCapability.jsonOrThrow(capabilities, { - unrecognizedObjectKeys: "strip", - }); - } - } - - if (labAccountId != null) { - _queryParams.lab_account_id = labAccountId; - } - + const _queryParams: Record = { + zip_code: zipCode, + lab_id: labId, + radius: + radius != null + ? serializers.AllowedRadius.jsonOrThrow(radius, { unrecognizedObjectKeys: "strip" }) + : undefined, + capabilities: Array.isArray(capabilities) + ? capabilities.map((item) => + serializers.LabLocationCapability.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : capabilities != null + ? serializers.LabLocationCapability.jsonOrThrow(capabilities, { unrecognizedObjectKeys: "strip" }) + : undefined, + lab_account_id: labAccountId, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2273,23 +2125,19 @@ export class LabTestsClient { requestOptions?: LabTestsClient.RequestOptions, ): Promise> { const { radius, capabilities } = request; - const _queryParams: Record = {}; - if (radius != null) { - _queryParams.radius = serializers.AllowedRadius.jsonOrThrow(radius, { unrecognizedObjectKeys: "strip" }); - } - - if (capabilities != null) { - if (Array.isArray(capabilities)) { - _queryParams.capabilities = capabilities.map((item) => - serializers.LabLocationCapability.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), - ); - } else { - _queryParams.capabilities = serializers.LabLocationCapability.jsonOrThrow(capabilities, { - unrecognizedObjectKeys: "strip", - }); - } - } - + const _queryParams: Record = { + radius: + radius != null + ? serializers.AllowedRadius.jsonOrThrow(radius, { unrecognizedObjectKeys: "strip" }) + : undefined, + capabilities: Array.isArray(capabilities) + ? capabilities.map((item) => + serializers.LabLocationCapability.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : capabilities != null + ? serializers.LabLocationCapability.jsonOrThrow(capabilities, { unrecognizedObjectKeys: "strip" }) + : undefined, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2603,12 +2451,10 @@ export class LabTestsClient { requestOptions?: LabTestsClient.RequestOptions, ): Promise> { const { numberOfLabels, collectionDate } = request; - const _queryParams: Record = {}; - if (numberOfLabels != null) { - _queryParams.number_of_labels = numberOfLabels; - } - - _queryParams.collection_date = collectionDate.toISOString(); + const _queryParams: Record = { + number_of_labels: numberOfLabels, + collection_date: collectionDate.toISOString(), + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2677,7 +2523,8 @@ export class LabTestsClient { * lab: "quest", * startDate: "start_date", * zipCode: "zip_code", - * radius: "10" + * radius: "10", + * allowStale: true * }) */ public getPscAppointmentAvailability( @@ -2691,29 +2538,18 @@ export class LabTestsClient { request: Vital.LabTestsGetPscAppointmentAvailabilityRequest, requestOptions?: LabTestsClient.RequestOptions, ): Promise> { - const { lab, startDate, siteCodes, zipCode, radius } = request; - const _queryParams: Record = {}; - _queryParams.lab = serializers.AppointmentPscLabs.jsonOrThrow(lab, { unrecognizedObjectKeys: "strip" }); - if (startDate != null) { - _queryParams.start_date = startDate; - } - - if (siteCodes != null) { - if (Array.isArray(siteCodes)) { - _queryParams.site_codes = siteCodes.map((item) => item); - } else { - _queryParams.site_codes = siteCodes; - } - } - - if (zipCode != null) { - _queryParams.zip_code = zipCode; - } - - if (radius != null) { - _queryParams.radius = serializers.AllowedRadius.jsonOrThrow(radius, { unrecognizedObjectKeys: "strip" }); - } - + const { lab, startDate, siteCodes, zipCode, radius, allowStale } = request; + const _queryParams: Record = { + lab: serializers.AppointmentPscLabs.jsonOrThrow(lab, { unrecognizedObjectKeys: "strip" }), + start_date: startDate, + site_codes: siteCodes, + zip_code: zipCode, + radius: + radius != null + ? serializers.AllowedRadius.jsonOrThrow(radius, { unrecognizedObjectKeys: "strip" }) + : undefined, + allow_stale: allowStale, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2789,19 +2625,21 @@ export class LabTestsClient { /** * @param {string} order_id - Your Order ID. - * @param {Vital.AppointmentBookingRequest} request + * @param {Vital.LabTestsBookPscAppointmentRequest} request * @param {LabTestsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Vital.UnprocessableEntityError} * * @example * await client.labTests.bookPscAppointment("order_id", { - * bookingKey: "booking_key" + * body: { + * bookingKey: "booking_key" + * } * }) */ public bookPscAppointment( order_id: string, - request: Vital.AppointmentBookingRequest, + request: Vital.LabTestsBookPscAppointmentRequest, requestOptions?: LabTestsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__bookPscAppointment(order_id, request, requestOptions)); @@ -2809,13 +2647,15 @@ export class LabTestsClient { private async __bookPscAppointment( order_id: string, - request: Vital.AppointmentBookingRequest, + request: Vital.LabTestsBookPscAppointmentRequest, requestOptions?: LabTestsClient.RequestOptions, ): Promise> { + const { idempotencyKey, idempotencyError, body: _body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ "x-idempotency-key": idempotencyKey, "x-idempotency-error": idempotencyError }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -2830,7 +2670,7 @@ export class LabTestsClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.AppointmentBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.AppointmentBookingRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -3508,8 +3348,6 @@ export class LabTestsClient { * * @example * await client.labTests.createOrder({ - * idempotencyKey: "X-Idempotency-Key", - * idempotencyError: "no-cache", * userId: "user_id", * patientDetails: { * firstName: "first_name", @@ -3815,17 +3653,13 @@ export class LabTestsClient { requestOptions?: LabTestsClient.RequestOptions, ): Promise> { const { finalStatus, delay, body: _body } = request; - const _queryParams: Record = {}; - if (finalStatus != null) { - _queryParams.final_status = serializers.OrderStatus.jsonOrThrow(finalStatus, { - unrecognizedObjectKeys: "strip", - }); - } - - if (delay != null) { - _queryParams.delay = delay; - } - + const _queryParams: Record = { + final_status: + finalStatus != null + ? serializers.OrderStatus.jsonOrThrow(finalStatus, { unrecognizedObjectKeys: "strip" }) + : undefined, + delay, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3844,12 +3678,9 @@ export class LabTestsClient { contentType: "application/json", queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, requestType: "json", - body: - _body != null - ? serializers.labTests.simulateOrderProcess.Request.jsonOrThrow(_body, { - unrecognizedObjectKeys: "strip", - }) - : undefined, + body: serializers.labTests.simulateOrderProcess.Request.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/labTests/client/requests/CreateLabTestRequest.ts b/src/api/resources/labTests/client/requests/CreateLabTestRequest.ts index c3620f0bd..e411be05e 100644 --- a/src/api/resources/labTests/client/requests/CreateLabTestRequest.ts +++ b/src/api/resources/labTests/client/requests/CreateLabTestRequest.ts @@ -17,4 +17,6 @@ export interface CreateLabTestRequest { method: Vital.LabTestCollectionMethod; description: string; fasting?: boolean; + labAccountId?: string; + labSlug?: Vital.Labs; } diff --git a/src/api/resources/labTests/client/requests/CreateOrderRequestCompatible.ts b/src/api/resources/labTests/client/requests/CreateOrderRequestCompatible.ts index 56fb7ffcf..4de923e8a 100644 --- a/src/api/resources/labTests/client/requests/CreateOrderRequestCompatible.ts +++ b/src/api/resources/labTests/client/requests/CreateOrderRequestCompatible.ts @@ -5,8 +5,6 @@ import type * as Vital from "../../../../index.js"; /** * @example * { - * idempotencyKey: "X-Idempotency-Key", - * idempotencyError: "no-cache", * userId: "user_id", * patientDetails: { * firstName: "first_name", @@ -43,6 +41,7 @@ export interface CreateOrderRequestCompatible { activateBy?: string; aoeAnswers?: Vital.AoEAnswer[]; passthrough?: string; + clinicalNotes?: string; labAccountId?: string; creatorMemberId?: string; patientDetails: Vital.PatientDetailsWithValidation; diff --git a/src/api/resources/labTests/client/requests/LabTestsBookPscAppointmentRequest.ts b/src/api/resources/labTests/client/requests/LabTestsBookPscAppointmentRequest.ts new file mode 100644 index 000000000..4dc4c2812 --- /dev/null +++ b/src/api/resources/labTests/client/requests/LabTestsBookPscAppointmentRequest.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../../../index.js"; + +/** + * @example + * { + * body: { + * bookingKey: "booking_key" + * } + * } + */ +export interface LabTestsBookPscAppointmentRequest { + /** [!] This feature (Idempotency Key) is under closed beta. Idempotency Key support for booking PSC appointment. */ + idempotencyKey?: string; + /** If `no-cache`, applies idempotency only to successful outcomes. */ + idempotencyError?: "no-cache"; + body: Vital.AppointmentBookingRequest; +} diff --git a/src/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.ts b/src/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.ts index f5cc0b343..93137c743 100644 --- a/src/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.ts +++ b/src/api/resources/labTests/client/requests/LabTestsGetMarkersRequest.ts @@ -3,6 +3,7 @@ /** * @example * { + * labSlug: "lab_slug", * name: "name", * aLaCarteEnabled: true, * labAccountId: "lab_account_id", @@ -13,6 +14,8 @@ export interface LabTestsGetMarkersRequest { /** The identifier Vital assigned to a lab partner. */ labId?: number | number[]; + /** The slug of the lab for these markers. If both lab_id and lab_slug are provided, lab_slug will be used. */ + labSlug?: string; /** The name or test code of an individual biomarker or a panel. */ name?: string; aLaCarteEnabled?: boolean; diff --git a/src/api/resources/labTests/client/requests/LabTestsGetOrdersRequest.ts b/src/api/resources/labTests/client/requests/LabTestsGetOrdersRequest.ts index d349a12a8..8b25e47a3 100644 --- a/src/api/resources/labTests/client/requests/LabTestsGetOrdersRequest.ts +++ b/src/api/resources/labTests/client/requests/LabTestsGetOrdersRequest.ts @@ -17,6 +17,7 @@ import type * as Vital from "../../../../index.js"; * userId: "user_id", * patientName: "patient_name", * shippingRecipientName: "shipping_recipient_name", + * orderTransactionId: "order_transaction_id", * page: 1, * size: 1 * } @@ -54,6 +55,8 @@ export interface LabTestsGetOrdersRequest { shippingRecipientName?: string; /** Filter by order ids. */ orderIds?: string | string[]; + /** Filter by order transaction ID */ + orderTransactionId?: string; page?: number; size?: number; } diff --git a/src/api/resources/labTests/client/requests/LabTestsGetPscAppointmentAvailabilityRequest.ts b/src/api/resources/labTests/client/requests/LabTestsGetPscAppointmentAvailabilityRequest.ts index cddd03bf3..7b1eedfea 100644 --- a/src/api/resources/labTests/client/requests/LabTestsGetPscAppointmentAvailabilityRequest.ts +++ b/src/api/resources/labTests/client/requests/LabTestsGetPscAppointmentAvailabilityRequest.ts @@ -8,7 +8,8 @@ import type * as Vital from "../../../../index.js"; * lab: "quest", * startDate: "start_date", * zipCode: "zip_code", - * radius: "10" + * radius: "10", + * allowStale: true * } */ export interface LabTestsGetPscAppointmentAvailabilityRequest { @@ -20,6 +21,8 @@ export interface LabTestsGetPscAppointmentAvailabilityRequest { siteCodes?: string | string[]; /** Zip code of the area to check */ zipCode?: string; - /** Radius in which to search. (meters) */ + /** Radius in which to search in miles */ radius?: Vital.AllowedRadius; + /** If true, allows cached availability data to be returned. */ + allowStale?: boolean; } diff --git a/src/api/resources/labTests/client/requests/RequestAppointmentRequest.ts b/src/api/resources/labTests/client/requests/RequestAppointmentRequest.ts index 0ec400c4a..468b30078 100644 --- a/src/api/resources/labTests/client/requests/RequestAppointmentRequest.ts +++ b/src/api/resources/labTests/client/requests/RequestAppointmentRequest.ts @@ -18,4 +18,5 @@ export interface RequestAppointmentRequest { /** At-home phlebotomy appointment address. */ address: Vital.UsAddress; provider: Vital.AppointmentProvider; + appointmentNotes?: string; } diff --git a/src/api/resources/labTests/client/requests/index.ts b/src/api/resources/labTests/client/requests/index.ts index b28ecbce1..b8a8624a2 100644 --- a/src/api/resources/labTests/client/requests/index.ts +++ b/src/api/resources/labTests/client/requests/index.ts @@ -2,6 +2,7 @@ export type { ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelR export type { CreateLabTestRequest } from "./CreateLabTestRequest.js"; export type { CreateOrderRequestCompatible } from "./CreateOrderRequestCompatible.js"; export type { ImportOrderBody } from "./ImportOrderBody.js"; +export type { LabTestsBookPscAppointmentRequest } from "./LabTestsBookPscAppointmentRequest.js"; export type { LabTestsGetAreaInfoRequest } from "./LabTestsGetAreaInfoRequest.js"; export type { LabTestsGetByIdRequest } from "./LabTestsGetByIdRequest.js"; export type { LabTestsGetLabelsPdfRequest } from "./LabTestsGetLabelsPdfRequest.js"; diff --git a/src/api/resources/link/client/Client.ts b/src/api/resources/link/client/Client.ts index e70755286..4e235f9e5 100644 --- a/src/api/resources/link/client/Client.ts +++ b/src/api/resources/link/client/Client.ts @@ -32,8 +32,7 @@ export class LinkClient { * @example * await client.link.listBulkOps({ * nextCursor: "next_cursor", - * pageSize: 1, - * teamId: "infer_from_context" + * pageSize: 1 * }) */ public listBulkOps( @@ -47,22 +46,11 @@ export class LinkClient { request: Vital.LinkListBulkOpsRequest = {}, requestOptions?: LinkClient.RequestOptions, ): Promise> { - const { nextCursor, pageSize, teamId } = request; - const _queryParams: Record = {}; - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (pageSize != null) { - _queryParams.page_size = pageSize; - } - - if (teamId != null) { - _queryParams.team_id = serializers.LinkListBulkOpsRequestTeamId.jsonOrThrow(teamId, { - unrecognizedObjectKeys: "strip", - }); - } - + const { nextCursor, pageSize } = request; + const _queryParams: Record = { + next_cursor: nextCursor, + page_size: pageSize, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -129,7 +117,6 @@ export class LinkClient { * * @example * await client.link.bulkImport({ - * teamId: "infer_from_context", * provider: "oura", * connections: [{ * userId: "user_id", @@ -151,14 +138,6 @@ export class LinkClient { request: Vital.BulkImportConnectionsBody, requestOptions?: LinkClient.RequestOptions, ): Promise> { - const { teamId, ..._body } = request; - const _queryParams: Record = {}; - if (teamId != null) { - _queryParams.team_id = serializers.LinkBulkImportRequestTeamId.jsonOrThrow(teamId, { - unrecognizedObjectKeys: "strip", - }); - } - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -175,9 +154,9 @@ export class LinkClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.BulkImportConnectionsBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), + body: serializers.BulkImportConnectionsBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -228,7 +207,6 @@ export class LinkClient { * * @example * await client.link.bulkTriggerHistoricalPull({ - * teamId: "infer_from_context", * userIds: ["user_ids"], * provider: "oura" * }) @@ -244,14 +222,6 @@ export class LinkClient { request: Vital.BulkTriggerHistoricalPullBody, requestOptions?: LinkClient.RequestOptions, ): Promise> { - const { teamId, ..._body } = request; - const _queryParams: Record = {}; - if (teamId != null) { - _queryParams.team_id = serializers.LinkBulkTriggerHistoricalPullRequestTeamId.jsonOrThrow(teamId, { - unrecognizedObjectKeys: "strip", - }); - } - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -268,9 +238,9 @@ export class LinkClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.BulkTriggerHistoricalPullBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), + body: serializers.BulkTriggerHistoricalPullBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -318,7 +288,6 @@ export class LinkClient { * * @example * await client.link.bulkExport({ - * teamId: "infer_from_context", * provider: "oura" * }) */ @@ -333,14 +302,6 @@ export class LinkClient { request: Vital.BulkExportConnectionsBody, requestOptions?: LinkClient.RequestOptions, ): Promise> { - const { teamId, ..._body } = request; - const _queryParams: Record = {}; - if (teamId != null) { - _queryParams.team_id = serializers.LinkBulkExportRequestTeamId.jsonOrThrow(teamId, { - unrecognizedObjectKeys: "strip", - }); - } - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -357,9 +318,9 @@ export class LinkClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.BulkExportConnectionsBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), + body: serializers.BulkExportConnectionsBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -410,7 +371,6 @@ export class LinkClient { * * @example * await client.link.bulkPause({ - * teamId: "infer_from_context", * userIds: ["user_ids"], * provider: "oura" * }) @@ -426,14 +386,6 @@ export class LinkClient { request: Vital.BulkPauseConnectionsBody, requestOptions?: LinkClient.RequestOptions, ): Promise> { - const { teamId, ..._body } = request; - const _queryParams: Record = {}; - if (teamId != null) { - _queryParams.team_id = serializers.LinkBulkPauseRequestTeamId.jsonOrThrow(teamId, { - unrecognizedObjectKeys: "strip", - }); - } - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -450,9 +402,9 @@ export class LinkClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.BulkPauseConnectionsBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), + body: serializers.BulkPauseConnectionsBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -686,12 +638,10 @@ export class LinkClient { requestOptions?: LinkClient.RequestOptions, ): Promise> { const { userId, expiresAt } = request; - const _queryParams: Record = {}; - _queryParams.user_id = userId; - if (expiresAt != null) { - _queryParams.expires_at = expiresAt.toISOString(); - } - + const _queryParams: Record = { + user_id: userId, + expires_at: expiresAt != null ? expiresAt?.toISOString() : undefined, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -847,9 +797,7 @@ export class LinkClient { * @throws {@link Vital.UnprocessableEntityError} * * @example - * await client.link.tokenState({ - * vitalLinkToken: "x-vital-link-token" - * }) + * await client.link.tokenState() */ public tokenState( request: Vital.LinkTokenStateRequest = {}, @@ -930,7 +878,6 @@ export class LinkClient { * * @example * await client.link.emailAuth({ - * vitalLinkToken: "x-vital-link-token", * email: "email", * provider: "oura", * authType: "password" @@ -1010,7 +957,6 @@ export class LinkClient { * * @example * await client.link.passwordAuth({ - * vitalLinkToken: "x-vital-link-token", * username: "username", * password: "password", * provider: "oura", @@ -1091,9 +1037,7 @@ export class LinkClient { * @throws {@link Vital.UnprocessableEntityError} * * @example - * await client.link.generateOauthLink("oura", { - * vitalLinkToken: "x-vital-link-token" - * }) + * await client.link.generateOauthLink("oura") */ public generateOauthLink( oauth_provider: Vital.OAuthProviders, @@ -1182,7 +1126,6 @@ export class LinkClient { * * @example * await client.link.connectPasswordProvider("whoop", { - * vitalLinkToken: "x-vital-link-token", * username: "username", * password: "password" * }) @@ -1277,7 +1220,6 @@ export class LinkClient { * * @example * await client.link.completePasswordProviderMfa("whoop", { - * vitalLinkToken: "x-vital-link-token", * mfaCode: "mfa_code" * }) */ @@ -1373,7 +1315,6 @@ export class LinkClient { * * @example * await client.link.connectEmailAuthProvider("freestyle_libre", { - * vitalLinkToken: "x-vital-link-token", * email: "email" * }) */ @@ -1457,9 +1398,7 @@ export class LinkClient { * @throws {@link Vital.UnprocessableEntityError} * * @example - * await client.link.getAllProviders({ - * vitalLinkToken: "x-vital-link-token" - * }) + * await client.link.getAllProviders() */ public getAllProviders( request: Vital.LinkGetAllProvidersRequest = {}, @@ -1555,10 +1494,15 @@ export class LinkClient { request: Vital.ManualConnectionData, requestOptions?: LinkClient.RequestOptions, ): Promise>> { + const { vitalIosSdkVersion, vitalAndroidSdkVersion, ..._body } = request; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, this._options?.headers, + mergeOnlyDefinedHeaders({ + "x-vital-ios-sdk-version": vitalIosSdkVersion, + "x-vital-android-sdk-version": vitalAndroidSdkVersion, + }), requestOptions?.headers, ); const _response = await core.fetcher({ @@ -1573,7 +1517,7 @@ export class LinkClient { contentType: "application/json", queryParameters: requestOptions?.queryParams, requestType: "json", - body: serializers.ManualConnectionData.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: serializers.ManualConnectionData.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/link/client/requests/BulkExportConnectionsBody.ts b/src/api/resources/link/client/requests/BulkExportConnectionsBody.ts index 210442d56..f930448d7 100644 --- a/src/api/resources/link/client/requests/BulkExportConnectionsBody.ts +++ b/src/api/resources/link/client/requests/BulkExportConnectionsBody.ts @@ -5,12 +5,10 @@ import type * as Vital from "../../../../index.js"; /** * @example * { - * teamId: "infer_from_context", * provider: "oura" * } */ export interface BulkExportConnectionsBody { - teamId?: Vital.LinkBulkExportRequestTeamId; userIds?: string[]; provider: Vital.OAuthProviders; nextToken?: string; diff --git a/src/api/resources/link/client/requests/BulkImportConnectionsBody.ts b/src/api/resources/link/client/requests/BulkImportConnectionsBody.ts index c142bdbcf..09afa7dbf 100644 --- a/src/api/resources/link/client/requests/BulkImportConnectionsBody.ts +++ b/src/api/resources/link/client/requests/BulkImportConnectionsBody.ts @@ -5,7 +5,6 @@ import type * as Vital from "../../../../index.js"; /** * @example * { - * teamId: "infer_from_context", * provider: "oura", * connections: [{ * userId: "user_id", @@ -17,7 +16,6 @@ import type * as Vital from "../../../../index.js"; * } */ export interface BulkImportConnectionsBody { - teamId?: Vital.LinkBulkImportRequestTeamId; provider: Vital.OAuthProviders; connections: Vital.ConnectionRecipe[]; /** diff --git a/src/api/resources/link/client/requests/BulkPauseConnectionsBody.ts b/src/api/resources/link/client/requests/BulkPauseConnectionsBody.ts index 47b9fdc61..14c91503f 100644 --- a/src/api/resources/link/client/requests/BulkPauseConnectionsBody.ts +++ b/src/api/resources/link/client/requests/BulkPauseConnectionsBody.ts @@ -5,13 +5,11 @@ import type * as Vital from "../../../../index.js"; /** * @example * { - * teamId: "infer_from_context", * userIds: ["user_ids"], * provider: "oura" * } */ export interface BulkPauseConnectionsBody { - teamId?: Vital.LinkBulkPauseRequestTeamId; userIds: string[]; provider: Vital.OAuthProviders; } diff --git a/src/api/resources/link/client/requests/BulkTriggerHistoricalPullBody.ts b/src/api/resources/link/client/requests/BulkTriggerHistoricalPullBody.ts index 5525b7a7a..5a8b4b7cc 100644 --- a/src/api/resources/link/client/requests/BulkTriggerHistoricalPullBody.ts +++ b/src/api/resources/link/client/requests/BulkTriggerHistoricalPullBody.ts @@ -5,13 +5,11 @@ import type * as Vital from "../../../../index.js"; /** * @example * { - * teamId: "infer_from_context", * userIds: ["user_ids"], * provider: "oura" * } */ export interface BulkTriggerHistoricalPullBody { - teamId?: Vital.LinkBulkTriggerHistoricalPullRequestTeamId; userIds: string[]; provider: Vital.OAuthProviders; /** diff --git a/src/api/resources/link/client/requests/CompletePasswordProviderMfaBody.ts b/src/api/resources/link/client/requests/CompletePasswordProviderMfaBody.ts index dc1af0010..b7cb78a73 100644 --- a/src/api/resources/link/client/requests/CompletePasswordProviderMfaBody.ts +++ b/src/api/resources/link/client/requests/CompletePasswordProviderMfaBody.ts @@ -3,7 +3,6 @@ /** * @example * { - * vitalLinkToken: "x-vital-link-token", * mfaCode: "mfa_code" * } */ diff --git a/src/api/resources/link/client/requests/EmailAuthLink.ts b/src/api/resources/link/client/requests/EmailAuthLink.ts index fa113fb49..06b03c741 100644 --- a/src/api/resources/link/client/requests/EmailAuthLink.ts +++ b/src/api/resources/link/client/requests/EmailAuthLink.ts @@ -5,7 +5,6 @@ import type * as Vital from "../../../../index.js"; /** * @example * { - * vitalLinkToken: "x-vital-link-token", * email: "email", * provider: "oura", * authType: "password" diff --git a/src/api/resources/link/client/requests/EmailProviderAuthLink.ts b/src/api/resources/link/client/requests/EmailProviderAuthLink.ts index a7b954aa3..a45a7c3cd 100644 --- a/src/api/resources/link/client/requests/EmailProviderAuthLink.ts +++ b/src/api/resources/link/client/requests/EmailProviderAuthLink.ts @@ -5,7 +5,6 @@ import type * as Vital from "../../../../index.js"; /** * @example * { - * vitalLinkToken: "x-vital-link-token", * email: "email" * } */ diff --git a/src/api/resources/link/client/requests/IndividualProviderData.ts b/src/api/resources/link/client/requests/IndividualProviderData.ts index c4883437c..dab88d377 100644 --- a/src/api/resources/link/client/requests/IndividualProviderData.ts +++ b/src/api/resources/link/client/requests/IndividualProviderData.ts @@ -5,7 +5,6 @@ import type * as Vital from "../../../../index.js"; /** * @example * { - * vitalLinkToken: "x-vital-link-token", * username: "username", * password: "password" * } diff --git a/src/api/resources/link/client/requests/LinkGenerateOauthLinkRequest.ts b/src/api/resources/link/client/requests/LinkGenerateOauthLinkRequest.ts index c03216a68..cdc2538ae 100644 --- a/src/api/resources/link/client/requests/LinkGenerateOauthLinkRequest.ts +++ b/src/api/resources/link/client/requests/LinkGenerateOauthLinkRequest.ts @@ -2,9 +2,7 @@ /** * @example - * { - * vitalLinkToken: "x-vital-link-token" - * } + * {} */ export interface LinkGenerateOauthLinkRequest { vitalLinkToken?: string; diff --git a/src/api/resources/link/client/requests/LinkGetAllProvidersRequest.ts b/src/api/resources/link/client/requests/LinkGetAllProvidersRequest.ts index aaaa5543f..b87282bb0 100644 --- a/src/api/resources/link/client/requests/LinkGetAllProvidersRequest.ts +++ b/src/api/resources/link/client/requests/LinkGetAllProvidersRequest.ts @@ -2,9 +2,7 @@ /** * @example - * { - * vitalLinkToken: "x-vital-link-token" - * } + * {} */ export interface LinkGetAllProvidersRequest { vitalLinkToken?: string; diff --git a/src/api/resources/link/client/requests/LinkListBulkOpsRequest.ts b/src/api/resources/link/client/requests/LinkListBulkOpsRequest.ts index 8cc415a3f..f6a945816 100644 --- a/src/api/resources/link/client/requests/LinkListBulkOpsRequest.ts +++ b/src/api/resources/link/client/requests/LinkListBulkOpsRequest.ts @@ -1,17 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import type * as Vital from "../../../../index.js"; - /** * @example * { * nextCursor: "next_cursor", - * pageSize: 1, - * teamId: "infer_from_context" + * pageSize: 1 * } */ export interface LinkListBulkOpsRequest { nextCursor?: string; pageSize?: number; - teamId?: Vital.LinkListBulkOpsRequestTeamId; } diff --git a/src/api/resources/link/client/requests/LinkTokenStateRequest.ts b/src/api/resources/link/client/requests/LinkTokenStateRequest.ts index d7bf9c60b..820ad5d5a 100644 --- a/src/api/resources/link/client/requests/LinkTokenStateRequest.ts +++ b/src/api/resources/link/client/requests/LinkTokenStateRequest.ts @@ -2,9 +2,7 @@ /** * @example - * { - * vitalLinkToken: "x-vital-link-token" - * } + * {} */ export interface LinkTokenStateRequest { vitalLinkToken?: string; diff --git a/src/api/resources/link/client/requests/ManualConnectionData.ts b/src/api/resources/link/client/requests/ManualConnectionData.ts index 2a46af1fa..2a726f9cf 100644 --- a/src/api/resources/link/client/requests/ManualConnectionData.ts +++ b/src/api/resources/link/client/requests/ManualConnectionData.ts @@ -7,6 +7,9 @@ * } */ export interface ManualConnectionData { + vitalIosSdkVersion?: string; + vitalAndroidSdkVersion?: string; userId: string; providerId?: string; + grantedPermissions?: string[]; } diff --git a/src/api/resources/link/client/requests/PasswordAuthLink.ts b/src/api/resources/link/client/requests/PasswordAuthLink.ts index 60e422505..86d59056d 100644 --- a/src/api/resources/link/client/requests/PasswordAuthLink.ts +++ b/src/api/resources/link/client/requests/PasswordAuthLink.ts @@ -5,7 +5,6 @@ import type * as Vital from "../../../../index.js"; /** * @example * { - * vitalLinkToken: "x-vital-link-token", * username: "username", * password: "password", * provider: "oura", diff --git a/src/api/resources/link/index.ts b/src/api/resources/link/index.ts index d9adb1af9..914b8c3c7 100644 --- a/src/api/resources/link/index.ts +++ b/src/api/resources/link/index.ts @@ -1,2 +1 @@ export * from "./client/index.js"; -export * from "./types/index.js"; diff --git a/src/api/resources/link/types/LinkBulkExportRequestTeamId.ts b/src/api/resources/link/types/LinkBulkExportRequestTeamId.ts deleted file mode 100644 index 99ac40818..000000000 --- a/src/api/resources/link/types/LinkBulkExportRequestTeamId.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const LinkBulkExportRequestTeamId = { - InferFromContext: "infer_from_context", -} as const; -export type LinkBulkExportRequestTeamId = - (typeof LinkBulkExportRequestTeamId)[keyof typeof LinkBulkExportRequestTeamId]; diff --git a/src/api/resources/link/types/LinkBulkImportRequestTeamId.ts b/src/api/resources/link/types/LinkBulkImportRequestTeamId.ts deleted file mode 100644 index 4ec17badd..000000000 --- a/src/api/resources/link/types/LinkBulkImportRequestTeamId.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const LinkBulkImportRequestTeamId = { - InferFromContext: "infer_from_context", -} as const; -export type LinkBulkImportRequestTeamId = - (typeof LinkBulkImportRequestTeamId)[keyof typeof LinkBulkImportRequestTeamId]; diff --git a/src/api/resources/link/types/LinkBulkPauseRequestTeamId.ts b/src/api/resources/link/types/LinkBulkPauseRequestTeamId.ts deleted file mode 100644 index 7b673c415..000000000 --- a/src/api/resources/link/types/LinkBulkPauseRequestTeamId.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const LinkBulkPauseRequestTeamId = { - InferFromContext: "infer_from_context", -} as const; -export type LinkBulkPauseRequestTeamId = (typeof LinkBulkPauseRequestTeamId)[keyof typeof LinkBulkPauseRequestTeamId]; diff --git a/src/api/resources/link/types/LinkBulkTriggerHistoricalPullRequestTeamId.ts b/src/api/resources/link/types/LinkBulkTriggerHistoricalPullRequestTeamId.ts deleted file mode 100644 index d61f6a01b..000000000 --- a/src/api/resources/link/types/LinkBulkTriggerHistoricalPullRequestTeamId.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const LinkBulkTriggerHistoricalPullRequestTeamId = { - InferFromContext: "infer_from_context", -} as const; -export type LinkBulkTriggerHistoricalPullRequestTeamId = - (typeof LinkBulkTriggerHistoricalPullRequestTeamId)[keyof typeof LinkBulkTriggerHistoricalPullRequestTeamId]; diff --git a/src/api/resources/link/types/LinkListBulkOpsRequestTeamId.ts b/src/api/resources/link/types/LinkListBulkOpsRequestTeamId.ts deleted file mode 100644 index b729b92e2..000000000 --- a/src/api/resources/link/types/LinkListBulkOpsRequestTeamId.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const LinkListBulkOpsRequestTeamId = { - InferFromContext: "infer_from_context", -} as const; -export type LinkListBulkOpsRequestTeamId = - (typeof LinkListBulkOpsRequestTeamId)[keyof typeof LinkListBulkOpsRequestTeamId]; diff --git a/src/api/resources/link/types/index.ts b/src/api/resources/link/types/index.ts deleted file mode 100644 index 2d2b3b335..000000000 --- a/src/api/resources/link/types/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./LinkBulkExportRequestTeamId.js"; -export * from "./LinkBulkImportRequestTeamId.js"; -export * from "./LinkBulkPauseRequestTeamId.js"; -export * from "./LinkBulkTriggerHistoricalPullRequestTeamId.js"; -export * from "./LinkListBulkOpsRequestTeamId.js"; diff --git a/src/api/resources/meal/client/Client.ts b/src/api/resources/meal/client/Client.ts index f90c4c297..c7c45f63e 100644 --- a/src/api/resources/meal/client/Client.ts +++ b/src/api/resources/meal/client/Client.ts @@ -53,16 +53,11 @@ export class MealClient { requestOptions?: MealClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/menstrualCycle/client/Client.ts b/src/api/resources/menstrualCycle/client/Client.ts index dc6ae2e0f..e61d818c4 100644 --- a/src/api/resources/menstrualCycle/client/Client.ts +++ b/src/api/resources/menstrualCycle/client/Client.ts @@ -51,16 +51,11 @@ export class MenstrualCycleClient { requestOptions?: MenstrualCycleClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/orderTransaction/client/Client.ts b/src/api/resources/orderTransaction/client/Client.ts new file mode 100644 index 000000000..e0b0b2aac --- /dev/null +++ b/src/api/resources/orderTransaction/client/Client.ts @@ -0,0 +1,261 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import * as environments from "../../../../environments.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as serializers from "../../../../serialization/index.js"; +import * as Vital from "../../../index.js"; + +export declare namespace OrderTransactionClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class OrderTransactionClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: OrderTransactionClient.Options = {}) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * @param {string} transaction_id + * @param {OrderTransactionClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Vital.UnprocessableEntityError} + * + * @example + * await client.orderTransaction.getTransaction("transaction_id") + */ + public getTransaction( + transaction_id: string, + requestOptions?: OrderTransactionClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTransaction(transaction_id, requestOptions)); + } + + private async __getTransaction( + transaction_id: string, + requestOptions?: OrderTransactionClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.VitalEnvironment.Production, + `v3/order_transaction/${core.url.encodePathParam(transaction_id)}`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GetOrderTransactionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Vital.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.VitalError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v3/order_transaction/{transaction_id}", + ); + } + + /** + * @param {string} transaction_id + * @param {OrderTransactionClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Vital.UnprocessableEntityError} + * + * @example + * await client.orderTransaction.getTransactionResult("transaction_id") + */ + public getTransactionResult( + transaction_id: string, + requestOptions?: OrderTransactionClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTransactionResult(transaction_id, requestOptions)); + } + + private async __getTransactionResult( + transaction_id: string, + requestOptions?: OrderTransactionClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.VitalEnvironment.Production, + `v3/order_transaction/${core.url.encodePathParam(transaction_id)}/result`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.LabResultsRaw.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Vital.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.VitalError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v3/order_transaction/{transaction_id}/result", + ); + } + + /** + * @throws {@link Vital.UnprocessableEntityError} + */ + public getTransactionResultPdf( + transaction_id: string, + requestOptions?: OrderTransactionClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getTransactionResultPdf(transaction_id, requestOptions)); + } + + private async __getTransactionResultPdf( + transaction_id: string, + requestOptions?: OrderTransactionClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.VitalEnvironment.Production, + `v3/order_transaction/${core.url.encodePathParam(transaction_id)}/result/pdf`, + ), + method: "GET", + headers: _headers, + queryParameters: requestOptions?.queryParams, + responseType: "binary-response", + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 422: + throw new Vital.UnprocessableEntityError( + serializers.HttpValidationError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.VitalError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v3/order_transaction/{transaction_id}/result/pdf", + ); + } +} diff --git a/src/api/resources/orderTransaction/client/index.ts b/src/api/resources/orderTransaction/client/index.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/src/api/resources/orderTransaction/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/orderTransaction/index.ts b/src/api/resources/orderTransaction/index.ts new file mode 100644 index 000000000..914b8c3c7 --- /dev/null +++ b/src/api/resources/orderTransaction/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/api/resources/profile/client/Client.ts b/src/api/resources/profile/client/Client.ts index 0fb834a0b..bf445b88d 100644 --- a/src/api/resources/profile/client/Client.ts +++ b/src/api/resources/profile/client/Client.ts @@ -51,11 +51,9 @@ export class ProfileClient { requestOptions?: ProfileClient.RequestOptions, ): Promise> { const { provider } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - + const _queryParams: Record = { + provider, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -142,11 +140,9 @@ export class ProfileClient { requestOptions?: ProfileClient.RequestOptions, ): Promise> { const { provider } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - + const _queryParams: Record = { + provider, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/providers/client/Client.ts b/src/api/resources/providers/client/Client.ts index ddd556bec..2db418b01 100644 --- a/src/api/resources/providers/client/Client.ts +++ b/src/api/resources/providers/client/Client.ts @@ -48,11 +48,9 @@ export class ProvidersClient { requestOptions?: ProvidersClient.RequestOptions, ): Promise> { const { sourceType } = request; - const _queryParams: Record = {}; - if (sourceType != null) { - _queryParams.source_type = sourceType; - } - + const _queryParams: Record = { + source_type: sourceType, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/sleep/client/Client.ts b/src/api/resources/sleep/client/Client.ts index fec2b40bc..4ebe9a2fe 100644 --- a/src/api/resources/sleep/client/Client.ts +++ b/src/api/resources/sleep/client/Client.ts @@ -53,16 +53,11 @@ export class SleepClient { requestOptions?: SleepClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -151,16 +146,11 @@ export class SleepClient { requestOptions?: SleepClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/sleepCycle/client/Client.ts b/src/api/resources/sleepCycle/client/Client.ts index c120863d9..b859df7d2 100644 --- a/src/api/resources/sleepCycle/client/Client.ts +++ b/src/api/resources/sleepCycle/client/Client.ts @@ -53,16 +53,11 @@ export class SleepCycleClient { requestOptions?: SleepCycleClient.RequestOptions, ): Promise> { const { startDate, endDate, provider } = request; - const _queryParams: Record = {}; - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - - if (provider != null) { - _queryParams.provider = provider; - } - + const _queryParams: Record = { + start_date: startDate, + end_date: endDate, + provider, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/team/client/Client.ts b/src/api/resources/team/client/Client.ts index c37d45c59..cd1957567 100644 --- a/src/api/resources/team/client/Client.ts +++ b/src/api/resources/team/client/Client.ts @@ -32,9 +32,7 @@ export class TeamClient { * @throws {@link Vital.UnprocessableEntityError} * * @example - * await client.team.getLinkConfig({ - * vitalLinkToken: "x-vital-link-token" - * }) + * await client.team.getLinkConfig() */ public getLinkConfig( request: Vital.TeamGetLinkConfigRequest = {}, @@ -210,11 +208,9 @@ export class TeamClient { requestOptions?: TeamClient.RequestOptions, ): Promise> { const { queryId } = request; - const _queryParams: Record = {}; - if (queryId != null) { - _queryParams.query_id = queryId; - } - + const _queryParams: Record = { + query_id: queryId, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -356,13 +352,12 @@ export class TeamClient { requestOptions?: TeamClient.RequestOptions, ): Promise[]>> { const { dataType } = request; - const _queryParams: Record = {}; - if (dataType != null) { - _queryParams.data_type = serializers.PriorityResource.jsonOrThrow(dataType, { - unrecognizedObjectKeys: "strip", - }); - } - + const _queryParams: Record = { + data_type: + dataType != null + ? serializers.PriorityResource.jsonOrThrow(dataType, { unrecognizedObjectKeys: "strip" }) + : undefined, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/team/client/requests/TeamGetLinkConfigRequest.ts b/src/api/resources/team/client/requests/TeamGetLinkConfigRequest.ts index f1f2e15f3..79fb9bd53 100644 --- a/src/api/resources/team/client/requests/TeamGetLinkConfigRequest.ts +++ b/src/api/resources/team/client/requests/TeamGetLinkConfigRequest.ts @@ -2,9 +2,7 @@ /** * @example - * { - * vitalLinkToken: "x-vital-link-token" - * } + * {} */ export interface TeamGetLinkConfigRequest { vitalLinkToken?: string; diff --git a/src/api/resources/user/client/Client.ts b/src/api/resources/user/client/Client.ts index a3886ae84..2374dc610 100644 --- a/src/api/resources/user/client/Client.ts +++ b/src/api/resources/user/client/Client.ts @@ -49,15 +49,10 @@ export class UserClient { requestOptions?: UserClient.RequestOptions, ): Promise> { const { offset, limit } = request; - const _queryParams: Record = {}; - if (offset != null) { - _queryParams.offset = offset; - } - - if (limit != null) { - _queryParams.limit = limit; - } - + const _queryParams: Record = { + offset, + limit, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -556,11 +551,9 @@ export class UserClient { requestOptions?: UserClient.RequestOptions, ): Promise> { const { isPrimary } = request; - const _queryParams: Record = {}; - if (isPrimary != null) { - _queryParams.is_primary = isPrimary; - } - + const _queryParams: Record = { + is_primary: isPrimary, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1149,15 +1142,10 @@ export class UserClient { requestOptions?: UserClient.RequestOptions, ): Promise> { const { userId, clientUserId } = request; - const _queryParams: Record = {}; - if (userId != null) { - _queryParams.user_id = userId; - } - - if (clientUserId != null) { - _queryParams.client_user_id = clientUserId; - } - + const _queryParams: Record = { + user_id: userId, + client_user_id: clientUserId, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1245,11 +1233,9 @@ export class UserClient { requestOptions?: UserClient.RequestOptions, ): Promise> { const { timeout } = request; - const _queryParams: Record = {}; - if (timeout != null) { - _queryParams.timeout = timeout; - } - + const _queryParams: Record = { + timeout, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/user/client/requests/UserInfoCreateRequest.ts b/src/api/resources/user/client/requests/UserInfoCreateRequest.ts index 686579300..3ea59d978 100644 --- a/src/api/resources/user/client/requests/UserInfoCreateRequest.ts +++ b/src/api/resources/user/client/requests/UserInfoCreateRequest.ts @@ -27,7 +27,7 @@ export interface UserInfoCreateRequest { phoneNumber: string; gender: string; dob: string; - address: Vital.Address; + address: Vital.UserAddress; medicalProxy?: Vital.GuarantorDetails; race?: Vital.Race; ethnicity?: Vital.Ethnicity; diff --git a/src/api/resources/vitals/client/Client.ts b/src/api/resources/vitals/client/Client.ts index 2bd0e379a..93371e1f0 100644 --- a/src/api/resources/vitals/client/Client.ts +++ b/src/api/resources/vitals/client/Client.ts @@ -55,24 +55,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -166,24 +155,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -279,24 +257,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -390,24 +357,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -501,24 +457,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -612,24 +557,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -725,24 +659,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -836,24 +759,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -947,24 +859,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1058,24 +959,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1169,24 +1059,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1280,24 +1159,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1393,24 +1261,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1506,24 +1363,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1619,24 +1465,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1730,24 +1565,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1843,24 +1667,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -1954,24 +1767,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2065,24 +1867,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2176,24 +1967,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2287,24 +2067,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2398,24 +2167,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2509,24 +2267,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2620,24 +2367,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2731,24 +2467,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2842,24 +2567,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -2953,24 +2667,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3064,24 +2767,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3175,24 +2867,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3286,24 +2967,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3397,24 +3067,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3508,24 +3167,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3615,28 +3263,17 @@ export class VitalsClient { private async __caloriesActiveGrouped( user_id: string, - request: Vital.VitalsCaloriesActiveGroupedRequest, - requestOptions?: VitalsClient.RequestOptions, - ): Promise> { - const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + request: Vital.VitalsCaloriesActiveGroupedRequest, + requestOptions?: VitalsClient.RequestOptions, + ): Promise> { + const { cursor, nextCursor, provider, startDate, endDate } = request; + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3730,24 +3367,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3841,24 +3467,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -3952,24 +3567,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4063,24 +3667,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4174,24 +3767,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4285,24 +3867,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4396,24 +3967,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4507,24 +4067,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4618,24 +4167,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4729,24 +4267,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4840,24 +4367,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -4953,24 +4469,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5064,24 +4569,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5175,24 +4669,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5286,24 +4769,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5397,24 +4869,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5510,24 +4971,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5621,24 +5071,13 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { cursor, nextCursor, provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (cursor != null) { - _queryParams.cursor = cursor; - } - - if (nextCursor != null) { - _queryParams.next_cursor = nextCursor; - } - - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + cursor, + next_cursor: nextCursor, + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5730,16 +5169,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5831,16 +5265,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -5932,16 +5361,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -6033,16 +5457,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -6134,16 +5553,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -6235,16 +5649,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -6336,16 +5745,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -6437,16 +5841,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -6538,16 +5937,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -6639,16 +6033,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -6740,16 +6129,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -6841,16 +6225,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -6937,16 +6316,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -7033,16 +6407,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -7134,16 +6503,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -7230,16 +6594,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -7331,16 +6690,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -7432,16 +6786,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -7533,16 +6882,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -7634,16 +6978,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -7735,16 +7074,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -7836,16 +7170,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -7937,16 +7266,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -8038,16 +7362,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -8139,16 +7458,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -8240,16 +7554,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -8341,16 +7650,11 @@ export class VitalsClient { requestOptions?: VitalsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/resources/workouts/client/Client.ts b/src/api/resources/workouts/client/Client.ts index c4193d7fc..e276e55ea 100644 --- a/src/api/resources/workouts/client/Client.ts +++ b/src/api/resources/workouts/client/Client.ts @@ -53,16 +53,11 @@ export class WorkoutsClient { requestOptions?: WorkoutsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, @@ -156,16 +151,11 @@ export class WorkoutsClient { requestOptions?: WorkoutsClient.RequestOptions, ): Promise> { const { provider, startDate, endDate } = request; - const _queryParams: Record = {}; - if (provider != null) { - _queryParams.provider = provider; - } - - _queryParams.start_date = startDate; - if (endDate != null) { - _queryParams.end_date = endDate; - } - + const _queryParams: Record = { + provider, + start_date: startDate, + end_date: endDate, + }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( _authRequest.headers, diff --git a/src/api/types/Address.ts b/src/api/types/Address.ts index c6fe647a0..7bb1aaf67 100644 --- a/src/api/types/Address.ts +++ b/src/api/types/Address.ts @@ -7,4 +7,5 @@ export interface Address { zip: string; city: string; state: string; + accessNotes?: string; } diff --git a/src/api/types/AggregateExprArg.ts b/src/api/types/AggregateExprArg.ts index 89711aaac..757607a57 100644 --- a/src/api/types/AggregateExprArg.ts +++ b/src/api/types/AggregateExprArg.ts @@ -4,6 +4,7 @@ import type * as Vital from "../index.js"; export type AggregateExprArg = | Vital.SleepColumnExpr + | Vital.DerivedReadinessColumnExpr | Vital.ActivityColumnExpr | Vital.WorkoutColumnExpr | Vital.BodyColumnExpr @@ -13,9 +14,11 @@ export type AggregateExprArg = | Vital.ChronotypeValueMacroExpr | Vital.AsleepAtValueMacroExpr | Vital.AwakeAtValueMacroExpr + | Vital.AwakeningsValueMacroExpr | Vital.UnrecognizedValueMacroExpr | Vital.DiscreteTimeseriesExpr | Vital.IntervalTimeseriesExpr + | Vital.InsulinInjectionTimeseriesExpr | Vital.BloodPressureTimeseriesExpr | Vital.TemperatureTimeseriesExpr | Vital.WorkoutDurationTimeseriesExpr diff --git a/src/api/types/AppointmentBookingRequest.ts b/src/api/types/AppointmentBookingRequest.ts index 2e452c752..1d614f120 100644 --- a/src/api/types/AppointmentBookingRequest.ts +++ b/src/api/types/AppointmentBookingRequest.ts @@ -2,4 +2,11 @@ export interface AppointmentBookingRequest { bookingKey: string; + appointmentNotes?: string; + /** If true, the endpoint attempts to confirm the booking within the `sync_confirmation_timeout_millisecond` window. If confirmation is not received in time, a pending appointment is returned and booking continues asynchronously. If false (default), the endpoint waits for confirmation or returns a 500 error on failure. */ + asyncConfirmation?: boolean; + /** Maximum time (in milliseconds) to wait for booking confirmation before returning a pending appointment. Only applies when `async_confirmation` is true. Defaults to 2500ms. Range: 1000-10000ms. */ + syncConfirmationTimeoutMillisecond?: number; + /** Maximum time (in milliseconds) to attempt asynchronous booking before cancelling the pending appointment. Only applies when `async_confirmation` is true. Defaults to 15 minutes. Range: 60000-172800000ms. */ + asyncConfirmationTimeoutMillisecond?: number; } diff --git a/src/api/types/AppointmentProvider.ts b/src/api/types/AppointmentProvider.ts index 76358bab6..82ca7165b 100644 --- a/src/api/types/AppointmentProvider.ts +++ b/src/api/types/AppointmentProvider.ts @@ -5,5 +5,6 @@ export const AppointmentProvider = { Getlabs: "getlabs", Phlebfinders: "phlebfinders", Quest: "quest", + SonoraQuest: "sonora_quest", } as const; export type AppointmentProvider = (typeof AppointmentProvider)[keyof typeof AppointmentProvider]; diff --git a/src/api/types/AppointmentPscLabs.ts b/src/api/types/AppointmentPscLabs.ts index 08d6132f7..6fe610107 100644 --- a/src/api/types/AppointmentPscLabs.ts +++ b/src/api/types/AppointmentPscLabs.ts @@ -1,6 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -/** - * ℹ️ This enum is non-exhaustive. - */ -export type AppointmentPscLabs = "quest"; +/** ℹ️ This enum is non-exhaustive. */ +export const AppointmentPscLabs = { + Quest: "quest", + SonoraQuest: "sonora_quest", +} as const; +export type AppointmentPscLabs = (typeof AppointmentPscLabs)[keyof typeof AppointmentPscLabs]; diff --git a/src/api/types/AppointmentRescheduleRequest.ts b/src/api/types/AppointmentRescheduleRequest.ts index edc78a716..1ed06b18b 100644 --- a/src/api/types/AppointmentRescheduleRequest.ts +++ b/src/api/types/AppointmentRescheduleRequest.ts @@ -2,4 +2,5 @@ export interface AppointmentRescheduleRequest { bookingKey: string; + appointmentNotes?: string; } diff --git a/src/api/types/AwakeningsValueMacroExpr.ts b/src/api/types/AwakeningsValueMacroExpr.ts new file mode 100644 index 000000000..deec37dc3 --- /dev/null +++ b/src/api/types/AwakeningsValueMacroExpr.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface AwakeningsValueMacroExpr { + valueMacro: "awakenings"; + version?: "automatic"; +} diff --git a/src/api/types/CanonicalCandidate.ts b/src/api/types/CanonicalCandidate.ts new file mode 100644 index 000000000..490dce500 --- /dev/null +++ b/src/api/types/CanonicalCandidate.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CanonicalCandidate { + loincSetHash: string; + displayName: string; + aliases?: string[]; + loincCodes?: string[]; + providerIds?: string[]; + loincComponents?: string[]; + loincGroups?: string[]; + cptCodes?: string[]; + popularityScore: number; + confidence: number; +} diff --git a/src/api/types/ClientFacingActivity.ts b/src/api/types/ClientFacingActivity.ts index 0f81af1e3..43eea83d5 100644 --- a/src/api/types/ClientFacingActivity.ts +++ b/src/api/types/ClientFacingActivity.ts @@ -36,7 +36,7 @@ export interface ClientFacingActivity { timezoneOffset?: number; /** Heart rate daily summary. */ heartRate?: Vital.ClientFacingHeartRate; - wheelchairUse?: boolean; + wheelchairUse?: true; wheelchairPush?: number; createdAt: Date; updatedAt: Date; diff --git a/src/api/types/ClientFacingAppointment.ts b/src/api/types/ClientFacingAppointment.ts index 91ec73f90..f0b28ec2c 100644 --- a/src/api/types/ClientFacingAppointment.ts +++ b/src/api/types/ClientFacingAppointment.ts @@ -6,6 +6,7 @@ export interface ClientFacingAppointment { id: string; userId: string; orderId: string; + orderTransactionId?: string; address: Vital.UsAddress; location: Vital.LngLat; /** Time is in UTC */ @@ -19,6 +20,7 @@ export interface ClientFacingAppointment { providerId: string; externalId?: string; canReschedule: boolean; + appointmentNotes?: string; eventStatus: Vital.AppointmentEventStatus; eventData?: Record; events: Vital.ClientFacingAppointmentEvent[]; diff --git a/src/api/types/ClientFacingDeviceSourceType.ts b/src/api/types/ClientFacingDeviceSourceType.ts index d0d0a4d18..da43b1a6b 100644 --- a/src/api/types/ClientFacingDeviceSourceType.ts +++ b/src/api/types/ClientFacingDeviceSourceType.ts @@ -11,6 +11,7 @@ export const ClientFacingDeviceSourceType = { Cuff: "cuff", ManualScan: "manual_scan", Automatic: "automatic", + InsulinPump: "insulin_pump", Scale: "scale", ChestStrap: "chest_strap", Ring: "ring", diff --git a/src/api/types/ClientFacingElectrocardiogramSourceType.ts b/src/api/types/ClientFacingElectrocardiogramSourceType.ts index 9683bd8b9..1905593f7 100644 --- a/src/api/types/ClientFacingElectrocardiogramSourceType.ts +++ b/src/api/types/ClientFacingElectrocardiogramSourceType.ts @@ -11,6 +11,7 @@ export const ClientFacingElectrocardiogramSourceType = { Cuff: "cuff", ManualScan: "manual_scan", Automatic: "automatic", + InsulinPump: "insulin_pump", Scale: "scale", ChestStrap: "chest_strap", Ring: "ring", diff --git a/src/api/types/ClientFacingInsulinInjectionSample.ts b/src/api/types/ClientFacingInsulinInjectionSample.ts index 1dd6b92d6..4f9c336cb 100644 --- a/src/api/types/ClientFacingInsulinInjectionSample.ts +++ b/src/api/types/ClientFacingInsulinInjectionSample.ts @@ -7,7 +7,7 @@ export interface ClientFacingInsulinInjectionSample { id?: number; /** Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source. */ timezoneOffset?: number; - /** The type of insulin injection. ℹ️ This enum is non-exhaustive. */ + /** The insulin formulation type. ℹ️ This enum is non-exhaustive. */ type: Vital.ClientFacingInsulinInjectionSampleType; unit: "unit"; /** Depracated. The start time (inclusive) of the interval. */ @@ -18,4 +18,10 @@ export interface ClientFacingInsulinInjectionSample { end: Date; /** The recorded value for the interval. */ value: number; + /** How the insulin was delivered. ℹ️ This enum is non-exhaustive. */ + deliveryMode?: Vital.ClientFacingInsulinInjectionSampleDeliveryMode; + /** For bolus deliveries, whether the dose was standard or extended. ℹ️ This enum is non-exhaustive. */ + deliveryForm?: Vital.ClientFacingInsulinInjectionSampleDeliveryForm; + /** For bolus deliveries, what the bolus was intended for. ℹ️ This enum is non-exhaustive. */ + bolusPurpose?: Vital.ClientFacingInsulinInjectionSampleBolusPurpose; } diff --git a/src/api/types/ClientFacingInsulinInjectionSampleBolusPurpose.ts b/src/api/types/ClientFacingInsulinInjectionSampleBolusPurpose.ts new file mode 100644 index 000000000..5566c0b7b --- /dev/null +++ b/src/api/types/ClientFacingInsulinInjectionSampleBolusPurpose.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +export const ClientFacingInsulinInjectionSampleBolusPurpose = { + Meal: "meal", + Correction: "correction", + Mixed: "mixed", + Unknown: "unknown", +} as const; +export type ClientFacingInsulinInjectionSampleBolusPurpose = + (typeof ClientFacingInsulinInjectionSampleBolusPurpose)[keyof typeof ClientFacingInsulinInjectionSampleBolusPurpose]; diff --git a/src/api/types/ClientFacingInsulinInjectionSampleDeliveryForm.ts b/src/api/types/ClientFacingInsulinInjectionSampleDeliveryForm.ts new file mode 100644 index 000000000..f0c206e68 --- /dev/null +++ b/src/api/types/ClientFacingInsulinInjectionSampleDeliveryForm.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const ClientFacingInsulinInjectionSampleDeliveryForm = { + Standard: "standard", + Extended: "extended", +} as const; +export type ClientFacingInsulinInjectionSampleDeliveryForm = + (typeof ClientFacingInsulinInjectionSampleDeliveryForm)[keyof typeof ClientFacingInsulinInjectionSampleDeliveryForm]; diff --git a/src/api/types/ClientFacingInsulinInjectionSampleDeliveryMode.ts b/src/api/types/ClientFacingInsulinInjectionSampleDeliveryMode.ts new file mode 100644 index 000000000..0576f7f27 --- /dev/null +++ b/src/api/types/ClientFacingInsulinInjectionSampleDeliveryMode.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const ClientFacingInsulinInjectionSampleDeliveryMode = { + Basal: "basal", + Bolus: "bolus", +} as const; +export type ClientFacingInsulinInjectionSampleDeliveryMode = + (typeof ClientFacingInsulinInjectionSampleDeliveryMode)[keyof typeof ClientFacingInsulinInjectionSampleDeliveryMode]; diff --git a/src/api/types/ClientFacingInsulinInjectionSampleType.ts b/src/api/types/ClientFacingInsulinInjectionSampleType.ts index 6ae507cab..852a475a3 100644 --- a/src/api/types/ClientFacingInsulinInjectionSampleType.ts +++ b/src/api/types/ClientFacingInsulinInjectionSampleType.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -/** The type of insulin injection. ℹ️ This enum is non-exhaustive. */ +/** The insulin formulation type. ℹ️ This enum is non-exhaustive. */ export const ClientFacingInsulinInjectionSampleType = { RapidActing: "rapid_acting", LongActing: "long_acting", diff --git a/src/api/types/ClientFacingLabAccount.ts b/src/api/types/ClientFacingLabAccount.ts new file mode 100644 index 000000000..71775f242 --- /dev/null +++ b/src/api/types/ClientFacingLabAccount.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface ClientFacingLabAccount { + id: string; + lab: Vital.Labs; + orgId?: string; + status: Vital.LabAccountStatus; + delegatedFlow: Vital.LabAccountDelegatedFlow; + providerAccountId: string; + accountName?: string; + defaultClinicalNotes?: string; + businessUnits?: string[]; + allowedBilling: Record; + teamIdAllowlist: string[]; +} diff --git a/src/api/types/ClientFacingLabReportParsingJobCreatedEvent.ts b/src/api/types/ClientFacingLabReportParsingJobCreatedEvent.ts new file mode 100644 index 000000000..8a4ef99b9 --- /dev/null +++ b/src/api/types/ClientFacingLabReportParsingJobCreatedEvent.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface ClientFacingLabReportParsingJobCreatedEvent { + eventType: "lab_report.parsing_job.created"; + userId: string; + clientUserId: string; + teamId: string; + data: Vital.ParsingJob; +} diff --git a/src/api/types/ClientFacingLabReportParsingJobUpdatedEvent.ts b/src/api/types/ClientFacingLabReportParsingJobUpdatedEvent.ts new file mode 100644 index 000000000..43afb7978 --- /dev/null +++ b/src/api/types/ClientFacingLabReportParsingJobUpdatedEvent.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface ClientFacingLabReportParsingJobUpdatedEvent { + eventType: "lab_report.parsing_job.updated"; + userId: string; + clientUserId: string; + teamId: string; + data: Vital.ParsingJob; +} diff --git a/src/api/types/ClientFacingLabs.ts b/src/api/types/ClientFacingLabs.ts index 6d472026d..cb48affd4 100644 --- a/src/api/types/ClientFacingLabs.ts +++ b/src/api/types/ClientFacingLabs.ts @@ -5,5 +5,6 @@ export const ClientFacingLabs = { Quest: "quest", Labcorp: "labcorp", Bioreference: "bioreference", + SonoraQuest: "sonora_quest", } as const; export type ClientFacingLabs = (typeof ClientFacingLabs)[keyof typeof ClientFacingLabs]; diff --git a/src/api/types/ClientFacingMenstrualCycleSourceType.ts b/src/api/types/ClientFacingMenstrualCycleSourceType.ts index cc24aecc6..d3a1ebe7d 100644 --- a/src/api/types/ClientFacingMenstrualCycleSourceType.ts +++ b/src/api/types/ClientFacingMenstrualCycleSourceType.ts @@ -11,6 +11,7 @@ export const ClientFacingMenstrualCycleSourceType = { Cuff: "cuff", ManualScan: "manual_scan", Automatic: "automatic", + InsulinPump: "insulin_pump", Scale: "scale", ChestStrap: "chest_strap", Ring: "ring", diff --git a/src/api/types/ClientFacingOrder.ts b/src/api/types/ClientFacingOrder.ts index bf04b18c5..c036cf416 100644 --- a/src/api/types/ClientFacingOrder.ts +++ b/src/api/types/ClientFacingOrder.ts @@ -20,12 +20,16 @@ export interface ClientFacingOrder { sampleId?: string; /** Notes associated with the order */ notes?: string; + clinicalNotes?: string; /** When your order was created */ createdAt: Date; /** When your order was last updated. */ updatedAt: Date; events: Vital.ClientFacingOrderEvent[]; + /** The top-level status of the latest event for this order. This field is deprecated. Please use `last_event` instead. */ status?: Vital.OrderTopLevelStatus; + /** The latest event in the order's lifecycle. */ + lastEvent: Vital.ClientFacingOrderEvent; physician?: Vital.ClientFacingPhysician; /** Vital ID of the health insurance. */ healthInsuranceId?: string; @@ -50,4 +54,6 @@ export interface ClientFacingOrder { expectedResultByDate?: string; /** The latest date by which the order result is expected to be available. */ worstCaseResultByDate?: string; + origin?: Vital.OrderOrigin; + orderTransaction?: Vital.ClientFacingOrderTransaction; } diff --git a/src/api/types/ClientFacingOrderEvent.ts b/src/api/types/ClientFacingOrderEvent.ts index 5e8b1d0b9..ba17913fe 100644 --- a/src/api/types/ClientFacingOrderEvent.ts +++ b/src/api/types/ClientFacingOrderEvent.ts @@ -6,4 +6,5 @@ export interface ClientFacingOrderEvent { id: number; createdAt: Date; status: Vital.OrderStatus; + statusDetail?: Vital.OrderStatusDetail; } diff --git a/src/api/types/ClientFacingOrderInTransaction.ts b/src/api/types/ClientFacingOrderInTransaction.ts new file mode 100644 index 000000000..969dc1970 --- /dev/null +++ b/src/api/types/ClientFacingOrderInTransaction.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +/** + * Minimal order info for embedding in order_transaction payload. + */ +export interface ClientFacingOrderInTransaction { + id: string; + lowLevelStatus?: Vital.OrderLowLevelStatus; + lowLevelStatusCreatedAt?: Date; + origin?: Vital.OrderOrigin; + parentId?: string; + createdAt: Date; + updatedAt: Date; +} diff --git a/src/api/types/ClientFacingOrderTransaction.ts b/src/api/types/ClientFacingOrderTransaction.ts new file mode 100644 index 000000000..438665e6b --- /dev/null +++ b/src/api/types/ClientFacingOrderTransaction.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +/** + * Order transaction info. + */ +export interface ClientFacingOrderTransaction { + id: string; + status: Vital.OrderTransactionStatus; + orders: Vital.ClientFacingOrderInTransaction[]; +} diff --git a/src/api/types/ClientFacingProfile.ts b/src/api/types/ClientFacingProfile.ts index a2338b83e..e639ac29d 100644 --- a/src/api/types/ClientFacingProfile.ts +++ b/src/api/types/ClientFacingProfile.ts @@ -8,7 +8,7 @@ export interface ClientFacingProfile { userId: string; height?: number; birthDate?: string; - wheelchairUse?: boolean; + wheelchairUse?: true; gender?: Vital.Gender; sex?: Vital.Sex; source: Vital.ClientFacingSource; diff --git a/src/api/types/ClientFacingSleep.ts b/src/api/types/ClientFacingSleep.ts index a9c95e829..5d3a52f5e 100644 --- a/src/api/types/ClientFacingSleep.ts +++ b/src/api/types/ClientFacingSleep.ts @@ -37,6 +37,8 @@ export interface ClientFacingSleep { deep: number; /** A value between 1 and 100 representing how well the user slept. Currently only available for Withings, Oura, Whoop and Garmin::scalar */ score?: number; + /** A value between 0 and 100 representing the provider's recovery/readiness proxy. Currently sourced from Oura readiness score, Whoop recovery score, and Ultrahuman recovery::scalar */ + recoveryReadinessScore?: number; /** The lowest heart rate (5 minutes sliding average) registered during the sleep period::beats per minute */ hrLowest?: number; /** The average heart rate registered during the sleep period::beats per minute */ diff --git a/src/api/types/ClientFacingSleepCycleSourceType.ts b/src/api/types/ClientFacingSleepCycleSourceType.ts index a2f866fb3..e2c17f92d 100644 --- a/src/api/types/ClientFacingSleepCycleSourceType.ts +++ b/src/api/types/ClientFacingSleepCycleSourceType.ts @@ -11,6 +11,7 @@ export const ClientFacingSleepCycleSourceType = { Cuff: "cuff", ManualScan: "manual_scan", Automatic: "automatic", + InsulinPump: "insulin_pump", Scale: "scale", ChestStrap: "chest_strap", Ring: "ring", diff --git a/src/api/types/CompendiumSearchLabs.ts b/src/api/types/CompendiumSearchLabs.ts new file mode 100644 index 000000000..063a9bb64 --- /dev/null +++ b/src/api/types/CompendiumSearchLabs.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** ℹ️ This enum is non-exhaustive. */ +export const CompendiumSearchLabs = { + Labcorp: "labcorp", + Quest: "quest", + Bioreference: "bioreference", + SonoraQuest: "sonora_quest", +} as const; +export type CompendiumSearchLabs = (typeof CompendiumSearchLabs)[keyof typeof CompendiumSearchLabs]; diff --git a/src/api/types/ConvertCompendiumResponse.ts b/src/api/types/ConvertCompendiumResponse.ts new file mode 100644 index 000000000..8458bbd4c --- /dev/null +++ b/src/api/types/ConvertCompendiumResponse.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface ConvertCompendiumResponse { + sourceLabTestId?: string; + sourceLabId?: number; + targetLabId: number; + targetLabSlug: string; + sourceProviderIds?: string[]; + convertedProviderIds?: string[]; + unresolvedProviderIds?: string[]; + bySourceProviderId?: Record; +} diff --git a/src/api/types/DerivedReadinessColumnExpr.ts b/src/api/types/DerivedReadinessColumnExpr.ts new file mode 100644 index 000000000..b93be8dcf --- /dev/null +++ b/src/api/types/DerivedReadinessColumnExpr.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface DerivedReadinessColumnExpr { + /** ℹ️ This enum is non-exhaustive. */ + derivedReadiness: Vital.DerivedReadinessColumnExprDerivedReadiness; +} diff --git a/src/api/types/DerivedReadinessColumnExprDerivedReadiness.ts b/src/api/types/DerivedReadinessColumnExprDerivedReadiness.ts new file mode 100644 index 000000000..9a5760ae5 --- /dev/null +++ b/src/api/types/DerivedReadinessColumnExprDerivedReadiness.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** ℹ️ This enum is non-exhaustive. */ +export const DerivedReadinessColumnExprDerivedReadiness = { + Date: "date", + Chronotype: "chronotype", + SleepScore: "sleep_score", + RecoveryScore: "recovery_score", + RecoveryZone: "recovery_zone", + StressScore: "stress_score", + StrainScore: "strain_score", + StrainZone: "strain_zone", +} as const; +export type DerivedReadinessColumnExprDerivedReadiness = + (typeof DerivedReadinessColumnExprDerivedReadiness)[keyof typeof DerivedReadinessColumnExprDerivedReadiness]; diff --git a/src/api/types/GetOrderTransactionResponse.ts b/src/api/types/GetOrderTransactionResponse.ts new file mode 100644 index 000000000..128e96226 --- /dev/null +++ b/src/api/types/GetOrderTransactionResponse.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface GetOrderTransactionResponse { + id: string; + teamId: string; + status: Vital.OrderTransactionStatus; + orders?: Vital.OrderSummary[]; +} diff --git a/src/api/types/GetTeamLabAccountsResponse.ts b/src/api/types/GetTeamLabAccountsResponse.ts new file mode 100644 index 000000000..1389516a1 --- /dev/null +++ b/src/api/types/GetTeamLabAccountsResponse.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface GetTeamLabAccountsResponse { + data?: Vital.ClientFacingLabAccount[]; +} diff --git a/src/api/types/HistoricalPullCompleted.ts b/src/api/types/HistoricalPullCompleted.ts index 9a31bc768..78fdd0a4c 100644 --- a/src/api/types/HistoricalPullCompleted.ts +++ b/src/api/types/HistoricalPullCompleted.ts @@ -4,6 +4,6 @@ export interface HistoricalPullCompleted { userId: string; startDate: Date; endDate: Date; - isFinal: boolean; + isFinal: true; provider: string; } diff --git a/src/api/types/IndexColumnExprIndex.ts b/src/api/types/IndexColumnExprIndex.ts index dc2510478..81731c41b 100644 --- a/src/api/types/IndexColumnExprIndex.ts +++ b/src/api/types/IndexColumnExprIndex.ts @@ -3,6 +3,7 @@ /** ℹ️ This enum is non-exhaustive. */ export const IndexColumnExprIndex = { Sleep: "sleep", + DerivedReadiness: "derived_readiness", Activity: "activity", Workout: "workout", Body: "body", diff --git a/src/api/types/InsulinInjectionTimeseriesExpr.ts b/src/api/types/InsulinInjectionTimeseriesExpr.ts new file mode 100644 index 000000000..a1e162b22 --- /dev/null +++ b/src/api/types/InsulinInjectionTimeseriesExpr.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface InsulinInjectionTimeseriesExpr { + timeseries: "insulin_injection"; + /** ℹ️ This enum is non-exhaustive. */ + field: Vital.InsulinInjectionTimeseriesExprField; +} diff --git a/src/api/types/InsulinInjectionTimeseriesExprField.ts b/src/api/types/InsulinInjectionTimeseriesExprField.ts new file mode 100644 index 000000000..ee127599b --- /dev/null +++ b/src/api/types/InsulinInjectionTimeseriesExprField.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +/** ℹ️ This enum is non-exhaustive. */ +export const InsulinInjectionTimeseriesExprField = { + SourceProvider: "source_provider", + SourceType: "source_type", + SourceAppId: "source_app_id", + SourceWorkoutId: "source_workout_id", + SourceSport: "source_sport", + TimezoneOffset: "timezone_offset", + Type: "type", + Duration: "duration", + Value: "value", + DeliveryMode: "delivery_mode", + DeliveryForm: "delivery_form", + BolusPurpose: "bolus_purpose", +} as const; +export type InsulinInjectionTimeseriesExprField = + (typeof InsulinInjectionTimeseriesExprField)[keyof typeof InsulinInjectionTimeseriesExprField]; diff --git a/src/api/types/IntervalTimeseriesExprTimeseries.ts b/src/api/types/IntervalTimeseriesExprTimeseries.ts index 95ac47fc5..d20e8f0de 100644 --- a/src/api/types/IntervalTimeseriesExprTimeseries.ts +++ b/src/api/types/IntervalTimeseriesExprTimeseries.ts @@ -8,7 +8,6 @@ export const IntervalTimeseriesExprTimeseries = { HeartRateAlert: "heart_rate_alert", StandHour: "stand_hour", SleepBreathingDisturbance: "sleep_breathing_disturbance", - InsulinInjection: "insulin_injection", Water: "water", Caffeine: "caffeine", MindfulnessMinutes: "mindfulness_minutes", diff --git a/src/api/types/LabAccountDelegatedFlow.ts b/src/api/types/LabAccountDelegatedFlow.ts new file mode 100644 index 000000000..235eeb6d7 --- /dev/null +++ b/src/api/types/LabAccountDelegatedFlow.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Describes which parts of the lab testing flow are delegated to the customer. + * + * - ORDER_DELEGATED: Ordering using client's physicians, critical result follow up via Junction + * - RESULT_DELEGATED: Ordering using Junction's Physician Network, critical results handled by client + * - FULLY_DELEGATED: Order and critical results handled by client + * - NOT_DELEGATED: Junction handles both ordering and results ℹ️ This enum is non-exhaustive. + */ +export const LabAccountDelegatedFlow = { + OrderDelegated: "order_delegated", + ResultDelegated: "result_delegated", + FullyDelegated: "fully_delegated", + NotDelegated: "not_delegated", +} as const; +export type LabAccountDelegatedFlow = (typeof LabAccountDelegatedFlow)[keyof typeof LabAccountDelegatedFlow]; diff --git a/src/api/types/LabAccountStatus.ts b/src/api/types/LabAccountStatus.ts new file mode 100644 index 000000000..f815f189a --- /dev/null +++ b/src/api/types/LabAccountStatus.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** ℹ️ This enum is non-exhaustive. */ +export const LabAccountStatus = { + Active: "active", + Pending: "pending", + Suspended: "suspended", +} as const; +export type LabAccountStatus = (typeof LabAccountStatus)[keyof typeof LabAccountStatus]; diff --git a/src/api/types/LabResultsRaw.ts b/src/api/types/LabResultsRaw.ts index ed03f06b1..dae4bc5f9 100644 --- a/src/api/types/LabResultsRaw.ts +++ b/src/api/types/LabResultsRaw.ts @@ -7,4 +7,5 @@ export interface LabResultsRaw { results: Vital.LabResultsRawResults; missingResults?: Vital.MissingBiomarkerResult[]; sampleInformation?: Record; + orderTransaction?: Vital.ClientFacingOrderTransaction; } diff --git a/src/api/types/Labs.ts b/src/api/types/Labs.ts index 632ce3e2b..e138d4d47 100644 --- a/src/api/types/Labs.ts +++ b/src/api/types/Labs.ts @@ -6,6 +6,7 @@ export const Labs = { Spiriplex: "spiriplex", Ussl: "ussl", Quest: "quest", + SonoraQuest: "sonora_quest", Labcorp: "labcorp", Bioreference: "bioreference", UsBiotek: "us_biotek", @@ -14,5 +15,6 @@ export const Labs = { Ihd: "ihd", Nexus: "nexus", MyUti: "my_uti", + Crl: "crl", } as const; export type Labs = (typeof Labs)[keyof typeof Labs]; diff --git a/src/api/types/ManualProviders.ts b/src/api/types/ManualProviders.ts index 0b279bf2a..65f87cfd6 100644 --- a/src/api/types/ManualProviders.ts +++ b/src/api/types/ManualProviders.ts @@ -11,5 +11,6 @@ export const ManualProviders = { AppleHealthKit: "apple_health_kit", Manual: "manual", HealthConnect: "health_connect", + SamsungHealth: "samsung_health", } as const; export type ManualProviders = (typeof ManualProviders)[keyof typeof ManualProviders]; diff --git a/src/api/types/OrderLowLevelStatus.ts b/src/api/types/OrderLowLevelStatus.ts index 9eb365f27..305655830 100644 --- a/src/api/types/OrderLowLevelStatus.ts +++ b/src/api/types/OrderLowLevelStatus.ts @@ -27,5 +27,7 @@ export const OrderLowLevelStatus = { AwaitingRegistration: "awaiting_registration", Registered: "registered", RedrawAvailable: "redraw_available", + Corrected: "corrected", + LabProcessingBlocked: "lab_processing_blocked", } as const; export type OrderLowLevelStatus = (typeof OrderLowLevelStatus)[keyof typeof OrderLowLevelStatus]; diff --git a/src/api/types/OrderOrigin.ts b/src/api/types/OrderOrigin.ts new file mode 100644 index 000000000..02c0be71a --- /dev/null +++ b/src/api/types/OrderOrigin.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** ℹ️ This enum is non-exhaustive. */ +export const OrderOrigin = { + Initial: "initial", + Redraw: "redraw", + Recreation: "recreation", +} as const; +export type OrderOrigin = (typeof OrderOrigin)[keyof typeof OrderOrigin]; diff --git a/src/api/types/OrderStatus.ts b/src/api/types/OrderStatus.ts index 85066ebd6..9b7e859ee 100644 --- a/src/api/types/OrderStatus.ts +++ b/src/api/types/OrderStatus.ts @@ -1,6 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -/** ℹ️ This enum is non-exhaustive. */ +/** + * Used in combination with OrderStatusDetail to represent the current order state. + * OrderStatus is driven by a FSM whereas OrderStatusDetail is descriptive only. ℹ️ This enum is non-exhaustive. + */ export const OrderStatus = { ReceivedWalkInTestOrdered: "received.walk_in_test.ordered", ReceivedWalkInTestRequisitionCreated: "received.walk_in_test.requisition_created", @@ -34,6 +37,7 @@ export const OrderStatus = { CollectingSampleTestkitWithCustomer: "collecting_sample.testkit.with_customer", CollectingSampleTestkitTransitLab: "collecting_sample.testkit.transit_lab", SampleWithLabTestkitDeliveredToLab: "sample_with_lab.testkit.delivered_to_lab", + SampleWithLabTestkitLabProcessingBlocked: "sample_with_lab.testkit.lab_processing_blocked", CompletedTestkitCompleted: "completed.testkit.completed", FailedTestkitFailureToDeliverToCustomer: "failed.testkit.failure_to_deliver_to_customer", FailedTestkitFailureToDeliverToLab: "failed.testkit.failure_to_deliver_to_lab", @@ -51,5 +55,9 @@ export const OrderStatus = { CancelledOnSiteCollectionCancelled: "cancelled.on_site_collection.cancelled", SampleWithLabOnSiteCollectionPartialResults: "sample_with_lab.on_site_collection.partial_results", FailedOnSiteCollectionSampleError: "failed.on_site_collection.sample_error", + CompletedWalkInTestCorrected: "completed.walk_in_test.corrected", + CompletedAtHomePhlebotomyCorrected: "completed.at_home_phlebotomy.corrected", + CompletedOnSiteCollectionCorrected: "completed.on_site_collection.corrected", + CompletedTestkitCorrected: "completed.testkit.corrected", } as const; export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus]; diff --git a/src/api/types/OrderStatusDetail.ts b/src/api/types/OrderStatusDetail.ts new file mode 100644 index 000000000..8e447af65 --- /dev/null +++ b/src/api/types/OrderStatusDetail.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +/** A descriptive-only additional field to be used in combination with OrderStatus. Exposed in the API. ℹ️ This enum is non-exhaustive. */ +export const OrderStatusDetail = { + FulfillmentError: "fulfillment_error", + DateOfCollectionUnspecified: "date_of_collection_unspecified", + DemographicInformationUnspecified: "demographic_information_unspecified", + DemographicInformationMismatch: "demographic_information_mismatch", + SampleQuantityNotSufficient: "sample_quantity_not_sufficient", + SampleContaminated: "sample_contaminated", + SampleStabilityExceeded: "sample_stability_exceeded", + SampleHemolyzed: "sample_hemolyzed", + SampleImproperCollection: "sample_improper_collection", +} as const; +export type OrderStatusDetail = (typeof OrderStatusDetail)[keyof typeof OrderStatusDetail]; diff --git a/src/api/types/OrderSummary.ts b/src/api/types/OrderSummary.ts new file mode 100644 index 000000000..18df63fe7 --- /dev/null +++ b/src/api/types/OrderSummary.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +/** + * Lightweight order summary. + */ +export interface OrderSummary { + id: string; + origin?: Vital.OrderOrigin; + parentId?: string; + lastStatus: Vital.OrderLowLevelStatus; + lastStatusCreatedAt: Date; + updatedAt: Date; + createdAt: Date; +} diff --git a/src/api/types/OrderTransactionStatus.ts b/src/api/types/OrderTransactionStatus.ts new file mode 100644 index 000000000..1a983177a --- /dev/null +++ b/src/api/types/OrderTransactionStatus.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** ℹ️ This enum is non-exhaustive. */ +export const OrderTransactionStatus = { + Active: "active", + Completed: "completed", + Cancelled: "cancelled", +} as const; +export type OrderTransactionStatus = (typeof OrderTransactionStatus)[keyof typeof OrderTransactionStatus]; diff --git a/src/api/types/ParsingJob.ts b/src/api/types/ParsingJob.ts index 37be8ac13..af3fe140b 100644 --- a/src/api/types/ParsingJob.ts +++ b/src/api/types/ParsingJob.ts @@ -4,8 +4,8 @@ import type * as Vital from "../index.js"; export interface ParsingJob { id: string; - jobId: string; status: Vital.ParsingJobStatus; + failureReason?: Vital.ParsingJobFailureReason; data?: Vital.ParsedLabReportData; needsHumanReview: boolean; isReviewed: boolean; diff --git a/src/api/types/ParsingJobFailureReason.ts b/src/api/types/ParsingJobFailureReason.ts new file mode 100644 index 000000000..60df86aa6 --- /dev/null +++ b/src/api/types/ParsingJobFailureReason.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Machine-readable failure reasons for parsing jobs. ℹ️ This enum is non-exhaustive. */ +export const ParsingJobFailureReason = { + InvalidInput: "invalid_input", + LowQuality: "low_quality", + NotEnglish: "not_english", +} as const; +export type ParsingJobFailureReason = (typeof ParsingJobFailureReason)[keyof typeof ParsingJobFailureReason]; diff --git a/src/api/types/PasswordProviders.ts b/src/api/types/PasswordProviders.ts index 04e789851..1e83e3536 100644 --- a/src/api/types/PasswordProviders.ts +++ b/src/api/types/PasswordProviders.ts @@ -13,5 +13,6 @@ export const PasswordProviders = { MyFitnessPal: "my_fitness_pal", Kardia: "kardia", AbbottLibreview: "abbott_libreview", + TandemSource: "tandem_source", } as const; export type PasswordProviders = (typeof PasswordProviders)[keyof typeof PasswordProviders]; diff --git a/src/api/types/PatientAddress.ts b/src/api/types/PatientAddress.ts index a43a46aa4..f15195bcd 100644 --- a/src/api/types/PatientAddress.ts +++ b/src/api/types/PatientAddress.ts @@ -8,4 +8,5 @@ export interface PatientAddress { state: string; zip: string; country: string; + accessNotes?: string; } diff --git a/src/api/types/PatientAddressCompatible.ts b/src/api/types/PatientAddressCompatible.ts index c926608f3..e47528dd4 100644 --- a/src/api/types/PatientAddressCompatible.ts +++ b/src/api/types/PatientAddressCompatible.ts @@ -8,5 +8,6 @@ export interface PatientAddressCompatible { state: string; zip: string; country: string; + accessNotes?: string; phoneNumber?: string; } diff --git a/src/api/types/PatientAddressWithValidation.ts b/src/api/types/PatientAddressWithValidation.ts index 777627eff..9f377d1b5 100644 --- a/src/api/types/PatientAddressWithValidation.ts +++ b/src/api/types/PatientAddressWithValidation.ts @@ -8,5 +8,6 @@ export interface PatientAddressWithValidation { state: string; zip: string; country: string; + accessNotes?: string; phoneNumber?: string; } diff --git a/src/api/types/PayorCodeExternalProvider.ts b/src/api/types/PayorCodeExternalProvider.ts index 39ccd83ba..35f678be3 100644 --- a/src/api/types/PayorCodeExternalProvider.ts +++ b/src/api/types/PayorCodeExternalProvider.ts @@ -7,5 +7,7 @@ export const PayorCodeExternalProvider = { Stedi: "stedi", Waystar: "waystar", ClaimMd: "claim_md", + Apero: "apero", + Pverify: "pverify", } as const; export type PayorCodeExternalProvider = (typeof PayorCodeExternalProvider)[keyof typeof PayorCodeExternalProvider]; diff --git a/src/api/types/PerLabCandidate.ts b/src/api/types/PerLabCandidate.ts new file mode 100644 index 000000000..992d95292 --- /dev/null +++ b/src/api/types/PerLabCandidate.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PerLabCandidate { + markerId: number; + labId: number; + labSlug?: string; + name: string; + resultNames?: string[]; + providerId?: string; + loincSetHash: string; + loincCodes?: string[]; + loincComponents?: string[]; + loincGroups?: string[]; + cptCodes?: string[]; + relation: string; + confidence: number; + reasonCodes?: string[]; + markerPopularityScore: number; +} diff --git a/src/api/types/Placeholder.ts b/src/api/types/Placeholder.ts index 13eb015fc..fbb4d40c2 100644 --- a/src/api/types/Placeholder.ts +++ b/src/api/types/Placeholder.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. export interface Placeholder { - placeholder: boolean; + placeholder: true; } diff --git a/src/api/types/ProviderIdConversionResponse.ts b/src/api/types/ProviderIdConversionResponse.ts new file mode 100644 index 000000000..d95e8964c --- /dev/null +++ b/src/api/types/ProviderIdConversionResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface ProviderIdConversionResponse { + sourceProviderId: string; + candidates?: Vital.PerLabCandidate[]; +} diff --git a/src/api/types/Providers.ts b/src/api/types/Providers.ts index b9ee3df65..f16f4bd0f 100644 --- a/src/api/types/Providers.ts +++ b/src/api/types/Providers.ts @@ -13,6 +13,7 @@ export const Providers = { Zwift: "zwift", FreestyleLibre: "freestyle_libre", AbbottLibreview: "abbott_libreview", + TandemSource: "tandem_source", FreestyleLibreBle: "freestyle_libre_ble", EightSleep: "eight_sleep", Withings: "withings", @@ -32,6 +33,7 @@ export const Providers = { Hammerhead: "hammerhead", MyFitnessPal: "my_fitness_pal", HealthConnect: "health_connect", + SamsungHealth: "samsung_health", Polar: "polar", Cronometer: "cronometer", Kardia: "kardia", diff --git a/src/api/types/QueryGroupByItem.ts b/src/api/types/QueryGroupByItem.ts index da109696a..413ca9277 100644 --- a/src/api/types/QueryGroupByItem.ts +++ b/src/api/types/QueryGroupByItem.ts @@ -6,6 +6,7 @@ export type QueryGroupByItem = | Vital.DateTruncExpr | Vital.DatePartExpr | Vital.SleepColumnExpr + | Vital.DerivedReadinessColumnExpr | Vital.ActivityColumnExpr | Vital.WorkoutColumnExpr | Vital.BodyColumnExpr @@ -15,9 +16,11 @@ export type QueryGroupByItem = | Vital.ChronotypeValueMacroExpr | Vital.AsleepAtValueMacroExpr | Vital.AwakeAtValueMacroExpr + | Vital.AwakeningsValueMacroExpr | Vital.UnrecognizedValueMacroExpr | Vital.DiscreteTimeseriesExpr | Vital.IntervalTimeseriesExpr + | Vital.InsulinInjectionTimeseriesExpr | Vital.BloodPressureTimeseriesExpr | Vital.TemperatureTimeseriesExpr | Vital.WorkoutDurationTimeseriesExpr diff --git a/src/api/types/QuerySelectItem.ts b/src/api/types/QuerySelectItem.ts index a2d61389a..977b32bb8 100644 --- a/src/api/types/QuerySelectItem.ts +++ b/src/api/types/QuerySelectItem.ts @@ -6,6 +6,7 @@ export type QuerySelectItem = | Vital.AggregateExpr | Vital.GroupKeyColumnExpr | Vital.SleepColumnExpr + | Vital.DerivedReadinessColumnExpr | Vital.ActivityColumnExpr | Vital.WorkoutColumnExpr | Vital.BodyColumnExpr @@ -15,9 +16,11 @@ export type QuerySelectItem = | Vital.ChronotypeValueMacroExpr | Vital.AsleepAtValueMacroExpr | Vital.AwakeAtValueMacroExpr + | Vital.AwakeningsValueMacroExpr | Vital.UnrecognizedValueMacroExpr | Vital.DiscreteTimeseriesExpr | Vital.IntervalTimeseriesExpr + | Vital.InsulinInjectionTimeseriesExpr | Vital.BloodPressureTimeseriesExpr | Vital.TemperatureTimeseriesExpr | Vital.WorkoutDurationTimeseriesExpr diff --git a/src/api/types/RelatedCandidate.ts b/src/api/types/RelatedCandidate.ts new file mode 100644 index 000000000..da0f142a8 --- /dev/null +++ b/src/api/types/RelatedCandidate.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface RelatedCandidate { + canonical: Vital.CanonicalCandidate; + relation: string; + confidence: number; + reasonCodes?: string[]; +} diff --git a/src/api/types/ResultMetadata.ts b/src/api/types/ResultMetadata.ts index 4519ba1d3..79c71d8d9 100644 --- a/src/api/types/ResultMetadata.ts +++ b/src/api/types/ResultMetadata.ts @@ -1,10 +1,14 @@ // This file was auto-generated by Fern from our API Definition. +import type * as Vital from "../index.js"; + export interface ResultMetadata { - patientFirstName: string; - patientLastName: string; - dob: string; - labName: string; + patientFirstName?: string; + patientLastName?: string; + dob?: string; + /** ℹ️ This enum is non-exhaustive. */ + gender?: Vital.ResultMetadataGender; + labName?: string; dateReported?: string; dateCollected?: string; specimenNumber?: string; diff --git a/src/api/types/ResultMetadataGender.ts b/src/api/types/ResultMetadataGender.ts new file mode 100644 index 000000000..74e80856d --- /dev/null +++ b/src/api/types/ResultMetadataGender.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** ℹ️ This enum is non-exhaustive. */ +export const ResultMetadataGender = { + Male: "male", + Female: "female", + Other: "other", +} as const; +export type ResultMetadataGender = (typeof ResultMetadataGender)[keyof typeof ResultMetadataGender]; diff --git a/src/api/types/SearchCompendiumResponse.ts b/src/api/types/SearchCompendiumResponse.ts new file mode 100644 index 000000000..23ad9ea9b --- /dev/null +++ b/src/api/types/SearchCompendiumResponse.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../index.js"; + +export interface SearchCompendiumResponse { + mode: Vital.SearchMode; + selectedCanonical?: Vital.CanonicalCandidate; + canonicalCandidates?: Vital.CanonicalCandidate[]; + perLab?: Record; + related?: Vital.RelatedCandidate[]; +} diff --git a/src/api/types/SearchMode.ts b/src/api/types/SearchMode.ts new file mode 100644 index 000000000..959979435 --- /dev/null +++ b/src/api/types/SearchMode.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +/** ℹ️ This enum is non-exhaustive. */ +export const SearchMode = { + Canonical: "canonical", + Crosswalk: "crosswalk", +} as const; +export type SearchMode = (typeof SearchMode)[keyof typeof SearchMode]; diff --git a/src/api/types/SleepColumnExprSleep.ts b/src/api/types/SleepColumnExprSleep.ts index 7f3289803..4a5fe22fe 100644 --- a/src/api/types/SleepColumnExprSleep.ts +++ b/src/api/types/SleepColumnExprSleep.ts @@ -27,6 +27,7 @@ export const SleepColumnExprSleep = { SkinTemperatureDelta: "skin_temperature_delta", RespiratoryRate: "respiratory_rate", Score: "score", + RecoveryReadinessScore: "recovery_readiness_score", SourceType: "source_type", SourceProvider: "source_provider", SourceAppId: "source_app_id", diff --git a/src/api/types/UsAddress.ts b/src/api/types/UsAddress.ts index 826286fec..3136282e4 100644 --- a/src/api/types/UsAddress.ts +++ b/src/api/types/UsAddress.ts @@ -8,4 +8,5 @@ export interface UsAddress { zipCode: string; /** Deprecated. Use `second_line` instead to provide the unit number. Subject to removal after 20 Nov 2023. */ unit?: string; + accessNotes?: string; } diff --git a/src/api/types/UsState.ts b/src/api/types/UsState.ts new file mode 100644 index 000000000..dd368f7e9 --- /dev/null +++ b/src/api/types/UsState.ts @@ -0,0 +1,56 @@ +// This file was auto-generated by Fern from our API Definition. + +/** ℹ️ This enum is non-exhaustive. */ +export const UsState = { + Al: "AL", + Ak: "AK", + Az: "AZ", + Ar: "AR", + Ca: "CA", + Co: "CO", + Ct: "CT", + De: "DE", + Fl: "FL", + Ga: "GA", + Hi: "HI", + Id: "ID", + Il: "IL", + In: "IN", + Ia: "IA", + Ks: "KS", + Ky: "KY", + La: "LA", + Me: "ME", + Md: "MD", + Ma: "MA", + Mi: "MI", + Mn: "MN", + Ms: "MS", + Mo: "MO", + Mt: "MT", + Ne: "NE", + Nv: "NV", + Nh: "NH", + Nj: "NJ", + Nm: "NM", + Ny: "NY", + Nc: "NC", + Nd: "ND", + Oh: "OH", + Ok: "OK", + Or: "OR", + Pa: "PA", + Ri: "RI", + Sc: "SC", + Sd: "SD", + Tn: "TN", + Tx: "TX", + Ut: "UT", + Vt: "VT", + Va: "VA", + Wa: "WA", + Wv: "WV", + Wi: "WI", + Wy: "WY", +} as const; +export type UsState = (typeof UsState)[keyof typeof UsState]; diff --git a/src/api/types/UserAddress.ts b/src/api/types/UserAddress.ts new file mode 100644 index 000000000..a720afd28 --- /dev/null +++ b/src/api/types/UserAddress.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface UserAddress { + firstLine: string; + secondLine?: string; + country: string; + zip: string; + city: string; + state: string; + accessNotes?: string; +} diff --git a/src/api/types/UserInfo.ts b/src/api/types/UserInfo.ts index 1c6fd0f64..bfd978de9 100644 --- a/src/api/types/UserInfo.ts +++ b/src/api/types/UserInfo.ts @@ -9,7 +9,7 @@ export interface UserInfo { phoneNumber: string; gender: string; dob: string; - address: Vital.Address; + address: Vital.UserAddress; medicalProxy?: Vital.GuarantorDetails; race?: Vital.Race; ethnicity?: Vital.Ethnicity; diff --git a/src/api/types/UserRefreshErrorResponse.ts b/src/api/types/UserRefreshErrorResponse.ts index e12b87d0d..ed1ff81ef 100644 --- a/src/api/types/UserRefreshErrorResponse.ts +++ b/src/api/types/UserRefreshErrorResponse.ts @@ -2,7 +2,7 @@ export interface UserRefreshErrorResponse { /** Whether operation was successful or not */ - success: boolean; + success: false; /** A unique ID representing the end user. Typically this will be a user ID from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_user_id. */ userId: string; error: string; diff --git a/src/api/types/UserRefreshSuccessResponse.ts b/src/api/types/UserRefreshSuccessResponse.ts index e9e6f001f..797f2dbef 100644 --- a/src/api/types/UserRefreshSuccessResponse.ts +++ b/src/api/types/UserRefreshSuccessResponse.ts @@ -2,7 +2,7 @@ export interface UserRefreshSuccessResponse { /** Whether operation was successful or not */ - success: boolean; + success: true; /** A unique ID representing the end user. Typically this will be a user ID from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_user_id. */ userId: string; refreshedSources: string[]; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index fd115a275..70a886ce1 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -28,6 +28,7 @@ export * from "./AttemptStatus.js"; export * from "./AuthType.js"; export * from "./Availability.js"; export * from "./AwakeAtValueMacroExpr.js"; +export * from "./AwakeningsValueMacroExpr.js"; export * from "./BasalBodyTemperatureEntry.js"; export * from "./Billing.js"; export * from "./BiomarkerResult.js"; @@ -42,6 +43,7 @@ export * from "./BulkOp.js"; export * from "./BulkOpStatus.js"; export * from "./BulkOpsResponse.js"; export * from "./BulkOpType.js"; +export * from "./CanonicalCandidate.js"; export * from "./CervicalMucusEntry.js"; export * from "./CervicalMucusEntryQuality.js"; export * from "./ChronotypeValueMacroExpr.js"; @@ -209,10 +211,16 @@ export * from "./ClientFacingInsulinInjectionChanged.js"; export * from "./ClientFacingInsulinInjectionChangedEventType.js"; export * from "./ClientFacingInsulinInjectionHistoricalPullCompleted.js"; export * from "./ClientFacingInsulinInjectionSample.js"; +export * from "./ClientFacingInsulinInjectionSampleBolusPurpose.js"; +export * from "./ClientFacingInsulinInjectionSampleDeliveryForm.js"; +export * from "./ClientFacingInsulinInjectionSampleDeliveryMode.js"; export * from "./ClientFacingInsulinInjectionSampleType.js"; export * from "./ClientFacingInsurance.js"; export * from "./ClientFacingLab.js"; +export * from "./ClientFacingLabAccount.js"; export * from "./ClientFacingLabLocation.js"; +export * from "./ClientFacingLabReportParsingJobCreatedEvent.js"; +export * from "./ClientFacingLabReportParsingJobUpdatedEvent.js"; export * from "./ClientFacingLabs.js"; export * from "./ClientFacingLabTest.js"; export * from "./ClientFacingLeanBodyMassChanged.js"; @@ -248,6 +256,8 @@ export * from "./ClientFacingOrderChanged.js"; export * from "./ClientFacingOrderChangedEventType.js"; export * from "./ClientFacingOrderDetails.js"; export * from "./ClientFacingOrderEvent.js"; +export * from "./ClientFacingOrderInTransaction.js"; +export * from "./ClientFacingOrderTransaction.js"; export * from "./ClientFacingPatientDetailsCompatible.js"; export * from "./ClientFacingPayor.js"; export * from "./ClientFacingPayorCodeSource.js"; @@ -384,6 +394,7 @@ export * from "./ClientUserIdConflictResponse.js"; export * from "./ClientWorkoutResponse.js"; export * from "./ClinicalInformation.js"; export * from "./CompanyDetails.js"; +export * from "./CompendiumSearchLabs.js"; export * from "./ConnectedSourceClientFacing.js"; export * from "./ConnectionRecipe.js"; export * from "./Consent.js"; @@ -394,6 +405,7 @@ export * from "./ContinuousQueryTaskHistoryResponse.js"; export * from "./ContinuousQueryTaskStatus.js"; export * from "./ContraceptiveEntry.js"; export * from "./ContraceptiveEntryType.js"; +export * from "./ConvertCompendiumResponse.js"; export * from "./CreateUserPortalUrlResponse.js"; export * from "./DatePartExpr.js"; export * from "./DatePartExprArg.js"; @@ -404,6 +416,8 @@ export * from "./DaySlots.js"; export * from "./DelegatedFlowType.js"; export * from "./DemoConnectionStatus.js"; export * from "./DemoProviders.js"; +export * from "./DerivedReadinessColumnExpr.js"; +export * from "./DerivedReadinessColumnExprDerivedReadiness.js"; export * from "./DetectedDeviationEntry.js"; export * from "./DetectedDeviationEntryDeviation.js"; export * from "./DeviceV2InDb.js"; @@ -424,6 +438,8 @@ export * from "./Gender.js"; export * from "./GenderIdentity.js"; export * from "./GetMarkersResponse.js"; export * from "./GetOrdersResponse.js"; +export * from "./GetOrderTransactionResponse.js"; +export * from "./GetTeamLabAccountsResponse.js"; export * from "./GroupedAFibBurden.js"; export * from "./GroupedAFibBurdenResponse.js"; export * from "./GroupedBasalBodyTemperature.js"; @@ -547,12 +563,16 @@ export * from "./IcdExcludesViolation.js"; export * from "./IcdExcludesWarning.js"; export * from "./IndexColumnExpr.js"; export * from "./IndexColumnExprIndex.js"; +export * from "./InsulinInjectionTimeseriesExpr.js"; +export * from "./InsulinInjectionTimeseriesExprField.js"; export * from "./IntermenstrualBleedingEntry.js"; export * from "./Interpretation.js"; export * from "./IntervalTimeseriesExpr.js"; export * from "./IntervalTimeseriesExprField.js"; export * from "./IntervalTimeseriesExprTimeseries.js"; export * from "./Jpeg.js"; +export * from "./LabAccountDelegatedFlow.js"; +export * from "./LabAccountStatus.js"; export * from "./LabLocationCapability.js"; export * from "./LabLocationMetadata.js"; export * from "./LabReportResult.js"; @@ -590,15 +610,20 @@ export * from "./NotFoundErrorBody.js"; export * from "./OAuthProviders.js"; export * from "./OrderActivationType.js"; export * from "./OrderLowLevelStatus.js"; +export * from "./OrderOrigin.js"; export * from "./OrderSetRequest.js"; export * from "./OrderStatus.js"; +export * from "./OrderStatusDetail.js"; +export * from "./OrderSummary.js"; export * from "./OrderTopLevelStatus.js"; +export * from "./OrderTransactionStatus.js"; export * from "./OvulationTestEntry.js"; export * from "./OvulationTestEntryTestResult.js"; export * from "./PaginatedUsersResponse.js"; export * from "./ParentBiomarkerData.js"; export * from "./ParsedLabReportData.js"; export * from "./ParsingJob.js"; +export * from "./ParsingJobFailureReason.js"; export * from "./ParsingJobStatus.js"; export * from "./PasswordProviders.js"; export * from "./PatientAddress.js"; @@ -609,6 +634,7 @@ export * from "./PayorCodeExternalProvider.js"; export * from "./PerformingLaboratory.js"; export * from "./Period.js"; export * from "./PeriodUnit.js"; +export * from "./PerLabCandidate.js"; export * from "./PhlebotomyAreaInfo.js"; export * from "./PhlebotomyProviderInfo.js"; export * from "./PhysicianCreateRequest.js"; @@ -624,6 +650,7 @@ export * from "./ProfileInDb.js"; export * from "./ProviderConnectionCreated.js"; export * from "./ProviderConnectionError.js"; export * from "./ProviderConnectionErrorErrorType.js"; +export * from "./ProviderIdConversionResponse.js"; export * from "./ProviderLinkResponse.js"; export * from "./ProviderLinkResponseErrorType.js"; export * from "./ProviderLinkResponseState.js"; @@ -648,11 +675,13 @@ export * from "./RawProfile.js"; export * from "./RawSleep.js"; export * from "./RawWorkout.js"; export * from "./Region.js"; +export * from "./RelatedCandidate.js"; export * from "./RelativeTimeframe.js"; export * from "./ResendWebhookResponse.js"; export * from "./ResourceAvailability.js"; export * from "./ResponsibleRelationship.js"; export * from "./ResultMetadata.js"; +export * from "./ResultMetadataGender.js"; export * from "./ResultType.js"; export * from "./SampleData.js"; export * from "./SampleDataDateCollected.js"; @@ -660,6 +689,8 @@ export * from "./SampleDataDateReceived.js"; export * from "./SampleDataDateReported.js"; export * from "./ScopeRequirementsGrants.js"; export * from "./ScopeRequirementsStr.js"; +export * from "./SearchCompendiumResponse.js"; +export * from "./SearchMode.js"; export * from "./Select.js"; export * from "./Sex.js"; export * from "./SexualActivityEntry.js"; @@ -695,6 +726,7 @@ export * from "./TimeseriesResource.js"; export * from "./TraceElements.js"; export * from "./UnrecognizedValueMacroExpr.js"; export * from "./UsAddress.js"; +export * from "./UserAddress.js"; export * from "./UserHistoricalPullsResponse.js"; export * from "./UserInfo.js"; export * from "./UserRefreshErrorResponse.js"; @@ -702,6 +734,7 @@ export * from "./UserRefreshSuccessResponse.js"; export * from "./UserResourcesResponse.js"; export * from "./UserSignInTokenResponse.js"; export * from "./UserSuccessResponse.js"; +export * from "./UsState.js"; export * from "./UtcTimestampWithTimezoneOffset.js"; export * from "./ValidateIcdCodesResponse.js"; export * from "./ValidationError.js"; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 45cae32b2..5e5058a91 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -218,7 +218,13 @@ async function getHeaders(args: Fetcher.Args): Promise { newHeaders.set( "Accept", - args.responseType === "json" ? "application/json" : args.responseType === "text" ? "text/plain" : "*/*", + args.responseType === "json" + ? "application/json" + : args.responseType === "text" + ? "text/plain" + : args.responseType === "sse" + ? "text/event-stream" + : "*/*", ); if (args.body !== undefined && args.contentType != null) { newHeaders.set("Content-Type", args.contentType); diff --git a/src/core/schemas/builders/list/list.ts b/src/core/schemas/builders/list/list.ts index 4f8c10ba4..b3c0bdfcb 100644 --- a/src/core/schemas/builders/list/list.ts +++ b/src/core/schemas/builders/list/list.ts @@ -44,30 +44,20 @@ function validateAndTransformArray( }; } - const maybeValidItems = value.map((item, index) => transformItem(item, index)); + const result: Parsed[] = []; + const errors: ValidationError[] = []; - return maybeValidItems.reduce>( - (acc, item) => { - if (acc.ok && item.ok) { - return { - ok: true, - value: [...acc.value, item.value], - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } - if (!item.ok) { - errors.push(...item.errors); - } + for (let i = 0; i < value.length; i++) { + const item = transformItem(value[i], i); + if (item.ok) { + result.push(item.value); + } else { + errors.push(...item.errors); + } + } - return { - ok: false, - errors, - }; - }, - { ok: true, value: [] }, - ); + if (errors.length === 0) { + return { ok: true, value: result }; + } + return { ok: false, errors }; } diff --git a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts index af69acb01..5fdc8023b 100644 --- a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts @@ -5,6 +5,9 @@ import { isPlainObject } from "../../utils/isPlainObject.js"; import { getSchemaUtils } from "../schema-utils/index.js"; import type { ObjectLikeSchema, ObjectLikeUtils } from "./types.js"; +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; + export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { return { withParsedProperties: (properties) => withParsedProperties(schema, properties), @@ -26,15 +29,14 @@ export function withParsedProperties>( - (processed, [key, value]) => { - return { - ...processed, - [key]: typeof value === "function" ? value(parsedObject.value) : value, - }; - }, - {}, - ); + const additionalProperties: Record = {}; + for (const key in properties) { + if (_hasOwn.call(properties, key)) { + const value = properties[key as keyof Properties]; + additionalProperties[key] = + typeof value === "function" ? (value as Function)(parsedObject.value) : value; + } + } return { ok: true, diff --git a/src/core/schemas/builders/object/object.ts b/src/core/schemas/builders/object/object.ts index 624d4d388..0db7f49aa 100644 --- a/src/core/schemas/builders/object/object.ts +++ b/src/core/schemas/builders/object/object.ts @@ -19,6 +19,9 @@ import type { PropertySchemas, } from "./types.js"; +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; + interface ObjectPropertyWithRawKey { rawKey: string; parsedKey: string; @@ -28,79 +31,128 @@ interface ObjectPropertyWithRawKey { export function object>( schemas: T, ): inferObjectSchemaFromPropertySchemas { - const baseSchema: BaseObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectFromPropertySchemas - > = { - _getRawProperties: () => - Object.entries(schemas).map(([parsedKey, propertySchema]) => - isProperty(propertySchema) ? propertySchema.rawKey : parsedKey, - ) as unknown as (keyof inferRawObjectFromPropertySchemas)[], - _getParsedProperties: () => keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[], + // All property metadata is lazily computed on first use. + // This keeps schema construction free of iteration, which matters when + // many schemas are defined but only some are exercised at runtime. + // Required-key computation is also deferred because lazy() schemas may + // not be resolved at construction time. - parse: (raw, opts) => { - const rawKeyToProperty: Record = {}; - const requiredKeys: string[] = []; + let _rawKeyToProperty: Record | undefined; + function getRawKeyToProperty(): Record { + if (_rawKeyToProperty == null) { + _rawKeyToProperty = {}; for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey; + const rawKey = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.rawKey + : (parsedKey as string); const valueSchema: Schema = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.valueSchema : schemaOrObjectProperty; - const property: ObjectPropertyWithRawKey = { + _rawKeyToProperty[rawKey] = { rawKey, parsedKey: parsedKey as string, valueSchema, }; + } + } + return _rawKeyToProperty; + } - rawKeyToProperty[rawKey] = property; + let _parseRequiredKeys: string[] | undefined; + let _jsonRequiredKeys: string[] | undefined; + let _parseRequiredKeysSet: Set | undefined; + let _jsonRequiredKeysSet: Set | undefined; + function getParseRequiredKeys(): string[] { + if (_parseRequiredKeys == null) { + _parseRequiredKeys = []; + _jsonRequiredKeys = []; + for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { + const rawKey = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.rawKey + : (parsedKey as string); + const valueSchema: Schema = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.valueSchema + : schemaOrObjectProperty; if (isSchemaRequired(valueSchema)) { - requiredKeys.push(rawKey); + _parseRequiredKeys.push(rawKey); + _jsonRequiredKeys.push(parsedKey as string); } } + _parseRequiredKeysSet = new Set(_parseRequiredKeys); + _jsonRequiredKeysSet = new Set(_jsonRequiredKeys); + } + return _parseRequiredKeys; + } + function getJsonRequiredKeys(): string[] { + if (_jsonRequiredKeys == null) { + getParseRequiredKeys(); + } + return _jsonRequiredKeys!; + } + + function getParseRequiredKeysSet(): Set { + if (_parseRequiredKeysSet == null) { + getParseRequiredKeys(); + } + return _parseRequiredKeysSet!; + } + + function getJsonRequiredKeysSet(): Set { + if (_jsonRequiredKeysSet == null) { + getParseRequiredKeys(); + } + return _jsonRequiredKeysSet!; + } + + const baseSchema: BaseObjectSchema< + inferRawObjectFromPropertySchemas, + inferParsedObjectFromPropertySchemas + > = { + _getRawProperties: () => + Object.entries(schemas).map(([parsedKey, propertySchema]) => + isProperty(propertySchema) ? propertySchema.rawKey : parsedKey, + ) as unknown as (keyof inferRawObjectFromPropertySchemas)[], + _getParsedProperties: () => keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[], + + parse: (raw, opts) => { + const breadcrumbsPrefix = opts?.breadcrumbsPrefix ?? []; return validateAndTransformObject({ value: raw, - requiredKeys, + requiredKeys: getParseRequiredKeys(), + requiredKeysSet: getParseRequiredKeysSet(), getProperty: (rawKey) => { - const property = rawKeyToProperty[rawKey]; + const property = getRawKeyToProperty()[rawKey]; if (property == null) { return undefined; } return { transformedKey: property.parsedKey, - transform: (propertyValue) => - property.valueSchema.parse(propertyValue, { + transform: (propertyValue) => { + const childBreadcrumbs = [...breadcrumbsPrefix, rawKey]; + return property.valueSchema.parse(propertyValue, { ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawKey], - }), + breadcrumbsPrefix: childBreadcrumbs, + }); + }, }; }, unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, + breadcrumbsPrefix, omitUndefined: opts?.omitUndefined, }); }, json: (parsed, opts) => { - const requiredKeys: string[] = []; - - for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const valueSchema: Schema = isProperty(schemaOrObjectProperty) - ? schemaOrObjectProperty.valueSchema - : schemaOrObjectProperty; - - if (isSchemaRequired(valueSchema)) { - requiredKeys.push(parsedKey as string); - } - } - + const breadcrumbsPrefix = opts?.breadcrumbsPrefix ?? []; return validateAndTransformObject({ value: parsed, - requiredKeys, + requiredKeys: getJsonRequiredKeys(), + requiredKeysSet: getJsonRequiredKeysSet(), getProperty: ( parsedKey, ): { transformedKey: string; transform: (propertyValue: object) => MaybeValid } | undefined => { @@ -114,26 +166,30 @@ export function object - property.valueSchema.json(propertyValue, { + transform: (propertyValue) => { + const childBreadcrumbs = [...breadcrumbsPrefix, parsedKey]; + return property.valueSchema.json(propertyValue, { ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), + breadcrumbsPrefix: childBreadcrumbs, + }); + }, }; } else { return { transformedKey: parsedKey, - transform: (propertyValue) => - property.json(propertyValue, { + transform: (propertyValue) => { + const childBreadcrumbs = [...breadcrumbsPrefix, parsedKey]; + return property.json(propertyValue, { ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), + breadcrumbsPrefix: childBreadcrumbs, + }); + }, }; } }, unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, + breadcrumbsPrefix, omitUndefined: opts?.omitUndefined, }); }, @@ -152,6 +208,7 @@ export function object({ value, requiredKeys, + requiredKeysSet, getProperty, unrecognizedObjectKeys = "fail", skipValidation = false, @@ -159,6 +216,7 @@ function validateAndTransformObject({ }: { value: unknown; requiredKeys: string[]; + requiredKeysSet: Set; getProperty: ( preTransformedKey: string, ) => { transformedKey: string; transform: (propertyValue: object) => MaybeValid } | undefined; @@ -179,15 +237,23 @@ function validateAndTransformObject({ }; } - const missingRequiredKeys = new Set(requiredKeys); + // Track which required keys have been seen. + // Use a counter instead of copying the Set to avoid per-call allocation. + let missingRequiredCount = requiredKeys.length; const errors: ValidationError[] = []; const transformed: Record = {}; - for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) { + for (const preTransformedKey in value) { + if (!_hasOwn.call(value, preTransformedKey)) { + continue; + } + const preTransformedItemValue = value[preTransformedKey]; const property = getProperty(preTransformedKey); if (property != null) { - missingRequiredKeys.delete(preTransformedKey); + if (missingRequiredCount > 0 && requiredKeysSet.has(preTransformedKey)) { + missingRequiredCount--; + } const value = property.transform(preTransformedItemValue as object); if (value.ok) { @@ -213,14 +279,16 @@ function validateAndTransformObject({ } } - errors.push( - ...requiredKeys - .filter((key) => missingRequiredKeys.has(key)) - .map((key) => ({ - path: breadcrumbsPrefix, - message: `Missing required key "${key}"`, - })), - ); + if (missingRequiredCount > 0) { + for (const key of requiredKeys) { + if (!(key in (value as Record))) { + errors.push({ + path: breadcrumbsPrefix, + message: `Missing required key "${key}"`, + }); + } + } + } if (errors.length === 0 || skipValidation) { return { @@ -270,6 +338,8 @@ export function getObjectUtils(schema: BaseObjectSchema { + const knownRawKeys = new Set(schema._getRawProperties() as string[]); + const knownParsedKeys = new Set(schema._getParsedProperties() as string[]); const baseSchema: BaseObjectSchema = { _getParsedProperties: () => schema._getParsedProperties(), @@ -279,10 +349,18 @@ export function getObjectUtils(schema: BaseObjectSchema = {}; + if (typeof raw === "object" && raw != null) { + for (const [key, value] of Object.entries(raw)) { + if (!knownRawKeys.has(key)) { + extraProperties[key] = value; + } + } + } return { ok: true, value: { - ...(raw as any), + ...extraProperties, ...transformed.value, }, }; @@ -292,10 +370,18 @@ export function getObjectUtils(schema: BaseObjectSchema = {}; + if (typeof parsed === "object" && parsed != null) { + for (const [key, value] of Object.entries(parsed)) { + if (!knownParsedKeys.has(key)) { + extraProperties[key] = value; + } + } + } return { ok: true, value: { - ...(parsed as any), + ...extraProperties, ...transformed.value, }, }; diff --git a/src/core/schemas/builders/object/types.ts b/src/core/schemas/builders/object/types.ts index 735d14fc4..384ae873f 100644 --- a/src/core/schemas/builders/object/types.ts +++ b/src/core/schemas/builders/object/types.ts @@ -23,9 +23,8 @@ export interface ObjectUtils { export type inferRawObject> = O extends ObjectSchema ? Raw : never; -export type inferParsedObject> = O extends ObjectSchema - ? Parsed - : never; +export type inferParsedObject> = + O extends ObjectSchema ? Parsed : never; export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< inferRawObjectFromPropertySchemas, @@ -47,25 +46,11 @@ export type PropertySchemas = Recor Property | Schema >; -export type inferRawPropertySchema

| Schema> = P extends Property< - any, - infer Raw, - any -> - ? Raw - : P extends Schema - ? inferRaw

- : never; +export type inferRawPropertySchema

| Schema> = + P extends Property ? Raw : P extends Schema ? inferRaw

: never; -export type inferParsedPropertySchema

| Schema> = P extends Property< - any, - any, - infer Parsed -> - ? Parsed - : P extends Schema - ? inferParsed

- : never; +export type inferParsedPropertySchema

| Schema> = + P extends Property ? Parsed : P extends Schema ? inferParsed

: never; export type inferRawKey< ParsedKey extends string | number | symbol, diff --git a/src/core/schemas/builders/record/record.ts b/src/core/schemas/builders/record/record.ts index a48966039..f107fbab7 100644 --- a/src/core/schemas/builders/record/record.ts +++ b/src/core/schemas/builders/record/record.ts @@ -1,11 +1,13 @@ import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema.js"; -import { entries } from "../../utils/entries.js"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType.js"; import { isPlainObject } from "../../utils/isPlainObject.js"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation.js"; import { getSchemaUtils } from "../schema-utils/index.js"; import type { BaseRecordSchema, RecordSchema } from "./types.js"; +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; + export function record( keySchema: Schema, valueSchema: Schema, @@ -79,51 +81,42 @@ function validateAndTransformRecord>>( - (accPromise, [stringKey, value]) => { - if (value === undefined) { - return accPromise; - } - - const acc = accPromise; - - let key: string | number = stringKey; - if (isKeyNumeric) { - const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; - if (!Number.isNaN(numberKey)) { - key = numberKey; - } - } - const transformedKey = transformKey(key); + const result = {} as Record; + const errors: ValidationError[] = []; - const transformedValue = transformValue(value, key); + for (const stringKey in value) { + if (!_hasOwn.call(value, stringKey)) { + continue; + } + const entryValue = (value as Record)[stringKey]; + if (entryValue === undefined) { + continue; + } - if (acc.ok && transformedKey.ok && transformedValue.ok) { - return { - ok: true, - value: { - ...acc.value, - [transformedKey.value]: transformedValue.value, - }, - }; + let key: string | number = stringKey; + if (isKeyNumeric) { + const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; + if (!Number.isNaN(numberKey)) { + key = numberKey; } + } + const transformedKey = transformKey(key); + const transformedValue = transformValue(entryValue, key); - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } + if (transformedKey.ok && transformedValue.ok) { + result[transformedKey.value] = transformedValue.value; + } else { if (!transformedKey.ok) { errors.push(...transformedKey.errors); } if (!transformedValue.ok) { errors.push(...transformedValue.errors); } + } + } - return { - ok: false, - errors, - }; - }, - { ok: true, value: {} as Record }, - ); + if (errors.length === 0) { + return { ok: true, value: result }; + } + return { ok: false, errors }; } diff --git a/src/core/schemas/builders/union/union.ts b/src/core/schemas/builders/union/union.ts index 509658e0e..fa993fdc0 100644 --- a/src/core/schemas/builders/union/union.ts +++ b/src/core/schemas/builders/union/union.ts @@ -16,6 +16,9 @@ import type { UnionSubtypes, } from "./types.js"; +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; + export function union, U extends UnionSubtypes>( discriminant: D, union: U, @@ -112,7 +115,13 @@ function transformAndValidateUnion< }; } - const { [discriminant]: discriminantValue, ...additionalProperties } = value; + const discriminantValue = value[discriminant]; + const additionalProperties: Record = {}; + for (const key in value) { + if (_hasOwn.call(value, key) && key !== discriminant) { + additionalProperties[key] = value[key]; + } + } if (discriminantValue == null) { return { diff --git a/src/core/schemas/utils/isPlainObject.ts b/src/core/schemas/utils/isPlainObject.ts index db82a722c..32a17e05f 100644 --- a/src/core/schemas/utils/isPlainObject.ts +++ b/src/core/schemas/utils/isPlainObject.ts @@ -4,14 +4,11 @@ export function isPlainObject(value: unknown): value is Record return false; } - if (Object.getPrototypeOf(value) === null) { + const proto = Object.getPrototypeOf(value); + if (proto === null) { return true; } - let proto = value; - while (Object.getPrototypeOf(proto) !== null) { - proto = Object.getPrototypeOf(proto); - } - - return Object.getPrototypeOf(value) === proto; + // Check that the prototype chain has exactly one level (i.e., proto is Object.prototype) + return Object.getPrototypeOf(proto) === null; } diff --git a/src/serialization/resources/compendium/client/index.ts b/src/serialization/resources/compendium/client/index.ts new file mode 100644 index 000000000..195f9aa8a --- /dev/null +++ b/src/serialization/resources/compendium/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/compendium/client/requests/ConvertCompendiumBody.ts b/src/serialization/resources/compendium/client/requests/ConvertCompendiumBody.ts new file mode 100644 index 000000000..411c88e1b --- /dev/null +++ b/src/serialization/resources/compendium/client/requests/ConvertCompendiumBody.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; +import { CompendiumSearchLabs } from "../../../../types/CompendiumSearchLabs.js"; + +export const ConvertCompendiumBody: core.serialization.Schema< + serializers.ConvertCompendiumBody.Raw, + Vital.ConvertCompendiumBody +> = core.serialization.object({ + labTestId: core.serialization.property("lab_test_id", core.serialization.string().optional()), + providerIds: core.serialization.property( + "provider_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + targetLab: core.serialization.property("target_lab", CompendiumSearchLabs), + limit: core.serialization.number().optional(), +}); + +export declare namespace ConvertCompendiumBody { + export interface Raw { + lab_test_id?: string | null; + provider_ids?: string[] | null; + target_lab: CompendiumSearchLabs.Raw; + limit?: number | null; + } +} diff --git a/src/serialization/resources/compendium/client/requests/SearchCompendiumBody.ts b/src/serialization/resources/compendium/client/requests/SearchCompendiumBody.ts new file mode 100644 index 000000000..265b019d3 --- /dev/null +++ b/src/serialization/resources/compendium/client/requests/SearchCompendiumBody.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; +import { CompendiumSearchLabs } from "../../../../types/CompendiumSearchLabs.js"; +import { SearchMode } from "../../../../types/SearchMode.js"; + +export const SearchCompendiumBody: core.serialization.Schema< + serializers.SearchCompendiumBody.Raw, + Vital.SearchCompendiumBody +> = core.serialization.object({ + mode: SearchMode, + query: core.serialization.string().optional(), + cptCodes: core.serialization.property("cpt_codes", core.serialization.list(core.serialization.string()).optional()), + loincSetHash: core.serialization.property("loinc_set_hash", core.serialization.string().optional()), + labs: core.serialization.list(CompendiumSearchLabs).optional(), + includeRelated: core.serialization.property("include_related", core.serialization.boolean().optional()), + limit: core.serialization.number().optional(), +}); + +export declare namespace SearchCompendiumBody { + export interface Raw { + mode: SearchMode.Raw; + query?: string | null; + cpt_codes?: string[] | null; + loinc_set_hash?: string | null; + labs?: CompendiumSearchLabs.Raw[] | null; + include_related?: boolean | null; + limit?: number | null; + } +} diff --git a/src/serialization/resources/compendium/client/requests/index.ts b/src/serialization/resources/compendium/client/requests/index.ts new file mode 100644 index 000000000..003fec611 --- /dev/null +++ b/src/serialization/resources/compendium/client/requests/index.ts @@ -0,0 +1,2 @@ +export { ConvertCompendiumBody } from "./ConvertCompendiumBody.js"; +export { SearchCompendiumBody } from "./SearchCompendiumBody.js"; diff --git a/src/serialization/resources/compendium/index.ts b/src/serialization/resources/compendium/index.ts new file mode 100644 index 000000000..914b8c3c7 --- /dev/null +++ b/src/serialization/resources/compendium/index.ts @@ -0,0 +1 @@ +export * from "./client/index.js"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index af379e5ac..e6dc48bc4 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,6 +1,8 @@ export * from "./aggregate/client/requests/index.js"; export * as aggregate from "./aggregate/index.js"; export * from "./aggregate/types/index.js"; +export * from "./compendium/client/requests/index.js"; +export * as compendium from "./compendium/index.js"; export * from "./insurance/client/requests/index.js"; export * as insurance from "./insurance/index.js"; export * from "./labTests/client/requests/index.js"; @@ -8,7 +10,6 @@ export * as labTests from "./labTests/index.js"; export * from "./labTests/types/index.js"; export * from "./link/client/requests/index.js"; export * as link from "./link/index.js"; -export * from "./link/types/index.js"; export * from "./order/client/requests/index.js"; export * as order from "./order/index.js"; export * from "./payor/client/requests/index.js"; diff --git a/src/serialization/resources/labTests/client/requests/CreateLabTestRequest.ts b/src/serialization/resources/labTests/client/requests/CreateLabTestRequest.ts index 713abb227..4ac053dd9 100644 --- a/src/serialization/resources/labTests/client/requests/CreateLabTestRequest.ts +++ b/src/serialization/resources/labTests/client/requests/CreateLabTestRequest.ts @@ -3,6 +3,7 @@ import type * as Vital from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; import type * as serializers from "../../../../index.js"; +import { Labs } from "../../../../types/Labs.js"; import { LabTestCollectionMethod } from "../../../../types/LabTestCollectionMethod.js"; export const CreateLabTestRequest: core.serialization.Schema< @@ -21,6 +22,8 @@ export const CreateLabTestRequest: core.serialization.Schema< method: LabTestCollectionMethod, description: core.serialization.string(), fasting: core.serialization.boolean().optional(), + labAccountId: core.serialization.property("lab_account_id", core.serialization.string().optional()), + labSlug: core.serialization.property("lab_slug", Labs.optional()), }); export declare namespace CreateLabTestRequest { @@ -31,5 +34,7 @@ export declare namespace CreateLabTestRequest { method: LabTestCollectionMethod.Raw; description: string; fasting?: boolean | null; + lab_account_id?: string | null; + lab_slug?: Labs.Raw | null; } } diff --git a/src/serialization/resources/labTests/client/requests/CreateOrderRequestCompatible.ts b/src/serialization/resources/labTests/client/requests/CreateOrderRequestCompatible.ts index 562d8ca76..b78e31b73 100644 --- a/src/serialization/resources/labTests/client/requests/CreateOrderRequestCompatible.ts +++ b/src/serialization/resources/labTests/client/requests/CreateOrderRequestCompatible.ts @@ -30,6 +30,7 @@ export const CreateOrderRequestCompatible: core.serialization.Schema< activateBy: core.serialization.property("activate_by", core.serialization.string().optional()), aoeAnswers: core.serialization.property("aoe_answers", core.serialization.list(AoEAnswer).optional()), passthrough: core.serialization.string().optional(), + clinicalNotes: core.serialization.property("clinical_notes", core.serialization.string().optional()), labAccountId: core.serialization.property("lab_account_id", core.serialization.string().optional()), creatorMemberId: core.serialization.property("creator_member_id", core.serialization.string().optional()), patientDetails: core.serialization.property("patient_details", PatientDetailsWithValidation), @@ -51,6 +52,7 @@ export declare namespace CreateOrderRequestCompatible { activate_by?: string | null; aoe_answers?: AoEAnswer.Raw[] | null; passthrough?: string | null; + clinical_notes?: string | null; lab_account_id?: string | null; creator_member_id?: string | null; patient_details: PatientDetailsWithValidation.Raw; diff --git a/src/serialization/resources/labTests/client/requests/RequestAppointmentRequest.ts b/src/serialization/resources/labTests/client/requests/RequestAppointmentRequest.ts index fa3ec4594..ca58b00b4 100644 --- a/src/serialization/resources/labTests/client/requests/RequestAppointmentRequest.ts +++ b/src/serialization/resources/labTests/client/requests/RequestAppointmentRequest.ts @@ -12,11 +12,13 @@ export const RequestAppointmentRequest: core.serialization.Schema< > = core.serialization.object({ address: UsAddress, provider: AppointmentProvider, + appointmentNotes: core.serialization.property("appointment_notes", core.serialization.string().optional()), }); export declare namespace RequestAppointmentRequest { export interface Raw { address: UsAddress.Raw; provider: AppointmentProvider.Raw; + appointment_notes?: string | null; } } diff --git a/src/serialization/resources/link/client/requests/BulkExportConnectionsBody.ts b/src/serialization/resources/link/client/requests/BulkExportConnectionsBody.ts index f93f9f67c..df1604b54 100644 --- a/src/serialization/resources/link/client/requests/BulkExportConnectionsBody.ts +++ b/src/serialization/resources/link/client/requests/BulkExportConnectionsBody.ts @@ -7,7 +7,7 @@ import { OAuthProviders } from "../../../../types/OAuthProviders.js"; export const BulkExportConnectionsBody: core.serialization.Schema< serializers.BulkExportConnectionsBody.Raw, - Omit + Vital.BulkExportConnectionsBody > = core.serialization.object({ userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string()).optional()), provider: OAuthProviders, diff --git a/src/serialization/resources/link/client/requests/BulkImportConnectionsBody.ts b/src/serialization/resources/link/client/requests/BulkImportConnectionsBody.ts index ad137a7a5..49d318be6 100644 --- a/src/serialization/resources/link/client/requests/BulkImportConnectionsBody.ts +++ b/src/serialization/resources/link/client/requests/BulkImportConnectionsBody.ts @@ -8,7 +8,7 @@ import { OAuthProviders } from "../../../../types/OAuthProviders.js"; export const BulkImportConnectionsBody: core.serialization.Schema< serializers.BulkImportConnectionsBody.Raw, - Omit + Vital.BulkImportConnectionsBody > = core.serialization.object({ provider: OAuthProviders, connections: core.serialization.list(ConnectionRecipe), diff --git a/src/serialization/resources/link/client/requests/BulkPauseConnectionsBody.ts b/src/serialization/resources/link/client/requests/BulkPauseConnectionsBody.ts index 79ce8a718..b6c148af2 100644 --- a/src/serialization/resources/link/client/requests/BulkPauseConnectionsBody.ts +++ b/src/serialization/resources/link/client/requests/BulkPauseConnectionsBody.ts @@ -7,7 +7,7 @@ import { OAuthProviders } from "../../../../types/OAuthProviders.js"; export const BulkPauseConnectionsBody: core.serialization.Schema< serializers.BulkPauseConnectionsBody.Raw, - Omit + Vital.BulkPauseConnectionsBody > = core.serialization.object({ userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string())), provider: OAuthProviders, diff --git a/src/serialization/resources/link/client/requests/BulkTriggerHistoricalPullBody.ts b/src/serialization/resources/link/client/requests/BulkTriggerHistoricalPullBody.ts index d9950785b..f25a5a20b 100644 --- a/src/serialization/resources/link/client/requests/BulkTriggerHistoricalPullBody.ts +++ b/src/serialization/resources/link/client/requests/BulkTriggerHistoricalPullBody.ts @@ -7,7 +7,7 @@ import { OAuthProviders } from "../../../../types/OAuthProviders.js"; export const BulkTriggerHistoricalPullBody: core.serialization.Schema< serializers.BulkTriggerHistoricalPullBody.Raw, - Omit + Vital.BulkTriggerHistoricalPullBody > = core.serialization.object({ userIds: core.serialization.property("user_ids", core.serialization.list(core.serialization.string())), provider: OAuthProviders, diff --git a/src/serialization/resources/link/client/requests/ManualConnectionData.ts b/src/serialization/resources/link/client/requests/ManualConnectionData.ts index 405a32540..d285fdb6f 100644 --- a/src/serialization/resources/link/client/requests/ManualConnectionData.ts +++ b/src/serialization/resources/link/client/requests/ManualConnectionData.ts @@ -6,15 +6,20 @@ import type * as serializers from "../../../../index.js"; export const ManualConnectionData: core.serialization.Schema< serializers.ManualConnectionData.Raw, - Vital.ManualConnectionData + Omit > = core.serialization.object({ userId: core.serialization.property("user_id", core.serialization.string()), providerId: core.serialization.property("provider_id", core.serialization.string().optional()), + grantedPermissions: core.serialization.property( + "granted_permissions", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace ManualConnectionData { export interface Raw { user_id: string; provider_id?: string | null; + granted_permissions?: string[] | null; } } diff --git a/src/serialization/resources/link/index.ts b/src/serialization/resources/link/index.ts index d9adb1af9..914b8c3c7 100644 --- a/src/serialization/resources/link/index.ts +++ b/src/serialization/resources/link/index.ts @@ -1,2 +1 @@ export * from "./client/index.js"; -export * from "./types/index.js"; diff --git a/src/serialization/resources/link/types/LinkBulkExportRequestTeamId.ts b/src/serialization/resources/link/types/LinkBulkExportRequestTeamId.ts deleted file mode 100644 index 1673275d4..000000000 --- a/src/serialization/resources/link/types/LinkBulkExportRequestTeamId.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Vital from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import type * as serializers from "../../../index.js"; - -export const LinkBulkExportRequestTeamId: core.serialization.Schema< - serializers.LinkBulkExportRequestTeamId.Raw, - Vital.LinkBulkExportRequestTeamId -> = core.serialization.enum_(["infer_from_context"]); - -export declare namespace LinkBulkExportRequestTeamId { - export type Raw = "infer_from_context"; -} diff --git a/src/serialization/resources/link/types/LinkBulkImportRequestTeamId.ts b/src/serialization/resources/link/types/LinkBulkImportRequestTeamId.ts deleted file mode 100644 index 297f66e2d..000000000 --- a/src/serialization/resources/link/types/LinkBulkImportRequestTeamId.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Vital from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import type * as serializers from "../../../index.js"; - -export const LinkBulkImportRequestTeamId: core.serialization.Schema< - serializers.LinkBulkImportRequestTeamId.Raw, - Vital.LinkBulkImportRequestTeamId -> = core.serialization.enum_(["infer_from_context"]); - -export declare namespace LinkBulkImportRequestTeamId { - export type Raw = "infer_from_context"; -} diff --git a/src/serialization/resources/link/types/LinkBulkPauseRequestTeamId.ts b/src/serialization/resources/link/types/LinkBulkPauseRequestTeamId.ts deleted file mode 100644 index 6f5c40fda..000000000 --- a/src/serialization/resources/link/types/LinkBulkPauseRequestTeamId.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Vital from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import type * as serializers from "../../../index.js"; - -export const LinkBulkPauseRequestTeamId: core.serialization.Schema< - serializers.LinkBulkPauseRequestTeamId.Raw, - Vital.LinkBulkPauseRequestTeamId -> = core.serialization.enum_(["infer_from_context"]); - -export declare namespace LinkBulkPauseRequestTeamId { - export type Raw = "infer_from_context"; -} diff --git a/src/serialization/resources/link/types/LinkBulkTriggerHistoricalPullRequestTeamId.ts b/src/serialization/resources/link/types/LinkBulkTriggerHistoricalPullRequestTeamId.ts deleted file mode 100644 index 6b79da0f9..000000000 --- a/src/serialization/resources/link/types/LinkBulkTriggerHistoricalPullRequestTeamId.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Vital from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import type * as serializers from "../../../index.js"; - -export const LinkBulkTriggerHistoricalPullRequestTeamId: core.serialization.Schema< - serializers.LinkBulkTriggerHistoricalPullRequestTeamId.Raw, - Vital.LinkBulkTriggerHistoricalPullRequestTeamId -> = core.serialization.enum_(["infer_from_context"]); - -export declare namespace LinkBulkTriggerHistoricalPullRequestTeamId { - export type Raw = "infer_from_context"; -} diff --git a/src/serialization/resources/link/types/LinkListBulkOpsRequestTeamId.ts b/src/serialization/resources/link/types/LinkListBulkOpsRequestTeamId.ts deleted file mode 100644 index e7ed980d7..000000000 --- a/src/serialization/resources/link/types/LinkListBulkOpsRequestTeamId.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Vital from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import type * as serializers from "../../../index.js"; - -export const LinkListBulkOpsRequestTeamId: core.serialization.Schema< - serializers.LinkListBulkOpsRequestTeamId.Raw, - Vital.LinkListBulkOpsRequestTeamId -> = core.serialization.enum_(["infer_from_context"]); - -export declare namespace LinkListBulkOpsRequestTeamId { - export type Raw = "infer_from_context"; -} diff --git a/src/serialization/resources/link/types/index.ts b/src/serialization/resources/link/types/index.ts deleted file mode 100644 index 2d2b3b335..000000000 --- a/src/serialization/resources/link/types/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./LinkBulkExportRequestTeamId.js"; -export * from "./LinkBulkImportRequestTeamId.js"; -export * from "./LinkBulkPauseRequestTeamId.js"; -export * from "./LinkBulkTriggerHistoricalPullRequestTeamId.js"; -export * from "./LinkListBulkOpsRequestTeamId.js"; diff --git a/src/serialization/resources/user/client/requests/UserInfoCreateRequest.ts b/src/serialization/resources/user/client/requests/UserInfoCreateRequest.ts index 8ea89113a..58e8a16d7 100644 --- a/src/serialization/resources/user/client/requests/UserInfoCreateRequest.ts +++ b/src/serialization/resources/user/client/requests/UserInfoCreateRequest.ts @@ -3,12 +3,12 @@ import type * as Vital from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; import type * as serializers from "../../../../index.js"; -import { Address } from "../../../../types/Address.js"; import { Ethnicity } from "../../../../types/Ethnicity.js"; import { GenderIdentity } from "../../../../types/GenderIdentity.js"; import { GuarantorDetails } from "../../../../types/GuarantorDetails.js"; import { Race } from "../../../../types/Race.js"; import { SexualOrientation } from "../../../../types/SexualOrientation.js"; +import { UserAddress } from "../../../../types/UserAddress.js"; export const UserInfoCreateRequest: core.serialization.Schema< serializers.UserInfoCreateRequest.Raw, @@ -20,7 +20,7 @@ export const UserInfoCreateRequest: core.serialization.Schema< phoneNumber: core.serialization.property("phone_number", core.serialization.string()), gender: core.serialization.string(), dob: core.serialization.string(), - address: Address, + address: UserAddress, medicalProxy: core.serialization.property("medical_proxy", GuarantorDetails.optional()), race: Race.optional(), ethnicity: Ethnicity.optional(), @@ -36,7 +36,7 @@ export declare namespace UserInfoCreateRequest { phone_number: string; gender: string; dob: string; - address: Address.Raw; + address: UserAddress.Raw; medical_proxy?: GuarantorDetails.Raw | null; race?: Race.Raw | null; ethnicity?: Ethnicity.Raw | null; diff --git a/src/serialization/types/Address.ts b/src/serialization/types/Address.ts index 84e0c8466..92471f9bc 100644 --- a/src/serialization/types/Address.ts +++ b/src/serialization/types/Address.ts @@ -12,6 +12,7 @@ export const Address: core.serialization.ObjectSchema = core.serialization.undiscriminatedUnion([ SleepColumnExpr, + DerivedReadinessColumnExpr, ActivityColumnExpr, WorkoutColumnExpr, BodyColumnExpr, @@ -34,9 +38,11 @@ export const AggregateExprArg: core.serialization.Schema = core.serialization.object({ bookingKey: core.serialization.property("booking_key", core.serialization.string()), + appointmentNotes: core.serialization.property("appointment_notes", core.serialization.string().optional()), + asyncConfirmation: core.serialization.property("async_confirmation", core.serialization.boolean().optional()), + syncConfirmationTimeoutMillisecond: core.serialization.property( + "sync_confirmation_timeout_millisecond", + core.serialization.number().optional(), + ), + asyncConfirmationTimeoutMillisecond: core.serialization.property( + "async_confirmation_timeout_millisecond", + core.serialization.number().optional(), + ), }); export declare namespace AppointmentBookingRequest { export interface Raw { booking_key: string; + appointment_notes?: string | null; + async_confirmation?: boolean | null; + sync_confirmation_timeout_millisecond?: number | null; + async_confirmation_timeout_millisecond?: number | null; } } diff --git a/src/serialization/types/AppointmentProvider.ts b/src/serialization/types/AppointmentProvider.ts index b1b656b0c..0d17df48d 100644 --- a/src/serialization/types/AppointmentProvider.ts +++ b/src/serialization/types/AppointmentProvider.ts @@ -7,8 +7,8 @@ import type * as serializers from "../index.js"; export const AppointmentProvider: core.serialization.Schema< serializers.AppointmentProvider.Raw, Vital.AppointmentProvider -> = core.serialization.enum_(["getlabs", "phlebfinders", "quest"]); +> = core.serialization.enum_(["getlabs", "phlebfinders", "quest", "sonora_quest"]); export declare namespace AppointmentProvider { - export type Raw = "getlabs" | "phlebfinders" | "quest"; + export type Raw = "getlabs" | "phlebfinders" | "quest" | "sonora_quest"; } diff --git a/src/serialization/types/AppointmentPscLabs.ts b/src/serialization/types/AppointmentPscLabs.ts index ea8291ef4..5703da076 100644 --- a/src/serialization/types/AppointmentPscLabs.ts +++ b/src/serialization/types/AppointmentPscLabs.ts @@ -7,8 +7,8 @@ import type * as serializers from "../index.js"; export const AppointmentPscLabs: core.serialization.Schema< serializers.AppointmentPscLabs.Raw, Vital.AppointmentPscLabs -> = core.serialization.stringLiteral("quest"); +> = core.serialization.enum_(["quest", "sonora_quest"]); export declare namespace AppointmentPscLabs { - export type Raw = "quest"; + export type Raw = "quest" | "sonora_quest"; } diff --git a/src/serialization/types/AppointmentRescheduleRequest.ts b/src/serialization/types/AppointmentRescheduleRequest.ts index ee0761183..3e57d5b46 100644 --- a/src/serialization/types/AppointmentRescheduleRequest.ts +++ b/src/serialization/types/AppointmentRescheduleRequest.ts @@ -9,10 +9,12 @@ export const AppointmentRescheduleRequest: core.serialization.ObjectSchema< Vital.AppointmentRescheduleRequest > = core.serialization.object({ bookingKey: core.serialization.property("booking_key", core.serialization.string()), + appointmentNotes: core.serialization.property("appointment_notes", core.serialization.string().optional()), }); export declare namespace AppointmentRescheduleRequest { export interface Raw { booking_key: string; + appointment_notes?: string | null; } } diff --git a/src/serialization/types/AwakeningsValueMacroExpr.ts b/src/serialization/types/AwakeningsValueMacroExpr.ts new file mode 100644 index 000000000..eea18b671 --- /dev/null +++ b/src/serialization/types/AwakeningsValueMacroExpr.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AwakeningsValueMacroExpr: core.serialization.ObjectSchema< + serializers.AwakeningsValueMacroExpr.Raw, + Vital.AwakeningsValueMacroExpr +> = core.serialization.object({ + valueMacro: core.serialization.property("value_macro", core.serialization.stringLiteral("awakenings")), + version: core.serialization.stringLiteral("automatic").optional(), +}); + +export declare namespace AwakeningsValueMacroExpr { + export interface Raw { + value_macro: "awakenings"; + version?: "automatic" | null; + } +} diff --git a/src/serialization/types/CanonicalCandidate.ts b/src/serialization/types/CanonicalCandidate.ts new file mode 100644 index 000000000..7e7024a63 --- /dev/null +++ b/src/serialization/types/CanonicalCandidate.ts @@ -0,0 +1,48 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CanonicalCandidate: core.serialization.ObjectSchema< + serializers.CanonicalCandidate.Raw, + Vital.CanonicalCandidate +> = core.serialization.object({ + loincSetHash: core.serialization.property("loinc_set_hash", core.serialization.string()), + displayName: core.serialization.property("display_name", core.serialization.string()), + aliases: core.serialization.list(core.serialization.string()).optional(), + loincCodes: core.serialization.property( + "loinc_codes", + core.serialization.list(core.serialization.string()).optional(), + ), + providerIds: core.serialization.property( + "provider_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + loincComponents: core.serialization.property( + "loinc_components", + core.serialization.list(core.serialization.string()).optional(), + ), + loincGroups: core.serialization.property( + "loinc_groups", + core.serialization.list(core.serialization.string()).optional(), + ), + cptCodes: core.serialization.property("cpt_codes", core.serialization.list(core.serialization.string()).optional()), + popularityScore: core.serialization.property("popularity_score", core.serialization.number()), + confidence: core.serialization.number(), +}); + +export declare namespace CanonicalCandidate { + export interface Raw { + loinc_set_hash: string; + display_name: string; + aliases?: string[] | null; + loinc_codes?: string[] | null; + provider_ids?: string[] | null; + loinc_components?: string[] | null; + loinc_groups?: string[] | null; + cpt_codes?: string[] | null; + popularity_score: number; + confidence: number; + } +} diff --git a/src/serialization/types/ClientFacingActivity.ts b/src/serialization/types/ClientFacingActivity.ts index efdf028d4..93650a01f 100644 --- a/src/serialization/types/ClientFacingActivity.ts +++ b/src/serialization/types/ClientFacingActivity.ts @@ -27,7 +27,7 @@ export const ClientFacingActivity: core.serialization.ObjectSchema< timeZone: core.serialization.property("time_zone", core.serialization.string().optional()), timezoneOffset: core.serialization.property("timezone_offset", core.serialization.number().optional()), heartRate: core.serialization.property("heart_rate", ClientFacingHeartRate.optional()), - wheelchairUse: core.serialization.property("wheelchair_use", core.serialization.boolean().optional()), + wheelchairUse: core.serialization.property("wheelchair_use", core.serialization.booleanLiteral(true).optional()), wheelchairPush: core.serialization.property("wheelchair_push", core.serialization.number().optional()), createdAt: core.serialization.property("created_at", core.serialization.date()), updatedAt: core.serialization.property("updated_at", core.serialization.date()), @@ -52,7 +52,7 @@ export declare namespace ClientFacingActivity { time_zone?: string | null; timezone_offset?: number | null; heart_rate?: ClientFacingHeartRate.Raw | null; - wheelchair_use?: boolean | null; + wheelchair_use?: true | null; wheelchair_push?: number | null; created_at: string; updated_at: string; diff --git a/src/serialization/types/ClientFacingAppointment.ts b/src/serialization/types/ClientFacingAppointment.ts index 027abcb04..9d9fa5a45 100644 --- a/src/serialization/types/ClientFacingAppointment.ts +++ b/src/serialization/types/ClientFacingAppointment.ts @@ -18,6 +18,7 @@ export const ClientFacingAppointment: core.serialization.ObjectSchema< id: core.serialization.string(), userId: core.serialization.property("user_id", core.serialization.string()), orderId: core.serialization.property("order_id", core.serialization.string()), + orderTransactionId: core.serialization.property("order_transaction_id", core.serialization.string().optional()), address: UsAddress, location: LngLat, startAt: core.serialization.property("start_at", core.serialization.date().optional()), @@ -29,6 +30,7 @@ export const ClientFacingAppointment: core.serialization.ObjectSchema< providerId: core.serialization.property("provider_id", core.serialization.string()), externalId: core.serialization.property("external_id", core.serialization.string().optional()), canReschedule: core.serialization.property("can_reschedule", core.serialization.boolean()), + appointmentNotes: core.serialization.property("appointment_notes", core.serialization.string().optional()), eventStatus: core.serialization.property("event_status", AppointmentEventStatus), eventData: core.serialization.property( "event_data", @@ -42,6 +44,7 @@ export declare namespace ClientFacingAppointment { id: string; user_id: string; order_id: string; + order_transaction_id?: string | null; address: UsAddress.Raw; location: LngLat.Raw; start_at?: string | null; @@ -53,6 +56,7 @@ export declare namespace ClientFacingAppointment { provider_id: string; external_id?: string | null; can_reschedule: boolean; + appointment_notes?: string | null; event_status: AppointmentEventStatus.Raw; event_data?: Record | null; events: ClientFacingAppointmentEvent.Raw[]; diff --git a/src/serialization/types/ClientFacingDeviceSourceType.ts b/src/serialization/types/ClientFacingDeviceSourceType.ts index 9f9788e2d..bd55c55a8 100644 --- a/src/serialization/types/ClientFacingDeviceSourceType.ts +++ b/src/serialization/types/ClientFacingDeviceSourceType.ts @@ -17,6 +17,7 @@ export const ClientFacingDeviceSourceType: core.serialization.Schema< "cuff", "manual_scan", "automatic", + "insulin_pump", "scale", "chest_strap", "ring", @@ -36,6 +37,7 @@ export declare namespace ClientFacingDeviceSourceType { | "cuff" | "manual_scan" | "automatic" + | "insulin_pump" | "scale" | "chest_strap" | "ring" diff --git a/src/serialization/types/ClientFacingElectrocardiogramSourceType.ts b/src/serialization/types/ClientFacingElectrocardiogramSourceType.ts index fa4a6d3d5..2515f51d6 100644 --- a/src/serialization/types/ClientFacingElectrocardiogramSourceType.ts +++ b/src/serialization/types/ClientFacingElectrocardiogramSourceType.ts @@ -17,6 +17,7 @@ export const ClientFacingElectrocardiogramSourceType: core.serialization.Schema< "cuff", "manual_scan", "automatic", + "insulin_pump", "scale", "chest_strap", "ring", @@ -36,6 +37,7 @@ export declare namespace ClientFacingElectrocardiogramSourceType { | "cuff" | "manual_scan" | "automatic" + | "insulin_pump" | "scale" | "chest_strap" | "ring" diff --git a/src/serialization/types/ClientFacingInsulinInjectionSample.ts b/src/serialization/types/ClientFacingInsulinInjectionSample.ts index adeb426bb..838dd6817 100644 --- a/src/serialization/types/ClientFacingInsulinInjectionSample.ts +++ b/src/serialization/types/ClientFacingInsulinInjectionSample.ts @@ -3,6 +3,9 @@ import type * as Vital from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; +import { ClientFacingInsulinInjectionSampleBolusPurpose } from "./ClientFacingInsulinInjectionSampleBolusPurpose.js"; +import { ClientFacingInsulinInjectionSampleDeliveryForm } from "./ClientFacingInsulinInjectionSampleDeliveryForm.js"; +import { ClientFacingInsulinInjectionSampleDeliveryMode } from "./ClientFacingInsulinInjectionSampleDeliveryMode.js"; import { ClientFacingInsulinInjectionSampleType } from "./ClientFacingInsulinInjectionSampleType.js"; export const ClientFacingInsulinInjectionSample: core.serialization.ObjectSchema< @@ -17,6 +20,18 @@ export const ClientFacingInsulinInjectionSample: core.serialization.ObjectSchema start: core.serialization.date(), end: core.serialization.date(), value: core.serialization.number(), + deliveryMode: core.serialization.property( + "delivery_mode", + ClientFacingInsulinInjectionSampleDeliveryMode.optional(), + ), + deliveryForm: core.serialization.property( + "delivery_form", + ClientFacingInsulinInjectionSampleDeliveryForm.optional(), + ), + bolusPurpose: core.serialization.property( + "bolus_purpose", + ClientFacingInsulinInjectionSampleBolusPurpose.optional(), + ), }); export declare namespace ClientFacingInsulinInjectionSample { @@ -29,5 +44,8 @@ export declare namespace ClientFacingInsulinInjectionSample { start: string; end: string; value: number; + delivery_mode?: ClientFacingInsulinInjectionSampleDeliveryMode.Raw | null; + delivery_form?: ClientFacingInsulinInjectionSampleDeliveryForm.Raw | null; + bolus_purpose?: ClientFacingInsulinInjectionSampleBolusPurpose.Raw | null; } } diff --git a/src/serialization/types/ClientFacingInsulinInjectionSampleBolusPurpose.ts b/src/serialization/types/ClientFacingInsulinInjectionSampleBolusPurpose.ts new file mode 100644 index 000000000..224c60551 --- /dev/null +++ b/src/serialization/types/ClientFacingInsulinInjectionSampleBolusPurpose.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const ClientFacingInsulinInjectionSampleBolusPurpose: core.serialization.Schema< + serializers.ClientFacingInsulinInjectionSampleBolusPurpose.Raw, + Vital.ClientFacingInsulinInjectionSampleBolusPurpose +> = core.serialization.enum_(["meal", "correction", "mixed", "unknown"]); + +export declare namespace ClientFacingInsulinInjectionSampleBolusPurpose { + export type Raw = "meal" | "correction" | "mixed" | "unknown"; +} diff --git a/src/serialization/types/ClientFacingInsulinInjectionSampleDeliveryForm.ts b/src/serialization/types/ClientFacingInsulinInjectionSampleDeliveryForm.ts new file mode 100644 index 000000000..192e134bd --- /dev/null +++ b/src/serialization/types/ClientFacingInsulinInjectionSampleDeliveryForm.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const ClientFacingInsulinInjectionSampleDeliveryForm: core.serialization.Schema< + serializers.ClientFacingInsulinInjectionSampleDeliveryForm.Raw, + Vital.ClientFacingInsulinInjectionSampleDeliveryForm +> = core.serialization.enum_(["standard", "extended"]); + +export declare namespace ClientFacingInsulinInjectionSampleDeliveryForm { + export type Raw = "standard" | "extended"; +} diff --git a/src/serialization/types/ClientFacingInsulinInjectionSampleDeliveryMode.ts b/src/serialization/types/ClientFacingInsulinInjectionSampleDeliveryMode.ts new file mode 100644 index 000000000..1f88a9731 --- /dev/null +++ b/src/serialization/types/ClientFacingInsulinInjectionSampleDeliveryMode.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const ClientFacingInsulinInjectionSampleDeliveryMode: core.serialization.Schema< + serializers.ClientFacingInsulinInjectionSampleDeliveryMode.Raw, + Vital.ClientFacingInsulinInjectionSampleDeliveryMode +> = core.serialization.enum_(["basal", "bolus"]); + +export declare namespace ClientFacingInsulinInjectionSampleDeliveryMode { + export type Raw = "basal" | "bolus"; +} diff --git a/src/serialization/types/ClientFacingLabAccount.ts b/src/serialization/types/ClientFacingLabAccount.ts new file mode 100644 index 000000000..2c6eb9c43 --- /dev/null +++ b/src/serialization/types/ClientFacingLabAccount.ts @@ -0,0 +1,51 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { LabAccountDelegatedFlow } from "./LabAccountDelegatedFlow.js"; +import { LabAccountStatus } from "./LabAccountStatus.js"; +import { Labs } from "./Labs.js"; +import { UsState } from "./UsState.js"; + +export const ClientFacingLabAccount: core.serialization.ObjectSchema< + serializers.ClientFacingLabAccount.Raw, + Vital.ClientFacingLabAccount +> = core.serialization.object({ + id: core.serialization.string(), + lab: Labs, + orgId: core.serialization.property("org_id", core.serialization.string().optional()), + status: LabAccountStatus, + delegatedFlow: core.serialization.property("delegated_flow", LabAccountDelegatedFlow), + providerAccountId: core.serialization.property("provider_account_id", core.serialization.string()), + accountName: core.serialization.property("account_name", core.serialization.string().optional()), + defaultClinicalNotes: core.serialization.property("default_clinical_notes", core.serialization.string().optional()), + businessUnits: core.serialization.property( + "business_units", + core.serialization.list(core.serialization.string()).optional(), + ), + allowedBilling: core.serialization.property( + "allowed_billing", + core.serialization.record(core.serialization.string(), core.serialization.list(UsState)), + ), + teamIdAllowlist: core.serialization.property( + "team_id_allowlist", + core.serialization.list(core.serialization.string()), + ), +}); + +export declare namespace ClientFacingLabAccount { + export interface Raw { + id: string; + lab: Labs.Raw; + org_id?: string | null; + status: LabAccountStatus.Raw; + delegated_flow: LabAccountDelegatedFlow.Raw; + provider_account_id: string; + account_name?: string | null; + default_clinical_notes?: string | null; + business_units?: string[] | null; + allowed_billing: Record; + team_id_allowlist: string[]; + } +} diff --git a/src/serialization/types/ClientFacingLabReportParsingJobCreatedEvent.ts b/src/serialization/types/ClientFacingLabReportParsingJobCreatedEvent.ts new file mode 100644 index 000000000..7e156db75 --- /dev/null +++ b/src/serialization/types/ClientFacingLabReportParsingJobCreatedEvent.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { ParsingJob } from "./ParsingJob.js"; + +export const ClientFacingLabReportParsingJobCreatedEvent: core.serialization.ObjectSchema< + serializers.ClientFacingLabReportParsingJobCreatedEvent.Raw, + Vital.ClientFacingLabReportParsingJobCreatedEvent +> = core.serialization.object({ + eventType: core.serialization.property( + "event_type", + core.serialization.stringLiteral("lab_report.parsing_job.created"), + ), + userId: core.serialization.property("user_id", core.serialization.string()), + clientUserId: core.serialization.property("client_user_id", core.serialization.string()), + teamId: core.serialization.property("team_id", core.serialization.string()), + data: ParsingJob, +}); + +export declare namespace ClientFacingLabReportParsingJobCreatedEvent { + export interface Raw { + event_type: "lab_report.parsing_job.created"; + user_id: string; + client_user_id: string; + team_id: string; + data: ParsingJob.Raw; + } +} diff --git a/src/serialization/types/ClientFacingLabReportParsingJobUpdatedEvent.ts b/src/serialization/types/ClientFacingLabReportParsingJobUpdatedEvent.ts new file mode 100644 index 000000000..9b1c06530 --- /dev/null +++ b/src/serialization/types/ClientFacingLabReportParsingJobUpdatedEvent.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { ParsingJob } from "./ParsingJob.js"; + +export const ClientFacingLabReportParsingJobUpdatedEvent: core.serialization.ObjectSchema< + serializers.ClientFacingLabReportParsingJobUpdatedEvent.Raw, + Vital.ClientFacingLabReportParsingJobUpdatedEvent +> = core.serialization.object({ + eventType: core.serialization.property( + "event_type", + core.serialization.stringLiteral("lab_report.parsing_job.updated"), + ), + userId: core.serialization.property("user_id", core.serialization.string()), + clientUserId: core.serialization.property("client_user_id", core.serialization.string()), + teamId: core.serialization.property("team_id", core.serialization.string()), + data: ParsingJob, +}); + +export declare namespace ClientFacingLabReportParsingJobUpdatedEvent { + export interface Raw { + event_type: "lab_report.parsing_job.updated"; + user_id: string; + client_user_id: string; + team_id: string; + data: ParsingJob.Raw; + } +} diff --git a/src/serialization/types/ClientFacingLabs.ts b/src/serialization/types/ClientFacingLabs.ts index 704e0f8fd..08929f068 100644 --- a/src/serialization/types/ClientFacingLabs.ts +++ b/src/serialization/types/ClientFacingLabs.ts @@ -5,8 +5,8 @@ import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; export const ClientFacingLabs: core.serialization.Schema = - core.serialization.enum_(["quest", "labcorp", "bioreference"]); + core.serialization.enum_(["quest", "labcorp", "bioreference", "sonora_quest"]); export declare namespace ClientFacingLabs { - export type Raw = "quest" | "labcorp" | "bioreference"; + export type Raw = "quest" | "labcorp" | "bioreference" | "sonora_quest"; } diff --git a/src/serialization/types/ClientFacingMenstrualCycleSourceType.ts b/src/serialization/types/ClientFacingMenstrualCycleSourceType.ts index 2b830421f..141b9ef81 100644 --- a/src/serialization/types/ClientFacingMenstrualCycleSourceType.ts +++ b/src/serialization/types/ClientFacingMenstrualCycleSourceType.ts @@ -17,6 +17,7 @@ export const ClientFacingMenstrualCycleSourceType: core.serialization.Schema< "cuff", "manual_scan", "automatic", + "insulin_pump", "scale", "chest_strap", "ring", @@ -36,6 +37,7 @@ export declare namespace ClientFacingMenstrualCycleSourceType { | "cuff" | "manual_scan" | "automatic" + | "insulin_pump" | "scale" | "chest_strap" | "ring" diff --git a/src/serialization/types/ClientFacingOrder.ts b/src/serialization/types/ClientFacingOrder.ts index cd647e8a8..90f1d3e7e 100644 --- a/src/serialization/types/ClientFacingOrder.ts +++ b/src/serialization/types/ClientFacingOrder.ts @@ -7,9 +7,11 @@ import { Billing } from "./Billing.js"; import { ClientFacingLabTest } from "./ClientFacingLabTest.js"; import { ClientFacingOrderDetails } from "./ClientFacingOrderDetails.js"; import { ClientFacingOrderEvent } from "./ClientFacingOrderEvent.js"; +import { ClientFacingOrderTransaction } from "./ClientFacingOrderTransaction.js"; import { ClientFacingPatientDetailsCompatible } from "./ClientFacingPatientDetailsCompatible.js"; import { ClientFacingPhysician } from "./ClientFacingPhysician.js"; import { Interpretation } from "./Interpretation.js"; +import { OrderOrigin } from "./OrderOrigin.js"; import { OrderTopLevelStatus } from "./OrderTopLevelStatus.js"; import { PatientAddressCompatible } from "./PatientAddressCompatible.js"; import { ShippingAddress } from "./ShippingAddress.js"; @@ -27,10 +29,12 @@ export const ClientFacingOrder: core.serialization.ObjectSchema< details: ClientFacingOrderDetails, sampleId: core.serialization.property("sample_id", core.serialization.string().optional()), notes: core.serialization.string().optional(), + clinicalNotes: core.serialization.property("clinical_notes", core.serialization.string().optional()), createdAt: core.serialization.property("created_at", core.serialization.date()), updatedAt: core.serialization.property("updated_at", core.serialization.date()), events: core.serialization.list(ClientFacingOrderEvent), status: OrderTopLevelStatus.optional(), + lastEvent: core.serialization.property("last_event", ClientFacingOrderEvent), physician: ClientFacingPhysician.optional(), healthInsuranceId: core.serialization.property("health_insurance_id", core.serialization.string().optional()), requisitionFormUrl: core.serialization.property("requisition_form_url", core.serialization.string().optional()), @@ -51,6 +55,8 @@ export const ClientFacingOrder: core.serialization.ObjectSchema< "worst_case_result_by_date", core.serialization.string().optional(), ), + origin: OrderOrigin.optional(), + orderTransaction: core.serialization.property("order_transaction", ClientFacingOrderTransaction.optional()), }); export declare namespace ClientFacingOrder { @@ -64,10 +70,12 @@ export declare namespace ClientFacingOrder { details: ClientFacingOrderDetails.Raw; sample_id?: string | null; notes?: string | null; + clinical_notes?: string | null; created_at: string; updated_at: string; events: ClientFacingOrderEvent.Raw[]; status?: OrderTopLevelStatus.Raw | null; + last_event: ClientFacingOrderEvent.Raw; physician?: ClientFacingPhysician.Raw | null; health_insurance_id?: string | null; requisition_form_url?: string | null; @@ -82,5 +90,7 @@ export declare namespace ClientFacingOrder { has_missing_results?: boolean | null; expected_result_by_date?: string | null; worst_case_result_by_date?: string | null; + origin?: OrderOrigin.Raw | null; + order_transaction?: ClientFacingOrderTransaction.Raw | null; } } diff --git a/src/serialization/types/ClientFacingOrderEvent.ts b/src/serialization/types/ClientFacingOrderEvent.ts index 04a7f5bc0..2f86df15f 100644 --- a/src/serialization/types/ClientFacingOrderEvent.ts +++ b/src/serialization/types/ClientFacingOrderEvent.ts @@ -4,6 +4,7 @@ import type * as Vital from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; import { OrderStatus } from "./OrderStatus.js"; +import { OrderStatusDetail } from "./OrderStatusDetail.js"; export const ClientFacingOrderEvent: core.serialization.ObjectSchema< serializers.ClientFacingOrderEvent.Raw, @@ -12,6 +13,7 @@ export const ClientFacingOrderEvent: core.serialization.ObjectSchema< id: core.serialization.number(), createdAt: core.serialization.property("created_at", core.serialization.date()), status: OrderStatus, + statusDetail: core.serialization.property("status_detail", OrderStatusDetail.optional()), }); export declare namespace ClientFacingOrderEvent { @@ -19,5 +21,6 @@ export declare namespace ClientFacingOrderEvent { id: number; created_at: string; status: OrderStatus.Raw; + status_detail?: OrderStatusDetail.Raw | null; } } diff --git a/src/serialization/types/ClientFacingOrderInTransaction.ts b/src/serialization/types/ClientFacingOrderInTransaction.ts new file mode 100644 index 000000000..fb757a58f --- /dev/null +++ b/src/serialization/types/ClientFacingOrderInTransaction.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { OrderLowLevelStatus } from "./OrderLowLevelStatus.js"; +import { OrderOrigin } from "./OrderOrigin.js"; + +export const ClientFacingOrderInTransaction: core.serialization.ObjectSchema< + serializers.ClientFacingOrderInTransaction.Raw, + Vital.ClientFacingOrderInTransaction +> = core.serialization.object({ + id: core.serialization.string(), + lowLevelStatus: core.serialization.property("low_level_status", OrderLowLevelStatus.optional()), + lowLevelStatusCreatedAt: core.serialization.property( + "low_level_status_created_at", + core.serialization.date().optional(), + ), + origin: OrderOrigin.optional(), + parentId: core.serialization.property("parent_id", core.serialization.string().optional()), + createdAt: core.serialization.property("created_at", core.serialization.date()), + updatedAt: core.serialization.property("updated_at", core.serialization.date()), +}); + +export declare namespace ClientFacingOrderInTransaction { + export interface Raw { + id: string; + low_level_status?: OrderLowLevelStatus.Raw | null; + low_level_status_created_at?: string | null; + origin?: OrderOrigin.Raw | null; + parent_id?: string | null; + created_at: string; + updated_at: string; + } +} diff --git a/src/serialization/types/ClientFacingOrderTransaction.ts b/src/serialization/types/ClientFacingOrderTransaction.ts new file mode 100644 index 000000000..a7b605dd9 --- /dev/null +++ b/src/serialization/types/ClientFacingOrderTransaction.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { ClientFacingOrderInTransaction } from "./ClientFacingOrderInTransaction.js"; +import { OrderTransactionStatus } from "./OrderTransactionStatus.js"; + +export const ClientFacingOrderTransaction: core.serialization.ObjectSchema< + serializers.ClientFacingOrderTransaction.Raw, + Vital.ClientFacingOrderTransaction +> = core.serialization.object({ + id: core.serialization.string(), + status: OrderTransactionStatus, + orders: core.serialization.list(ClientFacingOrderInTransaction), +}); + +export declare namespace ClientFacingOrderTransaction { + export interface Raw { + id: string; + status: OrderTransactionStatus.Raw; + orders: ClientFacingOrderInTransaction.Raw[]; + } +} diff --git a/src/serialization/types/ClientFacingProfile.ts b/src/serialization/types/ClientFacingProfile.ts index b717f0e87..3f6e524a8 100644 --- a/src/serialization/types/ClientFacingProfile.ts +++ b/src/serialization/types/ClientFacingProfile.ts @@ -15,7 +15,7 @@ export const ClientFacingProfile: core.serialization.ObjectSchema< userId: core.serialization.property("user_id", core.serialization.string()), height: core.serialization.number().optional(), birthDate: core.serialization.property("birth_date", core.serialization.string().optional()), - wheelchairUse: core.serialization.property("wheelchair_use", core.serialization.boolean().optional()), + wheelchairUse: core.serialization.property("wheelchair_use", core.serialization.booleanLiteral(true).optional()), gender: Gender.optional(), sex: Sex.optional(), source: ClientFacingSource, @@ -29,7 +29,7 @@ export declare namespace ClientFacingProfile { user_id: string; height?: number | null; birth_date?: string | null; - wheelchair_use?: boolean | null; + wheelchair_use?: true | null; gender?: Gender.Raw | null; sex?: Sex.Raw | null; source: ClientFacingSource.Raw; diff --git a/src/serialization/types/ClientFacingSleep.ts b/src/serialization/types/ClientFacingSleep.ts index 0c16455c5..92120e873 100644 --- a/src/serialization/types/ClientFacingSleep.ts +++ b/src/serialization/types/ClientFacingSleep.ts @@ -27,6 +27,10 @@ export const ClientFacingSleep: core.serialization.ObjectSchema< rem: core.serialization.number(), deep: core.serialization.number(), score: core.serialization.number().optional(), + recoveryReadinessScore: core.serialization.property( + "recovery_readiness_score", + core.serialization.number().optional(), + ), hrLowest: core.serialization.property("hr_lowest", core.serialization.number().optional()), hrAverage: core.serialization.property("hr_average", core.serialization.number().optional()), hrResting: core.serialization.property("hr_resting", core.serialization.number().optional()), @@ -61,6 +65,7 @@ export declare namespace ClientFacingSleep { rem: number; deep: number; score?: number | null; + recovery_readiness_score?: number | null; hr_lowest?: number | null; hr_average?: number | null; hr_resting?: number | null; diff --git a/src/serialization/types/ClientFacingSleepCycleSourceType.ts b/src/serialization/types/ClientFacingSleepCycleSourceType.ts index 4726c907b..5030831e9 100644 --- a/src/serialization/types/ClientFacingSleepCycleSourceType.ts +++ b/src/serialization/types/ClientFacingSleepCycleSourceType.ts @@ -17,6 +17,7 @@ export const ClientFacingSleepCycleSourceType: core.serialization.Schema< "cuff", "manual_scan", "automatic", + "insulin_pump", "scale", "chest_strap", "ring", @@ -36,6 +37,7 @@ export declare namespace ClientFacingSleepCycleSourceType { | "cuff" | "manual_scan" | "automatic" + | "insulin_pump" | "scale" | "chest_strap" | "ring" diff --git a/src/serialization/types/CompendiumSearchLabs.ts b/src/serialization/types/CompendiumSearchLabs.ts new file mode 100644 index 000000000..c4daf563f --- /dev/null +++ b/src/serialization/types/CompendiumSearchLabs.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CompendiumSearchLabs: core.serialization.Schema< + serializers.CompendiumSearchLabs.Raw, + Vital.CompendiumSearchLabs +> = core.serialization.enum_(["labcorp", "quest", "bioreference", "sonora_quest"]); + +export declare namespace CompendiumSearchLabs { + export type Raw = "labcorp" | "quest" | "bioreference" | "sonora_quest"; +} diff --git a/src/serialization/types/ConvertCompendiumResponse.ts b/src/serialization/types/ConvertCompendiumResponse.ts new file mode 100644 index 000000000..13dddc1da --- /dev/null +++ b/src/serialization/types/ConvertCompendiumResponse.ts @@ -0,0 +1,45 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { ProviderIdConversionResponse } from "./ProviderIdConversionResponse.js"; + +export const ConvertCompendiumResponse: core.serialization.ObjectSchema< + serializers.ConvertCompendiumResponse.Raw, + Vital.ConvertCompendiumResponse +> = core.serialization.object({ + sourceLabTestId: core.serialization.property("source_lab_test_id", core.serialization.string().optional()), + sourceLabId: core.serialization.property("source_lab_id", core.serialization.number().optional()), + targetLabId: core.serialization.property("target_lab_id", core.serialization.number()), + targetLabSlug: core.serialization.property("target_lab_slug", core.serialization.string()), + sourceProviderIds: core.serialization.property( + "source_provider_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + convertedProviderIds: core.serialization.property( + "converted_provider_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + unresolvedProviderIds: core.serialization.property( + "unresolved_provider_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + bySourceProviderId: core.serialization.property( + "by_source_provider_id", + core.serialization.record(core.serialization.string(), ProviderIdConversionResponse).optional(), + ), +}); + +export declare namespace ConvertCompendiumResponse { + export interface Raw { + source_lab_test_id?: string | null; + source_lab_id?: number | null; + target_lab_id: number; + target_lab_slug: string; + source_provider_ids?: string[] | null; + converted_provider_ids?: string[] | null; + unresolved_provider_ids?: string[] | null; + by_source_provider_id?: Record | null; + } +} diff --git a/src/serialization/types/DerivedReadinessColumnExpr.ts b/src/serialization/types/DerivedReadinessColumnExpr.ts new file mode 100644 index 000000000..6f092605f --- /dev/null +++ b/src/serialization/types/DerivedReadinessColumnExpr.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { DerivedReadinessColumnExprDerivedReadiness } from "./DerivedReadinessColumnExprDerivedReadiness.js"; + +export const DerivedReadinessColumnExpr: core.serialization.ObjectSchema< + serializers.DerivedReadinessColumnExpr.Raw, + Vital.DerivedReadinessColumnExpr +> = core.serialization.object({ + derivedReadiness: core.serialization.property("derived_readiness", DerivedReadinessColumnExprDerivedReadiness), +}); + +export declare namespace DerivedReadinessColumnExpr { + export interface Raw { + derived_readiness: DerivedReadinessColumnExprDerivedReadiness.Raw; + } +} diff --git a/src/serialization/types/DerivedReadinessColumnExprDerivedReadiness.ts b/src/serialization/types/DerivedReadinessColumnExprDerivedReadiness.ts new file mode 100644 index 000000000..815e21a33 --- /dev/null +++ b/src/serialization/types/DerivedReadinessColumnExprDerivedReadiness.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const DerivedReadinessColumnExprDerivedReadiness: core.serialization.Schema< + serializers.DerivedReadinessColumnExprDerivedReadiness.Raw, + Vital.DerivedReadinessColumnExprDerivedReadiness +> = core.serialization.enum_([ + "date", + "chronotype", + "sleep_score", + "recovery_score", + "recovery_zone", + "stress_score", + "strain_score", + "strain_zone", +]); + +export declare namespace DerivedReadinessColumnExprDerivedReadiness { + export type Raw = + | "date" + | "chronotype" + | "sleep_score" + | "recovery_score" + | "recovery_zone" + | "stress_score" + | "strain_score" + | "strain_zone"; +} diff --git a/src/serialization/types/GetOrderTransactionResponse.ts b/src/serialization/types/GetOrderTransactionResponse.ts new file mode 100644 index 000000000..03fbb5133 --- /dev/null +++ b/src/serialization/types/GetOrderTransactionResponse.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { OrderSummary } from "./OrderSummary.js"; +import { OrderTransactionStatus } from "./OrderTransactionStatus.js"; + +export const GetOrderTransactionResponse: core.serialization.ObjectSchema< + serializers.GetOrderTransactionResponse.Raw, + Vital.GetOrderTransactionResponse +> = core.serialization.object({ + id: core.serialization.string(), + teamId: core.serialization.property("team_id", core.serialization.string()), + status: OrderTransactionStatus, + orders: core.serialization.list(OrderSummary).optional(), +}); + +export declare namespace GetOrderTransactionResponse { + export interface Raw { + id: string; + team_id: string; + status: OrderTransactionStatus.Raw; + orders?: OrderSummary.Raw[] | null; + } +} diff --git a/src/serialization/types/GetTeamLabAccountsResponse.ts b/src/serialization/types/GetTeamLabAccountsResponse.ts new file mode 100644 index 000000000..00a72e3cb --- /dev/null +++ b/src/serialization/types/GetTeamLabAccountsResponse.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { ClientFacingLabAccount } from "./ClientFacingLabAccount.js"; + +export const GetTeamLabAccountsResponse: core.serialization.ObjectSchema< + serializers.GetTeamLabAccountsResponse.Raw, + Vital.GetTeamLabAccountsResponse +> = core.serialization.object({ + data: core.serialization.list(ClientFacingLabAccount).optional(), +}); + +export declare namespace GetTeamLabAccountsResponse { + export interface Raw { + data?: ClientFacingLabAccount.Raw[] | null; + } +} diff --git a/src/serialization/types/HistoricalPullCompleted.ts b/src/serialization/types/HistoricalPullCompleted.ts index c77cdc6cd..4cf62017a 100644 --- a/src/serialization/types/HistoricalPullCompleted.ts +++ b/src/serialization/types/HistoricalPullCompleted.ts @@ -11,7 +11,7 @@ export const HistoricalPullCompleted: core.serialization.ObjectSchema< userId: core.serialization.property("user_id", core.serialization.string()), startDate: core.serialization.property("start_date", core.serialization.date()), endDate: core.serialization.property("end_date", core.serialization.date()), - isFinal: core.serialization.property("is_final", core.serialization.boolean()), + isFinal: core.serialization.property("is_final", core.serialization.booleanLiteral(true)), provider: core.serialization.string(), }); @@ -20,7 +20,7 @@ export declare namespace HistoricalPullCompleted { user_id: string; start_date: string; end_date: string; - is_final: boolean; + is_final: true; provider: string; } } diff --git a/src/serialization/types/IndexColumnExprIndex.ts b/src/serialization/types/IndexColumnExprIndex.ts index ffa83789a..7c59cafa5 100644 --- a/src/serialization/types/IndexColumnExprIndex.ts +++ b/src/serialization/types/IndexColumnExprIndex.ts @@ -7,8 +7,25 @@ import type * as serializers from "../index.js"; export const IndexColumnExprIndex: core.serialization.Schema< serializers.IndexColumnExprIndex.Raw, Vital.IndexColumnExprIndex -> = core.serialization.enum_(["sleep", "activity", "workout", "body", "meal", "profile", "timeseries"]); +> = core.serialization.enum_([ + "sleep", + "derived_readiness", + "activity", + "workout", + "body", + "meal", + "profile", + "timeseries", +]); export declare namespace IndexColumnExprIndex { - export type Raw = "sleep" | "activity" | "workout" | "body" | "meal" | "profile" | "timeseries"; + export type Raw = + | "sleep" + | "derived_readiness" + | "activity" + | "workout" + | "body" + | "meal" + | "profile" + | "timeseries"; } diff --git a/src/serialization/types/InsulinInjectionTimeseriesExpr.ts b/src/serialization/types/InsulinInjectionTimeseriesExpr.ts new file mode 100644 index 000000000..31051dd57 --- /dev/null +++ b/src/serialization/types/InsulinInjectionTimeseriesExpr.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { InsulinInjectionTimeseriesExprField } from "./InsulinInjectionTimeseriesExprField.js"; + +export const InsulinInjectionTimeseriesExpr: core.serialization.ObjectSchema< + serializers.InsulinInjectionTimeseriesExpr.Raw, + Vital.InsulinInjectionTimeseriesExpr +> = core.serialization.object({ + timeseries: core.serialization.stringLiteral("insulin_injection"), + field: InsulinInjectionTimeseriesExprField, +}); + +export declare namespace InsulinInjectionTimeseriesExpr { + export interface Raw { + timeseries: "insulin_injection"; + field: InsulinInjectionTimeseriesExprField.Raw; + } +} diff --git a/src/serialization/types/InsulinInjectionTimeseriesExprField.ts b/src/serialization/types/InsulinInjectionTimeseriesExprField.ts new file mode 100644 index 000000000..57c1a98c9 --- /dev/null +++ b/src/serialization/types/InsulinInjectionTimeseriesExprField.ts @@ -0,0 +1,39 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const InsulinInjectionTimeseriesExprField: core.serialization.Schema< + serializers.InsulinInjectionTimeseriesExprField.Raw, + Vital.InsulinInjectionTimeseriesExprField +> = core.serialization.enum_([ + "source_provider", + "source_type", + "source_app_id", + "source_workout_id", + "source_sport", + "timezone_offset", + "type", + "duration", + "value", + "delivery_mode", + "delivery_form", + "bolus_purpose", +]); + +export declare namespace InsulinInjectionTimeseriesExprField { + export type Raw = + | "source_provider" + | "source_type" + | "source_app_id" + | "source_workout_id" + | "source_sport" + | "timezone_offset" + | "type" + | "duration" + | "value" + | "delivery_mode" + | "delivery_form" + | "bolus_purpose"; +} diff --git a/src/serialization/types/IntervalTimeseriesExprTimeseries.ts b/src/serialization/types/IntervalTimeseriesExprTimeseries.ts index e439b9bb5..f5eaae31c 100644 --- a/src/serialization/types/IntervalTimeseriesExprTimeseries.ts +++ b/src/serialization/types/IntervalTimeseriesExprTimeseries.ts @@ -14,7 +14,6 @@ export const IntervalTimeseriesExprTimeseries: core.serialization.Schema< "heart_rate_alert", "stand_hour", "sleep_breathing_disturbance", - "insulin_injection", "water", "caffeine", "mindfulness_minutes", @@ -51,7 +50,6 @@ export declare namespace IntervalTimeseriesExprTimeseries { | "heart_rate_alert" | "stand_hour" | "sleep_breathing_disturbance" - | "insulin_injection" | "water" | "caffeine" | "mindfulness_minutes" diff --git a/src/serialization/types/LabAccountDelegatedFlow.ts b/src/serialization/types/LabAccountDelegatedFlow.ts new file mode 100644 index 000000000..ee80e25a9 --- /dev/null +++ b/src/serialization/types/LabAccountDelegatedFlow.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const LabAccountDelegatedFlow: core.serialization.Schema< + serializers.LabAccountDelegatedFlow.Raw, + Vital.LabAccountDelegatedFlow +> = core.serialization.enum_(["order_delegated", "result_delegated", "fully_delegated", "not_delegated"]); + +export declare namespace LabAccountDelegatedFlow { + export type Raw = "order_delegated" | "result_delegated" | "fully_delegated" | "not_delegated"; +} diff --git a/src/serialization/types/LabAccountStatus.ts b/src/serialization/types/LabAccountStatus.ts new file mode 100644 index 000000000..98c113450 --- /dev/null +++ b/src/serialization/types/LabAccountStatus.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const LabAccountStatus: core.serialization.Schema = + core.serialization.enum_(["active", "pending", "suspended"]); + +export declare namespace LabAccountStatus { + export type Raw = "active" | "pending" | "suspended"; +} diff --git a/src/serialization/types/LabResultsRaw.ts b/src/serialization/types/LabResultsRaw.ts index e14076a07..5988a3f4a 100644 --- a/src/serialization/types/LabResultsRaw.ts +++ b/src/serialization/types/LabResultsRaw.ts @@ -3,6 +3,7 @@ import type * as Vital from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; +import { ClientFacingOrderTransaction } from "./ClientFacingOrderTransaction.js"; import { LabResultsMetadata } from "./LabResultsMetadata.js"; import { LabResultsRawResults } from "./LabResultsRawResults.js"; import { MissingBiomarkerResult } from "./MissingBiomarkerResult.js"; @@ -20,6 +21,7 @@ export const LabResultsRaw: core.serialization.ObjectSchema | null; + order_transaction?: ClientFacingOrderTransaction.Raw | null; } } diff --git a/src/serialization/types/Labs.ts b/src/serialization/types/Labs.ts index 38606f800..bd24c1b21 100644 --- a/src/serialization/types/Labs.ts +++ b/src/serialization/types/Labs.ts @@ -9,6 +9,7 @@ export const Labs: core.serialization.Schema = "spiriplex", "ussl", "quest", + "sonora_quest", "labcorp", "bioreference", "us_biotek", @@ -17,6 +18,7 @@ export const Labs: core.serialization.Schema = "ihd", "nexus", "my_uti", + "crl", ]); export declare namespace Labs { @@ -25,6 +27,7 @@ export declare namespace Labs { | "spiriplex" | "ussl" | "quest" + | "sonora_quest" | "labcorp" | "bioreference" | "us_biotek" @@ -32,5 +35,6 @@ export declare namespace Labs { | "sanocardio" | "ihd" | "nexus" - | "my_uti"; + | "my_uti" + | "crl"; } diff --git a/src/serialization/types/ManualProviders.ts b/src/serialization/types/ManualProviders.ts index e8abb8eb7..b5c3cf308 100644 --- a/src/serialization/types/ManualProviders.ts +++ b/src/serialization/types/ManualProviders.ts @@ -15,6 +15,7 @@ export const ManualProviders: core.serialization.Schema = + core.serialization.enum_(["initial", "redraw", "recreation"]); + +export declare namespace OrderOrigin { + export type Raw = "initial" | "redraw" | "recreation"; +} diff --git a/src/serialization/types/OrderStatus.ts b/src/serialization/types/OrderStatus.ts index a235e8f29..95851e21d 100644 --- a/src/serialization/types/OrderStatus.ts +++ b/src/serialization/types/OrderStatus.ts @@ -38,6 +38,7 @@ export const OrderStatus: core.serialization.Schema = + core.serialization.enum_([ + "fulfillment_error", + "date_of_collection_unspecified", + "demographic_information_unspecified", + "demographic_information_mismatch", + "sample_quantity_not_sufficient", + "sample_contaminated", + "sample_stability_exceeded", + "sample_hemolyzed", + "sample_improper_collection", + ]); + +export declare namespace OrderStatusDetail { + export type Raw = + | "fulfillment_error" + | "date_of_collection_unspecified" + | "demographic_information_unspecified" + | "demographic_information_mismatch" + | "sample_quantity_not_sufficient" + | "sample_contaminated" + | "sample_stability_exceeded" + | "sample_hemolyzed" + | "sample_improper_collection"; +} diff --git a/src/serialization/types/OrderSummary.ts b/src/serialization/types/OrderSummary.ts new file mode 100644 index 000000000..5873d44fe --- /dev/null +++ b/src/serialization/types/OrderSummary.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { OrderLowLevelStatus } from "./OrderLowLevelStatus.js"; +import { OrderOrigin } from "./OrderOrigin.js"; + +export const OrderSummary: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + origin: OrderOrigin.optional(), + parentId: core.serialization.property("parent_id", core.serialization.string().optional()), + lastStatus: core.serialization.property("last_status", OrderLowLevelStatus), + lastStatusCreatedAt: core.serialization.property("last_status_created_at", core.serialization.date()), + updatedAt: core.serialization.property("updated_at", core.serialization.date()), + createdAt: core.serialization.property("created_at", core.serialization.date()), + }); + +export declare namespace OrderSummary { + export interface Raw { + id: string; + origin?: OrderOrigin.Raw | null; + parent_id?: string | null; + last_status: OrderLowLevelStatus.Raw; + last_status_created_at: string; + updated_at: string; + created_at: string; + } +} diff --git a/src/serialization/types/OrderTransactionStatus.ts b/src/serialization/types/OrderTransactionStatus.ts new file mode 100644 index 000000000..16251aa77 --- /dev/null +++ b/src/serialization/types/OrderTransactionStatus.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const OrderTransactionStatus: core.serialization.Schema< + serializers.OrderTransactionStatus.Raw, + Vital.OrderTransactionStatus +> = core.serialization.enum_(["active", "completed", "cancelled"]); + +export declare namespace OrderTransactionStatus { + export type Raw = "active" | "completed" | "cancelled"; +} diff --git a/src/serialization/types/ParsingJob.ts b/src/serialization/types/ParsingJob.ts index c491305bc..f66701214 100644 --- a/src/serialization/types/ParsingJob.ts +++ b/src/serialization/types/ParsingJob.ts @@ -4,13 +4,14 @@ import type * as Vital from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; import { ParsedLabReportData } from "./ParsedLabReportData.js"; +import { ParsingJobFailureReason } from "./ParsingJobFailureReason.js"; import { ParsingJobStatus } from "./ParsingJobStatus.js"; export const ParsingJob: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string(), - jobId: core.serialization.property("job_id", core.serialization.string()), status: ParsingJobStatus, + failureReason: core.serialization.property("failure_reason", ParsingJobFailureReason.optional()), data: ParsedLabReportData.optional(), needsHumanReview: core.serialization.property("needs_human_review", core.serialization.boolean()), isReviewed: core.serialization.property("is_reviewed", core.serialization.boolean()), @@ -19,8 +20,8 @@ export const ParsingJob: core.serialization.ObjectSchema = core.serialization.enum_(["invalid_input", "low_quality", "not_english"]); + +export declare namespace ParsingJobFailureReason { + export type Raw = "invalid_input" | "low_quality" | "not_english"; +} diff --git a/src/serialization/types/PasswordProviders.ts b/src/serialization/types/PasswordProviders.ts index b8edef0b7..124a3b226 100644 --- a/src/serialization/types/PasswordProviders.ts +++ b/src/serialization/types/PasswordProviders.ts @@ -17,6 +17,7 @@ export const PasswordProviders: core.serialization.Schema = core.serialization.enum_(["change_healthcare", "availity", "stedi", "waystar", "claim_md"]); +> = core.serialization.enum_(["change_healthcare", "availity", "stedi", "waystar", "claim_md", "apero", "pverify"]); export declare namespace PayorCodeExternalProvider { - export type Raw = "change_healthcare" | "availity" | "stedi" | "waystar" | "claim_md"; + export type Raw = "change_healthcare" | "availity" | "stedi" | "waystar" | "claim_md" | "apero" | "pverify"; } diff --git a/src/serialization/types/PerLabCandidate.ts b/src/serialization/types/PerLabCandidate.ts new file mode 100644 index 000000000..a5ef444cf --- /dev/null +++ b/src/serialization/types/PerLabCandidate.ts @@ -0,0 +1,62 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const PerLabCandidate: core.serialization.ObjectSchema = + core.serialization.object({ + markerId: core.serialization.property("marker_id", core.serialization.number()), + labId: core.serialization.property("lab_id", core.serialization.number()), + labSlug: core.serialization.property("lab_slug", core.serialization.string().optional()), + name: core.serialization.string(), + resultNames: core.serialization.property( + "result_names", + core.serialization.list(core.serialization.string()).optional(), + ), + providerId: core.serialization.property("provider_id", core.serialization.string().optional()), + loincSetHash: core.serialization.property("loinc_set_hash", core.serialization.string()), + loincCodes: core.serialization.property( + "loinc_codes", + core.serialization.list(core.serialization.string()).optional(), + ), + loincComponents: core.serialization.property( + "loinc_components", + core.serialization.list(core.serialization.string()).optional(), + ), + loincGroups: core.serialization.property( + "loinc_groups", + core.serialization.list(core.serialization.string()).optional(), + ), + cptCodes: core.serialization.property( + "cpt_codes", + core.serialization.list(core.serialization.string()).optional(), + ), + relation: core.serialization.string(), + confidence: core.serialization.number(), + reasonCodes: core.serialization.property( + "reason_codes", + core.serialization.list(core.serialization.string()).optional(), + ), + markerPopularityScore: core.serialization.property("marker_popularity_score", core.serialization.number()), + }); + +export declare namespace PerLabCandidate { + export interface Raw { + marker_id: number; + lab_id: number; + lab_slug?: string | null; + name: string; + result_names?: string[] | null; + provider_id?: string | null; + loinc_set_hash: string; + loinc_codes?: string[] | null; + loinc_components?: string[] | null; + loinc_groups?: string[] | null; + cpt_codes?: string[] | null; + relation: string; + confidence: number; + reason_codes?: string[] | null; + marker_popularity_score: number; + } +} diff --git a/src/serialization/types/Placeholder.ts b/src/serialization/types/Placeholder.ts index 13c862a99..84594f816 100644 --- a/src/serialization/types/Placeholder.ts +++ b/src/serialization/types/Placeholder.ts @@ -6,11 +6,11 @@ import type * as serializers from "../index.js"; export const Placeholder: core.serialization.ObjectSchema = core.serialization.object({ - placeholder: core.serialization.boolean(), + placeholder: core.serialization.booleanLiteral(true), }); export declare namespace Placeholder { export interface Raw { - placeholder: boolean; + placeholder: true; } } diff --git a/src/serialization/types/ProviderIdConversionResponse.ts b/src/serialization/types/ProviderIdConversionResponse.ts new file mode 100644 index 000000000..8445a6ddf --- /dev/null +++ b/src/serialization/types/ProviderIdConversionResponse.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { PerLabCandidate } from "./PerLabCandidate.js"; + +export const ProviderIdConversionResponse: core.serialization.ObjectSchema< + serializers.ProviderIdConversionResponse.Raw, + Vital.ProviderIdConversionResponse +> = core.serialization.object({ + sourceProviderId: core.serialization.property("source_provider_id", core.serialization.string()), + candidates: core.serialization.list(PerLabCandidate).optional(), +}); + +export declare namespace ProviderIdConversionResponse { + export interface Raw { + source_provider_id: string; + candidates?: PerLabCandidate.Raw[] | null; + } +} diff --git a/src/serialization/types/Providers.ts b/src/serialization/types/Providers.ts index 08801aa68..dca8896d7 100644 --- a/src/serialization/types/Providers.ts +++ b/src/serialization/types/Providers.ts @@ -17,6 +17,7 @@ export const Providers: core.serialization.Schema = core.serialization.object({ + canonical: CanonicalCandidate, + relation: core.serialization.string(), + confidence: core.serialization.number(), + reasonCodes: core.serialization.property( + "reason_codes", + core.serialization.list(core.serialization.string()).optional(), + ), +}); + +export declare namespace RelatedCandidate { + export interface Raw { + canonical: CanonicalCandidate.Raw; + relation: string; + confidence: number; + reason_codes?: string[] | null; + } +} diff --git a/src/serialization/types/ResultMetadata.ts b/src/serialization/types/ResultMetadata.ts index 0171b7157..169ed6414 100644 --- a/src/serialization/types/ResultMetadata.ts +++ b/src/serialization/types/ResultMetadata.ts @@ -3,13 +3,15 @@ import type * as Vital from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; +import { ResultMetadataGender } from "./ResultMetadataGender.js"; export const ResultMetadata: core.serialization.ObjectSchema = core.serialization.object({ - patientFirstName: core.serialization.property("patient_first_name", core.serialization.string()), - patientLastName: core.serialization.property("patient_last_name", core.serialization.string()), - dob: core.serialization.string(), - labName: core.serialization.property("lab_name", core.serialization.string()), + patientFirstName: core.serialization.property("patient_first_name", core.serialization.string().optional()), + patientLastName: core.serialization.property("patient_last_name", core.serialization.string().optional()), + dob: core.serialization.string().optional(), + gender: ResultMetadataGender.optional(), + labName: core.serialization.property("lab_name", core.serialization.string().optional()), dateReported: core.serialization.property("date_reported", core.serialization.string().optional()), dateCollected: core.serialization.property("date_collected", core.serialization.string().optional()), specimenNumber: core.serialization.property("specimen_number", core.serialization.string().optional()), @@ -17,10 +19,11 @@ export const ResultMetadata: core.serialization.ObjectSchema = core.serialization.enum_(["male", "female", "other"]); + +export declare namespace ResultMetadataGender { + export type Raw = "male" | "female" | "other"; +} diff --git a/src/serialization/types/SearchCompendiumResponse.ts b/src/serialization/types/SearchCompendiumResponse.ts new file mode 100644 index 000000000..c6a1824c5 --- /dev/null +++ b/src/serialization/types/SearchCompendiumResponse.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CanonicalCandidate } from "./CanonicalCandidate.js"; +import { PerLabCandidate } from "./PerLabCandidate.js"; +import { RelatedCandidate } from "./RelatedCandidate.js"; +import { SearchMode } from "./SearchMode.js"; + +export const SearchCompendiumResponse: core.serialization.ObjectSchema< + serializers.SearchCompendiumResponse.Raw, + Vital.SearchCompendiumResponse +> = core.serialization.object({ + mode: SearchMode, + selectedCanonical: core.serialization.property("selected_canonical", CanonicalCandidate.optional()), + canonicalCandidates: core.serialization.property( + "canonical_candidates", + core.serialization.list(CanonicalCandidate).optional(), + ), + perLab: core.serialization.property( + "per_lab", + core.serialization.record(core.serialization.string(), core.serialization.list(PerLabCandidate)).optional(), + ), + related: core.serialization.list(RelatedCandidate).optional(), +}); + +export declare namespace SearchCompendiumResponse { + export interface Raw { + mode: SearchMode.Raw; + selected_canonical?: CanonicalCandidate.Raw | null; + canonical_candidates?: CanonicalCandidate.Raw[] | null; + per_lab?: Record | null; + related?: RelatedCandidate.Raw[] | null; + } +} diff --git a/src/serialization/types/SearchMode.ts b/src/serialization/types/SearchMode.ts new file mode 100644 index 000000000..27d62e4ea --- /dev/null +++ b/src/serialization/types/SearchMode.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const SearchMode: core.serialization.Schema = + core.serialization.enum_(["canonical", "crosswalk"]); + +export declare namespace SearchMode { + export type Raw = "canonical" | "crosswalk"; +} diff --git a/src/serialization/types/SleepColumnExprSleep.ts b/src/serialization/types/SleepColumnExprSleep.ts index 360d12f0f..7c738e9ab 100644 --- a/src/serialization/types/SleepColumnExprSleep.ts +++ b/src/serialization/types/SleepColumnExprSleep.ts @@ -33,6 +33,7 @@ export const SleepColumnExprSleep: core.serialization.Schema< "skin_temperature_delta", "respiratory_rate", "score", + "recovery_readiness_score", "source_type", "source_provider", "source_app_id", @@ -67,6 +68,7 @@ export declare namespace SleepColumnExprSleep { | "skin_temperature_delta" | "respiratory_rate" | "score" + | "recovery_readiness_score" | "source_type" | "source_provider" | "source_app_id" diff --git a/src/serialization/types/UsAddress.ts b/src/serialization/types/UsAddress.ts index bb51c7f81..42c895b0e 100644 --- a/src/serialization/types/UsAddress.ts +++ b/src/serialization/types/UsAddress.ts @@ -12,6 +12,7 @@ export const UsAddress: core.serialization.ObjectSchema = core.serialization.enum_([ + "AL", + "AK", + "AZ", + "AR", + "CA", + "CO", + "CT", + "DE", + "FL", + "GA", + "HI", + "ID", + "IL", + "IN", + "IA", + "KS", + "KY", + "LA", + "ME", + "MD", + "MA", + "MI", + "MN", + "MS", + "MO", + "MT", + "NE", + "NV", + "NH", + "NJ", + "NM", + "NY", + "NC", + "ND", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VT", + "VA", + "WA", + "WV", + "WI", + "WY", +]); + +export declare namespace UsState { + export type Raw = + | "AL" + | "AK" + | "AZ" + | "AR" + | "CA" + | "CO" + | "CT" + | "DE" + | "FL" + | "GA" + | "HI" + | "ID" + | "IL" + | "IN" + | "IA" + | "KS" + | "KY" + | "LA" + | "ME" + | "MD" + | "MA" + | "MI" + | "MN" + | "MS" + | "MO" + | "MT" + | "NE" + | "NV" + | "NH" + | "NJ" + | "NM" + | "NY" + | "NC" + | "ND" + | "OH" + | "OK" + | "OR" + | "PA" + | "RI" + | "SC" + | "SD" + | "TN" + | "TX" + | "UT" + | "VT" + | "VA" + | "WA" + | "WV" + | "WI" + | "WY"; +} diff --git a/src/serialization/types/UserAddress.ts b/src/serialization/types/UserAddress.ts new file mode 100644 index 000000000..195e741b0 --- /dev/null +++ b/src/serialization/types/UserAddress.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Vital from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const UserAddress: core.serialization.ObjectSchema = + core.serialization.object({ + firstLine: core.serialization.property("first_line", core.serialization.string()), + secondLine: core.serialization.property("second_line", core.serialization.string().optional()), + country: core.serialization.string(), + zip: core.serialization.string(), + city: core.serialization.string(), + state: core.serialization.string(), + accessNotes: core.serialization.property("access_notes", core.serialization.string().optional()), + }); + +export declare namespace UserAddress { + export interface Raw { + first_line: string; + second_line?: string | null; + country: string; + zip: string; + city: string; + state: string; + access_notes?: string | null; + } +} diff --git a/src/serialization/types/UserInfo.ts b/src/serialization/types/UserInfo.ts index 8c4c4f9f4..a9ee1ee32 100644 --- a/src/serialization/types/UserInfo.ts +++ b/src/serialization/types/UserInfo.ts @@ -3,12 +3,12 @@ import type * as Vital from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; -import { Address } from "./Address.js"; import { Ethnicity } from "./Ethnicity.js"; import { GenderIdentity } from "./GenderIdentity.js"; import { GuarantorDetails } from "./GuarantorDetails.js"; import { Race } from "./Race.js"; import { SexualOrientation } from "./SexualOrientation.js"; +import { UserAddress } from "./UserAddress.js"; export const UserInfo: core.serialization.ObjectSchema = core.serialization.object({ @@ -18,7 +18,7 @@ export const UserInfo: core.serialization.ObjectSchema = core.serialization.object({ - success: core.serialization.boolean(), + success: core.serialization.booleanLiteral(false), userId: core.serialization.property("user_id", core.serialization.string()), error: core.serialization.string(), failedSources: core.serialization.property( @@ -19,7 +19,7 @@ export const UserRefreshErrorResponse: core.serialization.ObjectSchema< export declare namespace UserRefreshErrorResponse { export interface Raw { - success: boolean; + success: false; user_id: string; error: string; failed_sources?: string[] | null; diff --git a/src/serialization/types/UserRefreshSuccessResponse.ts b/src/serialization/types/UserRefreshSuccessResponse.ts index 042293688..ad33b0aea 100644 --- a/src/serialization/types/UserRefreshSuccessResponse.ts +++ b/src/serialization/types/UserRefreshSuccessResponse.ts @@ -8,7 +8,7 @@ export const UserRefreshSuccessResponse: core.serialization.ObjectSchema< serializers.UserRefreshSuccessResponse.Raw, Vital.UserRefreshSuccessResponse > = core.serialization.object({ - success: core.serialization.boolean(), + success: core.serialization.booleanLiteral(true), userId: core.serialization.property("user_id", core.serialization.string()), refreshedSources: core.serialization.property( "refreshed_sources", @@ -23,7 +23,7 @@ export const UserRefreshSuccessResponse: core.serialization.ObjectSchema< export declare namespace UserRefreshSuccessResponse { export interface Raw { - success: boolean; + success: true; user_id: string; refreshed_sources: string[]; in_progress_sources: string[]; diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index fd115a275..70a886ce1 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -28,6 +28,7 @@ export * from "./AttemptStatus.js"; export * from "./AuthType.js"; export * from "./Availability.js"; export * from "./AwakeAtValueMacroExpr.js"; +export * from "./AwakeningsValueMacroExpr.js"; export * from "./BasalBodyTemperatureEntry.js"; export * from "./Billing.js"; export * from "./BiomarkerResult.js"; @@ -42,6 +43,7 @@ export * from "./BulkOp.js"; export * from "./BulkOpStatus.js"; export * from "./BulkOpsResponse.js"; export * from "./BulkOpType.js"; +export * from "./CanonicalCandidate.js"; export * from "./CervicalMucusEntry.js"; export * from "./CervicalMucusEntryQuality.js"; export * from "./ChronotypeValueMacroExpr.js"; @@ -209,10 +211,16 @@ export * from "./ClientFacingInsulinInjectionChanged.js"; export * from "./ClientFacingInsulinInjectionChangedEventType.js"; export * from "./ClientFacingInsulinInjectionHistoricalPullCompleted.js"; export * from "./ClientFacingInsulinInjectionSample.js"; +export * from "./ClientFacingInsulinInjectionSampleBolusPurpose.js"; +export * from "./ClientFacingInsulinInjectionSampleDeliveryForm.js"; +export * from "./ClientFacingInsulinInjectionSampleDeliveryMode.js"; export * from "./ClientFacingInsulinInjectionSampleType.js"; export * from "./ClientFacingInsurance.js"; export * from "./ClientFacingLab.js"; +export * from "./ClientFacingLabAccount.js"; export * from "./ClientFacingLabLocation.js"; +export * from "./ClientFacingLabReportParsingJobCreatedEvent.js"; +export * from "./ClientFacingLabReportParsingJobUpdatedEvent.js"; export * from "./ClientFacingLabs.js"; export * from "./ClientFacingLabTest.js"; export * from "./ClientFacingLeanBodyMassChanged.js"; @@ -248,6 +256,8 @@ export * from "./ClientFacingOrderChanged.js"; export * from "./ClientFacingOrderChangedEventType.js"; export * from "./ClientFacingOrderDetails.js"; export * from "./ClientFacingOrderEvent.js"; +export * from "./ClientFacingOrderInTransaction.js"; +export * from "./ClientFacingOrderTransaction.js"; export * from "./ClientFacingPatientDetailsCompatible.js"; export * from "./ClientFacingPayor.js"; export * from "./ClientFacingPayorCodeSource.js"; @@ -384,6 +394,7 @@ export * from "./ClientUserIdConflictResponse.js"; export * from "./ClientWorkoutResponse.js"; export * from "./ClinicalInformation.js"; export * from "./CompanyDetails.js"; +export * from "./CompendiumSearchLabs.js"; export * from "./ConnectedSourceClientFacing.js"; export * from "./ConnectionRecipe.js"; export * from "./Consent.js"; @@ -394,6 +405,7 @@ export * from "./ContinuousQueryTaskHistoryResponse.js"; export * from "./ContinuousQueryTaskStatus.js"; export * from "./ContraceptiveEntry.js"; export * from "./ContraceptiveEntryType.js"; +export * from "./ConvertCompendiumResponse.js"; export * from "./CreateUserPortalUrlResponse.js"; export * from "./DatePartExpr.js"; export * from "./DatePartExprArg.js"; @@ -404,6 +416,8 @@ export * from "./DaySlots.js"; export * from "./DelegatedFlowType.js"; export * from "./DemoConnectionStatus.js"; export * from "./DemoProviders.js"; +export * from "./DerivedReadinessColumnExpr.js"; +export * from "./DerivedReadinessColumnExprDerivedReadiness.js"; export * from "./DetectedDeviationEntry.js"; export * from "./DetectedDeviationEntryDeviation.js"; export * from "./DeviceV2InDb.js"; @@ -424,6 +438,8 @@ export * from "./Gender.js"; export * from "./GenderIdentity.js"; export * from "./GetMarkersResponse.js"; export * from "./GetOrdersResponse.js"; +export * from "./GetOrderTransactionResponse.js"; +export * from "./GetTeamLabAccountsResponse.js"; export * from "./GroupedAFibBurden.js"; export * from "./GroupedAFibBurdenResponse.js"; export * from "./GroupedBasalBodyTemperature.js"; @@ -547,12 +563,16 @@ export * from "./IcdExcludesViolation.js"; export * from "./IcdExcludesWarning.js"; export * from "./IndexColumnExpr.js"; export * from "./IndexColumnExprIndex.js"; +export * from "./InsulinInjectionTimeseriesExpr.js"; +export * from "./InsulinInjectionTimeseriesExprField.js"; export * from "./IntermenstrualBleedingEntry.js"; export * from "./Interpretation.js"; export * from "./IntervalTimeseriesExpr.js"; export * from "./IntervalTimeseriesExprField.js"; export * from "./IntervalTimeseriesExprTimeseries.js"; export * from "./Jpeg.js"; +export * from "./LabAccountDelegatedFlow.js"; +export * from "./LabAccountStatus.js"; export * from "./LabLocationCapability.js"; export * from "./LabLocationMetadata.js"; export * from "./LabReportResult.js"; @@ -590,15 +610,20 @@ export * from "./NotFoundErrorBody.js"; export * from "./OAuthProviders.js"; export * from "./OrderActivationType.js"; export * from "./OrderLowLevelStatus.js"; +export * from "./OrderOrigin.js"; export * from "./OrderSetRequest.js"; export * from "./OrderStatus.js"; +export * from "./OrderStatusDetail.js"; +export * from "./OrderSummary.js"; export * from "./OrderTopLevelStatus.js"; +export * from "./OrderTransactionStatus.js"; export * from "./OvulationTestEntry.js"; export * from "./OvulationTestEntryTestResult.js"; export * from "./PaginatedUsersResponse.js"; export * from "./ParentBiomarkerData.js"; export * from "./ParsedLabReportData.js"; export * from "./ParsingJob.js"; +export * from "./ParsingJobFailureReason.js"; export * from "./ParsingJobStatus.js"; export * from "./PasswordProviders.js"; export * from "./PatientAddress.js"; @@ -609,6 +634,7 @@ export * from "./PayorCodeExternalProvider.js"; export * from "./PerformingLaboratory.js"; export * from "./Period.js"; export * from "./PeriodUnit.js"; +export * from "./PerLabCandidate.js"; export * from "./PhlebotomyAreaInfo.js"; export * from "./PhlebotomyProviderInfo.js"; export * from "./PhysicianCreateRequest.js"; @@ -624,6 +650,7 @@ export * from "./ProfileInDb.js"; export * from "./ProviderConnectionCreated.js"; export * from "./ProviderConnectionError.js"; export * from "./ProviderConnectionErrorErrorType.js"; +export * from "./ProviderIdConversionResponse.js"; export * from "./ProviderLinkResponse.js"; export * from "./ProviderLinkResponseErrorType.js"; export * from "./ProviderLinkResponseState.js"; @@ -648,11 +675,13 @@ export * from "./RawProfile.js"; export * from "./RawSleep.js"; export * from "./RawWorkout.js"; export * from "./Region.js"; +export * from "./RelatedCandidate.js"; export * from "./RelativeTimeframe.js"; export * from "./ResendWebhookResponse.js"; export * from "./ResourceAvailability.js"; export * from "./ResponsibleRelationship.js"; export * from "./ResultMetadata.js"; +export * from "./ResultMetadataGender.js"; export * from "./ResultType.js"; export * from "./SampleData.js"; export * from "./SampleDataDateCollected.js"; @@ -660,6 +689,8 @@ export * from "./SampleDataDateReceived.js"; export * from "./SampleDataDateReported.js"; export * from "./ScopeRequirementsGrants.js"; export * from "./ScopeRequirementsStr.js"; +export * from "./SearchCompendiumResponse.js"; +export * from "./SearchMode.js"; export * from "./Select.js"; export * from "./Sex.js"; export * from "./SexualActivityEntry.js"; @@ -695,6 +726,7 @@ export * from "./TimeseriesResource.js"; export * from "./TraceElements.js"; export * from "./UnrecognizedValueMacroExpr.js"; export * from "./UsAddress.js"; +export * from "./UserAddress.js"; export * from "./UserHistoricalPullsResponse.js"; export * from "./UserInfo.js"; export * from "./UserRefreshErrorResponse.js"; @@ -702,6 +734,7 @@ export * from "./UserRefreshSuccessResponse.js"; export * from "./UserResourcesResponse.js"; export * from "./UserSignInTokenResponse.js"; export * from "./UserSuccessResponse.js"; +export * from "./UsState.js"; export * from "./UtcTimestampWithTimezoneOffset.js"; export * from "./ValidateIcdCodesResponse.js"; export * from "./ValidationError.js"; diff --git a/src/version.ts b/src/version.ts index 9379e1537..c8a6ab3f5 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.1.551"; +export const SDK_VERSION = "4.0.0"; diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts index 1b0e51079..1f7667ff4 100644 --- a/tests/mock-server/mockEndpointBuilder.ts +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -4,7 +4,7 @@ import { url } from "../../src/core"; import { toJson } from "../../src/core/json"; import { withFormUrlEncoded } from "./withFormUrlEncoded"; import { withHeaders } from "./withHeaders"; -import { withJson } from "./withJson"; +import { type WithJsonOptions, withJson } from "./withJson"; type HttpMethod = "all" | "get" | "post" | "put" | "delete" | "patch" | "options" | "head"; @@ -26,7 +26,7 @@ interface RequestHeadersStage extends RequestBodyStage, ResponseStage { } interface RequestBodyStage extends ResponseStage { - jsonBody(body: unknown): ResponseStage; + jsonBody(body: unknown, options?: WithJsonOptions): ResponseStage; formUrlEncodedBody(body: unknown): ResponseStage; } @@ -44,6 +44,7 @@ interface ResponseHeaderStage extends ResponseBodyStage, BuildStage { interface ResponseBodyStage { jsonBody(body: unknown): BuildStage; + sseBody(body: string): BuildStage; } interface BuildStage { @@ -129,11 +130,11 @@ class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodySta return this; } - jsonBody(body: unknown): ResponseStage { + jsonBody(body: unknown, options?: WithJsonOptions): ResponseStage { if (body === undefined) { throw new Error("Undefined is not valid JSON. Do not call jsonBody if you want an empty body."); } - this.predicates.push((resolver) => withJson(body, resolver)); + this.predicates.push((resolver) => withJson(body, resolver, options)); return this; } @@ -201,6 +202,12 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo return this; } + public sseBody(body: string): BuildStage { + this.responseHeaders["Content-Type"] = "text/event-stream"; + this.responseBody = body; + return this; + } + public build(): HttpHandler { const responseResolver: HttpResponseResolver = () => { const response = new HttpResponse(this.responseBody, { diff --git a/tests/mock-server/withJson.ts b/tests/mock-server/withJson.ts index b627638b0..3e8800a0c 100644 --- a/tests/mock-server/withJson.ts +++ b/tests/mock-server/withJson.ts @@ -2,12 +2,26 @@ import { type HttpResponseResolver, passthrough } from "msw"; import { fromJson, toJson } from "../../src/core/json"; +export interface WithJsonOptions { + /** + * List of field names to ignore when comparing request bodies. + * This is useful for pagination cursor fields that change between requests. + */ + ignoredFields?: string[]; +} + /** * Creates a request matcher that validates if the request JSON body exactly matches the expected object * @param expectedBody - The exact body object to match against * @param resolver - Response resolver to execute if body matches + * @param options - Optional configuration including fields to ignore */ -export function withJson(expectedBody: unknown, resolver: HttpResponseResolver): HttpResponseResolver { +export function withJson( + expectedBody: unknown, + resolver: HttpResponseResolver, + options?: WithJsonOptions, +): HttpResponseResolver { + const ignoredFields = options?.ignoredFields ?? []; return async (args) => { const { request } = args; @@ -28,7 +42,8 @@ export function withJson(expectedBody: unknown, resolver: HttpResponseResolver): } const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).filter((key) => !key.startsWith("pagination.")).length > 0) { + const filteredMismatches = Object.keys(mismatches).filter((key) => !ignoredFields.includes(key)); + if (filteredMismatches.length > 0) { console.error("JSON body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } diff --git a/tests/unit/fetcher/Fetcher.test.ts b/tests/unit/fetcher/Fetcher.test.ts index 2f98ede81..6c1762422 100644 --- a/tests/unit/fetcher/Fetcher.test.ts +++ b/tests/unit/fetcher/Fetcher.test.ts @@ -118,7 +118,7 @@ describe("Test fetcherImpl", () => { const { value } = await reader.read(); const decoder = new TextDecoder(); const streamContent = decoder.decode(value); - expect(streamContent).toBe("This is a test file!\n"); + expect(streamContent.trim()).toBe("This is a test file!"); expect(body.bodyUsed).toBe(true); } }); @@ -164,7 +164,7 @@ describe("Test fetcherImpl", () => { const { value } = await reader.read(); const decoder = new TextDecoder(); const streamContent = decoder.decode(value); - expect(streamContent).toBe("This is a test file!\n"); + expect(streamContent.trim()).toBe("This is a test file!"); expect(body.bodyUsed).toBe(true); } }); @@ -208,7 +208,7 @@ describe("Test fetcherImpl", () => { expect(arrayBuffer).toBeInstanceOf(ArrayBuffer); const decoder = new TextDecoder(); const streamContent = decoder.decode(new Uint8Array(arrayBuffer)); - expect(streamContent).toBe("This is a test file!\n"); + expect(streamContent.trim()).toBe("This is a test file!"); expect(body.bodyUsed).toBe(true); } }); @@ -255,7 +255,7 @@ describe("Test fetcherImpl", () => { expect(bytes).toBeInstanceOf(Uint8Array); const decoder = new TextDecoder(); const streamContent = decoder.decode(bytes); - expect(streamContent).toBe("This is a test file!\n"); + expect(streamContent.trim()).toBe("This is a test file!"); expect(body.bodyUsed).toBe(true); } }); diff --git a/tests/unit/file/file.test.ts b/tests/unit/file/file.test.ts index d7c4570b8..6cd650905 100644 --- a/tests/unit/file/file.test.ts +++ b/tests/unit/file/file.test.ts @@ -5,6 +5,7 @@ import { toBinaryUploadRequest, type Uploadable } from "../../../src/core/file/i describe("toBinaryUploadRequest", () => { const TEST_FILE_PATH = join(__dirname, "..", "test-file.txt"); + const TEST_FILE_SIZE = fs.statSync(TEST_FILE_PATH).size.toString(); beforeEach(() => { vi.clearAllMocks(); @@ -377,7 +378,7 @@ describe("toBinaryUploadRequest", () => { expect(result.headers).toEqual({ "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path "Content-Type": "text/plain", - "Content-Length": "21", // Should determine from file system (test file is 21 bytes) + "Content-Length": TEST_FILE_SIZE, // Should determine from file system (OS-agnostic) }); }); @@ -391,7 +392,7 @@ describe("toBinaryUploadRequest", () => { expect(result.body).toBeInstanceOf(fs.ReadStream); expect(result.headers).toEqual({ "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path - "Content-Length": "21", // Should determine from file system (test file is 21 bytes) + "Content-Length": TEST_FILE_SIZE, // Should determine from file system (OS-agnostic) }); }); }); diff --git a/tests/wire/compendium.test.ts b/tests/wire/compendium.test.ts new file mode 100644 index 000000000..929362518 --- /dev/null +++ b/tests/wire/compendium.test.ts @@ -0,0 +1,245 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Vital from "../../src/api/index"; +import { VitalClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("CompendiumClient", () => { + test("search (1)", async () => { + const server = mockServerPool.createServer(); + const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { mode: "canonical" }; + const rawResponseBody = { + mode: "canonical", + selected_canonical: { + loinc_set_hash: "loinc_set_hash", + display_name: "display_name", + aliases: ["aliases"], + loinc_codes: ["loinc_codes"], + provider_ids: ["provider_ids"], + loinc_components: ["loinc_components"], + loinc_groups: ["loinc_groups"], + cpt_codes: ["cpt_codes"], + popularity_score: 1.1, + confidence: 1.1, + }, + canonical_candidates: [ + { + loinc_set_hash: "loinc_set_hash", + display_name: "display_name", + aliases: ["aliases"], + loinc_codes: ["loinc_codes"], + provider_ids: ["provider_ids"], + loinc_components: ["loinc_components"], + loinc_groups: ["loinc_groups"], + cpt_codes: ["cpt_codes"], + popularity_score: 1.1, + confidence: 1.1, + }, + ], + per_lab: { + key: [ + { + marker_id: 1, + lab_id: 1, + name: "name", + loinc_set_hash: "loinc_set_hash", + relation: "relation", + confidence: 1.1, + marker_popularity_score: 1.1, + }, + ], + }, + related: [ + { + canonical: { + loinc_set_hash: "loinc_set_hash", + display_name: "display_name", + popularity_score: 1.1, + confidence: 1.1, + }, + relation: "relation", + confidence: 1.1, + reason_codes: ["reason_codes"], + }, + ], + }; + server + .mockEndpoint() + .post("/v3/compendium/search") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.compendium.search({ + mode: "canonical", + }); + expect(response).toEqual({ + mode: "canonical", + selectedCanonical: { + loincSetHash: "loinc_set_hash", + displayName: "display_name", + aliases: ["aliases"], + loincCodes: ["loinc_codes"], + providerIds: ["provider_ids"], + loincComponents: ["loinc_components"], + loincGroups: ["loinc_groups"], + cptCodes: ["cpt_codes"], + popularityScore: 1.1, + confidence: 1.1, + }, + canonicalCandidates: [ + { + loincSetHash: "loinc_set_hash", + displayName: "display_name", + aliases: ["aliases"], + loincCodes: ["loinc_codes"], + providerIds: ["provider_ids"], + loincComponents: ["loinc_components"], + loincGroups: ["loinc_groups"], + cptCodes: ["cpt_codes"], + popularityScore: 1.1, + confidence: 1.1, + }, + ], + perLab: { + key: [ + { + markerId: 1, + labId: 1, + name: "name", + loincSetHash: "loinc_set_hash", + relation: "relation", + confidence: 1.1, + markerPopularityScore: 1.1, + }, + ], + }, + related: [ + { + canonical: { + loincSetHash: "loinc_set_hash", + displayName: "display_name", + popularityScore: 1.1, + confidence: 1.1, + }, + relation: "relation", + confidence: 1.1, + reasonCodes: ["reason_codes"], + }, + ], + }); + }); + + test("search (2)", async () => { + const server = mockServerPool.createServer(); + const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { mode: "canonical" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/v3/compendium/search") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.compendium.search({ + mode: "canonical", + }); + }).rejects.toThrow(Vital.UnprocessableEntityError); + }); + + test("convert (1)", async () => { + const server = mockServerPool.createServer(); + const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { target_lab: "labcorp" }; + const rawResponseBody = { + source_lab_test_id: "source_lab_test_id", + source_lab_id: 1, + target_lab_id: 1, + target_lab_slug: "target_lab_slug", + source_provider_ids: ["source_provider_ids"], + converted_provider_ids: ["converted_provider_ids"], + unresolved_provider_ids: ["unresolved_provider_ids"], + by_source_provider_id: { + key: { + source_provider_id: "source_provider_id", + candidates: [ + { + marker_id: 1, + lab_id: 1, + name: "name", + loinc_set_hash: "loinc_set_hash", + relation: "relation", + confidence: 1.1, + marker_popularity_score: 1.1, + }, + ], + }, + }, + }; + server + .mockEndpoint() + .post("/v3/compendium/convert") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.compendium.convert({ + targetLab: "labcorp", + }); + expect(response).toEqual({ + sourceLabTestId: "source_lab_test_id", + sourceLabId: 1, + targetLabId: 1, + targetLabSlug: "target_lab_slug", + sourceProviderIds: ["source_provider_ids"], + convertedProviderIds: ["converted_provider_ids"], + unresolvedProviderIds: ["unresolved_provider_ids"], + bySourceProviderId: { + key: { + sourceProviderId: "source_provider_id", + candidates: [ + { + markerId: 1, + labId: 1, + name: "name", + loincSetHash: "loinc_set_hash", + relation: "relation", + confidence: 1.1, + markerPopularityScore: 1.1, + }, + ], + }, + }, + }); + }); + + test("convert (2)", async () => { + const server = mockServerPool.createServer(); + const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { target_lab: "labcorp" }; + const rawResponseBody = {}; + server + .mockEndpoint() + .post("/v3/compendium/convert") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.compendium.convert({ + targetLab: "labcorp", + }); + }).rejects.toThrow(Vital.UnprocessableEntityError); + }); +}); diff --git a/tests/wire/insurance.test.ts b/tests/wire/insurance.test.ts index 223c52c89..db08956c5 100644 --- a/tests/wire/insurance.test.ts +++ b/tests/wire/insurance.test.ts @@ -21,6 +21,7 @@ describe("InsuranceClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, source: "platform", }, @@ -50,6 +51,7 @@ describe("InsuranceClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, source: "platform", }, @@ -90,6 +92,7 @@ describe("InsuranceClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, source: "platform", }, @@ -116,6 +119,7 @@ describe("InsuranceClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, source: "platform", }, diff --git a/tests/wire/labAccount.test.ts b/tests/wire/labAccount.test.ts new file mode 100644 index 000000000..91e7652af --- /dev/null +++ b/tests/wire/labAccount.test.ts @@ -0,0 +1,79 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Vital from "../../src/api/index"; +import { VitalClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("LabAccountClient", () => { + test("get_team_lab_accounts (1)", async () => { + const server = mockServerPool.createServer(); + const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "id", + lab: "ayumetrix", + org_id: "org_id", + status: "active", + delegated_flow: "order_delegated", + provider_account_id: "provider_account_id", + account_name: "account_name", + default_clinical_notes: "default_clinical_notes", + business_units: ["business_units"], + allowed_billing: { key: ["AL"] }, + team_id_allowlist: ["team_id_allowlist"], + }, + ], + }; + server + .mockEndpoint() + .get("/v3/lab_test/lab_account") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.labAccount.getTeamLabAccounts({ + labAccountId: "lab_account_id", + status: "active", + }); + expect(response).toEqual({ + data: [ + { + id: "id", + lab: "ayumetrix", + orgId: "org_id", + status: "active", + delegatedFlow: "order_delegated", + providerAccountId: "provider_account_id", + accountName: "account_name", + defaultClinicalNotes: "default_clinical_notes", + businessUnits: ["business_units"], + allowedBilling: { + key: ["AL"], + }, + teamIdAllowlist: ["team_id_allowlist"], + }, + ], + }); + }); + + test("get_team_lab_accounts (2)", async () => { + const server = mockServerPool.createServer(); + const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/v3/lab_test/lab_account") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.labAccount.getTeamLabAccounts(); + }).rejects.toThrow(Vital.UnprocessableEntityError); + }); +}); diff --git a/tests/wire/labReport.test.ts b/tests/wire/labReport.test.ts index a848bc632..ba69d61ec 100644 --- a/tests/wire/labReport.test.ts +++ b/tests/wire/labReport.test.ts @@ -10,23 +10,46 @@ describe("LabReportClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - id: "id", - job_id: "job_id", - status: "upload_pending", + id: "8eb0217f-4683-4a3c-adca-faf95ac65739", + status: "completed", + failure_reason: "invalid_input", data: { metadata: { - patient_first_name: "patient_first_name", - patient_last_name: "patient_last_name", - dob: "dob", - lab_name: "lab_name", - date_reported: "date_reported", - date_collected: "date_collected", - specimen_number: "specimen_number", + patient_first_name: "Jane", + patient_last_name: "Doe", + dob: "1990-01-01", + gender: "male", + lab_name: "Acme Labs", + date_reported: "2025-01-01", + date_collected: "2024-12-30", + specimen_number: "ABC123", }, - results: [{ test_name: "test_name", value: "value" }], + results: [ + { + test_name: "Glucose", + value: "90", + type: "numeric", + units: "mg/dL", + max_reference_range: 99, + min_reference_range: 70, + source_panel_name: "CMP", + loinc_matches: [ + { + loinc_code: "2345-7", + loinc_name: "Glucose [Mass/volume] in Serum or Plasma", + display_name: "Glucose", + aliases: ["aliases"], + confidence_score: 0.99, + }, + ], + interpretation: "normal", + is_above_max_range: false, + is_below_min_range: false, + }, + ], }, - needs_human_review: true, - is_reviewed: true, + needs_human_review: false, + is_reviewed: false, }; server .mockEndpoint() @@ -38,28 +61,46 @@ describe("LabReportClient", () => { const response = await client.labReport.parserGetJob("job_id"); expect(response).toEqual({ - id: "id", - jobId: "job_id", - status: "upload_pending", + id: "8eb0217f-4683-4a3c-adca-faf95ac65739", + status: "completed", + failureReason: "invalid_input", data: { metadata: { - patientFirstName: "patient_first_name", - patientLastName: "patient_last_name", - dob: "dob", - labName: "lab_name", - dateReported: "date_reported", - dateCollected: "date_collected", - specimenNumber: "specimen_number", + patientFirstName: "Jane", + patientLastName: "Doe", + dob: "1990-01-01", + gender: "male", + labName: "Acme Labs", + dateReported: "2025-01-01", + dateCollected: "2024-12-30", + specimenNumber: "ABC123", }, results: [ { - testName: "test_name", - value: "value", + testName: "Glucose", + value: "90", + type: "numeric", + units: "mg/dL", + maxReferenceRange: 99, + minReferenceRange: 70, + sourcePanelName: "CMP", + loincMatches: [ + { + loincCode: "2345-7", + loincName: "Glucose [Mass/volume] in Serum or Plasma", + displayName: "Glucose", + aliases: ["aliases"], + confidenceScore: 0.99, + }, + ], + interpretation: "normal", + isAboveMaxRange: false, + isBelowMinRange: false, }, ], }, - needsHumanReview: true, - isReviewed: true, + needsHumanReview: false, + isReviewed: false, }); }); diff --git a/tests/wire/labTests.test.ts b/tests/wire/labTests.test.ts index 9d74398fe..3896ab6f6 100644 --- a/tests/wire/labTests.test.ts +++ b/tests/wire/labTests.test.ts @@ -688,6 +688,7 @@ describe("LabTestsClient", () => { .build(); const response = await client.labTests.getMarkers({ + labSlug: "lab_slug", name: "name", aLaCarteEnabled: true, labAccountId: "lab_account_id", @@ -1376,9 +1377,9 @@ describe("LabTestsClient", () => { const rawResponseBody = { orders: [ { - user_id: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - team_id: "525ea597-8447-469c-9031-b6b08ca0bad9", + user_id: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + team_id: "52604535-c73c-4ec8-aa62-77a6767da50e", patient_details: { dob: "2020-01-01T00:00:00Z", gender: "male" }, patient_address: { receiver_name: "John Doe", @@ -1443,9 +1444,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outbound_tracking_number: "", outbound_tracking_url: "", inbound_tracking_number: "", @@ -1460,6 +1461,7 @@ describe("LabTestsClient", () => { }, sample_id: "123456789", notes: "This is a note", + clinical_notes: "clinical_notes", created_at: "2020-01-01T00:00:00Z", updated_at: "2020-01-01T00:00:00Z", events: [ @@ -1472,6 +1474,11 @@ describe("LabTestsClient", () => { }, ], status: "collecting_sample", + last_event: { + id: 3, + created_at: "2022-01-03T00:00:00Z", + status: "collecting_sample.testkit.transit_customer", + }, physician: { first_name: "first_name", last_name: "last_name", npi: "npi" }, health_insurance_id: "health_insurance_id", requisition_form_url: "https://www.example.com", @@ -1494,6 +1501,29 @@ describe("LabTestsClient", () => { has_missing_results: true, expected_result_by_date: "expected_result_by_date", worst_case_result_by_date: "worst_case_result_by_date", + origin: "initial", + order_transaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + low_level_status: "transit_customer", + low_level_status_created_at: "2020-01-05T00:00:00Z", + origin: "initial", + created_at: "2020-01-01T00:00:00Z", + updated_at: "2020-01-05T00:00:00Z", + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + low_level_status: "requisition_created", + low_level_status_created_at: "2020-01-05T01:00:00Z", + origin: "redraw", + created_at: "2020-01-05T01:00:00Z", + updated_at: "2020-01-05T01:00:00Z", + }, + ], + }, }, ], total: 1, @@ -1515,15 +1545,16 @@ describe("LabTestsClient", () => { userId: "user_id", patientName: "patient_name", shippingRecipientName: "shipping_recipient_name", + orderTransactionId: "order_transaction_id", page: 1, size: 1, }); expect(response).toEqual({ orders: [ { - userId: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - teamId: "525ea597-8447-469c-9031-b6b08ca0bad9", + userId: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + teamId: "52604535-c73c-4ec8-aa62-77a6767da50e", patientDetails: { dob: new Date("2020-01-01T00:00:00.000Z"), gender: "male", @@ -1597,9 +1628,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outboundTrackingNumber: "", outboundTrackingUrl: "", inboundTrackingNumber: "", @@ -1614,6 +1645,7 @@ describe("LabTestsClient", () => { }, sampleId: "123456789", notes: "This is a note", + clinicalNotes: "clinical_notes", createdAt: new Date("2020-01-01T00:00:00.000Z"), updatedAt: new Date("2020-01-01T00:00:00.000Z"), events: [ @@ -1634,6 +1666,11 @@ describe("LabTestsClient", () => { }, ], status: "collecting_sample", + lastEvent: { + id: 3, + createdAt: new Date("2022-01-03T00:00:00.000Z"), + status: "collecting_sample.testkit.transit_customer", + }, physician: { firstName: "first_name", lastName: "last_name", @@ -1660,6 +1697,29 @@ describe("LabTestsClient", () => { hasMissingResults: true, expectedResultByDate: "expected_result_by_date", worstCaseResultByDate: "worst_case_result_by_date", + origin: "initial", + orderTransaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + lowLevelStatus: "transit_customer", + lowLevelStatusCreatedAt: new Date("2020-01-05T00:00:00.000Z"), + origin: "initial", + createdAt: new Date("2020-01-01T00:00:00.000Z"), + updatedAt: new Date("2020-01-05T00:00:00.000Z"), + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + lowLevelStatus: "requisition_created", + lowLevelStatusCreatedAt: new Date("2020-01-05T01:00:00.000Z"), + origin: "redraw", + createdAt: new Date("2020-01-05T01:00:00.000Z"), + updatedAt: new Date("2020-01-05T01:00:00.000Z"), + }, + ], + }, }, ], total: 1, @@ -1789,9 +1849,10 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { booking_key: "booking_key" }; const rawResponseBody = { - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - user_id: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - order_id: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + user_id: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + order_id: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + order_transaction_id: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { first_line: "123 Main St.", second_line: "Apt. 208", @@ -1799,6 +1860,7 @@ describe("LabTestsClient", () => { state: "CA", zip_code: "91189", unit: "unit", + access_notes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, lat: 37.7749295 }, start_at: "2022-01-01T00:00:00Z", @@ -1810,6 +1872,7 @@ describe("LabTestsClient", () => { provider_id: "123", external_id: "ext-123", can_reschedule: true, + appointment_notes: "Please bring photo ID", event_status: "scheduled", event_data: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -1832,9 +1895,10 @@ describe("LabTestsClient", () => { bookingKey: "booking_key", }); expect(response).toEqual({ - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - userId: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - orderId: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + userId: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + orderId: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + orderTransactionId: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { firstLine: "123 Main St.", secondLine: "Apt. 208", @@ -1842,6 +1906,7 @@ describe("LabTestsClient", () => { state: "CA", zipCode: "91189", unit: "unit", + accessNotes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, @@ -1856,6 +1921,7 @@ describe("LabTestsClient", () => { providerId: "123", externalId: "ext-123", canReschedule: true, + appointmentNotes: "Please bring photo ID", eventStatus: "scheduled", eventData: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -1908,9 +1974,10 @@ describe("LabTestsClient", () => { provider: "getlabs", }; const rawResponseBody = { - id: "aae38b08-42a2-4933-affc-b0f79ba99d9d", - user_id: "6fff4647-6e06-4d0e-be65-5b4749c8b8b9", - order_id: "2bd5b223-d99c-4949-bf19-ffb0349b7534", + id: "84fbc881-1ac5-4ed2-9742-838246a4c5c7", + user_id: "7a83af48-229d-472c-ba7e-2fa85a6fd2ce", + order_id: "bfb2eea1-f94f-49ea-bd94-d2e6f49ac2ba", + order_transaction_id: "2de87233-f126-4049-b337-d9e16e746823", address: { first_line: "123 Main St.", second_line: "Apt. 208", @@ -1918,6 +1985,7 @@ describe("LabTestsClient", () => { state: "CA", zip_code: "91189", unit: "unit", + access_notes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, lat: 37.7749295 }, start_at: "2024-01-15T09:30:00Z", @@ -1929,6 +1997,7 @@ describe("LabTestsClient", () => { provider_id: "123", external_id: "external_id", can_reschedule: false, + appointment_notes: "appointment_notes", event_status: "pending", event_data: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -1954,9 +2023,10 @@ describe("LabTestsClient", () => { provider: "getlabs", }); expect(response).toEqual({ - id: "aae38b08-42a2-4933-affc-b0f79ba99d9d", - userId: "6fff4647-6e06-4d0e-be65-5b4749c8b8b9", - orderId: "2bd5b223-d99c-4949-bf19-ffb0349b7534", + id: "84fbc881-1ac5-4ed2-9742-838246a4c5c7", + userId: "7a83af48-229d-472c-ba7e-2fa85a6fd2ce", + orderId: "bfb2eea1-f94f-49ea-bd94-d2e6f49ac2ba", + orderTransactionId: "2de87233-f126-4049-b337-d9e16e746823", address: { firstLine: "123 Main St.", secondLine: "Apt. 208", @@ -1964,6 +2034,7 @@ describe("LabTestsClient", () => { state: "CA", zipCode: "91189", unit: "unit", + accessNotes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, @@ -1978,6 +2049,7 @@ describe("LabTestsClient", () => { providerId: "123", externalId: "external_id", canReschedule: false, + appointmentNotes: "appointment_notes", eventStatus: "pending", eventData: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -2029,9 +2101,10 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { booking_key: "booking_key" }; const rawResponseBody = { - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - user_id: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - order_id: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + user_id: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + order_id: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + order_transaction_id: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { first_line: "123 Main St.", second_line: "Apt. 208", @@ -2039,6 +2112,7 @@ describe("LabTestsClient", () => { state: "CA", zip_code: "91189", unit: "unit", + access_notes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, lat: 37.7749295 }, start_at: "2022-01-01T00:00:00Z", @@ -2050,6 +2124,7 @@ describe("LabTestsClient", () => { provider_id: "123", external_id: "ext-123", can_reschedule: true, + appointment_notes: "Please bring photo ID", event_status: "scheduled", event_data: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -2072,9 +2147,10 @@ describe("LabTestsClient", () => { bookingKey: "booking_key", }); expect(response).toEqual({ - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - userId: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - orderId: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + userId: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + orderId: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + orderTransactionId: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { firstLine: "123 Main St.", secondLine: "Apt. 208", @@ -2082,6 +2158,7 @@ describe("LabTestsClient", () => { state: "CA", zipCode: "91189", unit: "unit", + accessNotes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, @@ -2096,6 +2173,7 @@ describe("LabTestsClient", () => { providerId: "123", externalId: "ext-123", canReschedule: true, + appointmentNotes: "Please bring photo ID", eventStatus: "scheduled", eventData: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -2145,9 +2223,10 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { cancellation_reason_id: "cancellation_reason_id" }; const rawResponseBody = { - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - user_id: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - order_id: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + user_id: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + order_id: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + order_transaction_id: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { first_line: "123 Main St.", second_line: "Apt. 208", @@ -2155,6 +2234,7 @@ describe("LabTestsClient", () => { state: "CA", zip_code: "91189", unit: "unit", + access_notes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, lat: 37.7749295 }, start_at: "2022-01-01T00:00:00Z", @@ -2166,6 +2246,7 @@ describe("LabTestsClient", () => { provider_id: "123", external_id: "ext-123", can_reschedule: true, + appointment_notes: "Please bring photo ID", event_status: "scheduled", event_data: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -2188,9 +2269,10 @@ describe("LabTestsClient", () => { cancellationReasonId: "cancellation_reason_id", }); expect(response).toEqual({ - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - userId: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - orderId: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + userId: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + orderId: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + orderTransactionId: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { firstLine: "123 Main St.", secondLine: "Apt. 208", @@ -2198,6 +2280,7 @@ describe("LabTestsClient", () => { state: "CA", zipCode: "91189", unit: "unit", + accessNotes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, @@ -2212,6 +2295,7 @@ describe("LabTestsClient", () => { providerId: "123", externalId: "ext-123", canReschedule: true, + appointmentNotes: "Please bring photo ID", eventStatus: "scheduled", eventData: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -2261,7 +2345,7 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = [ - { id: "8dc08e6a-7afc-41d6-8ff2-4522bb5a0522", name: "I'm feeling sick", is_refundable: true }, + { id: "1767bec4-87f4-4801-88d8-7245a3a65432", name: "I'm feeling sick", is_refundable: true }, ]; server .mockEndpoint() @@ -2274,7 +2358,7 @@ describe("LabTestsClient", () => { const response = await client.labTests.getPhlebotomyAppointmentCancellationReason(); expect(response).toEqual([ { - id: "8dc08e6a-7afc-41d6-8ff2-4522bb5a0522", + id: "1767bec4-87f4-4801-88d8-7245a3a65432", name: "I'm feeling sick", isRefundable: true, }, @@ -2286,9 +2370,10 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - user_id: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - order_id: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + user_id: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + order_id: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + order_transaction_id: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { first_line: "123 Main St.", second_line: "Apt. 208", @@ -2296,6 +2381,7 @@ describe("LabTestsClient", () => { state: "CA", zip_code: "91189", unit: "unit", + access_notes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, lat: 37.7749295 }, start_at: "2022-01-01T00:00:00Z", @@ -2307,6 +2393,7 @@ describe("LabTestsClient", () => { provider_id: "123", external_id: "ext-123", can_reschedule: true, + appointment_notes: "Please bring photo ID", event_status: "scheduled", event_data: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -2326,9 +2413,10 @@ describe("LabTestsClient", () => { const response = await client.labTests.getPhlebotomyAppointment("order_id"); expect(response).toEqual({ - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - userId: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - orderId: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + userId: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + orderId: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + orderTransactionId: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { firstLine: "123 Main St.", secondLine: "Apt. 208", @@ -2336,6 +2424,7 @@ describe("LabTestsClient", () => { state: "CA", zipCode: "91189", unit: "unit", + accessNotes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, @@ -2350,6 +2439,7 @@ describe("LabTestsClient", () => { providerId: "123", externalId: "ext-123", canReschedule: true, + appointmentNotes: "Please bring photo ID", eventStatus: "scheduled", eventData: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -2745,6 +2835,11 @@ describe("LabTestsClient", () => { date_reported: { timestamp: "2024-01-15T09:30:00Z", timezone_offset: 1 }, }, }, + order_transaction: { + id: "id", + status: "active", + orders: [{ id: "id", created_at: "2024-01-15T09:30:00Z", updated_at: "2024-01-15T09:30:00Z" }], + }, }; server .mockEndpoint() @@ -2837,6 +2932,17 @@ describe("LabTestsClient", () => { }, }, }, + orderTransaction: { + id: "id", + status: "active", + orders: [ + { + id: "id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + }, }); }); @@ -2898,6 +3004,7 @@ describe("LabTestsClient", () => { startDate: "start_date", zipCode: "zip_code", radius: "10", + allowStale: true, }); expect(response).toEqual({ slots: [ @@ -2977,9 +3084,10 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { booking_key: "booking_key" }; const rawResponseBody = { - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - user_id: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - order_id: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + user_id: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + order_id: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + order_transaction_id: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { first_line: "123 Main St.", second_line: "Apt. 208", @@ -2987,6 +3095,7 @@ describe("LabTestsClient", () => { state: "CA", zip_code: "91189", unit: "unit", + access_notes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, lat: 37.7749295 }, start_at: "2022-01-01T00:00:00Z", @@ -2998,6 +3107,7 @@ describe("LabTestsClient", () => { provider_id: "123", external_id: "ext-123", can_reschedule: true, + appointment_notes: "Please bring photo ID", event_status: "scheduled", event_data: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -3017,12 +3127,15 @@ describe("LabTestsClient", () => { .build(); const response = await client.labTests.bookPscAppointment("order_id", { - bookingKey: "booking_key", + body: { + bookingKey: "booking_key", + }, }); expect(response).toEqual({ - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - userId: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - orderId: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + userId: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + orderId: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + orderTransactionId: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { firstLine: "123 Main St.", secondLine: "Apt. 208", @@ -3030,6 +3143,7 @@ describe("LabTestsClient", () => { state: "CA", zipCode: "91189", unit: "unit", + accessNotes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, @@ -3044,6 +3158,7 @@ describe("LabTestsClient", () => { providerId: "123", externalId: "ext-123", canReschedule: true, + appointmentNotes: "Please bring photo ID", eventStatus: "scheduled", eventData: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -3083,7 +3198,9 @@ describe("LabTestsClient", () => { await expect(async () => { return await client.labTests.bookPscAppointment("order_id", { - bookingKey: "booking_key", + body: { + bookingKey: "booking_key", + }, }); }).rejects.toThrow(Vital.UnprocessableEntityError); }); @@ -3093,9 +3210,10 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { booking_key: "booking_key" }; const rawResponseBody = { - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - user_id: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - order_id: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + user_id: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + order_id: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + order_transaction_id: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { first_line: "123 Main St.", second_line: "Apt. 208", @@ -3103,6 +3221,7 @@ describe("LabTestsClient", () => { state: "CA", zip_code: "91189", unit: "unit", + access_notes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, lat: 37.7749295 }, start_at: "2022-01-01T00:00:00Z", @@ -3114,6 +3233,7 @@ describe("LabTestsClient", () => { provider_id: "123", external_id: "ext-123", can_reschedule: true, + appointment_notes: "Please bring photo ID", event_status: "scheduled", event_data: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -3136,9 +3256,10 @@ describe("LabTestsClient", () => { bookingKey: "booking_key", }); expect(response).toEqual({ - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - userId: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - orderId: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + userId: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + orderId: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + orderTransactionId: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { firstLine: "123 Main St.", secondLine: "Apt. 208", @@ -3146,6 +3267,7 @@ describe("LabTestsClient", () => { state: "CA", zipCode: "91189", unit: "unit", + accessNotes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, @@ -3160,6 +3282,7 @@ describe("LabTestsClient", () => { providerId: "123", externalId: "ext-123", canReschedule: true, + appointmentNotes: "Please bring photo ID", eventStatus: "scheduled", eventData: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -3209,9 +3332,10 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawRequestBody = { cancellationReasonId: "cancellationReasonId" }; const rawResponseBody = { - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - user_id: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - order_id: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + user_id: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + order_id: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + order_transaction_id: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { first_line: "123 Main St.", second_line: "Apt. 208", @@ -3219,6 +3343,7 @@ describe("LabTestsClient", () => { state: "CA", zip_code: "91189", unit: "unit", + access_notes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, lat: 37.7749295 }, start_at: "2022-01-01T00:00:00Z", @@ -3230,6 +3355,7 @@ describe("LabTestsClient", () => { provider_id: "123", external_id: "ext-123", can_reschedule: true, + appointment_notes: "Please bring photo ID", event_status: "scheduled", event_data: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -3252,9 +3378,10 @@ describe("LabTestsClient", () => { cancellationReasonId: "cancellationReasonId", }); expect(response).toEqual({ - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - userId: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - orderId: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + userId: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + orderId: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + orderTransactionId: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { firstLine: "123 Main St.", secondLine: "Apt. 208", @@ -3262,6 +3389,7 @@ describe("LabTestsClient", () => { state: "CA", zipCode: "91189", unit: "unit", + accessNotes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, @@ -3276,6 +3404,7 @@ describe("LabTestsClient", () => { providerId: "123", externalId: "ext-123", canReschedule: true, + appointmentNotes: "Please bring photo ID", eventStatus: "scheduled", eventData: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -3325,7 +3454,7 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = [ - { id: "8dc08e6a-7afc-41d6-8ff2-4522bb5a0522", name: "I'm feeling sick", is_refundable: true }, + { id: "1767bec4-87f4-4801-88d8-7245a3a65432", name: "I'm feeling sick", is_refundable: true }, ]; server .mockEndpoint() @@ -3338,7 +3467,7 @@ describe("LabTestsClient", () => { const response = await client.labTests.getPscAppointmentCancellationReason(); expect(response).toEqual([ { - id: "8dc08e6a-7afc-41d6-8ff2-4522bb5a0522", + id: "1767bec4-87f4-4801-88d8-7245a3a65432", name: "I'm feeling sick", isRefundable: true, }, @@ -3350,9 +3479,10 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - user_id: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - order_id: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + user_id: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + order_id: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + order_transaction_id: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { first_line: "123 Main St.", second_line: "Apt. 208", @@ -3360,6 +3490,7 @@ describe("LabTestsClient", () => { state: "CA", zip_code: "91189", unit: "unit", + access_notes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, lat: 37.7749295 }, start_at: "2022-01-01T00:00:00Z", @@ -3371,6 +3502,7 @@ describe("LabTestsClient", () => { provider_id: "123", external_id: "ext-123", can_reschedule: true, + appointment_notes: "Please bring photo ID", event_status: "scheduled", event_data: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -3390,9 +3522,10 @@ describe("LabTestsClient", () => { const response = await client.labTests.getPscAppointment("order_id"); expect(response).toEqual({ - id: "c64c03de-8a4d-4633-8cc2-0b539e4c12bd", - userId: "ee417bae-a9e6-4b8d-b5b0-8fff4f699cad", - orderId: "2ba972e3-c84a-446a-9028-51ff63d79ec6", + id: "bdcd3f8a-ac85-4c55-bcfb-ceaea48bd22b", + userId: "39facccd-6f05-4f6d-bf7e-ae85882a1137", + orderId: "cdc40abf-cabc-4d62-88ba-9e8c1fa9f340", + orderTransactionId: "2225a13b-5b4f-435a-b08c-450a0476f39c", address: { firstLine: "123 Main St.", secondLine: "Apt. 208", @@ -3400,6 +3533,7 @@ describe("LabTestsClient", () => { state: "CA", zipCode: "91189", unit: "unit", + accessNotes: "Gate code #1234, use side entrance", }, location: { lng: -122.4194155, @@ -3414,6 +3548,7 @@ describe("LabTestsClient", () => { providerId: "123", externalId: "ext-123", canReschedule: true, + appointmentNotes: "Please bring photo ID", eventStatus: "scheduled", eventData: { description: "Metadata field containing provider specific data, like cancellation reason or origin", @@ -3460,9 +3595,9 @@ describe("LabTestsClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { - user_id: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - team_id: "525ea597-8447-469c-9031-b6b08ca0bad9", + user_id: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + team_id: "52604535-c73c-4ec8-aa62-77a6767da50e", patient_details: { first_name: "first_name", last_name: "last_name", @@ -3492,6 +3627,7 @@ describe("LabTestsClient", () => { state: "CA", zip: "91189", country: "United States", + access_notes: "access_notes", phone_number: "+11234567890", }, lab_test: { @@ -3552,9 +3688,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outbound_tracking_number: "", outbound_tracking_url: "", inbound_tracking_number: "", @@ -3569,14 +3705,36 @@ describe("LabTestsClient", () => { }, sample_id: "123456789", notes: "This is a note", + clinical_notes: "clinical_notes", created_at: "2020-01-01T00:00:00Z", updated_at: "2020-01-01T00:00:00Z", events: [ - { id: 1, created_at: "2022-01-01T00:00:00Z", status: "received.testkit.ordered" }, - { id: 2, created_at: "2022-01-02T00:00:00Z", status: "received.testkit.requisition_created" }, - { id: 3, created_at: "2022-01-03T00:00:00Z", status: "collecting_sample.testkit.transit_customer" }, + { + id: 1, + created_at: "2022-01-01T00:00:00Z", + status: "received.testkit.ordered", + status_detail: "fulfillment_error", + }, + { + id: 2, + created_at: "2022-01-02T00:00:00Z", + status: "received.testkit.requisition_created", + status_detail: "fulfillment_error", + }, + { + id: 3, + created_at: "2022-01-03T00:00:00Z", + status: "collecting_sample.testkit.transit_customer", + status_detail: "fulfillment_error", + }, ], status: "collecting_sample", + last_event: { + id: 3, + created_at: "2022-01-03T00:00:00Z", + status: "collecting_sample.testkit.transit_customer", + status_detail: "fulfillment_error", + }, physician: { first_name: "first_name", last_name: "last_name", npi: "npi" }, health_insurance_id: "health_insurance_id", requisition_form_url: "https://www.example.com", @@ -3600,14 +3758,37 @@ describe("LabTestsClient", () => { has_missing_results: true, expected_result_by_date: "expected_result_by_date", worst_case_result_by_date: "worst_case_result_by_date", + origin: "initial", + order_transaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + low_level_status: "transit_customer", + low_level_status_created_at: "2020-01-05T00:00:00Z", + origin: "initial", + created_at: "2020-01-01T00:00:00Z", + updated_at: "2020-01-05T00:00:00Z", + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + low_level_status: "requisition_created", + low_level_status_created_at: "2020-01-05T01:00:00Z", + origin: "redraw", + created_at: "2020-01-05T01:00:00Z", + updated_at: "2020-01-05T01:00:00Z", + }, + ], + }, }; server.mockEndpoint().get("/v3/order/order_id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.labTests.getOrder("order_id"); expect(response).toEqual({ - userId: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - teamId: "525ea597-8447-469c-9031-b6b08ca0bad9", + userId: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + teamId: "52604535-c73c-4ec8-aa62-77a6767da50e", patientDetails: { firstName: "first_name", lastName: "last_name", @@ -3643,6 +3824,7 @@ describe("LabTestsClient", () => { state: "CA", zip: "91189", country: "United States", + accessNotes: "access_notes", phoneNumber: "+11234567890", }, labTest: { @@ -3709,9 +3891,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outboundTrackingNumber: "", outboundTrackingUrl: "", inboundTrackingNumber: "", @@ -3726,6 +3908,7 @@ describe("LabTestsClient", () => { }, sampleId: "123456789", notes: "This is a note", + clinicalNotes: "clinical_notes", createdAt: new Date("2020-01-01T00:00:00.000Z"), updatedAt: new Date("2020-01-01T00:00:00.000Z"), events: [ @@ -3733,19 +3916,28 @@ describe("LabTestsClient", () => { id: 1, createdAt: new Date("2022-01-01T00:00:00.000Z"), status: "received.testkit.ordered", + statusDetail: "fulfillment_error", }, { id: 2, createdAt: new Date("2022-01-02T00:00:00.000Z"), status: "received.testkit.requisition_created", + statusDetail: "fulfillment_error", }, { id: 3, createdAt: new Date("2022-01-03T00:00:00.000Z"), status: "collecting_sample.testkit.transit_customer", + statusDetail: "fulfillment_error", }, ], status: "collecting_sample", + lastEvent: { + id: 3, + createdAt: new Date("2022-01-03T00:00:00.000Z"), + status: "collecting_sample.testkit.transit_customer", + statusDetail: "fulfillment_error", + }, physician: { firstName: "first_name", lastName: "last_name", @@ -3773,6 +3965,29 @@ describe("LabTestsClient", () => { hasMissingResults: true, expectedResultByDate: "expected_result_by_date", worstCaseResultByDate: "worst_case_result_by_date", + origin: "initial", + orderTransaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + lowLevelStatus: "transit_customer", + lowLevelStatusCreatedAt: new Date("2020-01-05T00:00:00.000Z"), + origin: "initial", + createdAt: new Date("2020-01-01T00:00:00.000Z"), + updatedAt: new Date("2020-01-05T00:00:00.000Z"), + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + lowLevelStatus: "requisition_created", + lowLevelStatusCreatedAt: new Date("2020-01-05T01:00:00.000Z"), + origin: "redraw", + createdAt: new Date("2020-01-05T01:00:00.000Z"), + updatedAt: new Date("2020-01-05T01:00:00.000Z"), + }, + ], + }, }); }); @@ -3805,9 +4020,9 @@ describe("LabTestsClient", () => { }; const rawResponseBody = { order: { - user_id: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - team_id: "525ea597-8447-469c-9031-b6b08ca0bad9", + user_id: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + team_id: "52604535-c73c-4ec8-aa62-77a6767da50e", patient_details: { first_name: "first_name", last_name: "last_name", @@ -3840,6 +4055,7 @@ describe("LabTestsClient", () => { state: "CA", zip: "91189", country: "United States", + access_notes: "access_notes", phone_number: "+11234567890", }, lab_test: { @@ -3900,9 +4116,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outbound_tracking_number: "", outbound_tracking_url: "", inbound_tracking_number: "", @@ -3917,6 +4133,7 @@ describe("LabTestsClient", () => { }, sample_id: "123456789", notes: "This is a note", + clinical_notes: "clinical_notes", created_at: "2020-01-01T00:00:00Z", updated_at: "2020-01-01T00:00:00Z", events: [ @@ -3925,6 +4142,12 @@ describe("LabTestsClient", () => { { id: 3, created_at: "2022-01-03T00:00:00Z", status: "collecting_sample.testkit.transit_customer" }, ], status: "collecting_sample", + last_event: { + id: 3, + created_at: "2022-01-03T00:00:00Z", + status: "collecting_sample.testkit.transit_customer", + status_detail: "fulfillment_error", + }, physician: { first_name: "first_name", last_name: "last_name", npi: "npi" }, health_insurance_id: "health_insurance_id", requisition_form_url: "https://www.example.com", @@ -3948,6 +4171,29 @@ describe("LabTestsClient", () => { has_missing_results: true, expected_result_by_date: "expected_result_by_date", worst_case_result_by_date: "worst_case_result_by_date", + origin: "initial", + order_transaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + low_level_status: "transit_customer", + low_level_status_created_at: "2020-01-05T00:00:00Z", + origin: "initial", + created_at: "2020-01-01T00:00:00Z", + updated_at: "2020-01-05T00:00:00Z", + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + low_level_status: "requisition_created", + low_level_status_created_at: "2020-01-05T01:00:00Z", + origin: "redraw", + created_at: "2020-01-05T01:00:00Z", + updated_at: "2020-01-05T01:00:00Z", + }, + ], + }, }, status: "status", message: "message", @@ -3955,8 +4201,6 @@ describe("LabTestsClient", () => { server .mockEndpoint() .post("/v3/order") - .header("X-Idempotency-Key", "X-Idempotency-Key") - .header("X-Idempotency-Error", "no-cache") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -3964,8 +4208,6 @@ describe("LabTestsClient", () => { .build(); const response = await client.labTests.createOrder({ - idempotencyKey: "X-Idempotency-Key", - idempotencyError: "no-cache", userId: "user_id", patientDetails: { firstName: "first_name", @@ -3985,9 +4227,9 @@ describe("LabTestsClient", () => { }); expect(response).toEqual({ order: { - userId: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - teamId: "525ea597-8447-469c-9031-b6b08ca0bad9", + userId: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + teamId: "52604535-c73c-4ec8-aa62-77a6767da50e", patientDetails: { firstName: "first_name", lastName: "last_name", @@ -4020,6 +4262,7 @@ describe("LabTestsClient", () => { state: "CA", zip: "91189", country: "United States", + accessNotes: "access_notes", phoneNumber: "+11234567890", }, labTest: { @@ -4086,9 +4329,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outboundTrackingNumber: "", outboundTrackingUrl: "", inboundTrackingNumber: "", @@ -4103,6 +4346,7 @@ describe("LabTestsClient", () => { }, sampleId: "123456789", notes: "This is a note", + clinicalNotes: "clinical_notes", createdAt: new Date("2020-01-01T00:00:00.000Z"), updatedAt: new Date("2020-01-01T00:00:00.000Z"), events: [ @@ -4123,6 +4367,12 @@ describe("LabTestsClient", () => { }, ], status: "collecting_sample", + lastEvent: { + id: 3, + createdAt: new Date("2022-01-03T00:00:00.000Z"), + status: "collecting_sample.testkit.transit_customer", + statusDetail: "fulfillment_error", + }, physician: { firstName: "first_name", lastName: "last_name", @@ -4150,6 +4400,29 @@ describe("LabTestsClient", () => { hasMissingResults: true, expectedResultByDate: "expected_result_by_date", worstCaseResultByDate: "worst_case_result_by_date", + origin: "initial", + orderTransaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + lowLevelStatus: "transit_customer", + lowLevelStatusCreatedAt: new Date("2020-01-05T00:00:00.000Z"), + origin: "initial", + createdAt: new Date("2020-01-01T00:00:00.000Z"), + updatedAt: new Date("2020-01-05T00:00:00.000Z"), + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + lowLevelStatus: "requisition_created", + lowLevelStatusCreatedAt: new Date("2020-01-05T01:00:00.000Z"), + origin: "redraw", + createdAt: new Date("2020-01-05T01:00:00.000Z"), + updatedAt: new Date("2020-01-05T01:00:00.000Z"), + }, + ], + }, }, status: "status", message: "message", @@ -4231,9 +4504,9 @@ describe("LabTestsClient", () => { }; const rawResponseBody = { order: { - user_id: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - team_id: "525ea597-8447-469c-9031-b6b08ca0bad9", + user_id: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + team_id: "52604535-c73c-4ec8-aa62-77a6767da50e", patient_details: { first_name: "first_name", last_name: "last_name", @@ -4266,6 +4539,7 @@ describe("LabTestsClient", () => { state: "CA", zip: "91189", country: "United States", + access_notes: "access_notes", phone_number: "+11234567890", }, lab_test: { @@ -4326,9 +4600,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outbound_tracking_number: "", outbound_tracking_url: "", inbound_tracking_number: "", @@ -4343,6 +4617,7 @@ describe("LabTestsClient", () => { }, sample_id: "123456789", notes: "This is a note", + clinical_notes: "clinical_notes", created_at: "2020-01-01T00:00:00Z", updated_at: "2020-01-01T00:00:00Z", events: [ @@ -4351,6 +4626,12 @@ describe("LabTestsClient", () => { { id: 3, created_at: "2022-01-03T00:00:00Z", status: "collecting_sample.testkit.transit_customer" }, ], status: "collecting_sample", + last_event: { + id: 3, + created_at: "2022-01-03T00:00:00Z", + status: "collecting_sample.testkit.transit_customer", + status_detail: "fulfillment_error", + }, physician: { first_name: "first_name", last_name: "last_name", npi: "npi" }, health_insurance_id: "health_insurance_id", requisition_form_url: "https://www.example.com", @@ -4374,6 +4655,29 @@ describe("LabTestsClient", () => { has_missing_results: true, expected_result_by_date: "expected_result_by_date", worst_case_result_by_date: "worst_case_result_by_date", + origin: "initial", + order_transaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + low_level_status: "transit_customer", + low_level_status_created_at: "2020-01-05T00:00:00Z", + origin: "initial", + created_at: "2020-01-01T00:00:00Z", + updated_at: "2020-01-05T00:00:00Z", + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + low_level_status: "requisition_created", + low_level_status_created_at: "2020-01-05T01:00:00Z", + origin: "redraw", + created_at: "2020-01-05T01:00:00Z", + updated_at: "2020-01-05T01:00:00Z", + }, + ], + }, }, status: "status", message: "message", @@ -4412,9 +4716,9 @@ describe("LabTestsClient", () => { }); expect(response).toEqual({ order: { - userId: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - teamId: "525ea597-8447-469c-9031-b6b08ca0bad9", + userId: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + teamId: "52604535-c73c-4ec8-aa62-77a6767da50e", patientDetails: { firstName: "first_name", lastName: "last_name", @@ -4447,6 +4751,7 @@ describe("LabTestsClient", () => { state: "CA", zip: "91189", country: "United States", + accessNotes: "access_notes", phoneNumber: "+11234567890", }, labTest: { @@ -4513,9 +4818,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outboundTrackingNumber: "", outboundTrackingUrl: "", inboundTrackingNumber: "", @@ -4530,6 +4835,7 @@ describe("LabTestsClient", () => { }, sampleId: "123456789", notes: "This is a note", + clinicalNotes: "clinical_notes", createdAt: new Date("2020-01-01T00:00:00.000Z"), updatedAt: new Date("2020-01-01T00:00:00.000Z"), events: [ @@ -4550,6 +4856,12 @@ describe("LabTestsClient", () => { }, ], status: "collecting_sample", + lastEvent: { + id: 3, + createdAt: new Date("2022-01-03T00:00:00.000Z"), + status: "collecting_sample.testkit.transit_customer", + statusDetail: "fulfillment_error", + }, physician: { firstName: "first_name", lastName: "last_name", @@ -4577,6 +4889,29 @@ describe("LabTestsClient", () => { hasMissingResults: true, expectedResultByDate: "expected_result_by_date", worstCaseResultByDate: "worst_case_result_by_date", + origin: "initial", + orderTransaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + lowLevelStatus: "transit_customer", + lowLevelStatusCreatedAt: new Date("2020-01-05T00:00:00.000Z"), + origin: "initial", + createdAt: new Date("2020-01-01T00:00:00.000Z"), + updatedAt: new Date("2020-01-05T00:00:00.000Z"), + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + lowLevelStatus: "requisition_created", + lowLevelStatusCreatedAt: new Date("2020-01-05T01:00:00.000Z"), + origin: "redraw", + createdAt: new Date("2020-01-05T01:00:00.000Z"), + updatedAt: new Date("2020-01-05T01:00:00.000Z"), + }, + ], + }, }, status: "status", message: "message", @@ -4652,9 +4987,9 @@ describe("LabTestsClient", () => { const rawResponseBody = { order: { - user_id: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - team_id: "525ea597-8447-469c-9031-b6b08ca0bad9", + user_id: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + team_id: "52604535-c73c-4ec8-aa62-77a6767da50e", patient_details: { first_name: "first_name", last_name: "last_name", @@ -4687,6 +5022,7 @@ describe("LabTestsClient", () => { state: "CA", zip: "91189", country: "United States", + access_notes: "access_notes", phone_number: "+11234567890", }, lab_test: { @@ -4747,9 +5083,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outbound_tracking_number: "", outbound_tracking_url: "", inbound_tracking_number: "", @@ -4764,6 +5100,7 @@ describe("LabTestsClient", () => { }, sample_id: "123456789", notes: "This is a note", + clinical_notes: "clinical_notes", created_at: "2020-01-01T00:00:00Z", updated_at: "2020-01-01T00:00:00Z", events: [ @@ -4772,6 +5109,12 @@ describe("LabTestsClient", () => { { id: 3, created_at: "2022-01-03T00:00:00Z", status: "collecting_sample.testkit.transit_customer" }, ], status: "collecting_sample", + last_event: { + id: 3, + created_at: "2022-01-03T00:00:00Z", + status: "collecting_sample.testkit.transit_customer", + status_detail: "fulfillment_error", + }, physician: { first_name: "first_name", last_name: "last_name", npi: "npi" }, health_insurance_id: "health_insurance_id", requisition_form_url: "https://www.example.com", @@ -4795,6 +5138,29 @@ describe("LabTestsClient", () => { has_missing_results: true, expected_result_by_date: "expected_result_by_date", worst_case_result_by_date: "worst_case_result_by_date", + origin: "initial", + order_transaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + low_level_status: "transit_customer", + low_level_status_created_at: "2020-01-05T00:00:00Z", + origin: "initial", + created_at: "2020-01-01T00:00:00Z", + updated_at: "2020-01-05T00:00:00Z", + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + low_level_status: "requisition_created", + low_level_status_created_at: "2020-01-05T01:00:00Z", + origin: "redraw", + created_at: "2020-01-05T01:00:00Z", + updated_at: "2020-01-05T01:00:00Z", + }, + ], + }, }, status: "status", message: "message", @@ -4810,9 +5176,9 @@ describe("LabTestsClient", () => { const response = await client.labTests.cancelOrder("order_id"); expect(response).toEqual({ order: { - userId: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - teamId: "525ea597-8447-469c-9031-b6b08ca0bad9", + userId: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + teamId: "52604535-c73c-4ec8-aa62-77a6767da50e", patientDetails: { firstName: "first_name", lastName: "last_name", @@ -4845,6 +5211,7 @@ describe("LabTestsClient", () => { state: "CA", zip: "91189", country: "United States", + accessNotes: "access_notes", phoneNumber: "+11234567890", }, labTest: { @@ -4911,9 +5278,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outboundTrackingNumber: "", outboundTrackingUrl: "", inboundTrackingNumber: "", @@ -4928,6 +5295,7 @@ describe("LabTestsClient", () => { }, sampleId: "123456789", notes: "This is a note", + clinicalNotes: "clinical_notes", createdAt: new Date("2020-01-01T00:00:00.000Z"), updatedAt: new Date("2020-01-01T00:00:00.000Z"), events: [ @@ -4948,6 +5316,12 @@ describe("LabTestsClient", () => { }, ], status: "collecting_sample", + lastEvent: { + id: 3, + createdAt: new Date("2022-01-03T00:00:00.000Z"), + status: "collecting_sample.testkit.transit_customer", + statusDetail: "fulfillment_error", + }, physician: { firstName: "first_name", lastName: "last_name", @@ -4975,6 +5349,29 @@ describe("LabTestsClient", () => { hasMissingResults: true, expectedResultByDate: "expected_result_by_date", worstCaseResultByDate: "worst_case_result_by_date", + origin: "initial", + orderTransaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + lowLevelStatus: "transit_customer", + lowLevelStatusCreatedAt: new Date("2020-01-05T00:00:00.000Z"), + origin: "initial", + createdAt: new Date("2020-01-01T00:00:00.000Z"), + updatedAt: new Date("2020-01-05T00:00:00.000Z"), + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + lowLevelStatus: "requisition_created", + lowLevelStatusCreatedAt: new Date("2020-01-05T01:00:00.000Z"), + origin: "redraw", + createdAt: new Date("2020-01-05T01:00:00.000Z"), + updatedAt: new Date("2020-01-05T01:00:00.000Z"), + }, + ], + }, }, status: "status", message: "message", @@ -5048,9 +5445,9 @@ describe("LabTestsClient", () => { const rawResponseBody = { order: { - user_id: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - team_id: "525ea597-8447-469c-9031-b6b08ca0bad9", + user_id: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + team_id: "52604535-c73c-4ec8-aa62-77a6767da50e", patient_details: { first_name: "first_name", last_name: "last_name", @@ -5083,6 +5480,7 @@ describe("LabTestsClient", () => { state: "CA", zip: "91189", country: "United States", + access_notes: "access_notes", phone_number: "+11234567890", }, lab_test: { @@ -5143,9 +5541,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outbound_tracking_number: "", outbound_tracking_url: "", inbound_tracking_number: "", @@ -5160,6 +5558,7 @@ describe("LabTestsClient", () => { }, sample_id: "123456789", notes: "This is a note", + clinical_notes: "clinical_notes", created_at: "2020-01-01T00:00:00Z", updated_at: "2020-01-01T00:00:00Z", events: [ @@ -5168,6 +5567,12 @@ describe("LabTestsClient", () => { { id: 3, created_at: "2022-01-03T00:00:00Z", status: "collecting_sample.testkit.transit_customer" }, ], status: "collecting_sample", + last_event: { + id: 3, + created_at: "2022-01-03T00:00:00Z", + status: "collecting_sample.testkit.transit_customer", + status_detail: "fulfillment_error", + }, physician: { first_name: "first_name", last_name: "last_name", npi: "npi" }, health_insurance_id: "health_insurance_id", requisition_form_url: "https://www.example.com", @@ -5191,6 +5596,29 @@ describe("LabTestsClient", () => { has_missing_results: true, expected_result_by_date: "expected_result_by_date", worst_case_result_by_date: "worst_case_result_by_date", + origin: "initial", + order_transaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + low_level_status: "transit_customer", + low_level_status_created_at: "2020-01-05T00:00:00Z", + origin: "initial", + created_at: "2020-01-01T00:00:00Z", + updated_at: "2020-01-05T00:00:00Z", + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + low_level_status: "requisition_created", + low_level_status_created_at: "2020-01-05T01:00:00Z", + origin: "redraw", + created_at: "2020-01-05T01:00:00Z", + updated_at: "2020-01-05T01:00:00Z", + }, + ], + }, }, status: "status", message: "message", @@ -5206,9 +5634,9 @@ describe("LabTestsClient", () => { const response = await client.labTests.updateOnSiteCollectionOrderDrawCompleted("order_id"); expect(response).toEqual({ order: { - userId: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - teamId: "525ea597-8447-469c-9031-b6b08ca0bad9", + userId: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + teamId: "52604535-c73c-4ec8-aa62-77a6767da50e", patientDetails: { firstName: "first_name", lastName: "last_name", @@ -5241,6 +5669,7 @@ describe("LabTestsClient", () => { state: "CA", zip: "91189", country: "United States", + accessNotes: "access_notes", phoneNumber: "+11234567890", }, labTest: { @@ -5307,9 +5736,9 @@ describe("LabTestsClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outboundTrackingNumber: "", outboundTrackingUrl: "", inboundTrackingNumber: "", @@ -5324,6 +5753,7 @@ describe("LabTestsClient", () => { }, sampleId: "123456789", notes: "This is a note", + clinicalNotes: "clinical_notes", createdAt: new Date("2020-01-01T00:00:00.000Z"), updatedAt: new Date("2020-01-01T00:00:00.000Z"), events: [ @@ -5344,6 +5774,12 @@ describe("LabTestsClient", () => { }, ], status: "collecting_sample", + lastEvent: { + id: 3, + createdAt: new Date("2022-01-03T00:00:00.000Z"), + status: "collecting_sample.testkit.transit_customer", + statusDetail: "fulfillment_error", + }, physician: { firstName: "first_name", lastName: "last_name", @@ -5371,6 +5807,29 @@ describe("LabTestsClient", () => { hasMissingResults: true, expectedResultByDate: "expected_result_by_date", worstCaseResultByDate: "worst_case_result_by_date", + origin: "initial", + orderTransaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + lowLevelStatus: "transit_customer", + lowLevelStatusCreatedAt: new Date("2020-01-05T00:00:00.000Z"), + origin: "initial", + createdAt: new Date("2020-01-01T00:00:00.000Z"), + updatedAt: new Date("2020-01-05T00:00:00.000Z"), + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + lowLevelStatus: "requisition_created", + lowLevelStatusCreatedAt: new Date("2020-01-05T01:00:00.000Z"), + origin: "redraw", + createdAt: new Date("2020-01-05T01:00:00.000Z"), + updatedAt: new Date("2020-01-05T01:00:00.000Z"), + }, + ], + }, }, status: "status", message: "message", diff --git a/tests/wire/link.test.ts b/tests/wire/link.test.ts index 89e891bb0..466b719a0 100644 --- a/tests/wire/link.test.ts +++ b/tests/wire/link.test.ts @@ -28,7 +28,6 @@ describe("LinkClient", () => { const response = await client.link.listBulkOps({ nextCursor: "next_cursor", pageSize: 1, - teamId: "infer_from_context", }); expect(response).toEqual({ data: [ @@ -84,7 +83,6 @@ describe("LinkClient", () => { .build(); const response = await client.link.bulkImport({ - teamId: "infer_from_context", provider: "oura", connections: [ { @@ -172,7 +170,6 @@ describe("LinkClient", () => { .build(); const response = await client.link.bulkTriggerHistoricalPull({ - teamId: "infer_from_context", userIds: ["user_ids"], provider: "oura", }); @@ -230,7 +227,6 @@ describe("LinkClient", () => { .build(); const response = await client.link.bulkExport({ - teamId: "infer_from_context", provider: "oura", }); expect(response).toEqual({ @@ -284,7 +280,6 @@ describe("LinkClient", () => { .build(); const response = await client.link.bulkPause({ - teamId: "infer_from_context", userIds: ["user_ids"], provider: "oura", }); @@ -499,18 +494,9 @@ describe("LinkClient", () => { const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/v2/link/state") - .header("x-vital-link-token", "x-vital-link-token") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/v2/link/state").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.link.tokenState({ - vitalLinkToken: "x-vital-link-token", - }); + const response = await client.link.tokenState(); expect(response).toEqual({ key: "value", }); @@ -536,7 +522,6 @@ describe("LinkClient", () => { server .mockEndpoint() .post("/v2/link/auth/email") - .header("x-vital-link-token", "x-vital-link-token") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -544,7 +529,6 @@ describe("LinkClient", () => { .build(); const response = await client.link.emailAuth({ - vitalLinkToken: "x-vital-link-token", email: "email", provider: "oura", authType: "password", @@ -585,7 +569,6 @@ describe("LinkClient", () => { server .mockEndpoint() .post("/v2/link/auth") - .header("x-vital-link-token", "x-vital-link-token") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -593,7 +576,6 @@ describe("LinkClient", () => { .build(); const response = await client.link.passwordAuth({ - vitalLinkToken: "x-vital-link-token", username: "username", password: "password", provider: "oura", @@ -648,15 +630,12 @@ describe("LinkClient", () => { server .mockEndpoint() .get("/v2/link/provider/oauth/oura") - .header("x-vital-link-token", "x-vital-link-token") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.link.generateOauthLink("oura", { - vitalLinkToken: "x-vital-link-token", - }); + const response = await client.link.generateOauthLink("oura"); expect(response).toEqual({ name: "Garmin", slug: "garmin", @@ -707,7 +686,6 @@ describe("LinkClient", () => { server .mockEndpoint() .post("/v2/link/provider/password/whoop") - .header("x-vital-link-token", "x-vital-link-token") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -715,7 +693,6 @@ describe("LinkClient", () => { .build(); const response = await client.link.connectPasswordProvider("whoop", { - vitalLinkToken: "x-vital-link-token", username: "username", password: "password", }); @@ -773,7 +750,6 @@ describe("LinkClient", () => { server .mockEndpoint() .post("/v2/link/provider/password/whoop/complete_mfa") - .header("x-vital-link-token", "x-vital-link-token") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -781,7 +757,6 @@ describe("LinkClient", () => { .build(); const response = await client.link.completePasswordProviderMfa("whoop", { - vitalLinkToken: "x-vital-link-token", mfaCode: "mfa_code", }); expect(response).toEqual({ @@ -828,7 +803,6 @@ describe("LinkClient", () => { server .mockEndpoint() .post("/v2/link/provider/email/freestyle_libre") - .header("x-vital-link-token", "x-vital-link-token") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) @@ -836,7 +810,6 @@ describe("LinkClient", () => { .build(); const response = await client.link.connectEmailAuthProvider("freestyle_libre", { - vitalLinkToken: "x-vital-link-token", email: "email", }); expect(response).toEqual({ @@ -881,18 +854,9 @@ describe("LinkClient", () => { form_components: { key: "value" }, }, ]; - server - .mockEndpoint() - .get("/v2/link/providers") - .header("x-vital-link-token", "x-vital-link-token") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); + server.mockEndpoint().get("/v2/link/providers").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.link.getAllProviders({ - vitalLinkToken: "x-vital-link-token", - }); + const response = await client.link.getAllProviders(); expect(response).toEqual([ { id: 1, diff --git a/tests/wire/orderTransaction.test.ts b/tests/wire/orderTransaction.test.ts new file mode 100644 index 000000000..485c66952 --- /dev/null +++ b/tests/wire/orderTransaction.test.ts @@ -0,0 +1,266 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as Vital from "../../src/api/index"; +import { VitalClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("OrderTransactionClient", () => { + test("get_transaction (1)", async () => { + const server = mockServerPool.createServer(); + const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: "id", + team_id: "team_id", + status: "active", + orders: [ + { + id: "id", + origin: "initial", + parent_id: "parent_id", + last_status: "ordered", + last_status_created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + created_at: "2024-01-15T09:30:00Z", + }, + ], + }; + server + .mockEndpoint() + .get("/v3/order_transaction/transaction_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.orderTransaction.getTransaction("transaction_id"); + expect(response).toEqual({ + id: "id", + teamId: "team_id", + status: "active", + orders: [ + { + id: "id", + origin: "initial", + parentId: "parent_id", + lastStatus: "ordered", + lastStatusCreatedAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + createdAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + }); + }); + + test("get_transaction (2)", async () => { + const server = mockServerPool.createServer(); + const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/v3/order_transaction/transaction_id") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orderTransaction.getTransaction("transaction_id"); + }).rejects.toThrow(Vital.UnprocessableEntityError); + }); + + test("get_transaction_result (1)", async () => { + const server = mockServerPool.createServer(); + const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + metadata: { + age: "age", + dob: "18/08/1993", + "clia_#": "clia_#", + patient: "Bob Smith", + provider: "Dr. Jack Smith", + laboratory: "Quest Diagnostics", + date_reported: "2020-01-01", + date_collected: "2022-02-02", + specimen_number: "123131", + date_received: "2022-01-01", + status: "final", + interpretation: "normal", + patient_id: "patient_id", + account_id: "account_id", + }, + results: [ + { + name: "Monocytes(Absolute)", + slug: "monocytes-absolute", + result: "0.4", + type: "numeric", + unit: "x10E3/uL", + timestamp: "2023-11-01T08:28:00Z", + notes: "Final", + reference_range: "reference_range", + min_range_value: 0.1, + max_range_value: 0.9, + is_above_max_range: false, + is_below_min_range: false, + interpretation: "normal", + loinc: "742-7", + loinc_slug: "monocytes-auto-bld-vol", + provider_id: "provider_id", + source_markers: [{ marker_id: 1, name: "name", slug: "slug" }], + performing_laboratory: "performing_laboratory", + source_sample_id: "source_sample_id", + }, + ], + missing_results: [ + { + name: "name", + slug: "slug", + inferred_failure_type: "quantity_not_sufficient_failure", + note: "note", + loinc: "loinc", + loinc_slug: "loinc_slug", + provider_id: "provider_id", + source_markers: [{ marker_id: 1, name: "name", slug: "slug" }], + }, + ], + sample_information: { + key: { + sample_id: "sample_id", + control_number: "control_number", + date_collected: { timestamp: "2024-01-15T09:30:00Z", timezone_offset: 1 }, + date_received: { timestamp: "2024-01-15T09:30:00Z", timezone_offset: 1 }, + date_reported: { timestamp: "2024-01-15T09:30:00Z", timezone_offset: 1 }, + }, + }, + order_transaction: { + id: "id", + status: "active", + orders: [{ id: "id", created_at: "2024-01-15T09:30:00Z", updated_at: "2024-01-15T09:30:00Z" }], + }, + }; + server + .mockEndpoint() + .get("/v3/order_transaction/transaction_id/result") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.orderTransaction.getTransactionResult("transaction_id"); + expect(response).toEqual({ + metadata: { + age: "age", + dob: "18/08/1993", + clia: "clia_#", + patient: "Bob Smith", + provider: "Dr. Jack Smith", + laboratory: "Quest Diagnostics", + dateReported: "2020-01-01", + dateCollected: "2022-02-02", + specimenNumber: "123131", + dateReceived: "2022-01-01", + status: "final", + interpretation: "normal", + patientId: "patient_id", + accountId: "account_id", + }, + results: [ + { + name: "Monocytes(Absolute)", + slug: "monocytes-absolute", + result: "0.4", + type: "numeric", + unit: "x10E3/uL", + timestamp: new Date("2023-11-01T08:28:00.000Z"), + notes: "Final", + referenceRange: "reference_range", + minRangeValue: 0.1, + maxRangeValue: 0.9, + isAboveMaxRange: false, + isBelowMinRange: false, + interpretation: "normal", + loinc: "742-7", + loincSlug: "monocytes-auto-bld-vol", + providerId: "provider_id", + sourceMarkers: [ + { + markerId: 1, + name: "name", + slug: "slug", + }, + ], + performingLaboratory: "performing_laboratory", + sourceSampleId: "source_sample_id", + }, + ], + missingResults: [ + { + name: "name", + slug: "slug", + inferredFailureType: "quantity_not_sufficient_failure", + note: "note", + loinc: "loinc", + loincSlug: "loinc_slug", + providerId: "provider_id", + sourceMarkers: [ + { + markerId: 1, + name: "name", + slug: "slug", + }, + ], + }, + ], + sampleInformation: { + key: { + sampleId: "sample_id", + controlNumber: "control_number", + dateCollected: { + timestamp: new Date("2024-01-15T09:30:00.000Z"), + timezoneOffset: 1, + }, + dateReceived: { + timestamp: new Date("2024-01-15T09:30:00.000Z"), + timezoneOffset: 1, + }, + dateReported: { + timestamp: new Date("2024-01-15T09:30:00.000Z"), + timezoneOffset: 1, + }, + }, + }, + orderTransaction: { + id: "id", + status: "active", + orders: [ + { + id: "id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + }, + }); + }); + + test("get_transaction_result (2)", async () => { + const server = mockServerPool.createServer(); + const client = new VitalClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server + .mockEndpoint() + .get("/v3/order_transaction/transaction_id/result") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.orderTransaction.getTransactionResult("transaction_id"); + }).rejects.toThrow(Vital.UnprocessableEntityError); + }); +}); diff --git a/tests/wire/payor.test.ts b/tests/wire/payor.test.ts index 328e426ce..6d6512e71 100644 --- a/tests/wire/payor.test.ts +++ b/tests/wire/payor.test.ts @@ -23,6 +23,7 @@ describe("PayorClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, source: "platform", }; @@ -56,6 +57,7 @@ describe("PayorClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, source: "platform", }); diff --git a/tests/wire/sleep.test.ts b/tests/wire/sleep.test.ts index ac0320cb2..c0d45c467 100644 --- a/tests/wire/sleep.test.ts +++ b/tests/wire/sleep.test.ts @@ -27,6 +27,7 @@ describe("SleepClient", () => { rem: 2400, deep: 2400, score: 1, + recovery_readiness_score: 82, hr_lowest: 43, hr_average: 50, hr_resting: 1, @@ -41,24 +42,24 @@ describe("SleepClient", () => { source: { provider: "oura", type: "unknown", device_id: "550e8400-e29b-41d4-a716-446655440000" }, sleep_stream: { hrv: [ - { id: 0, unit: "rmssd", timestamp: "2026-01-12T12:39:39Z", value: 80 }, - { id: 1, unit: "rmssd", timestamp: "2026-01-12T12:40:09Z", value: 33 }, - { id: 2, unit: "rmssd", timestamp: "2026-01-12T12:40:39Z", value: 50 }, - { id: 3, unit: "rmssd", timestamp: "2026-01-12T12:41:09Z", value: 3 }, - { id: 4, unit: "rmssd", timestamp: "2026-01-12T12:41:39Z", value: 73 }, + { id: 0, unit: "rmssd", timestamp: "2026-04-09T19:55:55Z", value: 48 }, + { id: 1, unit: "rmssd", timestamp: "2026-04-09T19:56:25Z", value: 9 }, + { id: 2, unit: "rmssd", timestamp: "2026-04-09T19:56:55Z", value: 70 }, + { id: 3, unit: "rmssd", timestamp: "2026-04-09T19:57:25Z", value: 21 }, + { id: 4, unit: "rmssd", timestamp: "2026-04-09T19:57:55Z", value: 76 }, ], heartrate: [ - { id: 0, unit: "bpm", timestamp: "2026-01-12T12:39:39Z", value: 46 }, - { id: 1, unit: "bpm", timestamp: "2026-01-12T12:40:09Z", value: 113 }, - { id: 2, unit: "bpm", timestamp: "2026-01-12T12:40:39Z", value: 117 }, - { id: 3, unit: "bpm", timestamp: "2026-01-12T12:41:09Z", value: 86 }, - { id: 4, unit: "bpm", timestamp: "2026-01-12T12:41:39Z", value: 166 }, + { id: 0, unit: "bpm", timestamp: "2026-04-09T19:55:55Z", value: 159 }, + { id: 1, unit: "bpm", timestamp: "2026-04-09T19:56:25Z", value: 85 }, + { id: 2, unit: "bpm", timestamp: "2026-04-09T19:56:55Z", value: 183 }, + { id: 3, unit: "bpm", timestamp: "2026-04-09T19:57:25Z", value: 8 }, + { id: 4, unit: "bpm", timestamp: "2026-04-09T19:57:55Z", value: 189 }, ], hypnogram: [ { id: 0, unit: "stage", - timestamp: "2026-01-12T12:39:39Z", + timestamp: "2026-04-09T19:55:55Z", start: "2024-01-15T09:30:00Z", end: "2024-01-15T09:30:00Z", value: 4, @@ -66,42 +67,42 @@ describe("SleepClient", () => { { id: 1, unit: "stage", - timestamp: "2026-01-12T12:40:09Z", + timestamp: "2026-04-09T19:56:25Z", start: "2024-01-15T09:30:00Z", end: "2024-01-15T09:30:00Z", - value: 2, + value: 4, }, { id: 2, unit: "stage", - timestamp: "2026-01-12T12:40:39Z", + timestamp: "2026-04-09T19:56:55Z", start: "2024-01-15T09:30:00Z", end: "2024-01-15T09:30:00Z", - value: 3, + value: -1, }, { id: 3, unit: "stage", - timestamp: "2026-01-12T12:41:09Z", + timestamp: "2026-04-09T19:57:25Z", start: "2024-01-15T09:30:00Z", end: "2024-01-15T09:30:00Z", - value: 1, + value: -1, }, { id: 4, unit: "stage", - timestamp: "2026-01-12T12:41:39Z", + timestamp: "2026-04-09T19:57:55Z", start: "2024-01-15T09:30:00Z", end: "2024-01-15T09:30:00Z", - value: 0, + value: -1, }, ], respiratory_rate: [ - { id: 0, unit: "bpm", timestamp: "2026-01-12T12:39:39Z", value: 22 }, - { id: 1, unit: "bpm", timestamp: "2026-01-12T12:40:09Z", value: 21 }, - { id: 2, unit: "bpm", timestamp: "2026-01-12T12:40:39Z", value: 22 }, - { id: 3, unit: "bpm", timestamp: "2026-01-12T12:41:09Z", value: 22 }, - { id: 4, unit: "bpm", timestamp: "2026-01-12T12:41:39Z", value: 12 }, + { id: 0, unit: "bpm", timestamp: "2026-04-09T19:55:55Z", value: 10 }, + { id: 1, unit: "bpm", timestamp: "2026-04-09T19:56:25Z", value: 18 }, + { id: 2, unit: "bpm", timestamp: "2026-04-09T19:56:55Z", value: 18 }, + { id: 3, unit: "bpm", timestamp: "2026-04-09T19:57:25Z", value: 25 }, + { id: 4, unit: "bpm", timestamp: "2026-04-09T19:57:55Z", value: 14 }, ], }, created_at: "2023-02-27T20:31:24Z", @@ -140,6 +141,7 @@ describe("SleepClient", () => { rem: 2400, deep: 2400, score: 1, + recoveryReadinessScore: 82, hrLowest: 43, hrAverage: 50, hrResting: 1, @@ -161,71 +163,71 @@ describe("SleepClient", () => { { id: 0, unit: "rmssd", - timestamp: new Date("2026-01-12T12:39:39.000Z"), - value: 80, + timestamp: new Date("2026-04-09T19:55:55.000Z"), + value: 48, }, { id: 1, unit: "rmssd", - timestamp: new Date("2026-01-12T12:40:09.000Z"), - value: 33, + timestamp: new Date("2026-04-09T19:56:25.000Z"), + value: 9, }, { id: 2, unit: "rmssd", - timestamp: new Date("2026-01-12T12:40:39.000Z"), - value: 50, + timestamp: new Date("2026-04-09T19:56:55.000Z"), + value: 70, }, { id: 3, unit: "rmssd", - timestamp: new Date("2026-01-12T12:41:09.000Z"), - value: 3, + timestamp: new Date("2026-04-09T19:57:25.000Z"), + value: 21, }, { id: 4, unit: "rmssd", - timestamp: new Date("2026-01-12T12:41:39.000Z"), - value: 73, + timestamp: new Date("2026-04-09T19:57:55.000Z"), + value: 76, }, ], heartrate: [ { id: 0, unit: "bpm", - timestamp: new Date("2026-01-12T12:39:39.000Z"), - value: 46, + timestamp: new Date("2026-04-09T19:55:55.000Z"), + value: 159, }, { id: 1, unit: "bpm", - timestamp: new Date("2026-01-12T12:40:09.000Z"), - value: 113, + timestamp: new Date("2026-04-09T19:56:25.000Z"), + value: 85, }, { id: 2, unit: "bpm", - timestamp: new Date("2026-01-12T12:40:39.000Z"), - value: 117, + timestamp: new Date("2026-04-09T19:56:55.000Z"), + value: 183, }, { id: 3, unit: "bpm", - timestamp: new Date("2026-01-12T12:41:09.000Z"), - value: 86, + timestamp: new Date("2026-04-09T19:57:25.000Z"), + value: 8, }, { id: 4, unit: "bpm", - timestamp: new Date("2026-01-12T12:41:39.000Z"), - value: 166, + timestamp: new Date("2026-04-09T19:57:55.000Z"), + value: 189, }, ], hypnogram: [ { id: 0, unit: "stage", - timestamp: new Date("2026-01-12T12:39:39.000Z"), + timestamp: new Date("2026-04-09T19:55:55.000Z"), start: new Date("2024-01-15T09:30:00.000Z"), end: new Date("2024-01-15T09:30:00.000Z"), value: 4, @@ -233,66 +235,66 @@ describe("SleepClient", () => { { id: 1, unit: "stage", - timestamp: new Date("2026-01-12T12:40:09.000Z"), + timestamp: new Date("2026-04-09T19:56:25.000Z"), start: new Date("2024-01-15T09:30:00.000Z"), end: new Date("2024-01-15T09:30:00.000Z"), - value: 2, + value: 4, }, { id: 2, unit: "stage", - timestamp: new Date("2026-01-12T12:40:39.000Z"), + timestamp: new Date("2026-04-09T19:56:55.000Z"), start: new Date("2024-01-15T09:30:00.000Z"), end: new Date("2024-01-15T09:30:00.000Z"), - value: 3, + value: -1, }, { id: 3, unit: "stage", - timestamp: new Date("2026-01-12T12:41:09.000Z"), + timestamp: new Date("2026-04-09T19:57:25.000Z"), start: new Date("2024-01-15T09:30:00.000Z"), end: new Date("2024-01-15T09:30:00.000Z"), - value: 1, + value: -1, }, { id: 4, unit: "stage", - timestamp: new Date("2026-01-12T12:41:39.000Z"), + timestamp: new Date("2026-04-09T19:57:55.000Z"), start: new Date("2024-01-15T09:30:00.000Z"), end: new Date("2024-01-15T09:30:00.000Z"), - value: 0, + value: -1, }, ], respiratoryRate: [ { id: 0, unit: "bpm", - timestamp: new Date("2026-01-12T12:39:39.000Z"), - value: 22, + timestamp: new Date("2026-04-09T19:55:55.000Z"), + value: 10, }, { id: 1, unit: "bpm", - timestamp: new Date("2026-01-12T12:40:09.000Z"), - value: 21, + timestamp: new Date("2026-04-09T19:56:25.000Z"), + value: 18, }, { id: 2, unit: "bpm", - timestamp: new Date("2026-01-12T12:40:39.000Z"), - value: 22, + timestamp: new Date("2026-04-09T19:56:55.000Z"), + value: 18, }, { id: 3, unit: "bpm", - timestamp: new Date("2026-01-12T12:41:09.000Z"), - value: 22, + timestamp: new Date("2026-04-09T19:57:25.000Z"), + value: 25, }, { id: 4, unit: "bpm", - timestamp: new Date("2026-01-12T12:41:39.000Z"), - value: 12, + timestamp: new Date("2026-04-09T19:57:55.000Z"), + value: 14, }, ], }, @@ -415,41 +417,41 @@ describe("SleepClient", () => { timezone_offset: 1, type: "type", unit: "rmssd", - timestamp: "2026-01-12T12:39:39Z", - value: 80, + timestamp: "2026-04-09T19:55:55Z", + value: 48, }, + { id: 1, timezone_offset: 1, type: "type", unit: "rmssd", timestamp: "2026-04-09T19:56:25Z", value: 9 }, { - id: 1, + id: 2, timezone_offset: 1, type: "type", unit: "rmssd", - timestamp: "2026-01-12T12:40:09Z", - value: 33, + timestamp: "2026-04-09T19:56:55Z", + value: 70, }, { - id: 2, + id: 3, timezone_offset: 1, type: "type", unit: "rmssd", - timestamp: "2026-01-12T12:40:39Z", - value: 50, + timestamp: "2026-04-09T19:57:25Z", + value: 21, }, - { id: 3, timezone_offset: 1, type: "type", unit: "rmssd", timestamp: "2026-01-12T12:41:09Z", value: 3 }, { id: 4, timezone_offset: 1, type: "type", unit: "rmssd", - timestamp: "2026-01-12T12:41:39Z", - value: 73, + timestamp: "2026-04-09T19:57:55Z", + value: 76, }, ], heartrate: [ - { id: 0, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-01-12T12:39:39Z", value: 46 }, - { id: 1, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-01-12T12:40:09Z", value: 113 }, - { id: 2, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-01-12T12:40:39Z", value: 117 }, - { id: 3, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-01-12T12:41:09Z", value: 86 }, - { id: 4, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-01-12T12:41:39Z", value: 166 }, + { id: 0, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-04-09T19:55:55Z", value: 159 }, + { id: 1, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-04-09T19:56:25Z", value: 85 }, + { id: 2, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-04-09T19:56:55Z", value: 183 }, + { id: 3, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-04-09T19:57:25Z", value: 8 }, + { id: 4, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-04-09T19:57:55Z", value: 189 }, ], hypnogram: [ { @@ -457,7 +459,7 @@ describe("SleepClient", () => { timezone_offset: 1, type: "type", unit: "stage", - timestamp: "2026-01-12T12:39:39Z", + timestamp: "2026-04-09T19:55:55Z", start: "2024-01-15T09:30:00Z", end: "2024-01-15T09:30:00Z", value: 4, @@ -467,48 +469,48 @@ describe("SleepClient", () => { timezone_offset: 1, type: "type", unit: "stage", - timestamp: "2026-01-12T12:40:09Z", + timestamp: "2026-04-09T19:56:25Z", start: "2024-01-15T09:30:00Z", end: "2024-01-15T09:30:00Z", - value: 2, + value: 4, }, { id: 2, timezone_offset: 1, type: "type", unit: "stage", - timestamp: "2026-01-12T12:40:39Z", + timestamp: "2026-04-09T19:56:55Z", start: "2024-01-15T09:30:00Z", end: "2024-01-15T09:30:00Z", - value: 3, + value: -1, }, { id: 3, timezone_offset: 1, type: "type", unit: "stage", - timestamp: "2026-01-12T12:41:09Z", + timestamp: "2026-04-09T19:57:25Z", start: "2024-01-15T09:30:00Z", end: "2024-01-15T09:30:00Z", - value: 1, + value: -1, }, { id: 4, timezone_offset: 1, type: "type", unit: "stage", - timestamp: "2026-01-12T12:41:39Z", + timestamp: "2026-04-09T19:57:55Z", start: "2024-01-15T09:30:00Z", end: "2024-01-15T09:30:00Z", - value: 0, + value: -1, }, ], respiratory_rate: [ - { id: 0, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-01-12T12:39:39Z", value: 22 }, - { id: 1, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-01-12T12:40:09Z", value: 21 }, - { id: 2, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-01-12T12:40:39Z", value: 22 }, - { id: 3, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-01-12T12:41:09Z", value: 22 }, - { id: 4, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-01-12T12:41:39Z", value: 12 }, + { id: 0, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-04-09T19:55:55Z", value: 10 }, + { id: 1, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-04-09T19:56:25Z", value: 18 }, + { id: 2, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-04-09T19:56:55Z", value: 18 }, + { id: 3, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-04-09T19:57:25Z", value: 25 }, + { id: 4, timezone_offset: 1, type: "type", unit: "bpm", timestamp: "2026-04-09T19:57:55Z", value: 14 }, ], }; server @@ -527,40 +529,40 @@ describe("SleepClient", () => { timezoneOffset: 1, type: "type", unit: "rmssd", - timestamp: new Date("2026-01-12T12:39:39.000Z"), - value: 80, + timestamp: new Date("2026-04-09T19:55:55.000Z"), + value: 48, }, { id: 1, timezoneOffset: 1, type: "type", unit: "rmssd", - timestamp: new Date("2026-01-12T12:40:09.000Z"), - value: 33, + timestamp: new Date("2026-04-09T19:56:25.000Z"), + value: 9, }, { id: 2, timezoneOffset: 1, type: "type", unit: "rmssd", - timestamp: new Date("2026-01-12T12:40:39.000Z"), - value: 50, + timestamp: new Date("2026-04-09T19:56:55.000Z"), + value: 70, }, { id: 3, timezoneOffset: 1, type: "type", unit: "rmssd", - timestamp: new Date("2026-01-12T12:41:09.000Z"), - value: 3, + timestamp: new Date("2026-04-09T19:57:25.000Z"), + value: 21, }, { id: 4, timezoneOffset: 1, type: "type", unit: "rmssd", - timestamp: new Date("2026-01-12T12:41:39.000Z"), - value: 73, + timestamp: new Date("2026-04-09T19:57:55.000Z"), + value: 76, }, ], heartrate: [ @@ -569,40 +571,40 @@ describe("SleepClient", () => { timezoneOffset: 1, type: "type", unit: "bpm", - timestamp: new Date("2026-01-12T12:39:39.000Z"), - value: 46, + timestamp: new Date("2026-04-09T19:55:55.000Z"), + value: 159, }, { id: 1, timezoneOffset: 1, type: "type", unit: "bpm", - timestamp: new Date("2026-01-12T12:40:09.000Z"), - value: 113, + timestamp: new Date("2026-04-09T19:56:25.000Z"), + value: 85, }, { id: 2, timezoneOffset: 1, type: "type", unit: "bpm", - timestamp: new Date("2026-01-12T12:40:39.000Z"), - value: 117, + timestamp: new Date("2026-04-09T19:56:55.000Z"), + value: 183, }, { id: 3, timezoneOffset: 1, type: "type", unit: "bpm", - timestamp: new Date("2026-01-12T12:41:09.000Z"), - value: 86, + timestamp: new Date("2026-04-09T19:57:25.000Z"), + value: 8, }, { id: 4, timezoneOffset: 1, type: "type", unit: "bpm", - timestamp: new Date("2026-01-12T12:41:39.000Z"), - value: 166, + timestamp: new Date("2026-04-09T19:57:55.000Z"), + value: 189, }, ], hypnogram: [ @@ -611,7 +613,7 @@ describe("SleepClient", () => { timezoneOffset: 1, type: "type", unit: "stage", - timestamp: new Date("2026-01-12T12:39:39.000Z"), + timestamp: new Date("2026-04-09T19:55:55.000Z"), start: new Date("2024-01-15T09:30:00.000Z"), end: new Date("2024-01-15T09:30:00.000Z"), value: 4, @@ -621,40 +623,40 @@ describe("SleepClient", () => { timezoneOffset: 1, type: "type", unit: "stage", - timestamp: new Date("2026-01-12T12:40:09.000Z"), + timestamp: new Date("2026-04-09T19:56:25.000Z"), start: new Date("2024-01-15T09:30:00.000Z"), end: new Date("2024-01-15T09:30:00.000Z"), - value: 2, + value: 4, }, { id: 2, timezoneOffset: 1, type: "type", unit: "stage", - timestamp: new Date("2026-01-12T12:40:39.000Z"), + timestamp: new Date("2026-04-09T19:56:55.000Z"), start: new Date("2024-01-15T09:30:00.000Z"), end: new Date("2024-01-15T09:30:00.000Z"), - value: 3, + value: -1, }, { id: 3, timezoneOffset: 1, type: "type", unit: "stage", - timestamp: new Date("2026-01-12T12:41:09.000Z"), + timestamp: new Date("2026-04-09T19:57:25.000Z"), start: new Date("2024-01-15T09:30:00.000Z"), end: new Date("2024-01-15T09:30:00.000Z"), - value: 1, + value: -1, }, { id: 4, timezoneOffset: 1, type: "type", unit: "stage", - timestamp: new Date("2026-01-12T12:41:39.000Z"), + timestamp: new Date("2026-04-09T19:57:55.000Z"), start: new Date("2024-01-15T09:30:00.000Z"), end: new Date("2024-01-15T09:30:00.000Z"), - value: 0, + value: -1, }, ], respiratoryRate: [ @@ -663,40 +665,40 @@ describe("SleepClient", () => { timezoneOffset: 1, type: "type", unit: "bpm", - timestamp: new Date("2026-01-12T12:39:39.000Z"), - value: 22, + timestamp: new Date("2026-04-09T19:55:55.000Z"), + value: 10, }, { id: 1, timezoneOffset: 1, type: "type", unit: "bpm", - timestamp: new Date("2026-01-12T12:40:09.000Z"), - value: 21, + timestamp: new Date("2026-04-09T19:56:25.000Z"), + value: 18, }, { id: 2, timezoneOffset: 1, type: "type", unit: "bpm", - timestamp: new Date("2026-01-12T12:40:39.000Z"), - value: 22, + timestamp: new Date("2026-04-09T19:56:55.000Z"), + value: 18, }, { id: 3, timezoneOffset: 1, type: "type", unit: "bpm", - timestamp: new Date("2026-01-12T12:41:09.000Z"), - value: 22, + timestamp: new Date("2026-04-09T19:57:25.000Z"), + value: 25, }, { id: 4, timezoneOffset: 1, type: "type", unit: "bpm", - timestamp: new Date("2026-01-12T12:41:39.000Z"), - value: 12, + timestamp: new Date("2026-04-09T19:57:55.000Z"), + value: 14, }, ], }); diff --git a/tests/wire/team.test.ts b/tests/wire/team.test.ts index be6a98f94..16a41905c 100644 --- a/tests/wire/team.test.ts +++ b/tests/wire/team.test.ts @@ -13,15 +13,12 @@ describe("TeamClient", () => { server .mockEndpoint() .get("/v2/team/link/config") - .header("x-vital-link-token", "x-vital-link-token") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.team.getLinkConfig({ - vitalLinkToken: "x-vital-link-token", - }); + const response = await client.team.getLinkConfig(); expect(response).toEqual({ key: "value", }); @@ -165,16 +162,16 @@ describe("TeamClient", () => { user_id: "56bd81c9-6219-4000-a775-ae85526eba18", team_id: "56bd81c9-6219-4000-a775-ae85526eba18", client_user_id: "ZTEwZjNjMjctOTI2ZS00M2Vm", - created_on: "2026-01-12T12:39:40Z", + created_on: "2026-04-09T19:55:56Z", connected_sources: [ { provider: { name: "Oura", slug: "oura", logo: "https://logo_url.com" }, - created_on: "2026-01-12T12:39:40Z", + created_on: "2026-04-09T19:55:56Z", source: { name: "Oura", slug: "oura", logo: "logo_url" }, }, ], - fallback_time_zone: { id: "Europe/London", source_slug: "manual", updated_at: "2026-01-12T12:39:40Z" }, - fallback_birth_date: { value: "1989-09-12", source_slug: "manual", updated_at: "2026-01-12T12:39:40Z" }, + fallback_time_zone: { id: "Europe/London", source_slug: "manual", updated_at: "2026-04-09T19:55:56Z" }, + fallback_birth_date: { value: "1989-09-12", source_slug: "manual", updated_at: "2026-04-09T19:55:56Z" }, ingestion_start: "ingestion_start", ingestion_end: "ingestion_end", }, @@ -195,7 +192,7 @@ describe("TeamClient", () => { userId: "56bd81c9-6219-4000-a775-ae85526eba18", teamId: "56bd81c9-6219-4000-a775-ae85526eba18", clientUserId: "ZTEwZjNjMjctOTI2ZS00M2Vm", - createdOn: new Date("2026-01-12T12:39:40.000Z"), + createdOn: new Date("2026-04-09T19:55:56.000Z"), connectedSources: [ { provider: { @@ -203,7 +200,7 @@ describe("TeamClient", () => { slug: "oura", logo: "https://logo_url.com", }, - createdOn: new Date("2026-01-12T12:39:40.000Z"), + createdOn: new Date("2026-04-09T19:55:56.000Z"), source: { name: "Oura", slug: "oura", @@ -214,12 +211,12 @@ describe("TeamClient", () => { fallbackTimeZone: { id: "Europe/London", sourceSlug: "manual", - updatedAt: new Date("2026-01-12T12:39:40.000Z"), + updatedAt: new Date("2026-04-09T19:55:56.000Z"), }, fallbackBirthDate: { value: "1989-09-12", sourceSlug: "manual", - updatedAt: new Date("2026-01-12T12:39:40.000Z"), + updatedAt: new Date("2026-04-09T19:55:56.000Z"), }, ingestionStart: "ingestion_start", ingestionEnd: "ingestion_end", diff --git a/tests/wire/testkit.test.ts b/tests/wire/testkit.test.ts index 1e7800f9d..ee5006483 100644 --- a/tests/wire/testkit.test.ts +++ b/tests/wire/testkit.test.ts @@ -22,9 +22,9 @@ describe("TestkitClient", () => { }; const rawResponseBody = { order: { - user_id: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - team_id: "525ea597-8447-469c-9031-b6b08ca0bad9", + user_id: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + team_id: "52604535-c73c-4ec8-aa62-77a6767da50e", patient_details: { first_name: "first_name", last_name: "last_name", @@ -57,6 +57,7 @@ describe("TestkitClient", () => { state: "CA", zip: "91189", country: "United States", + access_notes: "access_notes", phone_number: "+11234567890", }, lab_test: { @@ -117,9 +118,9 @@ describe("TestkitClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outbound_tracking_number: "", outbound_tracking_url: "", inbound_tracking_number: "", @@ -134,6 +135,7 @@ describe("TestkitClient", () => { }, sample_id: "123456789", notes: "This is a note", + clinical_notes: "clinical_notes", created_at: "2020-01-01T00:00:00Z", updated_at: "2020-01-01T00:00:00Z", events: [ @@ -142,6 +144,12 @@ describe("TestkitClient", () => { { id: 3, created_at: "2022-01-03T00:00:00Z", status: "collecting_sample.testkit.transit_customer" }, ], status: "collecting_sample", + last_event: { + id: 3, + created_at: "2022-01-03T00:00:00Z", + status: "collecting_sample.testkit.transit_customer", + status_detail: "fulfillment_error", + }, physician: { first_name: "first_name", last_name: "last_name", npi: "npi" }, health_insurance_id: "health_insurance_id", requisition_form_url: "https://www.example.com", @@ -165,6 +173,29 @@ describe("TestkitClient", () => { has_missing_results: true, expected_result_by_date: "expected_result_by_date", worst_case_result_by_date: "worst_case_result_by_date", + origin: "initial", + order_transaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + low_level_status: "transit_customer", + low_level_status_created_at: "2020-01-05T00:00:00Z", + origin: "initial", + created_at: "2020-01-01T00:00:00Z", + updated_at: "2020-01-05T00:00:00Z", + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + low_level_status: "requisition_created", + low_level_status_created_at: "2020-01-05T01:00:00Z", + origin: "redraw", + created_at: "2020-01-05T01:00:00Z", + updated_at: "2020-01-05T01:00:00Z", + }, + ], + }, }, status: "status", message: "message", @@ -198,9 +229,9 @@ describe("TestkitClient", () => { }); expect(response).toEqual({ order: { - userId: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - teamId: "525ea597-8447-469c-9031-b6b08ca0bad9", + userId: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + teamId: "52604535-c73c-4ec8-aa62-77a6767da50e", patientDetails: { firstName: "first_name", lastName: "last_name", @@ -233,6 +264,7 @@ describe("TestkitClient", () => { state: "CA", zip: "91189", country: "United States", + accessNotes: "access_notes", phoneNumber: "+11234567890", }, labTest: { @@ -299,9 +331,9 @@ describe("TestkitClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outboundTrackingNumber: "", outboundTrackingUrl: "", inboundTrackingNumber: "", @@ -316,6 +348,7 @@ describe("TestkitClient", () => { }, sampleId: "123456789", notes: "This is a note", + clinicalNotes: "clinical_notes", createdAt: new Date("2020-01-01T00:00:00.000Z"), updatedAt: new Date("2020-01-01T00:00:00.000Z"), events: [ @@ -336,6 +369,12 @@ describe("TestkitClient", () => { }, ], status: "collecting_sample", + lastEvent: { + id: 3, + createdAt: new Date("2022-01-03T00:00:00.000Z"), + status: "collecting_sample.testkit.transit_customer", + statusDetail: "fulfillment_error", + }, physician: { firstName: "first_name", lastName: "last_name", @@ -363,6 +402,29 @@ describe("TestkitClient", () => { hasMissingResults: true, expectedResultByDate: "expected_result_by_date", worstCaseResultByDate: "worst_case_result_by_date", + origin: "initial", + orderTransaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + lowLevelStatus: "transit_customer", + lowLevelStatusCreatedAt: new Date("2020-01-05T00:00:00.000Z"), + origin: "initial", + createdAt: new Date("2020-01-01T00:00:00.000Z"), + updatedAt: new Date("2020-01-05T00:00:00.000Z"), + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + lowLevelStatus: "requisition_created", + lowLevelStatusCreatedAt: new Date("2020-01-05T01:00:00.000Z"), + origin: "redraw", + createdAt: new Date("2020-01-05T01:00:00.000Z"), + updatedAt: new Date("2020-01-05T01:00:00.000Z"), + }, + ], + }, }, status: "status", message: "message", @@ -434,9 +496,9 @@ describe("TestkitClient", () => { }; const rawResponseBody = { order: { - user_id: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - team_id: "525ea597-8447-469c-9031-b6b08ca0bad9", + user_id: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + team_id: "52604535-c73c-4ec8-aa62-77a6767da50e", patient_details: { first_name: "first_name", last_name: "last_name", @@ -469,6 +531,7 @@ describe("TestkitClient", () => { state: "CA", zip: "91189", country: "United States", + access_notes: "access_notes", phone_number: "+11234567890", }, lab_test: { @@ -529,9 +592,9 @@ describe("TestkitClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outbound_tracking_number: "", outbound_tracking_url: "", inbound_tracking_number: "", @@ -546,6 +609,7 @@ describe("TestkitClient", () => { }, sample_id: "123456789", notes: "This is a note", + clinical_notes: "clinical_notes", created_at: "2020-01-01T00:00:00Z", updated_at: "2020-01-01T00:00:00Z", events: [ @@ -554,6 +618,12 @@ describe("TestkitClient", () => { { id: 3, created_at: "2022-01-03T00:00:00Z", status: "collecting_sample.testkit.transit_customer" }, ], status: "collecting_sample", + last_event: { + id: 3, + created_at: "2022-01-03T00:00:00Z", + status: "collecting_sample.testkit.transit_customer", + status_detail: "fulfillment_error", + }, physician: { first_name: "first_name", last_name: "last_name", npi: "npi" }, health_insurance_id: "health_insurance_id", requisition_form_url: "https://www.example.com", @@ -577,6 +647,29 @@ describe("TestkitClient", () => { has_missing_results: true, expected_result_by_date: "expected_result_by_date", worst_case_result_by_date: "worst_case_result_by_date", + origin: "initial", + order_transaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + low_level_status: "transit_customer", + low_level_status_created_at: "2020-01-05T00:00:00Z", + origin: "initial", + created_at: "2020-01-01T00:00:00Z", + updated_at: "2020-01-05T00:00:00Z", + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + low_level_status: "requisition_created", + low_level_status_created_at: "2020-01-05T01:00:00Z", + origin: "redraw", + created_at: "2020-01-05T01:00:00Z", + updated_at: "2020-01-05T01:00:00Z", + }, + ], + }, }, status: "status", message: "message", @@ -605,9 +698,9 @@ describe("TestkitClient", () => { }); expect(response).toEqual({ order: { - userId: "82900d44-4b2d-4adf-a1bb-d0372468ebf4", - id: "fdf02066-86d7-486e-8646-d81fb661d2c1", - teamId: "525ea597-8447-469c-9031-b6b08ca0bad9", + userId: "cce86c28-7880-4f22-a5a0-cd8fbefcda6b", + id: "e942cfc8-1cf4-42bc-b46d-3ae8470965d7", + teamId: "52604535-c73c-4ec8-aa62-77a6767da50e", patientDetails: { firstName: "first_name", lastName: "last_name", @@ -640,6 +733,7 @@ describe("TestkitClient", () => { state: "CA", zip: "91189", country: "United States", + accessNotes: "access_notes", phoneNumber: "+11234567890", }, labTest: { @@ -706,9 +800,9 @@ describe("TestkitClient", () => { details: { type: "testkit", data: { - id: "ab71e177-9f45-4657-a9c8-5998150cbec4", + id: "0e5a3084-5f64-4873-9686-b16d8549e954", shipment: { - id: "0bc8393b-a913-4039-a970-00b63639bfe9", + id: "ea14553f-496b-4dd2-8c22-c86e5c90316a", outboundTrackingNumber: "", outboundTrackingUrl: "", inboundTrackingNumber: "", @@ -723,6 +817,7 @@ describe("TestkitClient", () => { }, sampleId: "123456789", notes: "This is a note", + clinicalNotes: "clinical_notes", createdAt: new Date("2020-01-01T00:00:00.000Z"), updatedAt: new Date("2020-01-01T00:00:00.000Z"), events: [ @@ -743,6 +838,12 @@ describe("TestkitClient", () => { }, ], status: "collecting_sample", + lastEvent: { + id: 3, + createdAt: new Date("2022-01-03T00:00:00.000Z"), + status: "collecting_sample.testkit.transit_customer", + statusDetail: "fulfillment_error", + }, physician: { firstName: "first_name", lastName: "last_name", @@ -770,6 +871,29 @@ describe("TestkitClient", () => { hasMissingResults: true, expectedResultByDate: "expected_result_by_date", worstCaseResultByDate: "worst_case_result_by_date", + origin: "initial", + orderTransaction: { + id: "a655f0e4-6405-4a1d-80b7-66f06c2108a7", + status: "active", + orders: [ + { + id: "d55210cc-3d9f-4115-8262-5013f700c7be", + lowLevelStatus: "transit_customer", + lowLevelStatusCreatedAt: new Date("2020-01-05T00:00:00.000Z"), + origin: "initial", + createdAt: new Date("2020-01-01T00:00:00.000Z"), + updatedAt: new Date("2020-01-05T00:00:00.000Z"), + }, + { + id: "e66321dd-4e0g-5226-9373-6124g811d8cf", + lowLevelStatus: "requisition_created", + lowLevelStatusCreatedAt: new Date("2020-01-05T01:00:00.000Z"), + origin: "redraw", + createdAt: new Date("2020-01-05T01:00:00.000Z"), + updatedAt: new Date("2020-01-05T01:00:00.000Z"), + }, + ], + }, }, status: "status", message: "message", diff --git a/tests/wire/user.test.ts b/tests/wire/user.test.ts index baa245331..ca3e639be 100644 --- a/tests/wire/user.test.ts +++ b/tests/wire/user.test.ts @@ -15,23 +15,23 @@ describe("UserClient", () => { user_id: "56bd81c9-6219-4000-a775-ae85526eba18", team_id: "56bd81c9-6219-4000-a775-ae85526eba18", client_user_id: "ZTEwZjNjMjctOTI2ZS00M2Vm", - created_on: "2026-01-12T12:39:40Z", + created_on: "2026-04-09T19:55:56Z", connected_sources: [ { provider: { name: "Oura", slug: "oura", logo: "https://logo_url.com" }, - created_on: "2026-01-12T12:39:40Z", + created_on: "2026-04-09T19:55:56Z", source: { name: "Oura", slug: "oura", logo: "logo_url" }, }, ], fallback_time_zone: { id: "Europe/London", source_slug: "manual", - updated_at: "2026-01-12T12:39:40Z", + updated_at: "2026-04-09T19:55:56Z", }, fallback_birth_date: { value: "1989-09-12", source_slug: "manual", - updated_at: "2026-01-12T12:39:40Z", + updated_at: "2026-04-09T19:55:56Z", }, ingestion_start: "ingestion_start", ingestion_end: "ingestion_end", @@ -53,7 +53,7 @@ describe("UserClient", () => { userId: "56bd81c9-6219-4000-a775-ae85526eba18", teamId: "56bd81c9-6219-4000-a775-ae85526eba18", clientUserId: "ZTEwZjNjMjctOTI2ZS00M2Vm", - createdOn: new Date("2026-01-12T12:39:40.000Z"), + createdOn: new Date("2026-04-09T19:55:56.000Z"), connectedSources: [ { provider: { @@ -61,7 +61,7 @@ describe("UserClient", () => { slug: "oura", logo: "https://logo_url.com", }, - createdOn: new Date("2026-01-12T12:39:40.000Z"), + createdOn: new Date("2026-04-09T19:55:56.000Z"), source: { name: "Oura", slug: "oura", @@ -72,12 +72,12 @@ describe("UserClient", () => { fallbackTimeZone: { id: "Europe/London", sourceSlug: "manual", - updatedAt: new Date("2026-01-12T12:39:40.000Z"), + updatedAt: new Date("2026-04-09T19:55:56.000Z"), }, fallbackBirthDate: { value: "1989-09-12", sourceSlug: "manual", - updatedAt: new Date("2026-01-12T12:39:40.000Z"), + updatedAt: new Date("2026-04-09T19:55:56.000Z"), }, ingestionStart: "ingestion_start", ingestionEnd: "ingestion_end", @@ -309,6 +309,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, medical_proxy: { first_name: "first_name", @@ -320,6 +321,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, phone_number: "phone_number", household_income: 1, @@ -354,6 +356,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, medicalProxy: { firstName: "first_name", @@ -365,6 +368,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, phoneNumber: "phone_number", householdIncome: 1, @@ -428,6 +432,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, dob: "dob", email: "email", @@ -442,6 +447,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, }, group_id: "group_id", @@ -455,6 +461,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, phone_number: "phone_number", household_income: 1, @@ -507,6 +514,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, dob: "dob", email: "email", @@ -521,6 +529,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, }, groupId: "group_id", @@ -534,6 +543,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, phoneNumber: "phone_number", householdIncome: 1, @@ -614,6 +624,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, dob: "dob", email: "email", @@ -628,6 +639,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, }, group_id: "group_id", @@ -641,6 +653,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, phone_number: "phone_number", household_income: 1, @@ -675,6 +688,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, dob: "dob", email: "email", @@ -689,6 +703,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, }, groupId: "group_id", @@ -702,6 +717,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, phoneNumber: "phone_number", householdIncome: 1, @@ -756,6 +772,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, medical_proxy: { first_name: "first_name", @@ -767,6 +784,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + access_notes: "access_notes", }, phone_number: "phone_number", household_income: 1, @@ -816,6 +834,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, medicalProxy: { firstName: "first_name", @@ -827,6 +846,7 @@ describe("UserClient", () => { zip: "zip", city: "city", state: "state", + accessNotes: "access_notes", }, phoneNumber: "phone_number", householdIncome: 1, @@ -889,16 +909,16 @@ describe("UserClient", () => { user_id: "56bd81c9-6219-4000-a775-ae85526eba18", team_id: "56bd81c9-6219-4000-a775-ae85526eba18", client_user_id: "ZTEwZjNjMjctOTI2ZS00M2Vm", - created_on: "2026-01-12T12:39:40Z", + created_on: "2026-04-09T19:55:56Z", connected_sources: [ { provider: { name: "Oura", slug: "oura", logo: "https://logo_url.com" }, - created_on: "2026-01-12T12:39:40Z", + created_on: "2026-04-09T19:55:56Z", source: { name: "Oura", slug: "oura", logo: "logo_url" }, }, ], - fallback_time_zone: { id: "Europe/London", source_slug: "manual", updated_at: "2026-01-12T12:39:40Z" }, - fallback_birth_date: { value: "1989-09-12", source_slug: "manual", updated_at: "2026-01-12T12:39:40Z" }, + fallback_time_zone: { id: "Europe/London", source_slug: "manual", updated_at: "2026-04-09T19:55:56Z" }, + fallback_birth_date: { value: "1989-09-12", source_slug: "manual", updated_at: "2026-04-09T19:55:56Z" }, ingestion_start: "ingestion_start", ingestion_end: "ingestion_end", }; @@ -915,7 +935,7 @@ describe("UserClient", () => { userId: "56bd81c9-6219-4000-a775-ae85526eba18", teamId: "56bd81c9-6219-4000-a775-ae85526eba18", clientUserId: "ZTEwZjNjMjctOTI2ZS00M2Vm", - createdOn: new Date("2026-01-12T12:39:40.000Z"), + createdOn: new Date("2026-04-09T19:55:56.000Z"), connectedSources: [ { provider: { @@ -923,7 +943,7 @@ describe("UserClient", () => { slug: "oura", logo: "https://logo_url.com", }, - createdOn: new Date("2026-01-12T12:39:40.000Z"), + createdOn: new Date("2026-04-09T19:55:56.000Z"), source: { name: "Oura", slug: "oura", @@ -934,12 +954,12 @@ describe("UserClient", () => { fallbackTimeZone: { id: "Europe/London", sourceSlug: "manual", - updatedAt: new Date("2026-01-12T12:39:40.000Z"), + updatedAt: new Date("2026-04-09T19:55:56.000Z"), }, fallbackBirthDate: { value: "1989-09-12", sourceSlug: "manual", - updatedAt: new Date("2026-01-12T12:39:40.000Z"), + updatedAt: new Date("2026-04-09T19:55:56.000Z"), }, ingestionStart: "ingestion_start", ingestionEnd: "ingestion_end", @@ -1009,16 +1029,16 @@ describe("UserClient", () => { user_id: "56bd81c9-6219-4000-a775-ae85526eba18", team_id: "56bd81c9-6219-4000-a775-ae85526eba18", client_user_id: "ZTEwZjNjMjctOTI2ZS00M2Vm", - created_on: "2026-01-12T12:39:40Z", + created_on: "2026-04-09T19:55:56Z", connected_sources: [ { provider: { name: "Oura", slug: "oura", logo: "https://logo_url.com" }, - created_on: "2026-01-12T12:39:40Z", + created_on: "2026-04-09T19:55:56Z", source: { name: "Oura", slug: "oura", logo: "logo_url" }, }, ], - fallback_time_zone: { id: "Europe/London", source_slug: "manual", updated_at: "2026-01-12T12:39:40Z" }, - fallback_birth_date: { value: "1989-09-12", source_slug: "manual", updated_at: "2026-01-12T12:39:40Z" }, + fallback_time_zone: { id: "Europe/London", source_slug: "manual", updated_at: "2026-04-09T19:55:56Z" }, + fallback_birth_date: { value: "1989-09-12", source_slug: "manual", updated_at: "2026-04-09T19:55:56Z" }, ingestion_start: "ingestion_start", ingestion_end: "ingestion_end", }; @@ -1029,7 +1049,7 @@ describe("UserClient", () => { userId: "56bd81c9-6219-4000-a775-ae85526eba18", teamId: "56bd81c9-6219-4000-a775-ae85526eba18", clientUserId: "ZTEwZjNjMjctOTI2ZS00M2Vm", - createdOn: new Date("2026-01-12T12:39:40.000Z"), + createdOn: new Date("2026-04-09T19:55:56.000Z"), connectedSources: [ { provider: { @@ -1037,7 +1057,7 @@ describe("UserClient", () => { slug: "oura", logo: "https://logo_url.com", }, - createdOn: new Date("2026-01-12T12:39:40.000Z"), + createdOn: new Date("2026-04-09T19:55:56.000Z"), source: { name: "Oura", slug: "oura", @@ -1048,12 +1068,12 @@ describe("UserClient", () => { fallbackTimeZone: { id: "Europe/London", sourceSlug: "manual", - updatedAt: new Date("2026-01-12T12:39:40.000Z"), + updatedAt: new Date("2026-04-09T19:55:56.000Z"), }, fallbackBirthDate: { value: "1989-09-12", sourceSlug: "manual", - updatedAt: new Date("2026-01-12T12:39:40.000Z"), + updatedAt: new Date("2026-04-09T19:55:56.000Z"), }, ingestionStart: "ingestion_start", ingestionEnd: "ingestion_end", diff --git a/tests/wire/vitals.test.ts b/tests/wire/vitals.test.ts index 7c748b7c4..d84efd8be 100644 --- a/tests/wire/vitals.test.ts +++ b/tests/wire/vitals.test.ts @@ -2117,7 +2117,7 @@ describe("VitalsClient", () => { unit: "min", timestamp: "2024-01-15T09:30:00Z", start: "2023-02-13T14:57:24Z", - end: "2026-01-12T12:44:39Z", + end: "2026-04-09T20:00:55Z", value: 42, }, ], @@ -2155,7 +2155,7 @@ describe("VitalsClient", () => { unit: "min", timestamp: new Date("2024-01-15T09:30:00.000Z"), start: new Date("2023-02-13T14:57:24.000Z"), - end: new Date("2026-01-12T12:44:39.000Z"), + end: new Date("2026-04-09T20:00:55.000Z"), value: 42, }, ], @@ -2916,12 +2916,15 @@ describe("VitalsClient", () => { source: { provider: "oura", type: "ring" }, data: [ { - type: "long_acting", + type: "rapid_acting", unit: "unit", timestamp: "2024-01-15T09:30:00Z", start: "2023-02-13T14:30:52Z", - end: "2023-02-13T14:30:52Z", - value: 60, + end: "2023-02-13T14:57:24Z", + value: 2.5, + delivery_mode: "bolus", + delivery_form: "extended", + bolus_purpose: "correction", }, ], }, @@ -2955,12 +2958,15 @@ describe("VitalsClient", () => { }, data: [ { - type: "long_acting", + type: "rapid_acting", unit: "unit", timestamp: new Date("2024-01-15T09:30:00.000Z"), start: new Date("2023-02-13T14:30:52.000Z"), - end: new Date("2023-02-13T14:30:52.000Z"), - value: 60, + end: new Date("2023-02-13T14:57:24.000Z"), + value: 2.5, + deliveryMode: "bolus", + deliveryForm: "extended", + bolusPurpose: "correction", }, ], }, @@ -4125,7 +4131,7 @@ describe("VitalsClient", () => { oura: [ { source: { provider: "oura", type: "ring" }, - data: [{ unit: "mmHg", timestamp: "2026-01-12T12:39:39Z", systolic: 125, diastolic: 75 }], + data: [{ unit: "mmHg", timestamp: "2026-04-09T19:55:55Z", systolic: 125, diastolic: 75 }], }, ], }, @@ -4158,7 +4164,7 @@ describe("VitalsClient", () => { data: [ { unit: "mmHg", - timestamp: new Date("2026-01-12T12:39:39.000Z"), + timestamp: new Date("2026-04-09T19:55:55.000Z"), systolic: 125, diastolic: 75, }, @@ -4318,7 +4324,7 @@ describe("VitalsClient", () => { unit: "min", timestamp: "2024-01-15T09:30:00Z", start: "2023-02-13T14:57:24Z", - end: "2026-01-12T12:44:39Z", + end: "2026-04-09T20:00:55Z", value: 42, }, ]; @@ -4343,7 +4349,7 @@ describe("VitalsClient", () => { unit: "min", timestamp: new Date("2024-01-15T09:30:00.000Z"), start: new Date("2023-02-13T14:57:24.000Z"), - end: new Date("2026-01-12T12:44:39.000Z"), + end: new Date("2026-04-09T20:00:55.000Z"), value: 42, }, ]); @@ -5680,7 +5686,7 @@ describe("VitalsClient", () => { type: "type", unit: "mmHg", grouping: [{ key: "value" }], - timestamp: "2026-01-12T12:39:39Z", + timestamp: "2026-04-09T19:55:55Z", systolic: 125, diastolic: 75, }, @@ -5709,7 +5715,7 @@ describe("VitalsClient", () => { key: "value", }, ], - timestamp: new Date("2026-01-12T12:39:39.000Z"), + timestamp: new Date("2026-04-09T19:55:55.000Z"), systolic: 125, diastolic: 75, },