@burdenoff/microfe-notification 2026.1029.2 → 2026.1113.1
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/AdminNotificationRoot.d.ts +33 -0
- package/dist/AdminNotificationRoot.js +9 -6
- package/dist/AdminNotificationRoot.js.map +1 -1
- package/dist/AdminNotificationRoutes.d.ts +1 -0
- package/dist/AdminNotificationRoutes.js +22 -23
- package/dist/AdminNotificationRoutes.js.map +1 -1
- package/dist/NotificationRoot.d.ts +29 -0
- package/dist/NotificationRoot.js +9 -6
- package/dist/NotificationRoot.js.map +1 -1
- package/dist/NotificationRoutes.d.ts +18 -0
- package/dist/NotificationRoutes.js +109 -38
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/UserNotificationRoot.d.ts +32 -0
- package/dist/UserNotificationRoot.js +9 -6
- package/dist/UserNotificationRoot.js.map +1 -1
- package/dist/UserNotificationRoutes.d.ts +16 -0
- package/dist/UserNotificationRoutes.js +9 -10
- package/dist/UserNotificationRoutes.js.map +1 -1
- package/dist/components/ConfirmDeleteDialog.d.ts +17 -0
- package/dist/components/ConfirmDeleteDialog.js +22 -0
- package/dist/components/ConfirmDeleteDialog.js.map +1 -0
- package/dist/components/FeatureDisabledPage.d.ts +6 -0
- package/dist/components/FeatureDisabledPage.js +1 -2
- package/dist/components/FeatureDisabledPage.js.map +1 -1
- package/dist/components/NotificationBell.d.ts +13 -0
- package/dist/components/NotificationBell.js +6 -7
- package/dist/components/NotificationBell.js.map +1 -1
- package/dist/components/NotificationCard.d.ts +27 -0
- package/dist/components/NotificationCard.js +106 -76
- package/dist/components/NotificationCard.js.map +1 -1
- package/dist/components/NotificationPanel.d.ts +10 -0
- package/dist/components/NotificationPanel.js +5 -6
- package/dist/components/NotificationPanel.js.map +1 -1
- package/dist/components/RecipientSelector.d.ts +32 -0
- package/dist/components/RecipientSelector.js +2 -3
- package/dist/components/RecipientSelector.js.map +1 -1
- package/dist/components/TemplatePreview.d.ts +21 -0
- package/dist/components/TemplatePreview.js +3 -4
- package/dist/components/TemplatePreview.js.map +1 -1
- package/dist/components/VariableInserter.d.ts +11 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +4 -3
- package/dist/constants/permissions.d.ts +23 -0
- package/dist/constants/permissions.js +1 -2
- package/dist/constants/permissions.js.map +1 -1
- package/dist/dev/main.d.ts +0 -0
- package/dist/generated/global-operations.d.ts +2119 -0
- package/dist/generated/global-operations.js +80 -69
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +23507 -0
- package/dist/generated/wspace-operations.d.ts +4 -0
- package/dist/generated/wspace-types.d.ts +57831 -0
- package/dist/graphql/global-client.d.ts +32 -0
- package/dist/graphql/global-client.js +23 -30
- package/dist/graphql/global-client.js.map +1 -1
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +7 -6
- package/dist/hooks/useNotificationAdmin.d.ts +46 -0
- package/dist/hooks/useNotificationAdmin.js +18 -17
- package/dist/hooks/useNotificationAdmin.js.map +1 -1
- package/dist/hooks/useNotificationAnalytics.d.ts +65 -0
- package/dist/hooks/useNotificationAnalytics.js +1 -2
- package/dist/hooks/useNotificationAnalytics.js.map +1 -1
- package/dist/hooks/useNotificationPreferences.d.ts +10 -0
- package/dist/hooks/useNotificationPreferences.js +7 -7
- package/dist/hooks/useNotificationPreferences.js.map +1 -1
- package/dist/hooks/useNotificationTemplates.d.ts +131 -0
- package/dist/hooks/useNotificationTemplates.js +1 -2
- package/dist/hooks/useNotificationTemplates.js.map +1 -1
- package/dist/hooks/useNotificationTopics.d.ts +35 -0
- package/dist/hooks/useNotificationTopics.js +22 -22
- package/dist/hooks/useNotificationTopics.js.map +1 -1
- package/dist/hooks/useNotifications.d.ts +39 -0
- package/dist/hooks/useNotifications.js +6 -4
- package/dist/hooks/useNotifications.js.map +1 -1
- package/dist/hooks/usePreferenceToggles.d.ts +27 -0
- package/dist/hooks/usePreferenceToggles.js +84 -0
- package/dist/hooks/usePreferenceToggles.js.map +1 -0
- package/dist/hooks/useSendNotification.d.ts +158 -0
- package/dist/hooks/useSendNotification.js +12 -10
- package/dist/hooks/useSendNotification.js.map +1 -1
- package/dist/hooks/useUserSearch.d.ts +26 -0
- package/dist/hooks/useUserSearch.js +8 -10
- package/dist/hooks/useUserSearch.js.map +1 -1
- package/dist/index.d.ts +36 -0
- package/dist/index.js +8 -8
- package/dist/navigation-v2/AdminPageV2.d.ts +14 -0
- package/dist/navigation-v2/AdminPageV2.js +51 -0
- package/dist/navigation-v2/AdminPageV2.js.map +1 -0
- package/dist/navigation-v2/AdminToolsMenu.d.ts +6 -0
- package/dist/navigation-v2/AdminToolsMenu.js +32 -0
- package/dist/navigation-v2/AdminToolsMenu.js.map +1 -0
- package/dist/navigation-v2/BackToNotifications.d.ts +2 -0
- package/dist/navigation-v2/BackToNotifications.js +20 -0
- package/dist/navigation-v2/BackToNotifications.js.map +1 -0
- package/dist/navigation-v2/FilterControls.d.ts +25 -0
- package/dist/navigation-v2/FilterControls.js +64 -0
- package/dist/navigation-v2/FilterControls.js.map +1 -0
- package/dist/navigation-v2/NotificationArchivedV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationArchivedV2.js +174 -0
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -0
- package/dist/navigation-v2/NotificationInboxV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationInboxV2.js +309 -0
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -0
- package/dist/navigation-v2/NotificationSettingsV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationSettingsV2.js +203 -0
- package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -0
- package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -0
- package/dist/navigation-v2/NotificationsV2Landing.js +37 -0
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -0
- package/dist/navigation-v2/__tests__/uiMocks.d.ts +71 -0
- package/dist/navigation-v2/inboxFilters.d.ts +8 -0
- package/dist/navigation-v2/inboxFilters.js +10 -0
- package/dist/navigation-v2/inboxFilters.js.map +1 -0
- package/dist/navigation-v2/paths.d.ts +24 -0
- package/dist/navigation-v2/paths.js +31 -0
- package/dist/navigation-v2/paths.js.map +1 -0
- package/dist/navigation-v2/settingsOptions.d.ts +12 -0
- package/dist/navigation-v2/settingsOptions.js +58 -0
- package/dist/navigation-v2/settingsOptions.js.map +1 -0
- package/dist/navigation-v2/useAdminTools.d.ts +22 -0
- package/dist/navigation-v2/useAdminTools.js +76 -0
- package/dist/navigation-v2/useAdminTools.js.map +1 -0
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
- package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +7 -8
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +9 -10
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +5 -6
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +4 -5
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/version.js +2 -3
- package/dist/node_modules/@apollo/client/version.js.map +1 -1
- package/dist/node_modules/@wry/caches/lib/weak.js +1 -2
- package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -1
- package/dist/node_modules/@wry/trie/lib/index.js +2 -3
- package/dist/node_modules/@wry/trie/lib/index.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/client.js +76 -69
- package/dist/node_modules/graphql-ws/dist/client.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +2 -3
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +41 -42
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +14 -15
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +21 -18
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -1
- package/dist/node_modules/{rxjs/node_modules/tslib → tslib}/tslib.es6.js +1 -2
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/pages/CreateNotificationPage.d.ts +5 -0
- package/dist/pages/CreateNotificationPage.js +591 -573
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.d.ts +8 -0
- package/dist/pages/NotificationCenterPage.js +87 -83
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.d.ts +2 -0
- package/dist/pages/NotificationHistoryAdminPage.js +7 -8
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.d.ts +6 -0
- package/dist/pages/NotificationHistoryPage.js +59 -55
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationLandingPage.d.ts +10 -0
- package/dist/pages/NotificationLandingPage.js +5 -6
- package/dist/pages/NotificationLandingPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.d.ts +5 -0
- package/dist/pages/NotificationPreferencesPage.js +97 -159
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.d.ts +7 -0
- package/dist/pages/NotificationTemplatesPage.js +192 -172
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.d.ts +1 -0
- package/dist/pages/NotificationTopicsPage.js +126 -112
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.d.ts +12 -0
- package/dist/pages/TemplateEditorPage.js +381 -341
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/dist/providers/NotificationProvider.d.ts +11 -0
- package/dist/providers/NotificationProvider.js +7 -7
- package/dist/providers/NotificationProvider.js.map +1 -1
- package/dist/shared/hooks/useTr.d.ts +13 -0
- package/dist/shared/hooks/useTr.js +1 -2
- package/dist/shared/hooks/useTr.js.map +1 -1
- package/dist/store/notificationStore.d.ts +30 -0
- package/dist/store/notificationStore.js +1 -2
- package/dist/store/notificationStore.js.map +1 -1
- package/dist/test/happydom.d.ts +1 -0
- package/dist/translations/en.d.ts +468 -0
- package/dist/types/index.d.ts +257 -0
- package/dist/utils/inAppNavigation.d.ts +37 -0
- package/dist/utils/inAppNavigation.js +2 -3
- package/dist/utils/inAppNavigation.js.map +1 -1
- package/dist/utils/index.d.ts +68 -0
- package/dist/utils/index.js +1 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +2 -0
- package/dist/utils/nativeBridge.js +1 -2
- package/dist/utils/notificationHistoryExport.d.ts +12 -0
- package/dist/utils/notificationHistoryExport.js +1 -2
- package/dist/utils/notificationHistoryExport.js.map +1 -1
- package/package.json +67 -49
- package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { NotificationCenterPage as e } from "../pages/NotificationCenterPage.js";
|
|
2
|
+
import { AdminPageV2 as t } from "./AdminPageV2.js";
|
|
3
|
+
import { useNotificationPaths as n } from "./paths.js";
|
|
4
|
+
import { Suspense as r, lazy as i } from "react";
|
|
5
|
+
import { useFeatureFlagDetails as a } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
6
|
+
import { Navigate as o, useSearchParams as s } from "react-router";
|
|
7
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
8
|
+
// src/navigation-v2/NotificationsV2Landing.tsx
|
|
9
|
+
var l = i(() => import("../pages/NotificationHistoryAdminPage.js").then((e) => ({ default: e.NotificationHistoryAdminPage })));
|
|
10
|
+
function u() {
|
|
11
|
+
return /* @__PURE__ */ c("div", {
|
|
12
|
+
className: "flex h-64 items-center justify-center",
|
|
13
|
+
children: /* @__PURE__ */ c("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function d() {
|
|
17
|
+
let [i] = s(), d = n(), f = i.get("tab"), p = a("notification.history"), m = p ? !!p.value : !1;
|
|
18
|
+
return f === "send" ? /* @__PURE__ */ c(o, {
|
|
19
|
+
to: d.send,
|
|
20
|
+
replace: !0
|
|
21
|
+
}) : f === "templates" ? /* @__PURE__ */ c(o, {
|
|
22
|
+
to: d.templates,
|
|
23
|
+
replace: !0
|
|
24
|
+
}) : f === "topics" ? /* @__PURE__ */ c(o, {
|
|
25
|
+
to: d.topics,
|
|
26
|
+
replace: !0
|
|
27
|
+
}) : f === "history" && m ? /* @__PURE__ */ c(t, {
|
|
28
|
+
tool: "deliveryLog",
|
|
29
|
+
children: /* @__PURE__ */ c(r, {
|
|
30
|
+
fallback: /* @__PURE__ */ c(u, {}),
|
|
31
|
+
children: /* @__PURE__ */ c(l, {})
|
|
32
|
+
})
|
|
33
|
+
}) : /* @__PURE__ */ c(e, {});
|
|
34
|
+
}
|
|
35
|
+
export { d as NotificationsV2Landing };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=NotificationsV2Landing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationsV2Landing.js","names":["NotificationHistoryAdminPage","lazy","m","PageLoader","NotificationsV2Landing","params","useSearchParams","paths","useNotificationPaths","tab","historyDetails","useFeatureFlagDetails","historyEnabled","Navigate","AdminPageV2","Suspense","NotificationCenterPage"],"sources":["../../src/navigation-v2/NotificationsV2Landing.tsx"],"sourcesContent":["import { Suspense, lazy } from 'react';\nimport { Navigate, useSearchParams } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { NotificationCenterPage } from '../pages/NotificationCenterPage';\nimport { AdminPageV2 } from './AdminPageV2';\nimport { useNotificationPaths } from './paths';\n\nconst NotificationHistoryAdminPage = lazy(() =>\n import('../pages/NotificationHistoryAdminPage').then((m) => ({\n default: m.NotificationHistoryAdminPage,\n }))\n);\n\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * `/notifications` under Navigation v2 (BOFF-11872): straight on the inbox,\n * no tab strip. Every old `?tab=` value still opens its page: `send`,\n * `templates` and `topics` go to their own routes, `history` is the Delivery\n * log (which has no route of its own, and, as on the old landing, opens only\n * while `notification.history` is on), and `inbox` or anything unknown is the\n * inbox.\n */\nexport function NotificationsV2Landing() {\n const [params] = useSearchParams();\n const paths = useNotificationPaths();\n const tab = params.get('tab');\n const historyDetails = useFeatureFlagDetails('notification.history');\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n if (tab === 'send') return <Navigate to={paths.send} replace />;\n if (tab === 'templates') return <Navigate to={paths.templates} replace />;\n if (tab === 'topics') return <Navigate to={paths.topics} replace />;\n if (tab === 'history' && historyEnabled) {\n return (\n <AdminPageV2 tool=\"deliveryLog\">\n <Suspense fallback={<PageLoader />}>\n <NotificationHistoryAdminPage />\n </Suspense>\n </AdminPageV2>\n );\n }\n return <NotificationCenterPage />;\n}\n"],"mappings":";;;;;;;;AAOA,IAAMA,IAA+BC,QACnC,OAAO,2CAAwC,CAAC,MAAM,OAAO,EAC3D,SAASC,EAAE,6BACb,EAAE,CACJ;AAEA,SAASC,IAAa;CACpB,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA;AAET;AAUA,SAAgBC,IAAyB;CACvC,IAAM,CAACC,KAAUC,EAAgB,GAC3BC,IAAQC,EAAqB,GAC7BC,IAAMJ,EAAO,IAAI,KAAK,GACtBK,IAAiBC,EAAsB,sBAAsB,GAC7DC,IAAiBF,IAAiB,EAAQA,EAAe,QAAS;CAcxE,OAZID,MAAQ,SAAe,kBAACI,GAAD;EAAU,IAAIN,EAAM;EAAM,SAAA;CAAS,CAAA,IAC1DE,MAAQ,cAAoB,kBAACI,GAAD;EAAU,IAAIN,EAAM;EAAW,SAAA;CAAS,CAAA,IACpEE,MAAQ,WAAiB,kBAACI,GAAD;EAAU,IAAIN,EAAM;EAAQ,SAAA;CAAS,CAAA,IAC9DE,MAAQ,aAAaG,IAErB,kBAACE,GAAD;EAAa,MAAK;EAChB,UAAA,kBAACC,GAAD;GAAU,UAAU,kBAACZ,GAAD,CAAa,CAAA;GAC/B,UAAA,kBAACH,GAAD,CAA+B,CAAA;EACvB,CAAA;CACC,CAAA,IAGV,kBAACgB,GAAD,CAAyB,CAAA;AAClC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type Children = {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare function Passthrough({ children }: Children): import('react').JSX.Element;
|
|
6
|
+
export declare const feLibsUiMock: {
|
|
7
|
+
Button: ({ children, asChild, ...rest }: Children & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
} & Record<string, unknown>) => import('react').JSX.Element;
|
|
10
|
+
Input: (props: Record<string, unknown>) => import('react').JSX.Element;
|
|
11
|
+
NativeSelect: ({ options, value, onValueChange, "aria-label": ariaLabel, }: {
|
|
12
|
+
options: Array<{
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}>;
|
|
16
|
+
value?: string;
|
|
17
|
+
onValueChange?: (value: string) => void;
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
}) => import('react').JSX.Element;
|
|
20
|
+
IllustratedEmptyState: ({ title, description, action, }: {
|
|
21
|
+
title: string;
|
|
22
|
+
description?: ReactNode;
|
|
23
|
+
action?: ReactNode;
|
|
24
|
+
}) => import('react').JSX.Element;
|
|
25
|
+
useRememberedOpen: (_key: string, initial?: boolean) => [boolean, import('react').Dispatch<import('react').SetStateAction<boolean>>];
|
|
26
|
+
DropdownMenu: typeof Passthrough;
|
|
27
|
+
DropdownMenuTrigger: typeof Passthrough;
|
|
28
|
+
DropdownMenuContent: typeof Passthrough;
|
|
29
|
+
DropdownMenuItem: ({ children, onSelect, disabled, ...rest }: Children & {
|
|
30
|
+
onSelect?: () => void;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
} & Record<string, unknown>) => import('react').JSX.Element;
|
|
33
|
+
Tooltip: typeof Passthrough;
|
|
34
|
+
TooltipTrigger: typeof Passthrough;
|
|
35
|
+
TooltipContent: ({ children }: Children) => import('react').JSX.Element;
|
|
36
|
+
Switch: ({ id, checked, disabled, onCheckedChange, }: {
|
|
37
|
+
id?: string;
|
|
38
|
+
checked?: boolean;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
41
|
+
}) => import('react').JSX.Element;
|
|
42
|
+
OptionalFields: ({ children }: Children) => import('react').JSX.Element;
|
|
43
|
+
EmphasisPanel: ({ children }: Children) => import('react').JSX.Element;
|
|
44
|
+
GlassCard: ({ children }: Children) => import('react').JSX.Element;
|
|
45
|
+
PagePurpose: () => null;
|
|
46
|
+
NextSteps: ({ steps }: {
|
|
47
|
+
steps: Array<{
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
href?: string;
|
|
51
|
+
}>;
|
|
52
|
+
}) => import('react').JSX.Element;
|
|
53
|
+
AlertDialog: ({ open, children }: Children & {
|
|
54
|
+
open?: boolean;
|
|
55
|
+
}) => import('react').JSX.Element | null;
|
|
56
|
+
AlertDialogContent: typeof Passthrough;
|
|
57
|
+
AlertDialogHeader: typeof Passthrough;
|
|
58
|
+
AlertDialogFooter: typeof Passthrough;
|
|
59
|
+
AlertDialogTitle: ({ children }: Children) => import('react').JSX.Element;
|
|
60
|
+
AlertDialogDescription: ({ children }: Children) => import('react').JSX.Element;
|
|
61
|
+
AlertDialogCancel: ({ children, onClick }: Children & {
|
|
62
|
+
onClick?: () => void;
|
|
63
|
+
}) => import('react').JSX.Element;
|
|
64
|
+
AlertDialogAction: ({ children, onClick }: Children & {
|
|
65
|
+
onClick?: () => void;
|
|
66
|
+
}) => import('react').JSX.Element;
|
|
67
|
+
AccessGate: ({ message }: {
|
|
68
|
+
message: string;
|
|
69
|
+
}) => import('react').JSX.Element;
|
|
70
|
+
};
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Notification } from '../types';
|
|
2
|
+
/** The read-state chips at level 1. "Needs action" means the item carries action buttons. */
|
|
3
|
+
export type InboxView = 'all' | 'unread' | 'action';
|
|
4
|
+
/** Items that ask the person to do something: they carry action buttons (approvals). */
|
|
5
|
+
export declare function needsAction(notification: Notification): boolean;
|
|
6
|
+
/** "Archived" shows what you archived; "Everything" is the full personal history. */
|
|
7
|
+
export type ArchivedView = 'archived' | 'everything';
|
|
8
|
+
export declare function inArchivedView(notification: Notification, view: ArchivedView): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inboxFilters.js","names":["needsAction","notification","inArchivedView","view"],"sources":["../../src/navigation-v2/inboxFilters.ts"],"sourcesContent":["import type { Notification } from '../types';\n\n/** The read-state chips at level 1. \"Needs action\" means the item carries action buttons. */\nexport type InboxView = 'all' | 'unread' | 'action';\n\n/** Items that ask the person to do something: they carry action buttons (approvals). */\nexport function needsAction(notification: Notification): boolean {\n return notification.actions.length > 0;\n}\n\n/** \"Archived\" shows what you archived; \"Everything\" is the full personal history. */\nexport type ArchivedView = 'archived' | 'everything';\n\nexport function inArchivedView(notification: Notification, view: ArchivedView): boolean {\n return view === 'everything' || Boolean(notification.archivedAt);\n}\n"],"mappings":";AAMA,SAAgBA,EAAY,GAAqC;CAC/D,OAAOC,EAAa,QAAQ,SAAS;AACvC;AAKA,SAAgBC,EAAe,GAA4B,GAA6B;CACtF,OAAOC,MAAS,gBAAgB,EAAQF,EAAa;AACvD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** `base` + `sub` with exactly one slash between them; `sub` empty gives `base`. */
|
|
2
|
+
export declare function joinNotificationPath(basePath: string | undefined, sub?: string): string;
|
|
3
|
+
/** Absolute paths for every page of the module, from where the shell mounted it. */
|
|
4
|
+
export interface NotificationPaths {
|
|
5
|
+
inbox: string;
|
|
6
|
+
center: string;
|
|
7
|
+
archived: string;
|
|
8
|
+
preferences: string;
|
|
9
|
+
send: string;
|
|
10
|
+
templates: string;
|
|
11
|
+
newTemplate: string;
|
|
12
|
+
template: (idOrSlug: string) => string;
|
|
13
|
+
topics: string;
|
|
14
|
+
deliveryLog: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function buildNotificationPaths(basePath: string | undefined): NotificationPaths;
|
|
17
|
+
/**
|
|
18
|
+
* The module's paths, absolute. Navigating with these (never a relative
|
|
19
|
+
* `navigate('new')`) means a page works the same whether it was opened by its
|
|
20
|
+
* own route or inside the old tabbed landing (BOFF-11872 §8 items 3, 4, 11).
|
|
21
|
+
*/
|
|
22
|
+
export declare function useNotificationPaths(): NotificationPaths;
|
|
23
|
+
/** True when the host turned on FluidGrids' Navigation v2 layout. */
|
|
24
|
+
export declare function useNavigationV2(): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useNotification as e } from "../providers/NotificationProvider.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
// src/navigation-v2/paths.ts
|
|
4
|
+
function n(e, t = "") {
|
|
5
|
+
let n = (e ?? "/").replace(/\/+$/, ""), r = t.replace(/^\/+/, "");
|
|
6
|
+
return r ? `${n}/${r}` : n || "/";
|
|
7
|
+
}
|
|
8
|
+
function r(e) {
|
|
9
|
+
return {
|
|
10
|
+
inbox: n(e),
|
|
11
|
+
center: n(e, "center"),
|
|
12
|
+
archived: n(e, "history"),
|
|
13
|
+
preferences: n(e, "preferences"),
|
|
14
|
+
send: n(e, "create"),
|
|
15
|
+
templates: n(e, "templates"),
|
|
16
|
+
newTemplate: n(e, "templates/new"),
|
|
17
|
+
template: (t) => n(e, `templates/${encodeURIComponent(t)}`),
|
|
18
|
+
topics: n(e, "topics"),
|
|
19
|
+
deliveryLog: `${n(e)}?tab=history`
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function i() {
|
|
23
|
+
let { basePath: n } = e();
|
|
24
|
+
return t(() => r(n), [n]);
|
|
25
|
+
}
|
|
26
|
+
function a() {
|
|
27
|
+
return !!e().navigationV2;
|
|
28
|
+
}
|
|
29
|
+
export { r as buildNotificationPaths, n as joinNotificationPath, a as useNavigationV2, i as useNotificationPaths };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","names":["joinNotificationPath","base","basePath","tail","sub","buildNotificationPaths","idOrSlug","useNotificationPaths","useNotification","useMemo","useNavigationV2"],"sources":["../../src/navigation-v2/paths.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useNotification } from '../providers/NotificationProvider';\n\n/** `base` + `sub` with exactly one slash between them; `sub` empty gives `base`. */\nexport function joinNotificationPath(basePath: string | undefined, sub = ''): string {\n const base = (basePath ?? '/').replace(/\\/+$/, '');\n const tail = sub.replace(/^\\/+/, '');\n if (!tail) return base || '/';\n return `${base}/${tail}`;\n}\n\n/** Absolute paths for every page of the module, from where the shell mounted it. */\nexport interface NotificationPaths {\n inbox: string;\n center: string;\n archived: string;\n preferences: string;\n send: string;\n templates: string;\n newTemplate: string;\n template: (idOrSlug: string) => string;\n topics: string;\n deliveryLog: string;\n}\n\nexport function buildNotificationPaths(basePath: string | undefined): NotificationPaths {\n return {\n inbox: joinNotificationPath(basePath),\n center: joinNotificationPath(basePath, 'center'),\n archived: joinNotificationPath(basePath, 'history'),\n preferences: joinNotificationPath(basePath, 'preferences'),\n send: joinNotificationPath(basePath, 'create'),\n templates: joinNotificationPath(basePath, 'templates'),\n newTemplate: joinNotificationPath(basePath, 'templates/new'),\n template: (idOrSlug: string) =>\n joinNotificationPath(basePath, `templates/${encodeURIComponent(idOrSlug)}`),\n topics: joinNotificationPath(basePath, 'topics'),\n // The delivery log has no route of its own; it is the old landing's\n // `?tab=history`, kept so every old link still opens it.\n deliveryLog: `${joinNotificationPath(basePath)}?tab=history`,\n };\n}\n\n/**\n * The module's paths, absolute. Navigating with these (never a relative\n * `navigate('new')`) means a page works the same whether it was opened by its\n * own route or inside the old tabbed landing (BOFF-11872 §8 items 3, 4, 11).\n */\nexport function useNotificationPaths(): NotificationPaths {\n const { basePath } = useNotification();\n return useMemo(() => buildNotificationPaths(basePath), [basePath]);\n}\n\n/** True when the host turned on FluidGrids' Navigation v2 layout. */\nexport function useNavigationV2(): boolean {\n return Boolean(useNotification().navigationV2);\n}\n"],"mappings":";;;AAIA,SAAgBA,EAAqB,GAA8B,IAAM,IAAY;CACnF,IAAMC,KAAQC,KAAY,IAAA,CAAK,QAAQ,QAAQ,EAAE,GAC3CC,IAAOC,EAAI,QAAQ,QAAQ,EAAE;CAEnC,OADKD,IACE,GAAGF,EAAK,GAAGE,MADAF,KAAQ;AAE5B;AAgBA,SAAgBI,EAAuB,GAAiD;CACtF,OAAO;EACL,OAAOL,EAAqBE,CAAQ;EACpC,QAAQF,EAAqBE,GAAU,QAAQ;EAC/C,UAAUF,EAAqBE,GAAU,SAAS;EAClD,aAAaF,EAAqBE,GAAU,aAAa;EACzD,MAAMF,EAAqBE,GAAU,QAAQ;EAC7C,WAAWF,EAAqBE,GAAU,WAAW;EACrD,aAAaF,EAAqBE,GAAU,eAAe;EAC3D,WAAW,MACTF,EAAqBE,GAAU,aAAa,mBAAmBI,CAAQ,GAAG;EAC5E,QAAQN,EAAqBE,GAAU,QAAQ;EAG/C,aAAa,GAAGF,EAAqBE,CAAQ,EAAE;CACjD;AACF;AAOA,SAAgBK,IAA0C;CACxD,IAAM,EAAE,gBAAaC,EAAgB;CACrC,OAAOC,QAAcJ,EAAuBH,CAAQ,GAAG,CAACA,CAAQ,CAAC;AACnE;AAGA,SAAgBQ,IAA2B;CACzC,OAAO,EAAQF,EAAgB,CAAC,CAAC;AACnC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NotificationChannel, NotificationType } from '../types';
|
|
2
|
+
export type Option<T> = {
|
|
3
|
+
value: T;
|
|
4
|
+
labelKey: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
/** "How to reach you", shown first. */
|
|
8
|
+
export declare const EVERYDAY_CHANNELS: Array<Option<NotificationChannel>>;
|
|
9
|
+
/** The other channels, under "More options". */
|
|
10
|
+
export declare const MORE_CHANNELS: Array<Option<NotificationChannel>>;
|
|
11
|
+
/** The type toggles, in plain words, under "More options". */
|
|
12
|
+
export declare const TYPES: Array<Option<NotificationType>>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// src/navigation-v2/settingsOptions.ts
|
|
2
|
+
var e = [
|
|
3
|
+
{
|
|
4
|
+
value: "IN_APP",
|
|
5
|
+
labelKey: "notifications.channelInApp",
|
|
6
|
+
label: "In-app"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
value: "EMAIL",
|
|
10
|
+
labelKey: "notifications.channelEmail",
|
|
11
|
+
label: "Email"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: "PUSH",
|
|
15
|
+
labelKey: "notifications.channelPush",
|
|
16
|
+
label: "Push"
|
|
17
|
+
}
|
|
18
|
+
], t = [
|
|
19
|
+
{
|
|
20
|
+
value: "SMS",
|
|
21
|
+
labelKey: "notifications.channelSms",
|
|
22
|
+
label: "SMS"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: "WHATSAPP",
|
|
26
|
+
labelKey: "notifications.channelWhatsapp",
|
|
27
|
+
label: "WhatsApp"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "SLACK",
|
|
31
|
+
labelKey: "notifications.channelSlack",
|
|
32
|
+
label: "Slack"
|
|
33
|
+
}
|
|
34
|
+
], n = [
|
|
35
|
+
{
|
|
36
|
+
value: "TRANSACTIONAL",
|
|
37
|
+
labelKey: "notifications.v2.type.transactional",
|
|
38
|
+
label: "About your account and activity"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: "SYSTEM",
|
|
42
|
+
labelKey: "notifications.v2.type.system",
|
|
43
|
+
label: "Product and service updates"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: "ALERT",
|
|
47
|
+
labelKey: "notifications.v2.type.alert",
|
|
48
|
+
label: "Urgent alerts"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
value: "MARKETING",
|
|
52
|
+
labelKey: "notifications.v2.type.marketing",
|
|
53
|
+
label: "News and offers"
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
export { e as EVERYDAY_CHANNELS, t as MORE_CHANNELS, n as TYPES };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=settingsOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsOptions.js","names":["EVERYDAY_CHANNELS","MORE_CHANNELS","TYPES"],"sources":["../../src/navigation-v2/settingsOptions.ts"],"sourcesContent":["import type { NotificationChannel, NotificationType } from '../types';\n\nexport type Option<T> = { value: T; labelKey: string; label: string };\n\n/** \"How to reach you\", shown first. */\nexport const EVERYDAY_CHANNELS: Array<Option<NotificationChannel>> = [\n { value: 'IN_APP', labelKey: 'notifications.channelInApp', label: 'In-app' },\n { value: 'EMAIL', labelKey: 'notifications.channelEmail', label: 'Email' },\n { value: 'PUSH', labelKey: 'notifications.channelPush', label: 'Push' },\n];\n\n/** The other channels, under \"More options\". */\nexport const MORE_CHANNELS: Array<Option<NotificationChannel>> = [\n { value: 'SMS', labelKey: 'notifications.channelSms', label: 'SMS' },\n { value: 'WHATSAPP', labelKey: 'notifications.channelWhatsapp', label: 'WhatsApp' },\n { value: 'SLACK', labelKey: 'notifications.channelSlack', label: 'Slack' },\n];\n\n/** The type toggles, in plain words, under \"More options\". */\nexport const TYPES: Array<Option<NotificationType>> = [\n {\n value: 'TRANSACTIONAL',\n labelKey: 'notifications.v2.type.transactional',\n label: 'About your account and activity',\n },\n {\n value: 'SYSTEM',\n labelKey: 'notifications.v2.type.system',\n label: 'Product and service updates',\n },\n { value: 'ALERT', labelKey: 'notifications.v2.type.alert', label: 'Urgent alerts' },\n { value: 'MARKETING', labelKey: 'notifications.v2.type.marketing', label: 'News and offers' },\n];\n"],"mappings":";AAKA,IAAaA,IAAwD;CACnE;EAAE,OAAO;EAAU,UAAU;EAA8B,OAAO;CAAS;CAC3E;EAAE,OAAO;EAAS,UAAU;EAA8B,OAAO;CAAQ;CACzE;EAAE,OAAO;EAAQ,UAAU;EAA6B,OAAO;CAAO;AACxE,GAGaC,IAAoD;CAC/D;EAAE,OAAO;EAAO,UAAU;EAA4B,OAAO;CAAM;CACnE;EAAE,OAAO;EAAY,UAAU;EAAiC,OAAO;CAAW;CAClF;EAAE,OAAO;EAAS,UAAU;EAA8B,OAAO;CAAQ;AAC3E,GAGaC,IAAyC;CACpD;EACE,OAAO;EACP,UAAU;EACV,OAAO;CACT;CACA;EACE,OAAO;EACP,UAAU;EACV,OAAO;CACT;CACA;EAAE,OAAO;EAAS,UAAU;EAA+B,OAAO;CAAgB;CAClF;EAAE,OAAO;EAAa,UAAU;EAAmC,OAAO;CAAkB;AAC9F"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NotificationPermission } from '../constants/permissions';
|
|
2
|
+
export type AdminToolId = 'send' | 'deliveryLog' | 'templates' | 'topics';
|
|
3
|
+
export interface AdminTool {
|
|
4
|
+
id: AdminToolId;
|
|
5
|
+
label: string;
|
|
6
|
+
href: string;
|
|
7
|
+
}
|
|
8
|
+
/** Which permission(s) each admin page needs: the same as AdminNotificationRoutes. */
|
|
9
|
+
export declare const ADMIN_TOOL_PERMISSIONS: Record<AdminToolId, {
|
|
10
|
+
anyOf?: NotificationPermission[];
|
|
11
|
+
allOf?: NotificationPermission[];
|
|
12
|
+
}>;
|
|
13
|
+
export declare function holdsAdminToolPermission(id: AdminToolId, hasPermission: (permission: string) => boolean): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The admin tools this person may use, in menu order: each needs both its
|
|
16
|
+
* feature flag and its permission (BOFF-11872, NOTIF-LAND-01…06). A page left
|
|
17
|
+
* out is still open by its URL to anyone who holds the permission.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useAdminTools(): {
|
|
20
|
+
tools: AdminTool[];
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { NOTIFICATION_PERMISSIONS as e } from "../constants/permissions.js";
|
|
2
|
+
import { useTr as t } from "../shared/hooks/useTr.js";
|
|
3
|
+
import { useNotificationPaths as n } from "./paths.js";
|
|
4
|
+
import { useMemo as r } from "react";
|
|
5
|
+
import { useFeatureFlagDetails as i } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
6
|
+
import { usePermissions as a } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
7
|
+
// src/navigation-v2/useAdminTools.ts
|
|
8
|
+
var o = {
|
|
9
|
+
send: { allOf: [e.NOTIFICATION_CREATE, e.NOTIFICATION_SEND] },
|
|
10
|
+
deliveryLog: { anyOf: [e.NOTIFICATION_LIST] },
|
|
11
|
+
templates: { anyOf: [
|
|
12
|
+
e.TEMPLATE_LIST,
|
|
13
|
+
e.TEMPLATE_CREATE,
|
|
14
|
+
e.TEMPLATE_UPDATE,
|
|
15
|
+
e.TEMPLATE_DELETE
|
|
16
|
+
] },
|
|
17
|
+
topics: { anyOf: [e.NOTIFICATION_CREATE] }
|
|
18
|
+
};
|
|
19
|
+
function s(e, t) {
|
|
20
|
+
let n = o[e];
|
|
21
|
+
return !(n.allOf && !n.allOf.every((e) => t(e)) || n.anyOf && !n.anyOf.some((e) => t(e)));
|
|
22
|
+
}
|
|
23
|
+
function c(e) {
|
|
24
|
+
let t = i(e);
|
|
25
|
+
return t ? !!t.value : !1;
|
|
26
|
+
}
|
|
27
|
+
function l() {
|
|
28
|
+
let e = t(), i = n(), { hasPermission: o, isLoading: l } = a(), u = c("notification.templates"), d = c("notification.create"), f = c("notification.history");
|
|
29
|
+
return {
|
|
30
|
+
tools: r(() => {
|
|
31
|
+
let t = [
|
|
32
|
+
{
|
|
33
|
+
id: "send",
|
|
34
|
+
label: e("notifications.v2.admin.send", "Send"),
|
|
35
|
+
href: i.send,
|
|
36
|
+
enabled: d
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "deliveryLog",
|
|
40
|
+
label: e("notifications.v2.admin.deliveryLog", "Delivery log"),
|
|
41
|
+
href: i.deliveryLog,
|
|
42
|
+
enabled: f
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "templates",
|
|
46
|
+
label: e("notifications.v2.admin.templates", "Templates"),
|
|
47
|
+
href: i.templates,
|
|
48
|
+
enabled: u
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "topics",
|
|
52
|
+
label: e("notifications.v2.admin.topics", "Topics"),
|
|
53
|
+
href: i.topics,
|
|
54
|
+
enabled: d
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
return l ? [] : t.filter((e) => e.enabled && s(e.id, o)).map(({ id: e, label: t, href: n }) => ({
|
|
58
|
+
id: e,
|
|
59
|
+
label: t,
|
|
60
|
+
href: n
|
|
61
|
+
}));
|
|
62
|
+
}, [
|
|
63
|
+
e,
|
|
64
|
+
i,
|
|
65
|
+
d,
|
|
66
|
+
f,
|
|
67
|
+
u,
|
|
68
|
+
l,
|
|
69
|
+
o
|
|
70
|
+
]),
|
|
71
|
+
isLoading: l
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export { o as ADMIN_TOOL_PERMISSIONS, s as holdsAdminToolPermission, l as useAdminTools };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=useAdminTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAdminTools.js","names":["ADMIN_TOOL_PERMISSIONS","NOTIFICATION_PERMISSIONS","holdsAdminToolPermission","rule","id","hasPermission","p","useFlag","details","useFeatureFlagDetails","key","useAdminTools","tr","useTr","paths","useNotificationPaths","usePermissions","templatesEnabled","createEnabled","historyEnabled","useMemo","all","isLoading","tool"],"sources":["../../src/navigation-v2/useAdminTools.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { NOTIFICATION_PERMISSIONS, type NotificationPermission } from '../constants/permissions';\nimport { useTr } from '../shared/hooks/useTr';\nimport { useNotificationPaths } from './paths';\n\nexport type AdminToolId = 'send' | 'deliveryLog' | 'templates' | 'topics';\n\nexport interface AdminTool {\n id: AdminToolId;\n label: string;\n href: string;\n}\n\n/** Which permission(s) each admin page needs: the same as AdminNotificationRoutes. */\nexport const ADMIN_TOOL_PERMISSIONS: Record<\n AdminToolId,\n { anyOf?: NotificationPermission[]; allOf?: NotificationPermission[] }\n> = {\n send: {\n allOf: [\n NOTIFICATION_PERMISSIONS.NOTIFICATION_CREATE,\n NOTIFICATION_PERMISSIONS.NOTIFICATION_SEND,\n ],\n },\n deliveryLog: { anyOf: [NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST] },\n templates: {\n anyOf: [\n NOTIFICATION_PERMISSIONS.TEMPLATE_LIST,\n NOTIFICATION_PERMISSIONS.TEMPLATE_CREATE,\n NOTIFICATION_PERMISSIONS.TEMPLATE_UPDATE,\n NOTIFICATION_PERMISSIONS.TEMPLATE_DELETE,\n ],\n },\n // Topics CRUD maps to `notification:create` per the backend @rbac (BOFF-2386).\n topics: { anyOf: [NOTIFICATION_PERMISSIONS.NOTIFICATION_CREATE] },\n};\n\nexport function holdsAdminToolPermission(\n id: AdminToolId,\n hasPermission: (permission: string) => boolean\n): boolean {\n const rule = ADMIN_TOOL_PERMISSIONS[id];\n if (rule.allOf && !rule.allOf.every((p) => hasPermission(p))) return false;\n if (rule.anyOf && !rule.anyOf.some((p) => hasPermission(p))) return false;\n return true;\n}\n\n/** Explicit `false` when a flag is unseeded, as the old tabbed landing does. */\nfunction useFlag(key: string): boolean {\n const details = useFeatureFlagDetails(key);\n return details ? Boolean(details.value) : false;\n}\n\n/**\n * The admin tools this person may use, in menu order: each needs both its\n * feature flag and its permission (BOFF-11872, NOTIF-LAND-01…06). A page left\n * out is still open by its URL to anyone who holds the permission.\n */\nexport function useAdminTools(): { tools: AdminTool[]; isLoading: boolean } {\n const tr = useTr();\n const paths = useNotificationPaths();\n const { hasPermission, isLoading } = usePermissions();\n const templatesEnabled = useFlag('notification.templates');\n const createEnabled = useFlag('notification.create');\n const historyEnabled = useFlag('notification.history');\n\n const tools = useMemo(() => {\n const all: Array<AdminTool & { enabled: boolean }> = [\n {\n id: 'send',\n label: tr('notifications.v2.admin.send', 'Send'),\n href: paths.send,\n enabled: createEnabled,\n },\n {\n id: 'deliveryLog',\n label: tr('notifications.v2.admin.deliveryLog', 'Delivery log'),\n href: paths.deliveryLog,\n enabled: historyEnabled,\n },\n {\n id: 'templates',\n label: tr('notifications.v2.admin.templates', 'Templates'),\n href: paths.templates,\n enabled: templatesEnabled,\n },\n {\n id: 'topics',\n label: tr('notifications.v2.admin.topics', 'Topics'),\n href: paths.topics,\n enabled: createEnabled,\n },\n ];\n if (isLoading) return [];\n return all\n .filter((tool) => tool.enabled && holdsAdminToolPermission(tool.id, hasPermission))\n .map(({ id, label, href }) => ({ id, label, href }));\n }, [tr, paths, createEnabled, historyEnabled, templatesEnabled, isLoading, hasPermission]);\n\n return { tools, isLoading };\n}\n"],"mappings":";;;;;;;AAgBA,IAAaA,IAGT;CACF,MAAM,EACJ,OAAO,CACLC,EAAyB,qBACzBA,EAAyB,iBAC3B,EACF;CACA,aAAa,EAAE,OAAO,CAACA,EAAyB,iBAAiB,EAAE;CACnE,WAAW,EACT,OAAO;EACLA,EAAyB;EACzBA,EAAyB;EACzBA,EAAyB;EACzBA,EAAyB;CAC3B,EACF;CAEA,QAAQ,EAAE,OAAO,CAACA,EAAyB,mBAAmB,EAAE;AAClE;AAEA,SAAgBC,EACd,GACA,GACS;CACT,IAAMC,IAAOH,EAAuBI;CAGpC,OADA,EADID,EAAK,SAAS,CAACA,EAAK,MAAM,OAAO,MAAME,EAAcC,CAAC,CAAC,KACvDH,EAAK,SAAS,CAACA,EAAK,MAAM,MAAM,MAAME,EAAcC,CAAC,CAAC;AAE5D;AAGA,SAASC,EAAQ,GAAsB;CACrC,IAAMC,IAAUC,EAAsBC,CAAG;CACzC,OAAOF,IAAU,EAAQA,EAAQ,QAAS;AAC5C;AAOA,SAAgBG,IAA4D;CAC1E,IAAMC,IAAKC,EAAM,GACXC,IAAQC,EAAqB,GAC7B,EAAE,kBAAe,iBAAcC,EAAe,GAC9CC,IAAmBV,EAAQ,wBAAwB,GACnDW,IAAgBX,EAAQ,qBAAqB,GAC7CY,IAAiBZ,EAAQ,sBAAsB;CAmCrD,OAAO;EAAE,OAjCKa,QAAc;GAC1B,IAAMC,IAA+C;IACnD;KACE,IAAI;KACJ,OAAOT,EAAG,+BAA+B,MAAM;KAC/C,MAAME,EAAM;KACZ,SAASI;IACX;IACA;KACE,IAAI;KACJ,OAAON,EAAG,sCAAsC,cAAc;KAC9D,MAAME,EAAM;KACZ,SAASK;IACX;IACA;KACE,IAAI;KACJ,OAAOP,EAAG,oCAAoC,WAAW;KACzD,MAAME,EAAM;KACZ,SAASG;IACX;IACA;KACE,IAAI;KACJ,OAAOL,EAAG,iCAAiC,QAAQ;KACnD,MAAME,EAAM;KACZ,SAASI;IACX;GACF;GAEA,OADII,IAAkB,CAAC,IAChBD,EACJ,QAAQ,MAASE,EAAK,WAAWrB,EAAyBqB,EAAK,IAAIlB,CAAa,CAAC,CAAC,CAClF,KAAK,EAAE,OAAI,UAAO,eAAY;IAAE;IAAI;IAAO;GAAK,EAAE;EACvD,GAAG;GAACO;GAAIE;GAAOI;GAAeC;GAAgBF;GAAkBK;GAAWjB;EAAa,CAE/E;EAAO;CAAU;AAC5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { brand as e, isBranded as t } from "./utils.js";
|
|
2
|
-
|
|
2
|
+
// node_modules/@apollo/client/errors/CombinedGraphQLErrors.js
|
|
3
3
|
function n(e) {
|
|
4
4
|
return e.filter((e) => e).map((e) => e.message || "Error message not found.").join("\n");
|
|
5
5
|
}
|
|
@@ -18,7 +18,6 @@ var r = class r extends Error {
|
|
|
18
18
|
})), this.errors = i, this.data = t.data, this.extensions = t.extensions, this.name = "CombinedGraphQLErrors", e(this), Object.setPrototypeOf(this, r.prototype);
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { r as CombinedGraphQLErrors };
|
|
23
22
|
|
|
24
23
|
//# sourceMappingURL=CombinedGraphQLErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CombinedGraphQLErrors.js","names":[],"sources":["../../../../../node_modules/@apollo/client/errors/CombinedGraphQLErrors.js"],"sourcesContent":["import { brand, isBranded } from \"./utils.js\";\nfunction defaultFormatMessage(errors) {\n return (errors\n // Handle non-spec-compliant servers: See #1185\n .filter((e) => e)\n .map((e) => e.message || \"Error message not found.\")\n .join(\"\\n\"));\n}\n/**\n * Represents the combined list of GraphQL errors returned from the server in a\n * GraphQL response. This error type is used when your GraphQL operation returns\n * errors in the `errors` field of the response.\n *\n * @remarks\n *\n * When your GraphQL operation encounters errors on the server side (such as\n * resolver errors, validation errors, or syntax errors), the server returns\n * these errors in the `errors` array of the GraphQL response. Apollo Client\n * wraps these errors in a `CombinedGraphQLErrors` object, which provides access\n * to the individual errors while maintaining additional context about the\n * response.\n *\n * @example\n *\n * ```ts\n * import { CombinedGraphQLErrors } from \"@apollo/client/errors\";\n *\n * // Check if an error is a CombinedGraphQLErrors object\n * if (CombinedGraphQLErrors.is(error)) {\n * // Access individual GraphQL errors\n * error.errors.forEach((graphQLError) => {\n * console.log(graphQLError.message);\n * console.log(graphQLError.path);\n * console.log(graphQLError.locations);\n * });\n *\n * // Access the original GraphQL result\n * console.log(error.result);\n * }\n * ```\n */\nexport class CombinedGraphQLErrors extends Error {\n /**\n * A method that determines whether an error is a `CombinedGraphQLErrors`\n * object. This method enables TypeScript to narrow the error type.\n * \n * @example\n * \n * ```ts\n * if (CombinedGraphQLErrors.is(error)) {\n * // TypeScript now knows `error` is a `CombinedGraphQLErrors` object\n * console.log(error.errors);\n * }\n * ```\n */\n static is(error) {\n return isBranded(error, \"CombinedGraphQLErrors\");\n }\n /**\n * A function that formats the error message used for the error's `message`\n * property. Override this method to provide your own formatting.\n * \n * @remarks\n * \n * The `formatMessage` function is called by the `CombinedGraphQLErrors`\n * constructor to provide a formatted message as the `message` property of the\n * `CombinedGraphQLErrors` object. Follow the [\"Providing a custom message\n * formatter\"](https://www.apollographql.com/docs/react/api/errors/CombinedGraphQLErrors#providing-a-custom-message-formatter) guide to learn how to modify the message format.\n * \n * @param errors - The array of GraphQL errors returned from the server in\n * the `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n static formatMessage = defaultFormatMessage;\n /**\n * The raw list of GraphQL errors returned by the `errors` field in the GraphQL response.\n */\n errors;\n /**\n * Partial data returned in the `data` field of the GraphQL response.\n */\n data;\n /**\n * Extensions returned by the `extensions` field in the GraphQL response.\n */\n extensions;\n constructor(result, errors = result.errors || []) {\n super(CombinedGraphQLErrors.formatMessage(errors, {\n result,\n defaultFormatMessage,\n }));\n this.errors = errors;\n this.data = result.data;\n this.extensions = result.extensions;\n this.name = \"CombinedGraphQLErrors\";\n brand(this);\n Object.setPrototypeOf(this, CombinedGraphQLErrors.prototype);\n }\n}\n//# sourceMappingURL=CombinedGraphQLErrors.js.map\n"],"
|
|
1
|
+
{"version":3,"file":"CombinedGraphQLErrors.js","names":["defaultFormatMessage","errors","CombinedGraphQLErrors","isBranded","error","result","brand"],"sources":["../../../../../node_modules/@apollo/client/errors/CombinedGraphQLErrors.js"],"sourcesContent":["import { brand, isBranded } from \"./utils.js\";\nfunction defaultFormatMessage(errors) {\n return (errors\n // Handle non-spec-compliant servers: See #1185\n .filter((e) => e)\n .map((e) => e.message || \"Error message not found.\")\n .join(\"\\n\"));\n}\n/**\n * Represents the combined list of GraphQL errors returned from the server in a\n * GraphQL response. This error type is used when your GraphQL operation returns\n * errors in the `errors` field of the response.\n *\n * @remarks\n *\n * When your GraphQL operation encounters errors on the server side (such as\n * resolver errors, validation errors, or syntax errors), the server returns\n * these errors in the `errors` array of the GraphQL response. Apollo Client\n * wraps these errors in a `CombinedGraphQLErrors` object, which provides access\n * to the individual errors while maintaining additional context about the\n * response.\n *\n * @example\n *\n * ```ts\n * import { CombinedGraphQLErrors } from \"@apollo/client/errors\";\n *\n * // Check if an error is a CombinedGraphQLErrors object\n * if (CombinedGraphQLErrors.is(error)) {\n * // Access individual GraphQL errors\n * error.errors.forEach((graphQLError) => {\n * console.log(graphQLError.message);\n * console.log(graphQLError.path);\n * console.log(graphQLError.locations);\n * });\n *\n * // Access the original GraphQL result\n * console.log(error.result);\n * }\n * ```\n */\nexport class CombinedGraphQLErrors extends Error {\n /**\n * A method that determines whether an error is a `CombinedGraphQLErrors`\n * object. This method enables TypeScript to narrow the error type.\n * \n * @example\n * \n * ```ts\n * if (CombinedGraphQLErrors.is(error)) {\n * // TypeScript now knows `error` is a `CombinedGraphQLErrors` object\n * console.log(error.errors);\n * }\n * ```\n */\n static is(error) {\n return isBranded(error, \"CombinedGraphQLErrors\");\n }\n /**\n * A function that formats the error message used for the error's `message`\n * property. Override this method to provide your own formatting.\n * \n * @remarks\n * \n * The `formatMessage` function is called by the `CombinedGraphQLErrors`\n * constructor to provide a formatted message as the `message` property of the\n * `CombinedGraphQLErrors` object. Follow the [\"Providing a custom message\n * formatter\"](https://www.apollographql.com/docs/react/api/errors/CombinedGraphQLErrors#providing-a-custom-message-formatter) guide to learn how to modify the message format.\n * \n * @param errors - The array of GraphQL errors returned from the server in\n * the `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n static formatMessage = defaultFormatMessage;\n /**\n * The raw list of GraphQL errors returned by the `errors` field in the GraphQL response.\n */\n errors;\n /**\n * Partial data returned in the `data` field of the GraphQL response.\n */\n data;\n /**\n * Extensions returned by the `extensions` field in the GraphQL response.\n */\n extensions;\n constructor(result, errors = result.errors || []) {\n super(CombinedGraphQLErrors.formatMessage(errors, {\n result,\n defaultFormatMessage,\n }));\n this.errors = errors;\n this.data = result.data;\n this.extensions = result.extensions;\n this.name = \"CombinedGraphQLErrors\";\n brand(this);\n Object.setPrototypeOf(this, CombinedGraphQLErrors.prototype);\n }\n}\n//# sourceMappingURL=CombinedGraphQLErrors.js.map\n"],"ignoreList":[0],"mappings":";;AACA,SAASA,EAAqB,GAAQ;CAClC,OAAQC,EAEH,QAAQ,MAAM,CAAC,CAAC,CAChB,KAAK,MAAM,EAAE,WAAW,0BAA0B,CAAC,CACnD,KAAK,IAAI;AAClB;AAkCA,IAAaC,IAAb,MAAaA,UAA8B,MAAM;CAc7C,OAAO,GAAG,GAAO;EACb,OAAOC,EAAUC,GAAO,uBAAuB;CACnD;CAiBA,OAAO,gBAAgBJ;CAIvB;CAIA;CAIA;CACA,YAAY,GAAQ,IAASK,EAAO,UAAU,CAAC,GAAG;EAU9C,AATA,MAAMH,EAAsB,cAAcD,GAAQ;GAC9C;GACA;EACJ,CAAC,CAAC,GACF,KAAK,SAASA,GACd,KAAK,OAAOI,EAAO,MACnB,KAAK,aAAaA,EAAO,YACzB,KAAK,OAAO,yBACZC,EAAM,IAAI,GACV,OAAO,eAAe,MAAMJ,EAAsB,SAAS;CAC/D;AACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// node_modules/@apollo/client/errors/utils.js
|
|
2
2
|
function e(e, t) {
|
|
3
3
|
return typeof e == "object" && !!e && e[Symbol.for("apollo.error")] === t;
|
|
4
4
|
}
|
|
@@ -10,7 +10,6 @@ function t(e) {
|
|
|
10
10
|
configurable: !1
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { t as brand, e as isBranded };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../../../node_modules/@apollo/client/errors/utils.js"],"sourcesContent":["export function isBranded(error, name) {\n return (typeof error === \"object\" &&\n error !== null &&\n error[Symbol.for(\"apollo.error\")] === name);\n}\nexport function brand(error) {\n Object.defineProperty(error, Symbol.for(\"apollo.error\"), {\n value: error.name,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n}\n//# sourceMappingURL=utils.js.map"],"
|
|
1
|
+
{"version":3,"file":"utils.js","names":["isBranded","error","name","brand"],"sources":["../../../../../node_modules/@apollo/client/errors/utils.js"],"sourcesContent":["export function isBranded(error, name) {\n return (typeof error === \"object\" &&\n error !== null &&\n error[Symbol.for(\"apollo.error\")] === name);\n}\nexport function brand(error) {\n Object.defineProperty(error, Symbol.for(\"apollo.error\"), {\n value: error.name,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n}\n//# sourceMappingURL=utils.js.map"],"ignoreList":[0],"mappings":";AAAA,SAAgBA,EAAU,GAAO,GAAM;CACnC,OAAQ,OAAOC,KAAU,cACrBA,KACAA,EAAM,OAAO,IAAI,cAAc,OAAOC;AAC9C;AACA,SAAgBC,EAAM,GAAO;CACzB,OAAO,eAAeF,GAAO,OAAO,IAAI,cAAc,GAAG;EACrD,OAAOA,EAAM;EACb,YAAY;EACZ,UAAU;EACV,cAAc;CAClB,CAAC;AACL"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EMPTY as e } from "../../../../rxjs/dist/esm5/internal/observable/empty.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { createOperation as t } from "../utils/createOperation.js";
|
|
3
|
+
import { newInvariantError as n } from "../../utilities/invariant/index.js";
|
|
4
|
+
// node_modules/@apollo/client/link/core/ApolloLink.js
|
|
5
5
|
var r = class r {
|
|
6
6
|
static empty() {
|
|
7
7
|
return new r(() => e);
|
|
@@ -18,8 +18,8 @@ var r = class r {
|
|
|
18
18
|
right: n
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
static execute(
|
|
22
|
-
return
|
|
21
|
+
static execute(n, r, i) {
|
|
22
|
+
return n.request(t(r, i), () => e);
|
|
23
23
|
}
|
|
24
24
|
static concat(...e) {
|
|
25
25
|
return r.from(e);
|
|
@@ -40,13 +40,12 @@ var r = class r {
|
|
|
40
40
|
right: t
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
request(e,
|
|
44
|
-
throw
|
|
43
|
+
request(e, t) {
|
|
44
|
+
throw n(67);
|
|
45
45
|
}
|
|
46
46
|
left;
|
|
47
47
|
right;
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
49
|
export { r as ApolloLink };
|
|
51
50
|
|
|
52
51
|
//# sourceMappingURL=ApolloLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApolloLink.js","names":[],"sources":["../../../../../../node_modules/@apollo/client/link/core/ApolloLink.js"],"sourcesContent":["import { EMPTY } from \"rxjs\";\nimport { createOperation } from \"@apollo/client/link/utils\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { invariant, newInvariantError, } from \"@apollo/client/utilities/invariant\";\n/**\n * The base class for all links in Apollo Client. A link represents either a\n * self-contained modification to a GraphQL operation or a side effect (such as\n * logging).\n *\n * @remarks\n *\n * Links enable you to customize Apollo Client's request flow by composing\n * together different pieces of functionality into a chain of links. Each\n * link represents a specific capability, such as adding authentication headers,\n * retrying failed requests, batching operations, or sending requests to a\n * GraphQL server.\n *\n * Every link must define a request handler via its constructor or by extending\n * this class and implementing the `request` method.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink } from \"@apollo/client\";\n *\n * const link = new ApolloLink((operation, forward) => {\n * console.log(\"Operation:\", operation.operationName);\n * return forward(operation);\n * });\n * ```\n */\nexport class ApolloLink {\n /**\n * Creates a link that completes immediately and does not emit a result.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.empty();\n * ```\n */\n static empty() {\n return new ApolloLink(() => EMPTY);\n }\n /**\n * Composes multiple links into a single composed link that executes each\n * provided link in serial order.\n *\n * @example\n *\n * ```ts\n * import { from, HttpLink, ApolloLink } from \"@apollo/client\";\n * import { RetryLink } from \"@apollo/client/link/retry\";\n * import MyAuthLink from \"../auth\";\n *\n * const link = ApolloLink.from([\n * new RetryLink(),\n * new MyAuthLink(),\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" }),\n * ]);\n * ```\n *\n * @param links - An array of `ApolloLink` instances or request handlers that\n * are executed in serial order.\n */\n static from(links) {\n if (links.length === 0)\n return ApolloLink.empty();\n const [first, ...rest] = links;\n return first.concat(...rest);\n }\n /**\n * Creates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const link = ApolloLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n static split(test, left, right = new ApolloLink((op, forward) => forward(op))) {\n const link = new ApolloLink((operation, forward) => {\n const result = test(operation);\n if (__DEV__) {\n if (typeof result !== \"boolean\") {\n __DEV__ && invariant.warn(63, result);\n }\n }\n return result ?\n left.request(operation, forward)\n : right.request(operation, forward);\n });\n return Object.assign(link, { left, right });\n }\n /**\n * Executes a GraphQL request against a link. The `execute` function begins\n * the request by calling the request handler of the link.\n *\n * @example\n *\n * ```ts\n * const observable = ApolloLink.execute(link, { query, variables }, { client });\n *\n * observable.subscribe({\n * next(value) {\n * console.log(\"Received\", value);\n * },\n * error(error) {\n * console.error(\"Oops got error\", error);\n * },\n * complete() {\n * console.log(\"Request complete\");\n * },\n * });\n * ```\n *\n * @param link - The `ApolloLink` instance to execute the request.\n *\n * @param request - The GraphQL request details, such as the `query` and\n * `variables`.\n *\n * @param context - The execution context for the request, such as the\n * `client` making the request.\n */\n static execute(link, request, context) {\n return link.request(createOperation(request, context), () => {\n if (__DEV__) {\n __DEV__ && invariant.warn(64);\n }\n return EMPTY;\n });\n }\n /**\n * Combines multiple links into a single composed link.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.concat(firstLink, secondLink, thirdLink);\n * ```\n *\n * @param links - The links to concatenate into a single link. Each link will\n * execute in serial order.\n *\n * @deprecated Use `ApolloLink.from` instead. `ApolloLink.concat` will be\n * removed in a future major version.\n */\n static concat(...links) {\n return ApolloLink.from(links);\n }\n constructor(request) {\n if (request)\n this.request = request;\n }\n /**\n * Concatenates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n split(test, left, right) {\n return this.concat(ApolloLink.split(test, left, right));\n }\n /**\n * Combines the link with other links into a single composed link.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.concat(\n * link1,\n * link2,\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" })\n * );\n * ```\n */\n concat(...links) {\n if (links.length === 0) {\n return this;\n }\n return links.reduce(this.combine.bind(this), this);\n }\n combine(left, right) {\n const link = new ApolloLink((operation, forward) => {\n return left.request(operation, (op) => right.request(op, forward));\n });\n return Object.assign(link, { left, right });\n }\n /**\n * Runs the request handler for the provided operation.\n *\n * > [!NOTE]\n * > This is called by the `ApolloLink.execute` function for you and should\n * > not be called directly. Prefer using `ApolloLink.execute` to make the\n * > request instead.\n */\n request(operation, forward) {\n throw newInvariantError(65);\n }\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n * \n * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n */\n left;\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n * \n * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n */\n right;\n}\n//# sourceMappingURL=ApolloLink.js.map\n"],"x_google_ignoreList":[0],"mappings":";;;;AA+BA,IAAa,IAAb,MAAa,EAAW;CAUpB,OAAO,QAAQ;AACX,SAAO,IAAI,QAAiB,EAAM;;CAuBtC,OAAO,KAAK,GAAO;AACf,MAAI,EAAM,WAAW,EACjB,QAAO,EAAW,OAAO;EAC7B,IAAM,CAAC,GAAO,GAAG,KAAQ;AACzB,SAAO,EAAM,OAAO,GAAG,EAAK;;CA4BhC,OAAO,MAAM,GAAM,GAAM,IAAQ,IAAI,GAAY,GAAI,MAAY,EAAQ,EAAG,CAAC,EAAE;EAC3E,IAAM,IAAO,IAAI,GAAY,GAAW,MACrB,EAAK,EAAU,GAO1B,EAAK,QAAQ,GAAW,EAAQ,GAC9B,EAAM,QAAQ,GAAW,EAAQ,CACzC;AACF,SAAO,OAAO,OAAO,GAAM;GAAE;GAAM;GAAO,CAAC;;CAgC/C,OAAO,QAAQ,GAAM,GAAS,GAAS;AACnC,SAAO,EAAK,QAAQ,EAAgB,GAAS,EAAQ,QAI1C,EACT;;CAiBN,OAAO,OAAO,GAAG,GAAO;AACpB,SAAO,EAAW,KAAK,EAAM;;CAEjC,YAAY,GAAS;AACjB,EAAI,MACA,KAAK,UAAU;;CAkCvB,MAAM,GAAM,GAAM,GAAO;AACrB,SAAO,KAAK,OAAO,EAAW,MAAM,GAAM,GAAM,EAAM,CAAC;;CAuB3D,OAAO,GAAG,GAAO;AAIb,SAHI,EAAM,WAAW,IACV,OAEJ,EAAM,OAAO,KAAK,QAAQ,KAAK,KAAK,EAAE,KAAK;;CAEtD,QAAQ,GAAM,GAAO;EACjB,IAAM,IAAO,IAAI,GAAY,GAAW,MAC7B,EAAK,QAAQ,IAAY,MAAO,EAAM,QAAQ,GAAI,EAAQ,CAAC,CACpE;AACF,SAAO,OAAO,OAAO,GAAM;GAAE;GAAM;GAAO,CAAC;;CAU/C,QAAQ,GAAW,GAAS;AACxB,QAAM,EAAkB,GAAG;;CAQ/B;CAOA"}
|
|
1
|
+
{"version":3,"file":"ApolloLink.js","names":["ApolloLink","EMPTY","links","first","rest","forward","op","link","test","operation","left","right","createOperation","request","context","newInvariantError"],"sources":["../../../../../../node_modules/@apollo/client/link/core/ApolloLink.js"],"sourcesContent":["import { EMPTY } from \"rxjs\";\nimport { createOperation } from \"@apollo/client/link/utils\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { invariant, newInvariantError, } from \"@apollo/client/utilities/invariant\";\n/**\n * The base class for all links in Apollo Client. A link represents either a\n * self-contained modification to a GraphQL operation or a side effect (such as\n * logging).\n *\n * @remarks\n *\n * Links enable you to customize Apollo Client's request flow by composing\n * together different pieces of functionality into a chain of links. Each\n * link represents a specific capability, such as adding authentication headers,\n * retrying failed requests, batching operations, or sending requests to a\n * GraphQL server.\n *\n * Every link must define a request handler via its constructor or by extending\n * this class and implementing the `request` method.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink } from \"@apollo/client\";\n *\n * const link = new ApolloLink((operation, forward) => {\n * console.log(\"Operation:\", operation.operationName);\n * return forward(operation);\n * });\n * ```\n */\nexport class ApolloLink {\n /**\n * Creates a link that completes immediately and does not emit a result.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.empty();\n * ```\n */\n static empty() {\n return new ApolloLink(() => EMPTY);\n }\n /**\n * Composes multiple links into a single composed link that executes each\n * provided link in serial order.\n *\n * @example\n *\n * ```ts\n * import { from, HttpLink, ApolloLink } from \"@apollo/client\";\n * import { RetryLink } from \"@apollo/client/link/retry\";\n * import MyAuthLink from \"../auth\";\n *\n * const link = ApolloLink.from([\n * new RetryLink(),\n * new MyAuthLink(),\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" }),\n * ]);\n * ```\n *\n * @param links - An array of `ApolloLink` instances or request handlers that\n * are executed in serial order.\n */\n static from(links) {\n if (links.length === 0)\n return ApolloLink.empty();\n const [first, ...rest] = links;\n return first.concat(...rest);\n }\n /**\n * Creates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const link = ApolloLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n static split(test, left, right = new ApolloLink((op, forward) => forward(op))) {\n const link = new ApolloLink((operation, forward) => {\n const result = test(operation);\n if (__DEV__) {\n if (typeof result !== \"boolean\") {\n __DEV__ && invariant.warn(65, result);\n }\n }\n return result ?\n left.request(operation, forward)\n : right.request(operation, forward);\n });\n return Object.assign(link, { left, right });\n }\n /**\n * Executes a GraphQL request against a link. The `execute` function begins\n * the request by calling the request handler of the link.\n *\n * @example\n *\n * ```ts\n * const observable = ApolloLink.execute(link, { query, variables }, { client });\n *\n * observable.subscribe({\n * next(value) {\n * console.log(\"Received\", value);\n * },\n * error(error) {\n * console.error(\"Oops got error\", error);\n * },\n * complete() {\n * console.log(\"Request complete\");\n * },\n * });\n * ```\n *\n * @param link - The `ApolloLink` instance to execute the request.\n *\n * @param request - The GraphQL request details, such as the `query` and\n * `variables`.\n *\n * @param context - The execution context for the request, such as the\n * `client` making the request.\n */\n static execute(link, request, context) {\n return link.request(createOperation(request, context), () => {\n if (__DEV__) {\n __DEV__ && invariant.warn(66);\n }\n return EMPTY;\n });\n }\n /**\n * Combines multiple links into a single composed link.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.concat(firstLink, secondLink, thirdLink);\n * ```\n *\n * @param links - The links to concatenate into a single link. Each link will\n * execute in serial order.\n *\n * @deprecated Use `ApolloLink.from` instead. `ApolloLink.concat` will be\n * removed in a future major version.\n */\n static concat(...links) {\n return ApolloLink.from(links);\n }\n constructor(request) {\n if (request)\n this.request = request;\n }\n /**\n * Concatenates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n split(test, left, right) {\n return this.concat(ApolloLink.split(test, left, right));\n }\n /**\n * Combines the link with other links into a single composed link.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.concat(\n * link1,\n * link2,\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" })\n * );\n * ```\n */\n concat(...links) {\n if (links.length === 0) {\n return this;\n }\n return links.reduce(this.combine.bind(this), this);\n }\n combine(left, right) {\n const link = new ApolloLink((operation, forward) => {\n return left.request(operation, (op) => right.request(op, forward));\n });\n return Object.assign(link, { left, right });\n }\n /**\n * Runs the request handler for the provided operation.\n *\n * > [!NOTE]\n * > This is called by the `ApolloLink.execute` function for you and should\n * > not be called directly. Prefer using `ApolloLink.execute` to make the\n * > request instead.\n */\n request(operation, forward) {\n throw newInvariantError(67);\n }\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n * \n * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n */\n left;\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n * \n * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n */\n right;\n}\n//# sourceMappingURL=ApolloLink.js.map\n"],"ignoreList":[0],"mappings":";;;;AA+BA,IAAaA,IAAb,MAAaA,EAAW;CAUpB,OAAO,QAAQ;EACX,OAAO,IAAIA,QAAiBC,CAAK;CACrC;CAsBA,OAAO,KAAK,GAAO;EACf,IAAIC,EAAM,WAAW,GACjB,OAAOF,EAAW,MAAM;EAC5B,IAAM,CAACG,GAAO,GAAGC,KAAQF;EACzB,OAAOC,EAAM,OAAO,GAAGC,CAAI;CAC/B;CA2BA,OAAO,MAAM,GAAM,GAAM,IAAQ,IAAIJ,GAAY,GAAI,MAAYK,EAAQC,CAAE,CAAC,GAAG;EAC3E,IAAMC,IAAO,IAAIP,GAAY,GAAW,MACrBQ,EAAKC,CAMb,IACHC,EAAK,QAAQD,GAAWJ,CAAO,IAC7BM,EAAM,QAAQF,GAAWJ,CAAO,CACzC;EACD,OAAO,OAAO,OAAOE,GAAM;GAAE;GAAM;EAAM,CAAC;CAC9C;CA+BA,OAAO,QAAQ,GAAM,GAAS,GAAS;EACnC,OAAOA,EAAK,QAAQK,EAAgBC,GAASC,CAAO,SAIzCb,CACV;CACL;CAgBA,OAAO,OAAO,GAAGC,GAAO;EACpB,OAAOF,EAAW,KAAKE,CAAK;CAChC;CACA,YAAY,GAAS;EACjB,AAAIW,MACA,KAAK,UAAUA;CACvB;CAiCA,MAAM,GAAM,GAAM,GAAO;EACrB,OAAO,KAAK,OAAOb,EAAW,MAAMQ,GAAME,GAAMC,CAAK,CAAC;CAC1D;CAsBA,OAAO,GAAGT,GAAO;EAIb,OAHIA,EAAM,WAAW,IACV,OAEJA,EAAM,OAAO,KAAK,QAAQ,KAAK,IAAI,GAAG,IAAI;CACrD;CACA,QAAQ,GAAM,GAAO;EACjB,IAAMK,IAAO,IAAIP,GAAY,GAAW,MAC7BU,EAAK,QAAQD,IAAY,MAAOE,EAAM,QAAQL,GAAID,CAAO,CAAC,CACpE;EACD,OAAO,OAAO,OAAOE,GAAM;GAAE;GAAM;EAAM,CAAC;CAC9C;CASA,QAAQ,GAAW,GAAS;EACxB,MAAMQ,EAAkB,EAAE;CAC9B;CAOA;CAOA;AACJ"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { Observable as e } from "../../../../rxjs/dist/esm5/internal/Observable.js";
|
|
2
2
|
import { CombinedGraphQLErrors as t } from "../../errors/CombinedGraphQLErrors.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { ApolloLink as n } from "../core/ApolloLink.js";
|
|
4
|
+
import { print as r } from "../../utilities/graphql/print.js";
|
|
5
|
+
import { isNonNullObject as i } from "../../utilities/internal/isNonNullObject.js";
|
|
6
|
+
// node_modules/@apollo/client/link/subscriptions/index.js
|
|
7
7
|
function a(e) {
|
|
8
|
-
return
|
|
8
|
+
return i(e) && "code" in e && "reason" in e;
|
|
9
9
|
}
|
|
10
10
|
function o(e) {
|
|
11
|
-
return
|
|
11
|
+
return i(e) && e.target?.readyState === WebSocket.CLOSED;
|
|
12
12
|
}
|
|
13
|
-
var s = class extends
|
|
13
|
+
var s = class extends n {
|
|
14
14
|
client;
|
|
15
15
|
constructor(e) {
|
|
16
16
|
super(), this.client = e;
|
|
17
17
|
}
|
|
18
18
|
request(n) {
|
|
19
19
|
return new e((e) => {
|
|
20
|
-
let { query:
|
|
20
|
+
let { query: i, variables: s, operationName: c, extensions: l } = n;
|
|
21
21
|
return this.client.subscribe({
|
|
22
22
|
variables: s,
|
|
23
23
|
operationName: c,
|
|
24
24
|
extensions: l,
|
|
25
|
-
query: i
|
|
25
|
+
query: r(i)
|
|
26
26
|
}, {
|
|
27
27
|
next: e.next.bind(e),
|
|
28
28
|
complete: e.complete.bind(e),
|
|
@@ -35,7 +35,6 @@ var s = class extends r {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
//#endregion
|
|
39
38
|
export { s as GraphQLWsLink };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=index.js.map
|