@openhi/constructs 0.0.0 → 0.0.1

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 (101) hide show
  1. package/lib/chunk-LZOMFHX3.mjs +38 -0
  2. package/lib/chunk-LZOMFHX3.mjs.map +1 -0
  3. package/lib/index.d.mts +664 -0
  4. package/lib/index.d.ts +745 -3
  5. package/lib/index.js +1133 -19
  6. package/lib/index.js.map +1 -0
  7. package/lib/index.mjs +1120 -0
  8. package/lib/index.mjs.map +1 -0
  9. package/lib/rest-api-lambda.handler.d.mts +6 -0
  10. package/lib/rest-api-lambda.handler.d.ts +6 -0
  11. package/lib/rest-api-lambda.handler.js +677 -0
  12. package/lib/rest-api-lambda.handler.js.map +1 -0
  13. package/lib/rest-api-lambda.handler.mjs +646 -0
  14. package/lib/rest-api-lambda.handler.mjs.map +1 -0
  15. package/package.json +37 -28
  16. package/lib/app/index.d.ts +0 -4
  17. package/lib/app/index.js +0 -21
  18. package/lib/app/open-hi-app.d.ts +0 -85
  19. package/lib/app/open-hi-app.js +0 -127
  20. package/lib/app/open-hi-environment.d.ts +0 -59
  21. package/lib/app/open-hi-environment.js +0 -72
  22. package/lib/app/open-hi-service.d.ts +0 -169
  23. package/lib/app/open-hi-service.js +0 -195
  24. package/lib/app/open-hi-stage.d.ts +0 -71
  25. package/lib/app/open-hi-stage.js +0 -70
  26. package/lib/components/acm/root-wildcard-certificate.d.ts +0 -15
  27. package/lib/components/acm/root-wildcard-certificate.js +0 -35
  28. package/lib/components/api-gateway/core-http-api.d.ts +0 -10
  29. package/lib/components/api-gateway/core-http-api.js +0 -44
  30. package/lib/components/api-gateway/http-lambda-integration-no-permissions.d.ts +0 -18
  31. package/lib/components/api-gateway/http-lambda-integration-no-permissions.js +0 -26
  32. package/lib/components/app-sync/core-graphql-api.d.ts +0 -12
  33. package/lib/components/app-sync/core-graphql-api.js +0 -54
  34. package/lib/components/auth.d.ts +0 -75
  35. package/lib/components/auth.js +0 -100
  36. package/lib/components/cognito/core-user-pool-client.d.ts +0 -10
  37. package/lib/components/cognito/core-user-pool-client.js +0 -47
  38. package/lib/components/cognito/core-user-pool-domain.d.ts +0 -10
  39. package/lib/components/cognito/core-user-pool-domain.js +0 -41
  40. package/lib/components/cognito/core-user-pool-kms-key.d.ts +0 -10
  41. package/lib/components/cognito/core-user-pool-kms-key.js +0 -37
  42. package/lib/components/cognito/core-user-pool.d.ts +0 -10
  43. package/lib/components/cognito/core-user-pool.js +0 -54
  44. package/lib/components/core.d.ts +0 -102
  45. package/lib/components/core.js +0 -79
  46. package/lib/components/dynamodb/dynamo-db-data-store.d.ts +0 -33
  47. package/lib/components/dynamodb/dynamo-db-data-store.js +0 -107
  48. package/lib/components/event-bridge/data-event-bus.d.ts +0 -19
  49. package/lib/components/event-bridge/data-event-bus.js +0 -34
  50. package/lib/components/event-bridge/ops-event-bus.d.ts +0 -19
  51. package/lib/components/event-bridge/ops-event-bus.js +0 -34
  52. package/lib/components/global.d.ts +0 -36
  53. package/lib/components/global.js +0 -63
  54. package/lib/components/index.d.ts +0 -1
  55. package/lib/components/index.js +0 -18
  56. package/lib/components/route-53/child-hosted-zone.d.ts +0 -20
  57. package/lib/components/route-53/child-hosted-zone.js +0 -48
  58. package/lib/components/route-53/root-hosted-zone.d.ts +0 -10
  59. package/lib/components/route-53/root-hosted-zone.js +0 -20
  60. package/lib/components/ssm/discoverable-string-parameter.d.ts +0 -59
  61. package/lib/components/ssm/discoverable-string-parameter.js +0 -50
  62. package/lib/components/ssm/index.d.ts +0 -1
  63. package/lib/components/ssm/index.js +0 -18
  64. package/lib/data/dynamo/ehr/r4/Patient.d.ts +0 -180
  65. package/lib/data/dynamo/ehr/r4/Patient.js +0 -192
  66. package/lib/data/dynamo/ehr/r4/ehr-r4-data-service.d.ts +0 -162
  67. package/lib/data/dynamo/ehr/r4/ehr-r4-data-service.js +0 -37
  68. package/lib/data/hello-world.d.ts +0 -39
  69. package/lib/data/hello-world.js +0 -59
  70. package/lib/data/import-patient-with-dynalite.d.ts +0 -1
  71. package/lib/data/import-patient-with-dynalite.js +0 -87
  72. package/lib/data/import-patient.d.ts +0 -47
  73. package/lib/data/import-patient.js +0 -158
  74. package/lib/data/lambda/rest-api-lambda.d.ts +0 -13
  75. package/lib/data/lambda/rest-api-lambda.handler.d.ts +0 -1
  76. package/lib/data/lambda/rest-api-lambda.handler.js +0 -10
  77. package/lib/data/lambda/rest-api-lambda.js +0 -22
  78. package/lib/data/middleware/open-hi-context.d.ts +0 -13
  79. package/lib/data/middleware/open-hi-context.js +0 -31
  80. package/lib/data/rest-api/ehr/r4/Patient.d.ts +0 -16
  81. package/lib/data/rest-api/ehr/r4/Patient.js +0 -234
  82. package/lib/data/rest-api/rest-api-local.d.ts +0 -1
  83. package/lib/data/rest-api/rest-api-local.js +0 -8
  84. package/lib/data/rest-api/rest-api-mockdata.d.ts +0 -7
  85. package/lib/data/rest-api/rest-api-mockdata.js +0 -585
  86. package/lib/data/rest-api/rest-api.d.ts +0 -3
  87. package/lib/data/rest-api/rest-api.js +0 -26
  88. package/lib/lib/compression.d.ts +0 -27
  89. package/lib/lib/compression.js +0 -87
  90. package/lib/services/index.d.ts +0 -5
  91. package/lib/services/index.js +0 -22
  92. package/lib/services/open-hi-auth-service.d.ts +0 -31
  93. package/lib/services/open-hi-auth-service.js +0 -31
  94. package/lib/services/open-hi-core-service.d.ts +0 -15
  95. package/lib/services/open-hi-core-service.js +0 -38
  96. package/lib/services/open-hi-data-service.d.ts +0 -18
  97. package/lib/services/open-hi-data-service.js +0 -18
  98. package/lib/services/open-hi-global-service.d.ts +0 -15
  99. package/lib/services/open-hi-global-service.js +0 -44
  100. package/lib/services/open-hi-rest-api-service.d.ts +0 -17
  101. package/lib/services/open-hi-rest-api-service.js +0 -107
