@oystehr/sdk 4.1.1 → 4.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/cjs/index.min.cjs +1 -1
  2. package/dist/cjs/index.min.cjs.map +1 -1
  3. package/dist/cjs/resources/classes/fax.cjs.map +1 -1
  4. package/dist/cjs/resources/classes/fax.d.ts +2 -2
  5. package/dist/cjs/resources/classes/fhir-ext.cjs +15 -2
  6. package/dist/cjs/resources/classes/fhir-ext.cjs.map +1 -1
  7. package/dist/cjs/resources/classes/lab.cjs +1 -1
  8. package/dist/cjs/resources/classes/lab.cjs.map +1 -1
  9. package/dist/cjs/resources/classes/lab.d.ts +4 -4
  10. package/dist/cjs/resources/classes/m2m.cjs +9 -0
  11. package/dist/cjs/resources/classes/m2m.cjs.map +1 -1
  12. package/dist/cjs/resources/classes/m2m.d.ts +8 -1
  13. package/dist/cjs/resources/classes/user.cjs +9 -0
  14. package/dist/cjs/resources/classes/user.cjs.map +1 -1
  15. package/dist/cjs/resources/classes/user.d.ts +8 -1
  16. package/dist/cjs/resources/types/ErxCheckPractitionerEnrollmentResponse.d.ts +4 -0
  17. package/dist/cjs/resources/types/ErxEnrollPractitionerParams.d.ts +1 -0
  18. package/dist/cjs/resources/types/ErxSearchAllergensResponse.d.ts +8 -4
  19. package/dist/cjs/resources/types/FaxOnboardResponse.d.ts +9 -0
  20. package/dist/cjs/resources/types/LabOrderSubmitResponse.d.ts +14 -0
  21. package/dist/cjs/resources/types/LabRouteCreateResponse.d.ts +9 -0
  22. package/dist/cjs/resources/types/LabRouteDeleteParams.d.ts +8 -0
  23. package/dist/cjs/resources/types/M2mMeResponse.d.ts +5 -0
  24. package/dist/cjs/resources/types/M2mUpdateParams.d.ts +4 -0
  25. package/dist/cjs/resources/types/UserResetMfaParams.d.ts +3 -0
  26. package/dist/cjs/resources/types/UserUpdateParams.d.ts +5 -1
  27. package/dist/cjs/resources/types/ZambdaCreateParams.d.ts +6 -2
  28. package/dist/cjs/resources/types/ZambdaFunction.d.ts +5 -1
  29. package/dist/cjs/resources/types/ZambdaUpdateParams.d.ts +5 -1
  30. package/dist/cjs/resources/types/fhir.d.ts +3 -0
  31. package/dist/cjs/resources/types/index.d.ts +5 -0
  32. package/dist/esm/index.min.js +1 -1
  33. package/dist/esm/index.min.js.map +1 -1
  34. package/dist/esm/resources/classes/fax.d.ts +2 -2
  35. package/dist/esm/resources/classes/fax.js.map +1 -1
  36. package/dist/esm/resources/classes/fhir-ext.js +15 -2
  37. package/dist/esm/resources/classes/fhir-ext.js.map +1 -1
  38. package/dist/esm/resources/classes/lab.d.ts +4 -4
  39. package/dist/esm/resources/classes/lab.js +1 -1
  40. package/dist/esm/resources/classes/lab.js.map +1 -1
  41. package/dist/esm/resources/classes/m2m.d.ts +8 -1
  42. package/dist/esm/resources/classes/m2m.js +9 -0
  43. package/dist/esm/resources/classes/m2m.js.map +1 -1
  44. package/dist/esm/resources/classes/user.d.ts +8 -1
  45. package/dist/esm/resources/classes/user.js +9 -0
  46. package/dist/esm/resources/classes/user.js.map +1 -1
  47. package/dist/esm/resources/types/ErxCheckPractitionerEnrollmentResponse.d.ts +4 -0
  48. package/dist/esm/resources/types/ErxEnrollPractitionerParams.d.ts +1 -0
  49. package/dist/esm/resources/types/ErxSearchAllergensResponse.d.ts +8 -4
  50. package/dist/esm/resources/types/FaxOnboardResponse.d.ts +9 -0
  51. package/dist/esm/resources/types/LabOrderSubmitResponse.d.ts +14 -0
  52. package/dist/esm/resources/types/LabRouteCreateResponse.d.ts +9 -0
  53. package/dist/esm/resources/types/LabRouteDeleteParams.d.ts +8 -0
  54. package/dist/esm/resources/types/M2mMeResponse.d.ts +5 -0
  55. package/dist/esm/resources/types/M2mUpdateParams.d.ts +4 -0
  56. package/dist/esm/resources/types/UserResetMfaParams.d.ts +3 -0
  57. package/dist/esm/resources/types/UserUpdateParams.d.ts +5 -1
  58. package/dist/esm/resources/types/ZambdaCreateParams.d.ts +6 -2
  59. package/dist/esm/resources/types/ZambdaFunction.d.ts +5 -1
  60. package/dist/esm/resources/types/ZambdaUpdateParams.d.ts +5 -1
  61. package/dist/esm/resources/types/fhir.d.ts +3 -0
  62. package/dist/esm/resources/types/index.d.ts +5 -0
  63. package/package.json +2 -2
  64. package/src/resources/classes/fax.ts +2 -2
  65. package/src/resources/classes/fhir-ext.ts +17 -2
  66. package/src/resources/classes/lab.ts +5 -3
  67. package/src/resources/classes/m2m.ts +10 -0
  68. package/src/resources/classes/user.ts +10 -0
  69. package/src/resources/types/ErxCheckPractitionerEnrollmentResponse.ts +4 -0
  70. package/src/resources/types/ErxEnrollPractitionerParams.ts +1 -0
  71. package/src/resources/types/ErxSearchAllergensResponse.ts +8 -4
  72. package/src/resources/types/FaxOnboardResponse.ts +11 -0
  73. package/src/resources/types/LabOrderSubmitResponse.ts +16 -0
  74. package/src/resources/types/LabRouteCreateResponse.ts +11 -0
  75. package/src/resources/types/LabRouteDeleteParams.ts +8 -0
  76. package/src/resources/types/M2mMeResponse.ts +7 -0
  77. package/src/resources/types/M2mUpdateParams.ts +4 -0
  78. package/src/resources/types/UserResetMfaParams.ts +5 -0
  79. package/src/resources/types/UserUpdateParams.ts +5 -1
  80. package/src/resources/types/ZambdaCreateParams.ts +6 -2
  81. package/src/resources/types/ZambdaFunction.ts +5 -1
  82. package/src/resources/types/ZambdaUpdateParams.ts +5 -1
  83. package/src/resources/types/fhir.ts +3 -0
  84. package/src/resources/types/index.ts +5 -0
  85. package/dist/esm/node_modules/tslib/package.json +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"fax.cjs","sources":["../../../../src/resources/classes/fax.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport { FaxSendParams, FaxSendResponse, OystehrClientRequest } from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class Fax extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['faxApiUrl'] ?? 'https://fax-api.zapehr.com/v1';\n }\n /**\n * Offboard a fax number. Oystehr's [offboard](https://docs.oystehr.com/oystehr/services/fax/number/) feature makes it easy to stop using the fax service and release the project's assigned fax number with a single API call. Please note there is no way to guarantee getting the same number back again, so if you think this can break your project in any way we recommend not offboarding and avoid sending faxes until you're sure.\n *\n * Access Policy Requirements:\n * Action: `Fax:Offboard`\n * Access Policy Resource: `Fax:Number`\n */\n offboard(request?: OystehrClientRequest): Promise<void> {\n return this.request('/offboard', 'post', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Onboard a fax number. Oystehr's [onboard](https://docs.oystehr.com/oystehr/services/fax/number/) feature makes it easy to start using the fax service and purchase a new fax number for your project with a single API call.\n *\n * Access Policy Requirements:\n * Action: `Fax:Onboard`\n * Access Policy Resource: `Fax:Number`\n */\n onboard(request?: OystehrClientRequest): Promise<void> {\n return this.request('/onboard', 'post', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Send a fax. Oystehr's [fax sending](https://docs.oystehr.com/oystehr/services/fax/send/) feature makes it easy to send a fax to a chosen recipient with a single API call. You can use this feature to send referrals, medical records, prescriptions, and other documents that require fax transmission e.g. for HIPAA compliance.\n *\n * Access Policy Requirements:\n * Action: `Fax:Send`\n * Access Policy Resource: `Fax:Fax`\n */\n send(params: FaxSendParams, request?: OystehrClientRequest): Promise<FaxSendResponse> {\n return this.request('/send', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAMM,MAAO,GAAI,SAAQA,kBAAW,CAAA;AAClC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,+BAA+B,CAAC;KAC/E;AACD;;;;;;AAMG;AACH,IAAA,QAAQ,CAAC,OAA8B,EAAA;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAClF;AACD;;;;;;AAMG;AACH,IAAA,OAAO,CAAC,OAA8B,EAAA;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KACjF;AACD;;;;;;AAMG;IACH,IAAI,CAAC,MAAqB,EAAE,OAA8B,EAAA;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACtF;AACF;;;;"}
