@octokit/plugin-request-log
Advanced tools
Comparing version 1.0.4 to 2.0.1
@@ -1,12 +0,31 @@ | ||
'use strict'; | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
// pkg/dist-src/index.js | ||
var dist_src_exports = {}; | ||
__export(dist_src_exports, { | ||
requestLog: () => requestLog | ||
}); | ||
module.exports = __toCommonJS(dist_src_exports); | ||
const VERSION = "1.0.4"; | ||
// pkg/dist-src/version.js | ||
var VERSION = "2.0.1"; | ||
/** | ||
* @param octokit Octokit instance | ||
* @param options Options passed to Octokit constructor | ||
*/ | ||
// pkg/dist-src/index.js | ||
function requestLog(octokit) { | ||
@@ -18,7 +37,11 @@ octokit.hook.wrap("request", (request, options) => { | ||
const path = requestOptions.url.replace(options.baseUrl, ""); | ||
return request(options).then(response => { | ||
octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`); | ||
return request(options).then((response) => { | ||
octokit.log.info( | ||
`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms` | ||
); | ||
return response; | ||
}).catch(error => { | ||
octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`); | ||
}).catch((error) => { | ||
octokit.log.info( | ||
`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms` | ||
); | ||
throw error; | ||
@@ -29,4 +52,5 @@ }); | ||
requestLog.VERSION = VERSION; | ||
exports.requestLog = requestLog; | ||
//# sourceMappingURL=index.js.map | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
requestLog | ||
}); |
import { VERSION } from "./version"; | ||
/** | ||
* @param octokit Octokit instance | ||
* @param options Options passed to Octokit constructor | ||
*/ | ||
export function requestLog(octokit) { | ||
octokit.hook.wrap("request", (request, options) => { | ||
octokit.log.debug("request", options); | ||
const start = Date.now(); | ||
const requestOptions = octokit.request.endpoint.parse(options); | ||
const path = requestOptions.url.replace(options.baseUrl, ""); | ||
return request(options) | ||
.then((response) => { | ||
octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`); | ||
return response; | ||
}) | ||
.catch((error) => { | ||
octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`); | ||
throw error; | ||
}); | ||
function requestLog(octokit) { | ||
octokit.hook.wrap("request", (request, options) => { | ||
octokit.log.debug("request", options); | ||
const start = Date.now(); | ||
const requestOptions = octokit.request.endpoint.parse(options); | ||
const path = requestOptions.url.replace(options.baseUrl, ""); | ||
return request(options).then((response) => { | ||
octokit.log.info( | ||
`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms` | ||
); | ||
return response; | ||
}).catch((error) => { | ||
octokit.log.info( | ||
`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms` | ||
); | ||
throw error; | ||
}); | ||
}); | ||
} | ||
requestLog.VERSION = VERSION; | ||
export { | ||
requestLog | ||
}; |
@@ -1,1 +0,4 @@ | ||
export const VERSION = "1.0.4"; | ||
const VERSION = "2.0.1"; | ||
export { | ||
VERSION | ||
}; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "1.0.4"; | ||
export declare const VERSION = "2.0.1"; |
@@ -1,27 +0,27 @@ | ||
const VERSION = "1.0.4"; | ||
// pkg/dist-src/version.js | ||
var VERSION = "2.0.1"; | ||
/** | ||
* @param octokit Octokit instance | ||
* @param options Options passed to Octokit constructor | ||
*/ | ||
// pkg/dist-src/index.js | ||
function requestLog(octokit) { | ||
octokit.hook.wrap("request", (request, options) => { | ||
octokit.log.debug("request", options); | ||
const start = Date.now(); | ||
const requestOptions = octokit.request.endpoint.parse(options); | ||
const path = requestOptions.url.replace(options.baseUrl, ""); | ||
return request(options) | ||
.then((response) => { | ||
octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`); | ||
return response; | ||
}) | ||
.catch((error) => { | ||
octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`); | ||
throw error; | ||
}); | ||
octokit.hook.wrap("request", (request, options) => { | ||
octokit.log.debug("request", options); | ||
const start = Date.now(); | ||
const requestOptions = octokit.request.endpoint.parse(options); | ||
const path = requestOptions.url.replace(options.baseUrl, ""); | ||
return request(options).then((response) => { | ||
octokit.log.info( | ||
`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms` | ||
); | ||
return response; | ||
}).catch((error) => { | ||
octokit.log.info( | ||
`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms` | ||
); | ||
throw error; | ||
}); | ||
}); | ||
} | ||
requestLog.VERSION = VERSION; | ||
export { requestLog }; | ||
//# sourceMappingURL=index.js.map | ||
export { | ||
requestLog | ||
}; |
{ | ||
"name": "@octokit/plugin-request-log", | ||
"version": "2.0.1", | ||
"description": "Log all requests and request errors", | ||
"version": "1.0.4", | ||
"license": "MIT", | ||
"files": [ | ||
"dist-*/", | ||
"bin/" | ||
], | ||
"pika": true, | ||
"sideEffects": false, | ||
"repository": "github:octokit/plugin-request-log.js", | ||
"keywords": [ | ||
@@ -18,4 +12,4 @@ "github", | ||
], | ||
"repository": "github:octokit/plugin-request-log.js", | ||
"dependencies": {}, | ||
"author": "Gregor Martynus (https://twitter.com/gr2m)", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
@@ -25,17 +19,15 @@ "@octokit/core": ">=3" | ||
"devDependencies": { | ||
"@octokit/core": "^3.0.0", | ||
"@pika/pack": "^0.5.0", | ||
"@pika/plugin-build-node": "^0.9.0", | ||
"@pika/plugin-build-web": "^0.9.0", | ||
"@pika/plugin-ts-standard-pkg": "^0.9.0", | ||
"@octokit/core": "^4.0.0", | ||
"@octokit/tsconfig": "^2.0.0", | ||
"@types/fetch-mock": "^7.3.2", | ||
"@types/jest": "^26.0.0", | ||
"@types/node": "^14.0.4", | ||
"@types/jest": "^29.0.0", | ||
"@types/node": "^18.0.0", | ||
"esbuild": "^0.17.19", | ||
"fetch-mock": "^9.0.0", | ||
"jest": "^27.0.0", | ||
"prettier": "2.3.1", | ||
"semantic-release": "^17.0.0", | ||
"glob": "^10.2.7", | ||
"jest": "^29.0.0", | ||
"prettier": "2.8.8", | ||
"semantic-release-plugin-update-version-in-files": "^1.0.0", | ||
"ts-jest": "^27.0.0-next.12", | ||
"typescript": "^4.0.0" | ||
"ts-jest": "^29.0.0", | ||
"typescript": "^5.0.0" | ||
}, | ||
@@ -45,6 +37,14 @@ "publishConfig": { | ||
}, | ||
"source": "dist-src/index.js", | ||
"engines": { | ||
"node": ">= 14" | ||
}, | ||
"files": [ | ||
"dist-*/**", | ||
"bin/**" | ||
], | ||
"main": "dist-node/index.js", | ||
"browser": "dist-web/index.js", | ||
"types": "dist-types/index.d.ts", | ||
"main": "dist-node/index.js", | ||
"module": "dist-web/index.js" | ||
"module": "dist-src/index.js", | ||
"sideEffects": false | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
13
115
1
10889
1