Commit iniziale

This commit is contained in:
Paolo A
2025-02-18 22:59:07 +00:00
commit 4bbf35cefb
6879 changed files with 623784 additions and 0 deletions

63
node_modules/@azure/logger/dist/commonjs/debug.d.ts generated vendored Normal file
View File

@@ -0,0 +1,63 @@
/**
* A simple mechanism for enabling logging.
* Intended to mimic the publicly available `debug` package.
*/
export interface Debug {
/**
* Creates a new logger with the given namespace.
*/
(namespace: string): Debugger;
/**
* The default log method (defaults to console)
*/
log: (...args: any[]) => void;
/**
* Enables a particular set of namespaces.
* To enable multiple separate them with commas, e.g. "info,debug".
* Supports wildcards, e.g. "azure:*"
* Supports skip syntax, e.g. "azure:*,-azure:storage:*" will enable
* everything under azure except for things under azure:storage.
*/
enable: (namespaces: string) => void;
/**
* Checks if a particular namespace is enabled.
*/
enabled: (namespace: string) => boolean;
/**
* Disables all logging, returns what was previously enabled.
*/
disable: () => string;
}
/**
* A log function that can be dynamically enabled and redirected.
*/
export interface Debugger {
/**
* Logs the given arguments to the `log` method.
*/
(...args: any[]): void;
/**
* True if this logger is active and logging.
*/
enabled: boolean;
/**
* Used to cleanup/remove this logger.
*/
destroy: () => boolean;
/**
* The current log method. Can be overridden to redirect output.
*/
log: (...args: any[]) => void;
/**
* The namespace of this logger.
*/
namespace: string;
/**
* Extends this logger with a child namespace.
* Namespaces are separated with a ':' character.
*/
extend: (namespace: string) => Debugger;
}
declare const debugObj: Debug;
export default debugObj;
//# sourceMappingURL=debug.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC9B;;OAEG;IACH,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAC9B;;;;;;OAMG;IACH,MAAM,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC;;OAEG;IACH,OAAO,EAAE,MAAM,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACvB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC;IACvB;;OAEG;IACH,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,QAAQ,CAAC;CACzC;AAcD,QAAA,MAAM,QAAQ,EAAE,KAUf,CAAC;AAmFF,eAAe,QAAQ,CAAC"}

95
node_modules/@azure/logger/dist/commonjs/debug.js generated vendored Normal file
View File

