@sudoplatform/sudo-common 6.4.0 → 7.0.2

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.
Files changed (236) hide show
  1. package/.gitignore +2 -1
  2. package/.yarn/releases/{yarn-1.22.18.cjs → yarn-1.22.19.cjs} +13 -4
  3. package/.yarnrc +1 -1
  4. package/bin/outdated-with-suppression.sh +117 -11
  5. package/bin/suppress-outdated.sh +36 -9
  6. package/dependencies-report.json +388 -4
  7. package/docs/assets/highlight.css +11 -11
  8. package/docs/assets/main.js +4 -2
  9. package/docs/assets/search.js +1 -1
  10. package/docs/assets/style.css +427 -617
  11. package/docs/classes/AccountLockedError.html +163 -8
  12. package/docs/classes/AuthenticationError.html +168 -8
  13. package/docs/classes/Base64.html +134 -3
  14. package/docs/classes/Buffer.html +158 -3
  15. package/docs/classes/ConfigurationNotSetError.html +163 -8
  16. package/docs/classes/ConfigurationSetNotFoundError.html +168 -8
  17. package/docs/classes/DecodeError.html +168 -8
  18. package/docs/classes/DefaultConfigurationManager.html +206 -18
  19. package/docs/classes/DefaultLogger.html +291 -25
  20. package/docs/classes/DefaultSudoKeyArchive.html +337 -39
  21. package/docs/classes/DefaultSudoKeyManager.html +813 -63
  22. package/docs/classes/FatalError.html +168 -8
  23. package/docs/classes/IllegalArgumentError.html +168 -8
  24. package/docs/classes/IllegalStateError.html +168 -8
  25. package/docs/classes/InsufficientEntitlementsError.html +163 -8
  26. package/docs/classes/InvalidOwnershipProofError.html +163 -8
  27. package/docs/classes/InvalidTokenError.html +163 -8
  28. package/docs/classes/KeyArchiveDecodingError.html +168 -8
  29. package/docs/classes/KeyArchiveIncorrectPasswordError.html +168 -8
  30. package/docs/classes/KeyArchiveMissingError.html +168 -8
  31. package/docs/classes/KeyArchiveNoPasswordRequiredError.html +168 -8
  32. package/docs/classes/KeyArchivePasswordRequiredError.html +168 -8
  33. package/docs/classes/KeyArchiveTypeError.html +168 -8
  34. package/docs/classes/KeyArchiveUnknownKeyTypeError.html +168 -8
  35. package/docs/classes/KeyArchiveVersionError.html +168 -8
  36. package/docs/classes/KeyNotFoundError.html +168 -8
  37. package/docs/classes/KeyStoreNotExportableError.html +168 -8
  38. package/docs/classes/LimitExceededError.html +163 -8
  39. package/docs/classes/NoEntitlementsError.html +163 -8
  40. package/docs/classes/NotAuthorizedError.html +168 -8
  41. package/docs/classes/NotRegisteredError.html +168 -8
  42. package/docs/classes/NotSignedInError.html +163 -8
  43. package/docs/classes/OperationNotImplementedError.html +168 -8
  44. package/docs/classes/RegisterError.html +168 -8
  45. package/docs/classes/RequestFailedError.html +188 -12
  46. package/docs/classes/ServiceError.html +168 -8
  47. package/docs/classes/SignOutError.html +168 -8
  48. package/docs/classes/SudoCryptoProviderDefaults.html +106 -1
  49. package/docs/classes/UnknownGraphQLError.html +168 -8
  50. package/docs/classes/UnrecognizedAlgorithmError.html +168 -8
  51. package/docs/classes/UserNotConfirmedError.html +163 -8
  52. package/docs/classes/VersionMismatchError.html +163 -8
  53. package/docs/enums/CachePolicy.html +71 -3
  54. package/docs/enums/EncryptionAlgorithm.html +78 -3
  55. package/docs/enums/KeyArchiveKeyType.html +86 -4
  56. package/docs/enums/KeyDataKeyFormat.html +84 -10
  57. package/docs/enums/KeyDataKeyType.html +85 -3
  58. package/docs/enums/ListOperationResultStatus.html +84 -9
  59. package/docs/enums/PublicKeyFormat.html +68 -1
  60. package/docs/functions/isAppSyncNetworkError.html +147 -0
  61. package/docs/functions/isInsecureKeyArchive.html +147 -0
  62. package/docs/functions/isSecureKeyArchive.html +147 -0
  63. package/docs/functions/isUnrecognizedKeyArchive.html +147 -0
  64. package/docs/functions/keyArchiveInfoFromKeyData.html +147 -0
  65. package/docs/functions/keyArchiveKeyTypeFromKeyDataKeyType.html +147 -0
  66. package/docs/functions/mapGraphQLToClientError.html +154 -0
  67. package/docs/functions/mapNetworkErrorToClientError.html +154 -0
  68. package/docs/index.html +134 -2
  69. package/docs/interfaces/AsymmetricEncryptionOptions.html +68 -3
  70. package/docs/interfaces/BooleanFilter.html +75 -3
  71. package/docs/interfaces/ConfigurationManager.html +191 -35
  72. package/docs/interfaces/KeyData.html +106 -8
  73. package/docs/interfaces/ListOperationFailureResult.html +76 -5
  74. package/docs/interfaces/ListOperationPartialResult.html +101 -9
  75. package/docs/interfaces/ListOperationSuccessResult.html +90 -7
  76. package/docs/interfaces/ListOutput.html +80 -3
  77. package/docs/interfaces/Logger.html +251 -45
  78. package/docs/interfaces/Owner.html +72 -1
  79. package/docs/interfaces/PublicKey.html +72 -1
  80. package/docs/interfaces/ServiceCompatibilityInfo.html +106 -13
  81. package/docs/interfaces/StringFilter.html +82 -3
  82. package/docs/interfaces/SudoCryptoProvider.html +860 -175
  83. package/docs/interfaces/SudoKeyArchive.html +245 -42
  84. package/docs/interfaces/SudoKeyManager.html +842 -169
  85. package/docs/interfaces/SymmetricEncryptionOptions.html +75 -3
  86. package/docs/interfaces/ValidationResult.html +79 -7
  87. package/docs/modules.html +248 -33
  88. package/docs/types/AppSyncError.html +138 -0
  89. package/docs/types/AppSyncNetworkError.html +138 -0
  90. package/docs/types/InsecureKeyArchive.html +138 -0
  91. package/docs/types/KeyArchive.html +138 -0
  92. package/docs/types/KeyArchiveKeyInfo.html +154 -0
  93. package/docs/types/KeyArchiveKeyInfoDecoded.html +138 -0
  94. package/docs/types/ListOperationResult.html +148 -0
  95. package/docs/types/SecureKeyArchive.html +138 -0
  96. package/docs/types/Subset.html +144 -0
  97. package/docs/types/UnrecognizedKeyArchive.html +138 -0
  98. package/docs/variables/CURRENT_ARCHIVE_VERSION.html +138 -0
  99. package/docs/variables/InsecureKeyArchiveCodec.html +138 -0
  100. package/docs/variables/InsecureKeyArchiveType.html +138 -0
  101. package/docs/variables/KeyArchiveCodec.html +138 -0
  102. package/docs/variables/KeyArchiveKeyInfoArrayCodec.html +138 -0
  103. package/docs/variables/KeyArchiveKeyInfoCodec.html +138 -0
  104. package/docs/variables/KeyArchiveKeyTypeCodec.html +138 -0
  105. package/docs/variables/SecureKeyArchiveCodec.html +138 -0
  106. package/docs/variables/SecureKeyArchiveType.html +138 -0
  107. package/docs/variables/UnrecognizedKeyArchiveCodec.html +138 -0
  108. package/github/.gitignore +2 -1
  109. package/github/.yarn/releases/{yarn-1.22.18.cjs → yarn-1.22.19.cjs} +13 -4
  110. package/github/.yarnrc +1 -1
  111. package/github/bin/outdated-with-suppression.sh +117 -11
  112. package/github/bin/suppress-outdated.sh +36 -9
  113. package/github/docs/assets/highlight.css +11 -11
  114. package/github/docs/assets/main.js +4 -2
  115. package/github/docs/assets/search.js +1 -1
  116. package/github/docs/assets/style.css +427 -617
  117. package/github/docs/classes/AccountLockedError.html +163 -8
  118. package/github/docs/classes/AuthenticationError.html +168 -8
  119. package/github/docs/classes/Base64.html +134 -3
  120. package/github/docs/classes/Buffer.html +158 -3
  121. package/github/docs/classes/ConfigurationNotSetError.html +163 -8
  122. package/github/docs/classes/ConfigurationSetNotFoundError.html +168 -8
  123. package/github/docs/classes/DecodeError.html +168 -8
  124. package/github/docs/classes/DefaultConfigurationManager.html +206 -18
  125. package/github/docs/classes/DefaultLogger.html +291 -25
  126. package/github/docs/classes/DefaultSudoKeyArchive.html +337 -39
  127. package/github/docs/classes/DefaultSudoKeyManager.html +813 -63
  128. package/github/docs/classes/FatalError.html +168 -8
  129. package/github/docs/classes/IllegalArgumentError.html +168 -8
  130. package/github/docs/classes/IllegalStateError.html +168 -8
  131. package/github/docs/classes/InsufficientEntitlementsError.html +163 -8
  132. package/github/docs/classes/InvalidOwnershipProofError.html +163 -8
  133. package/github/docs/classes/InvalidTokenError.html +163 -8
  134. package/github/docs/classes/KeyArchiveDecodingError.html +168 -8
  135. package/github/docs/classes/KeyArchiveIncorrectPasswordError.html +168 -8
  136. package/github/docs/classes/KeyArchiveMissingError.html +168 -8
  137. package/github/docs/classes/KeyArchiveNoPasswordRequiredError.html +168 -8
  138. package/github/docs/classes/KeyArchivePasswordRequiredError.html +168 -8
  139. package/github/docs/classes/KeyArchiveTypeError.html +168 -8
  140. package/github/docs/classes/KeyArchiveUnknownKeyTypeError.html +168 -8
  141. package/github/docs/classes/KeyArchiveVersionError.html +168 -8
  142. package/github/docs/classes/KeyNotFoundError.html +168 -8
  143. package/github/docs/classes/KeyStoreNotExportableError.html +168 -8
  144. package/github/docs/classes/LimitExceededError.html +163 -8
  145. package/github/docs/classes/NoEntitlementsError.html +163 -8
  146. package/github/docs/classes/NotAuthorizedError.html +168 -8
  147. package/github/docs/classes/NotRegisteredError.html +168 -8
  148. package/github/docs/classes/NotSignedInError.html +163 -8
  149. package/github/docs/classes/OperationNotImplementedError.html +168 -8
  150. package/github/docs/classes/RegisterError.html +168 -8
  151. package/github/docs/classes/RequestFailedError.html +188 -12
  152. package/github/docs/classes/ServiceError.html +168 -8
  153. package/github/docs/classes/SignOutError.html +168 -8
  154. package/github/docs/classes/SudoCryptoProviderDefaults.html +106 -1
  155. package/github/docs/classes/UnknownGraphQLError.html +168 -8
  156. package/github/docs/classes/UnrecognizedAlgorithmError.html +168 -8
  157. package/github/docs/classes/UserNotConfirmedError.html +163 -8
  158. package/github/docs/classes/VersionMismatchError.html +163 -8
  159. package/github/docs/enums/CachePolicy.html +71 -3
  160. package/github/docs/enums/EncryptionAlgorithm.html +78 -3
  161. package/github/docs/enums/KeyArchiveKeyType.html +86 -4
  162. package/github/docs/enums/KeyDataKeyFormat.html +84 -10
  163. package/github/docs/enums/KeyDataKeyType.html +85 -3
  164. package/github/docs/enums/ListOperationResultStatus.html +84 -9
  165. package/github/docs/enums/PublicKeyFormat.html +68 -1
  166. package/github/docs/functions/isAppSyncNetworkError.html +147 -0
  167. package/github/docs/functions/isInsecureKeyArchive.html +147 -0
  168. package/github/docs/functions/isSecureKeyArchive.html +147 -0
  169. package/github/docs/functions/isUnrecognizedKeyArchive.html +147 -0
  170. package/github/docs/functions/keyArchiveInfoFromKeyData.html +147 -0
  171. package/github/docs/functions/keyArchiveKeyTypeFromKeyDataKeyType.html +147 -0
  172. package/github/docs/functions/mapGraphQLToClientError.html +154 -0
  173. package/github/docs/functions/mapNetworkErrorToClientError.html +154 -0
  174. package/github/docs/index.html +134 -2
  175. package/github/docs/interfaces/AsymmetricEncryptionOptions.html +68 -3
  176. package/github/docs/interfaces/BooleanFilter.html +75 -3
  177. package/github/docs/interfaces/ConfigurationManager.html +191 -35
  178. package/github/docs/interfaces/KeyData.html +106 -8
  179. package/github/docs/interfaces/ListOperationFailureResult.html +76 -5
  180. package/github/docs/interfaces/ListOperationPartialResult.html +101 -9
  181. package/github/docs/interfaces/ListOperationSuccessResult.html +90 -7
  182. package/github/docs/interfaces/ListOutput.html +80 -3
  183. package/github/docs/interfaces/Logger.html +251 -45
  184. package/github/docs/interfaces/Owner.html +72 -1
  185. package/github/docs/interfaces/PublicKey.html +72 -1
  186. package/github/docs/interfaces/ServiceCompatibilityInfo.html +106 -13
  187. package/github/docs/interfaces/StringFilter.html +82 -3
  188. package/github/docs/interfaces/SudoCryptoProvider.html +860 -175
  189. package/github/docs/interfaces/SudoKeyArchive.html +245 -42
  190. package/github/docs/interfaces/SudoKeyManager.html +842 -169
  191. package/github/docs/interfaces/SymmetricEncryptionOptions.html +75 -3
  192. package/github/docs/interfaces/ValidationResult.html +79 -7
  193. package/github/docs/modules.html +248 -33
  194. package/github/docs/types/AppSyncError.html +138 -0
  195. package/github/docs/types/AppSyncNetworkError.html +138 -0
  196. package/github/docs/types/InsecureKeyArchive.html +138 -0
  197. package/github/docs/types/KeyArchive.html +138 -0
  198. package/github/docs/types/KeyArchiveKeyInfo.html +154 -0
  199. package/github/docs/types/KeyArchiveKeyInfoDecoded.html +138 -0
  200. package/github/docs/types/ListOperationResult.html +148 -0
  201. package/github/docs/types/SecureKeyArchive.html +138 -0
  202. package/github/docs/types/Subset.html +144 -0
  203. package/github/docs/types/UnrecognizedKeyArchive.html +138 -0
  204. package/github/docs/variables/CURRENT_ARCHIVE_VERSION.html +138 -0
  205. package/github/docs/variables/InsecureKeyArchiveCodec.html +138 -0
  206. package/github/docs/variables/InsecureKeyArchiveType.html +138 -0
  207. package/github/docs/variables/KeyArchiveCodec.html +138 -0
  208. package/github/docs/variables/KeyArchiveKeyInfoArrayCodec.html +138 -0
  209. package/github/docs/variables/KeyArchiveKeyInfoCodec.html +138 -0
  210. package/github/docs/variables/KeyArchiveKeyTypeCodec.html +138 -0
  211. package/github/docs/variables/SecureKeyArchiveCodec.html +138 -0
  212. package/github/docs/variables/SecureKeyArchiveType.html +138 -0
  213. package/github/docs/variables/UnrecognizedKeyArchiveCodec.html +138 -0
  214. package/github/package.json +25 -17
  215. package/github/src/sudoKeyArchive/sudoKeyArchive.ts +1 -1
  216. package/github/src/sudoKeyManager/sudoCryptoProvider.ts +44 -3
  217. package/github/src/sudoKeyManager/sudoKeyManager.ts +64 -6
  218. package/github/test/unit/sudoKeyManager.spec.ts +12 -12
  219. package/github/yarn.lock +1012 -735
  220. package/lib/sudoKeyArchive/sudoKeyArchive.d.ts +1 -1
  221. package/lib/sudoKeyArchive/sudoKeyArchive.js +1 -1
  222. package/lib/sudoKeyManager/sudoCryptoProvider.d.ts +34 -3
  223. package/lib/sudoKeyManager/sudoKeyManager.d.ts +32 -4
  224. package/lib/sudoKeyManager/sudoKeyManager.js +16 -4
  225. package/package.json +26 -18
  226. package/src/sudoKeyArchive/sudoKeyArchive.ts +1 -1
  227. package/src/sudoKeyManager/sudoCryptoProvider.ts +44 -3
  228. package/src/sudoKeyManager/sudoKeyManager.ts +64 -6
  229. package/test/unit/sudoKeyManager.spec.ts +12 -12
  230. package/yarn.lock +1012 -735
  231. package/docs/assets/icons.css +0 -1043
  232. package/docs/assets/icons.png +0 -0
  233. package/docs/assets/icons@2x.png +0 -0
  234. package/github/docs/assets/icons.css +0 -1043
  235. package/github/docs/assets/icons.png +0 -0
  236. package/github/docs/assets/icons@2x.png +0 -0
