@web3api/logger-plugin-js
Advanced tools
Comparing version 0.0.1-prealpha.71 to 0.0.1-prealpha.72
@@ -1,14 +0,1 @@ | ||
import { Query, Logger_LogLevel } from "./w3"; | ||
import { Plugin, PluginPackageManifest, PluginPackage } from "@web3api/core-js"; | ||
export declare type LogFunc = (level: Logger_LogLevel, message: string) => boolean; | ||
export declare class LoggerPlugin extends Plugin { | ||
private _logFunc?; | ||
constructor(logFunc?: LogFunc); | ||
static manifest(): PluginPackageManifest; | ||
getModules(): { | ||
query: Query.Module; | ||
}; | ||
log(level: Logger_LogLevel, message: string): boolean; | ||
} | ||
export declare const loggerPlugin: () => PluginPackage; | ||
export declare const plugin: () => PluginPackage; | ||
export * from "./w3-man"; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
// TIP: All user-defined code lives in the module folders (./query, ./mutation) | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.plugin = exports.loggerPlugin = exports.LoggerPlugin = void 0; | ||
var resolvers_1 = require("./resolvers"); | ||
var w3_1 = require("./w3"); | ||
var core_js_1 = require("@web3api/core-js"); | ||
var LoggerPlugin = /** @class */ (function (_super) { | ||
__extends(LoggerPlugin, _super); | ||
function LoggerPlugin(logFunc) { | ||
var _this = _super.call(this) || this; | ||
_this._logFunc = logFunc; | ||
return _this; | ||
} | ||
LoggerPlugin.manifest = function () { | ||
return w3_1.manifest; | ||
}; | ||
LoggerPlugin.prototype.getModules = function () { | ||
return { | ||
query: resolvers_1.query(this), | ||
}; | ||
}; | ||
LoggerPlugin.prototype.log = function (level, message) { | ||
if (this._logFunc) { | ||
return this._logFunc(level, message); | ||
} | ||
switch (level) { | ||
case "DEBUG": | ||
case w3_1.Logger_LogLevelEnum.DEBUG: | ||
console.debug(message); | ||
break; | ||
case "WARN": | ||
case w3_1.Logger_LogLevelEnum.WARN: | ||
console.warn(message); | ||
break; | ||
case "ERROR": | ||
case w3_1.Logger_LogLevelEnum.ERROR: | ||
console.error(message); | ||
break; | ||
case "INFO": | ||
case w3_1.Logger_LogLevelEnum.INFO: | ||
console.log(message); | ||
break; | ||
default: | ||
console.log(message); | ||
} | ||
return true; | ||
}; | ||
return LoggerPlugin; | ||
}(core_js_1.Plugin)); | ||
exports.LoggerPlugin = LoggerPlugin; | ||
exports.loggerPlugin = function () { | ||
return { | ||
factory: function () { return new LoggerPlugin(); }, | ||
manifest: w3_1.manifest, | ||
}; | ||
}; | ||
exports.plugin = exports.loggerPlugin; | ||
__exportStar(require("./w3-man"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"format": "0.0.1-prealpha.1", | ||
"format": "0.0.1-prealpha.2", | ||
"name": "Logger", | ||
"language": "plugin/typescript", | ||
"schema": "./schema.graphql", | ||
"modules": { | ||
"query": { | ||
"schema": "./src/query/schema.graphql", | ||
"module": "./src/query/index.ts" | ||
} | ||
}, | ||
"import_redirects": [ | ||
@@ -6,0 +12,0 @@ { |
@@ -10,9 +10,10 @@ { | ||
"files": [ | ||
"build", | ||
"schema.graphql" | ||
"build" | ||
], | ||
"version": "0.0.1-prealpha.71", | ||
"version": "0.0.1-prealpha.72", | ||
"main": "build/index.js", | ||
"scripts": { | ||
"build": "rimraf ./build && yarn codegen && tsc --project tsconfig.build.json", | ||
"build": "rimraf ./build ./**/w3 ./*/**/w3 && tsc --project tsconfig.build.json", | ||
"build:migrate": "npx w3 plugin codegen", | ||
"build:bak": "rimraf ./build && yarn codegen && tsc --project tsconfig.build.json", | ||
"codegen": "node ../../../../dependencies/node_modules/@web3api/cli/bin/w3 plugin codegen", | ||
@@ -25,7 +26,7 @@ "lint": "eslint --color -c ../../../../.eslintrc.js src/", | ||
"dependencies": { | ||
"@web3api/core-js": "0.0.1-prealpha.71" | ||
"@web3api/core-js": "0.0.1-prealpha.72" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "26.0.8", | ||
"@web3api/client-js": "0.0.1-prealpha.71", | ||
"@web3api/client-js": "0.0.1-prealpha.72", | ||
"jest": "26.6.3", | ||
@@ -37,3 +38,3 @@ "rimraf": "3.0.2", | ||
}, | ||
"gitHead": "daa694fd5d7e77c907307c38a40ca388ab23b5cc", | ||
"gitHead": "5f7c91449b10e023aaa9f70981291001aae011cf", | ||
"publishConfig": { | ||
@@ -40,0 +41,0 @@ "access": "public" |
Sorry, the diff of this file is not supported yet
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
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
24434
32
330
1
+ Added@web3api/core-js@0.0.1-prealpha.72(transitive)
+ Added@web3api/manifest-schemas@0.0.1-prealpha.72(transitive)
+ Added@web3api/tracing-js@0.0.1-prealpha.72(transitive)
- Removed@web3api/core-js@0.0.1-prealpha.71(transitive)
- Removed@web3api/manifest-schemas@0.0.1-prealpha.71(transitive)
- Removed@web3api/tracing-js@0.0.1-prealpha.71(transitive)