@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
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';
@@ -20,16 +20,17 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2';
20
20
  import * as rds from 'aws-cdk-lib/aws-rds';
21
21
  import { HostedZone, HostedZoneProps, IHostedZone, HostedZoneAttributes } from 'aws-cdk-lib/aws-route53';
22
22
  import { StringParameterProps, StringParameter } from 'aws-cdk-lib/aws-ssm';
23
- import { Distribution, DistributionProps } from 'aws-cdk-lib/aws-cloudfront';
23
+ import { Distribution, DistributionProps, CachePolicyProps } from 'aws-cdk-lib/aws-cloudfront';
24
+ import { HostingMode } from './static-hosting.viewer-request-handler.mjs';
24
25
  export { C as CascadeChunkInput, a as CascadeFinalizeInput, b as CascadeFinalizeOutput, c as CascadeListInput, d as CascadeListOutput, O as OWNING_DELETE_CASCADE_CONSUMER_NAME, e as OWNING_DELETE_CASCADE_DEFAULT_CONCURRENCY, f as OWNING_DELETE_CASCADE_STUCK_THRESHOLD_MINUTES, g as OWNING_DELETE_OPS_EVENT_BUS_ENV_VAR } from './events-CjS-sm0W.mjs';
25
26
  import { StateMachine } from 'aws-cdk-lib/aws-stepfunctions';
26
27
  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
28
  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';
29
+ import { Patient, Practitioner, Observation, Encounter, Account } from '@openhi/types';
30
+ 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
31
  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
32
  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
33
  import '@aws-sdk/client-dynamodb';
32
- import '@openhi/types';
33
34
  import 'aws-lambda';
34
35
 
35
36
  /**
@@ -245,7 +246,7 @@ declare class OpenHiApp extends App {
245
246
  *
246
247
  * @public
247
248
  */
248
- type OpenHiServiceType = "auth" | "rest-api" | "data" | "global" | "graphql-api";
249
+ type OpenHiServiceType = "auth" | "rest-api" | "data" | "global" | "graphql-api" | "website";
249
250
  /**
250
251
  * Tag-key suffixes applied by every OpenHiService stack via Tags.of().
251
252
  * Full keys are composed `${appName}:${suffix}` — see {@link openHiTagKey}.
@@ -420,47 +421,6 @@ declare class RootGraphqlApi extends GraphqlApi {
420
421
  constructor(scope: Construct, props?: Omit<RootGraphqlApiProps, "name">);
421
422
  }
422
423
 
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
424
  /**
465
425
  * @see sites/www-docs/content/packages/@openhi/constructs/components/cognito/cognito-user-pool.md
466
426
  */
@@ -1007,6 +967,79 @@ declare class DiscoverableStringParameter extends StringParameter {
1007
967
  constructor(scope: Construct, id: string, props: DiscoverableStringParameterProps);
1008
968
  }
1009
969
 
