@xtr-dev/payload-automation 0.0.3 → 0.0.4
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/dist/plugin/logger.js
CHANGED
|
@@ -5,25 +5,25 @@ let pluginLogger = null;
|
|
|
5
5
|
* Uses console with plugin prefix since Payload logger isn't available yet
|
|
6
6
|
*/ const configLogger = {
|
|
7
7
|
debug: (message, ...args)=>{
|
|
8
|
-
if (!process.env.
|
|
8
|
+
if (!process.env.PAYLOAD_AUTOMATION_CONFIG_LOGGING) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
console.log(`[payload-automation] ${message}`, ...args);
|
|
12
12
|
},
|
|
13
13
|
error: (message, ...args)=>{
|
|
14
|
-
if (!process.env.
|
|
14
|
+
if (!process.env.PAYLOAD_AUTOMATION_CONFIG_LOGGING) {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
console.error(`[payload-automation] ${message}`, ...args);
|
|
18
18
|
},
|
|
19
19
|
info: (message, ...args)=>{
|
|
20
|
-
if (!process.env.
|
|
20
|
+
if (!process.env.PAYLOAD_AUTOMATION_CONFIG_LOGGING) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
console.log(`[payload-automation] ${message}`, ...args);
|
|
24
24
|
},
|
|
25
25
|
warn: (message, ...args)=>{
|
|
26
|
-
if (!process.env.
|
|
26
|
+
if (!process.env.PAYLOAD_AUTOMATION_CONFIG_LOGGING) {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
console.warn(`[payload-automation] ${message}`, ...args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugin/logger.ts"],"sourcesContent":["import type { Payload } from 'payload'\n\n// Global logger instance - use Payload's logger type\nlet pluginLogger: null | Payload['logger'] = null\n\n/**\n * Simple config-time logger for use during plugin configuration\n * Uses console with plugin prefix since Payload logger isn't available yet\n */\nconst configLogger = {\n debug: <T>(message: string, ...args: T[]) => {\n if (!process.env.
|
|
1
|
+
{"version":3,"sources":["../../src/plugin/logger.ts"],"sourcesContent":["import type { Payload } from 'payload'\n\n// Global logger instance - use Payload's logger type\nlet pluginLogger: null | Payload['logger'] = null\n\n/**\n * Simple config-time logger for use during plugin configuration\n * Uses console with plugin prefix since Payload logger isn't available yet\n */\nconst configLogger = {\n debug: <T>(message: string, ...args: T[]) => {\n if (!process.env.PAYLOAD_AUTOMATION_CONFIG_LOGGING) {return}\n console.log(`[payload-automation] ${message}`, ...args)\n },\n error: <T>(message: string, ...args: T[]) => {\n if (!process.env.PAYLOAD_AUTOMATION_CONFIG_LOGGING) {return}\n console.error(`[payload-automation] ${message}`, ...args)\n },\n info: <T>(message: string, ...args: T[]) => {\n if (!process.env.PAYLOAD_AUTOMATION_CONFIG_LOGGING) {return}\n console.log(`[payload-automation] ${message}`, ...args)\n },\n warn: <T>(message: string, ...args: T[]) => {\n if (!process.env.PAYLOAD_AUTOMATION_CONFIG_LOGGING) {return}\n console.warn(`[payload-automation] ${message}`, ...args)\n }\n}\n\n/**\n * Get a logger for config-time use (before Payload initialization)\n */\nexport function getConfigLogger() {\n return configLogger\n}\n\n/**\n * Initialize the plugin logger using Payload's Pino instance\n * This creates a child logger with plugin identification\n */\nexport function initializeLogger(payload: Payload): Payload['logger'] {\n // Create a child logger with plugin identification\n pluginLogger = payload.logger.child({\n level: process.env.PAYLOAD_AUTOMATION_LOGGING || 'silent',\n plugin: '@xtr-dev/payload-automation'\n })\n return pluginLogger\n}\n\n/**\n * Get the plugin logger instance\n * Throws error if not initialized\n */\nexport function getLogger(): Payload['logger'] {\n if (!pluginLogger) {\n throw new Error('@xtr-dev/payload-automation: Logger not initialized. Make sure the plugin is properly configured.')\n }\n\n return pluginLogger\n}\n"],"names":["pluginLogger","configLogger","debug","message","args","process","env","PAYLOAD_AUTOMATION_CONFIG_LOGGING","console","log","error","info","warn","getConfigLogger","initializeLogger","payload","logger","child","level","PAYLOAD_AUTOMATION_LOGGING","plugin","getLogger","Error"],"mappings":"AAEA,qDAAqD;AACrD,IAAIA,eAAyC;AAE7C;;;CAGC,GACD,MAAMC,eAAe;IACnBC,OAAO,CAAIC,SAAiB,GAAGC;QAC7B,IAAI,CAACC,QAAQC,GAAG,CAACC,iCAAiC,EAAE;YAAC;QAAM;QAC3DC,QAAQC,GAAG,CAAC,CAAC,qBAAqB,EAAEN,SAAS,KAAKC;IACpD;IACAM,OAAO,CAAIP,SAAiB,GAAGC;QAC7B,IAAI,CAACC,QAAQC,GAAG,CAACC,iCAAiC,EAAE;YAAC;QAAM;QAC3DC,QAAQE,KAAK,CAAC,CAAC,qBAAqB,EAAEP,SAAS,KAAKC;IACtD;IACAO,MAAM,CAAIR,SAAiB,GAAGC;QAC5B,IAAI,CAACC,QAAQC,GAAG,CAACC,iCAAiC,EAAE;YAAC;QAAM;QAC3DC,QAAQC,GAAG,CAAC,CAAC,qBAAqB,EAAEN,SAAS,KAAKC;IACpD;IACAQ,MAAM,CAAIT,SAAiB,GAAGC;QAC5B,IAAI,CAACC,QAAQC,GAAG,CAACC,iCAAiC,EAAE;YAAC;QAAM;QAC3DC,QAAQI,IAAI,CAAC,CAAC,qBAAqB,EAAET,SAAS,KAAKC;IACrD;AACF;AAEA;;CAEC,GACD,OAAO,SAASS;IACd,OAAOZ;AACT;AAEA;;;CAGC,GACD,OAAO,SAASa,iBAAiBC,OAAgB;IAC/C,mDAAmD;IACnDf,eAAee,QAAQC,MAAM,CAACC,KAAK,CAAC;QAClCC,OAAOb,QAAQC,GAAG,CAACa,0BAA0B,IAAI;QACjDC,QAAQ;IACV;IACA,OAAOpB;AACT;AAEA;;;CAGC,GACD,OAAO,SAASqB;IACd,IAAI,CAACrB,cAAc;QACjB,MAAM,IAAIsB,MAAM;IAClB;IAEA,OAAOtB;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xtr-dev/payload-automation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "PayloadCMS Automation Plugin - Comprehensive workflow automation system with visual workflow building, execution tracking, and step types",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|