@contentful/optimization-api-client 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -15
- package/THIRD_PARTY_NOTICES.txt +0 -2017
- package/dist/api-schemas.cjs +504 -28
- package/dist/api-schemas.cjs.map +1 -1
- package/dist/api-schemas.d.cts +6558 -1
- package/dist/api-schemas.d.mts +6558 -1
- package/dist/api-schemas.d.ts +6558 -1
- package/dist/api-schemas.mjs +309 -2
- package/dist/api-schemas.mjs.map +1 -0
- package/dist/guards.cjs +44 -0
- package/dist/guards.cjs.map +1 -0
- package/dist/guards.d.cts +103 -0
- package/dist/guards.d.mts +103 -0
- package/dist/guards.d.ts +103 -0
- package/dist/guards.mjs +1 -0
- package/dist/index.cjs +48 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1512 -24
- package/dist/index.d.mts +1512 -24
- package/dist/index.d.ts +1512 -24
- package/dist/index.mjs +23 -22
- package/dist/index.mjs.map +1 -1
- package/dist/logger.cjs +17 -13
- package/dist/logger.cjs.map +1 -1
- package/dist/logger.mjs +131 -1
- package/dist/logger.mjs.map +1 -0
- package/dist/u~0.mjs +6 -0
- package/dist/u~0.mjs.map +1 -0
- package/package.json +39 -2
- package/dist/199.mjs +0 -2
- package/dist/649.mjs +0 -131
- package/dist/649.mjs.map +0 -1
package/dist/logger.mjs
CHANGED
|
@@ -1 +1,131 @@
|
|
|
1
|
-
|
|
1
|
+
class LogSink {
|
|
2
|
+
}
|
|
3
|
+
const logger_LogSink = LogSink;
|
|
4
|
+
class Logger {
|
|
5
|
+
name = '@contentful/optimization';
|
|
6
|
+
PREFIX_PARTS = [
|
|
7
|
+
'Ctfl',
|
|
8
|
+
'O10n'
|
|
9
|
+
];
|
|
10
|
+
DELIMITER = ':';
|
|
11
|
+
sinks = [];
|
|
12
|
+
assembleLocationPrefix(logLocation) {
|
|
13
|
+
return `[${[
|
|
14
|
+
...this.PREFIX_PARTS,
|
|
15
|
+
logLocation
|
|
16
|
+
].join(this.DELIMITER)}]`;
|
|
17
|
+
}
|
|
18
|
+
addSink(sink) {
|
|
19
|
+
this.sinks = [
|
|
20
|
+
...this.sinks.filter((existingSink)=>existingSink.name !== sink.name),
|
|
21
|
+
sink
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
removeSink(name) {
|
|
25
|
+
this.sinks = this.sinks.filter((sink)=>sink.name !== name);
|
|
26
|
+
}
|
|
27
|
+
removeSinks() {
|
|
28
|
+
this.sinks = [];
|
|
29
|
+
}
|
|
30
|
+
debug(logLocation, message, ...args) {
|
|
31
|
+
this.emit('debug', logLocation, message, ...args);
|
|
32
|
+
}
|
|
33
|
+
info(logLocation, message, ...args) {
|
|
34
|
+
this.emit('info', logLocation, message, ...args);
|
|
35
|
+
}
|
|
36
|
+
log(logLocation, message, ...args) {
|
|
37
|
+
this.emit('log', logLocation, message, ...args);
|
|
38
|
+
}
|
|
39
|
+
warn(logLocation, message, ...args) {
|
|
40
|
+
this.emit('warn', logLocation, message, ...args);
|
|
41
|
+
}
|
|
42
|
+
error(logLocation, message, ...args) {
|
|
43
|
+
this.emit('error', logLocation, message, ...args);
|
|
44
|
+
}
|
|
45
|
+
fatal(logLocation, message, ...args) {
|
|
46
|
+
this.emit('fatal', logLocation, message, ...args);
|
|
47
|
+
}
|
|
48
|
+
emit(level, logLocation, message, ...args) {
|
|
49
|
+
this.onLogEvent({
|
|
50
|
+
name: this.name,
|
|
51
|
+
level,
|
|
52
|
+
messages: [
|
|
53
|
+
`${this.assembleLocationPrefix(logLocation)} ${String(message)}`,
|
|
54
|
+
...args
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
onLogEvent(event) {
|
|
59
|
+
this.sinks.forEach((sink)=>{
|
|
60
|
+
sink.ingest(event);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const logger = new Logger();
|
|
65
|
+
function createScopedLogger(location) {
|
|
66
|
+
return {
|
|
67
|
+
debug: (message, ...args)=>{
|
|
68
|
+
logger.debug(location, message, ...args);
|
|
69
|
+
},
|
|
70
|
+
info: (message, ...args)=>{
|
|
71
|
+
logger.info(location, message, ...args);
|
|
72
|
+
},
|
|
73
|
+
log: (message, ...args)=>{
|
|
74
|
+
logger.log(location, message, ...args);
|
|
75
|
+
},
|
|
76
|
+
warn: (message, ...args)=>{
|
|
77
|
+
logger.warn(location, message, ...args);
|
|
78
|
+
},
|
|
79
|
+
error: (message, ...args)=>{
|
|
80
|
+
logger.error(location, message, ...args);
|
|
81
|
+
},
|
|
82
|
+
fatal: (message, ...args)=>{
|
|
83
|
+
logger.fatal(location, message, ...args);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const logLevelSeverity = {
|
|
88
|
+
fatal: 60,
|
|
89
|
+
error: 50,
|
|
90
|
+
warn: 40,
|
|
91
|
+
info: 30,
|
|
92
|
+
debug: 20,
|
|
93
|
+
log: 10
|
|
94
|
+
};
|
|
95
|
+
const consoleMap = {
|
|
96
|
+
debug: (...args)=>{
|
|
97
|
+
console.debug(...args);
|
|
98
|
+
},
|
|
99
|
+
info: (...args)=>{
|
|
100
|
+
console.info(...args);
|
|
101
|
+
},
|
|
102
|
+
log: (...args)=>{
|
|
103
|
+
console.log(...args);
|
|
104
|
+
},
|
|
105
|
+
warn: (...args)=>{
|
|
106
|
+
console.warn(...args);
|
|
107
|
+
},
|
|
108
|
+
error: (...args)=>{
|
|
109
|
+
console.error(...args);
|
|
110
|
+
},
|
|
111
|
+
fatal: (...args)=>{
|
|
112
|
+
console.error(...args);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
class ConsoleLogSink extends logger_LogSink {
|
|
116
|
+
name = 'ConsoleLogSink';
|
|
117
|
+
verbosity;
|
|
118
|
+
constructor(verbosity){
|
|
119
|
+
super();
|
|
120
|
+
this.verbosity = verbosity ?? 'error';
|
|
121
|
+
}
|
|
122
|
+
ingest(event) {
|
|
123
|
+
if (logLevelSeverity[event.level] < logLevelSeverity[this.verbosity]) return;
|
|
124
|
+
consoleMap[event.level](...event.messages);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const lib_logger = Logger;
|
|
128
|
+
export default lib_logger;
|
|
129
|
+
export { ConsoleLogSink, Logger, createScopedLogger, logLevelSeverity, logger, logger_LogSink as LogSink };
|
|
130
|
+
|
|
131
|
+
//# sourceMappingURL=logger.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.mjs","sources":["../src/lib/logger/LogSink.ts","../src/lib/logger/Logger.ts","../src/lib/logger/logging.ts","../src/lib/logger/ConsoleLogSink.ts","../src/lib/logger/index.ts"],"sourcesContent":["import type { LogEvent } from './logging'\n\n/**\n * Abstract base class for log sinks that receive and process log events.\n *\n * @example\n * ```typescript\n * class MyCustomSink extends LogSink {\n * name = 'MyCustomSink'\n *\n * ingest(event: LogEvent): void {\n * // process the event\n * }\n * }\n * ```\n *\n * @public\n */\nabstract class LogSink {\n /** Display name used to identify this sink for addition and removal. */\n abstract name: string\n\n /**\n * Processes an incoming log event.\n *\n * @param event - The log event to process.\n * @returns Nothing.\n */\n abstract ingest(event: LogEvent): void\n}\n\nexport default LogSink\n","import type LogSink from './LogSink'\nimport type { LogEvent, LogLevels } from './logging'\n\n/**\n * Central logger that routes log events through registered {@link LogSink} instances.\n *\n * @example\n * ```typescript\n * import { logger } from '@contentful/optimization-api-client/logger'\n *\n * logger.info('MyModule', 'Application started')\n * ```\n *\n * @public\n */\nexport class Logger {\n /** The logger's identifier, used as the event scope name. */\n readonly name = '@contentful/optimization'\n\n private readonly PREFIX_PARTS = ['Ctfl', 'O10n']\n private readonly DELIMITER = ':'\n private sinks: LogSink[] = []\n\n private assembleLocationPrefix(logLocation: string): string {\n return `[${[...this.PREFIX_PARTS, logLocation].join(this.DELIMITER)}]`\n }\n\n /**\n * Registers a log sink. If a sink with the same name already exists, it is replaced.\n *\n * @param sink - The {@link LogSink} instance to register.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * import { logger, ConsoleLogSink } from '@contentful/optimization-api-client/logger'\n *\n * logger.addSink(new ConsoleLogSink('debug'))\n * ```\n */\n public addSink(sink: LogSink): void {\n this.sinks = [...this.sinks.filter((existingSink) => existingSink.name !== sink.name), sink]\n }\n\n /**\n * Removes a registered sink by name.\n *\n * @param name - The name of the sink to remove.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.removeSink('ConsoleLogSink')\n * ```\n */\n public removeSink(name: string): void {\n this.sinks = this.sinks.filter((sink) => sink.name !== name)\n }\n\n /**\n * Removes all registered sinks.\n *\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.removeSinks()\n * ```\n */\n public removeSinks(): void {\n this.sinks = []\n }\n\n /**\n * Logs a message at the debug level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.debug('MyModule', 'Debugging value', someVariable)\n * ```\n */\n public debug(logLocation: string, message: string, ...args: unknown[]): void {\n this.emit('debug', logLocation, message, ...args)\n }\n\n /**\n * Logs a message at the info level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.info('MyModule', 'Operation completed')\n * ```\n */\n public info(logLocation: string, message: string, ...args: unknown[]): void {\n this.emit('info', logLocation, message, ...args)\n }\n\n /**\n * Logs a message at the log level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.log('MyModule', 'General log entry')\n * ```\n */\n public log(logLocation: string, message: string, ...args: unknown[]): void {\n this.emit('log', logLocation, message, ...args)\n }\n\n /**\n * Logs a message at the warn level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.warn('MyModule', 'Deprecated method called')\n * ```\n */\n public warn(logLocation: string, message: string, ...args: unknown[]): void {\n this.emit('warn', logLocation, message, ...args)\n }\n\n /**\n * Logs a message at the error level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message or Error object.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.error('MyModule', new Error('Something failed'))\n * ```\n */\n public error(logLocation: string, message: string | Error, ...args: unknown[]): void {\n this.emit('error', logLocation, message, ...args)\n }\n\n /**\n * Logs a message at the fatal level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message or Error object.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.fatal('MyModule', new Error('Unrecoverable failure'))\n * ```\n */\n public fatal(logLocation: string, message: string | Error, ...args: unknown[]): void {\n this.emit('fatal', logLocation, message, ...args)\n }\n\n private emit(\n level: LogLevels,\n logLocation: string,\n message: string | Error,\n ...args: unknown[]\n ): void {\n this.onLogEvent({\n name: this.name,\n level,\n messages: [`${this.assembleLocationPrefix(logLocation)} ${String(message)}`, ...args],\n })\n }\n\n private onLogEvent(event: LogEvent): void {\n this.sinks.forEach((sink) => {\n sink.ingest(event)\n })\n }\n}\n\n/**\n * Shared singleton {@link Logger} instance used across the SDK.\n *\n * @public\n */\nexport const logger = new Logger()\n\n/**\n * A location-scoped logger interface whose methods omit the `logLocation` parameter.\n *\n * @public\n */\nexport interface ScopedLogger {\n /** Logs at debug level. */\n debug: (message: string, ...args: unknown[]) => void\n /** Logs at info level. */\n info: (message: string, ...args: unknown[]) => void\n /** Logs at log level. */\n log: (message: string, ...args: unknown[]) => void\n /** Logs at warn level. */\n warn: (message: string, ...args: unknown[]) => void\n /** Logs at error level. */\n error: (message: string | Error, ...args: unknown[]) => void\n /** Logs at fatal level. */\n fatal: (message: string | Error, ...args: unknown[]) => void\n}\n\n/**\n * Creates a {@link ScopedLogger} that automatically prepends the given location to every log call.\n *\n * @param location - The module or component identifier to prepend.\n * @returns A {@link ScopedLogger} bound to the specified location.\n *\n * @example\n * ```typescript\n * import { createScopedLogger } from '@contentful/optimization-api-client/logger'\n *\n * const log = createScopedLogger('MyModule')\n * log.info('Initialization complete')\n * ```\n *\n * @public\n */\nexport function createScopedLogger(location: string): ScopedLogger {\n return {\n debug: (message: string, ...args: unknown[]) => {\n logger.debug(location, message, ...args)\n },\n info: (message: string, ...args: unknown[]) => {\n logger.info(location, message, ...args)\n },\n log: (message: string, ...args: unknown[]) => {\n logger.log(location, message, ...args)\n },\n warn: (message: string, ...args: unknown[]) => {\n logger.warn(location, message, ...args)\n },\n error: (message: string | Error, ...args: unknown[]) => {\n logger.error(location, message, ...args)\n },\n fatal: (message: string | Error, ...args: unknown[]) => {\n logger.fatal(location, message, ...args)\n },\n }\n}\n","/**\n * Supported log levels ordered from highest to lowest severity.\n *\n * @public\n */\nexport type LogLevels = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'log'\n\n/**\n * A log event emitted by the logger package.\n *\n * @public\n */\nexport interface LogEvent {\n /** Logger scope name. */\n name: string\n /** Event severity level. */\n level: LogLevels\n /** Event payload, where the first entry is the formatted message. */\n messages: unknown[]\n /** Optional additional context attached by sinks or middleware. */\n [other: string]: unknown\n}\n\n/**\n * Numeric severity map used for log-level threshold comparisons.\n *\n * @public\n */\nexport const logLevelSeverity: Readonly<Record<LogLevels, number>> = {\n fatal: 60,\n error: 50,\n warn: 40,\n info: 30,\n debug: 20,\n log: 10,\n}\n","/* eslint-disable no-console -- using console */\nimport { logLevelSeverity, type LogEvent, type LogLevels } from './logging'\nimport LogSink from './LogSink'\n\nconst consoleMap = {\n debug: (...args: unknown[]) => {\n console.debug(...args)\n },\n info: (...args: unknown[]) => {\n console.info(...args)\n },\n log: (...args: unknown[]) => {\n console.log(...args)\n },\n warn: (...args: unknown[]) => {\n console.warn(...args)\n },\n error: (...args: unknown[]) => {\n console.error(...args)\n },\n fatal: (...args: unknown[]) => {\n console.error(...args)\n },\n}\n\n/**\n * A {@link LogSink} that writes log events to the browser or Node.js console,\n * filtering by a configurable verbosity threshold.\n *\n * @example\n * ```typescript\n * import { logger, ConsoleLogSink } from '@contentful/optimization-api-client/logger'\n *\n * logger.addSink(new ConsoleLogSink('debug'))\n * ```\n *\n * @public\n */\nexport class ConsoleLogSink extends LogSink {\n /** Identifies this sink when registered with the {@link Logger}. */\n public name = 'ConsoleLogSink'\n\n /**\n * Minimum log level required for events to be output.\n *\n * @defaultValue 'error'\n */\n readonly verbosity: LogLevels\n\n /**\n * Creates a new ConsoleLogSink.\n *\n * @param verbosity - Minimum log level to output.\n */\n constructor(verbosity?: LogLevels) {\n super()\n\n this.verbosity = verbosity ?? 'error'\n }\n\n /**\n * Writes a log event to the console if its level meets the verbosity threshold.\n *\n * @param event - The log event to process.\n * @returns Nothing.\n */\n ingest(event: LogEvent): void {\n if (logLevelSeverity[event.level] < logLevelSeverity[this.verbosity]) return\n\n consoleMap[event.level](...event.messages)\n }\n}\n","import LogSink from './LogSink'\nimport { Logger } from './Logger'\n\nexport * from './ConsoleLogSink'\nexport * from './LogSink'\nexport * from './Logger'\nexport * from './logging'\n\nexport { LogSink }\nexport default Logger\n"],"names":["LogSink","Logger","logLocation","sink","existingSink","name","message","args","level","String","event","logger","createScopedLogger","location","logLevelSeverity","consoleMap","console","ConsoleLogSink","verbosity"],"mappings":"AAkBA,MAAeA;AAWf;AAEA,uBAAeA;AChBR,MAAMC;IAEF,OAAO,2BAA0B;IAEzB,eAAe;QAAC;QAAQ;KAAO;IAC/B,YAAY,IAAG;IACxB,QAAmB,EAAE;IAErB,uBAAuBC,WAAmB,EAAU;QAC1D,OAAO,CAAC,CAAC,EAAE;eAAI,IAAI,CAAC,YAAY;YAAEA;SAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACxE;IAeO,QAAQC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AOrB,UAAoB;IAO7B,YAAYkB,SAAqB,CAAE;QACjC,KAAK;QAEL,IAAI,CAAC,SAAS,GAAGA,aAAa;IAChC;IAQA,OAAOR,KAAe,EAAQ;QAC5B,IAAII,gBAAgB,CAACJ,MAAM,KAAK,CAAC,GAAGI,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QAEtEC,UAAU,CAACL,MAAM,KAAK,CAAC,IAAIA,MAAM,QAAQ;IAC3C;AACF;AC9DA,mBAAeT"}
|
package/dist/u~0.mjs
ADDED
package/dist/u~0.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"u~0.mjs","sources":["../src/schemas/experience/change/isVariableChange.ts"],"sourcesContent":["import type { Change, VariableChange } from './Change'\n\n/**\n * Determines whether a change represents a variable-backed optimization.\n *\n * @public\n */\nexport function isVariableChange(change: Change): change is VariableChange {\n return change.type === 'Variable'\n}\n"],"names":["isVariableChange","change"],"mappings":"AAOO,SAASA,iBAAiBC,MAAc;IAC7C,OAAOA,AAAgB,eAAhBA,OAAO,IAAI;AACpB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/optimization-api-client",
|
|
3
3
|
"description": "API client for Contentful Optimization services",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -33,6 +33,16 @@
|
|
|
33
33
|
"default": "./dist/logger.cjs"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
+
"./guards": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./dist/guards.d.mts",
|
|
39
|
+
"default": "./dist/guards.mjs"
|
|
40
|
+
},
|
|
41
|
+
"require": {
|
|
42
|
+
"types": "./dist/guards.d.cts",
|
|
43
|
+
"default": "./dist/guards.cjs"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
36
46
|
"./api-schemas": {
|
|
37
47
|
"import": {
|
|
38
48
|
"types": "./dist/api-schemas.d.mts",
|
|
@@ -52,12 +62,39 @@
|
|
|
52
62
|
"buildTools": {
|
|
53
63
|
"bundleSize": {
|
|
54
64
|
"gzipBudgets": {
|
|
65
|
+
"guards.cjs": 550,
|
|
66
|
+
"guards.mjs": 200,
|
|
55
67
|
"index.cjs": 5000,
|
|
56
68
|
"index.mjs": 4700
|
|
57
69
|
}
|
|
58
70
|
}
|
|
59
71
|
},
|
|
60
72
|
"dependencies": {
|
|
61
|
-
"
|
|
73
|
+
"zod": "^4.3.6"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"build-tools": "0.0.0",
|
|
77
|
+
"@microsoft/api-extractor": "^7.59.1",
|
|
78
|
+
"@rsdoctor/cli": "^1.6.4",
|
|
79
|
+
"@rslib/core": "^1.0.1",
|
|
80
|
+
"@types/node": "^24.0.13",
|
|
81
|
+
"@rstest/core": "^0.12.0",
|
|
82
|
+
"@rstest/coverage-istanbul": "^0.12.0",
|
|
83
|
+
"mocks": "0.0.0",
|
|
84
|
+
"msw": "^2.12.10",
|
|
85
|
+
"rimraf": "^6.1.3",
|
|
86
|
+
"tslib": "^2.8.1",
|
|
87
|
+
"typescript": "^5.8.3"
|
|
88
|
+
},
|
|
89
|
+
"scripts": {
|
|
90
|
+
"build": "pnpm clean; pnpm build:dist",
|
|
91
|
+
"build:ci": "pnpm build:dist",
|
|
92
|
+
"build:dist": "rslib build && build-tools emit-dual-dts ./dist",
|
|
93
|
+
"build:rsdoctor": "RSDOCTOR=true rslib build && build-tools emit-dual-dts ./dist",
|
|
94
|
+
"clean": "rimraf ./.rsdoctor ./.rslib ./.rstack ./dist ./coverage .tsbuildinfo ./node_modules/.cache/rspack",
|
|
95
|
+
"size:check": "pnpm build:dist && build-tools bundle-size",
|
|
96
|
+
"size:report": "build-tools bundle-size --report-only",
|
|
97
|
+
"test:unit": "rstest run --coverage",
|
|
98
|
+
"typecheck": "tsc --noEmit"
|
|
62
99
|
}
|
|
63
100
|
}
|
package/dist/199.mjs
DELETED
package/dist/649.mjs
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
class LogSink {
|
|
2
|
-
}
|
|
3
|
-
const logger_LogSink = LogSink;
|
|
4
|
-
class Logger {
|
|
5
|
-
name = '@contentful/optimization';
|
|
6
|
-
PREFIX_PARTS = [
|
|
7
|
-
'Ctfl',
|
|
8
|
-
'O10n'
|
|
9
|
-
];
|
|
10
|
-
DELIMITER = ':';
|
|
11
|
-
sinks = [];
|
|
12
|
-
assembleLocationPrefix(logLocation) {
|
|
13
|
-
return `[${[
|
|
14
|
-
...this.PREFIX_PARTS,
|
|
15
|
-
logLocation
|
|
16
|
-
].join(this.DELIMITER)}]`;
|
|
17
|
-
}
|
|
18
|
-
addSink(sink) {
|
|
19
|
-
this.sinks = [
|
|
20
|
-
...this.sinks.filter((existingSink)=>existingSink.name !== sink.name),
|
|
21
|
-
sink
|
|
22
|
-
];
|
|
23
|
-
}
|
|
24
|
-
removeSink(name) {
|
|
25
|
-
this.sinks = this.sinks.filter((sink)=>sink.name !== name);
|
|
26
|
-
}
|
|
27
|
-
removeSinks() {
|
|
28
|
-
this.sinks = [];
|
|
29
|
-
}
|
|
30
|
-
debug(logLocation, message, ...args) {
|
|
31
|
-
this.emit('debug', logLocation, message, ...args);
|
|
32
|
-
}
|
|
33
|
-
info(logLocation, message, ...args) {
|
|
34
|
-
this.emit('info', logLocation, message, ...args);
|
|
35
|
-
}
|
|
36
|
-
log(logLocation, message, ...args) {
|
|
37
|
-
this.emit('log', logLocation, message, ...args);
|
|
38
|
-
}
|
|
39
|
-
warn(logLocation, message, ...args) {
|
|
40
|
-
this.emit('warn', logLocation, message, ...args);
|
|
41
|
-
}
|
|
42
|
-
error(logLocation, message, ...args) {
|
|
43
|
-
this.emit('error', logLocation, message, ...args);
|
|
44
|
-
}
|
|
45
|
-
fatal(logLocation, message, ...args) {
|
|
46
|
-
this.emit('fatal', logLocation, message, ...args);
|
|
47
|
-
}
|
|
48
|
-
emit(level, logLocation, message, ...args) {
|
|
49
|
-
this.onLogEvent({
|
|
50
|
-
name: this.name,
|
|
51
|
-
level,
|
|
52
|
-
messages: [
|
|
53
|
-
`${this.assembleLocationPrefix(logLocation)} ${String(message)}`,
|
|
54
|
-
...args
|
|
55
|
-
]
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
onLogEvent(event) {
|
|
59
|
-
this.sinks.forEach((sink)=>{
|
|
60
|
-
sink.ingest(event);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
const logger = new Logger();
|
|
65
|
-
function createScopedLogger(location) {
|
|
66
|
-
return {
|
|
67
|
-
debug: (message, ...args)=>{
|
|
68
|
-
logger.debug(location, message, ...args);
|
|
69
|
-
},
|
|
70
|
-
info: (message, ...args)=>{
|
|
71
|
-
logger.info(location, message, ...args);
|
|
72
|
-
},
|
|
73
|
-
log: (message, ...args)=>{
|
|
74
|
-
logger.log(location, message, ...args);
|
|
75
|
-
},
|
|
76
|
-
warn: (message, ...args)=>{
|
|
77
|
-
logger.warn(location, message, ...args);
|
|
78
|
-
},
|
|
79
|
-
error: (message, ...args)=>{
|
|
80
|
-
logger.error(location, message, ...args);
|
|
81
|
-
},
|
|
82
|
-
fatal: (message, ...args)=>{
|
|
83
|
-
logger.fatal(location, message, ...args);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
const logLevelSeverity = {
|
|
88
|
-
fatal: 60,
|
|
89
|
-
error: 50,
|
|
90
|
-
warn: 40,
|
|
91
|
-
info: 30,
|
|
92
|
-
debug: 20,
|
|
93
|
-
log: 10
|
|
94
|
-
};
|
|
95
|
-
const consoleMap = {
|
|
96
|
-
debug: (...args)=>{
|
|
97
|
-
console.debug(...args);
|
|
98
|
-
},
|
|
99
|
-
info: (...args)=>{
|
|
100
|
-
console.info(...args);
|
|
101
|
-
},
|
|
102
|
-
log: (...args)=>{
|
|
103
|
-
console.log(...args);
|
|
104
|
-
},
|
|
105
|
-
warn: (...args)=>{
|
|
106
|
-
console.warn(...args);
|
|
107
|
-
},
|
|
108
|
-
error: (...args)=>{
|
|
109
|
-
console.error(...args);
|
|
110
|
-
},
|
|
111
|
-
fatal: (...args)=>{
|
|
112
|
-
console.error(...args);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
class ConsoleLogSink extends logger_LogSink {
|
|
116
|
-
name = 'ConsoleLogSink';
|
|
117
|
-
verbosity;
|
|
118
|
-
constructor(verbosity){
|
|
119
|
-
super();
|
|
120
|
-
this.verbosity = verbosity ?? 'error';
|
|
121
|
-
}
|
|
122
|
-
ingest(event) {
|
|
123
|
-
if (logLevelSeverity[event.level] < logLevelSeverity[this.verbosity]) return;
|
|
124
|
-
consoleMap[event.level](...event.messages);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
const lib_logger = Logger;
|
|
128
|
-
export default lib_logger;
|
|
129
|
-
export { ConsoleLogSink, Logger, createScopedLogger, logLevelSeverity, logger, logger_LogSink as LogSink };
|
|
130
|
-
|
|
131
|
-
//# sourceMappingURL=649.mjs.map
|
package/dist/649.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"649.mjs","sources":["../src/lib/logger/LogSink.ts","../src/lib/logger/Logger.ts","../src/lib/logger/logging.ts","../src/lib/logger/ConsoleLogSink.ts","../src/lib/logger/index.ts"],"sourcesContent":["import type { LogEvent } from './logging'\n\n/**\n * Abstract base class for log sinks that receive and process log events.\n *\n * @example\n * ```typescript\n * class MyCustomSink extends LogSink {\n * name = 'MyCustomSink'\n *\n * ingest(event: LogEvent): void {\n * // process the event\n * }\n * }\n * ```\n *\n * @public\n */\nabstract class LogSink {\n /** Display name used to identify this sink for addition and removal. */\n abstract name: string\n\n /**\n * Processes an incoming log event.\n *\n * @param event - The log event to process.\n * @returns Nothing.\n */\n abstract ingest(event: LogEvent): void\n}\n\nexport default LogSink\n","import type LogSink from './LogSink'\nimport type { LogEvent, LogLevels } from './logging'\n\n/**\n * Central logger that routes log events through registered {@link LogSink} instances.\n *\n * @example\n * ```typescript\n * import { logger } from '@contentful/optimization-api-client/logger'\n *\n * logger.info('MyModule', 'Application started')\n * ```\n *\n * @public\n */\nexport class Logger {\n /** The logger's identifier, used as the event scope name. */\n readonly name = '@contentful/optimization'\n\n private readonly PREFIX_PARTS = ['Ctfl', 'O10n']\n private readonly DELIMITER = ':'\n private sinks: LogSink[] = []\n\n private assembleLocationPrefix(logLocation: string): string {\n return `[${[...this.PREFIX_PARTS, logLocation].join(this.DELIMITER)}]`\n }\n\n /**\n * Registers a log sink. If a sink with the same name already exists, it is replaced.\n *\n * @param sink - The {@link LogSink} instance to register.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * import { logger, ConsoleLogSink } from '@contentful/optimization-api-client/logger'\n *\n * logger.addSink(new ConsoleLogSink('debug'))\n * ```\n */\n public addSink(sink: LogSink): void {\n this.sinks = [...this.sinks.filter((existingSink) => existingSink.name !== sink.name), sink]\n }\n\n /**\n * Removes a registered sink by name.\n *\n * @param name - The name of the sink to remove.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.removeSink('ConsoleLogSink')\n * ```\n */\n public removeSink(name: string): void {\n this.sinks = this.sinks.filter((sink) => sink.name !== name)\n }\n\n /**\n * Removes all registered sinks.\n *\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.removeSinks()\n * ```\n */\n public removeSinks(): void {\n this.sinks = []\n }\n\n /**\n * Logs a message at the debug level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.debug('MyModule', 'Debugging value', someVariable)\n * ```\n */\n public debug(logLocation: string, message: string, ...args: unknown[]): void {\n this.emit('debug', logLocation, message, ...args)\n }\n\n /**\n * Logs a message at the info level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.info('MyModule', 'Operation completed')\n * ```\n */\n public info(logLocation: string, message: string, ...args: unknown[]): void {\n this.emit('info', logLocation, message, ...args)\n }\n\n /**\n * Logs a message at the log level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.log('MyModule', 'General log entry')\n * ```\n */\n public log(logLocation: string, message: string, ...args: unknown[]): void {\n this.emit('log', logLocation, message, ...args)\n }\n\n /**\n * Logs a message at the warn level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.warn('MyModule', 'Deprecated method called')\n * ```\n */\n public warn(logLocation: string, message: string, ...args: unknown[]): void {\n this.emit('warn', logLocation, message, ...args)\n }\n\n /**\n * Logs a message at the error level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message or Error object.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.error('MyModule', new Error('Something failed'))\n * ```\n */\n public error(logLocation: string, message: string | Error, ...args: unknown[]): void {\n this.emit('error', logLocation, message, ...args)\n }\n\n /**\n * Logs a message at the fatal level.\n *\n * @param logLocation - The module or component identifier.\n * @param message - The log message or Error object.\n * @param args - Additional arguments forwarded in the log event.\n * @returns Nothing.\n *\n * @example\n * ```typescript\n * logger.fatal('MyModule', new Error('Unrecoverable failure'))\n * ```\n */\n public fatal(logLocation: string, message: string | Error, ...args: unknown[]): void {\n this.emit('fatal', logLocation, message, ...args)\n }\n\n private emit(\n level: LogLevels,\n logLocation: string,\n message: string | Error,\n ...args: unknown[]\n ): void {\n this.onLogEvent({\n name: this.name,\n level,\n messages: [`${this.assembleLocationPrefix(logLocation)} ${String(message)}`, ...args],\n })\n }\n\n private onLogEvent(event: LogEvent): void {\n this.sinks.forEach((sink) => {\n sink.ingest(event)\n })\n }\n}\n\n/**\n * Shared singleton {@link Logger} instance used across the SDK.\n *\n * @public\n */\nexport const logger = new Logger()\n\n/**\n * A location-scoped logger interface whose methods omit the `logLocation` parameter.\n *\n * @public\n */\nexport interface ScopedLogger {\n /** Logs at debug level. */\n debug: (message: string, ...args: unknown[]) => void\n /** Logs at info level. */\n info: (message: string, ...args: unknown[]) => void\n /** Logs at log level. */\n log: (message: string, ...args: unknown[]) => void\n /** Logs at warn level. */\n warn: (message: string, ...args: unknown[]) => void\n /** Logs at error level. */\n error: (message: string | Error, ...args: unknown[]) => void\n /** Logs at fatal level. */\n fatal: (message: string | Error, ...args: unknown[]) => void\n}\n\n/**\n * Creates a {@link ScopedLogger} that automatically prepends the given location to every log call.\n *\n * @param location - The module or component identifier to prepend.\n * @returns A {@link ScopedLogger} bound to the specified location.\n *\n * @example\n * ```typescript\n * import { createScopedLogger } from '@contentful/optimization-api-client/logger'\n *\n * const log = createScopedLogger('MyModule')\n * log.info('Initialization complete')\n * ```\n *\n * @public\n */\nexport function createScopedLogger(location: string): ScopedLogger {\n return {\n debug: (message: string, ...args: unknown[]) => {\n logger.debug(location, message, ...args)\n },\n info: (message: string, ...args: unknown[]) => {\n logger.info(location, message, ...args)\n },\n log: (message: string, ...args: unknown[]) => {\n logger.log(location, message, ...args)\n },\n warn: (message: string, ...args: unknown[]) => {\n logger.warn(location, message, ...args)\n },\n error: (message: string | Error, ...args: unknown[]) => {\n logger.error(location, message, ...args)\n },\n fatal: (message: string | Error, ...args: unknown[]) => {\n logger.fatal(location, message, ...args)\n },\n }\n}\n","/**\n * Supported log levels ordered from highest to lowest severity.\n *\n * @public\n */\nexport type LogLevels = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'log'\n\n/**\n * A log event emitted by the logger package.\n *\n * @public\n */\nexport interface LogEvent {\n /** Logger scope name. */\n name: string\n /** Event severity level. */\n level: LogLevels\n /** Event payload, where the first entry is the formatted message. */\n messages: unknown[]\n /** Optional additional context attached by sinks or middleware. */\n [other: string]: unknown\n}\n\n/**\n * Numeric severity map used for log-level threshold comparisons.\n *\n * @public\n */\nexport const logLevelSeverity: Readonly<Record<LogLevels, number>> = {\n fatal: 60,\n error: 50,\n warn: 40,\n info: 30,\n debug: 20,\n log: 10,\n}\n","/* eslint-disable no-console -- using console */\nimport { logLevelSeverity, type LogEvent, type LogLevels } from './logging'\nimport LogSink from './LogSink'\n\nconst consoleMap = {\n debug: (...args: unknown[]) => {\n console.debug(...args)\n },\n info: (...args: unknown[]) => {\n console.info(...args)\n },\n log: (...args: unknown[]) => {\n console.log(...args)\n },\n warn: (...args: unknown[]) => {\n console.warn(...args)\n },\n error: (...args: unknown[]) => {\n console.error(...args)\n },\n fatal: (...args: unknown[]) => {\n console.error(...args)\n },\n}\n\n/**\n * A {@link LogSink} that writes log events to the browser or Node.js console,\n * filtering by a configurable verbosity threshold.\n *\n * @example\n * ```typescript\n * import { logger, ConsoleLogSink } from '@contentful/optimization-api-client/logger'\n *\n * logger.addSink(new ConsoleLogSink('debug'))\n * ```\n *\n * @public\n */\nexport class ConsoleLogSink extends LogSink {\n /** Identifies this sink when registered with the {@link Logger}. */\n public name = 'ConsoleLogSink'\n\n /**\n * Minimum log level required for events to be output.\n *\n * @defaultValue 'error'\n */\n readonly verbosity: LogLevels\n\n /**\n * Creates a new ConsoleLogSink.\n *\n * @param verbosity - Minimum log level to output.\n */\n constructor(verbosity?: LogLevels) {\n super()\n\n this.verbosity = verbosity ?? 'error'\n }\n\n /**\n * Writes a log event to the console if its level meets the verbosity threshold.\n *\n * @param event - The log event to process.\n * @returns Nothing.\n */\n ingest(event: LogEvent): void {\n if (logLevelSeverity[event.level] < logLevelSeverity[this.verbosity]) return\n\n consoleMap[event.level](...event.messages)\n }\n}\n","import LogSink from './LogSink'\nimport { Logger } from './Logger'\n\nexport * from './ConsoleLogSink'\nexport * from './LogSink'\nexport * from './Logger'\nexport * from './logging'\n\nexport { LogSink }\nexport default Logger\n"],"names":["LogSink","Logger","logLocation","sink","existingSink","name","message","args","level","String","event","logger","createScopedLogger","location","logLevelSeverity","consoleMap","console","ConsoleLogSink","verbosity"],"mappings":"AAkBA,MAAeA;AAWf;AAEA,uBAAeA;AChBR,MAAMC;IAEF,OAAO,2BAA0B;IAEzB,eAAe;QAAC;QAAQ;KAAO;IAC/B,YAAY,IAAG;IACxB,QAAmB,EAAE;IAErB,uBAAuBC,WAAmB,EAAU;QAC1D,OAAO,CAAC,CAAC,EAAE;eAAI,IAAI,CAAC,YAAY;YAAEA;SAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACxE;IAeO,QAAQC,IAAa,EAAQ;QAClC,IAAI,CAAC,KAAK,GAAG;eAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAACC,eAAiBA,aAAa,IAAI,KAAKD,KAAK,IAAI;YAAGA;SAAK;IAC9F;IAaO,WAAWE,IAAY,EAAQ;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAACF,OAASA,KAAK,IAAI,KAAKE;IACzD;IAYO,cAAoB;QACzB,IAAI,CAAC,KAAK,GAAG,EAAE;IACjB;IAeO,MAAMH,WAAmB,EAAEI,OAAe,EAAE,GAAGC,IAAe,EAAQ;QAC3E,IAAI,CAAC,IAAI,CAAC,SAASL,aAAaI,YAAYC;IAC9C;IAeO,KAAKL,WAAmB,EAAEI,OAAe,EAAE,GAAGC,IAAe,EAAQ;QAC1E,IAAI,CAAC,IAAI,CAAC,QAAQL,aAAaI,YAAYC;IAC7C;IAeO,IAAIL,WAAmB,EAAEI,OAAe,EAAE,GAAGC,IAAe,EAAQ;QACzE,IAAI,CAAC,IAAI,CAAC,OAAOL,aAAaI,YAAYC;IAC5C;IAeO,KAAKL,WAAmB,EAAEI,OAAe,EAAE,GAAGC,IAAe,EAAQ;QAC1E,IAAI,CAAC,IAAI,C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