970
+ /**
971
+ * @see sites/www-docs/content/packages/@openhi/constructs/components/static-hosting/static-content.md
972
+ */
973
+ /*******************************************************************************
974
+ *
975
+ * STATIC CONTENT UPLOADER
976
+ *
977
+ * This construct uploads a directory of content from a local location into S3.
978
+ *
979
+ * To support PR and branch specific builds, each S3 bucket can store content
980
+ * for multiple domains and builds, using the following format:
981
+ *
982
+ * S3-bucket/<sub-domain>.<full-domain>/*
983
+ *
984
+ * A bucket used to store content for stage.openhi.org might have the
985
+ * following directory structure (all in the same bucket):
986
+ *
987
+ * /www.stage.openhi.org/* -> serves content to www.stage.openhi.org
988
+ * /feature-7.stage.openhi.org/* -> serves content to feature-7.stage.openhi.org
989
+ * /pr-123.stage.openhi.org/* -> serves content to pr-123.stage.openhi.org
990
+ *
991
+ ******************************************************************************/
992
+ /**
993
+ * Props for the StaticContent construct.
994
+ */
995
+ interface StaticContentProps {
996
+ /**
997
+ * Absolute path to directory containing content for the website.
998
+ */
999
+ readonly contentSourceDirectory: string;
1000
+ /**
1001
+ * Directory to place content into. Should start with a slash.
1002
+ * Example: '/widget'
1003
+ *
1004
+ * @default "/"
1005
+ */
1006
+ readonly contentDestinationDirectory?: string;
1007
+ /**
1008
+ * The sub domain prefix (e.g. "feature-7"). Used as the per-branch folder
1009
+ * name in the bucket so each branch deploys to its own prefix.
1010
+ *
1011
+ * @default the current stack's branch name (kebab-cased)
1012
+ */
1013
+ readonly subDomain?: string;
1014
+ /**
1015
+ * The full domain (e.g. "stage.openhi.org"). Used together with
1016
+ * `subDomain` to form the destination prefix
1017
+ * `<sub-domain>.<full-domain>`.
1018
+ */
1019
+ readonly fullDomain: string;
1020
+ /**
1021
+ * Service type used to look up the static-hosting bucket ARN via
1022
+ * DiscoverableStringParameter.
1023
+ *
1024
+ * @default STATIC_HOSTING_SERVICE_TYPE ("website")
1025
+ */
1026
+ readonly serviceType?: string;
1027
+ }
1028
+ /**
1029
+ * Static content uploader: deploys a local directory to the static-hosting
1030
+ * S3 bucket under `<sub-domain>.<full-domain>/<dest>` so each branch
1031
+ * deploys to its own prefix without clobbering siblings. The bucket ARN is
1032
+ * looked up via DiscoverableStringParameter so the uploader can run on a
1033
+ * feature-branch stack while the bucket itself was provisioned by the
1034
+ * release-branch service stack.
1035
+ */
1036
+ declare class StaticContent extends Construct {
1037
+ constructor(scope: Construct, id: string, props: StaticContentProps);
1038
+ }
1039
+
1040
+ /**
1041
+ * @see sites/www-docs/content/packages/@openhi/constructs/components/static-hosting/static-hosting.md
1042
+ */
1010
1043
  /**
1011
1044
  * Service type for the website service. Used in SSM parameter paths and by
1012
1045
  * OpenHiWebsiteService for fromConstruct() lookups.
@@ -1021,21 +1054,61 @@ interface StaticHostingProps {
1021
1054
  */
1022
1055
  readonly bucketProps?: Omit<BucketProps, "bucketName">;
1023
1056
  /**
1024
- * Optional CloudFront distribution props. Do not enable invalidation.
1025
- * Default TTL is 10 seconds via a custom cache policy.
1057
+ * Optional CloudFront distribution props. Defaults wire a custom cache
1058
+ * policy (60s/300s with gzip+brotli), `REDIRECT_TO_HTTPS`, and
1059
+ * `ALLOW_GET_HEAD_OPTIONS` on the default behavior; overrides apply on top.
1026
1060
  */
1027
1061
  readonly distributionProps?: Omit<DistributionProps, "defaultBehavior" | "defaultRootObject">;
1062
+ /**
1063
+ * Optional cache policy overrides. Defaults: `defaultTtl=60s`, `maxTtl=300s`,
1064
+ * `minTtl=0s`, gzip+brotli enabled, no headers/cookies/query strings cached.
1065
+ */
1066
+ readonly cachePolicyProps?: Omit<CachePolicyProps, "cachePolicyName">;
1067
+ /**
1068
+ * Wildcard certificate to attach to the CloudFront distribution. When
1069
+ * supplied together with `hostedZone` and `domainNames`, CloudFront serves
1070
+ * the listed domains and Route53 ARecords are created in the zone.
1071
+ *
1072
+ * @default - no custom certificate; CloudFront default domain is served
1073
+ */
1074
+ readonly certificate?: ICertificate;
1075
+ /**
1076
+ * Hosted zone to create Route53 ARecords in. Required together with
1077
+ * `certificate` and `domainNames` to attach a custom domain.
1078
+ */
1079
+ readonly hostedZone?: IHostedZone;
1080
+ /**
1081
+ * Domain names to attach to the CloudFront distribution. Each name also
1082
+ * gets an ARecord in `hostedZone`.
1083
+ */
1084
+ readonly domainNames?: ReadonlyArray<string>;
1085
+ /**
1086
+ * Selects how path-like URIs are rewritten by the viewer-request
1087
+ * Lambda@Edge handler.
1088
+ *
1089
+ * - `spa` (default): path-like URIs rewrite to `/index.html`.
1090
+ * - `static`: path-like URIs append `/index.html`.
1091
+ *
1092
+ * @default "spa"
1093
+ */
1094
+ readonly hostingMode?: HostingMode;
1028
1095
  /**
1029
1096
  * Service type for SSM parameter paths.
1097
+ *
1030
1098
  * @default STATIC_HOSTING_SERVICE_TYPE ("website")
1031
1099
  */
