@openhi/platform 0.0.0 → 0.0.2
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.
- package/lib/{openhi.d.ts → index.d.mts} +42 -16
- package/lib/index.d.ts +195 -2
- package/lib/index.js +825 -17
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +818 -0
- package/lib/index.mjs.map +1 -0
- package/package.json +33 -24
- package/lib/openhi.js +0 -108
- package/lib/service.d.ts +0 -36
- package/lib/service.js +0 -203
- package/lib/templates/generate-templates.d.ts +0 -5
- package/lib/templates/generate-templates.js +0 -45
- package/lib/templates/service-template.d.ts +0 -33
- package/lib/templates/service-template.js +0 -42
- package/lib/templates/src/README.md.d.ts +0 -5
- package/lib/templates/src/README.md.js +0 -19
- package/lib/templates/src/app-test.d.ts +0 -5
- package/lib/templates/src/app-test.js +0 -61
- package/lib/templates/src/app.d.ts +0 -5
- package/lib/templates/src/app.js +0 -27
- package/lib/templates/src/config.d.ts +0 -5
- package/lib/templates/src/config.js +0 -23
- package/lib/templates/src/data/README.md.d.ts +0 -5
- package/lib/templates/src/data/README.md.js +0 -19
- package/lib/templates/src/data/models/README.md.d.ts +0 -5
- package/lib/templates/src/data/models/README.md.js +0 -19
- package/lib/templates/src/infrastructure/README.md.d.ts +0 -5
- package/lib/templates/src/infrastructure/README.md.js +0 -19
- package/lib/templates/src/integrations/README.md.d.ts +0 -5
- package/lib/templates/src/integrations/README.md.js +0 -19
- package/lib/templates/src/main.d.ts +0 -5
- package/lib/templates/src/main.js +0 -15
- package/lib/templates/src/workflows/README.md.d.ts +0 -5
- package/lib/templates/src/workflows/README.md.js +0 -19
- package/lib/workflows/aws-teardown-workflow.d.ts +0 -13
- package/lib/workflows/aws-teardown-workflow.js +0 -222
- package/lib/workflows/build-dev-workflow.d.ts +0 -12
- package/lib/workflows/build-dev-workflow.js +0 -48
- package/lib/workflows/build-stage-workflow.d.ts +0 -12
- package/lib/workflows/build-stage-workflow.js +0 -60
|
@@ -1,8 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OpenHiConfig } from
|
|
3
|
-
import { SetOptional } from
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { MonorepoProjectOptions, MonorepoProject } from '@codedrifters/configulator';
|
|
2
|
+
import { OpenHiConfig } from '@openhi/config';
|
|
3
|
+
import { ValueOf, SetOptional } from 'type-fest';
|
|
4
|
+
import { awscdk } from 'projen';
|
|
5
|
+
|
|
6
|
+
declare const OPEN_HI_SERVICE_TYPE: {
|
|
7
|
+
readonly AUTH: "auth";
|
|
8
|
+
readonly DATA_SERVICE: "data";
|
|
9
|
+
readonly GLOBAL: "global";
|
|
10
|
+
readonly INTEGRATION: "integration";
|
|
11
|
+
readonly REST_API: "rest-api";
|
|
12
|
+
};
|
|
13
|
+
interface OpenHiServiceOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Configuration for this service.
|
|
16
|
+
*
|
|
17
|
+
* @default uses the global default config.
|
|
18
|
+
*/
|
|
19
|
+
readonly config: OpenHiConfig;
|
|
20
|
+
/**
|
|
21
|
+
* What type of service is this?
|
|
22
|
+
*/
|
|
23
|
+
readonly type: ValueOf<typeof OPEN_HI_SERVICE_TYPE>;
|
|
24
|
+
}
|
|
25
|
+
declare class OpenHiService {
|
|
26
|
+
openHi: OpenHi;
|
|
27
|
+
id: string;
|
|
28
|
+
options: OpenHiServiceOptions;
|
|
29
|
+
readonly project: awscdk.AwsCdkTypeScriptApp;
|
|
30
|
+
constructor(openHi: OpenHi, id: string, options: OpenHiServiceOptions);
|
|
31
|
+
private addDeploymentTarget;
|
|
32
|
+
get constructName(): string;
|
|
33
|
+
get outDir(): string;
|
|
34
|
+
get serviceName(): string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface OpenHiOptions {
|
|
6
38
|
/*****************************************************************************
|
|
7
39
|
*
|
|
8
40
|
* Root Project Configuration Options
|
|
@@ -41,16 +73,12 @@ export interface OpenHiOptions {
|
|
|
41
73
|
* Rest API Service Config
|
|
42
74
|
*/
|
|
43
75
|
readonly restApiServiceConfig?: OpenHiConfig;
|
|
44
|
-
/**
|
|
45
|
-
* Core Service Config
|
|
46
|
-
*/
|
|
47
|
-
readonly coreServiceConfig?: OpenHiConfig;
|
|
48
76
|
/**
|
|
49
77
|
* Data Service Config (DynamoDB FHIR store, S3, etc.)
|
|
50
78
|
*/
|
|
51
79
|
readonly dataServiceConfig?: OpenHiConfig;
|
|
52
80
|
}
|
|
53
|
-
|
|
81
|
+
declare class OpenHi {
|
|
54
82
|
/**
|
|
55
83
|
* Final options used to build this instance.
|
|
56
84
|
*/
|
|
@@ -65,24 +93,22 @@ export declare class OpenHi {
|
|
|
65
93
|
*/
|
|
66
94
|
readonly id: string;
|
|
67
95
|
/**
|
|
68
|
-
* Global service (deployed first;
|
|
96
|
+
* Global service (deployed first; Auth, data service, and other stacks depend on it).
|
|
69
97
|
*/
|
|
70
98
|
readonly global: OpenHiService;
|
|
71
99
|
/**
|
|
72
|
-
* Auth service (deployed
|
|
100
|
+
* Auth service (deployed first; data service, REST API, and data services depend on it).
|
|
73
101
|
*/
|
|
74
102
|
readonly auth: OpenHiService;
|
|
75
103
|
/**
|
|
76
104
|
* Rest API service
|
|
77
105
|
*/
|
|
78
106
|
readonly restApi: OpenHiService;
|
|
79
|
-
/**
|
|
80
|
-
* Core service
|
|
81
|
-
*/
|
|
82
|
-
readonly core: OpenHiService;
|
|
83
107
|
/**
|
|
84
108
|
* Data service (DynamoDB FHIR store, S3, and other persistence).
|
|
85
109
|
*/
|
|
86
110
|
readonly data: OpenHiService;
|
|
87
111
|
constructor(options?: OpenHiOptions);
|
|
88
112
|
}
|
|
113
|
+
|
|
114
|
+
export { OPEN_HI_SERVICE_TYPE, OpenHi, type OpenHiOptions, OpenHiService, type OpenHiServiceOptions };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,195 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { MonorepoProjectOptions, MonorepoProject } from '@codedrifters/configulator';
|
|
2
|
+
import { SetOptional, ValueOf } from 'type-fest';
|
|
3
|
+
import { awscdk } from 'projen';
|
|
4
|
+
|
|
5
|
+
/*******************************************************************************
|
|
6
|
+
*
|
|
7
|
+
* OpenHi Config
|
|
8
|
+
*
|
|
9
|
+
* These types are kept in their own package to prevent dependency conflicts and
|
|
10
|
+
* conditions between @openhi/constructs and @openhi/platform.
|
|
11
|
+
*
|
|
12
|
+
******************************************************************************/
|
|
13
|
+
/**
|
|
14
|
+
* Stage Types
|
|
15
|
+
*
|
|
16
|
+
* What stage of deployment is this? Dev, staging, or prod?
|
|
17
|
+
*/
|
|
18
|
+
declare const OPEN_HI_STAGE: {
|
|
19
|
+
/**
|
|
20
|
+
* Development environment, typically used for testing and development.
|
|
21
|
+
*/
|
|
22
|
+
readonly DEV: "dev";
|
|
23
|
+
/**
|
|
24
|
+
* Staging environment, used for pre-production testing.
|
|
25
|
+
*/
|
|
26
|
+
readonly STAGE: "stage";
|
|
27
|
+
/**
|
|
28
|
+
* Production environment, used for live deployments.
|
|
29
|
+
*/
|
|
30
|
+
readonly PROD: "prod";
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Deployment Target Role
|
|
34
|
+
*
|
|
35
|
+
* Is this (account, region) the primary or a secondary deployment target for the stage?
|
|
36
|
+
* Works for both multi-region (different regions) and cellular (same region, different accounts).
|
|
37
|
+
*/
|
|
38
|
+
declare const OPEN_HI_DEPLOYMENT_TARGET_ROLE: {
|
|
39
|
+
/**
|
|
40
|
+
* The primary deployment target for this stage (main account/region).
|
|
41
|
+
* For example, the base DynamoDB region for global tables.
|
|
42
|
+
*/
|
|
43
|
+
readonly PRIMARY: "primary";
|
|
44
|
+
/**
|
|
45
|
+
* A secondary deployment target for this stage (additional account/region).
|
|
46
|
+
* For example, a replica region for a global DynamoDB table, or another cell in the same region.
|
|
47
|
+
*/
|
|
48
|
+
readonly SECONDARY: "secondary";
|
|
49
|
+
};
|
|
50
|
+
interface OpenHiEnvironmentConfig {
|
|
51
|
+
account: string;
|
|
52
|
+
region: string;
|
|
53
|
+
/**
|
|
54
|
+
* Route53 zone containing DNS for this service.
|
|
55
|
+
*/
|
|
56
|
+
hostedZoneId?: string;
|
|
57
|
+
zoneName?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Represents the configuration for OpenHi services across different stages and
|
|
61
|
+
* deployment targets.
|
|
62
|
+
*/
|
|
63
|
+
interface OpenHiConfig {
|
|
64
|
+
versions?: {
|
|
65
|
+
cdk?: {
|
|
66
|
+
cdkLibVersion?: string;
|
|
67
|
+
cdkCliVersion?: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
deploymentTargets?: {
|
|
71
|
+
[OPEN_HI_STAGE.DEV]?: {
|
|
72
|
+
[OPEN_HI_DEPLOYMENT_TARGET_ROLE.PRIMARY]?: OpenHiEnvironmentConfig;
|
|
73
|
+
[OPEN_HI_DEPLOYMENT_TARGET_ROLE.SECONDARY]?: Array<OpenHiEnvironmentConfig>;
|
|
74
|
+
};
|
|
75
|
+
[OPEN_HI_STAGE.STAGE]?: {
|
|
76
|
+
[OPEN_HI_DEPLOYMENT_TARGET_ROLE.PRIMARY]?: OpenHiEnvironmentConfig;
|
|
77
|
+
[OPEN_HI_DEPLOYMENT_TARGET_ROLE.SECONDARY]?: Array<OpenHiEnvironmentConfig>;
|
|
78
|
+
};
|
|
79
|
+
[OPEN_HI_STAGE.PROD]?: {
|
|
80
|
+
[OPEN_HI_DEPLOYMENT_TARGET_ROLE.PRIMARY]?: OpenHiEnvironmentConfig;
|
|
81
|
+
[OPEN_HI_DEPLOYMENT_TARGET_ROLE.SECONDARY]?: Array<OpenHiEnvironmentConfig>;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare const OPEN_HI_SERVICE_TYPE: {
|
|
87
|
+
readonly AUTH: "auth";
|
|
88
|
+
readonly DATA_SERVICE: "data";
|
|
89
|
+
readonly GLOBAL: "global";
|
|
90
|
+
readonly INTEGRATION: "integration";
|
|
91
|
+
readonly REST_API: "rest-api";
|
|
92
|
+
};
|
|
93
|
+
interface OpenHiServiceOptions {
|
|
94
|
+
/**
|
|
95
|
+
* Configuration for this service.
|
|
96
|
+
*
|
|
97
|
+
* @default uses the global default config.
|
|
98
|
+
*/
|
|
99
|
+
readonly config: OpenHiConfig;
|
|
100
|
+
/**
|
|
101
|
+
* What type of service is this?
|
|
102
|
+
*/
|
|
103
|
+
readonly type: ValueOf<typeof OPEN_HI_SERVICE_TYPE>;
|
|
104
|
+
}
|
|
105
|
+
declare class OpenHiService {
|
|
106
|
+
openHi: OpenHi;
|
|
107
|
+
id: string;
|
|
108
|
+
options: OpenHiServiceOptions;
|
|
109
|
+
readonly project: awscdk.AwsCdkTypeScriptApp;
|
|
110
|
+
constructor(openHi: OpenHi, id: string, options: OpenHiServiceOptions);
|
|
111
|
+
private addDeploymentTarget;
|
|
112
|
+
get constructName(): string;
|
|
113
|
+
get outDir(): string;
|
|
114
|
+
get serviceName(): string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
interface OpenHiOptions {
|
|
118
|
+
/*****************************************************************************
|
|
119
|
+
*
|
|
120
|
+
* Root Project Configuration Options
|
|
121
|
+
*
|
|
122
|
+
* Configuration options for the root monorepo project that contains all
|
|
123
|
+
* OpenHi services and coordinate releases and builds.
|
|
124
|
+
*
|
|
125
|
+
****************************************************************************/
|
|
126
|
+
readonly rootProjectOptions?: SetOptional<MonorepoProjectOptions, "name">;
|
|
127
|
+
/**
|
|
128
|
+
* Monorepo root project, if using an existing project.
|
|
129
|
+
*/
|
|
130
|
+
readonly rootProject?: MonorepoProject;
|
|
131
|
+
/*****************************************************************************
|
|
132
|
+
*
|
|
133
|
+
* Service Configuration Options
|
|
134
|
+
*
|
|
135
|
+
* These options are used to configure the various services within the OpenHi
|
|
136
|
+
* framework. Each service can have its own configuration settings, which will
|
|
137
|
+
* be merged with the default configuration.
|
|
138
|
+
*
|
|
139
|
+
****************************************************************************/
|
|
140
|
+
/**
|
|
141
|
+
* Default configuration used in all services with undefined configs.
|
|
142
|
+
*/
|
|
143
|
+
readonly defaultConfig?: OpenHiConfig;
|
|
144
|
+
/**
|
|
145
|
+
* Global Service Config
|
|
146
|
+
*/
|
|
147
|
+
readonly globalServiceConfig?: OpenHiConfig;
|
|
148
|
+
/**
|
|
149
|
+
* Auth Service Config
|
|
150
|
+
*/
|
|
151
|
+
readonly authServiceConfig?: OpenHiConfig;
|
|
152
|
+
/**
|
|
153
|
+
* Rest API Service Config
|
|
154
|
+
*/
|
|
155
|
+
readonly restApiServiceConfig?: OpenHiConfig;
|
|
156
|
+
/**
|
|
157
|
+
* Data Service Config (DynamoDB FHIR store, S3, etc.)
|
|
158
|
+
*/
|
|
159
|
+
readonly dataServiceConfig?: OpenHiConfig;
|
|
160
|
+
}
|
|
161
|
+
declare class OpenHi {
|
|
162
|
+
/**
|
|
163
|
+
* Final options used to build this instance.
|
|
164
|
+
*/
|
|
165
|
+
options: OpenHiOptions;
|
|
166
|
+
/**
|
|
167
|
+
* Monorepo root project, either passed in as an argument or generated in
|
|
168
|
+
* this component
|
|
169
|
+
*/
|
|
170
|
+
readonly rootProject?: MonorepoProject;
|
|
171
|
+
/**
|
|
172
|
+
* Test identifier for this instance.
|
|
173
|
+
*/
|
|
174
|
+
readonly id: string;
|
|
175
|
+
/**
|
|
176
|
+
* Global service (deployed first; Auth, data service, and other stacks depend on it).
|
|
177
|
+
*/
|
|
178
|
+
readonly global: OpenHiService;
|
|
179
|
+
/**
|
|
180
|
+
* Auth service (deployed first; data service, REST API, and data services depend on it).
|
|
181
|
+
*/
|
|
182
|
+
readonly auth: OpenHiService;
|
|
183
|
+
/**
|
|
184
|
+
* Rest API service
|
|
185
|
+
*/
|
|
186
|
+
readonly restApi: OpenHiService;
|
|
187
|
+
/**
|
|
188
|
+
* Data service (DynamoDB FHIR store, S3, and other persistence).
|
|
189
|
+
*/
|
|
190
|
+
readonly data: OpenHiService;
|
|
191
|
+
constructor(options?: OpenHiOptions);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export { OPEN_HI_SERVICE_TYPE, OpenHi, OpenHiService };
|
|
195
|
+
export type { OpenHiOptions, OpenHiServiceOptions };
|