@common-stack/client-core
Advanced tools
Comparing version 0.0.14 to 0.0.140
@@ -1,11 +0,13 @@ | ||
import { IFeature, FeatureParams, ClientStateParams } from '../interfaces'; | ||
import { IFeature, FeatureParams } from '../interfaces'; | ||
export declare const featureCatalog: {}; | ||
export declare abstract class AbstractFeature implements IFeature { | ||
link: any[]; | ||
createFetch: any[]; | ||
connectionParam: any[]; | ||
reducer: any[]; | ||
resolver: ClientStateParams[]; | ||
link: any; | ||
createFetch: any; | ||
connectionParam: any; | ||
reducer: any; | ||
resolver: any; | ||
routerFactory: any; | ||
route: any; | ||
routeConfig: any; | ||
menuConfig: any; | ||
navItem: any; | ||
@@ -19,5 +21,15 @@ navItemRight: any; | ||
catalogInfo: any[]; | ||
languagesFuncs: any[]; | ||
data: any[]; | ||
leftMainPanelItems: any; | ||
middleMainPanelItems: any; | ||
leftFooterItems: any; | ||
rightFooterItems: any; | ||
middleLowerPanelItems: any; | ||
constructor(feature?: FeatureParams, ...features: any[]); | ||
readonly router: any; | ||
readonly abstract routes: any; | ||
getRouter(withRoot?: boolean, rootComponent?: any): any; | ||
abstract getRoutes(withRoot?: boolean, rootComponent?: any): any; | ||
abstract getConfiguredRoutes(routeSearch?: string): any; | ||
abstract getMenus(withRoot?: boolean, rootComponent?: any): any; | ||
abstract getConfiguredMenus(routeSearch?: string): any; | ||
readonly abstract navItems: any; | ||
@@ -27,7 +39,13 @@ readonly abstract navItemsRight: any; | ||
readonly resolvers: any; | ||
readonly connectionParams: any[]; | ||
readonly connectionParams: any; | ||
readonly stylesInserts: any[]; | ||
readonly scriptsInserts: any[]; | ||
readonly leftMainPanel: any; | ||
readonly middleMainPanel: any; | ||
readonly leftFooter: any; | ||
readonly rightFooter: any; | ||
readonly middleLowerPanel: any; | ||
abstract getWrappedRoot(root: any, req: any): any; | ||
abstract getDataRoot(root: any): any; | ||
abstract registerLanguages(monaco: any): any; | ||
} |
225
lib/index.js
@@ -40,10 +40,30 @@ module.exports = | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // define __esModule on exports | ||
/******/ __webpack_require__.r = function(exports) { | ||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/******/ } | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ | ||
/******/ // create a fake namespace object | ||
/******/ // mode & 1: value is a module id, require it | ||
/******/ // mode & 2: merge all properties of value into the ns | ||
/******/ // mode & 4: return value when already ns object | ||
/******/ // mode & 8|1: behave like require | ||
/******/ __webpack_require__.t = function(value, mode) { | ||
/******/ if(mode & 1) value = __webpack_require__(value); | ||
/******/ if(mode & 8) return value; | ||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; | ||
/******/ var ns = Object.create(null); | ||
/******/ __webpack_require__.r(ns); | ||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); | ||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); | ||
/******/ return ns; | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
@@ -64,22 +84,14 @@ /******/ __webpack_require__.n = function(module) { | ||
/******/ | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 0); | ||
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts"); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/******/ ({ | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(__webpack_require__(1)); | ||
__export(__webpack_require__(4)); | ||
/***/ }), | ||
/* 1 */ | ||
/***/ "./src/connector/abstract-connector.ts": | ||
/*!*********************************************!*\ | ||
!*** ./src/connector/abstract-connector.ts ***! | ||
\*********************************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -89,48 +101,4 @@ | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(__webpack_require__(2)); | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const client_1 = __webpack_require__(3); | ||
const logger = client_1.ClientLogger.create('FullStack', { level: 'trace' }); | ||
exports.logger = logger; | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("@cdm-logger/client"); | ||
/***/ }), | ||
/* 4 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(__webpack_require__(5)); | ||
/***/ }), | ||
/* 5 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_1 = __webpack_require__(6); | ||
const lodash_1 = __webpack_require__(/*! lodash */ "lodash"); | ||
const combine = (features, extractor) => lodash_1.without(lodash_1.union(...lodash_1.map(features, res => lodash_1.castArray(extractor(res)))), undefined); | ||
@@ -147,2 +115,7 @@ exports.featureCatalog = {}; | ||
this.resolver = combine(arguments, arg => arg.resolver); | ||
this.leftMainPanelItems = combine(arguments, arg => arg.leftMainPanelItems); | ||
this.middleMainPanelItems = combine(arguments, arg => arg.middleMainPanelItems); | ||
this.leftFooterItems = combine(arguments, arg => arg.leftFooterItems); | ||
this.rightFooterItems = combine(arguments, arg => arg.rightFooterItems); | ||
this.middleLowerPanelItems = combine(arguments, arg => arg.middleLowerPanelItems); | ||
this.routerFactory = combine(arguments, arg => arg.routerFactory) | ||
@@ -152,2 +125,4 @@ .slice(-1) | ||
this.route = combine(arguments, arg => arg.route); | ||
this.routeConfig = combine(arguments, arg => arg.routeConfig); | ||
this.menuConfig = combine(arguments, arg => arg.menuConfig); | ||
this.navItem = combine(arguments, arg => arg.navItem); | ||
@@ -157,8 +132,10 @@ this.navItemRight = combine(arguments, arg => arg.navItemRight); | ||
this.dataRootComponent = combine(arguments, arg => arg.dataRootComponent); | ||
this.languagesFuncs = combine(arguments, arg => arg.languagesFuncs); | ||
this.stylesInsert = combine(arguments, arg => arg.stylesInsert); | ||
this.scriptsInsert = combine(arguments, arg => arg.scriptsInsert); | ||
combine(arguments, arg => arg.catalogInfo).forEach(info => Object.keys(info).forEach(key => (exports.featureCatalog[key] = info[key]))); | ||
this.data = combine([{}].concat(Array.from(arguments)), arg => arg.data) | ||
.reduce((acc, el) => [Object.assign({}, acc[0], el)], [{}]); | ||
} | ||
get router() { | ||
return this.routerFactory(this.routes); | ||
getRouter(withRoot, rootComponent) { | ||
return this.routerFactory(this.getRoutes(withRoot, rootComponent)); | ||
} | ||
@@ -180,2 +157,17 @@ get reducers() { | ||
} | ||
get leftMainPanel() { | ||
return lodash_1.merge(...this.leftMainPanelItems); | ||
} | ||
get middleMainPanel() { | ||
return lodash_1.merge(...this.middleMainPanelItems); | ||
} | ||
get leftFooter() { | ||
return lodash_1.merge(...this.leftFooterItems); | ||
} | ||
get rightFooter() { | ||
return lodash_1.merge(...this.rightFooterItems); | ||
} | ||
get middleLowerPanel() { | ||
return lodash_1.merge(...this.middleLowerPanelItems); | ||
} | ||
} | ||
@@ -186,9 +178,100 @@ exports.AbstractFeature = AbstractFeature; | ||
/***/ }), | ||
/* 6 */ | ||
/***/ "./src/connector/index.ts": | ||
/*!********************************!*\ | ||
!*** ./src/connector/index.ts ***! | ||
\********************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(__webpack_require__(/*! ./abstract-connector */ "./src/connector/abstract-connector.ts")); | ||
/***/ }), | ||
/***/ "./src/index.ts": | ||
/*!**********************!*\ | ||
!*** ./src/index.ts ***! | ||
\**********************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(__webpack_require__(/*! ./logger */ "./src/logger/index.ts")); | ||
__export(__webpack_require__(/*! ./connector */ "./src/connector/index.ts")); | ||
/***/ }), | ||
/***/ "./src/logger/index.ts": | ||
/*!*****************************!*\ | ||
!*** ./src/logger/index.ts ***! | ||
\*****************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(__webpack_require__(/*! ./logger */ "./src/logger/logger.ts")); | ||
/***/ }), | ||
/***/ "./src/logger/logger.ts": | ||
/*!******************************!*\ | ||
!*** ./src/logger/logger.ts ***! | ||
\******************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const client_1 = __webpack_require__(/*! @cdm-logger/client */ "@cdm-logger/client"); | ||
const appName = (process.env && process.env.APP_NAME) || 'FullStack'; | ||
const logLevel = (process.env && process.env.LOG_LEVEL) || 'info'; | ||
const logger = client_1.ClientLogger.create(appName, { level: logLevel }); | ||
exports.logger = logger; | ||
/***/ }), | ||
/***/ "@cdm-logger/client": | ||
/*!*************************************!*\ | ||
!*** external "@cdm-logger/client" ***! | ||
\*************************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("@cdm-logger/client"); | ||
/***/ }), | ||
/***/ "lodash": | ||
/*!*************************!*\ | ||
!*** external "lodash" ***! | ||
\*************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports) { | ||
module.exports = require("lodash"); | ||
/***/ }) | ||
/******/ ]); | ||
/******/ }); | ||
//# sourceMappingURL=index.js.map |
@@ -7,30 +7,67 @@ export interface ClientStateParams { | ||
export interface FeatureParams { | ||
link?: any[]; | ||
createFetch?: any[]; | ||
connectionParam?: any[]; | ||
reducer?: any[]; | ||
resolver?: ClientStateParams[]; | ||
routerFactory?: any; | ||
route?: any; | ||
navItem?: any; | ||
navItemRight?: any; | ||
rootComponentFactory?: any[]; | ||
dataRootComponent?: any[]; | ||
createFetchOptions?: any[]; | ||
stylesInsert?: any[]; | ||
scriptsInsert?: any[]; | ||
catalogInfo?: any; | ||
readonly link?: any; | ||
readonly createFetch?: any; | ||
readonly connectionParam?: any; | ||
readonly reducer?: any; | ||
readonly resolver?: any; | ||
readonly routerFactory?: any; | ||
readonly route?: any; | ||
readonly routeConfig?: any; | ||
readonly menuConfig?: any; | ||
readonly navItem?: any; | ||
readonly navItemRight?: any; | ||
readonly rootComponentFactory?: any; | ||
readonly dataRootComponent?: any; | ||
readonly createFetchOptions?: any; | ||
readonly stylesInsert?: any; | ||
readonly scriptsInsert?: any; | ||
readonly catalogInfo?: any; | ||
readonly languagesFuncs?: any; | ||
readonly panels?: any; | ||
} | ||
export interface IFeature { | ||
router: any; | ||
routes: any; | ||
navItems: any; | ||
navItemsRight: any; | ||
reducers: any; | ||
resolvers: any; | ||
connectionParams: any; | ||
stylesInserts: any; | ||
scriptsInserts: any; | ||
readonly link: any; | ||
readonly createFetch: any; | ||
readonly connectionParam: any; | ||
readonly reducer: any; | ||
readonly resolver: any; | ||
readonly routerFactory: any; | ||
readonly route: any; | ||
readonly routeConfig: any; | ||
readonly menuConfig?: any; | ||
readonly navItem: any; | ||
readonly navItemRight: any; | ||
readonly rootComponentFactory: any[]; | ||
readonly dataRootComponent: any[]; | ||
readonly createFetchOptions: any[]; | ||
readonly stylesInsert: any[]; | ||
readonly scriptsInsert: any[]; | ||
readonly catalogInfo: any[]; | ||
readonly languagesFuncs: any[]; | ||
readonly data: any[]; | ||
readonly leftMainPanelItems: any; | ||
readonly middleMainPanelItems: any; | ||
readonly leftFooterItems: any; | ||
readonly rightFooterItems: any; | ||
readonly middleLowerPanelItems: any; | ||
readonly getRouter: any; | ||
readonly getRoutes: any; | ||
readonly getConfiguredRoutes: any; | ||
readonly getMenus: any; | ||
readonly getConfiguredMenus: any; | ||
readonly navItems: any; | ||
readonly navItemsRight: any; | ||
readonly reducers: any; | ||
readonly resolvers: any; | ||
readonly connectionParams: any; | ||
readonly stylesInserts: any; | ||
readonly scriptsInserts: any; | ||
readonly leftMainPanel: any; | ||
readonly middleMainPanel: any; | ||
readonly leftFooter: any; | ||
readonly rightFooter: any; | ||
readonly middleLowerPanel: any; | ||
getWrappedRoot(root: any, req?: any): any; | ||
getDataRoot(root: any): any; | ||
registerLanguages(monaco: any): void; | ||
} |
@@ -1,2 +0,3 @@ | ||
declare const logger: any; | ||
import * as Logger from 'browser-bunyan'; | ||
declare const logger: Logger; | ||
export { logger }; |
{ | ||
"name": "@common-stack/client-core", | ||
"version": "0.0.14", | ||
"version": "0.0.140", | ||
"description": "Sample core for higher packages to depend on", | ||
@@ -51,9 +51,12 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"jest": "^22.1.0", | ||
"jest": "^22.4.2", | ||
"rimraf": "^2.6.1", | ||
"webpack": "^3.10.0" | ||
"webpack": "^4.7.0" | ||
}, | ||
"dependencies": { | ||
"@common-stack/core": "^0.0.14" | ||
"@common-stack/core": "^0.0.140" | ||
}, | ||
"peerDependencies": { | ||
"lodash": "*" | ||
}, | ||
"typings": "lib/index.d.ts", | ||
@@ -60,0 +63,0 @@ "typescript": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30661
366
2
4
1
+ Added@common-stack/core@0.0.140(transitive)
+ Addedlodash@4.17.21(transitive)
- Removed@common-stack/core@0.0.14(transitive)
Updated@common-stack/core@^0.0.140