@google-cloud/logging-min
Advanced tools
Comparing version 10.3.1 to 10.3.2
@@ -25,6 +25,6 @@ /*! | ||
export declare const TRACE_SAMPLED_KEY = "logging.googleapis.com/trace_sampled"; | ||
export declare type Timestamp = google.protobuf.ITimestamp | Date | string; | ||
export declare type LogSeverity = google.logging.type.LogSeverity | string; | ||
export declare type HttpRequest = google.logging.type.IHttpRequest | CloudLoggingHttpRequest | RawHttpRequest; | ||
export declare type LogEntry = Omit<google.logging.v2.ILogEntry, 'timestamp' | 'severity' | 'httpRequest'> & { | ||
export type Timestamp = google.protobuf.ITimestamp | Date | string; | ||
export type LogSeverity = google.logging.type.LogSeverity | string; | ||
export type HttpRequest = google.logging.type.IHttpRequest | CloudLoggingHttpRequest | RawHttpRequest; | ||
export type LogEntry = Omit<google.logging.v2.ILogEntry, 'timestamp' | 'severity' | 'httpRequest'> & { | ||
timestamp?: Timestamp | null; | ||
@@ -34,3 +34,3 @@ severity?: LogSeverity | null; | ||
}; | ||
export declare type Data = any; | ||
export type Data = any; | ||
export interface EntryJson { | ||
@@ -37,0 +37,0 @@ timestamp: Timestamp; |
@@ -40,4 +40,4 @@ /*! | ||
} | ||
export declare type DeleteResponse = google.protobuf.Empty; | ||
export declare type LogSink = google.logging.v2.ILogSink; | ||
export type DeleteResponse = google.protobuf.Empty; | ||
export type LogSink = google.logging.v2.ILogSink; | ||
export interface AbortableDuplex extends Duplex { | ||
@@ -58,3 +58,3 @@ abort(): void; | ||
} | ||
export declare type GetEntriesResponse = [ | ||
export type GetEntriesResponse = [ | ||
Entry[], | ||
@@ -79,3 +79,3 @@ google.logging.v2.IListLogEntriesRequest, | ||
} | ||
export declare type GetLogsResponse = [ | ||
export type GetLogsResponse = [ | ||
Sink[], | ||
@@ -96,3 +96,3 @@ google.logging.v2.IListLogsRequest, | ||
} | ||
export declare type GetSinksResponse = [ | ||
export type GetSinksResponse = [ | ||
Sink[], | ||
@@ -105,3 +105,3 @@ google.logging.v2.IListSinksRequest, | ||
} | ||
export declare type Client = string; | ||
export type Client = string; | ||
export interface RequestConfig { | ||
@@ -108,0 +108,0 @@ client: Client; |
@@ -52,8 +52,8 @@ /*! | ||
} | ||
export declare type Metadata = any; | ||
export declare type ApiResponse = [Metadata]; | ||
export type Metadata = any; | ||
export type ApiResponse = [Metadata]; | ||
export interface ApiResponseCallback { | ||
(err: Error | null, apiResponse?: Metadata): void; | ||
} | ||
export declare type DeleteCallback = ApiResponseCallback; | ||
export type DeleteCallback = ApiResponseCallback; | ||
/** | ||
@@ -60,0 +60,0 @@ * A log is a named collection of entries, each entry representing a timestamped |
@@ -21,3 +21,3 @@ /*! | ||
} | ||
export declare type SinkMetadataResponse = [LogSink]; | ||
export type SinkMetadataResponse = [LogSink]; | ||
export interface SetSinkMetadata extends LogSink { | ||
@@ -24,0 +24,0 @@ gaxOptions?: CallOptions; |
@@ -18,3 +18,3 @@ /*! | ||
import * as http from 'http'; | ||
export declare type RawHttpRequest = http.IncomingMessage & CloudLoggingHttpRequest; | ||
export type RawHttpRequest = http.IncomingMessage & CloudLoggingHttpRequest; | ||
export interface CloudLoggingHttpRequest { | ||
@@ -21,0 +21,0 @@ requestMethod?: string; |
@@ -25,5 +25,5 @@ /*! | ||
*/ | ||
export declare const NODEJS_DEFAULT_LIBRARY_VERSION = "10.3.1"; | ||
export declare const NODEJS_DEFAULT_LIBRARY_VERSION = "10.3.2"; | ||
export declare const MAX_INSTRUMENTATION_COUNT = 3; | ||
export declare type InstrumentationInfo = { | ||
export type InstrumentationInfo = { | ||
name: string; | ||
@@ -30,0 +30,0 @@ version: string; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.setInstrumentationStatus=exports.getNodejsLibraryVersion=exports.createDiagnosticEntry=exports.populateInstrumentationInfo=exports.MAX_INSTRUMENTATION_COUNT=exports.NODEJS_DEFAULT_LIBRARY_VERSION=exports.NODEJS_LIBRARY_NAME_PREFIX=exports.INSTRUMENTATION_SOURCE_KEY=exports.DIAGNOSTIC_INFO_KEY=void 0;const arrify=require("arrify");const entry_1=require("../entry");global.instrumentationAdded=false;global.shouldSkipInstrumentationCheck=false;const maxDiagnosticValueLen=14;exports.DIAGNOSTIC_INFO_KEY="logging.googleapis.com/diagnostic";exports.INSTRUMENTATION_SOURCE_KEY="instrumentation_source";exports.NODEJS_LIBRARY_NAME_PREFIX="nodejs";exports.NODEJS_DEFAULT_LIBRARY_VERSION="10.3.1";exports.MAX_INSTRUMENTATION_COUNT=3;function populateInstrumentationInfo(entry){var _a,_b;if(global.shouldSkipInstrumentationCheck){return[arrify(entry),false]}let isWritten=setInstrumentationStatus(true);let isInfoAdded=false;const entries=[];if(entry){for(const entryItem of arrify(entry)){if(entryItem){const info=(_b=(_a=entryItem.data)===null||_a===void 0?void 0:_a[exports.DIAGNOSTIC_INFO_KEY])===null||_b===void 0?void 0:_b[exports.INSTRUMENTATION_SOURCE_KEY];if(info){entryItem.data[exports.DIAGNOSTIC_INFO_KEY][exports.INSTRUMENTATION_SOURCE_KEY]=validateAndUpdateInstrumentation(info);global.shouldSkipInstrumentationCheck=isInfoAdded=isWritten=true}entries.push(entryItem)}}}if(!isWritten){entries.push(createDiagnosticEntry(undefined,undefined));global.shouldSkipInstrumentationCheck=isInfoAdded=true}return[entries,isInfoAdded]}exports.populateInstrumentationInfo=populateInstrumentationInfo;function createDiagnosticEntry(libraryName,libraryVersion){if(!libraryName||!libraryName.startsWith(exports.NODEJS_LIBRARY_NAME_PREFIX)){libraryName=exports.NODEJS_LIBRARY_NAME_PREFIX}const entry=new entry_1.Entry(undefined,{[exports.DIAGNOSTIC_INFO_KEY]:{[exports.INSTRUMENTATION_SOURCE_KEY]:[{name:truncateValue(libraryName,maxDiagnosticValueLen),version:truncateValue(libraryVersion!==null&&libraryVersion!==void 0?libraryVersion:getNodejsLibraryVersion(),maxDiagnosticValueLen)}]}});return entry}exports.createDiagnosticEntry=createDiagnosticEntry;function validateAndUpdateInstrumentation(infoList){const finalInfo=[];let count=1;for(const info of infoList){if(isValidInfo(info)){finalInfo.push({name:truncateValue(info.name,maxDiagnosticValueLen),version:truncateValue(info.version,maxDiagnosticValueLen)});if(++count===exports.MAX_INSTRUMENTATION_COUNT)break}}finalInfo.push({name:exports.NODEJS_LIBRARY_NAME_PREFIX,version:getNodejsLibraryVersion()});return finalInfo}function truncateValue(value,maxLen){if(typeof value!=="string"){try{if(Object.prototype.hasOwnProperty.call(value,"version")){value=value.version}}catch(err){}}if(typeof value!=="string"){return exports.NODEJS_DEFAULT_LIBRARY_VERSION}if(value&&value.length>maxLen){return value.substring(0,maxLen).concat("*")}return value}function getNodejsLibraryVersion(){return exports.NODEJS_DEFAULT_LIBRARY_VERSION}exports.getNodejsLibraryVersion=getNodejsLibraryVersion;function isValidInfo(info){if(!info||!info.name||!info.version||!info.name.startsWith(exports.NODEJS_LIBRARY_NAME_PREFIX)){return false}return true}function setInstrumentationStatus(value){const status=global.instrumentationAdded;global.instrumentationAdded=value;return status}exports.setInstrumentationStatus=setInstrumentationStatus; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.setInstrumentationStatus=exports.getNodejsLibraryVersion=exports.createDiagnosticEntry=exports.populateInstrumentationInfo=exports.MAX_INSTRUMENTATION_COUNT=exports.NODEJS_DEFAULT_LIBRARY_VERSION=exports.NODEJS_LIBRARY_NAME_PREFIX=exports.INSTRUMENTATION_SOURCE_KEY=exports.DIAGNOSTIC_INFO_KEY=void 0;const arrify=require("arrify");const entry_1=require("../entry");global.instrumentationAdded=false;global.shouldSkipInstrumentationCheck=false;const maxDiagnosticValueLen=14;exports.DIAGNOSTIC_INFO_KEY="logging.googleapis.com/diagnostic";exports.INSTRUMENTATION_SOURCE_KEY="instrumentation_source";exports.NODEJS_LIBRARY_NAME_PREFIX="nodejs";exports.NODEJS_DEFAULT_LIBRARY_VERSION="10.3.2";exports.MAX_INSTRUMENTATION_COUNT=3;function populateInstrumentationInfo(entry){var _a,_b;if(global.shouldSkipInstrumentationCheck){return[arrify(entry),false]}let isWritten=setInstrumentationStatus(true);let isInfoAdded=false;const entries=[];if(entry){for(const entryItem of arrify(entry)){if(entryItem){const info=(_b=(_a=entryItem.data)===null||_a===void 0?void 0:_a[exports.DIAGNOSTIC_INFO_KEY])===null||_b===void 0?void 0:_b[exports.INSTRUMENTATION_SOURCE_KEY];if(info){entryItem.data[exports.DIAGNOSTIC_INFO_KEY][exports.INSTRUMENTATION_SOURCE_KEY]=validateAndUpdateInstrumentation(info);global.shouldSkipInstrumentationCheck=isInfoAdded=isWritten=true}entries.push(entryItem)}}}if(!isWritten){entries.push(createDiagnosticEntry(undefined,undefined));global.shouldSkipInstrumentationCheck=isInfoAdded=true}return[entries,isInfoAdded]}exports.populateInstrumentationInfo=populateInstrumentationInfo;function createDiagnosticEntry(libraryName,libraryVersion){if(!libraryName||!libraryName.startsWith(exports.NODEJS_LIBRARY_NAME_PREFIX)){libraryName=exports.NODEJS_LIBRARY_NAME_PREFIX}const entry=new entry_1.Entry(undefined,{[exports.DIAGNOSTIC_INFO_KEY]:{[exports.INSTRUMENTATION_SOURCE_KEY]:[{name:truncateValue(libraryName,maxDiagnosticValueLen),version:truncateValue(libraryVersion!==null&&libraryVersion!==void 0?libraryVersion:getNodejsLibraryVersion(),maxDiagnosticValueLen)}]}});return entry}exports.createDiagnosticEntry=createDiagnosticEntry;function validateAndUpdateInstrumentation(infoList){const finalInfo=[];let count=1;for(const info of infoList){if(isValidInfo(info)){finalInfo.push({name:truncateValue(info.name,maxDiagnosticValueLen),version:truncateValue(info.version,maxDiagnosticValueLen)});if(++count===exports.MAX_INSTRUMENTATION_COUNT)break}}finalInfo.push({name:exports.NODEJS_LIBRARY_NAME_PREFIX,version:getNodejsLibraryVersion()});return finalInfo}function truncateValue(value,maxLen){if(typeof value!=="string"){try{if(Object.prototype.hasOwnProperty.call(value,"version")){value=value.version}}catch(err){}}if(typeof value!=="string"){return exports.NODEJS_DEFAULT_LIBRARY_VERSION}if(value&&value.length>maxLen){return value.substring(0,maxLen).concat("*")}return value}function getNodejsLibraryVersion(){return exports.NODEJS_DEFAULT_LIBRARY_VERSION}exports.getNodejsLibraryVersion=getNodejsLibraryVersion;function isValidInfo(info){if(!info||!info.name||!info.version||!info.name.startsWith(exports.NODEJS_LIBRARY_NAME_PREFIX)){return false}return true}function setInstrumentationStatus(value){const status=global.instrumentationAdded;global.instrumentationAdded=value;return status}exports.setInstrumentationStatus=setInstrumentationStatus; | ||
//# sourceMappingURL=instrumentation.js.map |
@@ -27,3 +27,3 @@ /*! | ||
} | ||
export declare type MonitoredResource = google.api.IMonitoredResource; | ||
export type MonitoredResource = google.api.IMonitoredResource; | ||
export declare enum Severity { | ||
@@ -39,4 +39,4 @@ emergency = 0, | ||
} | ||
export declare type SeverityNames = keyof typeof Severity; | ||
export declare type LogSeverityFunctions = { | ||
export type SeverityNames = keyof typeof Severity; | ||
export type LogSeverityFunctions = { | ||
[P in SeverityNames]: Function; | ||
@@ -43,0 +43,0 @@ }; |
{ | ||
"name": "@google-cloud/logging-min", | ||
"version": "10.3.1", | ||
"version": "10.3.2", | ||
"description": "Cloud Logging Client Library for Node.js", | ||
@@ -75,3 +75,3 @@ "keywords": [ | ||
"@types/sinon": "^10.0.0", | ||
"@types/uuid": "^8.0.0", | ||
"@types/uuid": "^9.0.0", | ||
"bignumber.js": "^9.0.0", | ||
@@ -91,3 +91,3 @@ "c8": "^7.1.0", | ||
"proxyquire": "^2.1.3", | ||
"sinon": "^14.0.0", | ||
"sinon": "^15.0.0", | ||
"ts-loader": "^9.0.0", | ||
@@ -97,3 +97,3 @@ "typescript": "^4.6.4", | ||
"webpack": "^5.0.0", | ||
"webpack-cli": "^4.0.0" | ||
"webpack-cli": "^5.0.0" | ||
}, | ||
@@ -100,0 +100,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
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
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
2409371