@openhi/constructs 0.0.114 → 0.0.116

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 (39) hide show
  1. package/lib/chunk-AHYQFT4N.mjs +212 -0
  2. package/lib/chunk-AHYQFT4N.mjs.map +1 -0
  3. package/lib/{chunk-CUUKXDB2.mjs → chunk-AJQUWHFK.mjs} +460 -54
  4. package/lib/chunk-AJQUWHFK.mjs.map +1 -0
  5. package/lib/{chunk-GBDIGTNV.mjs → chunk-QWWLM452.mjs} +2 -2
  6. package/lib/{chunk-QMBJ4VHC.mjs → chunk-U7L7T4XU.mjs} +25 -25
  7. package/lib/{chunk-QMBJ4VHC.mjs.map → chunk-U7L7T4XU.mjs.map} +1 -1
  8. package/lib/{chunk-NZRW7ROK.mjs → chunk-YYRWDEG4.mjs} +2 -2
  9. package/lib/{chunk-KSFC72TT.mjs → chunk-ZHMHLK3S.mjs} +2 -2
  10. package/lib/{events-DPodvl07.d.mts → events-CMG8xanm.d.mts} +7 -53
  11. package/lib/{events-DPodvl07.d.ts → events-CMG8xanm.d.ts} +7 -53
  12. package/lib/index.d.mts +330 -84
  13. package/lib/index.d.ts +350 -136
  14. package/lib/index.js +844 -301
  15. package/lib/index.js.map +1 -1
  16. package/lib/index.mjs +472 -304
  17. package/lib/index.mjs.map +1 -1
  18. package/lib/pre-token-generation.handler.mjs +3 -3
  19. package/lib/provision-default-workspace.handler.mjs +3 -3
  20. package/lib/rest-api-lambda.handler.mjs +282 -452
  21. package/lib/rest-api-lambda.handler.mjs.map +1 -1
  22. package/lib/seed-demo-data.handler.d.mts +6 -3
  23. package/lib/seed-demo-data.handler.d.ts +6 -3
  24. package/lib/seed-demo-data.handler.js +656 -0
  25. package/lib/seed-demo-data.handler.js.map +1 -1
  26. package/lib/seed-demo-data.handler.mjs +4 -4
  27. package/lib/static-hosting.viewer-request-handler.d.mts +54 -0
  28. package/lib/static-hosting.viewer-request-handler.d.ts +54 -0
  29. package/lib/static-hosting.viewer-request-handler.js +79 -0
  30. package/lib/static-hosting.viewer-request-handler.js.map +1 -0
  31. package/lib/static-hosting.viewer-request-handler.mjs +53 -0
  32. package/lib/static-hosting.viewer-request-handler.mjs.map +1 -0
  33. package/package.json +2 -2
  34. package/lib/chunk-53OHXLIL.mjs +0 -27
  35. package/lib/chunk-53OHXLIL.mjs.map +0 -1
  36. package/lib/chunk-CUUKXDB2.mjs.map +0 -1
  37. /package/lib/{chunk-GBDIGTNV.mjs.map → chunk-QWWLM452.mjs.map} +0 -0
  38. /package/lib/{chunk-NZRW7ROK.mjs.map → chunk-YYRWDEG4.mjs.map} +0 -0
  39. /package/lib/{chunk-KSFC72TT.mjs.map → chunk-ZHMHLK3S.mjs.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  batchGetWithRetry,
3
3
  dispatchListMode
4
- } from "./chunk-QMBJ4VHC.mjs";
4
+ } from "./chunk-U7L7T4XU.mjs";
5
5
  import {
6
6
  ForbiddenError,
7
7
  NotFoundError,
@@ -304,4 +304,4 @@ export {
304
304
  idFromReference,
305
305
  switchUserTenantWorkspaceOperation
306
306
  };
307
- //# sourceMappingURL=chunk-NZRW7ROK.mjs.map
307
+ //# sourceMappingURL=chunk-YYRWDEG4.mjs.map
@@ -3,7 +3,7 @@ import {
3
3
  dispatchListMode,
4
4
  getDynamoDataService,
5
5
  listDataEntitiesByWorkspace
6
- } from "./chunk-QMBJ4VHC.mjs";
6
+ } from "./chunk-U7L7T4XU.mjs";
7
7
  import {
8
8
  SHARD_COUNT,
9
9
  getDynamoControlService
@@ -93,4 +93,4 @@ export {
93
93
  listMembershipsOperation,
94
94
  listRoleAssignmentsOperation
95
95
  };
96
- //# sourceMappingURL=chunk-KSFC72TT.mjs.map
96
+ //# sourceMappingURL=chunk-ZHMHLK3S.mjs.map
@@ -37,10 +37,9 @@ declare const DEMO_PERIOD: {
37
37
  * `"platform"` literal is a reserved value that never matches a real
38
38
  * Tenant id and signals "this RA scopes across all tenants".
39
39
  *
40
- * Renaming this constant is a wire-format break — the IAM grant in
41
- * `seed-demo-data-lambda.ts` enumerates exact-match `LeadingKeys`
42
- * computed from this value, and the in-band records written under it
43
- * become unreachable if the sentinel changes.
40
+ * Renaming this constant is a wire-format break — the handler emits
41
+ * RoleAssignment records keyed on this value, and the in-band records
42
+ * written under it become unreachable if the sentinel changes.
44
43
  */
45
44
  declare const PLATFORM_SCOPE_TENANT_ID = "platform";
46
45
  /** Placeholder Tenant id seeded by the workflow as the dev-user `currentTenant`. */
@@ -81,8 +80,8 @@ interface DemoWorkspaceSpec {
81
80
  readonly name: string;
82
81
  /**
83
82
  * Role suffix used in the demo URN value (`<scenario>:<roleSuffix>`).
84
- * Mirrors seed-fixtures' role suffix convention: `workspace` for
85
- * single-workspace tenants, `workspace-<sub>` for the mixed tenant.
83
+ * `workspace` for single-workspace tenants, `workspace-<sub>` for the
84
+ * mixed tenant.
86
85
  */
87
86
  readonly roleSuffix: string;
88
87
  }
@@ -95,8 +94,7 @@ interface DemoTenantSpec {
95
94
  /**
96
95
  * Scenario slug — `placeholder`, `demo-wound-care`, `demo-primary-care`,
97
96
  * `demo-mixed`. The placeholder tenant's slug is `placeholder`; the
98
- * three demo tenants mirror seed-fixtures' `fixture-*` slugs renamed
99
- * to `demo-*`.
97
+ * three demo tenants use `demo-*` slugs.
100
98
  */
101
99
  readonly scenario: string;
102
100
  /** Stable id (DynamoDB record id; also drives the canonical OHI URN). */
@@ -131,8 +129,6 @@ declare const demoMembershipId: (devUserId: string, tenantId: string) => string;
131
129
  declare const demoRoleAssignmentId: (devUserId: string, tenantId: string, roleCode: PlatformRoleCode) => string;
132
130
  /**
133
131
  * Demo-scenario FHIR `Identifier` entry — `urn:openhi:demo:<scenario>:<role>`.
134
- * Mirrors the `urn:openhi:fixture:<scenario>:<role>` pattern from
135
- * `@openhi/seed-fixtures/src/urn.ts`, renamed to the `demo` namespace.
136
132
  */
137
133
  declare const demoScenarioIdentifier: (scenario: string, roleSuffix: string) => {
138
134
  system: string;
@@ -161,47 +157,5 @@ declare const openhiResourceIdentifier: (params: {
161
157
  * is no per-(user, tenant) variance to drive from.
162
158
  */
163
159
  declare const demoRolesForUserInTenant: (_user: DemoDevUser, _tenantId: string) => ReadonlyArray<PlatformRoleCode>;
164
- /**
165
- * DynamoDB single-table partition-key builders. The IAM grant in
166
- * `seed-demo-data-lambda.ts` uses these to enumerate exact-match
167
- * `dynamodb:LeadingKeys` values; the entity definitions in
168
- * `data/dynamo/entities/control/` own the canonical key templates.
169
- *
170
- * These builders MUST emit the keys ElectroDB actually writes — not
171
- * the entity definition's pretty template. None of the control-plane
172
- * entities sets `casing: "none"` on the base-table PK template, so
173
- * ElectroDB applies its default lowercase casing at runtime: the
174
- * entity's `ROLE#ID#${id}` becomes `role#id#<id>` on the wire. A
175
- * builder that returns the uppercase template form produces a
176
- * silently-broken IAM grant (every PutItem denied with "no
177
- * identity-based policy allows" because the request's leading-key
178
- * never matches a policy value).
179
- */
180
- declare const rolePartitionKey: (roleId: string) => string;
181
- declare const demoTenantPartitionKey: (tenantId: string) => string;
182
- declare const demoWorkspacePartitionKey: (tenantId: string, workspaceId: string) => string;
183
- declare const demoMembershipPartitionKey: (tenantId: string, membershipId: string) => string;
184
- declare const demoRoleAssignmentPartitionKey: (tenantId: string, roleAssignmentId: string) => string;
185
- /** User entity PK template — `USER#ID#<id>` → `user#id#<id>` on the wire. */
186
- declare const demoUserPartitionKey: (userId: string) => string;
187
- /**
188
- * Tenant + Workspace PKs the workflow writes on every fire: the 4
189
- * tenant PKs (placeholder + 3 demo) plus their workspaces (1 + 1 + 1 + 2 = 5).
190
- */
191
- declare const demoBasePartitionKeys: () => ReadonlyArray<string>;
192
- /**
193
- * Membership + RoleAssignment + User PKs the workflow writes per dev
194
- * user. Empty when `devUsers` is empty (used by tests). The list
195
- * mirrors the handler's iteration order so the IAM grant covers every
196
- * write the handler can make.
197
- *
198
- * Per dev user the function emits:
199
- * - one User PK,
200
- * - per tenant in {@link DEMO_TENANT_SPECS}: one Membership PK plus
201
- * one `tenant-admin` RoleAssignment PK,
202
- * - one platform-scoped `system-admin` RoleAssignment PK keyed by
203
- * {@link PLATFORM_SCOPE_TENANT_ID}.
204
- */
205
- declare const demoDevUserPartitionKeys: (devUsers: ReadonlyArray<DemoDevUser>) => ReadonlyArray<string>;
206
160
 
207
- export { DEMO_PERIOD as D, OPENHI_RESOURCE_URN_SYSTEM as O, PLACEHOLDER_TENANT_ID as P, SEED_DEMO_DATA_CONSUMER_NAME as S, DEMO_TENANT_SPECS as a, DEMO_URN_SYSTEM as b, DEV_USERS as c, type DemoDevUser as d, type DemoTenantSpec as e, type DemoWorkspaceSpec as f, PLACEHOLDER_WORKSPACE_ID as g, PLATFORM_SCOPE_TENANT_ID as h, demoBasePartitionKeys as i, demoDevUserPartitionKeys as j, demoMembershipId as k, demoMembershipPartitionKey as l, demoRoleAssignmentId as m, demoRoleAssignmentPartitionKey as n, demoRolesForUserInTenant as o, demoScenarioIdentifier as p, demoTenantPartitionKey as q, demoUserPartitionKey as r, demoWorkspacePartitionKey as s, openhiResourceIdentifier as t, rolePartitionKey as u };
161
+ export { DEMO_PERIOD as D, OPENHI_RESOURCE_URN_SYSTEM as O, PLACEHOLDER_TENANT_ID as P, SEED_DEMO_DATA_CONSUMER_NAME as S, DEMO_TENANT_SPECS as a, DEMO_URN_SYSTEM as b, DEV_USERS as c, type DemoDevUser as d, type DemoTenantSpec as e, type DemoWorkspaceSpec as f, PLACEHOLDER_WORKSPACE_ID as g, PLATFORM_SCOPE_TENANT_ID as h, demoMembershipId as i, demoRoleAssignmentId as j, demoRolesForUserInTenant as k, demoScenarioIdentifier as l, openhiResourceIdentifier as o };
@@ -37,10 +37,9 @@ declare const DEMO_PERIOD: {
37
37
  * `"platform"` literal is a reserved value that never matches a real
38
38
  * Tenant id and signals "this RA scopes across all tenants".
39
39
  *
40
- * Renaming this constant is a wire-format break — the IAM grant in
41
- * `seed-demo-data-lambda.ts` enumerates exact-match `LeadingKeys`
42
- * computed from this value, and the in-band records written under it
43
- * become unreachable if the sentinel changes.
40
+ * Renaming this constant is a wire-format break — the handler emits
41
+ * RoleAssignment records keyed on this value, and the in-band records
42
+ * written under it become unreachable if the sentinel changes.
44
43
  */
45
44
  declare const PLATFORM_SCOPE_TENANT_ID = "platform";
46
45
  /** Placeholder Tenant id seeded by the workflow as the dev-user `currentTenant`. */
@@ -81,8 +80,8 @@ interface DemoWorkspaceSpec {
81
80
  readonly name: string;
82
81
  /**
83
82
  * Role suffix used in the demo URN value (`<scenario>:<roleSuffix>`).
84
- * Mirrors seed-fixtures' role suffix convention: `workspace` for
85
- * single-workspace tenants, `workspace-<sub>` for the mixed tenant.
83
+ * `workspace` for single-workspace tenants, `workspace-<sub>` for the
84
+ * mixed tenant.
86
85
  */
87
86
  readonly roleSuffix: string;
88
87
  }
@@ -95,8 +94,7 @@ interface DemoTenantSpec {
95
94
  /**
96
95
  * Scenario slug — `placeholder`, `demo-wound-care`, `demo-primary-care`,
97
96
  * `demo-mixed`. The placeholder tenant's slug is `placeholder`; the
98
- * three demo tenants mirror seed-fixtures' `fixture-*` slugs renamed
99
- * to `demo-*`.
97
+ * three demo tenants use `demo-*` slugs.
100
98
  */
101
99
  readonly scenario: string;
102
100
  /** Stable id (DynamoDB record id; also drives the canonical OHI URN). */
@@ -131,8 +129,6 @@ declare const demoMembershipId: (devUserId: string, tenantId: string) => string;
131
129
  declare const demoRoleAssignmentId: (devUserId: string, tenantId: string, roleCode: PlatformRoleCode) => string;
132
130
  /**
133
131
  * Demo-scenario FHIR `Identifier` entry — `urn:openhi:demo:<scenario>:<role>`.
134
- * Mirrors the `urn:openhi:fixture:<scenario>:<role>` pattern from
135
- * `@openhi/seed-fixtures/src/urn.ts`, renamed to the `demo` namespace.
136
132
  */
137
133
  declare const demoScenarioIdentifier: (scenario: string, roleSuffix: string) => {
138
134
  system: string;
@@ -161,47 +157,5 @@ declare const openhiResourceIdentifier: (params: {
161
157
  * is no per-(user, tenant) variance to drive from.
162
158
  */
163
159
  declare const demoRolesForUserInTenant: (_user: DemoDevUser, _tenantId: string) => ReadonlyArray<PlatformRoleCode>;
164
- /**
165
- * DynamoDB single-table partition-key builders. The IAM grant in
166
- * `seed-demo-data-lambda.ts` uses these to enumerate exact-match
167
- * `dynamodb:LeadingKeys` values; the entity definitions in
168
- * `data/dynamo/entities/control/` own the canonical key templates.
169
- *
170
- * These builders MUST emit the keys ElectroDB actually writes — not
171
- * the entity definition's pretty template. None of the control-plane
172
- * entities sets `casing: "none"` on the base-table PK template, so
173
- * ElectroDB applies its default lowercase casing at runtime: the
174
- * entity's `ROLE#ID#${id}` becomes `role#id#<id>` on the wire. A
175
- * builder that returns the uppercase template form produces a
176
- * silently-broken IAM grant (every PutItem denied with "no
177
- * identity-based policy allows" because the request's leading-key
178
- * never matches a policy value).
179
- */
180
- declare const rolePartitionKey: (roleId: string) => string;
181
- declare const demoTenantPartitionKey: (tenantId: string) => string;
182
- declare const demoWorkspacePartitionKey: (tenantId: string, workspaceId: string) => string;
183
- declare const demoMembershipPartitionKey: (tenantId: string, membershipId: string) => string;
184
- declare const demoRoleAssignmentPartitionKey: (tenantId: string, roleAssignmentId: string) => string;
185
- /** User entity PK template — `USER#ID#<id>` → `user#id#<id>` on the wire. */
186
- declare const demoUserPartitionKey: (userId: string) => string;
187
- /**
188
- * Tenant + Workspace PKs the workflow writes on every fire: the 4
189
- * tenant PKs (placeholder + 3 demo) plus their workspaces (1 + 1 + 1 + 2 = 5).
190
- */
191
- declare const demoBasePartitionKeys: () => ReadonlyArray<string>;
192
- /**
193
- * Membership + RoleAssignment + User PKs the workflow writes per dev
194
- * user. Empty when `devUsers` is empty (used by tests). The list
195
- * mirrors the handler's iteration order so the IAM grant covers every
196
- * write the handler can make.
197
- *
198
- * Per dev user the function emits:
199
- * - one User PK,
200
- * - per tenant in {@link DEMO_TENANT_SPECS}: one Membership PK plus
201
- * one `tenant-admin` RoleAssignment PK,
202
- * - one platform-scoped `system-admin` RoleAssignment PK keyed by
203
- * {@link PLATFORM_SCOPE_TENANT_ID}.
204
- */
205
- declare const demoDevUserPartitionKeys: (devUsers: ReadonlyArray<DemoDevUser>) => ReadonlyArray<string>;
206
160
 
207
- export { DEMO_PERIOD as D, OPENHI_RESOURCE_URN_SYSTEM as O, PLACEHOLDER_TENANT_ID as P, SEED_DEMO_DATA_CONSUMER_NAME as S, DEMO_TENANT_SPECS as a, DEMO_URN_SYSTEM as b, DEV_USERS as c, type DemoDevUser as d, type DemoTenantSpec as e, type DemoWorkspaceSpec as f, PLACEHOLDER_WORKSPACE_ID as g, PLATFORM_SCOPE_TENANT_ID as h, demoBasePartitionKeys as i, demoDevUserPartitionKeys as j, demoMembershipId as k, demoMembershipPartitionKey as l, demoRoleAssignmentId as m, demoRoleAssignmentPartitionKey as n, demoRolesForUserInTenant as o, demoScenarioIdentifier as p, demoTenantPartitionKey as q, demoUserPartitionKey as r, demoWorkspacePartitionKey as s, openhiResourceIdentifier as t, rolePartitionKey as u };
161
+ export { DEMO_PERIOD as D, OPENHI_RESOURCE_URN_SYSTEM as O, PLACEHOLDER_TENANT_ID as P, SEED_DEMO_DATA_CONSUMER_NAME as S, DEMO_TENANT_SPECS as a, DEMO_URN_SYSTEM as b, DEV_USERS as c, type DemoDevUser as d, type DemoTenantSpec as e, type DemoWorkspaceSpec as f, PLACEHOLDER_WORKSPACE_ID as g, PLATFORM_SCOPE_TENANT_ID as h, demoMembershipId as i, demoRoleAssignmentId as j, demoRolesForUserInTenant as k, demoScenarioIdentifier as l, openhiResourceIdentifier as o };