@xtr-dev/payload-automation 0.0.21 → 0.0.23
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 +73 -2
- package/dist/collections/Workflow.js +19 -7
- package/dist/collections/Workflow.js.map +1 -1
- package/dist/collections/WorkflowRuns.js +14 -7
- package/dist/collections/WorkflowRuns.js.map +1 -1
- package/dist/components/StatusCell.d.ts +6 -0
- package/dist/components/StatusCell.js +75 -0
- package/dist/components/StatusCell.js.map +1 -0
- package/dist/components/WorkflowExecutionStatus.d.ts +6 -0
- package/dist/components/WorkflowExecutionStatus.js +287 -0
- package/dist/components/WorkflowExecutionStatus.js.map +1 -0
- package/dist/core/workflow-executor.d.ts +32 -0
- package/dist/core/workflow-executor.js +162 -7
- package/dist/core/workflow-executor.js.map +1 -1
- package/dist/exports/client.d.ts +2 -0
- package/dist/exports/client.js +4 -1
- package/dist/exports/client.js.map +1 -1
- package/dist/plugin/index.js +131 -42
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/init-step-tasks.js +15 -1
- package/dist/plugin/init-step-tasks.js.map +1 -1
- package/dist/steps/create-document.js +1 -1
- package/dist/steps/create-document.js.map +1 -1
- package/dist/steps/delete-document.js +2 -2
- package/dist/steps/delete-document.js.map +1 -1
- package/dist/steps/http-request-handler.js +229 -10
- package/dist/steps/http-request-handler.js.map +1 -1
- package/dist/steps/http-request.d.ts +147 -4
- package/dist/steps/http-request.js +189 -3
- package/dist/steps/http-request.js.map +1 -1
- package/dist/steps/read-document.js +2 -2
- package/dist/steps/read-document.js.map +1 -1
- package/dist/steps/send-email.js +5 -5
- package/dist/steps/send-email.js.map +1 -1
- package/dist/steps/update-document.js +2 -2
- package/dist/steps/update-document.js.map +1 -1
- package/dist/test/create-document-step.test.js +378 -0
- package/dist/test/create-document-step.test.js.map +1 -0
- package/dist/test/http-request-step.test.js +361 -0
- package/dist/test/http-request-step.test.js.map +1 -0
- package/dist/test/workflow-executor.test.js +530 -0
- package/dist/test/workflow-executor.test.js.map +1 -0
- package/package.json +4 -1
- package/dist/test/basic.test.d.ts +0 -1
|
@@ -5,13 +5,199 @@ export const HttpRequestStepTask = {
|
|
|
5
5
|
inputSchema: [
|
|
6
6
|
{
|
|
7
7
|
name: 'url',
|
|
8
|
-
type: 'text'
|
|
8
|
+
type: 'text',
|
|
9
|
+
admin: {
|
|
10
|
+
description: 'The URL to make the HTTP request to'
|
|
11
|
+
},
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'method',
|
|
16
|
+
type: 'select',
|
|
17
|
+
options: [
|
|
18
|
+
{
|
|
19
|
+
label: 'GET',
|
|
20
|
+
value: 'GET'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: 'POST',
|
|
24
|
+
value: 'POST'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: 'PUT',
|
|
28
|
+
value: 'PUT'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'DELETE',
|
|
32
|
+
value: 'DELETE'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'PATCH',
|
|
36
|
+
value: 'PATCH'
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
defaultValue: 'GET',
|
|
40
|
+
admin: {
|
|
41
|
+
description: 'HTTP method to use'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'headers',
|
|
46
|
+
type: 'json',
|
|
47
|
+
admin: {
|
|
48
|
+
description: 'HTTP headers as JSON object (e.g., {"Content-Type": "application/json"})'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'body',
|
|
53
|
+
type: 'json',
|
|
54
|
+
admin: {
|
|
55
|
+
condition: (_, siblingData)=>siblingData?.method !== 'GET' && siblingData?.method !== 'DELETE',
|
|
56
|
+
description: 'Request body data. Use JSONPath to reference values (e.g., {"postId": "$.trigger.doc.id", "title": "$.trigger.doc.title"})'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'timeout',
|
|
61
|
+
type: 'number',
|
|
62
|
+
defaultValue: 30000,
|
|
63
|
+
admin: {
|
|
64
|
+
description: 'Request timeout in milliseconds (default: 30000)'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'authentication',
|
|
69
|
+
type: 'group',
|
|
70
|
+
fields: [
|
|
71
|
+
{
|
|
72
|
+
name: 'type',
|
|
73
|
+
type: 'select',
|
|
74
|
+
options: [
|
|
75
|
+
{
|
|
76
|
+
label: 'None',
|
|
77
|
+
value: 'none'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: 'Bearer Token',
|
|
81
|
+
value: 'bearer'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: 'Basic Auth',
|
|
85
|
+
value: 'basic'
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: 'API Key Header',
|
|
89
|
+
value: 'apikey'
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
defaultValue: 'none',
|
|
93
|
+
admin: {
|
|
94
|
+
description: 'Authentication method'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: 'token',
|
|
99
|
+
type: 'text',
|
|
100
|
+
admin: {
|
|
101
|
+
condition: (_, siblingData)=>siblingData?.type === 'bearer',
|
|
102
|
+
description: 'Bearer token value'
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'username',
|
|
107
|
+
type: 'text',
|
|
108
|
+
admin: {
|
|
109
|
+
condition: (_, siblingData)=>siblingData?.type === 'basic',
|
|
110
|
+
description: 'Basic auth username'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'password',
|
|
115
|
+
type: 'text',
|
|
116
|
+
admin: {
|
|
117
|
+
condition: (_, siblingData)=>siblingData?.type === 'basic',
|
|
118
|
+
description: 'Basic auth password'
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'headerName',
|
|
123
|
+
type: 'text',
|
|
124
|
+
admin: {
|
|
125
|
+
condition: (_, siblingData)=>siblingData?.type === 'apikey',
|
|
126
|
+
description: 'API key header name (e.g., "X-API-Key")'
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'headerValue',
|
|
131
|
+
type: 'text',
|
|
132
|
+
admin: {
|
|
133
|
+
condition: (_, siblingData)=>siblingData?.type === 'apikey',
|
|
134
|
+
description: 'API key value'
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'retries',
|
|
141
|
+
type: 'number',
|
|
142
|
+
defaultValue: 0,
|
|
143
|
+
min: 0,
|
|
144
|
+
max: 5,
|
|
145
|
+
admin: {
|
|
146
|
+
description: 'Number of retry attempts on failure (max: 5)'
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'retryDelay',
|
|
151
|
+
type: 'number',
|
|
152
|
+
defaultValue: 1000,
|
|
153
|
+
admin: {
|
|
154
|
+
condition: (_, siblingData)=>(siblingData?.retries || 0) > 0,
|
|
155
|
+
description: 'Delay between retries in milliseconds'
|
|
156
|
+
}
|
|
9
157
|
}
|
|
10
158
|
],
|
|
11
159
|
outputSchema: [
|
|
12
160
|
{
|
|
13
|
-
name: '
|
|
14
|
-
type: '
|
|
161
|
+
name: 'status',
|
|
162
|
+
type: 'number',
|
|
163
|
+
admin: {
|
|
164
|
+
description: 'HTTP status code'
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'statusText',
|
|
169
|
+
type: 'text',
|
|
170
|
+
admin: {
|
|
171
|
+
description: 'HTTP status text'
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'headers',
|
|
176
|
+
type: 'json',
|
|
177
|
+
admin: {
|
|
178
|
+
description: 'Response headers'
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: 'body',
|
|
183
|
+
type: 'textarea',
|
|
184
|
+
admin: {
|
|
185
|
+
description: 'Response body'
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'data',
|
|
190
|
+
type: 'json',
|
|
191
|
+
admin: {
|
|
192
|
+
description: 'Parsed response data (if JSON)'
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: 'duration',
|
|
197
|
+
type: 'number',
|
|
198
|
+
admin: {
|
|
199
|
+
description: 'Request duration in milliseconds'
|
|
200
|
+
}
|
|
15
201
|
}
|
|
16
202
|
]
|
|
17
203
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/http-request.ts"],"sourcesContent":["import type {TaskConfig} from \"payload\"\n\nimport {httpStepHandler} from \"./http-request-handler.js\"\n\nexport const HttpRequestStepTask = {\n slug: 'http-request-step',\n handler: httpStepHandler,\n inputSchema: [\n {\n name: 'url',\n type: 'text',\n }\n ],\n outputSchema: [\n {\n name: '
|
|
1
|
+
{"version":3,"sources":["../../src/steps/http-request.ts"],"sourcesContent":["import type {TaskConfig} from \"payload\"\n\nimport {httpStepHandler} from \"./http-request-handler.js\"\n\nexport const HttpRequestStepTask = {\n slug: 'http-request-step',\n handler: httpStepHandler,\n inputSchema: [\n {\n name: 'url',\n type: 'text',\n admin: {\n description: 'The URL to make the HTTP request to'\n },\n required: true\n },\n {\n name: 'method',\n type: 'select',\n options: [\n { label: 'GET', value: 'GET' },\n { label: 'POST', value: 'POST' },\n { label: 'PUT', value: 'PUT' },\n { label: 'DELETE', value: 'DELETE' },\n { label: 'PATCH', value: 'PATCH' }\n ],\n defaultValue: 'GET',\n admin: {\n description: 'HTTP method to use'\n }\n },\n {\n name: 'headers',\n type: 'json',\n admin: {\n description: 'HTTP headers as JSON object (e.g., {\"Content-Type\": \"application/json\"})'\n }\n },\n {\n name: 'body',\n type: 'json',\n admin: {\n condition: (_, siblingData) => siblingData?.method !== 'GET' && siblingData?.method !== 'DELETE',\n description: 'Request body data. Use JSONPath to reference values (e.g., {\"postId\": \"$.trigger.doc.id\", \"title\": \"$.trigger.doc.title\"})'\n }\n },\n {\n name: 'timeout',\n type: 'number',\n defaultValue: 30000,\n admin: {\n description: 'Request timeout in milliseconds (default: 30000)'\n }\n },\n {\n name: 'authentication',\n type: 'group',\n fields: [\n {\n name: 'type',\n type: 'select',\n options: [\n { label: 'None', value: 'none' },\n { label: 'Bearer Token', value: 'bearer' },\n { label: 'Basic Auth', value: 'basic' },\n { label: 'API Key Header', value: 'apikey' }\n ],\n defaultValue: 'none',\n admin: {\n description: 'Authentication method'\n }\n },\n {\n name: 'token',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'bearer',\n description: 'Bearer token value'\n }\n },\n {\n name: 'username',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'basic',\n description: 'Basic auth username'\n }\n },\n {\n name: 'password',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'basic',\n description: 'Basic auth password'\n }\n },\n {\n name: 'headerName',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'apikey',\n description: 'API key header name (e.g., \"X-API-Key\")'\n }\n },\n {\n name: 'headerValue',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'apikey',\n description: 'API key value'\n }\n }\n ]\n },\n {\n name: 'retries',\n type: 'number',\n defaultValue: 0,\n min: 0,\n max: 5,\n admin: {\n description: 'Number of retry attempts on failure (max: 5)'\n }\n },\n {\n name: 'retryDelay',\n type: 'number',\n defaultValue: 1000,\n admin: {\n condition: (_, siblingData) => (siblingData?.retries || 0) > 0,\n description: 'Delay between retries in milliseconds'\n }\n }\n ],\n outputSchema: [\n {\n name: 'status',\n type: 'number',\n admin: {\n description: 'HTTP status code'\n }\n },\n {\n name: 'statusText',\n type: 'text',\n admin: {\n description: 'HTTP status text'\n }\n },\n {\n name: 'headers',\n type: 'json',\n admin: {\n description: 'Response headers'\n }\n },\n {\n name: 'body',\n type: 'textarea',\n admin: {\n description: 'Response body'\n }\n },\n {\n name: 'data',\n type: 'json',\n admin: {\n description: 'Parsed response data (if JSON)'\n }\n },\n {\n name: 'duration',\n type: 'number',\n admin: {\n description: 'Request duration in milliseconds'\n }\n }\n ]\n} satisfies TaskConfig<'http-request-step'>\n"],"names":["httpStepHandler","HttpRequestStepTask","slug","handler","inputSchema","name","type","admin","description","required","options","label","value","defaultValue","condition","_","siblingData","method","fields","min","max","retries","outputSchema"],"mappings":"AAEA,SAAQA,eAAe,QAAO,4BAA2B;AAEzD,OAAO,MAAMC,sBAAsB;IACjCC,MAAM;IACNC,SAASH;IACTI,aAAa;QACX;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNI,SAAS;gBACP;oBAAEC,OAAO;oBAAOC,OAAO;gBAAM;gBAC7B;oBAAED,OAAO;oBAAQC,OAAO;gBAAO;gBAC/B;oBAAED,OAAO;oBAAOC,OAAO;gBAAM;gBAC7B;oBAAED,OAAO;oBAAUC,OAAO;gBAAS;gBACnC;oBAAED,OAAO;oBAASC,OAAO;gBAAQ;aAClC;YACDC,cAAc;YACdN,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLO,WAAW,CAACC,GAAGC,cAAgBA,aAAaC,WAAW,SAASD,aAAaC,WAAW;gBACxFT,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNO,cAAc;YACdN,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNY,QAAQ;gBACN;oBACEb,MAAM;oBACNC,MAAM;oBACNI,SAAS;wBACP;4BAAEC,OAAO;4BAAQC,OAAO;wBAAO;wBAC/B;4BAAED,OAAO;4BAAgBC,OAAO;wBAAS;wBACzC;4BAAED,OAAO;4BAAcC,OAAO;wBAAQ;wBACtC;4BAAED,OAAO;4BAAkBC,OAAO;wBAAS;qBAC5C;oBACDC,cAAc;oBACdN,OAAO;wBACLC,aAAa;oBACf;gBACF;gBACA;oBACEH,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLO,WAAW,CAACC,GAAGC,cAAgBA,aAAaV,SAAS;wBACrDE,aAAa;oBACf;gBACF;gBACA;oBACEH,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLO,WAAW,CAACC,GAAGC,cAAgBA,aAAaV,SAAS;wBACrDE,aAAa;oBACf;gBACF;gBACA;oBACEH,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLO,WAAW,CAACC,GAAGC,cAAgBA,aAAaV,SAAS;wBACrDE,aAAa;oBACf;gBACF;gBACA;oBACEH,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLO,WAAW,CAACC,GAAGC,cAAgBA,aAAaV,SAAS;wBACrDE,aAAa;oBACf;gBACF;gBACA;oBACEH,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLO,WAAW,CAACC,GAAGC,cAAgBA,aAAaV,SAAS;wBACrDE,aAAa;oBACf;gBACF;aACD;QACH;QACA;YACEH,MAAM;YACNC,MAAM;YACNO,cAAc;YACdM,KAAK;YACLC,KAAK;YACLb,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNO,cAAc;YACdN,OAAO;gBACLO,WAAW,CAACC,GAAGC,cAAgB,AAACA,CAAAA,aAAaK,WAAW,CAAA,IAAK;gBAC7Db,aAAa;YACf;QACF;KACD;IACDc,cAAc;QACZ;YACEjB,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;KACD;AACH,EAA2C"}
|
|
@@ -15,14 +15,14 @@ export const ReadDocumentStepTask = {
|
|
|
15
15
|
name: 'id',
|
|
16
16
|
type: 'text',
|
|
17
17
|
admin: {
|
|
18
|
-
description: 'The ID of a specific document to read (
|
|
18
|
+
description: 'The ID of a specific document to read. Use JSONPath (e.g., "$.trigger.doc.relatedId"). Leave empty to find multiple.'
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
name: 'where',
|
|
23
23
|
type: 'json',
|
|
24
24
|
admin: {
|
|
25
|
-
description: 'Query conditions to find documents
|
|
25
|
+
description: 'Query conditions to find documents when ID is not provided. Use JSONPath in values (e.g., {"category": "$.trigger.doc.category", "status": "published"})'
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/read-document.ts"],"sourcesContent":["import type { TaskConfig } from \"payload\"\n\nimport { readDocumentHandler } from \"./read-document-handler.js\"\n\nexport const ReadDocumentStepTask = {\n slug: 'read-document',\n handler: readDocumentHandler,\n inputSchema: [\n {\n name: 'collectionSlug',\n type: 'text',\n admin: {\n description: 'The collection slug to read from'\n },\n required: true\n },\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'The ID of a specific document to read (
|
|
1
|
+
{"version":3,"sources":["../../src/steps/read-document.ts"],"sourcesContent":["import type { TaskConfig } from \"payload\"\n\nimport { readDocumentHandler } from \"./read-document-handler.js\"\n\nexport const ReadDocumentStepTask = {\n slug: 'read-document',\n handler: readDocumentHandler,\n inputSchema: [\n {\n name: 'collectionSlug',\n type: 'text',\n admin: {\n description: 'The collection slug to read from'\n },\n required: true\n },\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'The ID of a specific document to read. Use JSONPath (e.g., \"$.trigger.doc.relatedId\"). Leave empty to find multiple.'\n }\n },\n {\n name: 'where',\n type: 'json',\n admin: {\n description: 'Query conditions to find documents when ID is not provided. Use JSONPath in values (e.g., {\"category\": \"$.trigger.doc.category\", \"status\": \"published\"})'\n }\n },\n {\n name: 'limit',\n type: 'number',\n admin: {\n description: 'Maximum number of documents to return (default: 10)'\n }\n },\n {\n name: 'sort',\n type: 'text',\n admin: {\n description: 'Field to sort by (prefix with - for descending order)'\n }\n },\n {\n name: 'locale',\n type: 'text',\n admin: {\n description: 'Locale for the document (if localization is enabled)'\n }\n },\n {\n name: 'depth',\n type: 'number',\n admin: {\n description: 'Depth of relationships to populate (0-10)'\n }\n }\n ],\n outputSchema: [\n {\n name: 'doc',\n type: 'json',\n admin: {\n description: 'The document(s) found'\n }\n },\n {\n name: 'totalDocs',\n type: 'number',\n admin: {\n description: 'Total number of documents matching the query'\n }\n }\n ]\n} satisfies TaskConfig<'read-document'>"],"names":["readDocumentHandler","ReadDocumentStepTask","slug","handler","inputSchema","name","type","admin","description","required","outputSchema"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ,6BAA4B;AAEhE,OAAO,MAAMC,uBAAuB;IAClCC,MAAM;IACNC,SAASH;IACTI,aAAa;QACX;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;KACD;IACDE,cAAc;QACZ;YACEL,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;KACD;AACH,EAAuC"}
|
package/dist/steps/send-email.js
CHANGED
|
@@ -7,7 +7,7 @@ export const SendEmailStepTask = {
|
|
|
7
7
|
name: 'to',
|
|
8
8
|
type: 'text',
|
|
9
9
|
admin: {
|
|
10
|
-
description: 'Recipient email address'
|
|
10
|
+
description: 'Recipient email address. Use JSONPath for dynamic values (e.g., "$.trigger.doc.email" or "$.trigger.user.email")'
|
|
11
11
|
},
|
|
12
12
|
required: true
|
|
13
13
|
},
|
|
@@ -15,14 +15,14 @@ export const SendEmailStepTask = {
|
|
|
15
15
|
name: 'from',
|
|
16
16
|
type: 'text',
|
|
17
17
|
admin: {
|
|
18
|
-
description: 'Sender email address (
|
|
18
|
+
description: 'Sender email address. Use JSONPath if needed (e.g., "$.trigger.doc.senderEmail"). Uses default if not provided.'
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
name: 'subject',
|
|
23
23
|
type: 'text',
|
|
24
24
|
admin: {
|
|
25
|
-
description: 'Email subject line'
|
|
25
|
+
description: 'Email subject line. Can include JSONPath references (e.g., "Order #$.trigger.doc.orderNumber received")'
|
|
26
26
|
},
|
|
27
27
|
required: true
|
|
28
28
|
},
|
|
@@ -30,14 +30,14 @@ export const SendEmailStepTask = {
|
|
|
30
30
|
name: 'text',
|
|
31
31
|
type: 'textarea',
|
|
32
32
|
admin: {
|
|
33
|
-
description: 'Plain text email content'
|
|
33
|
+
description: 'Plain text email content. Use JSONPath to include dynamic content (e.g., "Dear $.trigger.doc.customerName, your order #$.trigger.doc.id has been received.")'
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
name: 'html',
|
|
38
38
|
type: 'textarea',
|
|
39
39
|
admin: {
|
|
40
|
-
description: 'HTML email content (
|
|
40
|
+
description: 'HTML email content. Use JSONPath for dynamic values (e.g., "<h1>Order #$.trigger.doc.orderNumber</h1>")'
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/send-email.ts"],"sourcesContent":["import type { TaskConfig } from \"payload\"\n\nimport { sendEmailHandler } from \"./send-email-handler.js\"\n\nexport const SendEmailStepTask = {\n slug: 'send-email',\n handler: sendEmailHandler,\n inputSchema: [\n {\n name: 'to',\n type: 'text',\n admin: {\n description: 'Recipient email address'\n },\n required: true\n },\n {\n name: 'from',\n type: 'text',\n admin: {\n description: 'Sender email address (
|
|
1
|
+
{"version":3,"sources":["../../src/steps/send-email.ts"],"sourcesContent":["import type { TaskConfig } from \"payload\"\n\nimport { sendEmailHandler } from \"./send-email-handler.js\"\n\nexport const SendEmailStepTask = {\n slug: 'send-email',\n handler: sendEmailHandler,\n inputSchema: [\n {\n name: 'to',\n type: 'text',\n admin: {\n description: 'Recipient email address. Use JSONPath for dynamic values (e.g., \"$.trigger.doc.email\" or \"$.trigger.user.email\")'\n },\n required: true\n },\n {\n name: 'from',\n type: 'text',\n admin: {\n description: 'Sender email address. Use JSONPath if needed (e.g., \"$.trigger.doc.senderEmail\"). Uses default if not provided.'\n }\n },\n {\n name: 'subject',\n type: 'text',\n admin: {\n description: 'Email subject line. Can include JSONPath references (e.g., \"Order #$.trigger.doc.orderNumber received\")'\n },\n required: true\n },\n {\n name: 'text',\n type: 'textarea',\n admin: {\n description: 'Plain text email content. Use JSONPath to include dynamic content (e.g., \"Dear $.trigger.doc.customerName, your order #$.trigger.doc.id has been received.\")'\n }\n },\n {\n name: 'html',\n type: 'textarea',\n admin: {\n description: 'HTML email content. Use JSONPath for dynamic values (e.g., \"<h1>Order #$.trigger.doc.orderNumber</h1>\")'\n }\n },\n {\n name: 'cc',\n type: 'text',\n admin: {\n description: 'CC recipients'\n },\n hasMany: true\n },\n {\n name: 'bcc',\n type: 'text',\n admin: {\n description: 'BCC recipients'\n },\n hasMany: true\n }\n ],\n outputSchema: [\n {\n name: 'messageId',\n type: 'text',\n admin: {\n description: 'Email message ID from the mail server'\n }\n },\n {\n name: 'response',\n type: 'text',\n admin: {\n description: 'Response from the mail server'\n }\n }\n ]\n} satisfies TaskConfig<'send-email'>"],"names":["sendEmailHandler","SendEmailStepTask","slug","handler","inputSchema","name","type","admin","description","required","hasMany","outputSchema"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ,0BAAyB;AAE1D,OAAO,MAAMC,oBAAoB;IAC/BC,MAAM;IACNC,SAASH;IACTI,aAAa;QACX;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAE,SAAS;QACX;QACA;YACEL,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAE,SAAS;QACX;KACD;IACDC,cAAc;QACZ;YACEN,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;KACD;AACH,EAAoC"}
|
|
@@ -15,7 +15,7 @@ export const UpdateDocumentStepTask = {
|
|
|
15
15
|
name: 'id',
|
|
16
16
|
type: 'text',
|
|
17
17
|
admin: {
|
|
18
|
-
description: 'The ID of the document to update'
|
|
18
|
+
description: 'The ID of the document to update. Use JSONPath to reference IDs (e.g., "$.trigger.doc.id" or "$.steps.previousStep.output.id")'
|
|
19
19
|
},
|
|
20
20
|
required: true
|
|
21
21
|
},
|
|
@@ -23,7 +23,7 @@ export const UpdateDocumentStepTask = {
|
|
|
23
23
|
name: 'data',
|
|
24
24
|
type: 'json',
|
|
25
25
|
admin: {
|
|
26
|
-
description: 'The data to update the document with'
|
|
26
|
+
description: 'The data to update the document with. Use JSONPath to reference values (e.g., {"status": "$.trigger.doc.status", "updatedBy": "$.trigger.user.id"})'
|
|
27
27
|
},
|
|
28
28
|
required: true
|
|
29
29
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/steps/update-document.ts"],"sourcesContent":["import type { TaskConfig } from \"payload\"\n\nimport { updateDocumentHandler } from \"./update-document-handler.js\"\n\nexport const UpdateDocumentStepTask = {\n slug: 'update-document',\n handler: updateDocumentHandler,\n inputSchema: [\n {\n name: 'collectionSlug',\n type: 'text',\n admin: {\n description: 'The collection slug to update a document in'\n },\n required: true\n },\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'The ID of the document to update'\n },\n required: true\n },\n {\n name: 'data',\n type: 'json',\n admin: {\n description: 'The data to update the document with'\n },\n required: true\n },\n {\n name: 'draft',\n type: 'checkbox',\n admin: {\n description: 'Update as draft (if collection has drafts enabled)'\n }\n },\n {\n name: 'locale',\n type: 'text',\n admin: {\n description: 'Locale for the document (if localization is enabled)'\n }\n }\n ],\n outputSchema: [\n {\n name: 'doc',\n type: 'json',\n admin: {\n description: 'The updated document'\n }\n },\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'The ID of the updated document'\n }\n }\n ]\n} satisfies TaskConfig<'update-document'>"],"names":["updateDocumentHandler","UpdateDocumentStepTask","slug","handler","inputSchema","name","type","admin","description","required","outputSchema"],"mappings":"AAEA,SAASA,qBAAqB,QAAQ,+BAA8B;AAEpE,OAAO,MAAMC,yBAAyB;IACpCC,MAAM;IACNC,SAASH;IACTI,aAAa;QACX;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;KACD;IACDE,cAAc;QACZ;YACEL,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;KACD;AACH,EAAyC"}
|
|
1
|
+
{"version":3,"sources":["../../src/steps/update-document.ts"],"sourcesContent":["import type { TaskConfig } from \"payload\"\n\nimport { updateDocumentHandler } from \"./update-document-handler.js\"\n\nexport const UpdateDocumentStepTask = {\n slug: 'update-document',\n handler: updateDocumentHandler,\n inputSchema: [\n {\n name: 'collectionSlug',\n type: 'text',\n admin: {\n description: 'The collection slug to update a document in'\n },\n required: true\n },\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'The ID of the document to update. Use JSONPath to reference IDs (e.g., \"$.trigger.doc.id\" or \"$.steps.previousStep.output.id\")'\n },\n required: true\n },\n {\n name: 'data',\n type: 'json',\n admin: {\n description: 'The data to update the document with. Use JSONPath to reference values (e.g., {\"status\": \"$.trigger.doc.status\", \"updatedBy\": \"$.trigger.user.id\"})'\n },\n required: true\n },\n {\n name: 'draft',\n type: 'checkbox',\n admin: {\n description: 'Update as draft (if collection has drafts enabled)'\n }\n },\n {\n name: 'locale',\n type: 'text',\n admin: {\n description: 'Locale for the document (if localization is enabled)'\n }\n }\n ],\n outputSchema: [\n {\n name: 'doc',\n type: 'json',\n admin: {\n description: 'The updated document'\n }\n },\n {\n name: 'id',\n type: 'text',\n admin: {\n description: 'The ID of the updated document'\n }\n }\n ]\n} satisfies TaskConfig<'update-document'>"],"names":["updateDocumentHandler","UpdateDocumentStepTask","slug","handler","inputSchema","name","type","admin","description","required","outputSchema"],"mappings":"AAEA,SAASA,qBAAqB,QAAQ,+BAA8B;AAEpE,OAAO,MAAMC,yBAAyB;IACpCC,MAAM;IACNC,SAASH;IACTI,aAAa;QACX;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;YACAC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;KACD;IACDE,cAAc;QACZ;YACEL,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aAAa;YACf;QACF;KACD;AACH,EAAyC"}
|