@memberjunction/server 2.133.0 → 3.0.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.
package/src/index.ts CHANGED
@@ -10,7 +10,7 @@ import { extendConnectionPoolWithQuery } from './util.js';
10
10
  import { default as BodyParser } from 'body-parser';
11
11
  import compression from 'compression'; // Add compression middleware
12
12
  import cors from 'cors';
13
- import express from 'express';
13
+ import express, { Application } from 'express';
14
14
  import { default as fg } from 'fast-glob';
15
15
  import { useServer } from 'graphql-ws/lib/use/ws';
16
16
  import { createServer } from 'node:http';
@@ -77,7 +77,7 @@ const cacheRefreshInterval = configInfo.databaseSettings.metadataCacheRefreshInt
77
77
  export { MaxLength } from 'class-validator';
78
78
  export * from 'type-graphql';
79
79
  export { NewUserBase } from './auth/newUsers.js';
80
- export { configInfo } from './config.js';
80
+ export { configInfo, DEFAULT_SERVER_CONFIG } from './config.js';
81
81
  export * from './directives/index.js';
82
82
  export * from './entitySubclasses/entityPermissions.server.js';
83
83
  export * from './types.js';
@@ -131,9 +131,9 @@ const localPath = (p: string) => {
131
131
  return resolvedPath;
132
132
  };
133
133
 
134
- export const createApp = () => express();
134
+ export const createApp = (): Application => express();
135
135
 
136
- export const serve = async (resolverPaths: Array<string>, app = createApp(), options?: MJServerOptions) => {
136
+ export const serve = async (resolverPaths: Array<string>, app: Application = createApp(), options?: MJServerOptions): Promise<void> => {
137
137
  const localResolverPaths = ['resolvers/**/*Resolver.{js,ts}', 'generic/*Resolver.{js,ts}', 'generated/generated.{js,ts}'].map(localPath);
138
138
 
139
139
  const combinedResolverPaths = [...resolverPaths, ...localResolverPaths];