@xtr-dev/payload-automation 0.0.27 → 0.0.29

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.
@@ -36,7 +36,7 @@ export const createWorkflowCollection = ({ collectionTriggers, steps, triggers }
36
36
  type: 'ui',
37
37
  admin: {
38
38
  components: {
39
- Field: '@/components/WorkflowExecutionStatus'
39
+ Field: '../components/WorkflowExecutionStatus'
40
40
  },
41
41
  condition: (data)=>!!data?.id // Only show for existing workflows
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/Workflow.ts"],"sourcesContent":["import type {CollectionConfig, Field} from 'payload'\n\nimport type {WorkflowsPluginConfig} from \"../plugin/config-types.js\"\n\nexport const createWorkflowCollection: <T extends string>(options: WorkflowsPluginConfig<T>) => CollectionConfig = ({\n collectionTriggers,\n steps,\n triggers\n }) => ({\n slug: 'workflows',\n access: {\n create: () => true,\n delete: () => true,\n read: () => true,\n update: () => true,\n },\n admin: {\n defaultColumns: ['name', 'updatedAt'],\n description: 'Create and manage automated workflows.',\n group: 'Automation',\n useAsTitle: 'name',\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n admin: {\n description: 'Human-readable name for the workflow',\n },\n required: true,\n },\n {\n name: 'description',\n type: 'textarea',\n admin: {\n description: 'Optional description of what this workflow does',\n },\n },\n {\n name: 'executionStatus',\n type: 'ui',\n admin: {\n components: {\n Field: '@/components/WorkflowExecutionStatus'\n },\n condition: (data) => !!data?.id // Only show for existing workflows\n }\n },\n {\n name: 'triggers',\n type: 'array',\n fields: [\n {\n name: 'type',\n type: 'select',\n options: [\n 'collection-trigger',\n 'webhook-trigger',\n 'global-trigger',\n 'cron-trigger',\n ...(triggers || []).map(t => t.slug)\n ]\n },\n {\n name: 'parameters',\n type: 'json',\n admin: {\n hidden: true,\n },\n defaultValue: {}\n },\n // Virtual fields for collection trigger\n {\n name: '__builtin_collectionSlug',\n type: 'select',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'collection-trigger',\n description: 'Collection that triggers the workflow',\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.collectionSlug || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.collectionSlug = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n options: Object.keys(collectionTriggers || {}),\n virtual: true,\n },\n {\n name: '__builtin_operation',\n type: 'select',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'collection-trigger',\n description: 'Collection operation that triggers the workflow',\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.operation || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.operation = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n options: [\n 'create',\n 'delete',\n 'read',\n 'update',\n ],\n virtual: true,\n },\n // Virtual fields for webhook trigger\n {\n name: '__builtin_webhookPath',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'webhook-trigger',\n description: 'URL path for the webhook (e.g., \"my-webhook\"). Full URL will be /api/workflows-webhook/my-webhook',\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.webhookPath || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.webhookPath = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n validate: (value: any, {siblingData}: any) => {\n if (siblingData?.type === 'webhook-trigger' && !value && !siblingData?.parameters?.webhookPath) {\n return 'Webhook path is required for webhook triggers'\n }\n return true\n },\n virtual: true,\n },\n // Virtual fields for global trigger\n {\n name: '__builtin_global',\n type: 'select',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'global-trigger',\n description: 'Global that triggers the workflow',\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.global || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.global = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n options: [], // Will be populated dynamically based on available globals\n virtual: true,\n },\n {\n name: '__builtin_globalOperation',\n type: 'select',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'global-trigger',\n description: 'Global operation that triggers the workflow',\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.globalOperation || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.globalOperation = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n options: [\n 'update'\n ],\n virtual: true,\n },\n // Virtual fields for cron trigger\n {\n name: '__builtin_cronExpression',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'cron-trigger',\n description: 'Cron expression for scheduled execution (e.g., \"0 0 * * *\" for daily at midnight)',\n placeholder: '0 0 * * *'\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.cronExpression || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.cronExpression = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n validate: (value: any, {siblingData}: any) => {\n const cronValue = value || siblingData?.parameters?.cronExpression\n if (siblingData?.type === 'cron-trigger' && !cronValue) {\n return 'Cron expression is required for cron triggers'\n }\n\n // Validate cron expression format if provided\n if (siblingData?.type === 'cron-trigger' && cronValue) {\n // Basic format validation - should be 5 parts separated by spaces\n const cronParts = cronValue.trim().split(/\\s+/)\n if (cronParts.length !== 5) {\n return 'Invalid cron expression format. Expected 5 parts: \"minute hour day month weekday\" (e.g., \"0 9 * * 1\")'\n }\n\n // Additional validation could use node-cron but we avoid dynamic imports here\n // The main validation happens at runtime in the cron scheduler\n }\n\n return true\n },\n virtual: true,\n },\n {\n name: '__builtin_timezone',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'cron-trigger',\n description: 'Timezone for cron execution (e.g., \"America/New_York\", \"Europe/London\"). Defaults to UTC.',\n placeholder: 'UTC'\n },\n defaultValue: 'UTC',\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.timezone || 'UTC'\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.timezone = value || 'UTC'\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n validate: (value: any, {siblingData}: any) => {\n const tzValue = value || siblingData?.parameters?.timezone\n if (siblingData?.type === 'cron-trigger' && tzValue) {\n try {\n // Test if timezone is valid by trying to create a date with it\n new Intl.DateTimeFormat('en', {timeZone: tzValue})\n return true\n } catch {\n return `Invalid timezone: ${tzValue}. Please use a valid IANA timezone identifier (e.g., \"America/New_York\", \"Europe/London\")`\n }\n }\n return true\n },\n virtual: true,\n },\n {\n name: 'condition',\n type: 'text',\n admin: {\n description: 'JSONPath expression that must evaluate to true for this trigger to execute the workflow (e.g., \"$.trigger.doc.status == \\'published\\'\")'\n },\n required: false\n },\n // Virtual fields for custom triggers\n // Note: Custom trigger fields from trigger-helpers already have unique names\n // We just need to pass them through without modification\n ...(triggers || []).flatMap(t => (t.inputs || []))\n ]\n },\n {\n name: 'steps',\n type: 'array',\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'step',\n type: 'select',\n options: steps.map(t => t.slug)\n },\n {\n name: 'name',\n type: 'text',\n }\n ]\n },\n ...(steps || []).flatMap(step => (step.inputSchema || []).map(field => ({\n ...field,\n admin: {\n ...(field.admin || {}),\n condition: (...args) => args[1]?.step === step.slug && (\n field.admin?.condition ?\n field.admin.condition.call(this, ...args) :\n true\n ),\n },\n } as Field))),\n {\n name: 'dependencies',\n type: 'text',\n admin: {\n description: 'Step names that must complete before this step can run'\n },\n hasMany: true,\n required: false\n },\n {\n name: 'condition',\n type: 'text',\n admin: {\n description: 'JSONPath expression that must evaluate to true for this step to execute (e.g., \"$.trigger.doc.status == \\'published\\'\")'\n },\n required: false\n },\n ],\n }\n ],\n versions: {\n drafts: {\n autosave: false,\n },\n maxPerDoc: 10,\n },\n})\n"],"names":["createWorkflowCollection","collectionTriggers","steps","triggers","slug","access","create","delete","read","update","admin","defaultColumns","description","group","useAsTitle","fields","name","type","required","components","Field","condition","data","id","options","map","t","hidden","defaultValue","_","siblingData","hooks","afterRead","parameters","collectionSlug","undefined","beforeChange","value","Object","keys","virtual","operation","webhookPath","validate","global","globalOperation","placeholder","cronExpression","cronValue","cronParts","trim","split","length","timezone","tzValue","Intl","DateTimeFormat","timeZone","flatMap","inputs","step","inputSchema","field","args","call","hasMany","versions","drafts","autosave","maxPerDoc"],"mappings":"AAIA,OAAO,MAAMA,2BAAsG,CAAC,EACZC,kBAAkB,EAClBC,KAAK,EACLC,QAAQ,EACT,GAAM,CAAA;QAC3GC,MAAM;QACNC,QAAQ;YACNC,QAAQ,IAAM;YACdC,QAAQ,IAAM;YACdC,MAAM,IAAM;YACZC,QAAQ,IAAM;QAChB;QACAC,OAAO;YACLC,gBAAgB;gBAAC;gBAAQ;aAAY;YACrCC,aAAa;YACbC,OAAO;YACPC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNP,OAAO;oBACLE,aAAa;gBACf;gBACAM,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNP,OAAO;oBACLE,aAAa;gBACf;YACF;YACA;gBACEI,MAAM;gBACNC,MAAM;gBACNP,OAAO;oBACLS,YAAY;wBACVC,OAAO;oBACT;oBACAC,WAAW,CAACC,OAAS,CAAC,CAACA,MAAMC,GAAG,mCAAmC;gBACrE;YACF;YACA;gBACEP,MAAM;gBACNC,MAAM;gBACNF,QAAQ;oBACN;wBACEC,MAAM;wBACNC,MAAM;wBACNO,SAAS;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A;gBACE3C,MAAM;gBACNC,MAAM;gBACNF,QAAQ;oBACN;wBACEE,MAAM;wBACNF,QAAQ;4BACN;gCACEC,MAAM;gCACNC,MAAM;gCACNO,SAAStB,MAAMuB,GAAG,CAACC,CAAAA,IAAKA,EAAEtB,IAAI;4BAChC;4BACA;gCACEY,MAAM;gCACNC,MAAM;4BACR;yBACD;oBACH;uBACG,AAACf,CAAAA,SAAS,EAAE,AAAD,EAAGwD,OAAO,CAACE,CAAAA,OAAQ,AAACA,CAAAA,KAAKC,WAAW,IAAI,EAAE,AAAD,EAAGpC,GAAG,CAACqC,CAAAA,QAAU,CAAA;gCACtE,GAAGA,KAAK;gCACRpD,OAAO;oCACL,GAAIoD,MAAMpD,KAAK,IAAI,CAAC,CAAC;oCACrBW,WAAW,CAAC,GAAG0C,OAASA,IAAI,CAAC,EAAE,EAAEH,SAASA,KAAKxD,IAAI,IACjD0D,CAAAA,MAAMpD,KAAK,EAAEW,YACXyC,MAAMpD,KAAK,CAACW,SAAS,CAAC2C,IAAI,CAAC,IAAI,KAAKD,QACpC,IAAG;gCAET;4BACF,CAAA;oBACA;wBACE/C,MAAM;wBACNC,MAAM;wBACNP,OAAO;4BACLE,aAAa;wBACf;wBACAqD,SAAS;wBACT/C,UAAU;oBACZ;oBACA;wBACEF,MAAM;wBACNC,MAAM;wBACNP,OAAO;4BACLE,aAAa;wBACf;wBACAM,UAAU;oBACZ;iBACD;YACH;SACD;QACDgD,UAAU;YACRC,QAAQ;gBACNC,UAAU;YACZ;YACAC,WAAW;QACb;IACF,CAAA,EAAE"}
1
+ {"version":3,"sources":["../../src/collections/Workflow.ts"],"sourcesContent":["import type {CollectionConfig, Field} from 'payload'\n\nimport type {WorkflowsPluginConfig} from \"../plugin/config-types.js\"\n\nexport const createWorkflowCollection: <T extends string>(options: WorkflowsPluginConfig<T>) => CollectionConfig = ({\n collectionTriggers,\n steps,\n triggers\n }) => ({\n slug: 'workflows',\n access: {\n create: () => true,\n delete: () => true,\n read: () => true,\n update: () => true,\n },\n admin: {\n defaultColumns: ['name', 'updatedAt'],\n description: 'Create and manage automated workflows.',\n group: 'Automation',\n useAsTitle: 'name',\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n admin: {\n description: 'Human-readable name for the workflow',\n },\n required: true,\n },\n {\n name: 'description',\n type: 'textarea',\n admin: {\n description: 'Optional description of what this workflow does',\n },\n },\n {\n name: 'executionStatus',\n type: 'ui',\n admin: {\n components: {\n Field: '../components/WorkflowExecutionStatus'\n },\n condition: (data) => !!data?.id // Only show for existing workflows\n }\n },\n {\n name: 'triggers',\n type: 'array',\n fields: [\n {\n name: 'type',\n type: 'select',\n options: [\n 'collection-trigger',\n 'webhook-trigger',\n 'global-trigger',\n 'cron-trigger',\n ...(triggers || []).map(t => t.slug)\n ]\n },\n {\n name: 'parameters',\n type: 'json',\n admin: {\n hidden: true,\n },\n defaultValue: {}\n },\n // Virtual fields for collection trigger\n {\n name: '__builtin_collectionSlug',\n type: 'select',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'collection-trigger',\n description: 'Collection that triggers the workflow',\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.collectionSlug || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.collectionSlug = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n options: Object.keys(collectionTriggers || {}),\n virtual: true,\n },\n {\n name: '__builtin_operation',\n type: 'select',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'collection-trigger',\n description: 'Collection operation that triggers the workflow',\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.operation || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.operation = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n options: [\n 'create',\n 'delete',\n 'read',\n 'update',\n ],\n virtual: true,\n },\n // Virtual fields for webhook trigger\n {\n name: '__builtin_webhookPath',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'webhook-trigger',\n description: 'URL path for the webhook (e.g., \"my-webhook\"). Full URL will be /api/workflows-webhook/my-webhook',\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.webhookPath || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.webhookPath = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n validate: (value: any, {siblingData}: any) => {\n if (siblingData?.type === 'webhook-trigger' && !value && !siblingData?.parameters?.webhookPath) {\n return 'Webhook path is required for webhook triggers'\n }\n return true\n },\n virtual: true,\n },\n // Virtual fields for global trigger\n {\n name: '__builtin_global',\n type: 'select',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'global-trigger',\n description: 'Global that triggers the workflow',\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.global || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.global = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n options: [], // Will be populated dynamically based on available globals\n virtual: true,\n },\n {\n name: '__builtin_globalOperation',\n type: 'select',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'global-trigger',\n description: 'Global operation that triggers the workflow',\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.globalOperation || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.globalOperation = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n options: [\n 'update'\n ],\n virtual: true,\n },\n // Virtual fields for cron trigger\n {\n name: '__builtin_cronExpression',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'cron-trigger',\n description: 'Cron expression for scheduled execution (e.g., \"0 0 * * *\" for daily at midnight)',\n placeholder: '0 0 * * *'\n },\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.cronExpression || undefined\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.cronExpression = value\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n validate: (value: any, {siblingData}: any) => {\n const cronValue = value || siblingData?.parameters?.cronExpression\n if (siblingData?.type === 'cron-trigger' && !cronValue) {\n return 'Cron expression is required for cron triggers'\n }\n\n // Validate cron expression format if provided\n if (siblingData?.type === 'cron-trigger' && cronValue) {\n // Basic format validation - should be 5 parts separated by spaces\n const cronParts = cronValue.trim().split(/\\s+/)\n if (cronParts.length !== 5) {\n return 'Invalid cron expression format. Expected 5 parts: \"minute hour day month weekday\" (e.g., \"0 9 * * 1\")'\n }\n\n // Additional validation could use node-cron but we avoid dynamic imports here\n // The main validation happens at runtime in the cron scheduler\n }\n\n return true\n },\n virtual: true,\n },\n {\n name: '__builtin_timezone',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'cron-trigger',\n description: 'Timezone for cron execution (e.g., \"America/New_York\", \"Europe/London\"). Defaults to UTC.',\n placeholder: 'UTC'\n },\n defaultValue: 'UTC',\n hooks: {\n afterRead: [\n ({ siblingData }) => {\n return siblingData?.parameters?.timezone || 'UTC'\n }\n ],\n beforeChange: [\n ({ siblingData, value }) => {\n if (!siblingData.parameters) {siblingData.parameters = {}}\n siblingData.parameters.timezone = value || 'UTC'\n return undefined // Virtual field, don't store directly\n }\n ]\n },\n validate: (value: any, {siblingData}: any) => {\n const tzValue = value || siblingData?.parameters?.timezone\n if (siblingData?.type === 'cron-trigger' && tzValue) {\n try {\n // Test if timezone is valid by trying to create a date with it\n new Intl.DateTimeFormat('en', {timeZone: tzValue})\n return true\n } catch {\n return `Invalid timezone: ${tzValue}. Please use a valid IANA timezone identifier (e.g., \"America/New_York\", \"Europe/London\")`\n }\n }\n return true\n },\n virtual: true,\n },\n {\n name: 'condition',\n type: 'text',\n admin: {\n description: 'JSONPath expression that must evaluate to true for this trigger to execute the workflow (e.g., \"$.trigger.doc.status == \\'published\\'\")'\n },\n required: false\n },\n // Virtual fields for custom triggers\n // Note: Custom trigger fields from trigger-helpers already have unique names\n // We just need to pass them through without modification\n ...(triggers || []).flatMap(t => (t.inputs || []))\n ]\n },\n {\n name: 'steps',\n type: 'array',\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'step',\n type: 'select',\n options: steps.map(t => t.slug)\n },\n {\n name: 'name',\n type: 'text',\n }\n ]\n },\n ...(steps || []).flatMap(step => (step.inputSchema || []).map(field => ({\n ...field,\n admin: {\n ...(field.admin || {}),\n condition: (...args) => args[1]?.step === step.slug && (\n field.admin?.condition ?\n field.admin.condition.call(this, ...args) :\n true\n ),\n },\n } as Field))),\n {\n name: 'dependencies',\n type: 'text',\n admin: {\n description: 'Step names that must complete before this step can run'\n },\n hasMany: true,\n required: false\n },\n {\n name: 'condition',\n type: 'text',\n admin: {\n description: 'JSONPath expression that must evaluate to true for this step to execute (e.g., \"$.trigger.doc.status == \\'published\\'\")'\n },\n required: false\n },\n ],\n }\n ],\n versions: {\n drafts: {\n autosave: false,\n },\n maxPerDoc: 10,\n },\n})\n"],"names":["createWorkflowCollection","collectionTriggers","steps","triggers","slug","access","create","delete","read","update","admin","defaultColumns","description","group","useAsTitle","fields","name","type","required","components","Field","condition","data","id","options","map","t","hidden","defaultValue","_","siblingData","hooks","afterRead","parameters","collectionSlug","undefined","beforeChange","value","Object","keys","virtual","operation","webhookPath","validate","global","globalOperation","placeholder","cronExpression","cronValue","cronParts","trim","split","length","timezone","tzValue","Intl","DateTimeFormat","timeZone","flatMap","inputs","step","inputSchema","field","args","call","hasMany","versions","drafts","autosave","maxPerDoc"],"mappings":"AAIA,OAAO,MAAMA,2BAAsG,CAAC,EACZC,kBAAkB,EAClBC,KAAK,E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AMpD,KAAK,CAACW,SAAS,CAAC2C,IAAI,CAAC,IAAI,KAAKD,QACpC,IAAG;gCAET;4BACF,CAAA;oBACA;wBACE/C,MAAM;wBACNC,MAAM;wBACNP,OAAO;4BACLE,aAAa;wBACf;wBACAqD,SAAS;wBACT/C,UAAU;oBACZ;oBACA;wBACEF,MAAM;wBACNC,MAAM;wBACNP,OAAO;4BACLE,aAAa;wBACf;wBACAM,UAAU;oBACZ;iBACD;YACH;SACD;QACDgD,UAAU;YACRC,QAAQ;gBACNC,UAAU;YACZ;YACAC,WAAW;QACb;IACF,CAAA,EAAE"}
@@ -44,7 +44,7 @@ export const WorkflowRunsCollection = {
44
44
  admin: {
45
45
  description: 'Current execution status',
46
46
  components: {
47
- Cell: '@/components/StatusCell'
47
+ Cell: '../components/StatusCell'
48
48
  }
49
49
  },
50
50
  defaultValue: 'pending',
@@ -145,7 +145,7 @@ export const WorkflowRunsCollection = {
145
145
  description: 'Error message if workflow execution failed',
146
146
  condition: (_, siblingData)=>siblingData?.status === 'failed',
147
147
  components: {
148
- Field: '@/components/ErrorDisplay'
148
+ Field: '../components/ErrorDisplay'
149
149
  }
150
150
  }
151
151
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/collections/WorkflowRuns.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nexport const WorkflowRunsCollection: CollectionConfig = {\n slug: 'workflow-runs',\n access: {\n create: () => true,\n delete: () => true,\n read: () => true,\n update: () => true,\n },\n admin: {\n defaultColumns: ['workflow', 'status', 'triggeredBy', 'startedAt', 'duration'],\n group: 'Automation',\n pagination: {\n defaultLimit: 50,\n },\n useAsTitle: 'id',\n },\n fields: [\n {\n name: 'workflow',\n type: 'relationship',\n admin: {\n description: 'Reference to the workflow that was executed',\n },\n relationTo: 'workflows',\n required: true,\n },\n {\n name: 'workflowVersion',\n type: 'number',\n admin: {\n description: 'Version of the workflow that was executed',\n },\n required: true,\n },\n {\n name: 'status',\n type: 'select',\n admin: {\n description: 'Current execution status',\n components: {\n Cell: '@/components/StatusCell'\n }\n },\n defaultValue: 'pending',\n options: [\n {\n label: '⏳ Pending',\n value: 'pending',\n },\n {\n label: '🔄 Running',\n value: 'running',\n },\n {\n label: '✅ Completed',\n value: 'completed',\n },\n {\n label: '❌ Failed',\n value: 'failed',\n },\n {\n label: '⏹️ Cancelled',\n value: 'cancelled',\n },\n ],\n required: true,\n },\n {\n name: 'startedAt',\n type: 'date',\n admin: {\n date: {\n displayFormat: 'yyyy-MM-dd HH:mm:ss',\n },\n description: 'When execution began',\n },\n required: true,\n },\n {\n name: 'completedAt',\n type: 'date',\n admin: {\n date: {\n displayFormat: 'yyyy-MM-dd HH:mm:ss',\n },\n description: 'When execution finished',\n },\n },\n {\n name: 'duration',\n type: 'number',\n admin: {\n description: 'Total execution time in milliseconds',\n readOnly: true,\n },\n },\n {\n name: 'context',\n type: 'json'\n },\n {\n name: 'inputs',\n type: 'json',\n admin: {\n description: 'Input data provided when the workflow was triggered',\n },\n defaultValue: {},\n required: true,\n },\n {\n name: 'outputs',\n type: 'json',\n admin: {\n description: 'Final output data from completed steps',\n },\n },\n {\n name: 'triggeredBy',\n type: 'text',\n admin: {\n description: 'User, system, or trigger type that initiated execution',\n },\n required: true,\n },\n {\n name: 'steps',\n type: 'json',\n admin: {\n description: 'Array of step execution results',\n },\n defaultValue: [],\n required: true,\n },\n {\n name: 'error',\n type: 'textarea',\n admin: {\n description: 'Error message if workflow execution failed',\n condition: (_, siblingData) => siblingData?.status === 'failed',\n components: {\n Field: '@/components/ErrorDisplay'\n }\n },\n },\n {\n name: 'logs',\n type: 'json',\n admin: {\n description: 'Detailed execution logs',\n },\n defaultValue: [],\n required: true,\n },\n ],\n}\n"],"names":["WorkflowRunsCollection","slug","access","create","delete","read","update","admin","defaultColumns","group","pagination","defaultLimit","useAsTitle","fields","name","type","description","relationTo","required","components","Cell","defaultValue","options","label","value","date","displayFormat","readOnly","condition","_","siblingData","status","Field"],"mappings":"AAEA,OAAO,MAAMA,yBAA2C;IACtDC,MAAM;IACNC,QAAQ;QACNC,QAAQ,IAAM;QACdC,QAAQ,IAAM;QACdC,MAAM,IAAM;QACZC,QAAQ,IAAM;IAChB;IACAC,OAAO;QACLC,gBAAgB;YAAC;YAAY;YAAU;YAAe;YAAa;SAAW;QAC9EC,OAAO;QACPC,YAAY;YACVC,cAAc;QAChB;QACAC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAC,YAAY;YACZC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAE,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;gBACbG,YAAY;oBACVC,MAAM;gBACR;YACF;YACAC,cAAc;YACdC,SAAS;gBACP;oBACEC,OAAO;oBACPC,OAAO;gBACT;gBACA;oBACED,OAAO;oBACPC,OAAO;gBACT;gBACA;oBACED,OAAO;oBACPC,OAAO;gBACT;gBACA;oBACED,OAAO;oBACPC,OAAO;gBACT;gBACA;oBACED,OAAO;oBACPC,OAAO;gBACT;aACD;YACDN,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLkB,MAAM;oBACJC,eAAe;gBACjB;gBACAV,aAAa;YACf;YACAE,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLkB,MAAM;oBACJC,eAAe;gBACjB;gBACAV,aAAa;YACf;QACF;QACA;YACEF,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;gBACbW,UAAU;YACZ;QACF;QACA;YACEb,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAK,cAAc,CAAC;YACfH,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;QACF;QACA;YACEF,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAE,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAK,cAAc,EAAE;YAChBH,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;gBACbY,WAAW,CAACC,GAAGC,cAAgBA,aAAaC,WAAW;gBACvDZ,YAAY;oBACVa,OAAO;gBACT;YACF;QACF;QACA;YACElB,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAK,cAAc,EAAE;YAChBH,UAAU;QACZ;KACD;AACH,EAAC"}
1
+ {"version":3,"sources":["../../src/collections/WorkflowRuns.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nexport const WorkflowRunsCollection: CollectionConfig = {\n slug: 'workflow-runs',\n access: {\n create: () => true,\n delete: () => true,\n read: () => true,\n update: () => true,\n },\n admin: {\n defaultColumns: ['workflow', 'status', 'triggeredBy', 'startedAt', 'duration'],\n group: 'Automation',\n pagination: {\n defaultLimit: 50,\n },\n useAsTitle: 'id',\n },\n fields: [\n {\n name: 'workflow',\n type: 'relationship',\n admin: {\n description: 'Reference to the workflow that was executed',\n },\n relationTo: 'workflows',\n required: true,\n },\n {\n name: 'workflowVersion',\n type: 'number',\n admin: {\n description: 'Version of the workflow that was executed',\n },\n required: true,\n },\n {\n name: 'status',\n type: 'select',\n admin: {\n description: 'Current execution status',\n components: {\n Cell: '../components/StatusCell'\n }\n },\n defaultValue: 'pending',\n options: [\n {\n label: '⏳ Pending',\n value: 'pending',\n },\n {\n label: '🔄 Running',\n value: 'running',\n },\n {\n label: '✅ Completed',\n value: 'completed',\n },\n {\n label: '❌ Failed',\n value: 'failed',\n },\n {\n label: '⏹️ Cancelled',\n value: 'cancelled',\n },\n ],\n required: true,\n },\n {\n name: 'startedAt',\n type: 'date',\n admin: {\n date: {\n displayFormat: 'yyyy-MM-dd HH:mm:ss',\n },\n description: 'When execution began',\n },\n required: true,\n },\n {\n name: 'completedAt',\n type: 'date',\n admin: {\n date: {\n displayFormat: 'yyyy-MM-dd HH:mm:ss',\n },\n description: 'When execution finished',\n },\n },\n {\n name: 'duration',\n type: 'number',\n admin: {\n description: 'Total execution time in milliseconds',\n readOnly: true,\n },\n },\n {\n name: 'context',\n type: 'json'\n },\n {\n name: 'inputs',\n type: 'json',\n admin: {\n description: 'Input data provided when the workflow was triggered',\n },\n defaultValue: {},\n required: true,\n },\n {\n name: 'outputs',\n type: 'json',\n admin: {\n description: 'Final output data from completed steps',\n },\n },\n {\n name: 'triggeredBy',\n type: 'text',\n admin: {\n description: 'User, system, or trigger type that initiated execution',\n },\n required: true,\n },\n {\n name: 'steps',\n type: 'json',\n admin: {\n description: 'Array of step execution results',\n },\n defaultValue: [],\n required: true,\n },\n {\n name: 'error',\n type: 'textarea',\n admin: {\n description: 'Error message if workflow execution failed',\n condition: (_, siblingData) => siblingData?.status === 'failed',\n components: {\n Field: '../components/ErrorDisplay'\n }\n },\n },\n {\n name: 'logs',\n type: 'json',\n admin: {\n description: 'Detailed execution logs',\n },\n defaultValue: [],\n required: true,\n },\n ],\n}\n"],"names":["WorkflowRunsCollection","slug","access","create","delete","read","update","admin","defaultColumns","group","pagination","defaultLimit","useAsTitle","fields","name","type","description","relationTo","required","components","Cell","defaultValue","options","label","value","date","displayFormat","readOnly","condition","_","siblingData","status","Field"],"mappings":"AAEA,OAAO,MAAMA,yBAA2C;IACtDC,MAAM;IACNC,QAAQ;QACNC,QAAQ,IAAM;QACdC,QAAQ,IAAM;QACdC,MAAM,IAAM;QACZC,QAAQ,IAAM;IAChB;IACAC,OAAO;QACLC,gBAAgB;YAAC;YAAY;YAAU;YAAe;YAAa;SAAW;QAC9EC,OAAO;QACPC,YAAY;YACVC,cAAc;QAChB;QACAC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAC,YAAY;YACZC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAE,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;gBACbG,YAAY;oBACVC,MAAM;gBACR;YACF;YACAC,cAAc;YACdC,SAAS;gBACP;oBACEC,OAAO;oBACPC,OAAO;gBACT;gBACA;oBACED,OAAO;oBACPC,OAAO;gBACT;gBACA;oBACED,OAAO;oBACPC,OAAO;gBACT;gBACA;oBACED,OAAO;oBACPC,OAAO;gBACT;gBACA;oBACED,OAAO;oBACPC,OAAO;gBACT;aACD;YACDN,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLkB,MAAM;oBACJC,eAAe;gBACjB;gBACAV,aAAa;YACf;YACAE,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLkB,MAAM;oBACJC,eAAe;gBACjB;gBACAV,aAAa;YACf;QACF;QACA;YACEF,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;gBACbW,UAAU;YACZ;QACF;QACA;YACEb,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAK,cAAc,CAAC;YACfH,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;QACF;QACA;YACEF,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAE,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAK,cAAc,EAAE;YAChBH,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;gBACbY,WAAW,CAACC,GAAGC,cAAgBA,aAAaC,WAAW;gBACvDZ,YAAY;oBACVa,OAAO;gBACT;YACF;QACF;QACA;YACElB,MAAM;YACNC,MAAM;YACNR,OAAO;gBACLS,aAAa;YACf;YACAK,cAAc,EAAE;YAChBH,UAAU;QACZ;KACD;AACH,EAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface ErrorDisplayProps {
3
+ value?: string;
4
+ onChange?: (value: string) => void;
5
+ readOnly?: boolean;
6
+ path?: string;
7
+ }
8
+ export declare const ErrorDisplay: React.FC<ErrorDisplayProps>;
9
+ export {};
@@ -0,0 +1,307 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import React, { useState } from 'react';
4
+ import { Button } from '@payloadcms/ui';
5
+ export const ErrorDisplay = ({ value, onChange, readOnly = false })=>{
6
+ const [expanded, setExpanded] = useState(false);
7
+ if (!value) {
8
+ return null;
9
+ }
10
+ // Parse common error patterns
11
+ const parseError = (error)=>{
12
+ // Check for different error types and provide user-friendly messages
13
+ if (error.includes('Request timeout')) {
14
+ return {
15
+ type: 'timeout',
16
+ title: 'Request Timeout',
17
+ message: 'The HTTP request took too long to complete. Consider increasing the timeout value or checking the target server.',
18
+ technical: error
19
+ };
20
+ }
21
+ if (error.includes('Network error') || error.includes('fetch')) {
22
+ return {
23
+ type: 'network',
24
+ title: 'Network Error',
25
+ message: 'Unable to connect to the target server. Please check the URL and network connectivity.',
26
+ technical: error
27
+ };
28
+ }
29
+ if (error.includes('Hook execution failed')) {
30
+ return {
31
+ type: 'hook',
32
+ title: 'Workflow Hook Failed',
33
+ message: 'The workflow trigger hook encountered an error. This may be due to PayloadCMS initialization issues.',
34
+ technical: error
35
+ };
36
+ }
37
+ if (error.includes('Executor not available')) {
38
+ return {
39
+ type: 'executor',
40
+ title: 'Workflow Engine Unavailable',
41
+ message: 'The workflow execution engine is not properly initialized. Try restarting the server.',
42
+ technical: error
43
+ };
44
+ }
45
+ if (error.includes('Collection slug is required') || error.includes('Document data is required')) {
46
+ return {
47
+ type: 'validation',
48
+ title: 'Invalid Input Data',
49
+ message: 'Required fields are missing from the workflow step configuration. Please check your step inputs.',
50
+ technical: error
51
+ };
52
+ }
53
+ if (error.includes('status') && error.includes('4')) {
54
+ return {
55
+ type: 'client',
56
+ title: 'Client Error (4xx)',
57
+ message: 'The request was rejected by the server. Check your API credentials and request format.',
58
+ technical: error
59
+ };
60
+ }
61
+ if (error.includes('status') && error.includes('5')) {
62
+ return {
63
+ type: 'server',
64
+ title: 'Server Error (5xx)',
65
+ message: 'The target server encountered an error. This is usually temporary - try again later.',
66
+ technical: error
67
+ };
68
+ }
69
+ // Generic error
70
+ return {
71
+ type: 'generic',
72
+ title: 'Workflow Error',
73
+ message: 'An error occurred during workflow execution. See technical details below.',
74
+ technical: error
75
+ };
76
+ };
77
+ const errorInfo = parseError(value);
78
+ const getErrorIcon = (type)=>{
79
+ switch(type){
80
+ case 'timeout':
81
+ return '⏰';
82
+ case 'network':
83
+ return '🌐';
84
+ case 'hook':
85
+ return '🔗';
86
+ case 'executor':
87
+ return '⚙️';
88
+ case 'validation':
89
+ return '📋';
90
+ case 'client':
91
+ return '🚫';
92
+ case 'server':
93
+ return '🔥';
94
+ default:
95
+ return '❗';
96
+ }
97
+ };
98
+ const getErrorColor = (type)=>{
99
+ switch(type){
100
+ case 'timeout':
101
+ return '#F59E0B';
102
+ case 'network':
103
+ return '#EF4444';
104
+ case 'hook':
105
+ return '#8B5CF6';
106
+ case 'executor':
107
+ return '#6B7280';
108
+ case 'validation':
109
+ return '#F59E0B';
110
+ case 'client':
111
+ return '#EF4444';
112
+ case 'server':
113
+ return '#DC2626';
114
+ default:
115
+ return '#EF4444';
116
+ }
117
+ };
118
+ const errorColor = getErrorColor(errorInfo.type);
119
+ return /*#__PURE__*/ _jsxs("div", {
120
+ style: {
121
+ border: `2px solid ${errorColor}30`,
122
+ borderRadius: '8px',
123
+ backgroundColor: `${errorColor}08`,
124
+ padding: '16px',
125
+ marginTop: '8px'
126
+ },
127
+ children: [
128
+ /*#__PURE__*/ _jsxs("div", {
129
+ style: {
130
+ display: 'flex',
131
+ alignItems: 'center',
132
+ gap: '12px',
133
+ marginBottom: '12px'
134
+ },
135
+ children: [
136
+ /*#__PURE__*/ _jsx("span", {
137
+ style: {
138
+ fontSize: '24px'
139
+ },
140
+ children: getErrorIcon(errorInfo.type)
141
+ }),
142
+ /*#__PURE__*/ _jsxs("div", {
143
+ children: [
144
+ /*#__PURE__*/ _jsx("h4", {
145
+ style: {
146
+ margin: 0,
147
+ color: errorColor,
148
+ fontSize: '16px',
149
+ fontWeight: '600'
150
+ },
151
+ children: errorInfo.title
152
+ }),
153
+ /*#__PURE__*/ _jsx("p", {
154
+ style: {
155
+ margin: '4px 0 0 0',
156
+ color: '#6B7280',
157
+ fontSize: '14px',
158
+ lineHeight: '1.4'
159
+ },
160
+ children: errorInfo.message
161
+ })
162
+ ]
163
+ })
164
+ ]
165
+ }),
166
+ /*#__PURE__*/ _jsxs("div", {
167
+ children: [
168
+ /*#__PURE__*/ _jsx("div", {
169
+ style: {
170
+ marginBottom: expanded ? '12px' : '0'
171
+ },
172
+ children: /*#__PURE__*/ _jsxs(Button, {
173
+ onClick: ()=>setExpanded(!expanded),
174
+ size: "small",
175
+ buttonStyle: "secondary",
176
+ children: [
177
+ expanded ? 'Hide' : 'Show',
178
+ " Technical Details"
179
+ ]
180
+ })
181
+ }),
182
+ expanded && /*#__PURE__*/ _jsx("div", {
183
+ style: {
184
+ backgroundColor: '#F8F9FA',
185
+ border: '1px solid #E5E7EB',
186
+ borderRadius: '6px',
187
+ padding: '12px',
188
+ fontFamily: 'monospace',
189
+ fontSize: '13px',
190
+ color: '#374151',
191
+ whiteSpace: 'pre-wrap',
192
+ overflowX: 'auto'
193
+ },
194
+ children: errorInfo.technical
195
+ })
196
+ ]
197
+ }),
198
+ /*#__PURE__*/ _jsxs("div", {
199
+ style: {
200
+ marginTop: '12px',
201
+ padding: '12px',
202
+ backgroundColor: `${errorColor}10`,
203
+ borderRadius: '6px',
204
+ fontSize: '13px'
205
+ },
206
+ children: [
207
+ /*#__PURE__*/ _jsx("strong", {
208
+ children: "💡 Quick fixes:"
209
+ }),
210
+ /*#__PURE__*/ _jsxs("ul", {
211
+ style: {
212
+ margin: '8px 0 0 0',
213
+ paddingLeft: '20px'
214
+ },
215
+ children: [
216
+ errorInfo.type === 'timeout' && /*#__PURE__*/ _jsxs(_Fragment, {
217
+ children: [
218
+ /*#__PURE__*/ _jsx("li", {
219
+ children: "Increase the timeout value in step configuration"
220
+ }),
221
+ /*#__PURE__*/ _jsx("li", {
222
+ children: "Check if the target server is responding slowly"
223
+ })
224
+ ]
225
+ }),
226
+ errorInfo.type === 'network' && /*#__PURE__*/ _jsxs(_Fragment, {
227
+ children: [
228
+ /*#__PURE__*/ _jsx("li", {
229
+ children: "Verify the URL is correct and accessible"
230
+ }),
231
+ /*#__PURE__*/ _jsx("li", {
232
+ children: "Check firewall and network connectivity"
233
+ })
234
+ ]
235
+ }),
236
+ errorInfo.type === 'hook' && /*#__PURE__*/ _jsxs(_Fragment, {
237
+ children: [
238
+ /*#__PURE__*/ _jsx("li", {
239
+ children: "Restart the PayloadCMS server"
240
+ }),
241
+ /*#__PURE__*/ _jsx("li", {
242
+ children: "Check server logs for initialization errors"
243
+ })
244
+ ]
245
+ }),
246
+ errorInfo.type === 'executor' && /*#__PURE__*/ _jsxs(_Fragment, {
247
+ children: [
248
+ /*#__PURE__*/ _jsx("li", {
249
+ children: "Restart the PayloadCMS application"
250
+ }),
251
+ /*#__PURE__*/ _jsx("li", {
252
+ children: "Verify the automation plugin is properly configured"
253
+ })
254
+ ]
255
+ }),
256
+ errorInfo.type === 'validation' && /*#__PURE__*/ _jsxs(_Fragment, {
257
+ children: [
258
+ /*#__PURE__*/ _jsx("li", {
259
+ children: "Check all required fields are filled in the workflow step"
260
+ }),
261
+ /*#__PURE__*/ _jsx("li", {
262
+ children: "Verify JSONPath expressions in step inputs"
263
+ })
264
+ ]
265
+ }),
266
+ (errorInfo.type === 'client' || errorInfo.type === 'server') && /*#__PURE__*/ _jsxs(_Fragment, {
267
+ children: [
268
+ /*#__PURE__*/ _jsx("li", {
269
+ children: "Check API credentials and permissions"
270
+ }),
271
+ /*#__PURE__*/ _jsx("li", {
272
+ children: "Verify the request format matches API expectations"
273
+ }),
274
+ /*#__PURE__*/ _jsx("li", {
275
+ children: "Try the request manually to test the endpoint"
276
+ })
277
+ ]
278
+ }),
279
+ errorInfo.type === 'generic' && /*#__PURE__*/ _jsxs(_Fragment, {
280
+ children: [
281
+ /*#__PURE__*/ _jsx("li", {
282
+ children: "Check the workflow configuration"
283
+ }),
284
+ /*#__PURE__*/ _jsx("li", {
285
+ children: "Review server logs for more details"
286
+ }),
287
+ /*#__PURE__*/ _jsx("li", {
288
+ children: "Try running the workflow again"
289
+ })
290
+ ]
291
+ })
292
+ ]
293
+ })
294
+ ]
295
+ }),
296
+ !readOnly && onChange && /*#__PURE__*/ _jsx("textarea", {
297
+ value: value,
298
+ onChange: (e)=>onChange(e.target.value),
299
+ style: {
300
+ display: 'none'
301
+ }
302
+ })
303
+ ]
304
+ });
305
+ };
306
+
307
+ //# sourceMappingURL=ErrorDisplay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/ErrorDisplay.tsx"],"sourcesContent":["'use client'\n\nimport React, { useState } from 'react'\nimport { Button } from '@payloadcms/ui'\n\ninterface ErrorDisplayProps {\n value?: string\n onChange?: (value: string) => void\n readOnly?: boolean\n path?: string\n}\n\nexport const ErrorDisplay: React.FC<ErrorDisplayProps> = ({ \n value, \n onChange, \n readOnly = false \n}) => {\n const [expanded, setExpanded] = useState(false)\n\n if (!value) {\n return null\n }\n\n // Parse common error patterns\n const parseError = (error: string) => {\n // Check for different error types and provide user-friendly messages\n if (error.includes('Request timeout')) {\n return {\n type: 'timeout',\n title: 'Request Timeout',\n message: 'The HTTP request took too long to complete. Consider increasing the timeout value or checking the target server.',\n technical: error\n }\n }\n \n if (error.includes('Network error') || error.includes('fetch')) {\n return {\n type: 'network',\n title: 'Network Error',\n message: 'Unable to connect to the target server. Please check the URL and network connectivity.',\n technical: error\n }\n }\n \n if (error.includes('Hook execution failed')) {\n return {\n type: 'hook',\n title: 'Workflow Hook Failed',\n message: 'The workflow trigger hook encountered an error. This may be due to PayloadCMS initialization issues.',\n technical: error\n }\n }\n \n if (error.includes('Executor not available')) {\n return {\n type: 'executor',\n title: 'Workflow Engine Unavailable',\n message: 'The workflow execution engine is not properly initialized. Try restarting the server.',\n technical: error\n }\n }\n \n if (error.includes('Collection slug is required') || error.includes('Document data is required')) {\n return {\n type: 'validation',\n title: 'Invalid Input Data',\n message: 'Required fields are missing from the workflow step configuration. Please check your step inputs.',\n technical: error\n }\n }\n \n if (error.includes('status') && error.includes('4')) {\n return {\n type: 'client',\n title: 'Client Error (4xx)',\n message: 'The request was rejected by the server. Check your API credentials and request format.',\n technical: error\n }\n }\n \n if (error.includes('status') && error.includes('5')) {\n return {\n type: 'server',\n title: 'Server Error (5xx)',\n message: 'The target server encountered an error. This is usually temporary - try again later.',\n technical: error\n }\n }\n\n // Generic error\n return {\n type: 'generic',\n title: 'Workflow Error',\n message: 'An error occurred during workflow execution. See technical details below.',\n technical: error\n }\n }\n\n const errorInfo = parseError(value)\n\n const getErrorIcon = (type: string) => {\n switch (type) {\n case 'timeout': return '⏰'\n case 'network': return '🌐'\n case 'hook': return '🔗'\n case 'executor': return '⚙️'\n case 'validation': return '📋'\n case 'client': return '🚫'\n case 'server': return '🔥'\n default: return '❗'\n }\n }\n\n const getErrorColor = (type: string) => {\n switch (type) {\n case 'timeout': return '#F59E0B'\n case 'network': return '#EF4444'\n case 'hook': return '#8B5CF6'\n case 'executor': return '#6B7280'\n case 'validation': return '#F59E0B'\n case 'client': return '#EF4444'\n case 'server': return '#DC2626'\n default: return '#EF4444'\n }\n }\n\n const errorColor = getErrorColor(errorInfo.type)\n\n return (\n <div style={{ \n border: `2px solid ${errorColor}30`,\n borderRadius: '8px',\n backgroundColor: `${errorColor}08`,\n padding: '16px',\n marginTop: '8px'\n }}>\n {/* Error Header */}\n <div style={{ \n display: 'flex', \n alignItems: 'center', \n gap: '12px',\n marginBottom: '12px'\n }}>\n <span style={{ fontSize: '24px' }}>\n {getErrorIcon(errorInfo.type)}\n </span>\n <div>\n <h4 style={{ \n margin: 0, \n color: errorColor,\n fontSize: '16px',\n fontWeight: '600'\n }}>\n {errorInfo.title}\n </h4>\n <p style={{ \n margin: '4px 0 0 0',\n color: '#6B7280',\n fontSize: '14px',\n lineHeight: '1.4'\n }}>\n {errorInfo.message}\n </p>\n </div>\n </div>\n\n {/* Technical Details Toggle */}\n <div>\n <div style={{ marginBottom: expanded ? '12px' : '0' }}>\n <Button\n onClick={() => setExpanded(!expanded)}\n size=\"small\"\n buttonStyle=\"secondary\"\n >\n {expanded ? 'Hide' : 'Show'} Technical Details\n </Button>\n </div>\n \n {expanded && (\n <div style={{\n backgroundColor: '#F8F9FA',\n border: '1px solid #E5E7EB',\n borderRadius: '6px',\n padding: '12px',\n fontFamily: 'monospace',\n fontSize: '13px',\n color: '#374151',\n whiteSpace: 'pre-wrap',\n overflowX: 'auto'\n }}>\n {errorInfo.technical}\n </div>\n )}\n </div>\n\n {/* Quick Actions */}\n <div style={{ \n marginTop: '12px',\n padding: '12px',\n backgroundColor: `${errorColor}10`,\n borderRadius: '6px',\n fontSize: '13px'\n }}>\n <strong>💡 Quick fixes:</strong>\n <ul style={{ margin: '8px 0 0 0', paddingLeft: '20px' }}>\n {errorInfo.type === 'timeout' && (\n <>\n <li>Increase the timeout value in step configuration</li>\n <li>Check if the target server is responding slowly</li>\n </>\n )}\n {errorInfo.type === 'network' && (\n <>\n <li>Verify the URL is correct and accessible</li>\n <li>Check firewall and network connectivity</li>\n </>\n )}\n {errorInfo.type === 'hook' && (\n <>\n <li>Restart the PayloadCMS server</li>\n <li>Check server logs for initialization errors</li>\n </>\n )}\n {errorInfo.type === 'executor' && (\n <>\n <li>Restart the PayloadCMS application</li>\n <li>Verify the automation plugin is properly configured</li>\n </>\n )}\n {errorInfo.type === 'validation' && (\n <>\n <li>Check all required fields are filled in the workflow step</li>\n <li>Verify JSONPath expressions in step inputs</li>\n </>\n )}\n {(errorInfo.type === 'client' || errorInfo.type === 'server') && (\n <>\n <li>Check API credentials and permissions</li>\n <li>Verify the request format matches API expectations</li>\n <li>Try the request manually to test the endpoint</li>\n </>\n )}\n {errorInfo.type === 'generic' && (\n <>\n <li>Check the workflow configuration</li>\n <li>Review server logs for more details</li>\n <li>Try running the workflow again</li>\n </>\n )}\n </ul>\n </div>\n\n {/* Hidden textarea for editing if needed */}\n {!readOnly && onChange && (\n <textarea\n value={value}\n onChange={(e) => onChange(e.target.value)}\n style={{ display: 'none' }}\n />\n )}\n </div>\n )\n}"],"names":["React","useState","Button","ErrorDisplay","value","onChange","readOnly","expanded","setExpanded","parseError","error","includes","type","title","message","technical","errorInfo","getErrorIcon","getErrorColor","errorColor","div","style","border","borderRadius","backgroundColor","padding","marginTop","display","alignItems","gap","marginBottom","span","fontSize","h4","margin","color","fontWeight","p","lineHeight","onClick","size","buttonStyle","fontFamily","whiteSpace","overflowX","strong","ul","paddingLeft","li","textarea","e","target"],"mappings":"AAAA;;AAEA,OAAOA,SAASC,QAAQ,QAAQ,QAAO;AACvC,SAASC,MAAM,QAAQ,iBAAgB;AASvC,OAAO,MAAMC,eAA4C,CAAC,EACxDC,KAAK,EACLC,QAAQ,EACRC,WAAW,KAAK,EACjB;IACC,MAAM,CAACC,UAAUC,YAAY,GAAGP,SAAS;IAEzC,IAAI,CAACG,OAAO;QACV,OAAO;IACT;IAEA,8BAA8B;IAC9B,MAAMK,aAAa,CAACC;QAClB,qEAAqE;QACrE,IAAIA,MAAMC,QAAQ,CAAC,oBAAoB;YACrC,OAAO;gBACLC,MAAM;gBACNC,OAAO;gBACPC,SAAS;gBACTC,WAAWL;YACb;QACF;QAEA,IAAIA,MAAMC,QAAQ,CAAC,oBAAoBD,MAAMC,QAAQ,CAAC,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AW,EAAE,CAAC;oBAClCI,cAAc;oBACdS,UAAU;gBACZ;;kCACE,KAACa;kCAAO;;kCACR,MAACC;wBAAGzB,OAAO;4BAAEa,QAAQ;4BAAaa,aAAa;wBAAO;;4BACnD/B,UAAUJ,IAAI,KAAK,2BAClB;;kDACE,KAACoC;kDAAG;;kDACJ,KAACA;kDAAG;;;;4BAGPhC,UAAUJ,IAAI,KAAK,2BAClB;;kDACE,KAACoC;kDAAG;;kDACJ,KAACA;kDAAG;;;;4BAGPhC,UAAUJ,IAAI,KAAK,wBAClB;;kDACE,KAACoC;kDAAG;;kDACJ,KAACA;kDAAG;;;;4BAGPhC,UAAUJ,IAAI,KAAK,4BAClB;;kDACE,KAACoC;kDAAG;;kDACJ,KAACA;kDAAG;;;;4BAGPhC,UAAUJ,IAAI,KAAK,8BAClB;;kDACE,KAACoC;kDAAG;;kDACJ,KAACA;kDAAG;;;;4BAGNhC,CAAAA,UAAUJ,IAAI,KAAK,YAAYI,UAAUJ,IAAI,KAAK,QAAO,mBACzD;;kDACE,KAACoC;kDAAG;;kDACJ,KAACA;kDAAG;;kDACJ,KAACA;kDAAG;;;;4BAGPhC,UAAUJ,IAAI,KAAK,2BAClB;;kDACE,KAACoC;kDAAG;;kDACJ,KAACA;kDAAG;;kDACJ,KAACA;kDAAG;;;;;;;;YAOX,CAAC1C,YAAYD,0BACZ,KAAC4C;gBACC7C,OAAOA;gBACPC,UAAU,CAAC6C,IAAM7C,SAAS6C,EAAEC,MAAM,CAAC/C,KAAK;gBACxCiB,OAAO;oBAAEM,SAAS;gBAAO;;;;AAKnC,EAAC"}
@@ -1,3 +1,4 @@
1
1
  export { TriggerWorkflowButton } from '../components/TriggerWorkflowButton.js';
2
2
  export { StatusCell } from '../components/StatusCell.js';
3
+ export { ErrorDisplay } from '../components/ErrorDisplay.js';
3
4
  export { WorkflowExecutionStatus } from '../components/WorkflowExecutionStatus.js';
@@ -2,7 +2,7 @@
2
2
  // These are separated to avoid CSS import errors during Node.js type generation
3
3
  export { TriggerWorkflowButton } from '../components/TriggerWorkflowButton.js';
4
4
  export { StatusCell } from '../components/StatusCell.js';
5
- // export { ErrorDisplay } from '../components/ErrorDisplay.js' // Temporarily disabled
5
+ export { ErrorDisplay } from '../components/ErrorDisplay.js';
6
6
  export { WorkflowExecutionStatus } from '../components/WorkflowExecutionStatus.js'; // Future client components can be added here:
7
7
  // export { default as WorkflowDashboard } from '../components/WorkflowDashboard/index.js'
8
8
  // export { default as WorkflowBuilder } from '../components/WorkflowBuilder/index.js'
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["// Client-side components that may have CSS imports or PayloadCMS UI dependencies\n// These are separated to avoid CSS import errors during Node.js type generation\n\nexport { TriggerWorkflowButton } from '../components/TriggerWorkflowButton.js'\nexport { StatusCell } from '../components/StatusCell.js'\n// export { ErrorDisplay } from '../components/ErrorDisplay.js' // Temporarily disabled\nexport { WorkflowExecutionStatus } from '../components/WorkflowExecutionStatus.js'\n\n// Future client components can be added here:\n// export { default as WorkflowDashboard } from '../components/WorkflowDashboard/index.js'\n// export { default as WorkflowBuilder } from '../components/WorkflowBuilder/index.js'\n"],"names":["TriggerWorkflowButton","StatusCell","WorkflowExecutionStatus"],"mappings":"AAAA,iFAAiF;AACjF,gFAAgF;AAEhF,SAASA,qBAAqB,QAAQ,yCAAwC;AAC9E,SAASC,UAAU,QAAQ,8BAA6B;AACxD,uFAAuF;AACvF,SAASC,uBAAuB,QAAQ,2CAA0C,CAElF,8CAA8C;CAC9C,0FAA0F;CAC1F,sFAAsF"}
1
+ {"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["// Client-side components that may have CSS imports or PayloadCMS UI dependencies\n// These are separated to avoid CSS import errors during Node.js type generation\n\nexport { TriggerWorkflowButton } from '../components/TriggerWorkflowButton.js'\nexport { StatusCell } from '../components/StatusCell.js'\nexport { ErrorDisplay } from '../components/ErrorDisplay.js'\nexport { WorkflowExecutionStatus } from '../components/WorkflowExecutionStatus.js'\n\n// Future client components can be added here:\n// export { default as WorkflowDashboard } from '../components/WorkflowDashboard/index.js'\n// export { default as WorkflowBuilder } from '../components/WorkflowBuilder/index.js'\n"],"names":["TriggerWorkflowButton","StatusCell","ErrorDisplay","WorkflowExecutionStatus"],"mappings":"AAAA,iFAAiF;AACjF,gFAAgF;AAEhF,SAASA,qBAAqB,QAAQ,yCAAwC;AAC9E,SAASC,UAAU,QAAQ,8BAA6B;AACxD,SAASC,YAAY,QAAQ,gCAA+B;AAC5D,SAASC,uBAAuB,QAAQ,2CAA0C,CAElF,8CAA8C;CAC9C,0FAA0F;CAC1F,sFAAsF"}
@@ -3,24 +3,23 @@
3
3
  *
4
4
  * @example
5
5
  * ```typescript
6
- * import { createTrigger, webhookTrigger } from '@xtr-dev/payload-automation/helpers'
6
+ * import { createTrigger, createTriggerField, webhookTrigger } from '@xtr-dev/payload-automation/helpers'
7
7
  *
8
- * // Simple trigger
9
- * const myTrigger = createTrigger('my-trigger').parameters({
10
- * apiKey: { type: 'text', required: true },
11
- * timeout: { type: 'number', defaultValue: 30 }
12
- * })
8
+ * // Simple trigger with array of fields
9
+ * const myTrigger = createTrigger('my-trigger', [
10
+ * { name: 'apiKey', type: 'text', required: true },
11
+ * { name: 'timeout', type: 'number', defaultValue: 30 }
12
+ * ])
13
13
  *
14
- * // Webhook trigger with presets
14
+ * // Single field with virtual storage
15
+ * const field = createTriggerField(
16
+ * { name: 'webhookUrl', type: 'text', required: true },
17
+ * 'my-trigger'
18
+ * )
19
+ *
20
+ * // Webhook trigger preset
15
21
  * const orderWebhook = webhookTrigger('order-webhook')
16
- * .parameter('orderTypes', {
17
- * type: 'select',
18
- * hasMany: true,
19
- * options: ['regular', 'subscription']
20
- * })
21
- * .build()
22
22
  * ```
23
23
  */
24
- export { createTriggerParameter, createTriggerParameters, createTrigger, createAdvancedTrigger } from '../utils/trigger-helpers.js';
24
+ export { createTriggerField, createTrigger } from '../utils/trigger-helpers.js';
25
25
  export { webhookTrigger, cronTrigger, eventTrigger, manualTrigger, apiTrigger } from '../utils/trigger-presets.js';
26
- export { webhookParameters, cronParameters, eventParameters } from '../utils/trigger-presets.js';
@@ -3,28 +3,26 @@
3
3
  *
4
4
  * @example
5
5
  * ```typescript
6
- * import { createTrigger, webhookTrigger } from '@xtr-dev/payload-automation/helpers'
6
+ * import { createTrigger, createTriggerField, webhookTrigger } from '@xtr-dev/payload-automation/helpers'
7
7
  *
8
- * // Simple trigger
9
- * const myTrigger = createTrigger('my-trigger').parameters({
10
- * apiKey: { type: 'text', required: true },
11
- * timeout: { type: 'number', defaultValue: 30 }
12
- * })
8
+ * // Simple trigger with array of fields
9
+ * const myTrigger = createTrigger('my-trigger', [
10
+ * { name: 'apiKey', type: 'text', required: true },
11
+ * { name: 'timeout', type: 'number', defaultValue: 30 }
12
+ * ])
13
13
  *
14
- * // Webhook trigger with presets
14
+ * // Single field with virtual storage
15
+ * const field = createTriggerField(
16
+ * { name: 'webhookUrl', type: 'text', required: true },
17
+ * 'my-trigger'
18
+ * )
19
+ *
20
+ * // Webhook trigger preset
15
21
  * const orderWebhook = webhookTrigger('order-webhook')
16
- * .parameter('orderTypes', {
17
- * type: 'select',
18
- * hasMany: true,
19
- * options: ['regular', 'subscription']
20
- * })
21
- * .build()
22
22
  * ```
23
23
  */ // Core helpers
24
- export { createTriggerParameter, createTriggerParameters, createTrigger, createAdvancedTrigger } from '../utils/trigger-helpers.js';
24
+ export { createTriggerField, createTrigger } from '../utils/trigger-helpers.js';
25
25
  // Preset builders
26
26
  export { webhookTrigger, cronTrigger, eventTrigger, manualTrigger, apiTrigger } from '../utils/trigger-presets.js';
27
- // Common parameter sets for extending
28
- export { webhookParameters, cronParameters, eventParameters } from '../utils/trigger-presets.js';
29
27
 
30
28
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/exports/helpers.ts"],"sourcesContent":["/**\n * Trigger builder helpers for creating custom triggers with less boilerplate\n * \n * @example\n * ```typescript\n * import { createTrigger, webhookTrigger } from '@xtr-dev/payload-automation/helpers'\n * \n * // Simple trigger\n * const myTrigger = createTrigger('my-trigger').parameters({\n * apiKey: { type: 'text', required: true },\n * timeout: { type: 'number', defaultValue: 30 }\n * })\n * \n * // Webhook trigger with presets\n * const orderWebhook = webhookTrigger('order-webhook')\n * .parameter('orderTypes', {\n * type: 'select',\n * hasMany: true,\n * options: ['regular', 'subscription']\n * })\n * .build()\n * ```\n */\n\n// Core helpers\nexport {\n createTriggerParameter,\n createTriggerParameters,\n createTrigger,\n createAdvancedTrigger\n} from '../utils/trigger-helpers.js'\n\n// Preset builders\nexport {\n webhookTrigger,\n cronTrigger,\n eventTrigger,\n manualTrigger,\n apiTrigger\n} from '../utils/trigger-presets.js'\n\n// Common parameter sets for extending\nexport {\n webhookParameters,\n cronParameters,\n eventParameters\n} from '../utils/trigger-presets.js'"],"names":["createTriggerParameter","createTriggerParameters","createTrigger","createAdvancedTrigger","webhookTrigger","cronTrigger","eventTrigger","manualTrigger","apiTrigger","webhookParameters","cronParameters","eventParameters"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC,GAED,eAAe;AACf,SACEA,sBAAsB,EACtBC,uBAAuB,EACvBC,aAAa,EACbC,qBAAqB,QAChB,8BAA6B;AAEpC,kBAAkB;AAClB,SACEC,cAAc,EACdC,WAAW,EACXC,YAAY,EACZC,aAAa,EACbC,UAAU,QACL,8BAA6B;AAEpC,sCAAsC;AACtC,SACEC,iBAAiB,EACjBC,cAAc,EACdC,eAAe,QACV,8BAA6B"}
1
+ {"version":3,"sources":["../../src/exports/helpers.ts"],"sourcesContent":["/**\n * Trigger builder helpers for creating custom triggers with less boilerplate\n * \n * @example\n * ```typescript\n * import { createTrigger, createTriggerField, webhookTrigger } from '@xtr-dev/payload-automation/helpers'\n * \n * // Simple trigger with array of fields\n * const myTrigger = createTrigger('my-trigger', [\n * { name: 'apiKey', type: 'text', required: true },\n * { name: 'timeout', type: 'number', defaultValue: 30 }\n * ])\n * \n * // Single field with virtual storage\n * const field = createTriggerField(\n * { name: 'webhookUrl', type: 'text', required: true },\n * 'my-trigger'\n * )\n * \n * // Webhook trigger preset\n * const orderWebhook = webhookTrigger('order-webhook')\n * ```\n */\n\n// Core helpers\nexport {\n createTriggerField,\n createTrigger\n} from '../utils/trigger-helpers.js'\n\n// Preset builders\nexport {\n webhookTrigger,\n cronTrigger,\n eventTrigger,\n manualTrigger,\n apiTrigger\n} from '../utils/trigger-presets.js'"],"names":["createTriggerField","createTrigger","webhookTrigger","cronTrigger","eventTrigger","manualTrigger","apiTrigger"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC,GAED,eAAe;AACf,SACEA,kBAAkB,EAClBC,aAAa,QACR,8BAA6B;AAEpC,kBAAkB;AAClB,SACEC,cAAc,EACdC,WAAW,EACXC,YAAY,EACZC,aAAa,EACbC,UAAU,QACL,8BAA6B"}