@axinom/mosaic-service-common 0.28.0-rc.8 → 0.28.0
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/dist/plugins/add-error-codes-enum-plugin.d.ts +1 -1
- package/dist/plugins/add-error-codes-enum-plugin.d.ts.map +1 -1
- package/dist/plugins/add-error-codes-enum-plugin.js.map +1 -1
- package/dist/plugins/annotate-types-with-permissions-plugin.d.ts +1 -1
- package/dist/plugins/annotate-types-with-permissions-plugin.d.ts.map +1 -1
- package/dist/plugins/generic-bulk-plugin-factory.d.ts +1 -1
- package/dist/plugins/generic-bulk-plugin-factory.d.ts.map +1 -1
- package/dist/plugins/generic-bulk-plugin-factory.js.map +1 -1
- package/dist/plugins/omit-from-query-root-plugin.d.ts +1 -1
- package/dist/plugins/omit-from-query-root-plugin.d.ts.map +1 -1
- package/dist/plugins/subscriptions-plugin-factory.d.ts +1 -1
- package/dist/plugins/subscriptions-plugin-factory.d.ts.map +1 -1
- package/dist/plugins/subscriptions-plugin-factory.js.map +1 -1
- package/dist/postgraphile/index.d.ts +1 -0
- package/dist/postgraphile/index.d.ts.map +1 -1
- package/dist/postgraphile/index.js +1 -0
- package/dist/postgraphile/index.js.map +1 -1
- package/dist/postgraphile/postgraphile-options-builder.d.ts +24 -46
- package/dist/postgraphile/postgraphile-options-builder.d.ts.map +1 -1
- package/dist/postgraphile/postgraphile-options-builder.js +31 -57
- package/dist/postgraphile/postgraphile-options-builder.js.map +1 -1
- package/dist/postgraphile/websocket-utils.d.ts +11 -0
- package/dist/postgraphile/websocket-utils.d.ts.map +1 -0
- package/dist/postgraphile/websocket-utils.js +17 -0
- package/dist/postgraphile/websocket-utils.js.map +1 -0
- package/dist/webhooks/models.d.ts +3 -3
- package/dist/webhooks/models.d.ts.map +1 -1
- package/dist/webhooks/validate-webhook-request.d.ts.map +1 -1
- package/dist/webhooks/validate-webhook-request.js +4 -2
- package/dist/webhooks/validate-webhook-request.js.map +1 -1
- package/package.json +6 -6
- package/src/plugins/add-error-codes-enum-plugin.ts +1 -1
- package/src/plugins/annotate-types-with-permissions-plugin.ts +1 -1
- package/src/plugins/generic-bulk-plugin-factory.ts +1 -1
- package/src/plugins/omit-from-query-root-plugin.ts +1 -1
- package/src/plugins/subscriptions-plugin-factory.ts +1 -1
- package/src/postgraphile/index.ts +1 -0
- package/src/postgraphile/postgraphile-options-builder.spec.ts +54 -89
- package/src/postgraphile/postgraphile-options-builder.ts +34 -60
- package/src/postgraphile/websocket-utils.ts +19 -0
- package/src/webhooks/models.ts +3 -3
- package/src/webhooks/validate-webhook-request.spec.ts +120 -1
- package/src/webhooks/validate-webhook-request.ts +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-error-codes-enum-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/add-error-codes-enum-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-error-codes-enum-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/add-error-codes-enum-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,IAAI,EAAU,eAAe,EAAgB,MAAM,WAAW,CAAC;AAqCxE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,8BAA8B,EAAE,CAC3C,cAAc,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE,KACpC,MAwCJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-error-codes-enum-plugin.js","sourceRoot":"","sources":["../../src/plugins/add-error-codes-enum-plugin.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"add-error-codes-enum-plugin.js","sourceRoot":"","sources":["../../src/plugins/add-error-codes-enum-plugin.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAE1C,sCAAwE;AAIxE;;;GAGG;AACH,MAAM,aAAa,GAAG,CACpB,cAAuC,EACpB,E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ACf;QACD,MAAM,MAAM,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,YAAY,CAC3B,yBAAe,EACf;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,4PAA4P;YACzQ,MAAM;SACP,EACD,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAC3B,CAAC;QAEF,OAAO,MAAM,CAAC,MAAM,EAAE;YACpB,CAAC,cAAc,CAAC,EAAE;gBAChB,IAAI,EAAE,QAAQ;aACf;SACF,CAAC,CAAC;IACL,CAAC,CACF,CAAC;IAEF,mEAAmE;IACnE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE;QAClC,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;QACpC,IAAI,KAAK,EAAE;YACT,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC,cAAc,CAAC,CAAC;SAC1C;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AA1CW,QAAA,8BAA8B,kCA0CzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotate-types-with-permissions-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/annotate-types-with-permissions-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"annotate-types-with-permissions-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/annotate-types-with-permissions-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,UAAU,SAAS;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,YAAY,GAAG,aAAa,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,aAAK,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAsD9D,iBAAS,yBAAyB,CAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7C,QAAQ,EAAE,SAAS,EAAE,EACrB,IAAI,EAAE,YAAY,GACjB,MAAM,CAeR;AAID;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,EAAE,MA2GhD,CAAC;AAEF,eAAO,MAAM,gCAAgC;;CAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-bulk-plugin-factory.d.ts","sourceRoot":"","sources":["../../src/plugins/generic-bulk-plugin-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generic-bulk-plugin-factory.d.ts","sourceRoot":"","sources":["../../src/plugins/generic-bulk-plugin-factory.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAS,MAAM,EAAE,MAAM,cAAc,CAAC;AAG7C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,MAAM,EAAE,UAAU,GAAG,kBAAkB,GAAG,SAAS,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,OAAO,CAAC;IAChC,cAAc,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CAC5C;AAgHD;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,0BACV,gBAAgB,KAAG,QAAQ,IAAI,CAAC,gBAC3C,YAAY,6DAEzB,MAiJF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-bulk-plugin-factory.js","sourceRoot":"","sources":["../../src/plugins/generic-bulk-plugin-factory.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"generic-bulk-plugin-factory.js","sourceRoot":"","sources":["../../src/plugins/generic-bulk-plugin-factory.ts"],"names":[],"mappings":";;;AACA,mDAAoD;AAGpD,+CAAqD;AA0DrD;;GAEG;AACH,MAAM,YAAY,GAAG,KAAK,EACxB,MAAkB,EAClB,OAAuB,EACvB,IAAoC,EACpC,OAAgB,EAChB,MAA6B,EACC,EAAE;;IAChC,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE;QAClC,MAAM,IAAI,KAAK,CACb,0CAA0C,MAAM,CAAC,UAAU,IAAI,CAChE,CAAC;KACH;IACD,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,OAAO,CACvC,MAAM,EACN,IAAA,oBAAW,EAAA;oCACqB,MAAM,CAAC,UAAU;oBACjC,MAAM,CAAC,SAAS;;cAEtB,MAAM,CAAC,cAAc;;;;KAI9B,EACD,SAAS,EACT,OAAO,EACP,IAAI,CACL,CAAC;IAEF,OAAO,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,0CAAE,QAAQ,0CAAE,KAAK,CAAC,GAAG,CAAC,CAAC,MAAe,EAAE,EAAE;QAChE,IAAA,0BAAgB,EAAC,MAAM,CAAC,CAAC;QACzB,OAAO,MAAM,CAAC,MAAM,CAAC,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gCAEzC,MAAM,QAAQ,CAAC;oCACb,SAAS,EAAE,GAAG;oCACd,UAAU,EAAE,MAAM,CAAC,QAAQ;oCAC3B,cAAc,EAAE,MAAM,CAAC,cAAc;oCACrC,SAAS,EAAE,MAAM,CAAC,SAAS;oCAC3B,sBAAsB,EAAE,eAAe;oCACvC,cAAc,EAAE,OAAO;iCACxB,CAAC,CAAC;gCAEH,OAAO;oCACL,WAAW,EAAE,GAAG;oCAChB,UAAU,EAAE,GAAG,CAAC,MAAM;iCACvB,CAAC;4BACJ,CAAC;yBACF,CAAC;wBAEF,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE;4BACnB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS;yBAC1C,CAAC,CAAC;qBACJ;iBACF;aACF;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AArJW,QAAA,wBAAwB,4BAqJnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"omit-from-query-root-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/omit-from-query-root-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"omit-from-query-root-plugin.d.ts","sourceRoot":"","sources":["../../src/plugins/omit-from-query-root-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,MAAM,EAAE,MAAM,cAAc,CAAC;AAclD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,EAAE,MA2BrC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin } from '
|
|
1
|
+
import { Plugin } from 'postgraphile';
|
|
2
2
|
/**
|
|
3
3
|
* Factory function to create a makeExtendSchemaPlugin that adds a subscription endpoint for specific entity.
|
|
4
4
|
* @param mainTableName name of the table in the database without schema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions-plugin-factory.d.ts","sourceRoot":"","sources":["../../src/plugins/subscriptions-plugin-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subscriptions-plugin-factory.d.ts","sourceRoot":"","sources":["../../src/plugins/subscriptions-plugin-factory.ts"],"names":[],"mappings":"AAUA,OAAO,EAAS,MAAM,EAAE,MAAM,cAAc,CAAC;AAyD7C;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,kBACtB,MAAM,YACX,MAAM,kBACD,KAAK,GAAG,MAAM,KAC5B,MAoCC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions-plugin-factory.js","sourceRoot":"","sources":["../../src/plugins/subscriptions-plugin-factory.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"subscriptions-plugin-factory.js","sourceRoot":"","sources":["../../src/plugins/subscriptions-plugin-factory.ts"],"names":[],"mappings":";;;;;;AAEA,mDAIwB;AAGxB,4DAAoC;AAsBpC;;;;GAIG;AACH,SAAS,mBAAmB,CAC1B,KAAY,EACZ,QAAa;IAEb,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IAC7B,OAAO,KAAK,EACV,KAAoC,EACpC,KAA8B,EAC9B,QAAa;IACb,sDAAsD;IACtD,EAAE,QAAQ,EAAE,EAAE,4BAA4B,EAAE,EAAE,EAC9C,EAAE;QACF,MAAM,IAAI,GAAG,MAAM,4BAA4B,CAC7C,QAAQ,EACR,CAAC,UAAe,EAAE,UAAwB,EAAE,EAAE;YAC5C,UAAU,CAAC,KAAK,CACd,GAAG,CAAC,QAAQ,CAAA,GAAG,UAAU,SAAS,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAC7D,CAAC;QACJ,CAAC,CACF,CAAC;QACF,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,KAAK;IAIZ,OAAO,KAAK,EAAE,KAAoC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;AACvE,CAAC;AAED;;;;;GAKG;AACI,MAAM,0BAA0B,GAAG,CACxC,aAAqB,EACrB,QAAgB,EAChB,gBAAgC,KAAK,EAC7B,EAAE,CACV,IAAA,uCAAsB,EAAC,CAAC,KAAY,EAAE,EAAE;IACtC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,YAAY,GAAG,oBAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACzD,MAAM,WAAW,GACf,oBAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,qBAAqB,CAAC;IAC/D,MAAM,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;IAC7C,OAAO;QACL,QAAQ,EAAE,IAAA,oBAAG,EAAA;aACN,WAAW;cACV,aAAa;UACjB,YAAY,KAAK,QAAQ;;;;;;2BAMR,QAAQ;;UAEzB,YAAY,YAAY,WAAW;oCACT,SAAS;;KAExC;QACC,SAAS,EAAE;YACT,CAAC,WAAW,CAAC,EAAE;gBACb,EAAE,EAAE,KAAK,EAAE;gBACX,CAAC,YAAY,CAAC,EAAE,mBAAmB,CACjC,KAAK,EACL,GAAG,CAAC,QAAQ,CAAC,CAAC,cAAc,aAAa,EAAE,CAAC,CAAC,CAC9C;aACF;YACD,YAAY,EAAE;gBACZ,CAAC,GAAG,YAAY,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;aAC7C;SACF;KACqB,CAAC;AAC3B,CAAC,CAAC,CAAC;AAxCQ,QAAA,0BAA0B,8BAwClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/postgraphile/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/postgraphile/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC"}
|
|
@@ -11,4 +11,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./postgraphile-options-builder"), exports);
|
|
14
|
+
__exportStar(require("./websocket-utils"), exports);
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/postgraphile/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA+C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/postgraphile/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA+C;AAC/C,oDAAkC"}
|
|
@@ -22,19 +22,10 @@ export declare type HookPluginFactory = (buildOptions: PostGraphileOptions<Reque
|
|
|
22
22
|
* A builder class that allows construction of postgraphile options using multiple dedicated extension methods.
|
|
23
23
|
*/
|
|
24
24
|
export declare class PostgraphileOptionsBuilder {
|
|
25
|
-
private readonly isDev;
|
|
26
|
-
private readonly graphqlGuiEnabled;
|
|
27
25
|
private transformers;
|
|
28
26
|
private headers;
|
|
29
27
|
private pluginHooks;
|
|
30
28
|
private hookFuncs;
|
|
31
|
-
/**
|
|
32
|
-
* Creates a builder instance.
|
|
33
|
-
*
|
|
34
|
-
* @param isDev used to make decisions to either include or omit properties/plugins with calls like `setDefaultSettings`, `addDevPlugins` and `addDevProperties`
|
|
35
|
-
* @param graphqlGuiEnabled used to make decisions to either enable or disable graphiql GUI and related functionality with calls like `setDefaultSettings` and `setGraphiql`
|
|
36
|
-
*/
|
|
37
|
-
constructor(isDev: boolean, graphqlGuiEnabled: boolean);
|
|
38
29
|
/**
|
|
39
30
|
* Builds a postgraphile options object with previously used extension methods.
|
|
40
31
|
*/
|
|
@@ -50,7 +41,7 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
50
41
|
* @example
|
|
51
42
|
*
|
|
52
43
|
* ```ts
|
|
53
|
-
new PostgraphileOptionsBuilder(
|
|
44
|
+
new PostgraphileOptionsBuilder()
|
|
54
45
|
.addHookPluginFactory(customHookFactory)
|
|
55
46
|
* ```
|
|
56
47
|
*
|
|
@@ -63,7 +54,7 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
63
54
|
* @example
|
|
64
55
|
*
|
|
65
56
|
* ```ts
|
|
66
|
-
new PostgraphileOptionsBuilder(
|
|
57
|
+
new PostgraphileOptionsBuilder()
|
|
67
58
|
.addHookPluginFunction(subscriptionAuthorizationHook)
|
|
68
59
|
* ```
|
|
69
60
|
*
|
|
@@ -76,7 +67,7 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
76
67
|
* Example:
|
|
77
68
|
*
|
|
78
69
|
* ```ts
|
|
79
|
-
new PostgraphileOptionsBuilder(
|
|
70
|
+
new PostgraphileOptionsBuilder()
|
|
80
71
|
.setPgSettings(async req => {
|
|
81
72
|
const { subject } = await getManagementAuthenticationContext(req, idServiceParams);
|
|
82
73
|
return buildPgSettings(subject, config.dbGqlRole, config.serviceId);
|
|
@@ -91,7 +82,7 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
91
82
|
* Example:
|
|
92
83
|
*
|
|
93
84
|
* ```ts
|
|
94
|
-
new PostgraphileOptionsBuilder(
|
|
85
|
+
new PostgraphileOptionsBuilder()
|
|
95
86
|
.setErrorsHandler(errors => {
|
|
96
87
|
return graphqlErrorsHandler(
|
|
97
88
|
errors,
|
|
@@ -106,11 +97,11 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
106
97
|
*/
|
|
107
98
|
setErrorsHandler(handleErrors: (errors: readonly GraphQLError[], req: Request, res: Response) => GraphQLErrorExtended[]): PostgraphileOptionsBuilder;
|
|
108
99
|
/**
|
|
109
|
-
* Sets properties of postgraphile options object to be used in
|
|
100
|
+
* Sets properties of postgraphile options object to be used in without any conditions. Additional calls will override and add properties.
|
|
110
101
|
* Example:
|
|
111
102
|
*
|
|
112
103
|
* ```ts
|
|
113
|
-
new PostgraphileOptionsBuilder(
|
|
104
|
+
new PostgraphileOptionsBuilder()
|
|
114
105
|
.setProperties({
|
|
115
106
|
enableCors: true,
|
|
116
107
|
dynamicJson: true,
|
|
@@ -123,13 +114,14 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
123
114
|
*/
|
|
124
115
|
setProperties(properties: PostGraphileOptions<Request, Response>): PostgraphileOptionsBuilder;
|
|
125
116
|
/**
|
|
126
|
-
* Sets properties of postgraphile options object to be used
|
|
127
|
-
*
|
|
117
|
+
* Sets properties of postgraphile options object to be used based on some
|
|
118
|
+
* condition (use if true, omit if false). Additional calls will override and
|
|
119
|
+
* add properties.
|
|
128
120
|
* Example:
|
|
129
121
|
*
|
|
130
122
|
* ```ts
|
|
131
|
-
new PostgraphileOptionsBuilder(
|
|
132
|
-
.
|
|
123
|
+
new PostgraphileOptionsBuilder()
|
|
124
|
+
.setConditionalProperties(config.isDev, {
|
|
133
125
|
exportGqlSchemaPath: './src/generated/schema.graphql',
|
|
134
126
|
watchPg: true,
|
|
135
127
|
graphiql: true,
|
|
@@ -139,13 +131,13 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
139
131
|
* ```
|
|
140
132
|
* @param properties An object containing postgraphile options.
|
|
141
133
|
*/
|
|
142
|
-
|
|
134
|
+
setConditionalProperties(condition: boolean, properties: PostGraphileOptions<Request, Response>): PostgraphileOptionsBuilder;
|
|
143
135
|
/**
|
|
144
136
|
* Sets all necessary postgraphile properties to enable subscriptions.
|
|
145
137
|
* Example:
|
|
146
138
|
*
|
|
147
139
|
* ```ts
|
|
148
|
-
new PostgraphileOptionsBuilder(
|
|
140
|
+
new PostgraphileOptionsBuilder()
|
|
149
141
|
.enableSubscriptions({
|
|
150
142
|
plugin: SubscriptionsPlugin,
|
|
151
143
|
websocketMiddlewares: middlewares,
|
|
@@ -179,8 +171,7 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
179
171
|
* live) then you may want to authenticate your users using sessions or
|
|
180
172
|
* similar. You can pass some simple middlewares here that will be executed
|
|
181
173
|
* against the websocket connection in order to perform authentication.
|
|
182
|
-
* @param hookFactory A factory function for a Postgraphile hook plugin
|
|
183
|
-
* authorize subscription operations done over the web-socket.
|
|
174
|
+
* @param hookFactory A factory function for a Postgraphile hook plugin.
|
|
184
175
|
*/
|
|
185
176
|
enableSubscriptions({ plugin, websocketMiddlewares, hookFactory, }: {
|
|
186
177
|
plugin: Plugin;
|
|
@@ -192,7 +183,7 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
192
183
|
* Example:
|
|
193
184
|
*
|
|
194
185
|
```ts
|
|
195
|
-
new PostgraphileOptionsBuilder(
|
|
186
|
+
new PostgraphileOptionsBuilder()
|
|
196
187
|
.addPlugins(
|
|
197
188
|
PgSimplifyInflectorPlugin,
|
|
198
189
|
ScalarTypesPlugin,
|
|
@@ -210,31 +201,18 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
210
201
|
* Example:
|
|
211
202
|
*
|
|
212
203
|
```ts
|
|
213
|
-
new PostgraphileOptionsBuilder(
|
|
204
|
+
new PostgraphileOptionsBuilder()
|
|
214
205
|
.addConditionalPlugins(config.isDev || config.enablePopulatePlugins, PopulateMoviesPlugin, PopulateTvshowsPlugin)
|
|
215
206
|
```
|
|
216
207
|
* @param plugins Comma-separated list of Graphile Engine schema plugins to load after the default plugins.
|
|
217
208
|
*/
|
|
218
209
|
addConditionalPlugins(condition: boolean, ...plugins: Plugin[]): PostgraphileOptionsBuilder;
|
|
219
|
-
/**
|
|
220
|
-
* Adds multiple graphile engine plugins to `appendPlugins` array of postgraphile options object to be used in dev environments only.
|
|
221
|
-
* `setAdditionalGraphQLContextFromRequest` and `addGraphileBuildOptions` methods can be used to pass parameters to said plugins.
|
|
222
|
-
* Builder constructor parameter is used to make a decision if plugins should be used or not (use if true, omit if false).
|
|
223
|
-
* Example:
|
|
224
|
-
*
|
|
225
|
-
```ts
|
|
226
|
-
new PostgraphileOptionsBuilder(config.isDev, config.graphqlGuiEnabled)
|
|
227
|
-
.addDevPlugins(PopulateMoviesPlugin, PopulateTvshowsPlugin)
|
|
228
|
-
```
|
|
229
|
-
* @param plugins Comma-separated list of Graphile Engine schema plugins to load after the default plugins.
|
|
230
|
-
*/
|
|
231
|
-
addDevPlugins(...plugins: Plugin[]): PostgraphileOptionsBuilder;
|
|
232
210
|
/**
|
|
233
211
|
* Skips multiple default postgraphile plugins by adding them to `skipPlugins` array of postgraphile options object .
|
|
234
212
|
* Example:
|
|
235
213
|
*
|
|
236
214
|
```ts
|
|
237
|
-
new PostgraphileOptionsBuilder(
|
|
215
|
+
new PostgraphileOptionsBuilder()
|
|
238
216
|
.skipPlugins(NodePlugin, MutationPayloadQueryPlugin)
|
|
239
217
|
```
|
|
240
218
|
* @param plugins Comma-separated list of Graphile Engine schema plugins to skip.
|
|
@@ -245,7 +223,7 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
245
223
|
* Example:
|
|
246
224
|
*
|
|
247
225
|
```ts
|
|
248
|
-
new PostgraphileOptionsBuilder(
|
|
226
|
+
new PostgraphileOptionsBuilder()
|
|
249
227
|
.addGraphileBuildOptions({ pgSkipInstallingWatchFixtures: true })
|
|
250
228
|
```
|
|
251
229
|
* @param graphileBuildOptions Additional Options to pass through into the graphile schema building system (received via the second argument of a plugin).
|
|
@@ -256,7 +234,7 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
256
234
|
*
|
|
257
235
|
* Example:
|
|
258
236
|
```ts
|
|
259
|
-
new PostgraphileOptionsBuilder(
|
|
237
|
+
new PostgraphileOptionsBuilder()
|
|
260
238
|
.setAdditionalGraphQLContextFromRequest(async req => {
|
|
261
239
|
const { subject } = await getManagementAuthenticationContext(req);
|
|
262
240
|
return { subject, serviceId: config.serviceId };
|
|
@@ -266,16 +244,16 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
266
244
|
*/
|
|
267
245
|
setAdditionalGraphQLContextFromRequest(callback: (req: Request, res: Response) => Promise<Record<string, any>>): PostgraphileOptionsBuilder;
|
|
268
246
|
/**
|
|
269
|
-
* Enables or disables graphiql GUI depending on a
|
|
247
|
+
* Enables or disables graphiql GUI depending on a passed condition parameter. Enable if true, disable if false.
|
|
270
248
|
* Sets 3 postgraphile properties: `graphiql`, `enhanceGraphiql` and `allowExplain`.
|
|
271
249
|
* Example:
|
|
272
250
|
*
|
|
273
251
|
* ```ts
|
|
274
|
-
new PostgraphileOptionsBuilder(
|
|
275
|
-
.setGraphiql()
|
|
252
|
+
new PostgraphileOptionsBuilder()
|
|
253
|
+
.setGraphiql(config.graphqlGuiEnabled)
|
|
276
254
|
* ```
|
|
277
255
|
*/
|
|
278
|
-
setGraphiql(): PostgraphileOptionsBuilder;
|
|
256
|
+
setGraphiql(condition: boolean): PostgraphileOptionsBuilder;
|
|
279
257
|
/**
|
|
280
258
|
* Sets a response header for each GraphQL request.
|
|
281
259
|
*
|
|
@@ -287,6 +265,6 @@ export declare class PostgraphileOptionsBuilder {
|
|
|
287
265
|
* Sets default values for properties that we see as best practices which most services should start from.
|
|
288
266
|
* This includes the default GraphQL errors handler, suggested default properties, development properties in dev-environments, and excludes the 'NodePlugin'.
|
|
289
267
|
*/
|
|
290
|
-
setDefaultSettings(): PostgraphileOptionsBuilder;
|
|
268
|
+
setDefaultSettings(isDev: boolean, graphqlGuiEnabled: boolean): PostgraphileOptionsBuilder;
|
|
291
269
|
}
|
|
292
270
|
//# sourceMappingURL=postgraphile-options-builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgraphile-options-builder.d.ts","sourceRoot":"","sources":["../../src/postgraphile/postgraphile-options-builder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAc,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EACL,oBAAoB,EAEpB,UAAU,EACV,KAAK,EACL,OAAO,EACP,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAIL,IAAI,EAGL,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;;;;;GAaG;AACH,oBAAY,iBAAiB,GAAG,CAC9B,YAAY,EAAE,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,SAAS,KAC7D,kBAAkB,CAAC;AAExB;;GAEG;AACH,qBAAa,0BAA0B;
|
|
1
|
+
{"version":3,"file":"postgraphile-options-builder.d.ts","sourceRoot":"","sources":["../../src/postgraphile/postgraphile-options-builder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAc,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EACL,oBAAoB,EAEpB,UAAU,EACV,KAAK,EACL,OAAO,EACP,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAIL,IAAI,EAGL,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;;;;;GAaG;AACH,oBAAY,iBAAiB,GAAG,CAC9B,YAAY,EAAE,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,SAAS,KAC7D,kBAAkB,CAAC;AAExB;;GAEG;AACH,qBAAa,0BAA0B;IACrC,OAAO,CAAC,YAAY,CAEgC;IAEpD,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,WAAW,CAA0D;IAC7E,OAAO,CAAC,SAAS,CAAwD;IAEzE;;OAEG;IACI,KAAK,IAAI,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC;IAoBtD;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAkB9B;;;;;;;;;;;;;OAa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M,EAAE,GACnB,0BAA0B;IAO7B;;;;;;;;;OASG;IACI,WAAW,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,0BAA0B;IAUpE;;;;;;;;;OASG;IACI,uBAAuB,CAC5B,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,GACrC,0BAA0B;IAW7B;;;;;;;;;;;;OAYG;IACI,sCAAsC,CAC3C,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GACtE,0BAA0B;IAQ7B;;;;;;;;;OASG;IACI,WAAW,CAAC,SAAS,EAAE,OAAO,GAAG,0BAA0B;IAclE;;;;;OAKG;IACI,SAAS,CACd,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAChC,0BAA0B;IAK7B;;;OAGG;IACI,kBAAkB,CACvB,KAAK,EAAE,OAAO,EACd,iBAAiB,EAAE,OAAO,GACzB,0BAA0B;CA8B9B"}
|
|
@@ -13,15 +13,7 @@ const common_1 = require("../common");
|
|
|
13
13
|
* A builder class that allows construction of postgraphile options using multiple dedicated extension methods.
|
|
14
14
|
*/
|
|
15
15
|
class PostgraphileOptionsBuilder {
|
|
16
|
-
|
|
17
|
-
* Creates a builder instance.
|
|
18
|
-
*
|
|
19
|
-
* @param isDev used to make decisions to either include or omit properties/plugins with calls like `setDefaultSettings`, `addDevPlugins` and `addDevProperties`
|
|
20
|
-
* @param graphqlGuiEnabled used to make decisions to either enable or disable graphiql GUI and related functionality with calls like `setDefaultSettings` and `setGraphiql`
|
|
21
|
-
*/
|
|
22
|
-
constructor(isDev, graphqlGuiEnabled) {
|
|
23
|
-
this.isDev = isDev;
|
|
24
|
-
this.graphqlGuiEnabled = graphqlGuiEnabled;
|
|
16
|
+
constructor() {
|
|
25
17
|
this.transformers = [];
|
|
26
18
|
this.headers = {};
|
|
27
19
|
this.pluginHooks = new Set();
|
|
@@ -69,7 +61,7 @@ class PostgraphileOptionsBuilder {
|
|
|
69
61
|
* @example
|
|
70
62
|
*
|
|
71
63
|
* ```ts
|
|
72
|
-
new PostgraphileOptionsBuilder(
|
|
64
|
+
new PostgraphileOptionsBuilder()
|
|
73
65
|
.addHookPluginFactory(customHookFactory)
|
|
74
66
|
* ```
|
|
75
67
|
*
|
|
@@ -85,7 +77,7 @@ class PostgraphileOptionsBuilder {
|
|
|
85
77
|
* @example
|
|
86
78
|
*
|
|
87
79
|
* ```ts
|
|
88
|
-
new PostgraphileOptionsBuilder(
|
|
80
|
+
new PostgraphileOptionsBuilder()
|
|
89
81
|
.addHookPluginFunction(subscriptionAuthorizationHook)
|
|
90
82
|
* ```
|
|
91
83
|
*
|
|
@@ -101,7 +93,7 @@ class PostgraphileOptionsBuilder {
|
|
|
101
93
|
* Example:
|
|
102
94
|
*
|
|
103
95
|
* ```ts
|
|
104
|
-
new PostgraphileOptionsBuilder(
|
|
96
|
+
new PostgraphileOptionsBuilder()
|
|
105
97
|
.setPgSettings(async req => {
|
|
106
98
|
const { subject } = await getManagementAuthenticationContext(req, idServiceParams);
|
|
107
99
|
return buildPgSettings(subject, config.dbGqlRole, config.serviceId);
|
|
@@ -122,7 +114,7 @@ class PostgraphileOptionsBuilder {
|
|
|
122
114
|
* Example:
|
|
123
115
|
*
|
|
124
116
|
* ```ts
|
|
125
|
-
new PostgraphileOptionsBuilder(
|
|
117
|
+
new PostgraphileOptionsBuilder()
|
|
126
118
|
.setErrorsHandler(errors => {
|
|
127
119
|
return graphqlErrorsHandler(
|
|
128
120
|
errors,
|
|
@@ -143,11 +135,11 @@ class PostgraphileOptionsBuilder {
|
|
|
143
135
|
return this;
|
|
144
136
|
}
|
|
145
137
|
/**
|
|
146
|
-
* Sets properties of postgraphile options object to be used in
|
|
138
|
+
* Sets properties of postgraphile options object to be used in without any conditions. Additional calls will override and add properties.
|
|
147
139
|
* Example:
|
|
148
140
|
*
|
|
149
141
|
* ```ts
|
|
150
|
-
new PostgraphileOptionsBuilder(
|
|
142
|
+
new PostgraphileOptionsBuilder()
|
|
151
143
|
.setProperties({
|
|
152
144
|
enableCors: true,
|
|
153
145
|
dynamicJson: true,
|
|
@@ -165,13 +157,14 @@ class PostgraphileOptionsBuilder {
|
|
|
165
157
|
return this;
|
|
166
158
|
}
|
|
167
159
|
/**
|
|
168
|
-
* Sets properties of postgraphile options object to be used
|
|
169
|
-
*
|
|
160
|
+
* Sets properties of postgraphile options object to be used based on some
|
|
161
|
+
* condition (use if true, omit if false). Additional calls will override and
|
|
162
|
+
* add properties.
|
|
170
163
|
* Example:
|
|
171
164
|
*
|
|
172
165
|
* ```ts
|
|
173
|
-
new PostgraphileOptionsBuilder(
|
|
174
|
-
.
|
|
166
|
+
new PostgraphileOptionsBuilder()
|
|
167
|
+
.setConditionalProperties(config.isDev, {
|
|
175
168
|
exportGqlSchemaPath: './src/generated/schema.graphql',
|
|
176
169
|
watchPg: true,
|
|
177
170
|
graphiql: true,
|
|
@@ -181,8 +174,8 @@ class PostgraphileOptionsBuilder {
|
|
|
181
174
|
* ```
|
|
182
175
|
* @param properties An object containing postgraphile options.
|
|
183
176
|
*/
|
|
184
|
-
|
|
185
|
-
if (
|
|
177
|
+
setConditionalProperties(condition, properties) {
|
|
178
|
+
if (condition) {
|
|
186
179
|
this.transformers.push((options) => {
|
|
187
180
|
return Object.assign(Object.assign({}, options), properties);
|
|
188
181
|
});
|
|
@@ -194,7 +187,7 @@ class PostgraphileOptionsBuilder {
|
|
|
194
187
|
* Example:
|
|
195
188
|
*
|
|
196
189
|
* ```ts
|
|
197
|
-
new PostgraphileOptionsBuilder(
|
|
190
|
+
new PostgraphileOptionsBuilder()
|
|
198
191
|
.enableSubscriptions({
|
|
199
192
|
plugin: SubscriptionsPlugin,
|
|
200
193
|
websocketMiddlewares: middlewares,
|
|
@@ -228,8 +221,7 @@ class PostgraphileOptionsBuilder {
|
|
|
228
221
|
* live) then you may want to authenticate your users using sessions or
|
|
229
222
|
* similar. You can pass some simple middlewares here that will be executed
|
|
230
223
|
* against the websocket connection in order to perform authentication.
|
|
231
|
-
* @param hookFactory A factory function for a Postgraphile hook plugin
|
|
232
|
-
* authorize subscription operations done over the web-socket.
|
|
224
|
+
* @param hookFactory A factory function for a Postgraphile hook plugin.
|
|
233
225
|
*/
|
|
234
226
|
enableSubscriptions({ plugin, websocketMiddlewares, hookFactory, }) {
|
|
235
227
|
this.transformers.push((options) => {
|
|
@@ -264,7 +256,7 @@ class PostgraphileOptionsBuilder {
|
|
|
264
256
|
* Example:
|
|
265
257
|
*
|
|
266
258
|
```ts
|
|
267
|
-
new PostgraphileOptionsBuilder(
|
|
259
|
+
new PostgraphileOptionsBuilder()
|
|
268
260
|
.addPlugins(
|
|
269
261
|
PgSimplifyInflectorPlugin,
|
|
270
262
|
ScalarTypesPlugin,
|
|
@@ -291,7 +283,7 @@ class PostgraphileOptionsBuilder {
|
|
|
291
283
|
* Example:
|
|
292
284
|
*
|
|
293
285
|
```ts
|
|
294
|
-
new PostgraphileOptionsBuilder(
|
|
286
|
+
new PostgraphileOptionsBuilder()
|
|
295
287
|
.addConditionalPlugins(config.isDev || config.enablePopulatePlugins, PopulateMoviesPlugin, PopulateTvshowsPlugin)
|
|
296
288
|
```
|
|
297
289
|
* @param plugins Comma-separated list of Graphile Engine schema plugins to load after the default plugins.
|
|
@@ -302,30 +294,12 @@ class PostgraphileOptionsBuilder {
|
|
|
302
294
|
}
|
|
303
295
|
return this;
|
|
304
296
|
}
|
|
305
|
-
/**
|
|
306
|
-
* Adds multiple graphile engine plugins to `appendPlugins` array of postgraphile options object to be used in dev environments only.
|
|
307
|
-
* `setAdditionalGraphQLContextFromRequest` and `addGraphileBuildOptions` methods can be used to pass parameters to said plugins.
|
|
308
|
-
* Builder constructor parameter is used to make a decision if plugins should be used or not (use if true, omit if false).
|
|
309
|
-
* Example:
|
|
310
|
-
*
|
|
311
|
-
```ts
|
|
312
|
-
new PostgraphileOptionsBuilder(config.isDev, config.graphqlGuiEnabled)
|
|
313
|
-
.addDevPlugins(PopulateMoviesPlugin, PopulateTvshowsPlugin)
|
|
314
|
-
```
|
|
315
|
-
* @param plugins Comma-separated list of Graphile Engine schema plugins to load after the default plugins.
|
|
316
|
-
*/
|
|
317
|
-
addDevPlugins(...plugins) {
|
|
318
|
-
if (this.isDev) {
|
|
319
|
-
this.addPlugins(...plugins);
|
|
320
|
-
}
|
|
321
|
-
return this;
|
|
322
|
-
}
|
|
323
297
|
/**
|
|
324
298
|
* Skips multiple default postgraphile plugins by adding them to `skipPlugins` array of postgraphile options object .
|
|
325
299
|
* Example:
|
|
326
300
|
*
|
|
327
301
|
```ts
|
|
328
|
-
new PostgraphileOptionsBuilder(
|
|
302
|
+
new PostgraphileOptionsBuilder()
|
|
329
303
|
.skipPlugins(NodePlugin, MutationPayloadQueryPlugin)
|
|
330
304
|
```
|
|
331
305
|
* @param plugins Comma-separated list of Graphile Engine schema plugins to skip.
|
|
@@ -345,7 +319,7 @@ class PostgraphileOptionsBuilder {
|
|
|
345
319
|
* Example:
|
|
346
320
|
*
|
|
347
321
|
```ts
|
|
348
|
-
new PostgraphileOptionsBuilder(
|
|
322
|
+
new PostgraphileOptionsBuilder()
|
|
349
323
|
.addGraphileBuildOptions({ pgSkipInstallingWatchFixtures: true })
|
|
350
324
|
```
|
|
351
325
|
* @param graphileBuildOptions Additional Options to pass through into the graphile schema building system (received via the second argument of a plugin).
|
|
@@ -363,7 +337,7 @@ class PostgraphileOptionsBuilder {
|
|
|
363
337
|
*
|
|
364
338
|
* Example:
|
|
365
339
|
```ts
|
|
366
|
-
new PostgraphileOptionsBuilder(
|
|
340
|
+
new PostgraphileOptionsBuilder()
|
|
367
341
|
.setAdditionalGraphQLContextFromRequest(async req => {
|
|
368
342
|
const { subject } = await getManagementAuthenticationContext(req);
|
|
369
343
|
return { subject, serviceId: config.serviceId };
|
|
@@ -379,21 +353,21 @@ class PostgraphileOptionsBuilder {
|
|
|
379
353
|
return this;
|
|
380
354
|
}
|
|
381
355
|
/**
|
|
382
|
-
* Enables or disables graphiql GUI depending on a
|
|
356
|
+
* Enables or disables graphiql GUI depending on a passed condition parameter. Enable if true, disable if false.
|
|
383
357
|
* Sets 3 postgraphile properties: `graphiql`, `enhanceGraphiql` and `allowExplain`.
|
|
384
358
|
* Example:
|
|
385
359
|
*
|
|
386
360
|
* ```ts
|
|
387
|
-
new PostgraphileOptionsBuilder(
|
|
388
|
-
.setGraphiql()
|
|
361
|
+
new PostgraphileOptionsBuilder()
|
|
362
|
+
.setGraphiql(config.graphqlGuiEnabled)
|
|
389
363
|
* ```
|
|
390
364
|
*/
|
|
391
|
-
setGraphiql() {
|
|
365
|
+
setGraphiql(condition) {
|
|
392
366
|
this.transformers.push((options) => {
|
|
393
367
|
return Object.assign(Object.assign({}, options), {
|
|
394
|
-
graphiql:
|
|
395
|
-
enhanceGraphiql:
|
|
396
|
-
allowExplain:
|
|
368
|
+
graphiql: condition,
|
|
369
|
+
enhanceGraphiql: condition,
|
|
370
|
+
allowExplain: condition,
|
|
397
371
|
});
|
|
398
372
|
});
|
|
399
373
|
return this;
|
|
@@ -412,7 +386,7 @@ class PostgraphileOptionsBuilder {
|
|
|
412
386
|
* Sets default values for properties that we see as best practices which most services should start from.
|
|
413
387
|
* This includes the default GraphQL errors handler, suggested default properties, development properties in dev-environments, and excludes the 'NodePlugin'.
|
|
414
388
|
*/
|
|
415
|
-
setDefaultSettings() {
|
|
389
|
+
setDefaultSettings(isDev, graphqlGuiEnabled) {
|
|
416
390
|
this.setErrorsHandler((errors) => {
|
|
417
391
|
return (0, common_1.graphqlErrorsHandler)(errors, common_1.defaultPgErrorMapper, common_1.defaultWriteLogMapper, new common_1.Logger({ context: common_1.DefaultErrorHandlerLogContext }));
|
|
418
392
|
})
|
|
@@ -426,13 +400,13 @@ class PostgraphileOptionsBuilder {
|
|
|
426
400
|
disableQueryLog: true,
|
|
427
401
|
retryOnInitFail: true,
|
|
428
402
|
})
|
|
429
|
-
.
|
|
403
|
+
.setConditionalProperties(isDev, {
|
|
430
404
|
exportGqlSchemaPath: './src/generated/graphql/schema.graphql',
|
|
431
405
|
watchPg: true,
|
|
432
406
|
disableQueryLog: false,
|
|
433
407
|
retryOnInitFail: false,
|
|
434
408
|
})
|
|
435
|
-
.setGraphiql()
|
|
409
|
+
.setGraphiql(graphqlGuiEnabled)
|
|
436
410
|
.skipPlugins(graphile_build_1.NodePlugin); // removes some nodeId and byNodeId endpoints, but still leaves support for cursor pagination
|
|
437
411
|
return this;
|
|
438
412
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgraphile-options-builder.js","sourceRoot":"","sources":["../../src/postgraphile/postgraphile-options-builder.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAuD;AACvD,oEAA2C;AAE3C,mDAAoD;AAGpD,+CAQsB;AACtB,sCAOmB;AAoBnB;;GAEG;AACH,MAAa,0BAA0B;
|
|
1
|
+
{"version":3,"file":"postgraphile-options-builder.js","sourceRoot":"","sources":["../../src/postgraphile/postgraphile-options-builder.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAuD;AACvD,oEAA2C;AAE3C,mDAAoD;AAGpD,+CAQsB;AACtB,sCAOmB;AAoBnB;;GAEG;AACH,MAAa,0BAA0B;IAAvC;QACU,iBAAY,GAE6B,EAAE,CAAC;QAE5C,YAAO,GAAqC,EAAE,CAAC;QAC/C,gBAAW,GAA4B,IAAI,GAAG,EAAsB,CAAC;QACrE,cAAS,GAA2B,IAAI,GAAG,EAAqB,CAAC;IAgd3E,CAAC;IA9cC;;OAEG;IACI,KAAK;QACV,IAAI,OAAO,GAA2C,EAAE,CAAC;QACzD,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,YAAY,EAAE;YACzC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;SAC9B;QAED,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAE9B,yCAAyC;QACzC,CAAC,GAAG,IA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;IACI,SAAS,CACd,IAAY,EACZ,KAAiC;QAEjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,kBAAkB,CACvB,KAAc,EACd,iBAA0B;QAE1B,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,EAAE;YAC/B,OAAO,IAAA,6BAAoB,EACzB,MAAM,EACN,6BAAoB,EACpB,8BAAqB,EACrB,IAAI,eAAM,CAAC,EAAE,OAAO,EAAE,sCAA6B,EAAE,CAAC,CACvD,CAAC;QACJ,CAAC,CAAC;aACC,aAAa,CAAC;YACb,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,IAAI;YACjB,UAAU,EAAE,KAAK;YACjB,eAAe,EAAE,MAAM;YACvB,0BAA0B,EAAE,KAAK;YAEjC,OAAO,EAAE,KAAK;YACd,eAAe,EAAE,IAAI;YACrB,eAAe,EAAE,IAAI;SACtB,CAAC;aACD,wBAAwB,CAAC,KAAK,EAAE;YAC/B,mBAAmB,EAAE,wCAAwC;YAC7D,OAAO,EAAE,IAAI;YACb,eAAe,EAAE,KAAK;YACtB,eAAe,EAAE,KAAK;SACvB,CAAC;aACD,WAAW,CAAC,iBAAiB,CAAC;aAC9B,WAAW,CAAC,2BAAU,CAAC,CAAC,CAAC,6FAA6F;QACzH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAvdD,gEAudC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Request } from 'express';
|
|
2
|
+
import { WebSocket } from 'graphql-ws';
|
|
3
|
+
/**
|
|
4
|
+
* Extract the reference to web socket when given a request object that is coming
|
|
5
|
+
* from Postgraphile. The web socket reference is attached as a symbol.
|
|
6
|
+
*
|
|
7
|
+
* @param req A Postgraphile request.
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare const getWebsocketFromRequest: (req: Request) => WebSocket | undefined;
|
|
11
|
+
//# sourceMappingURL=websocket-utils.d.ts.map
|