naystack 1.5.31 → 1.5.32
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.
|
@@ -742,10 +742,18 @@ async function initGraphQLServer({
|
|
|
742
742
|
return {
|
|
743
743
|
GET: withCors((request) => handler(request), allowedOrigins),
|
|
744
744
|
POST: withCors((request) => handler(request), allowedOrigins),
|
|
745
|
-
|
|
746
|
-
(
|
|
747
|
-
|
|
748
|
-
|
|
745
|
+
...allowedOrigins?.length ? {
|
|
746
|
+
OPTIONS: (req) => {
|
|
747
|
+
const corsHeaders = getCorsHeaders(
|
|
748
|
+
req.headers.get("origin"),
|
|
749
|
+
allowedOrigins
|
|
750
|
+
);
|
|
751
|
+
return new import_server4.NextResponse(null, {
|
|
752
|
+
status: 204,
|
|
753
|
+
headers: corsHeaders ?? void 0
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
} : {}
|
|
749
757
|
};
|
|
750
758
|
}
|
|
751
759
|
|
|
@@ -729,10 +729,18 @@ async function initGraphQLServer({
|
|
|
729
729
|
return {
|
|
730
730
|
GET: withCors((request) => handler(request), allowedOrigins),
|
|
731
731
|
POST: withCors((request) => handler(request), allowedOrigins),
|
|
732
|
-
|
|
733
|
-
(
|
|
734
|
-
|
|
735
|
-
|
|
732
|
+
...allowedOrigins?.length ? {
|
|
733
|
+
OPTIONS: (req) => {
|
|
734
|
+
const corsHeaders = getCorsHeaders(
|
|
735
|
+
req.headers.get("origin"),
|
|
736
|
+
allowedOrigins
|
|
737
|
+
);
|
|
738
|
+
return new NextResponse3(null, {
|
|
739
|
+
status: 204,
|
|
740
|
+
headers: corsHeaders ?? void 0
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
} : {}
|
|
736
744
|
};
|
|
737
745
|
}
|
|
738
746
|
|
package/dist/graphql/init.cjs.js
CHANGED
|
@@ -195,10 +195,18 @@ async function initGraphQLServer({
|
|
|
195
195
|
return {
|
|
196
196
|
GET: withCors((request) => handler(request), allowedOrigins),
|
|
197
197
|
POST: withCors((request) => handler(request), allowedOrigins),
|
|
198
|
-
|
|
199
|
-
(
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
...allowedOrigins?.length ? {
|
|
199
|
+
OPTIONS: (req) => {
|
|
200
|
+
const corsHeaders = getCorsHeaders(
|
|
201
|
+
req.headers.get("origin"),
|
|
202
|
+
allowedOrigins
|
|
203
|
+
);
|
|
204
|
+
return new import_server4.NextResponse(null, {
|
|
205
|
+
status: 204,
|
|
206
|
+
headers: corsHeaders ?? void 0
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
} : {}
|
|
202
210
|
};
|
|
203
211
|
}
|
|
204
212
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/graphql/init.d.mts
CHANGED
|
@@ -42,9 +42,9 @@ declare function initGraphQLServer({ authChecker, resolvers, plugins, getContext
|
|
|
42
42
|
getContext?: (req: NextRequest) => Promise<any> | any;
|
|
43
43
|
allowedOrigins?: string[];
|
|
44
44
|
}): Promise<{
|
|
45
|
+
OPTIONS?: ((req: NextRequest) => NextResponse<unknown>) | undefined;
|
|
45
46
|
GET: (request: NextRequest) => Promise<Response>;
|
|
46
47
|
POST: (request: NextRequest) => Promise<Response>;
|
|
47
|
-
OPTIONS: (_request: NextRequest) => Promise<NextResponse<unknown>>;
|
|
48
48
|
}>;
|
|
49
49
|
|
|
50
50
|
export { initGraphQLServer };
|
package/dist/graphql/init.d.ts
CHANGED
|
@@ -42,9 +42,9 @@ declare function initGraphQLServer({ authChecker, resolvers, plugins, getContext
|
|
|
42
42
|
getContext?: (req: NextRequest) => Promise<any> | any;
|
|
43
43
|
allowedOrigins?: string[];
|
|
44
44
|
}): Promise<{
|
|
45
|
+
OPTIONS?: ((req: NextRequest) => NextResponse<unknown>) | undefined;
|
|
45
46
|
GET: (request: NextRequest) => Promise<Response>;
|
|
46
47
|
POST: (request: NextRequest) => Promise<Response>;
|
|
47
|
-
OPTIONS: (_request: NextRequest) => Promise<NextResponse<unknown>>;
|
|
48
48
|
}>;
|
|
49
49
|
|
|
50
50
|
export { initGraphQLServer };
|
package/dist/graphql/init.esm.js
CHANGED
|
@@ -176,10 +176,18 @@ async function initGraphQLServer({
|
|
|
176
176
|
return {
|
|
177
177
|
GET: withCors((request) => handler(request), allowedOrigins),
|
|
178
178
|
POST: withCors((request) => handler(request), allowedOrigins),
|
|
179
|
-
|
|
180
|
-
(
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
...allowedOrigins?.length ? {
|
|
180
|
+
OPTIONS: (req) => {
|
|
181
|
+
const corsHeaders = getCorsHeaders(
|
|
182
|
+
req.headers.get("origin"),
|
|
183
|
+
allowedOrigins
|
|
184
|
+
);
|
|
185
|
+
return new NextResponse3(null, {
|
|
186
|
+
status: 204,
|
|
187
|
+
headers: corsHeaders ?? void 0
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
} : {}
|
|
183
191
|
};
|
|
184
192
|
}
|
|
185
193
|
export {
|