@opencrvs/toolkit 2.0.0-rc.068feb5 → 2.0.0-rc.0710ce7
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 +1 -0
- package/build.sh +5 -5
- package/dist/application-config/index.js +17 -6
- package/dist/cli.js +482 -5374
- package/dist/commons/api/router.d.ts +10 -0
- package/dist/commons/conditionals/conditionals.d.ts +3 -3
- package/dist/commons/events/ActionConfig.d.ts +176 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
- package/dist/commons/events/EventConfig.d.ts +2 -0
- package/dist/commons/events/EventIndex.d.ts +25 -0
- package/dist/commons/events/EventMetadata.d.ts +26 -0
- package/dist/commons/events/FieldConfig.d.ts +10 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +39 -0
- package/dist/commons/events/locations.d.ts +1 -0
- package/dist/commons/events/state/index.d.ts +8 -0
- package/dist/commons/events/state/utils.d.ts +9 -0
- package/dist/conditionals/index.js +10 -5
- package/dist/environment/custom-types.d.ts.map +1 -1
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/derived-variables.js +1 -1
- package/dist/environment/editor-questions.d.ts +0 -1
- package/dist/environment/editor-questions.d.ts.map +1 -1
- package/dist/environment/editor-questions.js +6 -5
- package/dist/environment/git.js +5 -5
- package/dist/environment/github.d.ts.map +1 -1
- package/dist/environment/github.js +15 -12
- package/dist/environment/index.d.ts +0 -1
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +2 -2
- package/dist/environment/manage-users.d.ts.map +1 -1
- package/dist/environment/manage-users.js +11 -8
- package/dist/environment/questions-helper.d.ts.map +1 -1
- package/dist/environment/questions-helper.js +5 -5
- package/dist/environment/questions.d.ts +0 -23
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +14 -67
- package/dist/environment/setup-environment.js +75 -54
- package/dist/environment/ssh-keygen.d.ts.map +1 -1
- package/dist/environment/ssh-keygen.js +5 -2
- package/dist/environment/swarm-to-k8s.js +16 -15
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +16 -12
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +6 -5
- package/dist/environment/users.d.ts +1 -1
- package/dist/environment/users.d.ts.map +1 -1
- package/dist/environment/users.js +19 -9
- package/dist/environment/utils.d.ts.map +1 -1
- package/dist/environment/utils.js +1 -1
- package/dist/events/index.js +132 -13
- package/dist/migrations/v2.0/index.js +88 -5139
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
- package/dist/migrations/v2.1/index.d.ts +6 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -0
- package/dist/migrations/v2.1/index.js +218 -0
- package/dist/notification/index.js +108 -9
- package/dist/scopes/index.d.ts +89 -1
- package/dist/scopes/index.js +10 -5
- package/dist/{environment/templates → templates}/charts-values/dependencies/values.yaml +7 -6
- package/dist/{environment/templates/charts-values/dependencies → templates/charts-values/opencrvs-services}/values.override.yaml +1 -1
- package/dist/{environment/templates → templates}/charts-values/opencrvs-services/values.yaml +8 -6
- package/dist/{environment/templates → templates}/charts-values/traefik/values.override.yaml +1 -1
- package/dist/{environment/templates → templates}/charts-values/traefik/values.yaml +6 -7
- package/dist/{environment/templates → templates}/inventory/production.example.yml +2 -2
- package/opencrvs-toolkit-2.0.0-rc.0710ce7.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.068feb5.tgz +0 -0
- /package/dist/{environment/templates/charts-values/opencrvs-services → templates/charts-values/dependencies}/values.override.yaml +0 -0
- /package/dist/{environment/templates → templates}/inventory/inventory.template.yml +0 -0
- /package/dist/{environment/templates → templates}/inventory/qa.example.yml +0 -0
|
@@ -40,6 +40,7 @@ type ToArrayFields<T, K extends PropertyKey> = T extends unknown ? T extends obj
|
|
|
40
40
|
*/
|
|
41
41
|
export type EventIndexWithAdministrativeHierarchy = Omit<ToArrayFields<EventIndex, 'createdAtLocation' | 'updatedAtLocation' | 'placeOfEvent'>, 'legalStatuses'> & {
|
|
42
42
|
legalStatuses: {
|
|
43
|
+
NOTIFIED: ToArrayFields<ActionCreationMetadata, 'createdAtLocation'> | undefined;
|
|
43
44
|
DECLARED: ToArrayFields<ActionCreationMetadata, 'createdAtLocation'> | undefined;
|
|
44
45
|
REGISTERED: ToArrayFields<RegistrationCreationMetadata, 'createdAtLocation'> | undefined;
|
|
45
46
|
};
|
|
@@ -65,6 +65,14 @@ export declare function applyDraftToEventIndex(eventIndex: EventIndex, draft: Dr
|
|
|
65
65
|
type: string;
|
|
66
66
|
status: "CREATED" | "NOTIFIED" | "DECLARED" | "REGISTERED" | "ARCHIVED";
|
|
67
67
|
legalStatuses: {
|
|
68
|
+
NOTIFIED?: {
|
|
69
|
+
createdAt: string;
|
|
70
|
+
createdBy: string;
|
|
71
|
+
acceptedAt: string;
|
|
72
|
+
createdAtLocation?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
73
|
+
createdByUserType?: "user" | "system" | null | undefined;
|
|
74
|
+
createdByRole?: string | undefined;
|
|
75
|
+
} | null | undefined;
|
|
68
76
|
DECLARED?: {
|
|
69
77
|
createdAt: string;
|
|
70
78
|
createdBy: string;
|
|
@@ -30,6 +30,15 @@ export declare function getActionUpdateMetadata(actions: Action[]): Pick<{
|
|
|
30
30
|
* @see EventIndex for the description of the returned object.
|
|
31
31
|
*/
|
|
32
32
|
export declare function getLegalStatuses(actions: Action[]): {
|
|
33
|
+
NOTIFIED: {
|
|
34
|
+
createdAt: string;
|
|
35
|
+
createdBy: string;
|
|
36
|
+
createdByUserType: "user" | "system";
|
|
37
|
+
createdAtLocation: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
38
|
+
acceptedAt: string;
|
|
39
|
+
createdByRole: string | undefined;
|
|
40
|
+
registrationNumber: string | null | undefined;
|
|
41
|
+
} | null;
|
|
33
42
|
DECLARED: {
|
|
34
43
|
createdAt: string;
|
|
35
44
|
createdBy: string;
|
|
@@ -191,11 +191,13 @@ var scopeOptionsPlaceEvent = z6.object({
|
|
|
191
191
|
event: scopeByEvent,
|
|
192
192
|
placeOfEvent: JurisdictionFilter.optional()
|
|
193
193
|
}).describe("Options applicable to all record scopes.");
|
|
194
|
-
var
|
|
194
|
+
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
195
|
+
notifiedIn: JurisdictionFilter.optional(),
|
|
196
|
+
notifiedBy: UserFilter.optional(),
|
|
195
197
|
declaredIn: JurisdictionFilter.optional(),
|
|
196
198
|
declaredBy: UserFilter.optional()
|
|
197
199
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
198
|
-
var AllRecordScopeOptions =
|
|
200
|
+
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
199
201
|
registeredIn: JurisdictionFilter.optional(),
|
|
200
202
|
registeredBy: UserFilter.optional()
|
|
201
203
|
}).describe(
|
|
@@ -233,6 +235,8 @@ var ResolvedScopeOptionsPlaceEvent = z6.object({
|
|
|
233
235
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
234
236
|
);
|
|
235
237
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
238
|
+
notifiedIn: UUID.nullish(),
|
|
239
|
+
notifiedBy: z6.string().optional(),
|
|
236
240
|
declaredIn: UUID.nullish(),
|
|
237
241
|
declaredBy: z6.string().optional()
|
|
238
242
|
}).describe(
|
|
@@ -278,7 +282,7 @@ var RecordScopeV2 = z6.discriminatedUnion("type", [
|
|
|
278
282
|
}),
|
|
279
283
|
z6.object({
|
|
280
284
|
type: ScopesWithDeclaredOptions,
|
|
281
|
-
options:
|
|
285
|
+
options: scopeOptionsDeclaredOrNotified.optional()
|
|
282
286
|
}),
|
|
283
287
|
z6.object({
|
|
284
288
|
type: ScopesWithFullOptions,
|
|
@@ -367,8 +371,9 @@ var EncodedScope2 = z6.string().brand("EncodedScope");
|
|
|
367
371
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
368
372
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
369
373
|
accessLevel: JurisdictionFilter.enum.all,
|
|
370
|
-
|
|
371
|
-
declaredIn: JurisdictionFilter.enum.all
|
|
374
|
+
notifiedIn: JurisdictionFilter.enum.all,
|
|
375
|
+
declaredIn: JurisdictionFilter.enum.all,
|
|
376
|
+
registeredIn: JurisdictionFilter.enum.all
|
|
372
377
|
};
|
|
373
378
|
|
|
374
379
|
// ../commons/src/users/userReferences.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-types.d.ts","sourceRoot":"","sources":["../../src/environment/custom-types.ts"],"names":[],"mappings":"AAWA,OAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"custom-types.d.ts","sourceRoot":"","sources":["../../src/environment/custom-types.ts"],"names":[],"mappings":"AAWA,OAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE3C,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG;IACzD,IAAI,EAAE,CAAC,CAAA;IACP,SAAS,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IACjC,KAAK,EAAE,aAAa,GAAG,YAAY,CAAA;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IAC7E,IAAI,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"derived-variables.d.ts","sourceRoot":"","sources":["../../src/environment/derived-variables.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2JnB,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Secret, Variable } from './github';
|
|
2
2
|
import { AnswerWithNullValue, QuestionDescriptor } from './custom-types';
|
|
3
|
-
export declare function editorQuestion(question: string): Promise<string>;
|
|
4
3
|
export declare function askQuestionWithEditor(questions: Array<QuestionDescriptor<any>>, existingValues: Array<Secret | Variable>): Promise<AnswerWithNullValue[]>;
|
|
5
4
|
//# sourceMappingURL=editor-questions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-questions.d.ts","sourceRoot":"","sources":["../../src/environment/editor-questions.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"editor-questions.d.ts","sourceRoot":"","sources":["../../src/environment/editor-questions.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EACL,mBAAmB,EAEnB,kBAAkB,EACnB,MAAM,gBAAgB,CAAA;AAUvB,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,EACzC,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,GACvC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAoDhC"}
|
|
@@ -22,7 +22,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.editorQuestion = editorQuestion;
|
|
26
25
|
exports.askQuestionWithEditor = askQuestionWithEditor;
|
|
27
26
|
const utils_1 = require("./utils");
|
|
28
27
|
const kleur_1 = __importDefault(require("kleur"));
|
|
@@ -32,22 +31,24 @@ function editorQuestion(question) {
|
|
|
32
31
|
}
|
|
33
32
|
function askQuestionWithEditor(questions, existingValues) {
|
|
34
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
|
|
34
|
+
const answers = [];
|
|
36
35
|
for (const question of questions) {
|
|
37
36
|
const questionWithVariableLabel = Object.assign(Object.assign({}, question), { message: `${kleur_1.default.cyan(question.valueLabel || '')}: ${question.message}` });
|
|
38
37
|
if (!questionWithVariableLabel.valueLabel) {
|
|
39
|
-
throw Error(
|
|
38
|
+
throw Error('Undefined Label');
|
|
40
39
|
}
|
|
41
40
|
const existingSecret = (0, utils_1.findExistingValue)(questionWithVariableLabel.valueLabel, 'SECRET', questionWithVariableLabel.scope, existingValues);
|
|
42
41
|
let updateSecret = true;
|
|
43
42
|
if (existingSecret) {
|
|
44
|
-
updateSecret = (yield (0, prompts_1.default)([
|
|
43
|
+
updateSecret = (yield (0, prompts_1.default)([
|
|
44
|
+
{
|
|
45
45
|
name: 'overWrite',
|
|
46
46
|
type: 'confirm',
|
|
47
47
|
message: `${kleur_1.default.yellow(`${existingSecret.scope === 'REPOSITORY'
|
|
48
48
|
? 'Repository secret'
|
|
49
49
|
: 'Secret'} ${kleur_1.default.cyan(existingSecret.name)} already exists in Github. Do you want to update it?`)}`
|
|
50
|
-
}
|
|
50
|
+
}
|
|
51
|
+
])).overWrite;
|
|
51
52
|
}
|
|
52
53
|
if (!existingSecret || updateSecret === true) {
|
|
53
54
|
const question_answer = yield editorQuestion(questionWithVariableLabel.message);
|
package/dist/environment/git.js
CHANGED
|
@@ -14,15 +14,15 @@ exports.getRepoInfo = getRepoInfo;
|
|
|
14
14
|
const child_process_1 = require("child_process");
|
|
15
15
|
function getRepoInfo() {
|
|
16
16
|
try {
|
|
17
|
-
const remoteUrl = (0, child_process_1.execSync)(
|
|
18
|
-
stdio: [
|
|
17
|
+
const remoteUrl = (0, child_process_1.execSync)('git config --get remote.origin.url', {
|
|
18
|
+
stdio: ['ignore', 'pipe', 'ignore']
|
|
19
19
|
})
|
|
20
20
|
.toString()
|
|
21
21
|
.trim();
|
|
22
22
|
// Handle both SSH and HTTPS formats
|
|
23
23
|
const match = remoteUrl.match(/github\.com[:/](.+?)\/(.+?)(\.git)?$/);
|
|
24
24
|
if (!match) {
|
|
25
|
-
return { organization:
|
|
25
|
+
return { organization: '', repository: '' };
|
|
26
26
|
}
|
|
27
27
|
return {
|
|
28
28
|
organization: match[1],
|
|
@@ -31,8 +31,8 @@ function getRepoInfo() {
|
|
|
31
31
|
}
|
|
32
32
|
catch (_a) {
|
|
33
33
|
return {
|
|
34
|
-
organization:
|
|
35
|
-
repository:
|
|
34
|
+
organization: '',
|
|
35
|
+
repository: ''
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/environment/github.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAaf;AACD,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAaf;AAGD,wBAAsB,wBAAwB,CAC5C,OAAO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EAAE,CAAC,CAcnB;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,OAAO,CAAC,CAmBlB;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,aAAa,GAAG,YAAY,CAAA;CACpC,CAAA;AACD,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,UAAU,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,aAAa,GAAG,YAAY,CAAA;CACpC,CAAA;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,MAAM,EAAE,CAAC,CAcnB;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAsBrB;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAcrB"}
|
|
@@ -18,6 +18,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
18
18
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
21
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
25
|
exports.createEnvironmentVariable = createEnvironmentVariable;
|
|
23
26
|
exports.updateEnvironmentVariable = updateEnvironmentVariable;
|
|
@@ -32,7 +35,7 @@ exports.listEnvironmentSecrets = listEnvironmentSecrets;
|
|
|
32
35
|
exports.listRepositorySecrets = listRepositorySecrets;
|
|
33
36
|
exports.listEnvironmentVariables = listEnvironmentVariables;
|
|
34
37
|
exports.listRepositoryVariables = listRepositoryVariables;
|
|
35
|
-
const
|
|
38
|
+
const libsodium_wrappers_1 = __importDefault(require("libsodium-wrappers"));
|
|
36
39
|
const logger_1 = require("./logger");
|
|
37
40
|
function createEnvironmentVariable(octokit, repositoryId, environment, name, value) {
|
|
38
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -125,15 +128,15 @@ function getPublicKey(octokit, environment, ORGANISATION, REPOSITORY_NAME) {
|
|
|
125
128
|
function createEnvironmentSecret(octokit, repositoryId, environment, name, secret, organisationName, repositoryName) {
|
|
126
129
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
130
|
//Check if libsodium is ready and then proceed.
|
|
128
|
-
yield
|
|
131
|
+
yield libsodium_wrappers_1.default.ready;
|
|
129
132
|
const { key, key_id } = yield getPublicKey(octokit, environment, organisationName, repositoryName);
|
|
130
133
|
// Convert Secret & Base64 key to Uint8Array.
|
|
131
|
-
const binkey =
|
|
132
|
-
const binsec =
|
|
134
|
+
const binkey = libsodium_wrappers_1.default.from_base64(key, libsodium_wrappers_1.default.base64_variants.ORIGINAL);
|
|
135
|
+
const binsec = libsodium_wrappers_1.default.from_string(secret);
|
|
133
136
|
//Encrypt the secret using LibSodium
|
|
134
|
-
const encBytes =
|
|
137
|
+
const encBytes = libsodium_wrappers_1.default.crypto_box_seal(binsec, binkey);
|
|
135
138
|
// Convert encrypted Uint8Array to Base64
|
|
136
|
-
const encryptedValue =
|
|
139
|
+
const encryptedValue = libsodium_wrappers_1.default.to_base64(encBytes, libsodium_wrappers_1.default.base64_variants.ORIGINAL);
|
|
137
140
|
yield octokit.request(`PUT /repositories/${repositoryId}/environments/${environment}/secrets/${name}`, {
|
|
138
141
|
repository_id: repositoryId,
|
|
139
142
|
environment_name: environment,
|
|
@@ -149,15 +152,15 @@ function createEnvironmentSecret(octokit, repositoryId, environment, name, secre
|
|
|
149
152
|
function createRepositorySecret(octokit, repositoryId, name, secret, organisationName, repositoryName) {
|
|
150
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
154
|
//Check if libsodium is ready and then proceed.
|
|
152
|
-
yield
|
|
155
|
+
yield libsodium_wrappers_1.default.ready;
|
|
153
156
|
const { key, key_id } = yield getRepositoryPublicKey(octokit, organisationName, repositoryName);
|
|
154
157
|
// Convert Secret & Base64 key to Uint8Array.
|
|
155
|
-
const binkey =
|
|
156
|
-
const binsec =
|
|
158
|
+
const binkey = libsodium_wrappers_1.default.from_base64(key, libsodium_wrappers_1.default.base64_variants.ORIGINAL);
|
|
159
|
+
const binsec = libsodium_wrappers_1.default.from_string(secret);
|
|
157
160
|
//Encrypt the secret using LibSodium
|
|
158
|
-
const encBytes =
|
|
161
|
+
const encBytes = libsodium_wrappers_1.default.crypto_box_seal(binsec, binkey);
|
|
159
162
|
// Convert encrypted Uint8Array to Base64
|
|
160
|
-
const encryptedValue =
|
|
163
|
+
const encryptedValue = libsodium_wrappers_1.default.to_base64(encBytes, libsodium_wrappers_1.default.base64_variants.ORIGINAL);
|
|
161
164
|
yield octokit.request(`PUT /repositories/${repositoryId}/actions/secrets/${name}`, {
|
|
162
165
|
encrypted_value: encryptedValue,
|
|
163
166
|
key_id,
|
|
@@ -172,7 +175,7 @@ function getRepositoryEnvironments(octokit, githubOrganisation, repository) {
|
|
|
172
175
|
var _a;
|
|
173
176
|
const response = yield octokit.request('GET /repos/{githubOrganisation}/{repository}/environments', {
|
|
174
177
|
githubOrganisation,
|
|
175
|
-
repository
|
|
178
|
+
repository
|
|
176
179
|
});
|
|
177
180
|
// Safe access with fallback to empty array if undefined
|
|
178
181
|
const environments = ((_a = response.data.environments) !== null && _a !== void 0 ? _a : []).map((env) => env.name);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare function validateRepositoryStructure(repositoryRoot?: string): void;
|
|
2
1
|
export declare function runEnvironmentInit(): Promise<void>;
|
|
3
2
|
export declare function runEnvironmentUpdateWorkflows(): Promise<void>;
|
|
4
3
|
export declare function runEnvironmentUsers(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":"AAwCA,wBAAsB,kBAAkB,kBAGvC;AAED,wBAAsB,6BAA6B,kBAIlD;AAED,wBAAsB,mBAAmB,kBAIxC;AAED,wBAAsB,wBAAwB,kBAG7C"}
|
|
@@ -19,7 +19,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.validateRepositoryStructure = validateRepositoryStructure;
|
|
23
22
|
exports.runEnvironmentInit = runEnvironmentInit;
|
|
24
23
|
exports.runEnvironmentUpdateWorkflows = runEnvironmentUpdateWorkflows;
|
|
25
24
|
exports.runEnvironmentUsers = runEnvironmentUsers;
|
|
@@ -60,7 +59,8 @@ function runEnvironmentUpdateWorkflows() {
|
|
|
60
59
|
function runEnvironmentUsers() {
|
|
61
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
61
|
validateRepositoryStructure();
|
|
63
|
-
yield import('./users.js');
|
|
62
|
+
const { manageEnvironmentUsers } = yield import('./users.js');
|
|
63
|
+
yield manageEnvironmentUsers();
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
function runEnvironmentSwarmToK8s() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manage-users.d.ts","sourceRoot":"","sources":["../../src/environment/manage-users.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manage-users.d.ts","sourceRoot":"","sources":["../../src/environment/manage-users.ts"],"names":[],"mappings":"AAkCA,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC3B,IAAI,EAAE,OAAO,GAAG,UAAU,CAAA;CAC3B;AAkWD;;GAEG;AACH,wBAAsB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAqIxE"}
|
|
@@ -44,6 +44,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
45
|
exports.manageUsers = manageUsers;
|
|
46
46
|
const os = __importStar(require("os"));
|
|
47
|
+
/* eslint-disable no-console */
|
|
47
48
|
const fs = __importStar(require("fs"));
|
|
48
49
|
const path = __importStar(require("path"));
|
|
49
50
|
function inquirerPrompt(name, options) {
|
|
@@ -163,7 +164,7 @@ function askToAddCurrentUser(existingUsers) {
|
|
|
163
164
|
const currentUsername = getCurrentUsername();
|
|
164
165
|
const currentKeys = getCurrentUserSSHKeys();
|
|
165
166
|
// Check if user already exists
|
|
166
|
-
if (existingUsers.find(u => u.name === currentUsername)) {
|
|
167
|
+
if (existingUsers.find((u) => u.name === currentUsername)) {
|
|
167
168
|
(0, logger_1.info)(`ℹ️ User "${currentUsername}" already exists in inventory.`);
|
|
168
169
|
return null;
|
|
169
170
|
}
|
|
@@ -199,7 +200,7 @@ function addNewUser(existingUsers) {
|
|
|
199
200
|
if (!value.trim()) {
|
|
200
201
|
return 'Username required';
|
|
201
202
|
}
|
|
202
|
-
if (existingUsers.find(u => u.name === value.trim())) {
|
|
203
|
+
if (existingUsers.find((u) => u.name === value.trim())) {
|
|
203
204
|
return `User "${value}" already exists`;
|
|
204
205
|
}
|
|
205
206
|
if (!/^[a-z_][a-z0-9_-]*[$]?$/.test(value.trim())) {
|
|
@@ -221,7 +222,7 @@ function addNewUser(existingUsers) {
|
|
|
221
222
|
}
|
|
222
223
|
const role = yield selectRole();
|
|
223
224
|
// New users always active
|
|
224
|
-
const state =
|
|
225
|
+
const state = 'present';
|
|
225
226
|
return {
|
|
226
227
|
name: name.trim(),
|
|
227
228
|
ssh_keys,
|
|
@@ -378,7 +379,9 @@ function editUser(user) {
|
|
|
378
379
|
*/
|
|
379
380
|
function manageUsers(inventoryPath) {
|
|
380
381
|
return __awaiter(this, void 0, void 0, function* () {
|
|
381
|
-
let users = fs.existsSync(inventoryPath)
|
|
382
|
+
let users = fs.existsSync(inventoryPath)
|
|
383
|
+
? parseInventoryFile(inventoryPath)
|
|
384
|
+
: [];
|
|
382
385
|
if (users.length > 0) {
|
|
383
386
|
displayUserSummary(users);
|
|
384
387
|
}
|
|
@@ -418,12 +421,12 @@ function manageUsers(inventoryPath) {
|
|
|
418
421
|
}
|
|
419
422
|
const userToEdit = yield select({
|
|
420
423
|
message: 'Select user to edit:',
|
|
421
|
-
choices: users.map(u => ({
|
|
424
|
+
choices: users.map((u) => ({
|
|
422
425
|
name: `${u.name} (${u.role}, ${u.state})`,
|
|
423
426
|
value: u.name
|
|
424
427
|
}))
|
|
425
428
|
});
|
|
426
|
-
const userIndex = users.findIndex(u => u.name === userToEdit);
|
|
429
|
+
const userIndex = users.findIndex((u) => u.name === userToEdit);
|
|
427
430
|
if (userIndex !== -1) {
|
|
428
431
|
users[userIndex] = yield editUser(users[userIndex]);
|
|
429
432
|
console.log(`✅ User "${userToEdit}" updated.\n`);
|
|
@@ -436,7 +439,7 @@ function manageUsers(inventoryPath) {
|
|
|
436
439
|
}
|
|
437
440
|
const usersToRemove = yield checkbox({
|
|
438
441
|
message: 'Select user(s) to remove:',
|
|
439
|
-
choices: users.map(u => ({
|
|
442
|
+
choices: users.map((u) => ({
|
|
440
443
|
name: `${u.name} (${u.role}, ${u.state})`,
|
|
441
444
|
value: u.name
|
|
442
445
|
}))
|
|
@@ -447,7 +450,7 @@ function manageUsers(inventoryPath) {
|
|
|
447
450
|
default: false
|
|
448
451
|
});
|
|
449
452
|
if (confirmRemove) {
|
|
450
|
-
users = users.filter(u => !usersToRemove.includes(u.name));
|
|
453
|
+
users = users.filter((u) => !usersToRemove.includes(u.name));
|
|
451
454
|
console.log(`✅ Removed ${usersToRemove.length} user(s).\n`);
|
|
452
455
|
}
|
|
453
456
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"questions-helper.d.ts","sourceRoot":"","sources":["../../src/environment/questions-helper.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"questions-helper.d.ts","sourceRoot":"","sources":["../../src/environment/questions-helper.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAYhC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,UASnE;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAkCjB"}
|
|
@@ -45,7 +45,7 @@ function getIndexFromChoices(choices, value) {
|
|
|
45
45
|
}
|
|
46
46
|
function selectWithCustom(config) {
|
|
47
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
const { message, choices, initial = undefined, customLabel = 'Other...', customInputMessage = 'Enter custom value:'
|
|
48
|
+
const { message, choices, initial = undefined, customLabel = 'Other...', customInputMessage = 'Enter custom value:' } = config;
|
|
49
49
|
const CUSTOM = '__custom__';
|
|
50
50
|
const selected = yield select({
|
|
51
51
|
message,
|
|
@@ -53,15 +53,15 @@ function selectWithCustom(config) {
|
|
|
53
53
|
...choices,
|
|
54
54
|
{
|
|
55
55
|
value: CUSTOM,
|
|
56
|
-
name: customLabel
|
|
57
|
-
}
|
|
56
|
+
name: customLabel
|
|
57
|
+
}
|
|
58
58
|
],
|
|
59
|
-
default: initial
|
|
59
|
+
default: initial
|
|
60
60
|
});
|
|
61
61
|
if (selected === CUSTOM) {
|
|
62
62
|
const customValue = yield input({
|
|
63
63
|
message: customInputMessage,
|
|
64
|
-
validate: (value) => value.trim().length > 0 ? true : 'Value cannot be empty'
|
|
64
|
+
validate: (value) => value.trim().length > 0 ? true : 'Value cannot be empty'
|
|
65
65
|
});
|
|
66
66
|
return customValue;
|
|
67
67
|
}
|
|
@@ -152,29 +152,6 @@ export declare const databaseAndMonitoringQuestions: {
|
|
|
152
152
|
initial: string;
|
|
153
153
|
scope: "ENVIRONMENT";
|
|
154
154
|
}[];
|
|
155
|
-
export declare const notificationTransportQuestions: {
|
|
156
|
-
name: string;
|
|
157
|
-
type: "select";
|
|
158
|
-
message: string;
|
|
159
|
-
choices: {
|
|
160
|
-
title: string;
|
|
161
|
-
value: string;
|
|
162
|
-
}[];
|
|
163
|
-
valueLabel: string;
|
|
164
|
-
valueType: "VARIABLE";
|
|
165
|
-
scope: "ENVIRONMENT";
|
|
166
|
-
initial: string | undefined;
|
|
167
|
-
}[];
|
|
168
|
-
export declare const smsQuestions: {
|
|
169
|
-
name: string;
|
|
170
|
-
type: "text";
|
|
171
|
-
message: string;
|
|
172
|
-
valueType: "SECRET";
|
|
173
|
-
validate: (value: string | number) => true | "Please enter a value";
|
|
174
|
-
valueLabel: string;
|
|
175
|
-
initial: string | undefined;
|
|
176
|
-
scope: "ENVIRONMENT";
|
|
177
|
-
}[];
|
|
178
155
|
export declare const emailQuestions: ({
|
|
179
156
|
name: string;
|
|
180
157
|
type: "text";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../src/environment/questions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../src/environment/questions.ts"],"names":[],"mappings":"AA+BA,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAgBnD;AAED,eAAO,MAAM,kBAAkB;;;;;;sBAlCN,MAAM,GAAG,MAAM;;;GA4EvC,CAAA;AAED,eAAO,MAAM,eAAe;;;;sBA9EH,MAAM,GAAG,MAAM;;;GA+FvC,CAAA;AACD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;sBAhGR,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;;;;;;;;;;;;;;;;;;;;;;IAmMvC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;sBArMV,MAAM,GAAG,MAAM;;;;GA0NvC,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;sBA5NH,MAAM,GAAG,MAAM;;;;;;;;;;;;;;sBAAf,MAAM,GAAG,MAAM;;;;IAqQvC,CAAA;AAED,eAAO,MAAM,aAAa;;;;;sBAvQD,MAAM,GAAG,MAAM;;;;GAoRvC,CAAA;AAED,eAAO,MAAM,8BAA8B;;;;;sBAtRlB,MAAM,GAAG,MAAM;;;;GA2SvC,CAAA;AAED,eAAO,MAAM,cAAc;;;;;sBA7SF,MAAM,GAAG,MAAM;;;;;;;;;;;;;;sBAAf,MAAM,GAAG,MAAM;;;;IA+XvC,CAAA;AAED,eAAO,MAAM,eAAe;;;;;sBAjYH,MAAM,GAAG,MAAM;;;;GA4YvC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;GAoBlC,CAAA"}
|
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.metabaseAdminQuestions = exports.sentryQuestions = exports.emailQuestions = exports.
|
|
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
17
|
const kleur_1 = __importDefault(require("kleur"));
|
|
18
18
|
const utils_1 = require("./utils");
|
|
19
19
|
const git_1 = require("./git");
|
|
@@ -98,7 +98,7 @@ exports.githubQuestions = [
|
|
|
98
98
|
validate: notEmpty,
|
|
99
99
|
initial: process.env.GITHUB_REPOSITORY || (0, git_1.getRepoInfo)().repository,
|
|
100
100
|
scope: 'REPOSITORY'
|
|
101
|
-
}
|
|
101
|
+
}
|
|
102
102
|
];
|
|
103
103
|
exports.githubOtherQuestions = [
|
|
104
104
|
{
|
|
@@ -129,7 +129,7 @@ exports.githubOtherQuestions = [
|
|
|
129
129
|
valueLabel: 'APPROVAL_REQUIRED',
|
|
130
130
|
initial: process.env.APPROVAL_REQUIRED,
|
|
131
131
|
scope: 'ENVIRONMENT'
|
|
132
|
-
}
|
|
132
|
+
}
|
|
133
133
|
];
|
|
134
134
|
exports.githubTokenQuestion = [
|
|
135
135
|
{
|
|
@@ -182,8 +182,8 @@ exports.infrastructureQuestions = [
|
|
|
182
182
|
valueType: 'VARIABLE',
|
|
183
183
|
validate: validateCIDRs,
|
|
184
184
|
valueLabel: 'KUBE_API_ALLOWED_CIDRS',
|
|
185
|
-
initial: process.env.KUBE_API_ALLOWED_CIDRS ||
|
|
186
|
-
scope: 'ENVIRONMENT'
|
|
185
|
+
initial: process.env.KUBE_API_ALLOWED_CIDRS || '',
|
|
186
|
+
scope: 'ENVIRONMENT'
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
189
|
name: 'kubeWorkerNodes',
|
|
@@ -193,8 +193,8 @@ exports.infrastructureQuestions = [
|
|
|
193
193
|
// validate: notEmpty,
|
|
194
194
|
valueLabel: 'KUBE_WORKER_NODES',
|
|
195
195
|
initial: process.env.KUBE_WORKER_NODES || '',
|
|
196
|
-
scope: 'ENVIRONMENT'
|
|
197
|
-
}
|
|
196
|
+
scope: 'ENVIRONMENT'
|
|
197
|
+
}
|
|
198
198
|
];
|
|
199
199
|
exports.staticSSLCertQuestions = [
|
|
200
200
|
{
|
|
@@ -216,7 +216,7 @@ exports.staticSSLCertQuestions = [
|
|
|
216
216
|
valueLabel: 'SSL_KEY',
|
|
217
217
|
initial: process.env.SSL_KEY,
|
|
218
218
|
scope: 'ENVIRONMENT'
|
|
219
|
-
}
|
|
219
|
+
}
|
|
220
220
|
];
|
|
221
221
|
exports.backupQuestions = [
|
|
222
222
|
{
|
|
@@ -227,7 +227,7 @@ exports.backupQuestions = [
|
|
|
227
227
|
// validate: notEmpty,
|
|
228
228
|
valueLabel: 'BACKUP_HOST',
|
|
229
229
|
initial: process.env.BACKUP_HOST || '',
|
|
230
|
-
scope: 'ENVIRONMENT'
|
|
230
|
+
scope: 'ENVIRONMENT'
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
233
|
name: 'backupUser',
|
|
@@ -237,7 +237,7 @@ exports.backupQuestions = [
|
|
|
237
237
|
validate: notEmpty,
|
|
238
238
|
valueLabel: 'BACKUP_SERVER_USER',
|
|
239
239
|
initial: process.env.BACKUP_SERVER_USER || 'backup',
|
|
240
|
-
scope: 'ENVIRONMENT'
|
|
240
|
+
scope: 'ENVIRONMENT'
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
name: 'backupType',
|
|
@@ -257,8 +257,8 @@ exports.backupQuestions = [
|
|
|
257
257
|
validate: notEmpty,
|
|
258
258
|
valueLabel: 'BACKUP_ENVIRONMENT_MODE',
|
|
259
259
|
initial: process.env.BACKUP_ENVIRONMENT_MODE,
|
|
260
|
-
scope: 'ENVIRONMENT'
|
|
261
|
-
}
|
|
260
|
+
scope: 'ENVIRONMENT'
|
|
261
|
+
}
|
|
262
262
|
];
|
|
263
263
|
exports.diskQuestions = [
|
|
264
264
|
{
|
|
@@ -271,8 +271,8 @@ exports.diskQuestions = [
|
|
|
271
271
|
validate: notEmpty,
|
|
272
272
|
valueLabel: 'DISK_SPACE',
|
|
273
273
|
initial: process.env.DISK_SPACE || '200g',
|
|
274
|
-
scope: 'ENVIRONMENT'
|
|
275
|
-
}
|
|
274
|
+
scope: 'ENVIRONMENT'
|
|
275
|
+
}
|
|
276
276
|
];
|
|
277
277
|
exports.databaseAndMonitoringQuestions = [
|
|
278
278
|
{
|
|
@@ -296,59 +296,6 @@ exports.databaseAndMonitoringQuestions = [
|
|
|
296
296
|
scope: 'ENVIRONMENT'
|
|
297
297
|
}
|
|
298
298
|
];
|
|
299
|
-
exports.notificationTransportQuestions = [
|
|
300
|
-
{
|
|
301
|
-
name: 'notificationTransport',
|
|
302
|
-
type: 'select',
|
|
303
|
-
message: 'Notification transport for 2FA, informant and user messaging',
|
|
304
|
-
choices: [
|
|
305
|
-
{
|
|
306
|
-
title: 'Email (with SMTP details)',
|
|
307
|
-
value: 'email'
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
title: 'SMS (Infobip)',
|
|
311
|
-
value: 'sms'
|
|
312
|
-
}
|
|
313
|
-
],
|
|
314
|
-
valueLabel: 'NOTIFICATION_TRANSPORT',
|
|
315
|
-
valueType: 'VARIABLE',
|
|
316
|
-
scope: 'ENVIRONMENT',
|
|
317
|
-
initial: process.env.NOTIFICATION_TRANSPORT
|
|
318
|
-
}
|
|
319
|
-
];
|
|
320
|
-
exports.smsQuestions = [
|
|
321
|
-
{
|
|
322
|
-
name: 'infobipApiKey',
|
|
323
|
-
type: 'text',
|
|
324
|
-
message: 'What is your Infobip API key?',
|
|
325
|
-
valueType: 'SECRET',
|
|
326
|
-
validate: notEmpty,
|
|
327
|
-
valueLabel: 'INFOBIP_API_KEY',
|
|
328
|
-
initial: process.env.INFOBIP_API_KEY,
|
|
329
|
-
scope: 'ENVIRONMENT'
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
name: 'infobipGatewayEndpoint',
|
|
333
|
-
type: 'text',
|
|
334
|
-
message: 'What is your Infobip gateway endpoint?',
|
|
335
|
-
valueType: 'SECRET',
|
|
336
|
-
validate: notEmpty,
|
|
337
|
-
valueLabel: 'INFOBIP_GATEWAY_ENDPOINT',
|
|
338
|
-
initial: process.env.INFOBIP_GATEWAY_ENDPOINT,
|
|
339
|
-
scope: 'ENVIRONMENT'
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
name: 'infobipSenderId',
|
|
343
|
-
type: 'text',
|
|
344
|
-
message: 'What is your Infobip sender ID?',
|
|
345
|
-
valueType: 'SECRET',
|
|
346
|
-
validate: notEmpty,
|
|
347
|
-
valueLabel: 'INFOBIP_SENDER_ID',
|
|
348
|
-
initial: process.env.INFOBIP_SENDER_ID,
|
|
349
|
-
scope: 'ENVIRONMENT'
|
|
350
|
-
}
|
|
351
|
-
];
|
|
352
299
|
exports.emailQuestions = [
|
|
353
300
|
{
|
|
354
301
|
name: 'smtpHost',
|