@@ -0,0 +1,95 @@
"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Object.defineProperty(exports, "__esModule", { value: true });
const log_js_1 = require("./log.js");
const debugEnvVariable = (typeof process !== "undefined" && process.env && process.env.DEBUG) || undefined;
let enabledString;
let enabledNamespaces = [];
let skippedNamespaces = [];
const debuggers = [];
if (debugEnvVariable) {
enable(debugEnvVariable);
}
const debugObj = Object.assign((namespace) => {
return createDebugger(namespace);
}, {
enable,
enabled,
disable,
log: log_js_1.log,
});
function enable(namespaces) {
enabledString = namespaces;
enabledNamespaces = [];
skippedNamespaces = [];
const wildcard = /\*/g;
const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?"));
for (const ns of namespaceList) {
if (ns.startsWith("-")) {
skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`));
}
else {
enabledNamespaces.push(new RegExp(`^${ns}$`));
}
}
for (const instance of debuggers) {
instance.enabled = enabled(instance.namespace);
}
}
function enabled(namespace) {
if (namespace.endsWith("*")) {
return true;
}
for (const skipped of skippedNamespaces) {
if (skipped.test(namespace)) {
return false;
}
}
for (const enabledNamespace of enabledNamespaces) {
if (enabledNamespace.test(namespace)) {
return true;
}
}
return false;
}
function disable() {
const result = enabledString || "";
enable("");
return result;
}
function createDebugger(namespace) {
const newDebugger = Object.assign(debug, {
enabled: enabled(namespace),
destroy,
log: debugObj.log,
namespace,
extend,
});
function debug(...args) {
if (!newDebugger.enabled) {
return;
}
if (args.length > 0) {
args[0] = `${namespace} ${args[0]}`;
}
newDebugger.log(...args);
}
debuggers.push(newDebugger);
return newDebugger;
}
function destroy() {
const index = debuggers.indexOf(this);
if (index >= 0) {
debuggers.splice(index, 1);
return true;
}
return false;
}
function extend(namespace) {
const newDebugger = createDebugger(`${this.namespace}:${namespace}`);
newDebugger.log = this.log;
return newDebugger;
}
exports.default = debugObj;
//# sourceMappingURL=debug.js.map

File diff suppressed because one or more lines are too long

68
node_modules/@azure/logger/dist/commonjs/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,68 @@
import { type Debugger } from "./debug.js";
export type { Debugger } from "./debug.js";
/**
* The AzureLogger provides a mechanism for overriding where logs are output to.
* By default, logs are sent to stderr.
* Override the `log` method to redirect logs to another location.
*/
export declare const AzureLogger: AzureClientLogger;
/**
* The log levels supported by the logger.
* The log levels in order of most verbose to least verbose are:
* - verbose
* - info
* - warning
* - error
*/
export type AzureLogLevel = "verbose" | "info" | "warning" | "error";
/**
* An AzureClientLogger is a function that can log to an appropriate severity level.
*/
export type AzureClientLogger = Debugger;
/**
* Immediately enables logging at the specified log level. If no level is specified, logging is disabled.
* @param level - The log level to enable for logging.
* Options from most verbose to least verbose are:
* - verbose
* - info
* - warning
* - error
*/
export declare function setLogLevel(level?: AzureLogLevel): void;
/**
* Retrieves the currently specified log level.
*/
export declare function getLogLevel(): AzureLogLevel | undefined;
/**
* Defines the methods available on the SDK-facing logger.
*/
export interface AzureLogger {
/**
* Used for failures the program is unlikely to recover from,
* such as Out of Memory.
*/
error: Debugger;
/**
* Used when a function fails to perform its intended task.
* Usually this means the function will throw an exception.
* Not used for self-healing events (e.g. automatic retry)
*/
warning: Debugger;
/**
* Used when a function operates normally.
*/
info: Debugger;
/**
* Used for detailed troubleshooting scenarios. This is
* intended for use by developers / system administrators
* for diagnosing specific failures.
*/
verbose: Debugger;
}
/**
* Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`.
* @param namespace - The name of the SDK package.
* @hidden
*/
export declare function createClientLogger(namespace: string): AzureLogger;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAc,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAClD,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQ3C;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,iBAAkC,CAAC;AAK7D;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAKrE;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAezC;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,CAgBvD;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,aAAa,GAAG,SAAS,CAEvD;AASD;;GAEG;AAEH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,KAAK,EAAE,QAAQ,CAAC;IAChB;;;;OAIG;IACH,OAAO,EAAE,QAAQ,CAAC;IAClB;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IACf;;;;OAIG;IACH,OAAO,EAAE,QAAQ,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,CASjE"}

105
node_modules/@azure/logger/dist/commonjs/index.js generated vendored Normal file
View File

@@ -0,0 +1,105 @@
"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Object.defineProperty(exports, "__esModule", { value: true });
exports.AzureLogger = void 0;
exports.setLogLevel = setLogLevel;
exports.getLogLevel = getLogLevel;
exports.createClientLogger = createClientLogger;
const tslib_1 = require("tslib");
const debug_js_1 = tslib_1.__importDefault(require("./debug.js"));
const registeredLoggers = new Set();
const logLevelFromEnv = (typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL) || undefined;
let azureLogLevel;
/**
* The AzureLogger provides a mechanism for overriding where logs are output to.
* By default, logs are sent to stderr.
* Override the `log` method to redirect logs to another location.
*/
exports.AzureLogger = (0, debug_js_1.default)("azure");
exports.AzureLogger.log = (...args) => {
debug_js_1.default.log(...args);
};
const AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"];
if (logLevelFromEnv) {
// avoid calling setLogLevel because we don't want a mis-set environment variable to crash
if (isAzureLogLevel(logLevelFromEnv)) {
setLogLevel(logLevelFromEnv);
}
else {
console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`);
}
}
/**
* Immediately enables logging at the specified log level. If no level is specified, logging is disabled.
* @param level - The log level to enable for logging.
* Options from most verbose to least verbose are:
* - verbose
* - info
* - warning
* - error
*/
function setLogLevel(level) {
if (level && !isAzureLogLevel(level)) {
throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`);
}
azureLogLevel = level;
const enabledNamespaces = [];
for (const logger of registeredLoggers) {
if (shouldEnable(logger)) {
enabledNamespaces.push(logger.namespace);
}
}
debug_js_1.default.enable(enabledNamespaces.join(","));
}
/**
* Retrieves the currently specified log level.
*/
function getLogLevel() {
return azureLogLevel;
}
const levelMap = {
verbose: 400,
info: 300,
warning: 200,
error: 100,
};
/**
* Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`.
* @param namespace - The name of the SDK package.
* @hidden
*/
function createClientLogger(namespace) {
const clientRootLogger = exports.AzureLogger.extend(namespace);
patchLogMethod(exports.AzureLogger, clientRootLogger);
return {
error: createLogger(clientRootLogger, "error"),
warning: createLogger(clientRootLogger, "warning"),
info: createLogger(clientRootLogger, "info"),
verbose: createLogger(clientRootLogger, "verbose"),
};
}
function patchLogMethod(parent, child) {
child.log = (...args) => {
parent.log(...args);
};
}
function createLogger(parent, level) {
const logger = Object.assign(parent.extend(level), {
level,
});
patchLogMethod(parent, logger);
if (shouldEnable(logger)) {
const enabledNamespaces = debug_js_1.default.disable();
debug_js_1.default.enable(enabledNamespaces + "," + logger.namespace);
}
registeredLoggers.add(logger);
return logger;
}
function shouldEnable(logger) {
return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]);
}
function isAzureLogLevel(logLevel) {
return AZURE_LOG_LEVELS.includes(logLevel);
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
export declare function log(...args: any[]): void;
//# sourceMappingURL=log.common.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"log.common.d.ts","sourceRoot":"","sources":["../../src/log.common.ts"],"names":[],"mappings":"AAGA,wBAAgB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAexC"}

26
node_modules/@azure/logger/dist/commonjs/log.common.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Object.defineProperty(exports, "__esModule", { value: true });
exports.log = log;
function log(...args) {
if (args.length > 0) {
const firstArg = String(args[0]);
if (firstArg.includes(":error")) {
console.error(...args);
}
else if (firstArg.includes(":warning")) {
console.warn(...args);
}
else if (firstArg.includes(":info")) {
console.info(...args);
}
else if (firstArg.includes(":verbose")) {
console.debug(...args);
}
else {
console.debug(...args);
}
}
}
//# sourceMappingURL=log.common.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"log.common.js","sourceRoot":"","sources":["../../src/log.common.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,kBAeC;AAfD,SAAgB,GAAG,CAAC,GAAG,IAAW;IAChC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QACzB,CAAC;aAAM,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACxB,CAAC;aAAM,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACxB,CAAC;aAAM,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACzC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport function log(...args: any[]): void {\n if (args.length > 0) {\n const firstArg = String(args[0]);\n if (firstArg.includes(\":error\")) {\n console.error(...args);\n } else if (firstArg.includes(\":warning\")) {\n console.warn(...args);\n } else if (firstArg.includes(\":info\")) {\n console.info(...args);\n } else if (firstArg.includes(\":verbose\")) {\n console.debug(...args);\n } else {\n console.debug(...args);\n }\n }\n}\n"]}

2
node_modules/@azure/logger/dist/commonjs/log.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare function log(message: unknown, ...args: any[]): void;
//# sourceMappingURL=log.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/log.ts"],"names":[],"mappings":"AAOA,wBAAgB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAE1D"}

13
node_modules/@azure/logger/dist/commonjs/log.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Object.defineProperty(exports, "__esModule", { value: true });
exports.log = log;
const tslib_1 = require("tslib");
const node_os_1 = require("node:os");
const node_util_1 = tslib_1.__importDefault(require("node:util"));
const process = tslib_1.__importStar(require("node:process"));
function log(message, ...args) {
process.stderr.write(`${node_util_1.default.format(message, ...args)}${node_os_1.EOL}`);
}
//# sourceMappingURL=log.js.map

1
node_modules/@azure/logger/dist/commonjs/log.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/log.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAMlC,kBAEC;;AAND,qCAA8B;AAC9B,kEAA6B;AAC7B,8DAAwC;AAExC,SAAgB,GAAG,CAAC,OAAgB,EAAE,GAAG,IAAW;IAClD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,mBAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,aAAG,EAAE,CAAC,CAAC;AACjE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { EOL } from \"node:os\";\nimport util from \"node:util\";\nimport * as process from \"node:process\";\n\nexport function log(message: unknown, ...args: any[]): void {\n process.stderr.write(`${util.format(message, ...args)}${EOL}`);\n}\n"]}

View File

@@ -0,0 +1,3 @@
{
"type": "commonjs"
}

View File

@@ -0,0 +1,11 @@
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
// It should be published with your NPM package. It should not be tracked by Git.
{
"tsdocVersion": "0.12",
"toolPackages": [
{
"packageName": "@microsoft/api-extractor",
"packageVersion": "7.47.4"
}
]
}