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,61 +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 {
44
- // TODO:v5: remove this
45
- ...exceptionDetails,
46
- ...(exceptionDetails
47
- ? {
48
- // Reference: https://facebook.github.io/graphql/draft/#sec-Errors
49
- extensions: {
50
- ...originalError.extensions,
51
- exception: exceptionDetails,
52
- },
53
- }
54
- : null),
55
- message: error.message,
56
- locations: error.locations,
57
- path: error.path,
58
- };
59
- }
60
- exports.extendedFormatError = extendedFormatError;
61
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0ZW5kZWRGb3JtYXRFcnJvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wb3N0Z3JhcGhpbGUvZXh0ZW5kZWRGb3JtYXRFcnJvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFHQTs7R0FFRztBQUNILFNBQVMsV0FBVyxDQUFDLEdBQVUsRUFBRSxRQUFnQztJQUMvRCxNQUFNLE1BQU0sR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MsS0FBbUIsRUFDbkIsTUFBcUI7SUFFckIsSUFBSSxDQUFDLEtBQUssRUFBRTtRQUNWLE1BQU0sSUFBSSxLQUFLLENBQUMsbUNBQW1DLENBQUMsQ0FBQztLQUN0RDtJQUNELE1BQU0sYUFBYSxHQUFHLEtBQUssQ0FBQyxhQUFxQyxDQUFDO0lBQ2xFLE1BQU0sZ0JBQWdCLEdBQUcsYUFBYSxJQUFJLE1BQU0sQ0FBQyxDQUFDLENBQUMsV0FBVyxDQUFDLGFBQWEsRUFBRSxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0lBQ2xHLE9BQU87UUFDTCx1QkFBdUI7UUFDdkIsR0FBRyxnQkFBZ0I7UUFFbkIsR0FBRyxDQUFDLGdCQUFnQjtZQUNsQixDQUFDLENBQUM7Z0JBQ0Usa0VBQWtFO2dCQUNsRSxVQUFVLEVBQUU7b0JBQ1YsR0FBRyxhQUFhLENBQUMsVUFBVTtvQkFDM0IsU0FBUyxFQUFFLGdCQUFnQjtpQkFDNUI7YUFDRjtZQUNILENBQUMsQ0FBQyxJQUFJLENBQUM7UUFDVCxPQUFPLEVBQUUsS0FBSyxDQUFDLE9BQU87UUFDdEIsU0FBUyxFQUFFLEtBQUssQ0FBQyxTQUFTO1FBQzFCLElBQUksRUFBRSxLQUFLLENBQUMsSUFBSTtLQUNqQixDQUFDO0FBQ0osQ0FBQztBQTFCRCxrREEwQkMifQ==
@@ -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;