postgraphile 4.12.11 → 5.0.0-0.3

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.
Files changed (134) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/LICENSE.md +15 -20
  3. package/README.md +20 -171
  4. package/dist/cli-run.d.ts +3 -0
  5. package/dist/cli-run.d.ts.map +1 -0
  6. package/dist/cli-run.js +7 -0
  7. package/dist/cli-run.js.map +1 -0
  8. package/dist/cli.d.ts +21 -0
  9. package/dist/cli.d.ts.map +1 -0
  10. package/dist/cli.js +180 -0
  11. package/dist/cli.js.map +1 -0
  12. package/dist/index.d.ts +14 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +88 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/plugins/PgV4BehaviorPlugin.d.ts +11 -0
  17. package/dist/plugins/PgV4BehaviorPlugin.d.ts.map +1 -0
  18. package/dist/plugins/PgV4BehaviorPlugin.js +73 -0
  19. package/dist/plugins/PgV4BehaviorPlugin.js.map +1 -0
  20. package/dist/plugins/PgV4InflectionPlugin.d.ts +11 -0
  21. package/dist/plugins/PgV4InflectionPlugin.d.ts.map +1 -0
  22. package/dist/plugins/PgV4InflectionPlugin.js +91 -0
  23. package/dist/plugins/PgV4InflectionPlugin.js.map +1 -0
  24. package/dist/plugins/PgV4NoIgnoreIndexes.d.ts +2 -0
  25. package/dist/plugins/PgV4NoIgnoreIndexes.d.ts.map +1 -0
  26. package/dist/plugins/PgV4NoIgnoreIndexes.js +72 -0
  27. package/dist/plugins/PgV4NoIgnoreIndexes.js.map +1 -0
  28. package/dist/plugins/PgV4SmartTagsPlugin.d.ts +11 -0
  29. package/dist/plugins/PgV4SmartTagsPlugin.d.ts.map +1 -0
  30. package/dist/plugins/PgV4SmartTagsPlugin.js +190 -0
  31. package/dist/plugins/PgV4SmartTagsPlugin.js.map +1 -0
  32. package/dist/presets/amber.d.ts +5 -0
  33. package/dist/presets/amber.d.ts.map +1 -0
  34. package/dist/presets/amber.js +38 -0
  35. package/dist/presets/amber.js.map +1 -0
  36. package/dist/presets/v4.d.ts +34 -0
  37. package/dist/presets/v4.d.ts.map +1 -0
  38. package/dist/presets/v4.js +142 -0
  39. package/dist/presets/v4.js.map +1 -0
  40. package/dist/schema.d.ts +34 -0
  41. package/dist/schema.d.ts.map +1 -0
  42. package/dist/schema.js +82 -0
  43. package/dist/schema.js.map +1 -0
  44. package/package.json +77 -154
  45. package/build/assets/favicon.ico.d.ts +0 -3
  46. package/build/assets/favicon.ico.js +0 -6
  47. package/build/assets/graphiql.html.d.ts +0 -2
  48. package/build/assets/graphiql.html.js +0 -6
  49. package/build/index.d.ts +0 -8
  50. package/build/index.js +0 -34
  51. package/build/interfaces.d.ts +0 -162
  52. package/build/interfaces.js +0 -3
  53. package/build/plugins.d.ts +0 -3
  54. package/build/plugins.js +0 -53
  55. package/build/postgraphile/cli.d.ts +0 -3
  56. package/build/postgraphile/cli.js +0 -541
  57. package/build/postgraphile/extendedFormatError.d.ts +0 -9
  58. package/build/postgraphile/extendedFormatError.js +0 -51
  59. package/build/postgraphile/http/createPostGraphileHttpRequestHandler.d.ts +0 -11
  60. package/build/postgraphile/http/createPostGraphileHttpRequestHandler.js +0 -974
  61. package/build/postgraphile/http/frameworks.d.ts +0 -110
  62. package/build/postgraphile/http/frameworks.js +0 -258
  63. package/build/postgraphile/http/liveSubscribe.d.ts +0 -22
  64. package/build/postgraphile/http/liveSubscribe.js +0 -89
  65. package/build/postgraphile/http/mapAsyncIterator.d.ts +0 -15
  66. package/build/postgraphile/http/mapAsyncIterator.js +0 -71
  67. package/build/postgraphile/http/setupServerSentEvents.d.ts +0 -9
  68. package/build/postgraphile/http/setupServerSentEvents.js +0 -51
  69. package/build/postgraphile/http/subscriptions.d.ts +0 -7
  70. package/build/postgraphile/http/subscriptions.js +0 -410
  71. package/build/postgraphile/index.d.ts +0 -5
  72. package/build/postgraphile/index.js +0 -14
  73. package/build/postgraphile/pluginHook.d.ts +0 -104
  74. package/build/postgraphile/pluginHook.js +0 -100
  75. package/build/postgraphile/postgraphile.d.ts +0 -20
  76. package/build/postgraphile/postgraphile.js +0 -332
  77. package/build/postgraphile/postgraphilerc.d.ts +0 -2
  78. package/build/postgraphile/postgraphilerc.js +0 -16
  79. package/build/postgraphile/schema/exportPostGraphileSchema.d.ts +0 -6
  80. package/build/postgraphile/schema/exportPostGraphileSchema.js +0 -45
  81. package/build/postgraphile/shutdownActions.d.ts +0 -41
  82. package/build/postgraphile/shutdownActions.js +0 -87
  83. package/build/postgraphile/withPostGraphileContext.d.ts +0 -55
  84. package/build/postgraphile/withPostGraphileContext.js +0 -457
  85. package/build/postgres/inventory/pgClientFromContext.d.ts +0 -8
  86. package/build/postgres/inventory/pgClientFromContext.js +0 -21
  87. package/build-turbo/assets/favicon.ico.d.ts +0 -3
  88. package/build-turbo/assets/favicon.ico.js +0 -6
  89. package/build-turbo/assets/graphiql.html.d.ts +0 -2
  90. package/build-turbo/assets/graphiql.html.js +0 -6
  91. package/build-turbo/index.d.ts +0 -8
  92. package/build-turbo/index.js +0 -34
  93. package/build-turbo/interfaces.d.ts +0 -162
  94. package/build-turbo/interfaces.js +0 -3
  95. package/build-turbo/plugins.d.ts +0 -3
  96. package/build-turbo/plugins.js +0 -53
  97. package/build-turbo/postgraphile/cli.d.ts +0 -3
  98. package/build-turbo/postgraphile/cli.js +0 -572
  99. package/build-turbo/postgraphile/extendedFormatError.d.ts +0 -9
  100. package/build-turbo/postgraphile/extendedFormatError.js +0 -61
  101. package/build-turbo/postgraphile/http/createPostGraphileHttpRequestHandler.d.ts +0 -11
  102. package/build-turbo/postgraphile/http/createPostGraphileHttpRequestHandler.js +0 -982
  103. package/build-turbo/postgraphile/http/frameworks.d.ts +0 -110
  104. package/build-turbo/postgraphile/http/frameworks.js +0 -258
  105. package/build-turbo/postgraphile/http/liveSubscribe.d.ts +0 -22
  106. package/build-turbo/postgraphile/http/liveSubscribe.js +0 -89
  107. package/build-turbo/postgraphile/http/mapAsyncIterator.d.ts +0 -15
  108. package/build-turbo/postgraphile/http/mapAsyncIterator.js +0 -71
  109. package/build-turbo/postgraphile/http/setupServerSentEvents.d.ts +0 -9
  110. package/build-turbo/postgraphile/http/setupServerSentEvents.js +0 -51
  111. package/build-turbo/postgraphile/http/subscriptions.d.ts +0 -7
  112. package/build-turbo/postgraphile/http/subscriptions.js +0 -409
  113. package/build-turbo/postgraphile/index.d.ts +0 -5
  114. package/build-turbo/postgraphile/index.js +0 -14
  115. package/build-turbo/postgraphile/pluginHook.d.ts +0 -104
  116. package/build-turbo/postgraphile/pluginHook.js +0 -100
  117. package/build-turbo/postgraphile/postgraphile.d.ts +0 -20
  118. package/build-turbo/postgraphile/postgraphile.js +0 -337
  119. package/build-turbo/postgraphile/postgraphilerc.d.ts +0 -2
  120. package/build-turbo/postgraphile/postgraphilerc.js +0 -16
  121. package/build-turbo/postgraphile/schema/exportPostGraphileSchema.d.ts +0 -6
  122. package/build-turbo/postgraphile/schema/exportPostGraphileSchema.js +0 -45
  123. package/build-turbo/postgraphile/shutdownActions.d.ts +0 -41
  124. package/build-turbo/postgraphile/shutdownActions.js +0 -87
  125. package/build-turbo/postgraphile/withPostGraphileContext.d.ts +0 -55
  126. package/build-turbo/postgraphile/withPostGraphileContext.js +0 -466
  127. package/build-turbo/postgres/inventory/pgClientFromContext.d.ts +0 -8
  128. package/build-turbo/postgres/inventory/pgClientFromContext.js +0 -21
  129. package/cli.js +0 -6
  130. package/index.js +0 -5
  131. package/isTurbo.js +0 -11
  132. package/plugins.d.ts +0 -1
  133. package/plugins.js +0 -5
  134. package/sponsors.json +0 -150
