graphile-settings 6.24.2 → 6.24.4

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.
@@ -0,0 +1,8 @@
1
+ import type { GrafastCacheLimits } from '@constructive-io/graphql-types';
2
+ import type { GraphileConfig } from 'graphile-config';
3
+ import type { GraphQLSchemaConfig } from 'graphql';
4
+ /** Apply authoritative per-schema cache limits without disturbing extensions. */
5
+ export declare const applyGrafastCacheLimits: (config: GraphQLSchemaConfig, limits: Readonly<GrafastCacheLimits>) => GraphQLSchemaConfig;
6
+ /** Reusable plugin for bounding Grafast's schema-local runtime caches. */
7
+ export declare const createGrafastCacheLimitsPlugin: (limits: GrafastCacheLimits) => GraphileConfig.Plugin;
8
+ export declare const createGrafastCacheLimitsPreset: (limits?: GrafastCacheLimits) => GraphileConfig.Preset;
@@ -0,0 +1,34 @@
1
+ import { normalizeGrafastCacheLimits } from '@constructive-io/graphql-env';
2
+ /** Apply authoritative per-schema cache limits without disturbing extensions. */
3
+ export const applyGrafastCacheLimits = (config, limits) => ({
4
+ ...config,
5
+ extensions: {
6
+ ...(config.extensions ?? {}),
7
+ grafast: {
8
+ ...(config.extensions?.grafast ?? {}),
9
+ ...limits,
10
+ },
11
+ },
12
+ });
13
+ /** Reusable plugin for bounding Grafast's schema-local runtime caches. */
14
+ export const createGrafastCacheLimitsPlugin = (limits) => {
15
+ const normalized = normalizeGrafastCacheLimits(limits) ?? {};
16
+ return {
17
+ name: 'GrafastCacheLimitsPlugin',
18
+ version: '1.0.0',
19
+ description: 'Bounds schema-local Grafast parse and operation-plan caches',
20
+ schema: {
21
+ hooks: {
22
+ GraphQLSchema(config) {
23
+ return applyGrafastCacheLimits(config, normalized);
24
+ },
25
+ },
26
+ },
27
+ };
28
+ };
29
+ export const createGrafastCacheLimitsPreset = (limits) => {
30
+ const normalized = normalizeGrafastCacheLimits(limits);
31
+ return normalized === undefined || Object.keys(normalized).length === 0
32
+ ? {}
33
+ : { plugins: [createGrafastCacheLimitsPlugin(normalized)] };
34
+ };
package/esm/index.d.ts CHANGED
@@ -29,6 +29,7 @@
29
29
  import 'postgraphile/grafserv';
30
30
  import 'graphile-build';
31
31
  import { makePgService } from 'postgraphile/adaptors/pg';
32
+ export { applyGrafastCacheLimits, createGrafastCacheLimitsPlugin, createGrafastCacheLimitsPreset } from './grafast-cache-limits';
32
33
  export type { ConstructivePresetOptions } from './presets/constructive-preset';
33
34
  export { ConstructivePreset, createConstructivePreset } from './presets/constructive-preset';
34
35
  export * from './plugins/index';
package/esm/index.js CHANGED
@@ -34,6 +34,7 @@
34
34
  import 'postgraphile/grafserv';
35
35
  import 'graphile-build';
36
36
  import { makePgService } from 'postgraphile/adaptors/pg';
37
+ export { applyGrafastCacheLimits, createGrafastCacheLimitsPlugin, createGrafastCacheLimitsPreset } from './grafast-cache-limits';
37
38
  export { ConstructivePreset, createConstructivePreset } from './presets/constructive-preset';
38
39
  // Re-export all plugins for convenience
39
40
  export * from './plugins/index';
