@constructive-io/graphql-server 2.19.5 → 2.19.7

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.
@@ -41,6 +41,9 @@ export const getSubdomain = (reqDomains) => {
41
41
  };
42
42
  export const createApiMiddleware = (opts) => {
43
43
  return async (req, res, next) => {
44
+ // Log incoming request details at debug level to avoid excessive info logs in production
45
+ log.debug(`[api-middleware] Request: ${req.method} ${req.path}`);
46
+ log.debug(`[api-middleware] Headers: X-Api-Name=${req.get('X-Api-Name')}, X-Database-Id=${req.get('X-Database-Id')}, X-Meta-Schema=${req.get('X-Meta-Schema')}, Host=${req.get('Host')}`);
44
47
  if (opts.api?.enableServicesApi === false) {
45
48
  const schemas = opts.api.exposedSchemas ?? [];
46
49
  const anonRole = opts.api.anonRole ?? '';
package/esm/server.js CHANGED
@@ -55,11 +55,21 @@ class Server {
55
55
  });
56
56
  next();
57
57
  };
58
- // Log startup config in dev mode
59
- if (isDev()) {
60
- log.debug(`Database: ${effectiveOpts.pg?.database}@${effectiveOpts.pg?.host}:${effectiveOpts.pg?.port}`);
61
- log.debug(`Meta schemas: ${effectiveOpts.api?.metaSchemas?.join(', ') || 'default'}`);
62
- }
58
+ // Log startup configuration (non-sensitive values only)
59
+ const apiOpts = effectiveOpts.api || {};
60
+ log.info('[server] Starting with config:', {
61
+ database: effectiveOpts.pg?.database,
62
+ host: effectiveOpts.pg?.host,
63
+ port: effectiveOpts.pg?.port,
64
+ serverHost: effectiveOpts.server?.host,
65
+ serverPort: effectiveOpts.server?.port,
66
+ apiIsPublic: apiOpts.isPublic,
67
+ enableServicesApi: apiOpts.enableServicesApi,
68
+ metaSchemas: apiOpts.metaSchemas?.join(',') || 'default',
69
+ exposedSchemas: apiOpts.exposedSchemas?.join(',') || 'none',
70
+ anonRole: apiOpts.anonRole,
71
+ roleName: apiOpts.roleName
72
+ });
63
73
  healthz(app);
64
74
  trustProxy(app, effectiveOpts.server.trustProxy);
65
75
  // Warn if a global CORS override is set in production
package/middleware/api.js CHANGED
@@ -49,6 +49,9 @@ const getSubdomain = (reqDomains) => {
49
49
  exports.getSubdomain = getSubdomain;
50
50
  const createApiMiddleware = (opts) => {
51
51
  return async (req, res, next) => {
52
+ // Log incoming request details at debug level to avoid excessive info logs in production
53
+ log.debug(`[api-middleware] Request: ${req.method} ${req.path}`);
54
+ log.debug(`[api-middleware] Headers: X-Api-Name=${req.get('X-Api-Name')}, X-Database-Id=${req.get('X-Database-Id')}, X-Meta-Schema=${req.get('X-Meta-Schema')}, Host=${req.get('Host')}`);
52
55
  if (opts.api?.enableServicesApi === false) {
53
56
  const schemas = opts.api.exposedSchemas ?? [];
54
57
  const anonRole = opts.api.anonRole ?? '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/graphql-server",
3
- "version": "2.19.5",
3
+ "version": "2.19.7",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Constructive GraphQL Server",
6
6
  "main": "index.js",
@@ -42,7 +42,7 @@
42
42
  "backend"
43
43
  ],
44
44
  "dependencies": {
45
- "@constructive-io/graphql-env": "^2.9.1",
45
+ "@constructive-io/graphql-env": "^2.9.2",
46
46
  "@constructive-io/graphql-types": "^2.13.0",
47
47
  "@constructive-io/s3-utils": "^2.5.1",
48
48
  "@constructive-io/upload-names": "^2.4.0",
@@ -56,15 +56,15 @@
56
56
  "gql-ast": "^2.6.0",
57
57
  "graphile-build": "^4.14.1",
58
58
  "graphile-cache": "^1.8.0",
59
- "graphile-i18n": "^0.6.1",
60
- "graphile-meta-schema": "^0.7.1",
61
- "graphile-plugin-connection-filter": "^2.8.1",
62
- "graphile-plugin-connection-filter-postgis": "^1.5.1",
63
- "graphile-plugin-fulltext-filter": "^2.5.1",
59
+ "graphile-i18n": "^0.6.2",
60
+ "graphile-meta-schema": "^0.7.2",
61
+ "graphile-plugin-connection-filter": "^2.8.2",
62
+ "graphile-plugin-connection-filter-postgis": "^1.5.2",
63
+ "graphile-plugin-fulltext-filter": "^2.5.2",
64
64
  "graphile-query": "^2.5.1",
65
- "graphile-search-plugin": "^0.6.1",
66
- "graphile-settings": "^2.14.1",
67
- "graphile-simple-inflector": "^0.6.1",
65
+ "graphile-search-plugin": "^0.6.2",
66
+ "graphile-settings": "^2.14.2",
67
+ "graphile-simple-inflector": "^0.6.2",
68
68
  "graphile-utils": "^4.14.1",
69
69
  "graphql": "15.10.1",
70
70
  "graphql-tag": "2.12.6",
@@ -78,17 +78,17 @@
78
78
  },
79
79
  "devDependencies": {
80
80
  "@aws-sdk/client-s3": "^3.971.0",
81
- "@constructive-io/graphql-codegen": "2.28.4",
81
+ "@constructive-io/graphql-codegen": "2.28.5",
82
82
  "@types/cors": "^2.8.17",
83
83
  "@types/express": "^5.0.6",
84
84
  "@types/graphql-upload": "^8.0.12",
85
85
  "@types/pg": "^8.16.0",
86
86
  "@types/request-ip": "^0.0.41",
87
- "graphile-test": "2.15.1",
87
+ "graphile-test": "2.15.2",
88
88
  "makage": "^0.1.10",
89
89
  "nodemon": "^3.1.10",
90
90
  "rimraf": "^6.1.2",
91
91
  "ts-node": "^10.9.2"
92
92
  },
93
- "gitHead": "13c6cd90521b5521a7219ce270e1b4dd979652cf"
93
+ "gitHead": "64fdb385977ead1f08cb95f63be2f3299ac90cd4"
94
94
  }
package/server.js CHANGED
@@ -62,11 +62,21 @@ class Server {
62
62
  });
63
63
  next();
64
64
  };
65
- // Log startup config in dev mode
66
- if (isDev()) {
67
- log.debug(`Database: ${effectiveOpts.pg?.database}@${effectiveOpts.pg?.host}:${effectiveOpts.pg?.port}`);
68
- log.debug(`Meta schemas: ${effectiveOpts.api?.metaSchemas?.join(', ') || 'default'}`);
69
- }
65
+ // Log startup configuration (non-sensitive values only)
66
+ const apiOpts = effectiveOpts.api || {};
67
+ log.info('[server] Starting with config:', {
68
+ database: effectiveOpts.pg?.database,
69
+ host: effectiveOpts.pg?.host,
70
+ port: effectiveOpts.pg?.port,
71
+ serverHost: effectiveOpts.server?.host,
72
+ serverPort: effectiveOpts.server?.port,
73
+ apiIsPublic: apiOpts.isPublic,
74
+ enableServicesApi: apiOpts.enableServicesApi,
75
+ metaSchemas: apiOpts.metaSchemas?.join(',') || 'default',
76
+ exposedSchemas: apiOpts.exposedSchemas?.join(',') || 'none',
77
+ anonRole: apiOpts.anonRole,
78
+ roleName: apiOpts.roleName
79
+ });
70
80
  (0, server_utils_1.healthz)(app);
71
81
  (0, server_utils_1.trustProxy)(app, effectiveOpts.server.trustProxy);
72
82
  // Warn if a global CORS override is set in production