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

21
node_modules/@azure/logger/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2020 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

132
node_modules/@azure/logger/README.md generated vendored Normal file
View File

@@ -0,0 +1,132 @@
# Azure Logger client library for JavaScript
The `@azure/logger` package can be used to enable logging in the Azure SDKs for JavaScript.
Logging can be enabled for the Azure SDK in the following ways:
- Setting the AZURE_LOG_LEVEL environment variable
- Calling setLogLevel imported from "@azure/logger"
- Calling enable() on specific loggers
- Using the `DEBUG` environment variable.
Note that AZURE_LOG_LEVEL, if set, takes precedence over DEBUG. Only use DEBUG without specifying AZURE_LOG_LEVEL or calling setLogLevel.
## Getting started
### Installation
Install this library using npm as follows
```
npm install @azure/logger
```
## Key Concepts
The `@azure/logger` package supports the following log levels
specified in order of most verbose to least verbose:
- verbose
- info
- warning
- error
When setting a log level, either programmatically or via the `AZURE_LOG_LEVEL` environment variable,
any logs that are written using a log level equal to or less than the one you choose
will be emitted.
For example, setting the log level to `warning` will cause all logs that have the log
level `warning` or `error` to be emitted.
**NOTE**: When logging requests and responses, we sanitize these objects to make sure things like `Authorization` headers that contain secrets are not logged.
Request and response bodies are never logged. Headers are redacted by default, unless present in the following list or explicitly allowed by the client SDK:
- "x-ms-client-request-id",
- "x-ms-return-client-request-id",
- "x-ms-useragent",
- "x-ms-correlation-request-id",
- "x-ms-request-id",
- "client-request-id",
- "ms-cv",
- "return-client-request-id",
- "traceparent",
- "Access-Control-Allow-Credentials",
- "Access-Control-Allow-Headers",
- "Access-Control-Allow-Methods",
- "Access-Control-Allow-Origin",
- "Access-Control-Expose-Headers",
- "Access-Control-Max-Age",
- "Access-Control-Request-Headers",
- "Access-Control-Request-Method",
- "Origin",
- "Accept",
- "Accept-Encoding",
- "Cache-Control",
- "Connection",
- "Content-Length",
- "Content-Type",
- "Date",
- "ETag",
- "Expires",
- "If-Match",
- "If-Modified-Since",
- "If-None-Match",
- "If-Unmodified-Since",
- "Last-Modified",
- "Pragma",
- "Request-Id",
- "Retry-After",
- "Server",
- "Transfer-Encoding",
- "User-Agent",
- "WWW-Authenticate",
## Examples
### Example 1 - basic usage
```js
const { EventHubClient } = require('@azure/event-hubs');
const logger = require('@azure/logger');
logger.setLogLevel('info');
// operations will now emit info, warning, and error logs
const client = new EventHubClient(/* params */);
client.getPartitionIds()
.then(ids => { /* do work */ })
.catch(e => { /* do work */ });
});
```
### Example 2 - redirect log output
```js
const { AzureLogger, setLogLevel } = require("@azure/logger");
setLogLevel("verbose");
// override logging to output to console.log (default location is stderr)
AzureLogger.log = (...args) => {
console.log(...args);
};
```
Using `AzureLogger`, it is possible to redirect the logging output from the Azure SDKs by
overriding the `AzureLogger.log` method. This may be useful if you want to redirect logs to
a location other than stderr.
## Next steps
You can build and run the tests locally by executing `rushx test`. Explore the `test` folder to see advanced usage and behavior of the public classes.
## Troubleshooting
If you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new).
## Contributing
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Flogger%2FREADME.png)

63
node_modules/@azure/logger/dist/browser/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"}

93
node_modules/@azure/logger/dist/browser/debug.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { log } from "./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,
});
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;
}
export default debugObj;
//# sourceMappingURL=debug.js.map

1
node_modules/@azure/logger/dist/browser/debug.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

