@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
package/dist/{configure-apollo-249465d4.cjs.prod.js → configure-apollo-70d83707.cjs.prod.js}
RENAMED
|
@@ -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-902cf3f3.cjs.prod.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
|
const queryParams = new _URL__default["default"](window.location.href);
|
|
@@ -182,34 +171,33 @@ const loggerMiddleware = reduxLogger.createLogger({
|
|
|
182
171
|
predicate: (_getState, action) => {
|
|
183
172
|
if (!action) return false;
|
|
184
173
|
const type = action.type,
|
|
185
|
-
|
|
174
|
+
payload = action.payload;
|
|
186
175
|
if (!type) return false;
|
|
187
176
|
if (_startsWithInstanceProperty__default["default"](type).call(type, 'SHOW_') || _startsWithInstanceProperty__default["default"](type).call(type, 'HIDE_') || _startsWithInstanceProperty__default["default"](type).call(type, 'APOLLO_')) return false;
|
|
188
|
-
|
|
189
177
|
switch (type) {
|
|
190
178
|
case notifications.REMOVE_NOTIFICATION:
|
|
191
179
|
return false;
|
|
192
|
-
|
|
193
180
|
case notifications.ADD_NOTIFICATION:
|
|
194
181
|
{
|
|
195
182
|
const ignoredKinds = ['api-error', 'unexpected-error'];
|
|
196
183
|
return !_includesInstanceProperty__default["default"](ignoredKinds).call(ignoredKinds, payload.kind);
|
|
197
184
|
}
|
|
198
|
-
|
|
199
185
|
default:
|
|
200
186
|
return true;
|
|
201
187
|
}
|
|
202
188
|
}
|
|
203
189
|
});
|
|
204
190
|
|
|
191
|
+
// Attempt to load the `teamId` from localStorage
|
|
205
192
|
function selectTeamIdFromLocalStorage() {
|
|
206
193
|
return window.localStorage.getItem(constants$1.STORAGE_KEYS.ACTIVE_TEAM_ID) || undefined;
|
|
207
194
|
}
|
|
208
195
|
|
|
209
|
-
const staticUrlPathsInPositionOfProjectKey = ['login', 'logout', 'account'];
|
|
196
|
+
const staticUrlPathsInPositionOfProjectKey = ['login', 'logout', 'account'];
|
|
197
|
+
|
|
198
|
+
// Attempt to extract the `:projectKey` from the URL.
|
|
210
199
|
// If the value matches one of the values in the list above,
|
|
211
200
|
// return `undefined` as we're not within a project context.
|
|
212
|
-
|
|
213
201
|
function selectProjectKeyFromUrl() {
|
|
214
202
|
let locationPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.pathname;
|
|
215
203
|
const possibleProjectKey = locationPath.split('/')[1];
|
|
@@ -220,129 +208,102 @@ function selectProjectKeyFromUrl() {
|
|
|
220
208
|
// by the application. This is useful to retrieve on runtime the reference
|
|
221
209
|
// to the apollo client in other static modules.
|
|
222
210
|
let cachedApolloClient;
|
|
223
|
-
|
|
224
211
|
const setCachedApolloClient = apolloClient => {
|
|
225
212
|
cachedApolloClient = apolloClient;
|
|
226
213
|
};
|
|
227
|
-
|
|
228
214
|
const getCachedApolloClient = () => cachedApolloClient;
|
|
229
215
|
|
|
230
216
|
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 } } } };
|
|
231
217
|
function selectUserId() {
|
|
232
218
|
const apolloClient = getCachedApolloClient();
|
|
233
|
-
|
|
234
219
|
if (!apolloClient) {
|
|
235
220
|
return null;
|
|
236
221
|
}
|
|
237
|
-
|
|
238
222
|
try {
|
|
239
223
|
const queryResult = apolloClient.readQuery({
|
|
240
224
|
query: FetchUserId
|
|
241
225
|
});
|
|
242
|
-
|
|
243
226
|
if (queryResult && queryResult.user) {
|
|
244
227
|
return queryResult.user.id;
|
|
245
228
|
}
|
|
246
229
|
} catch (e) {
|
|
247
230
|
return null;
|
|
248
231
|
}
|
|
249
|
-
|
|
250
232
|
return null;
|
|
251
233
|
}
|
|
252
234
|
|
|
253
235
|
const VALID_ID_PART_FORMAT = /^[\w-/]+$/;
|
|
254
|
-
|
|
255
236
|
const skipMalformedPart = part => part && VALID_ID_PART_FORMAT.test(part);
|
|
256
|
-
|
|
257
237
|
function getCorrelationId() {
|
|
258
238
|
var _context;
|
|
259
|
-
|
|
260
239
|
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
261
|
-
|
|
262
|
-
|
|
240
|
+
userId = _ref.userId;
|
|
263
241
|
return _filterInstanceProperty__default["default"](_context = ['mc', selectProjectKeyFromUrl(), userId, uuid.v4()]).call(_context, skipMalformedPart).join('/');
|
|
264
242
|
}
|
|
265
243
|
|
|
266
244
|
// NOTE: Copied from `@application-shell-connectors`.
|
|
267
245
|
// TODO: Remove this version once the change in the connectors has been released.
|
|
246
|
+
|
|
268
247
|
const mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
269
248
|
const mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
270
|
-
|
|
271
249
|
const getMcOriginTld = host => {
|
|
272
250
|
if (host.match(mcPreviewHostnameRegex)) {
|
|
273
251
|
return host.replace(mcPreviewHostnameRegex, '$1');
|
|
274
252
|
}
|
|
275
|
-
|
|
276
253
|
return host.replace(mcHostnameRegex, '$3');
|
|
277
254
|
};
|
|
278
|
-
|
|
279
255
|
const getMcApiUrlFromOrigin = origin => {
|
|
280
256
|
var _context;
|
|
281
|
-
|
|
282
257
|
const url = new _URL__default["default"](origin);
|
|
283
258
|
const originTld = getMcOriginTld(url.host);
|
|
284
259
|
return _concatInstanceProperty__default["default"](_context = "".concat(url.protocol, "//mc-api.")).call(_context, originTld);
|
|
285
260
|
};
|
|
286
|
-
|
|
287
261
|
const parseAsBoolean = value => value === true || value === 'true';
|
|
288
|
-
|
|
289
262
|
function getMcApiUrl() {
|
|
290
263
|
let environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.app;
|
|
291
264
|
let origin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.origin;
|
|
292
265
|
const isServedByProxy = parseAsBoolean(environment.servedByProxy);
|
|
266
|
+
|
|
293
267
|
/**
|
|
294
268
|
* Prefer using the origin URL for the MC API based on the origin value
|
|
295
269
|
* of the browser's `window.location`.
|
|
296
270
|
* This ensures that the application always uses the correct URL associated
|
|
297
271
|
* with that environment, instead of relying on the config value.
|
|
298
272
|
*/
|
|
299
|
-
|
|
300
273
|
if (isServedByProxy) {
|
|
301
274
|
return getMcApiUrlFromOrigin(origin);
|
|
302
275
|
}
|
|
303
|
-
|
|
304
276
|
return environment.mcApiUrl;
|
|
305
277
|
}
|
|
306
278
|
|
|
307
279
|
const getSessionToken = () => window.sessionStorage.getItem(constants$1.STORAGE_KEYS.SESSION_TOKEN);
|
|
308
|
-
|
|
309
280
|
const setActiveSession = sessionToken => {
|
|
310
281
|
if (!sessionToken) return;
|
|
311
282
|
window.sessionStorage.setItem(constants$1.STORAGE_KEYS.SESSION_TOKEN, sessionToken !== null && sessionToken !== void 0 ? sessionToken : '');
|
|
312
|
-
window.localStorage.setItem(constants$1.STORAGE_KEYS.LOGIN_STRATEGY, constants$1.LOGIN_STRATEGY_OIDC);
|
|
313
|
-
|
|
283
|
+
window.localStorage.setItem(constants$1.STORAGE_KEYS.LOGIN_STRATEGY, constants$1.LOGIN_STRATEGY_OIDC);
|
|
284
|
+
// Remove flag for original workflow
|
|
314
285
|
window.localStorage.removeItem(constants$1.STORAGE_KEYS.IS_AUTHENTICATED);
|
|
315
286
|
};
|
|
316
|
-
|
|
317
287
|
const clearSession = () => {
|
|
318
288
|
window.sessionStorage.removeItem(constants$1.STORAGE_KEYS.SESSION_TOKEN);
|
|
319
289
|
window.sessionStorage.removeItem(constants$1.STORAGE_KEYS.SESSION_SCOPE);
|
|
320
290
|
window.sessionStorage.removeItem(constants$1.STORAGE_KEYS.IS_AUTHENTICATED);
|
|
321
291
|
};
|
|
322
|
-
|
|
323
292
|
const getActiveProjectKey = () => window.localStorage.getItem(constants$1.STORAGE_KEYS.ACTIVE_PROJECT_KEY);
|
|
324
|
-
|
|
325
293
|
const removeActiveProjectKey = () => {
|
|
326
294
|
window.localStorage.removeItem(constants$1.STORAGE_KEYS.ACTIVE_PROJECT_KEY);
|
|
327
295
|
};
|
|
328
|
-
|
|
329
296
|
const setActiveProjectKey = projectKey => {
|
|
330
297
|
window.localStorage.setItem(constants$1.STORAGE_KEYS.ACTIVE_PROJECT_KEY, projectKey);
|
|
331
298
|
};
|
|
332
|
-
|
|
333
299
|
const getSessionScope = () => window.sessionStorage.getItem(constants$1.STORAGE_KEYS.SESSION_SCOPE);
|
|
334
|
-
|
|
335
300
|
const setSessionScope = scope => {
|
|
336
301
|
window.sessionStorage.setItem(constants$1.STORAGE_KEYS.SESSION_SCOPE, scope);
|
|
337
302
|
};
|
|
338
|
-
|
|
339
303
|
const getSessionState = stateId => {
|
|
340
304
|
var _context;
|
|
341
|
-
|
|
342
305
|
const sessionStateKey = _concatInstanceProperty__default["default"](_context = "".concat(constants$1.STORAGE_KEYS.NONCE, "_")).call(_context, stateId);
|
|
343
|
-
|
|
344
306
|
const unparsedSessionState = window.sessionStorage.getItem(sessionStateKey);
|
|
345
|
-
|
|
346
307
|
if (unparsedSessionState) {
|
|
347
308
|
try {
|
|
348
309
|
const parsedSessionState = JSON.parse(unparsedSessionState);
|
|
@@ -352,37 +313,27 @@ const getSessionState = stateId => {
|
|
|
352
313
|
window.sessionStorage.removeItem(sessionStateKey);
|
|
353
314
|
}
|
|
354
315
|
}
|
|
355
|
-
|
|
356
316
|
return null;
|
|
357
317
|
};
|
|
358
|
-
|
|
359
318
|
const setSessionState = (stateId, state) => {
|
|
360
319
|
var _context3;
|
|
361
|
-
|
|
362
320
|
const sessionStateKey = _concatInstanceProperty__default["default"](_context3 = "".concat(constants$1.STORAGE_KEYS.NONCE, "_")).call(_context3, stateId);
|
|
363
|
-
|
|
364
321
|
window.sessionStorage.setItem(sessionStateKey, _JSON$stringify__default["default"](state));
|
|
365
322
|
};
|
|
366
323
|
|
|
367
324
|
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; }
|
|
368
|
-
|
|
369
325
|
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; }
|
|
370
|
-
|
|
371
326
|
const mergeObjectValues = object => {
|
|
372
327
|
var _context;
|
|
373
|
-
|
|
374
328
|
return _reduceInstanceProperty__default["default"](_context = _Object$entries__default["default"](object)).call(_context, (acc, _ref) => {
|
|
375
329
|
let _ref2 = _slicedToArray(_ref, 2),
|
|
376
|
-
|
|
377
|
-
|
|
330
|
+
value = _ref2[1];
|
|
378
331
|
return _objectSpread$4(_objectSpread$4({}, acc), value);
|
|
379
332
|
}, {});
|
|
380
333
|
};
|
|
381
|
-
|
|
382
334
|
const patchedGetCorrelationId = () => getCorrelationId({
|
|
383
335
|
userId: selectUserId()
|
|
384
336
|
});
|
|
385
|
-
|
|
386
337
|
const getAdditionalHeaders = () => {
|
|
387
338
|
const sessionToken = getSessionToken();
|
|
388
339
|
return omitEmpty__default["default"]({
|
|
@@ -391,24 +342,21 @@ const getAdditionalHeaders = () => {
|
|
|
391
342
|
[constants$1.SUPPORTED_HEADERS.X_TEAM_ID]: selectTeamIdFromLocalStorage()
|
|
392
343
|
});
|
|
393
344
|
};
|
|
394
|
-
|
|
395
345
|
const sdkMiddleware = sdk.createMiddleware({
|
|
396
346
|
getCorrelationId: patchedGetCorrelationId,
|
|
397
347
|
getProjectKey: selectProjectKeyFromUrl,
|
|
398
348
|
getAdditionalHeaders
|
|
399
349
|
});
|
|
350
|
+
|
|
400
351
|
/**
|
|
401
352
|
* @deprecated: This function should not be used directly anymore.
|
|
402
353
|
*/
|
|
403
|
-
|
|
404
354
|
const applyDefaultMiddlewares = function () {
|
|
405
355
|
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
406
356
|
middlewares[_key] = arguments[_key];
|
|
407
357
|
}
|
|
408
|
-
|
|
409
358
|
return toolkit.applyMiddleware(...middlewares, thunk__default["default"], loggerMiddleware);
|
|
410
359
|
};
|
|
411
|
-
|
|
412
360
|
const createInternalReducer = function () {
|
|
413
361
|
let injectedReducers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
414
362
|
let preloadedState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -417,17 +365,18 @@ const createInternalReducer = function () {
|
|
|
417
365
|
// notifications:
|
|
418
366
|
// 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.
|
|
419
367
|
// https://redux.js.org/api/createstore#createstorereducer-preloadedstate-enhancer
|
|
420
|
-
const preloadedStateReducers = mapValues__default["default"](preloadedState, value => () => value);
|
|
421
|
-
// we pass an `unknown` type to express this uncertainty and make the compiler happy.
|
|
368
|
+
const preloadedStateReducers = mapValues__default["default"](preloadedState, value => () => value);
|
|
422
369
|
|
|
370
|
+
// NOTE: since we don't know in advance which reducers will be injected,
|
|
371
|
+
// we pass an `unknown` type to express this uncertainty and make the compiler happy.
|
|
423
372
|
return toolkit.combineReducers(_objectSpread$4(_objectSpread$4({
|
|
424
373
|
requestsInFlight: requestsInFlightReducer,
|
|
425
374
|
notifications: notifications.reducer
|
|
426
375
|
}, injectedReducers), preloadedStateReducers));
|
|
427
|
-
};
|
|
428
|
-
// The application can import the configured store (the default export)
|
|
429
|
-
|
|
376
|
+
};
|
|
430
377
|
|
|
378
|
+
// We use a factory as it's more practicable for tests
|
|
379
|
+
// The application can import the configured store (the default export)
|
|
431
380
|
const createReduxStore = function () {
|
|
432
381
|
let preloadedState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
433
382
|
let additionalMiddlewares = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -448,90 +397,76 @@ const createReduxStore = function () {
|
|
|
448
397
|
immutableCheck: false
|
|
449
398
|
}), loggerMiddleware]
|
|
450
399
|
});
|
|
451
|
-
const enhancedStore = store;
|
|
400
|
+
const enhancedStore = store;
|
|
452
401
|
|
|
402
|
+
// Enable reducers to be injected on runtime (see `<InjectReducer>`)
|
|
453
403
|
enhancedStore.injectedReducers = {};
|
|
454
|
-
|
|
455
404
|
enhancedStore.injectReducers = _ref3 => {
|
|
456
405
|
let id = _ref3.id,
|
|
457
|
-
|
|
406
|
+
reducers = _ref3.reducers;
|
|
458
407
|
const hasReducerBeenInjected = _Reflect$has__default["default"](enhancedStore.injectedReducers, id) && enhancedStore.injectedReducers[id] === reducers;
|
|
459
|
-
|
|
460
408
|
if (!hasReducerBeenInjected) {
|
|
461
409
|
// Keep track of the reducer by id, so we can check if it's been injected aleady
|
|
462
|
-
enhancedStore.injectedReducers[id] = reducers;
|
|
463
|
-
|
|
410
|
+
enhancedStore.injectedReducers[id] = reducers;
|
|
411
|
+
// ...when we create the new reducer though, we spread the reducers from each namespace
|
|
464
412
|
enhancedStore.replaceReducer(createInternalReducer(mergeObjectValues(enhancedStore.injectedReducers)));
|
|
465
413
|
}
|
|
466
414
|
};
|
|
467
|
-
|
|
468
415
|
enhancedStore.removeReducers = _ref4 => {
|
|
469
416
|
let id = _ref4.id;
|
|
470
417
|
delete enhancedStore.injectedReducers[id];
|
|
471
418
|
enhancedStore.replaceReducer(createInternalReducer(mergeObjectValues(enhancedStore.injectedReducers)));
|
|
472
419
|
};
|
|
473
|
-
|
|
474
420
|
return enhancedStore;
|
|
475
421
|
};
|
|
476
422
|
var internalReduxStore = createReduxStore();
|
|
477
423
|
|
|
478
|
-
const RouteCatchAll = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./route-catch-all-
|
|
479
|
-
/* webpackChunkName: "route-catch-all" */
|
|
480
|
-
); }));
|
|
424
|
+
const RouteCatchAll = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./route-catch-all-373c69c6.cjs.prod.js' /* webpackChunkName: "route-catch-all" */); }));
|
|
481
425
|
|
|
482
426
|
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; }
|
|
483
|
-
|
|
484
427
|
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; }
|
|
485
|
-
|
|
486
428
|
const getSkipTokenRetry = context => {
|
|
487
429
|
const skipTokenRetry = Boolean(context.skipTokenRetry);
|
|
488
430
|
return skipTokenRetry;
|
|
489
431
|
};
|
|
490
|
-
|
|
491
432
|
const forwardTokenRetryHeader = headers => _objectSpread$3(_objectSpread$3({}, headers), {}, {
|
|
492
433
|
[constants$1.SUPPORTED_HEADERS.X_TOKEN_RETRY]: 'true'
|
|
493
|
-
});
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// This link retries requests to the CTP API that have been rejected
|
|
494
437
|
// because of an invalid/expired oauth token.
|
|
495
438
|
// To do so, we resend the request with the header "X-Force-Token: true"
|
|
496
439
|
// so that the MC BE can issue a new token.
|
|
497
440
|
// NOTE: the retry is not meant to work for the MC access token.
|
|
498
|
-
|
|
499
|
-
|
|
500
441
|
const getDoesGraphQLTargetSupportTokenRetry = context => {
|
|
501
442
|
var _context$headers, _context$headers2, _context;
|
|
502
|
-
|
|
503
443
|
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()]);
|
|
504
444
|
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));
|
|
505
445
|
};
|
|
506
|
-
|
|
507
446
|
const isHttpError = error => error.statusCode !== undefined || error.statusCode !== undefined;
|
|
508
|
-
|
|
509
447
|
const isGraphQLError = error => _Array$isArray__default["default"](error) && _someInstanceProperty__default["default"](error).call(error, err => err.message !== undefined || err.extensions !== undefined);
|
|
510
448
|
|
|
449
|
+
// Checks response from GraphQL in order to scan 401 errors and redirect the
|
|
511
450
|
// user to the login page resetting the store and showing the proper message
|
|
512
|
-
|
|
513
451
|
const errorLink = error.onError(_ref => {
|
|
514
452
|
let graphQLErrors = _ref.graphQLErrors,
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
453
|
+
networkError = _ref.networkError,
|
|
454
|
+
operation = _ref.operation,
|
|
455
|
+
forward = _ref.forward;
|
|
519
456
|
if (networkError && isHttpError(networkError) && networkError.statusCode === constants.STATUS_CODES.UNAUTHORIZED) {
|
|
520
457
|
history__default["default"].push("/logout?reason=".concat(constants.LOGOUT_REASONS.UNAUTHORIZED));
|
|
521
458
|
return;
|
|
522
|
-
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// In case of graphql errors, we want to retry unauthenticated requests by
|
|
523
462
|
// forcing our API to fetch a new token, using the `X-Force-Token` header.
|
|
524
463
|
// https://www.apollographql.com/docs/link/links/error/#retrying-failed-requests
|
|
525
464
|
// We need to do this as the `token-retry-link` only works for network errors.
|
|
526
465
|
// https://www.apollographql.com/docs/link/links/retry/
|
|
527
|
-
|
|
528
|
-
|
|
529
466
|
if (graphQLErrors && isGraphQLError(graphQLErrors)) {
|
|
530
467
|
const context = operation.getContext();
|
|
531
|
-
|
|
532
468
|
for (const err of graphQLErrors) {
|
|
533
469
|
var _err$extensions;
|
|
534
|
-
|
|
535
470
|
const isNonAuthenticatedViaExtensionCode = (err === null || err === void 0 ? void 0 : (_err$extensions = err.extensions) === null || _err$extensions === void 0 ? void 0 : _err$extensions.code) === 'UNAUTHENTICATED';
|
|
536
471
|
/**
|
|
537
472
|
* NOTE:
|
|
@@ -540,31 +475,25 @@ const errorLink = error.onError(_ref => {
|
|
|
540
475
|
* property until they introduced support for the `extensions`
|
|
541
476
|
* field.
|
|
542
477
|
*/
|
|
543
|
-
|
|
544
478
|
const isNonAuthenticatedViaCode = (err === null || err === void 0 ? void 0 : err.message) === 'invalid_token';
|
|
545
|
-
|
|
546
479
|
if ((isNonAuthenticatedViaExtensionCode || isNonAuthenticatedViaCode) && getDoesGraphQLTargetSupportTokenRetry(context) && !getSkipTokenRetry(context)) {
|
|
547
480
|
operation.setContext(_ref2 => {
|
|
548
481
|
let headers = _ref2.headers;
|
|
549
482
|
return {
|
|
550
483
|
headers: forwardTokenRetryHeader(headers)
|
|
551
484
|
};
|
|
552
|
-
});
|
|
553
|
-
|
|
485
|
+
});
|
|
486
|
+
// retry the request, returning the new observable
|
|
554
487
|
return forward(operation);
|
|
555
488
|
}
|
|
556
489
|
}
|
|
557
490
|
}
|
|
558
|
-
|
|
559
491
|
return;
|
|
560
492
|
});
|
|
561
493
|
|
|
562
494
|
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); }; }
|
|
563
|
-
|
|
564
495
|
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; } }
|
|
565
|
-
|
|
566
496
|
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; }
|
|
567
|
-
|
|
568
497
|
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; }
|
|
569
498
|
const defaultUserAgent = createHttpUserAgent__default["default"]({
|
|
570
499
|
name: 'unknown-http-client',
|
|
@@ -572,36 +501,27 @@ const defaultUserAgent = createHttpUserAgent__default["default"]({
|
|
|
572
501
|
});
|
|
573
502
|
const defaultForwardToVersion = 'v2';
|
|
574
503
|
const defaultForwardToAudiencePolicy = 'forward-url-full-path';
|
|
575
|
-
|
|
576
504
|
function buildApiUrl(endpoint) {
|
|
577
505
|
var _context;
|
|
578
|
-
|
|
579
506
|
const apiUrl = getMcApiUrl().replace(/\/$/, '');
|
|
580
507
|
return _concatInstanceProperty__default["default"](_context = "".concat(apiUrl)).call(_context, endpoint);
|
|
581
508
|
}
|
|
582
|
-
|
|
583
509
|
const getAppliedForwardToHeaders = forwardToConfig => {
|
|
584
510
|
var _context2, _forwardToConfig$head, _forwardToConfig$vers, _forwardToConfig$audi;
|
|
585
|
-
|
|
586
511
|
if (!forwardToConfig) {
|
|
587
512
|
return {};
|
|
588
513
|
}
|
|
589
|
-
|
|
590
514
|
if (!forwardToConfig.uri) {
|
|
591
515
|
throw new Error("Missing required \"uri\" option.");
|
|
592
516
|
}
|
|
593
|
-
|
|
594
517
|
const exchangeTokenClaims = [];
|
|
595
|
-
|
|
596
518
|
if (forwardToConfig.includeUserPermissions) {
|
|
597
519
|
exchangeTokenClaims.push('permissions');
|
|
598
520
|
}
|
|
599
|
-
|
|
600
521
|
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) => {
|
|
601
522
|
let _ref2 = _slicedToArray(_ref, 2),
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
523
|
+
headerName = _ref2[0],
|
|
524
|
+
headerValue = _ref2[1];
|
|
605
525
|
return _objectSpread$2(_objectSpread$2({}, customForwardHeaders), {}, {
|
|
606
526
|
// Prefix headers so that the MC API can allow and forward them.
|
|
607
527
|
["x-forward-header-".concat(headerName)]: headerValue
|
|
@@ -613,10 +533,8 @@ const getAppliedForwardToHeaders = forwardToConfig => {
|
|
|
613
533
|
[constants$1.SUPPORTED_HEADERS.X_FORWARD_TO_CLAIMS]: exchangeTokenClaims.join(' ')
|
|
614
534
|
});
|
|
615
535
|
};
|
|
616
|
-
|
|
617
536
|
function createHttpClientOptions() {
|
|
618
537
|
var _config$projectKey;
|
|
619
|
-
|
|
620
538
|
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
621
539
|
const sessionToken = getSessionToken();
|
|
622
540
|
const projectKey = (_config$projectKey = config.projectKey) !== null && _config$projectKey !== void 0 ? _config$projectKey : selectProjectKeyFromUrl();
|
|
@@ -637,37 +555,26 @@ function createHttpClientOptions() {
|
|
|
637
555
|
}, getAppliedForwardToHeaders(config.forwardToConfig)))
|
|
638
556
|
};
|
|
639
557
|
}
|
|
640
|
-
|
|
641
558
|
let RenewTokenError = /*#__PURE__*/function (_Error) {
|
|
642
559
|
_inherits(RenewTokenError, _Error);
|
|
643
|
-
|
|
644
560
|
var _super = _createSuper(RenewTokenError);
|
|
645
|
-
|
|
646
561
|
function RenewTokenError(message) {
|
|
647
562
|
var _this;
|
|
648
|
-
|
|
649
563
|
_classCallCheck(this, RenewTokenError);
|
|
650
|
-
|
|
651
564
|
_this = _super.call(this, message);
|
|
652
|
-
|
|
653
565
|
_Object$defineProperty__default["default"](_assertThisInitialized(_this), 'name', {
|
|
654
566
|
value: 'RenewTokenError'
|
|
655
567
|
});
|
|
656
|
-
|
|
657
568
|
return _this;
|
|
658
569
|
}
|
|
659
|
-
|
|
660
570
|
return _createClass(RenewTokenError);
|
|
661
571
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
662
|
-
|
|
663
572
|
async function executeHttpClientRequest(fetcher) {
|
|
664
573
|
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
665
|
-
|
|
666
574
|
// Wrapper function to be called again (once) on retry.
|
|
667
575
|
async function sendRequest() {
|
|
668
576
|
let _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
669
|
-
|
|
670
|
-
|
|
577
|
+
shouldRenewToken = _ref3.shouldRenewToken;
|
|
671
578
|
const requestOptions = createHttpClientOptions(config);
|
|
672
579
|
const response = await fetcher(_objectSpread$2(_objectSpread$2({}, requestOptions), {}, {
|
|
673
580
|
headers: omitEmpty__default["default"](_objectSpread$2(_objectSpread$2({}, requestOptions.headers), {}, {
|
|
@@ -675,22 +582,19 @@ async function executeHttpClientRequest(fetcher) {
|
|
|
675
582
|
[constants$1.SUPPORTED_HEADERS.X_TOKEN_RETRY]: shouldRenewToken
|
|
676
583
|
}))
|
|
677
584
|
}));
|
|
678
|
-
|
|
679
585
|
if (response.statusCode === constants.STATUS_CODES.UNAUTHORIZED) {
|
|
680
586
|
throw new RenewTokenError("Unauthorized response, attempting retry.");
|
|
681
|
-
}
|
|
682
|
-
|
|
587
|
+
}
|
|
683
588
|
|
|
589
|
+
// In case a new session token is returned from the server, save it.
|
|
684
590
|
const refreshedSessionToken = response.getHeader('x-refreshed-session-token');
|
|
685
|
-
|
|
686
591
|
if (refreshedSessionToken) {
|
|
687
592
|
setActiveSession(refreshedSessionToken);
|
|
688
593
|
}
|
|
689
|
-
|
|
690
594
|
return response.data;
|
|
691
|
-
}
|
|
692
|
-
|
|
595
|
+
}
|
|
693
596
|
|
|
597
|
+
// Attempt to send the request.
|
|
694
598
|
return sendRequest().catch(error => {
|
|
695
599
|
if (error instanceof RenewTokenError) {
|
|
696
600
|
// Retry the request and ask to renew the token.
|
|
@@ -698,13 +602,11 @@ async function executeHttpClientRequest(fetcher) {
|
|
|
698
602
|
shouldRenewToken: true
|
|
699
603
|
});
|
|
700
604
|
}
|
|
701
|
-
|
|
702
605
|
throw error;
|
|
703
606
|
});
|
|
704
607
|
}
|
|
705
608
|
|
|
706
609
|
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; }
|
|
707
|
-
|
|
708
610
|
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; }
|
|
709
611
|
const userAgent = createHttpUserAgent__default["default"]({
|
|
710
612
|
name: 'apollo-client',
|
|
@@ -715,47 +617,36 @@ const userAgent = createHttpUserAgent__default["default"]({
|
|
|
715
617
|
// points to the appkit repo issues
|
|
716
618
|
contactEmail: 'support@commercetools.com'
|
|
717
619
|
});
|
|
718
|
-
|
|
719
620
|
const isKnownGraphQlTarget = target => {
|
|
720
621
|
var _context;
|
|
721
|
-
|
|
722
622
|
return target ? _includesInstanceProperty__default["default"](_context = _Object$values__default["default"](constants.GRAPHQL_TARGETS)).call(_context, target) : false;
|
|
723
623
|
};
|
|
724
|
-
|
|
725
624
|
const extractSessionTokenFromResponse = context => {
|
|
726
625
|
var _context$response, _context$response$hea, _context$restResponse;
|
|
727
|
-
|
|
728
626
|
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');
|
|
729
|
-
|
|
730
627
|
if (refreshedSessionToken) {
|
|
731
628
|
return refreshedSessionToken !== null && refreshedSessionToken !== void 0 ? refreshedSessionToken : null;
|
|
732
629
|
}
|
|
733
|
-
|
|
734
630
|
const restResponseWithRefreshTokenHeader = (_context$restResponse = context.restResponses) === null || _context$restResponse === void 0 ? void 0 : _findInstanceProperty__default["default"](_context$restResponse).call(_context$restResponse, response => {
|
|
735
631
|
var _response$headers;
|
|
736
|
-
|
|
737
632
|
return (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.has('x-refreshed-session-token');
|
|
738
633
|
});
|
|
739
|
-
|
|
740
634
|
if (restResponseWithRefreshTokenHeader) {
|
|
741
635
|
var _restResponseWithRefr;
|
|
742
|
-
|
|
743
636
|
return (_restResponseWithRefr = restResponseWithRefreshTokenHeader.headers.get('x-refreshed-session-token')) !== null && _restResponseWithRefr !== void 0 ? _restResponseWithRefr : null;
|
|
744
637
|
}
|
|
745
|
-
|
|
746
638
|
return null;
|
|
747
639
|
};
|
|
640
|
+
|
|
748
641
|
/* eslint-disable import/prefer-default-export */
|
|
749
642
|
// Use a middleware to update the request headers with the correct params.
|
|
750
|
-
|
|
751
|
-
|
|
752
643
|
const headerLink = new client.ApolloLink((operation, forward) => {
|
|
753
644
|
var _context2, _context3;
|
|
754
|
-
|
|
755
645
|
const apolloContext = operation.getContext();
|
|
756
646
|
const variables = operation.variables;
|
|
757
647
|
const graphQlTarget = apolloContext.target || variables.target;
|
|
758
648
|
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, "\""));
|
|
649
|
+
|
|
759
650
|
/**
|
|
760
651
|
* NOTE:
|
|
761
652
|
* The project key is read from the url in a project related application context.
|
|
@@ -764,7 +655,6 @@ const headerLink = new client.ApolloLink((operation, forward) => {
|
|
|
764
655
|
* As a result we allow passing the project key as a variable on the operation allowing
|
|
765
656
|
* it to be the fallback.
|
|
766
657
|
*/
|
|
767
|
-
|
|
768
658
|
const projectKey = apolloContext.projectKey || variables.projectKey || selectProjectKeyFromUrl();
|
|
769
659
|
const teamId = apolloContext.teamId || variables.teamId || selectTeamIdFromLocalStorage();
|
|
770
660
|
const featureFlag = apolloContext.featureFlag || variables.featureFlag;
|
|
@@ -785,11 +675,9 @@ const headerLink = new client.ApolloLink((operation, forward) => {
|
|
|
785
675
|
return _mapInstanceProperty__default["default"](_context3 = forward(operation)).call(_context3, response => {
|
|
786
676
|
const context = operation.getContext();
|
|
787
677
|
const refreshedSessionToken = extractSessionTokenFromResponse(context);
|
|
788
|
-
|
|
789
678
|
if (refreshedSessionToken) {
|
|
790
679
|
setActiveSession(refreshedSessionToken);
|
|
791
680
|
}
|
|
792
|
-
|
|
793
681
|
return response;
|
|
794
682
|
});
|
|
795
683
|
});
|
|
@@ -797,7 +685,6 @@ const headerLink = new client.ApolloLink((operation, forward) => {
|
|
|
797
685
|
const tokenRetryLink = new retry.RetryLink({
|
|
798
686
|
attempts: (count, operation, error) => {
|
|
799
687
|
const context = operation.getContext();
|
|
800
|
-
|
|
801
688
|
if ((error === null || error === void 0 ? void 0 : error.statusCode) === constants.STATUS_CODES.UNAUTHORIZED && count === 1 && getDoesGraphQLTargetSupportTokenRetry(context) && !getSkipTokenRetry(context)) {
|
|
802
689
|
operation.setContext(_ref => {
|
|
803
690
|
let headers = _ref.headers;
|
|
@@ -807,65 +694,61 @@ const tokenRetryLink = new retry.RetryLink({
|
|
|
807
694
|
});
|
|
808
695
|
return true;
|
|
809
696
|
}
|
|
810
|
-
|
|
811
697
|
return false;
|
|
812
698
|
}
|
|
813
699
|
});
|
|
814
700
|
|
|
815
701
|
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; }
|
|
816
|
-
|
|
817
702
|
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; }
|
|
818
703
|
const httpLink = client.createHttpLink({
|
|
819
704
|
uri: "".concat(getMcApiUrl(), "/graphql"),
|
|
820
705
|
fetch
|
|
821
706
|
});
|
|
822
|
-
|
|
823
707
|
const createApolloLink = function () {
|
|
824
708
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
825
|
-
return (
|
|
709
|
+
return (
|
|
710
|
+
// The order of links is IMPORTANT!
|
|
826
711
|
// In the request-phase they are executed top to bottom.
|
|
827
712
|
// In the response/phase they are executed bottom to top.
|
|
828
713
|
// The `httpLink` is terminating so it must be last, while `tokenRetryLink` and `errorLink`
|
|
829
714
|
// wrap the links the their right.
|
|
830
|
-
client.from([headerLink,
|
|
715
|
+
client.from([headerLink,
|
|
716
|
+
// See https://www.apollographql.com/docs/react/api/link/apollo-link-rest/#link-order
|
|
831
717
|
// State & context links should happen before (to the left of) `restLink`.
|
|
832
|
-
...(options.restLink ? [options.restLink] : []),
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
718
|
+
...(options.restLink ? [options.restLink] : []),
|
|
719
|
+
// Must be before `tokenRetryLink`.
|
|
720
|
+
errorLink,
|
|
721
|
+
// Avoid logging queries in test environment
|
|
722
|
+
...(isLoggerEnabled() ? [loggerLink__default["default"]] : []),
|
|
723
|
+
// Must be after `errorLink`.
|
|
724
|
+
tokenRetryLink,
|
|
725
|
+
// Must be last.
|
|
836
726
|
httpLink])
|
|
837
727
|
);
|
|
838
|
-
};
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
// This custom merge function allows to merge two arrays of objects.
|
|
839
731
|
// The incoming list is what we need to update to, but we still need
|
|
840
732
|
// to ensure that existing cache elements are not removed but updated.
|
|
841
733
|
// This is usually the case when elements get removed.
|
|
842
|
-
|
|
843
|
-
|
|
844
734
|
const mergeArraysObjects = function () {
|
|
845
735
|
let existing = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
846
736
|
let incoming = arguments.length > 1 ? arguments[1] : undefined;
|
|
847
|
-
|
|
848
737
|
let _ref = arguments.length > 2 ? arguments[2] : undefined,
|
|
849
|
-
|
|
850
|
-
|
|
738
|
+
mergeObjects = _ref.mergeObjects;
|
|
851
739
|
return _reduceInstanceProperty__default["default"](incoming).call(incoming, (mergedElements, elem) => {
|
|
852
740
|
const existingElem = _findInstanceProperty__default["default"](existing).call(existing, el => el.__ref === elem.__ref);
|
|
853
|
-
|
|
854
741
|
if (existingElem) {
|
|
855
742
|
const updatedElem = mergeObjects(existingElem, elem);
|
|
856
|
-
|
|
857
743
|
if (updatedElem) {
|
|
858
744
|
return [...mergedElements, updatedElem];
|
|
859
745
|
}
|
|
860
746
|
}
|
|
861
|
-
|
|
862
747
|
return [...mergedElements, elem];
|
|
863
748
|
}, []);
|
|
864
749
|
};
|
|
865
|
-
|
|
866
750
|
const createApolloClient = function () {
|
|
867
751
|
var _options$cache, _customCacheConfig$ty;
|
|
868
|
-
|
|
869
752
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
870
753
|
const customCacheConfig = (_options$cache = options === null || options === void 0 ? void 0 : options.cache) !== null && _options$cache !== void 0 ? _options$cache : {};
|
|
871
754
|
return new client.ApolloClient({
|