@sudoplatform/sudo-common 12.2.2 → 12.2.4

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.
@@ -1,4 +1,4 @@
1
- #!/bin/sh
1
+ #!/usr/bin/env bash
2
2
  #
3
3
  # Insert a audit identifier to suppress in verification proccess.
4
4
  #
@@ -19,39 +19,14 @@
19
19
 
20
20
  YARNVER=$(yarn -v)
21
21
  if [[ "${YARNVER}" == 1* ]]; then
22
- yarn npm audit --json --groups "dependencies devDependencies" | \
23
- jq -M -s -c 'map(select(.type == "auditAdvisory").data.advisory) | unique_by(.id) | .[] | {id, title, module_name, vulnerable_versions, patched_versions, severity, findings}' | \
24
- (new=""; while read -r advisory ; do
25
- id=$(echo "${advisory}" | jq '.id')
26
- suppression=$(jq ".auditSuppressions[\"$id\"] | select (. != null)" package.json)
27
- if [ -z "$suppression" ]; then
28
- echo "New advisory ${id}:"
29
- echo "${advisory}" | jq .
30
- new=1
31
- else
32
- if expr "$suppression" : '[0-9][0-9]*$' >/dev/null ; then
33
- # Old style suppression that was just the expiry timestamp
34
- expiry="$suppression"
35
- else
36
- # New style suppression is a JSON object
37
- expiry=$(echo "$suppression" | jq -M -c ".until // 0")
38
- fi
39
- if [ "$(date '+%s')" -gt "$expiry" ]; then
40
- echo "Suppression for advisory ${id} has expired. Please revisit:"
41
- echo "${advisory}" | jq .
42
- new=1
43
- fi
44
- fi
45
- done
46
- if [ -n "${new}" ]; then
47
- exit 1
48
- fi
49
- )
22
+ echo "Yarn v1 no longer supported"
23
+ exit 1
50
24
  else
51
25
  now=$(date '+%s')
52
26
 
53
27
  echo "Checking for npm audit advisories"
54
28
  echo