68
node_modules/@azure/logger/dist/browser/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"}

98
node_modules/@azure/logger/dist/browser/index.js generated vendored Normal file
View File

@@ -0,0 +1,98 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import debug from "./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.
*/
export const AzureLogger = debug("azure");
AzureLogger.log = (...args) => {
debug.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
*/
export 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.enable(enabledNamespaces.join(","));
}
/**
* Retrieves the currently specified log level.
*/
export 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
*/
export function createClientLogger(namespace) {
const clientRootLogger = AzureLogger.extend(namespace);
patchLogMethod(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.disable();
debug.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

1
node_modules/@azure/logger/dist/browser/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"log-browser.d.mts","sourceRoot":"","sources":["../../src/log-browser.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"log-browser.mjs","sourceRoot":"","sources":["../../src/log-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { log } from \"./log.common.js\";\n"]}

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"}

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

@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export 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,MAAM,UAAU,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/browser/log.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export { log } from "./log.common.js";
//# sourceMappingURL=log-browser.d.mts.map

4
node_modules/@azure/logger/dist/browser/log.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export { log } from "./log.common.js";
//# sourceMappingURL=log-browser.mjs.map

3
node_modules/@azure/logger/dist/browser/package.json generated vendored Normal file
View File

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

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"
}
]
}

63
node_modules/@azure/logger/dist/esm/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

1
node_modules/@azure/logger/dist/esm/debug.d.ts.map generated vendored Normal file
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"}

93
node_modules/@azure/logger/dist/esm/debug.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { log } from "./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,
});
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;
}
export default debugObj;
//# sourceMappingURL=debug.js.map

1
node_modules/@azure/logger/dist/esm/debug.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

68
node_modules/@azure/logger/dist/esm/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

1
node_modules/@azure/logger/dist/esm/index.d.ts.map generated vendored Normal file
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"}

98
node_modules/@azure/logger/dist/esm/index.js generated vendored Normal file
View File

