opennms
Version:
Client API for the OpenNMS network monitoring platform
1 lines • 13.7 kB
JSON
{"remainingRequest":"/data/node_modules/babel-loader/lib/index.js!/data/node_modules/ts-loader/index.js!/data/src/internal/OnmsEnum.ts","dependencies":[{"path":"/data/src/internal/OnmsEnum.ts","mtime":1553611371628},{"path":"/data/node_modules/typescript-logging/dist/commonjs/typescript-logging.d.ts","mtime":1553611387808},{"path":"/data/node_modules/typescript-logging/dist/commonjs/control/LogGroupControl.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/control/CategoryServiceControl.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/extension/MessagesToExtensionJSON.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/extension/MessagesFromExtensionJSON.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/extension/ExtensionMessageJSON.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/extension/ExtensionHelper.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/AbstractCategoryLogger.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/LoggerOptions.d.ts","mtime":1553611387932},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/CategoryLogger.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/CategoryService.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/CategoryConsoleLoggerImpl.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/CategoryDelegateLoggerImpl.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/category/CategoryMessageBufferImpl.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/Logger.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/LoggerFactory.d.ts","mtime":1553611388004},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/LoggerFactoryService.d.ts","mtime":1553611388004},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/LoggerFactoryRuntimeSettings.d.ts","mtime":1553611388004},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/AbstractLogger.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/ConsoleLoggerImpl.d.ts","mtime":1553611388000},{"path":"/data/node_modules/typescript-logging/dist/commonjs/log/standard/MessageBufferLoggerImpl.d.ts","mtime":1553611388004},{"path":"/data/node_modules/typescript-logging/dist/commonjs/utils/DataStructures.d.ts","mtime":1553611387936},{"path":"/data/node_modules/typescript-logging/dist/commonjs/utils/JSONHelper.d.ts","mtime":1553611387936},{"path":"/data/node_modules/typescript-logging/dist/commonjs/utils/MessageUtils.d.ts","mtime":1553611387936},{"path":"/data/node_modules/moment/moment.d.ts","mtime":1553611386704},{"path":"/data/node_modules/axios/index.d.ts","mtime":1553611386356},{"path":"/data/typings/index.d.ts","mtime":1553611371628},{"path":"/data/node_modules/@types/fs-extra/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/node/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/node/inspector.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/glob/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/minimatch/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/glob/node_modules/@types/minimatch/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/handlebars/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/highlight.js/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/jest/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/jquery/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/lodash/index.d.ts","mtime":1553611386320},{"path":"/data/node_modules/@types/lodash/common/common.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/array.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/collection.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/date.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/function.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/lang.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/math.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/number.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/object.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/seq.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/string.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/lodash/common/util.d.ts","mtime":1553611386984},{"path":"/data/node_modules/@types/marked/index.d.ts","mtime":1553611386368},{"path":"/data/node_modules/@types/shelljs/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/@types/urijs/index.d.ts","mtime":1553611386380},{"path":"/data/node_modules/typescript/lib/lib.es2015.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.core.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.collection.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.generator.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.promise.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.iterable.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.symbol.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.proxy.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.reflect.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","mtime":1553611387384},{"path":"/data/node_modules/typescript/lib/lib.es5.d.ts","mtime":1553611387388},{"path":"/data/node_modules/typescript/lib/lib.dom.d.ts","mtime":1553611387384},{"path":"/data/.babelrc","mtime":1553611371556},{"path":"/data/node_modules/cache-loader/dist/cjs.js","mtime":1553611387012},{"path":"/data/node_modules/babel-loader/lib/index.js","mtime":1553611386992},{"path":"/data/node_modules/ts-loader/index.js","mtime":1553611386824}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Represents an enumerated type.\n * @module OnmsEnum\n */\n\nvar OnmsEnum = function () {\n /** construct an enum object with an id and label */\n function OnmsEnum(id, label) {\n _classCallCheck(this, OnmsEnum);\n\n this.i = id;\n this.l = label;\n }\n /** get the index/id of this enum entry */\n\n\n _createClass(OnmsEnum, [{\n key: \"toDisplayString\",\n\n /** convert this enum to a string suitable for display */\n value: function toDisplayString() {\n return this.l.charAt(0).toUpperCase() + this.l.slice(1).toLowerCase();\n }\n /** convert this enum to a string */\n\n }, {\n key: \"toString\",\n value: function toString() {\n return this.i;\n }\n /** convert to the JSON representation */\n\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return {\n id: this.i,\n label: this.l\n };\n }\n }, {\n key: \"id\",\n get: function get() {\n return this.i;\n }\n /** an alias for [[OnmsEnum.id]] */\n\n }, {\n key: \"index\",\n get: function get() {\n return this.i;\n }\n /** get the label of this enum entry */\n\n }, {\n key: \"label\",\n get: function get() {\n return this.l;\n }\n }]);\n\n return OnmsEnum;\n}();\n\nexports.OnmsEnum = OnmsEnum;\n/** convenience function for implementing id-based lookup in enums */\n/** @hidden */\nfunction forId(collection, id) {\n for (var type in collection) {\n if (collection.hasOwnProperty(type)) {\n var collectionId = collection[type].id;\n if ('' + collectionId === '' + id) {\n return collection[type];\n }\n }\n }\n return undefined;\n}\nexports.forId = forId;\n/** convenience function for implementing label-based lookup in enums */\n/** @hidden */\nfunction forLabel(collection, label) {\n for (var type in collection) {\n if (collection.hasOwnProperty(type)) {\n var collectionLabel = collection[type].label;\n if (collectionLabel && collectionLabel.toLowerCase() === label.toLowerCase()) {\n return collection[type];\n }\n }\n }\n return undefined;\n}\nexports.forLabel = forLabel;",{"version":3,"file":"/data/src/internal/OnmsEnum.ts","sourceRoot":"","sources":["/data/src/internal/OnmsEnum.ts"],"names":[],"mappings":";;;;;;;AACA,AAGG,AACH;;;;;;AAsBE,AAAoD;AACpD,sBAAY,AAAK,IAAE,AAAa;;;AAC9B,AAAI,aAAC,AAAC,IAAG,AAAE,AAAC;AACZ,AAAI,aAAC,AAAC,IAAG,AAAK,AAAC,AACjB;AAAC;AAnBD,AAA0C,AAC1C,AAAI,AAAE;;;;;;AAoBN,AAAyD,AAClD,AAAe;;AACpB,AAAM,mBAAC,AAAI,KAAC,AAAC,EAAC,AAAM,OAAC,AAAC,AAAC,GAAC,AAAW,AAAE,gBAAG,AAAI,KAAC,AAAC,EAAC,AAAK,MAAC,AAAC,AAAC,GAAC,AAAW,AAAE,AAAC,AACxE;AAAC;AAED,AAAoC,AAC7B,AAAQ;;;;;AACb,AAAM,mBAAC,AAAI,KAAC,AAAC,AAAC,AAChB;AAAC;AAED,AAAyC,AAClC,AAAM;;;;;AACX,AAAM;AACJ,AAAE,oBAAE,AAAI,KAAC,AAAC;AACV,AAAK,uBAAE,AAAI,KAAC,AAAC,AACd,AAAC,AACJ;AAJS;AAIR,AACF;;;;AApCG,AAAM,mBAAC,AAAI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C,AAAS,AAAC,AACnB;AAAC;AAVD,mBAUC","sourcesContent":["\n/**\n * Represents an enumerated type.\n * @module OnmsEnum\n */\nexport class OnmsEnum<T> {\n /** the internal index/id */\n private i: T;\n\n /** the type/label */\n private l: string;\n\n /** get the index/id of this enum entry */\n get id() {\n return this.i;\n }\n\n /** an alias for [[OnmsEnum.id]] */\n get index() {\n return this.i;\n }\n\n /** get the label of this enum entry */\n get label() {\n return this.l;\n }\n\n /** construct an enum object with an id and label */\n constructor(id: T, label: string) {\n this.i = id;\n this.l = label;\n }\n\n /** convert this enum to a string suitable for display */\n public toDisplayString() {\n return this.l.charAt(0).toUpperCase() + this.l.slice(1).toLowerCase();\n }\n\n /** convert this enum to a string */\n public toString() {\n return this.i;\n }\n\n /** convert to the JSON representation */\n public toJSON() {\n return {\n id: this.i,\n label: this.l,\n };\n }\n}\n\n/** convenience function for implementing id-based lookup in enums */\n/** @hidden */\nexport function forId(collection: any, id: any) {\n for (const type in collection) {\n if (collection.hasOwnProperty(type)) {\n const collectionId = collection[type].id;\n if (('' + collectionId) === ('' + id)) {\n return collection[type];\n }\n }\n }\n return undefined;\n}\n\n/** convenience function for implementing label-based lookup in enums */\n/** @hidden */\nexport function forLabel(collection: any, label: string) {\n for (const type in collection) {\n if (collection.hasOwnProperty(type)) {\n const collectionLabel = collection[type].label;\n if (collectionLabel && collectionLabel.toLowerCase() === label.toLowerCase()) {\n return collection[type];\n }\n }\n }\n return undefined;\n}\n"]}]}