@medplum/mock 2.0.1 → 2.0.2
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.
- package/dist/cjs/index.cjs +11 -14
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.min.cjs +1 -1
- package/dist/cjs/index.min.cjs.map +1 -1
- package/dist/cjs/repo.d.ts +1 -1
- package/dist/esm/index.min.mjs +1 -1
- package/dist/esm/index.min.mjs.map +1 -1
- package/dist/esm/index.mjs +8 -11
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/repo.d.ts +1 -1
- package/dist/types/repo.d.ts +1 -1
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@medplum/core'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@medplum/core', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.medplum = global.medplum || {}, global.medplum.mock = {}), global.medplum.core, global
|
|
5
|
-
})(this, (function (exports, core,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@medplum/core'), require('rfc6902')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@medplum/core', 'rfc6902'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.medplum = global.medplum || {}, global.medplum.mock = {}), global.medplum.core, global.rfc6902));
|
|
5
|
+
})(this, (function (exports, core, rfc6902) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const ExampleAccessPolicy = {
|
|
8
8
|
resourceType: 'AccessPolicy',
|
|
@@ -16595,17 +16595,14 @@
|
|
|
16595
16595
|
}
|
|
16596
16596
|
async patchResource(resourceType, id, patch) {
|
|
16597
16597
|
const resource = this.readResource(resourceType, id);
|
|
16598
|
-
|
|
16599
|
-
|
|
16600
|
-
|
|
16601
|
-
|
|
16602
|
-
|
|
16603
|
-
|
|
16604
|
-
const message = patchError.message?.split('\n')?.[0] || 'JSONPatch error';
|
|
16605
|
-
throw core.badRequest(message);
|
|
16598
|
+
const patchErrors = rfc6902.applyPatch(resource, patch);
|
|
16599
|
+
for (const error of patchErrors) {
|
|
16600
|
+
if (error) {
|
|
16601
|
+
const message = error.message?.split('\n')?.[0] || 'JSONPatch error';
|
|
16602
|
+
throw core.badRequest(message);
|
|
16603
|
+
}
|
|
16606
16604
|
}
|
|
16607
|
-
|
|
16608
|
-
return this.updateResource(patchedResource);
|
|
16605
|
+
return this.updateResource(resource);
|
|
16609
16606
|
}
|
|
16610
16607
|
readResource(resourceType, id) {
|
|
16611
16608
|
const resource = __classPrivateFieldGet(this, _MemoryRepository_resources, "f")?.[resourceType]?.[id];
|