grafserv 0.0.1-0.2 → 0.0.1-0.21
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/CHANGELOG.md +220 -0
- package/README.md +248 -3
- package/dist/accept.d.ts +8 -0
- package/dist/accept.d.ts.map +1 -0
- package/dist/accept.js +419 -0
- package/dist/accept.js.map +1 -0
- package/dist/core/base.d.ts +38 -0
- package/dist/core/base.d.ts.map +1 -0
- package/dist/core/base.js +440 -0
- package/dist/core/base.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +176 -23
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js +2 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/mapIterator.d.ts +2 -0
- package/dist/mapIterator.d.ts.map +1 -0
- package/dist/mapIterator.js +65 -0
- package/dist/mapIterator.js.map +1 -0
- package/dist/middleware/graphiql.d.ts +3 -3
- package/dist/middleware/graphiql.d.ts.map +1 -1
- package/dist/middleware/graphiql.js +14 -4
- package/dist/middleware/graphiql.js.map +1 -1
- package/dist/middleware/graphql.d.ts +8 -3
- package/dist/middleware/graphql.d.ts.map +1 -1
- package/dist/middleware/graphql.js +325 -23
- package/dist/middleware/graphql.js.map +1 -1
- package/dist/options.d.ts +23 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +114 -0
- package/dist/options.js.map +1 -0
- package/dist/servers/express/v4/index.d.ts +24 -0
- package/dist/servers/express/v4/index.d.ts.map +1 -0
- package/dist/servers/express/v4/index.js +62 -0
- package/dist/servers/express/v4/index.js.map +1 -0
- package/dist/servers/fastify/v4/index.d.ts +21 -0
- package/dist/servers/fastify/v4/index.d.ts.map +1 -0
- package/dist/servers/fastify/v4/index.js +198 -0
- package/dist/servers/fastify/v4/index.js.map +1 -0
- package/dist/servers/koa/v2/index.d.ts +25 -0
- package/dist/servers/koa/v2/index.d.ts.map +1 -0
- package/dist/servers/koa/v2/index.js +137 -0
- package/dist/servers/koa/v2/index.js.map +1 -0
- package/dist/servers/node/index.d.ts +32 -0
- package/dist/servers/node/index.d.ts.map +1 -0
- package/dist/servers/node/index.js +269 -0
- package/dist/servers/node/index.js.map +1 -0
- package/dist/utils.d.ts +19 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +145 -0
- package/dist/utils.js.map +1 -0
- package/package.json +42 -8
- package/dist/middleware/index.d.ts +0 -12
- package/dist/middleware/index.d.ts.map +0 -1
- package/dist/middleware/index.js +0 -431
- package/dist/middleware/index.js.map +0 -1
- package/dist/middleware/interfaces.d.ts +0 -40
- package/dist/middleware/interfaces.d.ts.map +0 -1
- package/dist/middleware/interfaces.js +0 -3
- package/dist/middleware/interfaces.js.map +0 -1
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleError = exports.convertHandlerResultToResult = exports.GrafservBase = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const eventemitter3_1 = tslib_1.__importDefault(require("eventemitter3"));
|
|
6
|
+
const grafast_1 = require("grafast");
|
|
7
|
+
const graphile_config_1 = require("graphile-config");
|
|
8
|
+
const graphql_1 = require("graphql");
|
|
9
|
+
const mapIterator_js_1 = require("../mapIterator.js");
|
|
10
|
+
const graphiql_js_1 = require("../middleware/graphiql.js");
|
|
11
|
+
const graphql_js_1 = require("../middleware/graphql.js");
|
|
12
|
+
const options_js_1 = require("../options.js");
|
|
13
|
+
const utils_js_1 = require("../utils.js");
|
|
14
|
+
function handleGraphQLHandlerError(request, dynamicOptions, e) {
|
|
15
|
+
if (e.safeMessage && e.statusCode) {
|
|
16
|
+
return {
|
|
17
|
+
type: "graphql",
|
|
18
|
+
request,
|
|
19
|
+
dynamicOptions,
|
|
20
|
+
payload: {
|
|
21
|
+
errors: [new graphql_1.GraphQLError(e.message, null, null, null, null, e)],
|
|
22
|
+
},
|
|
23
|
+
statusCode: e.statusCode,
|
|
24
|
+
// TODO: we should respect the `accept` header here if we can.
|
|
25
|
+
contentType: graphql_js_1.APPLICATION_JSON,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
// TODO: if a GraphQLError is thrown... WTF?
|
|
29
|
+
const graphqlError = e instanceof graphql_1.GraphQLError
|
|
30
|
+
? e
|
|
31
|
+
: new graphql_1.GraphQLError("Unknown error occurred", null, null, null, null, e);
|
|
32
|
+
// Special error handling for GraphQL route
|
|
33
|
+
console.error("An error occurred whilst attempting to handle the GraphQL request:");
|
|
34
|
+
console.dir(e);
|
|
35
|
+
return {
|
|
36
|
+
type: "graphql",
|
|
37
|
+
request,
|
|
38
|
+
dynamicOptions,
|
|
39
|
+
payload: { errors: [graphqlError] },
|
|
40
|
+
statusCode: 500,
|
|
41
|
+
// Fall back to application/json; this is when an unexpected error happens
|
|
42
|
+
// so it shouldn't be hit.
|
|
43
|
+
contentType: graphql_js_1.APPLICATION_JSON,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
class GrafservBase {
|
|
47
|
+
releaseHandlers = [];
|
|
48
|
+
releasing = false;
|
|
49
|
+
/** @internal */
|
|
50
|
+
dynamicOptions;
|
|
51
|
+
resolvedPreset;
|
|
52
|
+
schema;
|
|
53
|
+
schemaError;
|
|
54
|
+
eventEmitter;
|
|
55
|
+
initialized = false;
|
|
56
|
+
graphqlHandler;
|
|
57
|
+
graphiqlHandler;
|
|
58
|
+
constructor(config) {
|
|
59
|
+
this.eventEmitter = new eventemitter3_1.default();
|
|
60
|
+
this.setPreset(config.preset ?? Object.create(null));
|
|
61
|
+
this.schemaError = null;
|
|
62
|
+
this.schema = config.schema;
|
|
63
|
+
if ((0, grafast_1.isPromiseLike)(config.schema)) {
|
|
64
|
+
const promise = config.schema;
|
|
65
|
+
promise.then((schema) => {
|
|
66
|
+
this.setSchema(schema);
|
|
67
|
+
}, (error) => {
|
|
68
|
+
this.schemaError = promise;
|
|
69
|
+
this.schema = null;
|
|
70
|
+
this.eventEmitter.emit("schema:error", error);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this.eventEmitter.emit("schema:ready", config.schema);
|
|
75
|
+
}
|
|
76
|
+
this.initialized = true;
|
|
77
|
+
this.refreshHandlers();
|
|
78
|
+
}
|
|
79
|
+
_processRequest(inRequest) {
|
|
80
|
+
const request = (0, utils_js_1.normalizeRequest)(inRequest);
|
|
81
|
+
const dynamicOptions = this.dynamicOptions;
|
|
82
|
+
const forceCORS = !!this.resolvedPreset.grafserv?.dangerouslyAllowAllCORSRequests &&
|
|
83
|
+
request.method === "OPTIONS";
|
|
84
|
+
try {
|
|
85
|
+
if (request.path === dynamicOptions.graphqlPath) {
|
|
86
|
+
if (forceCORS)
|
|
87
|
+
return optionsResponse(request, this.dynamicOptions);
|
|
88
|
+
return this.graphqlHandler(request, this.graphiqlHandler).catch((e) => handleGraphQLHandlerError(request, dynamicOptions, e));
|
|
89
|
+
}
|
|
90
|
+
if (dynamicOptions.graphiql &&
|
|
91
|
+
request.method === "GET" &&
|
|
92
|
+
request.path === dynamicOptions.graphiqlPath) {
|
|
93
|
+
if (forceCORS)
|
|
94
|
+
return optionsResponse(request, this.dynamicOptions);
|
|
95
|
+
return this.graphiqlHandler(request);
|
|
96
|
+
}
|
|
97
|
+
if (dynamicOptions.watch &&
|
|
98
|
+
request.method === "GET" &&
|
|
99
|
+
request.path === dynamicOptions.eventStreamRoute) {
|
|
100
|
+
if (forceCORS)
|
|
101
|
+
return optionsResponse(request, this.dynamicOptions);
|
|
102
|
+
const stream = this.makeStream();
|
|
103
|
+
return {
|
|
104
|
+
type: "event-stream",
|
|
105
|
+
request,
|
|
106
|
+
dynamicOptions,
|
|
107
|
+
payload: stream,
|
|
108
|
+
statusCode: 200,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
// Unhandled
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
console.error("Unexpected error occurred in _processRequest", e);
|
|
116
|
+
return {
|
|
117
|
+
type: "html",
|
|
118
|
+
request,
|
|
119
|
+
dynamicOptions,
|
|
120
|
+
status: 500,
|
|
121
|
+
payload: Buffer.from("ERROR", "utf8"),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
processRequest(request) {
|
|
126
|
+
let returnValue;
|
|
127
|
+
try {
|
|
128
|
+
const result = this._processRequest(request);
|
|
129
|
+
if ((0, grafast_1.isPromiseLike)(result)) {
|
|
130
|
+
returnValue = result.then(convertHandlerResultToResult, exports.handleError);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
returnValue = convertHandlerResultToResult(result);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch (e) {
|
|
137
|
+
returnValue = (0, exports.handleError)(e);
|
|
138
|
+
}
|
|
139
|
+
if (this.resolvedPreset.grafserv?.dangerouslyAllowAllCORSRequests) {
|
|
140
|
+
if ((0, grafast_1.isPromiseLike)(returnValue)) {
|
|
141
|
+
return returnValue.then(dangerousCorsWrap);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
return dangerousCorsWrap(returnValue);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
return returnValue;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
getPreset() {
|
|
152
|
+
return this.resolvedPreset;
|
|
153
|
+
}
|
|
154
|
+
getSchema() {
|
|
155
|
+
return this.schema ?? this.schemaError;
|
|
156
|
+
}
|
|
157
|
+
async release() {
|
|
158
|
+
if (this.releasing) {
|
|
159
|
+
throw new Error("Release has already been called");
|
|
160
|
+
}
|
|
161
|
+
this.releasing = true;
|
|
162
|
+
for (let i = this.releaseHandlers.length - 1; i >= 0; i--) {
|
|
163
|
+
const handler = this.releaseHandlers[i];
|
|
164
|
+
try {
|
|
165
|
+
await handler();
|
|
166
|
+
}
|
|
167
|
+
catch (e) {
|
|
168
|
+
/* nom nom nom */
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
onRelease(cb) {
|
|
173
|
+
if (this.releasing) {
|
|
174
|
+
throw new Error("Release has already been called; cannot add more onRelease callbacks");
|
|
175
|
+
}
|
|
176
|
+
this.releaseHandlers.push(cb);
|
|
177
|
+
}
|
|
178
|
+
setPreset(newPreset) {
|
|
179
|
+
this.resolvedPreset = (0, graphile_config_1.resolvePresets)([newPreset]);
|
|
180
|
+
const newOptions = (0, options_js_1.optionsFromConfig)(this.resolvedPreset);
|
|
181
|
+
if (this.dynamicOptions !== newOptions) {
|
|
182
|
+
this.dynamicOptions = newOptions;
|
|
183
|
+
this.refreshHandlers();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
setSchema(newSchema) {
|
|
187
|
+
if (!newSchema) {
|
|
188
|
+
throw new Error(`setSchema must be called with a GraphQL schema`);
|
|
189
|
+
}
|
|
190
|
+
if (!(0, graphql_1.isSchema)(newSchema)) {
|
|
191
|
+
throw new Error(`setParams called with invalid schema (is there more than one 'graphql' module loaded?)`);
|
|
192
|
+
}
|
|
193
|
+
const errors = (0, graphql_1.validateSchema)(newSchema);
|
|
194
|
+
if (errors.length > 0) {
|
|
195
|
+
throw new Error(`setParams called with invalid schema; first error: ${errors[0]}`);
|
|
196
|
+
}
|
|
197
|
+
if (this.schema !== newSchema) {
|
|
198
|
+
this.schemaError = null;
|
|
199
|
+
this.schema = newSchema;
|
|
200
|
+
this.eventEmitter.emit("schema:ready", newSchema);
|
|
201
|
+
this.refreshHandlers();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
refreshHandlers() {
|
|
205
|
+
if (!this.initialized) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
// TODO: this.graphqlHandler?.release()?
|
|
209
|
+
this.graphqlHandler = (0, graphql_js_1.makeGraphQLHandler)(this.resolvedPreset, this.dynamicOptions, this.schema);
|
|
210
|
+
this.graphiqlHandler = (0, graphiql_js_1.makeGraphiQLHandler)(this.resolvedPreset, this.dynamicOptions);
|
|
211
|
+
}
|
|
212
|
+
// TODO: Rename this, or make it a middleware, or something
|
|
213
|
+
makeStream() {
|
|
214
|
+
const queue = [];
|
|
215
|
+
let finished = false;
|
|
216
|
+
const bump = () => {
|
|
217
|
+
const next = queue.shift();
|
|
218
|
+
if (next) {
|
|
219
|
+
next.resolve({
|
|
220
|
+
done: false,
|
|
221
|
+
value: { event: "change", data: "schema" },
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
const flushQueue = (e) => {
|
|
226
|
+
const entries = queue.splice(0, queue.length);
|
|
227
|
+
for (const entry of entries) {
|
|
228
|
+
if (e) {
|
|
229
|
+
entry.reject(e);
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
entry.resolve({ done: true });
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
this.eventEmitter.on("schema:ready", bump);
|
|
237
|
+
return {
|
|
238
|
+
[Symbol.asyncIterator]() {
|
|
239
|
+
return this;
|
|
240
|
+
},
|
|
241
|
+
next() {
|
|
242
|
+
if (finished) {
|
|
243
|
+
return Promise.resolve({
|
|
244
|
+
done: true,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
return new Promise((resolve, reject) => {
|
|
248
|
+
queue.push({ resolve, reject });
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
|
+
return() {
|
|
252
|
+
finished = true;
|
|
253
|
+
if (queue.length) {
|
|
254
|
+
flushQueue();
|
|
255
|
+
}
|
|
256
|
+
return Promise.resolve({
|
|
257
|
+
done: true,
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
throw(e) {
|
|
261
|
+
if (queue.length) {
|
|
262
|
+
flushQueue(e);
|
|
263
|
+
}
|
|
264
|
+
return Promise.reject(e);
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
exports.GrafservBase = GrafservBase;
|
|
270
|
+
const END = Buffer.from("\r\n-----\r\n", "utf8");
|
|
271
|
+
const DIVIDE = Buffer.from(`\r\n---\r\nContent-Type: application/json\r\n\r\n`, "utf8");
|
|
272
|
+
function convertHandlerResultToResult(handlerResult) {
|
|
273
|
+
if (handlerResult === null) {
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
switch (handlerResult.type) {
|
|
277
|
+
case "graphql": {
|
|
278
|
+
const { payload, statusCode = 200, contentType, outputDataAsString, dynamicOptions, request: { preferJSON }, } = handlerResult;
|
|
279
|
+
(0, utils_js_1.handleErrors)(payload);
|
|
280
|
+
const headers = Object.create(null);
|
|
281
|
+
headers["Content-Type"] = contentType;
|
|
282
|
+
if (dynamicOptions.watch) {
|
|
283
|
+
headers["X-GraphQL-Event-Stream"] = dynamicOptions.eventStreamRoute;
|
|
284
|
+
}
|
|
285
|
+
if (preferJSON && !outputDataAsString) {
|
|
286
|
+
return {
|
|
287
|
+
type: "json",
|
|
288
|
+
statusCode,
|
|
289
|
+
headers,
|
|
290
|
+
json: payload,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
const buffer = Buffer.from((0, grafast_1.stringifyPayload)(payload, outputDataAsString), "utf8");
|
|
295
|
+
headers["Content-Length"] = buffer.length;
|
|
296
|
+
return {
|
|
297
|
+
type: "buffer",
|
|
298
|
+
statusCode,
|
|
299
|
+
headers,
|
|
300
|
+
buffer,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
case "graphqlIncremental": {
|
|
305
|
+
const { iterator, statusCode = 200, outputDataAsString, dynamicOptions, } = handlerResult;
|
|
306
|
+
const headers = Object.create(null);
|
|
307
|
+
(headers["Content-Type"] = 'multipart/mixed; boundary="-"'),
|
|
308
|
+
(headers["Transfer-Encoding"] = "chunked");
|
|
309
|
+
if (dynamicOptions.watch) {
|
|
310
|
+
headers["X-GraphQL-Event-Stream"] = dynamicOptions.eventStreamRoute;
|
|
311
|
+
}
|
|
312
|
+
const bufferIterator = (0, mapIterator_js_1.mapIterator)(iterator, (payload) => {
|
|
313
|
+
(0, utils_js_1.handleErrors)(payload);
|
|
314
|
+
const payloadBuffer = Buffer.from((0, grafast_1.stringifyPayload)(payload, outputDataAsString), "utf8");
|
|
315
|
+
return Buffer.concat([DIVIDE, payloadBuffer]);
|
|
316
|
+
}, () => {
|
|
317
|
+
return END;
|
|
318
|
+
});
|
|
319
|
+
return {
|
|
320
|
+
type: "bufferStream",
|
|
321
|
+
headers,
|
|
322
|
+
statusCode,
|
|
323
|
+
lowLatency: true,
|
|
324
|
+
bufferIterator,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
case "text":
|
|
328
|
+
case "html": {
|
|
329
|
+
const { payload, statusCode = 200 } = handlerResult;
|
|
330
|
+
const headers = Object.create(null);
|
|
331
|
+
if (handlerResult.type === "html") {
|
|
332
|
+
headers["Content-Type"] = "text/html; charset=utf-8";
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
headers["Content-Type"] = "text/plain; charset=utf-8";
|
|
336
|
+
}
|
|
337
|
+
headers["Content-Length"] = payload.length;
|
|
338
|
+
return {
|
|
339
|
+
type: "buffer",
|
|
340
|
+
statusCode,
|
|
341
|
+
headers,
|
|
342
|
+
buffer: payload,
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
case "noContent": {
|
|
346
|
+
const { statusCode = 204 } = handlerResult;
|
|
347
|
+
const headers = Object.create(null);
|
|
348
|
+
return {
|
|
349
|
+
type: "noContent",
|
|
350
|
+
statusCode,
|
|
351
|
+
headers,
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
case "event-stream": {
|
|
355
|
+
const { payload: stream, statusCode = 200, request: { httpVersionMajor }, } = handlerResult;
|
|
356
|
+
// Making sure these options are set.
|
|
357
|
+
// Set headers for Server-Sent Events.
|
|
358
|
+
const headers = Object.create(null);
|
|
359
|
+
// Don't buffer EventStream in nginx
|
|
360
|
+
headers["X-Accel-Buffering"] = "no";
|
|
361
|
+
headers["Content-Type"] = "text/event-stream";
|
|
362
|
+
headers["Cache-Control"] = "no-cache, no-transform";
|
|
363
|
+
if (httpVersionMajor >= 2) {
|
|
364
|
+
// NOOP
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
headers["Connection"] = "keep-alive";
|
|
368
|
+
}
|
|
369
|
+
// Creates a stream for the response
|
|
370
|
+
const event2buffer = (event) => {
|
|
371
|
+
let payload = "";
|
|
372
|
+
if (event.event) {
|
|
373
|
+
payload += `event: ${event.event}\n`;
|
|
374
|
+
}
|
|
375
|
+
if (event.id) {
|
|
376
|
+
payload += `id: ${event.id}\n`;
|
|
377
|
+
}
|
|
378
|
+
if (event.retry) {
|
|
379
|
+
payload += `retry: ${event.retry}\n`;
|
|
380
|
+
}
|
|
381
|
+
if (event.data != null) {
|
|
382
|
+
payload += `data: ${event.data.replace(/\n/g, "\ndata: ")}\n`;
|
|
383
|
+
}
|
|
384
|
+
payload += "\n";
|
|
385
|
+
return Buffer.from(payload, "utf8");
|
|
386
|
+
};
|
|
387
|
+
const bufferIterator = (0, mapIterator_js_1.mapIterator)(stream, event2buffer, undefined, () => event2buffer({ event: "open" }));
|
|
388
|
+
return {
|
|
389
|
+
type: "bufferStream",
|
|
390
|
+
statusCode,
|
|
391
|
+
headers,
|
|
392
|
+
lowLatency: true,
|
|
393
|
+
bufferIterator,
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
default: {
|
|
397
|
+
const never = handlerResult;
|
|
398
|
+
console.error(`Did not understand '${never}' passed to convertHandlerResultToResult`);
|
|
399
|
+
const payload = Buffer.from("Unexpected input to convertHandlerResultToResult", "utf8");
|
|
400
|
+
const headers = Object.create(null);
|
|
401
|
+
headers["Content-Type"] = "text/plain; charset=utf-8";
|
|
402
|
+
headers["Content-Length"] = payload.length;
|
|
403
|
+
return {
|
|
404
|
+
type: "buffer",
|
|
405
|
+
statusCode: 500,
|
|
406
|
+
headers,
|
|
407
|
+
buffer: payload,
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
exports.convertHandlerResultToResult = convertHandlerResultToResult;
|
|
413
|
+
const handleError = (error) => {
|
|
414
|
+
// TODO: need to assert `error` is not a GraphQLError, that should be handled elsewhere.
|
|
415
|
+
const statusCode = error.statusCode ?? 500;
|
|
416
|
+
return {
|
|
417
|
+
type: "error",
|
|
418
|
+
statusCode,
|
|
419
|
+
headers: Object.create(null),
|
|
420
|
+
error,
|
|
421
|
+
};
|
|
422
|
+
};
|
|
423
|
+
exports.handleError = handleError;
|
|
424
|
+
function dangerousCorsWrap(result) {
|
|
425
|
+
if (result === null) {
|
|
426
|
+
return result;
|
|
427
|
+
}
|
|
428
|
+
result.headers["Access-Control-Allow-Origin"] = "*";
|
|
429
|
+
result.headers["Access-Control-Allow-Headers"] = "*";
|
|
430
|
+
return result;
|
|
431
|
+
}
|
|
432
|
+
function optionsResponse(request, dynamicOptions) {
|
|
433
|
+
return {
|
|
434
|
+
type: "noContent",
|
|
435
|
+
request,
|
|
436
|
+
dynamicOptions: dynamicOptions,
|
|
437
|
+
statusCode: 204,
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/core/base.ts"],"names":[],"mappings":";;;;AAAA,0EAAyC;AAEzC,qCAA0D;AAC1D,qDAAiD;AAEjD,qCAAiE;AAejE,sDAAgD;AAChD,2DAAgE;AAChE,yDAAgF;AAEhF,8CAAkD;AAClD,0CAA6D;AAE7D,SAAS,yBAAyB,CAChC,OAAgC,EAChC,cAAiC,EACjC,CAAyD;IAEzD,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,UAAU,EAAE;QACjC,OAAO;YACL,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ACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { GrafservBase } from "./core/base.js";
|
|
2
|
+
export { GrafservConfig } from "./interfaces.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "
|
|
3
|
+
exports.GrafservBase = void 0;
|
|
4
|
+
var base_js_1 = require("./core/base.js");
|
|
5
|
+
Object.defineProperty(exports, "GrafservBase", { enumerable: true, get: function () { return base_js_1.GrafservBase; } });
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,0CAA8C;AAArC,uGAAA,YAAY,OAAA"}
|