@memberjunction/server 0.9.1 → 0.9.3
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/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +8 -7
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.serve = exports.
|
|
32
|
+
exports.serve = exports.configInfo = exports.NewUserBase = exports.MaxLength = void 0;
|
|
33
33
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
34
34
|
dotenv_1.default.config();
|
|
35
35
|
const express4_1 = require("@apollo/server/express4");
|
|
@@ -53,15 +53,15 @@ const context_1 = require("./context");
|
|
|
53
53
|
const directives_1 = require("./directives");
|
|
54
54
|
const orm_1 = __importDefault(require("./orm"));
|
|
55
55
|
const cacheRefreshInterval = config_1.configInfo.databaseSettings.metadataCacheRefreshInterval;
|
|
56
|
-
var config_2 = require("./config");
|
|
57
|
-
Object.defineProperty(exports, "configInfo", { enumerable: true, get: function () { return config_2.configInfo; } });
|
|
58
|
-
var newUsers_1 = require("./auth/newUsers");
|
|
59
|
-
Object.defineProperty(exports, "NewUserBase", { enumerable: true, get: function () { return newUsers_1.NewUserBase; } });
|
|
60
56
|
var class_validator_1 = require("class-validator");
|
|
61
57
|
Object.defineProperty(exports, "MaxLength", { enumerable: true, get: function () { return class_validator_1.MaxLength; } });
|
|
62
|
-
__exportStar(require("./types"), exports);
|
|
63
|
-
__exportStar(require("./directives"), exports);
|
|
64
58
|
__exportStar(require("type-graphql"), exports);
|
|
59
|
+
var newUsers_1 = require("./auth/newUsers");
|
|
60
|
+
Object.defineProperty(exports, "NewUserBase", { enumerable: true, get: function () { return newUsers_1.NewUserBase; } });
|
|
61
|
+
var config_2 = require("./config");
|
|
62
|
+
Object.defineProperty(exports, "configInfo", { enumerable: true, get: function () { return config_2.configInfo; } });
|
|
63
|
+
__exportStar(require("./directives"), exports);
|
|
64
|
+
__exportStar(require("./types"), exports);
|
|
65
65
|
const serve = async (resolverPaths) => {
|
|
66
66
|
const dataSource = new typeorm_1.DataSource(orm_1.default);
|
|
67
67
|
const setupComplete$ = new rxjs_1.ReplaySubject(1);
|
|
@@ -77,7 +77,8 @@ const serve = async (resolverPaths) => {
|
|
|
77
77
|
.catch((err) => {
|
|
78
78
|
console.error('Error during Data Source initialization', err);
|
|
79
79
|
});
|
|
80
|
-
const paths = resolverPaths.flatMap((path) => (0, fast_glob_1.globSync)(path));
|
|
80
|
+
const paths = resolverPaths.flatMap((path) => (0, fast_glob_1.globSync)((0, fast_glob_1.convertPathToPattern)(path)));
|
|
81
|
+
console.log({ resolverPaths, paths });
|
|
81
82
|
const dynamicModules = await Promise.all(paths.map((modulePath) => { var _a; return _a = modulePath.replace(/\.[jt]s$/, ''), Promise.resolve().then(() => __importStar(require(_a))); }));
|
|
82
83
|
const resolvers = dynamicModules.flatMap((module) => Object.values(module).filter((value) => typeof value === 'function'));
|
|
83
84
|
const schema = directives_1.publicDirective.transformer((0, schema_1.mergeSchemas)({
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,sDAA4D;AAC5D,kDAAqD;AACrD,+CAAgD;AAChD,mFAA2G;AAC3G,6CAAmC;AACnC,gDAAwB;AACxB,sDAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B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AAe,GAAG,IAAI,oBAAe,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,wBAAe,EAAE,CAAC,CAAC;IAC3F,MAAM,aAAa,GAAG,IAAA,cAAS,EAC7B;QACE,MAAM;QACN,OAAO,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE;YACtC,MAAM,WAAW,GAAG,MAAM,IAAA,wBAAc,EAAC,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;YACzG,OAAO,EAAE,WAAW,EAAE,CAAC;QACzB,CAAC;KACF,EACD,eAAe,CAChB,CAAC;IAEF,MAAM,YAAY,GAAG,IAAA,sBAAiB,EAAC,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC,CAAC;IAClF,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;IAE3B,GAAG,CAAC,GAAG,CACL,wBAAe,EACf,IAAA,cAAI,GAAoB,EACxB,IAAA,kBAAI,GAAE,EACN,IAAA,4BAAiB,EAAC,YAAY,EAAE;QAC9B,OAAO,EAAE,IAAA,yBAAe,EAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC;KACzD,CAAC,CACH,CAAC;IAEF,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,oBAAW,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IACxF,OAAO,CAAC,GAAG,CAAC,uCAAuC,oBAAW,GAAG,CAAC,CAAC;AACrE,CAAC,CAAC;AAnEW,QAAA,KAAK,SAmEhB;AAEF,kBAAe,aAAK,CAAC"}
|
package/package.json
CHANGED
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')
|