@openhi/constructs 0.0.108 → 0.0.109

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 (33) hide show
  1. package/lib/chunk-2TPJ6HOF.mjs +289 -0
  2. package/lib/chunk-2TPJ6HOF.mjs.map +1 -0
  3. package/lib/{chunk-EST32BJ2.mjs → chunk-7FUAMZOF.mjs} +2 -2
  4. package/lib/{chunk-L3QHWDHB.mjs → chunk-7Q2IJ2J5.mjs} +4 -4
  5. package/lib/{chunk-ZGOHB4RA.mjs → chunk-BB5MK4L3.mjs} +2 -2
  6. package/lib/{chunk-LKG3I536.mjs → chunk-IS4VQRI4.mjs} +8 -1
  7. package/lib/chunk-IS4VQRI4.mjs.map +1 -0
  8. package/lib/{chunk-WWGJZNXJ.mjs → chunk-MULKGFIJ.mjs} +2 -2
  9. package/lib/index.mjs +4 -4
  10. package/lib/pre-token-generation.handler.js +17 -14
  11. package/lib/pre-token-generation.handler.js.map +1 -1
  12. package/lib/pre-token-generation.handler.mjs +3 -4
  13. package/lib/pre-token-generation.handler.mjs.map +1 -1
  14. package/lib/provision-default-workspace.handler.js +17 -14
  15. package/lib/provision-default-workspace.handler.js.map +1 -1
  16. package/lib/provision-default-workspace.handler.mjs +3 -4
  17. package/lib/provision-default-workspace.handler.mjs.map +1 -1
  18. package/lib/rest-api-lambda.handler.js +1504 -1156
  19. package/lib/rest-api-lambda.handler.js.map +1 -1
  20. package/lib/rest-api-lambda.handler.mjs +1341 -1153
  21. package/lib/rest-api-lambda.handler.mjs.map +1 -1
  22. package/lib/seed-demo-data.handler.js.map +1 -1
  23. package/lib/seed-demo-data.handler.mjs +4 -4
  24. package/package.json +2 -2
  25. package/lib/chunk-6J7NQ6A4.mjs +0 -45
  26. package/lib/chunk-6J7NQ6A4.mjs.map +0 -1
  27. package/lib/chunk-GT7SFZLP.mjs +0 -126
  28. package/lib/chunk-GT7SFZLP.mjs.map +0 -1
  29. package/lib/chunk-LKG3I536.mjs.map +0 -1
  30. /package/lib/{chunk-EST32BJ2.mjs.map → chunk-7FUAMZOF.mjs.map} +0 -0
  31. /package/lib/{chunk-L3QHWDHB.mjs.map → chunk-7Q2IJ2J5.mjs.map} +0 -0
  32. /package/lib/{chunk-ZGOHB4RA.mjs.map → chunk-BB5MK4L3.mjs.map} +0 -0
  33. /package/lib/{chunk-WWGJZNXJ.mjs.map → chunk-MULKGFIJ.mjs.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  ValidationError,
4
4
  createDataEntityRecord,
5
5
  getDynamoDataService
6
- } from "./chunk-LKG3I536.mjs";
6
+ } from "./chunk-IS4VQRI4.mjs";
7
7
  import {
8
8
  getDynamoControlService
9
9
  } from "./chunk-QR5JVSCF.mjs";
@@ -175,4 +175,4 @@ export {
175
175
  createTenantOperation,
176
176
  createWorkspaceOperation
177
177
  };
178
- //# sourceMappingURL=chunk-WWGJZNXJ.mjs.map
178
+ //# sourceMappingURL=chunk-MULKGFIJ.mjs.map
package/lib/index.mjs CHANGED
@@ -29,14 +29,14 @@ import {
29
29
  import_workflows,
30
30
  openhiResourceIdentifier,
31
31
  rolePartitionKey
32
- } from "./chunk-L3QHWDHB.mjs";
32
+ } from "./chunk-7Q2IJ2J5.mjs";
33
33
  import {
34
34
  DATA_STORE_CHANGE_DETAIL_MAX_UTF8_BYTES,
35
35
  DATA_STORE_CHANGE_DETAIL_TYPE,
36
36
  DATA_STORE_CHANGE_EVENT_SOURCE,
37
37
  buildFhirCurrentResourceChangeDetail
38
38
  } from "./chunk-CEOAGPYY.mjs";
