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.
- package/CHANGELOG.md +46 -0
- package/LICENSE.md +15 -20
- package/README.md +20 -171
- 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 +180 -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 +77 -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 -162
- 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 -974
- 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 -410
- 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 -162
- 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 -982
- 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 -409
- 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 -150
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extendedFormatError = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Extracts the requested fields from a pg error object, handling 'code' -> 'errcode' mapping.
|
|
6
|
-
*/
|
|
7
|
-
function pickPgError(err, inFields) {
|
|
8
|
-
const result = {};
|
|
9
|
-
let fields;
|
|
10
|
-
if (Array.isArray(inFields)) {
|
|
11
|
-
fields = inFields;
|
|
12
|
-
}
|
|
13
|
-
else if (typeof inFields === 'string') {
|
|
14
|
-
fields = inFields.split(',');
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
throw new Error('Invalid argument to extendedErrors - expected array of strings');
|
|
18
|
-
}
|
|
19
|
-
if (err && typeof err === 'object') {
|
|
20
|
-
fields.forEach((field) => {
|
|
21
|
-
// pg places 'errcode' on the 'code' property
|
|
22
|
-
if (typeof field !== 'string') {
|
|
23
|
-
throw new Error('Invalid argument to extendedErrors - expected array of strings');
|
|
24
|
-
}
|
|
25
|
-
const errField = field === 'errcode' ? 'code' : field;
|
|
26
|
-
result[field] = err[errField] != null ? String(err[errField]) : err[errField];
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Given a GraphQLError, format it according to the rules described by the
|
|
33
|
-
* Response Format, Errors section of the GraphQL Specification, plus it can
|
|
34
|
-
* extract additional error codes from the postgres error, such as 'hint',
|
|
35
|
-
* 'detail', 'errcode', 'where', etc. - see `extendedErrors` option.
|
|
36
|
-
*/
|
|
37
|
-
function extendedFormatError(error, fields) {
|
|
38
|
-
if (!error) {
|
|
39
|
-
throw new Error('Received null or undefined error.');
|
|
40
|
-
}
|
|
41
|
-
const originalError = error.originalError;
|
|
42
|
-
const exceptionDetails = originalError && fields ? pickPgError(originalError, fields) : undefined;
|
|
43
|
-
return Object.assign(Object.assign(Object.assign({}, exceptionDetails), (exceptionDetails
|
|
44
|
-
? {
|
|
45
|
-
// Reference: https://facebook.github.io/graphql/draft/#sec-Errors
|
|
46
|
-
extensions: Object.assign(Object.assign({}, originalError.extensions), { exception: exceptionDetails }),
|
|
47
|
-
}
|
|
48
|
-
: null)), { message: error.message, locations: error.locations, path: error.path });
|
|
49
|
-
}
|
|
50
|
-
exports.extendedFormatError = extendedFormatError;
|
|
51
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0ZW5kZWRGb3JtYXRFcnJvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wb3N0Z3JhcGhpbGUvZXh0ZW5kZWRGb3JtYXRFcnJvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFHQTs7R0FFRztBQUNILFNB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NoQixDQUFDO0FBRUQ7Ozs7O0dBS0c7QUFDSCxTQUFnQixtQkFBbUIsQ0FDakMsS0FBbUIsRUFDbkIsTUFBcUI7SUFFckIsSUFBSSxDQUFDLEtBQUssRUFBRTtRQUNWLE1BQU0sSUFBSSxLQUFLLENBQUMsbUNBQW1DLENBQUMsQ0FBQztLQUN0RDtJQUNELE1BQU0sYUFBYSxHQUFHLEtBQUssQ0FBQyxhQUFxQyxDQUFDO0lBQ2xFLE1BQU0sZ0JBQWdCLEdBQUcsYUFBYSxJQUFJLE1BQU0sQ0FBQyxDQUFDLENBQUMsV0FBVyxDQUFDLGFBQWEsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQ2xHLHFEQUVLLGdCQUFnQixHQUVoQixDQUFDLGdCQUFnQjtRQUNsQixDQUFDLENBQUM7WUFDRSxrRUFBa0U7WUFDbEUsVUFBVSxrQ0FDTCxhQUFhLENBQUMsVUFBVSxLQUMzQixTQUFTLEVBQUUsZ0JBQWdCLEdBQzVCO1NBQ0Y7UUFDSCxDQUFDLENBQUMsSUFBSSxDQUFDLEtBQ1QsT0FBTyxFQUFFLEtBQUssQ0FBQyxPQUFPLEVBQ3RCLFNBQVMsRUFBRSxLQUFLLENBQUMsU0FBUyxFQUMxQixJQUFJLEVBQUUsS0FBSyxDQUFDLElBQUksSUFDaEI7QUFDSixDQUFDO0FBMUJELGtEQTBCQyJ9
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HttpRequestHandler, CreateRequestHandlerOptions } from '../../interfaces';
|
|
2
|
-
export declare function isEmpty(value: any): boolean;
|
|
3
|
-
/**
|
|
4
|
-
* Creates a GraphQL request handler that can support many different `http` frameworks, including:
|
|
5
|
-
*
|
|
6
|
-
* - Native Node.js `http`.
|
|
7
|
-
* - `connect`.
|
|
8
|
-
* - `express`.
|
|
9
|
-
* - `koa` (2.0).
|
|
10
|
-
*/
|
|
11
|
-
export default function createPostGraphileHttpRequestHandler(options: CreateRequestHandlerOptions): HttpRequestHandler;
|