diff --git a/react-app/.env.development b/react-app/.env.development index f9a5c12..f88464a 100644 --- a/react-app/.env.development +++ b/react-app/.env.development @@ -1,4 +1,22 @@ +# For usage with Create React App, env variables needs to be prefixed with `REACT_APP_` + +# Server namespace REACT_APP_HOST_URI=http://localhost:4502 -REACT_APP_GRAPHQL_ENDPOINT=/content/graphql/global/endpoint.json -# Use Authorization when connecting to an AEM Author environment -REACT_APP_AUTHORIZATION=admin:admin +REACT_APP_GRAPHQL_ENDPOINT=/content/_cq_graphql/wknd-shared/endpoint.json + +# Dev modes, use proxy during development (helps avoids potential CORS issues) +REACT_APP_USE_PROXY=false + +#AUTH (Choose one method) +# Authentication methods: 'service-token', 'dev-token', 'basic' or leave blank to use no authentication +REACT_APP_AUTH_METHOD=basic + +# For Bearer auth, use DEV token (dev-token) from Cloud console +REACT_APP_DEV_TOKEN=dev-token + +# For Service toke auth, provide path to service token file (download file from Cloud console) +REACT_APP_SERVICE_TOKEN=auth/service-token.json + +# For Basic auth, use AEM ['user','pass'] pair (eg for Local AEM Author instance) +REACT_APP_BASIC_AUTH_USER=admin +REACT_APP_BASIC_AUTH_PASS=admin \ No newline at end of file diff --git a/react-app/package-lock.json b/react-app/package-lock.json index d7a1584..62add40 100644 --- a/react-app/package-lock.json +++ b/react-app/package-lock.json @@ -4,6 +4,19 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@adobe/aem-headless-client-js": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@adobe/aem-headless-client-js/-/aem-headless-client-js-3.1.1.tgz", + "integrity": "sha512-JENNHD/giRPpbbB/im2ijBP7mtCasOZsX5AeX3lYUAyakgdE8B5rPjL1DzooFPi7PUbIlDDIeLwu8GWSzICHrA==", + "requires": { + "@adobe/aio-lib-core-errors": "^3.0.1" + } + }, + "@adobe/aio-lib-core-errors": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@adobe/aio-lib-core-errors/-/aio-lib-core-errors-3.0.1.tgz", + "integrity": "sha512-o3FQFdrC+cCT+S1tjpGsWvshUfdiW57V+BOhf1YrQ/56ioEzYQvVEP2lTBX/tcyye6m+qWVGqAhkHFNq7oPLWg==" + }, "@babel/code-frame": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", @@ -4085,11 +4098,6 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==" }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -4204,11 +4212,6 @@ "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=" }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" - }, "ansi-colors": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", @@ -4271,15 +4274,6 @@ "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -4322,11 +4316,6 @@ "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=" }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" - }, "array-flatten": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", @@ -4446,11 +4435,6 @@ "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" }, - "async-foreach": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", - "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=" - }, "async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", @@ -4987,14 +4971,6 @@ "file-uri-to-path": "1.0.0" } }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "requires": { - "inherits": "~2.0.0" - } - }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -5336,22 +5312,6 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - }, - "dependencies": { - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - } - } - }, "caniuse-api": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", @@ -5583,11 +5543,6 @@ "q": "^1.1.2" } }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -5736,11 +5691,6 @@ "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, "constants-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", @@ -6171,14 +6121,6 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.4.tgz", "integrity": "sha512-xc8DUsCLmjvCfoD7LTGE0ou2MIWLx0K9RCZwSHMOdynqRsP4MtUcLeqh1HcQ2dInwDTqn+3CE0/FZh1et+p4jA==" }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "requires": { - "array-find-index": "^1.0.1" - } - }, "cyclist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", @@ -6375,11 +6317,6 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -7394,7 +7331,7 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==" }, "fast-deep-equal": { "version": "3.1.1", @@ -8187,17 +8124,6 @@ } } }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -8208,62 +8134,6 @@ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "gaze": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", - "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", - "requires": { - "globule": "^1.0.0" - } - }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -8279,11 +8149,6 @@ "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==" }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" - }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -8392,16 +8257,6 @@ } } }, - "globule": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz", - "integrity": "sha512-7IDTQTIu2xzXkT+6mlluidnWo+BypnbSoEVVQCGfzqnl5Ik8d3e1d4wycb8Rj9tWW+Z39uPWsdlquqiqPCd/pA==", - "requires": { - "glob": "~7.1.1", - "lodash": "~4.17.10", - "minimatch": "~3.0.2" - } - }, "graceful-fs": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", @@ -8491,11 +8346,6 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -8566,19 +8416,6 @@ "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==" }, - "history": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", - "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", - "requires": { - "@babel/runtime": "^7.1.2", - "loose-envify": "^1.2.0", - "resolve-pathname": "^3.0.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0", - "value-equal": "^1.0.1" - } - }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -8589,14 +8426,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "requires": { - "react-is": "^16.7.0" - } - }, "hosted-git-info": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", @@ -8871,6 +8700,11 @@ "resolved": "https://registry.npmjs.org/immer/-/immer-1.10.0.tgz", "integrity": "sha512-O3sR1/opvCDGLEVcvrGTMtLac8GJ5IwZC4puPrLuRj3l7ICKvkmA0vGuU9OW8mV9WIBRnaxp5GJh9IEAaNOoYg==" }, + "immutable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz", + "integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==" + }, "import-cwd": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz", @@ -8910,11 +8744,6 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, - "in-publish": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz", - "integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ==" - }, "indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", @@ -9196,11 +9025,6 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, - "is-finite": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", - "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==" - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -9325,11 +9149,6 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -9925,11 +9744,6 @@ "supports-color": "^6.1.0" } }, - "js-base64": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", - "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==" - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -10293,15 +10107,6 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, "lower-case": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.1.tgz", @@ -10352,11 +10157,6 @@ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" - }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -10394,129 +10194,6 @@ "readable-stream": "^2.0.1" } }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "requires": { - "repeating": "^2.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "^1.2.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "requires": { - "get-stdin": "^4.0.1" - } - } - } - }, "merge-deep": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.2.tgz", @@ -10623,15 +10300,6 @@ "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" }, - "mini-create-react-context": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz", - "integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==", - "requires": { - "@babel/runtime": "^7.12.1", - "tiny-warning": "^1.0.3" - } - }, "mini-css-extract-plugin": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz", @@ -10810,7 +10478,8 @@ "nan": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "optional": true }, "nanomatch": { "version": "1.2.13", @@ -10876,32 +10545,6 @@ "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" }, - "node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", - "requires": { - "fstream": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^2.0.0", - "which": "1" - }, - "dependencies": { - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" - } - } - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -10979,98 +10622,6 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.64.tgz", "integrity": "sha512-Iec8O9166/x2HRMJyLLLWkd0sFFLrFNy+Xf+JQfSQsdBJzPcHpNl3JQ9gD4j+aJxmCa25jNsIbM4bmACtSbkSg==" }, - "node-sass": { - "version": "4.14.1", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", - "integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", - "requires": { - "async-foreach": "^0.1.3", - "chalk": "^1.1.1", - "cross-spawn": "^3.0.0", - "gaze": "^1.0.0", - "get-stdin": "^4.0.1", - "glob": "^7.0.3", - "in-publish": "^2.0.0", - "lodash": "^4.17.15", - "meow": "^3.7.0", - "mkdirp": "^0.5.1", - "nan": "^2.13.2", - "node-gyp": "^3.8.0", - "npmlog": "^4.0.0", - "request": "^2.88.0", - "sass-graph": "2.2.5", - "stdout-stream": "^1.4.0", - "true-case-path": "^1.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "cross-spawn": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", - "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - } - } - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "requires": { - "abbrev": "1" - } - }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -11116,17 +10667,6 @@ "path-key": "^2.0.0" } }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, "nth-check": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", @@ -11140,11 +10680,6 @@ "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=" }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, "nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", @@ -11489,25 +11024,11 @@ "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=" }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, "p-each-series": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz", @@ -12826,11 +12347,6 @@ "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -13215,52 +12731,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, - "react-router": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", - "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", - "requires": { - "@babel/runtime": "^7.1.2", - "history": "^4.9.0", - "hoist-non-react-statics": "^3.1.0", - "loose-envify": "^1.3.1", - "mini-create-react-context": "^0.4.0", - "path-to-regexp": "^1.7.0", - "prop-types": "^15.6.2", - "react-is": "^16.6.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "requires": { - "isarray": "0.0.1" - } - } - } - }, - "react-router-dom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz", - "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", - "requires": { - "@babel/runtime": "^7.1.2", - "history": "^4.9.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.6.2", - "react-router": "5.2.0", - "tiny-invariant": "^1.0.2", - "tiny-warning": "^1.0.0" - } - }, "react-scripts": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-3.4.3.tgz", @@ -13642,14 +13112,6 @@ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "requires": { - "is-finite": "^1.0.0" - } - }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -13745,11 +13207,6 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" }, - "resolve-pathname": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", - "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" - }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -13931,15 +13388,14 @@ "resolved": "https://registry.npmjs.org/sanitize.css/-/sanitize.css-10.0.0.tgz", "integrity": "sha512-vTxrZz4dX5W86M6oVWVdOVe72ZiPs41Oi7Z6Km4W5Turyz28mrXSJhhEBZoRtzJWIv3833WKVwLSDWWkEfupMg==" }, - "sass-graph": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.5.tgz", - "integrity": "sha512-VFWDAHOe6mRuT4mZRd4eKE+d8Uedrk6Xnh7Sh9b4NGufQLQjOrvf/MQoOdx+0s92L89FeyUUNfU597j/3uNpag==", + "sass": { + "version": "1.52.3", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.52.3.tgz", + "integrity": "sha512-LNNPJ9lafx+j1ArtA7GyEJm9eawXN8KlA1+5dF6IZyoONg1Tyo/g+muOsENWJH/2Q1FHbbV4UwliU0cXMa/VIA==", "requires": { - "glob": "^7.0.0", - "lodash": "^4.0.0", - "scss-tokenizer": "^0.2.3", - "yargs": "^13.3.2" + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" } }, "sass-loader": { @@ -14016,25 +13472,6 @@ "ajv-keywords": "^3.5.2" } }, - "scss-tokenizer": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", - "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", - "requires": { - "js-base64": "^2.1.8", - "source-map": "^0.4.2" - }, - "dependencies": { - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, "select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", @@ -14479,6 +13916,11 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" + }, "source-map-resolve": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", @@ -14660,14 +14102,6 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, - "stdout-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", - "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", - "requires": { - "readable-stream": "^2.0.1" - } - }, "stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", @@ -15121,16 +14555,6 @@ "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==" }, - "tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", - "requires": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" - } - }, "terser": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", @@ -15340,16 +14764,6 @@ "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=" }, - "tiny-invariant": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz", - "integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==" - }, - "tiny-warning": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", - "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" - }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -15423,19 +14837,6 @@ "punycode": "^2.1.0" } }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" - }, - "true-case-path": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", - "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", - "requires": { - "glob": "^7.1.2" - } - }, "ts-pnp": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/ts-pnp/-/ts-pnp-1.1.6.tgz", @@ -15734,11 +15135,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "value-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", - "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" - }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -16269,38 +15665,6 @@ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "requires": { - "string-width": "^1.0.2 || 2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/react-app/package.json b/react-app/package.json index d8b84f3..b136652 100644 --- a/react-app/package.json +++ b/react-app/package.json @@ -1,38 +1,38 @@ { - "name": "aem-guides-wknd-app", - "version": "0.1.0", - "private": true, - "dependencies": { - "@testing-library/jest-dom": "^4.2.4", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^7.1.2", - "http-proxy-middleware": "^1.0.6", - "normalize-scss": "^7.0.1", - "react": "^16.13.1", - "react-dom": "^16.13.1", - "react-router-dom": "^5.2.0", - "react-scripts": "3.4.3", - "sass": "^1.42.1" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } + "name": "aem-guides-wknd-app", + "version": "0.1.0", + "private": true, + "dependencies": { + "@adobe/aem-headless-client-js": "^3.1.1", + "@testing-library/jest-dom": "^4.2.4", + "@testing-library/react": "^9.3.2", + "@testing-library/user-event": "^7.1.2", + "http-proxy-middleware": "^1.0.6", + "normalize-scss": "^7.0.1", + "react": "^16.13.1", + "react-dom": "^16.13.1", + "react-scripts": "3.4.3", + "sass": "^1.42.1" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } } diff --git a/react-app/src/App.js b/react-app/src/App.js index 0f7613d..b51ac5c 100644 --- a/react-app/src/App.js +++ b/react-app/src/App.js @@ -7,44 +7,54 @@ accordance with the terms of the Adobe license agreement accompanying it. */ import React from 'react'; -import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; -import logo from './images/wknd-logo-dk.svg'; -import Adventures from './components/Adventures'; -import AdventureDetail from './components/AdventureDetail'; +import TestPersistQueries from './components/TestPersistQueries'; import './App.scss'; +const { AEMHeadless } = require('@adobe/aem-headless-client-js'); + +// environment variable for confguring the headless client +const { + REACT_APP_HOST_URI, + REACT_APP_GRAPHQL_ENDPOINT, + REACT_APP_USE_PROXY, + REACT_APP_AUTH_METHOD, + REACT_APP_DEV_TOKEN, + REACT_APP_BASIC_AUTH_USER, + REACT_APP_BASIC_AUTH_PASS +} = process.env; function App() { - return ( - -
-
- WKND Logo -
-
- - - - - - - - -
-
- ); + // In a production application the serviceURL should be set to the production AEM Publish environment + // In development the serviceURL can be set to '/' which will be a relative proxy is used (see ../authMethods.js) to avoid CORS issues + const serviceURL = REACT_APP_USE_PROXY === 'true' ? '/' : REACT_APP_HOST_URI; + + const aemHeadlessClient = new AEMHeadless({ + serviceURL: serviceURL, + endpoint: REACT_APP_GRAPHQL_ENDPOINT, + auth: setAuthorization() + }); + + return ( +
+
+