package/.gitignore CHANGED
@@ -10,4 +10,5 @@ yarn-error.log
10
10
  coverage
11
11
  .yalc/
12
12
  yalc.lock
13
- config
13
+ config
14
+ package.json.old
@@ -1565,7 +1565,13 @@ class ResponseError extends Error {
1565
1565
  }
1566
1566
 
1567
1567
  exports.ResponseError = ResponseError;
1568
- class OneTimePasswordError extends Error {}
1568
+ class OneTimePasswordError extends Error {
1569
+ constructor(notice) {
1570
+ super();
1571
+ this.notice = notice;
1572
+ }
1573
+
1574
+ }
1569
1575
  exports.OneTimePasswordError = OneTimePasswordError;
1570
1576
 
1571
1577
  /***/ }),
@@ -32867,6 +32873,10 @@ class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default {
32867
32873
  }
32868
32874
 
32869
32875
  _this.reporter.info(_this.reporter.lang('twoFactorAuthenticationEnabled'));
32876
+ if (error.notice) {
32877
+ _this.reporter.info(error.notice);
32878
+ }
32879
+
32870
32880
  _this.otp = yield (0, (_login || _load_login()).getOneTimePassword)(_this.reporter);
32871
32881
 
32872
32882
  _this.requestManager.clearCache();
