@econneq/gql-auth 1.2.11 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +304 -22
- package/dist/api-factory.d.ts +11 -27
- package/dist/api-factory.d.ts.map +1 -1
- package/dist/api-factory.js +96 -43
- package/dist/api-factory.js.map +1 -0
- package/dist/authServer.d.ts +28 -1
- package/dist/authServer.d.ts.map +1 -1
- package/dist/authServer.js +66 -13
- package/dist/authServer.js.map +1 -0
- package/dist/client.d.ts +28 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +75 -55
- package/dist/client.js.map +1 -0
- package/dist/env.d.ts +35 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +65 -0
- package/dist/env.js.map +1 -0
- package/dist/errors.d.ts +10 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +24 -0
- package/dist/errors.js.map +1 -0
- package/dist/functions.d.ts +21 -3
- package/dist/functions.d.ts.map +1 -1
- package/dist/functions.js +74 -26
- package/dist/functions.js.map +1 -0
- package/dist/index.d.ts +11 -50
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -6
- package/dist/index.js.map +1 -0
- package/dist/query-server.d.ts +31 -9
- package/dist/query-server.d.ts.map +1 -1
- package/dist/query-server.js +63 -11
- package/dist/query-server.js.map +1 -0
- package/dist/tenant.d.ts +21 -0
- package/dist/tenant.d.ts.map +1 -0
- package/dist/tenant.js +50 -0
- package/dist/tenant.js.map +1 -0
- package/dist/types.d.ts +124 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/upload-gql.d.ts +2 -17
- package/dist/upload-gql.d.ts.map +1 -1
- package/dist/upload-gql.js +63 -44
- package/dist/upload-gql.js.map +1 -0
- package/dist/utils.d.ts +24 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +257 -0
- package/dist/utilsGeneral.d.ts +1 -1
- package/dist/utilsGeneral.d.ts.map +1 -1
- package/package.json +49 -22
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { InterFieldList, JwtPayload } from ".";
|
|
2
|
+
export declare const capitalizeEachWord: (str: string) => string;
|
|
3
|
+
export declare const errorLog: (err: any, show?: boolean) => string;
|
|
4
|
+
export declare const getToken: () => string | null;
|
|
5
|
+
export declare const getUser: () => JwtPayload | null;
|
|
6
|
+
export declare const getStoredFont: (FONTS: string[]) => string;
|
|
7
|
+
export declare const getTimeAgo: (dateStr: string, type: "past" | "future") => string;
|
|
8
|
+
export declare const getLanguage: () => "en" | "fr";
|
|
9
|
+
export declare const getTemplate: () => number;
|
|
10
|
+
export declare const decodeUrlID: (urlID: string) => string;
|
|
11
|
+
export declare function getAcademicYear(): string;
|
|
12
|
+
export declare const removeEmptyFields: (obj: any) => any;
|
|
13
|
+
export declare const Alert: ({ title, duration, status }: {
|
|
14
|
+
title: string;
|
|
15
|
+
duration: 1000 | 1500 | 2000 | 3000 | 4000 | 5000;
|
|
16
|
+
status?: boolean;
|
|
17
|
+
}) => void;
|
|
18
|
+
export declare const validateFormFields: (formData: any, currentStepFields: InterFieldList[]) => Record<string, string>;
|
|
19
|
+
export declare const lastYears: (number: number) => {
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}[];
|
|
23
|
+
export declare const formatText: (text: string) => string;
|
|
24
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAI/C,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,WAM7C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,KAAK,GAAG,EAAE,OAAO,OAAO,WAyBhD,CAAC;AAKF,eAAO,MAAM,QAAQ,qBAKpB,CAAC;AAEF,eAAO,MAAM,OAAO,yBAKnB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,WAO5C,CAAC;AAEF,eAAO,MAAM,UAAU,GACnB,SAAS,MAAM,EACf,MAAM,MAAM,GAAG,QAAQ,KACxB,MA0CF,CAAC;AAGF,eAAO,MAAM,WAAW,mBAOvB,CAAC;AAEF,eAAO,MAAM,WAAW,cAMvB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,WAIxC,CAAA;AAED,wBAAgB,eAAe,IAAI,MAAM,CAUxC;AAED,eAAO,MAAM,iBAAiB,GAAI,KAAK,GAAG,QAUzC,CAAC;AAGF,eAAO,MAAM,KAAK,GACd,6BACI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,SAU7F,CAAC;AAIF,eAAO,MAAM,kBAAkB,GAAI,UAAU,GAAG,EAAE,mBAAmB,cAAc,EAAE,2BAkDpF,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM;;;GAKvC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,WAiDtC,CAAC"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import Swal from "sweetalert2";
|
|
2
|
+
import Cookies from "js-cookie";
|
|
3
|
+
import { jwtDecode } from "jwt-decode";
|
|
4
|
+
export const capitalizeEachWord = (str) => {
|
|
5
|
+
if (!str)
|
|
6
|
+
return ''; // Handle empty or null strings
|
|
7
|
+
return str
|
|
8
|
+
.split(' ')
|
|
9
|
+
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
10
|
+
.join(' ');
|
|
11
|
+
};
|
|
12
|
+
export const errorLog = (err, show) => {
|
|
13
|
+
let mes = "An unknown error occurred";
|
|
14
|
+
if (typeof err === "string")
|
|
15
|
+
mes = err;
|
|
16
|
+
else if (err?.graphQLErrors?.length > 0)
|
|
17
|
+
mes = err.graphQLErrors.map((e) => e.message).join('\n');
|
|
18
|
+
else if (err?.networkError) {
|
|
19
|
+
const netErr = err.networkError;
|
|
20
|
+
if ("result" in netErr && netErr.result?.errors?.length > 0)
|
|
21
|
+
mes = netErr.result.errors.map((e) => e.message).join('\n');
|
|
22
|
+
else if (netErr.message)
|
|
23
|
+
mes = netErr.message;
|
|
24
|
+
}
|
|
25
|
+
else if (err?.extraInfo)
|
|
26
|
+
mes = String(err.extraInfo);
|
|
27
|
+
else if (err?.message)
|
|
28
|
+
mes = err.message;
|
|
29
|
+
if (show) {
|
|
30
|
+
Swal.fire({
|
|
31
|
+
title: mes,
|
|
32
|
+
icon: 'error',
|
|
33
|
+
timer: 3000,
|
|
34
|
+
timerProgressBar: true,
|
|
35
|
+
showConfirmButton: false,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return mes;
|
|
39
|
+
};
|
|
40
|
+
const currentYear = new Date().getFullYear();
|
|
41
|
+
export const getToken = () => {
|
|
42
|
+
if (typeof window === "undefined") {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return Cookies.get("token") || localStorage.getItem("token");
|
|
46
|
+
};
|
|
47
|
+
export const getUser = () => {
|
|
48
|
+
// const token = typeof window !== 'undefined' ? localStorage.getItem("token") : null;
|
|
49
|
+
const token = getToken();
|
|
50
|
+
const user = token ? jwtDecode(token) : null;
|
|
51
|
+
return user;
|
|
52
|
+
};
|
|
53
|
+
export const getStoredFont = (FONTS) => {
|
|
54
|
+
if (typeof window === "undefined")
|
|
55
|
+
return FONTS[0]; // Default for SSR
|
|
56
|
+
const up = localStorage.getItem("user-pref");
|
|
57
|
+
if (!up)
|
|
58
|
+
return FONTS[5]; // Default to Ubuntu (6th index)
|
|
59
|
+
const fontIndex = parseInt(up[1]) - 1;
|
|
60
|
+
return FONTS[fontIndex] || FONTS[5];
|
|
61
|
+
};
|
|
62
|
+
export const getTimeAgo = (dateStr, type) => {
|
|
63
|
+
if (!dateStr)
|
|
64
|
+
return "";
|
|
65
|
+
const now = new Date();
|
|
66
|
+
const item = new Date(dateStr);
|
|
67
|
+
let diffMs = 0;
|
|
68
|
+
if (type === "past")
|
|
69
|
+
diffMs = now.getTime() - item.getTime();
|
|
70
|
+
if (type === "future")
|
|
71
|
+
diffMs = item.getTime() - now.getTime();
|
|
72
|
+
// Handle invalid date ranges
|
|
73
|
+
if (diffMs < 0) {
|
|
74
|
+
return type === "past" ? "just now" : "Closed";
|
|
75
|
+
}
|
|
76
|
+
const seconds = Math.floor(diffMs / 1000);
|
|
77
|
+
const minutes = Math.floor(seconds / 60);
|
|
78
|
+
const hours = Math.floor(minutes / 60);
|
|
79
|
+
const days = Math.floor(hours / 24);
|
|
80
|
+
const weeks = Math.floor(days / 7);
|
|
81
|
+
const months = Math.floor(days / 30.44); // Use average month length
|
|
82
|
+
const years = Math.floor(days / 365.25); // Account for leap years
|
|
83
|
+
const suffix = type === "past" ? "ago" : "left";
|
|
84
|
+
// 1. Logic for Past Dates (e.g., Posted 2 days ago)
|
|
85
|
+
if (type === "past") {
|
|
86
|
+
if (days === 0)
|
|
87
|
+
return "Today";
|
|
88
|
+
if (days === 1)
|
|
89
|
+
return "Yesterday";
|
|
90
|
+
if (days < 7)
|
|
91
|
+
return `${days} days ago`;
|
|
92
|
+
if (weeks < 5)
|
|
93
|
+
return `${weeks} week${weeks > 1 ? "s" : ""} ago`;
|
|
94
|
+
if (months < 12)
|
|
95
|
+
return `${months} month${months > 1 ? "s" : ""} ago`;
|
|
96
|
+
return `${years} year${years > 1 ? "s" : ""} ago`;
|
|
97
|
+
}
|
|
98
|
+
// 2. Logic for Future Dates (e.g., 5 days left)
|
|
99
|
+
if (days === 0)
|
|
100
|
+
return "Ends today";
|
|
101
|
+
if (days === 1)
|
|
102
|
+
return "1 day left";
|
|
103
|
+
if (days < 7)
|
|
104
|
+
return `${days} days left`;
|
|
105
|
+
if (weeks < 5)
|
|
106
|
+
return `${weeks} week${weeks > 1 ? "s" : ""} left`;
|
|
107
|
+
if (months < 12)
|
|
108
|
+
return `${months} month${months > 1 ? "s" : ""} left`;
|
|
109
|
+
return `${years} year${years > 1 ? "s" : ""} left`;
|
|
110
|
+
};
|
|
111
|
+
export const getLanguage = () => {
|
|
112
|
+
if (typeof window === "undefined")
|
|
113
|
+
return "en";
|
|
114
|
+
const up = localStorage.getItem("user-pref");
|
|
115
|
+
if (!up)
|
|
116
|
+
return "en";
|
|
117
|
+
const langNumber = parseInt(up[0]);
|
|
118
|
+
return langNumber === 1 ? "en" : "fr";
|
|
119
|
+
};
|
|
120
|
+
export const getTemplate = () => {
|
|
121
|
+
if (typeof window === "undefined")
|
|
122
|
+
return 1;
|
|
123
|
+
const up = localStorage.getItem("user-pref");
|
|
124
|
+
if (!up)
|
|
125
|
+
return 1;
|
|
126
|
+
return parseInt(up[2]);
|
|
127
|
+
};
|
|
128
|
+
export const decodeUrlID = (urlID) => {
|
|
129
|
+
const base64DecodedString = decodeURIComponent(urlID); // Decodes %3D%3D to ==
|
|
130
|
+
const id = Buffer.from(base64DecodedString, 'base64').toString('utf-8'); // Decoding from base64
|
|
131
|
+
return id.split(":")[1];
|
|
132
|
+
};
|
|
133
|
+
export function getAcademicYear() {
|
|
134
|
+
const today = new Date();
|
|
135
|
+
const year = today.getFullYear();
|
|
136
|
+
const month = today.getMonth(); // 0 = January, 7 = August
|
|
137
|
+
if (month < 7) {
|
|
138
|
+
return `${year - 1}/${year}`;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
return `${year}/${year + 1}`;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export const removeEmptyFields = (obj) => {
|
|
145
|
+
const newObj = {};
|
|
146
|
+
for (const key in obj) {
|
|
147
|
+
// Keep File objects and non-empty values
|
|
148
|
+
if (obj[key] instanceof File ||
|
|
149
|
+
(obj[key] !== null && obj[key] !== undefined && obj[key] !== '')) {
|
|
150
|
+
newObj[key] = obj[key];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return newObj;
|
|
154
|
+
};
|
|
155
|
+
export const Alert = ({ title, duration, status = true }) => {
|
|
156
|
+
Swal.fire({
|
|
157
|
+
title: capitalizeEachWord(title),
|
|
158
|
+
timer: duration,
|
|
159
|
+
timerProgressBar: true,
|
|
160
|
+
showConfirmButton: false,
|
|
161
|
+
icon: status ? 'success' : 'error',
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
export const validateFormFields = (formData, currentStepFields) => {
|
|
165
|
+
const newErrors = {};
|
|
166
|
+
// 1. Flatten the fields from all rows in the step
|
|
167
|
+
const fieldsToValidate = currentStepFields.flatMap(row => row.fields);
|
|
168
|
+
fieldsToValidate.forEach((field) => {
|
|
169
|
+
// Skip validation if the field is hidden
|
|
170
|
+
if (field.show === false)
|
|
171
|
+
return;
|
|
172
|
+
// 2. Get the value from formData
|
|
173
|
+
const value = formData[field.name];
|
|
174
|
+
// 3. Check Required
|
|
175
|
+
if (field.required && (!value || value.toString().trim() === "")) {
|
|
176
|
+
newErrors[field.name] = `${capitalizeEachWord(field.label)} is required`;
|
|
177
|
+
// return;
|
|
178
|
+
}
|
|
179
|
+
// 4. Check Type (Email)
|
|
180
|
+
if (field.type === 'email' && value) {
|
|
181
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
182
|
+
if (!emailRegex.test(value)) {
|
|
183
|
+
newErrors[field.name] = "Invalid email format";
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// 5. Check Numbers (Min/Max)
|
|
187
|
+
if (field.type === 'number' && value) {
|
|
188
|
+
const numValue = Number(value);
|
|
189
|
+
if (field.min !== undefined && numValue < field.min) {
|
|
190
|
+
newErrors[field.name] = `Minimum value is ${field.min}`;
|
|
191
|
+
}
|
|
192
|
+
if (field.max !== undefined && numValue > field.max) {
|
|
193
|
+
newErrors[field.name] = `Maximum value is ${field.max}`;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// 6. Check Length (Strings)
|
|
197
|
+
if (field.type === 'text' && value) {
|
|
198
|
+
if (field.min !== undefined && value.length < field.min) {
|
|
199
|
+
newErrors[field.name] = `Too short (min ${field.min} chars)`;
|
|
200
|
+
}
|
|
201
|
+
if (field.max !== undefined && value.length > field.max) {
|
|
202
|
+
newErrors[field.name] = `Too long (min ${field.max} chars)`;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return newErrors;
|
|
207
|
+
};
|
|
208
|
+
export const lastYears = (number) => {
|
|
209
|
+
return Array.from({ length: number }, (_, i) => ({
|
|
210
|
+
value: (currentYear - i).toString(),
|
|
211
|
+
label: (currentYear - i).toString()
|
|
212
|
+
})).sort((a, b) => Number(b.value) - Number(a.value));
|
|
213
|
+
};
|
|
214
|
+
export const formatText = (text) => {
|
|
215
|
+
return text;
|
|
216
|
+
if (!text || typeof text !== "string")
|
|
217
|
+
return "";
|
|
218
|
+
return text
|
|
219
|
+
// Ensure space after "." if it's not part of abbreviation/number
|
|
220
|
+
.replace(/\.(?!\s|$|[a-zA-Z0-9])/g, ". ")
|
|
221
|
+
// Split sentences by ". " but preserve delimiter
|
|
222
|
+
.split(/(\. )/g)
|
|
223
|
+
.map((segment) => {
|
|
224
|
+
if (segment === ". ")
|
|
225
|
+
return segment; // keep delimiter
|
|
226
|
+
return segment
|
|
227
|
+
.split(" ")
|
|
228
|
+
.map((word, i) => {
|
|
229
|
+
if (word === "")
|
|
230
|
+
return word;
|
|
231
|
+
// Preserve existing ALL CAPS words
|
|
232
|
+
if (word.length > 1 && /^[A-Z]+$/.test(word)) {
|
|
233
|
+
return word;
|
|
234
|
+
}
|
|
235
|
+
// Abbreviations like g.a, n.l.n
|
|
236
|
+
if (/^([a-zA-Z]\.)+[a-zA-Z]?$/.test(word)) {
|
|
237
|
+
return word.toUpperCase(); // → G.A, N.L.N
|
|
238
|
+
}
|
|
239
|
+
// Version numbers like 3.0.1
|
|
240
|
+
if (/^\d+(\.\d+)+$/.test(word)) {
|
|
241
|
+
return word;
|
|
242
|
+
}
|
|
243
|
+
// Mixed abbrev/numbers (like p.m2.5 or covid-19 v2.0)
|
|
244
|
+
if (/[a-zA-Z]\.\d/.test(word) || /\d+\.\d+[a-zA-Z]?/.test(word)) {
|
|
245
|
+
return word; // leave as-is
|
|
246
|
+
}
|
|
247
|
+
// First word of sentence → capitalize first letter
|
|
248
|
+
if (i === 0) {
|
|
249
|
+
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
|
|
250
|
+
}
|
|
251
|
+
// Other words → lowercase
|
|
252
|
+
return word.toLowerCase();
|
|
253
|
+
})
|
|
254
|
+
.join(" ");
|
|
255
|
+
})
|
|
256
|
+
.join("");
|
|
257
|
+
};
|
package/dist/utilsGeneral.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InterFieldList, JwtPayload } from "
|
|
1
|
+
import { InterFieldList, JwtPayload } from ".";
|
|
2
2
|
export declare const capitalizeEachWord: (str: string) => string;
|
|
3
3
|
export declare const errorLog: (err: any, show?: boolean) => string;
|
|
4
4
|
export declare const logout: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilsGeneral.d.ts","sourceRoot":"","sources":["../src/utilsGeneral.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utilsGeneral.d.ts","sourceRoot":"","sources":["../src/utilsGeneral.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAM/C,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,WAM7C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,KAAK,GAAG,EAAE,OAAO,OAAO,WAyBhD,CAAC;AAEF,eAAO,MAAM,MAAM,YAclB,CAAC;AAEF,eAAO,MAAM,QAAQ,qBAKpB,CAAC;AAEF,eAAO,MAAM,OAAO,yBAKnB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,WAO5C,CAAC;AAEF,eAAO,MAAM,UAAU,GACnB,SAAS,MAAM,EACf,MAAM,MAAM,GAAG,QAAQ,KACxB,MA0CF,CAAC;AAEF,eAAO,MAAM,WAAW,mBAOvB,CAAC;AAEF,eAAO,MAAM,WAAW,cAMvB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,WAIxC,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,KAAK,GAAG,QAUzC,CAAC;AAEF,eAAO,MAAM,KAAK,GACd,6BACI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,SAU7F,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,UAAU,GAAG,EAAE,mBAAmB,cAAc,EAAE,2BAkDpF,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM;;;GAKvC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,WAiDtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,49 +1,76 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@econneq/gql-auth",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "GraphQL auth utilities for multi-tenant and single-tenant Next.js projects.",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
7
|
"module": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"build:watch": "tsc --watch",
|
|
12
|
+
"prepublishOnly": "npm run build",
|
|
13
|
+
"typecheck": "tsc --noEmit"
|
|
14
|
+
},
|
|
8
15
|
"publishConfig": {
|
|
9
|
-
"access": "public"
|
|
10
|
-
"registry": "https://registry.npmjs.org/"
|
|
16
|
+
"access": "public"
|
|
11
17
|
},
|
|
12
18
|
"exports": {
|
|
13
19
|
".": {
|
|
14
20
|
"types": "./dist/index.d.ts",
|
|
15
|
-
"import": "./dist/index.js"
|
|
16
|
-
"require": "./dist/index.js"
|
|
21
|
+
"import": "./dist/index.js"
|
|
17
22
|
},
|
|
18
23
|
"./query-server": {
|
|
19
24
|
"types": "./dist/query-server.d.ts",
|
|
20
25
|
"import": "./dist/query-server.js"
|
|
26
|
+
},
|
|
27
|
+
"./auth-server": {
|
|
28
|
+
"types": "./dist/authServer.d.ts",
|
|
29
|
+
"import": "./dist/authServer.js"
|
|
30
|
+
},
|
|
31
|
+
"./client": {
|
|
32
|
+
"types": "./dist/client.d.ts",
|
|
33
|
+
"import": "./dist/client.js"
|
|
34
|
+
},
|
|
35
|
+
"./types": {
|
|
36
|
+
"types": "./dist/types.d.ts",
|
|
37
|
+
"import": "./dist/types.js"
|
|
21
38
|
}
|
|
22
39
|
},
|
|
23
40
|
"files": [
|
|
24
|
-
"dist"
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"keywords": [
|
|
45
|
+
"graphql",
|
|
46
|
+
"apollo",
|
|
47
|
+
"nextjs",
|
|
48
|
+
"multitenant",
|
|
49
|
+
"auth",
|
|
50
|
+
"jwt"
|
|
25
51
|
],
|
|
26
52
|
"peerDependencies": {
|
|
27
|
-
"@apollo/client": "
|
|
28
|
-
"graphql": "
|
|
29
|
-
"next": "
|
|
30
|
-
"react": "
|
|
31
|
-
|
|
32
|
-
|
|
53
|
+
"@apollo/client": ">=3.0.0",
|
|
54
|
+
"graphql": ">=16.0.0",
|
|
55
|
+
"next": ">=14.0.0",
|
|
56
|
+
"react": ">=18.0.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"next": {
|
|
60
|
+
"optional": true
|
|
61
|
+
},
|
|
62
|
+
"react": {
|
|
63
|
+
"optional": true
|
|
64
|
+
}
|
|
33
65
|
},
|
|
34
66
|
"dependencies": {
|
|
35
67
|
"js-cookie": "^3.0.0",
|
|
36
68
|
"jwt-decode": "^4.0.0"
|
|
37
69
|
},
|
|
38
70
|
"devDependencies": {
|
|
39
|
-
"@types/
|
|
40
|
-
"@types/
|
|
41
|
-
"@types/react
|
|
42
|
-
"
|
|
43
|
-
"typescript": "^6.0.2"
|
|
44
|
-
},
|
|
45
|
-
"scripts": {
|
|
46
|
-
"build": "tsc",
|
|
47
|
-
"dev": "tsc --watch"
|
|
71
|
+
"@types/js-cookie": "^3.0.0",
|
|
72
|
+
"@types/node": "^20.0.0",
|
|
73
|
+
"@types/react": "^19.0.0",
|
|
74
|
+
"typescript": "^5.0.0"
|
|
48
75
|
}
|
|
49
|
-
}
|
|
76
|
+
}
|