AEM GraphQL React Test Harness

+
+ +
+ ); } -/*** - * Displays a grid of current adventures - */ -function Home() { - return ( -
-

Current Adventures

- -
- ); +// Get authorization based on environment variables +// authorization is not needed when connecting to Publish environments +const setAuthorization = function () { + if (REACT_APP_AUTH_METHOD === 'basic') { + return [REACT_APP_BASIC_AUTH_USER, REACT_APP_BASIC_AUTH_PASS]; + } else if (REACT_APP_AUTH_METHOD === 'dev-token') { + return REACT_APP_DEV_TOKEN; + } else { + // no authentication set + return; + } } diff --git a/react-app/src/App.scss b/react-app/src/App.scss index 0273f69..1931482 100644 --- a/react-app/src/App.scss +++ b/react-app/src/App.scss @@ -6,6 +6,7 @@ NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms of the Adobe license agreement accompanying it. */ +@use "sass:math"; /* Normalize */ @import '~normalize-scss/sass/normalize'; @import './styles/variables'; @@ -37,7 +38,7 @@ h3, .h3 { font-family: $font-family-serif; font-weight: $font-weight-normal; margin-top: $line-height-computed; -margin-bottom: ($line-height-computed / 2); +margin-bottom: math.div($line-height-computed, 2); } h4, .h4, @@ -73,7 +74,7 @@ h1 u, h2 u, h3 u { // ------------------------- p { -margin: 0 0 ($line-height-computed / 2); +margin: 0 0 math.div($line-height-computed , 2); font-size: $font-size-base; line-height: $line-height-base + 0.75; text-align: justify; diff --git a/react-app/src/App.test.js b/react-app/src/App.test.js index e834bd0..8afef48 100644 --- a/react-app/src/App.test.js +++ b/react-app/src/App.test.js @@ -7,11 +7,11 @@ accordance with the terms of the Adobe license agreement accompanying it. */ import React from 'react'; -import { render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import App from './App'; test('renders learn react link', () => { - const { getByText } = render(); - const linkElement = getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); + render(); + const logoElement = screen.getByAltText(/WKND Logo/i); + expect(logoElement).toBeInTheDocument(); }); diff --git a/react-app/src/api/useGraphQL.js b/react-app/src/api/useGraphQL.js deleted file mode 100644 index 1d15550..0000000 --- a/react-app/src/api/useGraphQL.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2020 Adobe -All Rights Reserved. - -NOTICE: Adobe permits you to use, modify, and distribute this file in -accordance with the terms of the Adobe license agreement accompanying -it. -*/ -import {useState, useEffect} from 'react'; - -const { NODE_ENV, REACT_APP_HOST_URI, REACT_APP_GRAPHQL_ENDPOINT, REACT_APP_AUTHORIZATION } = process.env; - -/* - Custom React Hook to perform a GraphQL query - query paramter is a GraphQL query - environment variable REACT_APP_GRAPHQL_ENDPOINT is used to point to endpoint in AEM -*/ -function useGraphQL(query) { - - let [data, setData] = useState(null); - let [errorMessage, setErrors] = useState(null); - - useEffect(() => { - window.fetch( - getRequestUrl(), - getRequestOptions(query) - ).then(response => response.json()) - .then(({data, errors}) => { - //If there are errors in the response set the error message - if(errors) { - setErrors(mapErrors(errors)); - } - //Otherwise if data in the response set the data as the results - if(data) { - setData(data); - } - }) - .catch((error) => { - setErrors(error); - }); - }, [query]); - - return {data, errorMessage} -} - -/** - * Get the request uri based on environment variables - */ -function getRequestUrl() { - - if(NODE_ENV === 'development') { - // always use a relative url during development so the proxy is used at setupProxy.js - return REACT_APP_GRAPHQL_ENDPOINT; - } - - // use an absolute URL for everything else - return REACT_APP_HOST_URI + REACT_APP_GRAPHQL_ENDPOINT; -} - -/** - * Set the GraphQL endpoint based on environment variables and passed in query - * @param {*} query - */ -function getRequestOptions(query) { - - // headers and include authorization if authorization set - let httpHeaders = new Headers(); - httpHeaders.append('Content-Type', 'application/json'); - if(REACT_APP_AUTHORIZATION) { - httpHeaders.append('Authorization', 'Basic ' + btoa(REACT_APP_AUTHORIZATION)) - } - - return { - method: 'POST', - headers: httpHeaders, - body: JSON.stringify({query}), - }; -} - -/** - * concatenate error messages into a single string. - * @param {*} errors - */ -function mapErrors(errors) { - return errors.map((error) => error.message).join(","); -} -export default useGraphQL \ No newline at end of file diff --git a/react-app/src/components/AdventureDetail.js b/react-app/src/components/AdventureDetail.js deleted file mode 100644 index 41ef63b..0000000 --- a/react-app/src/components/AdventureDetail.js +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright 2020 Adobe -All Rights Reserved. - -NOTICE: Adobe permits you to use, modify, and distribute this file in -accordance with the terms of the Adobe license agreement accompanying -it. -*/ -import React from 'react'; -import { withRouter, Link} from "react-router-dom"; -import useGraphQL from '../api/useGraphQL'; -import backIcon from '../images/icon-close.svg'; -import Error from './Error'; -import Loading from './Loading'; -import './AdventureDetail.scss'; - - -function AdventureDetail(props) { - - //parse the content fragment from the url - const contentFragmentPath = props.location.pathname.substring(props.match.url.length); - - //Use a custom React Hook to execute the GraphQL query - const { data, errorMessage } = useGraphQL(adventureDetailQuery(contentFragmentPath)); - - //If there is an error with the GraphQL query - if(errorMessage) return ; - - //If data is null then return a loading icon... - if(!data) return ; - - //Set adventureData variable based on graphQL response - let adventureData = data.adventureByPath.item; - - //Must have title, path, and image - if(!adventureData || !adventureData._path || !adventureData.adventureTitle || !adventureData.adventurePrimaryImage ) { - return ( -
- - Return - - -
- ); - } - - return ( -
- - Return - -

{adventureData.adventureTitle}

-
-
Activity
-
{adventureData.adventureActivity}
-
Type
-
{adventureData.adventureType}
-
Trip Length
-
{adventureData.adventureTripLength}
-
Group Size
-
{adventureData.adventureGroupSize}
-
Difficulty
-
{adventureData.adventureDifficulty}
-
Price
-
{adventureData.adventurePrice}
-
-
- {adventureData.adventureTitle}/ -
-

Itinerary

-
-
- -
- -
- ); -} - -function adventureDetailQuery(_path) { - return `{ - adventureByPath (_path: "${_path}") { - item { - _path - adventureTitle - adventureActivity - adventureType - adventurePrice - adventureTripLength - adventureGroupSize - adventureDifficulty - adventurePrice - adventurePrimaryImage { - ... on ImageRef { - _path - mimeType - width - height - } - } - adventureDescription { - html - } - adventureItinerary { - html - } - } - } - } - `; -} - -function Contributer(props) { - - if(!props) { - return null; - } - let pictureReference = null; - if(props.pictureReference) { - pictureReference = {props.fullName} - } - - return ( -
-
- {pictureReference} -

{props.fullName}

-

{props.occupation}

-
); -} - - -export default withRouter(AdventureDetail); diff --git a/react-app/src/components/AdventureDetail.scss b/react-app/src/components/AdventureDetail.scss deleted file mode 100644 index 778b6c2..0000000 --- a/react-app/src/components/AdventureDetail.scss +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright 2020 Adobe -All Rights Reserved. - -NOTICE: Adobe permits you to use, modify, and distribute this file in -accordance with the terms of the Adobe license agreement accompanying -it. -*/ -@import '../styles/variables'; - -.adventure-detail { - float: left; -} - -.adventure-detail-close-button { - width: 24px; - float: right; - margin: 1em; - } - - .adventure-detail-title { - margin-bottom: 1em; - } - - .adventure-detail-info { - width: 25%; - float: left; - } - - .adventure-detail-info-label, .adventure-detail-info-description { - border-left: 5px solid $gray-light; - } - - .adventure-detail-info-label { - padding: 10px 0px 5px 20px; - text-transform: uppercase; - } - - .adventure-detail-info-description { - margin-bottom: 20px; - padding: 5px 0px 10px 20px; - font-weight: bold; - text-transform: uppercase; - } - - .adventure-detail-content { - width: 75%; - float:left; - } - - .adventure-detail-content h2 { - margin: 15px 0px 0px 0px; - padding: 0px; - } - - .adventure-detail-primaryimage { - width: 100%; - } - - .adventure-detail-itinerary h2{ - font-family: $font-family-base; - font-weight: bold; - font-size: $font-size-large; - } - -@media only screen and (max-width: $mobile-breakpoint) { - .adventure-detail-info { - display: none; - } - - .adventure-detail-content { - width: 100%; - } -} - -/* Contributer Styles */ -$contributor-image-size: 60px; - -.contributor { - width: 100%; - float: left; - - &-image { - width: $contributor-image-size; - height: $contributor-image-size; - border-radius: $contributor-image-size / 2; - object-fit: cover; - float: left; - } - - &-name { - margin-left: $contributor-image-size + 20px; - font-family: $font-family-serif; - } - - &-occupation { - margin-left: $contributor-image-size + 20px; - margin-top: 0em; - } - - &-separator { - border-width: 1px solid $gray-light; - margin-top: 2em; - margin-bottom: 2em; - } - -} - \ No newline at end of file diff --git a/react-app/src/components/Adventures.js b/react-app/src/components/Adventures.js deleted file mode 100644 index 57a8c55..0000000 --- a/react-app/src/components/Adventures.js +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright 2020 Adobe -All Rights Reserved. - -NOTICE: Adobe permits you to use, modify, and distribute this file in -accordance with the terms of the Adobe license agreement accompanying -it. -*/ -import React, {useState} from 'react'; -import {Link} from 'react-router-dom'; -import useGraphQL from '../api/useGraphQL'; -import Error from './Error'; -import Loading from './Loading'; -import './Adventures.scss'; - - -function Adventures() { - - //Use React Hooks to set the initial GraphQL query to a variable named `query` - const [query, setQuery] = useState(allAdventuresQuery); - //Use a custom React Hook to execute the GraphQL query - const { data, errorMessage } = useGraphQL(query); - - //If there is an error with the GraphQL query - if(errorMessage) return ; - - //If data is null then return a loading state... - if(!data) return ; - - return ( -
-
    - { - //Iterate over the returned data items from the query - data.adventureList.items.map((adventure, index) => { - return ( - - ); - }) - } -
-
- ); -} - -// Render individual Adventure item -function AdventureItem(props) { - - //Must have title, path, and image - if(!props || !props._path || !props.adventureTitle || !props.adventurePrimaryImage ) { - return null; - } - return ( -
  • - - {props.adventureTitle}/ - -
    -
    {props.adventureTripLength}
    -
    {props.adventurePrice}
    -
    -
    {props.adventureTitle}
    -
  • - ); -} - -/** - * Query for all Adventures - */ -const allAdventuresQuery = ` - { - adventureList { - items { - _path - adventureTitle - adventurePrice - adventureTripLength - adventurePrimaryImage { - ... on ImageRef { - _path - mimeType - width - height - } - } - } - } - } -`; - -/** - * Returns a query for Adventures filtered by activity - */ -function filterQuery(activity) { - return ` - { - adventureList (filter: { - adventureActivity: { - _expressions: [ - { - value: "${activity}" - } - ] - } - }){ - items { - _path - adventureTitle - adventurePrice - adventureTripLength - adventurePrimaryImage { - ... on ImageRef { - _path - mimeType - width - height - } - } - } - } - } - `; -} - - -export default Adventures; \ No newline at end of file diff --git a/react-app/src/components/Adventures.scss b/react-app/src/components/Adventures.scss deleted file mode 100644 index 4c6095d..0000000 --- a/react-app/src/components/Adventures.scss +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2020 Adobe -All Rights Reserved. - -NOTICE: Adobe permits you to use, modify, and distribute this file in -accordance with the terms of the Adobe license agreement accompanying -it. -*/ -@import '../styles/variables'; - -$adventureItemWidth: 240px; -$adventureItemHeight: 200px; - -$adventureItemWidthMobile: 300px; -$adventureItemHeightMobile: 250px; - -.adventure-items { - display: flex; - list-style: none; - margin-top: 1em; - padding: 0; - width: 100%; - flex-wrap: wrap; - align-items: flex-start; - justify-content: normal; -} - -.adventure-item { - flex-basis: $adventureItemWidth; - margin: 0 0 2rem; - padding-right: 14px; -} - -.adventure-item-image { - width: 100%; - height: $adventureItemHeight; - object-fit: cover; - object-position: center; - overflow: hidden; - margin-bottom: 7px; -} - - .adventure-item-title { - font-weight: bold; - font-size: $font-size-medium; - margin-bottom: 5px; - text-transform: uppercase; - } - - .adventure-item-length-price { - width: 100%; - height: 20px; - } - - .adventure-item-length { - float: left; - } - - .adventure-item-price { - float: right; - } - - @media only screen and (max-width: $tablet-breakpoint) { - .adventure-items { - justify-content: normal; - } - .adventure-item { - flex-basis: $adventureItemWidthMobile; - } - .adventure-item-image { - height: $adventureItemHeightMobile; - } - } - - @media only screen and (max-width: $mobile-breakpoint) { - .adventure-items { - justify-content: center; - } - } \ No newline at end of file diff --git a/react-app/src/components/TestPersistQueries.js b/react-app/src/components/TestPersistQueries.js new file mode 100644 index 0000000..e3915fe --- /dev/null +++ b/react-app/src/components/TestPersistQueries.js @@ -0,0 +1,100 @@ +/* +Copyright 2020 Adobe +All Rights Reserved. + +NOTICE: Adobe permits you to use, modify, and distribute this file in +accordance with the terms of the Adobe license agreement accompanying +it. +*/ +import React, { useState } from 'react'; +import Error from './Error'; +import Loading from './Loading'; + + +function TestPersistQueries({ aemHeadlessClient }) { + + const [data, setData] = useState(); + const [errors, setErrors] = useState(); + const [isLoading, setIsLoading] = useState(false); + const [persistedQueryPath, setPersistedQueryPath] = useState('wknd-shared/adventure-by-slug'); + const [queryVariableString, setQueryVariableString] = useState('{"slug": "bali-surf-camp"}'); + + // handle execution of test query + const handleSubmit = async (evt) => { + + try { + setIsLoading(true); + console.log(queryVariableString); + // Pass query variables as JSON object to the AEM Headless client + const queryVariables = queryVariableString && queryVariableString !== '' ? JSON.parse(queryVariableString) : undefined; + // AEM GraphQL queries are asynchronous, either await their return or use Promise-based .then(..) { ... } syntax + const response = await aemHeadlessClient.runPersistedQuery(persistedQueryPath, queryVariables); + + setIsLoading(false); + + // The GraphQL data is stored on the response's data field + setData(response.data); + // Any errors are stored on the response's error field + setErrors(response.errors ? mapErrors(response.errors) : undefined); + } catch (e) { + console.error(e); + setErrors(e); + } + + } + + return ( +
    +
    + + +
    + + setQueryVariableString(e.target.value)}> +
    + +
    + +
    + + ); +} + +/** + * Render the AEM response + * @param {*} response + * @returns + */ +function RenderResponse({ data, errors, isLoading }) { + //If response is null then return a loading state... + if (isLoading) return ; + + //If there is an error with the GraphQL query + if (errors) return ; + + if (!data) return

    Test a query by filling out the form above

    ; + + return ( +
    +
    {JSON.stringify(data, null, 2)}
    +
    + ); + +} + +/** + * concatenate error messages into a single string. + * @param {*} errors + */ +export const mapErrors = function (errors) { + return errors.map((error) => error.message).join(","); +} + +export default TestPersistQueries; diff --git a/react-app/src/images/icon-close.svg b/react-app/src/images/icon-close.svg deleted file mode 100644 index 640689b..0000000 --- a/react-app/src/images/icon-close.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/react-app/src/images/wknd-logo-dk.svg b/react-app/src/images/wknd-logo-dk.svg deleted file mode 100644 index a7317af..0000000 --- a/react-app/src/images/wknd-logo-dk.svg +++ /dev/null @@ -1 +0,0 @@ -Asset 2 \ No newline at end of file diff --git a/react-app/src/proxy/authMethods.js b/react-app/src/proxy/authMethods.js new file mode 100644 index 0000000..0861aa9 --- /dev/null +++ b/react-app/src/proxy/authMethods.js @@ -0,0 +1,17 @@ +/* +Copyright 2021 Adobe +All Rights Reserved. + +NOTICE: Adobe permits you to use, modify, and distribute this file in +accordance with the terms of the Adobe license agreement accompanying +it. +*/ +const SERVICE_TOKEN = 'service-token'; +const DEV_TOKEN = 'dev-token'; +const BASIC = 'basic'; + +module.exports = { + SERVICE_TOKEN, + DEV_TOKEN, + BASIC +}; diff --git a/react-app/src/proxy/setupProxy.auth.basic.js b/react-app/src/proxy/setupProxy.auth.basic.js new file mode 100644 index 0000000..c841677 --- /dev/null +++ b/react-app/src/proxy/setupProxy.auth.basic.js @@ -0,0 +1,28 @@ +/* +Copyright 2020 Adobe +All Rights Reserved. + +NOTICE: Adobe permits you to use, modify, and distribute this file in +accordance with the terms of the Adobe license agreement accompanying +it. +*/ +const { createProxyMiddleware } = require('http-proxy-middleware'); +const { REACT_APP_HOST_URI, REACT_APP_BASIC_AUTH_USER, REACT_APP_BASIC_AUTH_PASS } = process.env; + +/* + Set up a proxy with AEM for local development + In a production enviroment this proxy should be set up at the webserver level or absolute URLs should be used. +*/ + +module.exports = function(app) { + app.use( + ['/content', '/graphql'], + createProxyMiddleware({ + target: REACT_APP_HOST_URI, + changeOrigin: true, + // pass in credentials when developing against an Author environment + auth: `${REACT_APP_BASIC_AUTH_USER}:${REACT_APP_BASIC_AUTH_PASS}` + }) + ); +}; + diff --git a/react-app/src/proxy/setupProxy.auth.dev-token.js b/react-app/src/proxy/setupProxy.auth.dev-token.js new file mode 100644 index 0000000..6643d2a --- /dev/null +++ b/react-app/src/proxy/setupProxy.auth.dev-token.js @@ -0,0 +1,31 @@ +/* +Copyright 2020 Adobe +All Rights Reserved. + +NOTICE: Adobe permits you to use, modify, and distribute this file in +accordance with the terms of the Adobe license agreement accompanying +it. +*/ +const { createProxyMiddleware } = require('http-proxy-middleware'); +const { REACT_APP_HOST_URI, REACT_APP_DEV_TOKEN } = process.env; + +/* + Set up a proxy with AEM for local development + In a production enviroment this proxy should be set up at the webserver level or absolute URLs should be used. +*/ + +module.exports = function(app) { + app.use( + ['/content', '/graphql'], + createProxyMiddleware({ + target: REACT_APP_HOST_URI, + changeOrigin: true, + onProxyReq: (proxyReq, req, res) => { + if (REACT_APP_DEV_TOKEN) { + proxyReq.setHeader('Authorization', `Bearer ${REACT_APP_DEV_TOKEN}`); + } + } + }) + ); +}; + diff --git a/react-app/src/proxy/setupProxy.auth.none.js b/react-app/src/proxy/setupProxy.auth.none.js new file mode 100644 index 0000000..7244e22 --- /dev/null +++ b/react-app/src/proxy/setupProxy.auth.none.js @@ -0,0 +1,26 @@ +/* +Copyright 2020 Adobe +All Rights Reserved. + +NOTICE: Adobe permits you to use, modify, and distribute this file in +accordance with the terms of the Adobe license agreement accompanying +it. +*/ +const { createProxyMiddleware } = require('http-proxy-middleware'); +const {REACT_APP_HOST_URI } = process.env; + +/* + Set up a proxy with AEM for local development + In a production enviroment this proxy should be set up at the webserver level or absolute URLs should be used. +*/ + +module.exports = function(app) { + app.use( + ['/content', '/graphql'], + createProxyMiddleware({ + target: REACT_APP_HOST_URI, + changeOrigin: true + }) + ); +}; + diff --git a/react-app/src/proxy/setupProxy.auth.service-token.js b/react-app/src/proxy/setupProxy.auth.service-token.js new file mode 100644 index 0000000..919d19d --- /dev/null +++ b/react-app/src/proxy/setupProxy.auth.service-token.js @@ -0,0 +1,54 @@ +/* +Copyright 2020 Adobe +All Rights Reserved. + +NOTICE: Adobe permits you to use, modify, and distribute this file in +accordance with the terms of the Adobe license agreement accompanying +it. +*/ +const { createProxyMiddleware } = require('http-proxy-middleware'); +const session = require('express-session') +const { getToken } = require('@adobe/aem-headless-client-nodejs'); +const { REACT_APP_HOST_URI, REACT_APP_SERVICE_TOKEN } = process.env; + +/* + Set up a proxy with AEM for local development + In a production environment this proxy should be set up at the webserver level or absolute URLs should be used. +*/ + +module.exports = function(app) { + // Setup session + app.use(session({ + secret: 'MY_SECRET', + resave: false, + saveUninitialized: true + })) + app.use( + ['/content', '/graphql'], + function (req, res, next) { + if (!req.session.accessToken) { + getToken(REACT_APP_SERVICE_TOKEN) + .then(({ accessToken, expires }) => { + console.log('Token received', accessToken.length, expires) + if (accessToken) { + req.session.accessToken = accessToken + req.headers.authorization = `Bearer ${accessToken}` + } + next() + }) + .catch(e => { + console.error(e) + next() + }) + } else { + req.headers.authorization = `Bearer ${req.session.accessToken}` + next() + } + }, + createProxyMiddleware({ + target: REACT_APP_HOST_URI, + changeOrigin: true + }) + ); +}; + diff --git a/react-app/src/setupProxy.js b/react-app/src/setupProxy.js index b805c5e..70f3f70 100644 --- a/react-app/src/setupProxy.js +++ b/react-app/src/setupProxy.js @@ -6,22 +6,28 @@ NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms of the Adobe license agreement accompanying it. */ -const { createProxyMiddleware } = require('http-proxy-middleware'); -const {REACT_APP_HOST_URI, REACT_APP_AUTHORIZATION } = process.env; +const { SERVICE_TOKEN, DEV_TOKEN, BASIC } = require('./proxy/authMethods'); + +const proxy = (() => { + switch (process.env.REACT_APP_AUTH_METHOD) { + case SERVICE_TOKEN: + // Use Service token exchange for Cloud Env PROD + return require('./proxy/setupProxy.auth.service-token'); + case DEV_TOKEN: + // Use Dev token for local development with Cloud Env + return require('./proxy/setupProxy.auth.dev-token'); + case BASIC: + // Use user/pass for local development with Local Author Env + return require('./proxy/setupProxy.auth.basic'); + default: + // Auth not needed for local development with Local Publisher Env + return require('./proxy/setupProxy.auth.none'); + } +})(); /* Set up a proxy with AEM for local development - In a production enviroment this proxy should be set up at the webserver level or absolute URLs should be used. + In a production environment this proxy should be set up at the webserver level or absolute URLs should be used. */ -module.exports = function(app) { - app.use( - '/content', - createProxyMiddleware({ - target: REACT_APP_HOST_URI, - changeOrigin: true, - //pass in credentials when developing against an Author environment - auth: REACT_APP_AUTHORIZATION, - }) - ); -}; +module.exports = proxy; diff --git a/react-app/src/setupTests.js b/react-app/src/setupTests.js index 180dde1..f173ba5 100644 --- a/react-app/src/setupTests.js +++ b/react-app/src/setupTests.js @@ -11,3 +11,4 @@ it. // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom/extend-expect'; +process.env.REACT_APP_GRAPHQL_ENDPOINT = 'test'