naystack 1.7.30 → 1.7.31
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/auth/email/index.cjs.js +4 -9
- package/dist/auth/email/index.esm.js +2 -7
- package/dist/auth/email/next.cjs.js +2 -7
- package/dist/auth/email/next.esm.js +2 -7
- package/dist/auth/index.cjs.js +14 -19
- package/dist/auth/index.esm.js +2 -7
- package/dist/graphql/index.cjs.js +2 -7
- package/dist/graphql/index.esm.js +2 -7
- package/dist/graphql/server.cjs.js +2 -7
- package/dist/graphql/server.d.mts +2 -11
- package/dist/graphql/server.d.ts +2 -11
- package/dist/graphql/server.esm.js +2 -7
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ __export(email_exports, {
|
|
|
38
38
|
setupEmailAuth: () => setupEmailAuth
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(email_exports);
|
|
41
|
-
var
|
|
41
|
+
var import_server5 = require("next/server");
|
|
42
42
|
|
|
43
43
|
// src/utils/route.ts
|
|
44
44
|
var import_server = require("next/server");
|
|
@@ -372,18 +372,13 @@ var import_react3 = __toESM(require("react"));
|
|
|
372
372
|
var import_client = require("@apollo/client");
|
|
373
373
|
var import_client_integration_nextjs = require("@apollo/client-integration-nextjs");
|
|
374
374
|
var import_headers2 = require("next/headers");
|
|
375
|
-
var import_server4 = require("next/server");
|
|
376
375
|
var import_react = __toESM(require("react"));
|
|
377
376
|
var import_react2 = require("react");
|
|
378
|
-
|
|
377
|
+
function Injector({
|
|
379
378
|
fetch: fetch2,
|
|
380
379
|
Component,
|
|
381
|
-
props
|
|
382
|
-
isStatic
|
|
380
|
+
props
|
|
383
381
|
}) {
|
|
384
|
-
if (!isStatic) {
|
|
385
|
-
await (0, import_server4.connection)();
|
|
386
|
-
}
|
|
387
382
|
return /* @__PURE__ */ import_react.default.createElement(import_react2.Suspense, { fallback: /* @__PURE__ */ import_react.default.createElement(Component, { ...props || {}, loading: true }) }, /* @__PURE__ */ import_react.default.createElement(InjectorSuspensed, { Component, fetch: fetch2, props }));
|
|
388
383
|
}
|
|
389
384
|
async function InjectorSuspensed({
|
|
@@ -441,7 +436,7 @@ function setupEmailAuth(options) {
|
|
|
441
436
|
req.headers.get("origin"),
|
|
442
437
|
allowedOrigins
|
|
443
438
|
);
|
|
444
|
-
return new
|
|
439
|
+
return new import_server5.NextResponse(null, {
|
|
445
440
|
status: 204,
|
|
446
441
|
headers: corsHeaders ?? void 0
|
|
447
442
|
});
|
|
@@ -337,18 +337,13 @@ import {
|
|
|
337
337
|
} from "@apollo/client";
|
|
338
338
|
import { registerApolloClient } from "@apollo/client-integration-nextjs";
|
|
339
339
|
import { cookies as cookies2 } from "next/headers";
|
|
340
|
-
import { connection } from "next/server";
|
|
341
340
|
import React from "react";
|
|
342
341
|
import { Suspense } from "react";
|
|
343
|
-
|
|
342
|
+
function Injector({
|
|
344
343
|
fetch: fetch2,
|
|
345
344
|
Component,
|
|
346
|
-
props
|
|
347
|
-
isStatic
|
|
345
|
+
props
|
|
348
346
|
}) {
|
|
349
|
-
if (!isStatic) {
|
|
350
|
-
await connection();
|
|
351
|
-
}
|
|
352
347
|
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Component, { ...props || {}, loading: true }) }, /* @__PURE__ */ React.createElement(InjectorSuspensed, { Component, fetch: fetch2, props }));
|
|
353
348
|
}
|
|
354
349
|
async function InjectorSuspensed({
|
|
@@ -95,18 +95,13 @@ function getEnv(key, skipCheck) {
|
|
|
95
95
|
var import_client = require("@apollo/client");
|
|
96
96
|
var import_client_integration_nextjs = require("@apollo/client-integration-nextjs");
|
|
97
97
|
var import_headers = require("next/headers");
|
|
98
|
-
var import_server = require("next/server");
|
|
99
98
|
var import_react = __toESM(require("react"));
|
|
100
99
|
var import_react2 = require("react");
|
|
101
|
-
|
|
100
|
+
function Injector({
|
|
102
101
|
fetch: fetch2,
|
|
103
102
|
Component,
|
|
104
|
-
props
|
|
105
|
-
isStatic
|
|
103
|
+
props
|
|
106
104
|
}) {
|
|
107
|
-
if (!isStatic) {
|
|
108
|
-
await (0, import_server.connection)();
|
|
109
|
-
}
|
|
110
105
|
return /* @__PURE__ */ import_react.default.createElement(import_react2.Suspense, { fallback: /* @__PURE__ */ import_react.default.createElement(Component, { ...props || {}, loading: true }) }, /* @__PURE__ */ import_react.default.createElement(InjectorSuspensed, { Component, fetch: fetch2, props }));
|
|
111
106
|
}
|
|
112
107
|
async function InjectorSuspensed({
|
|
@@ -64,18 +64,13 @@ import {
|
|
|
64
64
|
} from "@apollo/client";
|
|
65
65
|
import { registerApolloClient } from "@apollo/client-integration-nextjs";
|
|
66
66
|
import { cookies } from "next/headers";
|
|
67
|
-
import { connection } from "next/server";
|
|
68
67
|
import React from "react";
|
|
69
68
|
import { Suspense } from "react";
|
|
70
|
-
|
|
69
|
+
function Injector({
|
|
71
70
|
fetch: fetch2,
|
|
72
71
|
Component,
|
|
73
|
-
props
|
|
74
|
-
isStatic
|
|
72
|
+
props
|
|
75
73
|
}) {
|
|
76
|
-
if (!isStatic) {
|
|
77
|
-
await connection();
|
|
78
|
-
}
|
|
79
74
|
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Component, { ...props || {}, loading: true }) }, /* @__PURE__ */ React.createElement(InjectorSuspensed, { Component, fetch: fetch2, props }));
|
|
80
75
|
}
|
|
81
76
|
async function InjectorSuspensed({
|
package/dist/auth/index.cjs.js
CHANGED
|
@@ -44,7 +44,7 @@ __export(auth_exports, {
|
|
|
44
44
|
module.exports = __toCommonJS(auth_exports);
|
|
45
45
|
|
|
46
46
|
// src/auth/email/index.ts
|
|
47
|
-
var
|
|
47
|
+
var import_server5 = require("next/server");
|
|
48
48
|
|
|
49
49
|
// src/utils/route.ts
|
|
50
50
|
var import_server = require("next/server");
|
|
@@ -390,18 +390,13 @@ var import_react3 = __toESM(require("react"));
|
|
|
390
390
|
var import_client = require("@apollo/client");
|
|
391
391
|
var import_client_integration_nextjs = require("@apollo/client-integration-nextjs");
|
|
392
392
|
var import_headers2 = require("next/headers");
|
|
393
|
-
var import_server4 = require("next/server");
|
|
394
393
|
var import_react = __toESM(require("react"));
|
|
395
394
|
var import_react2 = require("react");
|
|
396
|
-
|
|
395
|
+
function Injector({
|
|
397
396
|
fetch: fetch2,
|
|
398
397
|
Component,
|
|
399
|
-
props
|
|
400
|
-
isStatic
|
|
398
|
+
props
|
|
401
399
|
}) {
|
|
402
|
-
if (!isStatic) {
|
|
403
|
-
await (0, import_server4.connection)();
|
|
404
|
-
}
|
|
405
400
|
return /* @__PURE__ */ import_react.default.createElement(import_react2.Suspense, { fallback: /* @__PURE__ */ import_react.default.createElement(Component, { ...props || {}, loading: true }) }, /* @__PURE__ */ import_react.default.createElement(InjectorSuspensed, { Component, fetch: fetch2, props }));
|
|
406
401
|
}
|
|
407
402
|
async function InjectorSuspensed({
|
|
@@ -459,7 +454,7 @@ function setupEmailAuth(options) {
|
|
|
459
454
|
req.headers.get("origin"),
|
|
460
455
|
allowedOrigins
|
|
461
456
|
);
|
|
462
|
-
return new
|
|
457
|
+
return new import_server5.NextResponse(null, {
|
|
463
458
|
status: 204,
|
|
464
459
|
headers: corsHeaders ?? void 0
|
|
465
460
|
});
|
|
@@ -470,7 +465,7 @@ function setupEmailAuth(options) {
|
|
|
470
465
|
|
|
471
466
|
// src/auth/google/get.ts
|
|
472
467
|
var import_googleapis = require("googleapis");
|
|
473
|
-
var
|
|
468
|
+
var import_server6 = require("next/server");
|
|
474
469
|
var import_uuid = require("uuid");
|
|
475
470
|
var getGoogleGetRoute = ({
|
|
476
471
|
getUserIdFromEmail,
|
|
@@ -507,7 +502,7 @@ var getGoogleGetRoute = ({
|
|
|
507
502
|
prompt: "consent",
|
|
508
503
|
redirect_uri: url
|
|
509
504
|
});
|
|
510
|
-
const res =
|
|
505
|
+
const res = import_server6.NextResponse.redirect(authorizationUrl);
|
|
511
506
|
res.cookies.set("state", state2, {
|
|
512
507
|
httpOnly: true,
|
|
513
508
|
secure: true
|
|
@@ -528,11 +523,11 @@ var getGoogleGetRoute = ({
|
|
|
528
523
|
const finalRedirectURL = stateRedirectURL || redirectURL;
|
|
529
524
|
const finalErrorURL = stateErrorRedirectURL || errorRedirectURL || finalRedirectURL;
|
|
530
525
|
if (error) {
|
|
531
|
-
return
|
|
526
|
+
return import_server6.NextResponse.redirect(finalErrorURL);
|
|
532
527
|
}
|
|
533
528
|
const state = req.nextUrl.searchParams.get("state") || void 0;
|
|
534
529
|
if (code && state) {
|
|
535
|
-
if (localState !== state) return
|
|
530
|
+
if (localState !== state) return import_server6.NextResponse.redirect(finalErrorURL);
|
|
536
531
|
const { tokens } = await oauth2Client.getToken(code);
|
|
537
532
|
oauth2Client.setCredentials(tokens);
|
|
538
533
|
const userInfoRequest = await import_googleapis.google.oauth2({
|
|
@@ -545,7 +540,7 @@ var getGoogleGetRoute = ({
|
|
|
545
540
|
const id = await getUserIdFromEmail(user, data);
|
|
546
541
|
if (id) {
|
|
547
542
|
const targetUrl = new URL(finalRedirectURL, req.nextUrl.origin);
|
|
548
|
-
const res =
|
|
543
|
+
const res = import_server6.NextResponse.redirect(targetUrl);
|
|
549
544
|
res.cookies.set(
|
|
550
545
|
REFRESH_COOKIE_NAME,
|
|
551
546
|
generateRefreshToken(id),
|
|
@@ -563,7 +558,7 @@ var getGoogleGetRoute = ({
|
|
|
563
558
|
}
|
|
564
559
|
}
|
|
565
560
|
}
|
|
566
|
-
return
|
|
561
|
+
return import_server6.NextResponse.redirect(finalErrorURL);
|
|
567
562
|
};
|
|
568
563
|
};
|
|
569
564
|
|
|
@@ -575,7 +570,7 @@ function setupGoogleAuth(props) {
|
|
|
575
570
|
}
|
|
576
571
|
|
|
577
572
|
// src/auth/instagram/route.ts
|
|
578
|
-
var
|
|
573
|
+
var import_server8 = require("next/server");
|
|
579
574
|
|
|
580
575
|
// src/auth/instagram/utils.ts
|
|
581
576
|
async function getRefreshedInstagramAccessToken(token) {
|
|
@@ -637,7 +632,7 @@ var getInstagramUser = (token, id, fields) => {
|
|
|
637
632
|
};
|
|
638
633
|
|
|
639
634
|
// src/socials/meta-webhook.ts
|
|
640
|
-
var
|
|
635
|
+
var import_server7 = require("next/server");
|
|
641
636
|
|
|
642
637
|
// src/auth/instagram/route.ts
|
|
643
638
|
var getInstagramRoute = ({
|
|
@@ -645,7 +640,7 @@ var getInstagramRoute = ({
|
|
|
645
640
|
errorRedirectURL,
|
|
646
641
|
onUser
|
|
647
642
|
}) => {
|
|
648
|
-
const handleError2 = (message) =>
|
|
643
|
+
const handleError2 = (message) => import_server8.NextResponse.redirect(`${errorRedirectURL}?error=${message}`);
|
|
649
644
|
return async (req) => {
|
|
650
645
|
const accessCode = req.nextUrl.searchParams.get("code");
|
|
651
646
|
const error = req.nextUrl.searchParams.get("error");
|
|
@@ -669,7 +664,7 @@ var getInstagramRoute = ({
|
|
|
669
664
|
instagramData.accessToken
|
|
670
665
|
);
|
|
671
666
|
if (errorMessage) return handleError2(errorMessage);
|
|
672
|
-
return
|
|
667
|
+
return import_server8.NextResponse.redirect(redirectURL);
|
|
673
668
|
};
|
|
674
669
|
};
|
|
675
670
|
|
package/dist/auth/index.esm.js
CHANGED
|
@@ -349,18 +349,13 @@ import {
|
|
|
349
349
|
} from "@apollo/client";
|
|
350
350
|
import { registerApolloClient } from "@apollo/client-integration-nextjs";
|
|
351
351
|
import { cookies as cookies2 } from "next/headers";
|
|
352
|
-
import { connection } from "next/server";
|
|
353
352
|
import React from "react";
|
|
354
353
|
import { Suspense } from "react";
|
|
355
|
-
|
|
354
|
+
function Injector({
|
|
356
355
|
fetch: fetch2,
|
|
357
356
|
Component,
|
|
358
|
-
props
|
|
359
|
-
isStatic
|
|
357
|
+
props
|
|
360
358
|
}) {
|
|
361
|
-
if (!isStatic) {
|
|
362
|
-
await connection();
|
|
363
|
-
}
|
|
364
359
|
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Component, { ...props || {}, loading: true }) }, /* @__PURE__ */ React.createElement(InjectorSuspensed, { Component, fetch: fetch2, props }));
|
|
365
360
|
}
|
|
366
361
|
async function InjectorSuspensed({
|
|
@@ -938,18 +938,13 @@ function FieldLibrary(type, queries) {
|
|
|
938
938
|
var import_client = require("@apollo/client");
|
|
939
939
|
var import_client_integration_nextjs = require("@apollo/client-integration-nextjs");
|
|
940
940
|
var import_headers3 = require("next/headers");
|
|
941
|
-
var import_server6 = require("next/server");
|
|
942
941
|
var import_react2 = __toESM(require("react"));
|
|
943
942
|
var import_react3 = require("react");
|
|
944
|
-
|
|
943
|
+
function Injector({
|
|
945
944
|
fetch: fetch2,
|
|
946
945
|
Component,
|
|
947
|
-
props
|
|
948
|
-
isStatic
|
|
946
|
+
props
|
|
949
947
|
}) {
|
|
950
|
-
if (!isStatic) {
|
|
951
|
-
await (0, import_server6.connection)();
|
|
952
|
-
}
|
|
953
948
|
return /* @__PURE__ */ import_react2.default.createElement(import_react3.Suspense, { fallback: /* @__PURE__ */ import_react2.default.createElement(Component, { ...props || {}, loading: true }) }, /* @__PURE__ */ import_react2.default.createElement(InjectorSuspensed, { Component, fetch: fetch2, props }));
|
|
954
949
|
}
|
|
955
950
|
async function InjectorSuspensed({
|
|
@@ -936,18 +936,13 @@ import {
|
|
|
936
936
|
} from "@apollo/client";
|
|
937
937
|
import { registerApolloClient } from "@apollo/client-integration-nextjs";
|
|
938
938
|
import { cookies as cookies3 } from "next/headers";
|
|
939
|
-
import { connection } from "next/server";
|
|
940
939
|
import React from "react";
|
|
941
940
|
import { Suspense } from "react";
|
|
942
|
-
|
|
941
|
+
function Injector({
|
|
943
942
|
fetch: fetch2,
|
|
944
943
|
Component,
|
|
945
|
-
props
|
|
946
|
-
isStatic
|
|
944
|
+
props
|
|
947
945
|
}) {
|
|
948
|
-
if (!isStatic) {
|
|
949
|
-
await connection();
|
|
950
|
-
}
|
|
951
946
|
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Component, { ...props || {}, loading: true }) }, /* @__PURE__ */ React.createElement(InjectorSuspensed, { Component, fetch: fetch2, props }));
|
|
952
947
|
}
|
|
953
948
|
async function InjectorSuspensed({
|
|
@@ -37,7 +37,6 @@ module.exports = __toCommonJS(server_exports);
|
|
|
37
37
|
var import_client = require("@apollo/client");
|
|
38
38
|
var import_client_integration_nextjs = require("@apollo/client-integration-nextjs");
|
|
39
39
|
var import_headers = require("next/headers");
|
|
40
|
-
var import_server = require("next/server");
|
|
41
40
|
var import_react = __toESM(require("react"));
|
|
42
41
|
var import_react2 = require("react");
|
|
43
42
|
|
|
@@ -92,15 +91,11 @@ function getEnv(key, skipCheck) {
|
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
// src/graphql/server.tsx
|
|
95
|
-
|
|
94
|
+
function Injector({
|
|
96
95
|
fetch,
|
|
97
96
|
Component,
|
|
98
|
-
props
|
|
99
|
-
isStatic
|
|
97
|
+
props
|
|
100
98
|
}) {
|
|
101
|
-
if (!isStatic) {
|
|
102
|
-
await (0, import_server.connection)();
|
|
103
|
-
}
|
|
104
99
|
return /* @__PURE__ */ import_react.default.createElement(import_react2.Suspense, { fallback: /* @__PURE__ */ import_react.default.createElement(Component, { ...props || {}, loading: true }) }, /* @__PURE__ */ import_react.default.createElement(InjectorSuspensed, { Component, fetch, props }));
|
|
105
100
|
}
|
|
106
101
|
async function InjectorSuspensed({
|
|
@@ -19,18 +19,10 @@ type ComponentProps<Y> = OmittedProps<Y> extends Record<string, never> ? {
|
|
|
19
19
|
* This is the primary way to inject server-side data into client components in naystack.
|
|
20
20
|
* Use `.authCall()` or `.call()` from your query definitions inside the `fetch` function.
|
|
21
21
|
*
|
|
22
|
-
* By default, `Injector` calls `connection()` from `next/server` before
|
|
23
|
-
* running `fetch`, marking the surrounding route segment as dynamic. This
|
|
24
|
-
* is what consumers almost always want: data fetched at request time
|
|
25
|
-
* should not be statically prerendered. Pass `isStatic` when you
|
|
26
|
-
* are intentionally rendering inside a cached/static segment (e.g. the
|
|
27
|
-
* `fetch` is wrapped in `"use cache"`).
|
|
28
|
-
*
|
|
29
22
|
* @param injectorProps - Configuration object.
|
|
30
23
|
* @param injectorProps.fetch - Async function that returns the data to pass to the component. Runs on the server.
|
|
31
24
|
* @param injectorProps.Component - React component that receives `{ data?: T; loading: boolean }` plus any extra props.
|
|
32
25
|
* @param injectorProps.props - Optional. Any additional props to pass to `Component`. Required if the Component has props other than `data` and `loading`.
|
|
33
|
-
* @param injectorProps.isStatic - Optional. When true, suppresses the implicit `connection()` call. Default: false.
|
|
34
26
|
* @returns A React element that suspends until `fetch()` completes, then renders `Component` with the data.
|
|
35
27
|
*
|
|
36
28
|
* @example Simple usage:
|
|
@@ -71,14 +63,13 @@ type ComponentProps<Y> = OmittedProps<Y> extends Record<string, never> ? {
|
|
|
71
63
|
*
|
|
72
64
|
* @category GraphQL
|
|
73
65
|
*/
|
|
74
|
-
declare function Injector<T, Y>({ fetch, Component, props,
|
|
66
|
+
declare function Injector<T, Y>({ fetch, Component, props, }: {
|
|
75
67
|
fetch: () => Promise<T>;
|
|
76
68
|
Component: FC<{
|
|
77
69
|
data?: T;
|
|
78
70
|
loading: boolean;
|
|
79
71
|
} & Y>;
|
|
80
|
-
|
|
81
|
-
} & ComponentProps<Y>): Promise<React__default.JSX.Element>;
|
|
72
|
+
} & ComponentProps<Y>): React__default.JSX.Element;
|
|
82
73
|
/**
|
|
83
74
|
* Runs a raw GraphQL query on the server using the registered Apollo client.
|
|
84
75
|
* Cookies are forwarded automatically so the backend can identify the user.
|
package/dist/graphql/server.d.ts
CHANGED
|
@@ -19,18 +19,10 @@ type ComponentProps<Y> = OmittedProps<Y> extends Record<string, never> ? {
|
|
|
19
19
|
* This is the primary way to inject server-side data into client components in naystack.
|
|
20
20
|
* Use `.authCall()` or `.call()` from your query definitions inside the `fetch` function.
|
|
21
21
|
*
|
|
22
|
-
* By default, `Injector` calls `connection()` from `next/server` before
|
|
23
|
-
* running `fetch`, marking the surrounding route segment as dynamic. This
|
|
24
|
-
* is what consumers almost always want: data fetched at request time
|
|
25
|
-
* should not be statically prerendered. Pass `isStatic` when you
|
|
26
|
-
* are intentionally rendering inside a cached/static segment (e.g. the
|
|
27
|
-
* `fetch` is wrapped in `"use cache"`).
|
|
28
|
-
*
|
|
29
22
|
* @param injectorProps - Configuration object.
|
|
30
23
|
* @param injectorProps.fetch - Async function that returns the data to pass to the component. Runs on the server.
|
|
31
24
|
* @param injectorProps.Component - React component that receives `{ data?: T; loading: boolean }` plus any extra props.
|
|
32
25
|
* @param injectorProps.props - Optional. Any additional props to pass to `Component`. Required if the Component has props other than `data` and `loading`.
|
|
33
|
-
* @param injectorProps.isStatic - Optional. When true, suppresses the implicit `connection()` call. Default: false.
|
|
34
26
|
* @returns A React element that suspends until `fetch()` completes, then renders `Component` with the data.
|
|
35
27
|
*
|
|
36
28
|
* @example Simple usage:
|
|
@@ -71,14 +63,13 @@ type ComponentProps<Y> = OmittedProps<Y> extends Record<string, never> ? {
|
|
|
71
63
|
*
|
|
72
64
|
* @category GraphQL
|
|
73
65
|
*/
|
|
74
|
-
declare function Injector<T, Y>({ fetch, Component, props,
|
|
66
|
+
declare function Injector<T, Y>({ fetch, Component, props, }: {
|
|
75
67
|
fetch: () => Promise<T>;
|
|
76
68
|
Component: FC<{
|
|
77
69
|
data?: T;
|
|
78
70
|
loading: boolean;
|
|
79
71
|
} & Y>;
|
|
80
|
-
|
|
81
|
-
} & ComponentProps<Y>): Promise<React__default.JSX.Element>;
|
|
72
|
+
} & ComponentProps<Y>): React__default.JSX.Element;
|
|
82
73
|
/**
|
|
83
74
|
* Runs a raw GraphQL query on the server using the registered Apollo client.
|
|
84
75
|
* Cookies are forwarded automatically so the backend can identify the user.
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
} from "@apollo/client";
|
|
7
7
|
import { registerApolloClient } from "@apollo/client-integration-nextjs";
|
|
8
8
|
import { cookies } from "next/headers";
|
|
9
|
-
import { connection } from "next/server";
|
|
10
9
|
import React from "react";
|
|
11
10
|
import { Suspense } from "react";
|
|
12
11
|
|
|
@@ -61,15 +60,11 @@ function getEnv(key, skipCheck) {
|
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
// src/graphql/server.tsx
|
|
64
|
-
|
|
63
|
+
function Injector({
|
|
65
64
|
fetch,
|
|
66
65
|
Component,
|
|
67
|
-
props
|
|
68
|
-
isStatic
|
|
66
|
+
props
|
|
69
67
|
}) {
|
|
70
|
-
if (!isStatic) {
|
|
71
|
-
await connection();
|
|
72
|
-
}
|
|
73
68
|
return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Component, { ...props || {}, loading: true }) }, /* @__PURE__ */ React.createElement(InjectorSuspensed, { Component, fetch, props }));
|
|
74
69
|
}
|
|
75
70
|
async function InjectorSuspensed({
|