@agatee/core
Advanced tools
| export interface GatAfterAppInitialized { | ||
| afterAppInitialized: () => void; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); |
| interface ResolverGql { | ||
| Query?: { | ||
| [key: string]: (...args: any[]) => any; | ||
| }; | ||
| Mutation?: { | ||
| [key: string]: (...args: any[]) => any; | ||
| }; | ||
| } | ||
| export declare const importSchema: (path: string) => any; | ||
| export declare const componentGql: (name: TemplateStringsArray) => any; | ||
| export declare const combineSchema: (main: string, ...schemas: string[]) => string; | ||
| export declare const combineResolvers: (resolvers: ResolverGql[]) => any; | ||
| export {}; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.combineResolvers = exports.combineSchema = exports.componentGql = exports.importSchema = void 0; | ||
| const fs_1 = require("fs"); | ||
| const importSchema = (path) => { | ||
| return (0, fs_1.readFileSync)(path).toString(); | ||
| }; | ||
| exports.importSchema = importSchema; | ||
| const componentGql = (name) => { | ||
| const path = `app/components/${name}/${name}.graphql`; | ||
| return (0, exports.importSchema)(path); | ||
| }; | ||
| exports.componentGql = componentGql; | ||
| const combineSchema = (main, ...schemas) => { | ||
| let result = schemas.join('\n'); | ||
| result += `\n${main}`; | ||
| return result; | ||
| }; | ||
| exports.combineSchema = combineSchema; | ||
| const combineResolvers = (resolvers) => { | ||
| const Query = Object.assign({}, ...resolvers.map(e => e.Query)); | ||
| const Mutation = Object.assign({}, ...resolvers.map(e => e.Mutation)); | ||
| let result = {}; | ||
| if (Object.keys(Query).length) { | ||
| result.Query = Query; | ||
| } | ||
| if (Object.keys(Mutation).length) { | ||
| result.Mutation = Mutation; | ||
| } | ||
| return result; | ||
| }; | ||
| exports.combineResolvers = combineResolvers; |
@@ -25,2 +25,5 @@ "use strict"; | ||
| } | ||
| if (typeof newInstance.afterAppInitialized === 'function') { | ||
| newInstance.afterAppInitialized(); | ||
| } | ||
| if (options.routes && newInstance.server) { | ||
@@ -27,0 +30,0 @@ for (let route of options.routes.map(el => new el())) { |
+1
-0
| export * from './decorators/injectable.decorators'; | ||
| export * from './decorators/gat-module.decorators'; | ||
| export * from './decorators/router-module.decorators'; | ||
| export * from './agatee.interfaces'; |
+1
-0
@@ -16,1 +16,2 @@ "use strict"; | ||
| __exportStar(require("./decorators/router-module.decorators"), exports); | ||
| __exportStar(require("./agatee.interfaces"), exports); |
+1
-1
| { | ||
| "name": "@agatee/core", | ||
| "version": "1.0.4", | ||
| "version": "1.0.5", | ||
| "description": "A lightweight Typescript framework for express app", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
13443
17.12%15
36.36%274
25.11%2
100%