@wbce-d9/api 12.5.3 → 12.5.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.
package/dist/app.js CHANGED
@@ -186,7 +186,9 @@ export default async function createApp() {
186
186
  await emitter.emitInit('middlewares.after', { app });
187
187
  await emitter.emitInit('routes.before', { app });
188
188
  app.use('/auth', authRouter);
189
- app.use('/graphql', graphqlRouter);
189
+ if (env['SERVE_GRAPHQL']) {
190
+ app.use('/graphql', graphqlRouter);
191
+ }
190
192
  app.use('/activity', activityRouter);
191
193
  app.use('/assets', assetsRouter);
192
194
  app.use('/collections', collectionsRouter);
@@ -1,5 +1,6 @@
1
1
  import { format } from 'date-fns';
2
2
  import { Router } from 'express';
3
+ import env from '../env.js';
3
4
  import { RouteNotFoundException } from '../exceptions/index.js';
4
5
  import { respond } from '../middleware/respond.js';
5
6
  import { ServerService } from '../services/server.js';
@@ -15,6 +16,9 @@ router.get('/specs/oas', asyncHandler(async (req, res, next) => {
15
16
  return next();
16
17
  }), respond);
17
18
  router.get('/specs/graphql/:scope?', asyncHandler(async (req, res) => {
19
+ if (env['SERVE_GRAPHQL'] === false) {
20
+ throw new RouteNotFoundException(req.path);
21
+ }
18
22
  const service = new SpecificationService({
19
23
  accountability: req.accountability,
20
24
  schema: req.schema,
package/dist/env.js CHANGED
@@ -22,6 +22,7 @@ const allowedEnvironmentVars = [
22
22
  'MAX_PAYLOAD_SIZE',
23
23
  'ROOT_REDIRECT',
24
24
  'SERVE_APP',
25
+ 'SERVE_GRAPHQL',
25
26
  'GRAPHQL_INTROSPECTION',
26
27
  'MAX_BATCH_MUTATION',
27
28
  'LOGGER_.+',
@@ -282,6 +283,7 @@ const defaults = {
282
283
  IP_CUSTOM_HEADER: false,
283
284
  IMPORT_IP_DENY_LIST: ['0.0.0.0', '169.254.169.254'],
284
285
  SERVE_APP: true,
286
+ SERVE_GRAPHQL: true,
285
287
  RELATIONAL_BATCH_SIZE: 25000,
286
288
  EXPORT_BATCH_SIZE: 5000,
287
289
  FILE_METADATA_ALLOW_LIST: 'ifd0.Make,ifd0.Model,exif.FNumber,exif.ExposureTime,exif.FocalLength,exif.ISO',
@@ -304,6 +306,7 @@ const typeMap = {
304
306
  CACHE_SKIP_ALLOWED: 'boolean',
305
307
  IMPORT_IP_DENY_LIST: 'array',
306
308
  FILE_METADATA_ALLOW_LIST: 'array',
309
+ SERVE_GRAPHQL: 'boolean',
307
310
  GRAPHQL_INTROSPECTION: 'boolean',
308
311
  MAX_BATCH_MUTATION: 'number',
309
312
  SERVER_SHUTDOWN_TIMEOUT: 'number',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wbce-d9/api",
3
- "version": "12.5.3",
3
+ "version": "12.5.4",
4
4
  "description": "Directus is a real-time API and App dashboard for managing SQL database content",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -144,19 +144,19 @@
144
144
  "tsx": "3.12.6",
145
145
  "uuid-validate": "0.0.3",
146
146
  "@wbce-d9/app": "10.1.1",
147
- "@wbce-d9/constants": "10.0.0",
148
147
  "@wbce-d9/extensions-sdk": "10.0.3",
149
- "@wbce-d9/exceptions": "10.0.0",
148
+ "@wbce-d9/constants": "10.0.0",
150
149
  "@wbce-d9/schema": "10.0.0",
151
150
  "@wbce-d9/specs": "9.26.5",
151
+ "@wbce-d9/exceptions": "10.0.0",
152
152
  "@wbce-d9/storage": "10.0.0",
153
153
  "@wbce-d9/storage-driver-azure": "10.0.2",
154
- "@wbce-d9/storage-driver-cloudinary": "10.0.3",
155
154
  "@wbce-d9/storage-driver-local": "10.0.2",
156
- "@wbce-d9/storage-driver-gcs": "10.0.2",
157
155
  "@wbce-d9/storage-driver-s3": "10.0.2",
156
+ "@wbce-d9/storage-driver-gcs": "10.0.2",
158
157
  "@wbce-d9/update-check": "10.0.3",
159
- "@wbce-d9/utils": "10.0.2"
158
+ "@wbce-d9/utils": "10.0.2",
159
+ "@wbce-d9/storage-driver-cloudinary": "10.0.3"
160
160
  },
161
161
  "devDependencies": {
162
162
  "@ngneat/falso": "6.4.0",