@memberjunction/server 0.9.2 → 0.9.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/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/orm.js +16 -17
- package/dist/orm.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -3
- package/src/orm.ts +18 -15
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,17 +53,19 @@ 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
|
-
const
|
|
66
|
+
const paths = resolverPaths.flatMap((path) => (0, fast_glob_1.globSync)((0, fast_glob_1.convertPathToPattern)(path)));
|
|
67
|
+
console.log({ resolverPaths, paths });
|
|
68
|
+
const dataSource = new typeorm_1.DataSource((0, orm_1.default)(paths));
|
|
67
69
|
const setupComplete$ = new rxjs_1.ReplaySubject(1);
|
|
68
70
|
dataSource
|
|
69
71
|
.initialize()
|
|
@@ -77,7 +79,6 @@ const serve = async (resolverPaths) => {
|
|
|
77
79
|
.catch((err) => {
|
|
78
80
|
console.error('Error during Data Source initialization', err);
|
|
79
81
|
});
|
|
80
|
-
const paths = resolverPaths.flatMap((path) => (0, fast_glob_1.globSync)(path));
|
|
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
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ANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
7
3
|
const config_1 = require("./config");
|
|
8
|
-
const orm = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const orm = (entities) => {
|
|
5
|
+
const ormConfig = {
|
|
6
|
+
type: 'mssql',
|
|
7
|
+
entities,
|
|
8
|
+
logging: false,
|
|
9
|
+
host: config_1.dbHost,
|
|
10
|
+
port: config_1.dbPort,
|
|
11
|
+
username: config_1.dbUsername,
|
|
12
|
+
password: config_1.dbPassword,
|
|
13
|
+
database: config_1.dbDatabase,
|
|
14
|
+
synchronize: false,
|
|
15
|
+
requestTimeout: config_1.configInfo.databaseSettings.requestTimeout,
|
|
16
|
+
connectionTimeout: config_1.configInfo.databaseSettings.connectionTimeout,
|
|
17
|
+
};
|
|
18
|
+
console.log({ ormConfig: { ...ormConfig, password: '***' } });
|
|
19
|
+
return ormConfig;
|
|
21
20
|
};
|
|
22
21
|
exports.default = orm;
|
|
23
22
|
//# sourceMappingURL=orm.js.map
|
package/dist/orm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orm.js","sourceRoot":"","sources":["../src/orm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orm.js","sourceRoot":"","sources":["../src/orm.ts"],"names":[],"mappings":";;AACA,qCAA0F;AAE1F,MAAM,GAAG,GAAG,CAAC,QAAuB,EAAqB,EAAE;IACzD,MAAM,SAAS,GAAG;QAChB,IAAI,EAAE,OAAgB;QACtB,QAAQ;QACR,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,eAAM;QACZ,IAAI,EAAE,eAAM;QACZ,QAAQ,EAAE,mBAAU;QACpB,QAAQ,EAAE,mBAAU;QACpB,QAAQ,EAAE,mBAAU;QACpB,WAAW,EAAE,KAAK;QAClB,cAAc,EAAE,mBAAU,CAAC,gBAAgB,CAAC,cAAc;QAC1D,iBAAiB,EAAE,mBAAU,CAAC,gBAAgB,CAAC,iBAAiB;KACjE,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,kBAAe,GAAG,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -33,7 +33,10 @@ export * from './directives';
|
|
|
33
33
|
export * from './types';
|
|
34
34
|
|
|
35
35
|
export const serve = async (resolverPaths: Array<string>) => {
|
|
36
|
-
const
|
|
36
|
+
const paths = resolverPaths.flatMap((path) => globSync(convertPathToPattern(path)));
|
|
37
|
+
console.log({ resolverPaths, paths });
|
|
38
|
+
|
|
39
|
+
const dataSource = new DataSource(orm(paths));
|
|
37
40
|
const setupComplete$ = new ReplaySubject(1);
|
|
38
41
|
dataSource
|
|
39
42
|
.initialize()
|
|
@@ -49,8 +52,6 @@ export const serve = async (resolverPaths: Array<string>) => {
|
|
|
49
52
|
console.error('Error during Data Source initialization', err);
|
|
50
53
|
});
|
|
51
54
|
|
|
52
|
-
const paths = resolverPaths.flatMap((path) => globSync(convertPathToPattern(path)));
|
|
53
|
-
console.log({ resolverPaths, paths });
|
|
54
55
|
const dynamicModules = await Promise.all(paths.map((modulePath) => import(modulePath.replace(/\.[jt]s$/, ''))));
|
|
55
56
|
const resolvers = dynamicModules.flatMap((module) =>
|
|
56
57
|
Object.values(module).filter((value) => typeof value === 'function')
|
package/src/orm.ts
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { configInfo, dbDatabase, dbHost, dbPassword, dbPort, dbUsername } from './config';
|
|
3
1
|
import { DataSourceOptions } from 'typeorm';
|
|
2
|
+
import { configInfo, dbDatabase, dbHost, dbPassword, dbPort, dbUsername } from './config';
|
|
3
|
+
|
|
4
|
+
const orm = (entities: Array<string>): DataSourceOptions => {
|
|
5
|
+
const ormConfig = {
|
|
6
|
+
type: 'mssql' as const,
|
|
7
|
+
entities,
|
|
8
|
+
logging: false,
|
|
9
|
+
host: dbHost,
|
|
10
|
+
port: dbPort,
|
|
11
|
+
username: dbUsername,
|
|
12
|
+
password: dbPassword,
|
|
13
|
+
database: dbDatabase,
|
|
14
|
+
synchronize: false,
|
|
15
|
+
requestTimeout: configInfo.databaseSettings.requestTimeout,
|
|
16
|
+
connectionTimeout: configInfo.databaseSettings.connectionTimeout,
|
|
17
|
+
};
|
|
4
18
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
entities: [path.resolve(__dirname, './generated/**')],
|
|
8
|
-
migrations: [path.resolve(__dirname, './migrations/**')],
|
|
9
|
-
logging: false,
|
|
10
|
-
host: dbHost,
|
|
11
|
-
port: dbPort,
|
|
12
|
-
username: dbUsername,
|
|
13
|
-
password: dbPassword,
|
|
14
|
-
database: dbDatabase,
|
|
15
|
-
synchronize: false,
|
|
16
|
-
requestTimeout: configInfo.databaseSettings.requestTimeout,
|
|
17
|
-
connectionTimeout: configInfo.databaseSettings.connectionTimeout,
|
|
19
|
+
console.log({ ormConfig: { ...ormConfig, password: '***' } });
|
|
20
|
+
return ormConfig;
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export default orm;
|