1032
1100
  readonly serviceType?: string;
1101
+ /**
1102
+ * Optional human-readable description used in distribution comment and
1103
+ * SSM parameter descriptions.
1104
+ */
1105
+ readonly description?: string;
1033
1106
  }
1034
1107
  /**
1035
1108
  * Static hosting: S3 bucket (private) + CloudFront distribution with Origin
1036
- * Access Control (OAC). Stores bucket ARN and distribution ARN in SSM via
1037
- * DiscoverableStringParameter for cross-stack lookup. No cache invalidation;
1038
- * default TTL 10 seconds.
1109
+ * Access Control (OAC) + Lambda@Edge viewer-request handler. Publishes
1110
+ * bucket ARN, distribution ARN, distribution domain, and distribution ID
1111
+ * via DiscoverableStringParameter for cross-stack lookup.
1039
1112
  */
1040
1113
  declare class StaticHosting extends Construct {
1041
1114
  /**
@@ -1046,8 +1119,18 @@ declare class StaticHosting extends Construct {
1046
1119
  * SSM parameter name for the CloudFront distribution ARN.
1047
1120
  */
1048
1121
  static readonly SSM_PARAM_NAME_DISTRIBUTION_ARN = "STATIC_HOSTING_DISTRIBUTION_ARN";
1122
+ /**
1123
+ * SSM parameter name for the CloudFront distribution domain
1124
+ * (e.g. dXXXXX.cloudfront.net).
1125
+ */
1126
+ static readonly SSM_PARAM_NAME_DISTRIBUTION_DOMAIN = "STATIC_HOSTING_DISTRIBUTION_DOMAIN";
1127
+ /**
1128
+ * SSM parameter name for the CloudFront distribution ID.
1129
+ */
1130
+ static readonly SSM_PARAM_NAME_DISTRIBUTION_ID = "STATIC_HOSTING_DISTRIBUTION_ID";
1049
1131
  readonly bucket: IBucket;
1050
1132
  readonly distribution: Distribution;
1133
+ readonly viewerRequestHandler: NodejsFunction;
1051
1134
  constructor(scope: Construct, id: string, props?: StaticHostingProps);
1052
1135
  }
1053
1136
 