@@ -0,0 +1,98 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import debug from "./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.
*/
export const AzureLogger = debug("azure");
AzureLogger.log = (...args) => {
debug.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
*/
export 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.enable(enabledNamespaces.join(","));
}
/**
* Retrieves the currently specified log level.
*/
export 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
*/
export function createClientLogger(namespace) {
const clientRootLogger = AzureLogger.extend(namespace);
patchLogMethod(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.disable();
debug.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

1
node_modules/@azure/logger/dist/esm/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/@azure/logger/dist/esm/log.common.d.ts generated vendored Normal file
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"}

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

@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export 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,MAAM,UAAU,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/esm/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

1
node_modules/@azure/logger/dist/esm/log.d.ts.map generated vendored Normal file
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"}

9
node_modules/@azure/logger/dist/esm/log.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { EOL } from "node:os";
import util from "node:util";
import * as process from "node:process";
export function log(message, ...args) {
process.stderr.write(`${util.format(message, ...args)}${EOL}`);
}
//# sourceMappingURL=log.js.map

1
node_modules/@azure/logger/dist/esm/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;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,GAAG,CAAC,OAAgB,EAAE,GAAG,IAAW;IAClD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,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"]}

3
node_modules/@azure/logger/dist/esm/package.json generated vendored Normal file
View File

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

104
node_modules/@azure/logger/dist/logger.d.ts generated vendored Normal file
View File

@@ -0,0 +1,104 @@
/**
* An AzureClientLogger is a function that can log to an appropriate severity level.
*/
export declare type AzureClientLogger = Debugger;
/**
* 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;
/**
* Defines the methods available on the SDK-facing logger.
*/
export declare 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;
}
/**
* The log levels supported by the logger.
* The log levels in order of most verbose to least verbose are:
* - verbose
* - info
* - warning
* - error
*/
export declare type AzureLogLevel = "verbose" | "info" | "warning" | "error";
/**
* 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;
/**
* A log function that can be dynamically enabled and redirected.
*/
export declare 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;
}
/**
* Retrieves the currently specified log level.
*/
export declare function getLogLevel(): AzureLogLevel | undefined;
/**
* 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;
export { }

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"}

93
node_modules/@azure/logger/dist/react-native/debug.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { log } from "./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,
});
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;
}
export default debugObj;
//# sourceMappingURL=debug.js.map

File diff suppressed because one or more lines are too long

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"}

98
node_modules/@azure/logger/dist/react-native/index.js generated vendored Normal file
View File

@@ -0,0 +1,98 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import debug from "./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.
*/
export const AzureLogger = debug("azure");
AzureLogger.log = (...args) => {
debug.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
*/
export 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.enable(enabledNamespaces.join(","));
}
/**
* Retrieves the currently specified log level.
*/
export 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
*/
export function createClientLogger(namespace) {
const clientRootLogger = AzureLogger.extend(namespace);
patchLogMethod(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.disable();
debug.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 @@
{"version":3,"file":"log-react-native.d.mts","sourceRoot":"","sources":["../../src/log-react-native.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"log-react-native.mjs","sourceRoot":"","sources":["../../src/log-react-native.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { log } from \"./log.common.js\";\n"]}

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"}

View File

@@ -0,0 +1,23 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export 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,MAAM,UAAU,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"]}

View File

@@ -0,0 +1,2 @@
export { log } from "./log.common.js";
//# sourceMappingURL=log-react-native.d.mts.map

4
node_modules/@azure/logger/dist/react-native/log.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export { log } from "./log.common.js";
//# sourceMappingURL=log-react-native.mjs.map

View File

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

122
node_modules/@azure/logger/package.json generated vendored Normal file
View File

@@ -0,0 +1,122 @@
{
"name": "@azure/logger",
"sdk-type": "client",
"version": "1.1.4",
"description": "Microsoft Azure SDK for JavaScript - Logger",
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"react-native": "./dist/react-native/index.js",
"exports": {
"./package.json": "./package.json",
".": {
"browser": {
"source": "./src/index.ts",
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"source": "./src/index.ts",
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"source": "./src/index.ts",
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"source": "./src/index.ts",
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"engines": {
"node": ">=18.0.0"
},
"files": [
"dist/",
"README.md",
"LICENSE"
],
"repository": "github:Azure/azure-sdk-for-js",
"keywords": [
"azure",
"log",
"logger",
"logging",
"node.js",
"typescript",
"javascript",
"browser",
"cloud"
],
"author": "Microsoft Corporation",
"license": "MIT",
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger/README.md",
"sideEffects": false,
"scripts": {
"build:samples": "echo Obsolete",
"build:test": "echo skipped. actual commands inlined in browser test scripts",
"build": "npm run clean && tshy && dev-tool run extract-api",
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"clean": "rimraf --glob dist dist-* temp *.tgz *.log",
"execute:samples": "echo skipped",
"extract-api": "tshy && dev-tool run extract-api",
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts",
"pack": "npm pack 2>&1",
"test:browser": "npm run clean && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node",
"test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "npm run clean && tshy && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
"unit-test:node": "dev-tool run test:vitest --no-test-proxy",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"dependencies": {
"tslib": "^2.6.2"
},
"devDependencies": {
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@microsoft/api-extractor": "^7.40.3",
"@types/node": "^18.0.0",
"@vitest/browser": "^1.3.1",
"@vitest/coverage-istanbul": "^1.3.1",
"dotenv": "^16.3.1",
"eslint": "^8.56.0",
"playwright": "^1.41.2",
"rimraf": "^5.0.5",
"tshy": "^1.17.0",
"typescript": "~5.5.3",
"vitest": "^1.3.1"
},
"//metadata": {
"migrationDate": "2023-03-08T18:36:03.000Z"
},
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"selfLink": false
},
"module": "./dist/esm/index.js"
}