29
+ # Read auditSuppressions from project package.json
55
30
  ignores=$(
56
31
  # shellcheck disable=SC2002
57
32
  cat package.json | \
@@ -19,7 +19,6 @@ const KeyArchiveKeyInfoRequiredProps = {
19
19
  const KeyArchiveKeyInfoOptionalProps = {
20
20
  Exportable: t.boolean,
21
21
  };
22
- // eslint-disable-next-line tree-shaking/no-side-effects-in-initialization
23
22
  exports.KeyArchiveKeyInfoCodec = t.intersection([
24
23
  t.type(KeyArchiveKeyInfoRequiredProps),
25
24
  t.partial(KeyArchiveKeyInfoOptionalProps),
@@ -1 +1 @@
1
- {"version":3,"file":"keyInfo.js","sourceRoot":"","sources":["../../src/sudoKeyArchive/keyInfo.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAEH,iDAA0B;AAE1B,uCAAkD;AAElD,MAAM,8BAA8B,GAAG;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,IAAI,EAAE,gCAAsB;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,cAAc,EAAE,CAAC,CAAC,OAAO;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM;CACpB,CAAA;AAED,MAAM,8BAA8B,GAAG;IACrC,UAAU,EAAE,CAAC,CAAC,OAAO;CACtB,CAAA;AAED,0EAA0E;AAC7D,QAAA,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAClD;IACE,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC;IACtC,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC;CAC1C,EACD,mBAAmB,CACpB,CAAA;AAEY,QAAA,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAChD,8BAAsB,EACtB,wBAAwB,CACzB,CAAA"}
1
+ {"version":3,"file":"keyInfo.js","sourceRoot":"","sources":["../../src/sudoKeyArchive/keyInfo.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAEH,iDAA0B;AAE1B,uCAAkD;AAElD,MAAM,8BAA8B,GAAG;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,IAAI,EAAE,gCAAsB;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,cAAc,EAAE,CAAC,CAAC,OAAO;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM;CACpB,CAAA;AAED,MAAM,8BAA8B,GAAG;IACrC,UAAU,EAAE,CAAC,CAAC,OAAO;CACtB,CAAA;AAEY,QAAA,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAClD;IACE,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC;IACtC,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC;CAC1C,EACD,mBAAmB,CACpB,CAAA;AAEY,QAAA,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAChD,8BAAsB,EACtB,wBAAwB,CACzB,CAAA"}
@@ -36,7 +36,7 @@ const keyArchiveKeyTypeAlternatives = {
36
36
  symmetrickey: KeyArchiveKeyType.SymmetricKey,
37
37
  symmetric_key: KeyArchiveKeyType.SymmetricKey,
38
38
  };
39
- const failureMessage = `Key type is not one of: ${Object.keys(keyArchiveKeyTypeAlternatives).join(',')}`; // eslint-disable-line tree-shaking/no-side-effects-in-initialization
39
+ const failureMessage = `Key type is not one of: ${Object.keys(keyArchiveKeyTypeAlternatives).join(',')}`;
40
40
  const isKeyArchiveKeyType = (u) => t.string.is(u) && keyArchiveKeyTypeAlternatives[u.toLowerCase()] !== undefined;
41
41
  exports.KeyArchiveKeyTypeCodec = new t.Type('KeyArchiveKeyType', isKeyArchiveKeyType, (u, c) => isKeyArchiveKeyType(u)
42
42
  ? t.success(keyArchiveKeyTypeAlternatives[u.toLowerCase()])
@@ -1 +1 @@
1
- {"version":3,"file":"keyType.js","sourceRoot":"","sources":["../../src/sudoKeyArchive/keyType.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAEH,iDAA0B;AAE1B;;;;GAIG;AACH,IAAY,iBAaX;AAbD,WAAY,iBAAiB;IAC3B,2EAA2E;IAC3E,0BAA0B;IAC1B,0CAAqB,CAAA;IAErB,2CAA2C;IAC3C,8CAAyB,CAAA;IAEzB,8BAA8B;IAC9B,4CAAuB,CAAA;IAEvB,kCAAkC;IAClC,kDAA6B,CAAA;AAC/B,CAAC,EAbW,iBAAiB,iCAAjB,iBAAiB,QAa5B;AAED,sEAAsE;AACtE,+B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t.boolean,
17
17
  };
18
- // eslint-disable-next-line tree-shaking/no-side-effects-in-initialization
19
18
  export const KeyArchiveKeyInfoCodec = t.intersection([
20
19
  t.type(KeyArchiveKeyInfoRequiredProps),
21
20
  t.partial(KeyArchiveKeyInfoOptionalProps),
@@ -1 +1 @@
1
- {"version":3,"file":"keyInfo.js","sourceRoot":"","sources":["../../src/sudoKeyArchive/keyInfo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,CAAC,MAAM,OAAO,CAAA;AAE1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAElD,MAAM,8BAA8B,GAAG;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,cAAc,EAAE,CAAC,CAAC,OAAO;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM;CACpB,CAAA;AAED,MAAM,8BAA8B,GAAG;IACrC,UAAU,EAAE,CAAC,CAAC,OAAO;CACtB,CAAA;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAClD;IACE,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC;IACtC,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC;CAC1C,EACD,mBAAmB,CACpB,CAAA;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAChD,sBAAsB,EACtB,wBAAwB,CACzB,CAAA"}
1
+ {"version":3,"file":"keyInfo.js","sourceRoot":"","sources":["../../src/sudoKeyArchive/keyInfo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,CAAC,MAAM,OAAO,CAAA;AAE1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAElD,MAAM,8BAA8B,GAAG;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,cAAc,EAAE,CAAC,CAAC,OAAO;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM;CACpB,CAAA;AAED,MAAM,8BAA8B,GAAG;IACrC,UAAU,EAAE,CAAC,CAAC,OAAO;CACtB,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAClD;IACE,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC;IACtC,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC;CAC1C,EACD,mBAAmB,CACpB,CAAA;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAChD,sBAAsB,EACtB,wBAAwB,CACzB,CAAA"}
@@ -32,7 +32,7 @@ const keyArchiveKeyTypeAlternatives = {
32
32
  symmetrickey: KeyArchiveKeyType.SymmetricKey,
33
33
  symmetric_key: KeyArchiveKeyType.SymmetricKey,
34
34
  };
35
- const failureMessage = `Key type is not one of: ${Object.keys(keyArchiveKeyTypeAlternatives).join(',')}`; // eslint-disable-line tree-shaking/no-side-effects-in-initialization
35
+ const failureMessage = `Key type is not one of: ${Object.keys(keyArchiveKeyTypeAlternatives).join(',')}`;
36
36
  const isKeyArchiveKeyType = (u) => t.string.is(u) && keyArchiveKeyTypeAlternatives[u.toLowerCase()] !== undefined;
37
37
  export const KeyArchiveKeyTypeCodec = new t.Type('KeyArchiveKeyType', isKeyArchiveKeyType, (u, c) => isKeyArchiveKeyType(u)
38
38
  ? t.success(keyArchiveKeyTypeAlternatives[u.toLowerCase()])
@@ -1 +1 @@
1
- {"version":3,"file":"keyType.js","sourceRoot":"","sources":["../../src/sudoKeyArchive/keyType.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,CAAC,MAAM,OAAO,CAAA;AAE1B;;;;GAIG;AACH,MAAM,CAAN,IAAY,iBAaX;AAbD,WAAY,iBAAiB;IAC3B,2EAA2E;IAC3E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AAO,CAAC,6BAA6B,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,EACrC,CAAC,CAAC,QAAQ,CACX,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudoplatform/sudo-common",
3
- "version": "12.2.2",
3
+ "version": "12.2.4",
4
4
  "author": "Anonyome Labs, Inc.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,9 +36,7 @@
36
36
  "sideEffects": false,
37
37
  "bin": {
38
38
  "audit-with-suppressions": "bin/yarn-audit-with-suppression.sh",
39
- "outdated-with-suppressions": "bin/outdated-with-suppression.sh",
40
- "suppress-audit": "bin/suppress-audit.sh",
41
- "suppress-outdated": "bin/suppress-outdated.sh"
39
+ "suppress-audit": "bin/suppress-audit.sh"
42
40
  },
43
41
  "files": [
44
42
  "bin",
@@ -59,16 +57,18 @@
59
57
  "io-ts": "^2.2.22"
60
58
  },
61
59
  "devDependencies": {
60
+ "@eslint/compat": "^2.0.2",
61
+ "@eslint/eslintrc": "^3.3.3",
62
+ "@eslint/js": "^10.0.1",
62
63
  "@types/jest": "^30.0.0",
63
- "@types/node": "^22.19.3",
64
- "@typescript-eslint/eslint-plugin": "^8.50.1",
65
- "@typescript-eslint/parser": "^8.50.1",
64
+ "@types/node": "^22.19.11",
65
+ "@typescript-eslint/eslint-plugin": "^8.56.0",
66
+ "@typescript-eslint/parser": "^8.56.0",
66
67
  "concurrently": "^9.2.1",
67
- "eslint": "8.57.1",
68
+ "eslint": "^9.39.2",
68
69
  "eslint-config-prettier": "^10.1.8",
69
70
  "eslint-plugin-import": "^2.32.0",
70
- "eslint-plugin-prettier": "^5.5.4",
71
- "eslint-plugin-tree-shaking": "^1.12.2",
71
+ "eslint-plugin-prettier": "^5.5.5",
72
72
  "expect-type": "^1.3.0",
73
73
  "fp-ts": "^2.16.11",
74
74
  "io-ts": "^2.2.22",
@@ -79,16 +79,20 @@
79
79
  "jest-environment-jsdom": "^30.2.0",
80
80
  "monocle-ts": "^2.3.13",
81
81
  "newtype-ts": "^0.3.5",
82
- "prettier": "^3.7.4",
83
- "rimraf": "^6.1.2",
82
+ "prettier": "^3.8.1",
83
+ "rimraf": "^6.1.3",
84
84
  "ts-jest": "^29.4.6",
85
85
  "ts-mockito": "^2.6.1",
86
86
  "ts-node": "^10.9.2",
87
- "typedoc": "^0.28.15",
87
+ "typedoc": "^0.28.17",
88
88
  "typescript": "~5.9.3"
89
89
  },
90
+ "resolutions": {
91
+ "fast-xml-parser": "^5.4.1"
92
+ },
90
93
  "engines": {
91
94
  "node": ">=22"
92
95
  },
93
- "packageManager": "yarn@4.12.0+sha512.f45ab632439a67f8bc759bf32ead036a1f413287b9042726b7cc4818b7b49e14e9423ba49b18f9e06ea4941c1ad062385b1d8760a8d5091a1a31e5f6219afca8"
96
+ "packageManager": "yarn@4.12.0+sha512.f45ab632439a67f8bc759bf32ead036a1f413287b9042726b7cc4818b7b49e14e9423ba49b18f9e06ea4941c1ad062385b1d8760a8d5091a1a31e5f6219afca8",
97
+ "auditSuppressions": {}
94
98
  }
@@ -1,243 +0,0 @@
1
- #!/bin/sh
2
-
3
- ###
4
- # This script is duplicated in platform-common. Any updates to this script here should also be adjusted in the platform-common repository.
5
- ###
6
-
7
- set -e
8
- d="$(dirname "$0")"
9
-
10
- version_diff_type() {
11
- v1="$1"
12
- v2="$2"
13
- v1_major=$(echo "$v1" | sed -E -e 's/^([^.]+)\..*/\1/')
14
- v2_major=$(echo "$v2" | sed -E -e 's/^([^.]+)\..*/\1/')
15
- v1_minor=$(echo "$v1" | sed -E -e 's/^([^.]+)\.([^.]+)\..*/\2/')
16
- v2_minor=$(echo "$v2" | sed -E -e 's/^([^.]+)\.([^.]+)\..*/\2/')
17
- if [ "${v1_major}" != "${v2_major}" ]; then echo 'major'; return 0; fi
18
- if [ "${v1_minor}" != "${v2_minor}" ]; then echo 'minor'; return 0; fi
19
- if [ "${v1}" != "${v2}" ]; then echo 'patch'; return 0; fi
20
- echo 'equal'
21
- return 0
22
- }
23
-
24
- suppression_from_diff_type() {
25
- diff_type="$1"
26
- majorSuppression="$2"
27
- minorSuppression="$3"
28
- patchSuppression="$4"
29
-
30
- case "${diff_type}" in
31
- major)
32
- if [ -n "${majorSuppression}" ]; then
33
- echo "major ${majorSuppression}"
34
- elif [ -n "${minorSuppression}" ]; then
35
- echo "minor ${minorSuppression}"
36
- elif [ -n "${patchSuppression}" ]; then
37
- echo "patch ${patchSuppression}"
38
- fi
39
- ;;
40
- minor)
41
- if [ -n "${minorSuppression}" ]; then
42
- echo "minor ${minorSuppression}"
43
- elif [ -n "${patchSuppression}" ]; then
44
- echo "patch ${patchSuppression}"
45
- fi
46
- ;;
47
- patch)
48
- if [ -n "${patchSuppression}" ]; then
49
- echo "patch ${patchSuppression}"
50
- fi
51
- ;;
52
- esac
53
- }
54
-
55
- #
56
- # This function will determine whether a new outdated dependency will cause the script to fail.
57
- # It compares the publish date of the wanted version and only populates 'new' when the publish date is outside 'stability_days'.
58
- #
59
- classify_outdated_dependency() {
60
- dependency_name=$1
61
- wanted_version=$2
62
- # Get the publish date of the version that matches 'wanted', returning YYYY-MM-DD
63
- publish_date=$(yarn info "$dependency_name" time --json | jq -r '.data | to_entries[] | select(.key == "'"$wanted_version"'") | .value | split("T") | .[0]')
64
-
65
- # Convert the 'publish_date' variable to epoch
66
- if [ -z "$CI" ]; then
67
- # CI_COMMIT_BRANCH is undefined, running locally, use mac environment
68
- publish_date_epoch=$(date -j -f '%Y-%m-%d' "$publish_date" '+%s')
69
- else
70
- # CI_COMMIT_BRANCH is defined, running in CI context, use busybox environment
71
- publish_date_epoch=$(date -d "$publish_date" +%s)
72
- fi
73
-
74
- # Calculate the difference in days
75
- diff_days=$(((current_epoch - publish_date_epoch) / 86400))
76
-
77
- # Check if the difference in days is greater than or equal to 3, and set a new outdated dependency if it was not published in the last 3 days
78
- if [ $diff_days -ge $stability_days ]; then
79
- # The date is more than 3 days away from the current date, populate 'new' to return fail later
80
- new=1
81
- fi
82
- }
83
-
84
- # Number of days to suppress if accepting or refreshing and cadence to run if --last specified
85
- cadence=30
86
-
87
- # If set, accept any outdated packages. Has the effect of refreshing existing suppressions
88
- # as well.
89
- accept=""
90
-
91
- # If set, refresh any existing suppressions
92
- refresh=""
93
-
94
- # If set, records/references last success in the specified directory.
95
- # Only run the dependency check every cadence days if a last success
96
- # timestamp is found
97
- last=""
98
-
99
- # Define the number of days an outdated dependency exists for before it returns a fail. For example, if this is set to 3, it includes today, yesterday, and the day before.
100
- stability_days=3
101
-
102
- # Get the current date in epoch, this is used with stability_days and each outdated dependency's publish date to determine when the script should fail.
103
- current_epoch=$(date +%s)
104
-
105
- while [ -n "${1}" ]; do
106
- case "${1}" in
107
- --cadence)
108
- if [ -z "$2" ]; then
109
- echo "ERROR: --cadence requires number of days argument" 1>&2
110
- exit 1
111
- fi
112
- shift
113
- cadence="$1"
114
- ;;
115
- --accept) accept="1" ;;
116
- --refresh) refresh="1" ;;
117
- --last)
118
- if [ -z "$2" ]; then
119
- echo "ERROR: --last requires directory argument in which last successful run timestamp is to be store" 1>&2
120
- exit 1
121
- fi
122
- shift
123
- last="$1"
124
- ;;
125
- *)
126
- echo "ERROR: Unrecognized argument '${1}'" 1>&2
127
- exit 1
128
- esac
129
- shift
130
- done
131
-
132
- dateFromSeconds() {
133
- s="$1"
134
- case $(uname) in
135
- Darwin)
136
- date -Iseconds -r"${s}"
137
- ;;
138
- *)
139
- date -Iseconds "-d@${s}"
140
- ;;
141
- esac
142
- }
143
-
144
- within_cadence=""
145
- if [ -r "${last}/last_success" ]; then
146
- cadence_seconds=$((cadence * 24 * 3600))
147
- now="$(date +%s)"
148
- last_run="$(cat "${last}/last_success")"
149
- due="$((last_run + cadence_seconds))"
150
- if [ "$((due > now))" = "1" ]; then
151
- echo "Last success: $(dateFromSeconds "${last_run}")"
152
- echo "Now: $(date -Iseconds)"
153
- echo "Due from: $(dateFromSeconds "${due}")"
154
- within_cadence="1"
155
- else
156
- echo "Last success: $(dateFromSeconds "${last_run}")"
157
- echo "Now: $(date -Iseconds)"
158
- echo "Due since: $(dateFromSeconds "${due}")"
159
- fi
160
- fi
161
-
162
-
163
- yarn outdated --json | jq -r -s -c 'map(select(.type == "table").data.body) | .[] | unique_by(.[0]) | .[] | .[0] + " " + .[1] + " " + .[2] + " " + .[3]' | (new=""; while read -r package_name current wanted latest; do
164
- majorSuppression=$(jq ".outdatedSuppressions.major[\"${package_name}\"] | select (. != null)" package.json)
165
- minorSuppression=$(jq ".outdatedSuppressions.minor[\"${package_name}\"] | select (. != null)" package.json)
166
- patchSuppression=$(jq ".outdatedSuppressions[\"${package_name}\"] | select (. != null)" package.json)
167
- latest_diff_type=$(version_diff_type "${current}" "${latest}")
168
- wanted_diff_type=$(version_diff_type "${current}" "${wanted}")
169
-
170
- # shellcheck disable=SC2046
171
- set -- $(suppression_from_diff_type "${latest_diff_type}" "${majorSuppression}" "${minorSuppression}" "${patchSuppression}")
172
- latest_suppression_type="$1"
173
- latest_suppression="$2"
174
-
175
- # shellcheck disable=SC2046
176
- set -- $(suppression_from_diff_type "${wanted_diff_type}" "${majorSuppression}" "${minorSuppression}" "${patchSuppression}")
177
- wanted_suppression_type="$1"
178
- wanted_suppression="$2"
179
-
180
- # If package has major update but isn't suppre
181
- suppression=""
182
- suppression_type=""
183
- outdated_diff_type="${latest_diff_type}"
184
- if [ -n "${latest_suppression_type}" ]; then
185
- if [ "${wanted_diff_type}" != "equal" ]; then
186
- outdated_diff_type="${wanted_diff_type}"
187
- if [ -n "${wanted_suppression_type}" ]; then
188
- suppression_type="${wanted_suppression_type}"
189
- suppression="${wanted_suppression}"
190
- else
191
- # Only suppressed at major level and we have minor or patch
192
- # updates available - do not suppress
193
- :
194
- fi
195
- else
196
- suppression_type="${latest_suppression_type}"
197
- suppression="${latest_suppression}"
198
- fi
199
- fi
200
-
201
- suppress_outdated=""
202
- if [ -e "${d}/suppress-outdated" ]; then
203
- suppress_outdated="${d}/suppress-outdated"
204
- elif [ -e "${d}/suppress-outdated.sh" ]; then
205
- suppress_outdated="${d}/suppress-outdated.sh"
206
- fi
207
- if [ -z "${suppress_outdated}" ]; then
208
- echo "ERROR: Unable to find suppress-outdated" 1>&2
209
- exit 1
210
- fi
211
- if [ -z "${suppression}" ]; then
212
- if [ -n "${accept}" ]; then
213
- echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${latest_diff_type} accepted]"
214
- "${suppress_outdated}" --suppression "${cadence}" --"${latest_diff_type}" "${package_name}"
215
- else
216
- echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} outdated]"
217
- classify_outdated_dependency "$package_name" "$wanted"
218
-
219
- fi
220
- elif [ -n "${accept}${refresh}" ]; then
221
- echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${suppression_type} suppression refreshed]"
222
- "${suppress_outdated}" --suppression "${cadence}" --"${suppression_type}" "${package_name}"
223
- elif [ "$(date '+%s')" -gt "${suppression}" ]; then
224
- echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} suppression expired]"
225
- new=1
226
- else
227
- echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} suppressed until $(dateFromSeconds "${suppression}")]"
228
- fi
229
- done
230
-
231
- # If we're not within cadence and there are new outdated dependencies
232
- # then fail
233
- if [ -z "${within_cadence}" ] && [ -n "${new}" ]; then
234
- exit 1
235
- fi
236
-
237
- # If there a no outdated dependencies and we're tracking last success then
238
- # refresh the last success timestamp.
239
- if [ -z "${new}" ] && [ -n "${last}" ]; then
240
- mkdir -p "${last}"
241
- date +%s > "${last}/last_success"
242
- fi
243
- )
@@ -1,60 +0,0 @@
1
- #!/bin/sh
2
- #
3
- # Insert a package name to suppress in outdated checks.
4
- #
5
-
6
- set -e
7
-
8
- usage() {
9
- echo "Usage: suppress-outdated.sh [--suppression <number-of-days>] {--major|--minor|--patch} <package name> ..."
10
- }
11
-
12
- suppression=30
13
- if [ "$1" = "--suppression" ]; then
14
- if [ -z "$2" ]; then
15
- echo "ERROR: --suppression argument must specify a number of days argument" 1>&2
16
- usage 1>&2
17
- exit 1
18
- fi
19
- shift
20
- suppression="$1"
21
- shift
22
- fi
23
-
24
- case "$1" in
25
- --major)
26
- root=".outdatedSuppressions.major"
27
- ;;
28
- --minor)
29
- root=".outdatedSuppressions.minor"
30
- ;;
31
- --patch)
32
- root=".outdatedSuppressions"
33
- ;;
34
- *)
35
- echo "suppress-outdated.sh: Unrecognized option: '$1'" 1>&2
36
- usage 1>&2
37
- exit 1
38
- ;;
39
- esac
40
- shift
41
-
42
- if [ -z "$1" ]; then
43
- echo "suppress-outdated.sh: No package names specified" 1>&2
44
- usage 1>&2
45
- exit 1
46
- fi
47
-
48
- suppression_seconds=$((suppression * 24 * 3600))
49
-
50
- PACKAGE_JSON="package.json"
51
- cp "$PACKAGE_JSON" "$PACKAGE_JSON.old"
52
-
53
- while [ -n "$1" ]; do
54
- package_name="$1"
55
-
56
- jq < "$PACKAGE_JSON" "${root}.\"${package_name}\" = (now | floor | . + ${suppression_seconds})" > "$PACKAGE_JSON.staging"
57
- mv "$PACKAGE_JSON.staging" "$PACKAGE_JSON"
58
-
59
- shift
60
- done