@@ -0,0 +1,8 @@
1
+ import type { GrafastCacheLimits } from '@constructive-io/graphql-types';
2
+ import type { GraphileConfig } from 'graphile-config';
3
+ import type { GraphQLSchemaConfig } from 'graphql';
4
+ /** Apply authoritative per-schema cache limits without disturbing extensions. */
5
+ export declare const applyGrafastCacheLimits: (config: GraphQLSchemaConfig, limits: Readonly<GrafastCacheLimits>) => GraphQLSchemaConfig;
6
+ /** Reusable plugin for bounding Grafast's schema-local runtime caches. */
7
+ export declare const createGrafastCacheLimitsPlugin: (limits: GrafastCacheLimits) => GraphileConfig.Plugin;
8
+ export declare const createGrafastCacheLimitsPreset: (limits?: GrafastCacheLimits) => GraphileConfig.Preset;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createGrafastCacheLimitsPreset = exports.createGrafastCacheLimitsPlugin = exports.applyGrafastCacheLimits = void 0;
4
+ const graphql_env_1 = require("@constructive-io/graphql-env");
5
+ /** Apply authoritative per-schema cache limits without disturbing extensions. */
6
+ const applyGrafastCacheLimits = (config, limits) => ({
7
+ ...config,
8
+ extensions: {
9
+ ...(config.extensions ?? {}),
10
+ grafast: {
11
+ ...(config.extensions?.grafast ?? {}),
12
+ ...limits,
13
+ },
14
+ },
15
+ });
16
+ exports.applyGrafastCacheLimits = applyGrafastCacheLimits;
17
+ /** Reusable plugin for bounding Grafast's schema-local runtime caches. */
18
+ const createGrafastCacheLimitsPlugin = (limits) => {
19
+ const normalized = (0, graphql_env_1.normalizeGrafastCacheLimits)(limits) ?? {};
20
+ return {
21
+ name: 'GrafastCacheLimitsPlugin',
22
+ version: '1.0.0',
23
+ description: 'Bounds schema-local Grafast parse and operation-plan caches',
24
+ schema: {
25
+ hooks: {
26
+ GraphQLSchema(config) {
27
+ return (0, exports.applyGrafastCacheLimits)(config, normalized);
28
+ },
29
+ },
30
+ },
31
+ };
32
+ };
33
+ exports.createGrafastCacheLimitsPlugin = createGrafastCacheLimitsPlugin;
34
+ const createGrafastCacheLimitsPreset = (limits) => {
35
+ const normalized = (0, graphql_env_1.normalizeGrafastCacheLimits)(limits);
36
+ return normalized === undefined || Object.keys(normalized).length === 0
37
+ ? {}
38
+ : { plugins: [(0, exports.createGrafastCacheLimitsPlugin)(normalized)] };
39
+ };
40
+ exports.createGrafastCacheLimitsPreset = createGrafastCacheLimitsPreset;
package/index.d.ts CHANGED
@@ -29,6 +29,7 @@
29
29
  import 'postgraphile/grafserv';
30
30
  import 'graphile-build';
31
31
  import { makePgService } from 'postgraphile/adaptors/pg';
32
+ export { applyGrafastCacheLimits, createGrafastCacheLimitsPlugin, createGrafastCacheLimitsPreset } from './grafast-cache-limits';
32
33
  export type { ConstructivePresetOptions } from './presets/constructive-preset';
33
34
  export { ConstructivePreset, createConstructivePreset } from './presets/constructive-preset';
34
35
  export * from './plugins/index';
package/index.js CHANGED
@@ -42,7 +42,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
42
42
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
43
43
  };
44
44
  Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.getPresignedUrlS3Config = exports.makePgService = exports.createConstructivePreset = exports.ConstructivePreset = void 0;
45
+ exports.getPresignedUrlS3Config = exports.makePgService = exports.createConstructivePreset = exports.ConstructivePreset = exports.createGrafastCacheLimitsPreset = exports.createGrafastCacheLimitsPlugin = exports.applyGrafastCacheLimits = void 0;
46
46
  // Import modules for type augmentation
47
47
  // These add properties to the GraphileConfig.Preset interface:
48
48
  // - grafserv: adds 'grafserv' property
@@ -52,6 +52,10 @@ require("postgraphile/grafserv");
52
52
  require("graphile-build");
53
53
  const pg_1 = require("postgraphile/adaptors/pg");
54
54
  Object.defineProperty(exports, "makePgService", { enumerable: true, get: function () { return pg_1.makePgService; } });
55
+ var grafast_cache_limits_1 = require("./grafast-cache-limits");
56
+ Object.defineProperty(exports, "applyGrafastCacheLimits", { enumerable: true, get: function () { return grafast_cache_limits_1.applyGrafastCacheLimits; } });
57
+ Object.defineProperty(exports, "createGrafastCacheLimitsPlugin", { enumerable: true, get: function () { return grafast_cache_limits_1.createGrafastCacheLimitsPlugin; } });
58
+ Object.defineProperty(exports, "createGrafastCacheLimitsPreset", { enumerable: true, get: function () { return grafast_cache_limits_1.createGrafastCacheLimitsPreset; } });
55
59
  var constructive_preset_1 = require("./presets/constructive-preset");
