UNPKG

opennms

Version:

Client API for the OpenNMS network monitoring platform

1 lines 12.7 kB
{"remainingRequest":"/data/node_modules/babel-loader/lib/index.js!/data/node_modules/ts-loader/index.js!/data/src/api/Restriction.ts","dependencies":[{"path":"/data/src/api/Restriction.ts","mtime":1553611371624},{"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/src/api/Comparator.ts","mtime":1553611371624},{"path":"/data/src/api/Log.ts","mtime":1553611371624},{"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 });\nvar Comparator_1 = require(\"./Comparator\");\nvar Log_1 = require(\"./Log\");\nvar namePattern = /^(.*?)\\s+(eq|ne|ilike|like|gt|lt|ge|le|null|isnull|notnull)\\s+(.*?)$/i;\nvar symbolPattern = /^(\\w+?)\\s*(\\=\\=|\\=|\\!\\=|\\>\\=|\\<\\=|\\>|\\<)\\s*(\\w+?)$/;\n/**\n * A query restriction.\n * @module Restriction\n */\n\nvar Restriction = function () {\n _createClass(Restriction, null, [{\n key: \"fromString\",\n\n /**\n * Convert a filter string into a restriction.\n */\n value: function fromString(filter) {\n var match = filter.match(namePattern);\n if (!match) {\n match = filter.match(symbolPattern);\n }\n if (match) {\n var comp = Comparator_1.Comparator.find(match[2]);\n if (comp) {\n return new Restriction(match[1], comp, match[3]);\n }\n Log_1.log.warn('Restriction.fromString matched \"' + filter + '\", but was unable to match \"' + match[2] + '\" to a comparator.', Log_1.catAPI);\n } else {\n Log_1.log.debug('Restriction.fromString failed to match \"' + filter + '\".', Log_1.catAPI);\n }\n return null;\n }\n }]);\n\n function Restriction(attribute, comparator, value) {\n _classCallCheck(this, Restriction);\n\n this.attribute = attribute;\n this.comparator = comparator;\n this.value = value;\n }\n /** A human-readable string for this restriction. */\n\n\n _createClass(Restriction, [{\n key: \"toString\",\n value: function toString() {\n return this.attribute + ' ' + this.comparator.label + (this.value === undefined ? '' : ' ' + this.value);\n }\n }]);\n\n return Restriction;\n}();\n\nexports.Restriction = Restriction;",{"version":3,"file":"/data/src/api/Restriction.ts","sourceRoot":"","sources":["/data/src/api/Restriction.ts"],"names":[],"mappings":";;;;;;;AAAA,2BAAqD;AACrD,oBAAkC;AAElC,IAAM,AAAW,cAAG,AAAuE,AAAC;AAC5F,IAAM,AAAa,gBAAG,AAAoD,AAAC;AAE3E,AAGG,AACH;;;;;;;;;AACE,AAEG,AACI,AAAM,AAAC,AAAU;;;mCAAC,AAAc;AACrC,gBAAI,AAAK,QAAG,AAAM,OAAC,AAAK,MAAC,AAAW,AAAC,AAAC;AACtC,AAAE,AAAC,gBAAC,CAAC,AAAK,AAAC,OAAC,AAAC;AACX,AAAK,wBAAG,AAAM,OAAC,AAAK,MAAC,AAAa,AAAC,AAAC,AACtC;AAAC;AACD,AAAE,AAAC,gBAAC,AAAK,AAAC,OAAC,AAAC;AACV,oBAAM,AAAI,OAAG,aAAU,WAAC,AAAI,KAAC,AAAK,MAAC,AAAC,AAAC,AAAC,AAAC;AACvC,AAAE,AAAC,oBAAC,AAAI,AAAC,MAAC,AAAC;AACT,AAAM,2BAAC,IAAI,AAAW,YAAC,AAAK,MAAC,AAAC,AAAC,IAAE,AAAI,MAAE,AAAK,MAAC,AAAC,AAAC,AAAC,AAAC,AACnD;AAAC;AACD,sBAAG,IAAC,AAAI,KAAC,AAAkC,qCAAG,AAAM,SAClD,AAA8B,iCAAG,AAAK,MAAC,AAAC,AAAC,KAAG,AAAoB,sBAAE,MAAM,AAAC,AAAC,AAC9E;AAAC,AAAC,AAAI,mBAAC,AAAC;AACN,sBAAG,IAAC,AAAK,MAAC,AAA0C,6CAAG,AAAM,SAAG,AAAI,MAAE,MAAM,AAAC,AAAC,AAChF;AAAC;AACD,AAAM,mBAAC,AAAI,AAAC,AACd;AAAC;;;AAWD,yBAAY,AAAiB,WAAE,AAAsB,YAAE,AAAW;;;AAChE,AAAI,aAAC,AAAS,YAAG,AAAS,AAAC;AAC3B,AAAI,aAAC,AAAU,aAAG,AAAU,AAAC;AAC7B,AAAI,aAAC,AAAK,QAAG,AAAK,AAAC,AACrB;AAAC;AAED,AAAoD,AAC7C,AAAQ;;;;;;AACb,AAAM,mBAAC,AAAI,KAAC,AAAS,YAAG,AAAG,MAAG,AAAI,KAAC,AAAU,WAAC,AAAK,AAAG,SAAC,AAAI,KAAC,AAAK,UAAK,AAAS,AAAC,AAAC,YAAC,AAAE,AAAC,AAAC,KAAC,AAAG,MAAG,AAAI,KAAC,AAAK,AAAC,AAAC,AAC3G;AAAC,AACF;;;;;;AAzCD,sBAyCC","sourcesContent":["import {Comparator, Comparators} from './Comparator';\nimport {log, catAPI} from './Log';\n\nconst namePattern = /^(.*?)\\s+(eq|ne|ilike|like|gt|lt|ge|le|null|isnull|notnull)\\s+(.*?)$/i;\nconst symbolPattern = /^(\\w+?)\\s*(\\=\\=|\\=|\\!\\=|\\>\\=|\\<\\=|\\>|\\<)\\s*(\\w+?)$/;\n\n/**\n * A query restriction.\n * @module Restriction\n */\nexport class Restriction {\n /**\n * Convert a filter string into a restriction.\n */\n public static fromString(filter: string) {\n let match = filter.match(namePattern);\n if (!match) {\n match = filter.match(symbolPattern);\n }\n if (match) {\n const comp = Comparator.find(match[2]);\n if (comp) {\n return new Restriction(match[1], comp, match[3]);\n }\n log.warn('Restriction.fromString matched \"' + filter +\n '\", but was unable to match \"' + match[2] + '\" to a comparator.', catAPI);\n } else {\n log.debug('Restriction.fromString failed to match \"' + filter + '\".', catAPI);\n }\n return null;\n }\n\n /** The model attribute (name, id, etc.) to query. */\n public attribute: string;\n\n /** The comparator to use when querying. */\n public comparator: Comparator;\n\n /** The value to compare the attribute property to. */\n public value?: any;\n\n constructor(attribute: string, comparator: Comparator, value?: any) {\n this.attribute = attribute;\n this.comparator = comparator;\n this.value = value;\n }\n\n /** A human-readable string for this restriction. */\n public toString() {\n return this.attribute + ' ' + this.comparator.label + (this.value === undefined ? '' : ' ' + this.value);\n }\n}\n"]}]}