@graphql-hive/plugin-aws-sigv4 2.0.18-alpha-8ea56a824441049703364ec2185ae13fb31495bb → 2.0.18-alpha-fbc61142c267103149e69b60daf77fcbe04389c9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @graphql-hive/plugin-aws-sigv4
2
2
 
3
- ## 2.0.18-alpha-8ea56a824441049703364ec2185ae13fb31495bb
3
+ ## 2.0.18-alpha-fbc61142c267103149e69b60daf77fcbe04389c9
4
4
  ### Patch Changes
5
5
 
6
- - Updated dependencies [[`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9)]:
7
- - @graphql-mesh/fusion-runtime@1.6.0-alpha-8ea56a824441049703364ec2185ae13fb31495bb
6
+ - Updated dependencies [[`173556a`](https://github.com/graphql-hive/gateway/commit/173556ade3db9c2a959fb707edcc6289d2a989ab), [`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9)]:
7
+ - @graphql-mesh/fusion-runtime@1.6.0-alpha-fbc61142c267103149e69b60daf77fcbe04389c9
8
8
 
9
9
  ## 2.0.17
10
10
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var require$$2 = require('node:crypto');
3
+ var require$$2$1 = require('node:crypto');
4
4
  var clientSts = require('@aws-sdk/client-sts');
5
- var require$$4 = require('@whatwg-node/promise-helpers');
5
+ var require$$2 = require('@whatwg-node/promise-helpers');
6
6
  var aws4 = require('aws4');
7
7
  var graphql = require('graphql');
8
8
 
@@ -35,6 +35,7 @@ const possibleGraphQLErrorProperties = [
35
35
  'name',
36
36
  'stack',
37
37
  'extensions',
38
+ 'coordinate',
38
39
  ];
