@memberjunction/server 0.9.0 → 0.9.2
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/.eslintignore +2 -1
- package/package.json +6 -6
- package/src/index.ts +8 -7
package/.eslintignore
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/server",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "MemberJunction: This project provides API access via GraphQL to the common data store.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"@memberjunction/global": "^0.9.19",
|
|
27
27
|
"@memberjunction/queue": "^0.9.17",
|
|
28
28
|
"@memberjunction/sqlserver-dataprovider": "^0.9.17",
|
|
29
|
+
"@types/axios": "^0.14.0",
|
|
30
|
+
"@types/cors": "^2.8.13",
|
|
31
|
+
"@types/jsonwebtoken": "^8.5.9",
|
|
32
|
+
"@types/node": "^18.11.14",
|
|
33
|
+
"@types/ws": "^8.5.5",
|
|
29
34
|
"axios": "^1.4.0",
|
|
30
35
|
"body-parser": "^1.20.2",
|
|
31
36
|
"class-validator": "^0.14.0",
|
|
@@ -49,11 +54,6 @@
|
|
|
49
54
|
"zod": "^3.22.4"
|
|
50
55
|
},
|
|
51
56
|
"devDependencies": {
|
|
52
|
-
"@types/axios": "^0.14.0",
|
|
53
|
-
"@types/cors": "^2.8.13",
|
|
54
|
-
"@types/jsonwebtoken": "^8.5.9",
|
|
55
|
-
"@types/node": "^18.11.14",
|
|
56
|
-
"@types/ws": "^8.5.5",
|
|
57
57
|
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
|
58
58
|
"@typescript-eslint/parser": "^5.46.1",
|
|
59
59
|
"concurrently": "^7.6.0",
|
package/src/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { setupSQLServerClient, SQLServerProviderConfigData } from '@memberjuncti
|
|
|
9
9
|
import { json } from 'body-parser';
|
|
10
10
|
import cors from 'cors';
|
|
11
11
|
import express from 'express';
|
|
12
|
-
import { globSync } from 'fast-glob';
|
|
12
|
+
import { convertPathToPattern, globSync } from 'fast-glob';
|
|
13
13
|
import { useServer } from 'graphql-ws/lib/use/ws';
|
|
14
14
|
import { createServer } from 'node:http';
|
|
15
15
|
import 'reflect-metadata';
|
|
@@ -25,12 +25,12 @@ import orm from './orm';
|
|
|
25
25
|
|
|
26
26
|
const cacheRefreshInterval = configInfo.databaseSettings.metadataCacheRefreshInterval;
|
|
27
27
|
|
|
28
|
-
export { configInfo } from './config';
|
|
29
|
-
export { NewUserBase } from './auth/newUsers';
|
|
30
28
|
export { MaxLength } from 'class-validator';
|
|
31
|
-
export * from './types';
|
|
32
|
-
export * from './directives';
|
|
33
29
|
export * from 'type-graphql';
|
|
30
|
+
export { NewUserBase } from './auth/newUsers';
|
|
31
|
+
export { configInfo } from './config';
|
|
32
|
+
export * from './directives';
|
|
33
|
+
export * from './types';
|
|
34
34
|
|
|
35
35
|
export const serve = async (resolverPaths: Array<string>) => {
|
|
36
36
|
const dataSource = new DataSource(orm);
|
|
@@ -48,8 +48,9 @@ export const serve = async (resolverPaths: Array<string>) => {
|
|
|
48
48
|
.catch((err) => {
|
|
49
49
|
console.error('Error during Data Source initialization', err);
|
|
50
50
|
});
|
|
51
|
-
|
|
52
|
-
const paths = resolverPaths.flatMap((path) => globSync(path));
|
|
51
|
+
|
|
52
|
+
const paths = resolverPaths.flatMap((path) => globSync(convertPathToPattern(path)));
|
|
53
|
+
console.log({ resolverPaths, paths });
|
|
53
54
|
const dynamicModules = await Promise.all(paths.map((modulePath) => import(modulePath.replace(/\.[jt]s$/, ''))));
|
|
54
55
|
const resolvers = dynamicModules.flatMap((module) =>
|
|
55
56
|
Object.values(module).filter((value) => typeof value === 'function')
|