shared.js 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667
  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', 'selector'],
  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', 'delay'],
  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. context: 'website',
  535. code: 'console.log("Hello world!");\nautomaNextBlock()',
  536. preloadScripts: [],
  537. everyNewTab: false,
  538. runBeforeLoad: false,
  539. },
  540. },
  541. 'trigger-event': {
  542. name: 'Trigger event',
  543. description: 'Trigger event',
  544. icon: 'riLightbulbFlashLine',
  545. component: 'BlockBasic',
  546. editComponent: 'EditTriggerEvent',
  547. category: 'interaction',
  548. inputs: 1,
  549. outputs: 1,
  550. allowedInputs: true,
  551. maxConnection: 1,
  552. refDataKeys: ['selector', 'eventParams.clientX', 'eventParams.clientY'],
  553. data: {
  554. disableBlock: false,
  555. description: '',
  556. findBy: 'cssSelector',
  557. waitForSelector: false,
  558. waitSelectorTimeout: 5000,
  559. selector: 'html',
  560. markEl: false,
  561. multiple: false,
  562. eventName: '',
  563. eventType: '',
  564. eventParams: { bubbles: true, cancelable: false },
  565. },
  566. },
  567. 'google-sheets': {
  568. name: 'Google sheets',
  569. description: 'Read Google Sheets data',
  570. icon: 'mdiGoogleSheet',
  571. component: 'BlockBasic',
  572. editComponent: 'EditGoogleSheets',
  573. category: 'onlineServices',
  574. inputs: 1,
  575. outputs: 1,
  576. allowedInputs: true,
  577. maxConnection: 1,
  578. refDataKeys: ['customData', 'range', 'spreadsheetId'],
  579. autocomplete: ['refKey'],
  580. data: {
  581. disableBlock: false,
  582. range: '',
  583. refKey: '',
  584. type: 'get',
  585. customData: '',
  586. description: '',
  587. spreadsheetId: '',
  588. dataColumn: '',
  589. saveData: true,
  590. assignVariable: false,
  591. variableName: '',
  592. firstRowAsKey: false,
  593. keysAsFirstRow: true,
  594. valueInputOption: 'RAW',
  595. InsertDataOption: 'INSERT_ROWS',
  596. dataFrom: 'data-columns',
  597. },
  598. },
  599. conditions: {
  600. name: 'Conditions',
  601. description: 'Conditional block',
  602. icon: 'riAB',
  603. component: 'BlockConditions',
  604. editComponent: 'EditConditions',
  605. category: 'conditions',
  606. inputs: 1,
  607. outputs: 0,
  608. allowedInputs: true,
  609. maxConnection: 1,
  610. data: {
  611. description: '',
  612. disableBlock: false,
  613. conditions: [],
  614. retryConditions: false,
  615. retryCount: 10,
  616. retryTimeout: 1000,
  617. },
  618. },
  619. 'element-exists': {
  620. name: 'Element exists',
  621. description: 'Check if an element is exists',
  622. icon: 'riFocus3Line',
  623. component: 'BlockElementExists',
  624. editComponent: 'EditElementExists',
  625. category: 'conditions',
  626. inputs: 1,
  627. outputs: 2,
  628. allowedInputs: true,
  629. maxConnection: 1,
  630. refDataKeys: ['selector'],
  631. data: {
  632. disableBlock: false,
  633. description: '',
  634. findBy: 'cssSelector',
  635. selector: '',
  636. tryCount: 1,
  637. timeout: 500,
  638. markEl: false,
  639. throwError: false,
  640. },
  641. },
  642. webhook: {
  643. name: 'HTTP Request',
  644. description: 'make an HTTP request',
  645. icon: 'riEarthLine',
  646. component: 'BlockBasicWithFallback',
  647. editComponent: 'EditWebhook',
  648. category: 'general',
  649. inputs: 1,
  650. outputs: 2,
  651. allowedInputs: true,
  652. maxConnection: 1,
  653. refDataKeys: ['body', 'url'],
  654. autocomplete: ['variableName'],
  655. data: {
  656. disableBlock: false,
  657. description: '',
  658. url: '',
  659. body: '{}',
  660. headers: [],
  661. method: 'POST',
  662. timeout: 10000,
  663. dataPath: '',
  664. contentType: 'json',
  665. variableName: '',
  666. assignVariable: false,
  667. saveData: false,
  668. dataColumn: '',
  669. responseType: 'json',
  670. },
  671. },
  672. 'while-loop': {
  673. name: 'While loop',
  674. description: 'Execute blocks while the condition is met',
  675. icon: 'riRefreshFill',
  676. component: 'BlockBasicWithFallback',
  677. editComponent: 'EditWhileLoop',
  678. category: 'conditions',
  679. inputs: 1,
  680. outputs: 2,
  681. allowedInputs: true,
  682. maxConnection: 1,
  683. data: {
  684. disableBlock: false,
  685. description: '',
  686. conditions: null,
  687. },
  688. },
  689. 'loop-data': {
  690. name: 'Loop data',
  691. icon: 'riRefreshLine',
  692. component: 'BlockBasic',
  693. editComponent: 'EditLoopData',
  694. category: 'conditions',
  695. inputs: 1,
  696. outputs: 1,
  697. allowedInputs: true,
  698. maxConnection: 1,
  699. refDataKeys: [
  700. 'maxLoop',
  701. 'loopData',
  702. 'variableName',
  703. 'referenceKey',
  704. 'elementSelector',
  705. ],
  706. autocomplete: ['variableName', 'loopId'],
  707. data: {
  708. disableBlock: false,
  709. loopId: '',
  710. maxLoop: 0,
  711. toNumber: 10,
  712. fromNumber: 1,
  713. startIndex: 0,
  714. loopData: '[]',
  715. description: '',
  716. variableName: '',
  717. referenceKey: '',
  718. reverseLoop: false,
  719. elementSelector: '',
  720. waitForSelector: false,
  721. waitSelectorTimeout: 5000,
  722. resumeLastWorkflow: false,
  723. loopThrough: 'data-columns',
  724. },
  725. },
  726. 'loop-elements': {
  727. name: 'Loop elements',
  728. icon: 'riRestartLine',
  729. component: 'BlockBasic',
  730. editComponent: 'EditLoopElements',
  731. category: 'conditions',
  732. inputs: 1,
  733. outputs: 1,
  734. allowedInputs: true,
  735. maxConnection: 1,
  736. refDataKeys: [
  737. 'maxLoop',
  738. 'variableName',
  739. 'elementSelector',
  740. 'actionElSelector',
  741. ],
  742. autocomplete: ['loopId'],
  743. data: {
  744. disableBlock: false,
  745. loopId: '',
  746. selector: '',
  747. maxLoop: '0',
  748. description: '',
  749. reverseLoop: false,
  750. actionElSelector: '',
  751. findBy: 'cssSelector',
  752. actionElMaxWaitTime: 5,
  753. actionPageMaxWaitTime: 10,
  754. loadMoreAction: 'none',
  755. scrollToBottom: true,
  756. waitForSelector: false,
  757. waitSelectorTimeout: 5000,
  758. },
  759. },
  760. 'loop-breakpoint': {
  761. name: 'Loop breakpoint',
  762. description: 'To tell where loop data must stop',
  763. icon: 'riStopLine',
  764. component: 'BlockLoopBreakpoint',
  765. category: 'conditions',
  766. disableEdit: true,
  767. inputs: 1,
  768. outputs: 1,
  769. allowedInputs: true,
  770. maxConnection: 1,
  771. data: {
  772. disableBlock: false,
  773. loopId: '',
  774. clearLoop: false,
  775. },
  776. },
  777. 'blocks-group': {
  778. name: 'Blocks group',
  779. description: 'Grouping blocks',
  780. icon: 'riFolderZipLine',
  781. component: 'BlockGroup',
  782. category: 'general',
  783. disableEdit: true,
  784. inputs: 1,
  785. outputs: 1,
  786. allowedInputs: true,
  787. maxConnection: 1,
  788. data: {
  789. disableBlock: false,
  790. name: '',
  791. blocks: [],
  792. },
  793. },
  794. // 'blocks-group-2': {
  795. // name: 'Blocks group',
  796. // description: 'Grouping blocks',
  797. // icon: 'riFolderZipLine',
  798. // component: 'BlockGroup2',
  799. // category: 'general',
  800. // disableEdit: true,
  801. // inputs: 1,
  802. // outputs: 1,
  803. // allowedInputs: true,
  804. // maxConnection: 1,
  805. // data: {
  806. // disableBlock: false,
  807. // name: '',
  808. // width: 400,
  809. // height: 300,
  810. // borderColor: '#2563eb',
  811. // backgroundColor: 'rgb(37, 99, 235, 0.3)',
  812. // },
  813. // },
  814. clipboard: {
  815. name: 'Clipboard',
  816. description: 'Get the copied text from the clipboard',
  817. icon: 'riClipboardLine',
  818. component: 'BlockBasic',
  819. category: 'general',
  820. editComponent: 'EditClipboard',
  821. inputs: 1,
  822. outputs: 1,
  823. allowedInputs: true,
  824. maxConnection: 1,
  825. autocomplete: ['variableName'],
  826. refDataKeys: ['dataToCopy'],
  827. data: {
  828. disableBlock: false,
  829. description: '',
  830. type: 'get',
  831. assignVariable: false,
  832. variableName: '',
  833. saveData: true,
  834. dataColumn: '',
  835. dataToCopy: '',
  836. copySelectedText: false,
  837. },
  838. },
  839. 'insert-data': {
  840. name: 'Insert data',
  841. description: 'Insert data into table or variable',
  842. icon: 'riDatabase2Line',
  843. component: 'BlockBasic',
  844. category: 'data',
  845. editComponent: 'EditInsertData',
  846. inputs: 1,
  847. outputs: 1,
  848. allowedInputs: true,
  849. maxConnection: 1,
  850. data: {
  851. disableBlock: false,
  852. description: '',
  853. dataList: [],
  854. },
  855. },
  856. 'switch-to': {
  857. name: 'Switch frame',
  858. description: 'Switch between main window and iframe',
  859. icon: 'riArrowUpDownLine',
  860. component: 'BlockBasic',
  861. editComponent: 'EditSwitchTo',
  862. category: 'interaction',
  863. inputs: 1,
  864. outputs: 1,
  865. allowedInputs: true,
  866. maxConnection: 1,
  867. refDataKeys: ['selector'],
  868. data: {
  869. disableBlock: false,
  870. findBy: 'cssSelector',
  871. selector: '',
  872. windowType: 'main-window',
  873. },
  874. },
  875. 'upload-file': {
  876. name: 'Upload file',
  877. description: 'Upload file into <input type="file"> element',
  878. icon: 'riFileUploadLine',
  879. component: 'BlockBasic',
  880. editComponent: 'EditUploadFile',
  881. category: 'interaction',
  882. inputs: 1,
  883. outputs: 1,
  884. allowedInputs: true,
  885. maxConnection: 1,
  886. refDataKeys: ['selector', 'filePaths'],
  887. data: {
  888. disableBlock: false,
  889. findBy: 'cssSelector',
  890. waitForSelector: false,
  891. waitSelectorTimeout: 5000,
  892. selector: '',
  893. filePaths: [],
  894. },
  895. },
  896. 'hover-element': {
  897. name: 'Hover element',
  898. description: 'Hover over an element',
  899. icon: 'mdiCursorDefaultClickOutline',
  900. component: 'BlockBasic',
  901. editComponent: 'EditInteractionBase',
  902. category: 'interaction',
  903. inputs: 1,
  904. outputs: 1,
  905. allowedInputs: true,
  906. maxConnection: 1,
  907. refDataKeys: ['selector'],
  908. data: {
  909. disableBlock: false,
  910. description: '',
  911. findBy: 'cssSelector',
  912. waitForSelector: false,
  913. waitSelectorTimeout: 5000,
  914. selector: '',
  915. markEl: false,
  916. multiple: false,
  917. },
  918. },
  919. 'save-assets': {
  920. name: 'Save assets',
  921. description:
  922. 'Save assets (image, video, audio, or file) from an element or URL',
  923. icon: 'riImageLine',
  924. component: 'BlockBasic',
  925. editComponent: 'EditSaveAssets',
  926. category: 'interaction',
  927. inputs: 1,
  928. outputs: 1,
  929. allowedInputs: true,
  930. maxConnection: 1,
  931. refDataKeys: ['selector', 'url', 'filename'],
  932. data: {
  933. disableBlock: false,
  934. description: '',
  935. findBy: 'cssSelector',
  936. waitForSelector: false,
  937. waitSelectorTimeout: 5000,
  938. selector: '',
  939. markEl: false,
  940. multiple: false,
  941. type: 'element',
  942. url: '',
  943. filename: '',
  944. onConflict: 'uniquify',
  945. },
  946. },
  947. 'press-key': {
  948. name: 'Press key',
  949. description: 'Press a key or a combination',
  950. icon: 'riKeyboardLine',
  951. component: 'BlockBasic',
  952. editComponent: 'EditPressKey',
  953. category: 'interaction',
  954. inputs: 1,
  955. outputs: 1,
  956. allowedInputs: true,
  957. maxConnection: 1,
  958. refDataKeys: ['selector', 'keys', 'keysToPress'],
  959. data: {
  960. disableBlock: false,
  961. keys: '',
  962. selector: '',
  963. description: '',
  964. keysToPress: '',
  965. action: 'press-key',
  966. },
  967. },
  968. 'handle-dialog': {
  969. name: 'Handle dialog',
  970. description:
  971. 'Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).',
  972. icon: 'riChat3Line',
  973. component: 'BlockBasic',
  974. editComponent: 'EditHandleDialog',
  975. category: 'browser',
  976. inputs: 1,
  977. outputs: 1,
  978. allowedInputs: true,
  979. maxConnection: 1,
  980. refDataKeys: ['promptText'],
  981. data: {
  982. disableBlock: false,
  983. description: '',
  984. accept: true,
  985. promptText: '',
  986. },
  987. },
  988. 'handle-download': {
  989. name: 'Handle download',
  990. description: 'Handle downloaded file',
  991. icon: 'riFileDownloadLine',
  992. component: 'BlockBasic',
  993. editComponent: 'EditHandleDownload',
  994. category: 'browser',
  995. inputs: 1,
  996. outputs: 1,
  997. allowedInputs: true,
  998. maxConnection: 1,
  999. refDataKeys: ['filename'],
  1000. autocomplete: ['variableName'],
  1001. data: {
  1002. disableBlock: false,
  1003. description: '',
  1004. filename: '',
  1005. timeout: 20000,
  1006. onConflict: 'uniquify',
  1007. waitForDownload: true,
  1008. dataColumn: '',
  1009. saveData: true,
  1010. assignVariable: false,
  1011. variableName: '',
  1012. },
  1013. },
  1014. 'reload-tab': {
  1015. name: 'Reload tab',
  1016. description: 'Reload the active tab',
  1017. icon: 'riRestartLine',
  1018. component: 'BlockBasic',
  1019. category: 'browser',
  1020. inputs: 1,
  1021. outputs: 1,
  1022. allowedInputs: true,
  1023. maxConnection: 1,
  1024. disableEdit: true,
  1025. data: {
  1026. disableBlock: false,
  1027. },
  1028. },
  1029. 'delete-data': {
  1030. name: 'Delete data',
  1031. description: 'Delete table or variable data',
  1032. icon: 'riDeleteBin7Line',
  1033. editComponent: 'EditDeleteData',
  1034. component: 'BlockBasic',
  1035. category: 'data',
  1036. inputs: 1,
  1037. outputs: 1,
  1038. allowedInputs: true,
  1039. maxConnection: 1,
  1040. data: {
  1041. disableBlock: false,
  1042. description: '',
  1043. deleteList: [],
  1044. },
  1045. },
  1046. 'wait-connections': {
  1047. name: 'Wait connections',
  1048. description: 'Wait for all connections before continuing to the next block',
  1049. icon: 'riTimerFlashLine',
  1050. editComponent: 'EditWaitConnections',
  1051. component: 'BlockBasic',
  1052. category: 'general',
  1053. inputs: 1,
  1054. outputs: 1,
  1055. allowedInputs: true,
  1056. maxConnection: 1,
  1057. data: {
  1058. disableBlock: false,
  1059. description: '',
  1060. timeout: 10000,
  1061. specificFlow: false,
  1062. flowBlockId: '',
  1063. },
  1064. },
  1065. notification: {
  1066. name: 'Notification',
  1067. description: 'Display a notification',
  1068. icon: 'riNotification3Line',
  1069. editComponent: 'EditNotification',
  1070. component: 'BlockBasic',
  1071. category: 'general',
  1072. inputs: 1,
  1073. outputs: 1,
  1074. allowedInputs: true,
  1075. maxConnection: 1,
  1076. refDataKeys: ['message', 'title', 'iconUrl', 'imageUrl'],
  1077. data: {
  1078. disableBlock: false,
  1079. description: '',
  1080. message: '',
  1081. iconUrl: '',
  1082. imageUrl: '',
  1083. title: 'Hello world!',
  1084. },
  1085. },
  1086. 'log-data': {
  1087. name: 'Get log data',
  1088. description: 'Get the latest log data of a workflow',
  1089. icon: 'riFileHistoryLine',
  1090. editComponent: 'EditLogData',
  1091. component: 'BlockBasic',
  1092. category: 'data',
  1093. inputs: 1,
  1094. outputs: 1,
  1095. allowedInputs: true,
  1096. maxConnection: 1,
  1097. data: {
  1098. disableBlock: false,
  1099. description: '',
  1100. workflowId: '',
  1101. dataColumn: '',
  1102. saveData: true,
  1103. assignVariable: false,
  1104. variableName: '',
  1105. },
  1106. },
  1107. 'tab-url': {
  1108. name: 'Get tab URL',
  1109. description: 'Get the tab URL',
  1110. icon: 'riLinksLine',
  1111. editComponent: 'EditTabURL',
  1112. component: 'BlockBasic',
  1113. category: 'browser',
  1114. inputs: 1,
  1115. outputs: 1,
  1116. allowedInputs: true,
  1117. maxConnection: 1,
  1118. data: {
  1119. disableBlock: false,
  1120. description: '',
  1121. type: 'active-tab',
  1122. dataColumn: '',
  1123. saveData: true,
  1124. assignVariable: false,
  1125. variableName: '',
  1126. },
  1127. },
  1128. 'slice-variable': {
  1129. name: 'Slice variable',
  1130. description: 'Extracts a section of a variable value',
  1131. icon: 'riSliceLine',
  1132. editComponent: 'EditSliceVariable',
  1133. component: 'BlockBasic',
  1134. category: 'data',
  1135. inputs: 1,
  1136. outputs: 1,
  1137. allowedInputs: true,
  1138. maxConnection: 1,
  1139. data: {
  1140. disableBlock: false,
  1141. description: '',
  1142. endIdxEnabled: false,
  1143. startIdxEnabled: true,
  1144. endIndex: 0,
  1145. startIndex: 0,
  1146. variableName: '',
  1147. },
  1148. },
  1149. 'increase-variable': {
  1150. name: 'Increase variable',
  1151. description: 'Increase the value of a variable by specific amount',
  1152. icon: 'riIncreaseDecreaseLine',
  1153. editComponent: 'EditIncreaseVariable',
  1154. component: 'BlockBasic',
  1155. category: 'data',
  1156. inputs: 1,
  1157. outputs: 1,
  1158. allowedInputs: true,
  1159. maxConnection: 1,
  1160. data: {
  1161. disableBlock: false,
  1162. description: '',
  1163. increaseBy: 1,
  1164. variableName: '',
  1165. },
  1166. },
  1167. 'regex-variable': {
  1168. name: 'RegEx variable',
  1169. description: 'Matching a variable value against a regular expression',
  1170. icon: 'mdiRegex',
  1171. editComponent: 'EditRegexVariable',
  1172. component: 'BlockBasic',
  1173. category: 'data',
  1174. inputs: 1,
  1175. outputs: 1,
  1176. allowedInputs: true,
  1177. maxConnection: 1,
  1178. refDataKeys: ['replaceVal'],
  1179. data: {
  1180. disableBlock: false,
  1181. method: 'match',
  1182. replaceVal: '',
  1183. description: '',
  1184. expression: '',
  1185. flag: [],
  1186. },
  1187. },
  1188. 'data-mapping': {
  1189. name: 'Data mapping',
  1190. description: 'Map data of a variable or table',
  1191. icon: 'riMindMap',
  1192. editComponent: 'EditDataMapping',
  1193. component: 'BlockBasic',
  1194. category: 'data',
  1195. inputs: 1,
  1196. outputs: 1,
  1197. allowedInputs: true,
  1198. maxConnection: 1,
  1199. data: {
  1200. disableBlock: false,
  1201. description: '',
  1202. dataSource: 'table',
  1203. sources: [],
  1204. varSourceName: '',
  1205. dataColumn: '',
  1206. saveData: false,
  1207. assignVariable: false,
  1208. variableName: '',
  1209. },
  1210. },
  1211. 'sort-data': {
  1212. name: 'Sort data',
  1213. description: 'Sort the items of data',
  1214. icon: 'riSortAsc',
  1215. editComponent: 'EditSortData',
  1216. component: 'BlockBasic',
  1217. category: 'data',
  1218. inputs: 1,
  1219. outputs: 1,
  1220. allowedInputs: true,
  1221. maxConnection: 1,
  1222. data: {
  1223. disableBlock: false,
  1224. description: '',
  1225. sortByProperty: false,
  1226. itemProperties: [],
  1227. dataSource: 'table',
  1228. varSourceName: '',
  1229. dataColumn: '',
  1230. saveData: false,
  1231. assignVariable: false,
  1232. variableName: '',
  1233. },
  1234. },
  1235. 'create-element': {
  1236. name: 'Create element',
  1237. description: 'Create an element and insert it into the page',
  1238. icon: 'riHtml5Line',
  1239. editComponent: 'EditCreateElement',
  1240. component: 'BlockBasic',
  1241. category: 'interaction',
  1242. inputs: 1,
  1243. outputs: 1,
  1244. allowedInputs: true,
  1245. maxConnection: 1,
  1246. refDataKeys: ['html', 'css', 'selector'],
  1247. data: {
  1248. disableBlock: false,
  1249. description: '',
  1250. javascript: '',
  1251. html: '',
  1252. css: '',
  1253. preloadScripts: [],
  1254. findBy: 'cssSelector',
  1255. insertAt: 'after',
  1256. runBeforeLoad: false,
  1257. waitForSelector: false,
  1258. waitSelectorTimeout: 5000,
  1259. selector: 'body',
  1260. },
  1261. },
  1262. cookie: {
  1263. name: 'Cookie',
  1264. description: 'Get, set, or remove cookies',
  1265. icon: 'mdiCookieOutline',
  1266. editComponent: 'EditCookie',
  1267. component: 'BlockBasic',
  1268. category: 'browser',
  1269. inputs: 1,
  1270. outputs: 1,
  1271. allowedInputs: true,
  1272. maxConnection: 1,
  1273. refDataKeys: [
  1274. 'domain',
  1275. 'expirationDate',
  1276. 'path',
  1277. 'sameSite',
  1278. 'name',
  1279. 'url',
  1280. 'value',
  1281. ],
  1282. data: {
  1283. disableBlock: false,
  1284. description: '',
  1285. type: 'get',
  1286. getAll: false,
  1287. domain: '',
  1288. expirationDate: '',
  1289. path: '',
  1290. sameSite: '',
  1291. name: '',
  1292. url: '',
  1293. value: '',
  1294. httpOnly: false,
  1295. secure: false,
  1296. session: false,
  1297. assignVariable: false,
  1298. variableName: '',
  1299. saveData: true,
  1300. dataColumn: '',
  1301. },
  1302. },
  1303. 'block-package': {
  1304. name: 'Block package',
  1305. description: 'Block package',
  1306. icon: 'riHtml5Line',
  1307. editComponent: 'EditPackage',
  1308. component: 'BlockPackage',
  1309. category: 'package',
  1310. inputs: 1,
  1311. outputs: 1,
  1312. allowedInputs: true,
  1313. maxConnection: 1,
  1314. data: {},
  1315. },
  1316. note: {
  1317. name: 'Note',
  1318. description: '',
  1319. icon: 'riFileEditLine',
  1320. component: 'BlockNote',
  1321. category: 'general',
  1322. disableEdit: true,
  1323. inputs: 1,
  1324. outputs: 1,
  1325. allowedInputs: true,
  1326. maxConnection: 1,
  1327. data: {
  1328. disableBlock: false,
  1329. note: '',
  1330. drawing: false,
  1331. width: 280,
  1332. height: 168,
  1333. color: 'white',
  1334. fontSize: 'regular',
  1335. },
  1336. },
  1337. 'workflow-state': {
  1338. name: 'Workflow State',
  1339. description: 'Manage workflows states',
  1340. icon: 'riSettings3Line',
  1341. component: 'BlockBasic',
  1342. editComponent: 'EditWorkflowState',
  1343. category: 'general',
  1344. inputs: 1,
  1345. outputs: 1,
  1346. allowedInputs: true,
  1347. maxConnection: 1,
  1348. data: {
  1349. disableBlock: false,
  1350. description: '',
  1351. type: 'stop-current',
  1352. exceptCurrent: false,
  1353. workflowsToStop: [],
  1354. },
  1355. },
  1356. 'parameter-prompt': {
  1357. name: 'Parameter prompt',
  1358. description: '',
  1359. icon: 'riCommandLine',
  1360. component: 'BlockBasic',
  1361. category: 'general',
  1362. editComponent: 'EditParameterPrompt',
  1363. inputs: 1,
  1364. outputs: 1,
  1365. maxConnection: 1,
  1366. allowedInputs: true,
  1367. data: {
  1368. disableBlock: false,
  1369. description: '',
  1370. timeout: 60000,
  1371. parameters: [],
  1372. },
  1373. },
  1374. };
  1375. export const categories = {
  1376. interaction: {
  1377. name: 'Web interaction',
  1378. border: 'border-green-200 dark:border-green-300',
  1379. color: 'bg-green-200 dark:bg-green-300 fill-green-200 dark:fill-green-300',
  1380. },
  1381. browser: {
  1382. name: 'Browser',
  1383. border: 'border-orange-200 dark:border-orange-300',
  1384. color:
  1385. 'bg-orange-200 dark:bg-orange-300 fill-orange-200 dark:fill-orange-300',
  1386. },
  1387. general: {
  1388. name: 'General',
  1389. border: 'border-yellow-200 dark:border-yellow-300',
  1390. color:
  1391. 'bg-yellow-200 dark:bg-yellow-300 fill-yellow-200 dark:fill-yellow-300',
  1392. },
  1393. onlineServices: {
  1394. name: 'Online services',
  1395. border: 'border-red-200 dark:border-red-300',
  1396. color: 'bg-red-200 dark:bg-red-300 fill-red-200 dark:fill-red-300',
  1397. },
  1398. data: {
  1399. name: 'Data',
  1400. border: 'border-lime-200 dark:border-lime-300',
  1401. color: 'bg-lime-200 dark:bg-lime-300 fill-lime-200 dark:fill-lime-300',
  1402. },
  1403. conditions: {
  1404. name: 'Control flow',
  1405. border: 'border-blue-200 dark:border-blue-300',
  1406. color: 'bg-blue-200 dark:bg-blue-300 fill-blue-200 dark:fill-blue-300',
  1407. },
  1408. package: {
  1409. name: 'Packages',
  1410. border: 'border-cyan-200 dark:border-cyan-300',
  1411. color: 'bg-cyan-200 dark:bg-cyan-300 fill-cyan-200 dark:fill-cyan-300',
  1412. },
  1413. };
  1414. export const tagColors = {
  1415. stage: 'bg-yellow-200 dark:bg-yellow-300',
  1416. production: 'bg-green-200 dark:bg-green-300',
  1417. };
  1418. export const eventList = [
  1419. { id: 'click', name: 'Click', type: 'mouse-event' },
  1420. { id: 'dblclick', name: 'Double Click', type: 'mouse-event' },
  1421. { id: 'mouseup', name: 'Mouseup', type: 'mouse-event' },
  1422. { id: 'mousedown', name: 'Mousedown', type: 'mouse-event' },
  1423. { id: 'mouseenter', name: 'Mouseenter', type: 'mouse-event' },
  1424. { id: 'mouseleave', name: 'Mouseleave', type: 'mouse-event' },
  1425. { id: 'mouseover', name: 'Mouseover', type: 'mouse-event' },
  1426. { id: 'mouseout', name: 'Mouseout', type: 'mouse-event' },
  1427. { id: 'mousemove', name: 'Mousemove', type: 'mouse-event' },
  1428. { id: 'focus', name: 'Focus', type: 'focus-event' },
  1429. { id: 'blur', name: 'Blur', type: 'focus-event' },
  1430. { id: 'input', name: 'Input', type: 'input-event' },
  1431. { id: 'change', name: 'Change', type: 'event' },
  1432. { id: 'touchstart', name: 'Touch start', type: 'touch-event' },
  1433. { id: 'touchend', name: 'Touch end', type: 'touch-event' },
  1434. { id: 'touchmove', name: 'Touch move', type: 'touch-event' },
  1435. { id: 'touchcancel', name: 'Touch cancel', type: 'touch-event' },
  1436. { id: 'keydown', name: 'Keydown', type: 'keyboard-event' },
  1437. { id: 'keyup', name: 'Keyup', type: 'keyboard-event' },
  1438. { id: 'submit', name: 'Submit', type: 'submit-event' },
  1439. { id: 'wheel', name: 'Wheel', type: 'wheel-event' },
  1440. ];
  1441. export const dataExportTypes = [
  1442. { name: 'JSON', id: 'json' },
  1443. { name: 'CSV', id: 'csv' },
  1444. { name: 'Plain text', id: 'plain-text' },
  1445. ];
  1446. export const workflowCategories = {
  1447. scrape: 'Scraping',
  1448. automation: 'Automation',
  1449. productivity: 'Productivity',
  1450. };
  1451. export const excludeOnError = [
  1452. 'note',
  1453. 'delay',
  1454. 'webhook',
  1455. 'trigger',
  1456. 'while-loop',
  1457. 'conditions',
  1458. 'block-package',
  1459. 'element-exists',
  1460. ];
  1461. export const contentTypes = [
  1462. { name: 'text/plain', value: 'text' },
  1463. { name: 'application/json', value: 'json' },
  1464. { name: 'multipart/form-data', value: 'form-data' },
  1465. { name: 'application/x-www-form-urlencoded', value: 'form' },
  1466. ];
  1467. export const supportLocales = [
  1468. { id: 'en', name: 'English' },
  1469. { id: 'zh', name: '简体中文' },
  1470. { id: 'zh-tw', name: '繁體中文' },
  1471. { id: 'vi', name: 'Tiếng Việt' },
  1472. { id: 'fr', name: 'Français' },
  1473. ];
  1474. export const communities = [
  1475. {
  1476. name: 'GitHub',
  1477. icon: 'riGithubFill',
  1478. url: 'https://github.com/kholid060/automa',
  1479. },
  1480. {
  1481. name: 'Twitter',
  1482. icon: 'riTwitterLine',
  1483. url: 'https://twitter.com/AutomaApp',
  1484. },
  1485. {
  1486. name: 'Discord',
  1487. icon: 'riDiscordLine',
  1488. url: 'https://discord.gg/C6khwwTE84',
  1489. },
  1490. {
  1491. name: 'YouTube',
  1492. icon: 'riYoutubeLine',
  1493. url: 'https://www.youtube.com/channel/UCL3qU64hW0fsIj2vOayOQUQ',
  1494. },
  1495. ];
  1496. export const elementsHighlightData = {
  1497. selectedElements: {
  1498. stroke: '#2563EB',
  1499. activeStroke: '#f87171',
  1500. fill: 'rgba(37, 99, 235, 0.1)',
  1501. activeFill: 'rgba(248, 113, 113, 0.1)',
  1502. },
  1503. hoveredElements: {
  1504. stroke: '#fbbf24',
  1505. fill: 'rgba(251, 191, 36, 0.1)',
  1506. },
  1507. };
  1508. export const excludeGroupBlocks = [
  1509. 'trigger',
  1510. 'repeat-task',
  1511. 'loop-data',
  1512. 'loop-breakpoint',
  1513. 'blocks-group',
  1514. 'conditions',
  1515. 'webhook',
  1516. 'element-exists',
  1517. 'while-loop',
  1518. 'block-package',
  1519. ];
  1520. export const conditionBuilder = {
  1521. valueTypes: [
  1522. {
  1523. id: 'value',
  1524. category: 'value',
  1525. name: 'Value',
  1526. compareable: true,
  1527. data: { value: '' },
  1528. },
  1529. {
  1530. id: 'code',
  1531. category: 'value',
  1532. name: 'Code',
  1533. compareable: false,
  1534. data: { code: '\nreturn true;', context: 'background' },
  1535. },
  1536. {
  1537. id: 'data#exists',
  1538. category: 'value',
  1539. name: 'Data exists',
  1540. compareable: false,
  1541. valueKey: 'dataPath',
  1542. data: { dataPath: '' },
  1543. },
  1544. {
  1545. id: 'element#text',
  1546. category: 'element',
  1547. name: 'Element text',
  1548. compareable: true,
  1549. data: { selector: '' },
  1550. },
  1551. {
  1552. id: 'element#exists',
  1553. category: 'element',
  1554. name: 'Element exists',
  1555. compareable: false,
  1556. data: { selector: '' },
  1557. },
  1558. {
  1559. id: 'element#notExists',
  1560. category: 'element',
  1561. name: 'Element not exists',
  1562. compareable: false,
  1563. data: { selector: '' },
  1564. },
  1565. {
  1566. id: 'element#visible',
  1567. category: 'element',
  1568. name: 'Element visible',
  1569. compareable: false,
  1570. data: { selector: '' },
  1571. },
  1572. {
  1573. id: 'element#visibleScreen',
  1574. category: 'element',
  1575. name: 'Element visible in screen',
  1576. compareable: false,
  1577. data: { selector: '' },
  1578. },
  1579. {
  1580. id: 'element#invisible',
  1581. category: 'element',
  1582. name: 'Element hidden in screen',
  1583. compareable: false,
  1584. data: { selector: '' },
  1585. },
  1586. {
  1587. id: 'element#attribute',
  1588. category: 'element',
  1589. name: 'Element attribute value',
  1590. compareable: true,
  1591. data: { selector: '', attrName: '' },
  1592. },
  1593. ],
  1594. compareTypes: [
  1595. { id: 'eq', name: 'Equals', needValue: true, category: 'basic' },
  1596. {
  1597. id: 'eqi',
  1598. name: 'Equals (case insensitive)',
  1599. needValue: true,
  1600. category: 'basic',
  1601. },
  1602. { id: 'nq', name: 'Not equals', needValue: true, category: 'basic' },
  1603. { id: 'gt', name: 'Greater than', needValue: true, category: 'number' },
  1604. {
  1605. id: 'gte',
  1606. name: 'Greater than or equal',
  1607. needValue: true,
  1608. category: 'number',
  1609. },
  1610. { id: 'lt', name: 'Less than', needValue: true, category: 'number' },
  1611. {
  1612. id: 'lte',
  1613. name: 'Less than or equal',
  1614. needValue: true,
  1615. category: 'number',
  1616. },
  1617. { id: 'cnt', name: 'Contains', needValue: true, category: 'text' },
  1618. {
  1619. id: 'cni',
  1620. name: 'Contains (case insensitive)',
  1621. needValue: true,
  1622. category: 'text',
  1623. },
  1624. { id: 'nct', name: 'Not contains', needValue: true, category: 'text' },
  1625. {
  1626. id: 'nci',
  1627. name: 'Not contains (case insensitive)',
  1628. needValue: true,
  1629. category: 'text',
  1630. },
  1631. { id: 'stw', name: 'Starts with', needValue: true, category: 'text' },
  1632. { id: 'enw', name: 'Ends with', needValue: true, category: 'text' },
  1633. { id: 'rgx', name: 'Match with RegEx', needValue: true, category: 'text' },
  1634. { id: 'itr', name: 'Is truthy', needValue: false, category: 'boolean' },
  1635. { id: 'ifl', name: 'Is falsy', needValue: false, category: 'boolean' },
  1636. ],
  1637. inputTypes: {
  1638. selector: {
  1639. placeholder: '.class',
  1640. label: 'CSS selector or XPath',
  1641. },
  1642. value: {
  1643. label: 'Value',
  1644. placeholder: 'abc123',
  1645. },
  1646. attrName: {
  1647. label: 'Attribute name',
  1648. placeholder: 'name',
  1649. },
  1650. dataPath: {
  1651. label: 'variables@variableName',
  1652. placeholder: '',
  1653. },
  1654. },
  1655. };