hof 22.0.0-timeout-warning-beta.2 → 22.0.0-timeout-warning-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/.nyc_output/3971586e-d34a-49de-8cd7-964103fb3317.json +1 -0
- package/.nyc_output/processinfo/{39365c14-40b7-4634-b733-940b72a11984.json → 3971586e-d34a-49de-8cd7-964103fb3317.json} +1 -1
- package/.nyc_output/processinfo/index.json +1 -1
- package/CHANGELOG.md +5 -0
- package/frontend/themes/gov-uk/client-js/index.js +0 -1
- package/frontend/themes/gov-uk/client-js/session-timeout-dialog.js +5 -2
- package/model/apis/axios-settings.js +21 -0
- package/model/apis/html-to-pdf-converter.js +10 -8
- package/model/index.js +102 -87
- package/package.json +4 -4
- package/sandbox/public/js/bundle.js +7 -3
- package/.nyc_output/39365c14-40b7-4634-b733-940b72a11984.json +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"parent":null,"pid":
|
1
|
+
{"parent":null,"pid":13474,"argv":["/Users/user/.nvm/versions/node/v20.9.0/bin/node","/Users/user/Documents/HO/HOF/hof/node_modules/.bin/_mocha","test/**/*.spec.js","sandbox/test/**/*.spec.js"],"execArgv":[],"cwd":"/Users/user/Documents/HO/HOF/hof","time":1722271618026,"ppid":13467,"coverageFilename":"/Users/user/Documents/HO/HOF/hof/.nyc_output/3971586e-d34a-49de-8cd7-964103fb3317.json","externalId":"","uuid":"3971586e-d34a-49de-8cd7-964103fb3317","files":["/Users/user/Documents/HO/HOF/hof/model/index.js","/Users/user/Documents/HO/HOF/hof/model/apis/axios-settings.js","/Users/user/Documents/HO/HOF/hof/components/index.js","/Users/user/Documents/HO/HOF/hof/components/address-lookup/index.js","/Users/user/Documents/HO/HOF/hof/components/address-lookup/default-model.js","/Users/user/Documents/HO/HOF/hof/components/address-lookup/defaults.js","/Users/user/Documents/HO/HOF/hof/components/clear-session/index.js","/Users/user/Documents/HO/HOF/hof/components/combine-and-loop-fields/index.js","/Users/user/Documents/HO/HOF/hof/components/date/index.js","/Users/user/Documents/HO/HOF/hof/components/date/fields.js","/Users/user/Documents/HO/HOF/hof/components/emailer/index.js","/Users/user/Documents/HO/HOF/hof/components/emailer/email-service.js","/Users/user/Documents/HO/HOF/hof/components/emailer/emailer.js","/Users/user/Documents/HO/HOF/hof/components/emailer/transports/index.js","/Users/user/Documents/HO/HOF/hof/components/emailer/transports/smtp.js","/Users/user/Documents/HO/HOF/hof/components/emailer/transports/ses.js","/Users/user/Documents/HO/HOF/hof/components/emailer/transports/stub.js","/Users/user/Documents/HO/HOF/hof/components/emailer/transports/debug.js","/Users/user/Documents/HO/HOF/hof/components/homeoffice-countries/index.js","/Users/user/Documents/HO/HOF/hof/config/component-defaults.js","/Users/user/Documents/HO/HOF/hof/components/notify/index.js","/Users/user/Documents/HO/HOF/hof/components/notify/notify.js","/Users/user/Documents/HO/HOF/hof/components/summary/index.js","/Users/user/Documents/HO/HOF/hof/config/rate-limits.js","/Users/user/Documents/HO/HOF/hof/middleware/rate-limiter.js","/Users/user/Documents/HO/HOF/hof/config/hof-defaults.js","/Users/user/Documents/HO/HOF/hof/controller/base-controller.js","/Users/user/Documents/HO/HOF/hof/controller/formatting/index.js","/Users/user/Documents/HO/HOF/hof/controller/validation/index.js","/Users/user/Documents/HO/HOF/hof/controller/validation/validators.js","/Users/user/Documents/HO/HOF/hof/controller/validation/email.js","/Users/user/Documents/HO/HOF/hof/controller/validation-error.js","/Users/user/Documents/HO/HOF/hof/utilities/index.js","/Users/user/Documents/HO/HOF/hof/utilities/autofill/index.js","/Users/user/Documents/HO/HOF/hof/utilities/autofill/inputs.js","/Users/user/Documents/HO/HOF/hof/utilities/test-data/index.js","/Users/user/Documents/HO/HOF/hof/utilities/countries.js","/Users/user/Documents/HO/HOF/hof/utilities/helpers/index.js","/Users/user/Documents/HO/HOF/hof/utilities/reqres/index.js","/Users/user/Documents/HO/HOF/hof/config/sanitisation-rules.js","/Users/user/Documents/HO/HOF/hof/controller/formatting/formatters.js","/Users/user/Documents/HO/HOF/hof/controller/index.js","/Users/user/Documents/HO/HOF/hof/controller/behaviour-session.js","/Users/user/Documents/HO/HOF/hof/controller/behaviour-hooks.js","/Users/user/Documents/HO/HOF/hof/controller/controller.js","/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/behaviours/country-select.js","/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/index.js","/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/template-mixins.js","/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/render.js","/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/helpers.js","/Users/user/Documents/HO/HOF/hof/index.js","/Users/user/Documents/HO/HOF/hof/frontend/index.js","/Users/user/Documents/HO/HOF/hof/frontend/govuk-template/index.js","/Users/user/Documents/HO/HOF/hof/frontend/govuk-template/build/index.js","/Users/user/Documents/HO/HOF/hof/frontend/govuk-template/build/config.js","/Users/user/Documents/HO/HOF/hof/frontend/template-partials/index.js","/Users/user/Documents/HO/HOF/hof/frontend/template-partials/translations/index.js","/Users/user/Documents/HO/HOF/hof/frontend/themes/index.js","/Users/user/Documents/HO/HOF/hof/frontend/themes/gov-uk/index.js","/Users/user/Documents/HO/HOF/hof/frontend/toolkit/index.js","/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/helpers.js","/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/form-focus.js","/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/progressive-reveal.js","/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/validation.js","/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/character-count.js","/Users/user/Documents/HO/HOF/hof/middleware/index.js","/Users/user/Documents/HO/HOF/hof/middleware/cookies.js","/Users/user/Documents/HO/HOF/hof/middleware/errors.js","/Users/user/Documents/HO/HOF/hof/middleware/not-found.js","/Users/user/Documents/HO/HOF/hof/middleware/deep-translate.js","/Users/user/Documents/HO/HOF/hof/lib/markdown.js","/Users/user/Documents/HO/HOF/hof/lib/router.js","/Users/user/Documents/HO/HOF/hof/wizard/index.js","/Users/user/Documents/HO/HOF/hof/wizard/behaviours/index.js","/Users/user/Documents/HO/HOF/hof/wizard/behaviours/complete.js","/Users/user/Documents/HO/HOF/hof/wizard/util/constants.js","/Users/user/Documents/HO/HOF/hof/lib/helpers.js","/Users/user/Documents/HO/HOF/hof/lib/health.js","/Users/user/Documents/HO/HOF/hof/lib/serve-static.js","/Users/user/Documents/HO/HOF/hof/lib/ga-tag.js","/Users/user/Documents/HO/HOF/hof/lib/sessions.js","/Users/user/Documents/HO/HOF/hof/lib/settings.js","/Users/user/Documents/HO/HOF/hof/lib/logger.js","/Users/user/Documents/HO/HOF/hof/build/index.js","/Users/user/Documents/HO/HOF/hof/config/builder-defaults.js","/Users/user/Documents/HO/HOF/hof/transpiler/index.js","/Users/user/Documents/HO/HOF/hof/transpiler/lib/compile.js","/Users/user/Documents/HO/HOF/hof/transpiler/lib/build.js","/Users/user/Documents/HO/HOF/hof/transpiler/lib/expand-dirs.js","/Users/user/Documents/HO/HOF/hof/transpiler/lib/aggregate.js","/Users/user/Documents/HO/HOF/hof/transpiler/lib/write-files.js","/Users/user/Documents/HO/HOF/hof/model/apis/index.js","/Users/user/Documents/HO/HOF/hof/model/apis/html-to-pdf-converter.js","/Users/user/Documents/HO/HOF/hof/wizard/model.js","/Users/user/Documents/HO/HOF/hof/wizard/middleware/back-links.js","/Users/user/Documents/HO/HOF/hof/wizard/util/helpers.js","/Users/user/Documents/HO/HOF/hof/wizard/middleware/check-complete.js","/Users/user/Documents/HO/HOF/hof/wizard/middleware/check-progress.js","/Users/user/Documents/HO/HOF/hof/wizard/middleware/check-session.js","/Users/user/Documents/HO/HOF/hof/wizard/middleware/csrf.js","/Users/user/Documents/HO/HOF/hof/sandbox/test/_unit/example_app/sections/summary-data-sections.spec.js","/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/sections/summary-data-sections.js","/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/lib/staticAppealStages.js","/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/fields.js","/Users/user/Documents/HO/HOF/hof/sandbox/test/helpers/utilities.js","/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/behaviours/international-number.js","/Users/user/Documents/HO/HOF/hof/lib/encryption.js","/Users/user/Documents/HO/HOF/hof/wizard/middleware/session.js","/Users/user/Documents/HO/HOF/hof/wizard/middleware/session-model.js"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"processes":{"39365c14-40b7-4634-b733-940b72a11984":{"parent":null,"children":[]}},"files":{"/Users/user/Documents/HO/HOF/hof/model/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/address-lookup/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/address-lookup/default-model.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/address-lookup/defaults.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/clear-session/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/combine-and-loop-fields/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/date/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/date/fields.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/emailer/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/emailer/email-service.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/emailer/emailer.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/emailer/transports/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/emailer/transports/smtp.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/emailer/transports/ses.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/emailer/transports/stub.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/emailer/transports/debug.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/homeoffice-countries/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/config/component-defaults.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/notify/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/notify/notify.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/components/summary/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/config/rate-limits.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/middleware/rate-limiter.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/config/hof-defaults.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/base-controller.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/formatting/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/validation/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/validation/validators.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/validation/email.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/validation-error.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/utilities/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/utilities/autofill/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/utilities/autofill/inputs.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/utilities/test-data/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/utilities/countries.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/utilities/helpers/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/utilities/reqres/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/config/sanitisation-rules.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/formatting/formatters.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/behaviour-session.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/behaviour-hooks.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/controller/controller.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/behaviours/country-select.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/template-mixins.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/render.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/helpers.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/govuk-template/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/govuk-template/build/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/govuk-template/build/config.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/template-partials/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/template-partials/translations/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/themes/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/themes/gov-uk/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/helpers.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/form-focus.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/progressive-reveal.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/validation.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/character-count.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/middleware/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/middleware/cookies.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/middleware/errors.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/middleware/not-found.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/middleware/deep-translate.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/lib/markdown.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/lib/router.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/behaviours/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/behaviours/complete.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/util/constants.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/lib/helpers.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/lib/health.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/lib/serve-static.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/lib/ga-tag.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/lib/sessions.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/lib/settings.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/lib/logger.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/build/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/config/builder-defaults.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/transpiler/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/transpiler/lib/compile.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/transpiler/lib/build.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/transpiler/lib/expand-dirs.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/transpiler/lib/aggregate.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/transpiler/lib/write-files.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/model/apis/index.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/model/apis/html-to-pdf-converter.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/model.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/back-links.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/util/helpers.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/check-complete.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/check-progress.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/check-session.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/csrf.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/sandbox/test/_unit/example_app/sections/summary-data-sections.spec.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/sections/summary-data-sections.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/lib/staticAppealStages.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/fields.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/sandbox/test/helpers/utilities.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/behaviours/international-number.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/lib/encryption.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/session.js":["39365c14-40b7-4634-b733-940b72a11984"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/session-model.js":["39365c14-40b7-4634-b733-940b72a11984"]},"externalIds":{}}
|
1
|
+
{"processes":{"3971586e-d34a-49de-8cd7-964103fb3317":{"parent":null,"children":[]}},"files":{"/Users/user/Documents/HO/HOF/hof/model/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/model/apis/axios-settings.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/address-lookup/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/address-lookup/default-model.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/address-lookup/defaults.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/clear-session/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/combine-and-loop-fields/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/date/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/date/fields.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/emailer/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/emailer/email-service.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/emailer/emailer.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/emailer/transports/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/emailer/transports/smtp.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/emailer/transports/ses.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/emailer/transports/stub.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/emailer/transports/debug.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/homeoffice-countries/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/config/component-defaults.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/notify/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/notify/notify.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/components/summary/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/config/rate-limits.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/middleware/rate-limiter.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/config/hof-defaults.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/base-controller.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/formatting/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/validation/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/validation/validators.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/validation/email.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/validation-error.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/utilities/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/utilities/autofill/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/utilities/autofill/inputs.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/utilities/test-data/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/utilities/countries.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/utilities/helpers/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/utilities/reqres/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/config/sanitisation-rules.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/formatting/formatters.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/behaviour-session.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/behaviour-hooks.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/controller/controller.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/behaviours/country-select.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/template-mixins.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/render.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/template-mixins/mixins/helpers.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/govuk-template/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/govuk-template/build/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/govuk-template/build/config.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/template-partials/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/template-partials/translations/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/themes/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/themes/gov-uk/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/helpers.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/form-focus.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/progressive-reveal.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/validation.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/frontend/toolkit/assets/javascript/character-count.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/middleware/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/middleware/cookies.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/middleware/errors.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/middleware/not-found.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/middleware/deep-translate.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/lib/markdown.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/lib/router.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/behaviours/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/behaviours/complete.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/util/constants.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/lib/helpers.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/lib/health.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/lib/serve-static.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/lib/ga-tag.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/lib/sessions.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/lib/settings.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/lib/logger.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/build/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/config/builder-defaults.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/transpiler/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/transpiler/lib/compile.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/transpiler/lib/build.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/transpiler/lib/expand-dirs.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/transpiler/lib/aggregate.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/transpiler/lib/write-files.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/model/apis/index.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/model/apis/html-to-pdf-converter.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/model.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/back-links.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/util/helpers.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/check-complete.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/check-progress.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/check-session.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/csrf.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/sandbox/test/_unit/example_app/sections/summary-data-sections.spec.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/sections/summary-data-sections.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/lib/staticAppealStages.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/fields.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/sandbox/test/helpers/utilities.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/sandbox/apps/sandbox/behaviours/international-number.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/lib/encryption.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/session.js":["3971586e-d34a-49de-8cd7-964103fb3317"],"/Users/user/Documents/HO/HOF/hof/wizard/middleware/session-model.js":["3971586e-d34a-49de-8cd7-964103fb3317"]},"externalIds":{}}
|
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 2024-07-22, Version 21.0.0 (Stable), @Rhodine-orleans-lindsay
|
2
|
+
* Replaces deprecated request module with axios
|
3
|
+
- refactors the hof model and apis to use axios instead of request
|
4
|
+
* Updates patch and minor dependency versions
|
5
|
+
|
1
6
|
## 2024-04-24, Version 20.5.0 (Stable), @mislam987
|
2
7
|
* Add hint property to checkboxes to align with govuk design guidelines
|
3
8
|
|
@@ -15,7 +15,6 @@ var skipToMain = require('./skip-to-main');
|
|
15
15
|
var cookie = require('./govuk-cookies');
|
16
16
|
var cookieSettings = require('./cookieSettings');
|
17
17
|
var sessionDialog = require('./session-timeout-dialog');
|
18
|
-
GOVUK.sessionDialog.init();
|
19
18
|
|
20
19
|
toolkit.detailsSummary();
|
21
20
|
|
@@ -40,7 +40,7 @@ window.GOVUK.sessionDialog = {
|
|
40
40
|
},
|
41
41
|
|
42
42
|
isDialogOpen: function () {
|
43
|
-
return window.GOVUK.sessionDialog.el.open;
|
43
|
+
return window.GOVUK.sessionDialog.el && window.GOVUK.sessionDialog.el.open;
|
44
44
|
},
|
45
45
|
|
46
46
|
isConfigured: function () {
|
@@ -57,6 +57,7 @@ window.GOVUK.sessionDialog = {
|
|
57
57
|
window.GOVUK.sessionDialog.saveLastFocusedEl();
|
58
58
|
window.GOVUK.sessionDialog.makePageContentInert();
|
59
59
|
window.GOVUK.sessionDialog.el.showModal();
|
60
|
+
window.GOVUK.sessionDialog.el.open = true;
|
60
61
|
}
|
61
62
|
},
|
62
63
|
|
@@ -64,6 +65,7 @@ window.GOVUK.sessionDialog = {
|
|
64
65
|
if (window.GOVUK.sessionDialog.isDialogOpen()) {
|
65
66
|
$('html, body').removeClass(window.GOVUK.sessionDialog.dialogIsOpenClass);
|
66
67
|
window.GOVUK.sessionDialog.el.close();
|
68
|
+
window.GOVUK.sessionDialog.el.open = false;
|
67
69
|
window.GOVUK.sessionDialog.setFocusOnLastFocusedEl();
|
68
70
|
window.GOVUK.sessionDialog.removeInertFromPageContent();
|
69
71
|
window.GOVUK.sessionDialog.refreshSession();
|
@@ -129,7 +131,7 @@ window.GOVUK.sessionDialog = {
|
|
129
131
|
/* Array of scales as words */
|
130
132
|
const scales = ['', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quatttuor-decillion', 'quindecillion', 'sexdecillion', 'septen-decillion', 'octodecillion', 'novemdecillion', 'vigintillion', 'centillion'];
|
131
133
|
|
132
|
-
/* Split user
|
134
|
+
/* Split user argument into 3 digit chunks from right to left */
|
133
135
|
start = string.length;
|
134
136
|
const chunks = [];
|
135
137
|
while (start > 0) {
|
@@ -331,3 +333,4 @@ window.GOVUK.sessionDialog = {
|
|
331
333
|
}
|
332
334
|
}
|
333
335
|
};
|
336
|
+
window.GOVUK.sessionDialog.init();
|
@@ -0,0 +1,21 @@
|
|
1
|
+
'use strict';
|
2
|
+
const { format } = require('url'); // Destructure 'format' from 'url' module
|
3
|
+
|
4
|
+
module.exports = (settings = {}, body = null) => {
|
5
|
+
if (typeof settings !== 'object' || settings === null) {
|
6
|
+
throw new TypeError('settings must be a non-null object');
|
7
|
+
}
|
8
|
+
|
9
|
+
const {
|
10
|
+
uri,
|
11
|
+
url,
|
12
|
+
body: settingsBody,
|
13
|
+
data: settingsData,
|
14
|
+
...restSettings
|
15
|
+
} = settings;
|
16
|
+
|
17
|
+
return Object.assign({}, restSettings, {
|
18
|
+
url: uri || url || format(settings),
|
19
|
+
data: settingsBody || body || settingsData
|
20
|
+
});
|
21
|
+
};
|
@@ -9,6 +9,7 @@ module.exports = class PDFModel extends Model {
|
|
9
9
|
const settings = super.requestConfig(options);
|
10
10
|
settings.encoding = null;
|
11
11
|
settings.rejectUnauthorized = false;
|
12
|
+
settings.responseType = 'arraybuffer';
|
12
13
|
return settings;
|
13
14
|
}
|
14
15
|
|
@@ -17,17 +18,18 @@ module.exports = class PDFModel extends Model {
|
|
17
18
|
}
|
18
19
|
|
19
20
|
handleResponse(response, callback) {
|
20
|
-
if (isPdf(Buffer.from(response.
|
21
|
-
return this.parseResponse(response.
|
21
|
+
if (isPdf(Buffer.from(response.data))) {
|
22
|
+
return this.parseResponse(response.status, response.data, callback);
|
22
23
|
}
|
23
24
|
const err = new Error();
|
24
|
-
|
25
|
-
|
26
|
-
err.
|
25
|
+
|
26
|
+
if (parseInt(response.status, 10) === 400) {
|
27
|
+
err.title = response.status;
|
28
|
+
err.message = response.statusText;
|
27
29
|
} else {
|
28
|
-
err.body = response.
|
30
|
+
err.body = response.data;
|
29
31
|
}
|
30
|
-
err.status = response.
|
31
|
-
return callback(err, null, response.
|
32
|
+
err.status = response.status;
|
33
|
+
return callback(err, null, response.status);
|
32
34
|
}
|
33
35
|
};
|
package/model/index.js
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
const _ = require('lodash');
|
5
|
-
const
|
5
|
+
const axios = require('axios').default;
|
6
6
|
const url = require('url');
|
7
7
|
const EventEmitter = require('events').EventEmitter;
|
8
|
-
|
8
|
+
const axiosSetting = require('./apis/axios-settings');
|
9
9
|
const REFERENCE = /^\$ref:/;
|
10
10
|
|
11
11
|
function timeDiff(from, to, d) {
|
@@ -27,10 +27,10 @@ module.exports = class Model extends EventEmitter {
|
|
27
27
|
this.set(attributes, {
|
28
28
|
silent: true
|
29
29
|
});
|
30
|
-
this._request =
|
30
|
+
this._request = axios;
|
31
31
|
}
|
32
32
|
|
33
|
-
save(options, callback) {
|
33
|
+
async save(options, callback) {
|
34
34
|
if (typeof options === 'function' && arguments.length === 1) {
|
35
35
|
callback = options;
|
36
36
|
options = {};
|
@@ -38,21 +38,18 @@ module.exports = class Model extends EventEmitter {
|
|
38
38
|
options = {};
|
39
39
|
}
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
return this.request(reqConf, data, callback);
|
52
|
-
});
|
41
|
+
let data = await this.prepare();
|
42
|
+
data = JSON.stringify(data);
|
43
|
+
const reqConf = this.requestConfig(options);
|
44
|
+
reqConf.method = options.method || 'POST';
|
45
|
+
reqConf.headers = Object.assign({
|
46
|
+
'Content-Type': 'application/json',
|
47
|
+
'Content-Length': Buffer.byteLength(data)
|
48
|
+
}, reqConf.headers || {});
|
49
|
+
return await this.request(reqConf, data, callback);
|
53
50
|
}
|
54
51
|
|
55
|
-
fetch(options, callback) {
|
52
|
+
async fetch(options, callback) {
|
56
53
|
if (typeof options === 'function' && arguments.length === 1) {
|
57
54
|
callback = options;
|
58
55
|
options = {};
|
@@ -61,10 +58,10 @@ module.exports = class Model extends EventEmitter {
|
|
61
58
|
}
|
62
59
|
const reqConf = this.requestConfig(options);
|
63
60
|
reqConf.method = options.method || 'GET';
|
64
|
-
return this.request(reqConf, callback);
|
61
|
+
return await this.request(reqConf, callback);
|
65
62
|
}
|
66
63
|
|
67
|
-
delete(options, callback) {
|
64
|
+
async delete(options, callback) {
|
68
65
|
if (typeof options === 'function' && arguments.length === 1) {
|
69
66
|
callback = options;
|
70
67
|
options = {};
|
@@ -73,7 +70,7 @@ module.exports = class Model extends EventEmitter {
|
|
73
70
|
}
|
74
71
|
const reqConf = this.requestConfig(options);
|
75
72
|
reqConf.method = options.method || 'DELETE';
|
76
|
-
return this.request(reqConf, callback);
|
73
|
+
return await this.request(reqConf, callback);
|
77
74
|
}
|
78
75
|
|
79
76
|
requestConfig(options) {
|
@@ -86,7 +83,7 @@ module.exports = class Model extends EventEmitter {
|
|
86
83
|
});
|
87
84
|
}
|
88
85
|
|
89
|
-
request(originalSettings, body, callback) {
|
86
|
+
async request(originalSettings, body, callback) {
|
90
87
|
if (typeof body === 'function' && arguments.length === 2) {
|
91
88
|
callback = body;
|
92
89
|
body = undefined;
|
@@ -94,96 +91,114 @@ module.exports = class Model extends EventEmitter {
|
|
94
91
|
|
95
92
|
let settings = Object.assign({}, originalSettings);
|
96
93
|
settings.timeout = settings.timeout || this.options.timeout;
|
97
|
-
settings
|
98
|
-
settings
|
99
|
-
|
100
|
-
settings = _.omit(settings, urlKeys, 'data', 'url');
|
94
|
+
settings = axiosSetting(settings, body);
|
95
|
+
settings = _.omit(settings, urlKeys);
|
101
96
|
this.emit('sync', originalSettings);
|
102
97
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
98
|
+
try {
|
99
|
+
const authData = await this.auth();
|
100
|
+
let authVal = authData;
|
101
|
+
if (typeof authVal === 'string') {
|
102
|
+
const [user, ...rest] = authVal.split(':');
|
103
|
+
authVal = {
|
104
|
+
user,
|
105
|
+
pass: rest.join(':'),
|
110
106
|
sendImmediately: true
|
111
107
|
};
|
112
108
|
}
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
const _callback = (err, data, statusCode) => {
|
120
|
-
if (timeoutTimer) {
|
121
|
-
clearTimeout(timeoutTimer);
|
122
|
-
timeoutTimer = null;
|
123
|
-
}
|
109
|
+
if (authVal) {
|
110
|
+
settings.headers = {
|
111
|
+
...settings.headers,
|
112
|
+
Authorization: `Bearer ${authVal.bearer}`
|
113
|
+
};
|
114
|
+
}
|
124
115
|
|
125
|
-
|
126
|
-
|
116
|
+
const startTime = process.hrtime();
|
117
|
+
let timeoutTimer;
|
127
118
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
}
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
119
|
+
if (timeoutTimer) {
|
120
|
+
clearTimeout(timeoutTimer);
|
121
|
+
timeoutTimer = null;
|
122
|
+
}
|
123
|
+
|
124
|
+
const data = await new Promise((resolve, reject) => {
|
125
|
+
const _callback = (err, responseData, statusCode) => {
|
126
|
+
if (timeoutTimer) {
|
127
|
+
clearTimeout(timeoutTimer);
|
128
|
+
timeoutTimer = null;
|
129
|
+
}
|
130
|
+
|
131
|
+
const endTime = process.hrtime();
|
132
|
+
const responseTime = timeDiff(startTime, endTime);
|
133
|
+
if (err) {
|
134
|
+
this.emit('fail', err, responseData, originalSettings, statusCode, responseTime);
|
135
|
+
reject(err);
|
136
|
+
} else {
|
137
|
+
this.emit('success', responseData, originalSettings, statusCode, responseTime);
|
138
|
+
resolve(responseData);
|
139
|
+
}
|
140
|
+
};
|
141
|
+
|
142
|
+
this._request(settings)
|
143
|
+
.then(response => {
|
144
|
+
return this.handleResponse(response)
|
145
|
+
.then(responseData => _callback(null, responseData, response.status))
|
146
|
+
.catch(error => {
|
151
147
|
error.headers = response.headers;
|
152
|
-
|
153
|
-
|
154
|
-
|
148
|
+
_callback(error, null, response.status);
|
149
|
+
});
|
150
|
+
})
|
151
|
+
.catch(err => {
|
152
|
+
if (err.code === 'ETIMEDOUT' || err.code === 'ESOCKETTIMEDOUT') {
|
153
|
+
err.message = 'Connection timed out';
|
154
|
+
err.status = 504;
|
155
|
+
}
|
156
|
+
err.status = err.status || 503;
|
157
|
+
return _callback(err, null, err.status);
|
155
158
|
});
|
156
|
-
});
|
157
159
|
});
|
158
160
|
|
159
|
-
|
160
|
-
|
161
|
+
if (typeof callback === 'function') {
|
162
|
+
callback(null, data);
|
163
|
+
}
|
164
|
+
return data;
|
165
|
+
} catch (error) {
|
166
|
+
if (typeof callback === 'function') {
|
167
|
+
callback(error);
|
168
|
+
}
|
169
|
+
return error;
|
161
170
|
}
|
162
|
-
return promise;
|
163
171
|
}
|
164
172
|
|
165
|
-
handleResponse(response
|
166
|
-
let data =
|
173
|
+
async handleResponse(response) {
|
174
|
+
let data = null;
|
167
175
|
try {
|
168
|
-
|
176
|
+
if (typeof response.data === 'object') {
|
177
|
+
data = response.data;
|
178
|
+
} else if (typeof response.data === 'string' && response.data.trim() !== '') {
|
179
|
+
data = JSON.parse(response.data);
|
180
|
+
} else {
|
181
|
+
data = {};
|
182
|
+
}
|
169
183
|
} catch (err) {
|
170
|
-
err.
|
171
|
-
err.
|
172
|
-
|
184
|
+
err.message = 'Failed to parse response data';
|
185
|
+
err.status = response.status;
|
186
|
+
err.body = response.data;
|
187
|
+
throw err;
|
173
188
|
}
|
174
|
-
return this.parseResponse(response.
|
189
|
+
return await this.parseResponse(response.status, data);
|
175
190
|
}
|
176
191
|
|
177
|
-
parseResponse(statusCode, data
|
192
|
+
async parseResponse(statusCode, data) {
|
178
193
|
if (statusCode < 400) {
|
179
194
|
try {
|
180
|
-
data = this.parse(data);
|
181
|
-
|
195
|
+
data = await this.parse(data);
|
196
|
+
return data;
|
182
197
|
} catch (err) {
|
183
|
-
|
198
|
+
throw err;
|
184
199
|
}
|
185
200
|
} else {
|
186
|
-
|
201
|
+
throw this.parseError(statusCode, data);
|
187
202
|
}
|
188
203
|
}
|
189
204
|
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "hof",
|
3
3
|
"description": "A bootstrap for HOF projects",
|
4
|
-
"version": "22.0.0-timeout-warning-beta.
|
4
|
+
"version": "22.0.0-timeout-warning-beta.3",
|
5
5
|
"license": "MIT",
|
6
6
|
"main": "index.js",
|
7
7
|
"author": "HomeOffice",
|
@@ -21,13 +21,13 @@
|
|
21
21
|
"url": "https://github.com/UKHomeOfficeForms/hof/issues"
|
22
22
|
},
|
23
23
|
"scripts": {
|
24
|
-
"test": "yarn run unit && yarn run test:
|
24
|
+
"test": "yarn run unit && yarn run test:jest && yarn run test:functional && yarn run test:client && yarn run test:lint",
|
25
25
|
"unit": "LOG_LEVEL=error nyc _mocha \"test/**/*.spec.js\" \"sandbox/test/**/*.spec.js\"",
|
26
26
|
"unit:nocov": "LOG_LEVEL=error mocha \"test/**/*.spec.js\" \"sandbox/test/**/*.spec.js\"",
|
27
27
|
"test:lint": "eslint . --config ./node_modules/eslint-config-hof/default.js",
|
28
28
|
"test:functional": "funkie mocha ./test/functional-tests --timeout 20000 --exit",
|
29
29
|
"test:client": "karma start test/frontend/toolkit/karma.conf.js",
|
30
|
-
"test:
|
30
|
+
"test:jest": "jest test/frontend/jest",
|
31
31
|
"test:acceptance": "TAGS=\"${TAGS:=@feature}\" yarn run test:cucumber",
|
32
32
|
"test:acceptance_browser": "ACCEPTANCE_WITH_BROWSER=true TAGS=\"${TAGS:=@feature}\" yarn run test:cucumber",
|
33
33
|
"test:cucumber": "cucumber-js -f @cucumber/pretty-formatter \"sandbox/test/_features/**/*.feature\" --require sandbox/test/_features/test.setup.js --require \"sandbox/test/_features/step_definitions/**/*.js\" --tags $TAGS",
|
@@ -36,6 +36,7 @@
|
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
38
|
"aliasify": "^2.1.0",
|
39
|
+
"axios": "^1.5.1",
|
39
40
|
"bluebird": "^3.7.2",
|
40
41
|
"body-parser": "^1.15.1",
|
41
42
|
"browserify": "^17.0.0",
|
@@ -83,7 +84,6 @@
|
|
83
84
|
"notifications-node-client": "^6.0.0",
|
84
85
|
"redis": "^3.1.2",
|
85
86
|
"reqres": "^3.0.1",
|
86
|
-
"request": "^2.79.0",
|
87
87
|
"rimraf": "^3.0.2",
|
88
88
|
"sass": "^1.56.2",
|
89
89
|
"serve-static": "^1.14.1",
|
@@ -286,7 +286,6 @@ var skipToMain = require('./skip-to-main');
|
|
286
286
|
var cookie = require('./govuk-cookies');
|
287
287
|
var cookieSettings = require('./cookieSettings');
|
288
288
|
var sessionDialog = require('./session-timeout-dialog');
|
289
|
-
GOVUK.sessionDialog.init();
|
290
289
|
|
291
290
|
toolkit.detailsSummary();
|
292
291
|
|
@@ -341,7 +340,7 @@ window.GOVUK.sessionDialog = {
|
|
341
340
|
},
|
342
341
|
|
343
342
|
isDialogOpen: function () {
|
344
|
-
return window.GOVUK.sessionDialog.el.open;
|
343
|
+
return window.GOVUK.sessionDialog.el && window.GOVUK.sessionDialog.el.open;
|
345
344
|
},
|
346
345
|
|
347
346
|
isConfigured: function () {
|
@@ -358,6 +357,8 @@ window.GOVUK.sessionDialog = {
|
|
358
357
|
window.GOVUK.sessionDialog.saveLastFocusedEl();
|
359
358
|
window.GOVUK.sessionDialog.makePageContentInert();
|
360
359
|
window.GOVUK.sessionDialog.el.showModal();
|
360
|
+
window.GOVUK.sessionDialog.el.open = true;
|
361
|
+
console.log(window.GOVUK.sessionDialog.el)
|
361
362
|
}
|
362
363
|
},
|
363
364
|
|
@@ -365,6 +366,8 @@ window.GOVUK.sessionDialog = {
|
|
365
366
|
if (window.GOVUK.sessionDialog.isDialogOpen()) {
|
366
367
|
$('html, body').removeClass(window.GOVUK.sessionDialog.dialogIsOpenClass);
|
367
368
|
window.GOVUK.sessionDialog.el.close();
|
369
|
+
window.GOVUK.sessionDialog.el.open = false;
|
370
|
+
console.log(window.GOVUK.sessionDialog.el)
|
368
371
|
window.GOVUK.sessionDialog.setFocusOnLastFocusedEl();
|
369
372
|
window.GOVUK.sessionDialog.removeInertFromPageContent();
|
370
373
|
window.GOVUK.sessionDialog.refreshSession();
|
@@ -430,7 +433,7 @@ window.GOVUK.sessionDialog = {
|
|
430
433
|
/* Array of scales as words */
|
431
434
|
const scales = ['', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quatttuor-decillion', 'quindecillion', 'sexdecillion', 'septen-decillion', 'octodecillion', 'novemdecillion', 'vigintillion', 'centillion'];
|
432
435
|
|
433
|
-
/* Split user
|
436
|
+
/* Split user argument into 3 digit chunks from right to left */
|
434
437
|
start = string.length;
|
435
438
|
const chunks = [];
|
436
439
|
while (start > 0) {
|
@@ -632,6 +635,7 @@ window.GOVUK.sessionDialog = {
|
|
632
635
|
}
|
633
636
|
}
|
634
637
|
};
|
638
|
+
window.GOVUK.sessionDialog.init();
|
635
639
|
|
636
640
|
},{"jquery":14}],5:[function(require,module,exports){
|
637
641
|
const skipToMain = function () {
|