shared.js 36 KB

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