shared.js 39 KB

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