shared.js 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780
  1. export const tasks = {
  2. trigger: {
  3. name: 'Trigger',
  4. description: 'Block where workflow will start executing',
  5. icon: 'riFlashlightLine',
  6. component: 'BlockBasic',
  7. editComponent: 'EditTrigger',
  8. category: 'general',
  9. inputs: 0,
  10. outputs: 1,
  11. allowedInputs: true,
  12. maxConnection: 1,
  13. refDataKeys: ['url'],
  14. data: {
  15. disableBlock: false,
  16. description: '',
  17. type: 'manual',
  18. interval: 60,
  19. delay: 5,
  20. date: '',
  21. time: '00:00',
  22. url: '',
  23. shortcut: '',
  24. activeInInput: false,
  25. isUrlRegex: false,
  26. days: [],
  27. contextMenuName: '',
  28. contextTypes: [],
  29. parameters: [],
  30. preferParamsInTab: false,
  31. observeElement: {
  32. selector: '',
  33. baseSelector: '',
  34. matchPattern: '',
  35. targetOptions: {
  36. subtree: false,
  37. childList: true,
  38. attributes: false,
  39. attributeFilter: [],
  40. characterData: false,
  41. },
  42. baseElOptions: {
  43. subtree: false,
  44. childList: true,
  45. attributes: false,
  46. attributeFilter: [],
  47. characterData: false,
  48. },
  49. },
  50. },
  51. },
  52. 'execute-workflow': {
  53. name: 'Execute workflow',
  54. description: '',
  55. icon: 'riFlowChart',
  56. component: 'BlockBasic',
  57. category: 'general',
  58. editComponent: 'EditExecuteWorkflow',
  59. inputs: 1,
  60. outputs: 1,
  61. allowedInputs: true,
  62. maxConnection: 1,
  63. refDataKeys: ['globalData'],
  64. data: {
  65. disableBlock: false,
  66. executeId: '',
  67. workflowId: '',
  68. globalData: '',
  69. description: '',
  70. insertAllVars: false,
  71. insertAllGlobalData: false,
  72. },
  73. },
  74. 'active-tab': {
  75. name: 'Active tab',
  76. description: "Set current tab that you're in as an active tab",
  77. icon: 'riWindowLine',
  78. component: 'BlockBasic',
  79. category: 'browser',
  80. disableEdit: true,
  81. inputs: 1,
  82. outputs: 1,
  83. allowedInputs: true,
  84. maxConnection: 1,
  85. data: {
  86. disableBlock: false,
  87. },
  88. },
  89. 'new-tab': {
  90. name: 'New tab',
  91. description: 'Create a new tab',
  92. icon: 'riGlobalLine',
  93. component: 'BlockBasic',
  94. editComponent: 'EditNewTab',
  95. category: 'browser',
  96. inputs: 1,
  97. outputs: 1,
  98. allowedInputs: true,
  99. maxConnection: 1,
  100. refDataKeys: ['url', 'userAgent'],
  101. data: {
  102. disableBlock: false,
  103. description: '',
  104. url: '',
  105. userAgent: '',
  106. active: true,
  107. tabZoom: 1,
  108. inGroup: false,
  109. waitTabLoaded: false,
  110. updatePrevTab: false,
  111. customUserAgent: false,
  112. },
  113. },
  114. 'switch-tab': {
  115. name: 'Switch tab',
  116. description: 'Switch active tab',
  117. icon: 'riArrowLeftRightLine',
  118. component: 'BlockBasic',
  119. editComponent: 'EditSwitchTab',
  120. category: 'browser',
  121. inputs: 1,
  122. outputs: 1,
  123. allowedInputs: true,
  124. maxConnection: 1,
  125. refDataKeys: ['url', 'matchPattern', 'tabTitle'],
  126. data: {
  127. disableBlock: false,
  128. description: '',
  129. url: '',
  130. tabIndex: 0,
  131. tabTitle: '',
  132. matchPattern: '',
  133. activeTab: true,
  134. createIfNoMatch: false,
  135. findTabBy: 'match-patterns',
  136. },
  137. },
  138. 'new-window': {
  139. name: 'New window',
  140. description: 'Create a new window',
  141. icon: 'riWindow2Line',
  142. component: 'BlockBasic',
  143. editComponent: 'EditNewWindow',
  144. category: 'browser',
  145. inputs: 1,
  146. outputs: 1,
  147. allowedInputs: true,
  148. maxConnection: 1,
  149. refDataKeys: ['url'],
  150. data: {
  151. disableBlock: false,
  152. description: '',
  153. top: 0,
  154. left: 0,
  155. width: 0,
  156. url: '',
  157. height: 0,
  158. type: 'normal',
  159. incognito: false,
  160. windowState: 'normal',
  161. },
  162. },
  163. proxy: {
  164. name: 'Proxy',
  165. description: 'Set the proxy of the browser',
  166. icon: 'riShieldKeyholeLine',
  167. component: 'BlockBasic',
  168. category: 'browser',
  169. editComponent: 'EditProxy',
  170. inputs: 1,
  171. outputs: 1,
  172. maxConnection: 1,
  173. allowedInputs: true,
  174. refDataKeys: ['host', 'port', 'scheme'],
  175. data: {
  176. description: '',
  177. disableBlock: false,
  178. scheme: 'https',
  179. host: '',
  180. port: 443,
  181. bypassList: '',
  182. clearProxy: false,
  183. },
  184. },
  185. 'go-back': {
  186. name: 'Go back',
  187. description: 'Go back to the previous page',
  188. icon: 'riArrowGoBackLine',
  189. component: 'BlockBasic',
  190. category: 'browser',
  191. inputs: 1,
  192. outputs: 1,
  193. maxConnection: 1,
  194. disableEdit: true,
  195. allowedInputs: true,
  196. data: {
  197. disableBlock: false,
  198. },
  199. },
  200. 'forward-page': {
  201. name: 'Go forward',
  202. description: 'Go forward to the next page',
  203. icon: 'riArrowGoForwardLine',
  204. component: 'BlockBasic',
  205. category: 'browser',
  206. inputs: 1,
  207. outputs: 1,
  208. maxConnection: 1,
  209. disableEdit: true,
  210. allowedInputs: true,
  211. data: {
  212. disableBlock: false,
  213. },
  214. },
  215. 'close-tab': {
  216. name: 'Close tab/window',
  217. icon: 'riCloseCircleLine',
  218. component: 'BlockBasic',
  219. category: 'browser',
  220. editComponent: 'EditCloseTab',
  221. inputs: 1,
  222. outputs: 1,
  223. maxConnection: 1,
  224. allowedInputs: true,
  225. refDataKeys: ['url'],
  226. data: {
  227. disableBlock: false,
  228. url: '',
  229. description: '',
  230. activeTab: true,
  231. closeType: 'tab',
  232. allWindows: false,
  233. },
  234. },
  235. 'take-screenshot': {
  236. name: 'Take screenshot',
  237. description: 'Take a screenshot of current active tab',
  238. icon: 'riImageLine',
  239. component: 'BlockBasic',
  240. category: 'browser',
  241. editComponent: 'EditTakeScreenshot',
  242. inputs: 1,
  243. outputs: 1,
  244. maxConnection: 1,
  245. allowedInputs: true,
  246. refDataKeys: ['fileName', 'selector', 'variableName'],
  247. autocomplete: ['variableName'],
  248. data: {
  249. description: '',
  250. disableBlock: false,
  251. fileName: '',
  252. ext: 'png',
  253. quality: 100,
  254. dataColumn: '',
  255. variableName: '',
  256. selector: '',
  257. fullPage: false,
  258. saveToColumn: false,
  259. saveToComputer: true,
  260. assignVariable: false,
  261. captureActiveTab: true,
  262. },
  263. },
  264. 'browser-event': {
  265. name: 'Browser event',
  266. description: 'Wait until the selected event is triggered',
  267. icon: 'riLightbulbLine',
  268. component: 'BlockBasic',
  269. category: 'browser',
  270. editComponent: 'EditBrowserEvent',
  271. inputs: 1,
  272. outputs: 1,
  273. maxConnection: 1,
  274. allowedInputs: true,
  275. data: {
  276. disableBlock: false,
  277. description: '',
  278. timeout: 10000,
  279. eventName: 'tab:loaded',
  280. setAsActiveTab: true,
  281. activeTabLoaded: true,
  282. tabLoadedUrl: '',
  283. tabUrl: '',
  284. fileQuery: '',
  285. },
  286. },
  287. 'event-click': {
  288. name: 'Click element',
  289. icon: 'riCursorLine',
  290. component: 'BlockBasic',
  291. editComponent: 'EditInteractionBase',
  292. category: 'interaction',
  293. inputs: 1,
  294. outputs: 1,
  295. allowedInputs: true,
  296. maxConnection: 1,
  297. refDataKeys: ['selector'],
  298. data: {
  299. disableBlock: false,
  300. description: '',
  301. findBy: 'cssSelector',
  302. waitForSelector: false,
  303. waitSelectorTimeout: 5000,
  304. selector: '',
  305. markEl: false,
  306. multiple: false,
  307. },
  308. },
  309. delay: {
  310. name: 'Delay',
  311. description: 'Add delay before executing the next block',
  312. icon: 'riTimerLine',
  313. component: 'BlockDelay',
  314. editComponent: 'EditDelay',
  315. category: 'general',
  316. inputs: 1,
  317. outputs: 1,
  318. allowedInputs: true,
  319. maxConnection: 1,
  320. refDataKeys: ['time'],
  321. data: {
  322. disableBlock: false,
  323. time: 500,
  324. },
  325. },
  326. 'get-text': {
  327. name: 'Get text',
  328. description: 'Get text from an element',
  329. icon: 'riParagraph',
  330. component: 'BlockBasic',
  331. editComponent: 'EditGetText',
  332. category: 'interaction',
  333. inputs: 1,
  334. outputs: 1,
  335. allowedInputs: true,
  336. maxConnection: 1,
  337. refDataKeys: [
  338. 'selector',
  339. 'variableName',
  340. 'prefixText',
  341. 'suffixText',
  342. 'extraRowValue',
  343. ],
  344. autocomplete: ['variableName'],
  345. data: {
  346. disableBlock: false,
  347. description: '',
  348. findBy: 'cssSelector',
  349. waitForSelector: false,
  350. waitSelectorTimeout: 5000,
  351. selector: '',
  352. markEl: false,
  353. multiple: false,
  354. regex: '',
  355. prefixText: '',
  356. suffixText: '',
  357. regexExp: [],
  358. dataColumn: '',
  359. saveData: true,
  360. includeTags: false,
  361. addExtraRow: false,
  362. assignVariable: false,
  363. useTextContent: false,
  364. variableName: '',
  365. extraRowValue: '',
  366. extraRowDataColumn: '',
  367. },
  368. },
  369. 'export-data': {
  370. name: 'Export data',
  371. icon: 'riDownloadLine',
  372. component: 'BlockBasic',
  373. editComponent: 'EditExportData',
  374. category: 'general',
  375. inputs: 1,
  376. outputs: 1,
  377. allowedInputs: true,
  378. maxConnection: 1,
  379. refDataKeys: ['name', 'variableName'],
  380. data: {
  381. disableBlock: false,
  382. name: '',
  383. refKey: '',
  384. type: 'json',
  385. description: '',
  386. variableName: '',
  387. csvDelimiter: ',',
  388. addBOMHeader: true,
  389. onConflict: 'uniquify',
  390. dataToExport: 'data-columns',
  391. },
  392. },
  393. 'element-scroll': {
  394. name: 'Scroll element',
  395. icon: 'riMouseLine',
  396. component: 'BlockBasic',
  397. editComponent: 'EditScrollElement',
  398. category: 'interaction',
  399. inputs: 1,
  400. outputs: 1,
  401. allowedInputs: true,
  402. maxConnection: 1,
  403. refDataKeys: ['selector'],
  404. data: {
  405. disableBlock: false,
  406. description: '',
  407. findBy: 'cssSelector',
  408. waitForSelector: false,
  409. waitSelectorTimeout: 5000,
  410. selector: 'html',
  411. markEl: false,
  412. multiple: false,
  413. scrollY: 0,
  414. scrollX: 0,
  415. incX: false,
  416. incY: false,
  417. smooth: false,
  418. scrollIntoView: false,
  419. },
  420. },
  421. link: {
  422. name: 'Link',
  423. description: 'Open link element',
  424. icon: 'riLink',
  425. component: 'BlockBasic',
  426. editComponent: 'EditLink',
  427. category: 'interaction',
  428. inputs: 1,
  429. outputs: 1,
  430. allowedInputs: true,
  431. maxConnection: 1,
  432. refDataKeys: ['selector'],
  433. data: {
  434. disableBlock: false,
  435. description: '',
  436. findBy: 'cssSelector',
  437. waitForSelector: false,
  438. waitSelectorTimeout: 5000,
  439. selector: '',
  440. markEl: false,
  441. disableMultiple: true,
  442. openInNewTab: false,
  443. },
  444. },
  445. 'attribute-value': {
  446. name: 'Attribute value',
  447. description: 'Get attribute value of an element',
  448. icon: 'riBracketsLine',
  449. component: 'BlockBasic',
  450. editComponent: 'EditAttributeValue',
  451. category: 'interaction',
  452. inputs: 1,
  453. outputs: 1,
  454. allowedInputs: true,
  455. maxConnection: 1,
  456. refDataKeys: [
  457. 'selector',
  458. 'variableName',
  459. 'attributeName',
  460. 'extraRowValue',
  461. 'attributeValue',
  462. ],
  463. autocomplete: ['variableName'],
  464. data: {
  465. disableBlock: false,
  466. description: '',
  467. findBy: 'cssSelector',
  468. waitForSelector: false,
  469. waitSelectorTimeout: 5000,
  470. selector: '',
  471. markEl: false,
  472. multiple: false,
  473. attributeValue: '',
  474. attributeName: '',
  475. assignVariable: false,
  476. variableName: '',
  477. dataColumn: '',
  478. saveData: true,
  479. action: 'get',
  480. addExtraRow: false,
  481. extraRowValue: '',
  482. extraRowDataColumn: '',
  483. },
  484. },
  485. forms: {
  486. name: 'Forms',
  487. icon: 'riInputCursorMove',
  488. description: 'Manipulate form(input, select, checkbox, and radio) element',
  489. component: 'BlockBasic',
  490. editComponent: 'EditForms',
  491. category: 'interaction',
  492. inputs: 1,
  493. outputs: 1,
  494. allowedInputs: true,
  495. maxConnection: 1,
  496. refDataKeys: [
  497. 'selector',
  498. 'variableName',
  499. 'value',
  500. 'optionPosition',
  501. 'delay',
  502. ],
  503. autocomplete: ['variableName'],
  504. data: {
  505. disableBlock: false,
  506. description: '',
  507. findBy: 'cssSelector',
  508. waitForSelector: false,
  509. waitSelectorTimeout: 5000,
  510. selector: '',
  511. markEl: false,
  512. multiple: false,
  513. selected: true,
  514. clearValue: true,
  515. getValue: false,
  516. saveData: false,
  517. dataColumn: '',
  518. selectOptionBy: 'value',
  519. optionPosition: '1',
  520. assignVariable: false,
  521. variableName: '',
  522. type: 'text-field',
  523. value: '',
  524. delay: 0,
  525. events: [],
  526. },
  527. },
  528. 'repeat-task': {
  529. name: 'Repeat task',
  530. icon: 'riRepeat2Line',
  531. component: 'BlockRepeatTask',
  532. category: 'conditions',
  533. inputs: 1,
  534. outputs: 2,
  535. allowedInputs: true,
  536. maxConnection: 1,
  537. refDataKeys: ['repeatFor'],
  538. data: {
  539. disableBlock: false,
  540. repeatFor: '1',
  541. },
  542. },
  543. 'javascript-code': {
  544. name: 'JavaScript code',
  545. description: 'Execute your custom javascript code in a webpage',
  546. icon: 'riCodeSSlashLine',
  547. component: 'BlockBasic',
  548. editComponent: 'EditJavascriptCode',
  549. category: 'interaction',
  550. inputs: 1,
  551. outputs: 1,
  552. allowedInputs: true,
  553. maxConnection: 1,
  554. data: {
  555. disableBlock: false,
  556. description: '',
  557. timeout: 20000,
  558. context: 'website',
  559. code: 'console.log("Hello world!");\nautomaNextBlock()',
  560. preloadScripts: [],
  561. everyNewTab: false,
  562. runBeforeLoad: false,
  563. },
  564. },
  565. 'trigger-event': {
  566. name: 'Trigger event',
  567. description: 'Trigger event',
  568. icon: 'riLightbulbFlashLine',
  569. component: 'BlockBasic',
  570. editComponent: 'EditTriggerEvent',
  571. category: 'interaction',
  572. inputs: 1,
  573. outputs: 1,
  574. allowedInputs: true,
  575. maxConnection: 1,
  576. refDataKeys: ['selector', 'eventParams.clientX', 'eventParams.clientY'],
  577. data: {
  578. disableBlock: false,
  579. description: '',
  580. findBy: 'cssSelector',
  581. waitForSelector: false,
  582. waitSelectorTimeout: 5000,
  583. selector: 'html',
  584. markEl: false,
  585. multiple: false,
  586. eventName: '',
  587. eventType: '',
  588. eventParams: { bubbles: true, cancelable: false },
  589. },
  590. },
  591. 'google-sheets': {
  592. name: 'Google sheets',
  593. description: 'Read Google Sheets data',
  594. icon: 'mdiGoogleSheet',
  595. component: 'BlockBasic',
  596. editComponent: 'EditGoogleSheets',
  597. category: 'onlineServices',
  598. inputs: 1,
  599. outputs: 1,
  600. allowedInputs: true,
  601. maxConnection: 1,
  602. refDataKeys: ['customData', 'range', 'spreadsheetId', 'variableName'],
  603. autocomplete: ['refKey'],
  604. data: {
  605. disableBlock: false,
  606. range: '',
  607. refKey: '',
  608. type: 'get',
  609. customData: '',
  610. description: '',
  611. spreadsheetId: '',
  612. dataColumn: '',
  613. saveData: true,
  614. assignVariable: false,
  615. variableName: '',
  616. firstRowAsKey: false,
  617. keysAsFirstRow: true,
  618. valueInputOption: 'RAW',
  619. InsertDataOption: 'INSERT_ROWS',
  620. dataFrom: 'data-columns',
  621. },
  622. },
  623. 'google-sheets-drive': {
  624. name: 'Google sheets (GDrive)',
  625. description: 'Read Google Sheets data',
  626. icon: 'riDriveFill',
  627. component: 'BlockBasic',
  628. editComponent: 'EditGoogleSheetsDrive',
  629. category: 'onlineServices',
  630. inputs: 1,
  631. outputs: 1,
  632. allowedInputs: true,
  633. maxConnection: 1,
  634. refDataKeys: [
  635. 'customData',
  636. 'range',
  637. 'spreadsheetId',
  638. 'sheetName',
  639. 'variableName',
  640. ],
  641. autocomplete: ['refKey'],
  642. data: {
  643. disableBlock: false,
  644. range: '',
  645. refKey: '',
  646. type: 'get',
  647. customData: '',
  648. description: '',
  649. spreadsheetId: '',
  650. dataColumn: '',
  651. inputSpreadsheetId: 'connected',
  652. saveData: true,
  653. sheetName: '',
  654. assignVariable: false,
  655. variableName: '',
  656. firstRowAsKey: false,
  657. keysAsFirstRow: true,
  658. valueInputOption: 'RAW',
  659. InsertDataOption: 'INSERT_ROWS',
  660. dataFrom: 'data-columns',
  661. },
  662. },
  663. 'google-drive': {
  664. name: 'Google drive',
  665. description: 'Upload files to Google Drive',
  666. icon: 'riDriveLine',
  667. component: 'BlockBasic',
  668. editComponent: 'EditGoogleDrive',
  669. category: 'onlineServices',
  670. inputs: 1,
  671. outputs: 1,
  672. allowedInputs: true,
  673. maxConnection: 1,
  674. refDataKeys: [],
  675. autocomplete: ['refKey'],
  676. data: {
  677. disableBlock: false,
  678. action: 'upload',
  679. filePaths: [],
  680. },
  681. },
  682. conditions: {
  683. name: 'Conditions',
  684. description: 'Conditional block',
  685. icon: 'riAB',
  686. component: 'BlockConditions',
  687. editComponent: 'EditConditions',
  688. category: 'conditions',
  689. inputs: 1,
  690. outputs: 0,
  691. allowedInputs: true,
  692. maxConnection: 1,
  693. data: {
  694. description: '',
  695. disableBlock: false,
  696. conditions: [],
  697. retryConditions: false,
  698. retryCount: 10,
  699. retryTimeout: 1000,
  700. },
  701. },
  702. 'element-exists': {
  703. name: 'Element exists',
  704. description: 'Check if an element is exists',
  705. icon: 'riFocus3Line',
  706. component: 'BlockElementExists',
  707. editComponent: 'EditElementExists',
  708. category: 'conditions',
  709. inputs: 1,
  710. outputs: 2,
  711. allowedInputs: true,
  712. maxConnection: 1,
  713. refDataKeys: ['selector'],
  714. data: {
  715. disableBlock: false,
  716. description: '',
  717. findBy: 'cssSelector',
  718. selector: '',
  719. tryCount: 1,
  720. timeout: 500,
  721. markEl: false,
  722. throwError: false,
  723. },
  724. },
  725. webhook: {
  726. name: 'HTTP Request',
  727. description: 'make an HTTP request',
  728. icon: 'riEarthLine',
  729. component: 'BlockBasicWithFallback',
  730. editComponent: 'EditWebhook',
  731. category: 'general',
  732. inputs: 1,
  733. outputs: 2,
  734. allowedInputs: true,
  735. maxConnection: 1,
  736. refDataKeys: ['body', 'url', 'variableName'],
  737. autocomplete: ['variableName'],
  738. data: {
  739. disableBlock: false,
  740. description: '',
  741. url: '',
  742. body: '{}',
  743. headers: [],
  744. method: 'POST',
  745. timeout: 10000,
  746. dataPath: '',
  747. contentType: 'json',
  748. variableName: '',
  749. assignVariable: false,
  750. saveData: false,
  751. dataColumn: '',
  752. responseType: 'json',
  753. },
  754. },
  755. 'while-loop': {
  756. name: 'While loop',
  757. description: 'Execute blocks while the condition is met',
  758. icon: 'riRefreshFill',
  759. component: 'BlockBasicWithFallback',
  760. editComponent: 'EditWhileLoop',
  761. category: 'conditions',
  762. inputs: 1,
  763. outputs: 2,
  764. allowedInputs: true,
  765. maxConnection: 1,
  766. data: {
  767. disableBlock: false,
  768. description: '',
  769. conditions: null,
  770. },
  771. },
  772. 'loop-data': {
  773. name: 'Loop data',
  774. icon: 'riRefreshLine',
  775. component: 'BlockBasic',
  776. editComponent: 'EditLoopData',
  777. category: 'conditions',
  778. inputs: 1,
  779. outputs: 1,
  780. allowedInputs: true,
  781. maxConnection: 1,
  782. refDataKeys: [
  783. 'maxLoop',
  784. 'loopData',
  785. 'selector',
  786. 'startIndex',
  787. 'variableName',
  788. 'referenceKey',
  789. 'elementSelector',
  790. ],
  791. autocomplete: ['variableName', 'loopId'],
  792. data: {
  793. disableBlock: false,
  794. loopId: '',
  795. maxLoop: 0,
  796. toNumber: 10,
  797. fromNumber: 1,
  798. startIndex: 0,
  799. loopData: '[]',
  800. description: '',
  801. variableName: '',
  802. referenceKey: '',
  803. reverseLoop: false,
  804. elementSelector: '',
  805. waitForSelector: false,
  806. waitSelectorTimeout: 5000,
  807. resumeLastWorkflow: false,
  808. loopThrough: 'data-columns',
  809. },
  810. },
  811. 'loop-elements': {
  812. name: 'Loop elements',
  813. icon: 'riRestartLine',
  814. component: 'BlockBasic',
  815. editComponent: 'EditLoopElements',
  816. category: 'conditions',
  817. inputs: 1,
  818. outputs: 1,
  819. allowedInputs: true,
  820. maxConnection: 1,
  821. refDataKeys: [
  822. 'maxLoop',
  823. 'selector',
  824. 'variableName',
  825. 'elementSelector',
  826. 'actionElSelector',
  827. ],
  828. autocomplete: ['loopId'],
  829. data: {
  830. disableBlock: false,
  831. loopId: '',
  832. selector: '',
  833. maxLoop: '0',
  834. description: '',
  835. reverseLoop: false,
  836. actionElSelector: '',
  837. findBy: 'cssSelector',
  838. actionElMaxWaitTime: 5,
  839. actionPageMaxWaitTime: 10,
  840. loadMoreAction: 'none',
  841. scrollToBottom: true,
  842. waitForSelector: false,
  843. waitSelectorTimeout: 5000,
  844. },
  845. },
  846. 'loop-breakpoint': {
  847. name: 'Loop breakpoint',
  848. description: 'To tell where loop data must stop',
  849. icon: 'riStopLine',
  850. component: 'BlockLoopBreakpoint',
  851. category: 'conditions',
  852. disableEdit: true,
  853. inputs: 1,
  854. outputs: 1,
  855. allowedInputs: true,
  856. maxConnection: 1,
  857. data: {
  858. disableBlock: false,
  859. loopId: '',
  860. clearLoop: false,
  861. },
  862. },
  863. 'blocks-group': {
  864. name: 'Blocks group',
  865. description: 'Grouping blocks',
  866. icon: 'riFolderZipLine',
  867. component: 'BlockGroup',
  868. category: 'general',
  869. disableEdit: true,
  870. inputs: 1,
  871. outputs: 1,
  872. allowedInputs: true,
  873. maxConnection: 1,
  874. data: {
  875. disableBlock: false,
  876. name: '',
  877. blocks: [],
  878. },
  879. },
  880. // 'blocks-group-2': {
  881. // name: 'Blocks group',
  882. // description: 'Grouping blocks',
  883. // icon: 'riFolderZipLine',
  884. // component: 'BlockGroup2',
  885. // category: 'general',
  886. // disableEdit: true,
  887. // inputs: 1,
  888. // outputs: 1,
  889. // allowedInputs: true,
  890. // maxConnection: 1,
  891. // data: {
  892. // disableBlock: false,
  893. // name: '',
  894. // width: 400,
  895. // height: 300,
  896. // borderColor: '#2563eb',
  897. // backgroundColor: 'rgb(37, 99, 235, 0.3)',
  898. // },
  899. // },
  900. clipboard: {
  901. name: 'Clipboard',
  902. description: 'Get the copied text from the clipboard',
  903. icon: 'riClipboardLine',
  904. component: 'BlockBasic',
  905. category: 'general',
  906. editComponent: 'EditClipboard',
  907. inputs: 1,
  908. outputs: 1,
  909. allowedInputs: true,
  910. maxConnection: 1,
  911. autocomplete: ['variableName'],
  912. refDataKeys: ['dataToCopy', 'variableName'],
  913. data: {
  914. disableBlock: false,
  915. description: '',
  916. type: 'get',
  917. assignVariable: false,
  918. variableName: '',
  919. saveData: true,
  920. dataColumn: '',
  921. dataToCopy: '',
  922. copySelectedText: false,
  923. },
  924. },
  925. 'insert-data': {
  926. name: 'Insert data',
  927. description: 'Insert data into table or variable',
  928. icon: 'riDatabase2Line',
  929. component: 'BlockBasic',
  930. category: 'data',
  931. editComponent: 'EditInsertData',
  932. inputs: 1,
  933. outputs: 1,
  934. allowedInputs: true,
  935. maxConnection: 1,
  936. data: {
  937. disableBlock: false,
  938. description: '',
  939. dataList: [],
  940. },
  941. },
  942. 'switch-to': {
  943. name: 'Switch frame',
  944. description: 'Switch between main window and iframe',
  945. icon: 'riArrowUpDownLine',
  946. component: 'BlockBasic',
  947. editComponent: 'EditSwitchTo',
  948. category: 'interaction',
  949. inputs: 1,
  950. outputs: 1,
  951. allowedInputs: true,
  952. maxConnection: 1,
  953. refDataKeys: ['selector'],
  954. data: {
  955. disableBlock: false,
  956. findBy: 'cssSelector',
  957. selector: '',
  958. windowType: 'main-window',
  959. },
  960. },
  961. 'upload-file': {
  962. name: 'Upload file',
  963. description: 'Upload file into <input type="file"> element',
  964. icon: 'riFileUploadLine',
  965. component: 'BlockBasic',
  966. editComponent: 'EditUploadFile',
  967. category: 'interaction',
  968. inputs: 1,
  969. outputs: 1,
  970. allowedInputs: true,
  971. maxConnection: 1,
  972. refDataKeys: ['selector', 'filePaths'],
  973. data: {
  974. disableBlock: false,
  975. findBy: 'cssSelector',
  976. waitForSelector: false,
  977. waitSelectorTimeout: 5000,
  978. selector: '',
  979. filePaths: [],
  980. },
  981. },
  982. 'hover-element': {
  983. name: 'Hover element',
  984. description: 'Hover over an element',
  985. icon: 'mdiCursorDefaultClickOutline',
  986. component: 'BlockBasic',
  987. editComponent: 'EditInteractionBase',
  988. category: 'interaction',
  989. inputs: 1,
  990. outputs: 1,
  991. allowedInputs: true,
  992. maxConnection: 1,
  993. refDataKeys: ['selector'],
  994. data: {
  995. disableBlock: false,
  996. description: '',
  997. findBy: 'cssSelector',
  998. waitForSelector: false,
  999. waitSelectorTimeout: 5000,
  1000. selector: '',
  1001. markEl: false,
  1002. multiple: false,
  1003. },
  1004. },
  1005. 'save-assets': {
  1006. name: 'Save assets',
  1007. description:
  1008. 'Save assets (image, video, audio, or file) from an element or URL',
  1009. icon: 'riImageLine',
  1010. component: 'BlockBasic',
  1011. editComponent: 'EditSaveAssets',
  1012. category: 'interaction',
  1013. inputs: 1,
  1014. outputs: 1,
  1015. allowedInputs: true,
  1016. maxConnection: 1,
  1017. refDataKeys: ['selector', 'url', 'filename', 'variableName'],
  1018. data: {
  1019. disableBlock: false,
  1020. description: '',
  1021. findBy: 'cssSelector',
  1022. waitForSelector: false,
  1023. waitSelectorTimeout: 5000,
  1024. selector: '',
  1025. markEl: false,
  1026. multiple: false,
  1027. type: 'element',
  1028. url: '',
  1029. filename: '',
  1030. saveDownloadIds: false,
  1031. onConflict: 'uniquify',
  1032. dataColumn: '',
  1033. saveData: true,
  1034. assignVariable: false,
  1035. variableName: '',
  1036. saveToGDrive: false,
  1037. },
  1038. },
  1039. 'press-key': {
  1040. name: 'Press key',
  1041. description: 'Press a key or a combination',
  1042. icon: 'riKeyboardLine',
  1043. component: 'BlockBasic',
  1044. editComponent: 'EditPressKey',
  1045. category: 'interaction',
  1046. inputs: 1,
  1047. outputs: 1,
  1048. allowedInputs: true,
  1049. maxConnection: 1,
  1050. refDataKeys: ['selector', 'keys', 'keysToPress', 'pressTime'],
  1051. data: {
  1052. disableBlock: false,
  1053. keys: '',
  1054. selector: '',
  1055. pressTime: '0',
  1056. description: '',
  1057. keysToPress: '',
  1058. action: 'press-key',
  1059. },
  1060. },
  1061. 'handle-dialog': {
  1062. name: 'Handle dialog',
  1063. description:
  1064. 'Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).',
  1065. icon: 'riChat3Line',
  1066. component: 'BlockBasic',
  1067. editComponent: 'EditHandleDialog',
  1068. category: 'browser',
  1069. inputs: 1,
  1070. outputs: 1,
  1071. allowedInputs: true,
  1072. maxConnection: 1,
  1073. refDataKeys: ['promptText'],
  1074. data: {
  1075. disableBlock: false,
  1076. description: '',
  1077. accept: true,
  1078. promptText: '',
  1079. },
  1080. },
  1081. 'handle-download': {
  1082. name: 'Handle download',
  1083. description: 'Handle downloaded file',
  1084. icon: 'riFileDownloadLine',
  1085. component: 'BlockBasic',
  1086. editComponent: 'EditHandleDownload',
  1087. category: 'browser',
  1088. inputs: 1,
  1089. outputs: 1,
  1090. allowedInputs: true,
  1091. maxConnection: 1,
  1092. refDataKeys: ['filename', 'downloadId', 'variableName'],
  1093. autocomplete: ['variableName'],
  1094. data: {
  1095. disableBlock: false,
  1096. description: '',
  1097. filename: '',
  1098. timeout: 20000,
  1099. onConflict: 'uniquify',
  1100. waitForDownload: true,
  1101. dataColumn: '',
  1102. saveData: true,
  1103. assignVariable: false,
  1104. variableName: '',
  1105. downloadId: '',
  1106. },
  1107. },
  1108. 'reload-tab': {
  1109. name: 'Reload tab',
  1110. description: 'Reload the active tab',
  1111. icon: 'riRestartLine',
  1112. component: 'BlockBasic',
  1113. category: 'browser',
  1114. inputs: 1,
  1115. outputs: 1,
  1116. allowedInputs: true,
  1117. maxConnection: 1,
  1118. disableEdit: true,
  1119. data: {
  1120. disableBlock: false,
  1121. },
  1122. },
  1123. 'delete-data': {
  1124. name: 'Delete data',
  1125. description: 'Delete table or variable data',
  1126. icon: 'riDeleteBin7Line',
  1127. editComponent: 'EditDeleteData',
  1128. component: 'BlockBasic',
  1129. category: 'data',
  1130. inputs: 1,
  1131. outputs: 1,
  1132. allowedInputs: true,
  1133. maxConnection: 1,
  1134. data: {
  1135. disableBlock: false,
  1136. description: '',
  1137. deleteList: [],
  1138. },
  1139. },
  1140. 'wait-connections': {
  1141. name: 'Wait connections',
  1142. description: 'Wait for all connections before continuing to the next block',
  1143. icon: 'riTimerFlashLine',
  1144. editComponent: 'EditWaitConnections',
  1145. component: 'BlockBasic',
  1146. category: 'general',
  1147. inputs: 1,
  1148. outputs: 1,
  1149. allowedInputs: true,
  1150. maxConnection: 1,
  1151. data: {
  1152. disableBlock: false,
  1153. description: '',
  1154. timeout: 10000,
  1155. specificFlow: false,
  1156. flowBlockId: '',
  1157. },
  1158. },
  1159. notification: {
  1160. name: 'Notification',
  1161. description: 'Display a notification',
  1162. icon: 'riNotification3Line',
  1163. editComponent: 'EditNotification',
  1164. component: 'BlockBasic',
  1165. category: 'general',
  1166. inputs: 1,
  1167. outputs: 1,
  1168. allowedInputs: true,
  1169. maxConnection: 1,
  1170. refDataKeys: ['message', 'title', 'iconUrl', 'imageUrl'],
  1171. data: {
  1172. disableBlock: false,
  1173. description: '',
  1174. message: '',
  1175. iconUrl: '',
  1176. imageUrl: '',
  1177. title: 'Hello world!',
  1178. },
  1179. },
  1180. 'log-data': {
  1181. name: 'Get log data',
  1182. description: 'Get the latest log data of a workflow',
  1183. icon: 'riFileHistoryLine',
  1184. editComponent: 'EditLogData',
  1185. component: 'BlockBasic',
  1186. category: 'data',
  1187. inputs: 1,
  1188. outputs: 1,
  1189. allowedInputs: true,
  1190. maxConnection: 1,
  1191. data: {
  1192. disableBlock: false,
  1193. description: '',
  1194. workflowId: '',
  1195. dataColumn: '',
  1196. saveData: true,
  1197. assignVariable: false,
  1198. variableName: '',
  1199. },
  1200. },
  1201. 'tab-url': {
  1202. name: 'Get tab URL',
  1203. description: 'Get the tab URL',
  1204. icon: 'riLinksLine',
  1205. editComponent: 'EditTabURL',
  1206. component: 'BlockBasic',
  1207. category: 'browser',
  1208. inputs: 1,
  1209. outputs: 1,
  1210. allowedInputs: true,
  1211. maxConnection: 1,
  1212. refDataKeys: ['variableName'],
  1213. data: {
  1214. disableBlock: false,
  1215. description: '',
  1216. type: 'active-tab',
  1217. dataColumn: '',
  1218. saveData: true,
  1219. assignVariable: false,
  1220. variableName: '',
  1221. qTitle: '',
  1222. qMatchPatterns: '',
  1223. },
  1224. },
  1225. 'slice-variable': {
  1226. name: 'Slice variable',
  1227. description: 'Extracts a section of a variable value',
  1228. icon: 'riSliceLine',
  1229. editComponent: 'EditSliceVariable',
  1230. component: 'BlockBasic',
  1231. category: 'data',
  1232. inputs: 1,
  1233. outputs: 1,
  1234. allowedInputs: true,
  1235. maxConnection: 1,
  1236. data: {
  1237. disableBlock: false,
  1238. description: '',
  1239. endIdxEnabled: false,
  1240. startIdxEnabled: true,
  1241. endIndex: 0,
  1242. startIndex: 0,
  1243. variableName: '',
  1244. },
  1245. },
  1246. 'increase-variable': {
  1247. name: 'Increase variable',
  1248. description: 'Increase the value of a variable by specific amount',
  1249. icon: 'riIncreaseDecreaseLine',
  1250. editComponent: 'EditIncreaseVariable',
  1251. component: 'BlockBasic',
  1252. category: 'data',
  1253. inputs: 1,
  1254. outputs: 1,
  1255. allowedInputs: true,
  1256. maxConnection: 1,
  1257. data: {
  1258. disableBlock: false,
  1259. description: '',
  1260. increaseBy: 1,
  1261. variableName: '',
  1262. },
  1263. },
  1264. 'regex-variable': {
  1265. name: 'RegEx variable',
  1266. description: 'Matching a variable value against a regular expression',
  1267. icon: 'mdiRegex',
  1268. editComponent: 'EditRegexVariable',
  1269. component: 'BlockBasic',
  1270. category: 'data',
  1271. inputs: 1,
  1272. outputs: 1,
  1273. allowedInputs: true,
  1274. maxConnection: 1,
  1275. refDataKeys: ['replaceVal'],
  1276. data: {
  1277. disableBlock: false,
  1278. method: 'match',
  1279. replaceVal: '',
  1280. description: '',
  1281. expression: '',
  1282. flag: [],
  1283. },
  1284. },
  1285. 'data-mapping': {
  1286. name: 'Data mapping',
  1287. description: 'Map data of a variable or table',
  1288. icon: 'riMindMap',
  1289. editComponent: 'EditDataMapping',
  1290. component: 'BlockBasic',
  1291. category: 'data',
  1292. inputs: 1,
  1293. outputs: 1,
  1294. allowedInputs: true,
  1295. maxConnection: 1,
  1296. data: {
  1297. disableBlock: false,
  1298. description: '',
  1299. dataSource: 'table',
  1300. sources: [],
  1301. varSourceName: '',
  1302. dataColumn: '',
  1303. saveData: false,
  1304. assignVariable: false,
  1305. variableName: '',
  1306. },
  1307. },
  1308. 'sort-data': {
  1309. name: 'Sort data',
  1310. description: 'Sort the items of data',
  1311. icon: 'riSortAsc',
  1312. editComponent: 'EditSortData',
  1313. component: 'BlockBasic',
  1314. category: 'data',
  1315. inputs: 1,
  1316. outputs: 1,
  1317. allowedInputs: true,
  1318. maxConnection: 1,
  1319. data: {
  1320. disableBlock: false,
  1321. description: '',
  1322. sortByProperty: false,
  1323. itemProperties: [],
  1324. dataSource: 'table',
  1325. varSourceName: '',
  1326. dataColumn: '',
  1327. saveData: false,
  1328. assignVariable: false,
  1329. variableName: '',
  1330. },
  1331. },
  1332. 'create-element': {
  1333. name: 'Create element',
  1334. description: 'Create an element and insert it into the page',
  1335. icon: 'riHtml5Line',
  1336. editComponent: 'EditCreateElement',
  1337. component: 'BlockBasic',
  1338. category: 'interaction',
  1339. inputs: 1,
  1340. outputs: 1,
  1341. allowedInputs: true,
  1342. maxConnection: 1,
  1343. refDataKeys: ['html', 'css', 'selector'],
  1344. data: {
  1345. disableBlock: false,
  1346. description: '',
  1347. javascript: '',
  1348. html: '',
  1349. css: '',
  1350. preloadScripts: [],
  1351. findBy: 'cssSelector',
  1352. insertAt: 'after',
  1353. runBeforeLoad: false,
  1354. waitForSelector: false,
  1355. waitSelectorTimeout: 5000,
  1356. selector: 'body',
  1357. },
  1358. },
  1359. cookie: {
  1360. name: 'Cookie',
  1361. description: 'Get, set, or remove cookies',
  1362. icon: 'mdiCookieOutline',
  1363. editComponent: 'EditCookie',
  1364. component: 'BlockBasic',
  1365. category: 'browser',
  1366. inputs: 1,
  1367. outputs: 1,
  1368. allowedInputs: true,
  1369. maxConnection: 1,
  1370. refDataKeys: [
  1371. 'domain',
  1372. 'expirationDate',
  1373. 'path',
  1374. 'sameSite',
  1375. 'name',
  1376. 'url',
  1377. 'value',
  1378. 'jsonCode',
  1379. 'variableName',
  1380. ],
  1381. data: {
  1382. disableBlock: false,
  1383. description: '',
  1384. type: 'get',
  1385. jsonCode: '{\n\n}',
  1386. useJson: false,
  1387. getAll: false,
  1388. domain: '',
  1389. expirationDate: '',
  1390. path: '',
  1391. sameSite: '',
  1392. name: '',
  1393. url: '',
  1394. value: '',
  1395. httpOnly: false,
  1396. secure: false,
  1397. session: false,
  1398. assignVariable: false,
  1399. variableName: '',
  1400. saveData: true,
  1401. dataColumn: '',
  1402. },
  1403. },
  1404. 'block-package': {
  1405. name: 'Block package',
  1406. description: 'Block package',
  1407. icon: 'riHtml5Line',
  1408. editComponent: 'EditPackage',
  1409. component: 'BlockPackage',
  1410. category: 'package',
  1411. inputs: 1,
  1412. outputs: 1,
  1413. allowedInputs: true,
  1414. maxConnection: 1,
  1415. data: {},
  1416. },
  1417. note: {
  1418. name: 'Note',
  1419. description: '',
  1420. icon: 'riFileEditLine',
  1421. component: 'BlockNote',
  1422. category: 'general',
  1423. disableEdit: true,
  1424. inputs: 1,
  1425. outputs: 1,
  1426. allowedInputs: true,
  1427. maxConnection: 1,
  1428. data: {
  1429. disableBlock: false,
  1430. note: '',
  1431. drawing: false,
  1432. width: 280,
  1433. height: 168,
  1434. color: 'white',
  1435. fontSize: 'regular',
  1436. },
  1437. },
  1438. 'workflow-state': {
  1439. name: 'Workflow State',
  1440. description: 'Manage workflows states',
  1441. icon: 'riSettings3Line',
  1442. component: 'BlockBasic',
  1443. editComponent: 'EditWorkflowState',
  1444. category: 'general',
  1445. inputs: 1,
  1446. outputs: 1,
  1447. allowedInputs: true,
  1448. maxConnection: 1,
  1449. data: {
  1450. disableBlock: false,
  1451. description: '',
  1452. type: 'stop-current',
  1453. exceptCurrent: false,
  1454. workflowsToStop: [],
  1455. },
  1456. },
  1457. 'parameter-prompt': {
  1458. name: 'Parameter prompt',
  1459. description: '',
  1460. icon: 'riCommandLine',
  1461. component: 'BlockBasic',
  1462. category: 'general',
  1463. editComponent: 'EditParameterPrompt',
  1464. inputs: 1,
  1465. outputs: 1,
  1466. maxConnection: 1,
  1467. allowedInputs: true,
  1468. data: {
  1469. disableBlock: false,
  1470. description: '',
  1471. timeout: 60000,
  1472. parameters: [],
  1473. },
  1474. },
  1475. };
  1476. export const categories = {
  1477. interaction: {
  1478. name: 'Web interaction',
  1479. border: 'border-green-200 dark:border-green-300',
  1480. color: 'bg-green-200 dark:bg-green-300 fill-green-200 dark:fill-green-300',
  1481. },
  1482. browser: {
  1483. name: 'Browser',
  1484. border: 'border-orange-200 dark:border-orange-300',
  1485. color:
  1486. 'bg-orange-200 dark:bg-orange-300 fill-orange-200 dark:fill-orange-300',
  1487. },
  1488. general: {
  1489. name: 'General',
  1490. border: 'border-yellow-200 dark:border-yellow-300',
  1491. color:
  1492. 'bg-yellow-200 dark:bg-yellow-300 fill-yellow-200 dark:fill-yellow-300',
  1493. },
  1494. onlineServices: {
  1495. name: 'Online services',
  1496. border: 'border-red-200 dark:border-red-300',
  1497. color: 'bg-red-200 dark:bg-red-300 fill-red-200 dark:fill-red-300',
  1498. },
  1499. data: {
  1500. name: 'Data',
  1501. border: 'border-lime-200 dark:border-lime-300',
  1502. color: 'bg-lime-200 dark:bg-lime-300 fill-lime-200 dark:fill-lime-300',
  1503. },
  1504. conditions: {
  1505. name: 'Control flow',
  1506. border: 'border-blue-200 dark:border-blue-300',
  1507. color: 'bg-blue-200 dark:bg-blue-300 fill-blue-200 dark:fill-blue-300',
  1508. },
  1509. package: {
  1510. name: 'Packages',
  1511. border: 'border-cyan-200 dark:border-cyan-300',
  1512. color: 'bg-cyan-200 dark:bg-cyan-300 fill-cyan-200 dark:fill-cyan-300',
  1513. },
  1514. };
  1515. export const tagColors = {
  1516. stage: 'bg-yellow-200 dark:bg-yellow-300',
  1517. production: 'bg-green-200 dark:bg-green-300',
  1518. };
  1519. export const eventList = [
  1520. { id: 'click', name: 'Click', type: 'mouse-event' },
  1521. { id: 'dblclick', name: 'Double Click', type: 'mouse-event' },
  1522. { id: 'mouseup', name: 'Mouseup', type: 'mouse-event' },
  1523. { id: 'mousedown', name: 'Mousedown', type: 'mouse-event' },
  1524. { id: 'mouseenter', name: 'Mouseenter', type: 'mouse-event' },
  1525. { id: 'mouseleave', name: 'Mouseleave', type: 'mouse-event' },
  1526. { id: 'mouseover', name: 'Mouseover', type: 'mouse-event' },
  1527. { id: 'mouseout', name: 'Mouseout', type: 'mouse-event' },
  1528. { id: 'mousemove', name: 'Mousemove', type: 'mouse-event' },
  1529. { id: 'focus', name: 'Focus', type: 'focus-event' },
  1530. { id: 'blur', name: 'Blur', type: 'focus-event' },
  1531. { id: 'input', name: 'Input', type: 'input-event' },
  1532. { id: 'change', name: 'Change', type: 'event' },
  1533. { id: 'touchstart', name: 'Touch start', type: 'touch-event' },
  1534. { id: 'touchend', name: 'Touch end', type: 'touch-event' },
  1535. { id: 'touchmove', name: 'Touch move', type: 'touch-event' },
  1536. { id: 'touchcancel', name: 'Touch cancel', type: 'touch-event' },
  1537. { id: 'keydown', name: 'Keydown', type: 'keyboard-event' },
  1538. { id: 'keyup', name: 'Keyup', type: 'keyboard-event' },
  1539. { id: 'submit', name: 'Submit', type: 'submit-event' },
  1540. { id: 'wheel', name: 'Wheel', type: 'wheel-event' },
  1541. ];
  1542. export const dataExportTypes = [
  1543. { name: 'JSON', id: 'json' },
  1544. { name: 'CSV', id: 'csv' },
  1545. { name: 'Plain text', id: 'plain-text' },
  1546. ];
  1547. export const workflowCategories = {
  1548. scrape: 'Scraping',
  1549. automation: 'Automation',
  1550. productivity: 'Productivity',
  1551. };
  1552. export const excludeOnError = [
  1553. 'note',
  1554. 'delay',
  1555. 'webhook',
  1556. 'trigger',
  1557. 'while-loop',
  1558. 'conditions',
  1559. 'blocks-group',
  1560. 'block-package',
  1561. 'element-exists',
  1562. ];
  1563. export const contentTypes = [
  1564. { name: 'text/plain', value: 'text' },
  1565. { name: 'application/json', value: 'json' },
  1566. { name: 'multipart/form-data', value: 'form-data' },
  1567. { name: 'application/x-www-form-urlencoded', value: 'form' },
  1568. ];
  1569. export const supportLocales = [
  1570. { id: 'en', name: 'English' },
  1571. { id: 'fr', name: 'Français' },
  1572. { id: 'it', name: 'Italiano' },
  1573. { id: 'uk', name: 'Україньська' },
  1574. { id: 'vi', name: 'Tiếng Việt' },
  1575. { id: 'zh', name: '简体中文' },
  1576. { id: 'zh-TW', name: '繁體中文' },
  1577. { id: 'tr', name: 'Türkçe' },
  1578. ];
  1579. export const communities = [
  1580. {
  1581. name: 'GitHub',
  1582. icon: 'riGithubFill',
  1583. url: 'https://github.com/kholid060/automa',
  1584. },
  1585. {
  1586. name: 'Twitter',
  1587. icon: 'riTwitterLine',
  1588. url: 'https://twitter.com/AutomaApp',
  1589. },
  1590. {
  1591. name: 'Discord',
  1592. icon: 'riDiscordLine',
  1593. url: 'https://discord.gg/C6khwwTE84',
  1594. },
  1595. {
  1596. name: 'YouTube',
  1597. icon: 'riYoutubeLine',
  1598. url: 'https://www.youtube.com/channel/UCL3qU64hW0fsIj2vOayOQUQ',
  1599. },
  1600. ];
  1601. export const elementsHighlightData = {
  1602. selectedElements: {
  1603. stroke: '#2563EB',
  1604. activeStroke: '#f87171',
  1605. fill: 'rgba(37, 99, 235, 0.1)',
  1606. activeFill: 'rgba(248, 113, 113, 0.1)',
  1607. },
  1608. hoveredElements: {
  1609. stroke: '#fbbf24',
  1610. fill: 'rgba(251, 191, 36, 0.1)',
  1611. },
  1612. };
  1613. export const excludeGroupBlocks = [
  1614. 'trigger',
  1615. 'repeat-task',
  1616. 'loop-data',
  1617. 'loop-breakpoint',
  1618. 'blocks-group',
  1619. 'conditions',
  1620. 'webhook',
  1621. 'element-exists',
  1622. 'while-loop',
  1623. 'block-package',
  1624. ];
  1625. export const conditionBuilder = {
  1626. valueTypes: [
  1627. {
  1628. id: 'value',
  1629. category: 'value',
  1630. name: 'Value',
  1631. compareable: true,
  1632. data: { value: '' },
  1633. },
  1634. {
  1635. id: 'code',
  1636. category: 'value',
  1637. name: 'Code',
  1638. compareable: false,
  1639. data: { code: '\nreturn true;', context: 'background' },
  1640. },
  1641. {
  1642. id: 'data#exists',
  1643. category: 'value',
  1644. name: 'Data exists',
  1645. compareable: false,
  1646. valueKey: 'dataPath',
  1647. data: { dataPath: '' },
  1648. },
  1649. {
  1650. id: 'element#text',
  1651. category: 'element',
  1652. name: 'Element text',
  1653. compareable: true,
  1654. data: { selector: '' },
  1655. },
  1656. {
  1657. id: 'element#exists',
  1658. category: 'element',
  1659. name: 'Element exists',
  1660. compareable: false,
  1661. data: { selector: '' },
  1662. },
  1663. {
  1664. id: 'element#notExists',
  1665. category: 'element',
  1666. name: 'Element not exists',
  1667. compareable: false,
  1668. data: { selector: '' },
  1669. },
  1670. {
  1671. id: 'element#visible',
  1672. category: 'element',
  1673. name: 'Element visible',
  1674. compareable: false,
  1675. data: { selector: '' },
  1676. },
  1677. {
  1678. id: 'element#visibleScreen',
  1679. category: 'element',
  1680. name: 'Element visible in screen',
  1681. compareable: false,
  1682. data: { selector: '' },
  1683. },
  1684. {
  1685. id: 'element#invisible',
  1686. category: 'element',
  1687. name: 'Element hidden in screen',
  1688. compareable: false,
  1689. data: { selector: '' },
  1690. },
  1691. {
  1692. id: 'element#attribute',
  1693. category: 'element',
  1694. name: 'Element attribute value',
  1695. compareable: true,
  1696. data: { selector: '', attrName: '' },
  1697. },
  1698. ],
  1699. compareTypes: [
  1700. { id: 'eq', name: 'Equals', needValue: true, category: 'basic' },
  1701. {
  1702. id: 'eqi',
  1703. name: 'Equals (case insensitive)',
  1704. needValue: true,
  1705. category: 'basic',
  1706. },
  1707. { id: 'nq', name: 'Not equals', needValue: true, category: 'basic' },
  1708. { id: 'gt', name: 'Greater than', needValue: true, category: 'number' },
  1709. {
  1710. id: 'gte',
  1711. name: 'Greater than or equal',
  1712. needValue: true,
  1713. category: 'number',
  1714. },
  1715. { id: 'lt', name: 'Less than', needValue: true, category: 'number' },
  1716. {
  1717. id: 'lte',
  1718. name: 'Less than or equal',
  1719. needValue: true,
  1720. category: 'number',
  1721. },
  1722. { id: 'cnt', name: 'Contains', needValue: true, category: 'text' },
  1723. {
  1724. id: 'cni',
  1725. name: 'Contains (case insensitive)',
  1726. needValue: true,
  1727. category: 'text',
  1728. },
  1729. { id: 'nct', name: 'Not contains', needValue: true, category: 'text' },
  1730. {
  1731. id: 'nci',
  1732. name: 'Not contains (case insensitive)',
  1733. needValue: true,
  1734. category: 'text',
  1735. },
  1736. { id: 'stw', name: 'Starts with', needValue: true, category: 'text' },
  1737. { id: 'enw', name: 'Ends with', needValue: true, category: 'text' },
  1738. { id: 'rgx', name: 'Match with RegEx', needValue: true, category: 'text' },
  1739. { id: 'itr', name: 'Is truthy', needValue: false, category: 'boolean' },
  1740. { id: 'ifl', name: 'Is falsy', needValue: false, category: 'boolean' },
  1741. ],
  1742. inputTypes: {
  1743. selector: {
  1744. placeholder: '.class',
  1745. label: 'CSS selector or XPath',
  1746. },
  1747. value: {
  1748. label: 'Value',
  1749. placeholder: 'abc123',
  1750. },
  1751. attrName: {
  1752. label: 'Attribute name',
  1753. placeholder: 'name',
  1754. },
  1755. dataPath: {
  1756. label: 'variables@variableName',
  1757. placeholder: '',
  1758. },
  1759. },
  1760. };
  1761. export const messageHasReferences = [
  1762. 'no-tab',
  1763. 'invalid-active-tab',
  1764. 'no-match-tab',
  1765. 'invalid-body',
  1766. 'element-not-found',
  1767. ];