@@ -0,0 +1,38 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __commonJS = (cb, mod) => function __require2() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
33
+ export {
34
+ __require,
35
+ __commonJS,
36
+ __toESM
37
+ };
38
+ //# sourceMappingURL=chunk-LZOMFHX3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,664 @@
1
+ import { OPEN_HI_STAGE, OPEN_HI_DEPLOYMENT_TARGET_ROLE, OpenHiEnvironmentConfig, OpenHiConfig } from '@openhi/config';
2
+ import { Stage, StageProps, App, AppProps, Stack, StackProps, RemovalPolicy } from 'aws-cdk-lib';
3
+ import { IConstruct, Construct } from 'constructs';
4
+ import { HttpApiProps, HttpApi, IHttpApi } from 'aws-cdk-lib/aws-apigatewayv2';
5
+ import { GraphqlApiProps } from 'aws-cdk-lib/aws-appsync';
6
+ import { EventBusProps } from 'aws-cdk-lib/aws-events';
7
+ import { StringParameterProps, StringParameter } from 'aws-cdk-lib/aws-ssm';
8
+ import { UserPoolProps, IUserPool, IUserPoolClient, IUserPoolDomain } from 'aws-cdk-lib/aws-cognito';
9
+ import { IKey } from 'aws-cdk-lib/aws-kms';
10
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
11
+ import { HostedZoneAttributes, IHostedZone } from 'aws-cdk-lib/aws-route53';
12
+ import { SetOptional } from 'type-fest';
13
+ import { ITable } from 'aws-cdk-lib/aws-dynamodb';
14
+
15
+ /**
16
+ * Properties for creating an OpenHiStage instance.
17
+ */
18
+ interface OpenHiStageProps extends StageProps {
19
+ /**
20
+ * The type of the OpenHi stage.
21
+ */
22
+ readonly stageType: (typeof OPEN_HI_STAGE)[keyof typeof OPEN_HI_STAGE];
23
+ }
24
+ /**
25
+ * Represents a deployment stage in the OpenHi infrastructure hierarchy.
26
+ */
27
+ declare class OpenHiStage extends Stage {
28
+ /**
29
+ * The OpenHiApp that this stage belongs to.
30
+ *
31
+ * @public
32
+ */
33
+ ohApp: OpenHiApp;
34
+ /**
35
+ * Properties for configuring the stage.
36
+ *
37
+ * @public
38
+ */
39
+ props: OpenHiStageProps;
40
+ /**
41
+ * Finds the OpenHiStage that contains the given construct.
42
+ */
43
+ static of(construct: IConstruct): OpenHiStage | undefined;
44
+ /**
45
+ * Type guard to check if a value is an OpenHiStage instance.
46
+ */
47
+ static isOpenHiStage(this: void, x: any): x is OpenHiStage;
48
+ /**
49
+ * The type of this OpenHi stage.
50
+ */
51
+ readonly stageType: (typeof OPEN_HI_STAGE)[keyof typeof OPEN_HI_STAGE];
52
+ /**
53
+ * Creates a new OpenHiStage instance.
54
+ */
55
+ constructor(
56
+ /**
57
+ * The OpenHiApp that this stage belongs to.
58
+ *
59
+ * @public
60
+ */
61
+ ohApp: OpenHiApp,
62
+ /**
63
+ * Properties for configuring the stage.
64
+ *
65
+ * @public
66
+ */
67
+ props: OpenHiStageProps);
68
+ /**
69
+ * Gets all OpenHiEnvironment instances contained within this stage.
70
+ */
71
+ get environments(): Array<OpenHiEnvironment>;
72
+ /**
73
+ * Gets the primary OpenHiEnvironment for this stage, if one exists.
74
+ */
75
+ get primaryEnvironment(): OpenHiEnvironment | undefined;
76
+ /**
77
+ * Gets all secondary OpenHiEnvironment instances for this stage.
78
+ */
79
+ get secondaryEnvironments(): Array<OpenHiEnvironment>;
80
+ }
81
+
82
+ /**
83
+ * Properties for creating an OpenHiEnvironment.
84
+ */
85
+ interface OpenHiEnvironmentProps extends StageProps {
86
+ /**
87
+ * The deployment target role for this (account, region).
88
+ */
89
+ readonly deploymentTargetRole: (typeof OPEN_HI_DEPLOYMENT_TARGET_ROLE)[keyof typeof OPEN_HI_DEPLOYMENT_TARGET_ROLE];
90
+ /**
91
+ * Configuration for this specific environment.
92
+ */
93
+ readonly config: OpenHiEnvironmentConfig;
94
+ }
95
+ /**
96
+ * Represents an OpenHi environment within an AWS CDK stage.
97
+ */
98
+ declare class OpenHiEnvironment extends Stage {
99
+ /**
100
+ * The OpenHiStage that contains this environment.
101
+ */
102
+ ohStage: OpenHiStage;
103
+ /**
104
+ * Properties for creating the environment.
105
+ */
106
+ props: OpenHiEnvironmentProps;
107
+ /**
108
+ * Finds the OpenHiEnvironment that contains the given construct.
109
+ * ```
110
+ */
111
+ static of(construct: IConstruct): OpenHiEnvironment | undefined;
112
+ /**
113
+ * Type guard to check if a value is an OpenHiEnvironment instance.
114
+ */
115
+ static isOpenHiEnvironment(this: void, x: any): x is OpenHiEnvironment;
116
+ /**
117
+ * Configuration for this specific environment.
118
+ */
119
+ readonly config: OpenHiEnvironmentConfig;
120
+ /**
121
+ * The deployment target role for this (account, region).
122
+ */
123
+ readonly deploymentTargetRole: (typeof OPEN_HI_DEPLOYMENT_TARGET_ROLE)[keyof typeof OPEN_HI_DEPLOYMENT_TARGET_ROLE];
124
+ /**
125
+ * Creates a new OpenHiEnvironment.
126
+ */
127
+ constructor(
128
+ /**
129
+ * The OpenHiStage that contains this environment.
130
+ */
131
+ ohStage: OpenHiStage,
132
+ /**
133
+ * Properties for creating the environment.
134
+ */
135
+ props: OpenHiEnvironmentProps);
136
+ }
137
+
138
+ /**
139
+ * Properties for creating an OpenHiApp instance.
140
+ */
141
+ interface OpenHiAppProps extends AppProps {
142
+ /**
143
+ * Optional name for the application.
144
+ * ```
145
+ */
146
+ readonly appName?: string;
147
+ /**
148
+ * The OpenHi configuration object that defines stages, environments, and
149
+ * their associated AWS account and region settings.
150
+ */
151
+ readonly config: OpenHiConfig;
152
+ }
153
+ /**
154
+ * Root application construct for OpenHi CDK applications.
155
+ */
156
+ declare class OpenHiApp extends App {
157
+ /**
158
+ * Finds the OpenHiApp instance that contains the given construct in its
159
+ * construct tree.
160
+ */
161
+ static of(construct: IConstruct): OpenHiApp | undefined;
162
+ /**
163
+ * Type guard that checks if a value is an OpenHiApp instance.
164
+ */
165
+ static isOpenHiApp(this: void, x: any): x is OpenHiApp;
166
+ /**
167
+ * Name for the application.
168
+ */
169
+ readonly appName: string;
170
+ /**
171
+ * The OpenHi configuration object for this application.
172
+ */
173
+ readonly config: OpenHiConfig;
174
+ /**
175
+ * Creates a new OpenHiApp instance.
176
+ */
177
+ constructor(props: OpenHiAppProps);
178
+ /*****************************************************************************
179
+ *
180
+ * Stages
181
+ *
182
+ ****************************************************************************/
183
+ /**
184
+ * Gets all OpenHiStage instances that are direct children of this app.
185
+
186
+ */
187
+ get stages(): Array<OpenHiStage>;
188
+ /**
189
+ * Gets the development stage, if it exists.
190
+ */
191
+ get devStage(): OpenHiStage | undefined;
192
+ /**
193
+ * Gets the staging stage, if it exists.
194
+ */
195
+ get stageStage(): OpenHiStage | undefined;
196
+ /**
197
+ * Gets the production stage, if it exists.
198
+ */
199
+ get prodStage(): OpenHiStage | undefined;
200
+ /*****************************************************************************
201
+ *
202
+ * Environments
203
+ *
204
+ ****************************************************************************/
205
+ /**
206
+ * Gets all OpenHiEnvironment instances across all stages in this app.
207
+ */
208
+ get environments(): Array<OpenHiEnvironment>;
209
+ /**
210
+ * Gets all primary environments across all stages in this app.
211
+ */
212
+ get primaryEnvironments(): Array<OpenHiEnvironment>;
213
+ /**
214
+ * Gets all secondary environments across all stages in this app.
215
+ */
216
+ get secondaryEnvironments(): Array<OpenHiEnvironment>;
217
+ }
218
+
219
+ interface CoreProps {
220
+ /**
221
+ * Pass in options for an event bus, optional.
222
+ */
223
+ readonly dataEventBusProps?: EventBusProps;
224
+ /**
225
+ * Pass in options for an event bus, optional.
226
+ */
227
+ readonly opsEventBusProps?: EventBusProps;
228
+ /**
229
+ * Optional args for creating HTTP API.
230
+ */
231
+ readonly httpApiProps?: HttpApiProps;
232
+ /**
233
+ * Optional args for creating the core GraphQL API.
234
+ */
235
+ readonly graphqlApiProps?: GraphqlApiProps;
236
+ }
237
+
238
+ /**
239
+ * Service type identifiers for OpenHI services.
240
+ *
241
+ * @remarks
242
+ * These constants define the different types of services that can be deployed
243
+ * within the OpenHI platform. Each service type represents a distinct domain
244
+ * or functional area with its own data model, API endpoints, and business logic.
245
+ *
246
+ * Service types are used for:
247
+ * - Resource naming and tagging
248
+ * - Service discovery and routing
249
+ * - Deployment context calculations
250
+ * - Cross-service communication patterns
251
+ *
252
+ * @public
253
+ */
254
+ declare const OPEN_HI_SERVICE_TYPE: {
255
+ /**
256
+ * Authentication service.
257
+ * *
258
+ * Only one instance of the auth service should exist per environment.
259
+ */
260
+ readonly AUTH: "auth";
261
+ /**
262
+ * Root shared core services.
263
+ *
264
+ * Only one instance of the core service should exist per environment.
265
+ */
266
+ readonly CORE: "core";
267
+ /**
268
+ * Rest API service.
269
+ */
270
+ readonly REST_API: "rest-api";
271
+ /**
272
+ * Global Infrastructure stack (Route53, ACM).
273
+ */
274
+ readonly GLOBAL: "global";
275
+ /**
276
+ * Data service (DynamoDB, S3, persistence).
277
+ */
278
+ readonly DATA: "data";
279
+ };
280
+ /**
281
+ * Type representing valid OpenHI service type values. This is a union of the
282
+ * values from {@link OPEN_HI_SERVICE_TYPE}.
283
+ *
284
+ * @public
285
+ */
286
+ type OpenHiServiceType = (typeof OPEN_HI_SERVICE_TYPE)[keyof typeof OPEN_HI_SERVICE_TYPE];
287
+ /**
288
+ * Properties for creating an {@link OpenHiService} stack.
289
+ *
290
+ * @public
291
+ */
292
+ interface OpenHiServiceProps extends StackProps {
293
+ /**
294
+ * Optional branch name override.
295
+ */
296
+ readonly branchName?: string;
297
+ /**
298
+ * Optional repository name override.
299
+ */
300
+ readonly repoName?: string;
301
+ /**
302
+ * Optional application name override.
303
+ */
304
+ readonly appName?: string;
305
+ /**
306
+ * Default release branch name.
307
+ */
308
+ readonly defaultReleaseBranch?: string;
309
+ /**
310
+ * The removal policy for persistent stack resources.
311
+ */
312
+ readonly removalPolicy?: RemovalPolicy;
313
+ /**
314
+ * Environment configuration for this service.
315
+ */
316
+ readonly config?: OpenHiEnvironmentConfig;
317
+ /**
318
+ * A constant that identifies the service type.
319
+ */
320
+ readonly serviceType?: OpenHiServiceType;
321
+ /**
322
+ * Optional props for the core construct.
323
+ */
324
+ readonly coreProps?: CoreProps;
325
+ }
326
+ /**
327
+ * Represents an OpenHI service stack within the OpenHI platform.
328
+ */
329
+ declare class OpenHiService extends Stack {
330
+ ohEnv: OpenHiEnvironment;
331
+ props: OpenHiServiceProps;
332
+ /**
333
+ * The service/stack ID that was passed to the constructor.
334
+ */
335
+ readonly serviceId: string;
336
+ /**
337
+ * The deployment target role identifier.
338
+ */
339
+ readonly deploymentTargetRole: string;
340
+ /**
341
+ * Repository name used in resource tagging.
342
+ */
343
+ readonly repoName: string;
344
+ /**
345
+ * Application name identifier.
346
+ */
347
+ readonly appName: string;
348
+ /**
349
+ * Default release branch name.
350
+ */
351
+ readonly defaultReleaseBranch: string;
352
+ /**
353
+ * Branch name used when calculating resource names and hashes.
354
+ */
355
+ readonly branchName: string;
356
+ /**
357
+ * Short hash unique to the deployment target (app name, deployment target role, account, region).
358
+ */
359
+ readonly environmentHash: string;
360
+ /**
361
+ * Short hash unique to the environment and branch combination.
362
+ */
363
+ readonly branchHash: string;
364
+ /**
365
+ * Short hash unique to the specific stack/service.
366
+ */
367
+ readonly stackHash: string;
368
+ /**
369
+ * The removal policy for persistent stack resources.
370
+ */
371
+ readonly removalPolicy: RemovalPolicy;
372
+ /**
373
+ * Environment configuration for this service.
374
+ * This is either the value passed in or the default config
375
+ */
376
+ readonly config: OpenHiEnvironmentConfig;
377
+ /**
378
+ * A constant that identifies the service type.
379
+ */
380
+ readonly serviceType: (typeof OPEN_HI_SERVICE_TYPE)[keyof typeof OPEN_HI_SERVICE_TYPE] | string;
381
+ /**
382
+ * Core construct containing shared infrastructure.
383
+ */
384
+ /**
385
+ * Creates a new OpenHI service stack.
386
+ *
387
+ * @param ohEnv - The OpenHI environment (stage) this service belongs to
388
+ * @param id - Unique identifier for this service stack (e.g., "user-service")
389
+ * @param props - Optional properties for configuring the service
390
+ *
391
+ * @throws {Error} If account and region are not defined in props or environment
392
+ *
393
+ */
394
+ constructor(ohEnv: OpenHiEnvironment, id: string, props?: OpenHiServiceProps);
395
+ /**
396
+ * Creates or returns the core construct for shared infrastructure.
397
+ */
398
+ /**
399
+ * DNS prefix for this branche's child zone.
400
+ */
401
+ get childZonePrefix(): string;
402
+ }
403
+
404
+ /*******************************************************************************
405
+ *
406
+ * DiscoverableStringParameterProps: props for creating or looking up SSM
407
+ * parameters. Includes StringParameterProps (minus parameterName) plus
408
+ * name-building fields used by buildParameterName.
409
+ *
410
+ ******************************************************************************/
411
+ interface DiscoverableStringParameterProps extends Omit<StringParameterProps, "parameterName"> {
412
+ /**
413
+ * SSM param name used to build the SSM parameter name via buildParameterName
414
+ * and stored as a tag on the parameter for discoverability.
415
+ */
416
+ readonly ssmParamName: string;
417
+ /**
418
+ * The environment hash the parameter belongs to.
419
+ * @default - the current stack's environment hash
420
+ */
421
+ readonly branchHash?: string;
422
+ /**
423
+ * The service type the parameter belongs to.
424
+ * @default - the current stack's service type
425
+ */
426
+ readonly serviceType?: string;
427
+ /**
428
+ * The AWS account the parameter belongs to.
429
+ * @default - the current stack's account
430
+ */
431
+ readonly account?: string;
432
+ /**
433
+ * The AWS region the parameter belongs to.
434
+ * @default - the current stack's region
435
+ */
436
+ readonly region?: string;
437
+ }
438
+ /**
439
+ * Props for buildParameterName and valueForLookupName.
440
+ * Includes ssmParamName (required) and optional overrides (branchHash, serviceType, account, region).
441
+ */
442
+ type BuildParameterNameProps = Pick<DiscoverableStringParameterProps, "ssmParamName" | "branchHash" | "serviceType" | "account" | "region">;
443
+ /**
444
+ * Discoverable SSM string parameter construct. Extends CDK StringParameter:
445
+ * builds parameterName from the given name via buildParameterName and tags
446
+ * the parameter with the name constant.
447
+ */
448
+ declare class DiscoverableStringParameter extends StringParameter {
449
+ /**
450
+ * Build a param name based on predictable attributes found in services and
451
+ * constructs. Used for storage and retrieval of SSM values across services.
452
+ */
453
+ static buildParameterName(scope: Construct, props: BuildParameterNameProps): string;
454
+ /**
455
+ * Read the string value of an SSM parameter created with DiscoverableStringParameter,
456
+ * using props that include ssmParamName and optional overrides (e.g. serviceType).
457
+ */
458
+ static valueForLookupName(scope: Construct, props: BuildParameterNameProps): string;
459
+ constructor(scope: Construct, id: string, props: DiscoverableStringParameterProps);
460
+ }
461
+
462
+ interface OpenHiCoreServiceProps extends OpenHiServiceProps {
463
+ }
464
+ declare class OpenHiCoreService extends OpenHiService {
465
+ /*****************************************************************************
466
+ *
467
+ * PROPS
468
+ *
469
+ * Final props calculated from inputs combined with default values.
470
+ *
471
+ ****************************************************************************/
472
+ readonly props: OpenHiCoreServiceProps;
473
+ constructor(ohEnv: OpenHiEnvironment, props?: OpenHiCoreServiceProps);
474
+ }
475
+
476
+ interface AuthProps {
477
+ /**
478
+ * Optional props for creating the user pool.
479
+ */
480
+ readonly userPoolProps?: UserPoolProps;
481
+ }
482
+ /**
483
+ * Auth construct that manages Cognito authentication resources.
484
+ *
485
+ * @remarks
486
+ * The Auth construct provides authentication infrastructure including:
487
+ * - Cognito User Pool for user management and authentication
488
+ * - User Pool Client for application integration
489
+ * - User Pool Domain for hosting the Cognito hosted UI
490
+ * - KMS Key for Cognito User Pool encryption
491
+ *
492
+ * When created in the Auth service (`serviceType === OPEN_HI_SERVICE_TYPE.AUTH`),
493
+ * it creates concrete resources. Otherwise, it imports existing resources
494
+ * from SSM Parameter Store.
495
+ *
496
+ * Use {@link Auth.fromConstruct} to obtain an Auth instance (with resources
497
+ * imported from AUTH SSM parameters) when not in the Auth service, e.g. from
498
+ * the Core construct.
499
+ *
500
+ * @public
501
+ */
502
+ declare class Auth extends Construct {
503
+ /**
504
+ * Returns an Auth instance that uses resources imported from AUTH SSM
505
+ * parameters. Use this when creating Core or other stacks that consume
506
+ * auth resources; the Auth stack must be deployed first.
507
+ *
508
+ * @param scope - Construct scope (e.g. Core); must be in a stack that has
509
+ * access to the same account/region as the deployed Auth stack.
510
+ */
511
+ static fromConstruct(scope: Construct): Auth;
512
+ /**
513
+ * Is this construct being created in the auth service or elsewhere?
514
+ */
515
+ readonly isAuthService: boolean;
516
+ /**
517
+ * KMS Key used to encrypt the Cognito User Pool. We need a custom key so that
518
+ * we can decrypt tokens when sending emails using something other than SES.
519
+ */
520
+ readonly userPoolKmsKey: IKey;
521
+ /**
522
+ * Cognito User Pool for user management and authentication.
523
+ */
524
+ readonly userPool: IUserPool;
525
+ /**
526
+ * Cognito User Pool Client for application integration with the User Pool.
527
+ */
528
+ readonly userPoolClient: IUserPoolClient;
529
+ /**
530
+ * Cognito User Pool Domain for hosting the Cognito hosted UI.
531
+ */
532
+ readonly userPoolDomain: IUserPoolDomain;
533
+ constructor(scope: Construct, props?: AuthProps);
534
+ /*****************************************************************************
535
+ *
536
+ * Auth Support
537
+ *
538
+ ****************************************************************************/
539
+ protected createUserPoolKmsKey(): IKey;
540
+ protected createUserPool(props?: UserPoolProps): IUserPool;
541
+ protected createUserPoolClient(props: {
542
+ userPool: IUserPool;
543
+ }): IUserPoolClient;
544
+ protected createUserPoolDomain(props: {
545
+ userPool: IUserPool;
546
+ }): IUserPoolDomain;
547
+ }
548
+
549
+ interface OpenHiAuthServiceProps extends OpenHiServiceProps {
550
+ /**
551
+ * Optional props for the auth construct.
552
+ */
553
+ readonly authProps?: AuthProps;
554
+ }
555
+ /**
556
+ * OpenHI Auth Service stack.
557
+ *
558
+ * @remarks
559
+ * The Auth service manages authentication infrastructure including:
560
+ * - Cognito User Pool for user management and authentication
561
+ * - User Pool Client for application integration
562
+ * - User Pool Domain for hosting the Cognito hosted UI
563
+ * - KMS Key for Cognito User Pool encryption
564
+ *
565
+ * Only one instance of the auth service should exist per environment.
566
+ *
567
+ * @public
568
+ */
569
+ declare class OpenHiAuthService extends OpenHiService {
570
+ props: OpenHiAuthServiceProps;
571
+ /**
572
+ * Auth construct containing authentication resources.
573
+ */
574
+ readonly auth: Auth;
575
+ constructor(ohEnv: OpenHiEnvironment, props?: OpenHiAuthServiceProps);
576
+ }
577
+
578
+ interface GlobalProps {
579
+ /**
580
+ * Root zone configuration attributes. Zone name is required, hosted zone ID
581
+ * is optional.
582
+ */
583
+ readonly rootHostedZoneAttributes: HostedZoneAttributes;
584
+ /**
585
+ * Child zone configuration attributes. Zone name is required, hosted zone ID
586
+ * is optional.
587
+ */
588
+ readonly childHostedZoneAttributes?: SetOptional<HostedZoneAttributes, "hostedZoneId">;
589
+ }
590
+ /**
591
+ * Global construct: owns global infrastructure (e.g. DNS and certificate resources).
592
+
593
+ */
594
+ declare class Global extends Construct {
595
+ props: GlobalProps;
596
+ /**
597
+ * Root hosted zone when config provides zoneName.
598
+ */
599
+ readonly rootHostedZone: IHostedZone;
600
+ /**
601
+ * Child hosted zone when root zone exists.
602
+ */
603
+ readonly childHostedZone?: IHostedZone;
604
+ /**
605
+ * Root wildcard certificate.
606
+ */
607
+ readonly rootWildcardCertificate: ICertificate;
608
+ constructor(scope: Construct, id: string, props: GlobalProps);
609
+ }
610
+
611
+ interface OpenHiGlobalServiceProps extends OpenHiServiceProps {
612
+ }
613
+ /**
614
+ * Global Infrastructure stack: owns global DNS and certificates
615
+ */
616
+ declare class OpenHiGlobalService extends OpenHiService {
617
+ /**
618
+ * Global construct.
619
+ */
620
+ readonly global: Global;
621
+ constructor(ohEnv: OpenHiEnvironment, props?: OpenHiGlobalServiceProps);
622
+ }
623
+
624
+ declare class CoreHttpApi extends HttpApi {
625
+ /**
626
+ * Used when storing the API ID in SSM.
627
+ */
628
+ static readonly SSM_PARAM_NAME = "CORE_HTTP_API";
629
+ static fromConstruct(scope: Construct): IHttpApi;
630
+ constructor(scope: Construct, props?: HttpApiProps);
631
+ }
632
+
633
+ interface OpenHiRestApiServiceProps extends OpenHiServiceProps {
634
+ }
635
+ /**
636
+ * SSM parameter name suffix for the REST API base URL.
637
+ * Full parameter name is built via buildParameterName with serviceType REST_API.
638
+ */
639
+ declare const REST_API_BASE_URL_SSM_NAME = "REST_API_BASE_URL";
640
+ /**
641
+ * REST API service stack: HTTP API, custom domain, and Lambda; exports base URL via SSM.
642
+ */
643
+ declare class OpenHiRestApiService extends OpenHiService {
644
+ readonly coreHttpApi: CoreHttpApi;
645
+ constructor(ohEnv: OpenHiEnvironment, props?: OpenHiRestApiServiceProps);
646
+ }
647
+
648
+ interface OpenHiDataServiceProps extends OpenHiServiceProps {
649
+ }
650
+ /**
651
+ * Data storage service stack: centralizes DynamoDB, S3, and other persistence
652
+ * resources for OpenHI. Creates the single-table data store (CRM, CMS, ERP,
653
+ * EHR); add buckets or other resources as needed.
654
+ */
655
+ declare class OpenHiDataService extends OpenHiService {
656
+ /**
657
+ * The single-table DynamoDB data store. Use {@link DynamoDbDataStore.fromConstruct}
658
+ * from other stacks to obtain an ITable reference by name.
659
+ */
660
+ readonly dataStore: ITable;
661
+ constructor(ohEnv: OpenHiEnvironment, props?: OpenHiDataServiceProps);
662
+ }
663
+
664
+ export { type BuildParameterNameProps, DiscoverableStringParameter, type DiscoverableStringParameterProps, OPEN_HI_SERVICE_TYPE, OpenHiApp, type OpenHiAppProps, OpenHiAuthService, type OpenHiAuthServiceProps, OpenHiCoreService, type OpenHiCoreServiceProps, OpenHiDataService, type OpenHiDataServiceProps, OpenHiEnvironment, type OpenHiEnvironmentProps, OpenHiGlobalService, type OpenHiGlobalServiceProps, OpenHiRestApiService, type OpenHiRestApiServiceProps, OpenHiService, type OpenHiServiceProps, type OpenHiServiceType, OpenHiStage, type OpenHiStageProps, REST_API_BASE_URL_SSM_NAME };