1
+ {"version":3,"file":"fax.cjs","sources":["../../../../src/resources/classes/fax.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport { FaxOnboardResponse, FaxSendParams, FaxSendResponse, OystehrClientRequest } from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class Fax extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['faxApiUrl'] ?? 'https://fax-api.zapehr.com/v1';\n }\n /**\n * Offboard a fax number. Oystehr's [offboard](https://docs.oystehr.com/oystehr/services/fax/number/) feature makes it easy to stop using the fax service and release the project's assigned fax number with a single API call. Please note there is no way to guarantee getting the same number back again, so if you think this can break your project in any way we recommend not offboarding and avoid sending faxes until you're sure.\n *\n * Access Policy Requirements:\n * Action: `Fax:Offboard`\n * Access Policy Resource: `Fax:Number`\n */\n offboard(request?: OystehrClientRequest): Promise<void> {\n return this.request('/offboard', 'post', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Onboard a fax number. Oystehr's [onboard](https://docs.oystehr.com/oystehr/services/fax/number/) feature makes it easy to start using the fax service and purchase a new fax number for your project with a single API call.\n *\n * Access Policy Requirements:\n * Action: `Fax:Onboard`\n * Access Policy Resource: `Fax:Number`\n */\n onboard(request?: OystehrClientRequest): Promise<FaxOnboardResponse> {\n return this.request('/onboard', 'post', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Send a fax. Oystehr's [fax sending](https://docs.oystehr.com/oystehr/services/fax/send/) feature makes it easy to send a fax to a chosen recipient with a single API call. You can use this feature to send referrals, medical records, prescriptions, and other documents that require fax transmission e.g. for HIPAA compliance.\n *\n * Access Policy Requirements:\n * Action: `Fax:Send`\n * Access Policy Resource: `Fax:Fax`\n */\n send(params: FaxSendParams, request?: OystehrClientRequest): Promise<FaxSendResponse> {\n return this.request('/send', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAMM,MAAO,GAAI,SAAQA,kBAAW,CAAA;AAClC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,+BAA+B,CAAC;KAC/E;AACD;;;;;;AAMG;AACH,IAAA,QAAQ,CAAC,OAA8B,EAAA;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAClF;AACD;;;;;;AAMG;AACH,IAAA,OAAO,CAAC,OAA8B,EAAA;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KACjF;AACD;;;;;;AAMG;IACH,IAAI,CAAC,MAAqB,EAAE,OAA8B,EAAA;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACtF;AACF;;;;"}
@@ -1,4 +1,4 @@
1
- import { FaxSendParams, FaxSendResponse, OystehrClientRequest } from '../..';
1
+ import { FaxOnboardResponse, FaxSendParams, FaxSendResponse, OystehrClientRequest } from '../..';
2
2
  import { SDKResource } from '../../client/client';
3
3
  import { OystehrConfig } from '../../config';
4
4
  export declare class Fax extends SDKResource {
@@ -19,7 +19,7 @@ export declare class Fax extends SDKResource {
19
19
  * Action: `Fax:Onboard`
20
20
  * Access Policy Resource: `Fax:Number`
21
21
  */
22
- onboard(request?: OystehrClientRequest): Promise<void>;
22
+ onboard(request?: OystehrClientRequest): Promise<FaxOnboardResponse>;
23
23
  /**
24
24
  * Send a fax. Oystehr's [fax sending](https://docs.oystehr.com/oystehr/services/fax/send/) feature makes it easy to send a fax to a chosen recipient with a single API call. You can use this feature to send referrals, medical records, prescriptions, and other documents that require fax transmission e.g. for HIPAA compliance.
25
25
  *
@@ -100,7 +100,10 @@ function batchInputRequestToBundleEntryItem(request) {
100
100
  if (method === 'PUT') {
101
101
  const { resource } = request;
102
102
  return {
103
- ...baseRequest,
103
+ request: {
104
+ ...baseRequest.request,
105
+ ifMatch: request.ifMatch,
106
+ },
104
107
  resource: resource,
105
108
  };
106
109
  }
@@ -108,7 +111,10 @@ function batchInputRequestToBundleEntryItem(request) {
108
111
  if (method === 'PATCH') {
109
112
  if ('resource' in request) {
110
113
  return {
111
- ...baseRequest,
114
+ request: {
115
+ ...baseRequest.request,
116
+ ifMatch: request.ifMatch,
117
+ },
112
118
  resource: request.resource,
113
119
  };
114
120
  }
@@ -130,6 +136,13 @@ function batchInputRequestToBundleEntryItem(request) {
130
136
  fullUrl,
131
137
  };
132
138
  }
139
+ // // Add ifMatch for the entries that support it
140
+ // if ('ifMatch' in request) {
141
+ // baseRequest.request = {
142
+ // ...baseRequest.request,
143
+ // ifMatch: request.ifMatch,
144
+ // };
145
+ // }
133
146
  throw new Error('Unrecognized method');
134
147
  }
135
148
  function bundleRequest(type) {
@@ -1 +1 @@
1
- {"version":3,"file":"fhir-ext.cjs","sources":["../../../../src/resources/classes/fhir-ext.ts"],"sourcesContent":["import { Address as AddressR4B, HumanName as HumanNameR4B } from 'fhir/r4b';\nimport { Address as AddressR5, HumanName as HumanNameR5 } from 'fhir/r5';\nimport {\n BatchInput,\n BatchInputRequest,\n Binary,\n Bundle,\n BundleEntry,\n FhirBundle,\n FhirCreateParams,\n FhirDeleteParams,\n FhirGetParams,\n FhirHistoryGetParams,\n FhirHistorySearchParams,\n FhirPatchParams,\n FhirResource,\n FhirSearchParams,\n FhirUpdateParams,\n} from '../..';\nimport { addParamsToSearch, FhirFetcherResponse, OystehrClientRequest, SDKResource } from '../../client/client';\n\n/**\n * Optional parameter that can be passed to the client methods. It allows\n * overriding the access token or project ID, and setting various headers,\n * such as 'Content-Type'. Also support enabling optimistic locking.\n */\nexport interface OystehrFHIRUpdateClientRequest extends OystehrClientRequest {\n /**\n * Enable optimistic locking for the request. If set to a version ID, the request will\n * include the 'If-Match' header with that value in the FHIR optimistic-locking format.\n * If the resource has been updated since the version provided, the request\n * will fail with a 412 Precondition Failed error.\n */\n optimisticLockingVersionId?: string;\n}\n\n/**\n * Performs a FHIR search and returns the results as a Bundle resource\n *\n * @param options FHIR resource type and FHIR search parameters\n * @param request optional OystehrClientRequest object\n * @returns FHIR Bundle resource\n */\nexport async function search<T extends FhirResource>(\n this: SDKResource,\n params: FhirSearchParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>>> {\n const { resourceType, params: searchParams } = params;\n let paramMap: Record<string, (string | number)[]> | undefined;\n if (searchParams) {\n paramMap = Object.entries(searchParams).reduce((acc, [_, param]) => {\n if (!acc[param.name]) {\n acc[param.name] = [];\n }\n acc[param.name].push(param.value);\n return acc;\n }, {} as Record<string, (string | number)[]>);\n }\n const requestBundle = await this.fhirRequest<FhirBundle<T>>(`/${resourceType}/_search`, 'POST')(paramMap, {\n ...request,\n contentType: 'application/x-www-form-urlencoded',\n });\n const bundle: Bundle<T> = {\n ...requestBundle,\n entry: requestBundle.entry as Array<BundleEntry<T>> | undefined,\n unbundle: function (this: { entry?: Array<BundleEntry<T>> | undefined }) {\n return this.entry?.map((entry) => entry.resource).filter((entry): entry is T => entry !== undefined) ?? [];\n },\n };\n return bundle;\n}\n\nexport async function create<T extends FhirResource>(\n this: SDKResource,\n params: FhirCreateParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<T>> {\n const { resourceType } = params;\n return this.fhirRequest(`/${resourceType}`, 'POST')(params as unknown as Record<string, unknown>, request);\n}\n\nexport async function get<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirGetParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<T>> {\n return this.fhirRequest<T>(`/${resourceType}/${id}`, 'GET')({}, request);\n}\n\nexport async function update<T extends FhirResource>(\n this: SDKResource,\n params: FhirUpdateParams<T>,\n request?: OystehrFHIRUpdateClientRequest\n): Promise<FhirFetcherResponse<T>> {\n const { id, resourceType } = params;\n return this.fhirRequest(`/${resourceType}/${id}`, 'PUT')(params as unknown as Record<string, unknown>, {\n ...request,\n ifMatch: request?.optimisticLockingVersionId ? `W/\"${request.optimisticLockingVersionId}\"` : undefined,\n });\n}\n\nexport async function patch<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, operations }: FhirPatchParams<T>,\n request?: OystehrFHIRUpdateClientRequest\n): Promise<FhirFetcherResponse<T>> {\n return this.fhirRequest(`/${resourceType}/${id}`, 'PATCH')(operations, {\n ...request,\n contentType: 'application/json-patch+json',\n ifMatch: request?.optimisticLockingVersionId ? `W/\"${request.optimisticLockingVersionId}\"` : undefined,\n });\n}\n\nasync function del<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirDeleteParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<T>> {\n return this.fhirRequest(`/${resourceType}/${id}`, 'DELETE')({}, request);\n}\nexport { del as delete };\n\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirHistorySearchParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>>>;\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, versionId }: FhirHistoryGetParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<T>>;\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, versionId }: { resourceType: string; id: string; versionId?: string },\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>> | FhirFetcherResponse<T>> {\n return this.fhirRequest(`/${resourceType}/${id}/_history${versionId ? `/${versionId}` : ''}`, 'GET')({}, request);\n}\n\nfunction batchInputRequestToBundleEntryItem<T extends FhirResource>(\n request: BatchInputRequest<T>\n): BundleEntry<T | Binary<T>> {\n const { method, url } = request;\n const baseRequest = {\n request: {\n method,\n url,\n },\n };\n\n // Escape query string parameters in entry.request.url\n if (url.split('?').length > 1) {\n const [resource, query] = url.split('?');\n const params = query\n .split('&')\n .map((param) => {\n const [name, value] = param.split('=');\n return { name, value };\n })\n .reduce((acc, { name, value }) => {\n if (!name) {\n return acc;\n }\n if (!acc[name]) {\n acc[name] = [];\n }\n acc[name].push(value);\n return acc;\n }, {} as Record<string, string[]>);\n const search = new URLSearchParams();\n addParamsToSearch(params, search);\n baseRequest.request.url = `${resource}?${search.toString()}`;\n }\n\n // GET, DELETE, and HEAD require no further parameters\n if (['GET', 'DELETE', 'HEAD'].includes(method)) {\n return baseRequest as BundleEntry<T>;\n }\n\n // PUT updates require a full resource\n if (method === 'PUT') {\n const { resource } = request;\n return {\n ...baseRequest,\n resource: resource as T,\n } as BundleEntry<T>;\n }\n\n // PATCH can be Binary resource or JSON patch\n if (method === 'PATCH') {\n if ('resource' in request) {\n return {\n ...baseRequest,\n resource: request.resource,\n } as BundleEntry<Binary<T>>;\n }\n return {\n ...baseRequest,\n resource: {\n resourceType: 'Binary',\n contentType: 'application/json-patch+json',\n data: Buffer.from(JSON.stringify(request.operations), 'utf8').toString('base64'),\n },\n } as BundleEntry<Binary<T>>;\n }\n\n // POST creates require a full resource\n if (method === 'POST') {\n const { resource, fullUrl } = request;\n return {\n ...baseRequest,\n resource: resource as T,\n fullUrl,\n } as BundleEntry<T>;\n }\n throw new Error('Unrecognized method');\n}\n\nfunction bundleRequest(type: 'batch' | 'transaction') {\n return async function <BundleContentType extends FhirResource>(\n this: SDKResource,\n input: BatchInput<BundleContentType>,\n request?: OystehrClientRequest\n ): Promise<FhirFetcherResponse<Bundle<BundleContentType>>> {\n return this.fhirRequest('/', 'POST')(\n {\n resourceType: 'Bundle',\n type,\n entry: input.requests.map(batchInputRequestToBundleEntryItem),\n },\n request\n );\n };\n}\n\nexport const batch = bundleRequest('batch');\nexport const transaction = bundleRequest('transaction');\n\nexport function formatAddress(\n address: AddressR4B | AddressR5,\n options?: { all?: boolean; use?: boolean; lineSeparator?: string }\n): string {\n const builder = [];\n\n if (address.line) {\n builder.push(...address.line);\n }\n\n if (address.city || address.state || address.postalCode) {\n const cityStateZip = [];\n if (address.city) {\n cityStateZip.push(address.city);\n }\n if (address.state) {\n cityStateZip.push(address.state);\n }\n if (address.postalCode) {\n cityStateZip.push(address.postalCode);\n }\n builder.push(cityStateZip.join(', '));\n }\n\n if (address.use && (options?.all || options?.use)) {\n builder.push('[' + address.use + ']');\n }\n\n return builder.join(options?.lineSeparator || ', ').trim();\n}\n\nexport function formatHumanName(\n name: HumanNameR4B | HumanNameR5,\n options?: {\n all?: boolean;\n prefix?: boolean;\n suffix?: boolean;\n use?: boolean;\n }\n): string {\n const builder = [];\n\n if (name.prefix && options?.prefix !== false) {\n builder.push(...name.prefix);\n }\n\n if (name.given) {\n builder.push(...name.given);\n }\n\n if (name.family) {\n builder.push(name.family);\n }\n\n if (name.suffix && options?.suffix !== false) {\n builder.push(...name.suffix);\n }\n\n if (name.use && (options?.all || options?.use)) {\n builder.push('[' + name.use + ']');\n }\n\n return builder.join(' ').trim();\n}\n"],"names":["addParamsToSearch"],"mappings":";;;;AAoCA;;;;;;AAMG;AACI,eAAe,MAAM,CAE1B,MAA2B,EAC3B,OAA8B,EAAA;IAE9B,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;AACtD,IAAA,IAAI,QAAyD,CAAC;IAC9D,IAAI,YAAY,EAAE;AAChB,QAAA,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,KAAI;YACjE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;AACpB,gBAAA,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;aACtB;AACD,YAAA,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAClC,YAAA,OAAO,GAAG,CAAC;SACZ,EAAE,EAAyC,CAAC,CAAC;KAC/C;AACD,IAAA,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,WAAW,CAAgB,CAAI,CAAA,EAAA,YAAY,UAAU,EAAE,MAAM,CAAC,CAAC,QAAQ,EAAE;AACxG,QAAA,GAAG,OAAO;AACV,QAAA,WAAW,EAAE,mCAAmC;AACjD,KAAA,CAAC,CAAC;AACH,IAAA,MAAM,MAAM,GAAc;AACxB,QAAA,GAAG,aAAa;QAChB,KAAK,EAAE,aAAa,CAAC,KAA0C;AAC/D,QAAA,QAAQ,EAAE,YAAA;AACR,YAAA,OAAO,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,KAAK,KA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ACd,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;KAC7B;AAED,IAAA,IAAI,IAAI,CAAC,MAAM,EAAE;AACf,QAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC3B;IAED,IAAI,IAAI,CAAC,MAAM,IAAI,OAAO,EAAE,MAAM,KAAK,KAAK,EAAE;QAC5C,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;KAC9B;AAED,IAAA,IAAI,IAAI,CAAC,GAAG,KAAK,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,GAAG,CAAC,EAAE;QAC9C,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;KACpC;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAClC;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"fhir-ext.cjs","sources":["../../../../src/resources/classes/fhir-ext.ts"],"sourcesContent":["import { Address as AddressR4B, HumanName as HumanNameR4B } from 'fhir/r4b';\nimport { Address as AddressR5, HumanName as HumanNameR5 } from 'fhir/r5';\nimport {\n BatchInput,\n BatchInputRequest,\n Binary,\n Bundle,\n BundleEntry,\n FhirBundle,\n FhirCreateParams,\n FhirDeleteParams,\n FhirGetParams,\n FhirHistoryGetParams,\n FhirHistorySearchParams,\n FhirPatchParams,\n FhirResource,\n FhirSearchParams,\n FhirUpdateParams,\n} from '../..';\nimport { addParamsToSearch, FhirFetcherResponse, OystehrClientRequest, SDKResource } from '../../client/client';\n\n/**\n * Optional parameter that can be passed to the client methods. It allows\n * overriding the access token or project ID, and setting various headers,\n * such as 'Content-Type'. Also support enabling optimistic locking.\n */\nexport interface OystehrFHIRUpdateClientRequest extends OystehrClientRequest {\n /**\n * Enable optimistic locking for the request. If set to a version ID, the request will\n * include the 'If-Match' header with that value in the FHIR optimistic-locking format.\n * If the resource has been updated since the version provided, the request\n * will fail with a 412 Precondition Failed error.\n */\n optimisticLockingVersionId?: string;\n}\n\n/**\n * Performs a FHIR search and returns the results as a Bundle resource\n *\n * @param options FHIR resource type and FHIR search parameters\n * @param request optional OystehrClientRequest object\n * @returns FHIR Bundle resource\n */\nexport async function search<T extends FhirResource>(\n this: SDKResource,\n params: FhirSearchParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>>> {\n const { resourceType, params: searchParams } = params;\n let paramMap: Record<string, (string | number)[]> | undefined;\n if (searchParams) {\n paramMap = Object.entries(searchParams).reduce((acc, [_, param]) => {\n if (!acc[param.name]) {\n acc[param.name] = [];\n }\n acc[param.name].push(param.value);\n return acc;\n }, {} as Record<string, (string | number)[]>);\n }\n const requestBundle = await this.fhirRequest<FhirBundle<T>>(`/${resourceType}/_search`, 'POST')(paramMap, {\n ...request,\n contentType: 'application/x-www-form-urlencoded',\n });\n const bundle: Bundle<T> = {\n ...requestBundle,\n entry: requestBundle.entry as Array<BundleEntry<T>> | undefined,\n unbundle: function (this: { entry?: Array<BundleEntry<T>> | undefined }) {\n return this.entry?.map((entry) => entry.resource).filter((entry): entry is T => entry !== undefined) ?? [];\n },\n };\n return bundle;\n}\n\nexport async function create<T extends FhirResource>(\n this: SDKResource,\n params: FhirCreateParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<T>> {\n const { resourceType } = params;\n return this.fhirRequest(`/${resourceType}`, 'POST')(params as unknown as Record<string, unknown>, request);\n}\n\nexport async function get<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirGetParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<T>> {\n return this.fhirRequest<T>(`/${resourceType}/${id}`, 'GET')({}, request);\n}\n\nexport async function update<T extends FhirResource>(\n this: SDKResource,\n params: FhirUpdateParams<T>,\n request?: OystehrFHIRUpdateClientRequest\n): Promise<FhirFetcherResponse<T>> {\n const { id, resourceType } = params;\n return this.fhirRequest(`/${resourceType}/${id}`, 'PUT')(params as unknown as Record<string, unknown>, {\n ...request,\n ifMatch: request?.optimisticLockingVersionId ? `W/\"${request.optimisticLockingVersionId}\"` : undefined,\n });\n}\n\nexport async function patch<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, operations }: FhirPatchParams<T>,\n request?: OystehrFHIRUpdateClientRequest\n): Promise<FhirFetcherResponse<T>> {\n return this.fhirRequest(`/${resourceType}/${id}`, 'PATCH')(operations, {\n ...request,\n contentType: 'application/json-patch+json',\n ifMatch: request?.optimisticLockingVersionId ? `W/\"${request.optimisticLockingVersionId}\"` : undefined,\n });\n}\n\nasync function del<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirDeleteParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<T>> {\n return this.fhirRequest(`/${resourceType}/${id}`, 'DELETE')({}, request);\n}\nexport { del as delete };\n\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id }: FhirHistorySearchParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>>>;\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, versionId }: FhirHistoryGetParams<T>,\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<T>>;\nexport async function history<T extends FhirResource>(\n this: SDKResource,\n { resourceType, id, versionId }: { resourceType: string; id: string; versionId?: string },\n request?: OystehrClientRequest\n): Promise<FhirFetcherResponse<Bundle<T>> | FhirFetcherResponse<T>> {\n return this.fhirRequest(`/${resourceType}/${id}/_history${versionId ? `/${versionId}` : ''}`, 'GET')({}, request);\n}\n\nfunction batchInputRequestToBundleEntryItem<T extends FhirResource>(\n request: BatchInputRequest<T>\n): BundleEntry<T | Binary<T>> {\n const { method, url } = request;\n const baseRequest = {\n request: {\n method,\n url,\n },\n };\n\n // Escape query string parameters in entry.request.url\n if (url.split('?').length > 1) {\n const [resource, query] = url.split('?');\n const params = query\n .split('&')\n .map((param) => {\n const [name, value] = param.split('=');\n return { name, value };\n })\n .reduce((acc, { name, value }) => {\n if (!name) {\n return acc;\n }\n if (!acc[name]) {\n acc[name] = [];\n }\n acc[name].push(value);\n return acc;\n }, {} as Record<string, string[]>);\n const search = new URLSearchParams();\n addParamsToSearch(params, search);\n baseRequest.request.url = `${resource}?${search.toString()}`;\n }\n\n // GET, DELETE, and HEAD require no further parameters\n if (['GET', 'DELETE', 'HEAD'].includes(method)) {\n return baseRequest as BundleEntry<T>;\n }\n\n // PUT updates require a full resource\n if (method === 'PUT') {\n const { resource } = request;\n return {\n request: {\n ...baseRequest.request,\n ifMatch: request.ifMatch,\n },\n resource: resource as T,\n } as BundleEntry<T>;\n }\n\n // PATCH can be Binary resource or JSON patch\n if (method === 'PATCH') {\n if ('resource' in request) {\n return {\n request: {\n ...baseRequest.request,\n ifMatch: request.ifMatch,\n },\n resource: request.resource,\n } as BundleEntry<Binary<T>>;\n }\n return {\n ...baseRequest,\n resource: {\n resourceType: 'Binary',\n contentType: 'application/json-patch+json',\n data: Buffer.from(JSON.stringify(request.operations), 'utf8').toString('base64'),\n },\n } as BundleEntry<Binary<T>>;\n }\n\n // POST creates require a full resource\n if (method === 'POST') {\n const { resource, fullUrl } = request;\n return {\n ...baseRequest,\n resource: resource as T,\n fullUrl,\n } as BundleEntry<T>;\n }\n\n // // Add ifMatch for the entries that support it\n // if ('ifMatch' in request) {\n // baseRequest.request = {\n // ...baseRequest.request,\n // ifMatch: request.ifMatch,\n // };\n // }\n\n throw new Error('Unrecognized method');\n}\n\nfunction bundleRequest(type: 'batch' | 'transaction') {\n return async function <BundleContentType extends FhirResource>(\n this: SDKResource,\n input: BatchInput<BundleContentType>,\n request?: OystehrClientRequest\n ): Promise<FhirFetcherResponse<Bundle<BundleContentType>>> {\n return this.fhirRequest('/', 'POST')(\n {\n resourceType: 'Bundle',\n type,\n entry: input.requests.map(batchInputRequestToBundleEntryItem),\n },\n request\n );\n };\n}\n\nexport const batch = bundleRequest('batch');\nexport const transaction = bundleRequest('transaction');\n\nexport function formatAddress(\n address: AddressR4B | AddressR5,\n options?: { all?: boolean; use?: boolean; lineSeparator?: string }\n): string {\n const builder = [];\n\n if (address.line) {\n builder.push(...address.line);\n }\n\n if (address.city || address.state || address.postalCode) {\n const cityStateZip = [];\n if (address.city) {\n cityStateZip.push(address.city);\n }\n if (address.state) {\n cityStateZip.push(address.state);\n }\n if (address.postalCode) {\n cityStateZip.push(address.postalCode);\n }\n builder.push(cityStateZip.join(', '));\n }\n\n if (address.use && (options?.all || options?.use)) {\n builder.push('[' + address.use + ']');\n }\n\n return builder.join(options?.lineSeparator || ', ').trim();\n}\n\nexport function formatHumanName(\n name: HumanNameR4B | HumanNameR5,\n options?: {\n all?: boolean;\n prefix?: boolean;\n suffix?: boolean;\n use?: boolean;\n }\n): string {\n const builder = [];\n\n if (name.prefix && options?.prefix !== false) {\n builder.push(...name.prefix);\n }\n\n if (name.given) {\n builder.push(...name.given);\n }\n\n if (name.family) {\n builder.push(name.family);\n }\n\n if (name.suffix && options?.suffix !== false) {\n builder.push(...name.suffix);\n }\n\n if (name.use && (options?.all || options?.use)) {\n builder.push('[' + name.use + ']');\n }\n\n return builder.join(' ').trim();\n}\n"],"names":["addParamsToSearch"],"mappings":";;;;AAoCA;;;;;;AAMG;AACI,eAAe,MAAM,CAE1B,MAA2B,EAC3B,OAA8B,EAAA;IAE9B,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;AACtD,IAAA,IAAI,QAAyD,CAAC;IAC9D,IAAI,YAAY,EAAE;AAChB,QAAA,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,KAAI;YACjE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;AACpB,gBAAA,GAAG,CAAC,KAAK,CAAC,IA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GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;KACpC;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAClC;;;;;;;;;;;;;;"}
@@ -61,7 +61,7 @@ class Lab extends client.SDKResource {
61
61
  return this.request('/canonical-questionnaire/lab/{labGuid}/compendium/{compendiumVersion}/item/{itemCode}/questionnaire', 'get', this.#baseUrlThunk.bind(this))(params, request);
62
62
  }
63
63
  /**
64
- * Submit a lab order. Oystehr's [Submit Lab](https://docs.oystehr.com/oystehr/services/lab/submit-an-order/) feature allows users to submit a well configured ServiceRequest to an external lab. In order to successfully submit an order, a [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#create-route) to and Organization representing that lab must exist.
64
+ * Submit a lab order. Oystehr's [Submit Lab](https://docs.oystehr.com/oystehr/services/lab/submit-an-order/) feature allows users to submit a well configured ServiceRequest to an external lab. In order to successfully submit an order, a [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#create-route) to and Organization representing that lab must exist. If the lab requires its own requisition document (eReq) or an Advance Beneficiary Notice (ABN), the appropriate DocumentReferences will be included in the response.
65
65
  *
66
66
  * Access Policy Requirements:
67
67
  * Action: `Lab:SubmitOrder`
@@ -1 +1 @@
1
- {"version":3,"file":"lab.cjs","sources":["../../../../src/resources/classes/lab.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n LabOrderableItemListParams,\n LabOrderableItemListResponse,\n LabOrderableItemQuestionnaireGetParams,\n LabOrderableItemQuestionnaireGetResponse,\n LabOrderSubmitParams,\n LabRouteCreateParams,\n LabRouteDeleteParams,\n LabRouteListResponse,\n OystehrClientRequest,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class Lab extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['labApiUrl'] ?? 'https://labs-api.zapehr.com/v1';\n }\n /**\n * Gets a list of Routes associated with the project. Returns an empty list if no Routes are found.\n *\n * Access Policy Requirements:\n * Action: `Lab:GetRoutes`\n * Access Policy Resource: `Lab:Route`\n */\n routeList(request?: OystehrClientRequest): Promise<LabRouteListResponse> {\n return this.request('/route', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Create a route. A Route represents that a lab and particular customer have a relationship, and a Route is necessary to submit an order to a lab. See [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#create-route) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:CreateRoute`\n * Access Policy Resource: `Lab:Route`\n */\n routeCreate(params: LabRouteCreateParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/route', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete a route. Deleting a Route will permanently remove the `routeGuid`. Orders can no longer be submitted to this lab until a new Route is created. See [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#delete-route) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:DeleteRoute`\n * Access Policy Resource: `Lab:Route`\n */\n routeDelete(params: LabRouteDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/route/{routeGuid}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Returns list of active orderable items for the latest compendium version. Page size is default 25 and max 100 items. See [orderable item Search](https://docs.oystehr.com/oystehr/services/lab/explore-the-compendium/#orderable-item-search) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:SearchOrderableItems`\n * Access Policy Resource: `Lab:OrderableItem`\n */\n orderableItemList(\n params: LabOrderableItemListParams,\n request?: OystehrClientRequest\n ): Promise<LabOrderableItemListResponse>;\n /**\n * Returns list of active orderable items for the latest compendium version. Page size is default 25 and max 100 items. See [orderable item Search](https://docs.oystehr.com/oystehr/services/lab/explore-the-compendium/#orderable-item-search) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:SearchOrderableItems`\n * Access Policy Resource: `Lab:OrderableItem`\n */\n orderableItemList(request?: OystehrClientRequest): Promise<LabOrderableItemListResponse>;\n /**\n * Returns list of active orderable items for the latest compendium version. Page size is default 25 and max 100 items. See [orderable item Search](https://docs.oystehr.com/oystehr/services/lab/explore-the-compendium/#orderable-item-search) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:SearchOrderableItems`\n * Access Policy Resource: `Lab:OrderableItem`\n */\n orderableItemList(\n params?: LabOrderableItemListParams | OystehrClientRequest,\n request?: OystehrClientRequest\n ): Promise<LabOrderableItemListResponse> {\n return this.request('/orderableItem', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Retrieve the AOE (Answer on Entry) Questionnaire for the given orderable item. The orderable item is defined by its labGuid, compendiumVersion, and itemCode. See [AOE](https://docs.oystehr.com/oystehr/services/lab/explore-the-compendium/#AOE) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:SearchOrderableItems`\n * Access Policy Resource: `Lab:OrderableItem`\n */\n orderableItemQuestionnaireGet(\n params: LabOrderableItemQuestionnaireGetParams,\n request?: OystehrClientRequest\n ): Promise<LabOrderableItemQuestionnaireGetResponse> {\n return this.request(\n '/canonical-questionnaire/lab/{labGuid}/compendium/{compendiumVersion}/item/{itemCode}/questionnaire',\n 'get',\n this.#baseUrlThunk.bind(this)\n )(params, request);\n }\n /**\n * Submit a lab order. Oystehr's [Submit Lab](https://docs.oystehr.com/oystehr/services/lab/submit-an-order/) feature allows users to submit a well configured ServiceRequest to an external lab. In order to successfully submit an order, a [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#create-route) to and Organization representing that lab must exist.\n *\n * Access Policy Requirements:\n * Action: `Lab:SubmitOrder`\n * Access Policy Resource: `Lab:Order`\n */\n orderSubmit(params: LabOrderSubmitParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/submit', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAgBM,MAA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,CAAC,IAAI,CAAC,CAC9B,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpB;AACD;;;;;;AAMG;IACH,WAAW,CAAC,MAA4B,EAAE,OAA8B,EAAA;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACxF;AACF;;;;"}
1
+ {"version":3,"file":"lab.cjs","sources":["../../../../src/resources/classes/lab.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n LabOrderableItemListParams,\n LabOrderableItemListResponse,\n LabOrderableItemQuestionnaireGetParams,\n LabOrderableItemQuestionnaireGetResponse,\n LabOrderSubmitParams,\n LabOrderSubmitResponse,\n LabRouteCreateParams,\n LabRouteCreateResponse,\n LabRouteDeleteParams,\n LabRouteListResponse,\n OystehrClientRequest,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class Lab extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['labApiUrl'] ?? 'https://labs-api.zapehr.com/v1';\n }\n /**\n * Gets a list of Routes associated with the project. Returns an empty list if no Routes are found.\n *\n * Access Policy Requirements:\n * Action: `Lab:GetRoutes`\n * Access Policy Resource: `Lab:Route`\n */\n routeList(request?: OystehrClientRequest): Promise<LabRouteListResponse> {\n return this.request('/route', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Create a route. A Route represents that a lab and particular customer have a relationship, and a Route is necessary to submit an order to a lab. See [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#create-route) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:CreateRoute`\n * Access Policy Resource: `Lab:Route`\n */\n routeCreate(params: LabRouteCreateParams, request?: OystehrClientRequest): Promise<LabRouteCreateResponse> {\n return this.request('/route', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete a route. Deleting a Route will permanently remove the `routeGuid`. Orders can no longer be submitted to this lab until a new Route is created. See [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#delete-route) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:DeleteRoute`\n * Access Policy Resource: `Lab:Route`\n */\n routeDelete(params: LabRouteDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/route/{routeGuid}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Returns list of active orderable items for the latest compendium version. Page size is default 25 and max 100 items. See [orderable item Search](https://docs.oystehr.com/oystehr/services/lab/explore-the-compendium/#orderable-item-search) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:SearchOrderableItems`\n * Access Policy Resource: `Lab:OrderableItem`\n */\n orderableItemList(\n params: LabOrderableItemListParams,\n request?: OystehrClientRequest\n ): Promise<LabOrderableItemListResponse>;\n /**\n * Returns list of active orderable items for the latest compendium version. Page size is default 25 and max 100 items. See [orderable item Search](https://docs.oystehr.com/oystehr/services/lab/explore-the-compendium/#orderable-item-search) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:SearchOrderableItems`\n * Access Policy Resource: `Lab:OrderableItem`\n */\n orderableItemList(request?: OystehrClientRequest): Promise<LabOrderableItemListResponse>;\n /**\n * Returns list of active orderable items for the latest compendium version. Page size is default 25 and max 100 items. See [orderable item Search](https://docs.oystehr.com/oystehr/services/lab/explore-the-compendium/#orderable-item-search) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:SearchOrderableItems`\n * Access Policy Resource: `Lab:OrderableItem`\n */\n orderableItemList(\n params?: LabOrderableItemListParams | OystehrClientRequest,\n request?: OystehrClientRequest\n ): Promise<LabOrderableItemListResponse> {\n return this.request('/orderableItem', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Retrieve the AOE (Answer on Entry) Questionnaire for the given orderable item. The orderable item is defined by its labGuid, compendiumVersion, and itemCode. See [AOE](https://docs.oystehr.com/oystehr/services/lab/explore-the-compendium/#AOE) for more details.\n *\n * Access Policy Requirements:\n * Action: `Lab:SearchOrderableItems`\n * Access Policy Resource: `Lab:OrderableItem`\n */\n orderableItemQuestionnaireGet(\n params: LabOrderableItemQuestionnaireGetParams,\n request?: OystehrClientRequest\n ): Promise<LabOrderableItemQuestionnaireGetResponse> {\n return this.request(\n '/canonical-questionnaire/lab/{labGuid}/compendium/{compendiumVersion}/item/{itemCode}/questionnaire',\n 'get',\n this.#baseUrlThunk.bind(this)\n )(params, request);\n }\n /**\n * Submit a lab order. Oystehr's [Submit Lab](https://docs.oystehr.com/oystehr/services/lab/submit-an-order/) feature allows users to submit a well configured ServiceRequest to an external lab. In order to successfully submit an order, a [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#create-route) to and Organization representing that lab must exist. If the lab requires its own requisition document (eReq) or an Advance Beneficiary Notice (ABN), the appropriate DocumentReferences will be included in the response.\n *\n * Access Policy Requirements:\n * Action: `Lab:SubmitOrder`\n * Access Policy Resource: `Lab:Order`\n */\n orderSubmit(params: LabOrderSubmitParams, request?: OystehrClientRequest): Promise<LabOrderSubmitResponse> {\n return this.request('/submit', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAkBM,MAAO,GAAI,SAAQA,kBAAW,CAAA;AAClC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,gCAAgC,CAAC;KAChF;AACD;;;;;;AAMG;AACH,IAAA,SAAS,CAAC,OAA8B,EAAA;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CA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ableItemQuestionnaireGetResponse, LabOrderSubmitParams, LabRouteCreateParams, LabRouteDeleteParams, LabRouteListResponse, OystehrClientRequest } from '../..';
1
+ import { LabOrderableItemListParams, LabOrderableItemListResponse, LabOrderableItemQuestionnaireGetParams, LabOrderableItemQuestionnaireGetResponse, LabOrderSubmitParams, LabOrderSubmitResponse, LabRouteCreateParams, LabRouteCreateResponse, LabRouteDeleteParams, LabRouteListResponse, OystehrClientRequest } from '../..';
2
2
  import { SDKResource } from '../../client/client';
3
3
  import { OystehrConfig } from '../../config';
4
4
  export declare class Lab extends SDKResource {
@@ -19,7 +19,7 @@ export declare class Lab extends SDKResource {
19
19
  * Action: `Lab:CreateRoute`
20
20
  * Access Policy Resource: `Lab:Route`
21
21
  */
22
- routeCreate(params: LabRouteCreateParams, request?: OystehrClientRequest): Promise<void>;
22
+ routeCreate(params: LabRouteCreateParams, request?: OystehrClientRequest): Promise<LabRouteCreateResponse>;
23
23
  /**
24
24
  * Delete a route. Deleting a Route will permanently remove the `routeGuid`. Orders can no longer be submitted to this lab until a new Route is created. See [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#delete-route) for more details.
25
25
  *
@@ -53,11 +53,11 @@ export declare class Lab extends SDKResource {
53
53
  */
54
54
  orderableItemQuestionnaireGet(params: LabOrderableItemQuestionnaireGetParams, request?: OystehrClientRequest): Promise<LabOrderableItemQuestionnaireGetResponse>;
55
55
  /**
56
- * Submit a lab order. Oystehr's [Submit Lab](https://docs.oystehr.com/oystehr/services/lab/submit-an-order/) feature allows users to submit a well configured ServiceRequest to an external lab. In order to successfully submit an order, a [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#create-route) to and Organization representing that lab must exist.
56
+ * Submit a lab order. Oystehr's [Submit Lab](https://docs.oystehr.com/oystehr/services/lab/submit-an-order/) feature allows users to submit a well configured ServiceRequest to an external lab. In order to successfully submit an order, a [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#create-route) to and Organization representing that lab must exist. If the lab requires its own requisition document (eReq) or an Advance Beneficiary Notice (ABN), the appropriate DocumentReferences will be included in the response.
57
57
  *
58
58
  * Access Policy Requirements:
59
59
  * Action: `Lab:SubmitOrder`
60
60
  * Access Policy Resource: `Lab:Order`
61
61
  */
62
- orderSubmit(params: LabOrderSubmitParams, request?: OystehrClientRequest): Promise<void>;
62
+ orderSubmit(params: LabOrderSubmitParams, request?: OystehrClientRequest): Promise<LabOrderSubmitResponse>;
63
63
  }
@@ -30,6 +30,15 @@ class M2m extends client.SDKResource {
30
30
  create(params, request) {
31
31
  return this.request('/m2m', 'post', this.#baseUrlThunk.bind(this))(params, request);
32
32
  }
33
+ /**
34
+ * Get information about the calling M2M Client [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
35
+ *
36
+ * Access Policy Action: `App:GetM2MClient`
37
+ * Access Policy Resource: `IAM:M2MClient`
38
+ */
39
+ me(request) {
40
+ return this.request('/m2m/me', 'get', this.#baseUrlThunk.bind(this))(request);
41
+ }
33
42
  /**
34
43
  * Get the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
35
44
  *
@@ -1 +1 @@
1
- {"version":3,"file":"m2m.cjs","sources":["../../../../src/resources/classes/m2m.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n M2mCreateParams,\n M2mCreateResponse,\n M2mDeleteParams,\n M2mGetParams,\n M2mGetResponse,\n M2mListResponse,\n M2mListV2Params,\n M2mListV2Response,\n M2mRotateSecretParams,\n M2mRotateSecretResponse,\n M2mUpdateParams,\n M2mUpdateResponse,\n OystehrClientRequest,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class M2m extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n /**\n * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_m2m-v2-list) instead.\n *\n * Get a list of all M2M Clients. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n list(request?: OystehrClientRequest): Promise<M2mListResponse> {\n return this.request('/m2m', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Create a new M2M Client. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:CreateM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n create(params: M2mCreateParams, request?: OystehrClientRequest): Promise<M2mCreateResponse> {\n return this.request('/m2m', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Get the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:GetM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n get(params: M2mGetParams, request?: OystehrClientRequest): Promise<M2mGetResponse> {\n return this.request('/m2m/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Update the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:UpdateM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n update(params: M2mUpdateParams, request?: OystehrClientRequest): Promise<M2mUpdateResponse> {\n return this.request('/m2m/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:DeleteM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n delete(params: M2mDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/m2m/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Rotate the client secret for the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:RotateM2MClientSecret`\n * Access Policy Resource: `IAM:M2MClient`\n */\n rotateSecret(params: M2mRotateSecretParams, request?: OystehrClientRequest): Promise<M2mRotateSecretResponse> {\n return this.request('/m2m/{id}/rotate-secret', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Get M2M clients in the Project with pagination, sort, sort order and filtering. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n listV2(params: M2mListV2Params, request?: OystehrClientRequest): Promise<M2mListV2Response>;\n /**\n * Get M2M clients in the Project with pagination, sort, sort order and filtering. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n listV2(request?: OystehrClientRequest): Promise<M2mListV2Response>;\n /**\n * Get M2M clients in the Project with pagination, sort, sort order and filtering. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n listV2(params?: M2mListV2Params | OystehrClientRequest, request?: OystehrClientRequest): Promise<M2mListV2Response> {\n return this.request('/m2m/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAoBM,MAAO,GAAI,SAAQA,kBAAW,CAAA;AAClC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,mCAAmC,CAAC;KACvF;AACD;;;;;;;AAOG;AACH,IAAA,IAAI,CAAC,OAA8B,EAAA;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAC5E;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAuB,EAAE,OAA8B,EAAA;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACrF;AACD;;;;;AAKG;IACH,GAAG,CAAC,MAAoB,EAAE,OAA8B,EAAA;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACzF;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAuB,EAAE,OAA8B,EAAA;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC3F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAuB,EAAE,OAA8B,EAAA;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5F;AACD;;;;;AAKG;IACH,YAAY,CAAC,MAA6B,EAAE,OAA8B,EAAA;QACxE,OAAO,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACxG;AAeD;;;;;AAKG;IACH,MAAM,CAAC,MAA+C,EAAE,OAA8B,EAAA;QACpF,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5F;AACF;;;;"}
1
+ {"version":3,"file":"m2m.cjs","sources":["../../../../src/resources/classes/m2m.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n M2mCreateParams,\n M2mCreateResponse,\n M2mDeleteParams,\n M2mGetParams,\n M2mGetResponse,\n M2mListResponse,\n M2mListV2Params,\n M2mListV2Response,\n M2mMeResponse,\n M2mRotateSecretParams,\n M2mRotateSecretResponse,\n M2mUpdateParams,\n M2mUpdateResponse,\n OystehrClientRequest,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class M2m extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n /**\n * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_m2m-v2-list) instead.\n *\n * Get a list of all M2M Clients. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n list(request?: OystehrClientRequest): Promise<M2mListResponse> {\n return this.request('/m2m', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Create a new M2M Client. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:CreateM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n create(params: M2mCreateParams, request?: OystehrClientRequest): Promise<M2mCreateResponse> {\n return this.request('/m2m', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Get information about the calling M2M Client [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:GetM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n me(request?: OystehrClientRequest): Promise<M2mMeResponse> {\n return this.request('/m2m/me', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Get the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:GetM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n get(params: M2mGetParams, request?: OystehrClientRequest): Promise<M2mGetResponse> {\n return this.request('/m2m/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Update the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:UpdateM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n update(params: M2mUpdateParams, request?: OystehrClientRequest): Promise<M2mUpdateResponse> {\n return this.request('/m2m/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:DeleteM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n delete(params: M2mDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/m2m/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Rotate the client secret for the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:RotateM2MClientSecret`\n * Access Policy Resource: `IAM:M2MClient`\n */\n rotateSecret(params: M2mRotateSecretParams, request?: OystehrClientRequest): Promise<M2mRotateSecretResponse> {\n return this.request('/m2m/{id}/rotate-secret', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Get M2M clients in the Project with pagination, sort, sort order and filtering. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n listV2(params: M2mListV2Params, request?: OystehrClientRequest): Promise<M2mListV2Response>;\n /**\n * Get M2M clients in the Project with pagination, sort, sort order and filtering. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n listV2(request?: OystehrClientRequest): Promise<M2mListV2Response>;\n /**\n * Get M2M clients in the Project with pagination, sort, sort order and filtering. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n listV2(params?: M2mListV2Params | OystehrClientRequest, request?: OystehrClientRequest): Promise<M2mListV2Response> {\n return this.request('/m2m/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAqBM,MAAO,GAAI,SAAQA,kBAAW,CAAA;AAClC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,mCAAmC,CAAC;KACvF;AACD;;;;;;;AAOG;AACH,IAAA,IAAI,CAAC,OAA8B,EAAA;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAC5E;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAuB,EAAE,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;KACxG;AAeD;;;;;AAKG;IACH,MAAM,CAAC,MAA+C,EAAE,OAA8B,EAAA;QACpF,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5F;AACF;;;;"}
@@ -1,4 +1,4 @@
1
- import { M2mCreateParams, M2mCreateResponse, M2mDeleteParams, M2mGetParams, M2mGetResponse, M2mListResponse, M2mListV2Params, M2mListV2Response, M2mRotateSecretParams, M2mRotateSecretResponse, M2mUpdateParams, M2mUpdateResponse, OystehrClientRequest } from '../..';
1
+ import { M2mCreateParams, M2mCreateResponse, M2mDeleteParams, M2mGetParams, M2mGetResponse, M2mListResponse, M2mListV2Params, M2mListV2Response, M2mMeResponse, M2mRotateSecretParams, M2mRotateSecretResponse, M2mUpdateParams, M2mUpdateResponse, OystehrClientRequest } from '../..';
2
2
  import { SDKResource } from '../../client/client';
3
3
  import { OystehrConfig } from '../../config';
4
4
  export declare class M2m extends SDKResource {
@@ -20,6 +20,13 @@ export declare class M2m extends SDKResource {
20
20
  * Access Policy Resource: `IAM:M2MClient`
21
21
  */
22
22
  create(params: M2mCreateParams, request?: OystehrClientRequest): Promise<M2mCreateResponse>;
23
+ /**
24
+ * Get information about the calling M2M Client [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
25
+ *
26
+ * Access Policy Action: `App:GetM2MClient`
27
+ * Access Policy Resource: `IAM:M2MClient`
28
+ */
29
+ me(request?: OystehrClientRequest): Promise<M2mMeResponse>;
23
30
  /**
24
31
  * Get the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
25
32
  *
@@ -45,6 +45,15 @@ class User extends client.SDKResource {
45
45
  delete(params, request) {
46
46
  return this.request('/user/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
47
47
  }
48
+ /**
49
+ * Reset MFA for the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
50
+ *
51
+ * Access Policy Action: `App:ResetUserMFA`
52
+ * Access Policy Resource: `App:User`
53
+ */
54
+ resetMfa(params, request) {
55
+ return this.request('/user/{id}/reset-mfa', 'post', this.#baseUrlThunk.bind(this))(params, request);
56
+ }
48
57
  /**
49
58
  * Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
50
59
  *
@@ -1 +1 @@
1
- {"version":3,"file":"user.cjs","sources":["../../../../src/resources/classes/user.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n UserDeleteParams,\n UserGetParams,\n UserGetResponse,\n UserInviteParams,\n UserInviteResponse,\n UserListResponse,\n UserListV2Params,\n UserListV2Response,\n UserMeResponse,\n UserUpdateParams,\n UserUpdateResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class User extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n /**\n * Get your own User details. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.\n */\n me(request?: OystehrClientRequest): Promise<UserMeResponse> {\n return this.request('/user/me', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Get the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:GetUser`\n * Access Policy Resource: `App:User`\n */\n get(params: UserGetParams, request?: OystehrClientRequest): Promise<UserGetResponse> {\n return this.request('/user/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Update the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:UpdateUser`\n * Access Policy Resource: `App:User`\n */\n update(params: UserUpdateParams, request?: OystehrClientRequest): Promise<UserUpdateResponse> {\n return this.request('/user/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:DeleteUser`\n * Access Policy Resource: `App:User`\n */\n delete(params: UserDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/user/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:CreateUser`\n * Access Policy Resource: `App:User`\n */\n invite(params: UserInviteParams, request?: OystehrClientRequest): Promise<UserInviteResponse> {\n return this.request('/user/invite', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.\n *\n * Get all Users in the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:ListAllUsers`\n * Access Policy Resource: `App:User`\n */\n list(request?: OystehrClientRequest): Promise<UserListResponse> {\n return this.request('/user', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(params: UserListV2Params, request?: OystehrClientRequest): Promise<UserListV2Response>;\n /**\n * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(request?: OystehrClientRequest): Promise<UserListV2Response>;\n /**\n * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(\n params?: UserListV2Params | OystehrClientRequest,\n request?: OystehrClientRequest\n ): Promise<UserListV2Response> {\n return this.request('/user/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAmBM,MAAO,IAAK,SAAQA,kBAAW,CAAA;AACnC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAA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a,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAC7E;AAeD;;;;;AAKG;IACH,MAAM,CACJ,MAAgD,EAChD,OAA8B,EAAA;QAE9B,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7F;AACF;;;;"}
1
+ {"version":3,"file":"user.cjs","sources":["../../../../src/resources/classes/user.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n UserDeleteParams,\n UserGetParams,\n UserGetResponse,\n UserInviteParams,\n UserInviteResponse,\n UserListResponse,\n UserListV2Params,\n UserListV2Response,\n UserMeResponse,\n UserResetMfaParams,\n UserUpdateParams,\n UserUpdateResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class User extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n /**\n * Get your own User details. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.\n */\n me(request?: OystehrClientRequest): Promise<UserMeResponse> {\n return this.request('/user/me', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Get the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:GetUser`\n * Access Policy Resource: `App:User`\n */\n get(params: UserGetParams, request?: OystehrClientRequest): Promise<UserGetResponse> {\n return this.request('/user/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Update the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:UpdateUser`\n * Access Policy Resource: `App:User`\n */\n update(params: UserUpdateParams, request?: OystehrClientRequest): Promise<UserUpdateResponse> {\n return this.request('/user/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:DeleteUser`\n * Access Policy Resource: `App:User`\n */\n delete(params: UserDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/user/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Reset MFA for the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:ResetUserMFA`\n * Access Policy Resource: `App:User`\n */\n resetMfa(params: UserResetMfaParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/user/{id}/reset-mfa', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:CreateUser`\n * Access Policy Resource: `App:User`\n */\n invite(params: UserInviteParams, request?: OystehrClientRequest): Promise<UserInviteResponse> {\n return this.request('/user/invite', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.\n *\n * Get all Users in the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:ListAllUsers`\n * Access Policy Resource: `App:User`\n */\n list(request?: OystehrClientRequest): Promise<UserListResponse> {\n return this.request('/user', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(params: UserListV2Params, request?: OystehrClientRequest): Promise<UserListV2Response>;\n /**\n * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(request?: OystehrClientRequest): Promise<UserListV2Response>;\n /**\n * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(\n params?: UserListV2Params | OystehrClientRequest,\n request?: OystehrClientRequest\n ): Promise<UserListV2Response> {\n return this.request('/user/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAoBM,MAAO,IAAK,SAAQA,kBAAW,CAAA;AACnC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;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,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7F;AACD;;;;;;;AAOG;AACH,IAAA,IAAI,CAAC,OAA8B,EAAA;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAC7E;AAeD;;;;;AAKG;IACH,MAAM,CACJ,MAAgD,EAChD,OAA8B,EAAA;QAE9B,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7F;AACF;;;;"}
@@ -1,4 +1,4 @@
1
- import { OystehrClientRequest, UserDeleteParams, UserGetParams, UserGetResponse, UserInviteParams, UserInviteResponse, UserListResponse, UserListV2Params, UserListV2Response, UserMeResponse, UserUpdateParams, UserUpdateResponse } from '../..';
1
+ import { OystehrClientRequest, UserDeleteParams, UserGetParams, UserGetResponse, UserInviteParams, UserInviteResponse, UserListResponse, UserListV2Params, UserListV2Response, UserMeResponse, UserResetMfaParams, UserUpdateParams, UserUpdateResponse } from '../..';
2
2
  import { SDKResource } from '../../client/client';
3
3
  import { OystehrConfig } from '../../config';
4
4
  export declare class User extends SDKResource {
@@ -31,6 +31,13 @@ export declare class User extends SDKResource {
31
31
  * Access Policy Resource: `App:User`
32
32
  */
33
33
  delete(params: UserDeleteParams, request?: OystehrClientRequest): Promise<void>;
34
+ /**
35
+ * Reset MFA for the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
36
+ *
37
+ * Access Policy Action: `App:ResetUserMFA`
38
+ * Access Policy Resource: `App:User`
39
+ */
40
+ resetMfa(params: UserResetMfaParams, request?: OystehrClientRequest): Promise<void>;
34
41
  /**
35
42
  * Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
36
43
  *
@@ -22,4 +22,8 @@ export interface ErxCheckPractitionerEnrollmentResponse {
22
22
  * Whether the practitioner has enrolled in two-factor authentication with the upstream eRx provider.
23
23
  */
24
24
  twoFactorEnrolled: boolean;
25
+ /**
26
+ * Whether the practitioner is enrolled as a prescribing practitioner.
27
+ */
28
+ isPrescribing: boolean;
25
29
  }
@@ -1,3 +1,4 @@
1
1
  export interface ErxEnrollPractitionerParams {
2
2
  practitionerId: string;
3
+ isPrescribing?: boolean;
3
4
  }
@@ -5,17 +5,21 @@ export type ErxSearchAllergensResponse = {
5
5
  /**
6
6
  * The identifier for the allergen.
7
7
  */
8
- id?: number;
8
+ id: number;
9
9
  /**
10
10
  * Human readable name of allergen.
11
11
  */
12
- name?: string;
12
+ name: string;
13
+ /**
14
+ * Brand name of the allergen, if applicable.
15
+ */
16
+ brandName?: string;
13
17
  /**
14
18
  * Type of allergen.
15
19
  */
16
- type?: 'AllergenClass' | 'FoodAndEnvironmentalAllergens' | 'NoKnownAllergy' | 'RoutedDoseFormDrugs' | 'ScreenableIngredient';
20
+ type: 'AllergenClass' | 'FoodAndEnvironmentalAllergens' | 'NoKnownAllergy' | 'RoutedDoseFormDrugs' | 'ScreenableIngredient';
17
21
  /**
18
22
  * Category of allergen.
19
23
  */
20
- category?: 'CommonAllergens' | 'UncommonAllergens' | 'OtherBrandDrugs';
24
+ category: 'CommonAllergens' | 'UncommonAllergens' | 'OtherBrandDrugs';
21
25
  }[];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Fax number onboarded successfully.
3
+ */
4
+ export interface FaxOnboardResponse {
5
+ /**
6
+ * The fax number that was purchased and assigned to your project in E.164 format.
7
+ */
8
+ faxNumber: string;
9
+ }
@@ -0,0 +1,14 @@
1
+ import { DocumentReference } from 'fhir/r4b';
2
+ /**
3
+ * Order submitted successfully. eReq and ABN may be available
4
+ */
5
+ export interface LabOrderSubmitResponse {
6
+ /**
7
+ * Lab generated electronic requisition document (eReq). To be sent with samples.
8
+ */
9
+ eRequisitionDocumentReference?: DocumentReference;
10
+ /**
11
+ * Advance Beneficiary Notice (ABN). To be signed by patient.
12
+ */
13
+ abnDocumentReference?: DocumentReference;
14
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Route created successfully.
3
+ */
4
+ export interface LabRouteCreateResponse {
5
+ /**
6
+ * Unique identifier of the created Route.
7
+ */
8
+ routeGuid: string;
9
+ }
@@ -1,4 +1,12 @@
1
1
  export interface LabRouteDeleteParams {
2
2
  primaryId?: string;
3
+ /**
4
+ * Provided by the lab, indicates a financial relationship between the lab and the customer.
5
+ */
6
+ accountNumber: string;
7
+ /**
8
+ * Unique identifier of a lab. Searchable via orderable item Search.
9
+ */
10
+ labGuid: string;
3
11
  routeGuid: string;
4
12
  }
@@ -0,0 +1,5 @@
1
+ import { M2m } from './M2m';
2
+ /**
3
+ * M2M Client
4
+ */
5
+ export type M2mMeResponse = M2m;
@@ -17,5 +17,9 @@ export interface M2mUpdateParams {
17
17
  * An URL of JWK set used for getting an access token by signed authentication JWT
18
18
  */
19
19
  jwksUrl?: string;
20
+ /**
21
+ * A relative reference to a FHIR relative reference of the format Patient/{uuidV4}. Resource type must be one of Patient, Practitioner, Device.
22
+ */
23
+ profile?: string;
20
24
  id: string;
21
25
  }
@@ -0,0 +1,3 @@
1
+ export interface UserResetMfaParams {
2
+ id: string;
3
+ }
@@ -2,8 +2,12 @@ import { AccessPolicy } from './AccessPolicy';
2
2
  export interface UserUpdateParams {
3
3
  accessPolicy?: AccessPolicy;
4
4
  /**
5
- * A list of Role IDs to assign to the user. If the accessPolicy property is not provided this property is required and may not be empty.
5
+ * A list of Role IDs to assign to the user.
6
6
  */
7
7
  roles?: string[];
8
+ /**
9
+ * A FHIR relative reference of the format Patient/{uuidV4}. Resource type must be one of Patient, Practitioner, Device.
10
+ */
11
+ profile?: string;
8
12
  id: string;
9
13
  }
@@ -10,9 +10,9 @@ export interface ZambdaCreateParams {
10
10
  triggerMethod?: 'http_auth' | 'http_open' | 'subscription' | 'cron';
11
11
  schedule?: ZambdaSchedule;
12
12
  /**
13
- * The runtime to use for the Zambda Function. This property is optional and defaults to "nodejs20.x".
13
+ * The runtime to use for the Zambda Function.
14
14
  */
15
- runtime?: 'nodejs18.x' | 'nodejs20.x' | 'nodejs22.x' | 'python3.13' | 'python3.12' | 'java21' | 'dotnet9' | 'ruby3.3';
15
+ runtime: 'nodejs18.x' | 'nodejs20.x' | 'nodejs22.x' | 'python3.13' | 'python3.12' | 'java21' | 'dotnet9' | 'ruby3.3';
16
16
  /**
17
17
  * The amount of memory in MB to allocate to the Zambda Function. If not specified, a system default (1024MB) will be used. Min: 128MB, Max: 10240MB.
18
18
  */
@@ -21,4 +21,8 @@ export interface ZambdaCreateParams {
21
21
  * The timeout for the Zambda Function in seconds. If not specified, a system default (27 seconds) will be used. Min: 1s, Max: 900s (15 minutes). Note: For 'http_auth' and 'http_open' trigger methods, the timeout cannot exceed 27 seconds due to API Gateway limitations.
22
22
  */
23
23
  timeoutInSeconds?: number;
24
+ /**
25
+ * The ID of the IAM role that the Zambda Function will assume when it is invoked.
26
+ */
27
+ executionRoleId?: string;
24
28
  }
@@ -8,7 +8,7 @@ export interface ZambdaFunction {
8
8
  /**
9
9
  * The runtime of the Zambda Function.
10
10
  */
11
- runtime?: string;
11
+ runtime: string;
12
12
  /**
13
13
  * The Zambda Function status provides information about the Functions state including whether it is ready to be invoked.
14
14
  */
@@ -43,4 +43,8 @@ export interface ZambdaFunction {
43
43
  * The timeout for the Zambda Function in seconds. If not specified, a system default (27 seconds) will be used. Min: 1s, Max: 900s (15 minutes). Note: For 'http_auth' and 'http_open' trigger methods, the timeout cannot exceed 27 seconds due to API Gateway limitations.
44
44
  */
45
45
  timeoutInSeconds?: number;
46
+ /**
47
+ * The ID of the IAM role that the Zambda Function will assume when it is invoked.
48
+ */
49
+ executionRoleId?: string;
46
50
  }
@@ -10,7 +10,7 @@ export interface ZambdaUpdateParams {
10
10
  triggerMethod?: 'http_auth' | 'http_open' | 'subscription' | 'cron';
11
11
  schedule?: ZambdaSchedule;
12
12
  /**
13
- * The runtime to use for the Zambda Function. This property is optional and defaults to "nodejs20.x".
13
+ * The runtime to use for the Zambda Function.
14
14
  */
15
15
  runtime?: 'nodejs18.x' | 'nodejs20.x' | 'nodejs22.x' | 'python3.13' | 'python3.12' | 'java21' | 'dotnet9' | 'ruby3.3';
16
16
  /**
@@ -21,5 +21,9 @@ export interface ZambdaUpdateParams {
21
21
  * The timeout for the Zambda Function in seconds. If not specified, a system default (27 seconds) will be used. Min: 1s, Max: 900s (15 minutes). Note: For 'http_auth' and 'http_open' trigger methods, the timeout cannot exceed 27 seconds due to API Gateway limitations.
22
22
  */
23
23
  timeoutInSeconds?: number;
24
+ /**
25
+ * The ID of the IAM role that the Zambda Function will assume when it is invoked.
26
+ */
27
+ executionRoleId?: string;
24
28
  id: string;
25
29
  }