@@ -46853,7 +46863,7 @@ function mkdirfix (name, opts, cb) {
46853
46863
  /* 195 */
46854
46864
  /***/ (function(module, exports) {
46855
46865
 
46856
- module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.22.18","packageManager":"yarn@1.22.17","license":"BSD-2-Clause","preferGlobal":true,"description":"📦🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^3.1.0","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","cli-table3":"^0.4.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^6.2.0","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","js-yaml":"^3.13.1","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.4","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-inline-import":"^3.0.0","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.28","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.11.0","fancy-log":"^1.3.2","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^4.0.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","string-replace-loader":"^2.1.1","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}
46866
+ module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.22.19","packageManager":"yarn@1.22.17","license":"BSD-2-Clause","preferGlobal":true,"description":"📦🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^3.1.0","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","cli-table3":"^0.4.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^6.2.0","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","js-yaml":"^3.13.1","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.4","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-inline-import":"^3.0.0","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.28","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.11.0","fancy-log":"^1.3.2","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^4.0.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","string-replace-loader":"^2.1.1","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}
46857
46867
 
46858
46868
  /***/ }),
46859
46869
  /* 196 */
@@ -77655,9 +77665,8 @@ class RequestManager {
77655
77665
 
77656
77666
  if (res.statusCode === 401 && res.headers['www-authenticate']) {
77657
77667
  const authMethods = res.headers['www-authenticate'].split(/,\s*/).map(s => s.toLowerCase());
77658
-
77659
77668
  if (authMethods.indexOf('otp') !== -1) {
77660
- reject(new (_errors || _load_errors()).OneTimePasswordError());
77669
+ reject(new (_errors || _load_errors()).OneTimePasswordError(res.headers['npm-notice']));
77661
77670
  return;
77662
77671
  }
77663
77672
  }
package/.yarnrc CHANGED
@@ -2,4 +2,4 @@
2
2
  # yarn lockfile v1
3
3
 
4
4
 
5
- yarn-path ".yarn/releases/yarn-1.22.18.cjs"
5
+ yarn-path ".yarn/releases/yarn-1.22.19.cjs"
@@ -1,12 +1,15 @@
1
1
  #!/bin/sh
2
2
 
3
- function version_diff_type() {
3
+ set -e
4
+ d="$(dirname "$0")"
5
+
6
+ version_diff_type() {
4
7
  v1="$1"
5
8
  v2="$2"
6
- v1_major=$(echo $v1 | sed -E -e 's/^([^.]+)\..*/\1/')
7
- v2_major=$(echo $v2 | sed -E -e 's/^([^.]+)\..*/\1/')
8
- v1_minor=$(echo $v1 | sed -E -e 's/^([^.]+)\.([^.]+)\..*/\2/')
9
- v2_minor=$(echo $v2 | sed -E -e 's/^([^.]+)\.([^.]+)\..*/\2/')
9
+ v1_major=$(echo "$v1" | sed -E -e 's/^([^.]+)\..*/\1/')
10
+ v2_major=$(echo "$v2" | sed -E -e 's/^([^.]+)\..*/\1/')
11
+ v1_minor=$(echo "$v1" | sed -E -e 's/^([^.]+)\.([^.]+)\..*/\2/')
12
+ v2_minor=$(echo "$v2" | sed -E -e 's/^([^.]+)\.([^.]+)\..*/\2/')
10
13
  if [ "${v1_major}" != "${v2_major}" ]; then echo 'major'; return 0; fi
11
14
  if [ "${v1_minor}" != "${v2_minor}" ]; then echo 'minor'; return 0; fi
12
15
  if [ "${v1}" != "${v2}" ]; then echo 'patch'; return 0; fi
@@ -14,7 +17,7 @@ function version_diff_type() {
14
17
  return 0
15
18
  }
16
19
 
17
- function suppression_from_diff_type() {
20
+ suppression_from_diff_type() {
18
21
  diff_type="$1"
19
22
  majorSuppression="$2"
20
23
  minorSuppression="$3"
@@ -45,17 +48,92 @@ function suppression_from_diff_type() {
45
48
  esac
46
49
  }
47
50
 
48
- yarn outdated --json | jq -r -s -c 'map(select(.type == "table").data.body) | .[] | unique_by(.[0]) | .[] | .[0] + " " + .[1] + " " + .[2] + " " + .[3]' | (new=""; while read package_name current wanted latest; do
51
+ # Number of days to suppress if accepting or refreshing and cadence to run if --last specified
52
+ cadence=30
53
+
54
+ # If set, accept any outdated packages. Has the effect of refreshing existing suppressions
55
+ # as well.
56
+ accept=""
57
+
58
+ # If set, refresh any existing suppressions
59
+ refresh=""
60
+
61
+ # If set, records/references last success in the specified directory.
62
+ # Only run the dependency check every cadence days if a last success
63
+ # timestamp is found
64
+ last=""
65
+
66
+ while [ -n "${1}" ]; do
67
+ case "${1}" in
68
+ --cadence)
69
+ if [ -z "$2" ]; then
70
+ echo "ERROR: --cadence requires number of days argument" 1>&2
71
+ exit 1
72
+ fi
73
+ shift
74
+ cadence="$1"
75
+ ;;
76
+ --accept) accept="1" ;;
77
+ --refresh) refresh="1" ;;
78
+ --last)
79
+ if [ -z "$2" ]; then
80
+ echo "ERROR: --last requires directory argument in which last successful run timestamp is to be store" 1>&2
81
+ exit 1
82
+ fi
83
+ shift
84
+ last="$1"
85
+ ;;
86
+ *)
87
+ echo "ERROR: Unrecognized argument '${1}'" 1>&2
88
+ exit 1
89
+ esac
90
+ shift
91
+ done
92
+
93
+ dateFromSeconds() {
94
+ s="$1"
95
+ case $(uname) in
96
+ Darwin)
97
+ date -Iseconds -r"${s}"
98
+ ;;
99
+ *)
100
+ date -Iseconds "-d@${s}"
101
+ ;;
102
+ esac
103
+ }
104
+
105
+ within_cadence=""
106
+ if [ -r "${last}/last_success" ]; then
107
+ cadence_seconds=$((cadence * 24 * 3600))
108
+ now="$(date +%s)"
109
+ last_run="$(cat "${last}/last_success")"
110
+ due="$((last_run + cadence_seconds))"
111
+ if [ "$((due > now))" = "1" ]; then
112
+ echo "Last success: $(dateFromSeconds "${last_run}")"
113
+ echo "Now: $(date -Iseconds)"
114
+ echo "Due from: $(dateFromSeconds "${due}")"
115
+ within_cadence="1"
116
+ else
117
+ echo "Last success: $(dateFromSeconds "${last_run}")"
118
+ echo "Now: $(date -Iseconds)"
119
+ echo "Due since: $(dateFromSeconds "${due}")"
120
+ fi
121
+ fi
122
+
123
+
124
+ 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
49
125
  majorSuppression=$(jq ".outdatedSuppressions.major[\"${package_name}\"] | select (. != null)" package.json)
