naystack 1.4.28 → 1.4.29
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/graphql/index.cjs.js +37 -28
- package/dist/graphql/index.esm.js +37 -28
- package/dist/graphql/utils.cjs.js +37 -28
- package/dist/graphql/utils.esm.js +37 -28
- package/package.json +1 -1
|
@@ -664,6 +664,7 @@ async function initGraphQLServer({
|
|
|
664
664
|
|
|
665
665
|
// src/graphql/utils.ts
|
|
666
666
|
var import_headers2 = require("next/headers");
|
|
667
|
+
var import_react = require("react");
|
|
667
668
|
var import_type_graphql2 = require("type-graphql");
|
|
668
669
|
|
|
669
670
|
// src/auth/constants.ts
|
|
@@ -703,40 +704,48 @@ var getUserId = async () => {
|
|
|
703
704
|
return refresh ? getUserIdFromRefreshToken(refresh) : null;
|
|
704
705
|
};
|
|
705
706
|
function getAuthCaller(fn) {
|
|
706
|
-
return
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
707
|
+
return (0, import_react.cache)(
|
|
708
|
+
async (data) => {
|
|
709
|
+
const ctx = {
|
|
710
|
+
userId: await getUserId(),
|
|
711
|
+
isRefreshID: true
|
|
712
|
+
};
|
|
713
|
+
return await fn(ctx, data);
|
|
714
|
+
}
|
|
715
|
+
);
|
|
713
716
|
}
|
|
714
717
|
function getCaller(fn) {
|
|
715
|
-
return
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
718
|
+
return (0, import_react.cache)(
|
|
719
|
+
async (data) => {
|
|
720
|
+
const ctx = {
|
|
721
|
+
userId: null,
|
|
722
|
+
isRefreshID: true
|
|
723
|
+
};
|
|
724
|
+
return await fn(ctx, data);
|
|
725
|
+
}
|
|
726
|
+
);
|
|
722
727
|
}
|
|
723
728
|
function getFieldAuthCaller(fn) {
|
|
724
|
-
return
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
729
|
+
return (0, import_react.cache)(
|
|
730
|
+
async (root, data) => {
|
|
731
|
+
const ctx = {
|
|
732
|
+
userId: await getUserId(),
|
|
733
|
+
isRefreshID: true
|
|
734
|
+
};
|
|
735
|
+
return await fn(root, ctx, data);
|
|
736
|
+
}
|
|
737
|
+
);
|
|
731
738
|
}
|
|
732
739
|
function getFieldCaller(fn) {
|
|
733
|
-
return
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
+
return (0, import_react.cache)(
|
|
741
|
+
async (root, data) => {
|
|
742
|
+
const ctx = {
|
|
743
|
+
userId: null,
|
|
744
|
+
isRefreshID: true
|
|
745
|
+
};
|
|
746
|
+
return await fn(root, ctx, data);
|
|
747
|
+
}
|
|
748
|
+
);
|
|
740
749
|
}
|
|
741
750
|
function field(fn, options) {
|
|
742
751
|
return {
|
|
@@ -651,6 +651,7 @@ async function initGraphQLServer({
|
|
|
651
651
|
|
|
652
652
|
// src/graphql/utils.ts
|
|
653
653
|
import { cookies as cookies2 } from "next/headers";
|
|
654
|
+
import { cache } from "react";
|
|
654
655
|
import {
|
|
655
656
|
Arg,
|
|
656
657
|
Authorized,
|
|
@@ -699,40 +700,48 @@ var getUserId = async () => {
|
|
|
699
700
|
return refresh ? getUserIdFromRefreshToken(refresh) : null;
|
|
700
701
|
};
|
|
701
702
|
function getAuthCaller(fn) {
|
|
702
|
-
return
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
703
|
+
return cache(
|
|
704
|
+
async (data) => {
|
|
705
|
+
const ctx = {
|
|
706
|
+
userId: await getUserId(),
|
|
707
|
+
isRefreshID: true
|
|
708
|
+
};
|
|
709
|
+
return await fn(ctx, data);
|
|
710
|
+
}
|
|
711
|
+
);
|
|
709
712
|
}
|
|
710
713
|
function getCaller(fn) {
|
|
711
|
-
return
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
714
|
+
return cache(
|
|
715
|
+
async (data) => {
|
|
716
|
+
const ctx = {
|
|
717
|
+
userId: null,
|
|
718
|
+
isRefreshID: true
|
|
719
|
+
};
|
|
720
|
+
return await fn(ctx, data);
|
|
721
|
+
}
|
|
722
|
+
);
|
|
718
723
|
}
|
|
719
724
|
function getFieldAuthCaller(fn) {
|
|
720
|
-
return
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
725
|
+
return cache(
|
|
726
|
+
async (root, data) => {
|
|
727
|
+
const ctx = {
|
|
728
|
+
userId: await getUserId(),
|
|
729
|
+
isRefreshID: true
|
|
730
|
+
};
|
|
731
|
+
return await fn(root, ctx, data);
|
|
732
|
+
}
|
|
733
|
+
);
|
|
727
734
|
}
|
|
728
735
|
function getFieldCaller(fn) {
|
|
729
|
-
return
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
+
return cache(
|
|
737
|
+
async (root, data) => {
|
|
738
|
+
const ctx = {
|
|
739
|
+
userId: null,
|
|
740
|
+
isRefreshID: true
|
|
741
|
+
};
|
|
742
|
+
return await fn(root, ctx, data);
|
|
743
|
+
}
|
|
744
|
+
);
|
|
736
745
|
}
|
|
737
746
|
function field(fn, options) {
|
|
738
747
|
return {
|
|
@@ -35,6 +35,7 @@ __export(utils_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(utils_exports);
|
|
37
37
|
var import_headers2 = require("next/headers");
|
|
38
|
+
var import_react = require("react");
|
|
38
39
|
var import_type_graphql = require("type-graphql");
|
|
39
40
|
|
|
40
41
|
// src/auth/constants.ts
|
|
@@ -125,40 +126,48 @@ var getUserId = async () => {
|
|
|
125
126
|
return refresh ? getUserIdFromRefreshToken(refresh) : null;
|
|
126
127
|
};
|
|
127
128
|
function getAuthCaller(fn) {
|
|
128
|
-
return
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
return (0, import_react.cache)(
|
|
130
|
+
async (data) => {
|
|
131
|
+
const ctx = {
|
|
132
|
+
userId: await getUserId(),
|
|
133
|
+
isRefreshID: true
|
|
134
|
+
};
|
|
135
|
+
return await fn(ctx, data);
|
|
136
|
+
}
|
|
137
|
+
);
|
|
135
138
|
}
|
|
136
139
|
function getCaller(fn) {
|
|
137
|
-
return
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
return (0, import_react.cache)(
|
|
141
|
+
async (data) => {
|
|
142
|
+
const ctx = {
|
|
143
|
+
userId: null,
|
|
144
|
+
isRefreshID: true
|
|
145
|
+
};
|
|
146
|
+
return await fn(ctx, data);
|
|
147
|
+
}
|
|
148
|
+
);
|
|
144
149
|
}
|
|
145
150
|
function getFieldAuthCaller(fn) {
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
return (0, import_react.cache)(
|
|
152
|
+
async (root, data) => {
|
|
153
|
+
const ctx = {
|
|
154
|
+
userId: await getUserId(),
|
|
155
|
+
isRefreshID: true
|
|
156
|
+
};
|
|
157
|
+
return await fn(root, ctx, data);
|
|
158
|
+
}
|
|
159
|
+
);
|
|
153
160
|
}
|
|
154
161
|
function getFieldCaller(fn) {
|
|
155
|
-
return
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
+
return (0, import_react.cache)(
|
|
163
|
+
async (root, data) => {
|
|
164
|
+
const ctx = {
|
|
165
|
+
userId: null,
|
|
166
|
+
isRefreshID: true
|
|
167
|
+
};
|
|
168
|
+
return await fn(root, ctx, data);
|
|
169
|
+
}
|
|
170
|
+
);
|
|
162
171
|
}
|
|
163
172
|
function field(fn, options) {
|
|
164
173
|
return {
|
|
@@ -11,6 +11,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
11
11
|
|
|
12
12
|
// src/graphql/utils.ts
|
|
13
13
|
import { cookies as cookies2 } from "next/headers";
|
|
14
|
+
import { cache } from "react";
|
|
14
15
|
import {
|
|
15
16
|
Arg,
|
|
16
17
|
Authorized,
|
|
@@ -110,40 +111,48 @@ var getUserId = async () => {
|
|
|
110
111
|
return refresh ? getUserIdFromRefreshToken(refresh) : null;
|
|
111
112
|
};
|
|
112
113
|
function getAuthCaller(fn) {
|
|
113
|
-
return
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
return cache(
|
|
115
|
+
async (data) => {
|
|
116
|
+
const ctx = {
|
|
117
|
+
userId: await getUserId(),
|
|
118
|
+
isRefreshID: true
|
|
119
|
+
};
|
|
120
|
+
return await fn(ctx, data);
|
|
121
|
+
}
|
|
122
|
+
);
|
|
120
123
|
}
|
|
121
124
|
function getCaller(fn) {
|
|
122
|
-
return
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
return cache(
|
|
126
|
+
async (data) => {
|
|
127
|
+
const ctx = {
|
|
128
|
+
userId: null,
|
|
129
|
+
isRefreshID: true
|
|
130
|
+
};
|
|
131
|
+
return await fn(ctx, data);
|
|
132
|
+
}
|
|
133
|
+
);
|
|
129
134
|
}
|
|
130
135
|
function getFieldAuthCaller(fn) {
|
|
131
|
-
return
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
return cache(
|
|
137
|
+
async (root, data) => {
|
|
138
|
+
const ctx = {
|
|
139
|
+
userId: await getUserId(),
|
|
140
|
+
isRefreshID: true
|
|
141
|
+
};
|
|
142
|
+
return await fn(root, ctx, data);
|
|
143
|
+
}
|
|
144
|
+
);
|
|
138
145
|
}
|
|
139
146
|
function getFieldCaller(fn) {
|
|
140
|
-
return
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
return cache(
|
|
148
|
+
async (root, data) => {
|
|
149
|
+
const ctx = {
|
|
150
|
+
userId: null,
|
|
151
|
+
isRefreshID: true
|
|
152
|
+
};
|
|
153
|
+
return await fn(root, ctx, data);
|
|
154
|
+
}
|
|
155
|
+
);
|
|
147
156
|
}
|
|
148
157
|
function field(fn, options) {
|
|
149
158
|
return {
|