@opencrvs/toolkit 2.0.0-rc.d2125d9 → 2.0.0-rc.d23bb0b
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/README.md +14 -0
- package/build.sh +3 -2
- package/create-countryconfig/index.js +103 -0
- package/create-countryconfig/package.json +21 -0
- package/dist/application-config/index.js +314 -131
- package/dist/cli.js +5110 -384
- package/dist/commons/api/router.d.ts +3414 -271
- package/dist/commons/application-config/index.d.ts +17 -4
- package/dist/commons/conditionals/conditionals.d.ts +360 -10
- package/dist/commons/conditionals/validate.d.ts +52 -2
- package/dist/commons/events/ActionConfig.d.ts +28 -2
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +114 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +342 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
- package/dist/commons/events/Draft.d.ts +4 -2
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/EventIndex.d.ts +14 -3
- package/dist/commons/events/EventMetadata.d.ts +0 -7
- package/dist/commons/events/FieldConfig.d.ts +388 -50
- package/dist/commons/events/FieldType.d.ts +1 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
- package/dist/commons/events/FieldValue.d.ts +6 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +189 -150
- package/dist/commons/events/field.d.ts +53 -1
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/locations.d.ts +38 -1
- package/dist/commons/events/mocks.test.utils.d.ts +19 -0
- package/dist/commons/events/scopes.d.ts +24 -1
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/commons/events/state/index.d.ts +0 -4
- package/dist/commons/events/state/utils.d.ts +12 -289
- package/dist/commons/events/utils.d.ts +13 -2
- package/dist/conditionals/index.js +92 -9
- package/dist/environment/custom-types.d.ts +33 -0
- package/dist/environment/custom-types.d.ts.map +1 -0
- package/dist/environment/custom-types.js +12 -0
- package/dist/environment/derived-variables.d.ts +134 -0
- package/dist/environment/derived-variables.d.ts.map +1 -0
- package/dist/environment/derived-variables.js +169 -0
- package/dist/environment/editor-questions.d.ts +4 -0
- package/dist/environment/editor-questions.d.ts.map +1 -0
- package/dist/environment/editor-questions.js +65 -0
- package/dist/environment/git.d.ts +5 -0
- package/dist/environment/git.d.ts.map +1 -0
- package/dist/environment/git.js +38 -0
- package/dist/environment/github.d.ts +26 -0
- package/dist/environment/github.d.ts.map +1 -0
- package/dist/environment/github.js +244 -0
- package/dist/environment/index.d.ts +5 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +71 -0
- package/dist/environment/logger.d.ts +15 -0
- package/dist/environment/logger.d.ts.map +1 -0
- package/dist/environment/logger.js +25 -0
- package/dist/environment/manage-users.d.ts +11 -0
- package/dist/environment/manage-users.d.ts.map +1 -0
- package/dist/environment/manage-users.js +494 -0
- package/dist/environment/questions-helper.d.ts +15 -0
- package/dist/environment/questions-helper.d.ts.map +1 -0
- package/dist/environment/questions-helper.js +70 -0
- package/dist/environment/questions.d.ts +199 -0
- package/dist/environment/questions.d.ts.map +1 -0
- package/dist/environment/questions.js +412 -0
- package/dist/environment/setup-environment.d.ts +2 -0
- package/dist/environment/setup-environment.d.ts.map +1 -0
- package/dist/environment/setup-environment.js +773 -0
- package/dist/environment/ssh-keygen.d.ts +5 -0
- package/dist/environment/ssh-keygen.d.ts.map +1 -0
- package/dist/environment/ssh-keygen.js +18 -0
- package/dist/environment/swarm-to-k8s.d.ts +2 -0
- package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
- package/dist/environment/swarm-to-k8s.js +172 -0
- package/dist/environment/templates.d.ts +27 -0
- package/dist/environment/templates.d.ts.map +1 -0
- package/dist/environment/templates.js +159 -0
- package/dist/environment/update-workflows.d.ts +2 -0
- package/dist/environment/update-workflows.d.ts.map +1 -0
- package/dist/environment/update-workflows.js +168 -0
- package/dist/environment/users.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +110 -0
- package/dist/environment/utils.d.ts +18 -0
- package/dist/environment/utils.d.ts.map +1 -0
- package/dist/environment/utils.js +100 -0
- package/dist/events/index.js +1206 -291
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +63 -39
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +3 -0
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +1 -0
- package/dist/migrations/v2.0/add-resend-invite-notification.js +373 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +19 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +17 -14
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +4 -5
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +4 -5
- package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -1
- package/dist/migrations/v2.0/create-events-index.js +1 -2
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +11 -0
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -0
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +123 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
- package/dist/migrations/v2.0/index.d.ts +10 -4
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +1929 -347
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +95 -7
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +13 -0
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -0
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +222 -0
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-application-config-url.js +342 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-scopes.js +55 -32
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +3 -4
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +143 -63
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +3 -4
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-demo-scope.js +2 -3
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +3 -4
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +3 -0
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-fhir-url-helpers.js +163 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-hearth-migrations.js +1 -2
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +3 -0
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-old-statistics-service.js +356 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +3 -4
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-review-from-register-action.js +3 -4
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +3 -0
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-unused-environment-variables.js +186 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -1
- package/dist/migrations/v2.0/rename-api-paths.js +3 -4
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +3 -4
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -1
- package/dist/migrations/v2.0/simplify-analytics-precalculations.js +1 -2
- package/dist/migrations/v2.0/update-package-json.d.ts +3 -0
- package/dist/migrations/v2.0/update-package-json.d.ts.map +1 -0
- package/dist/migrations/v2.0/update-package-json.js +105 -0
- package/dist/notification/index.js +938 -163
- package/dist/scopes/index.d.ts +91 -16
- package/dist/scopes/index.js +55 -12
- package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
- package/dist/templates/charts-values/dependencies/values.yaml +82 -0
- package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +79 -0
- package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
- package/dist/templates/charts-values/traefik/values.yaml +116 -0
- package/dist/templates/inventory/inventory.template.yml +100 -0
- package/dist/templates/inventory/production.example.yml +77 -0
- package/dist/templates/inventory/qa.example.yml +48 -0
- package/opencrvs-toolkit-2.0.0-rc.d23bb0b.tgz +0 -0
- package/package.json +20 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.d2125d9.tgz +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
declare function validateCIDRs(input: string): true | string;
|
|
2
|
+
export declare const dockerhubQuestions: {
|
|
3
|
+
name: string;
|
|
4
|
+
type: "text";
|
|
5
|
+
message: string;
|
|
6
|
+
valueType: "SECRET";
|
|
7
|
+
valueLabel: string;
|
|
8
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
9
|
+
initial: string | undefined;
|
|
10
|
+
scope: "REPOSITORY";
|
|
11
|
+
}[];
|
|
12
|
+
export declare const githubQuestions: {
|
|
13
|
+
name: string;
|
|
14
|
+
type: "text";
|
|
15
|
+
message: string;
|
|
16
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
17
|
+
initial: string;
|
|
18
|
+
scope: "REPOSITORY";
|
|
19
|
+
}[];
|
|
20
|
+
export declare const githubOtherQuestions: ({
|
|
21
|
+
name: string;
|
|
22
|
+
type: "text";
|
|
23
|
+
message: string;
|
|
24
|
+
initial: string | undefined;
|
|
25
|
+
valueType: "VARIABLE";
|
|
26
|
+
valueLabel: string;
|
|
27
|
+
scope: "REPOSITORY";
|
|
28
|
+
choices?: undefined;
|
|
29
|
+
validate?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
type: "select";
|
|
33
|
+
message: string;
|
|
34
|
+
choices: {
|
|
35
|
+
title: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}[];
|
|
38
|
+
valueType: "VARIABLE";
|
|
39
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
40
|
+
valueLabel: string;
|
|
41
|
+
initial: string | undefined;
|
|
42
|
+
scope: "ENVIRONMENT";
|
|
43
|
+
})[];
|
|
44
|
+
export declare const githubTokenQuestion: {
|
|
45
|
+
name: string;
|
|
46
|
+
type: "text";
|
|
47
|
+
message: string;
|
|
48
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
49
|
+
initial: string | undefined;
|
|
50
|
+
valueType: "SECRET";
|
|
51
|
+
scope: "REPOSITORY";
|
|
52
|
+
valueLabel: string;
|
|
53
|
+
}[];
|
|
54
|
+
export declare const countryQuestions: {
|
|
55
|
+
name: string;
|
|
56
|
+
type: "text";
|
|
57
|
+
message: string;
|
|
58
|
+
valueType: "VARIABLE";
|
|
59
|
+
valueLabel: string;
|
|
60
|
+
initial: string | undefined;
|
|
61
|
+
scope: "REPOSITORY";
|
|
62
|
+
}[];
|
|
63
|
+
export declare const infrastructureQuestions: ({
|
|
64
|
+
name: string;
|
|
65
|
+
type: "text";
|
|
66
|
+
message: string;
|
|
67
|
+
valueType: "VARIABLE";
|
|
68
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
69
|
+
valueLabel: string;
|
|
70
|
+
initial: string | undefined;
|
|
71
|
+
scope: "ENVIRONMENT";
|
|
72
|
+
} | {
|
|
73
|
+
name: string;
|
|
74
|
+
type: "text";
|
|
75
|
+
message: string;
|
|
76
|
+
valueType: "VARIABLE";
|
|
77
|
+
valueLabel: string;
|
|
78
|
+
initial: string | undefined;
|
|
79
|
+
scope: "ENVIRONMENT";
|
|
80
|
+
validate?: undefined;
|
|
81
|
+
} | {
|
|
82
|
+
name: string;
|
|
83
|
+
type: "text";
|
|
84
|
+
message: string;
|
|
85
|
+
valueType: "VARIABLE";
|
|
86
|
+
validate: typeof validateCIDRs;
|
|
87
|
+
valueLabel: string;
|
|
88
|
+
initial: string;
|
|
89
|
+
scope: "ENVIRONMENT";
|
|
90
|
+
})[];
|
|
91
|
+
export declare const staticSSLCertQuestions: {
|
|
92
|
+
name: string;
|
|
93
|
+
type: "text";
|
|
94
|
+
message: string;
|
|
95
|
+
valueType: "SECRET";
|
|
96
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
97
|
+
valueLabel: string;
|
|
98
|
+
initial: string | undefined;
|
|
99
|
+
scope: "ENVIRONMENT";
|
|
100
|
+
}[];
|
|
101
|
+
export declare const backupQuestions: ({
|
|
102
|
+
name: string;
|
|
103
|
+
type: "text";
|
|
104
|
+
message: string;
|
|
105
|
+
valueType: "VARIABLE";
|
|
106
|
+
valueLabel: string;
|
|
107
|
+
initial: string;
|
|
108
|
+
scope: "ENVIRONMENT";
|
|
109
|
+
validate?: undefined;
|
|
110
|
+
choices?: undefined;
|
|
111
|
+
} | {
|
|
112
|
+
name: string;
|
|
113
|
+
type: "text";
|
|
114
|
+
message: string;
|
|
115
|
+
valueType: "SECRET";
|
|
116
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
117
|
+
valueLabel: string;
|
|
118
|
+
initial: string;
|
|
119
|
+
scope: "ENVIRONMENT";
|
|
120
|
+
choices?: undefined;
|
|
121
|
+
} | {
|
|
122
|
+
name: string;
|
|
123
|
+
type: "select";
|
|
124
|
+
message: string;
|
|
125
|
+
choices: {
|
|
126
|
+
title: string;
|
|
127
|
+
value: string;
|
|
128
|
+
}[];
|
|
129
|
+
valueType: "VARIABLE";
|
|
130
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
131
|
+
valueLabel: string;
|
|
132
|
+
initial: string | undefined;
|
|
133
|
+
scope: "ENVIRONMENT";
|
|
134
|
+
})[];
|
|
135
|
+
export declare const diskQuestions: {
|
|
136
|
+
name: string;
|
|
137
|
+
type: "text";
|
|
138
|
+
message: string;
|
|
139
|
+
valueType: "VARIABLE";
|
|
140
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
141
|
+
valueLabel: string;
|
|
142
|
+
initial: string;
|
|
143
|
+
scope: "ENVIRONMENT";
|
|
144
|
+
}[];
|
|
145
|
+
export declare const databaseAndMonitoringQuestions: {
|
|
146
|
+
name: string;
|
|
147
|
+
type: "text";
|
|
148
|
+
message: string;
|
|
149
|
+
valueType: "SECRET";
|
|
150
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
151
|
+
valueLabel: string;
|
|
152
|
+
initial: string;
|
|
153
|
+
scope: "ENVIRONMENT";
|
|
154
|
+
}[];
|
|
155
|
+
export declare const emailQuestions: ({
|
|
156
|
+
name: string;
|
|
157
|
+
type: "text";
|
|
158
|
+
message: string;
|
|
159
|
+
valueType: "SECRET";
|
|
160
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
161
|
+
valueLabel: string;
|
|
162
|
+
initial: string | undefined;
|
|
163
|
+
scope: "ENVIRONMENT";
|
|
164
|
+
choices?: undefined;
|
|
165
|
+
} | {
|
|
166
|
+
name: string;
|
|
167
|
+
type: "select";
|
|
168
|
+
message: string;
|
|
169
|
+
choices: {
|
|
170
|
+
title: string;
|
|
171
|
+
value: string;
|
|
172
|
+
}[];
|
|
173
|
+
valueType: "SECRET";
|
|
174
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
175
|
+
valueLabel: string;
|
|
176
|
+
initial: string | undefined;
|
|
177
|
+
scope: "ENVIRONMENT";
|
|
178
|
+
})[];
|
|
179
|
+
export declare const sentryQuestions: {
|
|
180
|
+
name: string;
|
|
181
|
+
type: "text";
|
|
182
|
+
message: string;
|
|
183
|
+
valueType: "SECRET";
|
|
184
|
+
validate: (value: string | number) => true | "Please enter a value";
|
|
185
|
+
valueLabel: string;
|
|
186
|
+
initial: string | undefined;
|
|
187
|
+
scope: "ENVIRONMENT";
|
|
188
|
+
}[];
|
|
189
|
+
export declare const metabaseAdminQuestions: {
|
|
190
|
+
valueType: "SECRET";
|
|
191
|
+
name: string;
|
|
192
|
+
type: "text";
|
|
193
|
+
message: string;
|
|
194
|
+
valueLabel: string;
|
|
195
|
+
scope: "ENVIRONMENT";
|
|
196
|
+
initial: string;
|
|
197
|
+
}[];
|
|
198
|
+
export {};
|
|
199
|
+
//# sourceMappingURL=questions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../src/environment/questions.ts"],"names":[],"mappings":"AAgCA,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAgBnD;AAGD,eAAO,MAAM,kBAAkB;;;;;;sBAnCN,MAAM,GAAG,MAAM;;;GA6EvC,CAAA;AAED,eAAO,MAAM,eAAe;;;;sBA/EH,MAAM,GAAG,MAAM;;;GAgGvC,CAAA;AACD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;sBAjGR,MAAM,GAAG,MAAM;;;;IA+HvC,CAAA;AACD,eAAO,MAAM,mBAAmB;;;;sBAhIP,MAAM,GAAG,MAAM;;;;;GA2IvC,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;;GAW5B,CAAA;AAED,eAAO,MAAM,uBAAuB;;;;;sBA1JX,MAAM,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;IAsMvC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;sBAxMV,MAAM,GAAG,MAAM;;;;GA+NvC,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;sBAjOH,MAAM,GAAG,MAAM;;;;;;;;;;;;;;sBAAf,MAAM,GAAG,MAAM;;;;IA4QvC,CAAA;AAED,eAAO,MAAM,aAAa;;;;;sBA9QD,MAAM,GAAG,MAAM;;;;GA2RvC,CAAA;AAED,eAAO,MAAM,8BAA8B;;;;;sBA7RlB,MAAM,GAAG,MAAM;;;;GAkTvC,CAAA;AAED,eAAO,MAAM,cAAc;;;;;sBApTF,MAAM,GAAG,MAAM;;;;;;;;;;;;;;sBAAf,MAAM,GAAG,MAAM;;;;IAsYvC,CAAA;AAED,eAAO,MAAM,eAAe;;;;;sBAxYH,MAAM,GAAG,MAAM;;;;GAmZvC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;GAoBlC,CAAA"}
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
6
|
+
*
|
|
7
|
+
* OpenCRVS is also distributed under the terms of the Civil Registration
|
|
8
|
+
* & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
9
|
+
*
|
|
10
|
+
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
11
|
+
*/
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.metabaseAdminQuestions = exports.sentryQuestions = exports.emailQuestions = exports.databaseAndMonitoringQuestions = exports.diskQuestions = exports.backupQuestions = exports.staticSSLCertQuestions = exports.infrastructureQuestions = exports.countryQuestions = exports.githubTokenQuestion = exports.githubOtherQuestions = exports.githubQuestions = exports.dockerhubQuestions = void 0;
|
|
17
|
+
const kleur_1 = __importDefault(require("kleur"));
|
|
18
|
+
const utils_1 = require("./utils");
|
|
19
|
+
const git_1 = require("./git");
|
|
20
|
+
const notEmpty = (value) => value.toString().trim().length > 0 ? true : 'Please enter a value';
|
|
21
|
+
function validateCIDR(input) {
|
|
22
|
+
if (!input.trim()) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
const cidrRegex = /^((25[0-5]|(2[0-4]|1\d|[1-9]?\d)\d?)\.){3}(25[0-5]|(2[0-4]|1\d|[1-9]?\d)\d?)\/([0-9]|[12][0-9]|3[0-2])$/;
|
|
26
|
+
return cidrRegex.test(input.trim())
|
|
27
|
+
? true
|
|
28
|
+
: 'Please enter a valid CIDR (e.g. 10.0.0.0/24)';
|
|
29
|
+
}
|
|
30
|
+
function validateCIDRs(input) {
|
|
31
|
+
if (!input.trim()) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
const cidrs = input.split(',').map((v) => v.trim());
|
|
35
|
+
for (const cidr of cidrs) {
|
|
36
|
+
const result = validateCIDR(cidr);
|
|
37
|
+
if (result !== true) {
|
|
38
|
+
return `Invalid CIDR: ${cidr}`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
exports.dockerhubQuestions = [
|
|
44
|
+
{
|
|
45
|
+
name: 'dockerhubOrganisation',
|
|
46
|
+
type: 'text',
|
|
47
|
+
message: 'What is the name of your Docker Hub organisation?',
|
|
48
|
+
valueType: 'SECRET',
|
|
49
|
+
valueLabel: 'DOCKERHUB_ACCOUNT',
|
|
50
|
+
validate: notEmpty,
|
|
51
|
+
initial: process.env.DOCKER_ORGANISATION,
|
|
52
|
+
scope: 'REPOSITORY'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'dockerhubRepository',
|
|
56
|
+
type: 'text',
|
|
57
|
+
message: 'What is the name of your private Docker Hub repository?',
|
|
58
|
+
valueType: 'SECRET',
|
|
59
|
+
valueLabel: 'DOCKERHUB_REPO',
|
|
60
|
+
validate: notEmpty,
|
|
61
|
+
initial: process.env.DOCKER_REPO,
|
|
62
|
+
scope: 'REPOSITORY'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'dockerhubUsername',
|
|
66
|
+
type: 'text',
|
|
67
|
+
message: 'What is the Docker Hub username the the target server should be using?',
|
|
68
|
+
valueType: 'SECRET',
|
|
69
|
+
valueLabel: 'DOCKER_USERNAME',
|
|
70
|
+
validate: notEmpty,
|
|
71
|
+
initial: process.env.DOCKER_USERNAME,
|
|
72
|
+
scope: 'REPOSITORY'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'dockerhubToken',
|
|
76
|
+
type: 'text',
|
|
77
|
+
message: 'What is the token of this Docker Hub account?',
|
|
78
|
+
valueType: 'SECRET',
|
|
79
|
+
valueLabel: 'DOCKER_TOKEN',
|
|
80
|
+
validate: notEmpty,
|
|
81
|
+
initial: process.env.DOCKER_TOKEN,
|
|
82
|
+
scope: 'REPOSITORY'
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
exports.githubQuestions = [
|
|
86
|
+
{
|
|
87
|
+
name: 'githubOrganisation',
|
|
88
|
+
type: 'text',
|
|
89
|
+
message: 'What is the name of your Github organisation?',
|
|
90
|
+
validate: notEmpty,
|
|
91
|
+
initial: process.env.GITHUB_ORGANISATION || (0, git_1.getRepoInfo)().organization,
|
|
92
|
+
scope: 'REPOSITORY'
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'githubRepository',
|
|
96
|
+
type: 'text',
|
|
97
|
+
message: 'What is your Github infrastructure repository?',
|
|
98
|
+
validate: notEmpty,
|
|
99
|
+
initial: process.env.GITHUB_REPOSITORY || (0, git_1.getRepoInfo)().repository,
|
|
100
|
+
scope: 'REPOSITORY'
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
exports.githubOtherQuestions = [
|
|
104
|
+
{
|
|
105
|
+
name: 'githubApprovers',
|
|
106
|
+
type: 'text',
|
|
107
|
+
message: 'Please provide/update list of production approvers?',
|
|
108
|
+
initial: process.env.GH_APPROVERS,
|
|
109
|
+
valueType: 'VARIABLE',
|
|
110
|
+
valueLabel: 'GH_APPROVERS',
|
|
111
|
+
scope: 'REPOSITORY'
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'approvalRequired',
|
|
115
|
+
type: 'select',
|
|
116
|
+
message: 'Would you like to enable approvals process for GitHub action workflows?',
|
|
117
|
+
choices: [
|
|
118
|
+
{
|
|
119
|
+
title: 'True',
|
|
120
|
+
value: 'true'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
title: 'False',
|
|
124
|
+
value: 'false'
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
valueType: 'VARIABLE',
|
|
128
|
+
validate: notEmpty,
|
|
129
|
+
valueLabel: 'APPROVAL_REQUIRED',
|
|
130
|
+
initial: process.env.APPROVAL_REQUIRED,
|
|
131
|
+
scope: 'ENVIRONMENT'
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
exports.githubTokenQuestion = [
|
|
135
|
+
{
|
|
136
|
+
name: 'githubToken',
|
|
137
|
+
type: 'text',
|
|
138
|
+
message: 'What is your Github token?',
|
|
139
|
+
validate: notEmpty,
|
|
140
|
+
initial: process.env.GITHUB_TOKEN,
|
|
141
|
+
valueType: 'SECRET',
|
|
142
|
+
scope: 'REPOSITORY',
|
|
143
|
+
valueLabel: 'GH_TOKEN'
|
|
144
|
+
}
|
|
145
|
+
];
|
|
146
|
+
exports.countryQuestions = [
|
|
147
|
+
{
|
|
148
|
+
name: 'country',
|
|
149
|
+
type: 'text',
|
|
150
|
+
message: 'What is the ISO 3166-1 alpha-3 country-code? (e.g. "NZL" for New Zealand) Reference: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3',
|
|
151
|
+
valueType: 'VARIABLE',
|
|
152
|
+
valueLabel: 'COUNTRY',
|
|
153
|
+
initial: process.env.COUNTRY,
|
|
154
|
+
scope: 'REPOSITORY'
|
|
155
|
+
}
|
|
156
|
+
];
|
|
157
|
+
exports.infrastructureQuestions = [
|
|
158
|
+
{
|
|
159
|
+
name: 'domain',
|
|
160
|
+
type: 'text',
|
|
161
|
+
message: 'What is the web domain applied after all subdomains in URLs?',
|
|
162
|
+
valueType: 'VARIABLE',
|
|
163
|
+
validate: notEmpty,
|
|
164
|
+
valueLabel: 'DOMAIN',
|
|
165
|
+
initial: process.env.DOMAIN,
|
|
166
|
+
scope: 'ENVIRONMENT'
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'kubeAPIHost',
|
|
170
|
+
type: 'text',
|
|
171
|
+
message: `Kubernetes API endpoint (default: auto-detect)`,
|
|
172
|
+
valueType: 'VARIABLE',
|
|
173
|
+
// validate: notEmpty,
|
|
174
|
+
valueLabel: 'KUBE_API_HOST',
|
|
175
|
+
initial: process.env.KUBE_API_HOST,
|
|
176
|
+
scope: 'ENVIRONMENT'
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: 'kubeApiAllowedCidrs',
|
|
180
|
+
type: 'text',
|
|
181
|
+
message: `Allowed CIDRs for Kubernetes API access (default: KUBE_API_HOST)`,
|
|
182
|
+
valueType: 'VARIABLE',
|
|
183
|
+
validate: validateCIDRs,
|
|
184
|
+
valueLabel: 'KUBE_API_ALLOWED_CIDRS',
|
|
185
|
+
initial: process.env.KUBE_API_ALLOWED_CIDRS || "",
|
|
186
|
+
scope: 'ENVIRONMENT',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'kubeWorkerNodes',
|
|
190
|
+
type: 'text',
|
|
191
|
+
message: `Kubernetes worker node hostnames or IPs (comma-separated, default: no worker nodes)`,
|
|
192
|
+
valueType: 'VARIABLE',
|
|
193
|
+
// validate: notEmpty,
|
|
194
|
+
valueLabel: 'KUBE_WORKER_NODES',
|
|
195
|
+
initial: process.env.KUBE_WORKER_NODES || '',
|
|
196
|
+
scope: 'ENVIRONMENT',
|
|
197
|
+
},
|
|
198
|
+
];
|
|
199
|
+
exports.staticSSLCertQuestions = [
|
|
200
|
+
{
|
|
201
|
+
name: 'sslCrt',
|
|
202
|
+
type: 'text',
|
|
203
|
+
message: 'Provide SSL Certificate or Certificate chain:',
|
|
204
|
+
valueType: 'SECRET',
|
|
205
|
+
validate: notEmpty,
|
|
206
|
+
valueLabel: 'SSL_CRT',
|
|
207
|
+
initial: process.env.SSL_CRT,
|
|
208
|
+
scope: 'ENVIRONMENT'
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: 'sslKey',
|
|
212
|
+
type: 'text',
|
|
213
|
+
message: 'Provide SSL Certificate key',
|
|
214
|
+
valueType: 'SECRET',
|
|
215
|
+
validate: notEmpty,
|
|
216
|
+
valueLabel: 'SSL_KEY',
|
|
217
|
+
initial: process.env.SSL_KEY,
|
|
218
|
+
scope: 'ENVIRONMENT'
|
|
219
|
+
},
|
|
220
|
+
];
|
|
221
|
+
exports.backupQuestions = [
|
|
222
|
+
{
|
|
223
|
+
name: 'backupHost',
|
|
224
|
+
type: 'text',
|
|
225
|
+
message: `Please enter backup server host/IP address, (default: no backup):`,
|
|
226
|
+
valueType: 'VARIABLE',
|
|
227
|
+
// validate: notEmpty,
|
|
228
|
+
valueLabel: 'BACKUP_HOST',
|
|
229
|
+
initial: process.env.BACKUP_HOST || '',
|
|
230
|
+
scope: 'ENVIRONMENT',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: 'backupUser',
|
|
234
|
+
type: 'text',
|
|
235
|
+
message: `Please enter backup server user name:`,
|
|
236
|
+
valueType: 'SECRET',
|
|
237
|
+
validate: notEmpty,
|
|
238
|
+
valueLabel: 'BACKUP_SERVER_USER',
|
|
239
|
+
initial: process.env.BACKUP_SERVER_USER || 'backup',
|
|
240
|
+
scope: 'ENVIRONMENT',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: 'backupType',
|
|
244
|
+
type: 'select',
|
|
245
|
+
message: 'Select environment backup mode',
|
|
246
|
+
choices: [
|
|
247
|
+
{
|
|
248
|
+
title: 'Full dump (daily full database backup)',
|
|
249
|
+
value: 'dump'
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
title: 'Differential (weekly full, daily diff backup)',
|
|
253
|
+
value: 'differential'
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
valueType: 'VARIABLE',
|
|
257
|
+
validate: notEmpty,
|
|
258
|
+
valueLabel: 'BACKUP_ENVIRONMENT_MODE',
|
|
259
|
+
initial: process.env.BACKUP_ENVIRONMENT_MODE,
|
|
260
|
+
scope: 'ENVIRONMENT',
|
|
261
|
+
},
|
|
262
|
+
];
|
|
263
|
+
exports.diskQuestions = [
|
|
264
|
+
{
|
|
265
|
+
name: 'diskSpace',
|
|
266
|
+
type: 'text',
|
|
267
|
+
message: `What is the amount of diskspace that should be dedicated to OpenCRVS data and will become the size of an encrypted cryptfs data directory.
|
|
268
|
+
\n${kleur_1.default.red('DO NOT USE ALL DISKSPACE FOR OPENCRVS!')}
|
|
269
|
+
\nLeave at least 50g available for OS use.`,
|
|
270
|
+
valueType: 'VARIABLE',
|
|
271
|
+
validate: notEmpty,
|
|
272
|
+
valueLabel: 'DISK_SPACE',
|
|
273
|
+
initial: process.env.DISK_SPACE || '200g',
|
|
274
|
+
scope: 'ENVIRONMENT',
|
|
275
|
+
},
|
|
276
|
+
];
|
|
277
|
+
exports.databaseAndMonitoringQuestions = [
|
|
278
|
+
{
|
|
279
|
+
name: 'kibanaUsername',
|
|
280
|
+
type: 'text',
|
|
281
|
+
message: 'Input the username for logging in to Kibana',
|
|
282
|
+
valueType: 'SECRET',
|
|
283
|
+
validate: notEmpty,
|
|
284
|
+
valueLabel: 'KIBANA_USERNAME',
|
|
285
|
+
initial: process.env.KIBANA_USERNAME || 'opencrvs-admin',
|
|
286
|
+
scope: 'ENVIRONMENT'
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: 'kibanaPassword',
|
|
290
|
+
type: 'text',
|
|
291
|
+
message: 'Input the password for logging in to Kibana',
|
|
292
|
+
valueType: 'SECRET',
|
|
293
|
+
validate: notEmpty,
|
|
294
|
+
valueLabel: 'KIBANA_PASSWORD',
|
|
295
|
+
initial: process.env.KIBANA_PASSWORD || (0, utils_1.generateLongPassword)(),
|
|
296
|
+
scope: 'ENVIRONMENT'
|
|
297
|
+
}
|
|
298
|
+
];
|
|
299
|
+
exports.emailQuestions = [
|
|
300
|
+
{
|
|
301
|
+
name: 'smtpHost',
|
|
302
|
+
type: 'text',
|
|
303
|
+
message: 'What is your SMTP host?',
|
|
304
|
+
valueType: 'SECRET',
|
|
305
|
+
validate: notEmpty,
|
|
306
|
+
valueLabel: 'SMTP_HOST',
|
|
307
|
+
initial: process.env.SMTP_HOST,
|
|
308
|
+
scope: 'ENVIRONMENT'
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: 'smtpUsername',
|
|
312
|
+
type: 'text',
|
|
313
|
+
message: 'What is your SMTP username?',
|
|
314
|
+
valueType: 'SECRET',
|
|
315
|
+
validate: notEmpty,
|
|
316
|
+
valueLabel: 'SMTP_USERNAME',
|
|
317
|
+
initial: process.env.SMTP_USERNAME,
|
|
318
|
+
scope: 'ENVIRONMENT'
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: 'smtpPassword',
|
|
322
|
+
type: 'text',
|
|
323
|
+
message: 'What is your SMTP password?',
|
|
324
|
+
valueType: 'SECRET',
|
|
325
|
+
validate: notEmpty,
|
|
326
|
+
valueLabel: 'SMTP_PASSWORD',
|
|
327
|
+
initial: process.env.SMTP_PASSWORD,
|
|
328
|
+
scope: 'ENVIRONMENT'
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
name: 'smtpPort',
|
|
332
|
+
type: 'text',
|
|
333
|
+
message: 'What is your SMTP port?',
|
|
334
|
+
valueType: 'SECRET',
|
|
335
|
+
validate: notEmpty,
|
|
336
|
+
valueLabel: 'SMTP_PORT',
|
|
337
|
+
initial: process.env.SMTP_PORT,
|
|
338
|
+
scope: 'ENVIRONMENT'
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: 'smtpSecure',
|
|
342
|
+
type: 'select',
|
|
343
|
+
message: 'Is the SMTP connection made securely using TLS?',
|
|
344
|
+
choices: [
|
|
345
|
+
{
|
|
346
|
+
title: 'True',
|
|
347
|
+
value: 'true'
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
title: 'False',
|
|
351
|
+
value: 'false'
|
|
352
|
+
}
|
|
353
|
+
],
|
|
354
|
+
valueType: 'SECRET',
|
|
355
|
+
validate: notEmpty,
|
|
356
|
+
valueLabel: 'SMTP_SECURE',
|
|
357
|
+
initial: process.env.SMTP_SECURE,
|
|
358
|
+
scope: 'ENVIRONMENT'
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: 'senderEmailAddress',
|
|
362
|
+
type: 'text',
|
|
363
|
+
message: 'What is your sender email address?',
|
|
364
|
+
valueType: 'SECRET',
|
|
365
|
+
validate: notEmpty,
|
|
366
|
+
valueLabel: 'SENDER_EMAIL_ADDRESS',
|
|
367
|
+
initial: process.env.SENDER_EMAIL_ADDRESS,
|
|
368
|
+
scope: 'ENVIRONMENT'
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
name: 'alertEmail',
|
|
372
|
+
type: 'text',
|
|
373
|
+
message: 'What is the email address to receive alert emails or a Slack channel email link?',
|
|
374
|
+
valueType: 'SECRET',
|
|
375
|
+
validate: notEmpty,
|
|
376
|
+
valueLabel: 'ALERT_EMAIL',
|
|
377
|
+
initial: process.env.ALERT_EMAIL,
|
|
378
|
+
scope: 'ENVIRONMENT'
|
|
379
|
+
}
|
|
380
|
+
];
|
|
381
|
+
exports.sentryQuestions = [
|
|
382
|
+
{
|
|
383
|
+
name: 'sentryDsn',
|
|
384
|
+
type: 'text',
|
|
385
|
+
message: 'What is your Sentry DSN?',
|
|
386
|
+
valueType: 'SECRET',
|
|
387
|
+
validate: notEmpty,
|
|
388
|
+
valueLabel: 'SENTRY_DSN',
|
|
389
|
+
initial: process.env.SENTRY_DSN,
|
|
390
|
+
scope: 'ENVIRONMENT'
|
|
391
|
+
}
|
|
392
|
+
];
|
|
393
|
+
exports.metabaseAdminQuestions = [
|
|
394
|
+
{
|
|
395
|
+
valueType: 'SECRET',
|
|
396
|
+
name: 'OPENCRVS_METABASE_ADMIN_EMAIL',
|
|
397
|
+
type: 'text',
|
|
398
|
+
message: 'Email for Metabase super admin. Used as a username when logging in to the dashboard',
|
|
399
|
+
valueLabel: 'OPENCRVS_METABASE_ADMIN_EMAIL',
|
|
400
|
+
scope: 'ENVIRONMENT',
|
|
401
|
+
initial: 'user@opencrvs.org'
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
valueType: 'SECRET',
|
|
405
|
+
name: 'OPENCRVS_METABASE_ADMIN_PASSWORD',
|
|
406
|
+
type: 'text',
|
|
407
|
+
message: 'Password for Metabase super admin.',
|
|
408
|
+
valueLabel: 'OPENCRVS_METABASE_ADMIN_PASSWORD',
|
|
409
|
+
scope: 'ENVIRONMENT',
|
|
410
|
+
initial: (0, utils_1.generateLongPassword)()
|
|
411
|
+
}
|
|
412
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-environment.d.ts","sourceRoot":"","sources":["../../src/environment/setup-environment.ts"],"names":[],"mappings":""}
|