50
126
  minorSuppression=$(jq ".outdatedSuppressions.minor[\"${package_name}\"] | select (. != null)" package.json)
51
127
  patchSuppression=$(jq ".outdatedSuppressions[\"${package_name}\"] | select (. != null)" package.json)
52
128
  latest_diff_type=$(version_diff_type "${current}" "${latest}")
53
129
  wanted_diff_type=$(version_diff_type "${current}" "${wanted}")
54
130
 
131
+ # shellcheck disable=SC2046
55
132
  set -- $(suppression_from_diff_type "${latest_diff_type}" "${majorSuppression}" "${minorSuppression}" "${patchSuppression}")
56
133
  latest_suppression_type="$1"
57
134
  latest_suppression="$2"
58
135
 
136
+ # shellcheck disable=SC2046
59
137
  set -- $(suppression_from_diff_type "${wanted_diff_type}" "${majorSuppression}" "${minorSuppression}" "${patchSuppression}")
60
138
  wanted_suppression_type="$1"
61
139
  wanted_suppression="$2"
@@ -81,17 +159,45 @@ yarn outdated --json | jq -r -s -c 'map(select(.type == "table").data.body) | .[
81
159
  fi
82
160
  fi
83
161
 
162
+ suppress_outdated=""
163
+ if [ -e "${d}/suppress-outdated" ]; then
164
+ suppress_outdated="${d}/suppress-outdated"
165
+ elif [ -e "${d}/suppress-outdated.sh" ]; then
166
+ suppress_outdated="${d}/suppress-outdated.sh"
167
+ fi
168
+ if [ -z "${suppress_outdated}" ]; then
169
+ echo "ERROR: Unable to find suppress-outdated" 1>&2
170
+ exit 1
171
+ fi
84
172
  if [ -z "${suppression}" ]; then