56
60
  Object.defineProperty(exports, "ConstructivePreset", { enumerable: true, get: function () { return constructive_preset_1.ConstructivePreset; } });
57
61
  Object.defineProperty(exports, "createConstructivePreset", { enumerable: true, get: function () { return constructive_preset_1.createConstructivePreset; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-settings",
3
- "version": "6.24.2",
3
+ "version": "6.24.4",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "graphile settings",
6
6
  "main": "index.js",
@@ -31,16 +31,16 @@
31
31
  "dependencies": {
32
32
  "@aws-sdk/client-s3": "^3.1052.0",
33
33
  "@constructive-io/bucket-provisioner": "^0.29.0",
34
- "@constructive-io/graphql-env": "^3.34.2",
35
- "@constructive-io/graphql-types": "^3.33.2",
36
- "@constructive-io/s3-streamer": "^2.44.2",
34
+ "@constructive-io/graphql-env": "^3.34.3",
35
+ "@constructive-io/graphql-types": "^3.33.3",
36
+ "@constructive-io/s3-streamer": "^2.44.3",
37
37
  "@constructive-io/s3-utils": "^2.34.0",
38
38
  "@constructive-io/upload-names": "^2.31.0",
39
39
  "@dataplan/json": "1.0.1",
40
40
  "@dataplan/pg": "1.1.1",
41
41
  "@graphile-contrib/pg-many-to-many": "2.0.0-rc.2",
42
42
  "@pgpmjs/logger": "^2.26.0",
43
- "@pgpmjs/types": "^2.55.2",
43
+ "@pgpmjs/types": "^2.56.0",
44
44
  "@pgsql/quotes": "^18.2.4",
45
45
  "cors": "^2.8.6",
46
46
  "express": "^5.2.1",
@@ -49,19 +49,19 @@
49
49
  "graphile-bucket-provisioner-plugin": "1.16.0",
50
50
  "graphile-build": "5.1.1",
51
51
  "graphile-build-pg": "5.1.3",
52
- "graphile-bulk-mutations": "^1.17.2",
52
+ "graphile-bulk-mutations": "^1.17.3",
53
53
  "graphile-config": "1.1.0",
54
- "graphile-connection-filter": "^2.17.2",
55
- "graphile-history": "^1.9.2",
56
- "graphile-i18n": "^2.18.2",
57
- "graphile-llm": "^1.18.2",
58
- "graphile-ltree": "^2.17.2",
54
+ "graphile-connection-filter": "^2.17.3",
55
+ "graphile-history": "^1.9.3",
56
+ "graphile-i18n": "^2.18.3",
57
+ "graphile-llm": "^1.18.3",
58
+ "graphile-ltree": "^2.17.3",
59
59
  "graphile-meta": "^1.10.0",
60
- "graphile-pg-aggregates": "^2.17.2",
61
- "graphile-postgis": "^3.18.2",
62
- "graphile-presigned-url-plugin": "^1.21.0",
60
+ "graphile-pg-aggregates": "^2.17.3",
61
+ "graphile-postgis": "^3.18.3",
62
+ "graphile-presigned-url-plugin": "^1.21.1",
63
63
  "graphile-realtime-subscriptions": "^1.12.0",
64
- "graphile-search": "^2.17.2",
64
+ "graphile-search": "^2.17.3",
65
65
  "graphile-upload-plugin": "^2.27.0",
66
66
  "graphile-utils": "5.0.3",
67
67
  "graphql": "16.13.0",
@@ -80,7 +80,7 @@
80
80
  "@types/express": "^5.0.6",
81
81
  "@types/pg": "^8.20.4",
82
82
  "@types/request-ip": "^0.0.41",
83
- "graphile-test": "^5.17.2",
83
+ "graphile-test": "^5.17.3",
84
84
  "makage": "^0.8.0",
85
85
  "nodemon": "^3.1.14",
86
86
  "ts-node": "^10.9.2"
@@ -92,5 +92,5 @@
92
92
  "constructive",
93
93
  "graphql"
94
94
  ],
95
- "gitHead": "e05686fb94c5e22c954436f18c25aa4439b9e83e"
95
+ "gitHead": "ee458dba426522b0d06e315f6ef010938ed71e0e"
96
96
  }