hof 21.0.0 → 21.0.1-beta-payload-too-large
Sign up to get free protection for your applications and to get access to all the features.
- package/.nyc_output/1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41.json +1 -0
- package/.nyc_output/processinfo/1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/CHANGELOG.md +0 -5
- package/lib/settings.js +3 -2
- package/model/apis/html-to-pdf-converter.js +8 -10
- package/model/index.js +87 -102
- package/package.json +2 -2
- package/sandbox/public/css/app.css +6 -241
- package/sandbox/public/js/bundle.js +28151 -39208
- package/.nyc_output/39365c14-40b7-4634-b733-940b72a11984.json +0 -1
- package/.nyc_output/processinfo/39365c14-40b7-4634-b733-940b72a11984.json +0 -1
- package/model/apis/axios-settings.js +0 -21
@@ -0,0 +1 @@
|
|
1
|
+
{"parent":null,"pid":40488,"argv":["/opt/homebrew/Cellar/node@20/20.9.0/bin/node","/Users/temitopeayoku/Repos/HOF/hof/node_modules/.bin/_mocha","test/**/*.spec.js","sandbox/test/**/*.spec.js"],"execArgv":[],"cwd":"/Users/temitopeayoku/Repos/HOF/hof","time":1712051425836,"ppid":40486,"coverageFilename":"/Users/temitopeayoku/Repos/HOF/hof/.nyc_output/1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41.json","externalId":"","uuid":"1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41","files":["/Users/temitopeayoku/Repos/HOF/hof/model/index.js","/Users/temitopeayoku/Repos/HOF/hof/components/index.js","/Users/temitopeayoku/Repos/HOF/hof/components/address-lookup/index.js","/Users/temitopeayoku/Repos/HOF/hof/components/address-lookup/default-model.js","/Users/temitopeayoku/Repos/HOF/hof/components/address-lookup/defaults.js","/Users/temitopeayoku/Repos/HOF/hof/components/clear-session/index.js","/Users/temitopeayoku/Repos/HOF/hof/components/combine-and-loop-fields/index.js","/Users/temitopeayoku/Repos/HOF/hof/components/date/index.js","/Users/temitopeayoku/Repos/HOF/hof/components/date/fields.js","/Users/temitopeayoku/Repos/HOF/hof/components/emailer/index.js","/Users/temitopeayoku/Repos/HOF/hof/components/emailer/email-service.js","/Users/temitopeayoku/Repos/HOF/hof/components/emailer/emailer.js","/Users/temitopeayoku/Repos/HOF/hof/components/emailer/transports/index.js","/Users/temitopeayoku/Repos/HOF/hof/components/emailer/transports/smtp.js","/Users/temitopeayoku/Repos/HOF/hof/components/emailer/transports/ses.js","/Users/temitopeayoku/Repos/HOF/hof/components/emailer/transports/stub.js","/Users/temitopeayoku/Repos/HOF/hof/components/emailer/transports/debug.js","/Users/temitopeayoku/Repos/HOF/hof/components/homeoffice-countries/index.js","/Users/temitopeayoku/Repos/HOF/hof/config/component-defaults.js","/Users/temitopeayoku/Repos/HOF/hof/components/notify/index.js","/Users/temitopeayoku/Repos/HOF/hof/components/notify/notify.js","/Users/temitopeayoku/Repos/HOF/hof/components/summary/index.js","/Users/temitopeayoku/Repos/HOF/hof/config/rate-limits.js","/Users/temitopeayoku/Repos/HOF/hof/middleware/rate-limiter.js","/Users/temitopeayoku/Repos/HOF/hof/config/hof-defaults.js","/Users/temitopeayoku/Repos/HOF/hof/controller/base-controller.js","/Users/temitopeayoku/Repos/HOF/hof/controller/formatting/index.js","/Users/temitopeayoku/Repos/HOF/hof/controller/validation/index.js","/Users/temitopeayoku/Repos/HOF/hof/controller/validation/validators.js","/Users/temitopeayoku/Repos/HOF/hof/controller/validation/email.js","/Users/temitopeayoku/Repos/HOF/hof/controller/validation-error.js","/Users/temitopeayoku/Repos/HOF/hof/utilities/index.js","/Users/temitopeayoku/Repos/HOF/hof/utilities/autofill/index.js","/Users/temitopeayoku/Repos/HOF/hof/utilities/autofill/inputs.js","/Users/temitopeayoku/Repos/HOF/hof/utilities/test-data/index.js","/Users/temitopeayoku/Repos/HOF/hof/utilities/countries.js","/Users/temitopeayoku/Repos/HOF/hof/utilities/helpers/index.js","/Users/temitopeayoku/Repos/HOF/hof/utilities/reqres/index.js","/Users/temitopeayoku/Repos/HOF/hof/config/sanitisation-rules.js","/Users/temitopeayoku/Repos/HOF/hof/controller/formatting/formatters.js","/Users/temitopeayoku/Repos/HOF/hof/controller/index.js","/Users/temitopeayoku/Repos/HOF/hof/controller/behaviour-session.js","/Users/temitopeayoku/Repos/HOF/hof/controller/behaviour-hooks.js","/Users/temitopeayoku/Repos/HOF/hof/controller/controller.js","/Users/temitopeayoku/Repos/HOF/hof/sandbox/apps/sandbox/behaviours/country-select.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/template-mixins/mixins/index.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/template-mixins/mixins/template-mixins.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/template-mixins/mixins/render.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/template-mixins/mixins/helpers.js","/Users/temitopeayoku/Repos/HOF/hof/index.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/index.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/govuk-template/index.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/govuk-template/build/index.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/govuk-template/build/config.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/template-partials/index.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/template-partials/translations/index.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/themes/index.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/themes/gov-uk/index.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/index.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/assets/javascript/helpers.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/assets/javascript/form-focus.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/assets/javascript/progressive-reveal.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/assets/javascript/validation.js","/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/assets/javascript/character-count.js","/Users/temitopeayoku/Repos/HOF/hof/middleware/index.js","/Users/temitopeayoku/Repos/HOF/hof/middleware/cookies.js","/Users/temitopeayoku/Repos/HOF/hof/middleware/errors.js","/Users/temitopeayoku/Repos/HOF/hof/middleware/not-found.js","/Users/temitopeayoku/Repos/HOF/hof/middleware/deep-translate.js","/Users/temitopeayoku/Repos/HOF/hof/lib/markdown.js","/Users/temitopeayoku/Repos/HOF/hof/lib/router.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/index.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/behaviours/index.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/behaviours/complete.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/util/constants.js","/Users/temitopeayoku/Repos/HOF/hof/lib/helpers.js","/Users/temitopeayoku/Repos/HOF/hof/lib/health.js","/Users/temitopeayoku/Repos/HOF/hof/lib/serve-static.js","/Users/temitopeayoku/Repos/HOF/hof/lib/ga-tag.js","/Users/temitopeayoku/Repos/HOF/hof/lib/sessions.js","/Users/temitopeayoku/Repos/HOF/hof/lib/settings.js","/Users/temitopeayoku/Repos/HOF/hof/lib/logger.js","/Users/temitopeayoku/Repos/HOF/hof/build/index.js","/Users/temitopeayoku/Repos/HOF/hof/config/builder-defaults.js","/Users/temitopeayoku/Repos/HOF/hof/transpiler/index.js","/Users/temitopeayoku/Repos/HOF/hof/transpiler/lib/compile.js","/Users/temitopeayoku/Repos/HOF/hof/transpiler/lib/build.js","/Users/temitopeayoku/Repos/HOF/hof/transpiler/lib/expand-dirs.js","/Users/temitopeayoku/Repos/HOF/hof/transpiler/lib/aggregate.js","/Users/temitopeayoku/Repos/HOF/hof/transpiler/lib/write-files.js","/Users/temitopeayoku/Repos/HOF/hof/model/apis/index.js","/Users/temitopeayoku/Repos/HOF/hof/model/apis/html-to-pdf-converter.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/model.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/back-links.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/util/helpers.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/check-complete.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/check-progress.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/check-session.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/csrf.js","/Users/temitopeayoku/Repos/HOF/hof/sandbox/test/_unit/example_app/sections/summary-data-sections.spec.js","/Users/temitopeayoku/Repos/HOF/hof/sandbox/apps/sandbox/sections/summary-data-sections.js","/Users/temitopeayoku/Repos/HOF/hof/sandbox/apps/sandbox/lib/staticAppealStages.js","/Users/temitopeayoku/Repos/HOF/hof/sandbox/apps/sandbox/fields.js","/Users/temitopeayoku/Repos/HOF/hof/sandbox/test/helpers/utilities.js","/Users/temitopeayoku/Repos/HOF/hof/sandbox/apps/sandbox/behaviours/international-number.js","/Users/temitopeayoku/Repos/HOF/hof/lib/encryption.js","/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/session.js","/Users/temitopeayoku/Repos/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":{"1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41":{"parent":null,"children":[]}},"files":{"/Users/temitopeayoku/Repos/HOF/hof/model/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/address-lookup/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/address-lookup/default-model.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/address-lookup/defaults.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/clear-session/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/combine-and-loop-fields/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/date/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/date/fields.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/emailer/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/emailer/email-service.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/emailer/emailer.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/emailer/transports/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/emailer/transports/smtp.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/emailer/transports/ses.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/emailer/transports/stub.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/emailer/transports/debug.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/homeoffice-countries/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/config/component-defaults.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/notify/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/notify/notify.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/components/summary/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/config/rate-limits.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/middleware/rate-limiter.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/config/hof-defaults.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/base-controller.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/formatting/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/validation/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/validation/validators.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/validation/email.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/validation-error.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/utilities/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/utilities/autofill/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/utilities/autofill/inputs.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/utilities/test-data/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/utilities/countries.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/utilities/helpers/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/utilities/reqres/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/config/sanitisation-rules.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/formatting/formatters.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/behaviour-session.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/behaviour-hooks.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/controller/controller.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/sandbox/apps/sandbox/behaviours/country-select.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/template-mixins/mixins/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/template-mixins/mixins/template-mixins.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/template-mixins/mixins/render.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/template-mixins/mixins/helpers.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/govuk-template/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/govuk-template/build/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/govuk-template/build/config.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/template-partials/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/template-partials/translations/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/themes/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/themes/gov-uk/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/assets/javascript/helpers.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/assets/javascript/form-focus.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/assets/javascript/progressive-reveal.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/assets/javascript/validation.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/frontend/toolkit/assets/javascript/character-count.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/middleware/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/middleware/cookies.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/middleware/errors.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/middleware/not-found.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/middleware/deep-translate.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/lib/markdown.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/lib/router.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/behaviours/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/behaviours/complete.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/util/constants.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/lib/helpers.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/lib/health.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/lib/serve-static.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/lib/ga-tag.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/lib/sessions.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/lib/settings.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/lib/logger.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/build/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/config/builder-defaults.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/transpiler/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/transpiler/lib/compile.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/transpiler/lib/build.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/transpiler/lib/expand-dirs.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/transpiler/lib/aggregate.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/transpiler/lib/write-files.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/model/apis/index.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/model/apis/html-to-pdf-converter.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/model.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/back-links.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/util/helpers.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/check-complete.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/check-progress.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/check-session.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/csrf.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/sandbox/test/_unit/example_app/sections/summary-data-sections.spec.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/sandbox/apps/sandbox/sections/summary-data-sections.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/sandbox/apps/sandbox/lib/staticAppealStages.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/sandbox/apps/sandbox/fields.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/sandbox/test/helpers/utilities.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/sandbox/apps/sandbox/behaviours/international-number.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/lib/encryption.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/session.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"],"/Users/temitopeayoku/Repos/HOF/hof/wizard/middleware/session-model.js":["1e54a5ac-ed7a-4c0d-9b5f-5675cd8a7d41"]},"externalIds":{}}
|
package/CHANGELOG.md
CHANGED
@@ -1,8 +1,3 @@
|
|
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
|
-
|
6
1
|
## 2024-04-24, Version 20.5.0 (Stable), @mislam987
|
7
2
|
* Add hint property to checkboxes to align with govuk design guidelines
|
8
3
|
|
package/lib/settings.js
CHANGED
@@ -52,14 +52,15 @@ module.exports = async (app, config) => {
|
|
52
52
|
|
53
53
|
app.set('views', viewPaths);
|
54
54
|
app.use(expressPartialTemplates(app));
|
55
|
-
|
55
|
+
|
56
56
|
app.engine(viewEngine, hoganExpressStrict);
|
57
57
|
|
58
58
|
app.use(bodyParser.urlencoded({
|
59
|
+
limit: '50mb',
|
59
60
|
extended: true
|
60
61
|
}));
|
61
62
|
|
62
|
-
app.use(bodyParser.json());
|
63
|
+
app.use(bodyParser.json({limit: '50mb'}));
|
63
64
|
|
64
65
|
app.use((req, res, next) => {
|
65
66
|
res.locals.baseUrl = req.baseUrl;
|
@@ -9,7 +9,6 @@ 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';
|
13
12
|
return settings;
|
14
13
|
}
|
15
14
|
|
@@ -18,18 +17,17 @@ module.exports = class PDFModel extends Model {
|
|
18
17
|
}
|
19
18
|
|
20
19
|
handleResponse(response, callback) {
|
21
|
-
if (isPdf(Buffer.from(response.
|
22
|
-
return this.parseResponse(response.
|
20
|
+
if (isPdf(Buffer.from(response.body))) {
|
21
|
+
return this.parseResponse(response.statusCode, response.body, callback);
|
23
22
|
}
|
24
23
|
const err = new Error();
|
25
|
-
|
26
|
-
|
27
|
-
err.
|
28
|
-
err.message = response.statusText;
|
24
|
+
if (parseInt(response.statusCode, 10) === 400) {
|
25
|
+
err.title = response.body.code;
|
26
|
+
err.message = response.body.message;
|
29
27
|
} else {
|
30
|
-
err.body = response.
|
28
|
+
err.body = response.body;
|
31
29
|
}
|
32
|
-
err.status = response.
|
33
|
-
return callback(err, null, response.
|
30
|
+
err.status = response.statusCode;
|
31
|
+
return callback(err, null, response.statusCode);
|
34
32
|
}
|
35
33
|
};
|
package/model/index.js
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
const _ = require('lodash');
|
5
|
-
const
|
5
|
+
const request = require('request');
|
6
6
|
const url = require('url');
|
7
7
|
const EventEmitter = require('events').EventEmitter;
|
8
|
-
|
8
|
+
|
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 = request;
|
31
31
|
}
|
32
32
|
|
33
|
-
|
33
|
+
save(options, callback) {
|
34
34
|
if (typeof options === 'function' && arguments.length === 1) {
|
35
35
|
callback = options;
|
36
36
|
options = {};
|
@@ -38,18 +38,21 @@ module.exports = class Model extends EventEmitter {
|
|
38
38
|
options = {};
|
39
39
|
}
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
41
|
+
return this.prepare().then(data => {
|
42
|
+
data = JSON.stringify(data);
|
43
|
+
const reqConf = this.requestConfig(options);
|
44
|
+
reqConf.method = options.method || 'POST';
|
45
|
+
|
46
|
+
reqConf.headers = Object.assign({
|
47
|
+
'Content-Type': 'application/json',
|
48
|
+
'Content-Length': Buffer.byteLength(data)
|
49
|
+
}, reqConf.headers || {});
|
50
|
+
|
51
|
+
return this.request(reqConf, data, callback);
|
52
|
+
});
|
50
53
|
}
|
51
54
|
|
52
|
-
|
55
|
+
fetch(options, callback) {
|
53
56
|
if (typeof options === 'function' && arguments.length === 1) {
|
54
57
|
callback = options;
|
55
58
|
options = {};
|
@@ -58,10 +61,10 @@ module.exports = class Model extends EventEmitter {
|
|
58
61
|
}
|
59
62
|
const reqConf = this.requestConfig(options);
|
60
63
|
reqConf.method = options.method || 'GET';
|
61
|
-
return
|
64
|
+
return this.request(reqConf, callback);
|
62
65
|
}
|
63
66
|
|
64
|
-
|
67
|
+
delete(options, callback) {
|
65
68
|
if (typeof options === 'function' && arguments.length === 1) {
|
66
69
|
callback = options;
|
67
70
|
options = {};
|
@@ -70,7 +73,7 @@ module.exports = class Model extends EventEmitter {
|
|
70
73
|
}
|
71
74
|
const reqConf = this.requestConfig(options);
|
72
75
|
reqConf.method = options.method || 'DELETE';
|
73
|
-
return
|
76
|
+
return this.request(reqConf, callback);
|
74
77
|
}
|
75
78
|
|
76
79
|
requestConfig(options) {
|
@@ -83,7 +86,7 @@ module.exports = class Model extends EventEmitter {
|
|
83
86
|
});
|
84
87
|
}
|
85
88
|
|
86
|
-
|
89
|
+
request(originalSettings, body, callback) {
|
87
90
|
if (typeof body === 'function' && arguments.length === 2) {
|
88
91
|
callback = body;
|
89
92
|
body = undefined;
|
@@ -91,114 +94,96 @@ module.exports = class Model extends EventEmitter {
|
|
91
94
|
|
92
95
|
let settings = Object.assign({}, originalSettings);
|
93
96
|
settings.timeout = settings.timeout || this.options.timeout;
|
94
|
-
settings =
|
95
|
-
settings =
|
97
|
+
settings.uri = settings.uri || settings.url || url.format(settings);
|
98
|
+
settings.body = settings.body || body || settings.data;
|
99
|
+
|
100
|
+
settings = _.omit(settings, urlKeys, 'data', 'url');
|
96
101
|
this.emit('sync', originalSettings);
|
97
102
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
pass: rest.join(':'),
|
103
|
+
const promise = Promise.resolve().then(() => this.auth()).then(authData => {
|
104
|
+
settings.auth = authData;
|
105
|
+
if (typeof settings.auth === 'string') {
|
106
|
+
const auth = settings.auth.split(':');
|
107
|
+
settings.auth = {
|
108
|
+
user: auth.shift(),
|
109
|
+
pass: auth.join(':'),
|
106
110
|
sendImmediately: true
|
107
111
|
};
|
108
112
|
}
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
clearTimeout(timeoutTimer);
|
121
|
-
timeoutTimer = null;
|
122
|
-
}
|
113
|
+
})
|
114
|
+
.then(() => {
|
115
|
+
const startTime = process.hrtime();
|
116
|
+
let timeoutTimer;
|
117
|
+
|
118
|
+
return new Promise((resolve, reject) => {
|
119
|
+
const _callback = (err, data, statusCode) => {
|
120
|
+
if (timeoutTimer) {
|
121
|
+
clearTimeout(timeoutTimer);
|
122
|
+
timeoutTimer = null;
|
123
|
+
}
|
123
124
|
|
124
|
-
|
125
|
-
|
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
|
-
};
|
125
|
+
const endTime = process.hrtime();
|
126
|
+
const responseTime = timeDiff(startTime, endTime);
|
141
127
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
.
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
128
|
+
if (err) {
|
129
|
+
this.emit('fail', err, data, originalSettings, statusCode, responseTime);
|
130
|
+
} else {
|
131
|
+
this.emit('success', data, originalSettings, statusCode, responseTime);
|
132
|
+
}
|
133
|
+
if (err) {
|
134
|
+
reject(err);
|
135
|
+
} else {
|
136
|
+
resolve(data);
|
137
|
+
}
|
138
|
+
};
|
139
|
+
|
140
|
+
this._request(settings, (err, response) => {
|
141
|
+
if (err) {
|
142
|
+
if (err.code === 'ETIMEDOUT' || err.code === 'ESOCKETTIMEDOUT') {
|
143
|
+
err.message = 'Connection timed out';
|
144
|
+
err.status = 504;
|
145
|
+
}
|
146
|
+
err.status = err.status || (response && response.statusCode) || 503;
|
147
|
+
return _callback(err, null, err.status);
|
155
148
|
}
|
156
|
-
|
157
|
-
|
149
|
+
return this.handleResponse(response, (error, data, status) => {
|
150
|
+
if (error) {
|
151
|
+
error.headers = response.headers;
|
152
|
+
}
|
153
|
+
_callback(error, data, status);
|
154
|
+
});
|
158
155
|
});
|
156
|
+
});
|
159
157
|
});
|
160
158
|
|
161
|
-
|
162
|
-
|
163
|
-
}
|
164
|
-
return data;
|
165
|
-
} catch (error) {
|
166
|
-
if (typeof callback === 'function') {
|
167
|
-
callback(error);
|
168
|
-
}
|
169
|
-
return error;
|
159
|
+
if (typeof callback === 'function') {
|
160
|
+
return promise.then(data => callback(null, data), callback);
|
170
161
|
}
|
162
|
+
return promise;
|
171
163
|
}
|
172
164
|
|
173
|
-
|
174
|
-
let data =
|
165
|
+
handleResponse(response, callback) {
|
166
|
+
let data = {};
|
175
167
|
try {
|
176
|
-
|
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
|
-
}
|
168
|
+
data = JSON.parse(response.body || '{}');
|
183
169
|
} catch (err) {
|
184
|
-
err.
|
185
|
-
err.
|
186
|
-
err
|
187
|
-
throw err;
|
170
|
+
err.status = response.statusCode;
|
171
|
+
err.body = response.body;
|
172
|
+
return callback(err, null, response.statusCode);
|
188
173
|
}
|
189
|
-
return
|
174
|
+
return this.parseResponse(response.statusCode, data, callback);
|
190
175
|
}
|
191
176
|
|
192
|
-
|
177
|
+
parseResponse(statusCode, data, callback) {
|
193
178
|
if (statusCode < 400) {
|
194
179
|
try {
|
195
|
-
data =
|
196
|
-
|
180
|
+
data = this.parse(data);
|
181
|
+
callback(null, data, statusCode);
|
197
182
|
} catch (err) {
|
198
|
-
|
183
|
+
callback(err, null, statusCode);
|
199
184
|
}
|
200
185
|
} else {
|
201
|
-
|
186
|
+
callback(this.parseError(statusCode, data), data, statusCode);
|
202
187
|
}
|
203
188
|
}
|
204
189
|
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "hof",
|
3
3
|
"description": "A bootstrap for HOF projects",
|
4
|
-
"version": "21.0.
|
4
|
+
"version": "21.0.1-beta-payload-too-large",
|
5
5
|
"license": "MIT",
|
6
6
|
"main": "index.js",
|
7
7
|
"author": "HomeOffice",
|
@@ -36,7 +36,6 @@
|
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
38
|
"aliasify": "^2.1.0",
|
39
|
-
"axios": "^1.5.1",
|
40
39
|
"bluebird": "^3.7.2",
|
41
40
|
"body-parser": "^1.15.1",
|
42
41
|
"browserify": "^17.0.0",
|
@@ -83,6 +82,7 @@
|
|
83
82
|
"notifications-node-client": "^6.0.0",
|
84
83
|
"redis": "^3.1.2",
|
85
84
|
"reqres": "^3.0.1",
|
85
|
+
"request": "^2.79.0",
|
86
86
|
"rimraf": "^3.0.2",
|
87
87
|
"sass": "^1.56.2",
|
88
88
|
"serve-static": "^1.14.1",
|