@magek/core 0.0.9 → 0.0.11

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.
@@ -9,7 +9,7 @@ const events_reader_1 = require("../../events-reader");
9
9
  const read_models_reader_1 = require("../../read-models-reader");
10
10
  const graphql_mutation_generator_1 = require("./graphql-mutation-generator");
11
11
  const graphql_query_generator_1 = require("./graphql-query-generator");
12
- const graphql_subcriptions_generator_1 = require("./graphql-subcriptions-generator");
12
+ const graphql_subscriptions_generator_1 = require("./graphql-subscriptions-generator");
13
13
  const graphql_type_informer_1 = require("./graphql-type-informer");
14
14
  const query_dispatcher_1 = require("../../query-dispatcher");
15
15
  class GraphQLGenerator {
@@ -30,7 +30,7 @@ class GraphQLGenerator {
30
30
  const generatedFiltersByTypeName = {};
31
31
  const queryGenerator = new graphql_query_generator_1.GraphQLQueryGenerator(config, Object.values(config.readModels).map((m) => m.class), config.queryHandlers, typeInformer, this.readModelByIDResolverBuilder.bind(this, config), this.queriesResolverBuilder.bind(this), this.readModelResolverBuilder.bind(this), this.eventResolver.bind(this), generatedFiltersByTypeName);
32
32
  const mutationGenerator = new graphql_mutation_generator_1.GraphQLMutationGenerator(config.commandHandlers, typeInformer, this.commandResolverBuilder.bind(this), config);
33
- const subscriptionGenerator = new graphql_subcriptions_generator_1.GraphQLSubscriptionGenerator(Object.values(config.readModels).map((m) => m.class), typeInformer, this.subscriptionByIDResolverBuilder.bind(this, config), this.subscriptionResolverBuilder.bind(this, config), generatedFiltersByTypeName, config);
33
+ const subscriptionGenerator = new graphql_subscriptions_generator_1.GraphQLSubscriptionGenerator(Object.values(config.readModels).map((m) => m.class), typeInformer, this.subscriptionByIDResolverBuilder.bind(this, config), this.subscriptionResolverBuilder.bind(this, config), generatedFiltersByTypeName, config);
34
34
  this.schema = new graphql_1.GraphQLSchema({
35
35
  query: queryGenerator.generate(),
36
36
  mutation: mutationGenerator.generate(),
@@ -123,6 +123,13 @@ class GraphQLGenerator {
123
123
  version: 1, // TODO: How to pass the version through GraphQL?
124
124
  filters: {},
125
125
  sortBy: {},
126
+ context: {
127
+ request: {
128
+ body: context.context?.request.body,
129
+ headers: context.context?.request.headers,
130
+ },
131
+ rawContext: context.context?.rawContext,
132
+ },
126
133
  };
127
134
  }
128
135
  /**
@@ -245,6 +252,13 @@ function toReadModelRequestEnvelope(readModelClass, args, context, paginatedVers
245
252
  paginatedVersion,
246
253
  version: 1, // TODO: How to pass the version through GraphQL?
247
254
  select,
255
+ context: {
256
+ request: {
257
+ body: context.context?.request.body,
258
+ headers: context.context?.request.headers,
259
+ },
260
+ rawContext: context.context?.rawContext,
261
+ },
248
262
  };
249
263
  }
250
264
  function toEventSearchRequest(args, context) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magek/core",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Library for your Magek apps",
5
5
  "author": "Boosterin Labs SLU",
6
6
  "homepage": "https://magek.ai",
@@ -23,25 +23,23 @@
23
23
  "node": ">=22.0.0 <23.0.0"
24
24
  },
25
25
  "dependencies": {
26
- "@magek/common": "^0.0.9",
26
+ "@magek/common": "^0.0.11",
27
27
  "fp-ts": "2.16.11",
28
28
  "graphql-scalars": "1.25.0",
29
29
  "inflected": "2.1.0",
30
30
  "iterall": "1.3.0",
31
31
  "jsonwebtoken": "9.0.3",
32
32
  "jwks-rsa": "3.2.2",
33
- "tslib": "2.8.1",
34
- "validator": "13.15.26",
35
- "fast-check": "4.5.3"
33
+ "tslib": "2.8.1"
36
34
  },
37
35
  "devDependencies": {
38
- "@magek/eslint-config": "^0.0.9",
36
+ "@magek/eslint-config": "^0.0.11",
39
37
  "@types/chai": "5.2.3",
40
38
  "@types/chai-as-promised": "8.0.2",
41
39
  "@types/inflected": "2.1.3",
42
40
  "@types/jsonwebtoken": "9.0.10",
43
41
  "@types/mocha": "10.0.10",
44
- "@types/node": "22.19.7",
42
+ "@types/node": "22.19.9",
45
43
  "@types/sinon": "21.0.0",
46
44
  "@types/sinon-chai": "4.0.0",
47
45
  "chai": "6.2.2",