@constructive-io/graphql-server 5.31.1 → 5.32.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.
@@ -3,6 +3,7 @@ import { Logger } from '@pgpmjs/logger';
3
3
  import { svcCache } from '@pgpmjs/server-utils';
4
4
  import { createHash, timingSafeEqual } from 'crypto';
5
5
  import { graphileCache } from 'graphile-cache';
6
+ import { clearStorageModuleCache } from 'graphile-presigned-url-plugin';
6
7
  import { getPgPool } from 'pg-cache';
7
8
  import { getRoutingSchema, isValidSchemaName } from './routing';
8
9
  const log = new Logger('flush');
@@ -41,12 +42,18 @@ export const createFlushMiddleware = (opts) => {
41
42
  res.status(401).send('Unauthorized');
42
43
  return;
43
44
  }
45
+ const databaseId = req.databaseId ?? req.api?.databaseId;
46
+ if (databaseId)
47
+ clearStorageModuleCache(databaseId);
44
48
  graphileCache.delete(req.svc_key);
45
49
  svcCache.delete(req.svc_key);
46
50
  res.status(200).send('OK');
47
51
  };
48
52
  };
49
53
  export const flushService = async (opts, databaseId) => {
54
+ // Do this before the routing lookup: an empty/removed domain must not leave
55
+ // module discovery alive after its schema has changed.
56
+ clearStorageModuleCache(databaseId);
50
57
  const pgPool = getPgPool(opts.pg);
51
58
  log.info('flushing db ' + databaseId);
52
59
  const api = new RegExp(`^api:${databaseId}:.*`);
@@ -6,6 +6,7 @@ const logger_1 = require("@pgpmjs/logger");
6
6
  const server_utils_1 = require("@pgpmjs/server-utils");
7
7
  const crypto_1 = require("crypto");
8
8
  const graphile_cache_1 = require("graphile-cache");
9
+ const graphile_presigned_url_plugin_1 = require("graphile-presigned-url-plugin");
9
10
  const pg_cache_1 = require("pg-cache");
10
11
  const routing_1 = require("./routing");
11
12
  const log = new logger_1.Logger('flush');
@@ -44,6 +45,9 @@ const createFlushMiddleware = (opts) => {
44
45
  res.status(401).send('Unauthorized');
45
46
  return;
46
47
  }
48
+ const databaseId = req.databaseId ?? req.api?.databaseId;
49
+ if (databaseId)
50
+ (0, graphile_presigned_url_plugin_1.clearStorageModuleCache)(databaseId);
47
51
  graphile_cache_1.graphileCache.delete(req.svc_key);
48
52
  server_utils_1.svcCache.delete(req.svc_key);
49
53
  res.status(200).send('OK');
@@ -51,6 +55,9 @@ const createFlushMiddleware = (opts) => {
51
55
  };
52
56
  exports.createFlushMiddleware = createFlushMiddleware;
53
57
  const flushService = async (opts, databaseId) => {
58
+ // Do this before the routing lookup: an empty/removed domain must not leave
59
+ // module discovery alive after its schema has changed.
60
+ (0, graphile_presigned_url_plugin_1.clearStorageModuleCache)(databaseId);
54
61
  const pgPool = (0, pg_cache_1.getPgPool)(opts.pg);
55
62
  log.info('flushing db ' + databaseId);
56
63
  const api = new RegExp(`^api:${databaseId}:.*`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/graphql-server",
3
- "version": "5.31.1",
3
+ "version": "5.32.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Constructive GraphQL Server",
6
6
  "main": "index.js",
@@ -40,45 +40,46 @@
40
40
  "backend"
41
41
  ],
42
42
  "dependencies": {
43
- "@agentic-kit/ollama": "2.15.0",
44
- "@constructive-io/csrf": "^0.30.1",
45
- "@constructive-io/errors": "^0.24.0",
46
- "@constructive-io/express-context": "^0.34.1",
47
- "@constructive-io/graphql-env": "^3.36.1",
48
- "@constructive-io/graphql-types": "^3.35.1",
49
- "@constructive-io/llm-env": "^0.15.0",
50
- "@constructive-io/query-builder": "^3.16.10",
51
- "@constructive-io/s3-utils": "^2.34.0",
52
- "@constructive-io/url-domains": "^2.31.0",
43
+ "@agentic-kit/ollama": "2.16.0",
44
+ "@constructive-io/csrf": "^0.31.0",
45
+ "@constructive-io/errors": "^0.25.0",
46
+ "@constructive-io/express-context": "^0.35.0",
47
+ "@constructive-io/graphql-env": "^3.37.0",
48
+ "@constructive-io/graphql-types": "^3.36.0",
49
+ "@constructive-io/llm-env": "^0.16.0",
50
+ "@constructive-io/query-builder": "^3.17.0",
51
+ "@constructive-io/s3-utils": "^2.35.0",
52
+ "@constructive-io/url-domains": "^2.32.0",
53
53
  "@graphile-contrib/pg-many-to-many": "2.0.0-rc.2",
54
- "@pgpmjs/env": "^2.47.1",
55
- "@pgpmjs/logger": "^2.26.0",
56
- "@pgpmjs/server-utils": "^3.29.8",
57
- "@pgpmjs/types": "^2.57.1",
54
+ "@pgpmjs/env": "^2.48.0",
55
+ "@pgpmjs/logger": "^2.27.0",
56
+ "@pgpmjs/server-utils": "^3.30.0",
57
+ "@pgpmjs/types": "^2.58.0",
58
58
  "@pgsql/quotes": "^18.2.4",
59
59
  "@simplewebauthn/server": "13.3.2",
60
60
  "cors": "^2.8.6",
61
61
  "deepmerge": "^4.3.1",
62
62
  "express": "^5.2.1",
63
- "gql-ast": "^3.25.0",
63
+ "gql-ast": "^3.26.0",
64
64
  "grafast": "1.1.2",
65
65
  "grafserv": "1.0.1",
66
66
  "graphile-build": "5.1.1",
67
67
  "graphile-build-pg": "5.1.3",
68
- "graphile-cache": "^4.15.1",
68
+ "graphile-cache": "^4.16.0",
69
69
  "graphile-config": "1.1.0",
70
- "graphile-function-bindings": "^1.17.11",
71
- "graphile-plugin-utils": "^1.13.0",
72
- "graphile-scoped-introspection": "^0.4.11",
73
- "graphile-settings": "^6.25.4",
70
+ "graphile-function-bindings": "^1.18.0",
71
+ "graphile-plugin-utils": "^1.14.0",
72
+ "graphile-presigned-url-plugin": "^1.23.0",
73
+ "graphile-scoped-introspection": "^0.5.0",
74
+ "graphile-settings": "^6.26.0",
74
75
  "graphile-utils": "5.0.3",
75
76
  "graphql": "16.13.0",
76
77
  "graphql-upload": "^13.0.0",
77
78
  "lru-cache": "^11.2.7",
78
79
  "pg": "^8.21.0",
79
- "pg-cache": "^3.29.8",
80
- "pg-env": "^1.32.1",
81
- "pg-query-context": "^2.32.1",
80
+ "pg-cache": "^3.30.0",
81
+ "pg-env": "^1.33.0",
82
+ "pg-query-context": "^2.33.0",
82
83
  "pg-sql2": "5.0.1",
83
84
  "postgraphile": "5.1.4",
84
85
  "request-ip": "^3.3.0"
@@ -93,11 +94,11 @@
93
94
  "@types/request-ip": "^0.0.41",
94
95
  "@types/supertest": "^7.2.1",
95
96
  "cookie-parser": "^1.4.7",
96
- "graphile-test": "5.17.11",
97
+ "graphile-test": "5.18.0",
97
98
  "makage": "^0.8.0",
98
99
  "nodemon": "^3.1.14",
99
100
  "supertest": "^7.2.2",
100
101
  "ts-node": "^10.9.2"
101
102
  },
102
- "gitHead": "8227c782c98281f7185d257a7f716fbffdcc45c2"
103
+ "gitHead": "487c4ec9ee997d7da80584a3d41d7120d4354c54"
103
104
  }