naystack 1.5.3 → 1.5.5

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,28 @@ 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
+ "use server";
739
+ const ctx = {
740
+ userId: await getUserId(),
741
+ isRefreshID: true
742
+ };
743
+ return await fn(ctx, data);
744
+ }
745
+ );
744
746
  }
745
747
  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
- };
748
+ return (0, import_react.cache)(
749
+ async (data) => {
750
+ "use server";
751
+ const ctx = {
752
+ userId: null,
753
+ isRefreshID: true
754
+ };
755
+ return await fn(ctx, data);
756
+ }
757
+ );
754
758
  }
755
759
  function getFieldAuthCaller(fn) {
756
760
  return (0, import_react.cache)(
@@ -729,24 +729,28 @@ 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
+ "use server";
735
+ const ctx = {
736
+ userId: await getUserId(),
737
+ isRefreshID: true
738
+ };
739
+ return await fn(ctx, data);
740
+ }
741
+ );
740
742
  }
741
743
  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
- };
744
+ return cache(
745
+ async (data) => {
746
+ "use server";
747
+ const ctx = {
748
+ userId: null,
749
+ isRefreshID: true
750
+ };
751
+ return await fn(ctx, data);
752
+ }
753
+ );
750
754
  }
751
755
  function getFieldAuthCaller(fn) {
752
756
  return cache(
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "server-only";
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -126,24 +127,28 @@ var getUserId = async () => {
126
127
  return refresh ? getUserIdFromRefreshToken(refresh) : null;
127
128
  };
128
129
  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
- };
130
+ return (0, import_react.cache)(
131
+ async (data) => {
132
+ "use server";
133
+ const ctx = {
134
+ userId: await getUserId(),
135
+ isRefreshID: true
136
+ };
137
+ return await fn(ctx, data);
138
+ }
139
+ );
137
140
  }
138
141
  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
- };
142
+ return (0, import_react.cache)(
143
+ async (data) => {
144
+ "use server";
145
+ const ctx = {
146
+ userId: null,
147
+ isRefreshID: true
148
+ };
149
+ return await fn(ctx, data);
150
+ }
151
+ );
147
152
  }
148
153
  function getFieldAuthCaller(fn) {
149
154
  return (0, import_react.cache)(
@@ -1,3 +1,4 @@
1
+ "server-only";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __decorateClass = (decorators, target, key, kind) => {
@@ -111,24 +112,28 @@ var getUserId = async () => {
111
112
  return refresh ? getUserIdFromRefreshToken(refresh) : null;
112
113
  };
113
114
  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
- };
115
+ return cache(
116
+ async (data) => {
117
+ "use server";
118
+ const ctx = {
119
+ userId: await getUserId(),
120
+ isRefreshID: true
121
+ };
122
+ return await fn(ctx, data);
123
+ }
124
+ );
122
125
  }
123
126
  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
- };
127
+ return cache(
128
+ async (data) => {
129
+ "use server";
130
+ const ctx = {
131
+ userId: null,
132
+ isRefreshID: true
133
+ };
134
+ return await fn(ctx, data);
135
+ }
136
+ );
132
137
  }
133
138
  function getFieldAuthCaller(fn) {
134
139
  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.5",
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",