39
- import "./chunk-EST32BJ2.mjs";
39
+ import "./chunk-7FUAMZOF.mjs";
40
40
  import {
41
41
  PROVISION_DEFAULT_WORKSPACE_DETAIL_TYPE,
42
42
  USER_ONBOARDING_EVENT_SOURCE,
@@ -54,8 +54,8 @@ import {
54
54
  import {
55
55
  require_lib
56
56
  } from "./chunk-SYBADQXI.mjs";
57
- import "./chunk-WWGJZNXJ.mjs";
58
- import "./chunk-LKG3I536.mjs";
57
+ import "./chunk-MULKGFIJ.mjs";
58
+ import "./chunk-IS4VQRI4.mjs";
59
59
  import "./chunk-QR5JVSCF.mjs";
60
60
  import {
61
61
  __commonJS,
@@ -23,7 +23,7 @@ __export(pre_token_generation_handler_exports, {
23
23
  handler: () => handler
24
24
  });
25
25
  module.exports = __toCommonJS(pre_token_generation_handler_exports);
26
- var import_types5 = require("@openhi/types");
26
+ var import_types6 = require("@openhi/types");
27
27
 
28
28
  // src/data/dynamo/dynamo-control-service.ts
29
29
  var import_electrodb8 = require("electrodb");
@@ -1107,7 +1107,7 @@ async function findUserBySubOperation(params) {
1107
1107
  };
1108
1108
  }
1109
1109
 
1110
- // src/data/operations/control/user/user-update-operation.ts
1110
+ // src/data/operations/control/user/user-switch-tenant-workspace-operation.ts
1111
1111
  var import_types4 = require("@openhi/types");
1112
1112
 
1113
1113
  // src/data/operations/control/user/user-resource-helpers.ts
@@ -1119,6 +1119,18 @@ function parseUserResource(resource) {
1119
1119
  }
1120
1120
  }
1121
1121
 
1122
+ // src/data/operations/fhir-reference.ts
1123
+ function idFromReference(reference, prefix) {
1124
+ if (!reference || !reference.startsWith(prefix)) {
1125
+ return void 0;
1126
+ }
1127
+ const id = reference.slice(prefix.length);
1128
+ return id.length > 0 ? id : void 0;
1129
+ }
1130
+
1131
+ // src/data/operations/control/user/user-update-operation.ts
1132
+ var import_types5 = require("@openhi/types");
1133
+
1122
1134
  // src/data/dynamo/dynamo-data-service.ts
1123
1135
  var import_electrodb10 = require("electrodb");
1124
1136
 
@@ -2164,15 +2176,6 @@ async function listPractitionerRolesOperation(params) {
2164
2176
  );
2165
2177
  }
2166
2178
 
2167
- // src/data/operations/fhir-reference.ts
2168
- function idFromReference(reference, prefix) {
2169
- if (!reference || !reference.startsWith(prefix)) {
2170
- return void 0;
2171
- }
2172
- const id = reference.slice(prefix.length);
2173
- return id.length > 0 ? id : void 0;
2174
- }
2175
-
2176
2179
  // src/components/cognito/pre-token-generation.handler.ts
2177
2180
  var REFERENCE_TYPES = {
2178
2181
  Tenant: "Tenant/",
@@ -2256,7 +2259,7 @@ async function resolveOrganizationRoles(tenantId, workspaceId, userId) {
2256
2259
  if (matching === void 0) {
2257
2260
  return void 0;
2258
2261
  }
2259
- const linked = (0, import_types5.getLinkedDataIdentity)(
2262
+ const linked = (0, import_types6.getLinkedDataIdentity)(
2260
2263
  matching.resource
2261
2264
  );
2262
2265
  if (linked?.reference === void 0) {
@@ -2275,7 +2278,7 @@ async function resolveOrganizationRoles(tenantId, workspaceId, userId) {
2275
2278
  const codings = role.code?.flatMap((cc) => cc.coding ?? []) ?? [];
2276
2279
  for (const c of codings) {
2277
2280
  if (typeof c.code !== "string") continue;
2278
- const parsed = import_types5.organizationRoleCodeSchema.safeParse(c.code);
2281
+ const parsed = import_types6.organizationRoleCodeSchema.safeParse(c.code);
2279
2282
  if (parsed.success) {
2280
2283
  codes.add(parsed.data);
2281
2284
  }
@@ -2312,7 +2315,7 @@ async function resolvePlatformRoles(tenantId, workspaceId, userId) {
2312
2315
  const roleId = idFromReference(ref, "Role/");
2313
2316
  if (roleId === void 0) continue;
2314
2317
  const candidate = roleId.startsWith("role-") ? roleId.slice("role-".length) : roleId;
2315
- const parsed = import_types5.platformRoleCodeSchema.safeParse(candidate);
2318
+ const parsed = import_types6.platformRoleCodeSchema.safeParse(candidate);
2316
2319
  if (parsed.success) {
2317
2320
  codes.add(parsed.data);
2318
2321
  }