naystack 1.7.4 → 1.7.6
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/client.cjs.js +6 -2
- package/dist/auth/client.esm.js +7 -2
- package/dist/auth/email/client.cjs.js +5 -2
- package/dist/auth/email/client.esm.js +5 -2
- package/dist/auth/index.cjs.js +5 -0
- package/dist/auth/index.d.mts +3 -3
- package/dist/auth/index.d.ts +3 -3
- package/dist/auth/index.esm.js +4 -0
- package/dist/graphql/client.cjs.js +38 -17
- package/dist/graphql/client.d.mts +3 -2
- package/dist/graphql/client.d.ts +3 -2
- package/dist/graphql/client.esm.js +31 -7
- package/package.json +1 -6
package/dist/auth/client.cjs.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -111,14 +112,17 @@ var AuthWrapper = ({
|
|
|
111
112
|
skipInitialFetch
|
|
112
113
|
}) => {
|
|
113
114
|
const [token, setToken] = (0, import_react.useState)();
|
|
114
|
-
useAuthFetch({ getRefreshToken, skip: skipInitialFetch });
|
|
115
115
|
(0, import_react.useEffect)(() => {
|
|
116
116
|
if (onTokenUpdate && token !== void 0) {
|
|
117
117
|
onTokenUpdate(token);
|
|
118
118
|
}
|
|
119
119
|
}, [token]);
|
|
120
|
-
return /* @__PURE__ */ import_react.default.createElement(TokenContext.Provider, { value: { token, setToken } }, children);
|
|
120
|
+
return /* @__PURE__ */ import_react.default.createElement(TokenContext.Provider, { value: { token, setToken } }, !skipInitialFetch && /* @__PURE__ */ import_react.default.createElement(AuthChildComponent, { getRefreshToken }), children);
|
|
121
121
|
};
|
|
122
|
+
function AuthChildComponent({ getRefreshToken }) {
|
|
123
|
+
useAuthFetch({ getRefreshToken });
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
122
126
|
function useAuthFetch({ getRefreshToken, skip }) {
|
|
123
127
|
const setToken = useSetToken();
|
|
124
128
|
const fetchToken = async () => {
|
package/dist/auth/client.esm.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
// src/auth/email/client.tsx
|
|
2
4
|
import React, {
|
|
3
5
|
createContext,
|
|
@@ -72,14 +74,17 @@ var AuthWrapper = ({
|
|
|
72
74
|
skipInitialFetch
|
|
73
75
|
}) => {
|
|
74
76
|
const [token, setToken] = useState();
|
|
75
|
-
useAuthFetch({ getRefreshToken, skip: skipInitialFetch });
|
|
76
77
|
useEffect(() => {
|
|
77
78
|
if (onTokenUpdate && token !== void 0) {
|
|
78
79
|
onTokenUpdate(token);
|
|
79
80
|
}
|
|
80
81
|
}, [token]);
|
|
81
|
-
return /* @__PURE__ */ React.createElement(TokenContext.Provider, { value: { token, setToken } }, children);
|
|
82
|
+
return /* @__PURE__ */ React.createElement(TokenContext.Provider, { value: { token, setToken } }, !skipInitialFetch && /* @__PURE__ */ React.createElement(AuthChildComponent, { getRefreshToken }), children);
|
|
82
83
|
};
|
|
84
|
+
function AuthChildComponent({ getRefreshToken }) {
|
|
85
|
+
useAuthFetch({ getRefreshToken });
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
83
88
|
function useAuthFetch({ getRefreshToken, skip }) {
|
|
84
89
|
const setToken = useSetToken();
|
|
85
90
|
const fetchToken = async () => {
|
|
@@ -109,14 +109,17 @@ var AuthWrapper = ({
|
|
|
109
109
|
skipInitialFetch
|
|
110
110
|
}) => {
|
|
111
111
|
const [token, setToken] = (0, import_react.useState)();
|
|
112
|
-
useAuthFetch({ getRefreshToken, skip: skipInitialFetch });
|
|
113
112
|
(0, import_react.useEffect)(() => {
|
|
114
113
|
if (onTokenUpdate && token !== void 0) {
|
|
115
114
|
onTokenUpdate(token);
|
|
116
115
|
}
|
|
117
116
|
}, [token]);
|
|
118
|
-
return /* @__PURE__ */ import_react.default.createElement(TokenContext.Provider, { value: { token, setToken } }, children);
|
|
117
|
+
return /* @__PURE__ */ import_react.default.createElement(TokenContext.Provider, { value: { token, setToken } }, !skipInitialFetch && /* @__PURE__ */ import_react.default.createElement(AuthChildComponent, { getRefreshToken }), children);
|
|
119
118
|
};
|
|
119
|
+
function AuthChildComponent({ getRefreshToken }) {
|
|
120
|
+
useAuthFetch({ getRefreshToken });
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
120
123
|
function useAuthFetch({ getRefreshToken, skip }) {
|
|
121
124
|
const setToken = useSetToken();
|
|
122
125
|
const fetchToken = async () => {
|
|
@@ -74,14 +74,17 @@ var AuthWrapper = ({
|
|
|
74
74
|
skipInitialFetch
|
|
75
75
|
}) => {
|
|
76
76
|
const [token, setToken] = useState();
|
|
77
|
-
useAuthFetch({ getRefreshToken, skip: skipInitialFetch });
|
|
78
77
|
useEffect(() => {
|
|
79
78
|
if (onTokenUpdate && token !== void 0) {
|
|
80
79
|
onTokenUpdate(token);
|
|
81
80
|
}
|
|
82
81
|
}, [token]);
|
|
83
|
-
return /* @__PURE__ */ React.createElement(TokenContext.Provider, { value: { token, setToken } }, children);
|
|
82
|
+
return /* @__PURE__ */ React.createElement(TokenContext.Provider, { value: { token, setToken } }, !skipInitialFetch && /* @__PURE__ */ React.createElement(AuthChildComponent, { getRefreshToken }), children);
|
|
84
83
|
};
|
|
84
|
+
function AuthChildComponent({ getRefreshToken }) {
|
|
85
|
+
useAuthFetch({ getRefreshToken });
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
85
88
|
function useAuthFetch({ getRefreshToken, skip }) {
|
|
86
89
|
const setToken = useSetToken();
|
|
87
90
|
const fetchToken = async () => {
|
package/dist/auth/index.cjs.js
CHANGED
|
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var auth_exports = {};
|
|
32
32
|
__export(auth_exports, {
|
|
33
33
|
AuthFetch: () => AuthFetch,
|
|
34
|
+
AuthWrapper: () => AuthWrapper,
|
|
34
35
|
checkAuthStatus: () => checkAuthStatus,
|
|
35
36
|
getContext: () => getContext,
|
|
36
37
|
getRefreshToken: () => getRefreshToken,
|
|
@@ -416,6 +417,9 @@ function AuthFetch() {
|
|
|
416
417
|
}
|
|
417
418
|
);
|
|
418
419
|
}
|
|
420
|
+
function AuthWrapper({ children, getRefreshToken: getRefreshToken2, onTokenUpdate, skipInitialFetch }) {
|
|
421
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement(import_client2.AuthWrapper, { skipInitialFetch: true, getRefreshToken: getRefreshToken2, onTokenUpdate }, !skipInitialFetch && /* @__PURE__ */ import_react3.default.createElement(AuthFetch, null), children));
|
|
422
|
+
}
|
|
419
423
|
|
|
420
424
|
// src/auth/email/index.ts
|
|
421
425
|
function setupEmailAuth(options) {
|
|
@@ -642,6 +646,7 @@ async function getRefreshToken() {
|
|
|
642
646
|
// Annotate the CommonJS export names for ESM import in node:
|
|
643
647
|
0 && (module.exports = {
|
|
644
648
|
AuthFetch,
|
|
649
|
+
AuthWrapper,
|
|
645
650
|
checkAuthStatus,
|
|
646
651
|
getContext,
|
|
647
652
|
getRefreshToken,
|
package/dist/auth/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { setupEmailAuth } from './email/index.mjs';
|
|
2
|
-
export { setupGoogleAuth } from './google/index.mjs';
|
|
3
|
-
export { setupInstagramAuth } from './instagram/index.mjs';
|
|
2
|
+
export { SetupGoogleAuthOptions, setupGoogleAuth } from './google/index.mjs';
|
|
3
|
+
export { SetupInstagramAuthOptions, setupInstagramAuth } from './instagram/index.mjs';
|
|
4
4
|
export { getRefreshToken } from './utils/token.mjs';
|
|
5
|
-
export { AuthFetch } from './email/next.mjs';
|
|
5
|
+
export { AuthFetch, AuthWrapper } from './email/next.mjs';
|
|
6
6
|
export { checkAuthStatus } from './email/token.mjs';
|
|
7
7
|
export { getContext } from './email/utils.mjs';
|
|
8
8
|
export { getRefreshedInstagramAccessToken } from './instagram/utils.mjs';
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { setupEmailAuth } from './email/index.js';
|
|
2
|
-
export { setupGoogleAuth } from './google/index.js';
|
|
3
|
-
export { setupInstagramAuth } from './instagram/index.js';
|
|
2
|
+
export { SetupGoogleAuthOptions, setupGoogleAuth } from './google/index.js';
|
|
3
|
+
export { SetupInstagramAuthOptions, setupInstagramAuth } from './instagram/index.js';
|
|
4
4
|
export { getRefreshToken } from './utils/token.js';
|
|
5
|
-
export { AuthFetch } from './email/next.js';
|
|
5
|
+
export { AuthFetch, AuthWrapper } from './email/next.js';
|
|
6
6
|
export { checkAuthStatus } from './email/token.js';
|
|
7
7
|
export { getContext } from './email/utils.js';
|
|
8
8
|
export { getRefreshedInstagramAccessToken } from './instagram/utils.js';
|
package/dist/auth/index.esm.js
CHANGED
|
@@ -377,6 +377,9 @@ function AuthFetch() {
|
|
|
377
377
|
}
|
|
378
378
|
);
|
|
379
379
|
}
|
|
380
|
+
function AuthWrapper({ children, getRefreshToken: getRefreshToken2, onTokenUpdate, skipInitialFetch }) {
|
|
381
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(AuthWrapperClient, { skipInitialFetch: true, getRefreshToken: getRefreshToken2, onTokenUpdate }, !skipInitialFetch && /* @__PURE__ */ React2.createElement(AuthFetch, null), children));
|
|
382
|
+
}
|
|
380
383
|
|
|
381
384
|
// src/auth/email/index.ts
|
|
382
385
|
function setupEmailAuth(options) {
|
|
@@ -602,6 +605,7 @@ async function getRefreshToken() {
|
|
|
602
605
|
}
|
|
603
606
|
export {
|
|
604
607
|
AuthFetch,
|
|
608
|
+
AuthWrapper,
|
|
605
609
|
checkAuthStatus,
|
|
606
610
|
getContext,
|
|
607
611
|
getRefreshToken,
|
|
@@ -31,15 +31,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
// src/graphql/client.tsx
|
|
32
32
|
var client_exports = {};
|
|
33
33
|
__export(client_exports, {
|
|
34
|
-
|
|
34
|
+
ApolloWrapperClient: () => ApolloWrapperClient,
|
|
35
|
+
ApolloWrapperNext: () => ApolloWrapper,
|
|
35
36
|
tokenContext: () => tokenContext,
|
|
36
37
|
useAuthMutation: () => useAuthMutation,
|
|
37
38
|
useAuthQuery: () => useAuthQuery
|
|
38
39
|
});
|
|
39
40
|
module.exports = __toCommonJS(client_exports);
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
41
|
+
var import_client2 = require("@apollo/client");
|
|
42
|
+
var import_client3 = require("naystack/auth/client");
|
|
43
|
+
var import_react2 = __toESM(require("react"));
|
|
43
44
|
|
|
44
45
|
// src/env.ts
|
|
45
46
|
var EXTRA_ENV = globalThis.__NAYSTACK_ENV__ || (globalThis.__NAYSTACK_ENV__ = {});
|
|
@@ -91,10 +92,13 @@ function getEnv(key, skipCheck) {
|
|
|
91
92
|
return value;
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
// src/graphql/
|
|
95
|
+
// src/graphql/next.tsx
|
|
96
|
+
var import_client = require("@apollo/client");
|
|
97
|
+
var import_client_integration_nextjs = require("@apollo/client-integration-nextjs");
|
|
98
|
+
var import_react = __toESM(require("react"));
|
|
95
99
|
function makeClient(cacheConfig) {
|
|
96
|
-
return new
|
|
97
|
-
cache: new
|
|
100
|
+
return new import_client_integration_nextjs.ApolloClient({
|
|
101
|
+
cache: new import_client_integration_nextjs.InMemoryCache(cacheConfig),
|
|
98
102
|
link: new import_client.HttpLink({
|
|
99
103
|
uri: getEnv("NEXT_PUBLIC_GRAPHQL_ENDPOINT" /* NEXT_PUBLIC_GRAPHQL_ENDPOINT */)
|
|
100
104
|
})
|
|
@@ -104,7 +108,23 @@ var ApolloWrapper = ({
|
|
|
104
108
|
children,
|
|
105
109
|
cacheConfig
|
|
106
110
|
}) => {
|
|
107
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
111
|
+
return /* @__PURE__ */ import_react.default.createElement(import_client_integration_nextjs.ApolloNextAppProvider, { makeClient: () => makeClient(cacheConfig) }, children);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// src/graphql/client.tsx
|
|
115
|
+
function makeClient2(cacheConfig) {
|
|
116
|
+
return new import_client2.ApolloClient({
|
|
117
|
+
cache: new import_client2.InMemoryCache(cacheConfig),
|
|
118
|
+
link: new import_client2.HttpLink({
|
|
119
|
+
uri: getEnv("NEXT_PUBLIC_GRAPHQL_ENDPOINT" /* NEXT_PUBLIC_GRAPHQL_ENDPOINT */)
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
var ApolloWrapperClient = ({
|
|
124
|
+
children,
|
|
125
|
+
cacheConfig
|
|
126
|
+
}) => {
|
|
127
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_client2.ApolloProvider, { client: makeClient2(cacheConfig) }, children);
|
|
108
128
|
};
|
|
109
129
|
var tokenContext = (token) => {
|
|
110
130
|
if (!token) return void 0;
|
|
@@ -116,12 +136,12 @@ var tokenContext = (token) => {
|
|
|
116
136
|
};
|
|
117
137
|
};
|
|
118
138
|
function useAuthQuery(query, variables) {
|
|
119
|
-
const token = (0,
|
|
120
|
-
const [fetch, result] = (0,
|
|
139
|
+
const token = (0, import_client3.useToken)();
|
|
140
|
+
const [fetch, result] = (0, import_client2.useLazyQuery)(query, {
|
|
121
141
|
fetchPolicy: "no-cache"
|
|
122
142
|
});
|
|
123
|
-
const prevVarsRef = (0,
|
|
124
|
-
(0,
|
|
143
|
+
const prevVarsRef = (0, import_react2.useRef)(null);
|
|
144
|
+
(0, import_react2.useEffect)(() => {
|
|
125
145
|
const serialized = JSON.stringify(variables);
|
|
126
146
|
if (token && variables && prevVarsRef.current !== serialized) {
|
|
127
147
|
prevVarsRef.current = serialized;
|
|
@@ -132,7 +152,7 @@ function useAuthQuery(query, variables) {
|
|
|
132
152
|
});
|
|
133
153
|
}
|
|
134
154
|
}, [fetch, token, variables]);
|
|
135
|
-
const reFetch = (0,
|
|
155
|
+
const reFetch = (0, import_react2.useCallback)(
|
|
136
156
|
(input) => fetch({
|
|
137
157
|
// @ts-expect-error -- to allow dynamic props
|
|
138
158
|
variables: { input },
|
|
@@ -143,9 +163,9 @@ function useAuthQuery(query, variables) {
|
|
|
143
163
|
return [reFetch, { ...result, hasAuth: !!token }];
|
|
144
164
|
}
|
|
145
165
|
function useAuthMutation(mutation, options) {
|
|
146
|
-
const token = (0,
|
|
147
|
-
const [mutate, result] = (0,
|
|
148
|
-
const method = (0,
|
|
166
|
+
const token = (0, import_client3.useToken)();
|
|
167
|
+
const [mutate, result] = (0, import_client2.useMutation)(mutation, options);
|
|
168
|
+
const method = (0, import_react2.useCallback)(
|
|
149
169
|
(input) => mutate({
|
|
150
170
|
// @ts-expect-error -- to allow dynamic props
|
|
151
171
|
variables: { input },
|
|
@@ -157,7 +177,8 @@ function useAuthMutation(mutation, options) {
|
|
|
157
177
|
}
|
|
158
178
|
// Annotate the CommonJS export names for ESM import in node:
|
|
159
179
|
0 && (module.exports = {
|
|
160
|
-
|
|
180
|
+
ApolloWrapperClient,
|
|
181
|
+
ApolloWrapperNext,
|
|
161
182
|
tokenContext,
|
|
162
183
|
useAuthMutation,
|
|
163
184
|
useAuthQuery
|
|
@@ -3,8 +3,9 @@ import * as _apollo_client from '@apollo/client';
|
|
|
3
3
|
import { InMemoryCacheConfig, OperationVariables, ApolloClient, MutationHookOptions } from '@apollo/client';
|
|
4
4
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
5
|
import React__default, { PropsWithChildren } from 'react';
|
|
6
|
+
export { ApolloWrapper as ApolloWrapperNext } from './next.mjs';
|
|
6
7
|
|
|
7
|
-
declare const
|
|
8
|
+
declare const ApolloWrapperClient: ({ children, cacheConfig, }: PropsWithChildren<{
|
|
8
9
|
cacheConfig?: InMemoryCacheConfig;
|
|
9
10
|
}>) => React__default.JSX.Element;
|
|
10
11
|
/**
|
|
@@ -129,4 +130,4 @@ declare function useAuthMutation<T, V extends OperationVariables>(mutation: Type
|
|
|
129
130
|
readonly reset: () => void;
|
|
130
131
|
}];
|
|
131
132
|
|
|
132
|
-
export {
|
|
133
|
+
export { ApolloWrapperClient, tokenContext, useAuthMutation, useAuthQuery };
|
package/dist/graphql/client.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import * as _apollo_client from '@apollo/client';
|
|
|
3
3
|
import { InMemoryCacheConfig, OperationVariables, ApolloClient, MutationHookOptions } from '@apollo/client';
|
|
4
4
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
5
|
import React__default, { PropsWithChildren } from 'react';
|
|
6
|
+
export { ApolloWrapper as ApolloWrapperNext } from './next.js';
|
|
6
7
|
|
|
7
|
-
declare const
|
|
8
|
+
declare const ApolloWrapperClient: ({ children, cacheConfig, }: PropsWithChildren<{
|
|
8
9
|
cacheConfig?: InMemoryCacheConfig;
|
|
9
10
|
}>) => React__default.JSX.Element;
|
|
10
11
|
/**
|
|
@@ -129,4 +130,4 @@ declare function useAuthMutation<T, V extends OperationVariables>(mutation: Type
|
|
|
129
130
|
readonly reset: () => void;
|
|
130
131
|
}];
|
|
131
132
|
|
|
132
|
-
export {
|
|
133
|
+
export { ApolloWrapperClient, tokenContext, useAuthMutation, useAuthQuery };
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
// src/graphql/client.tsx
|
|
4
4
|
import {
|
|
5
|
-
ApolloClient,
|
|
5
|
+
ApolloClient as ApolloClient2,
|
|
6
6
|
ApolloProvider,
|
|
7
|
-
HttpLink,
|
|
8
|
-
InMemoryCache,
|
|
7
|
+
HttpLink as HttpLink2,
|
|
8
|
+
InMemoryCache as InMemoryCache2,
|
|
9
9
|
useLazyQuery,
|
|
10
10
|
useMutation
|
|
11
11
|
} from "@apollo/client";
|
|
12
12
|
import { useToken } from "naystack/auth/client";
|
|
13
|
-
import
|
|
13
|
+
import React2, {
|
|
14
14
|
useCallback,
|
|
15
15
|
useEffect,
|
|
16
16
|
useRef
|
|
@@ -66,7 +66,14 @@ function getEnv(key, skipCheck) {
|
|
|
66
66
|
return value;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
// src/graphql/
|
|
69
|
+
// src/graphql/next.tsx
|
|
70
|
+
import { HttpLink } from "@apollo/client";
|
|
71
|
+
import {
|
|
72
|
+
ApolloClient,
|
|
73
|
+
ApolloNextAppProvider,
|
|
74
|
+
InMemoryCache
|
|
75
|
+
} from "@apollo/client-integration-nextjs";
|
|
76
|
+
import React from "react";
|
|
70
77
|
function makeClient(cacheConfig) {
|
|
71
78
|
return new ApolloClient({
|
|
72
79
|
cache: new InMemoryCache(cacheConfig),
|
|
@@ -79,7 +86,23 @@ var ApolloWrapper = ({
|
|
|
79
86
|
children,
|
|
80
87
|
cacheConfig
|
|
81
88
|
}) => {
|
|
82
|
-
return /* @__PURE__ */ React.createElement(
|
|
89
|
+
return /* @__PURE__ */ React.createElement(ApolloNextAppProvider, { makeClient: () => makeClient(cacheConfig) }, children);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// src/graphql/client.tsx
|
|
93
|
+
function makeClient2(cacheConfig) {
|
|
94
|
+
return new ApolloClient2({
|
|
95
|
+
cache: new InMemoryCache2(cacheConfig),
|
|
96
|
+
link: new HttpLink2({
|
|
97
|
+
uri: getEnv("NEXT_PUBLIC_GRAPHQL_ENDPOINT" /* NEXT_PUBLIC_GRAPHQL_ENDPOINT */)
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
var ApolloWrapperClient = ({
|
|
102
|
+
children,
|
|
103
|
+
cacheConfig
|
|
104
|
+
}) => {
|
|
105
|
+
return /* @__PURE__ */ React2.createElement(ApolloProvider, { client: makeClient2(cacheConfig) }, children);
|
|
83
106
|
};
|
|
84
107
|
var tokenContext = (token) => {
|
|
85
108
|
if (!token) return void 0;
|
|
@@ -131,7 +154,8 @@ function useAuthMutation(mutation, options) {
|
|
|
131
154
|
return [method, { ...result, hasAuth: !!token }];
|
|
132
155
|
}
|
|
133
156
|
export {
|
|
134
|
-
|
|
157
|
+
ApolloWrapperClient,
|
|
158
|
+
ApolloWrapper as ApolloWrapperNext,
|
|
135
159
|
tokenContext,
|
|
136
160
|
useAuthMutation,
|
|
137
161
|
useAuthQuery
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "naystack",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6",
|
|
4
4
|
"description": "A stack built with Next + GraphQL + S3 + Auth",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -33,11 +33,6 @@
|
|
|
33
33
|
"import": "./dist/graphql/client.esm.js",
|
|
34
34
|
"require": "./dist/graphql/client.cjs.js"
|
|
35
35
|
},
|
|
36
|
-
"./graphql/next": {
|
|
37
|
-
"types": "./dist/graphql/next.d.ts",
|
|
38
|
-
"import": "./dist/graphql/next.esm.js",
|
|
39
|
-
"require": "./dist/graphql/next.cjs.js"
|
|
40
|
-
},
|
|
41
36
|
"./file": {
|
|
42
37
|
"types": "./dist/file/index.d.ts",
|
|
43
38
|
"import": "./dist/file/index.esm.js",
|