@commercetools-frontend/application-shell 22.2.0 → 22.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{application-entry-point-362fa5d0.cjs.dev.js → application-entry-point-0c3254b0.cjs.dev.js} +10 -19
- package/dist/{application-entry-point-390ae225.cjs.prod.js → application-entry-point-2333abb6.cjs.prod.js} +10 -19
- package/dist/{application-entry-point-587966d5.esm.js → application-entry-point-a1dfe994.esm.js} +10 -19
- package/dist/{box-6b5be9a9.cjs.dev.js → box-686bc950.cjs.dev.js} +0 -2
- package/dist/{box-4395623b.esm.js → box-6ce924c9.esm.js} +0 -2
- package/dist/{box-8850277f.cjs.prod.js → box-e17daf6c.cjs.prod.js} +0 -2
- package/dist/{cart-a49faf67.esm.js → cart-3b156a46.esm.js} +0 -2
- package/dist/{cart-41f0b7bc.cjs.dev.js → cart-796beed7.cjs.dev.js} +0 -2
- package/dist/{cart-0698b97d.cjs.prod.js → cart-f2fc1baf.cjs.prod.js} +0 -2
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +5 -5
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +5 -5
- package/dist/commercetools-frontend-application-shell.esm.js +5 -5
- package/dist/{configure-apollo-249465d4.cjs.prod.js → configure-apollo-70d83707.cjs.prod.js} +64 -181
- package/dist/{configure-apollo-4d96823e.esm.js → configure-apollo-89ea99bf.esm.js} +64 -183
- package/dist/{configure-apollo-63948b67.cjs.dev.js → configure-apollo-de2b9aa2.cjs.dev.js} +64 -183
- package/dist/{connected-square-47233754.cjs.dev.js → connected-square-960e046b.cjs.prod.js} +0 -2
- package/dist/{connected-square-b2e25621.cjs.prod.js → connected-square-961eb5b6.cjs.dev.js} +0 -2
- package/dist/{connected-square-3cac6bd7.esm.js → connected-square-f34a98ff.esm.js} +0 -2
- package/dist/{constants-a3c2194a.cjs.prod.js → constants-902cf3f3.cjs.prod.js} +2 -1
- package/dist/{constants-940f343f.esm.js → constants-b962b73e.esm.js} +2 -1
- package/dist/{constants-b201d328.cjs.dev.js → constants-e51cdcc0.cjs.dev.js} +2 -1
- package/dist/declarations/src/components/app-bar/app-bar.d.ts +1 -1
- package/dist/declarations/src/components/application-entry-point/application-entry-point.d.ts +1 -1
- package/dist/declarations/src/components/application-loader/application-loader.d.ts +1 -1
- package/dist/declarations/src/components/application-shell/application-shell.d.ts +1 -1
- package/dist/declarations/src/components/application-shell/global-styles.d.ts +1 -1
- package/dist/declarations/src/components/application-shell-authenticated/application-shell-authenticated.d.ts +1 -1
- package/dist/declarations/src/components/application-shell-provider/application-shell-provider.d.ts +1 -2
- package/dist/declarations/src/components/application-shell-provider/utils.d.ts +2 -0
- package/dist/declarations/src/components/authenticated/am-i-logged-in.d.ts +1 -1
- package/dist/declarations/src/components/authenticated/authenticated.d.ts +1 -1
- package/dist/declarations/src/components/authenticated/oidc-callback-error-page.d.ts +1 -1
- package/dist/declarations/src/components/authenticated/oidc-callback.async.d.ts +1 -1
- package/dist/declarations/src/components/authenticated/oidc-callback.d.ts +1 -1
- package/dist/declarations/src/components/back-to-project/back-to-project.d.ts +1 -1
- package/dist/declarations/src/components/configure-intl-provider/configure-intl-provider.d.ts +1 -1
- package/dist/declarations/src/components/error-apologizer/error-apologizer.d.ts +1 -1
- package/dist/declarations/src/components/error-apologizer/index.d.ts +1 -1
- package/dist/declarations/src/components/error-boundary/error-boundary.d.ts +1 -1
- package/dist/declarations/src/components/fetch-project/fetch-project.d.ts +1 -1
- package/dist/declarations/src/components/fetch-user/fetch-user.d.ts +1 -1
- package/dist/declarations/src/components/inject-reducers/inject-reducers.d.ts +1 -1
- package/dist/declarations/src/components/locale-switcher/locale-switcher.d.ts +2 -2
- package/dist/declarations/src/components/navbar/index.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/box.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/cart.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/connected-square.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/gear.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/heart.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/list-with-search.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/paperclip.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/plugin.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/rocket.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/speedometer.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/star.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/tag-multi.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/tree-structure.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/user-filled.d.ts +1 -1
- package/dist/declarations/src/components/navbar/legacy-icons/world.d.ts +1 -1
- package/dist/declarations/src/components/navbar/loading-navbar.d.ts +1 -1
- package/dist/declarations/src/components/navbar/menu-items.d.ts +8 -8
- package/dist/declarations/src/components/navbar/navbar.d.ts +1 -1
- package/dist/declarations/src/components/project-container/index.d.ts +1 -1
- package/dist/declarations/src/components/project-container/project-container.d.ts +1 -1
- package/dist/declarations/src/components/project-data-locale/project-data-locale.d.ts +1 -1
- package/dist/declarations/src/components/project-expired/index.d.ts +1 -1
- package/dist/declarations/src/components/project-expired/project-expired.d.ts +1 -1
- package/dist/declarations/src/components/project-not-found/index.d.ts +1 -1
- package/dist/declarations/src/components/project-not-found/project-not-found.d.ts +1 -1
- package/dist/declarations/src/components/project-not-initialized/index.d.ts +1 -1
- package/dist/declarations/src/components/project-not-initialized/project-not-initialized.d.ts +1 -1
- package/dist/declarations/src/components/project-suspended/index.d.ts +1 -1
- package/dist/declarations/src/components/project-suspended/project-suspended.d.ts +1 -1
- package/dist/declarations/src/components/project-switcher/project-switcher.d.ts +3 -3
- package/dist/declarations/src/components/quick-access/butler/butler.d.ts +1 -1
- package/dist/declarations/src/components/quick-access/butler-command/butler-command.d.ts +1 -1
- package/dist/declarations/src/components/quick-access/index.d.ts +1 -1
- package/dist/declarations/src/components/quick-access/quick-access.d.ts +1 -1
- package/dist/declarations/src/components/redirect-to-login/index.d.ts +1 -1
- package/dist/declarations/src/components/redirect-to-login/redirect-to-login.d.ts +1 -1
- package/dist/declarations/src/components/redirect-to-logout/index.d.ts +1 -1
- package/dist/declarations/src/components/redirect-to-logout/redirect-to-logout.d.ts +1 -1
- package/dist/declarations/src/components/redirect-to-project-create/index.d.ts +1 -1
- package/dist/declarations/src/components/redirect-to-project-create/redirect-to-project-create.d.ts +1 -1
- package/dist/declarations/src/components/route-catch-all/index.d.ts +1 -1
- package/dist/declarations/src/components/route-catch-all/route-catch-all.d.ts +1 -1
- package/dist/declarations/src/components/service-page-project-switcher/service-page-project-switcher.d.ts +1 -1
- package/dist/declarations/src/components/setup-flop-flip-provider/setup-flop-flip-provider.d.ts +1 -1
- package/dist/declarations/src/components/suspended-route/suspended-route.d.ts +1 -1
- package/dist/declarations/src/components/theme-switcher/new-design-release-info-dialog.d.ts +1 -1
- package/dist/declarations/src/components/theme-switcher/theme-switcher.d.ts +1 -1
- package/dist/declarations/src/components/user-settings-menu/index.d.ts +1 -1
- package/dist/declarations/src/components/user-settings-menu/user-settings-menu.d.ts +3 -3
- package/dist/declarations/src/types/generated/settings.d.ts +89 -1151
- package/dist/{error-apologizer-57a2fb57.cjs.prod.js → error-apologizer-24ad0b88.cjs.prod.js} +0 -3
- package/dist/{error-apologizer-d0409fcb.esm.js → error-apologizer-55551c07.esm.js} +0 -3
- package/dist/{error-apologizer-d20ca326.cjs.dev.js → error-apologizer-a5c03978.cjs.dev.js} +0 -3
- package/dist/{gear-300dd24c.esm.js → gear-1f381738.esm.js} +0 -2
- package/dist/{gear-2890f7fb.cjs.prod.js → gear-9b394c43.cjs.prod.js} +0 -2
- package/dist/{gear-e8014c5a.cjs.dev.js → gear-ab1f6210.cjs.dev.js} +0 -2
- package/dist/{get-mc-origin-7968e04f.cjs.prod.js → get-mc-origin-8f7a578c.cjs.prod.js} +10 -16
- package/dist/{get-mc-origin-314b77a2.cjs.dev.js → get-mc-origin-a86dff20.cjs.dev.js} +10 -16
- package/dist/{get-mc-origin-5df60933.esm.js → get-mc-origin-fecfee07.esm.js} +10 -16
- package/dist/{heart-000a023d.cjs.prod.js → heart-a6e7ccf9.cjs.dev.js} +0 -2
- package/dist/{heart-dded66b4.esm.js → heart-be7c779b.esm.js} +0 -2
- package/dist/{heart-f21b7d39.cjs.dev.js → heart-ebfab4cd.cjs.prod.js} +0 -2
- package/dist/{index-2591875d.cjs.dev.js → index-02a17607.cjs.dev.js} +241 -473
- package/dist/{index-42ea4111.esm.js → index-667035b8.esm.js} +240 -472
- package/dist/{index-2302ee7f.cjs.prod.js → index-a03f4e81.cjs.prod.js} +237 -465
- package/dist/{list-with-search-a3302710.esm.js → list-with-search-3341bbf7.esm.js} +0 -2
- package/dist/{list-with-search-a5b72b33.cjs.prod.js → list-with-search-b5e9ae1b.cjs.dev.js} +0 -2
- package/dist/{list-with-search-ee796e9e.cjs.dev.js → list-with-search-e3ccba98.cjs.prod.js} +0 -2
- package/dist/{navbar-b56b7b35.cjs.prod.js → navbar-00a55ccf.cjs.prod.js} +55 -111
- package/dist/{navbar-70b7575c.cjs.dev.js → navbar-1b61993a.cjs.dev.js} +55 -111
- package/dist/{navbar-ef173893.esm.js → navbar-84dc97f9.esm.js} +55 -111
- package/dist/{new-design-release-info-dialog-629191c2.cjs.dev.js → new-design-release-info-dialog-57843832.cjs.dev.js} +0 -2
- package/dist/{new-design-release-info-dialog-879a4af8.cjs.prod.js → new-design-release-info-dialog-730137e2.cjs.prod.js} +0 -2
- package/dist/{new-design-release-info-dialog-6e19106c.esm.js → new-design-release-info-dialog-e2cd95fa.esm.js} +0 -2
- package/dist/{oidc-15d3a4c1.cjs.dev.js → oidc-4895bd80.cjs.dev.js} +13 -20
- package/dist/{oidc-callback-bcf67ab0.cjs.prod.js → oidc-callback-121ef6c1.cjs.prod.js} +12 -20
- package/dist/{oidc-callback-fd0c6ab8.esm.js → oidc-callback-cddf8bb4.esm.js} +12 -20
- package/dist/{oidc-callback-9538bece.cjs.dev.js → oidc-callback-e60075ab.cjs.dev.js} +12 -20
- package/dist/{oidc-77115492.esm.js → oidc-d7f0409a.esm.js} +13 -20
- package/dist/{oidc-6c79100b.cjs.prod.js → oidc-da4ccc69.cjs.prod.js} +13 -20
- package/dist/{paperclip-23d1e69c.cjs.prod.js → paperclip-6f0b6ae5.cjs.prod.js} +0 -2
- package/dist/{paperclip-a61112e8.esm.js → paperclip-c76aec52.esm.js} +0 -2
- package/dist/{paperclip-d653c134.cjs.dev.js → paperclip-ec55e4a0.cjs.dev.js} +0 -2
- package/dist/{plugin-0ee6aee4.cjs.dev.js → plugin-16c01245.cjs.dev.js} +0 -2
- package/dist/{plugin-3d353a5b.esm.js → plugin-279f88cd.esm.js} +0 -2
- package/dist/{plugin-7e57f237.cjs.prod.js → plugin-f199ed20.cjs.prod.js} +0 -2
- package/dist/{project-container-56d0c955.cjs.dev.js → project-container-51e70095.cjs.dev.js} +21 -46
- package/dist/{project-container-8c617e3c.esm.js → project-container-98c2a789.esm.js} +21 -46
- package/dist/{project-container-32a1d5c4.cjs.prod.js → project-container-e7f950b0.cjs.prod.js} +21 -45
- package/dist/{project-expired-1cc0ccbb.cjs.prod.js → project-expired-1cd4843f.cjs.prod.js} +6 -11
- package/dist/{project-expired-73713e7e.esm.js → project-expired-513a8320.esm.js} +6 -11
- package/dist/{project-expired-2a72b968.cjs.dev.js → project-expired-fd3efa19.cjs.dev.js} +6 -11
- package/dist/{project-not-found-a3b0d2f0.esm.js → project-not-found-8bab15e7.esm.js} +6 -9
- package/dist/{project-not-found-6b42e6c0.cjs.prod.js → project-not-found-9f21b30c.cjs.prod.js} +6 -9
- package/dist/{project-not-found-a09d8a13.cjs.dev.js → project-not-found-e5eb5b7e.cjs.dev.js} +6 -9
- package/dist/{project-not-initialized-dbaa28e7.cjs.dev.js → project-not-initialized-3cdb8692.cjs.dev.js} +6 -11
- package/dist/{project-not-initialized-dfca89f5.cjs.prod.js → project-not-initialized-a1a8d9dc.cjs.prod.js} +6 -11
- package/dist/{project-not-initialized-2542a33a.esm.js → project-not-initialized-a8562fd3.esm.js} +6 -11
- package/dist/{project-suspended-b78011e8.cjs.dev.js → project-suspended-79c67f38.cjs.dev.js} +6 -10
- package/dist/{project-suspended-231a0961.cjs.prod.js → project-suspended-8a558cb8.cjs.prod.js} +6 -10
- package/dist/{project-suspended-ccaaa1d7.esm.js → project-suspended-e0fb960a.esm.js} +6 -10
- package/dist/{quick-access-a2d18d3b.cjs.dev.js → quick-access-0fb30eee.cjs.dev.js} +124 -194
- package/dist/{quick-access-3dabce21.esm.js → quick-access-8c7919d2.esm.js} +124 -194
- package/dist/{quick-access-54ce94b5.cjs.prod.js → quick-access-ff6fee75.cjs.prod.js} +123 -191
- package/dist/{redirect-to-login-3fecfdc9.esm.js → redirect-to-login-02167259.esm.js} +14 -18
- package/dist/{redirect-to-login-f8ba63e5.cjs.prod.js → redirect-to-login-3c2a1258.cjs.prod.js} +14 -18
- package/dist/{redirect-to-login-fa9676c1.cjs.dev.js → redirect-to-login-73396807.cjs.dev.js} +14 -18
- package/dist/{redirect-to-logout-2d96cea9.cjs.prod.js → redirect-to-logout-838758f3.cjs.prod.js} +7 -12
- package/dist/{redirect-to-logout-764c003b.esm.js → redirect-to-logout-b5c8fdbf.esm.js} +7 -12
- package/dist/{redirect-to-logout-b0f5c48e.cjs.dev.js → redirect-to-logout-be3e139d.cjs.dev.js} +7 -12
- package/dist/{redirect-to-project-create-048efa71.cjs.prod.js → redirect-to-project-create-2266c427.cjs.prod.js} +1 -3
- package/dist/{redirect-to-project-create-f0e7b35e.cjs.dev.js → redirect-to-project-create-7b476aa6.cjs.dev.js} +1 -3
- package/dist/{redirect-to-project-create-052f293e.esm.js → redirect-to-project-create-c5323504.esm.js} +1 -3
- package/dist/{redirector-47a6be71.esm.js → redirector-368eeb0f.esm.js} +1 -8
- package/dist/{redirector-0d98f9df.cjs.dev.js → redirector-ec9fa17f.cjs.prod.js} +1 -8
- package/dist/{redirector-77ce2f5c.cjs.prod.js → redirector-f71198cc.cjs.dev.js} +1 -8
- package/dist/{requests-in-flight-loader-23a03381.cjs.dev.js → requests-in-flight-loader-3a40411c.cjs.dev.js} +5 -9
- package/dist/{requests-in-flight-loader-6e4fd082.esm.js → requests-in-flight-loader-78bce8a5.esm.js} +5 -9
- package/dist/{requests-in-flight-loader-40b16b26.cjs.prod.js → requests-in-flight-loader-d7963726.cjs.prod.js} +5 -9
- package/dist/{rocket-4b088727.esm.js → rocket-067c2f8c.esm.js} +0 -2
- package/dist/{rocket-3e3f0a98.cjs.prod.js → rocket-c6d44215.cjs.dev.js} +0 -2
- package/dist/{rocket-95b6858d.cjs.dev.js → rocket-f0bfae34.cjs.prod.js} +0 -2
- package/dist/{route-catch-all-3b490df1.cjs.prod.js → route-catch-all-293a1269.cjs.dev.js} +6 -6
- package/dist/{route-catch-all-9ac99936.cjs.dev.js → route-catch-all-373c69c6.cjs.prod.js} +6 -6
- package/dist/{route-catch-all-01cf0095.esm.js → route-catch-all-4af77675.esm.js} +6 -6
- package/dist/{service-page-project-switcher-4341744e.cjs.dev.js → service-page-project-switcher-2a4bc3ee.cjs.dev.js} +3 -4
- package/dist/{service-page-project-switcher-4c425f79.cjs.prod.js → service-page-project-switcher-617a204e.cjs.prod.js} +3 -3
- package/dist/{service-page-project-switcher-fd691711.esm.js → service-page-project-switcher-b99782a7.esm.js} +3 -4
- package/dist/{speedometer-2881cef6.cjs.prod.js → speedometer-0de260cf.cjs.prod.js} +0 -2
- package/dist/{speedometer-54f872f2.cjs.dev.js → speedometer-aedd9660.cjs.dev.js} +0 -2
- package/dist/{speedometer-08a11d5a.esm.js → speedometer-baa6ae82.esm.js} +0 -2
- package/dist/{star-52bf7a64.cjs.dev.js → star-49745c72.cjs.dev.js} +0 -2
- package/dist/{star-15244db1.esm.js → star-bd723a9c.esm.js} +0 -2
- package/dist/{star-f8502efb.cjs.prod.js → star-c11b0683.cjs.prod.js} +0 -2
- package/dist/{tag-multi-3be995ac.esm.js → tag-multi-1dee8212.esm.js} +0 -2
- package/dist/{tag-multi-1d1553b6.cjs.dev.js → tag-multi-2e7a68ec.cjs.dev.js} +0 -2
- package/dist/{tag-multi-f9acb1c2.cjs.prod.js → tag-multi-f8d9c9e6.cjs.prod.js} +0 -2
- package/dist/{tree-structure-c8753526.esm.js → tree-structure-0a1dc6bf.esm.js} +0 -2
- package/dist/{tree-structure-4650688d.cjs.dev.js → tree-structure-690366f9.cjs.prod.js} +0 -2
- package/dist/{tree-structure-f24ee3f6.cjs.prod.js → tree-structure-8c974c7a.cjs.dev.js} +0 -2
- package/dist/{use-applications-menu-390a31f4.cjs.dev.js → use-applications-menu-2046cce4.cjs.dev.js} +30 -40
- package/dist/{use-applications-menu-1d53322d.cjs.prod.js → use-applications-menu-84a888d7.cjs.prod.js} +30 -40
- package/dist/{use-applications-menu-6f960374.esm.js → use-applications-menu-daf4a744.esm.js} +30 -40
- package/dist/{use-is-served-by-proxy-499bfa16.esm.js → use-is-served-by-proxy-77984220.esm.js} +0 -2
- package/dist/{use-is-served-by-proxy-2b4916e5.cjs.dev.js → use-is-served-by-proxy-845cace5.cjs.prod.js} +0 -2
- package/dist/{use-is-served-by-proxy-51e76976.cjs.prod.js → use-is-served-by-proxy-ed411f45.cjs.dev.js} +0 -2
- package/dist/{user-filled-2e6cb25e.cjs.dev.js → user-filled-58af1ae4.cjs.prod.js} +0 -2
- package/dist/{user-filled-815b49a0.cjs.prod.js → user-filled-5dd7a51a.cjs.dev.js} +0 -2
- package/dist/{user-filled-2dc4e79e.esm.js → user-filled-d40a7e17.esm.js} +0 -2
- package/dist/{user-settings-menu-4646418a.esm.js → user-settings-menu-b8ecc868.esm.js} +16 -53
- package/dist/{user-settings-menu-22bf89c0.cjs.prod.js → user-settings-menu-c50b95e4.cjs.prod.js} +16 -52
- package/dist/{user-settings-menu-c8b3ee57.cjs.dev.js → user-settings-menu-fe393647.cjs.dev.js} +16 -53
- package/dist/{version-tracker-9fd44381.cjs.dev.js → version-tracker-3b9eb5c6.cjs.dev.js} +5 -5
- package/dist/{version-tracker-71b6de2c.cjs.prod.js → version-tracker-4ad14ed3.cjs.prod.js} +5 -5
- package/dist/{version-tracker-5c514d81.esm.js → version-tracker-f2e3185f.esm.js} +5 -5
- package/dist/{world-c5ea311a.esm.js → world-1b0e72fc.esm.js} +0 -2
- package/dist/{world-973090a5.cjs.dev.js → world-bfd04f52.cjs.dev.js} +0 -2
- package/dist/{world-e1f9dbf8.cjs.prod.js → world-f921d80c.cjs.prod.js} +0 -2
- package/package.json +41 -27
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +2 -2
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +2 -2
- package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +2 -2
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +78 -112
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +78 -112
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +78 -112
|
@@ -25,7 +25,7 @@ var _indexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
|
|
|
25
25
|
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
26
26
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
27
27
|
var sentry = require('@commercetools-frontend/sentry');
|
|
28
|
-
var constants$1 = require('./constants-
|
|
28
|
+
var constants$1 = require('./constants-e51cdcc0.cjs.dev.js');
|
|
29
29
|
var reactNotifications = require('@commercetools-frontend/react-notifications');
|
|
30
30
|
var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
31
31
|
var reduxLogger = require('redux-logger');
|
|
@@ -87,32 +87,25 @@ var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construc
|
|
|
87
87
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
88
88
|
|
|
89
89
|
// NOTE: This string will be replaced on build time with the package version.
|
|
90
|
-
var applicationShellVersion = "22.
|
|
90
|
+
var applicationShellVersion = "22.3.0";
|
|
91
91
|
|
|
92
92
|
const isShowRequestInFlightAction = action => action.type === constants.SHOW_LOADING;
|
|
93
|
-
|
|
94
93
|
const isHideRequestInFlightAction = action => action.type === constants.HIDE_LOADING;
|
|
95
|
-
|
|
96
94
|
const excludeFirstOccurrence = (list, item) => {
|
|
97
95
|
const index = _indexOfInstanceProperty__default["default"](list).call(list, item);
|
|
98
|
-
|
|
99
96
|
return [..._sliceInstanceProperty__default["default"](list).call(list, 0, index), ..._sliceInstanceProperty__default["default"](list).call(list, index + 1)];
|
|
100
97
|
};
|
|
101
|
-
|
|
102
98
|
var requestsInFlightReducer = ((requestsInFlight, action) => {
|
|
103
99
|
if (!requestsInFlight || !action) return [];
|
|
104
100
|
if (isShowRequestInFlightAction(action)) return [...requestsInFlight, action.payload];
|
|
105
|
-
|
|
106
101
|
if (isHideRequestInFlightAction(action)) {
|
|
107
102
|
// may only remove first occurence
|
|
108
103
|
if (!_includesInstanceProperty__default["default"](requestsInFlight).call(requestsInFlight, action.payload)) {
|
|
109
104
|
sentry.reportErrorToSentry(new Error("Tried to hide \"".concat(action.payload, "\", but it was not progressing!")));
|
|
110
105
|
return requestsInFlight;
|
|
111
106
|
}
|
|
112
|
-
|
|
113
107
|
return excludeFirstOccurrence(requestsInFlight, action.payload);
|
|
114
108
|
}
|
|
115
|
-
|
|
116
109
|
return requestsInFlight;
|
|
117
110
|
});
|
|
118
111
|
|
|
@@ -120,27 +113,23 @@ const isAddNotificationErrorAction = action => {
|
|
|
120
113
|
const errorAction = action;
|
|
121
114
|
return errorAction.type === notifications.ADD_NOTIFICATION && errorAction.payload && (errorAction.payload.kind === constants.NOTIFICATION_KINDS_PAGE['api-error'] || errorAction.payload.kind === constants.NOTIFICATION_KINDS_PAGE['unexpected-error']);
|
|
122
115
|
};
|
|
123
|
-
|
|
124
116
|
const isHideAllNotificationsAction = action => action.type === constants.HIDE_ALL_PAGE_NOTIFICATIONS;
|
|
125
|
-
|
|
126
117
|
const hideNotificationsMiddleware = _ref => {
|
|
127
118
|
let getState = _ref.getState;
|
|
128
119
|
return next => action => {
|
|
129
120
|
if (isHideAllNotificationsAction(action) || isAddNotificationErrorAction(action)) {
|
|
130
121
|
var _context;
|
|
131
|
-
|
|
132
122
|
const state = getState();
|
|
133
|
-
|
|
134
123
|
_forEachInstanceProperty__default["default"](_context = reactNotifications.selectPageNotifications(state)).call(_context, notification => {
|
|
135
124
|
next(notifications.removeNotification(notification.id));
|
|
136
125
|
});
|
|
137
126
|
}
|
|
138
|
-
|
|
139
127
|
return next(action);
|
|
140
128
|
};
|
|
141
129
|
};
|
|
142
130
|
|
|
143
131
|
/* eslint-disable no-console */
|
|
132
|
+
|
|
144
133
|
const isLoggerEnabled = () => {
|
|
145
134
|
if (process.env.DEBUG === 'true') return true;
|
|
146
135
|
if (process.env.NODE_ENV === 'development') return true;
|
|
@@ -183,34 +172,33 @@ const loggerMiddleware = reduxLogger.createLogger({
|
|
|
183
172
|
predicate: (_getState, action) => {
|
|
184
173
|
if (!action) return false;
|
|
185
174
|
const type = action.type,
|
|
186
|
-
|
|
175
|
+
payload = action.payload;
|
|
187
176
|
if (!type) return false;
|
|
188
177
|
if (_startsWithInstanceProperty__default["default"](type).call(type, 'SHOW_') || _startsWithInstanceProperty__default["default"](type).call(type, 'HIDE_') || _startsWithInstanceProperty__default["default"](type).call(type, 'APOLLO_')) return false;
|
|
189
|
-
|
|
190
178
|
switch (type) {
|
|
191
179
|
case notifications.REMOVE_NOTIFICATION:
|
|
192
180
|
return false;
|
|
193
|
-
|
|
194
181
|
case notifications.ADD_NOTIFICATION:
|
|
195
182
|
{
|
|
196
183
|
const ignoredKinds = ['api-error', 'unexpected-error'];
|
|
197
184
|
return !_includesInstanceProperty__default["default"](ignoredKinds).call(ignoredKinds, payload.kind);
|
|
198
185
|
}
|
|
199
|
-
|
|
200
186
|
default:
|
|
201
187
|
return true;
|
|
202
188
|
}
|
|
203
189
|
}
|
|
204
190
|
});
|
|
205
191
|
|
|
192
|
+
// Attempt to load the `teamId` from localStorage
|
|
206
193
|
function selectTeamIdFromLocalStorage() {
|
|
207
194
|
return window.localStorage.getItem(constants$1.STORAGE_KEYS.ACTIVE_TEAM_ID) || undefined;
|
|
208
195
|
}
|
|
209
196
|
|
|
210
|
-
const staticUrlPathsInPositionOfProjectKey = ['login', 'logout', 'account'];
|
|
197
|
+
const staticUrlPathsInPositionOfProjectKey = ['login', 'logout', 'account'];
|
|
198
|
+
|
|
199
|
+
// Attempt to extract the `:projectKey` from the URL.
|
|
211
200
|
// If the value matches one of the values in the list above,
|
|
212
201
|
// return `undefined` as we're not within a project context.
|
|
213
|
-
|
|
214
202
|
function selectProjectKeyFromUrl() {
|
|
215
203
|
let locationPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.pathname;
|
|
216
204
|
const possibleProjectKey = locationPath.split('/')[1];
|
|
@@ -221,129 +209,102 @@ function selectProjectKeyFromUrl() {
|
|
|
221
209
|
// by the application. This is useful to retrieve on runtime the reference
|
|
222
210
|
// to the apollo client in other static modules.
|
|
223
211
|
let cachedApolloClient;
|
|
224
|
-
|
|
225
212
|
const setCachedApolloClient = apolloClient => {
|
|
226
213
|
cachedApolloClient = apolloClient;
|
|
227
214
|
};
|
|
228
|
-
|
|
229
215
|
const getCachedApolloClient = () => cachedApolloClient;
|
|
230
216
|
|
|
231
217
|
var FetchUserId = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchUserId" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "user" }, name: { kind: "Name", value: "me" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 46, source: { body: "query FetchUserId {\n user: me {\n id\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
232
218
|
function selectUserId() {
|
|
233
219
|
const apolloClient = getCachedApolloClient();
|
|
234
|
-
|
|
235
220
|
if (!apolloClient) {
|
|
236
221
|
return null;
|
|
237
222
|
}
|
|
238
|
-
|
|
239
223
|
try {
|
|
240
224
|
const queryResult = apolloClient.readQuery({
|
|
241
225
|
query: FetchUserId
|
|
242
226
|
});
|
|
243
|
-
|
|
244
227
|
if (queryResult && queryResult.user) {
|
|
245
228
|
return queryResult.user.id;
|
|
246
229
|
}
|
|
247
230
|
} catch (e) {
|
|
248
231
|
return null;
|
|
249
232
|
}
|
|
250
|
-
|
|
251
233
|
return null;
|
|
252
234
|
}
|
|
253
235
|
|
|
254
236
|
const VALID_ID_PART_FORMAT = /^[\w-/]+$/;
|
|
255
|
-
|
|
256
237
|
const skipMalformedPart = part => part && VALID_ID_PART_FORMAT.test(part);
|
|
257
|
-
|
|
258
238
|
function getCorrelationId() {
|
|
259
239
|
var _context;
|
|
260
|
-
|
|
261
240
|
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
262
|
-
|
|
263
|
-
|
|
241
|
+
userId = _ref.userId;
|
|
264
242
|
return _filterInstanceProperty__default["default"](_context = ['mc', selectProjectKeyFromUrl(), userId, uuid.v4()]).call(_context, skipMalformedPart).join('/');
|
|
265
243
|
}
|
|
266
244
|
|
|
267
245
|
// NOTE: Copied from `@application-shell-connectors`.
|
|
268
246
|
// TODO: Remove this version once the change in the connectors has been released.
|
|
247
|
+
|
|
269
248
|
const mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
270
249
|
const mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
271
|
-
|
|
272
250
|
const getMcOriginTld = host => {
|
|
273
251
|
if (host.match(mcPreviewHostnameRegex)) {
|
|
274
252
|
return host.replace(mcPreviewHostnameRegex, '$1');
|
|
275
253
|
}
|
|
276
|
-
|
|
277
254
|
return host.replace(mcHostnameRegex, '$3');
|
|
278
255
|
};
|
|
279
|
-
|
|
280
256
|
const getMcApiUrlFromOrigin = origin => {
|
|
281
257
|
var _context;
|
|
282
|
-
|
|
283
258
|
const url = new _URL__default["default"](origin);
|
|
284
259
|
const originTld = getMcOriginTld(url.host);
|
|
285
260
|
return _concatInstanceProperty__default["default"](_context = "".concat(url.protocol, "//mc-api.")).call(_context, originTld);
|
|
286
261
|
};
|
|
287
|
-
|
|
288
262
|
const parseAsBoolean = value => value === true || value === 'true';
|
|
289
|
-
|
|
290
263
|
function getMcApiUrl() {
|
|
291
264
|
let environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.app;
|
|
292
265
|
let origin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.origin;
|
|
293
266
|
const isServedByProxy = parseAsBoolean(environment.servedByProxy);
|
|
267
|
+
|
|
294
268
|
/**
|
|
295
269
|
* Prefer using the origin URL for the MC API based on the origin value
|
|
296
270
|
* of the browser's `window.location`.
|
|
297
271
|
* This ensures that the application always uses the correct URL associated
|
|
298
272
|
* with that environment, instead of relying on the config value.
|
|
299
273
|
*/
|
|
300
|
-
|
|
301
274
|
if (isServedByProxy) {
|
|
302
275
|
return getMcApiUrlFromOrigin(origin);
|
|
303
276
|
}
|
|
304
|
-
|
|
305
277
|
return environment.mcApiUrl;
|
|
306
278
|
}
|
|
307
279
|
|
|
308
280
|
const getSessionToken = () => window.sessionStorage.getItem(constants$1.STORAGE_KEYS.SESSION_TOKEN);
|
|
309
|
-
|
|
310
281
|
const setActiveSession = sessionToken => {
|
|
311
282
|
if (!sessionToken) return;
|
|
312
283
|
window.sessionStorage.setItem(constants$1.STORAGE_KEYS.SESSION_TOKEN, sessionToken !== null && sessionToken !== void 0 ? sessionToken : '');
|
|
313
|
-
window.localStorage.setItem(constants$1.STORAGE_KEYS.LOGIN_STRATEGY, constants$1.LOGIN_STRATEGY_OIDC);
|
|
314
|
-
|
|
284
|
+
window.localStorage.setItem(constants$1.STORAGE_KEYS.LOGIN_STRATEGY, constants$1.LOGIN_STRATEGY_OIDC);
|
|
285
|
+
// Remove flag for original workflow
|
|
315
286
|
window.localStorage.removeItem(constants$1.STORAGE_KEYS.IS_AUTHENTICATED);
|
|
316
287
|
};
|
|
317
|
-
|
|
318
288
|
const clearSession = () => {
|
|
319
289
|
window.sessionStorage.removeItem(constants$1.STORAGE_KEYS.SESSION_TOKEN);
|
|
320
290
|
window.sessionStorage.removeItem(constants$1.STORAGE_KEYS.SESSION_SCOPE);
|
|
321
291
|
window.sessionStorage.removeItem(constants$1.STORAGE_KEYS.IS_AUTHENTICATED);
|
|
322
292
|
};
|
|
323
|
-
|
|
324
293
|
const getActiveProjectKey = () => window.localStorage.getItem(constants$1.STORAGE_KEYS.ACTIVE_PROJECT_KEY);
|
|
325
|
-
|
|
326
294
|
const removeActiveProjectKey = () => {
|
|
327
295
|
window.localStorage.removeItem(constants$1.STORAGE_KEYS.ACTIVE_PROJECT_KEY);
|
|
328
296
|
};
|
|
329
|
-
|
|
330
297
|
const setActiveProjectKey = projectKey => {
|
|
331
298
|
window.localStorage.setItem(constants$1.STORAGE_KEYS.ACTIVE_PROJECT_KEY, projectKey);
|
|
332
299
|
};
|
|
333
|
-
|
|
334
300
|
const getSessionScope = () => window.sessionStorage.getItem(constants$1.STORAGE_KEYS.SESSION_SCOPE);
|
|
335
|
-
|
|
336
301
|
const setSessionScope = scope => {
|
|
337
302
|
window.sessionStorage.setItem(constants$1.STORAGE_KEYS.SESSION_SCOPE, scope);
|
|
338
303
|
};
|
|
339
|
-
|
|
340
304
|
const getSessionState = stateId => {
|
|
341
305
|
var _context;
|
|
342
|
-
|
|
343
306
|
const sessionStateKey = _concatInstanceProperty__default["default"](_context = "".concat(constants$1.STORAGE_KEYS.NONCE, "_")).call(_context, stateId);
|
|
344
|
-
|
|
345
307
|
const unparsedSessionState = window.sessionStorage.getItem(sessionStateKey);
|
|
346
|
-
|
|
347
308
|
if (unparsedSessionState) {
|
|
348
309
|
try {
|
|
349
310
|
const parsedSessionState = JSON.parse(unparsedSessionState);
|
|
@@ -351,46 +312,34 @@ const getSessionState = stateId => {
|
|
|
351
312
|
return parsedSessionState;
|
|
352
313
|
} catch (error) {
|
|
353
314
|
window.sessionStorage.removeItem(sessionStateKey);
|
|
354
|
-
|
|
355
315
|
if (process.env.NODE_ENV !== 'production') {
|
|
356
316
|
var _context2;
|
|
357
|
-
|
|
358
317
|
// eslint-disable-next-line no-console
|
|
359
318
|
console.warn(_concatInstanceProperty__default["default"](_context2 = "Cannot parse session state for \"".concat(sessionStateKey, "\".\n")).call(_context2, unparsedSessionState));
|
|
360
319
|
}
|
|
361
320
|
}
|
|
362
321
|
}
|
|
363
|
-
|
|
364
322
|
return null;
|
|
365
323
|
};
|
|
366
|
-
|
|
367
324
|
const setSessionState = (stateId, state) => {
|
|
368
325
|
var _context3;
|
|
369
|
-
|
|
370
326
|
const sessionStateKey = _concatInstanceProperty__default["default"](_context3 = "".concat(constants$1.STORAGE_KEYS.NONCE, "_")).call(_context3, stateId);
|
|
371
|
-
|
|
372
327
|
window.sessionStorage.setItem(sessionStateKey, _JSON$stringify__default["default"](state));
|
|
373
328
|
};
|
|
374
329
|
|
|
375
330
|
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
376
|
-
|
|
377
331
|
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$4(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
378
|
-
|
|
379
332
|
const mergeObjectValues = object => {
|
|
380
333
|
var _context;
|
|
381
|
-
|
|
382
334
|
return _reduceInstanceProperty__default["default"](_context = _Object$entries__default["default"](object)).call(_context, (acc, _ref) => {
|
|
383
335
|
let _ref2 = _slicedToArray(_ref, 2),
|
|
384
|
-
|
|
385
|
-
|
|
336
|
+
value = _ref2[1];
|
|
386
337
|
return _objectSpread$4(_objectSpread$4({}, acc), value);
|
|
387
338
|
}, {});
|
|
388
339
|
};
|
|
389
|
-
|
|
390
340
|
const patchedGetCorrelationId = () => getCorrelationId({
|
|
391
341
|
userId: selectUserId()
|
|
392
342
|
});
|
|
393
|
-
|
|
394
343
|
const getAdditionalHeaders = () => {
|
|
395
344
|
const sessionToken = getSessionToken();
|
|
396
345
|
return omitEmpty__default["default"]({
|
|
@@ -399,24 +348,21 @@ const getAdditionalHeaders = () => {
|
|
|
399
348
|
[constants$1.SUPPORTED_HEADERS.X_TEAM_ID]: selectTeamIdFromLocalStorage()
|
|
400
349
|
});
|
|
401
350
|
};
|
|
402
|
-
|
|
403
351
|
const sdkMiddleware = sdk.createMiddleware({
|
|
404
352
|
getCorrelationId: patchedGetCorrelationId,
|
|
405
353
|
getProjectKey: selectProjectKeyFromUrl,
|
|
406
354
|
getAdditionalHeaders
|
|
407
355
|
});
|
|
356
|
+
|
|
408
357
|
/**
|
|
409
358
|
* @deprecated: This function should not be used directly anymore.
|
|
410
359
|
*/
|
|
411
|
-
|
|
412
360
|
const applyDefaultMiddlewares = function () {
|
|
413
361
|
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
414
362
|
middlewares[_key] = arguments[_key];
|
|
415
363
|
}
|
|
416
|
-
|
|
417
364
|
return toolkit.applyMiddleware(...middlewares, thunk__default["default"], loggerMiddleware);
|
|
418
365
|
};
|
|
419
|
-
|
|
420
366
|
const createInternalReducer = function () {
|
|
421
367
|
let injectedReducers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
422
368
|
let preloadedState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -425,17 +371,18 @@ const createInternalReducer = function () {
|
|
|
425
371
|
// notifications:
|
|
426
372
|
// Unexpected key "new Key" found in preloadedState argument passed to createStore. Expected to find one of the known reducer keys instead: "requestsInFlight", "notifications". Unexpected keys will be ignored.
|
|
427
373
|
// https://redux.js.org/api/createstore#createstorereducer-preloadedstate-enhancer
|
|
428
|
-
const preloadedStateReducers = mapValues__default["default"](preloadedState, value => () => value);
|
|
429
|
-
// we pass an `unknown` type to express this uncertainty and make the compiler happy.
|
|
374
|
+
const preloadedStateReducers = mapValues__default["default"](preloadedState, value => () => value);
|
|
430
375
|
|
|
376
|
+
// NOTE: since we don't know in advance which reducers will be injected,
|
|
377
|
+
// we pass an `unknown` type to express this uncertainty and make the compiler happy.
|
|
431
378
|
return toolkit.combineReducers(_objectSpread$4(_objectSpread$4({
|
|
432
379
|
requestsInFlight: requestsInFlightReducer,
|
|
433
380
|
notifications: notifications.reducer
|
|
434
381
|
}, injectedReducers), preloadedStateReducers));
|
|
435
|
-
};
|
|
436
|
-
// The application can import the configured store (the default export)
|
|
437
|
-
|
|
382
|
+
};
|
|
438
383
|
|
|
384
|
+
// We use a factory as it's more practicable for tests
|
|
385
|
+
// The application can import the configured store (the default export)
|
|
439
386
|
const createReduxStore = function () {
|
|
440
387
|
let preloadedState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
441
388
|
let additionalMiddlewares = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -456,90 +403,76 @@ const createReduxStore = function () {
|
|
|
456
403
|
immutableCheck: false
|
|
457
404
|
}), loggerMiddleware]
|
|
458
405
|
});
|
|
459
|
-
const enhancedStore = store;
|
|
406
|
+
const enhancedStore = store;
|
|
460
407
|
|
|
408
|
+
// Enable reducers to be injected on runtime (see `<InjectReducer>`)
|
|
461
409
|
enhancedStore.injectedReducers = {};
|
|
462
|
-
|
|
463
410
|
enhancedStore.injectReducers = _ref3 => {
|
|
464
411
|
let id = _ref3.id,
|
|
465
|
-
|
|
412
|
+
reducers = _ref3.reducers;
|
|
466
413
|
const hasReducerBeenInjected = _Reflect$has__default["default"](enhancedStore.injectedReducers, id) && enhancedStore.injectedReducers[id] === reducers;
|
|
467
|
-
|
|
468
414
|
if (!hasReducerBeenInjected) {
|
|
469
415
|
// Keep track of the reducer by id, so we can check if it's been injected aleady
|
|
470
|
-
enhancedStore.injectedReducers[id] = reducers;
|
|
471
|
-
|
|
416
|
+
enhancedStore.injectedReducers[id] = reducers;
|
|
417
|
+
// ...when we create the new reducer though, we spread the reducers from each namespace
|
|
472
418
|
enhancedStore.replaceReducer(createInternalReducer(mergeObjectValues(enhancedStore.injectedReducers)));
|
|
473
419
|
}
|
|
474
420
|
};
|
|
475
|
-
|
|
476
421
|
enhancedStore.removeReducers = _ref4 => {
|
|
477
422
|
let id = _ref4.id;
|
|
478
423
|
delete enhancedStore.injectedReducers[id];
|
|
479
424
|
enhancedStore.replaceReducer(createInternalReducer(mergeObjectValues(enhancedStore.injectedReducers)));
|
|
480
425
|
};
|
|
481
|
-
|
|
482
426
|
return enhancedStore;
|
|
483
427
|
};
|
|
484
428
|
var internalReduxStore = createReduxStore();
|
|
485
429
|
|
|
486
|
-
const RouteCatchAll = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./route-catch-all-
|
|
487
|
-
/* webpackChunkName: "route-catch-all" */
|
|
488
|
-
); }));
|
|
430
|
+
const RouteCatchAll = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./route-catch-all-293a1269.cjs.dev.js' /* webpackChunkName: "route-catch-all" */); }));
|
|
489
431
|
|
|
490
432
|
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
491
|
-
|
|
492
433
|
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$3(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
493
|
-
|
|
494
434
|
const getSkipTokenRetry = context => {
|
|
495
435
|
const skipTokenRetry = Boolean(context.skipTokenRetry);
|
|
496
436
|
return skipTokenRetry;
|
|
497
437
|
};
|
|
498
|
-
|
|
499
438
|
const forwardTokenRetryHeader = headers => _objectSpread$3(_objectSpread$3({}, headers), {}, {
|
|
500
439
|
[constants$1.SUPPORTED_HEADERS.X_TOKEN_RETRY]: 'true'
|
|
501
|
-
});
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
// This link retries requests to the CTP API that have been rejected
|
|
502
443
|
// because of an invalid/expired oauth token.
|
|
503
444
|
// To do so, we resend the request with the header "X-Force-Token: true"
|
|
504
445
|
// so that the MC BE can issue a new token.
|
|
505
446
|
// NOTE: the retry is not meant to work for the MC access token.
|
|
506
|
-
|
|
507
|
-
|
|
508
447
|
const getDoesGraphQLTargetSupportTokenRetry = context => {
|
|
509
448
|
var _context$headers, _context$headers2, _context;
|
|
510
|
-
|
|
511
449
|
const graphQLTarget = ((_context$headers = context.headers) === null || _context$headers === void 0 ? void 0 : _context$headers[constants$1.SUPPORTED_HEADERS.X_GRAPHQL_TARGET]) || ((_context$headers2 = context.headers) === null || _context$headers2 === void 0 ? void 0 : _context$headers2[constants$1.SUPPORTED_HEADERS.X_GRAPHQL_TARGET.toLowerCase()]);
|
|
512
450
|
return Boolean(graphQLTarget && _includesInstanceProperty__default["default"](_context = [constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM, constants.GRAPHQL_TARGETS.ADMINISTRATION_SERVICE, constants.GRAPHQL_TARGETS.SETTINGS_SERVICE, constants.GRAPHQL_TARGETS.MERCHANT_CENTER_BACKEND]).call(_context, graphQLTarget));
|
|
513
451
|
};
|
|
514
|
-
|
|
515
452
|
const isHttpError = error => error.statusCode !== undefined || error.statusCode !== undefined;
|
|
516
|
-
|
|
517
453
|
const isGraphQLError = error => _Array$isArray__default["default"](error) && _someInstanceProperty__default["default"](error).call(error, err => err.message !== undefined || err.extensions !== undefined);
|
|
518
454
|
|
|
455
|
+
// Checks response from GraphQL in order to scan 401 errors and redirect the
|
|
519
456
|
// user to the login page resetting the store and showing the proper message
|
|
520
|
-
|
|
521
457
|
const errorLink = error.onError(_ref => {
|
|
522
458
|
let graphQLErrors = _ref.graphQLErrors,
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
459
|
+
networkError = _ref.networkError,
|
|
460
|
+
operation = _ref.operation,
|
|
461
|
+
forward = _ref.forward;
|
|
527
462
|
if (networkError && isHttpError(networkError) && networkError.statusCode === constants.STATUS_CODES.UNAUTHORIZED) {
|
|
528
463
|
history__default["default"].push("/logout?reason=".concat(constants.LOGOUT_REASONS.UNAUTHORIZED));
|
|
529
464
|
return;
|
|
530
|
-
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// In case of graphql errors, we want to retry unauthenticated requests by
|
|
531
468
|
// forcing our API to fetch a new token, using the `X-Force-Token` header.
|
|
532
469
|
// https://www.apollographql.com/docs/link/links/error/#retrying-failed-requests
|
|
533
470
|
// We need to do this as the `token-retry-link` only works for network errors.
|
|
534
471
|
// https://www.apollographql.com/docs/link/links/retry/
|
|
535
|
-
|
|
536
|
-
|
|
537
472
|
if (graphQLErrors && isGraphQLError(graphQLErrors)) {
|
|
538
473
|
const context = operation.getContext();
|
|
539
|
-
|
|
540
474
|
for (const err of graphQLErrors) {
|
|
541
475
|
var _err$extensions;
|
|
542
|
-
|
|
543
476
|
const isNonAuthenticatedViaExtensionCode = (err === null || err === void 0 ? void 0 : (_err$extensions = err.extensions) === null || _err$extensions === void 0 ? void 0 : _err$extensions.code) === 'UNAUTHENTICATED';
|
|
544
477
|
/**
|
|
545
478
|
* NOTE:
|
|
@@ -548,31 +481,25 @@ const errorLink = error.onError(_ref => {
|
|
|
548
481
|
* property until they introduced support for the `extensions`
|
|
549
482
|
* field.
|
|
550
483
|
*/
|
|
551
|
-
|
|
552
484
|
const isNonAuthenticatedViaCode = (err === null || err === void 0 ? void 0 : err.message) === 'invalid_token';
|
|
553
|
-
|
|
554
485
|
if ((isNonAuthenticatedViaExtensionCode || isNonAuthenticatedViaCode) && getDoesGraphQLTargetSupportTokenRetry(context) && !getSkipTokenRetry(context)) {
|
|
555
486
|
operation.setContext(_ref2 => {
|
|
556
487
|
let headers = _ref2.headers;
|
|
557
488
|
return {
|
|
558
489
|
headers: forwardTokenRetryHeader(headers)
|
|
559
490
|
};
|
|
560
|
-
});
|
|
561
|
-
|
|
491
|
+
});
|
|
492
|
+
// retry the request, returning the new observable
|
|
562
493
|
return forward(operation);
|
|
563
494
|
}
|
|
564
495
|
}
|
|
565
496
|
}
|
|
566
|
-
|
|
567
497
|
return;
|
|
568
498
|
});
|
|
569
499
|
|
|
570
500
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
571
|
-
|
|
572
501
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
573
|
-
|
|
574
502
|
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
575
|
-
|
|
576
503
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$2(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$2(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
577
504
|
const defaultUserAgent = createHttpUserAgent__default["default"]({
|
|
578
505
|
name: 'unknown-http-client',
|
|
@@ -580,36 +507,27 @@ const defaultUserAgent = createHttpUserAgent__default["default"]({
|
|
|
580
507
|
});
|
|
581
508
|
const defaultForwardToVersion = 'v2';
|
|
582
509
|
const defaultForwardToAudiencePolicy = 'forward-url-full-path';
|
|
583
|
-
|
|
584
510
|
function buildApiUrl(endpoint) {
|
|
585
511
|
var _context;
|
|
586
|
-
|
|
587
512
|
const apiUrl = getMcApiUrl().replace(/\/$/, '');
|
|
588
513
|
return _concatInstanceProperty__default["default"](_context = "".concat(apiUrl)).call(_context, endpoint);
|
|
589
514
|
}
|
|
590
|
-
|
|
591
515
|
const getAppliedForwardToHeaders = forwardToConfig => {
|
|
592
516
|
var _context2, _forwardToConfig$head, _forwardToConfig$vers, _forwardToConfig$audi;
|
|
593
|
-
|
|
594
517
|
if (!forwardToConfig) {
|
|
595
518
|
return {};
|
|
596
519
|
}
|
|
597
|
-
|
|
598
520
|
if (!forwardToConfig.uri) {
|
|
599
521
|
throw new Error("Missing required \"uri\" option.");
|
|
600
522
|
}
|
|
601
|
-
|
|
602
523
|
const exchangeTokenClaims = [];
|
|
603
|
-
|
|
604
524
|
if (forwardToConfig.includeUserPermissions) {
|
|
605
525
|
exchangeTokenClaims.push('permissions');
|
|
606
526
|
}
|
|
607
|
-
|
|
608
527
|
return _objectSpread$2(_objectSpread$2({}, _reduceInstanceProperty__default["default"](_context2 = _Object$entries__default["default"]((_forwardToConfig$head = forwardToConfig.headers) !== null && _forwardToConfig$head !== void 0 ? _forwardToConfig$head : {})).call(_context2, (customForwardHeaders, _ref) => {
|
|
609
528
|
let _ref2 = _slicedToArray(_ref, 2),
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
529
|
+
headerName = _ref2[0],
|
|
530
|
+
headerValue = _ref2[1];
|
|
613
531
|
return _objectSpread$2(_objectSpread$2({}, customForwardHeaders), {}, {
|
|
614
532
|
// Prefix headers so that the MC API can allow and forward them.
|
|
615
533
|
["x-forward-header-".concat(headerName)]: headerValue
|
|
@@ -621,10 +539,8 @@ const getAppliedForwardToHeaders = forwardToConfig => {
|
|
|
621
539
|
[constants$1.SUPPORTED_HEADERS.X_FORWARD_TO_CLAIMS]: exchangeTokenClaims.join(' ')
|
|
622
540
|
});
|
|
623
541
|
};
|
|
624
|
-
|
|
625
542
|
function createHttpClientOptions() {
|
|
626
543
|
var _config$projectKey;
|
|
627
|
-
|
|
628
544
|
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
629
545
|
const sessionToken = getSessionToken();
|
|
630
546
|
const projectKey = (_config$projectKey = config.projectKey) !== null && _config$projectKey !== void 0 ? _config$projectKey : selectProjectKeyFromUrl();
|
|
@@ -645,37 +561,26 @@ function createHttpClientOptions() {
|
|
|
645
561
|
}, getAppliedForwardToHeaders(config.forwardToConfig)))
|
|
646
562
|
};
|
|
647
563
|
}
|
|
648
|
-
|
|
649
564
|
let RenewTokenError = /*#__PURE__*/function (_Error) {
|
|
650
565
|
_inherits(RenewTokenError, _Error);
|
|
651
|
-
|
|
652
566
|
var _super = _createSuper(RenewTokenError);
|
|
653
|
-
|
|
654
567
|
function RenewTokenError(message) {
|
|
655
568
|
var _this;
|
|
656
|
-
|
|
657
569
|
_classCallCheck(this, RenewTokenError);
|
|
658
|
-
|
|
659
570
|
_this = _super.call(this, message);
|
|
660
|
-
|
|
661
571
|
_Object$defineProperty__default["default"](_assertThisInitialized(_this), 'name', {
|
|
662
572
|
value: 'RenewTokenError'
|
|
663
573
|
});
|
|
664
|
-
|
|
665
574
|
return _this;
|
|
666
575
|
}
|
|
667
|
-
|
|
668
576
|
return _createClass(RenewTokenError);
|
|
669
577
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
670
|
-
|
|
671
578
|
async function executeHttpClientRequest(fetcher) {
|
|
672
579
|
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
673
|
-
|
|
674
580
|
// Wrapper function to be called again (once) on retry.
|
|
675
581
|
async function sendRequest() {
|
|
676
582
|
let _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
677
|
-
|
|
678
|
-
|
|
583
|
+
shouldRenewToken = _ref3.shouldRenewToken;
|
|
679
584
|
const requestOptions = createHttpClientOptions(config);
|
|
680
585
|
const response = await fetcher(_objectSpread$2(_objectSpread$2({}, requestOptions), {}, {
|
|
681
586
|
headers: omitEmpty__default["default"](_objectSpread$2(_objectSpread$2({}, requestOptions.headers), {}, {
|
|
@@ -683,22 +588,19 @@ async function executeHttpClientRequest(fetcher) {
|
|
|
683
588
|
[constants$1.SUPPORTED_HEADERS.X_TOKEN_RETRY]: shouldRenewToken
|
|
684
589
|
}))
|
|
685
590
|
}));
|
|
686
|
-
|
|
687
591
|
if (response.statusCode === constants.STATUS_CODES.UNAUTHORIZED) {
|
|
688
592
|
throw new RenewTokenError("Unauthorized response, attempting retry.");
|
|
689
|
-
}
|
|
690
|
-
|
|
593
|
+
}
|
|
691
594
|
|
|
595
|
+
// In case a new session token is returned from the server, save it.
|
|
692
596
|
const refreshedSessionToken = response.getHeader('x-refreshed-session-token');
|
|
693
|
-
|
|
694
597
|
if (refreshedSessionToken) {
|
|
695
598
|
setActiveSession(refreshedSessionToken);
|
|
696
599
|
}
|
|
697
|
-
|
|
698
600
|
return response.data;
|
|
699
|
-
}
|
|
700
|
-
|
|
601
|
+
}
|
|
701
602
|
|
|
603
|
+
// Attempt to send the request.
|
|
702
604
|
return sendRequest().catch(error => {
|
|
703
605
|
if (error instanceof RenewTokenError) {
|
|
704
606
|
// Retry the request and ask to renew the token.
|
|
@@ -706,13 +608,11 @@ async function executeHttpClientRequest(fetcher) {
|
|
|
706
608
|
shouldRenewToken: true
|
|
707
609
|
});
|
|
708
610
|
}
|
|
709
|
-
|
|
710
611
|
throw error;
|
|
711
612
|
});
|
|
712
613
|
}
|
|
713
614
|
|
|
714
615
|
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
715
|
-
|
|
716
616
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$1(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$1(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
717
617
|
const userAgent = createHttpUserAgent__default["default"]({
|
|
718
618
|
name: 'apollo-client',
|
|
@@ -723,47 +623,36 @@ const userAgent = createHttpUserAgent__default["default"]({
|
|
|
723
623
|
// points to the appkit repo issues
|
|
724
624
|
contactEmail: 'support@commercetools.com'
|
|
725
625
|
});
|
|
726
|
-
|
|
727
626
|
const isKnownGraphQlTarget = target => {
|
|
728
627
|
var _context;
|
|
729
|
-
|
|
730
628
|
return target ? _includesInstanceProperty__default["default"](_context = _Object$values__default["default"](constants.GRAPHQL_TARGETS)).call(_context, target) : false;
|
|
731
629
|
};
|
|
732
|
-
|
|
733
630
|
const extractSessionTokenFromResponse = context => {
|
|
734
631
|
var _context$response, _context$response$hea, _context$restResponse;
|
|
735
|
-
|
|
736
632
|
const refreshedSessionToken = (_context$response = context.response) === null || _context$response === void 0 ? void 0 : (_context$response$hea = _context$response.headers) === null || _context$response$hea === void 0 ? void 0 : _context$response$hea.get('x-refreshed-session-token');
|
|
737
|
-
|
|
738
633
|
if (refreshedSessionToken) {
|
|
739
634
|
return refreshedSessionToken !== null && refreshedSessionToken !== void 0 ? refreshedSessionToken : null;
|
|
740
635
|
}
|
|
741
|
-
|
|
742
636
|
const restResponseWithRefreshTokenHeader = (_context$restResponse = context.restResponses) === null || _context$restResponse === void 0 ? void 0 : _findInstanceProperty__default["default"](_context$restResponse).call(_context$restResponse, response => {
|
|
743
637
|
var _response$headers;
|
|
744
|
-
|
|
745
638
|
return (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.has('x-refreshed-session-token');
|
|
746
639
|
});
|
|
747
|
-
|
|
748
640
|
if (restResponseWithRefreshTokenHeader) {
|
|
749
641
|
var _restResponseWithRefr;
|
|
750
|
-
|
|
751
642
|
return (_restResponseWithRefr = restResponseWithRefreshTokenHeader.headers.get('x-refreshed-session-token')) !== null && _restResponseWithRefr !== void 0 ? _restResponseWithRefr : null;
|
|
752
643
|
}
|
|
753
|
-
|
|
754
644
|
return null;
|
|
755
645
|
};
|
|
646
|
+
|
|
756
647
|
/* eslint-disable import/prefer-default-export */
|
|
757
648
|
// Use a middleware to update the request headers with the correct params.
|
|
758
|
-
|
|
759
|
-
|
|
760
649
|
const headerLink = new client.ApolloLink((operation, forward) => {
|
|
761
650
|
var _context2, _context3;
|
|
762
|
-
|
|
763
651
|
const apolloContext = operation.getContext();
|
|
764
652
|
const variables = operation.variables;
|
|
765
653
|
const graphQlTarget = apolloContext.target || variables.target;
|
|
766
654
|
if (!apolloContext.skipGraphQlTargetCheck && !isKnownGraphQlTarget(graphQlTarget)) throw new Error(_concatInstanceProperty__default["default"](_context2 = "GraphQL target \"".concat(graphQlTarget, "\" is missing (or is not supported) in operation \"")).call(_context2, operation.operationName, "\""));
|
|
655
|
+
|
|
767
656
|
/**
|
|
768
657
|
* NOTE:
|
|
769
658
|
* The project key is read from the url in a project related application context.
|
|
@@ -772,7 +661,6 @@ const headerLink = new client.ApolloLink((operation, forward) => {
|
|
|
772
661
|
* As a result we allow passing the project key as a variable on the operation allowing
|
|
773
662
|
* it to be the fallback.
|
|
774
663
|
*/
|
|
775
|
-
|
|
776
664
|
const projectKey = apolloContext.projectKey || variables.projectKey || selectProjectKeyFromUrl();
|
|
777
665
|
const teamId = apolloContext.teamId || variables.teamId || selectTeamIdFromLocalStorage();
|
|
778
666
|
const featureFlag = apolloContext.featureFlag || variables.featureFlag;
|
|
@@ -793,11 +681,9 @@ const headerLink = new client.ApolloLink((operation, forward) => {
|
|
|
793
681
|
return _mapInstanceProperty__default["default"](_context3 = forward(operation)).call(_context3, response => {
|
|
794
682
|
const context = operation.getContext();
|
|
795
683
|
const refreshedSessionToken = extractSessionTokenFromResponse(context);
|
|
796
|
-
|
|
797
684
|
if (refreshedSessionToken) {
|
|
798
685
|
setActiveSession(refreshedSessionToken);
|
|
799
686
|
}
|
|
800
|
-
|
|
801
687
|
return response;
|
|
802
688
|
});
|
|
803
689
|
});
|
|
@@ -805,7 +691,6 @@ const headerLink = new client.ApolloLink((operation, forward) => {
|
|
|
805
691
|
const tokenRetryLink = new retry.RetryLink({
|
|
806
692
|
attempts: (count, operation, error) => {
|
|
807
693
|
const context = operation.getContext();
|
|
808
|
-
|
|
809
694
|
if ((error === null || error === void 0 ? void 0 : error.statusCode) === constants.STATUS_CODES.UNAUTHORIZED && count === 1 && getDoesGraphQLTargetSupportTokenRetry(context) && !getSkipTokenRetry(context)) {
|
|
810
695
|
operation.setContext(_ref => {
|
|
811
696
|
let headers = _ref.headers;
|
|
@@ -815,65 +700,61 @@ const tokenRetryLink = new retry.RetryLink({
|
|
|
815
700
|
});
|
|
816
701
|
return true;
|
|
817
702
|
}
|
|
818
|
-
|
|
819
703
|
return false;
|
|
820
704
|
}
|
|
821
705
|
});
|
|
822
706
|
|
|
823
707
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
824
|
-
|
|
825
708
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
826
709
|
const httpLink = client.createHttpLink({
|
|
827
710
|
uri: "".concat(getMcApiUrl(), "/graphql"),
|
|
828
711
|
fetch
|
|
829
712
|
});
|
|
830
|
-
|
|
831
713
|
const createApolloLink = function () {
|
|
832
714
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
833
|
-
return (
|
|
715
|
+
return (
|
|
716
|
+
// The order of links is IMPORTANT!
|
|
834
717
|
// In the request-phase they are executed top to bottom.
|
|
835
718
|
// In the response/phase they are executed bottom to top.
|
|
836
719
|
// The `httpLink` is terminating so it must be last, while `tokenRetryLink` and `errorLink`
|
|
837
720
|
// wrap the links the their right.
|
|
838
|
-
client.from([headerLink,
|
|
721
|
+
client.from([headerLink,
|
|
722
|
+
// See https://www.apollographql.com/docs/react/api/link/apollo-link-rest/#link-order
|
|
839
723
|
// State & context links should happen before (to the left of) `restLink`.
|
|
840
|
-
...(options.restLink ? [options.restLink] : []),
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
724
|
+
...(options.restLink ? [options.restLink] : []),
|
|
725
|
+
// Must be before `tokenRetryLink`.
|
|
726
|
+
errorLink,
|
|
727
|
+
// Avoid logging queries in test environment
|
|
728
|
+
...(isLoggerEnabled() ? [loggerLink__default["default"]] : []),
|
|
729
|
+
// Must be after `errorLink`.
|
|
730
|
+
tokenRetryLink,
|
|
731
|
+
// Must be last.
|
|
844
732
|
httpLink])
|
|
845
733
|
);
|
|
846
|
-
};
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
// This custom merge function allows to merge two arrays of objects.
|
|
847
737
|
// The incoming list is what we need to update to, but we still need
|
|
848
738
|
// to ensure that existing cache elements are not removed but updated.
|
|
849
739
|
// This is usually the case when elements get removed.
|
|
850
|
-
|
|
851
|
-
|
|
852
740
|
const mergeArraysObjects = function () {
|
|
853
741
|
let existing = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
854
742
|
let incoming = arguments.length > 1 ? arguments[1] : undefined;
|
|
855
|
-
|
|
856
743
|
let _ref = arguments.length > 2 ? arguments[2] : undefined,
|
|
857
|
-
|
|
858
|
-
|
|
744
|
+
mergeObjects = _ref.mergeObjects;
|
|
859
745
|
return _reduceInstanceProperty__default["default"](incoming).call(incoming, (mergedElements, elem) => {
|
|
860
746
|
const existingElem = _findInstanceProperty__default["default"](existing).call(existing, el => el.__ref === elem.__ref);
|
|
861
|
-
|
|
862
747
|
if (existingElem) {
|
|
863
748
|
const updatedElem = mergeObjects(existingElem, elem);
|
|
864
|
-
|
|
865
749
|
if (updatedElem) {
|
|
866
750
|
return [...mergedElements, updatedElem];
|
|
867
751
|
}
|
|
868
752
|
}
|
|
869
|
-
|
|
870
753
|
return [...mergedElements, elem];
|
|
871
754
|
}, []);
|
|
872
755
|
};
|
|
873
|
-
|
|
874
756
|
const createApolloClient = function () {
|
|
875
757
|
var _options$cache, _customCacheConfig$ty;
|
|
876
|
-
|
|
877
758
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
878
759
|
const customCacheConfig = (_options$cache = options === null || options === void 0 ? void 0 : options.cache) !== null && _options$cache !== void 0 ? _options$cache : {};
|
|
879
760
|
return new client.ApolloClient({
|