@things-factory/shell 5.0.0 → 5.0.11
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/bin/things-factory-dev +1 -1
- package/db.test.sqlite +0 -0
- package/dist-server/graphql-local-client.js.map +1 -1
- package/dist-server/index.js +9 -22
- package/dist-server/index.js.map +1 -1
- package/dist-server/initializers/database.js.map +1 -1
- package/dist-server/initializers/naming-strategy.js +3 -5
- package/dist-server/initializers/naming-strategy.js.map +1 -1
- package/dist-server/middlewares/domain-middleware.js +0 -4
- package/dist-server/middlewares/domain-middleware.js.map +1 -1
- package/dist-server/middlewares/index.js +2 -17
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/1000000000000-SeedDomain.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/pubsub-log-transport.js +3 -5
- package/dist-server/pubsub-log-transport.js.map +1 -1
- package/dist-server/pubsub.js +2 -6
- package/dist-server/pubsub.js.map +1 -1
- package/dist-server/routers/domain-router.js +2 -7
- package/dist-server/routers/domain-router.js.map +1 -1
- package/dist-server/routers/global-router.js +3 -7
- package/dist-server/routers/global-router.js.map +1 -1
- package/dist-server/routers/index.js +3 -16
- package/dist-server/routers/index.js.map +1 -1
- package/dist-server/schema.js.map +1 -1
- package/dist-server/server-dev.js +11 -14
- package/dist-server/server-dev.js.map +1 -1
- package/dist-server/server.js +10 -12
- package/dist-server/server.js.map +1 -1
- package/dist-server/service/common-types/index.js +7 -20
- package/dist-server/service/common-types/index.js.map +1 -1
- package/dist-server/service/common-types/list-param.js +27 -35
- package/dist-server/service/common-types/list-param.js.map +1 -1
- package/dist-server/service/common-types/log.js +10 -18
- package/dist-server/service/common-types/log.js.map +1 -1
- package/dist-server/service/common-types/object-ref.js +8 -16
- package/dist-server/service/common-types/object-ref.js.map +1 -1
- package/dist-server/service/common-types/scalar-any.js.map +1 -1
- package/dist-server/service/common-types/scalar-date.js.map +1 -1
- package/dist-server/service/common-types/scalar-object.js.map +1 -1
- package/dist-server/service/directive-transaction/index.js +2 -15
- package/dist-server/service/directive-transaction/index.js.map +1 -1
- package/dist-server/service/directive-transaction/transaction.js +2 -7
- package/dist-server/service/directive-transaction/transaction.js.map +1 -1
- package/dist-server/service/domain/domain-resolver.js +44 -55
- package/dist-server/service/domain/domain-resolver.js.map +1 -1
- package/dist-server/service/domain/domain-types.js +32 -40
- package/dist-server/service/domain/domain-types.js.map +1 -1
- package/dist-server/service/domain/domain.js +30 -38
- package/dist-server/service/domain/domain.js.map +1 -1
- package/dist-server/service/domain/index.js.map +1 -1
- package/dist-server/service/index.js +5 -18
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/subscription-data/data-resolver.js +9 -22
- package/dist-server/service/subscription-data/data-resolver.js.map +1 -1
- package/dist-server/service/subscription-data/data-types.js +8 -17
- package/dist-server/service/subscription-data/data-types.js.map +1 -1
- package/dist-server/service/subscription-data/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/dist-server/utils/condition-builder.js +2 -4
- package/dist-server/utils/condition-builder.js.map +1 -1
- package/dist-server/utils/get-domain.js +2 -5
- package/dist-server/utils/get-domain.js.map +1 -1
- package/dist-server/utils/get-query-builder-from-list-params.js +7 -8
- package/dist-server/utils/get-query-builder-from-list-params.js.map +1 -1
- package/dist-server/utils/index.js +8 -21
- package/dist-server/utils/index.js.map +1 -1
- package/dist-server/utils/list-param-adjuster.js.map +1 -1
- package/dist-server/utils/list-params-converter.js +1 -2
- package/dist-server/utils/list-params-converter.js.map +1 -1
- package/dist-server/utils/list-query-builder.js +2 -3
- package/dist-server/utils/list-query-builder.js.map +1 -1
- package/dist-server/utils/publish-progress.js.map +1 -1
- package/dist-server/webpack/koa-webpack/client.js.map +1 -1
- package/dist-server/webpack/koa-webpack/index.js.map +1 -1
- package/dist-server/webpack/koa-webpack/middleware.js.map +1 -1
- package/dist-server/webpack/koa-webpack/validate.js.map +1 -1
- package/package.json +8 -8
- package/server/middlewares/domain-middleware.ts +0 -5
- package/server/middlewares/index.ts +0 -4
- package/server/pubsub.ts +0 -4
- package/server/routers/domain-router.ts +1 -4
- package/server/routers/global-router.ts +2 -3
- package/server/server-dev.ts +0 -2
- package/server/service/directive-transaction/transaction.ts +0 -6
- package/server/service/subscription-data/data-resolver.ts +3 -6
- package/server/service/subscription-data/data-types.ts +2 -3
- package/server/utils/get-domain.ts +4 -6
- package/server/utils/get-query-builder-from-list-params.ts +13 -9
- package/server/utils/list-params-converter.ts +4 -3
- package/server/utils/list-query-builder.ts +8 -4
package/bin/things-factory-dev
CHANGED
package/db.test.sqlite
ADDED
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"graphql-local-client.js","sourceRoot":"","sources":["../server/graphql-local-client.ts"],"names":[],"mappings":";;;AAAA,2DAAqD;AAErD,qCAA6C;AA4B7C,MAAa,kBAAkB;IAG7B,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;QACrB,MAAM,OAAO,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;YAChE,8CAA8C;YAC9C,MAAM,MAAM,GAAG,IAAI,qCAAgB,CAAC;gBAClC,MAAM;gBACN,OAAO,kCAOF,OAAO,KACV,GAAG,GACJ;aACF,CAAC,CAAA;YAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC7D,MAAM,SAAS,GAAG,KAAK,IAAI,QAAQ,CAAA;YACnC,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE;gBACzC,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;aACzE;YAED,+BAA+B;YAC/B,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC;gBACjC,SAAS;gBACT,KAAK,EAAE,OAAO,SAAS,KAAK,QAA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E;gBACzC,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;aACzE;YAED,+BAA+B;YAC/B,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC;gBACjC,SAAS;gBACT,KAAK,EAAE,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,eAAK,EAAC,SAAS,CAAC;aACpE,CAAC,CAAA;YAEF,8CAA8C;YAC9C,+CAA+C;YAC/C,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE;gBACvC,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBACjE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;aACzB;YAED,OAAO,GAAG,CAAA;QACZ,CAAC,CAAA;QAED,kBAAkB,CAAC,MAAM,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA;IACjE,CAAC;CACF;AA5CD,gDA4CC","sourcesContent":["import { ApolloServerBase } from 'apollo-server-core'\nimport { GraphQLResponse } from 'apollo-server-types'\nimport { print, DocumentNode } from 'graphql'\n\ntype StringOrAst = string | DocumentNode\n\n// A query must not come with a mutation (and vice versa).\ntype Query = {\n query: StringOrAst\n mutation?: undefined\n variables?: {\n [name: string]: any\n }\n operationName?: string\n}\n\ntype Mutation = {\n mutation: StringOrAst\n query?: undefined\n variables?: {\n [name: string]: any\n }\n operationName?: string\n}\n\nexport interface ApolloServerLocalClient {\n query: (query: Query) => Promise<GraphQLResponse>\n mutate: (mutation: Mutation) => Promise<GraphQLResponse>\n}\n\nexport class GraphqlLocalClient {\n static client: ApolloServerLocalClient\n\n static init(schema, app) {\n const resolve = async ({ query, mutation, variables, context }) => {\n // Create a new Apollo Server for each request\n const server = new ApolloServerBase({\n schema,\n context: {\n // ⚠️ Note: here you should construct your GraphQL\n // context! When calling the query/mutation, I\n // usually like to override some properties (eg the\n // authed user which I attach to the context). Here\n // is where you need to put all your default GraphQL\n // context data. Eg dataloaders etc.\n ...context,\n app\n }\n })\n\n const executeOperation = server.executeOperation.bind(server)\n const operation = query || mutation\n if (!operation || (!!query && !!mutation)) {\n throw new Error('Either query or mutation must be passed, but not both')\n }\n\n // Execute the actual operation\n const res = await executeOperation({\n variables,\n query: typeof operation === 'string' ? operation : print(operation)\n })\n\n // Throw an error with all the messages of the\n // errors to make them easy to match using Jest\n if (!!res.errors && !!res.errors.length) {\n const message = res.errors.map(error => error.message).join('\\n')\n throw new Error(message)\n }\n\n return res\n }\n\n GraphqlLocalClient.client = { query: resolve, mutate: resolve }\n }\n}\n"]}
|
package/dist-server/index.js
CHANGED
@@ -1,25 +1,12 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
|
18
|
-
__exportStar(require("./
|
19
|
-
__exportStar(require("./
|
20
|
-
__exportStar(require("./
|
21
|
-
__exportStar(require("./pubsub
|
22
|
-
__exportStar(require("./
|
23
|
-
__exportStar(require("./
|
24
|
-
__exportStar(require("./
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./migrations"), exports);
|
5
|
+
tslib_1.__exportStar(require("./initializers/naming-strategy"), exports);
|
6
|
+
tslib_1.__exportStar(require("./utils"), exports);
|
7
|
+
tslib_1.__exportStar(require("./pubsub"), exports);
|
8
|
+
tslib_1.__exportStar(require("./pubsub-log-transport"), exports);
|
9
|
+
tslib_1.__exportStar(require("./middlewares"), exports);
|
10
|
+
tslib_1.__exportStar(require("./graphql-local-client"), exports);
|
11
|
+
tslib_1.__exportStar(require("./service"), exports);
|
25
12
|
//# sourceMappingURL=index.js.map
|
package/dist-server/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,yEAA8C;AAC9C,kDAAuB;AACvB,mDAAwB;AACxB,iEAAsC;AACtC,wDAA6B;AAC7B,iEAAsC;AACtC,oDAAyB","sourcesContent":["export * from './migrations'\nexport * from './initializers/naming-strategy'\nexport * from './utils'\nexport * from './pubsub'\nexport * from './pubsub-log-transport'\nexport * from './middlewares'\nexport * from './graphql-local-client'\nexport * from './service'\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../server/initializers/database.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAE5B,qCAA0C;AAC1C,6CAAyD;AAEzD,IAAI,SAAS,CAAA;AACb,IAAI;IACF,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAW,EAAE,WAAW,CAAC,CAAC,CAAA;CAC5D;AAAC,OAAO,CAAC,EAAE;IACV,SAAS,GAAG,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W,IAAI,KAAK,EAAE;YAChE,MAAM,UAAU,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;YACjD,MAAM,UAAU,CAAC,WAAW,EAAE,CAAA;YAC9B,MAAM,UAAU,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;SACjD;QAED,OAAO,UAAU,CAAA;KAClB;IAAC,OAAO,CAAC,EAAE;QACV,YAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;KAChB;AACH,CAAC,CAAA;AAfY,QAAA,mBAAmB,uBAe/B","sourcesContent":["const path = require('path')\n\nimport { createConnection } from 'typeorm'\nimport { logger, appRootPath } from '@things-factory/env'\n\nvar ormconfig\ntry {\n ormconfig = require(path.resolve(appRootPath, 'ormconfig'))\n} catch (e) {\n ormconfig = require('@things-factory/shell/ormconfig')\n}\n\nexport const databaseInitializer = async () => {\n try {\n const connection = await createConnection(ormconfig)\n logger.info('Database connection established')\n\n if (ormconfig.type == 'sqlite' && ormconfig.synchronize == false) {\n await connection.query('PRAGMA foreign_keys=OFF')\n await connection.synchronize()\n await connection.query('PRAGMA foreign_keys=ON')\n }\n\n return connection\n } catch (e) {\n logger.error(e)\n }\n}\n"]}
|
@@ -1,12 +1,10 @@
|
|
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
3
|
exports.NamingStrategy = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
7
5
|
const typeorm_1 = require("typeorm");
|
8
|
-
const pluralize_1 = __importDefault(require("pluralize"));
|
9
|
-
const lodash_1 = __importDefault(require("lodash"));
|
6
|
+
const pluralize_1 = tslib_1.__importDefault(require("pluralize"));
|
7
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
10
8
|
class NamingStrategy extends typeorm_1.DefaultNamingStrategy {
|
11
9
|
tableName(targetName, userSpecifiedName) {
|
12
10
|
return userSpecifiedName || (0, pluralize_1.default)(lodash_1.default.snakeCase(targetName));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"naming-strategy.js","sourceRoot":"","sources":["../../server/initializers/naming-strategy.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"naming-strategy.js","sourceRoot":"","sources":["../../server/initializers/naming-strategy.ts"],"names":[],"mappings":";;;;AACA,qCAA+C;AAC/C,kEAAiC;AACjC,4DAAsB;AAEtB,MAAa,cAAe,SAAQ,+BAAqB;IACvD,SAAS,CAAC,UAAkB,EAAE,iBAAyB;QACrD,OAAO,iBAAiB,IAAI,IAAA,mBAAS,EAAC,gBAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAA;IAChE,CAAC;IAED,UAAU,CAAC,YAAoB,EAAE,UAAkB,EAAE,gBAA0B;QAC7E,OAAO,gBAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,UAAU,IAAI,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IACnF,CAAC;CACF;AARD,wCAQC","sourcesContent":["import { NamingStrategyInterface } from 'typeorm'\nimport { DefaultNamingStrategy } from 'typeorm'\nimport pluralize from 'pluralize'\nimport _ from 'lodash'\n\nexport class NamingStrategy extends DefaultNamingStrategy implements NamingStrategyInterface {\n tableName(targetName: string, userSpecifiedName: string): string {\n return userSpecifiedName || pluralize(_.snakeCase(targetName))\n }\n\n columnName(propertyName: string, customName: string, embeddedPrefixes: string[]): string {\n return _.snakeCase(embeddedPrefixes.concat(customName || propertyName).join('_'))\n }\n}\n"]}
|
@@ -2,12 +2,9 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.domainMiddleware = void 0;
|
4
4
|
const utils_1 = require("../utils");
|
5
|
-
const debug = require('debug')('things-factory:shell:domain-middleware');
|
6
5
|
async function domainMiddleware(context, next) {
|
7
|
-
var _a;
|
8
6
|
const { domain } = context.state;
|
9
7
|
if (domain) {
|
10
|
-
debug('already fetch domain', context.path, domain.subdomain);
|
11
8
|
return await next();
|
12
9
|
}
|
13
10
|
/*
|
@@ -16,7 +13,6 @@ async function domainMiddleware(context, next) {
|
|
16
13
|
* So, we don't check domainType here.
|
17
14
|
*/
|
18
15
|
context.state.domain = await (0, utils_1.getDomainFromURL)(context);
|
19
|
-
debug('subdomain', context.path, (_a = context.state.domain) === null || _a === void 0 ? void 0 : _a.subdomain);
|
20
16
|
await next();
|
21
17
|
}
|
22
18
|
exports.domainMiddleware = domainMiddleware;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domain-middleware.js","sourceRoot":"","sources":["../../server/middlewares/domain-middleware.ts"],"names":[],"mappings":";;;AAAA,oCAA2C;
|
1
|
+
{"version":3,"file":"domain-middleware.js","sourceRoot":"","sources":["../../server/middlewares/domain-middleware.ts"],"names":[],"mappings":";;;AAAA,oCAA2C;AAEpC,KAAK,UAAU,gBAAgB,CAAC,OAAY,EAAE,IAAS;IAC5D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IAChC,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,IAAI,EAAE,CAAA;KACpB;IAED;;;;OAIG;IACH,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,IAAA,wBAAgB,EAAC,OAAO,CAAC,CAAA;IAEtD,MAAM,IAAI,EAAE,CAAA;AACd,CAAC;AAdD,4CAcC","sourcesContent":["import { getDomainFromURL } from '../utils'\n\nexport async function domainMiddleware(context: any, next: any) {\n const { domain } = context.state\n if (domain) {\n return await next()\n }\n\n /*\n * The domainType should be checked only when signin and checkin.\n * For purposes such as API calls, the target domainType may be different from the system domainType.\n * So, we don't check domainType here.\n */\n context.state.domain = await getDomainFromURL(context)\n\n await next()\n}\n"]}
|
@@ -1,23 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
3
|
exports.initMiddlewares = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
18
5
|
const env_1 = require("@things-factory/env");
|
19
6
|
const domain_middleware_1 = require("./domain-middleware");
|
20
|
-
const debug = require('debug')('things-factory:shell:middleware');
|
21
7
|
function initMiddlewares(app) {
|
22
8
|
app.subdomainOffset = env_1.config.get('subdomainOffset', 2);
|
23
9
|
app.on('error', (err, context) => {
|
@@ -52,8 +38,7 @@ function initMiddlewares(app) {
|
|
52
38
|
}
|
53
39
|
exports.initMiddlewares = initMiddlewares;
|
54
40
|
process.on('bootstrap-module-subscription', (app, subscriptionMiddleware) => {
|
55
|
-
debug('bootstrap-module-subscription');
|
56
41
|
subscriptionMiddleware.push(domain_middleware_1.domainMiddleware);
|
57
42
|
});
|
58
|
-
__exportStar(require("./domain-middleware"), exports);
|
43
|
+
tslib_1.__exportStar(require("./domain-middleware"), exports);
|
59
44
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"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AE;IACjF,sBAAsB,CAAC,IAAI,CAAC,oCAAgB,CAAC,CAAA;AAC/C,CAAC,CAAC,CAAA;AAEF,8DAAmC","sourcesContent":["import { config, logger } from '@things-factory/env'\n\nimport { domainMiddleware } from './domain-middleware'\n\nexport function initMiddlewares(app) {\n app.subdomainOffset = config.get('subdomainOffset', 2)\n\n app.on('error', (err, context) => {\n logger.error(err)\n })\n\n /*\n * Catching downstream errors\n * - recommend to use context.throw, context.assert\n */\n app.use(async (context, next) => {\n try {\n await next()\n } catch (err) {\n context.status = err?.status || 500\n context.body = err?.message\n\n // emitting error to app.on('error', ...)\n context.app.emit('error', err, context)\n }\n })\n\n /*\n * post:graphql 에 대해서는 domain을 확인한다.\n * graphql app을 router에 적용하지 못하기 때문임.\n */\n app.use(async (context, next) => {\n const { method, path } = context\n\n if (method == 'POST' && path.startsWith('/graphql')) {\n return await domainMiddleware(context, next)\n }\n\n await next()\n })\n}\n\nprocess.on('bootstrap-module-subscription' as any, (app, subscriptionMiddleware) => {\n subscriptionMiddleware.push(domainMiddleware)\n})\n\nexport * from './domain-middleware'\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"1000000000000-SeedDomain.js","sourceRoot":"","sources":["../../server/migrations/1000000000000-SeedDomain.ts"],"names":[],"mappings":";;;AAAA,qCAAwE;AACxE,qDAAiD;AAEjD,MAAM,YAAY,GAAG;IACnB;QACE,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,IAAI;KACjB;CACF,CAAA;AAED,MAAa,uBAAuB;IAC3B,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,eAAM,CAAC,CAAA;QAExC,OAAO,MAAM,OAAO,CAAC,GAAG,CACtB,YAAY,CAAC,GAAG,CAAC,KAAK,EAAC,MAAM,EAAC,EAAE;YAC9B,MAAM,UAAU,CAAC,IAAI,mBAChB,MAAM,EACT,CAAA;QACJ,CAAC,CAAC,CACH,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,eAAM,CAAC,CAAA;QAExC,OAAO,MAAM,OAAO,CAAC,GAAG,CACtB,YAAY,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,EAAC,MAAM,EAAC,EAAE;YACxC,IAAI,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAA;YACtE,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACjC,CAAC,CAAC,CACH,CAAA;IACH,CAAC;CACF;AAvBD,0DAuBC"}
|
1
|
+
{"version":3,"file":"1000000000000-SeedDomain.js","sourceRoot":"","sources":["../../server/migrations/1000000000000-SeedDomain.ts"],"names":[],"mappings":";;;AAAA,qCAAwE;AACxE,qDAAiD;AAEjD,MAAM,YAAY,GAAG;IACnB;QACE,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,IAAI;KACjB;CACF,CAAA;AAED,MAAa,uBAAuB;IAC3B,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,eAAM,CAAC,CAAA;QAExC,OAAO,MAAM,OAAO,CAAC,GAAG,CACtB,YAAY,CAAC,GAAG,CAAC,KAAK,EAAC,MAAM,EAAC,EAAE;YAC9B,MAAM,UAAU,CAAC,IAAI,mBAChB,MAAM,EACT,CAAA;QACJ,CAAC,CAAC,CACH,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,eAAM,CAAC,CAAA;QAExC,OAAO,MAAM,OAAO,CAAC,GAAG,CACtB,YAAY,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,EAAC,MAAM,EAAC,EAAE;YACxC,IAAI,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAA;YACtE,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACjC,CAAC,CAAC,CACH,CAAA;IACH,CAAC;CACF;AAvBD,0DAuBC","sourcesContent":["import { MigrationInterface, QueryRunner, getRepository } from 'typeorm'\nimport { Domain } from '../service/domain/domain'\n\nconst SEED_DOMAINS = [\n {\n name: 'SYSTEM',\n subdomain: 'system',\n systemFlag: true\n }\n]\n\nexport class SeedDomain1000000000000 implements MigrationInterface {\n public async up(queryRunner: QueryRunner): Promise<any> {\n const repository = getRepository(Domain)\n\n return await Promise.all(\n SEED_DOMAINS.map(async domain => {\n await repository.save({\n ...domain\n })\n })\n )\n }\n\n public async down(queryRunner: QueryRunner): Promise<any> {\n const repository = getRepository(Domain)\n\n return await Promise.all(\n SEED_DOMAINS.reverse().map(async domain => {\n let recode = await repository.findOne({ subdomain: domain.subdomain })\n await repository.remove(recode)\n })\n )\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA","sourcesContent":["const glob = require('glob')\nconst path = require('path')\n\nexport var migrations = []\n\nglob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function(file) {\n if (file.indexOf('index.js') !== -1) return\n migrations = migrations.concat(Object.values(require(path.resolve(file))) || [])\n})\n"]}
|
@@ -1,11 +1,9 @@
|
|
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
3
|
exports.PubSubLogTransport = void 0;
|
7
|
-
const
|
8
|
-
const
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const camelCase_1 = tslib_1.__importDefault(require("lodash/camelCase"));
|
6
|
+
const winston_transport_1 = tslib_1.__importDefault(require("winston-transport"));
|
9
7
|
const pubsub_1 = require("./pubsub");
|
10
8
|
class PubSubLogTransport extends winston_transport_1.default {
|
11
9
|
constructor(opts) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pubsub-log-transport.js","sourceRoot":"","sources":["../server/pubsub-log-transport.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"pubsub-log-transport.js","sourceRoot":"","sources":["../server/pubsub-log-transport.ts"],"names":[],"mappings":";;;;AAAA,yEAAwC;AACxC,kFAAyC;AACzC,qCAAiC;AAEjC,MAAa,kBAAmB,SAAQ,2BAAS;IAK/C,YAAY,IAAI;QACd,KAAK,CAAC,IAAI,CAAC,CAAA;QAEX,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAA,mBAAS,EAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACxD,CAAC;IAED,GAAG,CAAC,IAAI,EAAE,QAAQ;QAChB,YAAY,CAAC,GAAG,EAAE;YAChB,eAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;gBACzB,CAAC,IAAI,CAAC,QAAQ,CAAC,kBACb,MAAM,EAAE,IAAI,CAAC,MAAM,IAChB,IAAI,CACR;aACF,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,QAAQ,EAAE,CAAA;IACZ,CAAC;CACF;AAzBD,gDAyBC","sourcesContent":["import camelCase from 'lodash/camelCase'\nimport Transport from 'winston-transport'\nimport { pubsub } from './pubsub'\n\nexport class PubSubLogTransport extends Transport {\n source: object\n topic: string\n resolver: string /* field resolver name */\n\n constructor(opts) {\n super(opts)\n\n this.topic = opts.topic\n this.source = opts.source\n this.resolver = opts.resolver || camelCase(this.topic)\n }\n\n log(info, callback) {\n setImmediate(() => {\n pubsub.publish(this.topic, {\n [this.resolver]: {\n source: this.source,\n ...info\n }\n })\n })\n\n callback()\n }\n}\n"]}
|
package/dist-server/pubsub.js
CHANGED
@@ -1,17 +1,14 @@
|
|
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
3
|
exports.pubsub = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
7
5
|
const graphql_mqtt_subscriptions_1 = require("graphql-mqtt-subscriptions");
|
8
6
|
const graphql_redis_subscriptions_1 = require("graphql-redis-subscriptions");
|
9
7
|
const graphql_subscriptions_1 = require("graphql-subscriptions");
|
10
|
-
const ioredis_1 = __importDefault(require("ioredis"));
|
8
|
+
const ioredis_1 = tslib_1.__importDefault(require("ioredis"));
|
11
9
|
const mqtt_1 = require("mqtt");
|
12
10
|
const env_1 = require("@things-factory/env");
|
13
11
|
const { middleware, host, port, nodes, topic, options } = env_1.config.get('pubsub', {});
|
14
|
-
const debug = require('debug')('things-factory:shell');
|
15
12
|
let pubsub;
|
16
13
|
exports.pubsub = pubsub;
|
17
14
|
switch (middleware) {
|
@@ -57,7 +54,6 @@ switch (middleware) {
|
|
57
54
|
exports.pubsub = pubsub = new graphql_subscriptions_1.PubSub();
|
58
55
|
break;
|
59
56
|
}
|
60
|
-
debug(middleware || 'default', 'pubsub initialized.');
|
61
57
|
// kafka pubsub keeps connection and app port with 'ctrl+c' termination.
|
62
58
|
const exitHandler = async (evt) => {
|
63
59
|
if (pubsub.close) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pubsub.js","sourceRoot":"","sources":["../server/pubsub.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"pubsub.js","sourceRoot":"","sources":["../server/pubsub.ts"],"names":[],"mappings":";;;;AAAA,2EAAuD;AACvD,6EAAyD;AACzD,iEAA8C;AAC9C,8DAA2B;AAC3B,+BAA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IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA","sourcesContent":["import { MQTTPubSub } from 'graphql-mqtt-subscriptions'\nimport { RedisPubSub } from 'graphql-redis-subscriptions'\nimport { PubSub } from 'graphql-subscriptions'\nimport Redis from 'ioredis'\nimport { connect } from 'mqtt'\n\nimport { config, logger } from '@things-factory/env'\n\nconst { middleware, host, port, nodes, topic, options } = config.get('pubsub', {})\n\nlet pubsub: any\n\nswitch (middleware) {\n case 'mqtt':\n pubsub = new MQTTPubSub({\n client: connect('mqtt://' + host, {\n reconnectPeriod: 1000,\n ...options\n }) as any\n })\n break\n case 'redis':\n const redisOption = {\n host,\n port,\n retryStrategy: times => {\n // reconnect after\n return Math.min(times * 50, 2000)\n },\n ...options\n }\n pubsub = new RedisPubSub({\n publisher: new Redis(redisOption),\n subscriber: new Redis(redisOption)\n })\n break\n case 'redisCluster':\n const cluster = new Redis.Cluster(nodes, options)\n pubsub = new RedisPubSub({\n publisher: cluster,\n subscriber: cluster\n })\n break\n case 'kafka':\n try {\n /*\n * https://github.com/hatiolab/things-factory/issues/1239\n */\n const { KafkaPubSub } = require('graphql-kafka-subscriptions')\n pubsub = new KafkaPubSub({\n topic,\n host,\n port,\n ...options\n })\n } catch (e) {\n logger.error('graphql-kafka-subscriptions module is not installed, so application can not go further.')\n throw e\n }\n break\n default:\n pubsub = new PubSub()\n break\n}\n\n// kafka pubsub keeps connection and app port with 'ctrl+c' termination.\nconst exitHandler = async evt => {\n if (pubsub.close) {\n try {\n await pubsub.close()\n } catch (err) {\n logger.error(err)\n }\n }\n}\n\n/*\n * exit events hint from https://stackoverflow.com/a/14032965/14539284\n */\n\n//do something when app is closing\nprocess.on('exit', exitHandler.bind(null, { name: 'exit', exit: true }))\n\n//catches ctrl+c event\nprocess.on('SIGINT', exitHandler.bind(null, { name: 'SIGINT', exit: true }))\n\n// catches \"kill pid\" (for example: nodemon restart)\nprocess.on('SIGUSR1', exitHandler.bind(null, { name: 'SIGUSR1', exit: true }))\nprocess.on('SIGUSR2', exitHandler.bind(null, { name: 'SIGUSR2', exit: true }))\n\n//catches uncaught exceptions\nprocess.on('uncaughtException', exitHandler.bind(null, { name: 'uncaughtException', exit: true }))\n\nexport { pubsub }\n"]}
|
@@ -1,20 +1,15 @@
|
|
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
3
|
exports.domainPrivateRouter = exports.domainPublicRouter = void 0;
|
7
|
-
const
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const koa_router_1 = tslib_1.__importDefault(require("koa-router"));
|
8
6
|
const domain_middleware_1 = require("../middlewares/domain-middleware");
|
9
|
-
const debug = require('debug')('things-factory:shell:domain-router');
|
10
7
|
exports.domainPublicRouter = new koa_router_1.default();
|
11
8
|
exports.domainPublicRouter.use(async (context, next) => {
|
12
|
-
debug('domain-public-router path, referer, matched', context.path, context.get('Referrer'), context._matchedRoute);
|
13
9
|
await next();
|
14
10
|
}, domain_middleware_1.domainMiddleware);
|
15
11
|
exports.domainPrivateRouter = new koa_router_1.default();
|
16
12
|
exports.domainPrivateRouter.use(async (context, next) => {
|
17
|
-
debug('domain-private-router path, referer, matched', context.path, context.get('Referrer'), context._matchedRoute);
|
18
13
|
await next();
|
19
14
|
}, domain_middleware_1.domainMiddleware);
|
20
15
|
//# sourceMappingURL=domain-router.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domain-router.js","sourceRoot":"","sources":["../../server/routers/domain-router.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"domain-router.js","sourceRoot":"","sources":["../../server/routers/domain-router.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAE/B,wEAAmE;AAEtD,QAAA,kBAAkB,GAAG,IAAI,oBAAM,EAAE,CAAA;AAC9C,0BAAkB,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC7C,MAAM,IAAI,EAAE,CAAA;AACd,CAAC,EAAE,oCAAgB,CAAC,CAAA;AAEP,QAAA,mBAAmB,GAAG,IAAI,oBAAM,EAAE,CAAA;AAC/C,2BAAmB,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC9C,MAAM,IAAI,EAAE,CAAA;AACd,CAAC,EAAE,oCAAgB,CAAC,CAAA","sourcesContent":["import Router from 'koa-router'\n\nimport { domainMiddleware } from '../middlewares/domain-middleware'\n\nexport const domainPublicRouter = new Router()\ndomainPublicRouter.use(async (context, next) => {\n await next()\n}, domainMiddleware)\n\nexport const domainPrivateRouter = new Router()\ndomainPrivateRouter.use(async (context, next) => {\n await next()\n}, domainMiddleware)\n"]}
|
@@ -1,13 +1,10 @@
|
|
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
3
|
exports.globalPrivateRouter = exports.globalPublicRouter = void 0;
|
7
|
-
const
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const koa_router_1 = tslib_1.__importDefault(require("koa-router"));
|
8
6
|
const domain_middleware_1 = require("../middlewares/domain-middleware");
|
9
7
|
var crawler = require('npm-license-crawler');
|
10
|
-
const debug = require('debug')('things-factory:shell:global-router');
|
11
8
|
exports.globalPublicRouter = new koa_router_1.default();
|
12
9
|
exports.globalPrivateRouter = new koa_router_1.default();
|
13
10
|
/* even though global private router, catch domain for information */
|
@@ -27,7 +24,7 @@ exports.globalPublicRouter.get('/licenses', (context, next) => {
|
|
27
24
|
};
|
28
25
|
crawler.dumpLicenses(options, function (error, res) {
|
29
26
|
if (error) {
|
30
|
-
|
27
|
+
console.error('get:/licenses', error);
|
31
28
|
reject(error);
|
32
29
|
}
|
33
30
|
else {
|
@@ -41,7 +38,6 @@ exports.globalPublicRouter.get('/licenses', (context, next) => {
|
|
41
38
|
/* Paths starting with /public are assumed to use the koa-view renderer. */
|
42
39
|
exports.globalPublicRouter.get('/public/(.[^.]*)', async (context, next) => {
|
43
40
|
const { path } = context;
|
44
|
-
debug('get:/public/(.[^.]*)', path);
|
45
41
|
await context.render(path.substr(1));
|
46
42
|
});
|
47
43
|
//# sourceMappingURL=global-router.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"global-router.js","sourceRoot":"","sources":["../../server/routers/global-router.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"global-router.js","sourceRoot":"","sources":["../../server/routers/global-router.ts"],"names":[],"mappings":";;;;AAAA,oEAA+B;AAE/B,wEAAmE;AAEnE,IAAI,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAE/B,QAAA,kBAAkB,GAAG,IAAI,oBAAM,EAAE,CAAA;AACjC,QAAA,mBAAmB,GAAG,IAAI,oBAAM,EAAE,CAAA;AAE/C,qEAAqE;AACrE,2BAAmB,CAAC,GAAG,CAAC,oCAAgB,CAAC,CAAA;AAEzC,0BAAkB,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAC9D,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAE1D,MAAM,OAAO,CAAC,MAAM,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAA;AAChF,CAAC,CAAC,CAAA;AAEF,0BAAkB,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;IACpD,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM;QAC1C,IAAI,OAAO,GAAG;YACZ,KAAK,EAAE,CAAC,GAAG,CAAC;YACZ,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,KAAK;SACf,CAAA;QAED,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,KAAK,EAAE,GAAG;YAChD,IAAI,KAAK,EAAE;gBACT,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;gBACrC,MAAM,CAAC,KAAK,CAAC,CAAA;aACd;iBAAM;gBACL,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAA;gBACjC,OAAO,CAAC,IAAI,GAAG,GAAG,CAAA;gBAClB,OAAO,CAAC,GAAG,CAAC,CAAA;aACb;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,2EAA2E;AAC3E,0BAAkB,CAAC,GAAG,CAAC,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACjE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACxB,MAAM,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACtC,CAAC,CAAC,CAAA","sourcesContent":["import Router from 'koa-router'\n\nimport { domainMiddleware } from '../middlewares/domain-middleware'\n\nvar crawler = require('npm-license-crawler')\n\nexport const globalPublicRouter = new Router()\nexport const globalPrivateRouter = new Router()\n\n/* even though global private router, catch domain for information */\nglobalPrivateRouter.use(domainMiddleware)\n\nglobalPublicRouter.get('/dependencies', async (context, next) => {\n const { dependencyGraph } = require('@things-factory/env')\n\n await context.render('dependencies-view-graphviz', { model: dependencyGraph })\n})\n\nglobalPublicRouter.get('/licenses', (context, next) => {\n return new Promise(function (resolve, reject) {\n var options = {\n start: ['.'],\n exclude: [],\n noColor: true,\n production: true,\n unknown: false\n }\n\n crawler.dumpLicenses(options, function (error, res) {\n if (error) {\n console.error('get:/licenses', error)\n reject(error)\n } else {\n context.type = 'application/json'\n context.body = res\n resolve(res)\n }\n })\n })\n})\n\n/* Paths starting with /public are assumed to use the koa-view renderer. */\nglobalPublicRouter.get('/public/(.[^.]*)', async (context, next) => {\n const { path } = context\n await context.render(path.substr(1))\n})\n"]}
|
@@ -1,19 +1,6 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
|
18
|
-
__exportStar(require("./
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./global-router"), exports);
|
5
|
+
tslib_1.__exportStar(require("./domain-router"), exports);
|
19
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/routers/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/routers/index.ts"],"names":[],"mappings":";;;AAAA,0DAA+B;AAC/B,0DAA+B","sourcesContent":["export * from './global-router'\nexport * from './domain-router'\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../server/schema.ts"],"names":[],"mappings":";;;AACA,sEAA+D;AAC/D,+C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,CAAC,SAAwC,EAAE,EAAE;QACjF,MAAM,GAAG,SAAS,CAAC,MAAM,CAAQ,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC;AApJD,wBAoJC","sourcesContent":["import { GraphQLSchema } from 'graphql'\nimport { GraphQLUpload } from 'graphql-upload/GraphQLUpload.js'\nimport { buildSchema } from 'type-graphql'\n\nimport { mergeSchemas } from '@graphql-tools/schema'\nimport { loader, orderedModuleNames } from '@things-factory/env'\nimport { deepMerge } from '@things-factory/utils'\n\nexport async function schema() {\n const schemas = orderedModuleNames\n .map(dep => loader(dep).schema)\n .filter(schema => schema)\n .reduce(\n (sum, schema) => {\n const { typeDefs, resolvers, resolverClasses, directives } = sum\n let {\n typeDefs: sTypeDefs = {},\n resolvers: sResolvers = {},\n resolverClasses: sResolverClasses = [],\n directives: sDirectives = {}\n } = schema\n\n return {\n typeDefs: deepMerge(typeDefs, sTypeDefs),\n resolvers: deepMerge(resolvers, sResolvers),\n resolverClasses: [...resolverClasses, ...(sResolverClasses || [])],\n directives: deepMerge(directives, sDirectives)\n }\n },\n {\n typeDefs: {},\n resolvers: {},\n resolverClasses: [],\n directives: {}\n }\n )\n\n /* for typeDefs */\n var typeDefs = schemas.typeDefs\n var { queries = [], mutations = [], subscriptions = [], directives = [], types = [] } = typeDefs\n\n queries = [...queries, ...(typeDefs.Query || [])]\n mutations = [...mutations, ...(typeDefs.Mutation || [])]\n subscriptions = [...subscriptions, ...(typeDefs.Subscription || [])]\n directives = [...directives, ...(typeDefs.Directive || [])]\n\n delete typeDefs.Query\n delete typeDefs.Mutation\n delete typeDefs.Subscription\n delete typeDefs.Directive\n\n delete typeDefs.queries\n delete typeDefs.mutations\n delete typeDefs.subscriptions\n delete typeDefs.directives\n delete typeDefs.types\n\n const defs = {\n query: queries.length > 0 ? ['type Query {', ...queries, '}'].join('\\n') : 'type Query { _ : Boolean }',\n mutation:\n mutations.length > 0 ? ['type Mutation {', ...mutations, '}'].join('\\n') : 'type Mutation { _ : Boolean }',\n subscription:\n subscriptions.length > 0\n ? ['type Subscription {', ...subscriptions, '}'].join('\\n')\n : 'type Subscription { _ : Boolean }'\n }\n\n typeDefs = [\n `\n scalar Upload\n `,\n defs.query,\n defs.mutation,\n defs.subscription,\n ...directives,\n ...types,\n ...Object.values(typeDefs)\n ].filter(type => !!type)\n\n /* for resolvers */\n var { resolvers } = schemas\n var { queries = [], mutations = [], subscriptions = [], directives = [] } = resolvers\n\n var queryResolvers =\n queries.length > 0 &&\n queries.reduce((sum, query) => {\n return {\n ...sum,\n ...query\n }\n }, {})\n\n var mutationResolvers =\n mutations.length > 0 &&\n mutations.reduce((sum, mutation) => {\n return {\n ...sum,\n ...mutation\n }\n }, {})\n\n var subscriptionResolvers =\n subscriptions.length > 0 &&\n subscriptions.reduce((sum, subscription) => {\n return {\n ...sum,\n ...subscription\n }\n }, {})\n\n var directiveResolvers = directives.reduce((sum, directive) => {\n return {\n ...sum,\n ...directive\n }\n }, {})\n\n delete resolvers.queries\n delete resolvers.mutations\n delete resolvers.subscriptions\n delete resolvers.directives\n\n var Query = resolvers.Query || {}\n var Mutation = resolvers.Mutation || {}\n var Subscription = resolvers.Subscription || {}\n var Directive = resolvers.Directive || {}\n\n delete resolvers.Query\n delete resolvers.Mutation\n delete resolvers.Subscription\n delete resolvers.Directive\n\n resolvers = {\n Upload: GraphQLUpload as any,\n Query: deepMerge(Query, queryResolvers),\n Mutation: deepMerge(Mutation, mutationResolvers),\n Subscription: deepMerge(Subscription, subscriptionResolvers),\n ...resolvers\n }\n\n var merged = mergeSchemas({\n schemas: [\n await buildSchema({\n resolvers: schemas.resolverClasses,\n dateScalarMode: 'timestamp'\n })\n ],\n typeDefs,\n resolvers\n })\n\n Object.values(schemas.directives).map((directive: (schema: GraphQLSchema) => {}) => {\n merged = directive(merged) as any\n })\n\n return merged\n}\n"]}
|
@@ -1,28 +1,26 @@
|
|
1
1
|
"use strict";
|
2
2
|
// ts-import-sorter: disable
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
5
|
-
};
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
const tslib_1 = require("tslib");
|
7
5
|
/* following 2 lines should be located in top of the file */
|
8
6
|
process.env.NODE_ENV = 'development';
|
9
7
|
process.setMaxListeners(0);
|
10
8
|
const apollo_server_core_1 = require("apollo-server-core");
|
11
9
|
const apollo_server_koa_1 = require("apollo-server-koa");
|
12
|
-
const bytes_1 = __importDefault(require("bytes"));
|
13
|
-
const graphqlUploadKoa_js_1 = __importDefault(require("graphql-upload/graphqlUploadKoa.js"));
|
10
|
+
const bytes_1 = tslib_1.__importDefault(require("bytes"));
|
11
|
+
const graphqlUploadKoa_js_1 = tslib_1.__importDefault(require("graphql-upload/graphqlUploadKoa.js"));
|
14
12
|
const ws_1 = require("graphql-ws/lib/use/ws");
|
15
13
|
const http_1 = require("http");
|
16
|
-
const koa_1 = __importDefault(require("koa"));
|
17
|
-
const koa_bodyparser_1 = __importDefault(require("koa-bodyparser"));
|
18
|
-
const koa_ip_1 = __importDefault(require("koa-ip"));
|
19
|
-
const koa_static_1 = __importDefault(require("koa-static"));
|
20
|
-
const koa_compose_1 = __importDefault(require("koa-compose"));
|
14
|
+
const koa_1 = tslib_1.__importDefault(require("koa"));
|
15
|
+
const koa_bodyparser_1 = tslib_1.__importDefault(require("koa-bodyparser"));
|
16
|
+
const koa_ip_1 = tslib_1.__importDefault(require("koa-ip"));
|
17
|
+
const koa_static_1 = tslib_1.__importDefault(require("koa-static"));
|
18
|
+
const koa_compose_1 = tslib_1.__importDefault(require("koa-compose"));
|
21
19
|
const koa2_connect_history_api_fallback_1 = require("koa2-connect-history-api-fallback");
|
22
20
|
const ws_2 = require("ws");
|
23
|
-
const co_1 = __importDefault(require("co"));
|
24
|
-
const koa_webpack_1 = __importDefault(require("@hatiolab/koa-webpack"));
|
25
|
-
const cors_1 = __importDefault(require("@koa/cors"));
|
21
|
+
const co_1 = tslib_1.__importDefault(require("co"));
|
22
|
+
const koa_webpack_1 = tslib_1.__importDefault(require("@hatiolab/koa-webpack"));
|
23
|
+
const cors_1 = tslib_1.__importDefault(require("@koa/cors"));
|
26
24
|
const env_1 = require("@things-factory/env");
|
27
25
|
const graphql_local_client_1 = require("./graphql-local-client");
|
28
26
|
const database_1 = require("./initializers/database");
|
@@ -32,7 +30,6 @@ process.on('uncaughtException', error => {
|
|
32
30
|
env_1.logger.error(error);
|
33
31
|
process.exit(1);
|
34
32
|
});
|
35
|
-
const debug = require('debug')('things-factory:shell:server-dev');
|
36
33
|
const args = require('args');
|
37
34
|
args.option('port', 'The port on which the app will be running', env_1.config.get('port', 3000));
|
38
35
|
args.option('inspect', `The address on which the inspection will be running. Used in development mode only.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"server-dev.js","sourceRoot":"","sources":["../server/server-dev.ts"],"names":[],"mappings":";AAAA,4BAA4B;;;;;AAE5B,4DAA4D;AAC5D,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAA;AACpC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;AAE1B,2DAAsH;AACtH,yDAAgD;AAChD,kDAA+B;AAC/B,6FAAiE;AACjE,8CAAiD;AACjD,+BAAmC;AACnC,8CAAqB;AACrB,oEAA0C;AAC1C,oDAAuB;AACvB,4DAAkC;AAClC,8DAAiC;AACjC,yFAAsE;AACtE,2BAAoC;AACpC,4CAAmB;AAEnB,wEAA8C;AAC9C,qDAA4B;AAC5B,6CAAgF;AAEhF,iEAA2D;AAC3D,sDAA6D;AAC7D,uCAA4G;AAC5G,qCAAiC;AAEjC,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE;IACtC,YAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAEnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC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MAAM,EAAE,CAAC;SAChC,GAAG,CAAC,4BAAkB,CAAC,cAAc,EAAE,CAAC;SACxC,GAAG,CAAC,6BAAmB,CAAC,MAAM,EAAE,CAAC;SACjC,GAAG,CAAC,6BAAmB,CAAC,cAAc,EAAE,CAAC,CAAA;IAE5C,oFAAoF;IACpF,GAAG,CAAC,GAAG,CAAC,IAAA,sDAAkB,EAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IAE9C,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAEnB,GAAG,CAAC,GAAG,CACL,IAAA,oBAAS,EAAC,QAAQ,CAAC,UAAU,EAAE;QAC7B,KAAK,EAAE,KAAK;KACb,CAAC,CACH,CAAA;IAED,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE;QACrC,YAAM,CAAC,IAAI,CAAC,qCAAqC,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;QAC7E,YAAM,CAAC,IAAI,CAAC,0CAA0C,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;QAElF,OAAO,CAAC,IAAI,CAAC,wBAA+B,EAAE,EAAE,GAAG,EAAE,MAAM,EAAN,YAAM,EAAE,WAAW,EAAE,UAAU,EAAS,CAAC,CAAA;IAChG,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,SAAS,EAAE,CAAA","sourcesContent":["// ts-import-sorter: disable\n\n/* following 2 lines should be located in top of the file */\nprocess.env.NODE_ENV = 'development'\nprocess.setMaxListeners(0)\n\nimport { ApolloServerPluginDrainHttpServer, ApolloServerPluginLandingPageGraphQLPlayground } from 'apollo-server-core'\nimport { ApolloServer } from 'apollo-server-koa'\nimport bytesFormat from 'bytes'\nimport graphqlUploadKoa from 'graphql-upload/graphqlUploadKoa.js'\nimport { useServer } from 'graphql-ws/lib/use/ws'\nimport { createServer } from 'http'\nimport Koa from 'koa'\nimport koaBodyParser from 'koa-bodyparser'\nimport ip from 'koa-ip'\nimport koaStatic from 'koa-static'\nimport compose from 'koa-compose'\nimport { historyApiFallback } from 'koa2-connect-history-api-fallback'\nimport { WebSocketServer } from 'ws'\nimport co from 'co'\n\nimport koaWebpack from '@hatiolab/koa-webpack'\nimport cors from '@koa/cors'\nimport { config, loader, logger, orderedModuleNames } from '@things-factory/env'\n\nimport { GraphqlLocalClient } from './graphql-local-client'\nimport { databaseInitializer } from './initializers/database'\nimport { domainPrivateRouter, domainPublicRouter, globalPrivateRouter, globalPublicRouter } from './routers'\nimport { schema } from './schema'\n\nprocess.on('uncaughtException', error => {\n logger.error(error)\n\n process.exit(1)\n})\n\nconst args = require('args')\n\nargs.option('port', 'The port on which the app will be running', config.get('port', 3000))\nargs.option(\n 'inspect',\n `The address on which the inspection will be running. Used in development mode only.\n This option is just to prevent termination for reasons of not recognizing the 'inspect' option.`,\n config.get('inspect', ':9229')\n)\n\nconst flags = args.parse(process.argv)\n\nconst path = require('path')\nconst webpack = require('webpack')\nconst webpackConfig = require('@things-factory/builder/webpack.config.dev.js')\n\nconst compiler = webpack(webpackConfig)\n\nconst PORT = (process.env.PORT = flags.port)\n\nconst requestBody = config.get('requestBody') || {}\n\nconst bodyParserOption = {\n formLimit: requestBody.formLimit || '10mb',\n jsonLimit: requestBody.jsonLimit || '10mb',\n textLimit: requestBody.textLimit || '10mb'\n}\n\nconst fileUpload = config.get('fileUpload') || {}\nconst fileUploadOption = {\n maxFileSize: bytesFormat.parse(fileUpload.maxFileSize) || bytesFormat.parse('10mb'),\n maxFiles: fileUpload.maxFiles || 10\n}\n\n/* bootstrap */\nconst bootstrap = async () => {\n await databaseInitializer()\n\n const app = new Koa()\n\n app.use(\n cors({\n origin: function (ctx) {\n return ctx.request.headers.origin || '*'\n },\n exposeHeaders: ['WWW-Authenticate', 'Server-Authorization'],\n maxAge: 5,\n credentials: true,\n /* allowMethods: ['GET', 'POST', 'DELETE'], -- use default */\n allowHeaders: ['Content-Type', 'Authorization', 'Accept']\n })\n )\n\n const whitelist = config.get('whitelist')\n const blacklist = config.get('blacklist')\n\n if (whitelist || blacklist) {\n app.use(\n ip({\n whitelist,\n blacklist,\n handler: async (ctx, next) => {\n ctx.status = 403\n }\n })\n )\n }\n\n var subscriptionMiddleware = []\n process.emit('bootstrap-module-subscription' as any, app, subscriptionMiddleware)\n\n const builtSchema = await schema()\n\n const httpServer = createServer(app.callback())\n const websocketServer = new WebSocketServer({\n server: httpServer,\n path: '/graphql'\n })\n\n // Save the returned server's info so we can shut down this server later\n const serverCleanup = useServer(\n {\n schema: builtSchema,\n context: async (ctx, msg, args) => {\n return ctx['context']\n },\n onConnect: async ctx => {\n var { extra, connectionParams } = ctx\n var { request } = extra\n\n var url = new URL(((connectionParams['headers'] as any) || connectionParams).referer)\n var accessToken = url.searchParams.get('access_token')\n connectionParams['headers']['authorization'] = accessToken\n\n request.headers = {\n ...request.headers,\n ...(connectionParams['headers'] || (connectionParams as any))\n }\n\n var koacontext = await app.createContext(request, {} as any)\n koacontext['state'] = {}\n\n /* in case connect error(like a authentication error) just throw exception */\n var middlewares = [...subscriptionMiddleware]\n const fn = co.wrap(compose(middlewares))\n\n await fn(koacontext)\n\n return (ctx['context'] = koacontext)\n },\n onDisconnect(ctx, code, reason) {\n console.log('Disconnected!')\n },\n onError(ctx, msg, errors) {\n console.error(msg, errors)\n }\n },\n websocketServer\n )\n\n const server = new ApolloServer({\n schema: builtSchema,\n formatError: error => {\n logger.error(error)\n return error\n },\n formatResponse: response => {\n return response\n },\n context: async ({ connection, ctx }) => {\n if (connection) {\n return connection.context\n } else {\n return ctx\n }\n },\n plugins: [\n ApolloServerPluginLandingPageGraphQLPlayground({\n settings: {\n 'request.credentials': 'same-origin'\n }\n }),\n ApolloServerPluginDrainHttpServer({ httpServer }),\n {\n async serverWillStart() {\n return {\n async drainServer() {\n await serverCleanup.dispose()\n }\n }\n }\n }\n ],\n cache: 'bounded'\n })\n\n await server.start()\n\n GraphqlLocalClient.init(builtSchema, app)\n\n orderedModuleNames.forEach(name => {\n const { initMiddlewares } = loader(name)\n initMiddlewares && initMiddlewares(app)\n })\n\n const render = require('@things-factory/ejs-remote')\n render(app, {\n root: '/views',\n host: `http://127.0.0.1:${PORT}`,\n layout: false,\n viewExt: 'html',\n cache: false,\n debug: false\n })\n\n const middleware = await koaWebpack({\n compiler,\n hotClient: {},\n devMiddleware: {\n publicPath: webpackConfig.output.publicPath,\n stats: { colors: true }\n }\n })\n\n // only for development mode. triggered after webpack compilation is done.\n compiler.hooks.done.tap({ name: 'server-dev' }, stats => {\n process.emit('client-rebuilt' as any, app, compiler.outputFileSystem)\n })\n\n app.use(koaBodyParser(bodyParserOption))\n app.use(graphqlUploadKoa(fileUploadOption))\n\n app.use(\n server.getMiddleware({\n path: '/graphql'\n })\n )\n\n /* routers */\n process.emit('bootstrap-module-global-public-route' as any, app, globalPublicRouter)\n process.emit('bootstrap-module-global-private-route' as any, app, globalPrivateRouter)\n process.emit('bootstrap-module-domain-public-route' as any, app, domainPublicRouter)\n process.emit('bootstrap-module-domain-private-route' as any, app, domainPrivateRouter)\n\n app\n .use(globalPublicRouter.routes())\n .use(globalPublicRouter.allowedMethods())\n .use(globalPrivateRouter.routes())\n .use(globalPrivateRouter.allowedMethods())\n .use(domainPublicRouter.routes())\n .use(domainPublicRouter.allowedMethods())\n .use(domainPrivateRouter.routes())\n .use(domainPrivateRouter.allowedMethods())\n\n /* should follow this order : history-fallback => webpack-middleware => koaStatic */\n app.use(historyApiFallback({ whiteList: [] }))\n\n app.use(middleware)\n\n app.use(\n koaStatic(compiler.outputPath, {\n index: false\n })\n )\n\n httpServer.listen({ port: PORT }, () => {\n logger.info(`🚀 Server ready at http://0.0.0.0:${PORT}${server.graphqlPath}`)\n logger.info(`🚀 Subscriptions ready at ws://0.0.0.0:${PORT}${server.graphqlPath}`)\n\n process.emit('bootstrap-module-start' as any, { app, config, builtSchema, httpServer } as any)\n })\n}\n\nbootstrap()\n"]}
|
package/dist-server/server.js
CHANGED
@@ -1,27 +1,25 @@
|
|
1
1
|
"use strict";
|
2
2
|
// ts-import-sorter: disable
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
5
|
-
};
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
const tslib_1 = require("tslib");
|
7
5
|
/* following 2 lines should be located in top of the file */
|
8
6
|
process.env.NODE_ENV = 'production';
|
9
7
|
process.setMaxListeners(0);
|
10
8
|
const apollo_server_core_1 = require("apollo-server-core");
|
11
9
|
const apollo_server_koa_1 = require("apollo-server-koa");
|
12
|
-
const bytes_1 = __importDefault(require("bytes"));
|
13
|
-
const graphqlUploadKoa_js_1 = __importDefault(require("graphql-upload/graphqlUploadKoa.js"));
|
10
|
+
const bytes_1 = tslib_1.__importDefault(require("bytes"));
|
11
|
+
const graphqlUploadKoa_js_1 = tslib_1.__importDefault(require("graphql-upload/graphqlUploadKoa.js"));
|
14
12
|
const ws_1 = require("graphql-ws/lib/use/ws");
|
15
13
|
const http_1 = require("http");
|
16
|
-
const koa_1 = __importDefault(require("koa"));
|
17
|
-
const koa_bodyparser_1 = __importDefault(require("koa-bodyparser"));
|
18
|
-
const koa_ip_1 = __importDefault(require("koa-ip"));
|
19
|
-
const koa_static_1 = __importDefault(require("koa-static"));
|
20
|
-
const koa_compose_1 = __importDefault(require("koa-compose"));
|
14
|
+
const koa_1 = tslib_1.__importDefault(require("koa"));
|
15
|
+
const koa_bodyparser_1 = tslib_1.__importDefault(require("koa-bodyparser"));
|
16
|
+
const koa_ip_1 = tslib_1.__importDefault(require("koa-ip"));
|
17
|
+
const koa_static_1 = tslib_1.__importDefault(require("koa-static"));
|
18
|
+
const koa_compose_1 = tslib_1.__importDefault(require("koa-compose"));
|
21
19
|
const koa2_connect_history_api_fallback_1 = require("koa2-connect-history-api-fallback");
|
22
20
|
const ws_2 = require("ws");
|
23
|
-
const co_1 = __importDefault(require("co"));
|
24
|
-
const cors_1 = __importDefault(require("@koa/cors"));
|
21
|
+
const co_1 = tslib_1.__importDefault(require("co"));
|
22
|
+
const cors_1 = tslib_1.__importDefault(require("@koa/cors"));
|
25
23
|
const env_1 = require("@things-factory/env");
|
26
24
|
const graphql_local_client_1 = require("./graphql-local-client");
|
27
25
|
const database_1 = require("./initializers/database");
|