@opencrvs/toolkit 2.0.1 → 2.1.0-beta
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 +16 -0
- package/build.sh +14 -5
- package/create-countryconfig/index.js +293 -103
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +5 -2
- package/dist/application-config/index.js +369 -282
- package/dist/authentication/index.d.ts +67 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +750 -0
- package/dist/cli.js +4343 -4788
- package/dist/commons/api/router.d.ts +4120 -2946
- package/dist/commons/application-config/index.d.ts +6 -6
- package/dist/commons/conditionals/conditionals.d.ts +32 -323
- package/dist/commons/conditionals/validate.d.ts +16 -5
- package/dist/commons/events/ActionConfig.d.ts +302 -71
- package/dist/commons/events/ActionDocument.d.ts +159 -121
- package/dist/commons/events/ActionInput.d.ts +30 -10
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/ActionType.d.ts +63 -58
- package/dist/commons/events/AdvancedSearchConfig.d.ts +531 -501
- package/dist/commons/events/AuditLog.d.ts +189 -40
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/Conditional.d.ts +3 -3
- package/dist/commons/events/CountryConfigQueryInput.d.ts +603 -561
- package/dist/commons/events/Draft.d.ts +38 -36
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +8 -3
- package/dist/commons/events/EventDocument.d.ts +537 -47
- package/dist/commons/events/EventIndex.d.ts +61 -59
- package/dist/commons/events/EventMetadata.d.ts +59 -43
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +424 -384
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +86 -86
- package/dist/commons/events/FieldValue.d.ts +14 -14
- package/dist/commons/events/Flag.d.ts +57 -15
- package/dist/commons/events/FormConfig.d.ts +0 -6
- package/dist/commons/events/PageConfig.d.ts +0 -4
- package/dist/commons/events/PlainDate.d.ts +8 -0
- package/dist/commons/events/SummaryConfig.d.ts +249 -0
- package/dist/commons/events/TemplateConfig.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
- package/dist/commons/events/WorkqueueConfig.d.ts +835 -790
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +14 -2
- package/dist/commons/events/field.d.ts +69 -198
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locationPayloads.d.ts +95 -0
- package/dist/commons/events/locations.d.ts +248 -14
- package/dist/commons/events/mocks.test.utils.d.ts +48 -4
- package/dist/commons/events/scopes.d.ts +5 -4
- package/dist/commons/events/state/index.d.ts +23 -15
- package/dist/commons/events/state/utils.d.ts +15 -6
- package/dist/commons/events/test.utils.d.ts +68 -42
- package/dist/commons/events/utils.d.ts +139 -110
- package/dist/commons/notification/UserNotifications.d.ts +38 -18
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +341 -68
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- 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 +122 -0
- package/dist/environment/derived-variables.d.ts.map +1 -0
- package/dist/environment/derived-variables.js +155 -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 +67 -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 +247 -0
- package/dist/environment/index.d.ts +6 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +81 -0
- package/dist/environment/logger.d.ts +18 -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 +507 -0
- package/dist/environment/paths.d.ts +7 -0
- package/dist/environment/paths.d.ts.map +1 -0
- package/dist/environment/paths.js +72 -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 +200 -0
- package/dist/environment/questions.d.ts.map +1 -0
- package/dist/environment/questions.js +418 -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 +795 -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 +21 -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 +183 -0
- package/dist/environment/templates.d.ts +27 -0
- package/dist/environment/templates.d.ts.map +1 -0
- package/dist/environment/templates.js +164 -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 +191 -0
- package/dist/environment/upgrade.d.ts +2 -0
- package/dist/environment/upgrade.d.ts.map +1 -0
- package/dist/environment/upgrade.js +82 -0
- package/dist/environment/users.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +120 -0
- package/dist/environment/utils.d.ts +18 -0
- package/dist/environment/utils.d.ts.map +1 -0
- package/dist/environment/utils.js +110 -0
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +8104 -7408
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
- package/dist/migrations/v2.0/index.js +88 -5143
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +3 -3
- package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
- 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/add-recovery-link-notifications.d.ts +3 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
- package/dist/migrations/v2.1/add-translations.d.ts +9 -0
- package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-translations.js +213 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +438 -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 +1276 -0
- package/dist/notification/index.js +2010 -1451
- package/dist/scopes/index.d.ts +512 -231
- package/dist/scopes/index.js +342 -68
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +39 -0
- 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 +78 -0
- package/dist/templates/charts-values/opentelemetry/values.yaml +95 -0
- package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
- package/dist/templates/charts-values/traefik/values.yaml +129 -0
- package/dist/templates/inventory/inventory.template.yml +98 -0
- package/dist/translations/check.d.ts +19 -0
- package/dist/translations/check.d.ts.map +1 -0
- package/dist/translations/check.js +127 -0
- package/dist/verify/endpoints.d.ts.map +1 -1
- package/dist/verify/endpoints.js +25 -25
- package/opencrvs-toolkit-2.1.0-beta.tgz +0 -0
- package/package.json +25 -6
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/opencrvs-toolkit-2.0.1.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
package/dist/csv.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.parseCsvLine = parseCsvLine;
|
|
14
|
+
exports.toCsvLine = toCsvLine;
|
|
15
|
+
exports.idOf = idOf;
|
|
16
|
+
exports.readCsvFile = readCsvFile;
|
|
17
|
+
exports.writeCsvFile = writeCsvFile;
|
|
18
|
+
exports.addRows = addRows;
|
|
19
|
+
/**
|
|
20
|
+
* Just enough CSV for the translation files codemods edit. They are read and
|
|
21
|
+
* written a line at a time rather than through a parser, so that adding two
|
|
22
|
+
* rows to a file of sixteen hundred produces a diff of two lines instead of a
|
|
23
|
+
* re-quoted rewrite of the whole thing.
|
|
24
|
+
*
|
|
25
|
+
* Rows spanning multiple lines are not supported, and none of the translation
|
|
26
|
+
* files contain any.
|
|
27
|
+
*/
|
|
28
|
+
const fs_1 = require("fs");
|
|
29
|
+
function parseCsvLine(line) {
|
|
30
|
+
const values = [];
|
|
31
|
+
let value = '';
|
|
32
|
+
let quoted = false;
|
|
33
|
+
for (let index = 0; index < line.length; index++) {
|
|
34
|
+
const character = line[index];
|
|
35
|
+
if (quoted) {
|
|
36
|
+
if (character !== '"') {
|
|
37
|
+
value += character;
|
|
38
|
+
}
|
|
39
|
+
else if (line[index + 1] === '"') {
|
|
40
|
+
value += '"';
|
|
41
|
+
index++;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
quoted = false;
|
|
45
|
+
}
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (character === '"') {
|
|
49
|
+
quoted = true;
|
|
50
|
+
}
|
|
51
|
+
else if (character === ',') {
|
|
52
|
+
values.push(value);
|
|
53
|
+
value = '';
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
value += character;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
values.push(value);
|
|
60
|
+
return values;
|
|
61
|
+
}
|
|
62
|
+
function toCsvLine(values) {
|
|
63
|
+
return values
|
|
64
|
+
.map((value) => /["\n,]/.test(value) ? `"${value.replace(/"/g, '""')}"` : value)
|
|
65
|
+
.join(',');
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The id of a row, which is its first column. Translation ids never contain a
|
|
69
|
+
* comma or a quote, so this does not need the parser.
|
|
70
|
+
*/
|
|
71
|
+
function idOf(line) {
|
|
72
|
+
const comma = line.indexOf(',');
|
|
73
|
+
// No comma: `slice(0, -1)` would eat the last character.
|
|
74
|
+
return comma === -1 ? line : line.slice(0, comma);
|
|
75
|
+
}
|
|
76
|
+
function readCsvFile(path) {
|
|
77
|
+
if (!(0, fs_1.existsSync)(path)) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const contents = (0, fs_1.readFileSync)(path, 'utf8');
|
|
81
|
+
const newline = contents.includes('\r\n') ? '\r\n' : '\n';
|
|
82
|
+
const trailingNewline = /\r?\n$/.test(contents);
|
|
83
|
+
const lines = contents.replace(/\r?\n$/, '').split(/\r?\n/);
|
|
84
|
+
// Trailing blank line leaves an empty entry. It sorts before every id, so
|
|
85
|
+
// the file reads as unsorted.
|
|
86
|
+
const body = lines.slice(1).filter((line) => line !== '');
|
|
87
|
+
return { header: lines[0], body, newline, trailingNewline };
|
|
88
|
+
}
|
|
89
|
+
function writeCsvFile(path, file) {
|
|
90
|
+
(0, fs_1.writeFileSync)(path, [file.header, ...file.body].join(file.newline) +
|
|
91
|
+
(file.trailingNewline ? file.newline : ''));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Adds the rows the file does not already have an id for, in place. Rows go in
|
|
95
|
+
* sorted position when the file is sorted by id, and at the end when it is not,
|
|
96
|
+
* so a country config that keeps its own order keeps it.
|
|
97
|
+
*
|
|
98
|
+
* Returns the ids that were added.
|
|
99
|
+
*/
|
|
100
|
+
function addRows(file, rows) {
|
|
101
|
+
const isSorted = file.body.every((line, index) => index === 0 || idOf(file.body[index - 1]) <= idOf(line));
|
|
102
|
+
const added = [];
|
|
103
|
+
for (const row of rows) {
|
|
104
|
+
const id = idOf(row);
|
|
105
|
+
if (file.body.some((line) => idOf(line) === id)) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const insertAt = isSorted
|
|
109
|
+
? file.body.findIndex((line) => idOf(line) > id)
|
|
110
|
+
: -1;
|
|
111
|
+
if (insertAt === -1) {
|
|
112
|
+
file.body.push(row);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
file.body.splice(insertAt, 0, row);
|
|
116
|
+
}
|
|
117
|
+
added.push(id);
|
|
118
|
+
}
|
|
119
|
+
return added;
|
|
120
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PromptObject } from 'prompts';
|
|
2
|
+
import { Secret, Variable } from './github';
|
|
3
|
+
export type Question<T extends string> = PromptObject<T> & {
|
|
4
|
+
name: T;
|
|
5
|
+
valueType?: 'SECRET' | 'VARIABLE';
|
|
6
|
+
scope: 'ENVIRONMENT' | 'REPOSITORY';
|
|
7
|
+
valueLabel?: string;
|
|
8
|
+
};
|
|
9
|
+
export type QuestionDescriptor<T extends string> = Omit<Question<T>, 'type'> & {
|
|
10
|
+
type: 'disabled' | PromptObject<T>['type'];
|
|
11
|
+
};
|
|
12
|
+
export type SecretAnswer = {
|
|
13
|
+
type: 'SECRET';
|
|
14
|
+
scope: 'ENVIRONMENT' | 'REPOSITORY';
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
didExist: Secret | undefined;
|
|
18
|
+
};
|
|
19
|
+
export type VariableAnswer = {
|
|
20
|
+
type: 'VARIABLE';
|
|
21
|
+
name: string;
|
|
22
|
+
didExist: Variable | undefined;
|
|
23
|
+
value: string;
|
|
24
|
+
scope: 'ENVIRONMENT' | 'REPOSITORY';
|
|
25
|
+
};
|
|
26
|
+
export type Answer = SecretAnswer | VariableAnswer;
|
|
27
|
+
export type Answers = Answer[];
|
|
28
|
+
export type AnswerWithNullValue = (Omit<SecretAnswer, 'value'> & {
|
|
29
|
+
value: SecretAnswer['value'] | null;
|
|
30
|
+
}) | (Omit<VariableAnswer, 'value'> & {
|
|
31
|
+
value: VariableAnswer['value'] | null;
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=custom-types.d.ts.map
|
|
@@ -0,0 +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,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE3C,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS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C,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export declare const derivedVariables: readonly [{
|
|
2
|
+
readonly name: 'ACTIVATE_USERS';
|
|
3
|
+
readonly valueLabel: 'ACTIVATE_USERS';
|
|
4
|
+
readonly valueType: 'VARIABLE';
|
|
5
|
+
readonly type: 'disabled';
|
|
6
|
+
readonly scope: 'ENVIRONMENT';
|
|
7
|
+
}, {
|
|
8
|
+
readonly name: 'COUNTRY_CONFIG_HOST';
|
|
9
|
+
readonly valueLabel: 'COUNTRY_CONFIG_HOST';
|
|
10
|
+
readonly valueType: 'VARIABLE';
|
|
11
|
+
readonly type: 'disabled';
|
|
12
|
+
readonly scope: 'ENVIRONMENT';
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: 'GATEWAY_HOST';
|
|
15
|
+
readonly valueLabel: 'GATEWAY_HOST';
|
|
16
|
+
readonly valueType: 'VARIABLE';
|
|
17
|
+
readonly type: 'disabled';
|
|
18
|
+
readonly scope: 'ENVIRONMENT';
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: 'CONTENT_SECURITY_POLICY_WILDCARD';
|
|
21
|
+
readonly valueLabel: 'CONTENT_SECURITY_POLICY_WILDCARD';
|
|
22
|
+
readonly valueType: 'VARIABLE';
|
|
23
|
+
readonly type: 'disabled';
|
|
24
|
+
readonly scope: 'ENVIRONMENT';
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: 'CLIENT_APP_URL';
|
|
27
|
+
readonly valueLabel: 'CLIENT_APP_URL';
|
|
28
|
+
readonly valueType: 'VARIABLE';
|
|
29
|
+
readonly type: 'disabled';
|
|
30
|
+
readonly scope: 'ENVIRONMENT';
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: 'LOGIN_URL';
|
|
33
|
+
readonly valueLabel: 'LOGIN_URL';
|
|
34
|
+
readonly valueType: 'VARIABLE';
|
|
35
|
+
readonly type: 'disabled';
|
|
36
|
+
readonly scope: 'ENVIRONMENT';
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: 'ELASTICSEARCH_SUPERUSER_PASSWORD';
|
|
39
|
+
readonly valueLabel: 'ELASTICSEARCH_SUPERUSER_PASSWORD';
|
|
40
|
+
readonly valueType: 'SECRET';
|
|
41
|
+
readonly type: 'disabled';
|
|
42
|
+
readonly scope: 'ENVIRONMENT';
|
|
43
|
+
}, {
|
|
44
|
+
readonly name: 'KIBANA_SYSTEM_PASSWORD';
|
|
45
|
+
readonly valueLabel: 'KIBANA_SYSTEM_PASSWORD';
|
|
46
|
+
readonly valueType: 'SECRET';
|
|
47
|
+
readonly type: 'disabled';
|
|
48
|
+
readonly scope: 'ENVIRONMENT';
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: 'MINIO_ROOT_USER';
|
|
51
|
+
readonly valueLabel: 'MINIO_ROOT_USER';
|
|
52
|
+
readonly valueType: 'SECRET';
|
|
53
|
+
readonly type: 'disabled';
|
|
54
|
+
readonly scope: 'ENVIRONMENT';
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: 'MINIO_ROOT_PASSWORD';
|
|
57
|
+
readonly valueLabel: 'MINIO_ROOT_PASSWORD';
|
|
58
|
+
readonly valueType: 'SECRET';
|
|
59
|
+
readonly type: 'disabled';
|
|
60
|
+
readonly scope: 'ENVIRONMENT';
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: 'POSTGRES_USER';
|
|
63
|
+
readonly valueLabel: 'POSTGRES_USER';
|
|
64
|
+
readonly valueType: 'SECRET';
|
|
65
|
+
readonly type: 'disabled';
|
|
66
|
+
readonly scope: 'ENVIRONMENT';
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: 'POSTGRES_PASSWORD';
|
|
69
|
+
readonly valueLabel: 'POSTGRES_PASSWORD';
|
|
70
|
+
readonly valueType: 'SECRET';
|
|
71
|
+
readonly type: 'disabled';
|
|
72
|
+
readonly scope: 'ENVIRONMENT';
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: 'SUPER_USER_PASSWORD';
|
|
75
|
+
readonly valueLabel: 'SUPER_USER_PASSWORD';
|
|
76
|
+
readonly valueType: 'SECRET';
|
|
77
|
+
readonly type: 'disabled';
|
|
78
|
+
readonly scope: 'ENVIRONMENT';
|
|
79
|
+
}, {
|
|
80
|
+
readonly name: 'ENCRYPTION_KEY';
|
|
81
|
+
readonly valueLabel: 'ENCRYPTION_KEY';
|
|
82
|
+
readonly valueType: 'SECRET';
|
|
83
|
+
readonly type: 'disabled';
|
|
84
|
+
readonly scope: 'ENVIRONMENT';
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: 'GH_ENCRYPTION_PASSWORD';
|
|
87
|
+
readonly valueLabel: 'GH_ENCRYPTION_PASSWORD';
|
|
88
|
+
readonly valueType: 'SECRET';
|
|
89
|
+
readonly type: 'disabled';
|
|
90
|
+
readonly scope: 'REPOSITORY';
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: 'BACKUP_ENCRYPTION_PASSPHRASE';
|
|
93
|
+
readonly valueLabel: 'BACKUP_ENCRYPTION_PASSPHRASE';
|
|
94
|
+
readonly valueType: 'SECRET';
|
|
95
|
+
readonly type: 'disabled';
|
|
96
|
+
readonly scope: 'ENVIRONMENT';
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: 'BACKUP_HOST_PRIVATE_KEY';
|
|
99
|
+
readonly valueLabel: 'BACKUP_HOST_PRIVATE_KEY';
|
|
100
|
+
readonly valueType: 'SECRET';
|
|
101
|
+
readonly type: 'disabled';
|
|
102
|
+
readonly scope: 'ENVIRONMENT';
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: 'BACKUP_HOST_PUBLIC_KEY';
|
|
105
|
+
readonly valueLabel: 'BACKUP_HOST_PUBLIC_KEY';
|
|
106
|
+
readonly valueType: 'SECRET';
|
|
107
|
+
readonly type: 'disabled';
|
|
108
|
+
readonly scope: 'ENVIRONMENT';
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: 'RESTORE_ENVIRONMENT_NAME';
|
|
111
|
+
readonly valueLabel: 'RESTORE_ENVIRONMENT_NAME';
|
|
112
|
+
readonly valueType: 'VARIABLE';
|
|
113
|
+
readonly type: 'disabled';
|
|
114
|
+
readonly scope: 'ENVIRONMENT';
|
|
115
|
+
}, {
|
|
116
|
+
readonly name: 'NOTIFICATION_TRANSPORT';
|
|
117
|
+
readonly valueLabel: 'NOTIFICATION_TRANSPORT';
|
|
118
|
+
readonly valueType: 'VARIABLE';
|
|
119
|
+
readonly type: 'disabled';
|
|
120
|
+
readonly scope: 'ENVIRONMENT';
|
|
121
|
+
}];
|
|
122
|
+
//# sourceMappingURL=derived-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derived-variables.d.ts","sourceRoot":"","sources":["../../src/environment/derived-variables.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB;aAEzB,IAAI,EAAE,gBAAgB;aACtB,UAAU,EAAE,gBAAgB;aAC5B,SAAS,EAAE,UAAU;aACrB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,aAAa;;aAGpB,IAAI,EAAE,qBAAqB;aAC3B,UAAU,EAAE,qBAAqB;aACjC,SAAS,EAAE,UAAU;aACrB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,aAAa;;aAGpB,IAAI,EAAE,c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;aAChB,KAAK,EAAE,aAAa;;aAGpB,IAAI,EAAE,qBAAqB;aAC3B,UAAU,EAAE,qBAAqB;aACjC,SAAS,EAAE,QAAQ;aACnB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,aAAa;;aAGpB,IAAI,EAAE,gBAAgB;aACtB,UAAU,EAAE,gBAAgB;aAC5B,SAAS,EAAE,QAAQ;aACnB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,aAAa;;aAGpB,IAAI,EAAE,wBAAwB;aAC9B,UAAU,EAAE,wBAAwB;aACpC,SAAS,EAAE,QAAQ;aACnB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,YAAY;;aAGnB,IAAI,EAAE,8BAA8B;aACpC,UAAU,EAAE,8BAA8B;aAC1C,SAAS,EAAE,QAAQ;aACnB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,aAAa;;aAGpB,IAAI,EAAE,yBAAyB;aAC/B,UAAU,EAAE,yBAAyB;aACrC,SAAS,EAAE,QAAQ;aACnB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,aAAa;;aAGpB,IAAI,EAAE,wBAAwB;aAC9B,UAAU,EAAE,wBAAwB;aACpC,SAAS,EAAE,QAAQ;aACnB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,aAAa;;aAGpB,IAAI,EAAE,0BAA0B;aAChC,UAAU,EAAE,0BAA0B;aACtC,SAAS,EAAE,UAAU;aACrB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,aAAa;;aAGpB,IAAI,EAAE,wBAAwB;aAC9B,UAAU,EAAE,wBAAwB;aACpC,SAAS,EAAE,UAAU;aACrB,IAAI,EAAE,UAAU;aAChB,KAAK,EAAE,aAAa;EAEd,CAAA"}
|
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.derivedVariables = void 0;
|
|
14
|
+
exports.derivedVariables = [
|
|
15
|
+
{
|
|
16
|
+
name: 'ACTIVATE_USERS',
|
|
17
|
+
valueLabel: 'ACTIVATE_USERS',
|
|
18
|
+
valueType: 'VARIABLE',
|
|
19
|
+
type: 'disabled',
|
|
20
|
+
scope: 'ENVIRONMENT'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'COUNTRY_CONFIG_HOST',
|
|
24
|
+
valueLabel: 'COUNTRY_CONFIG_HOST',
|
|
25
|
+
valueType: 'VARIABLE',
|
|
26
|
+
type: 'disabled',
|
|
27
|
+
scope: 'ENVIRONMENT'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'GATEWAY_HOST',
|
|
31
|
+
valueLabel: 'GATEWAY_HOST',
|
|
32
|
+
valueType: 'VARIABLE',
|
|
33
|
+
type: 'disabled',
|
|
34
|
+
scope: 'ENVIRONMENT'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'CONTENT_SECURITY_POLICY_WILDCARD',
|
|
38
|
+
valueLabel: 'CONTENT_SECURITY_POLICY_WILDCARD',
|
|
39
|
+
valueType: 'VARIABLE',
|
|
40
|
+
type: 'disabled',
|
|
41
|
+
scope: 'ENVIRONMENT'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'CLIENT_APP_URL',
|
|
45
|
+
valueLabel: 'CLIENT_APP_URL',
|
|
46
|
+
valueType: 'VARIABLE',
|
|
47
|
+
type: 'disabled',
|
|
48
|
+
scope: 'ENVIRONMENT'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'LOGIN_URL',
|
|
52
|
+
valueLabel: 'LOGIN_URL',
|
|
53
|
+
valueType: 'VARIABLE',
|
|
54
|
+
type: 'disabled',
|
|
55
|
+
scope: 'ENVIRONMENT'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'ELASTICSEARCH_SUPERUSER_PASSWORD',
|
|
59
|
+
valueLabel: 'ELASTICSEARCH_SUPERUSER_PASSWORD',
|
|
60
|
+
valueType: 'SECRET',
|
|
61
|
+
type: 'disabled',
|
|
62
|
+
scope: 'ENVIRONMENT'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'KIBANA_SYSTEM_PASSWORD',
|
|
66
|
+
valueLabel: 'KIBANA_SYSTEM_PASSWORD',
|
|
67
|
+
valueType: 'SECRET',
|
|
68
|
+
type: 'disabled',
|
|
69
|
+
scope: 'ENVIRONMENT'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'MINIO_ROOT_USER',
|
|
73
|
+
valueLabel: 'MINIO_ROOT_USER',
|
|
74
|
+
valueType: 'SECRET',
|
|
75
|
+
type: 'disabled',
|
|
76
|
+
scope: 'ENVIRONMENT'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'MINIO_ROOT_PASSWORD',
|
|
80
|
+
valueLabel: 'MINIO_ROOT_PASSWORD',
|
|
81
|
+
valueType: 'SECRET',
|
|
82
|
+
type: 'disabled',
|
|
83
|
+
scope: 'ENVIRONMENT'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'POSTGRES_USER',
|
|
87
|
+
valueLabel: 'POSTGRES_USER',
|
|
88
|
+
valueType: 'SECRET',
|
|
89
|
+
type: 'disabled',
|
|
90
|
+
scope: 'ENVIRONMENT'
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'POSTGRES_PASSWORD',
|
|
94
|
+
valueLabel: 'POSTGRES_PASSWORD',
|
|
95
|
+
valueType: 'SECRET',
|
|
96
|
+
type: 'disabled',
|
|
97
|
+
scope: 'ENVIRONMENT'
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'SUPER_USER_PASSWORD',
|
|
101
|
+
valueLabel: 'SUPER_USER_PASSWORD',
|
|
102
|
+
valueType: 'SECRET',
|
|
103
|
+
type: 'disabled',
|
|
104
|
+
scope: 'ENVIRONMENT'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'ENCRYPTION_KEY',
|
|
108
|
+
valueLabel: 'ENCRYPTION_KEY',
|
|
109
|
+
valueType: 'SECRET',
|
|
110
|
+
type: 'disabled',
|
|
111
|
+
scope: 'ENVIRONMENT'
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'GH_ENCRYPTION_PASSWORD',
|
|
115
|
+
valueLabel: 'GH_ENCRYPTION_PASSWORD',
|
|
116
|
+
valueType: 'SECRET',
|
|
117
|
+
type: 'disabled',
|
|
118
|
+
scope: 'REPOSITORY'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'BACKUP_ENCRYPTION_PASSPHRASE',
|
|
122
|
+
valueLabel: 'BACKUP_ENCRYPTION_PASSPHRASE',
|
|
123
|
+
valueType: 'SECRET',
|
|
124
|
+
type: 'disabled',
|
|
125
|
+
scope: 'ENVIRONMENT'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'BACKUP_HOST_PRIVATE_KEY',
|
|
129
|
+
valueLabel: 'BACKUP_HOST_PRIVATE_KEY',
|
|
130
|
+
valueType: 'SECRET',
|
|
131
|
+
type: 'disabled',
|
|
132
|
+
scope: 'ENVIRONMENT'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'BACKUP_HOST_PUBLIC_KEY',
|
|
136
|
+
valueLabel: 'BACKUP_HOST_PUBLIC_KEY',
|
|
137
|
+
valueType: 'SECRET',
|
|
138
|
+
type: 'disabled',
|
|
139
|
+
scope: 'ENVIRONMENT'
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'RESTORE_ENVIRONMENT_NAME',
|
|
143
|
+
valueLabel: 'RESTORE_ENVIRONMENT_NAME',
|
|
144
|
+
valueType: 'VARIABLE',
|
|
145
|
+
type: 'disabled',
|
|
146
|
+
scope: 'ENVIRONMENT'
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'NOTIFICATION_TRANSPORT',
|
|
150
|
+
valueLabel: 'NOTIFICATION_TRANSPORT',
|
|
151
|
+
valueType: 'VARIABLE',
|
|
152
|
+
type: 'disabled',
|
|
153
|
+
scope: 'ENVIRONMENT'
|
|
154
|
+
}
|
|
155
|
+
];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Secret, Variable } from './github';
|
|
2
|
+
import { AnswerWithNullValue, QuestionDescriptor } from './custom-types';
|
|
3
|
+
export declare function askQuestionWithEditor(questions: Array<QuestionDescriptor<any>>, existingValues: Array<Secret | Variable>): Promise<AnswerWithNullValue[]>;
|
|
4
|
+
//# sourceMappingURL=editor-questions.d.ts.map
|
|
@@ -0,0 +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,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"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.askQuestionWithEditor = askQuestionWithEditor;
|
|
26
|
+
const utils_1 = require("./utils");
|
|
27
|
+
const kleur_1 = __importDefault(require("kleur"));
|
|
28
|
+
const prompts_1 = __importDefault(require("prompts"));
|
|
29
|
+
function editorQuestion(question) {
|
|
30
|
+
return import('@inquirer/prompts').then(({ editor }) => editor({ message: question }));
|
|
31
|
+
}
|
|
32
|
+
function askQuestionWithEditor(questions, existingValues) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const answers = [];
|
|
35
|
+
for (const question of questions) {
|
|
36
|
+
const questionWithVariableLabel = Object.assign(Object.assign({}, question), { message: `${kleur_1.default.cyan(question.valueLabel || '')}: ${question.message}` });
|
|
37
|
+
if (!questionWithVariableLabel.valueLabel) {
|
|
38
|
+
throw Error('Undefined Label');
|
|
39
|
+
}
|
|
40
|
+
const existingSecret = (0, utils_1.findExistingValue)(questionWithVariableLabel.valueLabel, 'SECRET', questionWithVariableLabel.scope, existingValues);
|
|
41
|
+
let updateSecret = true;
|
|
42
|
+
if (existingSecret) {
|
|
43
|
+
updateSecret = (yield (0, prompts_1.default)([
|
|
44
|
+
{
|
|
45
|
+
name: 'overWrite',
|
|
46
|
+
type: 'confirm',
|
|
47
|
+
message: `${kleur_1.default.yellow(`${existingSecret.scope === 'REPOSITORY'
|
|
48
|
+
? 'Repository secret'
|
|
49
|
+
: 'Secret'} ${kleur_1.default.cyan(existingSecret.name)} already exists in Github. Do you want to update it?`)}`
|
|
50
|
+
}
|
|
51
|
+
])).overWrite;
|
|
52
|
+
}
|
|
53
|
+
if (!existingSecret || updateSecret === true) {
|
|
54
|
+
const question_answer = yield editorQuestion(questionWithVariableLabel.message);
|
|
55
|
+
const answer = {
|
|
56
|
+
type: 'SECRET',
|
|
57
|
+
scope: 'ENVIRONMENT',
|
|
58
|
+
name: questionWithVariableLabel.valueLabel,
|
|
59
|
+
value: question_answer,
|
|
60
|
+
didExist: existingSecret
|
|
61
|
+
};
|
|
62
|
+
answers.push(answer);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return answers;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/environment/git.ts"],"names":[],"mappings":"AAaA,wBAAgB,WAAW;;;EAyB1B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.getRepoInfo = getRepoInfo;
|
|
14
|
+
const child_process_1 = require("child_process");
|
|
15
|
+
function getRepoInfo() {
|
|
16
|
+
try {
|
|
17
|
+
const remoteUrl = (0, child_process_1.execSync)('git config --get remote.origin.url', {
|
|
18
|
+
stdio: ['ignore', 'pipe', 'ignore']
|
|
19
|
+
})
|
|
20
|
+
.toString()
|
|
21
|
+
.trim();
|
|
22
|
+
// Handle both SSH and HTTPS formats
|
|
23
|
+
const match = remoteUrl.match(/github\.com[:/](.+?)\/(.+?)(\.git)?$/);
|
|
24
|
+
if (!match) {
|
|
25
|
+
return { organization: '', repository: '' };
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
organization: match[1],
|
|
29
|
+
repository: match[2]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (_a) {
|
|
33
|
+
return {
|
|
34
|
+
organization: '',
|
|
35
|
+
repository: ''
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Octokit } from '@octokit/core';
|
|
2
|
+
export declare function createEnvironmentVariable(octokit: Octokit, repositoryId: number, environment: string, name: string, value: string): Promise<void>;
|
|
3
|
+
export declare function updateEnvironmentVariable(octokit: Octokit, repositoryId: number, environment: string, name: string, value: string): Promise<void>;
|
|
4
|
+
export declare function createRepositoryVariable(octokit: Octokit, repositoryId: number, name: string, value: string): Promise<void>;
|
|
5
|
+
export declare function updateRepositoryVariable(octokit: Octokit, repositoryId: number, name: string, value: string): Promise<void>;
|
|
6
|
+
export declare function getRepositoryId(octokit: Octokit, owner: string, repo: string): Promise<number>;
|
|
7
|
+
export declare function createEnvironmentSecret(octokit: Octokit, repositoryId: number, environment: string, name: string, secret: string, organisationName: string, repositoryName: string): Promise<void>;
|
|
8
|
+
export declare function createRepositorySecret(octokit: Octokit, repositoryId: number, name: string, secret: string, organisationName: string, repositoryName: string): Promise<void>;
|
|
9
|
+
export declare function getRepositoryEnvironments(octokit: Octokit, githubOrganisation: string, repository: string): Promise<string[]>;
|
|
10
|
+
export declare function createEnvironment(octokit: Octokit, environment: string, ORGANISATION: string, REPOSITORY_NAME: string): Promise<boolean>;
|
|
11
|
+
export type Secret = {
|
|
12
|
+
type: 'SECRET';
|
|
13
|
+
name: string;
|
|
14
|
+
scope: 'ENVIRONMENT' | 'REPOSITORY';
|
|
15
|
+
};
|
|
16
|
+
export type Variable = {
|
|
17
|
+
type: 'VARIABLE';
|
|
18
|
+
name: string;
|
|
19
|
+
value: string;
|
|
20
|
+
scope: 'ENVIRONMENT' | 'REPOSITORY';
|
|
21
|
+
};
|
|
22
|
+
export declare function listEnvironmentSecrets(octokit: Octokit, owner: string, repositoryId: number, environmentName: string): Promise<Secret[]>;
|
|
23
|
+
export declare function listRepositorySecrets(octokit: Octokit, owner: string, repositoryName: string): Promise<Secret[]>;
|
|
24
|
+
export declare function listEnvironmentVariables(octokit: Octokit, repositoryId: number, environmentName: string): Promise<Variable[]>;
|
|
25
|
+
export declare function listRepositoryVariables(octokit: Octokit, owner: string, repositoryName: string): Promise<Variable[]>;
|
|
26
|
+
//# sourceMappingURL=github.d.ts.map
|
|
@@ -0,0 +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,wBAA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