85
- echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} outdated]"
86
- new=1
87
- elif [ $(date '+%s') -gt "${suppression}" ]; then
173
+ if [ -n "${accept}" ]; then
174
+ echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${latest_diff_type} accepted]"
175
+ "${suppress_outdated}" --suppression "${cadence}" --"${latest_diff_type}" "${package_name}"
176
+ else
177
+ echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} outdated]"
178
+ new=1
179
+ fi
180
+ elif [ -n "${accept}${refresh}" ]; then
181
+ echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${suppression_type} suppression refreshed]"
182
+ "${suppress_outdated}" --suppression "${cadence}" --"${suppression_type}" "${package_name}"
183
+ elif [ "$(date '+%s')" -gt "${suppression}" ]; then
88
184
  echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} suppression expired]"
89
185
  new=1
90
186
  else
91
187
  echo "${package_name}: current: ${current} wanted: ${wanted} latest: ${latest} [${outdated_diff_type} suppressed]"
92
188
  fi
93
189
  done
94
- if [ -n "${new}" ]; then
190
+
191
+ # If we're not within cadence and there are new outdated dependencies
192
+ # then fail
193
+ if [ -z "${within_cadence}" -a -n "${new}" ]; then
95
194
  exit 1
96
195
  fi
196
+
197
+ # If there a no outdated dependencies and we're tracking last success then
198
+ # refresh the last success timestamp.
199
+ if [ -z "${new}" -a -n "${last}" ]; then
200
+ mkdir -p "${last}"
201
+ date +%s > "${last}/last_success"
202
+ fi
97
203
  )
