naystack 1.5.3 → 1.5.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.
@@ -733,24 +733,26 @@ var getUserId = async () => {
733
733
  return refresh ? getUserIdFromRefreshToken(refresh) : null;
734
734
  };
735
735
  function getAuthCaller(fn) {
736
- return async (data) => {
737
- "use server";
738
- const ctx = {
739
- userId: await getUserId(),
740
- isRefreshID: true
741
- };
742
- return await fn(ctx, data);
743
- };
736
+ return (0, import_react.cache)(
737
+ async (data) => {
738
+ const ctx = {
739
+ userId: await getUserId(),
740
+ isRefreshID: true
741
+ };
742
+ return await fn(ctx, data);
743
+ }
744
+ );
744
745
  }
745
746
  function getCaller(fn) {
746
- return async (data) => {
747
- "use server";
748
- const ctx = {
749
- userId: null,
750
- isRefreshID: true
751
- };
752
- return await fn(ctx, data);
753
- };
747
+ return (0, import_react.cache)(
748
+ async (data) => {
749
+ const ctx = {
750
+ userId: null,
751
+ isRefreshID: true
752
+ };
753
+ return await fn(ctx, data);
754
+ }
755
+ );
754
756
  }
755
757
  function getFieldAuthCaller(fn) {
756
758
  return (0, import_react.cache)(
@@ -729,24 +729,26 @@ var getUserId = async () => {
729
729
  return refresh ? getUserIdFromRefreshToken(refresh) : null;
730
730
  };
731
731
  function getAuthCaller(fn) {
732
- return async (data) => {
733
- "use server";
734
- const ctx = {
735
- userId: await getUserId(),
736
- isRefreshID: true
737
- };
738
- return await fn(ctx, data);
739
- };
732
+ return cache(
733
+ async (data) => {
734
+ const ctx = {
735
+ userId: await getUserId(),
736
+ isRefreshID: true
737
+ };
738
+ return await fn(ctx, data);
739
+ }
740
+ );
740
741
  }
741
742
  function getCaller(fn) {
742
- return async (data) => {
743
- "use server";
744
- const ctx = {
745
- userId: null,
746
- isRefreshID: true
747
- };
748
- return await fn(ctx, data);
749
- };
743
+ return cache(
744
+ async (data) => {
745
+ const ctx = {
746
+ userId: null,
747
+ isRefreshID: true
748
+ };
749
+ return await fn(ctx, data);
750
+ }
751
+ );
750
752
  }
751
753
  function getFieldAuthCaller(fn) {
752
754
  return cache(
@@ -126,24 +126,26 @@ var getUserId = async () => {
126
126
  return refresh ? getUserIdFromRefreshToken(refresh) : null;
127
127
  };
128
128
  function getAuthCaller(fn) {
129
- return async (data) => {
130
- "use server";
131
- const ctx = {
132
- userId: await getUserId(),
133
- isRefreshID: true
134
- };
135
- return await fn(ctx, data);
136
- };
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
+ );
137
138
  }
138
139
  function getCaller(fn) {
139
- return async (data) => {
140
- "use server";
141
- const ctx = {
142
- userId: null,
143
- isRefreshID: true
144
- };
145
- return await fn(ctx, data);
146
- };
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
+ );
147
149
  }
148
150
  function getFieldAuthCaller(fn) {
149
151
  return (0, import_react.cache)(
@@ -111,24 +111,26 @@ var getUserId = async () => {
111
111
  return refresh ? getUserIdFromRefreshToken(refresh) : null;
112
112
  };
113
113
  function getAuthCaller(fn) {
114
- return async (data) => {
115
- "use server";
116
- const ctx = {
117
- userId: await getUserId(),
118
- isRefreshID: true
119
- };
120
- return await fn(ctx, data);
121
- };
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
+ );
122
123
  }
123
124
  function getCaller(fn) {
124
- return async (data) => {
125
- "use server";
126
- const ctx = {
127
- userId: null,
128
- isRefreshID: true
129
- };
130
- return await fn(ctx, data);
131
- };
125
+ return cache(
126
+ async (data) => {
127
+ const ctx = {
128
+ userId: null,
129
+ isRefreshID: true
130
+ };
131
+ return await fn(ctx, data);
132
+ }
133
+ );
132
134
  }
133
135
  function getFieldAuthCaller(fn) {
134
136
  return cache(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.5.3",
3
+ "version": "1.5.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",