@makerx/graphql-core 2.1.0 → 2.2.1

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 (77) hide show
  1. package/User.d.ts +1 -2
  2. package/User.js +7 -6
  3. package/User.js.map +1 -1
  4. package/User.mjs +48 -0
  5. package/User.mjs.map +1 -0
  6. package/context.d.ts +1 -2
  7. package/context.js +13 -15
  8. package/context.js.map +1 -1
  9. package/context.mjs +75 -0
  10. package/context.mjs.map +1 -0
  11. package/index.d.ts +0 -2
  12. package/index.js +24 -25
  13. package/index.js.map +1 -1
  14. package/index.mjs +7 -0
  15. package/index.mjs.map +1 -0
  16. package/logging.d.ts +4 -4
  17. package/logging.js +19 -21
  18. package/logging.js.map +1 -1
  19. package/logging.mjs +44 -0
  20. package/logging.mjs.map +1 -0
  21. package/models.d.ts +0 -1
  22. package/package.json +29 -11
  23. package/schema-util.d.ts +1 -2
  24. package/schema-util.js +7 -6
  25. package/schema-util.js.map +1 -1
  26. package/schema-util.mjs +29 -0
  27. package/schema-util.mjs.map +1 -0
  28. package/shield.d.ts +5 -5
  29. package/shield.js +11 -10
  30. package/shield.js.map +1 -1
  31. package/shield.mjs +49 -0
  32. package/shield.mjs.map +1 -0
  33. package/subscriptions/context.d.ts +1 -2
  34. package/subscriptions/context.js +15 -14
  35. package/subscriptions/context.js.map +1 -1
  36. package/subscriptions/context.mjs +62 -0
  37. package/subscriptions/context.mjs.map +1 -0
  38. package/subscriptions/index.d.ts +0 -1
  39. package/subscriptions/index.js +12 -22
  40. package/subscriptions/index.js.map +1 -1
  41. package/subscriptions/index.mjs +4 -0
  42. package/subscriptions/index.mjs.map +1 -0
  43. package/subscriptions/server.d.ts +4 -5
  44. package/subscriptions/server.js +24 -26
  45. package/subscriptions/server.js.map +1 -1
  46. package/subscriptions/server.mjs +87 -0
  47. package/subscriptions/server.mjs.map +1 -0
  48. package/subscriptions/utils.d.ts +0 -1
  49. package/subscriptions/utils.js +5 -5
  50. package/subscriptions/utils.js.map +1 -1
  51. package/subscriptions/utils.mjs +21 -0
  52. package/subscriptions/utils.mjs.map +1 -0
  53. package/testing.d.ts +6 -6
  54. package/testing.js +26 -35
  55. package/testing.js.map +1 -1
  56. package/testing.mjs +60 -0
  57. package/testing.mjs.map +1 -0
  58. package/utils.d.ts +0 -1
  59. package/utils.js +6 -6
  60. package/utils.js.map +1 -1
  61. package/utils.mjs +6 -0
  62. package/utils.mjs.map +1 -0
  63. package/User.d.ts.map +0 -1
  64. package/context.d.ts.map +0 -1
  65. package/index.d.ts.map +0 -1
  66. package/logging.d.ts.map +0 -1
  67. package/models.d.ts.map +0 -1
  68. package/models.js +0 -3
  69. package/models.js.map +0 -1
  70. package/schema-util.d.ts.map +0 -1
  71. package/shield.d.ts.map +0 -1
  72. package/subscriptions/context.d.ts.map +0 -1
  73. package/subscriptions/index.d.ts.map +0 -1
  74. package/subscriptions/server.d.ts.map +0 -1
  75. package/subscriptions/utils.d.ts.map +0 -1
  76. package/testing.d.ts.map +0 -1
  77. package/utils.d.ts.map +0 -1
