@burdenoff/microfe-export 2026.1125.2 → 2026.1127.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/export/providers/ExportProvider.js +37 -37
- package/dist/export/utils/cn.js +2 -2
- package/dist/export/workspace-v2/SetupsList.js +0 -1
- package/dist/export/workspace-v2/SetupsList.js.map +1 -1
- package/dist/index.js +0 -1
- package/package.json +4 -1
- package/dist/export/index.js +0 -5
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +0 -23
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +0 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +0 -15
- package/dist/node_modules/@apollo/client/errors/utils.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +0 -51
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +0 -40
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +0 -33
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -5
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +0 -15
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js +0 -18
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +0 -20
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +0 -16
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +0 -7
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +0 -7
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +0 -22
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +0 -56
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +0 -1
- package/dist/node_modules/@apollo/client/version.js +0 -5
- package/dist/node_modules/@apollo/client/version.js.map +0 -1
- package/dist/node_modules/@wry/caches/lib/weak.js +0 -66
- package/dist/node_modules/@wry/caches/lib/weak.js.map +0 -1
- package/dist/node_modules/@wry/trie/lib/index.js +0 -52
- package/dist/node_modules/@wry/trie/lib/index.js.map +0 -1
- package/dist/node_modules/clsx/dist/clsx.js +0 -19
- package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
- package/dist/node_modules/graphql-ws/dist/client.js +0 -279
- package/dist/node_modules/graphql-ws/dist/client.js.map +0 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +0 -61
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +0 -20
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +0 -77
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +0 -116
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +0 -96
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +0 -11
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +0 -8
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +0 -15
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +0 -12
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -10
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +0 -10
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +0 -21
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -5
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +0 -12
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +0 -13
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +0 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1778
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
- package/dist/node_modules/tslib/tslib.es6.js +0 -51
- package/dist/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { exportGatewayEndpoints as e, exportGatewayHeaders as t } from "../utils/exportAuthority.js";
|
|
2
|
+
import { createContext as n, useContext as r, useMemo as i, useRef as a } from "react";
|
|
3
|
+
import { MemoryRouter as o } from "react-router";
|
|
4
|
+
import { MutationCache as s, QueryClient as c, QueryClientProvider as l } from "@tanstack/react-query";
|
|
5
|
+
import { ApolloClient as u, HttpLink as d, InMemoryCache as f, Observable as p, from as m, split as h } from "@apollo/client";
|
|
6
|
+
import { getMainDefinition as g } from "@apollo/client/utilities";
|
|
7
|
+
import { GraphQLWsLink as _ } from "@apollo/client/link/subscriptions";
|
|
8
|
+
import { createClient as v } from "graphql-ws";
|
|
9
9
|
import { onError as y } from "@apollo/client/link/error";
|
|
10
10
|
import { ApolloProvider as b } from "@apollo/client/react";
|
|
11
11
|
import { isAuthNetworkError as x, redirectToLogin as S } from "@burdenoff/fe-libs/shared/utils";
|
|
@@ -17,13 +17,13 @@ function w(e = []) {
|
|
|
17
17
|
return t === "UNAUTHENTICATED" || n === "TOKEN_EXPIRED" || r.includes("token_expired") || r.includes("token expired") || r.includes("session expired") || r.includes("unauthorized") || r.includes("unauthenticated") || r.includes("authentication required") || r.includes("workspace context missing");
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
var T =
|
|
21
|
-
let e =
|
|
20
|
+
var T = n(null), E = () => {
|
|
21
|
+
let e = r(T);
|
|
22
22
|
if (!e) throw Error("useExport must be used within ExportProvider");
|
|
23
23
|
return e;
|
|
24
|
-
}, D = ({ children:
|
|
24
|
+
}, D = ({ children: n, basePath: r, navigate: E, currentUser: D, workspaceId: O, tenantId: k, organizationId: A, apiGatewayUrl: j, authToken: M, workspaceToken: N, eventBus: P, getWorkspaceToken: F }) => {
|
|
25
25
|
let I = {
|
|
26
|
-
basePath:
|
|
26
|
+
basePath: r,
|
|
27
27
|
navigate: E,
|
|
28
28
|
currentUser: D,
|
|
29
29
|
workspaceId: O,
|
|
@@ -34,11 +34,11 @@ var T = a(null), E = () => {
|
|
|
34
34
|
workspaceToken: N,
|
|
35
35
|
eventBus: P,
|
|
36
36
|
getWorkspaceToken: F
|
|
37
|
-
}, L =
|
|
37
|
+
}, L = a(!1), R = a(F);
|
|
38
38
|
R.current = F;
|
|
39
|
-
let z =
|
|
40
|
-
let e = new
|
|
41
|
-
mutationCache: new
|
|
39
|
+
let z = i(() => {
|
|
40
|
+
let e = new c({
|
|
41
|
+
mutationCache: new s({ onSuccess: () => {
|
|
42
42
|
e.invalidateQueries();
|
|
43
43
|
} }),
|
|
44
44
|
defaultOptions: { queries: {
|
|
@@ -48,20 +48,20 @@ var T = a(null), E = () => {
|
|
|
48
48
|
} }
|
|
49
49
|
});
|
|
50
50
|
return e;
|
|
51
|
-
}, []), B =
|
|
52
|
-
let
|
|
51
|
+
}, []), B = i(() => {
|
|
52
|
+
let n = t({
|
|
53
53
|
authToken: M,
|
|
54
54
|
workspaceToken: N,
|
|
55
55
|
workspaceId: O,
|
|
56
56
|
organizationId: A
|
|
57
|
-
}),
|
|
58
|
-
uri:
|
|
59
|
-
headers: Object.keys(
|
|
60
|
-
}),
|
|
57
|
+
}), r = e(j, window.location.origin), i = r.http, a = new d({
|
|
58
|
+
uri: i,
|
|
59
|
+
headers: Object.keys(n).length > 0 ? n : void 0
|
|
60
|
+
}), o = y(({ error: e, operation: t, forward: n }) => {
|
|
61
61
|
if (!e) return;
|
|
62
62
|
let r = w("errors" in e && Array.isArray(e.errors) ? e.errors : []);
|
|
63
63
|
if (!R.current || !r || L.current) e instanceof Error && x(e) && S();
|
|
64
|
-
else return new
|
|
64
|
+
else return new p((e) => {
|
|
65
65
|
L.current = !0, R.current().then((r) => {
|
|
66
66
|
if (L.current = !1, !r) {
|
|
67
67
|
S(), e.error(/* @__PURE__ */ Error("Failed to refresh workspace token"));
|
|
@@ -77,16 +77,16 @@ var T = a(null), E = () => {
|
|
|
77
77
|
L.current = !1, e.error(t);
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
|
-
}),
|
|
81
|
-
url:
|
|
82
|
-
connectionParams: Object.keys(
|
|
83
|
-
})),
|
|
84
|
-
let
|
|
85
|
-
return
|
|
86
|
-
},
|
|
87
|
-
return new
|
|
88
|
-
link:
|
|
89
|
-
cache: new
|
|
80
|
+
}), s = r.websocket, c = new _(v({
|
|
81
|
+
url: s,
|
|
82
|
+
connectionParams: Object.keys(n).length > 0 ? n : void 0
|
|
83
|
+
})), l = h(({ query: e }) => {
|
|
84
|
+
let t = g(e);
|
|
85
|
+
return t.kind === "OperationDefinition" && t.operation === "subscription";
|
|
86
|
+
}, c, m([o, a]));
|
|
87
|
+
return new u({
|
|
88
|
+
link: l,
|
|
89
|
+
cache: new f(),
|
|
90
90
|
defaultOptions: { watchQuery: { fetchPolicy: "cache-and-network" } }
|
|
91
91
|
});
|
|
92
92
|
}, [
|
|
@@ -95,16 +95,16 @@ var T = a(null), E = () => {
|
|
|
95
95
|
N,
|
|
96
96
|
O,
|
|
97
97
|
A
|
|
98
|
-
]), V = /* @__PURE__ */ C(
|
|
98
|
+
]), V = /* @__PURE__ */ C(l, {
|
|
99
99
|
client: z,
|
|
100
100
|
children: /* @__PURE__ */ C(T.Provider, {
|
|
101
101
|
value: I,
|
|
102
|
-
children:
|
|
102
|
+
children: n
|
|
103
103
|
})
|
|
104
104
|
});
|
|
105
|
-
return
|
|
105
|
+
return r ? V : /* @__PURE__ */ C(b, {
|
|
106
106
|
client: B,
|
|
107
|
-
children: /* @__PURE__ */ C(
|
|
107
|
+
children: /* @__PURE__ */ C(o, { children: V })
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
110
|
export { D as ExportProvider, E as useExport };
|
package/dist/export/utils/cn.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { clsx as e } from "
|
|
2
|
-
import { twMerge as t } from "
|
|
1
|
+
import { clsx as e } from "clsx";
|
|
2
|
+
import { twMerge as t } from "tailwind-merge";
|
|
3
3
|
// src/export/utils/cn.ts
|
|
4
4
|
function n(...n) {
|
|
5
5
|
return t(e(n));
|
|
@@ -2,7 +2,6 @@ import { useTr as e } from "../hooks/useTr.js";
|
|
|
2
2
|
import { ageOf as t } from "./downloadsModel.js";
|
|
3
3
|
import { canRunSetup as n } from "./newDownloadModel.js";
|
|
4
4
|
import { RowTile as r, useAgeText as i } from "./DownloadCells.js";
|
|
5
|
-
import "./useDownloadsData.js";
|
|
6
5
|
import { useListClock as a } from "./useListClock.js";
|
|
7
6
|
import { useOnceAtATime as o } from "./useOnceAtATime.js";
|
|
8
7
|
import { Archive as s, Pencil as c, Play as l, Plus as u, SlidersHorizontal as d, Trash2 as f } from "lucide-react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetupsList.js","names":["setupKey","setup","NO_LINKS","SetupsList","tr","useTr","ageText","useAgeText","now","useListClock","run","useOnceAtATime","actions","page","shown","pageSlice","data","setupsList","createLocked","access","createReason","kindsReady","kinds","runLock","canRunSetup","ListView","EmptyState","Archive","LockedButton","Plus","Notice","ListPager","DataRows","RowTile","ageOf","lock","Play","ActionMenu","SlidersHorizontal","Pencil","Trash2"],"sources":["../../../src/export/workspace-v2/SetupsList.tsx"],"sourcesContent":["/**\n * The Saved setups tab (BOFF-15822): one row per setup (an export template)\n * with what it contains and its file type, \"Run now\", and ⋯ to start a\n * download from it with changes, or to delete it.\n *\n * The service keeps no schedule and no \"whose data\" on a setup: Run now\n * downloads the person's own data; for the whole workspace, an admin opens the\n * setup in New download and picks it there. Run now sends only the setup's\n * kinds of data that are offered here, and is locked when none are.\n */\nimport {\n Archive,\n Pencil,\n Play,\n Plus,\n SlidersHorizontal,\n Trash2,\n} from \"lucide-react\";\nimport {\n ActionMenu,\n DataRows,\n EmptyState,\n ListPager,\n ListView,\n LockedButton,\n Notice,\n pageSlice,\n} from \"@burdenoff/fe-libs/ui\";\nimport { useTr } from \"../hooks/useTr\";\nimport type { ExportTemplate } from \"../types\";\nimport { ageOf } from \"./downloadsModel\";\nimport { canRunSetup } from \"./newDownloadModel\";\nimport { RowTile, useAgeText } from \"./DownloadCells\";\nimport type { DownloadActions } from \"./useDownloadActions\";\nimport { SETUPS_LIMIT, type SavedSetups } from \"./useDownloadsData\";\nimport type { DownloadsPageState } from \"./useDownloadsPage\";\nimport type { ExportAccess } from \"./useExportAccess\";\nimport { useListClock } from \"./useListClock\";\nimport { useOnceAtATime } from \"./useOnceAtATime\";\nimport type { OfferedKinds } from \"./useOfferedKinds\";\n\nconst setupKey = (setup: ExportTemplate) => setup.id;\n\n/** Setups have no download links: the list clock only ticks. */\nconst NO_LINKS: readonly [] = [];\n\nexport interface SetupsListProps {\n page: DownloadsPageState;\n data: SavedSetups;\n kinds: OfferedKinds;\n access: ExportAccess;\n actions: DownloadActions;\n}\n\nexport function SetupsList({\n page,\n data,\n kinds,\n access,\n actions,\n}: SetupsListProps) {\n const tr = useTr();\n const ageText = useAgeText();\n // Moves on every minute, so \"Changed\" ages stay true while the tab is open.\n const now = useListClock(NO_LINKS);\n // Once at a time per setup: a second press makes no second download.\n const run = useOnceAtATime(actions.runSetup, setupKey);\n const { setupsList } = page;\n const shown = pageSlice(data.setups, setupsList.page, setupsList.pageSize);\n const createLocked = access.settled && !access.canCreate;\n const createReason = tr(\n \"export.v2.new.createLocked\",\n \"Starting a download needs permission to export in this workspace. Ask a workspace admin.\",\n );\n // Run now needs the kinds offered here: it waits for them, and says when\n // they couldn't load or when none of a setup's kinds is offered.\n const kindsReady = !kinds.loading && !kinds.error;\n const runLock = (setup: ExportTemplate): string | null => {\n if (createLocked) return createReason;\n if (kinds.error)\n return tr(\n \"export.v2.setups.kindsFailed\",\n \"Couldn’t load what can be downloaded here. Try again in a moment.\",\n );\n if (kindsReady && !canRunSetup(setup, kinds.isOffered))\n return tr(\n \"export.v2.setups.nothingHere\",\n \"Nothing in this setup can be downloaded here: its kinds of data belong to another product, or are switched off.\",\n );\n return null;\n };\n\n return (\n <ListView\n count={data.setups.length}\n loading={data.loading}\n error={data.error ?? undefined}\n onRetry={data.refresh}\n errorTitle={tr(\n \"export.v2.setups.failed\",\n \"Couldn’t load your saved setups\",\n )}\n errorDetails={data.error?.message || undefined}\n summary={\n data.setups.length === 1\n ? tr(\"export.v2.setups.countOne\", \"1 saved setup\")\n : tr(\"export.v2.setups.count\", \"{{count}} saved setups\", {\n count: data.setups.length,\n })\n }\n empty={\n <EmptyState\n size=\"page\"\n illustration=\"documents\"\n icon={<Archive aria-hidden=\"true\" />}\n title={tr(\"export.v2.setups.emptyTitle\", \"No saved setups\")}\n description={tr(\n \"export.v2.setups.emptyDescription\",\n \"When you make a download, turn on “Save as a setup” to run it again in one click.\",\n )}\n action={\n <LockedButton\n type=\"button\"\n locked={createLocked}\n reason={createReason}\n icon={Plus}\n onClick={() => page.openNew()}\n >\n {tr(\"export.v2.newDownload\", \"New download\")}\n </LockedButton>\n }\n />\n }\n summaryEnd={\n (data.total ?? 0) > SETUPS_LIMIT ? (\n <Notice tone=\"info\">\n {tr(\n \"export.v2.setups.limit\",\n \"Showing the first {{count}} saved setups.\",\n {\n count: SETUPS_LIMIT,\n },\n )}\n </Notice>\n ) : null\n }\n pager={<ListPager list={setupsList} total={data.setups.length} />}\n >\n <DataRows<ExportTemplate>\n label={tr(\"export.v2.setups.label\", \"Saved setups\")}\n items={shown}\n getId={(setup) => setup.id}\n lead={{\n header: tr(\"export.v2.setups.setup\", \"Setup\"),\n media: () => <RowTile icon={Archive} />,\n title: (setup) => setup.name,\n subtitle: (setup) => setup.description || undefined,\n }}\n columns={[\n {\n id: \"contains\",\n header: tr(\"export.v2.setups.contains\", \"Contains\"),\n width: \"minmax(0,1.4fr)\",\n cell: (setup) => setup.entityTypes.map(kinds.label).join(\", \"),\n },\n {\n id: \"file\",\n header: tr(\"export.v2.list.file\", \"File\"),\n width: \"90px\",\n cell: (setup) => setup.format,\n },\n {\n id: \"changed\",\n header: tr(\"export.v2.setups.changed\", \"Changed\"),\n width: \"130px\",\n cell: (setup) => ageText(ageOf(setup.updatedAt, now)),\n },\n ]}\n actions={(setup) => {\n const lock = runLock(setup);\n return (\n <span className=\"flex items-center justify-end gap-1\">\n <LockedButton\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n locked={lock !== null}\n reason={lock ?? createReason}\n disabled={(lock === null && !kindsReady) || run.busy(setup)}\n aria-busy={run.busy(setup) || undefined}\n icon={Play}\n onClick={() => run.start(setup)}\n aria-label={tr(\"export.v2.setups.runAria\", \"Run {{name}} now\", {\n name: setup.name,\n })}\n >\n {tr(\"export.v2.setups.run\", \"Run now\")}\n </LockedButton>\n <ActionMenu\n placement=\"row\"\n label={tr(\"export.v2.row.menu\", \"Actions for {{name}}\", {\n name: setup.name,\n })}\n items={[\n {\n id: \"open-new\",\n label: tr(\"export.v2.setups.openNew\", \"Run with changes…\"),\n description: tr(\n \"export.v2.setups.openNewHelp\",\n \"Opens New download with this setup filled in\",\n ),\n icon: SlidersHorizontal,\n locked: createLocked,\n lockedReason: createReason,\n onSelect: () => page.openNew(setup.id),\n },\n {\n id: \"edit\",\n label: tr(\"export.v2.setups.edit\", \"Edit…\"),\n icon: Pencil,\n locked: access.settled && !access.canSetups,\n lockedReason: tr(\n \"export.v2.new.setupLocked\",\n \"Saving setups needs permission to manage them in this workspace. Ask a workspace admin.\",\n ),\n onSelect: () => page.openSetup(setup.id),\n },\n {\n id: \"delete\",\n label: tr(\"export.v2.setups.delete\", \"Delete setup…\"),\n icon: Trash2,\n danger: true,\n separatorBefore: true,\n locked: access.settled && !access.canSetups,\n lockedReason: tr(\n \"export.v2.new.setupLocked\",\n \"Saving setups needs permission to manage them in this workspace. Ask a workspace admin.\",\n ),\n onSelect: () => void actions.removeSetup(setup),\n },\n ]}\n />\n </span>\n );\n }}\n />\n </ListView>\n );\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"SetupsList.js","names":["setupKey","setup","NO_LINKS","SetupsList","tr","useTr","ageText","useAgeText","now","useListClock","run","useOnceAtATime","actions","page","shown","pageSlice","data","setupsList","createLocked","access","createReason","kindsReady","kinds","runLock","canRunSetup","ListView","EmptyState","Archive","LockedButton","Plus","Notice","ListPager","DataRows","RowTile","ageOf","lock","Play","ActionMenu","SlidersHorizontal","Pencil","Trash2"],"sources":["../../../src/export/workspace-v2/SetupsList.tsx"],"sourcesContent":["/**\n * The Saved setups tab (BOFF-15822): one row per setup (an export template)\n * with what it contains and its file type, \"Run now\", and ⋯ to start a\n * download from it with changes, or to delete it.\n *\n * The service keeps no schedule and no \"whose data\" on a setup: Run now\n * downloads the person's own data; for the whole workspace, an admin opens the\n * setup in New download and picks it there. Run now sends only the setup's\n * kinds of data that are offered here, and is locked when none are.\n */\nimport {\n Archive,\n Pencil,\n Play,\n Plus,\n SlidersHorizontal,\n Trash2,\n} from \"lucide-react\";\nimport {\n ActionMenu,\n DataRows,\n EmptyState,\n ListPager,\n ListView,\n LockedButton,\n Notice,\n pageSlice,\n} from \"@burdenoff/fe-libs/ui\";\nimport { useTr } from \"../hooks/useTr\";\nimport type { ExportTemplate } from \"../types\";\nimport { ageOf } from \"./downloadsModel\";\nimport { canRunSetup } from \"./newDownloadModel\";\nimport { RowTile, useAgeText } from \"./DownloadCells\";\nimport type { DownloadActions } from \"./useDownloadActions\";\nimport { SETUPS_LIMIT, type SavedSetups } from \"./useDownloadsData\";\nimport type { DownloadsPageState } from \"./useDownloadsPage\";\nimport type { ExportAccess } from \"./useExportAccess\";\nimport { useListClock } from \"./useListClock\";\nimport { useOnceAtATime } from \"./useOnceAtATime\";\nimport type { OfferedKinds } from \"./useOfferedKinds\";\n\nconst setupKey = (setup: ExportTemplate) => setup.id;\n\n/** Setups have no download links: the list clock only ticks. */\nconst NO_LINKS: readonly [] = [];\n\nexport interface SetupsListProps {\n page: DownloadsPageState;\n data: SavedSetups;\n kinds: OfferedKinds;\n access: ExportAccess;\n actions: DownloadActions;\n}\n\nexport function SetupsList({\n page,\n data,\n kinds,\n access,\n actions,\n}: SetupsListProps) {\n const tr = useTr();\n const ageText = useAgeText();\n // Moves on every minute, so \"Changed\" ages stay true while the tab is open.\n const now = useListClock(NO_LINKS);\n // Once at a time per setup: a second press makes no second download.\n const run = useOnceAtATime(actions.runSetup, setupKey);\n const { setupsList } = page;\n const shown = pageSlice(data.setups, setupsList.page, setupsList.pageSize);\n const createLocked = access.settled && !access.canCreate;\n const createReason = tr(\n \"export.v2.new.createLocked\",\n \"Starting a download needs permission to export in this workspace. Ask a workspace admin.\",\n );\n // Run now needs the kinds offered here: it waits for them, and says when\n // they couldn't load or when none of a setup's kinds is offered.\n const kindsReady = !kinds.loading && !kinds.error;\n const runLock = (setup: ExportTemplate): string | null => {\n if (createLocked) return createReason;\n if (kinds.error)\n return tr(\n \"export.v2.setups.kindsFailed\",\n \"Couldn’t load what can be downloaded here. Try again in a moment.\",\n );\n if (kindsReady && !canRunSetup(setup, kinds.isOffered))\n return tr(\n \"export.v2.setups.nothingHere\",\n \"Nothing in this setup can be downloaded here: its kinds of data belong to another product, or are switched off.\",\n );\n return null;\n };\n\n return (\n <ListView\n count={data.setups.length}\n loading={data.loading}\n error={data.error ?? undefined}\n onRetry={data.refresh}\n errorTitle={tr(\n \"export.v2.setups.failed\",\n \"Couldn’t load your saved setups\",\n )}\n errorDetails={data.error?.message || undefined}\n summary={\n data.setups.length === 1\n ? tr(\"export.v2.setups.countOne\", \"1 saved setup\")\n : tr(\"export.v2.setups.count\", \"{{count}} saved setups\", {\n count: data.setups.length,\n })\n }\n empty={\n <EmptyState\n size=\"page\"\n illustration=\"documents\"\n icon={<Archive aria-hidden=\"true\" />}\n title={tr(\"export.v2.setups.emptyTitle\", \"No saved setups\")}\n description={tr(\n \"export.v2.setups.emptyDescription\",\n \"When you make a download, turn on “Save as a setup” to run it again in one click.\",\n )}\n action={\n <LockedButton\n type=\"button\"\n locked={createLocked}\n reason={createReason}\n icon={Plus}\n onClick={() => page.openNew()}\n >\n {tr(\"export.v2.newDownload\", \"New download\")}\n </LockedButton>\n }\n />\n }\n summaryEnd={\n (data.total ?? 0) > SETUPS_LIMIT ? (\n <Notice tone=\"info\">\n {tr(\n \"export.v2.setups.limit\",\n \"Showing the first {{count}} saved setups.\",\n {\n count: SETUPS_LIMIT,\n },\n )}\n </Notice>\n ) : null\n }\n pager={<ListPager list={setupsList} total={data.setups.length} />}\n >\n <DataRows<ExportTemplate>\n label={tr(\"export.v2.setups.label\", \"Saved setups\")}\n items={shown}\n getId={(setup) => setup.id}\n lead={{\n header: tr(\"export.v2.setups.setup\", \"Setup\"),\n media: () => <RowTile icon={Archive} />,\n title: (setup) => setup.name,\n subtitle: (setup) => setup.description || undefined,\n }}\n columns={[\n {\n id: \"contains\",\n header: tr(\"export.v2.setups.contains\", \"Contains\"),\n width: \"minmax(0,1.4fr)\",\n cell: (setup) => setup.entityTypes.map(kinds.label).join(\", \"),\n },\n {\n id: \"file\",\n header: tr(\"export.v2.list.file\", \"File\"),\n width: \"90px\",\n cell: (setup) => setup.format,\n },\n {\n id: \"changed\",\n header: tr(\"export.v2.setups.changed\", \"Changed\"),\n width: \"130px\",\n cell: (setup) => ageText(ageOf(setup.updatedAt, now)),\n },\n ]}\n actions={(setup) => {\n const lock = runLock(setup);\n return (\n <span className=\"flex items-center justify-end gap-1\">\n <LockedButton\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n locked={lock !== null}\n reason={lock ?? createReason}\n disabled={(lock === null && !kindsReady) || run.busy(setup)}\n aria-busy={run.busy(setup) || undefined}\n icon={Play}\n onClick={() => run.start(setup)}\n aria-label={tr(\"export.v2.setups.runAria\", \"Run {{name}} now\", {\n name: setup.name,\n })}\n >\n {tr(\"export.v2.setups.run\", \"Run now\")}\n </LockedButton>\n <ActionMenu\n placement=\"row\"\n label={tr(\"export.v2.row.menu\", \"Actions for {{name}}\", {\n name: setup.name,\n })}\n items={[\n {\n id: \"open-new\",\n label: tr(\"export.v2.setups.openNew\", \"Run with changes…\"),\n description: tr(\n \"export.v2.setups.openNewHelp\",\n \"Opens New download with this setup filled in\",\n ),\n icon: SlidersHorizontal,\n locked: createLocked,\n lockedReason: createReason,\n onSelect: () => page.openNew(setup.id),\n },\n {\n id: \"edit\",\n label: tr(\"export.v2.setups.edit\", \"Edit…\"),\n icon: Pencil,\n locked: access.settled && !access.canSetups,\n lockedReason: tr(\n \"export.v2.new.setupLocked\",\n \"Saving setups needs permission to manage them in this workspace. Ask a workspace admin.\",\n ),\n onSelect: () => page.openSetup(setup.id),\n },\n {\n id: \"delete\",\n label: tr(\"export.v2.setups.delete\", \"Delete setup…\"),\n icon: Trash2,\n danger: true,\n separatorBefore: true,\n locked: access.settled && !access.canSetups,\n lockedReason: tr(\n \"export.v2.new.setupLocked\",\n \"Saving setups needs permission to manage them in this workspace. Ask a workspace admin.\",\n ),\n onSelect: () => void actions.removeSetup(setup),\n },\n ]}\n />\n </span>\n );\n }}\n />\n </ListView>\n );\n}\n"],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -2,5 +2,4 @@ import { useExport as e } from "./export/providers/ExportProvider.js";
|
|
|
2
2
|
import { useExportStore as t } from "./export/store/exportStore.js";
|
|
3
3
|
import { ExportRoot as n } from "./export/ExportRoot.js";
|
|
4
4
|
import { enTranslations as r } from "./translations/en.js";
|
|
5
|
-
import "./export/index.js";
|
|
6
5
|
export { n as ExportRoot, r as enTranslations, e as useExport, t as useExportStore };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-export",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1127.1",
|
|
4
4
|
"description": "Burdenoff Export Microfrontend - Data export management interface",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"package.json",
|
|
9
9
|
"README.md"
|
|
10
10
|
],
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
11
14
|
"imports": {
|
|
12
15
|
"#src/*": "./src/*",
|
|
13
16
|
"#export/*": "./src/export/*"
|
package/dist/export/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ExportRoot as e } from "./ExportRoot.js";
|
|
2
|
-
import { useExport as t } from "./providers/ExportProvider.js";
|
|
3
|
-
import { useExportStore as n } from "./store/exportStore.js";
|
|
4
|
-
import { enTranslations as r } from "../translations/en.js";
|
|
5
|
-
export { e as ExportRoot, r as enTranslations, t as useExport, n as useExportStore };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { brand as e, isBranded as t } from "./utils.js";
|
|
2
|
-
// node_modules/@apollo/client/errors/CombinedGraphQLErrors.js
|
|
3
|
-
function n(e) {
|
|
4
|
-
return e.filter((e) => e).map((e) => e.message || "Error message not found.").join("\n");
|
|
5
|
-
}
|
|
6
|
-
var r = class r extends Error {
|
|
7
|
-
static is(e) {
|
|
8
|
-
return t(e, "CombinedGraphQLErrors");
|
|
9
|
-
}
|
|
10
|
-
static formatMessage = n;
|
|
11
|
-
errors;
|
|
12
|
-
data;
|
|
13
|
-
extensions;
|
|
14
|
-
constructor(t, i = t.errors || []) {
|
|
15
|
-
super(r.formatMessage(i, {
|
|
16
|
-
result: t,
|
|
17
|
-
defaultFormatMessage: n
|
|
18
|
-
})), this.errors = i, this.data = t.data, this.extensions = t.extensions, this.name = "CombinedGraphQLErrors", e(this), Object.setPrototypeOf(this, r.prototype);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export { r as CombinedGraphQLErrors };
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=CombinedGraphQLErrors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,15 +0,0 @@
|
|
|
1
|
-
// node_modules/@apollo/client/errors/utils.js
|
|
2
|
-
function e(e, t) {
|
|
3
|
-
return typeof e == "object" && !!e && e[Symbol.for("apollo.error")] === t;
|
|
4
|
-
}
|
|
5
|
-
function t(e) {
|
|
6
|
-
Object.defineProperty(e, Symbol.for("apollo.error"), {
|
|
7
|
-
value: e.name,
|
|
8
|
-
enumerable: !1,
|
|
9
|
-
writable: !1,
|
|
10
|
-
configurable: !1
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
export { t as brand, e as isBranded };
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,51 +0,0 @@
|
|
|
1
|
-
import { EMPTY as e } from "../../../../rxjs/dist/esm5/internal/observable/empty.js";
|
|
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
|
-
var r = class r {
|
|
6
|
-
static empty() {
|
|
7
|
-
return new r(() => e);
|
|
8
|
-
}
|
|
9
|
-
static from(e) {
|
|
10
|
-
if (e.length === 0) return r.empty();
|
|
11
|
-
let [t, ...n] = e;
|
|
12
|
-
return t.concat(...n);
|
|
13
|
-
}
|
|
14
|
-
static split(e, t, n = new r((e, t) => t(e))) {
|
|
15
|
-
let i = new r((r, i) => e(r) ? t.request(r, i) : n.request(r, i));
|
|
16
|
-
return Object.assign(i, {
|
|
17
|
-
left: t,
|
|
18
|
-
right: n
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
static execute(n, r, i) {
|
|
22
|
-
return n.request(t(r, i), () => e);
|
|
23
|
-
}
|
|
24
|
-
static concat(...e) {
|
|
25
|
-
return r.from(e);
|
|
26
|
-
}
|
|
27
|
-
constructor(e) {
|
|
28
|
-
e && (this.request = e);
|
|
29
|
-
}
|
|
30
|
-
split(e, t, n) {
|
|
31
|
-
return this.concat(r.split(e, t, n));
|
|
32
|
-
}
|
|
33
|
-
concat(...e) {
|
|
34
|
-
return e.length === 0 ? this : e.reduce(this.combine.bind(this), this);
|
|
35
|
-
}
|
|
36
|
-
combine(e, t) {
|
|
37
|
-
let n = new r((n, r) => e.request(n, (e) => t.request(e, r)));
|
|
38
|
-
return Object.assign(n, {
|
|
39
|
-
left: e,
|
|
40
|
-
right: t
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
request(e, t) {
|
|
44
|
-
throw n(67);
|
|
45
|
-
}
|
|
46
|
-
left;
|
|
47
|
-
right;
|
|
48
|
-
};
|
|
49
|
-
export { r as ApolloLink };
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=ApolloLink.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,40 +0,0 @@
|
|
|
1
|
-
import { Observable as e } from "../../../../rxjs/dist/esm5/internal/Observable.js";
|
|
2
|
-
import { CombinedGraphQLErrors as t } from "../../errors/CombinedGraphQLErrors.js";
|
|
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
|
-
function a(e) {
|
|
8
|
-
return i(e) && "code" in e && "reason" in e;
|
|
9
|
-
}
|
|
10
|
-
function o(e) {
|
|
11
|
-
return i(e) && e.target?.readyState === WebSocket.CLOSED;
|
|
12
|
-
}
|
|
13
|
-
var s = class extends n {
|
|
14
|
-
client;
|
|
15
|
-
constructor(e) {
|
|
16
|
-
super(), this.client = e;
|
|
17
|
-
}
|
|
18
|
-
request(n) {
|
|
19
|
-
return new e((e) => {
|
|
20
|
-
let { query: i, variables: s, operationName: c, extensions: l } = n;
|
|
21
|
-
return this.client.subscribe({
|
|
22
|
-
variables: s,
|
|
23
|
-
operationName: c,
|
|
24
|
-
extensions: l,
|
|
25
|
-
query: r(i)
|
|
26
|
-
}, {
|
|
27
|
-
next: e.next.bind(e),
|
|
28
|
-
complete: e.complete.bind(e),
|
|
29
|
-
error: (n) => {
|
|
30
|
-
if (n instanceof Error) return e.error(n);
|
|
31
|
-
let r = a(n);
|
|
32
|
-
return r || o(n) ? e.error(/* @__PURE__ */ Error(`Socket closed${r ? ` with event ${n.code}` : ""}${r ? ` ${n.reason}` : ""}`)) : e.error(new t({ errors: Array.isArray(n) ? n : [n] }));
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
export { s as GraphQLWsLink };
|
|
39
|
-
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["isLikeCloseEvent","isNonNullObject","val","isLikeErrorEvent","err","GraphQLWsLink","ApolloLink","client","Observable","operation","print","query","observer","likeClose","CombinedGraphQLErrors"],"sources":["../../../../../../node_modules/@apollo/client/link/subscriptions/index.js"],"sourcesContent":["// This file is adapted from the graphql-ws npm package:\n// https://github.com/enisdenjo/graphql-ws\n//\n// Most of the file comes from that package's README; some other parts (such as\n// isLikeCloseEvent) come from its source.\n//\n// Here's the license of the original code:\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2020-2021 Denis Badurina\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nimport { Observable } from \"rxjs\";\nimport { CombinedGraphQLErrors } from \"@apollo/client/errors\";\nimport { ApolloLink } from \"@apollo/client/link\";\nimport { print } from \"@apollo/client/utilities\";\nimport { isNonNullObject } from \"@apollo/client/utilities/internal\";\n// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event\nfunction isLikeCloseEvent(val) {\n return isNonNullObject(val) && \"code\" in val && \"reason\" in val;\n}\n// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/error_event\nfunction isLikeErrorEvent(err) {\n return isNonNullObject(err) && err.target?.readyState === WebSocket.CLOSED;\n}\n/**\n * The `GraphQLWsLink` is a terminating link sends GraphQL operations over a\n * WebSocket connection using the [`graphql-ws`](https://www.npmjs.com/package/graphql-ws) library. It's used most\n * commonly with GraphQL [subscriptions](https://apollographql.com/docs/react/data/subscriptions/),\n *\n * > [!NOTE]\n * > This link works with the `graphql-ws` library. If your server uses\n * > the deprecated `subscriptions-transport-ws` library, use the deprecated\n * > [`WebSocketLink`](https://apollographql.com/docs/react/api/link/apollo-link-ws) link instead.\n *\n * @example\n *\n * ```ts\n * import { GraphQLWsLink } from \"@apollo/client/link/subscriptions\";\n * import { createClient } from \"graphql-ws\";\n *\n * const link = new GraphQLWsLink(\n * createClient({\n * url: \"ws://localhost:3000/subscriptions\",\n * })\n * );\n * ```\n */\nexport class GraphQLWsLink extends ApolloLink {\n client;\n constructor(client) {\n super();\n this.client = client;\n }\n request(operation) {\n return new Observable((observer) => {\n const { query, variables, operationName, extensions } = operation;\n return this.client.subscribe({ variables, operationName, extensions, query: print(query) }, {\n next: observer.next.bind(observer),\n complete: observer.complete.bind(observer),\n error: (err) => {\n if (err instanceof Error) {\n return observer.error(err);\n }\n const likeClose = isLikeCloseEvent(err);\n if (likeClose || isLikeErrorEvent(err)) {\n return observer.error(\n // reason will be available on clean closes\n new Error(`Socket closed${likeClose ? ` with event ${err.code}` : \"\"}${likeClose ? ` ${err.reason}` : \"\"}`));\n }\n return observer.error(new CombinedGraphQLErrors({\n errors: Array.isArray(err) ? err : [err],\n }));\n },\n // casting around a wrong type in graphql-ws, which incorrectly expects `Sink<ExecutionResult>`\n });\n });\n }\n}\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;;;;AAmCA,SAASA,EAAiB,GAAK;CAC3B,OAAOC,EAAgBC,CAAG,KAAK,UAAUA,KAAO,YAAYA;AAChE;AAEA,SAASC,EAAiB,GAAK;CAC3B,OAAOF,EAAgBG,CAAG,KAAKA,EAAI,QAAQ,eAAe,UAAU;AACxE;AAwBA,IAAaC,IAAb,cAAmCC,EAAW;CAC1C;CACA,YAAY,GAAQ;EAEhB,AADA,MAAM,GACN,KAAK,SAASC;CAClB;CACA,QAAQ,GAAW;EACf,OAAO,IAAIC,GAAY,MAAa;GAChC,IAAM,EAAE,UAAO,cAAW,kBAAe,kBAAeC;GACxD,OAAO,KAAK,OAAO,UAAU;IAAE;IAAW;IAAe;IAAY,OAAOC,EAAMC,CAAK;GAAE,GAAG;IACxF,MAAMC,EAAS,KAAK,KAAKA,CAAQ;IACjC,UAAUA,EAAS,SAAS,KAAKA,CAAQ;IACzC,QAAQ,MAAQ;KACZ,IAAIR,aAAe,OACf,OAAOQ,EAAS,MAAMR,CAAG;KAE7B,IAAMS,IAAYb,EAAiBI,CAAG;KAMtC,OALIS,KAAaV,EAAiBC,CAAG,IAC1BQ,EAAS,MAEhB,gBAAI,MAAM,gBAAgBC,IAAY,eAAeT,EAAI,SAAS,KAAKS,IAAY,IAAIT,EAAI,WAAW,IAAI,CAAC,IAExGQ,EAAS,MAAM,IAAIE,EAAsB,EAC5C,QAAQ,MAAM,QAAQV,CAAG,IAAIA,IAAM,CAACA,CAAG,EAC3C,CAAC,CAAC;IACN;GAEJ,CAAC;EACL,CAAC;CACL;AACJ"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { getOperationDefinition as e } from "../../utilities/internal/getOperationDefinition.js";
|
|
2
|
-
import { getOperationName as t } from "../../utilities/internal/getOperationName.js";
|
|
3
|
-
// node_modules/@apollo/client/link/utils/createOperation.js
|
|
4
|
-
function n(n, { client: r }) {
|
|
5
|
-
let i = {
|
|
6
|
-
query: n.query,
|
|
7
|
-
variables: n.variables || {},
|
|
8
|
-
extensions: n.extensions || {},
|
|
9
|
-
operationName: t(n.query),
|
|
10
|
-
operationType: e(n.query).operation
|
|
11
|
-
}, a = { ...n.context }, o = (e) => {
|
|
12
|
-
a = typeof e == "function" ? {
|
|
13
|
-
...a,
|
|
14
|
-
...e(s())
|
|
15
|
-
} : {
|
|
16
|
-
...a,
|
|
17
|
-
...e
|
|
18
|
-
};
|
|
19
|
-
}, s = () => Object.freeze({ ...a });
|
|
20
|
-
return Object.defineProperty(i, "setContext", {
|
|
21
|
-
enumerable: !1,
|
|
22
|
-
value: o
|
|
23
|
-
}), Object.defineProperty(i, "getContext", {
|
|
24
|
-
enumerable: !1,
|
|
25
|
-
value: s
|
|
26
|
-
}), Object.defineProperty(i, "client", {
|
|
27
|
-
enumerable: !1,
|
|
28
|
-
value: r
|
|
29
|
-
}), i;
|
|
30
|
-
}
|
|
31
|
-
export { n as createOperation };
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=createOperation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createOperation.js","names":["createOperation","operation","request","getOperationName","getOperationDefinition","context","setContext","next","getContext","client"],"sources":["../../../../../../node_modules/@apollo/client/link/utils/createOperation.js"],"sourcesContent":["import { getOperationDefinition, getOperationName, } from \"@apollo/client/utilities/internal\";\nexport function createOperation(request, { client }) {\n const operation = {\n query: request.query,\n variables: request.variables || {},\n extensions: request.extensions || {},\n operationName: getOperationName(request.query),\n operationType: getOperationDefinition(request.query).operation,\n };\n let context = { ...request.context };\n const setContext = (next) => {\n if (typeof next === \"function\") {\n context = { ...context, ...next(getContext()) };\n }\n else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => Object.freeze({ ...context });\n Object.defineProperty(operation, \"setContext\", {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, \"getContext\", {\n enumerable: false,\n value: getContext,\n });\n Object.defineProperty(operation, \"client\", {\n enumerable: false,\n value: client,\n });\n return operation;\n}\n//# sourceMappingURL=createOperation.js.map"],"ignoreList":[0],"mappings":";;;AACA,SAAgBA,EAAgB,GAAS,EAAE,aAAU;CACjD,IAAMC,IAAY;EACd,OAAOC,EAAQ;EACf,WAAWA,EAAQ,aAAa,CAAC;EACjC,YAAYA,EAAQ,cAAc,CAAC;EACnC,eAAeC,EAAiBD,EAAQ,KAAK;EAC7C,eAAeE,EAAuBF,EAAQ,KAAK,CAAC,CAAC;CACzD,GACIG,IAAU,EAAE,GAAGH,EAAQ,QAAQ,GAC7BI,KAAc,MAAS;EACzB,AAIID,IAJA,OAAOE,KAAS,aACN;GAAE,GAAGF;GAAS,GAAGE,EAAKC,EAAW,CAAC;EAAE,IAGpC;GAAE,GAAGH;GAAS,GAAGE;EAAK;CAExC,GACMC,UAAmB,OAAO,OAAO,EAAE,GAAGH,EAAQ,CAAC;CAarD,OAZA,OAAO,eAAeJ,GAAW,cAAc;EAC3C,YAAY;EACZ,OAAOK;CACX,CAAC,GACD,OAAO,eAAeL,GAAW,cAAc;EAC3C,YAAY;EACZ,OAAOO;CACX,CAAC,GACD,OAAO,eAAeP,GAAW,UAAU;EACvC,YAAY;EACZ,OAAOQ;CACX,CAAC,GACMR;AACX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.js","names":["global","global_default","cacheSizes"],"sources":["../../../../../../node_modules/@apollo/client/utilities/caching/sizes.js"],"sourcesContent":["import { global } from \"@apollo/client/utilities/internal/globals\";\nconst cacheSizeSymbol = Symbol.for(\"apollo.cacheSize\");\n/**\n * The global cache size configuration for Apollo Client.\n *\n * @remarks\n *\n * You can directly modify this object, but any modification will\n * only have an effect on caches that are created after the modification.\n *\n * So for global caches, such as `canonicalStringify` and `print`,\n * you might need to call `.reset` on them, which will essentially re-create them.\n *\n * Alternatively, you can set `globalThis[Symbol.for(\"apollo.cacheSize\")]` before\n * you load the Apollo Client package:\n *\n * @example\n *\n * ```ts\n * globalThis[Symbol.for(\"apollo.cacheSize\")] = {\n * print: 100,\n * } satisfies Partial<CacheSizes>; // the `satisfies` is optional if using TypeScript\n * ```\n */\nexport const cacheSizes = { ...global[cacheSizeSymbol] };\n//# sourceMappingURL=sizes.js.map"],"ignoreList":[0],"mappings":";AAwBA,IAAaE,IAAa,EAAE,GAAGF,EAvBP,OAAO,IAAI,kBAuBG,GAAiB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AutoCleanedWeakCache as e } from "../internal/caches.js";
|
|
2
|
-
import "../internal/getMemoryInternals.js";
|
|
3
|
-
import { cacheSizes as t } from "../caching/sizes.js";
|
|
4
|
-
import { print as n } from "graphql";
|
|
5
|
-
// node_modules/@apollo/client/utilities/graphql/print.js
|
|
6
|
-
var r, i = Object.assign((e) => {
|
|
7
|
-
let t = r.get(e);
|
|
8
|
-
return t || (t = n(e), r.set(e, t)), t;
|
|
9
|
-
}, { reset() {
|
|
10
|
-
r = new e(t.print || 2e3);
|
|
11
|
-
} });
|
|
12
|
-
i.reset();
|
|
13
|
-
export { i as print };
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=print.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"print.js","names":["print","origPrint","printCache","print$1","result","ast","print","AutoCleanedWeakCache","cacheSizes"],"sources":["../../../../../../node_modules/@apollo/client/utilities/graphql/print.js"],"sourcesContent":["import { print as origPrint } from \"graphql\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { AutoCleanedWeakCache, registerGlobalCache, } from \"@apollo/client/utilities/internal\";\nimport { cacheSizes } from \"../caching/index.js\";\nlet printCache;\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n *\n * @remarks This is the same function as the GraphQL.js `print` function but\n * with an added cache to avoid recomputation when encountering the same\n * `ASTNode` more than once.\n */\nexport const print = Object.assign((ast) => {\n let result = printCache.get(ast);\n if (!result) {\n result = origPrint(ast);\n printCache.set(ast, result);\n }\n return result;\n}, {\n reset() {\n printCache = new AutoCleanedWeakCache(cacheSizes.print || 2000 /* defaultCacheSizes.print */);\n },\n});\nprint.reset();\nif (__DEV__) {\n registerGlobalCache(\"print\", () => (printCache ? printCache.size : 0));\n}\n//# sourceMappingURL=print.js.map"],"ignoreList":[0],"mappings":";;;;;AAIA,IAAIE,GASSF,IAAQ,OAAO,QAAQ,MAAQ;CACxC,IAAII,IAASF,EAAW,IAAIG,CAAG;CAK/B,OAJKD,MACD,IAASH,EAAUI,CAAG,GACtBH,EAAW,IAAIG,GAAKD,CAAM,IAEvBA;AACX,GAAG,EACC,QAAQ;CACJ,IAAa,IAAIG,EAAqBC,EAAW,SAAS,GAAkC;AAChG,EACJ,CAAC;AACDR,EAAM,MAAM"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { WeakCache as e } from "../../../../@wry/caches/lib/weak.js";
|
|
2
|
-
// node_modules/@apollo/client/utilities/internal/caches.js
|
|
3
|
-
var t = /* @__PURE__ */ new WeakSet();
|
|
4
|
-
function n(e) {
|
|
5
|
-
e.size <= (e.max || -1) || t.has(e) || (t.add(e), setTimeout(() => {
|
|
6
|
-
e.clean(), t.delete(e);
|
|
7
|
-
}, 100));
|
|
8
|
-
}
|
|
9
|
-
var r = function(t, r) {
|
|
10
|
-
let i = new e(t, r);
|
|
11
|
-
return i.set = function(t, r) {
|
|
12
|
-
let i = e.prototype.set.call(this, t, r);
|
|
13
|
-
return n(this), i;
|
|
14
|
-
}, i;
|
|
15
|
-
};
|
|
16
|
-
export { r as AutoCleanedWeakCache };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=caches.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"caches.js","names":["scheduledCleanup","schedule","cache","AutoCleanedWeakCache","WeakCache","max","dispose","ret","key","value"],"sources":["../../../../../../node_modules/@apollo/client/utilities/internal/caches.js"],"sourcesContent":["import { StrongCache, WeakCache } from \"@wry/caches\";\nconst scheduledCleanup = new WeakSet();\nfunction schedule(cache) {\n if (cache.size <= (cache.max || -1)) {\n return;\n }\n if (!scheduledCleanup.has(cache)) {\n scheduledCleanup.add(cache);\n setTimeout(() => {\n cache.clean();\n scheduledCleanup.delete(cache);\n }, 100);\n }\n}\n/**\n* @internal\n* A version of WeakCache that will auto-schedule a cleanup of the cache when\n* a new item is added and the cache reached maximum size.\n* Throttled to once per 100ms.\n*\n* @privateRemarks\n* Should be used throughout the rest of the codebase instead of WeakCache,\n* with the notable exception of usage in `wrap` from `optimism` - that one\n* already handles cleanup and should remain a `WeakCache`.\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport const AutoCleanedWeakCache = function (max, dispose) {\n /*\n Some builds of `WeakCache` are function prototypes, some are classes.\n This library still builds with an ES5 target, so we can't extend the\n real classes.\n Instead, we have to use this workaround until we switch to a newer build\n target.\n */\n const cache = new WeakCache(max, dispose);\n cache.set = function (key, value) {\n const ret = WeakCache.prototype.set.call(this, key, value);\n schedule(this);\n return ret;\n };\n return cache;\n};\n/**\n* @internal\n* A version of StrongCache that will auto-schedule a cleanup of the cache when\n* a new item is added and the cache reached maximum size.\n* Throttled to once per 100ms.\n*\n* @privateRemarks\n* Should be used throughout the rest of the codebase instead of StrongCache,\n* with the notable exception of usage in `wrap` from `optimism` - that one\n* already handles cleanup and should remain a `StrongCache`.\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport const AutoCleanedStrongCache = function (max, dispose) {\n /*\n Some builds of `StrongCache` are function prototypes, some are classes.\n This library still builds with an ES5 target, so we can't extend the\n real classes.\n Instead, we have to use this workaround until we switch to a newer build\n target.\n */\n const cache = new StrongCache(max, dispose);\n cache.set = function (key, value) {\n const ret = StrongCache.prototype.set.call(this, key, value);\n schedule(this);\n return ret;\n };\n return cache;\n};\n//# sourceMappingURL=caches.js.map\n"],"ignoreList":[0],"mappings":";;AACA,IAAMA,oBAAmB,IAAI,QAAQ;AACrC,SAASC,EAAS,GAAO;CACrB,AAAIC,EAAM,SAASA,EAAM,OAAO,OAG3BF,EAAiB,IAAIE,CAAK,MAC3BF,EAAiB,IAAIE,CAAK,GAC1B,iBAAiB;EAEb,AADAA,EAAM,MAAM,GACZF,EAAiB,OAAOE,CAAK;CACjC,GAAG,GAAG;AAEd;AAcA,IAAaC,IAAuB,SAAU,GAAK,GAAS;CAQxD,IAAMD,IAAQ,IAAIE,EAAUC,GAAKC,CAAO;CAMxC,OALA,EAAM,MAAM,SAAU,GAAK,GAAO;EAC9B,IAAMC,IAAMH,EAAU,UAAU,IAAI,KAAK,MAAMI,GAAKC,CAAK;EAEzD,OADAR,EAAS,IAAI,GACNM;CACX,GACOL;AACX"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { invariant as e, newInvariantError as t } from "../invariant/index.js";
|
|
2
|
-
import { cacheSizes as n } from "../caching/sizes.js";
|
|
3
|
-
import { getOperationName as r } from "./getOperationName.js";
|
|
4
|
-
import { memoize as i } from "./memoize.js";
|
|
5
|
-
import { Kind as a, visit as o } from "graphql";
|
|
6
|
-
// node_modules/@apollo/client/utilities/internal/checkDocument.js
|
|
7
|
-
var s = i((n, i) => {
|
|
8
|
-
e(n && n.kind === "Document", 1);
|
|
9
|
-
let s = n.definitions.filter((e) => e.kind === "OperationDefinition");
|
|
10
|
-
i && e(s.length == 1 && s[0].operation === i, 4, i, i, s[0].operation), o(n, { Field(e, i, o, c) {
|
|
11
|
-
if (e.alias && (e.alias.value === "__typename" || e.alias.value.startsWith("__ac_")) && e.alias.value !== e.name.value) {
|
|
12
|
-
let i = n, o = [];
|
|
13
|
-
for (let e of c) i = i[e], i.kind === a.FIELD && o.push(i.alias?.value || i.name.value);
|
|
14
|
-
throw o.splice(-1, 1, e.name.value), t(5, e.alias.value, o.join("."), s[0].operation, r(n, "(anonymous)"));
|
|
15
|
-
}
|
|
16
|
-
} });
|
|
17
|
-
}, { max: n.checkDocument || 2e3 });
|
|
18
|
-
export { s as checkDocument };
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=checkDocument.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkDocument.js","names":["checkDocument","memoize","doc","operations","d","expectedType","invariant","visit","field","current","fieldPath","key","path","Kind","newInvariantError","getOperationName","cacheSizes","\"checkDocument\""],"sources":["../../../../../../node_modules/@apollo/client/utilities/internal/checkDocument.js"],"sourcesContent":["// Checks the document for errors and throws an exception if there is an error.\nimport { Kind, visit } from \"graphql\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { invariant, newInvariantError, } from \"@apollo/client/utilities/invariant\";\nimport { cacheSizes } from \"../caching/sizes.js\";\nimport { getOperationName } from \"./getOperationName.js\";\nimport { memoize } from \"./memoize.js\";\n/**\n* Checks the document for errors and throws an exception if there is an error.\n*\n* @internal\n* \n* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.\n*/\nexport const checkDocument = memoize((doc, expectedType) => {\n invariant(doc && doc.kind === \"Document\", 1);\n const operations = doc.definitions.filter((d) => d.kind === \"OperationDefinition\");\n if (__DEV__) {\n doc.definitions.forEach((definition) => {\n if (definition.kind !== \"OperationDefinition\" &&\n definition.kind !== \"FragmentDefinition\") {\n throw newInvariantError(2, definition.kind);\n }\n });\n invariant(operations.length <= 1, 3, operations.length);\n }\n if (expectedType) {\n invariant(\n operations.length == 1 && operations[0].operation === expectedType,\n 4,\n expectedType,\n expectedType,\n operations[0].operation\n );\n }\n visit(doc, {\n Field(field, _, __, path) {\n if (field.alias &&\n (field.alias.value === \"__typename\" ||\n field.alias.value.startsWith(\"__ac_\")) &&\n field.alias.value !== field.name.value) {\n // not using `invariant` so path calculation only happens in error case\n let current = doc, fieldPath = [];\n for (const key of path) {\n current = current[key];\n if (current.kind === Kind.FIELD) {\n fieldPath.push(current.alias?.value || current.name.value);\n }\n }\n fieldPath.splice(-1, 1, field.name.value);\n throw newInvariantError(\n 5,\n field.alias.value,\n fieldPath.join(\".\"),\n operations[0].operation,\n getOperationName(doc, \"(anonymous)\")\n );\n }\n },\n });\n}, {\n max: cacheSizes[\"checkDocument\"] || 2000 /* defaultCacheSizes[\"checkDocument\"] */,\n});\n//# sourceMappingURL=checkDocument.js.map\n"],"ignoreList":[0],"mappings":";;;;;;AAcA,IAAaA,IAAgBC,GAAS,GAAK,MAAiB;CACxD,EAAUC,KAAOA,EAAI,SAAS,YAAY,CAAC;CAC3C,IAAMC,IAAaD,EAAI,YAAY,QAAQ,MAAME,EAAE,SAAS,qBAAqB;CAmBjF,AATIC,KACAC,EACIH,EAAW,UAAU,KAAKA,EAAW,EAAE,CAAC,cAAcE,GACtD,GACAA,GACAA,GACAF,EAAW,EAAE,CAAC,SAClB,GAEJI,EAAML,GAAK,EACP,MAAM,GAAO,GAAG,GAAI,GAAM;EACtB,IAAIM,EAAM,UACLA,EAAM,MAAM,UAAU,gBACnBA,EAAM,MAAM,MAAM,WAAW,OAAO,MACxCA,EAAM,MAAM,UAAUA,EAAM,KAAK,OAAO;GAExC,IAAIC,IAAUP,GAAKQ,IAAY,CAAC;GAChC,KAAK,IAAMC,KAAOC,GAEd,AADA,IAAUH,EAAQE,IACdF,EAAQ,SAASI,EAAK,SACtBH,EAAU,KAAKD,EAAQ,OAAO,SAASA,EAAQ,KAAK,KAAK;GAIjE,MADAC,EAAU,OAAO,IAAI,GAAGF,EAAM,KAAK,KAAK,GAClCM,EACF,GACAN,EAAM,MAAM,OACZE,EAAU,KAAK,GAAG,GAClBP,EAAW,EAAE,CAAC,WACdY,EAAiBb,GAAK,aAAa,CACvC;EACJ;CACJ,EACJ,CAAC;AACL,GAAG,EACC,KAAKc,EAAWC,iBAAoB,IACxC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { newInvariantError as e } from "../invariant/index.js";
|
|
2
|
-
import { checkDocument as t } from "./checkDocument.js";
|
|
3
|
-
// node_modules/@apollo/client/utilities/internal/getMainDefinition.js
|
|
4
|
-
function n(n) {
|
|
5
|
-
t(n);
|
|
6
|
-
let r;
|
|
7
|
-
for (let e of n.definitions) {
|
|
8
|
-
if (e.kind === "OperationDefinition") return e;
|
|
9
|
-
e.kind === "FragmentDefinition" && !r && (r = e);
|
|
10
|
-
}
|
|
11
|
-
if (r) return r;
|
|
12
|
-
throw e(14);
|
|
13
|
-
}
|
|
14
|
-
export { n as getMainDefinition };
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=getMainDefinition.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMainDefinition.js","names":["getMainDefinition","queryDoc","fragmentDefinition","definition","newInvariantError"],"sources":["../../../../../../node_modules/@apollo/client/utilities/internal/getMainDefinition.js"],"sourcesContent":["import { newInvariantError } from \"@apollo/client/utilities/invariant\";\nimport { checkDocument } from \"./checkDocument.js\";\n/**\n * Returns the first operation definition from a GraphQL document. The function\n * prioritizes operation definitions over fragment definitions, which makes it\n * suitable for documents that may contain both. If no operation definition is\n * found, the first fragment definition will be returned. If no definitions are\n * found, an error is thrown.\n *\n * @remarks\n *\n * Use this function when you need to perform more advanced tasks with the main\n * definition AST node. If you want to determine when a document is a specific\n * operation type, prefer the `isQueryOperation`, `isMutationOperation`, and\n * `isSubscriptionOperation` utility functions instead.\n *\n * @param queryDoc - The GraphQL document to extract the definition from\n * @returns The main operation or fragment definition AST node\n *\n * @example\n *\n * ```ts\n * import { gql } from \"@apollo/client\";\n * import { getMainDefinition } from \"@apollo/client/utilities\";\n *\n * const query = gql`\n * query GetUser($id: ID!) {\n * user(id: $id) {\n * name\n * email\n * }\n * }\n * `;\n *\n * const definition = getMainDefinition(query);\n * ```\n *\n * @throws When the document contains no operation or fragment definitions\n */\nexport function getMainDefinition(queryDoc) {\n checkDocument(queryDoc);\n let fragmentDefinition;\n for (let definition of queryDoc.definitions) {\n if (definition.kind === \"OperationDefinition\") {\n return definition;\n }\n if (definition.kind === \"FragmentDefinition\" && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition;\n }\n }\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n throw newInvariantError(14);\n}\n//# sourceMappingURL=getMainDefinition.js.map\n"],"ignoreList":[0],"mappings":";;;AAuCA,SAAgBA,EAAkB,GAAU;CACxC,EAAcC,CAAQ;CACtB,IAAIC;CACJ,KAAK,IAAIC,KAAcF,EAAS,aAAa;EACzC,IAAIE,EAAW,SAAS,uBACpB,OAAOA;EAEX,AAAIA,EAAW,SAAS,wBAAwB,CAACD,MAG7C,IAAqBC;CAE7B;CACA,IAAID,GACA,OAAOA;CAEX,MAAME,EAAkB,EAAE;AAC9B"}
|