@@ -1131,17 +1214,6 @@ declare class OpenHiAuthService extends OpenHiService {
1131
1214
  * Returns an IUserPoolClient by looking up the Auth stack's User Pool Client ID from SSM.
1132
1215
  */
1133
1216
  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
1217
  /**
1146
1218
  * Returns an IUserPoolDomain by looking up the Auth stack's User Pool Domain from SSM.
1147
1219
  */
@@ -1161,12 +1233,6 @@ declare class OpenHiAuthService extends OpenHiService {
1161
1233
  readonly userPool: IUserPool;
1162
1234
  readonly userPoolClient: IUserPoolClient;
1163
1235
  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
1236
  /**
1171
1237
  * Cross-stack reference to the data store table. Cached so repeated
1172
1238
  * lookups share a single CDK construct id ("dynamo-db-data-store") in
@@ -1245,18 +1311,6 @@ declare class OpenHiAuthService extends OpenHiService {
1245
1311
  * Override to customize.
1246
1312
  */
1247
1313
  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
1314
  /**
1261
1315
  * Creates the User Pool Domain (Cognito hosted UI) and exports domain name to SSM.
1262
1316
  * Look up via {@link OpenHiAuthService.userPoolDomainFromConstruct}.
@@ -1522,12 +1576,69 @@ declare class OpenHiRestApiService extends OpenHiService {
1522
1576
  protected createRootHttpApi(domainName: DomainName): RootHttpApi;
1523
1577
  }
1524
1578
 
1579
+ /**
1580
+ * @see sites/www-docs/content/packages/@openhi/constructs/workflows/control-plane/seed-demo-data/data-plane-fixtures.md
1581
+ *
1582
+ * Hand-authored FHIR data-plane fixture bodies the `seed-demo-data`
1583
+ * workflow upserts into the data store on every non-prod deploy.
1584
+ * Mirrors the OPS-009 v1 resource set: Patient, Practitioner,
1585
+ * Observation, Encounter, Account.
1586
+ *
1587
+ * Ids are deterministic — re-fires of the workflow upsert the same
1588
+ * records, satisfying the workflow's idempotency contract (no
1589
+ * duplicates) and letting the IAM grant in `seed-demo-data-lambda.ts`
1590
+ * enumerate exact-match `dynamodb:LeadingKeys` rather than a wildcard.
1591
+ *
1592
+ * The placeholder tenant carries no data-plane fixtures — only the
1593
+ * three real demo tenants (wound-care, primary-care, mixed) get
1594
+ * Patient/Practitioner/Observation/Encounter/Account records. The
1595
+ * placeholder tenant exists solely as a routing target for the
1596
+ * Cognito pre-token-generation fallback and never holds clinical
1597
+ * data.
1598
+ */
1599
+ /**
1600
+ * Logical group of FHIR resources owned by a single (tenant, workspace)
1601
+ * pair. The workflow walks `DEMO_DATA_PLANE_FIXTURES` and writes every
1602
+ * entry against the matching workspace's `OpenHiContext`.
1603
+ */
1604
+ interface DemoWorkspaceDataPlaneFixtures {
1605
+ readonly tenantId: string;
1606
+ readonly workspaceId: string;
1607
+ /**
1608
+ * Scenario slug used in the demo-URN identifier — mirrors the
1609
+ * `DemoTenantSpec.scenario` value for the parent tenant. For the
1610
+ * mixed tenant both workspaces share the `demo-mixed` scenario.
1611
+ */
1612
+ readonly scenario: string;
1613
+ readonly patients: ReadonlyArray<Patient>;
1614
+ readonly practitioners: ReadonlyArray<Practitioner>;
1615
+ readonly observations: ReadonlyArray<Observation>;
1616
+ readonly encounters: ReadonlyArray<Encounter>;
1617
+ readonly accounts: ReadonlyArray<Account>;
1618
+ }
1619
+ /**
1620
+ * Per-workspace fixtures the data-plane phase writes on every fire.
1621
+ * The placeholder tenant carries no fixtures. The mixed tenant carries
1622
+ * one fixture group per workspace; the two single-workspace tenants
1623
+ * carry one each. Total: 4 fixture groups × ≈ 9 resources = ~36
1624
+ * data-plane records.
1625
+ *
1626
+ * Ids embed the tenant + workspace slug so they remain unambiguous
1627
+ * across the four workspaces (the FHIR resource id is the only thing
1628
+ * that survives into the partition key, so a duplicate id across
1629
+ * workspaces would still collide on read paths that scan-by-id).
1630
+ */
1631
+ declare const DEMO_DATA_PLANE_FIXTURES: ReadonlyArray<DemoWorkspaceDataPlaneFixtures>;
1632
+
1525
1633
  interface SeedDemoDataLambdaProps {
1526
1634
  /**
1527
1635
  * 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.
1636
+ * Wired via `DYNAMO_TABLE_NAME` env var; granted `dynamodb:GetItem`
1637
+ * (pre-flight Role lookup) and `dynamodb:PutItem`/`dynamodb:UpdateItem`
1638
+ * (write phase). The grants are scoped to the table ARN only; the
1639
+ * handler itself is the scope guarantee for which records the
1640
+ * workflow touches (see the construct body for the previous
1641
+ * `LeadingKeys`-based grants and the reason they were dropped).
1531
1642
  */
1532
1643
  readonly dataStoreTable: ITable;
1533
1644
  /**
@@ -1796,6 +1907,141 @@ declare class OpenHiGraphqlService extends OpenHiService {
1796
1907
  protected createRootGraphqlApi(): RootGraphqlApi;
1797
1908
  }
1798
1909
 
1910
+ /**
1911
+ * @see sites/www-docs/content/packages/@openhi/constructs/services/open-hi-website-service.md
1912
+ */
1913
+ interface OpenHiWebsiteServiceProps extends OpenHiServiceProps {
1914
+ /**
1915
+ * Sub-domain prefix attached to the child zone (e.g. "www" -> "www.<zone>").
1916
+ *
1917
+ * @default "www"
1918
+ */
1919
+ readonly domainPrefix?: string;
1920
+ /**
1921
+ * Absolute path to the local directory whose contents should be uploaded
1922
+ * to the static-hosting bucket. Required.
1923
+ */
1924
+ readonly contentSourceDirectory: string;
1925
+ /**
1926
+ * Path under the per-branch destination prefix to upload into. Should start
1927
+ * with a slash.
1928
+ *
1929
+ * @default "/"
1930
+ */
1931
+ readonly contentDestinationDirectory?: string;
1932
+ /**
1933
+ * Force the `StaticHosting` infrastructure (bucket + distribution +
1934
+ * Lambda@Edge + DNS + 4 SSM params) to be created on this branch even when
1935
+ * it is not the release branch. Useful for one-off bootstraps and tests.
1936
+ *
1937
+ * When omitted, hosting infrastructure is created only on
1938
+ * `defaultReleaseBranch`. The `StaticContent` uploader is always
1939
+ * created so feature branches can publish their content under their own
1940
+ * sub-domain folder against the release-branch bucket.
1941
+ *
1942
+ * @default - true on release branch, false otherwise
1943
+ */
1944
+ readonly createHostingInfrastructure?: boolean;
1945
+ }
1946
+ /**
1947
+ * SSM parameter name suffix for the website's full domain
1948
+ * (e.g. www.example.com).
1949
+ */
1950
+ declare const SSM_PARAM_NAME_FULL_DOMAIN = "WEBSITE_FULL_DOMAIN";
1951
+ /**
1952
+ * Website service stack: composes StaticHosting (only on release-branch
1953
+ * deploys) and StaticContent (always) so feature branches can ship their
1954
+ * content to a per-branch sub-domain folder against the release-branch
1955
+ * bucket without provisioning duplicate infrastructure.
1956
+ *
1957
+ * Resources are created in protected methods; subclasses may override to
1958
+ * customize.
1959
+ */
1960
+ declare class OpenHiWebsiteService extends OpenHiService {
1961
+ static readonly SERVICE_TYPE: "website";
1962
+ /**
1963
+ * Looks up the static-hosting bucket ARN published by the release-branch
1964
+ * deploy of this service.
1965
+ */
1966
+ static bucketArnFromConstruct(scope: Construct): string;
1967
+ /**
1968
+ * Looks up the CloudFront distribution ARN published by the release-branch
1969
+ * deploy of this service.
1970
+ */
1971
+ static distributionArnFromConstruct(scope: Construct): string;
1972
+ /**
1973
+ * Looks up the CloudFront distribution domain
1974
+ * (e.g. dXXXXX.cloudfront.net) published by the release-branch deploy.
1975
+ */
1976
+ static distributionDomainFromConstruct(scope: Construct): string;
1977
+ /**
1978
+ * Looks up the CloudFront distribution ID published by the release-branch
1979
+ * deploy of this service.
1980
+ */
1981
+ static distributionIdFromConstruct(scope: Construct): string;
1982
+ /**
1983
+ * Looks up the website's full domain (e.g. www.example.com) published by
1984
+ * the release-branch deploy of this service.
1985
+ */
1986
+ static fullDomainFromConstruct(scope: Construct): string;
1987
+ get serviceType(): string;
1988
+ /** Override so this.props is typed with this service's options. */
1989
+ props: OpenHiWebsiteServiceProps;
1990
+ /**
1991
+ * Full domain served by this website (e.g. www.example.com). Derived from
1992
+ * `domainPrefix` and the child hosted zone name.
1993
+ */
1994
+ readonly fullDomain: string;
1995
+ /**
1996
+ * The hosting construct, only created on release-branch deploys (or when
1997
+ * `createHostingInfrastructure` is true).
1998
+ */
1999
+ readonly staticHosting?: StaticHosting;
2000
+ /**
2001
+ * The content uploader, always created.
2002
+ */
2003
+ readonly staticContent: StaticContent;
2004
+ constructor(ohEnv: OpenHiEnvironment, props: OpenHiWebsiteServiceProps);
2005
+ /**
2006
+ * Validates that config required for the website stack is present.
2007
+ */
2008
+ protected validateConfig(props: OpenHiWebsiteServiceProps): void;
2009
+ /**
2010
+ * Looks up the child hosted zone published by the Global service.
2011
+ * Override to customize.
2012
+ */
2013
+ protected createHostedZone(): IHostedZone;
2014
+ /**
2015
+ * Returns the wildcard certificate looked up from the Global service.
2016
+ * Override to customize.
2017
+ */
2018
+ protected createCertificate(): ICertificate;
2019
+ /**
2020
+ * Computes the full website domain from `domainPrefix` and the child
2021
+ * zone name.
2022
+ */
2023
+ protected computeFullDomain(hostedZone: IHostedZone): string;
2024
+ /**
2025
+ * Creates the StaticHosting infrastructure (bucket + distribution +
2026
+ * Lambda@Edge + 4 SSM params + DNS).
2027
+ */
2028
+ protected createStaticHosting(deps: {
2029
+ certificate: ICertificate;
2030
+ hostedZone: IHostedZone;
2031
+ }): StaticHosting;
2032
+ /**
2033
+ * Creates the SSM parameter that publishes the website's full domain.
2034
+ * Look up via {@link OpenHiWebsiteService.fullDomainFromConstruct}.
2035
+ */
2036
+ protected createFullDomainParameter(): void;
2037
+ /**
2038
+ * Creates the StaticContent uploader. Always created so feature-branch
2039
+ * deploys can publish content to their own sub-domain folder against the
2040
+ * release-branch bucket.
2041
+ */
2042
+ protected createStaticContent(): StaticContent;
2043
+ }
2044
+
1799
2045
  interface OwningDeleteCascadeLambdasProps {
1800
2046
  /** Data-store table the cascade reads (Query) and writes (DeleteItem / TransactWriteItems) against. */
1801
2047
  readonly dataStoreTable: ITable;
@@ -1980,4 +2226,4 @@ declare class RenameCascadeWorkflow extends Construct {
1980
2226
  constructor(scope: Construct, props: RenameCascadeWorkflowProps);
1981
2227
  }
1982
2228
 
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 };
2229
+ 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, HostingMode, 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, OpenHiWebsiteService, type OpenHiWebsiteServiceProps, 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, SSM_PARAM_NAME_FULL_DOMAIN, STATIC_HOSTING_SERVICE_TYPE, SeedDemoDataLambda, type SeedDemoDataLambdaProps, SeedDemoDataWorkflow, type SeedDemoDataWorkflowProps, SeedSystemDataLambda, type SeedSystemDataLambdaProps, SeedSystemDataWorkflow, type SeedSystemDataWorkflowProps, StaticContent, type StaticContentProps, StaticHosting, type StaticHostingProps, UserOnboardingWorkflow, type UserOnboardingWorkflowProps, WorkflowDedupConsumerNameInvalidError, WorkflowDedupTable, WorkflowDedupTableDuplicateError, type WorkflowDedupTableProps, buildFhirCurrentResourceChangeDetail, getDynamoDbDataStoreTableName, getPostgresReplicaSchemaName, getWorkflowDedupTableName, openHiTagKey };