postgraphile 4.13.0 → 5.0.0-0.10
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 +118 -0
- package/LICENSE.md +15 -20
- package/README.md +15 -170
- package/dist/cli-run.d.ts +3 -0
- package/dist/cli-run.d.ts.map +1 -0
- package/dist/cli-run.js +7 -0
- package/dist/cli-run.js.map +1 -0
- package/dist/cli.d.ts +21 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +199 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/PgV4BehaviorPlugin.d.ts +11 -0
- package/dist/plugins/PgV4BehaviorPlugin.d.ts.map +1 -0
- package/dist/plugins/PgV4BehaviorPlugin.js +73 -0
- package/dist/plugins/PgV4BehaviorPlugin.js.map +1 -0
- package/dist/plugins/PgV4InflectionPlugin.d.ts +11 -0
- package/dist/plugins/PgV4InflectionPlugin.d.ts.map +1 -0
- package/dist/plugins/PgV4InflectionPlugin.js +91 -0
- package/dist/plugins/PgV4InflectionPlugin.js.map +1 -0
- package/dist/plugins/PgV4NoIgnoreIndexes.d.ts +2 -0
- package/dist/plugins/PgV4NoIgnoreIndexes.d.ts.map +1 -0
- package/dist/plugins/PgV4NoIgnoreIndexes.js +72 -0
- package/dist/plugins/PgV4NoIgnoreIndexes.js.map +1 -0
- package/dist/plugins/PgV4SmartTagsPlugin.d.ts +11 -0
- package/dist/plugins/PgV4SmartTagsPlugin.d.ts.map +1 -0
- package/dist/plugins/PgV4SmartTagsPlugin.js +190 -0
- package/dist/plugins/PgV4SmartTagsPlugin.js.map +1 -0
- package/dist/presets/amber.d.ts +5 -0
- package/dist/presets/amber.d.ts.map +1 -0
- package/dist/presets/amber.js +38 -0
- package/dist/presets/amber.js.map +1 -0
- package/dist/presets/v4.d.ts +34 -0
- package/dist/presets/v4.d.ts.map +1 -0
- package/dist/presets/v4.js +142 -0
- package/dist/presets/v4.js.map +1 -0
- package/dist/schema.d.ts +34 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +82 -0
- package/dist/schema.js.map +1 -0
- package/package.json +79 -154
- package/build/assets/favicon.ico.d.ts +0 -3
- package/build/assets/favicon.ico.js +0 -6
- package/build/assets/graphiql.html.d.ts +0 -2
- package/build/assets/graphiql.html.js +0 -6
- package/build/index.d.ts +0 -8
- package/build/index.js +0 -34
- package/build/interfaces.d.ts +0 -163
- package/build/interfaces.js +0 -3
- package/build/plugins.d.ts +0 -3
- package/build/plugins.js +0 -53
- package/build/postgraphile/cli.d.ts +0 -3
- package/build/postgraphile/cli.js +0 -541
- package/build/postgraphile/extendedFormatError.d.ts +0 -9
- package/build/postgraphile/extendedFormatError.js +0 -51
- package/build/postgraphile/http/createPostGraphileHttpRequestHandler.d.ts +0 -11
- package/build/postgraphile/http/createPostGraphileHttpRequestHandler.js +0 -976
- package/build/postgraphile/http/frameworks.d.ts +0 -110
- package/build/postgraphile/http/frameworks.js +0 -258
- package/build/postgraphile/http/liveSubscribe.d.ts +0 -22
- package/build/postgraphile/http/liveSubscribe.js +0 -89
- package/build/postgraphile/http/mapAsyncIterator.d.ts +0 -15
- package/build/postgraphile/http/mapAsyncIterator.js +0 -71
- package/build/postgraphile/http/setupServerSentEvents.d.ts +0 -9
- package/build/postgraphile/http/setupServerSentEvents.js +0 -51
- package/build/postgraphile/http/subscriptions.d.ts +0 -7
- package/build/postgraphile/http/subscriptions.js +0 -411
- package/build/postgraphile/index.d.ts +0 -5
- package/build/postgraphile/index.js +0 -14
- package/build/postgraphile/pluginHook.d.ts +0 -104
- package/build/postgraphile/pluginHook.js +0 -100
- package/build/postgraphile/postgraphile.d.ts +0 -20
- package/build/postgraphile/postgraphile.js +0 -332
- package/build/postgraphile/postgraphilerc.d.ts +0 -2
- package/build/postgraphile/postgraphilerc.js +0 -16
- package/build/postgraphile/schema/exportPostGraphileSchema.d.ts +0 -6
- package/build/postgraphile/schema/exportPostGraphileSchema.js +0 -45
- package/build/postgraphile/shutdownActions.d.ts +0 -41
- package/build/postgraphile/shutdownActions.js +0 -87
- package/build/postgraphile/withPostGraphileContext.d.ts +0 -55
- package/build/postgraphile/withPostGraphileContext.js +0 -457
- package/build/postgres/inventory/pgClientFromContext.d.ts +0 -8
- package/build/postgres/inventory/pgClientFromContext.js +0 -21
- package/build-turbo/assets/favicon.ico.d.ts +0 -3
- package/build-turbo/assets/favicon.ico.js +0 -6
- package/build-turbo/assets/graphiql.html.d.ts +0 -2
- package/build-turbo/assets/graphiql.html.js +0 -6
- package/build-turbo/index.d.ts +0 -8
- package/build-turbo/index.js +0 -34
- package/build-turbo/interfaces.d.ts +0 -163
- package/build-turbo/interfaces.js +0 -3
- package/build-turbo/plugins.d.ts +0 -3
- package/build-turbo/plugins.js +0 -53
- package/build-turbo/postgraphile/cli.d.ts +0 -3
- package/build-turbo/postgraphile/cli.js +0 -572
- package/build-turbo/postgraphile/extendedFormatError.d.ts +0 -9
- package/build-turbo/postgraphile/extendedFormatError.js +0 -61
- package/build-turbo/postgraphile/http/createPostGraphileHttpRequestHandler.d.ts +0 -11
- package/build-turbo/postgraphile/http/createPostGraphileHttpRequestHandler.js +0 -984
- package/build-turbo/postgraphile/http/frameworks.d.ts +0 -110
- package/build-turbo/postgraphile/http/frameworks.js +0 -258
- package/build-turbo/postgraphile/http/liveSubscribe.d.ts +0 -22
- package/build-turbo/postgraphile/http/liveSubscribe.js +0 -89
- package/build-turbo/postgraphile/http/mapAsyncIterator.d.ts +0 -15
- package/build-turbo/postgraphile/http/mapAsyncIterator.js +0 -71
- package/build-turbo/postgraphile/http/setupServerSentEvents.d.ts +0 -9
- package/build-turbo/postgraphile/http/setupServerSentEvents.js +0 -51
- package/build-turbo/postgraphile/http/subscriptions.d.ts +0 -7
- package/build-turbo/postgraphile/http/subscriptions.js +0 -410
- package/build-turbo/postgraphile/index.d.ts +0 -5
- package/build-turbo/postgraphile/index.js +0 -14
- package/build-turbo/postgraphile/pluginHook.d.ts +0 -104
- package/build-turbo/postgraphile/pluginHook.js +0 -100
- package/build-turbo/postgraphile/postgraphile.d.ts +0 -20
- package/build-turbo/postgraphile/postgraphile.js +0 -337
- package/build-turbo/postgraphile/postgraphilerc.d.ts +0 -2
- package/build-turbo/postgraphile/postgraphilerc.js +0 -16
- package/build-turbo/postgraphile/schema/exportPostGraphileSchema.d.ts +0 -6
- package/build-turbo/postgraphile/schema/exportPostGraphileSchema.js +0 -45
- package/build-turbo/postgraphile/shutdownActions.d.ts +0 -41
- package/build-turbo/postgraphile/shutdownActions.js +0 -87
- package/build-turbo/postgraphile/withPostGraphileContext.d.ts +0 -55
- package/build-turbo/postgraphile/withPostGraphileContext.js +0 -466
- package/build-turbo/postgres/inventory/pgClientFromContext.d.ts +0 -8
- package/build-turbo/postgres/inventory/pgClientFromContext.js +0 -21
- package/cli.js +0 -6
- package/index.js +0 -5
- package/isTurbo.js +0 -11
- package/plugins.d.ts +0 -1
- package/plugins.js +0 -5
- package/sponsors.json +0 -151
package/build/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from 'graphile-utils';
|
|
2
|
-
export { mixed, Middleware, PostGraphileOptions, CreateRequestHandlerOptions, GraphQLFormattedErrorExtended, GraphQLErrorExtended, HttpRequestHandler, WithPostGraphileContextOptions, } from './interfaces';
|
|
3
|
-
export { Plugin, Build, Context, SchemaBuilder, SchemaListener, Inflection, Options, postGraphileBaseOverrides, postGraphileClassicIdsOverrides, PostGraphileInflectionPlugin, PostGraphileClassicIdsInflectionPlugin, } from 'postgraphile-core';
|
|
4
|
-
export { postgraphile, createPostGraphileSchema, watchPostGraphileSchema, withPostGraphileContext, enhanceHttpServerWithWebSockets, debugPgClient, postgraphile as postgraphql, createPostGraphileSchema as createPostGraphQLSchema, watchPostGraphileSchema as watchPostGraphQLSchema, withPostGraphileContext as withPostGraphQLContext, enhanceHttpServerWithWebSockets as enhanceHttpServerWithSubscriptions, } from './postgraphile';
|
|
5
|
-
export { PostGraphileResponse, PostGraphileResponseNode, PostGraphileResponseKoa, PostGraphileResponseFastify3, } from './postgraphile/http/frameworks';
|
|
6
|
-
export { makePluginHook, PostGraphilePlugin } from './postgraphile/pluginHook';
|
|
7
|
-
import { postgraphile } from './postgraphile';
|
|
8
|
-
export default postgraphile;
|
package/build/index.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makePluginHook = exports.PostGraphileResponseFastify3 = exports.PostGraphileResponseKoa = exports.PostGraphileResponseNode = exports.PostGraphileResponse = exports.enhanceHttpServerWithSubscriptions = exports.withPostGraphQLContext = exports.watchPostGraphQLSchema = exports.createPostGraphQLSchema = exports.postgraphql = exports.debugPgClient = exports.enhanceHttpServerWithWebSockets = exports.withPostGraphileContext = exports.watchPostGraphileSchema = exports.createPostGraphileSchema = exports.postgraphile = exports.PostGraphileClassicIdsInflectionPlugin = exports.PostGraphileInflectionPlugin = exports.postGraphileClassicIdsOverrides = exports.postGraphileBaseOverrides = exports.SchemaBuilder = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
tslib_1.__exportStar(require("graphile-utils"), exports);
|
|
6
|
-
var postgraphile_core_1 = require("postgraphile-core");
|
|
7
|
-
Object.defineProperty(exports, "SchemaBuilder", { enumerable: true, get: function () { return postgraphile_core_1.SchemaBuilder; } });
|
|
8
|
-
Object.defineProperty(exports, "postGraphileBaseOverrides", { enumerable: true, get: function () { return postgraphile_core_1.postGraphileBaseOverrides; } });
|
|
9
|
-
Object.defineProperty(exports, "postGraphileClassicIdsOverrides", { enumerable: true, get: function () { return postgraphile_core_1.postGraphileClassicIdsOverrides; } });
|
|
10
|
-
Object.defineProperty(exports, "PostGraphileInflectionPlugin", { enumerable: true, get: function () { return postgraphile_core_1.PostGraphileInflectionPlugin; } });
|
|
11
|
-
Object.defineProperty(exports, "PostGraphileClassicIdsInflectionPlugin", { enumerable: true, get: function () { return postgraphile_core_1.PostGraphileClassicIdsInflectionPlugin; } });
|
|
12
|
-
var postgraphile_1 = require("./postgraphile");
|
|
13
|
-
Object.defineProperty(exports, "postgraphile", { enumerable: true, get: function () { return postgraphile_1.postgraphile; } });
|
|
14
|
-
Object.defineProperty(exports, "createPostGraphileSchema", { enumerable: true, get: function () { return postgraphile_1.createPostGraphileSchema; } });
|
|
15
|
-
Object.defineProperty(exports, "watchPostGraphileSchema", { enumerable: true, get: function () { return postgraphile_1.watchPostGraphileSchema; } });
|
|
16
|
-
Object.defineProperty(exports, "withPostGraphileContext", { enumerable: true, get: function () { return postgraphile_1.withPostGraphileContext; } });
|
|
17
|
-
Object.defineProperty(exports, "enhanceHttpServerWithWebSockets", { enumerable: true, get: function () { return postgraphile_1.enhanceHttpServerWithWebSockets; } });
|
|
18
|
-
Object.defineProperty(exports, "debugPgClient", { enumerable: true, get: function () { return postgraphile_1.debugPgClient; } });
|
|
19
|
-
// Backwards compatibility
|
|
20
|
-
Object.defineProperty(exports, "postgraphql", { enumerable: true, get: function () { return postgraphile_1.postgraphile; } });
|
|
21
|
-
Object.defineProperty(exports, "createPostGraphQLSchema", { enumerable: true, get: function () { return postgraphile_1.createPostGraphileSchema; } });
|
|
22
|
-
Object.defineProperty(exports, "watchPostGraphQLSchema", { enumerable: true, get: function () { return postgraphile_1.watchPostGraphileSchema; } });
|
|
23
|
-
Object.defineProperty(exports, "withPostGraphQLContext", { enumerable: true, get: function () { return postgraphile_1.withPostGraphileContext; } });
|
|
24
|
-
Object.defineProperty(exports, "enhanceHttpServerWithSubscriptions", { enumerable: true, get: function () { return postgraphile_1.enhanceHttpServerWithWebSockets; } });
|
|
25
|
-
var frameworks_1 = require("./postgraphile/http/frameworks");
|
|
26
|
-
Object.defineProperty(exports, "PostGraphileResponse", { enumerable: true, get: function () { return frameworks_1.PostGraphileResponse; } });
|
|
27
|
-
Object.defineProperty(exports, "PostGraphileResponseNode", { enumerable: true, get: function () { return frameworks_1.PostGraphileResponseNode; } });
|
|
28
|
-
Object.defineProperty(exports, "PostGraphileResponseKoa", { enumerable: true, get: function () { return frameworks_1.PostGraphileResponseKoa; } });
|
|
29
|
-
Object.defineProperty(exports, "PostGraphileResponseFastify3", { enumerable: true, get: function () { return frameworks_1.PostGraphileResponseFastify3; } });
|
|
30
|
-
var pluginHook_1 = require("./postgraphile/pluginHook");
|
|
31
|
-
Object.defineProperty(exports, "makePluginHook", { enumerable: true, get: function () { return pluginHook_1.makePluginHook; } });
|
|
32
|
-
const postgraphile_2 = require("./postgraphile");
|
|
33
|
-
exports.default = postgraphile_2.postgraphile;
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLHlEQUErQjtBQWEvQix1REFZMkI7QUFSekIsa0hBQUEsYUFBYSxPQUFBO0FBSWIsOEhBQUEseUJBQXlCLE9BQUE7QUFDekIsb0lBQUEsK0JBQStCLE9BQUE7QUFDL0IsaUlBQUEsNEJBQTRCLE9BQUE7QUFDNUIsMklBQUEsc0NBQXNDLE9BQUE7QUFHeEMsK0NBYXdCO0FBWnRCLDRHQUFBLFlBQVksT0FBQTtBQUNaLHdIQUFBLHdCQUF3QixPQUFBO0FBQ3hCLHVIQUFBLHVCQUF1QixPQUFBO0FBQ3ZCLHVIQUFBLHVCQUF1QixPQUFBO0FBQ3ZCLCtIQUFBLCtCQUErQixPQUFBO0FBQy9CLDZHQUFBLGFBQWEsT0FBQTtBQUNiLDBCQUEwQjtBQUMxQiwyR0FBQSxZQUFZLE9BQWU7QUFDM0IsdUhBQUEsd0JBQXdCLE9BQTJCO0FBQ25ELHNIQUFBLHVCQUF1QixPQUEwQjtBQUNqRCxzSEFBQSx1QkFBdUIsT0FBMEI7QUFDakQsa0lBQUEsK0JBQStCLE9BQXNDO0FBR3ZFLDZEQUt3QztBQUp0QyxrSEFBQSxvQkFBb0IsT0FBQTtBQUNwQixzSEFBQSx3QkFBd0IsT0FBQTtBQUN4QixxSEFBQSx1QkFBdUIsT0FBQTtBQUN2QiwwSEFBQSw0QkFBNEIsT0FBQTtBQUc5Qix3REFBK0U7QUFBdEUsNEdBQUEsY0FBYyxPQUFBO0FBRXZCLGlEQUE4QztBQUM5QyxrQkFBZSwyQkFBWSxDQUFDIn0=
|
package/build/interfaces.d.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { GraphQLError, GraphQLSchema, SourceLocation, DocumentNode } from 'graphql';
|
|
3
|
-
import { IncomingMessage, ServerResponse } from 'http';
|
|
4
|
-
import { PluginHookFn } from './postgraphile/pluginHook';
|
|
5
|
-
import { Pool } from 'pg';
|
|
6
|
-
import { Plugin, PostGraphileCoreOptions } from 'postgraphile-core';
|
|
7
|
-
import jwt = require('jsonwebtoken');
|
|
8
|
-
import { EventEmitter } from 'events';
|
|
9
|
-
import { PostGraphileResponse } from './postgraphile/http/frameworks';
|
|
10
|
-
import { ShutdownActions } from './postgraphile/shutdownActions';
|
|
11
|
-
import { KeyObject } from 'crypto';
|
|
12
|
-
declare type PromiseOrDirect<T> = T | Promise<T>;
|
|
13
|
-
declare type DirectOrCallback<Request, T> = T | ((req: Request) => PromiseOrDirect<T>);
|
|
14
|
-
/**
|
|
15
|
-
* A narrower type than `any` that won’t swallow errors from assumptions about
|
|
16
|
-
* code.
|
|
17
|
-
*
|
|
18
|
-
* For example `(x as any).anything()` is ok. That function then returns `any`
|
|
19
|
-
* as well so the problem compounds into `(x as any).anything().else()` and the
|
|
20
|
-
* problem just goes from there. `any` is a type black hole that swallows any
|
|
21
|
-
* useful type information and shouldn’t be used unless you know what you’re
|
|
22
|
-
* doing.
|
|
23
|
-
*
|
|
24
|
-
* With `mixed` you must *prove* the type is what you want to use.
|
|
25
|
-
*
|
|
26
|
-
* The `mixed` type is identical to the `mixed` type in Flow.
|
|
27
|
-
*
|
|
28
|
-
* @see https://github.com/Microsoft/TypeScript/issues/9999
|
|
29
|
-
* @see https://flowtype.org/docs/builtins.html#mixed
|
|
30
|
-
*/
|
|
31
|
-
export declare type mixed = Record<string, any> | string | number | boolean | undefined | null;
|
|
32
|
-
export declare type Middleware<Request extends IncomingMessage = IncomingMessage, Response extends ServerResponse = ServerResponse> = (req: Request, res: Response, next: (errOrEscape?: any) => void) => void;
|
|
33
|
-
export interface PostGraphileOptions<Request extends IncomingMessage = IncomingMessage, Response extends ServerResponse = ServerResponse> extends PostGraphileCoreOptions {
|
|
34
|
-
watchPg?: boolean;
|
|
35
|
-
retryOnInitFail?: boolean | ((error: Error, attempts: number) => boolean | Promise<boolean>);
|
|
36
|
-
ownerConnectionString?: string;
|
|
37
|
-
subscriptions?: boolean;
|
|
38
|
-
live?: boolean;
|
|
39
|
-
websockets?: ('v0' | 'v1')[];
|
|
40
|
-
websocketOperations?: 'all' | 'subscriptions';
|
|
41
|
-
websocketMiddlewares?: Array<Middleware<Request, Response>>;
|
|
42
|
-
pgDefaultRole?: string;
|
|
43
|
-
dynamicJson?: boolean;
|
|
44
|
-
setofFunctionsContainNulls?: boolean;
|
|
45
|
-
classicIds?: boolean;
|
|
46
|
-
disableDefaultMutations?: boolean;
|
|
47
|
-
ignoreRBAC?: boolean;
|
|
48
|
-
ignoreIndexes?: boolean;
|
|
49
|
-
includeExtensionResources?: boolean;
|
|
50
|
-
showErrorStack?: boolean | 'json';
|
|
51
|
-
extendedErrors?: Array<string>;
|
|
52
|
-
handleErrors?: (errors: ReadonlyArray<GraphQLError>, req: Request, res: Response) => ReadonlyArray<GraphQLError | GraphQLErrorExtended>;
|
|
53
|
-
appendPlugins?: Array<Plugin>;
|
|
54
|
-
prependPlugins?: Array<Plugin>;
|
|
55
|
-
replaceAllPlugins?: Array<Plugin>;
|
|
56
|
-
skipPlugins?: Array<Plugin>;
|
|
57
|
-
readCache?: string | Record<string, any>;
|
|
58
|
-
writeCache?: string;
|
|
59
|
-
exportJsonSchemaPath?: string;
|
|
60
|
-
exportGqlSchemaPath?: string;
|
|
61
|
-
sortExport?: boolean;
|
|
62
|
-
graphqlRoute?: string;
|
|
63
|
-
eventStreamRoute?: string;
|
|
64
|
-
externalGraphqlRoute?: string;
|
|
65
|
-
externalEventStreamRoute?: string;
|
|
66
|
-
graphiqlRoute?: string;
|
|
67
|
-
externalUrlBase?: string;
|
|
68
|
-
graphiql?: boolean;
|
|
69
|
-
graphiqlCredentials?: 'include' | 'omit' | 'same-origin';
|
|
70
|
-
enhanceGraphiql?: boolean;
|
|
71
|
-
enableCors?: boolean;
|
|
72
|
-
bodySizeLimit?: string;
|
|
73
|
-
enableQueryBatching?: boolean;
|
|
74
|
-
jwtSecret?: Exclude<jwt.Secret, KeyObject>;
|
|
75
|
-
jwtPublicKey?: jwt.Secret | jwt.GetPublicKeyOrSecret;
|
|
76
|
-
jwtVerifyOptions?: jwt.VerifyOptions;
|
|
77
|
-
jwtSignOptions?: jwt.SignOptions;
|
|
78
|
-
jwtRole?: Array<string>;
|
|
79
|
-
jwtPgTypeIdentifier?: string;
|
|
80
|
-
jwtAudiences?: Array<string>;
|
|
81
|
-
legacyRelations?: 'only' | 'deprecated' | 'omit';
|
|
82
|
-
legacyJsonUuid?: boolean;
|
|
83
|
-
disableQueryLog?: boolean;
|
|
84
|
-
pgSettings?: DirectOrCallback<Request, {
|
|
85
|
-
[key: string]: mixed;
|
|
86
|
-
}>;
|
|
87
|
-
allowExplain?: DirectOrCallback<Request, boolean>;
|
|
88
|
-
additionalGraphQLContextFromRequest?: (req: Request, res: Response) => Promise<Record<string, any>>;
|
|
89
|
-
pluginHook?: PluginHookFn;
|
|
90
|
-
simpleCollections?: 'omit' | 'both' | 'only';
|
|
91
|
-
queryCacheMaxSize?: number;
|
|
92
|
-
}
|
|
93
|
-
export interface CreateRequestHandlerOptions extends PostGraphileOptions {
|
|
94
|
-
getGqlSchema: () => Promise<GraphQLSchema>;
|
|
95
|
-
pgPool: Pool;
|
|
96
|
-
_emitter: EventEmitter;
|
|
97
|
-
shutdownActions: ShutdownActions;
|
|
98
|
-
}
|
|
99
|
-
export interface GraphQLFormattedErrorExtended {
|
|
100
|
-
message: string;
|
|
101
|
-
locations: ReadonlyArray<SourceLocation> | void;
|
|
102
|
-
path: ReadonlyArray<string | number> | void;
|
|
103
|
-
extensions?: {
|
|
104
|
-
[s: string]: any;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
export declare type GraphQLErrorExtended = GraphQLError & {
|
|
108
|
-
extensions: {
|
|
109
|
-
exception: {
|
|
110
|
-
hint?: string;
|
|
111
|
-
detail?: string;
|
|
112
|
-
code: string;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* A request handler for one of many different `http` frameworks.
|
|
118
|
-
*/
|
|
119
|
-
export interface HttpRequestHandler<Request extends IncomingMessage = IncomingMessage, Response extends ServerResponse = ServerResponse> {
|
|
120
|
-
(req: Request, res: Response, next?: (error?: mixed) => void): Promise<void>;
|
|
121
|
-
(ctx: {
|
|
122
|
-
req: Request;
|
|
123
|
-
res: Response;
|
|
124
|
-
}, next: () => void): Promise<void>;
|
|
125
|
-
formatError: (e: GraphQLError) => GraphQLFormattedErrorExtended;
|
|
126
|
-
getGraphQLSchema: () => Promise<GraphQLSchema>;
|
|
127
|
-
pgPool: Pool;
|
|
128
|
-
withPostGraphileContextFromReqRes: (req: Request, res: Response, moreOptions: any, fn: (ctx: mixed) => any) => Promise<any>;
|
|
129
|
-
options: CreateRequestHandlerOptions;
|
|
130
|
-
handleErrors: (errors: ReadonlyArray<GraphQLError>, req: Request, res: Response) => ReadonlyArray<GraphQLError | GraphQLErrorExtended>;
|
|
131
|
-
graphqlRoute: string;
|
|
132
|
-
graphqlRouteHandler: (res: PostGraphileResponse) => Promise<void>;
|
|
133
|
-
graphiqlRoute: string;
|
|
134
|
-
graphiqlRouteHandler: ((res: PostGraphileResponse) => Promise<void>) | null;
|
|
135
|
-
faviconRouteHandler: ((res: PostGraphileResponse) => Promise<void>) | null;
|
|
136
|
-
eventStreamRoute: string;
|
|
137
|
-
eventStreamRouteHandler: ((res: PostGraphileResponse) => Promise<void>) | null;
|
|
138
|
-
/** Experimental! */
|
|
139
|
-
release: () => Promise<void>;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Options passed to the `withPostGraphileContext` function
|
|
143
|
-
*/
|
|
144
|
-
export interface WithPostGraphileContextOptions {
|
|
145
|
-
pgPool: Pool;
|
|
146
|
-
jwtToken?: string;
|
|
147
|
-
jwtSecret?: Exclude<jwt.Secret, KeyObject>;
|
|
148
|
-
jwtPublicKey?: jwt.Secret | jwt.GetPublicKeyOrSecret;
|
|
149
|
-
jwtAudiences?: Array<string>;
|
|
150
|
-
jwtRole?: Array<string>;
|
|
151
|
-
jwtVerifyOptions?: jwt.VerifyOptions;
|
|
152
|
-
pgDefaultRole?: string;
|
|
153
|
-
pgSettings?: {
|
|
154
|
-
[key: string]: mixed;
|
|
155
|
-
};
|
|
156
|
-
explain?: boolean;
|
|
157
|
-
queryDocumentAst?: DocumentNode;
|
|
158
|
-
operationName?: string;
|
|
159
|
-
pgForceTransaction?: boolean;
|
|
160
|
-
singleStatement?: boolean;
|
|
161
|
-
variables?: any;
|
|
162
|
-
}
|
|
163
|
-
export {};
|
package/build/interfaces.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbnRlcmZhY2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
package/build/plugins.d.ts
DELETED
package/build/plugins.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TagsFilePlugin = exports.makePgSmartTagsFromFilePlugin = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const graphile_utils_1 = require("graphile-utils");
|
|
6
|
-
const JSON5 = require("json5");
|
|
7
|
-
const makePgSmartTagsFromFilePlugin = (tagsFile = process.cwd() + '/postgraphile.tags.json5') => {
|
|
8
|
-
/*
|
|
9
|
-
* We're wrapping the `smartTagsPlugin` defined below with a plugin wrapper
|
|
10
|
-
* so that any errors from reading the smart tags file are thrown when the
|
|
11
|
-
* plugin is *loaded* rather than from when it is defined.
|
|
12
|
-
*/
|
|
13
|
-
const plugin = (builder, options) => {
|
|
14
|
-
function handleTagsError(err) {
|
|
15
|
-
console.error(`Failed to process smart tags file '${tagsFile}': ${err.message}`);
|
|
16
|
-
}
|
|
17
|
-
const initialTagsJSON = JSON5.parse(fs_1.readFileSync(tagsFile, 'utf8'));
|
|
18
|
-
let tagsListener = null;
|
|
19
|
-
const smartTagsPlugin = graphile_utils_1.makeJSONPgSmartTagsPlugin(initialTagsJSON, updateJSON => {
|
|
20
|
-
if (tagsListener) {
|
|
21
|
-
fs_1.unwatchFile(tagsFile, tagsListener);
|
|
22
|
-
tagsListener = null;
|
|
23
|
-
}
|
|
24
|
-
if (updateJSON) {
|
|
25
|
-
tagsListener = (_current, _previous) => {
|
|
26
|
-
fs_1.readFile(tagsFile, 'utf8', (err, data) => {
|
|
27
|
-
if (err) {
|
|
28
|
-
if (err['code'] === 'ENOENT') {
|
|
29
|
-
updateJSON(null);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
handleTagsError(err);
|
|
33
|
-
}
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
updateJSON(JSON5.parse(data));
|
|
38
|
-
}
|
|
39
|
-
catch (e) {
|
|
40
|
-
handleTagsError(e);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
fs_1.watchFile(tagsFile, { interval: 507 }, tagsListener);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
return smartTagsPlugin(builder, options);
|
|
48
|
-
};
|
|
49
|
-
return plugin;
|
|
50
|
-
};
|
|
51
|
-
exports.makePgSmartTagsFromFilePlugin = makePgSmartTagsFromFilePlugin;
|
|
52
|
-
exports.TagsFilePlugin = exports.makePgSmartTagsFromFilePlugin();
|
|
53
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDJCQUEyRTtBQUMzRSxtREFBNEU7QUFDNUUsK0JBQStCO0FBR3hCLE1BQU0sNkJBQTZCLEdBQUcsQ0FDM0MsUUFBUSxHQUFHLE9BQU8sQ0FBQyxHQUFHLEVBQUUsR0FBRywwQkFBMEIsRUFDN0MsRUFBRTtJQUNWOzs7O09BSUc7SUFDSCxNQUFNLE1BQU0sR0FBVyxDQUFDLE9BQU8sRUFBRSxPQUFPLEVBQUUsRUFBRTtRQUMxQyxTQUFTLGVBQWUsQ0FBQyxHQUFVO1lBQ2pDLE9BQU8sQ0FBQyxLQUFLLENBQUMsc0NBQXNDLFFBQVEsTUFBTSxHQUFHLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FBQztRQUNuRixDQUFDO1FBRUQsTUFBTSxlQUFlLEdBQW9CLEtBQUssQ0FBQyxLQUFLLENBQUMsaUJBQVksQ0FBQyxRQUFRLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQztRQUVyRixJQUFJLFlBQVksR0FBdUQsSUFBSSxDQUFDO1FBQzVFLE1BQU0sZUFBZSxHQUFHLDBDQUF5QixDQUFDLGVBQWUsRUFBRSxVQUFVLENBQUMsRUFBRTtZQUM5RSxJQUFJLFlBQVksRUFBRTtnQkFDaEIsZ0JBQVcsQ0FBQyxRQUFRLEVBQUUsWUFBWSxDQUFDLENBQUM7Z0JBQ3BDLFlBQVksR0FBRyxJQUFJLENBQUM7YUFDckI7WUFDRCxJQUFJLFVBQVUsRUFBRTtnQkFDZCxZQUFZLEdBQUcsQ0FBQyxRQUFRLEVBQUUsU0FBUyxFQUFRLEVBQUU7b0JBQzNDLGFBQVEsQ0FBQyxRQUFRLEVBQUUsTUFBTSxFQUFFLENBQUMsR0FBRyxFQUFFLElBQUksRUFBRSxFQUFFO3dCQUN2QyxJQUFJLEdBQUcsRUFBRTs0QkFDUCxJQUFJLEdBQUcsQ0FBQyxNQUFNLENBQUMsS0FBSyxRQUFRLEVBQUU7Z0NBQzVCLFVBQVUsQ0FBQyxJQUFJLENBQUMsQ0FBQzs2QkFDbEI7aUNBQU07Z0NBQ0wsZUFBZSxDQUFDLEdBQUcsQ0FBQyxDQUFDOzZCQUN0Qjs0QkFDRCxPQUFPO3lCQUNSO3dCQUNELElBQUk7NEJBQ0YsVUFBVSxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQzt5QkFDL0I7d0JBQUMsT0FBTyxDQUFDLEVBQUU7NEJBQ1YsZUFBZSxDQUFDLENBQUMsQ0FBQyxDQUFDO3lCQUNwQjtvQkFDSCxDQUFDLENBQUMsQ0FBQztnQkFDTCxDQUFDLENBQUM7Z0JBRUYsY0FBUyxDQUFDLFFBQVEsRUFBRSxFQUFFLFFBQVEsRUFBRSxHQUFHLEVBQUUsRUFBRSxZQUFZLENBQUMsQ0FBQzthQUN0RDtRQUNILENBQUMsQ0FBQyxDQUFDO1FBQ0gsT0FBTyxlQUFlLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0lBQzNDLENBQUMsQ0FBQztJQUNGLE9BQU8sTUFBTSxDQUFDO0FBQ2hCLENBQUMsQ0FBQztBQTlDVyxRQUFBLDZCQUE2QixpQ0E4Q3hDO0FBRVcsUUFBQSxjQUFjLEdBQUcscUNBQTZCLEVBQUUsQ0FBQyJ9
|