39
40
  function isGraphQLErrorLike(error) {
40
41
  return (error != null &&
@@ -47,10 +48,17 @@ function createGraphQLError(message, options) {
47
48
  isGraphQLErrorLike(options.originalError)) {
48
49
  options.originalError = createGraphQLError(options.originalError.message, options.originalError);
49
50
  }
50
- if (graphql.versionInfo.major >= 17) {
51
- return new graphql.GraphQLError(message, options);
51
+ // To avoid type error on graphql <16, we have to use an any type here
52
+ const Constructor = graphql.GraphQLError;
53
+ const error = graphql.versionInfo.major >= 16
54
+ ? new Constructor(message, options)
55
+ : new Constructor(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
56
+ if (options?.coordinate && error.coordinate == null) {
57
+ Object.defineProperties(error, {
58
+ coordinate: { value: options.coordinate, enumerable: true, configurable: true },
59
+ });
52
60
  }
53
- return new graphql.GraphQLError(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
61
+ return error;
54
62
  }
55
63
 
56
64
  var AWSSignV4Headers = /* @__PURE__ */ ((AWSSignV4Headers2) => {
@@ -116,14 +124,14 @@ function useAWSSigv4(opts) {
116
124
  if (secretFromEnv) {
117
125
  return secretFromEnv;
118
126
  }
119
- return require$$4.handleMaybePromise(
127
+ return require$$2.handleMaybePromise(
120
128
  () => incomingOptions?.assumeRole?.(payload),
121
129
  (assumeRolePayload) => {
122
130
  if (!assumeRolePayload || !assumeRolePayload.roleArn || !assumeRolePayload.roleSessionName) {
123
131
  return;
124
132
  }
125
133
  const sts = new clientSts.STS({ region: assumeRolePayload.region });
126
- return require$$4.handleMaybePromise(
134
+ return require$$2.handleMaybePromise(
127
135
  () => sts.assumeRole({
128
136
  RoleArn: assumeRolePayload.roleArn,
129
137
  RoleSessionName: assumeRolePayload.roleSessionName
@@ -141,18 +149,18 @@ function useAWSSigv4(opts) {
141
149
  if (incomingOptions == null) {
142
150
  return;
143
151
  }
144
- return require$$4.handleMaybePromise(
152
+ return require$$2.handleMaybePromise(
145
153
  () => incomingOptions.enabled(request, serverContext),
146
154
  (ifEnabled) => {
147
155
  if (!ifEnabled) {
148
156
  return;
149
157
  }
150
- return require$$4.handleMaybePromise(
158
+ return require$$2.handleMaybePromise(
151
159
  () => {
152
160
  if (!incomingOptions) {
153
161
  throw new Error("Missing options setup");
154
162
  }
155
- return require$$4.handleMaybePromise(
163
+ return require$$2.handleMaybePromise(
156
164
  () => incomingOptions.onBeforeParse(request, serverContext),
157
165
  (ifContinue) => {
158
166
  if (!ifContinue) {
@@ -231,7 +239,7 @@ function useAWSSigv4(opts) {
231
239
  request,
232
240
  serverContext
233
241
  };
234
- return require$$4.handleMaybePromise(
242
+ return require$$2.handleMaybePromise(
235
243
  () => incomingOptions.secretAccessKey?.(payload),
236
244
  (secretKey) => {
237
245
  if (!secretKey) {
@@ -241,7 +249,7 @@ function useAWSSigv4(opts) {
241
249
  );
242
250
  }
243
251
  payload.secretAccessKey = secretKey;
244
- return require$$4.handleMaybePromise(
252
+ return require$$2.handleMaybePromise(
245
253
  () => incomingOptions.onAfterParse(payload),
246
254
  (shouldContinue) => {
247
255
  if (!shouldContinue) {
@@ -342,7 +350,7 @@ function useAWSSigv4(opts) {
342
350
  if (!isBufferOrString(options.body)) {
343
351
  return;
344
352
  }
345
- return require$$4.handleMaybePromise(
353
+ return require$$2.handleMaybePromise(
346
354
  () => outgoingOptionsFactory({ url, options, subgraphName }),
347
355
  (factoryResult) => {
348
356
  if (factoryResult === false) {
@@ -368,7 +376,7 @@ function useAWSSigv4(opts) {
368
376
  service = factoryResult.serviceName;
369
377
  region = factoryResult.region;
370
378
  }
371
- return require$$4.handleMaybePromise(
379
+ return require$$2.handleMaybePromise(
372
380
  () => roleArn && roleSessionName ? new clientSts.STS({ region }).assumeRole({
373
381
  RoleArn: roleArn,
374
382
  RoleSessionName: roleSessionName
@@ -415,9 +423,9 @@ const encodeRfc3986 = (urlEncodedString) => urlEncodedString.replace(
415
423
  /[!'()*]/g,
416
424
  (c) => "%" + c.charCodeAt(0).toString(16).toUpperCase()
417
425
  );
418
- const hmac = (secretKey, data) => require$$2.createHmac("sha256", secretKey).update(data, "utf8").digest();
419
- const hash = (data) => require$$2.createHash("sha256").update(data, "utf8").digest("hex");
420
- const hmacHex = (secretKey, data) => require$$2.createHmac("sha256", secretKey).update(data, "utf8").digest("hex");
426
+ const hmac = (secretKey, data) => require$$2$1.createHmac("sha256", secretKey).update(data, "utf8").digest();
427
+ const hash = (data) => require$$2$1.createHash("sha256").update(data, "utf8").digest("hex");
428
+ const hmacHex = (secretKey, data) => require$$2$1.createHmac("sha256", secretKey).update(data, "utf8").digest("hex");
421
429
 
422
430
  exports.AWSSignV4Headers = AWSSignV4Headers;
423
431
  exports.useAWSSigv4 = useAWSSigv4;
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ const possibleGraphQLErrorProperties = [
29
29
  'name',
30
30
  'stack',
31
31
  'extensions',
32
+ 'coordinate',
32
33
  ];
33
34
  function isGraphQLErrorLike(error) {
34
35
  return (error != null &&
@@ -41,10 +42,17 @@ function createGraphQLError(message, options) {
41
42
  isGraphQLErrorLike(options.originalError)) {
42
43
  options.originalError = createGraphQLError(options.originalError.message, options.originalError);
43
44
  }
44
- if (versionInfo.major >= 17) {
45
- return new GraphQLError(message, options);
45
+ // To avoid type error on graphql <16, we have to use an any type here
46
+ const Constructor = GraphQLError;
47
+ const error = versionInfo.major >= 16
48
+ ? new Constructor(message, options)
49
+ : new Constructor(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
50
+ if (options?.coordinate && error.coordinate == null) {
51
+ Object.defineProperties(error, {
52
+ coordinate: { value: options.coordinate, enumerable: true, configurable: true },
53
+ });
46
54
  }
47
- return new GraphQLError(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
55
+ return error;
48
56
  }
49
57
 
50
58
  var AWSSignV4Headers = /* @__PURE__ */ ((AWSSignV4Headers2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-hive/plugin-aws-sigv4",
3
- "version": "2.0.18-alpha-8ea56a824441049703364ec2185ae13fb31495bb",
3
+ "version": "2.0.18-alpha-fbc61142c267103149e69b60daf77fcbe04389c9",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,18 +43,18 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@aws-sdk/client-sts": "^3.931.0",
46
- "@graphql-mesh/fusion-runtime": "1.6.0-alpha-8ea56a824441049703364ec2185ae13fb31495bb",
46
+ "@graphql-mesh/fusion-runtime": "1.6.0-alpha-fbc61142c267103149e69b60daf77fcbe04389c9",
47
47
  "@whatwg-node/promise-helpers": "^1.3.2",
48
48
  "aws4": "1.13.2",
49
49
  "tslib": "^2.8.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@apollo/subgraph": "^2.11.3",
53
- "@graphql-hive/gateway-runtime": "2.3.6-alpha-8ea56a824441049703364ec2185ae13fb31495bb",
53
+ "@graphql-hive/gateway-runtime": "2.4.0-alpha-fbc61142c267103149e69b60daf77fcbe04389c9",
54
54
  "@types/aws4": "^1.11.6",
55
55
  "graphql": "^16.12.0",
56
- "graphql-yoga": "^5.16.2",
57
- "pkgroll": "2.21.3"
56
+ "graphql-yoga": "^5.17.0",
57
+ "pkgroll": "2.21.4"
58
58
  },
59
59
  "sideEffects": false
60
60
  }