@openstax/ts-utils 1.21.12 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/errors/index.d.ts +11 -0
- package/dist/cjs/errors/index.js +15 -1
- package/dist/cjs/middleware/apiErrorHandler.d.ts +4 -3
- package/dist/cjs/middleware/apiErrorHandler.js +4 -3
- package/dist/cjs/misc/helpers.js +1 -1
- package/dist/cjs/services/accountsGateway/index.js +3 -4
- package/dist/cjs/services/apiGateway/index.d.ts +6 -2
- package/dist/cjs/services/apiGateway/index.js +17 -5
- package/dist/cjs/services/fileServer/localFileServer.js +5 -4
- package/dist/cjs/services/fileServer/s3FileServer.js +1 -0
- package/dist/cjs/services/lrsGateway/index.js +1 -1
- package/dist/cjs/services/openSearch.d.ts +29 -0
- package/dist/cjs/services/openSearch.js +107 -0
- package/dist/cjs/services/searchProvider/index.d.ts +1 -0
- package/dist/cjs/services/searchProvider/memorySearchTheBadWay.js +11 -4
- package/dist/cjs/tsconfig.without-specs.cjs.tsbuildinfo +1 -1
- package/dist/esm/errors/index.d.ts +11 -0
- package/dist/esm/errors/index.js +13 -0
- package/dist/esm/middleware/apiErrorHandler.d.ts +4 -3
- package/dist/esm/middleware/apiErrorHandler.js +5 -4
- package/dist/esm/misc/helpers.js +1 -1
- package/dist/esm/services/accountsGateway/index.js +3 -4
- package/dist/esm/services/apiGateway/index.d.ts +6 -2
- package/dist/esm/services/apiGateway/index.js +18 -6
- package/dist/esm/services/fileServer/localFileServer.js +6 -5
- package/dist/esm/services/fileServer/s3FileServer.js +1 -0
- package/dist/esm/services/lrsGateway/index.js +1 -1
- package/dist/esm/services/openSearch.d.ts +29 -0
- package/dist/esm/services/openSearch.js +103 -0
- package/dist/esm/services/searchProvider/index.d.ts +1 -0
- package/dist/esm/services/searchProvider/memorySearchTheBadWay.js +11 -4
- package/dist/esm/tsconfig.without-specs.esm.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/script/bin/deploy.bash +8 -0
- package/script/bin/get-env-param.bash +3 -3
- package/script/bin/init-params-script.bash +10 -1
- package/script/bin/upload-params.bash +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openstax/ts-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.1",
|
|
4
4
|
"bin": {
|
|
5
5
|
"ts-utils": "./script/bin-entry.bash"
|
|
6
6
|
},
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"uuid": "^9.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
+
"@opensearch-project/opensearch": "^1.2.0",
|
|
26
27
|
"@types/cookie": "^0.5.0",
|
|
27
28
|
"@types/cors": "^2.8.13",
|
|
28
29
|
"@types/deep-equal": "^1.0.1",
|
|
@@ -200,6 +201,7 @@
|
|
|
200
201
|
"license": "MIT",
|
|
201
202
|
"main": "index.js",
|
|
202
203
|
"peerDependencies": {
|
|
204
|
+
"@opensearch-project/opensearch": "^1.2.0",
|
|
203
205
|
"cors": "^2.8.5",
|
|
204
206
|
"express": "^4.17.3",
|
|
205
207
|
"multer": "^1.4.5-lts.1",
|
package/script/bin/deploy.bash
CHANGED
|
@@ -38,4 +38,12 @@ if [ ! -f "./deploy/deploy.bash" ]; then
|
|
|
38
38
|
exit 1
|
|
39
39
|
fi;
|
|
40
40
|
|
|
41
|
+
source $(yarn -s ts-utils which init-params-script)
|
|
42
|
+
|
|
43
|
+
missing_params=$(get_missing_param_names)
|
|
44
|
+
if [ -n "$missing_params" ]; then
|
|
45
|
+
echo "please upload the following params before deploying: $missing_params"
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
|
|
41
49
|
./deploy/deploy.bash
|
|
@@ -5,12 +5,12 @@ set -euo pipefail; if [ -n "${DEBUG-}" ]; then set -x; fi
|
|
|
5
5
|
source $(yarn -s ts-utils which init-constants-script)
|
|
6
6
|
source $(yarn -s ts-utils which init-params-script)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
ENVIRONMENT=$(yarn -s ts-utils get-arg 0 "$@")
|
|
9
9
|
param=$(yarn -s ts-utils get-arg 1 "$@")
|
|
10
10
|
|
|
11
|
-
if [ -z "$
|
|
11
|
+
if [ -z "$ENVIRONMENT" ] || [ -z "$param" ]; then
|
|
12
12
|
cat <<HEREDOC
|
|
13
|
-
Usage: $(basename ${BASH_SOURCE[0]}) <environment> <parameter name>
|
|
13
|
+
Usage: $(basename ${BASH_SOURCE[0]}) <environment> <parameter name>
|
|
14
14
|
|
|
15
15
|
Shows secret value from AWS parameter store
|
|
16
16
|
HEREDOC
|
|
@@ -37,7 +37,7 @@ if [ -z "${aws_version##aws-cli/1.*}" ]; then
|
|
|
37
37
|
fi
|
|
38
38
|
|
|
39
39
|
function get_param_name() {
|
|
40
|
-
echo "/$APPLICATION/$
|
|
40
|
+
echo "/$APPLICATION/$ENVIRONMENT/api/$param"
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
function get_value() {
|
|
@@ -50,6 +50,15 @@ function get_parameter() {
|
|
|
50
50
|
--query Parameter.Value --output text 2>&1
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
function get_missing_param_names() {
|
|
54
|
+
names=()
|
|
55
|
+
for param in "${PARAMS[@]}"; do
|
|
56
|
+
name=$param
|
|
57
|
+
names+=($(get_param_name))
|
|
58
|
+
done
|
|
59
|
+
aws ssm get-parameters --region "$region" --names "${names[@]}" --query InvalidParameters --output text 2>&1
|
|
60
|
+
}
|
|
61
|
+
|
|
53
62
|
function upload_parameter() {
|
|
54
63
|
set +e
|
|
55
64
|
previous_value=$(get_parameter)
|
|
@@ -7,9 +7,9 @@ source $(yarn -s ts-utils which init-params-script)
|
|
|
7
7
|
|
|
8
8
|
if [ -z "${PARAMS:-}" ]; then echo "PARAMS must be set" > /dev/stderr; exit 1; fi
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
ENVIRONMENT=$(yarn -s ts-utils get-arg 0 "$@")
|
|
11
11
|
|
|
12
|
-
if [ -z "$
|
|
12
|
+
if [ -z "$ENVIRONMENT" ]; then
|
|
13
13
|
cat <<HEREDOC
|
|
14
14
|
Usage: $(basename "${BASH_SOURCE[0]}") <environment> [options]
|
|
15
15
|
|
|
@@ -56,4 +56,4 @@ for param in $params_with_value; do
|
|
|
56
56
|
upload_parameter
|
|
57
57
|
done
|
|
58
58
|
|
|
59
|
-
printf "\nSuccessfully uploaded %sparameters for %s-%s\n\n" "${partial:+partial }" "$
|
|
59
|
+
printf "\nSuccessfully uploaded %sparameters for %s-%s\n\n" "${partial:+partial }" "$ENVIRONMENT" "$APPLICATION"
|