@@ -3,6 +3,24 @@
3
3
  # Insert a package name to suppress in outdated checks.
4
4
  #
5
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
+
6
24
  case "$1" in
7
25
  --major)
8
26
  root=".outdatedSuppressions.major"
@@ -15,19 +33,28 @@ case "$1" in
15
33
  ;;
16
34
  *)
17
35
  echo "suppress-outdated.sh: Unrecognized option: '$1'" 1>&2
18
- echo "Usage: suppress-outdated.sh {--major|--minor|--patch} <package name>" 1>&2
36
+ usage 1>&2
19
37
  exit 1
20
38
  ;;
21
39
  esac
40
+ shift
22
41
 
23
- package_name="$2"
24
- PACKAGE_JSON="package.json"
25
-
26
- if [ -z "$package_name" ]; then
27
- echo "Usage: yarn suppress-outdated {--major|--minor|--patch} <package name>"
42
+ if [ -z "$1" ]; then
43
+ echo "suppress-outdated.sh: No package names specified" 1>&2
44
+ usage 1>&2
28
45
  exit 1
29
46
  fi
30
47
 
31
- cp $PACKAGE_JSON $PACKAGE_JSON.old
32
- cat $PACKAGE_JSON | jq "${root}.\"${package_name}\" = (now | floor | . + 1209600)" > $PACKAGE_JSON.staging
33
- mv $PACKAGE_JSON.staging $PACKAGE_JSON
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