@cyberskill/shared 2.27.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/config.util.cjs +1 -1
- package/dist/config/config.util.js +24 -33
- package/dist/config/eslint/index.cjs +1 -1
- package/dist/config/eslint/index.d.ts +6 -0
- package/dist/config/eslint/index.js +4 -12
- package/dist/config/graphql-codegen/graphql-codegen.util.cjs +1 -1
- package/dist/config/graphql-codegen/graphql-codegen.util.js +28 -33
- package/dist/config/storybook/storybook.preview.cjs +1 -1
- package/dist/config/storybook/storybook.preview.js +10 -13
- package/dist/config/vitest/vitest.e2e.cjs +1 -1
- package/dist/config/vitest/vitest.e2e.js +1 -1
- package/dist/config/vitest/vitest.unit.cjs +1 -1
- package/dist/config/vitest/vitest.unit.js +19 -8
- package/dist/constant/common.cjs +1 -1
- package/dist/constant/common.js +1 -1
- package/dist/node/apollo-server/apollo-server.util.cjs +1 -1
- package/dist/node/apollo-server/apollo-server.util.js +21 -48
- package/dist/node/cli/index.cjs +2 -5
- package/dist/node/cli/index.js +109 -170
- package/dist/node/command/command.util.cjs +2 -2
- package/dist/node/command/command.util.js +135 -170
- package/dist/node/express/express.util.cjs +1 -1
- package/dist/node/express/express.util.js +39 -72
- package/dist/node/fs/fs.util.cjs +4 -1
- package/dist/node/fs/fs.util.d.ts +8 -0
- package/dist/node/fs/fs.util.js +46 -53
- package/dist/node/fs/index.cjs +1 -1
- package/dist/node/fs/index.js +13 -12
- package/dist/node/log/log.util.cjs +1 -1
- package/dist/node/log/log.util.js +29 -30
- package/dist/node/mongo/mongo.controller.cjs +1 -1
- package/dist/node/mongo/mongo.controller.js +531 -629
- package/dist/node/mongo/mongo.type.js +3 -3
- package/dist/node/mongo/mongo.util.cjs +2 -5
- package/dist/node/mongo/mongo.util.js +308 -354
- package/dist/node/package/package.util.cjs +1 -1
- package/dist/node/package/package.util.js +197 -226
- package/dist/node/path/index.cjs +1 -1
- package/dist/node/path/index.js +26 -25
- package/dist/node/path/path.constant.cjs +1 -1
- package/dist/node/path/path.constant.d.ts +2 -0
- package/dist/node/path/path.constant.js +130 -150
- package/dist/node/storage/storage.util.cjs +1 -1
- package/dist/node/storage/storage.util.js +110 -158
- package/dist/node/upload/upload.util.cjs +1 -1
- package/dist/node/upload/upload.util.js +119 -150
- package/dist/node/ws/ts.util.cjs +1 -1
- package/dist/node/ws/ts.util.js +31 -54
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.component.js +4 -4
- package/dist/react/apollo-client/apollo-client.util.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.util.js +51 -58
- package/dist/react/apollo-client/links/upload.cjs +1 -1
- package/dist/react/apollo-client/links/upload.js +71 -74
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +1 -1
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +11 -18
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.component.js +61 -23
- package/dist/react/apollo-error/apollo-error.module.scss.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.module.scss.js +6 -6
- package/dist/react/apollo-error/apollo-error.test.unit.d.ts +1 -0
- package/dist/react/apollo-error/apollo-error.util.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.util.js +6 -6
- package/dist/react/loading/loading.component.cjs +2 -2
- package/dist/react/loading/loading.component.js +30 -46
- package/dist/react/log/log.util.cjs +1 -1
- package/dist/react/log/log.util.js +4 -4
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
- package/dist/react/next-intl/next-intl.hoc.js +13 -22
- package/dist/react/next-intl/next-intl.provider.cjs +1 -1
- package/dist/react/next-intl/next-intl.provider.js +7 -7
- package/dist/react/storage/storage.hook.cjs +1 -1
- package/dist/react/storage/storage.hook.js +43 -59
- package/dist/react/storage/storage.util.cjs +1 -1
- package/dist/react/storage/storage.util.js +28 -53
- package/dist/react/userback/userback.component.cjs +1 -1
- package/dist/react/userback/userback.component.js +18 -42
- package/dist/style.css +1 -1
- package/dist/util/common/common.util.cjs +1 -1
- package/dist/util/common/common.util.d.ts +11 -0
- package/dist/util/common/common.util.js +33 -37
- package/dist/util/common/index.cjs +1 -1
- package/dist/util/common/index.js +6 -5
- package/dist/util/index.cjs +1 -1
- package/dist/util/index.js +22 -20
- package/dist/util/object/object.util.cjs +1 -1
- package/dist/util/object/object.util.js +70 -70
- package/dist/util/string/index.cjs +1 -1
- package/dist/util/string/index.js +4 -3
- package/dist/util/string/string.util.cjs +1 -1
- package/dist/util/string/string.util.d.ts +12 -0
- package/dist/util/string/string.util.js +63 -44
- package/package.json +53 -44
- package/public/tsconfig.base.json +7 -3
- package/README.md +0 -470
- package/dist/node/mongo/mongo.util.d.ts +0 -1040
- /package/dist/node_modules/.pnpm/{vitest@4.0.17_@types_node@25.0.9_jiti@2.6.1_jsdom@27.4.0_@noble_hashes@1.8.0__sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
- /package/dist/node_modules/.pnpm/{vitest@4.0.17_@types_node@25.0.9_jiti@2.6.1_jsdom@27.4.0_@noble_hashes@1.8.0__sass@1.97.2_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.18_@types_node@25.3.3_jiti@2.6.1_jsdom@28.1.0_@noble_hashes@1.8.0__sass@1.97.3_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
package/dist/node/ws/ts.util.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("graphql-ws/use/ws"),u=require("ws");function h(c){const{server:o,path:a,sessionParser:n}=c;if(n){const t=new u.WebSocketServer({noServer:!0});return o.on("upgrade",(e,r,s)=>{try{if(new URL(e.url||"","http://localhost").pathname!==a)return;n(e,{},()=>{t.handleUpgrade(e,r,s,i=>{t.emit("connection",i,e)})})}catch{r.destroy()}}),t}return new u.WebSocketServer({server:o,path:a})}function l(c){const{schema:o,server:a,context:n,onConnect:t}=c;return S.useServer({schema:o,context:async e=>{const r=e.extra.request,s=n?await n(r):{};return{req:r,...s}},onConnect:async e=>{if(t){const r=e.extra.request;await t(r)}}},a)}exports.createWSServer=h;exports.initGraphQLWS=l;
|
package/dist/node/ws/ts.util.js
CHANGED
|
@@ -1,68 +1,45 @@
|
|
|
1
|
-
import { useServer as
|
|
2
|
-
import { WebSocketServer as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
_.call(r, e) && f(t, e, r[e]);
|
|
9
|
-
return t;
|
|
10
|
-
}, v = (t, r, e) => new Promise((l, o) => {
|
|
11
|
-
var n = (c) => {
|
|
12
|
-
try {
|
|
13
|
-
s(e.next(c));
|
|
14
|
-
} catch (u) {
|
|
15
|
-
o(u);
|
|
16
|
-
}
|
|
17
|
-
}, a = (c) => {
|
|
18
|
-
try {
|
|
19
|
-
s(e.throw(c));
|
|
20
|
-
} catch (u) {
|
|
21
|
-
o(u);
|
|
22
|
-
}
|
|
23
|
-
}, s = (c) => c.done ? l(c.value) : Promise.resolve(c.value).then(n, a);
|
|
24
|
-
s((e = e.apply(t, r)).next());
|
|
25
|
-
});
|
|
26
|
-
function S(t) {
|
|
27
|
-
const { server: r, path: e, sessionParser: l } = t;
|
|
28
|
-
if (l) {
|
|
29
|
-
const o = new i({ noServer: !0 });
|
|
30
|
-
return r.on("upgrade", (n, a, s) => {
|
|
1
|
+
import { useServer as p } from "graphql-ws/use/ws";
|
|
2
|
+
import { WebSocketServer as u } from "ws";
|
|
3
|
+
function f(c) {
|
|
4
|
+
const { server: o, path: a, sessionParser: n } = c;
|
|
5
|
+
if (n) {
|
|
6
|
+
const r = new u({ noServer: !0 });
|
|
7
|
+
return o.on("upgrade", (e, t, s) => {
|
|
31
8
|
try {
|
|
32
|
-
if (new URL(
|
|
9
|
+
if (new URL(e.url || "", "http://localhost").pathname !== a)
|
|
33
10
|
return;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
n(e, {}, () => {
|
|
12
|
+
r.handleUpgrade(e, t, s, (i) => {
|
|
13
|
+
r.emit("connection", i, e);
|
|
37
14
|
});
|
|
38
15
|
});
|
|
39
|
-
} catch
|
|
40
|
-
|
|
16
|
+
} catch {
|
|
17
|
+
t.destroy();
|
|
41
18
|
}
|
|
42
|
-
}),
|
|
19
|
+
}), r;
|
|
43
20
|
}
|
|
44
|
-
return new
|
|
21
|
+
return new u({ server: o, path: a });
|
|
45
22
|
}
|
|
46
|
-
function
|
|
47
|
-
const { schema:
|
|
48
|
-
return
|
|
23
|
+
function S(c) {
|
|
24
|
+
const { schema: o, server: a, context: n, onConnect: r } = c;
|
|
25
|
+
return p(
|
|
49
26
|
{
|
|
50
|
-
schema:
|
|
51
|
-
context: (
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
}
|
|
55
|
-
onConnect: (
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
|
|
27
|
+
schema: o,
|
|
28
|
+
context: async (e) => {
|
|
29
|
+
const t = e.extra.request, s = n ? await n(t) : {};
|
|
30
|
+
return { req: t, ...s };
|
|
31
|
+
},
|
|
32
|
+
onConnect: async (e) => {
|
|
33
|
+
if (r) {
|
|
34
|
+
const t = e.extra.request;
|
|
35
|
+
await r(t);
|
|
59
36
|
}
|
|
60
|
-
}
|
|
37
|
+
}
|
|
61
38
|
},
|
|
62
|
-
|
|
39
|
+
a
|
|
63
40
|
);
|
|
64
41
|
}
|
|
65
42
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
f as createWSServer,
|
|
44
|
+
S as initGraphQLWS
|
|
68
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@apollo/client/react"),n=require("react"),c=require("./apollo-client.context.cjs"),a=require("./apollo-client.util.cjs"),u=require("../apollo-error/apollo-error.provider.cjs"),p=require("../apollo-error/apollo-error.component.cjs"),m=require("react-hot-toast");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@apollo/client/react"),n=require("react"),c=require("./apollo-client.context.cjs"),a=require("./apollo-client.util.cjs"),u=require("../apollo-error/apollo-error.provider.cjs"),p=require("../apollo-error/apollo-error.component.cjs"),m=require("react-hot-toast");function s(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,l.get?l:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const t=s(n);function d({options:e,children:o,onError:r}){const l=n.useMemo(()=>a.getClient(e??{}),[e]);return t.createElement(t.Fragment,null,t.createElement(u.ApolloErrorProvider,{onError:r},t.createElement(c.ApolloClientProvider,{client:l},t.createElement(i.ApolloProvider,{client:l},o)),!r&&t.createElement(p.ApolloErrorComponent,null)),t.createElement(m.Toaster,{position:"top-right"}))}exports.ApolloProvider=d;
|
|
@@ -6,12 +6,12 @@ import { getClient as p } from "./apollo-client.util.js";
|
|
|
6
6
|
import { ApolloErrorProvider as a } from "../apollo-error/apollo-error.provider.js";
|
|
7
7
|
import { ApolloErrorComponent as c } from "../apollo-error/apollo-error.component.js";
|
|
8
8
|
import { Toaster as f } from "react-hot-toast";
|
|
9
|
-
function g({ options:
|
|
9
|
+
function g({ options: o, children: l, onError: r }) {
|
|
10
10
|
const t = i(
|
|
11
|
-
() => p(
|
|
12
|
-
[
|
|
11
|
+
() => p(o ?? {}),
|
|
12
|
+
[o]
|
|
13
13
|
);
|
|
14
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(a, { onError:
|
|
14
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(a, { onError: r }, /* @__PURE__ */ e.createElement(n, { client: t }, /* @__PURE__ */ e.createElement(m, { client: t }, l)), !r && /* @__PURE__ */ e.createElement(c, null)), /* @__PURE__ */ e.createElement(f, { position: "top-right" }));
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
17
|
g as ApolloProvider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@apollo/client/core"),c=require("@apollo/client/link"),b=require("@apollo/client/link/error"),w=require("@apollo/client/link/remove-typename"),q=require("@apollo/client/link/subscriptions"),h=require("graphql"),y=require("graphql-ws"),A=require("react"),E=require("rxjs"),f=require("./apollo-client.constant.cjs"),m=require("./apollo-client.module.scss.cjs"),C=require("./links/upload.cjs"),p=require("../apollo-error/apollo-error.util.cjs"),l=require("../log/log.util.cjs"),d=require("react-hot-toast");function T(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const g=T(A),N=new c.ApolloLink((e,o)=>(e.setContext({start:new Date}),o(e).pipe(E.tap(()=>{const r=new Date().getTime()-e.getContext().start;l.log.info(`Operation ${e.operationName} took ${r}ms to complete`)})))),$=new b.ErrorLink(({error:e,operation:o})=>{const r=o?.operationName||"Unknown";let t="";a.CombinedGraphQLErrors.is(e)?e.errors.forEach(({message:n,locations:i,path:s},u)=>{u===0&&(t=n),l.log.error(`[GraphQL error] ${r}: ${n}, Location: ${JSON.stringify(i,null,4)}, Path: ${s}`)}):a.CombinedProtocolErrors.is(e)?e.errors.forEach(({message:n,extensions:i},s)=>{s===0&&(t=n),l.log.error(`[Protocol error]: ${n}, Extensions: ${JSON.stringify(i,null,4)}`)}):a.ServerError.is(e)?(t=e.message,l.log.error(`[Server error]: ${e.message}`)):(t=e.message,l.log.error(`[Network error]: ${e.message}`)),e&&t&&typeof window<"u"&&(p.hasCustomApolloErrorHandler()?p.showGlobalApolloError(e):d.toast.error(n=>g.createElement("div",{className:m.default["error-container"]},t,g.createElement("button",{type:"button",className:m.default["error-details-button"],onClick:()=>{p.showGlobalApolloError(e),d.toast.dismiss(n.id)}},"Error Details"))))});function k(e){const{uri:o,wsUrl:r,customLinks:t}=e,n=new w.RemoveTypenameFromVariablesLink;o||l.log.warn(`[Apollo] No GraphQL URI provided — using "${f.GRAPHQL_URI_DEFAULT}" as default`);const i=C.createUploadLink({uri:o??f.GRAPHQL_URI_DEFAULT,credentials:"include",headers:{"apollo-require-preflight":"true"}}),s=r?new q.GraphQLWsLink(y.createClient({url:r})):c.ApolloLink.empty(),u=r?c.ApolloLink.split(({operationType:L})=>L===h.OperationTypeNode.SUBSCRIPTION,s,i):i;return r&&u===i&&l.log.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[N,$,n,...t??[],u]}function O(e){const o=c.ApolloLink.from(k(e));return new a.ApolloClient({link:o,cache:new a.InMemoryCache,...e})}exports.createApolloLinks=k;exports.getClient=O;
|
|
@@ -1,84 +1,77 @@
|
|
|
1
|
-
import { ApolloClient as
|
|
2
|
-
import { ApolloLink as
|
|
3
|
-
import { ErrorLink as
|
|
4
|
-
import { RemoveTypenameFromVariablesLink as
|
|
5
|
-
import { GraphQLWsLink as
|
|
6
|
-
import { OperationTypeNode as
|
|
7
|
-
import { createClient as
|
|
1
|
+
import { ApolloClient as d, InMemoryCache as w, CombinedGraphQLErrors as h, CombinedProtocolErrors as E, ServerError as g } from "@apollo/client/core";
|
|
2
|
+
import { ApolloLink as a } from "@apollo/client/link";
|
|
3
|
+
import { ErrorLink as C } from "@apollo/client/link/error";
|
|
4
|
+
import { RemoveTypenameFromVariablesLink as y } from "@apollo/client/link/remove-typename";
|
|
5
|
+
import { GraphQLWsLink as N } from "@apollo/client/link/subscriptions";
|
|
6
|
+
import { OperationTypeNode as $ } from "graphql";
|
|
7
|
+
import { createClient as b } from "graphql-ws";
|
|
8
8
|
import * as p from "react";
|
|
9
|
-
import { tap as
|
|
10
|
-
import { GRAPHQL_URI_DEFAULT as
|
|
11
|
-
import
|
|
12
|
-
import { createUploadLink as
|
|
13
|
-
import { hasCustomApolloErrorHandler as
|
|
9
|
+
import { tap as A } from "rxjs";
|
|
10
|
+
import { GRAPHQL_URI_DEFAULT as c } from "./apollo-client.constant.js";
|
|
11
|
+
import f from "./apollo-client.module.scss.js";
|
|
12
|
+
import { createUploadLink as T } from "./links/upload.js";
|
|
13
|
+
import { hasCustomApolloErrorHandler as U, showGlobalApolloError as u } from "../apollo-error/apollo-error.util.js";
|
|
14
14
|
import { log as s } from "../log/log.util.js";
|
|
15
|
-
import { toast as
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
for (var o of w(e))
|
|
21
|
-
U.call(e, o) && L(r, o, e[o]);
|
|
22
|
-
return r;
|
|
23
|
-
};
|
|
24
|
-
const R = new m((r, e) => (r.setContext({ start: /* @__PURE__ */ new Date() }), e(r).pipe(
|
|
25
|
-
N(() => {
|
|
26
|
-
const o = (/* @__PURE__ */ new Date()).getTime() - r.getContext().start;
|
|
27
|
-
s.info(`Operation ${r.operationName} took ${o}ms to complete`);
|
|
15
|
+
import { toast as L } from "react-hot-toast";
|
|
16
|
+
const R = new a((o, e) => (o.setContext({ start: /* @__PURE__ */ new Date() }), e(o).pipe(
|
|
17
|
+
A(() => {
|
|
18
|
+
const t = (/* @__PURE__ */ new Date()).getTime() - o.getContext().start;
|
|
19
|
+
s.info(`Operation ${o.operationName} took ${t}ms to complete`);
|
|
28
20
|
})
|
|
29
|
-
))),
|
|
30
|
-
const
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`[GraphQL error] ${
|
|
21
|
+
))), S = new C(({ error: o, operation: e }) => {
|
|
22
|
+
const t = e?.operationName || "Unknown";
|
|
23
|
+
let i = "";
|
|
24
|
+
h.is(o) ? o.errors.forEach(({ message: r, locations: n, path: l }, m) => {
|
|
25
|
+
m === 0 && (i = r), s.error(
|
|
26
|
+
`[GraphQL error] ${t}: ${r}, Location: ${JSON.stringify(n, null, 4)}, Path: ${l}`
|
|
35
27
|
);
|
|
36
|
-
}) : E.is(
|
|
37
|
-
l === 0 && (
|
|
38
|
-
`[Protocol error]: ${
|
|
28
|
+
}) : E.is(o) ? o.errors.forEach(({ message: r, extensions: n }, l) => {
|
|
29
|
+
l === 0 && (i = r), s.error(
|
|
30
|
+
`[Protocol error]: ${r}, Extensions: ${JSON.stringify(n, null, 4)}`
|
|
39
31
|
);
|
|
40
|
-
}) :
|
|
32
|
+
}) : g.is(o) ? (i = o.message, s.error(`[Server error]: ${o.message}`)) : (i = o.message, s.error(`[Network error]: ${o.message}`)), o && i && typeof window < "u" && (U() ? u(o) : L.error((r) => /* @__PURE__ */ p.createElement("div", { className: f["error-container"] }, i, /* @__PURE__ */ p.createElement(
|
|
41
33
|
"button",
|
|
42
34
|
{
|
|
43
35
|
type: "button",
|
|
44
|
-
className:
|
|
36
|
+
className: f["error-details-button"],
|
|
45
37
|
onClick: () => {
|
|
46
|
-
u(
|
|
38
|
+
u(o), L.dismiss(r.id);
|
|
47
39
|
}
|
|
48
40
|
},
|
|
49
41
|
"Error Details"
|
|
50
42
|
))));
|
|
51
43
|
});
|
|
52
|
-
function
|
|
53
|
-
const { uri: e, wsUrl:
|
|
54
|
-
e || s.warn(`[Apollo] No GraphQL URI provided — using "${
|
|
55
|
-
const
|
|
56
|
-
uri: e
|
|
44
|
+
function v(o) {
|
|
45
|
+
const { uri: e, wsUrl: t, customLinks: i } = o, r = new y();
|
|
46
|
+
e || s.warn(`[Apollo] No GraphQL URI provided — using "${c}" as default`);
|
|
47
|
+
const n = T({
|
|
48
|
+
uri: e ?? c,
|
|
57
49
|
credentials: "include",
|
|
58
50
|
headers: {
|
|
59
51
|
"apollo-require-preflight": "true"
|
|
60
52
|
}
|
|
61
|
-
}), l =
|
|
62
|
-
({ operationType: k }) => k ===
|
|
53
|
+
}), l = t ? new N(b({ url: t })) : a.empty(), m = t ? a.split(
|
|
54
|
+
({ operationType: k }) => k === $.SUBSCRIPTION,
|
|
63
55
|
l,
|
|
64
|
-
|
|
65
|
-
) :
|
|
66
|
-
return
|
|
56
|
+
n
|
|
57
|
+
) : n;
|
|
58
|
+
return t && m === n && s.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."), [
|
|
67
59
|
R,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
...
|
|
71
|
-
|
|
60
|
+
S,
|
|
61
|
+
r,
|
|
62
|
+
...i ?? [],
|
|
63
|
+
m
|
|
72
64
|
];
|
|
73
65
|
}
|
|
74
|
-
function
|
|
75
|
-
const e =
|
|
76
|
-
return new
|
|
66
|
+
function B(o) {
|
|
67
|
+
const e = a.from(v(o));
|
|
68
|
+
return new d({
|
|
77
69
|
link: e,
|
|
78
|
-
cache: new
|
|
79
|
-
|
|
70
|
+
cache: new w(),
|
|
71
|
+
...o
|
|
72
|
+
});
|
|
80
73
|
}
|
|
81
74
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
v as createApolloLinks,
|
|
76
|
+
B as getClient
|
|
84
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("@apollo/client/link"),c=require("@apollo/client/link/http"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("@apollo/client/link"),c=require("@apollo/client/link/http"),F=require("@apollo/client/utilities"),T=require("extract-files/extractFiles.mjs"),v=require("extract-files/isExtractableFile.mjs");function G(){if(typeof AbortController>"u")return{controller:!1,signal:!1};const o=new AbortController,i=o.signal;return{controller:o,signal:i}}function H(o,i,a){"name"in a?o.append(i,a,a.name):o.append(i,a)}function J({uri:o="/graphql",useGETForQueries:i,isExtractableFile:a=v,FormData:q,formDataAppendFile:x=H,print:E=c.defaultPrinter,fetch:O,fetchOptions:k,credentials:w,headers:A,includeExtensions:C}={}){const S={http:{includeExtensions:C},options:k,credentials:w,headers:A};return new L.ApolloLink(l=>{const p=l.getContext(),{clientAwareness:{name:h,version:g}={},headers:U}=p,D={http:p.http,options:p.fetchOptions,credentials:p.credentials,headers:{...h&&{"apollographql-client-name":h},...g&&{"apollographql-client-version":g},...U}},{options:t,body:b}=c.selectHttpOptionsAndBodyInternal(l,E,c.fallbackHttpConfig,S,D),{clone:m,files:f}=T(b,a,"");let d=c.selectURI(l,o);if(f.size){t.headers&&delete t.headers["content-type"];const n=q||FormData,r=new n;r.append("operations",JSON.stringify(m));const e={};let u=0;f.forEach(y=>{e[++u]=y}),r.append("map",JSON.stringify(e)),u=0,f.forEach((y,R)=>{x(r,String(++u),R)}),t.body=r}else if(i&&!l.query.definitions.some(n=>n.kind==="OperationDefinition"&&n.operation==="mutation")&&(t.method="GET"),t.method==="GET"){const{newURI:n,parseError:r}=c.rewriteURIForGET(d,b);if(r)return new F.Observable(e=>{e.error(r)});d=n}else t.body=JSON.stringify(m);const{controller:s}=G();typeof s!="boolean"&&(t.signal&&(t.signal.aborted?s.abort():t.signal.addEventListener("abort",()=>{s.abort()},{once:!0})),t.signal=s.signal);const I=O||fetch;return new F.Observable(n=>{let r;return I(d,t).then(e=>(l.setContext({response:e}),e)).then(c.parseAndCheckHttpResponse(l)).then(e=>{n.next(e),n.complete()}).catch(e=>{r||(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))}),()=>{r=!0,typeof s!="boolean"&&s.abort()}})})}exports.createUploadLink=J;
|
|
@@ -1,88 +1,85 @@
|
|
|
1
1
|
import { ApolloLink as q } from "@apollo/client/link";
|
|
2
|
-
import { selectHttpOptionsAndBodyInternal as G, defaultPrinter as H, fallbackHttpConfig as J, selectURI as L, rewriteURIForGET as
|
|
3
|
-
import { Observable as
|
|
4
|
-
import
|
|
2
|
+
import { selectHttpOptionsAndBodyInternal as G, defaultPrinter as H, fallbackHttpConfig as J, selectURI as L, rewriteURIForGET as T, parseAndCheckHttpResponse as N } from "@apollo/client/link/http";
|
|
3
|
+
import { Observable as y } from "@apollo/client/utilities";
|
|
4
|
+
import v from "extract-files/extractFiles.mjs";
|
|
5
5
|
import z from "extract-files/isExtractableFile.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
V.call(t, e) && _(n, e, t[e]);
|
|
9
|
-
if (w)
|
|
10
|
-
for (var e of w(t))
|
|
11
|
-
K.call(t, e) && _(n, e, t[e]);
|
|
12
|
-
return n;
|
|
13
|
-
};
|
|
14
|
-
function M() {
|
|
15
|
-
if (typeof AbortController == "undefined")
|
|
6
|
+
function B() {
|
|
7
|
+
if (typeof AbortController > "u")
|
|
16
8
|
return { controller: !1, signal: !1 };
|
|
17
|
-
const
|
|
18
|
-
return { controller:
|
|
9
|
+
const r = new AbortController(), i = r.signal;
|
|
10
|
+
return { controller: r, signal: i };
|
|
19
11
|
}
|
|
20
|
-
function
|
|
21
|
-
"name" in
|
|
12
|
+
function P(r, i, a) {
|
|
13
|
+
"name" in a ? r.append(i, a, a.name) : r.append(i, a);
|
|
22
14
|
}
|
|
23
|
-
function
|
|
24
|
-
uri:
|
|
25
|
-
useGETForQueries:
|
|
26
|
-
isExtractableFile:
|
|
27
|
-
FormData:
|
|
28
|
-
formDataAppendFile:
|
|
29
|
-
print:
|
|
30
|
-
fetch:
|
|
15
|
+
function V({
|
|
16
|
+
uri: r = "/graphql",
|
|
17
|
+
useGETForQueries: i,
|
|
18
|
+
isExtractableFile: a = z,
|
|
19
|
+
FormData: x,
|
|
20
|
+
formDataAppendFile: F = P,
|
|
21
|
+
print: E = H,
|
|
22
|
+
fetch: w,
|
|
31
23
|
fetchOptions: A,
|
|
32
24
|
credentials: C,
|
|
33
|
-
headers:
|
|
34
|
-
includeExtensions:
|
|
25
|
+
headers: O,
|
|
26
|
+
includeExtensions: k
|
|
35
27
|
} = {}) {
|
|
36
|
-
const
|
|
37
|
-
http: { includeExtensions:
|
|
28
|
+
const S = {
|
|
29
|
+
http: { includeExtensions: k },
|
|
38
30
|
options: A,
|
|
39
31
|
credentials: C,
|
|
40
|
-
headers:
|
|
32
|
+
headers: O
|
|
41
33
|
};
|
|
42
34
|
return new q((l) => {
|
|
43
|
-
const
|
|
35
|
+
const c = l.getContext(), {
|
|
44
36
|
// Apollo Studio client awareness `name` and `version` can be configured
|
|
45
37
|
// via `ApolloClient` constructor options:
|
|
46
38
|
// https://www.apollographql.com/docs/graphos/metrics/client-awareness/#setup
|
|
47
|
-
clientAwareness: { name:
|
|
39
|
+
clientAwareness: { name: m, version: h } = {},
|
|
48
40
|
headers: D
|
|
49
|
-
} =
|
|
50
|
-
http:
|
|
51
|
-
options:
|
|
52
|
-
credentials:
|
|
53
|
-
headers:
|
|
54
|
-
|
|
41
|
+
} = c, I = {
|
|
42
|
+
http: c.http,
|
|
43
|
+
options: c.fetchOptions,
|
|
44
|
+
credentials: c.credentials,
|
|
45
|
+
headers: {
|
|
46
|
+
// Client awareness headers can be overridden by context `headers`.
|
|
47
|
+
...m && { "apollographql-client-name": m },
|
|
48
|
+
...h && { "apollographql-client-version": h },
|
|
49
|
+
...D
|
|
50
|
+
}
|
|
51
|
+
}, { options: e, body: u } = G(
|
|
55
52
|
l,
|
|
56
|
-
|
|
53
|
+
E,
|
|
57
54
|
J,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
), { clone:
|
|
61
|
-
let f = L(l,
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
const
|
|
55
|
+
S,
|
|
56
|
+
I
|
|
57
|
+
), { clone: g, files: p } = v(u, a, "");
|
|
58
|
+
let f = L(l, r);
|
|
59
|
+
if (p.size) {
|
|
60
|
+
e.headers && delete e.headers["content-type"];
|
|
61
|
+
const n = x || FormData, o = new n();
|
|
62
|
+
o.append("operations", JSON.stringify(g));
|
|
63
|
+
const t = {};
|
|
67
64
|
let d = 0;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}),
|
|
71
|
-
|
|
72
|
-
}),
|
|
73
|
-
} else if (
|
|
74
|
-
(
|
|
75
|
-
) && (
|
|
76
|
-
const { newURI:
|
|
77
|
-
if (
|
|
78
|
-
return new
|
|
79
|
-
|
|
65
|
+
p.forEach((b) => {
|
|
66
|
+
t[++d] = b;
|
|
67
|
+
}), o.append("map", JSON.stringify(t)), d = 0, p.forEach((b, U) => {
|
|
68
|
+
F(o, String(++d), U);
|
|
69
|
+
}), e.body = o;
|
|
70
|
+
} else if (i && !l.query.definitions.some(
|
|
71
|
+
(n) => n.kind === "OperationDefinition" && n.operation === "mutation"
|
|
72
|
+
) && (e.method = "GET"), e.method === "GET") {
|
|
73
|
+
const { newURI: n, parseError: o } = T(f, u);
|
|
74
|
+
if (o)
|
|
75
|
+
return new y((t) => {
|
|
76
|
+
t.error(o);
|
|
80
77
|
});
|
|
81
|
-
f =
|
|
78
|
+
f = n;
|
|
82
79
|
} else
|
|
83
|
-
|
|
84
|
-
const { controller: s } =
|
|
85
|
-
typeof s != "boolean" && (
|
|
80
|
+
e.body = JSON.stringify(g);
|
|
81
|
+
const { controller: s } = B();
|
|
82
|
+
typeof s != "boolean" && (e.signal && (e.signal.aborted ? s.abort() : e.signal.addEventListener(
|
|
86
83
|
"abort",
|
|
87
84
|
() => {
|
|
88
85
|
s.abort();
|
|
@@ -92,20 +89,20 @@ function tt({
|
|
|
92
89
|
// is long lasting, or controls multiple things.
|
|
93
90
|
once: !0
|
|
94
91
|
}
|
|
95
|
-
)),
|
|
96
|
-
const
|
|
97
|
-
return new
|
|
98
|
-
let
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
}).catch((
|
|
102
|
-
|
|
92
|
+
)), e.signal = s.signal);
|
|
93
|
+
const R = w || fetch;
|
|
94
|
+
return new y((n) => {
|
|
95
|
+
let o;
|
|
96
|
+
return R(f, e).then((t) => (l.setContext({ response: t }), t)).then(N(l)).then((t) => {
|
|
97
|
+
n.next(t), n.complete();
|
|
98
|
+
}).catch((t) => {
|
|
99
|
+
o || (t.result && t.result.errors && t.result.data && n.next(t.result), n.error(t));
|
|
103
100
|
}), () => {
|
|
104
|
-
|
|
101
|
+
o = !0, typeof s != "boolean" && s.abort();
|
|
105
102
|
};
|
|
106
103
|
});
|
|
107
104
|
});
|
|
108
105
|
}
|
|
109
106
|
export {
|
|
110
|
-
|
|
107
|
+
V as createUploadLink
|
|
111
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@apollo/client-integration-nextjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@apollo/client-integration-nextjs"),l=require("@apollo/client/link"),i=require("../apollo-client/apollo-client.util.cjs");function o(e={}){const t=l.ApolloLink.from(i.createApolloLinks(e));return new n.ApolloClient({link:t,cache:new n.InMemoryCache,...e})}exports.getClient=o;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import { ApolloClient as
|
|
2
|
-
import { ApolloLink as
|
|
3
|
-
import { createApolloLinks as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
function v(e = {}) {
|
|
13
|
-
const r = a.from(i(e));
|
|
14
|
-
return new l(_({
|
|
15
|
-
link: r,
|
|
16
|
-
cache: new p()
|
|
17
|
-
}, e));
|
|
1
|
+
import { ApolloClient as r, InMemoryCache as n } from "@apollo/client-integration-nextjs";
|
|
2
|
+
import { ApolloLink as t } from "@apollo/client/link";
|
|
3
|
+
import { createApolloLinks as l } from "../apollo-client/apollo-client.util.js";
|
|
4
|
+
function p(o = {}) {
|
|
5
|
+
const e = t.from(l(o));
|
|
6
|
+
return new r({
|
|
7
|
+
link: e,
|
|
8
|
+
cache: new n(),
|
|
9
|
+
...o
|
|
10
|
+
});
|
|
18
11
|
}
|
|
19
12
|
export {
|
|
20
|
-
|
|
13
|
+
p as getClient
|
|
21
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),E=require("../../util/validate/validate.util.cjs"),y=require("./apollo-error.context.cjs"),s=require("./apollo-error.module.scss.cjs");function g(l){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const r in l)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(l,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>l[r]})}}return e.default=l,Object.freeze(e)}const t=g(i),h='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function v(){const l=i.use(y.ApolloErrorContext),{error:e,hideError:r}=l??{},n=i.useRef(null),c=i.useRef(null);i.useEffect(()=>{if(!e||!r)return;const o=a=>{a.key==="Escape"&&r()};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}},[e,r]),i.useEffect(()=>{e&&n.current?(c.current=document.activeElement,n.current.focus()):!e&&c.current&&(c.current.focus(),c.current=null)},[e]);const p=o=>{if(o.key!=="Tab"||!n.current)return;const a=Array.from(n.current.querySelectorAll(h)).filter(b=>!b.hasAttribute("disabled"));if(a.length===0)return;const d=a[0],f=a[a.length-1];!d||!f||(o.shiftKey?document.activeElement===d&&(o.preventDefault(),f.focus()):document.activeElement===f&&(o.preventDefault(),d.focus()))};if(!e)return null;const u="locations"in e||"path"in e||"extensions"in e,m="message"in e?e.message:"Unknown error occurred";return t.createElement("div",{className:s.default["modal-backdrop"]},t.createElement("div",{ref:n,className:s.default["modal-content"],role:"dialog","aria-modal":"true","aria-labelledby":"apollo-error-title",tabIndex:-1,onKeyDown:p},t.createElement("button",{type:"button",className:s.default["btn-close"],onClick:r,"aria-label":"Close error details",title:"Close error details"},"✕"),t.createElement("div",{id:"apollo-error-title",className:s.default["error-title"]},t.createElement("button",{type:"button",className:s.default["btn-retry"],onClick:()=>window.location.reload(),"aria-label":"Reload page"},"Reload")," ",!E.validate.isEmpty(e)&&m),t.createElement("div",{className:s.default["error-details"]},u&&"locations"in e&&e.locations&&t.createElement("pre",{className:"locations"},t.createElement("strong",null,"Locations:")," ",JSON.stringify(e.locations,null,4)),u&&"path"in e&&e.path&&t.createElement("pre",{className:"path"},t.createElement("strong",null,"Path:")," ",JSON.stringify(e.path,null,4)),u&&"extensions"in e&&e.extensions&&t.createElement("pre",{className:"extensions"},t.createElement("strong",null,"Extensions:")," ",JSON.stringify(e.extensions,null,4)),!u&&t.createElement("pre",{className:"error-details"},t.createElement("strong",null,"Error Details:")," ",E.validate.isEmpty(e)?m:JSON.stringify(e,null,4)))))}exports.ApolloErrorComponent=v;
|