@cyberskill/shared 1.208.0 → 1.209.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-CwzVfkkX.js +6 -0
- package/dist/index-BG1UznTl.js +628 -0
- package/dist/{magic-string.es-C6Zk6wMx.js → magic-string.es-BQ9KnLz-.js} +105 -117
- package/dist/src/config/config.type.d.ts +1 -1
- package/dist/src/config/config.util.d.ts +1 -1
- package/dist/src/config/config.util.js +48 -7
- package/dist/src/config/env/env.util.js +10 -10
- package/dist/src/config/eslint/index.js +4 -15
- package/dist/src/config/graphql-codegen/graphql-codegen.util.js +30 -39
- package/dist/src/config/index.js +1 -1
- package/dist/src/config/vitest/vitest.e2e.js +9 -19
- package/dist/src/config/vitest/vitest.unit.js +11 -22
- package/dist/src/config/vitest/vitest.unit.setup.js +9339 -9868
- package/dist/src/constant/common.js +1 -1
- package/dist/src/node/apollo-server/apollo-server.util.js +23 -54
- package/dist/src/node/cli/index.d.ts +2 -1
- package/dist/src/node/cli/index.js +108 -1
- package/dist/src/node/command/command.util.js +9 -10
- package/dist/src/node/command/index.js +1 -1
- package/dist/src/node/express/express.util.js +39 -77
- package/dist/src/node/express/index.js +9 -9
- package/dist/src/node/fs/fs.util.js +40 -59
- package/dist/src/node/log/index.js +6 -6
- package/dist/src/node/log/log.util.js +32 -33
- package/dist/src/node/mongo/mongo.util.js +381 -457
- package/dist/src/node/package/index.js +3 -3
- package/dist/src/node/package/package.util.js +2 -2
- package/dist/src/node/path/index.js +30 -30
- package/dist/src/node/path/path.constant.js +30 -30
- package/dist/src/node/storage/storage.util.js +40 -70
- package/dist/src/node/upload/index.js +1 -1
- package/dist/src/node/upload/upload.util.js +125 -6
- package/dist/src/react/apollo-client/apollo-client.component.js +15 -13
- package/dist/src/react/apollo-client/apollo-client.type.d.ts +1 -1
- package/dist/src/react/apollo-client/apollo-client.util.js +66 -81
- package/dist/src/react/apollo-client/index.js +25 -26
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.js +7 -8
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.js +11 -21
- package/dist/src/react/apollo-error/apollo-error.component.js +7 -7
- package/dist/src/react/apollo-error/apollo-error.util.js +7 -7
- package/dist/src/react/loading/loading.component.js +24 -45
- package/dist/src/react/loading/loading.provider.d.ts +1 -1
- package/dist/src/react/log/log.util.js +9 -9
- package/dist/src/react/next-intl/next-intl.hoc.d.ts +1 -1
- package/dist/src/react/next-intl/next-intl.hoc.js +17 -29
- package/dist/src/react/next-intl/next-intl.provider.js +18 -19
- package/dist/src/react/next-intl/next-intl.type.d.ts +1 -1
- package/dist/src/react/storage/storage.hook.js +37 -53
- package/dist/src/react/storage/storage.util.js +25 -50
- package/dist/src/react/userback/userback.component.js +16 -43
- package/dist/src/typescript/index.d.ts +2 -2
- package/dist/src/typescript/index.js +2 -2
- package/dist/src/typescript/style.d.js +1 -1
- package/dist/src/util/common/common.util.js +14 -25
- package/dist/src/util/object/object.util.d.ts +1 -1
- package/dist/src/util/object/object.util.js +39 -49
- package/dist/src/util/string/string.util.js +40 -53
- package/dist/style.css +1 -1
- package/package.json +43 -76
- package/dist/config-B7WSlzSh.js +0 -8
- package/dist/config-DDQ9k8fw.cjs +0 -1
- package/dist/config.util-Ci2CZDut.cjs +0 -1
- package/dist/config.util-DKBwEBKR.js +0 -61
- package/dist/favicon/android-icon-144x144.png +0 -0
- package/dist/favicon/android-icon-192x192.png +0 -0
- package/dist/favicon/android-icon-36x36.png +0 -0
- package/dist/favicon/android-icon-48x48.png +0 -0
- package/dist/favicon/android-icon-72x72.png +0 -0
- package/dist/favicon/android-icon-96x96.png +0 -0
- package/dist/favicon/apple-icon-114x114.png +0 -0
- package/dist/favicon/apple-icon-120x120.png +0 -0
- package/dist/favicon/apple-icon-144x144.png +0 -0
- package/dist/favicon/apple-icon-152x152.png +0 -0
- package/dist/favicon/apple-icon-180x180.png +0 -0
- package/dist/favicon/apple-icon-57x57.png +0 -0
- package/dist/favicon/apple-icon-60x60.png +0 -0
- package/dist/favicon/apple-icon-72x72.png +0 -0
- package/dist/favicon/apple-icon-76x76.png +0 -0
- package/dist/favicon/apple-icon-precomposed.png +0 -0
- package/dist/favicon/apple-icon.png +0 -0
- package/dist/favicon/browserconfig.xml +0 -2
- package/dist/favicon/favicon-16x16.png +0 -0
- package/dist/favicon/favicon-32x32.png +0 -0
- package/dist/favicon/favicon-96x96.png +0 -0
- package/dist/favicon/favicon.ico +0 -0
- package/dist/favicon/manifest.json +0 -41
- package/dist/favicon/ms-icon-144x144.png +0 -0
- package/dist/favicon/ms-icon-150x150.png +0 -0
- package/dist/favicon/ms-icon-310x310.png +0 -0
- package/dist/favicon/ms-icon-70x70.png +0 -0
- package/dist/log.type-CMvG6Box.cjs +0 -1
- package/dist/log.type-DTOvZHyz.js +0 -4
- package/dist/magic-string.es-CjWtD8Pa.cjs +0 -10
- package/dist/path.constant-CWtb99gS.cjs +0 -2
- package/dist/path.constant-CvSr0Rrx.js +0 -682
- package/dist/src/config/commitlint/index.cjs +0 -1
- package/dist/src/config/config.util.cjs +0 -1
- package/dist/src/config/env/env.constant.cjs +0 -1
- package/dist/src/config/env/env.d.cjs +0 -1
- package/dist/src/config/env/env.d.js +0 -1
- package/dist/src/config/env/env.util.cjs +0 -1
- package/dist/src/config/env/index.cjs +0 -1
- package/dist/src/config/eslint/index.cjs +0 -1
- package/dist/src/config/graphql-codegen/graphql-codegen.util.cjs +0 -1
- package/dist/src/config/graphql-codegen/index.cjs +0 -1
- package/dist/src/config/index.cjs +0 -1
- package/dist/src/config/lint-staged/index.cjs +0 -1
- package/dist/src/config/vitest/index.cjs +0 -1
- package/dist/src/config/vitest/vitest.e2e.cjs +0 -1
- package/dist/src/config/vitest/vitest.unit.cjs +0 -1
- package/dist/src/config/vitest/vitest.unit.setup.cjs +0 -508
- package/dist/src/constant/common.cjs +0 -1
- package/dist/src/constant/index.cjs +0 -1
- package/dist/src/constant/response-status.cjs +0 -1
- package/dist/src/node/apollo-server/apollo-server.util.cjs +0 -1
- package/dist/src/node/apollo-server/index.cjs +0 -1
- package/dist/src/node/cli/cli.util.cjs +0 -6
- package/dist/src/node/cli/cli.util.d.ts +0 -2
- package/dist/src/node/cli/cli.util.js +0 -171
- package/dist/src/node/cli/index.cjs +0 -1
- package/dist/src/node/command/command.util.cjs +0 -1
- package/dist/src/node/command/index.cjs +0 -1
- package/dist/src/node/express/express.util.cjs +0 -1
- package/dist/src/node/express/index.cjs +0 -1
- package/dist/src/node/fs/fs.util.cjs +0 -1
- package/dist/src/node/fs/index.cjs +0 -1
- package/dist/src/node/log/index.cjs +0 -1
- package/dist/src/node/log/log.util.cjs +0 -1
- package/dist/src/node/mongo/index.cjs +0 -1
- package/dist/src/node/mongo/mongo.constant.cjs +0 -1
- package/dist/src/node/mongo/mongo.util.cjs +0 -5
- package/dist/src/node/package/index.cjs +0 -1
- package/dist/src/node/package/package.util.cjs +0 -1
- package/dist/src/node/path/index.cjs +0 -1
- package/dist/src/node/path/path.constant.cjs +0 -1
- package/dist/src/node/path/path.util.cjs +0 -1
- package/dist/src/node/storage/index.cjs +0 -1
- package/dist/src/node/storage/storage.util.cjs +0 -1
- package/dist/src/node/upload/index.cjs +0 -1
- package/dist/src/node/upload/upload.util.cjs +0 -1
- package/dist/src/node/ws/index.cjs +0 -1
- package/dist/src/node/ws/ts.util.cjs +0 -1
- package/dist/src/react/apollo-client/apollo-client.component.cjs +0 -1
- package/dist/src/react/apollo-client/apollo-client.constant.cjs +0 -1
- package/dist/src/react/apollo-client/apollo-client.context.cjs +0 -1
- package/dist/src/react/apollo-client/apollo-client.hook.cjs +0 -1
- package/dist/src/react/apollo-client/apollo-client.util.cjs +0 -1
- package/dist/src/react/apollo-client/index.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/index.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.component.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.context.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.hook.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.provider.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.util.cjs +0 -1
- package/dist/src/react/apollo-error/index.cjs +0 -1
- package/dist/src/react/i18next/i18next.hook.cjs +0 -1
- package/dist/src/react/i18next/i18next.util.cjs +0 -1
- package/dist/src/react/i18next/index.cjs +0 -1
- package/dist/src/react/loading/index.cjs +0 -1
- package/dist/src/react/loading/loading.component.cjs +0 -6
- package/dist/src/react/loading/loading.context.cjs +0 -1
- package/dist/src/react/loading/loading.hook.cjs +0 -1
- package/dist/src/react/loading/loading.provider.cjs +0 -1
- package/dist/src/react/log/index.cjs +0 -1
- package/dist/src/react/log/log.util.cjs +0 -1
- package/dist/src/react/next-intl/index.cjs +0 -1
- package/dist/src/react/next-intl/next-intl.constant.cjs +0 -1
- package/dist/src/react/next-intl/next-intl.context.cjs +0 -1
- package/dist/src/react/next-intl/next-intl.hoc.cjs +0 -1
- package/dist/src/react/next-intl/next-intl.hook.cjs +0 -1
- package/dist/src/react/next-intl/next-intl.provider.cjs +0 -1
- package/dist/src/react/storage/index.cjs +0 -1
- package/dist/src/react/storage/storage.hook.cjs +0 -1
- package/dist/src/react/storage/storage.util.cjs +0 -1
- package/dist/src/react/toast/index.cjs +0 -1
- package/dist/src/react/userback/index.cjs +0 -1
- package/dist/src/react/userback/userback.component.cjs +0 -1
- package/dist/src/typescript/common.cjs +0 -1
- package/dist/src/typescript/common.js +0 -4
- package/dist/src/typescript/index.cjs +0 -1
- package/dist/src/typescript/react.cjs +0 -1
- package/dist/src/typescript/react.js +0 -1
- package/dist/src/typescript/style.d.cjs +0 -1
- package/dist/src/util/common/common.util.cjs +0 -1
- package/dist/src/util/common/index.cjs +0 -1
- package/dist/src/util/index.cjs +0 -1
- package/dist/src/util/object/index.cjs +0 -1
- package/dist/src/util/object/object.util.cjs +0 -1
- package/dist/src/util/serializer/index.cjs +0 -1
- package/dist/src/util/serializer/serializer.util.cjs +0 -1
- package/dist/src/util/string/index.cjs +0 -1
- package/dist/src/util/string/string.util.cjs +0 -1
- package/dist/src/util/validate/index.cjs +0 -1
- package/dist/src/util/validate/validate.util.cjs +0 -1
- package/dist/tsconfig.base.json +0 -37
- package/dist/upload.util-CE3MjBdh.cjs +0 -1
- package/dist/upload.util-D4aUdmPo.js +0 -160
- /package/dist/src/typescript/{common.d.ts → common.type.d.ts} +0 -0
- /package/dist/src/typescript/{react.d.ts → react.type.d.ts} +0 -0
|
@@ -1,116 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import k from "react";
|
|
22
|
-
import { showGlobalApolloError as W } from "../apollo-error/apollo-error.util.js";
|
|
23
|
-
import { log as s } from "../log/log.util.js";
|
|
24
|
-
import { toast as x } from "react-hot-toast";
|
|
25
|
-
import { GRAPHQL_URI_DEFAULT as D } from "./apollo-client.constant.js";
|
|
26
|
-
class V extends w {
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...arguments);
|
|
29
|
-
N(this, "count", 0);
|
|
30
|
-
}
|
|
31
|
-
request(n, a) {
|
|
32
|
-
const u = Date.now();
|
|
33
|
-
return this.count += 1, a(n).map((p) => {
|
|
34
|
-
const d = Date.now() - u, f = n.operationName || "Unnamed";
|
|
35
|
-
return s.info(`[Apollo] #${this.count}: ${f} (${d}ms)`), p;
|
|
1
|
+
import { ApolloError as y, ApolloClient as U, InMemoryCache as N } from "@apollo/client/core/core.cjs";
|
|
2
|
+
import { ApolloLink as k, split as x, from as D } from "@apollo/client/link/core/core.cjs";
|
|
3
|
+
import { onError as v } from "@apollo/client/link/error/error.cjs";
|
|
4
|
+
import { removeTypenameFromVariables as C } from "@apollo/client/link/remove-typename/remove-typename.cjs";
|
|
5
|
+
import { GraphQLWsLink as T } from "@apollo/client/link/subscriptions/subscriptions.cjs";
|
|
6
|
+
import { getMainDefinition as G } from "@apollo/client/utilities/utilities.cjs";
|
|
7
|
+
import R from "apollo-upload-client/createUploadLink.mjs";
|
|
8
|
+
import { createClient as I } from "graphql-ws";
|
|
9
|
+
import L from "react";
|
|
10
|
+
import { showGlobalApolloError as P } from "../apollo-error/apollo-error.util.js";
|
|
11
|
+
import { GRAPHQL_URI_DEFAULT as $ } from "./apollo-client.constant.js";
|
|
12
|
+
import { log as r } from "../log/log.util.js";
|
|
13
|
+
import { toast as b } from "react-hot-toast";
|
|
14
|
+
class S extends k {
|
|
15
|
+
count = 0;
|
|
16
|
+
request(o, s) {
|
|
17
|
+
const m = Date.now();
|
|
18
|
+
return this.count += 1, s(o).map((c) => {
|
|
19
|
+
const f = Date.now() - m, p = o.operationName || "Unnamed";
|
|
20
|
+
return r.info(`[Apollo] #${this.count}: ${p} (${f}ms)`), c;
|
|
36
21
|
});
|
|
37
22
|
}
|
|
38
23
|
}
|
|
39
|
-
function
|
|
40
|
-
const { uri:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
`[GraphQL error] ${v}: ${m}, Location: ${JSON.stringify(c, null, 4)}, Path: ${L}`
|
|
24
|
+
function _(i) {
|
|
25
|
+
const { uri: o, wsUrl: s, customLinks: m } = i, c = new S(), f = v(({ graphQLErrors: n, networkError: e, protocolErrors: a, operation: h }) => {
|
|
26
|
+
const A = h?.operationName || "Unknown";
|
|
27
|
+
if (n && n.forEach(({ message: t, locations: l, path: d }) => {
|
|
28
|
+
r.error(
|
|
29
|
+
`[GraphQL error] ${A}: ${t}, Location: ${JSON.stringify(l, null, 4)}, Path: ${d}`
|
|
46
30
|
);
|
|
47
|
-
}),
|
|
48
|
-
|
|
49
|
-
`[Protocol error]: ${
|
|
31
|
+
}), a && a.forEach(({ message: t, extensions: l }) => {
|
|
32
|
+
r.error(
|
|
33
|
+
`[Protocol error]: ${t}, Extensions: ${JSON.stringify(l, null, 4)}`
|
|
50
34
|
);
|
|
51
|
-
}),
|
|
52
|
-
const
|
|
53
|
-
graphQLErrors:
|
|
54
|
-
protocolErrors:
|
|
35
|
+
}), e && r.error(`[Network error]: ${e}`), n || a || e) {
|
|
36
|
+
const t = n?.[0]?.message || a?.[0]?.message || e?.message || "Unexpected error", l = new y({
|
|
37
|
+
graphQLErrors: n || [],
|
|
38
|
+
protocolErrors: a || [],
|
|
55
39
|
clientErrors: [],
|
|
56
|
-
networkError:
|
|
57
|
-
errorMessage:
|
|
40
|
+
networkError: e || null,
|
|
41
|
+
errorMessage: t,
|
|
58
42
|
extraInfo: {
|
|
59
|
-
operation:
|
|
43
|
+
operation: h
|
|
60
44
|
}
|
|
61
45
|
});
|
|
62
|
-
typeof window
|
|
46
|
+
typeof window < "u" && b.error((d) => /* @__PURE__ */ L.createElement(L.Fragment, null, t, " ", /* @__PURE__ */ L.createElement(
|
|
63
47
|
"button",
|
|
64
48
|
{
|
|
65
49
|
type: "button",
|
|
66
50
|
className: "text-blue-500 hover:text-blue-700",
|
|
67
51
|
onClick: () => {
|
|
68
52
|
setTimeout(() => {
|
|
69
|
-
|
|
70
|
-
}, 0),
|
|
53
|
+
P(l);
|
|
54
|
+
}, 0), b.dismiss(d.id);
|
|
71
55
|
}
|
|
72
56
|
},
|
|
73
57
|
"Show Details"
|
|
74
58
|
)));
|
|
75
59
|
}
|
|
76
|
-
}),
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
uri:
|
|
60
|
+
}), p = C();
|
|
61
|
+
o || r.warn(`[Apollo] No GraphQL URI provided — using "${$}" as default`);
|
|
62
|
+
const u = R({
|
|
63
|
+
uri: o ?? $,
|
|
80
64
|
credentials: "include",
|
|
81
65
|
headers: {
|
|
82
66
|
"apollo-require-preflight": "true"
|
|
83
67
|
}
|
|
84
|
-
}),
|
|
85
|
-
({ query:
|
|
86
|
-
const
|
|
87
|
-
return
|
|
68
|
+
}), g = s ? new T(I({ url: s })) : k.empty(), w = g instanceof k ? x(
|
|
69
|
+
({ query: n }) => {
|
|
70
|
+
const e = G(n);
|
|
71
|
+
return e.kind === "OperationDefinition" && e.operation === "subscription";
|
|
88
72
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
) :
|
|
92
|
-
return
|
|
93
|
-
|
|
73
|
+
g,
|
|
74
|
+
u
|
|
75
|
+
) : u;
|
|
76
|
+
return w === u && s && r.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."), [
|
|
77
|
+
c,
|
|
94
78
|
// 🪵 custom logger
|
|
95
|
-
|
|
79
|
+
f,
|
|
96
80
|
// ⚠️ Apollo's error handling
|
|
97
|
-
|
|
81
|
+
p,
|
|
98
82
|
// 🧼 cleans up __typename
|
|
99
|
-
...
|
|
83
|
+
...m ?? [],
|
|
100
84
|
// 🔗 custom links
|
|
101
|
-
|
|
85
|
+
w
|
|
102
86
|
// 📡 HTTP vs WS routing (includes uploadLink)
|
|
103
87
|
];
|
|
104
88
|
}
|
|
105
|
-
function
|
|
106
|
-
const
|
|
107
|
-
return new
|
|
108
|
-
link:
|
|
109
|
-
cache: new
|
|
110
|
-
|
|
89
|
+
function K(i = {}) {
|
|
90
|
+
const o = D(_(i));
|
|
91
|
+
return new U({
|
|
92
|
+
link: o,
|
|
93
|
+
cache: new N(),
|
|
94
|
+
...i
|
|
95
|
+
});
|
|
111
96
|
}
|
|
112
97
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
98
|
+
S as DevLoggerLink,
|
|
99
|
+
_ as createApolloLinks,
|
|
100
|
+
K as getClient
|
|
116
101
|
};
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { ApolloProvider as
|
|
1
|
+
import { ApolloProvider as o } from "./apollo-client.component.js";
|
|
2
2
|
import { GRAPHQL_URI_DEFAULT as s } from "./apollo-client.constant.js";
|
|
3
|
-
import { ApolloClientContext as
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useApolloClient as A, useBackgroundQuery as L, useFragment as d, useLazyQuery as g, useLoadableQuery as C, useMutation as R, useQuery as c, useQueryRefHandlers as k, useReactiveVar as v, useReadQuery as F, useSubscription as P, useSuspenseFragment as S, useSuspenseQuery as b } from "@apollo/client/react/hooks/hooks.cjs";
|
|
3
|
+
import { ApolloClientContext as l, ApolloClientProvider as n } from "./apollo-client.context.js";
|
|
4
|
+
import { DevLoggerLink as p, createApolloLinks as i, getClient as m } from "./apollo-client.util.js";
|
|
5
|
+
import { makeVar as Q } from "@apollo/client/cache/cache.cjs";
|
|
6
|
+
import { useApolloClient as x, useBackgroundQuery as A, useFragment as L, useLazyQuery as d, useLoadableQuery as g, useMutation as C, useQuery as R, useQueryRefHandlers as c, useReactiveVar as k, useReadQuery as v, useSubscription as F, useSuspenseFragment as P, useSuspenseQuery as S } from "@apollo/client/react/hooks/hooks.cjs";
|
|
8
7
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
l as ApolloClientContext,
|
|
9
|
+
n as ApolloClientProvider,
|
|
10
|
+
o as ApolloProvider,
|
|
11
|
+
p as DevLoggerLink,
|
|
13
12
|
s as GRAPHQL_URI_DEFAULT,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
i as createApolloLinks,
|
|
14
|
+
m as getClient,
|
|
15
|
+
Q as makeVar,
|
|
16
|
+
x as useApolloClient,
|
|
17
|
+
A as useBackgroundQuery,
|
|
18
|
+
L as useFragment,
|
|
19
|
+
d as useLazyQuery,
|
|
20
|
+
g as useLoadableQuery,
|
|
21
|
+
C as useMutation,
|
|
22
|
+
R as useQuery,
|
|
23
|
+
c as useQueryRefHandlers,
|
|
24
|
+
k as useReactiveVar,
|
|
25
|
+
v as useReadQuery,
|
|
26
|
+
F as useSubscription,
|
|
27
|
+
P as useSuspenseFragment,
|
|
28
|
+
S as useSuspenseQuery
|
|
30
29
|
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { ApolloNextAppProvider as l } from "@apollo/client-integration-nextjs";
|
|
2
2
|
import e, { useMemo as m } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import "../apollo-error/apollo-error.context.js";
|
|
3
|
+
import { getClient as n } from "./apollo-client-nextjs.util.js";
|
|
5
4
|
import { ApolloErrorProvider as p } from "../apollo-error/apollo-error.provider.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
function
|
|
5
|
+
import { ApolloErrorComponent as i } from "../apollo-error/apollo-error.component.js";
|
|
6
|
+
import { Toaster as a } from "react-hot-toast";
|
|
7
|
+
function g({
|
|
9
8
|
options: r,
|
|
10
9
|
children: o
|
|
11
10
|
}) {
|
|
12
11
|
const t = m(
|
|
13
|
-
() => () =>
|
|
12
|
+
() => () => n(r || {}),
|
|
14
13
|
[r]
|
|
15
14
|
);
|
|
16
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(p, null, /* @__PURE__ */ e.createElement(l, { makeClient: t }, o), /* @__PURE__ */ e.createElement(
|
|
15
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(p, null, /* @__PURE__ */ e.createElement(l, { makeClient: t }, o), /* @__PURE__ */ e.createElement(i, null)), /* @__PURE__ */ e.createElement(a, { position: "top-right" }));
|
|
17
16
|
}
|
|
18
17
|
export {
|
|
19
|
-
|
|
18
|
+
g as ApolloProvider
|
|
20
19
|
};
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
import { ApolloClient as f, InMemoryCache as p } from "@apollo/client-integration-nextjs";
|
|
13
|
-
import { from as a } from "@apollo/client/link/core/core.cjs";
|
|
14
|
-
import { createApolloLinks as C } from "../apollo-client/apollo-client.util.js";
|
|
15
|
-
function A(e = {}) {
|
|
16
|
-
const o = a(C(e));
|
|
17
|
-
return new f(m({
|
|
18
|
-
link: o,
|
|
19
|
-
cache: new p()
|
|
20
|
-
}, e));
|
|
1
|
+
import { ApolloClient as r, InMemoryCache as n } from "@apollo/client-integration-nextjs";
|
|
2
|
+
import { from as t } from "@apollo/client/link/core/core.cjs";
|
|
3
|
+
import { createApolloLinks as m } from "../apollo-client/apollo-client.util.js";
|
|
4
|
+
function f(o = {}) {
|
|
5
|
+
const e = t(m(o));
|
|
6
|
+
return new r({
|
|
7
|
+
link: e,
|
|
8
|
+
cache: new n(),
|
|
9
|
+
...o
|
|
10
|
+
});
|
|
21
11
|
}
|
|
22
12
|
export {
|
|
23
|
-
|
|
13
|
+
f as getClient
|
|
24
14
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e, { use as
|
|
1
|
+
import e, { use as c } from "react";
|
|
2
2
|
import { ApolloErrorContext as m } from "./apollo-error.context.js";
|
|
3
3
|
const t = {
|
|
4
4
|
"modal-backdrop": "_modal-backdrop_8fveh_1",
|
|
@@ -8,17 +8,17 @@ const t = {
|
|
|
8
8
|
"btn-retry": "_btn-retry_8fveh_41",
|
|
9
9
|
"error-details": "_error-details_8fveh_54"
|
|
10
10
|
};
|
|
11
|
-
function
|
|
12
|
-
const
|
|
11
|
+
function d() {
|
|
12
|
+
const l = c(m), r = l?.error;
|
|
13
13
|
if (!r)
|
|
14
14
|
return null;
|
|
15
|
-
const
|
|
15
|
+
const o = (s, n) => n?.length ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("strong", null, s, ":"), /* @__PURE__ */ e.createElement("ul", null, n.map((a) => /* @__PURE__ */ e.createElement("li", { key: a.message }, a.message)))) : null;
|
|
16
16
|
return /* @__PURE__ */ e.createElement("div", { className: t["modal-backdrop"] }, /* @__PURE__ */ e.createElement("div", { className: t["modal-content"] }, /* @__PURE__ */ e.createElement(
|
|
17
17
|
"button",
|
|
18
18
|
{
|
|
19
19
|
type: "button",
|
|
20
20
|
className: t["btn-close"],
|
|
21
|
-
onClick:
|
|
21
|
+
onClick: l.hideError
|
|
22
22
|
},
|
|
23
23
|
"✕"
|
|
24
24
|
), /* @__PURE__ */ e.createElement("div", { className: t["error-title"] }, /* @__PURE__ */ e.createElement(
|
|
@@ -29,8 +29,8 @@ function i() {
|
|
|
29
29
|
onClick: () => window.location.reload()
|
|
30
30
|
},
|
|
31
31
|
"Reload"
|
|
32
|
-
), " ", r.message), /* @__PURE__ */ e.createElement("div", { className: t["error-details"] }, r.networkError && /* @__PURE__ */ e.createElement("pre", { className: "network" }, /* @__PURE__ */ e.createElement("strong", null, "Network Error:"), " ", r.networkError.message),
|
|
32
|
+
), " ", r.message), /* @__PURE__ */ e.createElement("div", { className: t["error-details"] }, r.networkError && /* @__PURE__ */ e.createElement("pre", { className: "network" }, /* @__PURE__ */ e.createElement("strong", null, "Network Error:"), " ", r.networkError.message), o("GraphQL Errors", [...r.graphQLErrors]), o("Protocol Errors", [...r.protocolErrors]), o("Client Errors", [...r.clientErrors]), r.extraInfo && /* @__PURE__ */ e.createElement("pre", { className: "extra" }, /* @__PURE__ */ e.createElement("strong", null, "Extra Info:"), " ", JSON.stringify(r.extraInfo, null, 4)))));
|
|
33
33
|
}
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
d as ApolloErrorComponent
|
|
36
36
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
let
|
|
2
|
-
function
|
|
3
|
-
|
|
1
|
+
let o = null;
|
|
2
|
+
function r(l) {
|
|
3
|
+
o = l;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
l
|
|
5
|
+
function a(l) {
|
|
6
|
+
o?.(l);
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
r as setGlobalApolloErrorCallback,
|
|
10
|
+
a as showGlobalApolloError
|
|
11
11
|
};
|
|
@@ -1,61 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
u.call(t, n) && d(e, n, t[n]);
|
|
10
|
-
return e;
|
|
1
|
+
import s from "clsx";
|
|
2
|
+
import e, { useEffect as a } from "react";
|
|
3
|
+
const m = "_full_b1d9o_1", u = "_block_b1d9o_2", _ = "_container_b1d9o_40", f = "_ring_b1d9o_50", g = "_message_b1d9o_74", n = {
|
|
4
|
+
full: m,
|
|
5
|
+
block: u,
|
|
6
|
+
container: _,
|
|
7
|
+
ring: f,
|
|
8
|
+
message: g
|
|
11
9
|
};
|
|
12
|
-
|
|
13
|
-
var n = {};
|
|
14
|
-
for (var o in e)
|
|
15
|
-
m.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
|
|
16
|
-
if (e != null && r)
|
|
17
|
-
for (var o of r(e))
|
|
18
|
-
t.indexOf(o) < 0 && u.call(e, o) && (n[o] = e[o]);
|
|
19
|
-
return n;
|
|
20
|
-
};
|
|
21
|
-
import g from "clsx";
|
|
22
|
-
import c, { useEffect as v } from "react";
|
|
23
|
-
const y = "_full_b1d9o_1", p = "_block_b1d9o_2", L = "_container_b1d9o_40", N = "_ring_b1d9o_50", h = "_message_b1d9o_74", l = {
|
|
24
|
-
full: y,
|
|
25
|
-
block: p,
|
|
26
|
-
container: L,
|
|
27
|
-
ring: N,
|
|
28
|
-
message: h
|
|
29
|
-
};
|
|
30
|
-
function x() {
|
|
10
|
+
function v() {
|
|
31
11
|
if (document.getElementById("noscroll-style"))
|
|
32
12
|
return;
|
|
33
|
-
const
|
|
34
|
-
|
|
13
|
+
const t = document.createElement("style");
|
|
14
|
+
t.id = "noscroll-style", t.innerHTML = `
|
|
35
15
|
.noscroll {
|
|
36
16
|
overflow: hidden !important;
|
|
37
17
|
height: 100vh !important;
|
|
38
18
|
}
|
|
39
|
-
`, document.head.appendChild(
|
|
19
|
+
`, document.head.appendChild(t);
|
|
40
20
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (e) {
|
|
21
|
+
function y({ full: t = !1, className: o = "", message: c = "Loading", ...i }) {
|
|
22
|
+
a(() => {
|
|
23
|
+
if (t) {
|
|
45
24
|
document.body.classList.add("noscroll");
|
|
46
|
-
const
|
|
47
|
-
return document.addEventListener("contextmenu",
|
|
48
|
-
document.body.classList.remove("noscroll"), document.removeEventListener("contextmenu",
|
|
25
|
+
const r = (d) => d.preventDefault();
|
|
26
|
+
return document.addEventListener("contextmenu", r), () => {
|
|
27
|
+
document.body.classList.remove("noscroll"), document.removeEventListener("contextmenu", r);
|
|
49
28
|
};
|
|
50
29
|
}
|
|
51
|
-
}, [
|
|
52
|
-
|
|
30
|
+
}, [t]), a(() => {
|
|
31
|
+
v();
|
|
53
32
|
}, []);
|
|
54
|
-
function
|
|
55
|
-
return /* @__PURE__ */
|
|
33
|
+
function l() {
|
|
34
|
+
return /* @__PURE__ */ e.createElement("div", { className: n.container, ...i }, /* @__PURE__ */ e.createElement("div", { className: n.ring }), /* @__PURE__ */ e.createElement("div", { className: n.ring }), /* @__PURE__ */ e.createElement("div", { className: n.ring }), /* @__PURE__ */ e.createElement("div", { className: n.ring }), c && /* @__PURE__ */ e.createElement("div", { className: n.message }, c));
|
|
56
35
|
}
|
|
57
|
-
return
|
|
36
|
+
return t ? /* @__PURE__ */ e.createElement("div", { className: s(n.full, o) }, l()) : /* @__PURE__ */ e.createElement("div", { className: s(n.block, o) }, l());
|
|
58
37
|
}
|
|
59
38
|
export {
|
|
60
|
-
|
|
39
|
+
y as Loading
|
|
61
40
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { consola as e } from "consola/browser";
|
|
2
|
-
import { RESPONSE_STATUS as
|
|
3
|
-
const
|
|
2
|
+
import { RESPONSE_STATUS as c } from "../../constant/response-status.js";
|
|
3
|
+
const l = {
|
|
4
4
|
silent: e.silent,
|
|
5
5
|
level: e.level,
|
|
6
6
|
fatal: e.fatal,
|
|
@@ -16,15 +16,15 @@ const n = {
|
|
|
16
16
|
trace: e.trace,
|
|
17
17
|
verbose: e.verbose
|
|
18
18
|
};
|
|
19
|
-
function
|
|
20
|
-
const { shouldLog:
|
|
21
|
-
return
|
|
19
|
+
function g(r, a) {
|
|
20
|
+
const { shouldLog: n = !0, returnValue: t, callback: o } = a ?? {}, s = r instanceof Error ? r : new Error(typeof r == "string" ? r : "Unknown error");
|
|
21
|
+
return n && l.error(s.message), o && typeof o == "function" && o(s), t || {
|
|
22
22
|
success: !1,
|
|
23
|
-
message:
|
|
24
|
-
code:
|
|
23
|
+
message: s.message,
|
|
24
|
+
code: c.INTERNAL_SERVER_ERROR.CODE
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
g as catchError,
|
|
29
|
+
l as log
|
|
30
30
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, default as React } from 'react';
|
|
2
|
-
import { I_Children } from '../../typescript/
|
|
2
|
+
import { I_Children } from '../../typescript/index.js';
|
|
3
3
|
import { I_NextIntlLanguage, T_NextIntlMessageList } from './next-intl.type.js';
|
|
4
4
|
export declare function withNextIntl<T extends I_Children>(Component: ComponentType<T>): {
|
|
5
5
|
(props: T & {
|
|
@@ -1,35 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
import { NextIntlClientProvider as c } from "next-intl";
|
|
13
|
-
import r from "react";
|
|
14
|
-
import { log as h } from "../log/log.util.js";
|
|
15
|
-
import { NEXT_INTL_DEFAULT_LANGUAGE as u } from "./next-intl.constant.js";
|
|
16
|
-
import { useNextIntl as w } from "./next-intl.hook.js";
|
|
17
|
-
function P(s) {
|
|
18
|
-
const e = (t) => {
|
|
19
|
-
var m, n;
|
|
20
|
-
const { currentLanguage: l } = w(), { messages: i, languages: d } = t, o = "en", v = i[(l == null ? void 0 : l.value) || o], I = (n = (m = d.find((p) => p.value === (l == null ? void 0 : l.value))) == null ? void 0 : m.timezone) != null ? n : u.timezone;
|
|
21
|
-
return i ? /* @__PURE__ */ r.createElement(
|
|
22
|
-
c,
|
|
1
|
+
import { NextIntlClientProvider as g } from "next-intl";
|
|
2
|
+
import s from "react";
|
|
3
|
+
import { NEXT_INTL_DEFAULT_LANGUAGE as c } from "./next-intl.constant.js";
|
|
4
|
+
import { useNextIntl as f } from "./next-intl.hook.js";
|
|
5
|
+
import { log as N } from "../log/log.util.js";
|
|
6
|
+
function E(t) {
|
|
7
|
+
const a = (l) => {
|
|
8
|
+
const { currentLanguage: e } = f(), { messages: r, languages: o } = l, n = "en", i = r[e?.value || n], m = o.find((u) => u.value === e?.value)?.timezone ?? c.timezone;
|
|
9
|
+
return r ? /* @__PURE__ */ s.createElement(
|
|
10
|
+
g,
|
|
23
11
|
{
|
|
24
|
-
locale:
|
|
25
|
-
messages:
|
|
26
|
-
timeZone:
|
|
12
|
+
locale: e?.value || n,
|
|
13
|
+
messages: i || null,
|
|
14
|
+
timeZone: m
|
|
27
15
|
},
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
) : (
|
|
16
|
+
/* @__PURE__ */ s.createElement(t, { ...l })
|
|
17
|
+
) : (N.warn(`Missing messages for language: ${e?.value || n}`), null);
|
|
30
18
|
};
|
|
31
|
-
return
|
|
19
|
+
return a.displayName = `withNextIntl(${t.displayName || t.name || "Component"})`, a;
|
|
32
20
|
}
|
|
33
21
|
export {
|
|
34
|
-
|
|
22
|
+
E as withNextIntl
|
|
35
23
|
};
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, n);
|
|
1
|
+
import { NEXT_INTL_DEFAULT_LANGUAGE as u } from "./next-intl.constant.js";
|
|
2
|
+
import { NextIntlContext as c } from "./next-intl.context.js";
|
|
3
|
+
import { withNextIntl as p } from "./next-intl.hoc.js";
|
|
4
|
+
import "./next-intl.hook.js";
|
|
5
|
+
import t, { useMemo as i } from "react";
|
|
6
|
+
import { useStorage as l } from "../storage/storage.hook.js";
|
|
7
|
+
function f({ children: r }) {
|
|
8
|
+
return /* @__PURE__ */ t.createElement(t.Fragment, null, r);
|
|
10
9
|
}
|
|
11
|
-
const L = f
|
|
12
|
-
function
|
|
13
|
-
children:
|
|
14
|
-
languages:
|
|
15
|
-
messages:
|
|
10
|
+
const L = p(f);
|
|
11
|
+
function I({
|
|
12
|
+
children: r,
|
|
13
|
+
languages: e,
|
|
14
|
+
messages: a
|
|
16
15
|
}) {
|
|
17
|
-
const { value:
|
|
18
|
-
() => ({ languages:
|
|
19
|
-
[
|
|
16
|
+
const { value: n, set: o } = l("lang", e[0]), m = i(
|
|
17
|
+
() => ({ languages: e, currentLanguage: n ?? u, setCurrentLanguage: o }),
|
|
18
|
+
[e, o, n]
|
|
20
19
|
);
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ t.createElement(c, { value: m }, /* @__PURE__ */ t.createElement(L, { languages: e, messages: a }, r));
|
|
22
21
|
}
|
|
23
22
|
export {
|
|
24
|
-
|
|
23
|
+
I as NextIntlProvider
|
|
25
24
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Locale } from 'date-fns';
|
|
2
2
|
import { AbstractIntlMessages, Timezone } from 'next-intl';
|
|
3
|
-
import { I_Children } from '../../typescript/
|
|
3
|
+
import { I_Children } from '../../typescript/index.js';
|
|
4
4
|
export interface I_NextIntlLanguage {
|
|
5
5
|
label: string;
|
|
6
6
|
value: string;
|