@@ -1,23 +1,20 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useSubscriptionsServer = void 0;
7
- const graphql_ws_1 = require("graphql-ws");
8
- const ws_1 = require("graphql-ws/lib/use/ws");
9
- const lodash_pick_1 = __importDefault(require("lodash.pick"));
10
- const ws_2 = require("ws");
11
- const logging_1 = require("../logging");
12
- const utils_1 = require("./utils");
1
+ 'use strict';
2
+
3
+ var graphqlWs = require('graphql-ws');
4
+ var ws$1 = require('graphql-ws/lib/use/ws');
5
+ var lodash = require('lodash');
6
+ var ws = require('ws');
7
+ var logging = require('../logging.js');
8
+ var utils = require('./utils.js');
9
+
13
10
  function useSubscriptionsServer({ schema, httpServer, createSubscriptionContext, logger, operationLogLevel = 'info', path = '/graphql', verifyToken, requireAuth, jwtClaimsToLog = ['oid', 'iss'], }) {
14
11
  if (requireAuth && !verifyToken)
15
12
  throw new Error('verifyToken must be supplied when requireAuth is true');
16
- const wsServer = new ws_2.WebSocketServer({
13
+ const wsServer = new ws.WebSocketServer({
17
14
  server: httpServer,
18
15
  path,
19
16
  });
20
- return (0, ws_1.useServer)({
17
+ return ws$1.useServer({
21
18
  schema,
22
19
  onError(_ctx, message, errors) {
23
20
  logger.error('GraphQL subscriptions server error', { message, errors });
@@ -28,7 +25,7 @@ function useSubscriptionsServer({ schema, httpServer, createSubscriptionContext,
28
25
  logger.info(connectionEstablished);
29
26
  return true;
30
27
  }
31
- const token = (0, utils_1.extractTokenFromConnectionParams)(ctx.connectionParams);
28
+ const token = utils.extractTokenFromConnectionParams(ctx.connectionParams);
32
29
  if (!token) {
33
30
  if (requireAuth) {
34
31
  logger.error('No authorization parameter was supplied via websocket connection params');
@@ -38,10 +35,10 @@ function useSubscriptionsServer({ schema, httpServer, createSubscriptionContext,
38
35
  return true;
39
36
  }
40
37
  try {
41
- const claims = await verifyToken((0, utils_1.getHost)(ctx.extra.request), token);
38
+ const claims = await verifyToken(utils.getHost(ctx.extra.request), token);
42
39
  ctx.extra.claims = claims;
43
40
  logger.info(connectionEstablished, {
44
- claims: (0, lodash_pick_1.default)(claims, jwtClaimsToLog),
41
+ claims: lodash.pick(claims, jwtClaimsToLog),
45
42
  });
46
43
  return true;
47
44
  }
@@ -53,24 +50,24 @@ function useSubscriptionsServer({ schema, httpServer, createSubscriptionContext,
53
50
  onSubscribe: async (ctx) => {
54
51
  if (!verifyToken)
55
52
  return;
56
- const token = (0, utils_1.extractTokenFromConnectionParams)(ctx.connectionParams);
53
+ const token = utils.extractTokenFromConnectionParams(ctx.connectionParams);
57
54
  if (!token) {
58
55
  if (requireAuth) {
59
56
  logger.error('No authorization parameter was supplied via websocket connection params');
60
- ctx.extra.socket.close(graphql_ws_1.CloseCode.Forbidden, 'Forbidden');
57
+ ctx.extra.socket.close(graphqlWs.CloseCode.Forbidden, 'Forbidden');
61
58
  }
62
59
  return;
63
60
  }
64
61
  try {
65
- await verifyToken((0, utils_1.getHost)(ctx.extra.request), token);
62
+ await verifyToken(utils.getHost(ctx.extra.request), token);
66
63
  }
67
64
  catch (error) {
68
- logger.warn('Subscription connection auth token is no longer valid', { claims: (0, lodash_pick_1.default)(ctx.extra.claims, jwtClaimsToLog), error });
69
- ctx.extra.socket.close(graphql_ws_1.CloseCode.Forbidden, 'Forbidden');
65
+ logger.warn('Subscription connection auth token is no longer valid', { claims: lodash.pick(ctx.extra.claims, jwtClaimsToLog), error });
66
+ ctx.extra.socket.close(graphqlWs.CloseCode.Forbidden, 'Forbidden');
70
67
  }
71
68
  },
72
69
  onDisconnect({ extra: { claims } }) {
73
- logger.info('Subscription connection disconnected', { claims: (0, lodash_pick_1.default)(claims, jwtClaimsToLog) });
70
+ logger.info('Subscription connection disconnected', { claims: lodash.pick(claims, jwtClaimsToLog) });
74
71
  },
75
72
  context: async (ctx) => {
76
73
  return createSubscriptionContext({
@@ -80,12 +77,13 @@ function useSubscriptionsServer({ schema, httpServer, createSubscriptionContext,
80
77
  });
81
78
  },
82
79
  onOperation(_ctx, _message, args) {
83
- (0, logging_1.logSubscriptionOperation)({ args, logLevel: operationLogLevel });
80
+ logging.logSubscriptionOperation({ args, logLevel: operationLogLevel });
84
81
  },
85
82
  onNext(_ctx, _message, args, { data, ...result }) {
86
- (0, logging_1.logSubscriptionOperation)({ args, logLevel: operationLogLevel, result });
83
+ logging.logSubscriptionOperation({ args, logLevel: operationLogLevel, result });
87
84
  },
88
85
  }, wsServer);
89
86
  }
87
+
90
88
  exports.useSubscriptionsServer = useSubscriptionsServer;
91
- //# sourceMappingURL=server.js.map
89
+ //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/subscriptions/server.ts"],"names":[],"mappings":";;;;;;AAEA,2CAAsC;AACtC,8CAAiD;AAEjD,8DAA8B;AA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AE;YAChC,MAAM,CAAC,IAAI,CAAC,sCAAsC,EAAE,EAAE,MAAM,EAAE,IAAA,qBAAI,EAAC,MAAM,EAAE,cAAc,CAAC,EAAE,CAAC,CAAA;QAC/F,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;YACrB,OAAO,yBAAyB,CAAC;gBAC/B,cAAc,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO;gBACjC,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;gBACtC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,MAAgC;aACnD,CAAC,CAAA;QACJ,CAAC;QACD,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI;YAC9B,IAAA,kCAAwB,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAA;QACjE,CAAC;QACD,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE;YAC9C,IAAA,kCAAwB,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC,CAAA;QACzE,CAAC;KACF,EACD,QAAQ,CACT,CAAA;AACH,CAAC;AAnGD,wDAmGC"}
1
+ {"version":3,"file":"server.js","sources":["../../src/subscriptions/server.ts"],"sourcesContent":["import type { Logger } from '@makerx/node-common'\nimport type { GraphQLSchema } from 'graphql'\nimport { CloseCode } from 'graphql-ws'\nimport { useServer } from 'graphql-ws/lib/use/ws'\nimport type { Server } from 'http'\nimport { pick } from 'lodash'\nimport { WebSocketServer } from 'ws'\nimport type { JwtPayload } from '../context'\nimport { logSubscriptionOperation } from '../logging'\nimport type { CreateSubscriptionContext } from './context'\nimport { extractTokenFromConnectionParams, getHost } from './utils'\n\nexport function useSubscriptionsServer<TLogger extends Logger = Logger>({\n schema,\n httpServer,\n createSubscriptionContext,\n logger,\n operationLogLevel = 'info',\n path = '/graphql',\n verifyToken,\n requireAuth,\n jwtClaimsToLog = ['oid', 'iss'],\n}: {\n schema: GraphQLSchema\n httpServer: Server\n createSubscriptionContext: CreateSubscriptionContext\n logger: TLogger\n operationLogLevel?: keyof TLogger\n path?: string\n verifyToken?: (host: string, token: string) => Promise<JwtPayload>\n requireAuth?: boolean\n jwtClaimsToLog?: string[]\n}) {\n if (requireAuth && !verifyToken) throw new Error('verifyToken must be supplied when requireAuth is true')\n\n const wsServer = new WebSocketServer({\n server: httpServer,\n path,\n })\n\n return useServer(\n {\n schema,\n onError(_ctx, message, errors) {\n logger.error('GraphQL subscriptions server error', { message, errors })\n },\n onConnect: async (ctx) => {\n const connectionEstablished = 'Subscription connection established'\n if (!verifyToken) {\n logger.info(connectionEstablished)\n return true\n }\n\n const token = extractTokenFromConnectionParams(ctx.connectionParams)\n if (!token) {\n if (requireAuth) {\n logger.error('No authorization parameter was supplied via websocket connection params')\n return false\n }\n logger.info(connectionEstablished)\n return true\n }\n\n try {\n const claims = await verifyToken(getHost(ctx.extra.request), token)\n ctx.extra.claims = claims as unknown as undefined\n logger.info(connectionEstablished, {\n claims: pick(claims, jwtClaimsToLog),\n })\n return true\n } catch (error) {\n logger.error('Failed to verify subscription connection auth token', { error })\n return false\n }\n },\n onSubscribe: async (ctx) => {\n if (!verifyToken) return\n const token = extractTokenFromConnectionParams(ctx.connectionParams)\n if (!token) {\n if (requireAuth) {\n logger.error('No authorization parameter was supplied via websocket connection params')\n ctx.extra.socket.close(CloseCode.Forbidden, 'Forbidden')\n }\n return\n }\n try {\n await verifyToken(getHost(ctx.extra.request), token)\n } catch (error) {\n logger.warn('Subscription connection auth token is no longer valid', { claims: pick(ctx.extra.claims, jwtClaimsToLog), error })\n ctx.extra.socket.close(CloseCode.Forbidden, 'Forbidden')\n }\n },\n onDisconnect({ extra: { claims } }) {\n logger.info('Subscription connection disconnected', { claims: pick(claims, jwtClaimsToLog) })\n },\n context: async (ctx) => {\n return createSubscriptionContext({\n connectRequest: ctx.extra.request,\n connectionParams: ctx.connectionParams,\n claims: ctx.extra.claims as JwtPayload | undefined,\n })\n },\n onOperation(_ctx, _message, args) {\n logSubscriptionOperation({ args, logLevel: operationLogLevel })\n },\n onNext(_ctx, _message, args, { data, ...result }) {\n logSubscriptionOperation({ args, logLevel: operationLogLevel, result })\n },\n },\n wsServer,\n )\n}\n"],"names":["WebSocketServer","useServer","extractTokenFromConnectionParams","getHost","pick","CloseCode","logSubscriptionOperation"],"mappings":";;;;;;;;;AAYgB,SAAA,sBAAsB,CAAkC,EACtE,MAAM,EACN,UAAU,EACV,yBAAyB,EACzB,MAAM,EACN,iBAAiB,GAAG,MAAM,EAC1B,IAAI,GAAG,UAAU,EACjB,WAAW,EACX,WAAW,EACX,cAAc,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,GAWhC,EAAA;IACC,IAAI,WAAW,IAAI,CAAC,WAAW;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;AAEzG,IAAA,MAAM,QAAQ,GAAG,IAAIA,kBAAe,CAAC;AACnC,QAAA,MAAM,EAAE,UAAU;QAClB,IAAI;AACL,KAAA,CAAC,CAAA;AAEF,IAAA,OAAOC,cAAS,CACd;QACE,MAAM;AACN,QAAA,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAA;YAC3B,MAAM,CAAC,KAAK,CAAC,oCAAoC,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAA;SACxE;AACD,QAAA,SAAS,EAAE,OAAO,GAAG,KAAI;YACvB,MAAM,qBAAqB,GAAG,qCAAqC,CAAA;YACnE,IAAI,CAAC,WAAW,EAAE;AAChB,gBAAA,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;AAClC,gBAAA,OAAO,IAAI,CAAA;aACZ;YAED,MAAM,KAAK,GAAGC,sCAAgC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;YACpE,IAAI,CAAC,KAAK,EAAE;gBACV,IAAI,WAAW,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from 'lodash';
4
+ import { WebSocketServer } from 'ws';
5
+ import { logSubscriptionOperation } from '../logging.mjs';
6
+ import { extractTokenFromConnectionParams, getHost } from './utils.mjs';
7
+
8
+ function useSubscriptionsServer({ schema, httpServer, createSubscriptionContext, logger, operationLogLevel = 'info', path = '/graphql', verifyToken, requireAuth, jwtClaimsToLog = ['oid', 'iss'], }) {
9
+ if (requireAuth && !verifyToken)
10
+ throw new Error('verifyToken must be supplied when requireAuth is true');
11
+ const wsServer = new WebSocketServer({
12
+ server: httpServer,
13
+ path,
14
+ });
15
+ return useServer({
16
+ schema,
17
+ onError(_ctx, message, errors) {
18
+ logger.error('GraphQL subscriptions server error', { message, errors });
19
+ },
20
+ onConnect: async (ctx) => {
21
+ const connectionEstablished = 'Subscription connection established';
22
+ if (!verifyToken) {
23
+ logger.info(connectionEstablished);
24
+ return true;
25
+ }
26
+ const token = extractTokenFromConnectionParams(ctx.connectionParams);
27
+ if (!token) {
28
+ if (requireAuth) {
29
+ logger.error('No authorization parameter was supplied via websocket connection params');
30
+ return false;
31
+ }
32
+ logger.info(connectionEstablished);
33
+ return true;
34
+ }
35
+ try {
36
+ const claims = await verifyToken(getHost(ctx.extra.request), token);
37
+ ctx.extra.claims = claims;
38
+ logger.info(connectionEstablished, {
39
+ claims: pick(claims, jwtClaimsToLog),
40
+ });
41
+ return true;
42
+ }
43
+ catch (error) {
44
+ logger.error('Failed to verify subscription connection auth token', { error });
45
+ return false;
46
+ }
47
+ },
48
+ onSubscribe: async (ctx) => {
49
+ if (!verifyToken)
50
+ return;
51
+ const token = extractTokenFromConnectionParams(ctx.connectionParams);
52
+ if (!token) {
53
+ if (requireAuth) {
54
+ logger.error('No authorization parameter was supplied via websocket connection params');
55
+ ctx.extra.socket.close(CloseCode.Forbidden, 'Forbidden');
56
+ }
57
+ return;
58
+ }
59
+ try {
60
+ await verifyToken(getHost(ctx.extra.request), token);
61
+ }
62
+ catch (error) {
63
+ logger.warn('Subscription connection auth token is no longer valid', { claims: pick(ctx.extra.claims, jwtClaimsToLog), error });
64
+ ctx.extra.socket.close(CloseCode.Forbidden, 'Forbidden');
65
+ }
66
+ },
67
+ onDisconnect({ extra: { claims } }) {
68
+ logger.info('Subscription connection disconnected', { claims: pick(claims, jwtClaimsToLog) });
69
+ },
70
+ context: async (ctx) => {
71
+ return createSubscriptionContext({
72
+ connectRequest: ctx.extra.request,
73
+ connectionParams: ctx.connectionParams,
74
+ claims: ctx.extra.claims,
75
+ });
76
+ },
77
+ onOperation(_ctx, _message, args) {
78
+ logSubscriptionOperation({ args, logLevel: operationLogLevel });
79
+ },
80
+ onNext(_ctx, _message, args, { data, ...result }) {
81
+ logSubscriptionOperation({ args, logLevel: operationLogLevel, result });
82
+ },
83
+ }, wsServer);
84
+ }
85
+
86
+ export { useSubscriptionsServer };
87
+ //# sourceMappingURL=server.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.mjs","sources":["../../src/subscriptions/server.ts"],"sourcesContent":["import type { Logger } from '@makerx/node-common'\nimport type { GraphQLSchema } from 'graphql'\nimport { CloseCode } from 'graphql-ws'\nimport { useServer } from 'graphql-ws/lib/use/ws'\nimport type { Server } from 'http'\nimport { pick } from 'lodash'\nimport { WebSocketServer } from 'ws'\nimport type { JwtPayload } from '../context'\nimport { logSubscriptionOperation } from '../logging'\nimport type { CreateSubscriptionContext } from './context'\nimport { extractTokenFromConnectionParams, getHost } from './utils'\n\nexport function useSubscriptionsServer<TLogger extends Logger = Logger>({\n schema,\n httpServer,\n createSubscriptionContext,\n logger,\n operationLogLevel = 'info',\n path = '/graphql',\n verifyToken,\n requireAuth,\n jwtClaimsToLog = ['oid', 'iss'],\n}: {\n schema: GraphQLSchema\n httpServer: Server\n createSubscriptionContext: CreateSubscriptionContext\n logger: TLogger\n operationLogLevel?: keyof TLogger\n path?: string\n verifyToken?: (host: string, token: string) => Promise<JwtPayload>\n requireAuth?: boolean\n jwtClaimsToLog?: string[]\n}) {\n if (requireAuth && !verifyToken) throw new Error('verifyToken must be supplied when requireAuth is true')\n\n const wsServer = new WebSocketServer({\n server: httpServer,\n path,\n })\n\n return useServer(\n {\n schema,\n onError(_ctx, message, errors) {\n logger.error('GraphQL subscriptions server error', { message, errors })\n },\n onConnect: async (ctx) => {\n const connectionEstablished = 'Subscription connection established'\n if (!verifyToken) {\n logger.info(connectionEstablished)\n return true\n }\n\n const token = extractTokenFromConnectionParams(ctx.connectionParams)\n if (!token) {\n if (requireAuth) {\n logger.error('No authorization parameter was supplied via websocket connection params')\n return false\n }\n logger.info(connectionEstablished)\n return true\n }\n\n try {\n const claims = await verifyToken(getHost(ctx.extra.request), token)\n ctx.extra.claims = claims as unknown as undefined\n logger.info(connectionEstablished, {\n claims: pick(claims, jwtClaimsToLog),\n })\n return true\n } catch (error) {\n logger.error('Failed to verify subscription connection auth token', { error })\n return false\n }\n },\n onSubscribe: async (ctx) => {\n if (!verifyToken) return\n const token = extractTokenFromConnectionParams(ctx.connectionParams)\n if (!token) {\n if (requireAuth) {\n logger.error('No authorization parameter was supplied via websocket connection params')\n ctx.extra.socket.close(CloseCode.Forbidden, 'Forbidden')\n }\n return\n }\n try {\n await verifyToken(getHost(ctx.extra.request), token)\n } catch (error) {\n logger.warn('Subscription connection auth token is no longer valid', { claims: pick(ctx.extra.claims, jwtClaimsToLog), error })\n ctx.extra.socket.close(CloseCode.Forbidden, 'Forbidden')\n }\n },\n onDisconnect({ extra: { claims } }) {\n logger.info('Subscription connection disconnected', { claims: pick(claims, jwtClaimsToLog) })\n },\n context: async (ctx) => {\n return createSubscriptionContext({\n connectRequest: ctx.extra.request,\n connectionParams: ctx.connectionParams,\n claims: ctx.extra.claims as JwtPayload | undefined,\n })\n },\n onOperation(_ctx, _message, args) {\n logSubscriptionOperation({ args, logLevel: operationLogLevel })\n },\n onNext(_ctx, _message, args, { data, ...result }) {\n logSubscriptionOperation({ args, logLevel: operationLogLevel, result })\n },\n },\n wsServer,\n )\n}\n"],"names":[],"mappings":";;;;;;;AAYgB,SAAA,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EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA;AAChC,YAAA,MAAM,CAAC,IAAI,CAAC,sCAAsC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE,CAAC,CAAA;SAC9F;AACD,QAAA,OAAO,EAAE,OAAO,GAAG,KAAI;AACrB,YAAA,OAAO,yBAAyB,CAAC;AAC/B,gBAAA,cAAc,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO;gBACjC,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;AACtC,gBAAA,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,MAAgC;AACnD,aAAA,CAAC,CAAA;SACH;AACD,QAAA,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAA;YAC9B,wBAAwB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAA;SAChE;AACD,QAAA,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,EAAA;YAC9C,wBAAwB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC,CAAA;SACxE;KACF,EACD,QAAQ,CACT,CAAA;AACH;;;;"}
@@ -9,4 +9,3 @@ import type { IncomingMessage } from 'http';
9
9
  */
10
10
  export declare function extractTokenFromConnectionParams(connectionParams?: Readonly<Record<string, unknown>>): string | undefined;
11
11
  export declare function getHost(request: IncomingMessage): string;
12
- //# sourceMappingURL=utils.d.ts.map
@@ -1,6 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getHost = exports.extractTokenFromConnectionParams = void 0;
1
+ 'use strict';
2
+
4
3
  /**
5
4
  * Extracts a token from a connection parameter named `authorization` or `Authorization`.
6
5
  * The expected format of the parameter value is: Bearer <token>, consistent with an HTTP Authorization header.
@@ -14,11 +13,12 @@ function extractTokenFromConnectionParams(connectionParams) {
14
13
  return undefined;
15
14
  return bearerTokenValue.substring(7);
16
15
  }
17
- exports.extractTokenFromConnectionParams = extractTokenFromConnectionParams;
18
16
  function getHost(request) {
19
17
  const proxyHostHeader = request.headers['x-forwarded-host'];
20
18
  const host = Array.isArray(proxyHostHeader) ? proxyHostHeader[0] ?? undefined : proxyHostHeader ?? request.headers.host ?? undefined;
21
19
  return host ?? 'subscriptions';
22
20
  }
21
+
22
+ exports.extractTokenFromConnectionParams = extractTokenFromConnectionParams;
23
23
  exports.getHost = getHost;
24
- //# sourceMappingURL=utils.js.map
24
+ //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/subscriptions/utils.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,SAAgB,gCAAgC,CAAC,gBAAoD;IACnG,MAAM,gBAAgB,GAAG,CAAC,gBAAgB,EAAE,aAAa,IAAI,gBAAgB,EAAE,aAAa,CAAuB,CAAA;IACnH,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,SAAS,CAAA;IAC9D,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;AACtC,CAAC;AAJD,4EAIC;AAED,SAAgB,OAAO,CAAC,OAAwB;IAC9C,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;IAC3D,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,SAAS,CAAA;IACpI,OAAO,IAAI,IAAI,eAAe,CAAA;AAChC,CAAC;AAJD,0BAIC"}
1
+ {"version":3,"file":"utils.js","sources":["../../src/subscriptions/utils.ts"],"sourcesContent":["import type { IncomingMessage } from 'http'\n\n/**\n * Extracts a token from a connection parameter named `authorization` or `Authorization`.\n * The expected format of the parameter value is: Bearer <token>, consistent with an HTTP Authorization header.\n * Apollo Sandbox sets an `Authorization` connection parameter when you specify an HTTP Authorization header via the UI.\n * @param connectionParams\n * @returns\n */\nexport function extractTokenFromConnectionParams(connectionParams?: Readonly<Record<string, unknown>>) {\n const bearerTokenValue = (connectionParams?.authorization ?? connectionParams?.Authorization) as string | undefined\n if (!bearerTokenValue?.startsWith('Bearer ')) return undefined\n return bearerTokenValue.substring(7)\n}\n\nexport function getHost(request: IncomingMessage) {\n const proxyHostHeader = request.headers['x-forwarded-host']\n const host = Array.isArray(proxyHostHeader) ? proxyHostHeader[0] ?? undefined : proxyHostHeader ?? request.headers.host ?? undefined\n return host ?? 'subscriptions'\n}\n"],"names":[],"mappings":";;AAEA;;;;;;AAMG;AACG,SAAU,gCAAgC,CAAC,gBAAoD,EAAA;IACnG,MAAM,gBAAgB,IAAI,gBAAgB,EAAE,aAAa,IAAI,gBAAgB,EAAE,aAAa,CAAuB,CAAA;AACnH,IAAA,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,SAAS,CAAC;AAAE,QAAA,OAAO,SAAS,CAAA;AAC9D,IAAA,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;AACtC,CAAC;AAEK,SAAU,OAAO,CAAC,OAAwB,EAAA;IAC9C,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC3D,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,IAAI,SAAS,GAAG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,SAAS,CAAA;IACpI,OAAO,IAAI,IAAI,eAAe,CAAA;AAChC;;;;;"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Extracts a token from a connection parameter named `authorization` or `Authorization`.
3
+ * The expected format of the parameter value is: Bearer <token>, consistent with an HTTP Authorization header.
4
+ * Apollo Sandbox sets an `Authorization` connection parameter when you specify an HTTP Authorization header via the UI.
5
+ * @param connectionParams
6
+ * @returns
7
+ */
8
+ function extractTokenFromConnectionParams(connectionParams) {
9
+ const bearerTokenValue = (connectionParams?.authorization ?? connectionParams?.Authorization);
10
+ if (!bearerTokenValue?.startsWith('Bearer '))
11
+ return undefined;
12
+ return bearerTokenValue.substring(7);
13
+ }
14
+ function getHost(request) {
15
+ const proxyHostHeader = request.headers['x-forwarded-host'];
16
+ const host = Array.isArray(proxyHostHeader) ? proxyHostHeader[0] ?? undefined : proxyHostHeader ?? request.headers.host ?? undefined;
17
+ return host ?? 'subscriptions';
18
+ }
19
+
20
+ export { extractTokenFromConnectionParams, getHost };
21
+ //# sourceMappingURL=utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.mjs","sources":["../../src/subscriptions/utils.ts"],"sourcesContent":["import type { IncomingMessage } from 'http'\n\n/**\n * Extracts a token from a connection parameter named `authorization` or `Authorization`.\n * The expected format of the parameter value is: Bearer <token>, consistent with an HTTP Authorization header.\n * Apollo Sandbox sets an `Authorization` connection parameter when you specify an HTTP Authorization header via the UI.\n * @param connectionParams\n * @returns\n */\nexport function extractTokenFromConnectionParams(connectionParams?: Readonly<Record<string, unknown>>) {\n const bearerTokenValue = (connectionParams?.authorization ?? connectionParams?.Authorization) as string | undefined\n if (!bearerTokenValue?.startsWith('Bearer ')) return undefined\n return bearerTokenValue.substring(7)\n}\n\nexport function getHost(request: IncomingMessage) {\n const proxyHostHeader = request.headers['x-forwarded-host']\n const host = Array.isArray(proxyHostHeader) ? proxyHostHeader[0] ?? undefined : proxyHostHeader ?? request.headers.host ?? undefined\n return host ?? 'subscriptions'\n}\n"],"names":[],"mappings":"AAEA;;;;;;AAMG;AACG,SAAU,gCAAgC,CAAC,gBAAoD,EAAA;IACnG,MAAM,gBAAgB,IAAI,gBAAgB,EAAE,aAAa,IAAI,gBAAgB,EAAE,aAAa,CAAuB,CAAA;AACnH,IAAA,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,SAAS,CAAC;AAAE,QAAA,OAAO,SAAS,CAAA;AAC9D,IAAA,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;AACtC,CAAC;AAEK,SAAU,OAAO,CAAC,OAAwB,EAAA;IAC9C,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC3D,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,IAAI,SAAS,GAAG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,SAAS,CAAA;IACpI,OAAO,IAAI,IAAI,eAAe,CAAA;AAChC;;;;"}
package/testing.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
2
- import { ClientCredentialsConfig } from '@makerx/node-common';
3
- import { ApolloClientOptions } from '@apollo/client/core/ApolloClient';
1
+ import type { NormalizedCacheObject } from '@apollo/client/core';
2
+ import { ApolloClient } from '@apollo/client/core';
3
+ import type { ApolloClientOptions } from '@apollo/client/core/ApolloClient';
4
+ import type { ClientCredentialsConfig } from '@makerx/node-common';
4
5
  export * from '@apollo/client/core';
5
- export declare const createTestClient: (fetch: WindowOrWorkerGlobalScope['fetch'], url: string, accessToken?: string, options?: Partial<ApolloClientOptions<NormalizedCacheObject>>) => ApolloClient<NormalizedCacheObject>;
6
- export declare const createTestClientWithClientCredentials: (fetch: WindowOrWorkerGlobalScope['fetch'], url: string, clientCredentialsConfig: ClientCredentialsConfig, options?: Partial<ApolloClientOptions<NormalizedCacheObject>>) => ApolloClient<NormalizedCacheObject>;
7
- //# sourceMappingURL=testing.d.ts.map
6
+ export declare const createTestClient: (url: string, accessToken?: string, options?: Partial<ApolloClientOptions<NormalizedCacheObject>>) => ApolloClient<NormalizedCacheObject>;
7
+ export declare const createTestClientWithClientCredentials: (url: string, clientCredentialsConfig: ClientCredentialsConfig, options?: Partial<ApolloClientOptions<NormalizedCacheObject>>) => ApolloClient<NormalizedCacheObject>;
package/testing.js CHANGED
@@ -1,25 +1,10 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.createTestClientWithClientCredentials = exports.createTestClient = void 0;
18
- const core_1 = require("@apollo/client/core");
19
- const context_1 = require("@apollo/client/link/context");
20
- const node_common_1 = require("@makerx/node-common");
21
- __exportStar(require("@apollo/client/core"), exports);
22
- const bearerTokenLink = (accessToken) => (0, context_1.setContext)((_, { headers }) => {
1
+ 'use strict';
2
+
3
+ var core = require('@apollo/client/core');
4
+ var context = require('@apollo/client/link/context');
5
+ var nodeCommon = require('@makerx/node-common');
6
+
7
+ const bearerTokenLink = (accessToken) => context.setContext((_, { headers }) => {
23
8
  if (accessToken)
24
9
  return {
25
10
  headers: {
@@ -33,12 +18,12 @@ const bearerTokenLink = (accessToken) => (0, context_1.setContext)((_, { headers
33
18
  });
34
19
  const clientCredentialsLink = (clientCredentialsConfig) => {
35
20
  let promise;
36
- return (0, context_1.setContext)(async () => {
21
+ return context.setContext(async () => {
37
22
  if (!promise)
38
- promise = (0, node_common_1.getClientCredentialsToken)(clientCredentialsConfig);
23
+ promise = nodeCommon.getClientCredentialsToken(clientCredentialsConfig);
39
24
  let tokenResponse = await promise;
40
25
  if (tokenResponse.isExpired) {
41
- promise = (0, node_common_1.getClientCredentialsToken)(clientCredentialsConfig);
26
+ promise = nodeCommon.getClientCredentialsToken(clientCredentialsConfig);
42
27
  tokenResponse = await promise;
43
28
  }
44
29
  return {
@@ -48,13 +33,12 @@ const clientCredentialsLink = (clientCredentialsConfig) => {
48
33
  };
49
34
  });
50
35
  };
51
- const httpLink = (url, fetch) => (0, core_1.createHttpLink)({
36
+ const httpLink = (url) => core.createHttpLink({
52
37
  uri: url,
53
- fetch,
54
38
  });
55
- const createTestClient = (fetch, url, accessToken, options) => new core_1.ApolloClient({
56
- link: (0, core_1.from)([bearerTokenLink(accessToken), httpLink(url, fetch)]),
57
- cache: new core_1.InMemoryCache(),
39
+ const createTestClient = (url, accessToken, options) => new core.ApolloClient({
40
+ link: core.from([bearerTokenLink(accessToken), httpLink(url)]),
41
+ cache: new core.InMemoryCache(),
58
42
  defaultOptions: {
59
43
  query: {
60
44
  errorPolicy: 'all',
@@ -62,10 +46,9 @@ const createTestClient = (fetch, url, accessToken, options) => new core_1.Apollo
62
46
  },
63
47
  ...options,
64
48
  });
65
- exports.createTestClient = createTestClient;
66
- const createTestClientWithClientCredentials = (fetch, url, clientCredentialsConfig, options) => new core_1.ApolloClient({
67
- link: (0, core_1.from)([clientCredentialsLink(clientCredentialsConfig), httpLink(url, fetch)]),
68
- cache: new core_1.InMemoryCache(),
49
+ const createTestClientWithClientCredentials = (url, clientCredentialsConfig, options) => new core.ApolloClient({
50
+ link: core.from([clientCredentialsLink(clientCredentialsConfig), httpLink(url)]),
51
+ cache: new core.InMemoryCache(),
69
52
  defaultOptions: {
70
53
  query: {
71
54
  errorPolicy: 'all',
@@ -73,5 +56,13 @@ const createTestClientWithClientCredentials = (fetch, url, clientCredentialsConf
73
56
  },
74
57
  ...options,
75
58
  });
59
+
60
+ exports.createTestClient = createTestClient;
76
61
  exports.createTestClientWithClientCredentials = createTestClientWithClientCredentials;
77
- //# sourceMappingURL=testing.js.map
62
+ Object.keys(core).forEach(function (k) {
63
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
64
+ enumerable: true,
65
+ get: function () { return core[k]; }
66
+ });
67
+ });
68
+ //# sourceMappingURL=testing.js.map
package/testing.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA8G;AAC9G,yDAAwD;AACxD,qDAA6G;AAG7G,sDAAmC;AAEnC,MAAM,eAAe,GAAG,CAAC,WAAoB,EAAE,EAAE,CAC/C,IAAA,oBAAU,EAAC,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IAC5B,IAAI,WAAW;QACb,OAAO;YACL,OAAO,EAAE;gBACP,GAAG,OAAO;gBACV,aAAa,EAAE,UAAU,WAAW,EAAE;aACvC;SACF,CAAA;IACH,OAAO;QACL,OAAO;KACR,CAAA;AACH,CAAC,CAAC,CAAA;AAEJ,MAAM,qBAAqB,GAAG,CAAC,uBAAgD,EAAE,EAAE;IACjF,IAAI,OAAiD,CAAA;IACrD,OAAO,IAAA,oBAAU,EAAC,KAAK,IAAI,EAAE;QAC3B,IAAI,CAAC,OAAO;YAAE,OAAO,GAAG,IAAA,uCAAyB,EAAC,uBAAuB,CAAC,CAAA;QAC1E,IAAI,aAAa,GAAG,MAAM,OAAO,CAAA;QACjC,IAAI,aAAa,CAAC,SAAS,EAAE;YAC3B,OAAO,GAAG,IAAA,uCAAyB,EAAC,uBAAuB,CAAC,CAAA;YAC5D,aAAa,GAAG,MAAM,OAAO,CAAA;SAC9B;QACD,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,aAAa,CAAC,YAAY,EAAE;aACtD;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,KAAyC,EAAE,EAAE,CAC1E,IAAA,qBAAc,EAAC;IACb,GAAG,EAAE,GAAG;IACR,KAAK;CACN,CAAC,CAAA;AAEG,MAAM,gBAAgB,GAAG,CAC9B,KAAyC,EACzC,GAAW,EACX,WAAoB,EACpB,OAA6D,EACxB,EAAE,CACvC,IAAI,mBAAY,CAAC;IACf,IAAI,EAAE,IAAA,WAAI,EAAC,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAChE,KAAK,EAAE,IAAI,oBAAa,EAAE;IAC1B,cAAc,EAAE;QACd,KAAK,EAAE;YACL,WAAW,EAAE,KAAK;SACnB;KACF;IACD,GAAG,OAAO;CACX,CAAC,CAAA;AAfS,QAAA,gBAAgB,oBAezB;AAEG,MAAM,qCAAqC,GAAG,CACnD,KAAyC,EACzC,GAAW,EACX,uBAAgD,EAChD,OAA6D,EACxB,EAAE,CACvC,IAAI,mBAAY,CAAC;IACf,IAAI,EAAE,IAAA,WAAI,EAAC,CAAC,qBAAqB,CAAC,uBAAuB,CAAC,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAClF,KAAK,EAAE,IAAI,oBAAa,EAAE;IAC1B,cAAc,EAAE;QACd,KAAK,EAAE;YACL,WAAW,EAAE,KAAK;SACnB;KACF;IACD,GAAG,OAAO;CACX,CAAC,CAAA;AAfS,QAAA,qCAAqC,yCAe9C"}
1
+ {"version":3,"file":"testing.js","sources":["../src/testing.ts"],"sourcesContent":["import type { NormalizedCacheObject } from '@apollo/client/core'\nimport { ApolloClient, createHttpLink, from, InMemoryCache } from '@apollo/client/core'\nimport type { ApolloClientOptions } from '@apollo/client/core/ApolloClient'\nimport { setContext } from '@apollo/client/link/context'\nimport type { AccessTokenResponse, ClientCredentialsConfig } from '@makerx/node-common'\nimport { getClientCredentialsToken } from '@makerx/node-common'\n\nexport * from '@apollo/client/core'\n\nconst bearerTokenLink = (accessToken?: string) =>\n setContext((_, { headers }) => {\n if (accessToken)\n return {\n headers: {\n ...headers,\n authorization: `Bearer ${accessToken}`,\n },\n }\n return {\n headers,\n }\n })\n\nconst clientCredentialsLink = (clientCredentialsConfig: ClientCredentialsConfig) => {\n let promise: Promise<AccessTokenResponse> | undefined\n return setContext(async () => {\n if (!promise) promise = getClientCredentialsToken(clientCredentialsConfig)\n let tokenResponse = await promise\n if (tokenResponse.isExpired) {\n promise = getClientCredentialsToken(clientCredentialsConfig)\n tokenResponse = await promise\n }\n return {\n headers: {\n authorization: `Bearer ${tokenResponse.access_token}`,\n },\n }\n })\n}\n\nconst httpLink = (url: string) =>\n createHttpLink({\n uri: url,\n })\n\nexport const createTestClient = (\n url: string,\n accessToken?: string,\n options?: Partial<ApolloClientOptions<NormalizedCacheObject>>,\n): ApolloClient<NormalizedCacheObject> =>\n new ApolloClient({\n link: from([bearerTokenLink(accessToken), httpLink(url)]),\n cache: new InMemoryCache(),\n defaultOptions: {\n query: {\n errorPolicy: 'all',\n },\n },\n ...options,\n })\n\nexport const createTestClientWithClientCredentials = (\n url: string,\n clientCredentialsConfig: ClientCredentialsConfig,\n options?: Partial<ApolloClientOptions<NormalizedCacheObject>>,\n): ApolloClient<NormalizedCacheObject> =>\n new ApolloClient({\n link: from([clientCredentialsLink(clientCredentialsConfig), httpLink(url)]),\n cache: new InMemoryCache(),\n defaultOptions: {\n query: {\n errorPolicy: 'all',\n },\n },\n ...options,\n })\n"],"names":["setContext","getClientCredentialsToken","createHttpLink","ApolloClient","from","InMemoryCache"],"mappings":";;;;;;AASA,MAAM,eAAe,GAAG,CAAC,WAAoB,KAC3CA,kBAAU,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,KAAI;AAC5B,IAAA,IAAI,WAAW;QACb,OAAO;AACL,YAAA,OAAO,EAAE;AACP,gBAAA,GAAG,OAAO;gBACV,aAAa,EAAE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,EAChD,OAA6D,KAE7D,IAAIF,iBAAY,CAAC;AACf,IAAA,IAAI,EAAEC,SAAI,CAAC,CAAC,qBAAqB,CAAC,uBAAuB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3E,KAAK,EAAE,IAAIC,kBAAa,EAAE;AAC1B,IAAA,cAAc,EAAE;AACd,QAAA,KAAK,EAAE;AACL,YAAA,WAAW,EAAE,KAAK;AACnB,SAAA;AACF,KAAA;AACD,IAAA,GAAG,OAAO;AACX,CAAA;;;;;;;;;;;"}
package/testing.mjs ADDED
@@ -0,0 +1,60 @@
1
+ import { ApolloClient, from, InMemoryCache, createHttpLink } from '@apollo/client/core';
2
+ export * from '@apollo/client/core';
3
+ import { setContext } from '@apollo/client/link/context';
4
+ import { getClientCredentialsToken } from '@makerx/node-common';
5
+
6
+ const bearerTokenLink = (accessToken) => setContext((_, { headers }) => {
7
+ if (accessToken)
8
+ return {
9
+ headers: {
10
+ ...headers,
11
+ authorization: `Bearer ${accessToken}`,
12
+ },
13
+ };
14
+ return {
15
+ headers,
16
+ };
17
+ });
18
+ const clientCredentialsLink = (clientCredentialsConfig) => {
19
+ let promise;
20
+ return setContext(async () => {
21
+ if (!promise)
22
+ promise = getClientCredentialsToken(clientCredentialsConfig);
23
+ let tokenResponse = await promise;
24
+ if (tokenResponse.isExpired) {
25
+ promise = getClientCredentialsToken(clientCredentialsConfig);
26
+ tokenResponse = await promise;
27
+ }
28
+ return {
29
+ headers: {
30
+ authorization: `Bearer ${tokenResponse.access_token}`,
31
+ },
32
+ };
33
+ });
34
+ };
35
+ const httpLink = (url) => createHttpLink({
36
+ uri: url,
37
+ });
38
+ const createTestClient = (url, accessToken, options) => new ApolloClient({
39
+ link: from([bearerTokenLink(accessToken), httpLink(url)]),
40
+ cache: new InMemoryCache(),
41
+ defaultOptions: {
42
+ query: {
43
+ errorPolicy: 'all',
44
+ },
45
+ },
46
+ ...options,
47
+ });
48
+ const createTestClientWithClientCredentials = (url, clientCredentialsConfig, options) => new ApolloClient({
49
+ link: from([clientCredentialsLink(clientCredentialsConfig), httpLink(url)]),
50
+ cache: new InMemoryCache(),
51
+ defaultOptions: {
52
+ query: {
53
+ errorPolicy: 'all',
54
+ },
55
+ },
56
+ ...options,
57
+ });
58
+
59
+ export { createTestClient, createTestClientWithClientCredentials };
60
+ //# sourceMappingURL=testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.mjs","sources":["../src/testing.ts"],"sourcesContent":["import type { NormalizedCacheObject } from '@apollo/client/core'\nimport { ApolloClient, createHttpLink, from, InMemoryCache } from '@apollo/client/core'\nimport type { ApolloClientOptions } from '@apollo/client/core/ApolloClient'\nimport { setContext } from '@apollo/client/link/context'\nimport type { AccessTokenResponse, ClientCredentialsConfig } from '@makerx/node-common'\nimport { getClientCredentialsToken } from '@makerx/node-common'\n\nexport * from '@apollo/client/core'\n\nconst bearerTokenLink = (accessToken?: string) =>\n setContext((_, { headers }) => {\n if (accessToken)\n return {\n headers: {\n ...headers,\n authorization: `Bearer ${accessToken}`,\n },\n }\n return {\n headers,\n }\n })\n\nconst clientCredentialsLink = (clientCredentialsConfig: ClientCredentialsConfig) => {\n let promise: Promise<AccessTokenResponse> | undefined\n return setContext(async () => {\n if (!promise) promise = getClientCredentialsToken(clientCredentialsConfig)\n let tokenResponse = await promise\n if (tokenResponse.isExpired) {\n promise = getClientCredentialsToken(clientCredentialsConfig)\n tokenResponse = await promise\n }\n return {\n headers: {\n authorization: `Bearer ${tokenResponse.access_token}`,\n },\n }\n })\n}\n\nconst httpLink = (url: string) =>\n createHttpLink({\n uri: url,\n })\n\nexport const createTestClient = (\n url: string,\n accessToken?: string,\n options?: Partial<ApolloClientOptions<NormalizedCacheObject>>,\n): ApolloClient<NormalizedCacheObject> =>\n new ApolloClient({\n link: from([bearerTokenLink(accessToken), httpLink(url)]),\n cache: new InMemoryCache(),\n defaultOptions: {\n query: {\n errorPolicy: 'all',\n },\n },\n ...options,\n })\n\nexport const createTestClientWithClientCredentials = (\n url: string,\n clientCredentialsConfig: ClientCredentialsConfig,\n options?: Partial<ApolloClientOptions<NormalizedCacheObject>>,\n): ApolloClient<NormalizedCacheObject> =>\n new ApolloClient({\n link: from([clientCredentialsLink(clientCredentialsConfig), httpLink(url)]),\n cache: new InMemoryCache(),\n defaultOptions: {\n query: {\n errorPolicy: 'all',\n },\n },\n ...options,\n })\n"],"names":[],"mappings":";;;;;AASA,MAAM,eAAe,GAAG,CAAC,WAAoB,KAC3C,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,KAAI;AAC5B,IAAA,IAAI,WAAW;QACb,OAAO;AACL,YAAA,OAAO,EAAE;AACP,gBAAA,GAAG,OAAO;gBACV,aAAa,EAAE,CAAU,OAAA,EAAA,WAAW,CAAE,CAAA;AACvC,aAAA;SACF,CAAA;IACH,OAAO;QACL,OAAO;KACR,CAAA;AACH,CAAC,CAAC,CAAA;AAEJ,MAAM,qBAAqB,GAAG,CAAC,uBAAgD,KAAI;AACjF,IAAA,IAAI,OAAiD,CAAA;AACrD,IAAA,OAAO,UAAU,CAAC,YAAW;AAC3B,QAAA,IAAI,CAAC,OAAO;AAAE,YAAA,OAAO,GAAG,yBAAyB,CAAC,uBAAuB,CAAC,CAAA;AAC1E,QAAA,IAAI,aAAa,GAAG,MAAM,OAAO,CAAA;AACjC,QAAA,IAAI,aAAa,CAAC,SAAS,EAAE;AAC3B,YAAA,OAAO,GAAG,yBAAyB,CAAC,uBAAuB,CAAC,CAAA;YAC5D,aAAa,GAAG,MAAM,OAAO,CAAA;SAC9B;QACD,OAAO;AACL,YAAA,OAAO,EAAE;AACP,gBAAA,aAAa,EAAE,CAAA,OAAA,EAAU,aAAa,CAAC,YAAY,CAAE,CAAA;AACtD,aAAA;SACF,CAAA;AACH,KAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,GAAW,KAC3B,cAAc,CAAC;AACb,IAAA,GAAG,EAAE,GAAG;AACT,CAAA,CAAC,CAAA;AAEG,MAAM,gBAAgB,GAAG,CAC9B,GAAW,EACX,WAAoB,EACpB,OAA6D,KAE7D,IAAI,YAAY,CAAC;AACf,IAAA,IAAI,EAAE,IAAI,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,KAAK,EAAE,IAAI,aAAa,EAAE;AAC1B,IAAA,cAAc,EAAE;AACd,QAAA,KAAK,EAAE;AACL,YAAA,WAAW,EAAE,KAAK;AACnB,SAAA;AACF,KAAA;AACD,IAAA,GAAG,OAAO;AACX,CAAA,EAAC;AAEG,MAAM,qCAAqC,GAAG,CACnD,GAAW,EACX,uBAAgD,EAChD,OAA6D,KAE7D,IAAI,YAAY,CAAC;AACf,IAAA,IAAI,EAAE,IAAI,CAAC,CAAC,qBAAqB,CAAC,uBAAuB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3E,KAAK,EAAE,IAAI,aAAa,EAAE;AAC1B,IAAA,cAAc,EAAE;AACd,QAAA,KAAK,EAAE;AACL,YAAA,WAAW,EAAE,KAAK;AACnB,SAAA;AACF,KAAA;AACD,IAAA,GAAG,OAAO;AACX,CAAA;;;;"}
package/utils.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export declare const isIntrospectionQuery: (query?: string) => boolean | undefined;
2
2
  export declare const isNil: (value: unknown) => value is null | undefined;
3
3
  export declare const isNotNil: <T>(value: T) => value is Exclude<T, null | undefined>;
4
- //# sourceMappingURL=utils.d.ts.map
package/utils.js CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isNotNil = exports.isNil = exports.isIntrospectionQuery = void 0;
1
+ 'use strict';
2
+
4
3
  const isIntrospectionQuery = (query) => query?.includes('__schema');
5
- exports.isIntrospectionQuery = isIntrospectionQuery;
6
4
  const isNil = (value) => value === null || value === undefined;
5
+ const isNotNil = (value) => !isNil(value);
6
+
7
+ exports.isIntrospectionQuery = isIntrospectionQuery;
7
8
  exports.isNil = isNil;
8
- const isNotNil = (value) => !(0, exports.isNil)(value);
9
9
  exports.isNotNil = isNotNil;
10
- //# sourceMappingURL=utils.js.map
10
+ //# sourceMappingURL=utils.js.map
package/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAO,MAAM,oBAAoB,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAA;AAAtE,QAAA,oBAAoB,wBAAkD;AAC5E,MAAM,KAAK,GAAG,CAAC,KAAc,EAA6B,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAA;AAA5F,QAAA,KAAK,SAAuF;AAClG,MAAM,QAAQ,GAAG,CAAI,KAAQ,EAAyC,EAAE,CAAC,CAAC,IAAA,aAAK,EAAC,KAAK,CAAC,CAAA;AAAhF,QAAA,QAAQ,YAAwE"}
1
+ {"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["export const isIntrospectionQuery = (query?: string) => query?.includes('__schema')\nexport const isNil = (value: unknown): value is null | undefined => value === null || value === undefined\nexport const isNotNil = <T>(value: T): value is Exclude<T, undefined | null> => !isNil(value)\n"],"names":[],"mappings":";;AAAO,MAAM,oBAAoB,GAAG,CAAC,KAAc,KAAK,KAAK,EAAE,QAAQ,CAAC,UAAU,EAAC;AACtE,MAAA,KAAK,GAAG,CAAC,KAAc,KAAgC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,UAAS;AAClG,MAAM,QAAQ,GAAG,CAAI,KAAQ,KAA4C,CAAC,KAAK,CAAC,KAAK;;;;;;"}
package/utils.mjs ADDED
@@ -0,0 +1,6 @@
1
+ const isIntrospectionQuery = (query) => query?.includes('__schema');
2
+ const isNil = (value) => value === null || value === undefined;
3
+ const isNotNil = (value) => !isNil(value);
4
+
5
+ export { isIntrospectionQuery, isNil, isNotNil };
6
+ //# sourceMappingURL=utils.mjs.map
package/utils.mjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.mjs","sources":["../src/utils.ts"],"sourcesContent":["export const isIntrospectionQuery = (query?: string) => query?.includes('__schema')\nexport const isNil = (value: unknown): value is null | undefined => value === null || value === undefined\nexport const isNotNil = <T>(value: T): value is Exclude<T, undefined | null> => !isNil(value)\n"],"names":[],"mappings":"AAAO,MAAM,oBAAoB,GAAG,CAAC,KAAc,KAAK,KAAK,EAAE,QAAQ,CAAC,UAAU,EAAC;AACtE,MAAA,KAAK,GAAG,CAAC,KAAc,KAAgC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,UAAS;AAClG,MAAM,QAAQ,GAAG,CAAI,KAAQ,KAA4C,CAAC,KAAK,CAAC,KAAK;;;;"}
package/User.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../src/User.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAGtC,qBAAa,IAAI;IACf,SAAgB,KAAK,EAAE,MAAM,CAAA;IAC7B,SAAgB,MAAM,EAAE,UAAU,CAAA;gBAEtB,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM;IAKnD,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAQ9B;IAED,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAK7B;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,MAAM,IAAI,MAAM,EAAE,CAErB;IAED,IAAI,KAAK,IAAI,MAAM,EAAE,CAEpB;IAED,OAAO,CAAC,KAAK;IAOb,OAAO,CAAC,YAAY;CAKrB"}
package/context.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"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,qBAAqB,EAAE,GAAG,IAAI,CAAA;QAChD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;QAC3C,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;IACD;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,MAAM,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,kBAAkB,CAAC,OAAO,CAAC,CAAA;CAC7C;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,6KA8B/B,CAAA;AAED,eAAO,MAAM,wBAAwB;UAM7B,aAAa;;;;UAqBpB,CAAA"}
package/models.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAA;AAG7F,KAAK,mBAAmB,CAAC,CAAC,EAAE,IAAI,SAAS,MAAM,CAAC,EAAE,kBAAkB,GAAG,KAAK,IAAI,IAAI,SAAS,GAAG,GAC5F,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,kBAAkB,GAC5C,IAAI,GACJ,KAAK,GACP,KAAK,CAAA;AACT,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,kBAAkB,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAA"}
package/models.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=models.js.map
package/models.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema-util.d.ts","sourceRoot":"","sources":["../src/schema-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,SAAS,CAAA;AAE1D;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,eAAe,EAAE,MAAM,EAAE,QAgBrG"}
package/shield.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"shield.d.ts","sourceRoot":"","sources":["../src/shield.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,EAAS,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAgB,MAAM,gBAAgB,CAAA;AAE1E,KAAK,cAAc,GAAG,OAAO,KAAK,GAAG,OAAO,IAAI,GAAG,OAAO,EAAE,GAAG,OAAO,GAAG,CAAA;AAEzE,eAAO,MAAM,UAAU,yGACmC,OAAO,GAAG,QAAQ,OAAO,CAAC,GAAG,KAAK,UACnF,YAAY,GAAG,QAAQ,gDAC2C,CAAA;AAE3E;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,GAAG,YAAY,CAAC,CAAC,CAAC,CAS5H;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,CAAC,cAAc,CAAC,EAAE,YAAY,GAAE,UAAkB,oEAKxH;AAED,MAAM,MAAM,YAAY,CAAC,SAAS,IAAI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