@@ -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;
@@ -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=
@@ -1,162 +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
- declare type PromiseOrDirect<T> = T | Promise<T>;
12
- declare type DirectOrCallback<Request, T> = T | ((req: Request) => PromiseOrDirect<T>);
13
- /**
14
- * A narrower type than `any` that won’t swallow errors from assumptions about
15
- * code.
16
- *
17
- * For example `(x as any).anything()` is ok. That function then returns `any`
18
- * as well so the problem compounds into `(x as any).anything().else()` and the
19
- * problem just goes from there. `any` is a type black hole that swallows any
20
- * useful type information and shouldn’t be used unless you know what you’re
21
- * doing.
22
- *
23
- * With `mixed` you must *prove* the type is what you want to use.
24
- *
25
- * The `mixed` type is identical to the `mixed` type in Flow.
26
- *
27
- * @see https://github.com/Microsoft/TypeScript/issues/9999
28
- * @see https://flowtype.org/docs/builtins.html#mixed
29
- */
30
- export declare type mixed = Record<string, any> | string | number | boolean | undefined | null;
31
- export declare type Middleware<Request extends IncomingMessage = IncomingMessage, Response extends ServerResponse = ServerResponse> = (req: Request, res: Response, next: (errOrEscape?: any) => void) => void;
32
- export interface PostGraphileOptions<Request extends IncomingMessage = IncomingMessage, Response extends ServerResponse = ServerResponse> extends PostGraphileCoreOptions {
33
- watchPg?: boolean;
34
- retryOnInitFail?: boolean | ((error: Error, attempts: number) => boolean | Promise<boolean>);
35
- ownerConnectionString?: string;
36
- subscriptions?: boolean;
37
- live?: boolean;
38
- websockets?: ('v0' | 'v1')[];
39
- websocketOperations?: 'all' | 'subscriptions';
40
- websocketMiddlewares?: Array<Middleware<Request, Response>>;
41
- pgDefaultRole?: string;
42
- dynamicJson?: boolean;
43
- setofFunctionsContainNulls?: boolean;
44
- classicIds?: boolean;
45
- disableDefaultMutations?: boolean;
46
- ignoreRBAC?: boolean;
47
- ignoreIndexes?: boolean;
48
- includeExtensionResources?: boolean;
49
- showErrorStack?: boolean | 'json';
50
- extendedErrors?: Array<string>;
51
- handleErrors?: (errors: ReadonlyArray<GraphQLError>, req: Request, res: Response) => ReadonlyArray<GraphQLError | GraphQLErrorExtended>;
52
- appendPlugins?: Array<Plugin>;
53
- prependPlugins?: Array<Plugin>;
54
- replaceAllPlugins?: Array<Plugin>;
55
- skipPlugins?: Array<Plugin>;
56
- readCache?: string | Record<string, any>;
57
- writeCache?: string;
58
- exportJsonSchemaPath?: string;
59
- exportGqlSchemaPath?: string;
60
- sortExport?: boolean;
61
- graphqlRoute?: string;
62
- eventStreamRoute?: string;
63
- externalGraphqlRoute?: string;
64
- externalEventStreamRoute?: string;
65
- graphiqlRoute?: string;
66
- externalUrlBase?: string;
67
- graphiql?: boolean;
68
- graphiqlCredentials?: 'include' | 'omit' | 'same-origin';
69
- enhanceGraphiql?: boolean;
70
- enableCors?: boolean;
71
- bodySizeLimit?: string;
72
- enableQueryBatching?: boolean;
73
- jwtSecret?: jwt.Secret;
74
- jwtPublicKey?: jwt.Secret | jwt.GetPublicKeyOrSecret;
75
- jwtVerifyOptions?: jwt.VerifyOptions;
76
- jwtSignOptions?: jwt.SignOptions;
77
- jwtRole?: Array<string>;
78
- jwtPgTypeIdentifier?: string;
79
- jwtAudiences?: Array<string>;
80
- legacyRelations?: 'only' | 'deprecated' | 'omit';
81
- legacyJsonUuid?: boolean;
82
- disableQueryLog?: boolean;
83
- pgSettings?: DirectOrCallback<Request, {
84
- [key: string]: mixed;
85
- }>;
86
- allowExplain?: DirectOrCallback<Request, boolean>;
87
- additionalGraphQLContextFromRequest?: (req: Request, res: Response) => Promise<Record<string, any>>;
88
- pluginHook?: PluginHookFn;
89
- simpleCollections?: 'omit' | 'both' | 'only';
90
- queryCacheMaxSize?: number;
91
- }
92
- export interface CreateRequestHandlerOptions extends PostGraphileOptions {
93
- getGqlSchema: () => Promise<GraphQLSchema>;
94
- pgPool: Pool;
95
- _emitter: EventEmitter;
96
- shutdownActions: ShutdownActions;
97
- }
98
- export interface GraphQLFormattedErrorExtended {
99
- message: string;
100
- locations: ReadonlyArray<SourceLocation> | void;
101
- path: ReadonlyArray<string | number> | void;
102
- extensions?: {
103
- [s: string]: any;
104
- };
105
- }
106
- export declare type GraphQLErrorExtended = GraphQLError & {
107
- extensions: {
108
- exception: {
109
- hint?: string;
110
- detail?: string;
111
- code: string;
112
- };
113
- };
114
- };
115
- /**
116
- * A request handler for one of many different `http` frameworks.
117
- */
118
- export interface HttpRequestHandler<Request extends IncomingMessage = IncomingMessage, Response extends ServerResponse = ServerResponse> {
119
- (req: Request, res: Response, next?: (error?: mixed) => void): Promise<void>;
120
- (ctx: {
121
- req: Request;
122
- res: Response;
123
- }, next: () => void): Promise<void>;
124
- formatError: (e: GraphQLError) => GraphQLFormattedErrorExtended;
125
- getGraphQLSchema: () => Promise<GraphQLSchema>;
126
- pgPool: Pool;
127
- withPostGraphileContextFromReqRes: (req: Request, res: Response, moreOptions: any, fn: (ctx: mixed) => any) => Promise<any>;
128
- options: CreateRequestHandlerOptions;
129
- handleErrors: (errors: ReadonlyArray<GraphQLError>, req: Request, res: Response) => ReadonlyArray<GraphQLError | GraphQLErrorExtended>;
130
- graphqlRoute: string;
131
- graphqlRouteHandler: (res: PostGraphileResponse) => Promise<void>;
132
- graphiqlRoute: string;
133
- graphiqlRouteHandler: ((res: PostGraphileResponse) => Promise<void>) | null;
134
- faviconRouteHandler: ((res: PostGraphileResponse) => Promise<void>) | null;
135
- eventStreamRoute: string;
136
- eventStreamRouteHandler: ((res: PostGraphileResponse) => Promise<void>) | null;
137
- /** Experimental! */
138
- release: () => Promise<void>;
139
- }
140
- /**
141
- * Options passed to the `withPostGraphileContext` function
142
- */
143
- export interface WithPostGraphileContextOptions {
144
- pgPool: Pool;
145
- jwtToken?: string;
146
- jwtSecret?: jwt.Secret;
147
- jwtPublicKey?: jwt.Secret | jwt.GetPublicKeyOrSecret;
148
- jwtAudiences?: Array<string>;
149
- jwtRole?: Array<string>;
150
- jwtVerifyOptions?: jwt.VerifyOptions;
151
- pgDefaultRole?: string;
152
- pgSettings?: {
153
- [key: string]: mixed;
154
- };
155
- explain?: boolean;
156
- queryDocumentAst?: DocumentNode;
157
- operationName?: string;
158
- pgForceTransaction?: boolean;
159
- singleStatement?: boolean;
160
- variables?: any;
161
- }
162
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbnRlcmZhY2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
@@ -1,3 +0,0 @@
1
- import { Plugin } from 'postgraphile-core';
2
- export declare const makePgSmartTagsFromFilePlugin: (tagsFile?: string) => Plugin;
3
- export declare const TagsFilePlugin: Plugin;
@@ -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
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { mixed } from '../interfaces';
3
- export declare type AddFlagFn = (optionString: string, description: string, parse?: (option: string) => mixed) => AddFlagFn;