@openhi/constructs 0.0.113 → 0.0.115

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-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 +64 -77
  13. package/lib/index.d.ts +70 -129
  14. package/lib/index.js +499 -241
  15. package/lib/index.js.map +1 -1
  16. package/lib/index.mjs +58 -184
  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/package.json +8 -8
  28. package/lib/chunk-53OHXLIL.mjs +0 -27
  29. package/lib/chunk-53OHXLIL.mjs.map +0 -1
  30. package/lib/chunk-CUUKXDB2.mjs.map +0 -1
  31. /package/lib/{chunk-GBDIGTNV.mjs.map → chunk-QWWLM452.mjs.map} +0 -0
  32. /package/lib/{chunk-NZRW7ROK.mjs.map → chunk-YYRWDEG4.mjs.map} +0 -0
  33. /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 };
package/lib/index.d.mts CHANGED
@@ -4,7 +4,7 @@ import { IConstruct, Construct } from 'constructs';
4
4
  import { Certificate, CertificateProps, ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
5
5
  import { HttpApiProps, HttpApi, IHttpApi, DomainName } from 'aws-cdk-lib/aws-apigatewayv2';
6
6
  import { GraphqlApi, IGraphqlApi, GraphqlApiProps } from 'aws-cdk-lib/aws-appsync';
7
- import { UserPoolClient, UserPoolClientProps, IUserPool, UserPool, UserPoolProps, UserPoolDomain, UserPoolDomainProps, IUserPoolClient, IUserPoolDomain } from 'aws-cdk-lib/aws-cognito';
7
+ import { UserPool, UserPoolProps, UserPoolClient, UserPoolClientProps, UserPoolDomain, UserPoolDomainProps, IUserPool, IUserPoolClient, IUserPoolDomain } from 'aws-cdk-lib/aws-cognito';
8
8
  import { Key, KeyProps, IKey } from 'aws-cdk-lib/aws-kms';
9
9
  import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
10
10
  import { D as DynamoDbStreamKinesisRecord } from './dynamodb-stream-record-CJtV6a1t.mjs';
@@ -25,11 +25,11 @@ export { C as CascadeChunkInput, a as CascadeFinalizeInput, b as CascadeFinalize
25
25
  import { StateMachine } from 'aws-cdk-lib/aws-stepfunctions';
26
26
  export { B as BRIDGED_STATUSES, a as BridgedStatus, C as CLOUDFORMATION_EVENT_SOURCE, b as CLOUDFORMATION_STACK_STATUS_CHANGE_DETAIL_TYPE, c as CONTROL_EVENT_BUS_NAME_ENV_VAR, d as CloudFormationStackStatusChangeDetail, O as OPENHI_REPO_TAG_KEY_ENV_VAR, e as OPENHI_TAG_KEY_PREFIX_ENV_VAR, P as PLATFORM_DEPLOY_BRIDGE_ACTOR_SYSTEM } from './events-BfrkMoBD.mjs';
27
27
  export { R as RENAME_CASCADE_CONSUMER_NAME, a as RENAME_CASCADE_DEFAULT_CONCURRENCY, b as RENAME_CASCADE_FAILED_THRESHOLD, c as RENAME_CASCADE_OPS_EVENT_BUS_ENV_VAR, d as RENAME_CASCADE_SLOW_THRESHOLD_SECONDS, e as RenameCascadeChunkInput, f as RenameCascadeFinalizeInput, g as RenameCascadeFinalizeOutput, h as RenameCascadeListInput, i as RenameCascadeListOutput } from './events-Da_cFgtc.mjs';
28
- export { D as DEMO_PERIOD, a as DEMO_TENANT_SPECS, b as DEMO_URN_SYSTEM, c as DEV_USERS, d as DemoDevUser, e as DemoTenantSpec, f as DemoWorkspaceSpec, O as OPENHI_RESOURCE_URN_SYSTEM, P as PLACEHOLDER_TENANT_ID, g as PLACEHOLDER_WORKSPACE_ID, h as PLATFORM_SCOPE_TENANT_ID, S as SEED_DEMO_DATA_CONSUMER_NAME, i as demoBasePartitionKeys, j as demoDevUserPartitionKeys, k as demoMembershipId, l as demoMembershipPartitionKey, m as demoRoleAssignmentId, n as demoRoleAssignmentPartitionKey, o as demoRolesForUserInTenant, p as demoScenarioIdentifier, q as demoTenantPartitionKey, r as demoUserPartitionKey, s as demoWorkspacePartitionKey, t as openhiResourceIdentifier, u as rolePartitionKey } from './events-DPodvl07.mjs';
28
+ import { Patient, Practitioner, Observation, Encounter, Account } from '@openhi/types';
29
+ export { D as DEMO_PERIOD, a as DEMO_TENANT_SPECS, b as DEMO_URN_SYSTEM, c as DEV_USERS, d as DemoDevUser, e as DemoTenantSpec, f as DemoWorkspaceSpec, O as OPENHI_RESOURCE_URN_SYSTEM, P as PLACEHOLDER_TENANT_ID, g as PLACEHOLDER_WORKSPACE_ID, h as PLATFORM_SCOPE_TENANT_ID, S as SEED_DEMO_DATA_CONSUMER_NAME, i as demoMembershipId, j as demoRoleAssignmentId, k as demoRolesForUserInTenant, l as demoScenarioIdentifier, o as openhiResourceIdentifier } from './events-CMG8xanm.mjs';
29
30
  export { P as PROVISION_DEFAULT_WORKSPACE_DETAIL_TYPE, a as ProvisionDefaultWorkspaceRequestedDetail, U as USER_ONBOARDING_EVENT_SOURCE, b as buildProvisionDefaultWorkspaceRequestedDetail } from './events-CVA3_eEB.mjs';
30
31
  export { ControlPlaneOwningDeleteCompleteV1, ControlPlaneOwningDeleteCompleteV1Detail, ControlPlaneOwningDeleteFailedV1, ControlPlaneOwningDeleteFailedV1Detail, ControlPlaneOwningDeleteV1, ControlPlaneOwningDeleteV1Detail, ControlPlaneRenameCompleteV1, ControlPlaneRenameCompleteV1Detail, ControlPlaneRenameFailedV1, ControlPlaneRenameFailedV1Detail, ControlPlaneRenameV1, ControlPlaneRenameV1Detail, OPENHI_DATA_SOURCE, OPENHI_OPS_SOURCE, OWNING_ENTITY_TYPE, OwningEntityType, PlatformDeploymentCompletedV1, PlatformSystemDataSeededV1, RENAMABLE_ENTITY_TYPE, RenamableEntityType } from '@openhi/workflows';
31
32
  import '@aws-sdk/client-dynamodb';
32
- import '@openhi/types';
33
33
  import 'aws-lambda';
34
34
 
35
35
  /**
@@ -420,47 +420,6 @@ declare class RootGraphqlApi extends GraphqlApi {
420
420
  constructor(scope: Construct, props?: Omit<RootGraphqlApiProps, "name">);
421
421
  }
422
422
 
423
- interface CognitoFixtureSeederClientProps extends Partial<Omit<UserPoolClientProps, "userPool" | "generateSecret">> {
424
- readonly userPool: IUserPool;
425
- }
426
- /**
427
- * Dedicated Cognito app client for the OpenHI fixture-seeder CLI
428
- * (`@openhi/seed-fixtures`).
429
- *
430
- * Why a dedicated client (vs reusing the SPA client):
431
- * - Tightly scoped: only the seeder consumes tokens issued here, so an
432
- * audit trail of seeder activity is cleanly separable.
433
- * - Decoupled from the SPA client's OAuth flows — no risk of breaking
434
- * web-app sign-in by tweaking auth-flow settings here.
435
- * - Stage-conditional creation upstream (only provisioned in non-prod
436
- * environments) means prod stacks never carry a code path that could
437
- * issue a fixture-seeder token in the first place.
438
- *
439
- * Why USER_PASSWORD_AUTH (vs M2M client-credentials):
440
- * - Cognito's M2M tier has a per-app-client monthly fee plus per-token
441
- * activity charges. For sporadic non-prod fixture runs the per-client
442
- * fee dominates the bill, especially if every dev branch spins up
443
- * its own auth stack.
444
- * - USER_PASSWORD_AUTH against a service `fixture-seeder` user keeps
445
- * the cost in MAU territory (free under the 50K MAU tier).
446
- * - Tradeoff: passwords need rotation and the service user must be
447
- * provisioned per non-prod environment (manual or scripted post-deploy).
448
- *
449
- * No client secret (`generateSecret: false`): USER_PASSWORD_AUTH
450
- * authenticates with the password directly; a secret would just add
451
- * another credential to manage without strengthening anything.
452
- */
453
- declare class CognitoFixtureSeederClient extends UserPoolClient {
454
- /**
455
- * SSM parameter name suffix used to publish this client's ID for
456
- * cross-stack lookups. Built into a full parameter name via
457
- * `buildParameterName` with `serviceType` AUTH (since the auth stack
458
- * owns this resource).
459
- */
460
- static readonly SSM_PARAM_NAME = "COGNITO_FIXTURE_SEEDER_CLIENT";
461
- constructor(scope: Construct, props: CognitoFixtureSeederClientProps);
462
- }
463
-
464
423
  /**
465
424
  * @see sites/www-docs/content/packages/@openhi/constructs/components/cognito/cognito-user-pool.md
466
425
  */
@@ -1131,17 +1090,6 @@ declare class OpenHiAuthService extends OpenHiService {
1131
1090
  * Returns an IUserPoolClient by looking up the Auth stack's User Pool Client ID from SSM.
1132
1091
  */
1133
1092
  static userPoolClientFromConstruct(scope: Construct): IUserPoolClient;
1134
- /**
1135
- * Returns the dedicated fixture-seeder IUserPoolClient by looking up
1136
- * its ID from SSM. Only non-prod auth stacks publish this parameter
1137
- * (per the conditional in {@link createFixtureSeederClient}); calling
1138
- * this against a prod-deployed stack will fail at lookup time.
1139
- *
1140
- * Consumed by `OpenHiRestApiService` (in non-prod) so the authorizer
1141
- * accepts tokens issued by this client, and by the seed-fixtures CLI
1142
- * to drive USER_PASSWORD_AUTH against this client's ID.
1143
- */
1144
- static fixtureSeederClientFromConstruct(scope: Construct): IUserPoolClient;
1145
1093
  /**
1146
1094
  * Returns an IUserPoolDomain by looking up the Auth stack's User Pool Domain from SSM.
1147
1095
  */
@@ -1161,12 +1109,6 @@ declare class OpenHiAuthService extends OpenHiService {
1161
1109
  readonly userPool: IUserPool;
1162
1110
  readonly userPoolClient: IUserPoolClient;
1163
1111
  readonly userPoolDomain: IUserPoolDomain;
1164
- /**
1165
- * Dedicated USER_PASSWORD_AUTH client for the seed-fixtures CLI.
1166
- * Only created in non-prod environments (see
1167
- * {@link createFixtureSeederClient}). `undefined` in prod.
1168
- */
1169
- readonly fixtureSeederClient?: IUserPoolClient;
1170
1112
  /**
1171
1113
  * Cross-stack reference to the data store table. Cached so repeated
1172
1114
  * lookups share a single CDK construct id ("dynamo-db-data-store") in
@@ -1245,18 +1187,6 @@ declare class OpenHiAuthService extends OpenHiService {
1245
1187
  * Override to customize.
1246
1188
  */
1247
1189
  protected createUserPoolClient(): IUserPoolClient;
1248
- /**
1249
- * Creates the dedicated USER_PASSWORD_AUTH app client for the
1250
- * `@openhi/seed-fixtures` CLI, **only** in non-prod environments.
1251
- * Returns `undefined` when this stack is being deployed to a prod
1252
- * stage so the prod auth stack carries no fixture-seeder code path.
1253
- *
1254
- * Operator post-deploy: create a `fixture-seeder` Cognito user with
1255
- * a service password (manually via console or scripted with
1256
- * `aws cognito-idp admin-create-user`); the CLI consumes those creds
1257
- * via env vars to drive `InitiateAuth`.
1258
- */
1259
- protected createFixtureSeederClient(): IUserPoolClient | undefined;
1260
1190
  /**
1261
1191
  * Creates the User Pool Domain (Cognito hosted UI) and exports domain name to SSM.
1262
1192
  * Look up via {@link OpenHiAuthService.userPoolDomainFromConstruct}.
@@ -1522,12 +1452,69 @@ declare class OpenHiRestApiService extends OpenHiService {
1522
1452
  protected createRootHttpApi(domainName: DomainName): RootHttpApi;
1523
1453
  }
1524
1454
 
1455
+ /**
1456
+ * @see sites/www-docs/content/packages/@openhi/constructs/workflows/control-plane/seed-demo-data/data-plane-fixtures.md
1457
+ *
1458
+ * Hand-authored FHIR data-plane fixture bodies the `seed-demo-data`
1459
+ * workflow upserts into the data store on every non-prod deploy.
1460
+ * Mirrors the OPS-009 v1 resource set: Patient, Practitioner,
1461
+ * Observation, Encounter, Account.
1462
+ *
1463
+ * Ids are deterministic — re-fires of the workflow upsert the same
1464
+ * records, satisfying the workflow's idempotency contract (no
1465
+ * duplicates) and letting the IAM grant in `seed-demo-data-lambda.ts`
1466
+ * enumerate exact-match `dynamodb:LeadingKeys` rather than a wildcard.
1467
+ *
1468
+ * The placeholder tenant carries no data-plane fixtures — only the
1469
+ * three real demo tenants (wound-care, primary-care, mixed) get
1470
+ * Patient/Practitioner/Observation/Encounter/Account records. The
1471
+ * placeholder tenant exists solely as a routing target for the
1472
+ * Cognito pre-token-generation fallback and never holds clinical
1473
+ * data.
1474
+ */
1475
+ /**
1476
+ * Logical group of FHIR resources owned by a single (tenant, workspace)
1477
+ * pair. The workflow walks `DEMO_DATA_PLANE_FIXTURES` and writes every
1478
+ * entry against the matching workspace's `OpenHiContext`.
1479
+ */
1480
+ interface DemoWorkspaceDataPlaneFixtures {
1481
+ readonly tenantId: string;
1482
+ readonly workspaceId: string;
1483
+ /**
1484
+ * Scenario slug used in the demo-URN identifier — mirrors the
1485
+ * `DemoTenantSpec.scenario` value for the parent tenant. For the
1486
+ * mixed tenant both workspaces share the `demo-mixed` scenario.
1487
+ */
1488
+ readonly scenario: string;
1489
+ readonly patients: ReadonlyArray<Patient>;
1490
+ readonly practitioners: ReadonlyArray<Practitioner>;
1491
+ readonly observations: ReadonlyArray<Observation>;
1492
+ readonly encounters: ReadonlyArray<Encounter>;
1493
+ readonly accounts: ReadonlyArray<Account>;
1494
+ }
1495
+ /**
1496
+ * Per-workspace fixtures the data-plane phase writes on every fire.
1497
+ * The placeholder tenant carries no fixtures. The mixed tenant carries
1498
+ * one fixture group per workspace; the two single-workspace tenants
1499
+ * carry one each. Total: 4 fixture groups × ≈ 9 resources = ~36
1500
+ * data-plane records.
1501
+ *
1502
+ * Ids embed the tenant + workspace slug so they remain unambiguous
1503
+ * across the four workspaces (the FHIR resource id is the only thing
1504
+ * that survives into the partition key, so a duplicate id across
1505
+ * workspaces would still collide on read paths that scan-by-id).
1506
+ */
1507
+ declare const DEMO_DATA_PLANE_FIXTURES: ReadonlyArray<DemoWorkspaceDataPlaneFixtures>;
1508
+
1525
1509
  interface SeedDemoDataLambdaProps {
1526
1510
  /**
1527
1511
  * Data-store table the workflow upserts demo-data records into.
1528
- * Wired via `DYNAMO_TABLE_NAME` env var; granted scoped read on the
1529
- * Role PKs (pre-flight check) and scoped write on the enumerated
1530
- * demo Tenant / Workspace / Membership / RoleAssignment / User PKs.
1512
+ * Wired via `DYNAMO_TABLE_NAME` env var; granted `dynamodb:GetItem`
1513
+ * (pre-flight Role lookup) and `dynamodb:PutItem`/`dynamodb:UpdateItem`
1514
+ * (write phase). The grants are scoped to the table ARN only; the
1515
+ * handler itself is the scope guarantee for which records the
1516
+ * workflow touches (see the construct body for the previous
1517
+ * `LeadingKeys`-based grants and the reason they were dropped).
1531
1518
  */
1532
1519
  readonly dataStoreTable: ITable;
1533
1520
  /**
@@ -1980,4 +1967,4 @@ declare class RenameCascadeWorkflow extends Construct {
1980
1967
  constructor(scope: Construct, props: RenameCascadeWorkflowProps);
1981
1968
  }
1982
1969
 
1983
- export { type BuildParameterNameProps, ChildHostedZone, type ChildHostedZoneProps, CognitoFixtureSeederClient, type CognitoFixtureSeederClientProps, CognitoUserPool, CognitoUserPoolClient, CognitoUserPoolDomain, CognitoUserPoolKmsKey, ControlEventBus, DATA_STORE_CHANGE_DETAIL_MAX_UTF8_BYTES, DATA_STORE_CHANGE_DETAIL_TYPE, DATA_STORE_CHANGE_EVENT_SOURCE, DataEventBus, DataStoreHistoricalArchive, type DataStoreHistoricalArchiveProps, DataStorePostgresReplica, type DataStorePostgresReplicaProps, DiscoverableStringParameter, type DiscoverableStringParameterProps, DynamoDbDataStore, type DynamoDbDataStoreProps, type FhirCurrentResourceChangeDetail, type GrantConsumerOptions, OPENHI_TAG_SUFFIX_BRANCH_NAME, OPENHI_TAG_SUFFIX_REPO_NAME, OPENHI_TAG_SUFFIX_SERVICE_TYPE, OPENHI_TAG_SUFFIX_STAGE_TYPE, OpenHiApp, type OpenHiAppProps, OpenHiAuthService, type OpenHiAuthServiceProps, OpenHiDataService, type OpenHiDataServiceProps, OpenHiEnvironment, type OpenHiEnvironmentProps, OpenHiGlobalService, type OpenHiGlobalServiceProps, OpenHiGraphqlService, type OpenHiGraphqlServiceProps, OpenHiRestApiService, type OpenHiRestApiServiceProps, OpenHiService, type OpenHiServiceProps, type OpenHiServiceType, OpenHiStage, type OpenHiStageProps, OpsEventBus, OwningDeleteCascadeLambdas, type OwningDeleteCascadeLambdasProps, OwningDeleteCascadeWorkflow, type OwningDeleteCascadeWorkflowProps, POSTGRES_REPLICA_CLUSTER_ARN_SSM_NAME, POSTGRES_REPLICA_DATABASE_NAME_SSM_NAME, POSTGRES_REPLICA_SECRET_ARN_SSM_NAME, PlatformDeployBridge, PlatformDeployBridgeLambda, type PlatformDeployBridgeLambdaProps, type PlatformDeployBridgeProps, PostAuthenticationLambda, PostConfirmationLambda, type PostConfirmationLambdaProps, PreTokenGenerationLambda, type PreTokenGenerationLambdaProps, ProvisionDefaultWorkspaceLambda, type ProvisionDefaultWorkspaceLambdaProps, REST_API_BASE_URL_SSM_NAME, RenameCascadeLambdas, type RenameCascadeLambdasProps, RenameCascadeWorkflow, type RenameCascadeWorkflowProps, RootGraphqlApi, type RootGraphqlApiProps, RootHostedZone, RootHttpApi, type RootHttpApiProps, RootWildcardCertificate, SEED_SYSTEM_DATA_ACTOR_SYSTEM, SEED_SYSTEM_DATA_CONSUMER_NAME, SEED_SYSTEM_DATA_CONTROL_BUS_ENV_VAR, STATIC_HOSTING_SERVICE_TYPE, SeedDemoDataLambda, type SeedDemoDataLambdaProps, SeedDemoDataWorkflow, type SeedDemoDataWorkflowProps, SeedSystemDataLambda, type SeedSystemDataLambdaProps, SeedSystemDataWorkflow, type SeedSystemDataWorkflowProps, StaticHosting, type StaticHostingProps, UserOnboardingWorkflow, type UserOnboardingWorkflowProps, WorkflowDedupConsumerNameInvalidError, WorkflowDedupTable, WorkflowDedupTableDuplicateError, type WorkflowDedupTableProps, buildFhirCurrentResourceChangeDetail, getDynamoDbDataStoreTableName, getPostgresReplicaSchemaName, getWorkflowDedupTableName, openHiTagKey };
1970
+ export { type BuildParameterNameProps, ChildHostedZone, type ChildHostedZoneProps, CognitoUserPool, CognitoUserPoolClient, CognitoUserPoolDomain, CognitoUserPoolKmsKey, ControlEventBus, DATA_STORE_CHANGE_DETAIL_MAX_UTF8_BYTES, DATA_STORE_CHANGE_DETAIL_TYPE, DATA_STORE_CHANGE_EVENT_SOURCE, DEMO_DATA_PLANE_FIXTURES, DataEventBus, DataStoreHistoricalArchive, type DataStoreHistoricalArchiveProps, DataStorePostgresReplica, type DataStorePostgresReplicaProps, type DemoWorkspaceDataPlaneFixtures, DiscoverableStringParameter, type DiscoverableStringParameterProps, DynamoDbDataStore, type DynamoDbDataStoreProps, type FhirCurrentResourceChangeDetail, type GrantConsumerOptions, OPENHI_TAG_SUFFIX_BRANCH_NAME, OPENHI_TAG_SUFFIX_REPO_NAME, OPENHI_TAG_SUFFIX_SERVICE_TYPE, OPENHI_TAG_SUFFIX_STAGE_TYPE, OpenHiApp, type OpenHiAppProps, OpenHiAuthService, type OpenHiAuthServiceProps, OpenHiDataService, type OpenHiDataServiceProps, OpenHiEnvironment, type OpenHiEnvironmentProps, OpenHiGlobalService, type OpenHiGlobalServiceProps, OpenHiGraphqlService, type OpenHiGraphqlServiceProps, OpenHiRestApiService, type OpenHiRestApiServiceProps, OpenHiService, type OpenHiServiceProps, type OpenHiServiceType, OpenHiStage, type OpenHiStageProps, OpsEventBus, OwningDeleteCascadeLambdas, type OwningDeleteCascadeLambdasProps, OwningDeleteCascadeWorkflow, type OwningDeleteCascadeWorkflowProps, POSTGRES_REPLICA_CLUSTER_ARN_SSM_NAME, POSTGRES_REPLICA_DATABASE_NAME_SSM_NAME, POSTGRES_REPLICA_SECRET_ARN_SSM_NAME, PlatformDeployBridge, PlatformDeployBridgeLambda, type PlatformDeployBridgeLambdaProps, type PlatformDeployBridgeProps, PostAuthenticationLambda, PostConfirmationLambda, type PostConfirmationLambdaProps, PreTokenGenerationLambda, type PreTokenGenerationLambdaProps, ProvisionDefaultWorkspaceLambda, type ProvisionDefaultWorkspaceLambdaProps, REST_API_BASE_URL_SSM_NAME, RenameCascadeLambdas, type RenameCascadeLambdasProps, RenameCascadeWorkflow, type RenameCascadeWorkflowProps, RootGraphqlApi, type RootGraphqlApiProps, RootHostedZone, RootHttpApi, type RootHttpApiProps, RootWildcardCertificate, SEED_SYSTEM_DATA_ACTOR_SYSTEM, SEED_SYSTEM_DATA_CONSUMER_NAME, SEED_SYSTEM_DATA_CONTROL_BUS_ENV_VAR, STATIC_HOSTING_SERVICE_TYPE, SeedDemoDataLambda, type SeedDemoDataLambdaProps, SeedDemoDataWorkflow, type SeedDemoDataWorkflowProps, SeedSystemDataLambda, type SeedSystemDataLambdaProps, SeedSystemDataWorkflow, type SeedSystemDataWorkflowProps, StaticHosting, type StaticHostingProps, UserOnboardingWorkflow, type UserOnboardingWorkflowProps, WorkflowDedupConsumerNameInvalidError, WorkflowDedupTable, WorkflowDedupTableDuplicateError, type WorkflowDedupTableProps, buildFhirCurrentResourceChangeDetail, getDynamoDbDataStoreTableName, getPostgresReplicaSchemaName, getWorkflowDedupTableName, openHiTagKey };