stellate 3.0.4 → 3.2.0
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/apollo-server.d.mts +14 -0
- package/dist/apollo-server.mjs +4 -8
- package/dist/bin.js +745 -733
- package/dist/envelop.d.mts +16 -0
- package/dist/envelop.mjs +2 -4
- package/dist/graphql-yoga.d.mts +14 -0
- package/dist/graphql-yoga.mjs +2 -4
- package/dist/index.d.mts +2094 -0
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/rate-limiting.d.mts +69 -0
- package/package.json +7 -6
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Plugin } from '@envelop/core';
|
|
2
|
+
|
|
3
|
+
interface Options {
|
|
4
|
+
serviceName: string;
|
|
5
|
+
token: string;
|
|
6
|
+
fetch: typeof fetch;
|
|
7
|
+
sendVariablesAsHash?: boolean;
|
|
8
|
+
schemaSyncing?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function createBlake3Hash(str: string): number;
|
|
11
|
+
|
|
12
|
+
declare const createStellateLoggerPlugin: (opts: Options) => Plugin<{
|
|
13
|
+
request: Request;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
export { createBlake3Hash, createStellateLoggerPlugin };
|
package/dist/envelop.mjs
CHANGED
|
@@ -112,8 +112,7 @@ var createStellateLoggerPlugin = (options) => {
|
|
|
112
112
|
if (shouldSyncSchema) {
|
|
113
113
|
const apiSchema = opts.schema;
|
|
114
114
|
const randomTimeout = Math.random() * 5e3;
|
|
115
|
-
if (timeout)
|
|
116
|
-
clearTimeout(timeout);
|
|
115
|
+
if (timeout) clearTimeout(timeout);
|
|
117
116
|
timeout = setTimeout(async () => {
|
|
118
117
|
timeout = null;
|
|
119
118
|
try {
|
|
@@ -153,8 +152,7 @@ var createStellateLoggerPlugin = (options) => {
|
|
|
153
152
|
headers
|
|
154
153
|
);
|
|
155
154
|
}
|
|
156
|
-
if (headers.has("gcdn-request-id"))
|
|
157
|
-
return;
|
|
155
|
+
if (headers.has("gcdn-request-id")) return;
|
|
158
156
|
const stellatePayload = extractStellatePayload({
|
|
159
157
|
headers,
|
|
160
158
|
operation: print(payload.args.document),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Plugin } from 'graphql-yoga';
|
|
2
|
+
|
|
3
|
+
interface Options {
|
|
4
|
+
serviceName: string;
|
|
5
|
+
token: string;
|
|
6
|
+
fetch: typeof fetch;
|
|
7
|
+
sendVariablesAsHash?: boolean;
|
|
8
|
+
schemaSyncing?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function createBlake3Hash(str: string): number;
|
|
11
|
+
|
|
12
|
+
declare const createStellateLoggerPlugin: (opts: Options) => Plugin;
|
|
13
|
+
|
|
14
|
+
export { createBlake3Hash, createStellateLoggerPlugin };
|
package/dist/graphql-yoga.mjs
CHANGED
|
@@ -98,8 +98,7 @@ var createStellateLoggerPlugin = (options) => {
|
|
|
98
98
|
if (shouldSyncSchema) {
|
|
99
99
|
const apiSchema = opts.schema;
|
|
100
100
|
const randomTimeout = Math.random() * 5e3;
|
|
101
|
-
if (timeout)
|
|
102
|
-
clearTimeout(timeout);
|
|
101
|
+
if (timeout) clearTimeout(timeout);
|
|
103
102
|
timeout = setTimeout(async () => {
|
|
104
103
|
timeout = null;
|
|
105
104
|
try {
|
|
@@ -134,8 +133,7 @@ var createStellateLoggerPlugin = (options) => {
|
|
|
134
133
|
return;
|
|
135
134
|
}
|
|
136
135
|
const { headers, method } = payload.args.contextValue.request;
|
|
137
|
-
if (headers.has("gcdn-request-id"))
|
|
138
|
-
return;
|
|
136
|
+
if (headers.has("gcdn-request-id")) return;
|
|
139
137
|
const graphqlClientName = headers.get("x-graphql-client-name") || void 0;
|
|
140
138
|
const graphqlClientVersion = headers.get("x-graphql-client-version") || void 0;
|
|
141
139
|
const stellatePayload = extractStellatePayload({
|