shared.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. /* to-do execute multiple blocks simultaneously, keyboard shortcut */
  2. import { nanoid } from 'nanoid';
  3. export const tasks = {
  4. trigger: {
  5. name: 'Trigger',
  6. description: 'Block where workflow will start executing',
  7. icon: 'riFlashlightLine',
  8. component: 'BlockBasic',
  9. editComponent: 'EditTrigger',
  10. category: 'general',
  11. inputs: 0,
  12. outputs: 1,
  13. allowedInputs: true,
  14. maxConnection: 1,
  15. refDataKeys: ['url'],
  16. data: {
  17. description: '',
  18. type: 'manual',
  19. interval: 60,
  20. delay: 5,
  21. date: '',
  22. time: '00:00',
  23. url: '',
  24. shortcut: '',
  25. activeInInput: false,
  26. isUrlRegex: false,
  27. days: [],
  28. },
  29. },
  30. 'execute-workflow': {
  31. name: 'Execute workflow',
  32. description: '',
  33. icon: 'riFlowChart',
  34. component: 'BlockBasic',
  35. category: 'general',
  36. editComponent: 'EditExecuteWorkflow',
  37. inputs: 1,
  38. outputs: 1,
  39. allowedInputs: true,
  40. maxConnection: 1,
  41. refDataKeys: ['globalData'],
  42. data: {
  43. executeId: '',
  44. workflowId: '',
  45. globalData: '',
  46. description: '',
  47. },
  48. },
  49. 'active-tab': {
  50. name: 'Active tab',
  51. description: "Set current tab that you're in as an active tab",
  52. icon: 'riWindowLine',
  53. component: 'BlockBasic',
  54. category: 'browser',
  55. disableEdit: true,
  56. inputs: 1,
  57. outputs: 1,
  58. allowedInputs: true,
  59. maxConnection: 1,
  60. data: {},
  61. },
  62. 'new-tab': {
  63. name: 'New tab',
  64. description: 'Create a new tab',
  65. icon: 'riGlobalLine',
  66. component: 'BlockBasic',
  67. editComponent: 'EditNewTab',
  68. category: 'browser',
  69. inputs: 1,
  70. outputs: 1,
  71. allowedInputs: true,
  72. maxConnection: 1,
  73. refDataKeys: ['url'],
  74. data: {
  75. description: '',
  76. url: '',
  77. active: true,
  78. inGroup: false,
  79. updatePrevTab: false,
  80. },
  81. },
  82. 'switch-tab': {
  83. name: 'Switch tab',
  84. description: 'Switch active tab',
  85. icon: 'riArrowLeftRightLine',
  86. component: 'BlockBasic',
  87. editComponent: 'EditSwitchTab',
  88. category: 'browser',
  89. inputs: 1,
  90. outputs: 1,
  91. allowedInputs: true,
  92. maxConnection: 1,
  93. refDataKeys: ['url', 'matchPattern'],
  94. data: {
  95. description: '',
  96. url: '',
  97. matchPattern: '',
  98. createIfNoMatch: false,
  99. },
  100. },
  101. 'new-window': {
  102. name: 'New window',
  103. description: 'Create a new window',
  104. icon: 'riWindow2Line',
  105. component: 'BlockBasic',
  106. editComponent: 'EditNewWindow',
  107. category: 'browser',
  108. inputs: 1,
  109. outputs: 1,
  110. allowedInputs: true,
  111. maxConnection: 1,
  112. data: {
  113. description: '',
  114. top: 0,
  115. left: 0,
  116. width: 0,
  117. height: 0,
  118. incognito: false,
  119. windowState: 'normal',
  120. },
  121. },
  122. proxy: {
  123. name: 'Proxy',
  124. description: 'Set the proxy of the browser',
  125. icon: 'riShieldKeyholeLine',
  126. component: 'BlockBasic',
  127. category: 'browser',
  128. editComponent: 'EditProxy',
  129. inputs: 1,
  130. outputs: 1,
  131. maxConnection: 1,
  132. allowedInputs: true,
  133. data: {
  134. scheme: 'https',
  135. host: '',
  136. port: 443,
  137. bypassList: '',
  138. clearProxy: false,
  139. },
  140. },
  141. 'go-back': {
  142. name: 'Go back',
  143. description: 'Go back to the previous page',
  144. icon: 'riArrowGoBackLine',
  145. component: 'BlockBasic',
  146. category: 'browser',
  147. inputs: 1,
  148. outputs: 1,
  149. maxConnection: 1,
  150. disableEdit: true,
  151. allowedInputs: true,
  152. data: {},
  153. },
  154. 'forward-page': {
  155. name: 'Go forward',
  156. description: 'Go forward to the next page',
  157. icon: 'riArrowGoForwardLine',
  158. component: 'BlockBasic',
  159. category: 'browser',
  160. inputs: 1,
  161. outputs: 1,
  162. maxConnection: 1,
  163. disableEdit: true,
  164. allowedInputs: true,
  165. data: {},
  166. },
  167. 'close-tab': {
  168. name: 'Close tab/window',
  169. icon: 'riCloseCircleLine',
  170. component: 'BlockBasic',
  171. category: 'browser',
  172. editComponent: 'EditCloseTab',
  173. inputs: 1,
  174. outputs: 1,
  175. maxConnection: 1,
  176. allowedInputs: true,
  177. refDataKeys: ['url'],
  178. data: {
  179. url: '',
  180. description: '',
  181. activeTab: true,
  182. closeType: 'tab',
  183. allWindows: false,
  184. },
  185. },
  186. 'take-screenshot': {
  187. name: 'Take screenshot',
  188. description: 'Take a screenshot of current active tab',
  189. icon: 'riImageLine',
  190. component: 'BlockBasic',
  191. category: 'browser',
  192. editComponent: 'EditTakeScreenshot',
  193. inputs: 1,
  194. outputs: 1,
  195. maxConnection: 1,
  196. allowedInputs: true,
  197. refDataKeys: ['fileName'],
  198. data: {
  199. fileName: '',
  200. ext: 'png',
  201. quality: 100,
  202. dataColumn: '',
  203. variableName: '',
  204. fullPage: false,
  205. saveToColumn: false,
  206. saveToComputer: true,
  207. assignVariable: false,
  208. captureActiveTab: true,
  209. },
  210. },
  211. 'browser-event': {
  212. name: 'Browser event',
  213. description: 'Wait until the selected event is triggered',
  214. icon: 'riLightbulbLine',
  215. component: 'BlockBasic',
  216. category: 'browser',
  217. editComponent: 'EditBrowserEvent',
  218. inputs: 1,
  219. outputs: 1,
  220. maxConnection: 1,
  221. allowedInputs: true,
  222. data: {
  223. description: '',
  224. timeout: 10000,
  225. eventName: 'tab:loaded',
  226. setAsActiveTab: true,
  227. activeTabLoaded: true,
  228. tabLoadedUrl: '',
  229. tabUrl: '',
  230. fileQuery: '',
  231. },
  232. },
  233. 'event-click': {
  234. name: 'Click element',
  235. icon: 'riCursorLine',
  236. component: 'BlockBasic',
  237. editComponent: 'EditInteractionBase',
  238. category: 'interaction',
  239. inputs: 1,
  240. outputs: 1,
  241. allowedInputs: true,
  242. maxConnection: 1,
  243. refDataKeys: ['selector'],
  244. data: {
  245. description: '',
  246. findBy: 'cssSelector',
  247. waitForSelector: false,
  248. waitSelectorTimeout: 5000,
  249. selector: '',
  250. markEl: false,
  251. multiple: false,
  252. },
  253. },
  254. delay: {
  255. name: 'Delay',
  256. description: 'Add delay before executing the next block',
  257. icon: 'riTimerLine',
  258. component: 'BlockDelay',
  259. editComponent: 'EditTrigger',
  260. category: 'general',
  261. inputs: 1,
  262. outputs: 1,
  263. allowedInputs: true,
  264. maxConnection: 1,
  265. refDataKeys: ['time'],
  266. data: {
  267. time: 500,
  268. },
  269. },
  270. 'get-text': {
  271. name: 'Get text',
  272. description: 'Get text from an element',
  273. icon: 'riParagraph',
  274. component: 'BlockBasic',
  275. editComponent: 'EditGetText',
  276. category: 'interaction',
  277. inputs: 1,
  278. outputs: 1,
  279. allowedInputs: true,
  280. maxConnection: 1,
  281. refDataKeys: ['selector', 'prefixText', 'suffixText', 'extraRowValue'],
  282. data: {
  283. description: '',
  284. findBy: 'cssSelector',
  285. waitForSelector: false,
  286. waitSelectorTimeout: 5000,
  287. selector: '',
  288. markEl: false,
  289. multiple: false,
  290. regex: '',
  291. prefixText: '',
  292. suffixText: '',
  293. regexExp: ['g'],
  294. dataColumn: '',
  295. saveData: true,
  296. includeTags: false,
  297. addExtraRow: false,
  298. assignVariable: false,
  299. variableName: '',
  300. extraRowValue: '',
  301. extraRowDataColumn: '',
  302. },
  303. },
  304. 'export-data': {
  305. name: 'Export data',
  306. icon: 'riDownloadLine',
  307. component: 'BlockBasic',
  308. editComponent: 'EditExportData',
  309. category: 'general',
  310. inputs: 1,
  311. outputs: 1,
  312. allowedInputs: true,
  313. maxConnection: 1,
  314. refDataKeys: ['name'],
  315. data: {
  316. name: '',
  317. refKey: '',
  318. type: 'json',
  319. description: '',
  320. dataToExport: 'data-columns',
  321. },
  322. },
  323. 'element-scroll': {
  324. name: 'Scroll element',
  325. icon: 'riMouseLine',
  326. component: 'BlockBasic',
  327. editComponent: 'EditScrollElement',
  328. category: 'interaction',
  329. inputs: 1,
  330. outputs: 1,
  331. allowedInputs: true,
  332. maxConnection: 1,
  333. refDataKeys: ['selector'],
  334. data: {
  335. description: '',
  336. findBy: 'cssSelector',
  337. waitForSelector: false,
  338. waitSelectorTimeout: 5000,
  339. selector: 'html',
  340. markEl: false,
  341. multiple: false,
  342. scrollY: 0,
  343. scrollX: 0,
  344. incX: false,
  345. incY: false,
  346. smooth: false,
  347. scrollIntoView: false,
  348. },
  349. },
  350. link: {
  351. name: 'Link',
  352. description: 'Open link element',
  353. icon: 'riLink',
  354. component: 'BlockBasic',
  355. editComponent: 'EditInteractionBase',
  356. category: 'interaction',
  357. inputs: 1,
  358. outputs: 1,
  359. allowedInputs: true,
  360. maxConnection: 1,
  361. refDataKeys: ['selector'],
  362. data: {
  363. description: '',
  364. findBy: 'cssSelector',
  365. waitForSelector: false,
  366. waitSelectorTimeout: 5000,
  367. selector: '',
  368. markEl: false,
  369. disableMultiple: true,
  370. },
  371. },
  372. 'attribute-value': {
  373. name: 'Attribute value',
  374. description: 'Get attribute value of an element',
  375. icon: 'riBracketsLine',
  376. component: 'BlockBasic',
  377. editComponent: 'EditAttributeValue',
  378. category: 'interaction',
  379. inputs: 1,
  380. outputs: 1,
  381. allowedInputs: true,
  382. maxConnection: 1,
  383. refDataKeys: ['selector', 'attributeName', 'extraRowValue'],
  384. data: {
  385. description: '',
  386. findBy: 'cssSelector',
  387. waitForSelector: false,
  388. waitSelectorTimeout: 5000,
  389. selector: '',
  390. markEl: false,
  391. multiple: false,
  392. attributeName: '',
  393. assignVariable: false,
  394. variableName: '',
  395. dataColumn: '',
  396. saveData: true,
  397. addExtraRow: false,
  398. extraRowValue: '',
  399. extraRowDataColumn: '',
  400. },
  401. },
  402. forms: {
  403. name: 'Forms',
  404. icon: 'riInputCursorMove',
  405. description: 'Manipulate form(input, select, checkbox, and radio) element',
  406. component: 'BlockBasic',
  407. editComponent: 'EditForms',
  408. category: 'interaction',
  409. inputs: 1,
  410. outputs: 1,
  411. allowedInputs: true,
  412. maxConnection: 1,
  413. refDataKeys: ['selector', 'value'],
  414. data: {
  415. description: '',
  416. findBy: 'cssSelector',
  417. waitForSelector: false,
  418. waitSelectorTimeout: 5000,
  419. selector: '',
  420. markEl: false,
  421. multiple: false,
  422. selected: true,
  423. clearValue: true,
  424. getValue: false,
  425. saveData: true,
  426. dataColumn: '',
  427. assignVariable: false,
  428. variableName: '',
  429. type: 'text-field',
  430. value: '',
  431. delay: 0,
  432. events: [],
  433. },
  434. },
  435. 'repeat-task': {
  436. name: 'Repeat task',
  437. icon: 'riRepeat2Line',
  438. component: 'BlockRepeatTask',
  439. editComponent: 'EditTrigger',
  440. category: 'general',
  441. inputs: 1,
  442. outputs: 2,
  443. allowedInputs: true,
  444. maxConnection: 1,
  445. data: {
  446. repeatFor: 1,
  447. },
  448. },
  449. // 'reload-page': {
  450. // name: 'Reload page',
  451. // icon: 'riRestartLine',
  452. // component: 'BlockBasic',
  453. // category: 'interaction',
  454. // inputs: 1,
  455. // outputs: 1,
  456. // allowedInputs: true,
  457. // maxConnection: 1,
  458. // disableEdit: true,
  459. // data: {},
  460. // },
  461. 'javascript-code': {
  462. name: 'JavaScript code',
  463. description: 'Execute your custom javascript code in a webpage',
  464. icon: 'riCodeSSlashLine',
  465. component: 'BlockBasic',
  466. editComponent: 'EditJavascriptCode',
  467. category: 'interaction',
  468. inputs: 1,
  469. outputs: 1,
  470. allowedInputs: true,
  471. maxConnection: 1,
  472. data: {
  473. description: '',
  474. timeout: 20000,
  475. code: 'console.log("Hello world!");\nautomaNextBlock()',
  476. preloadScripts: [],
  477. },
  478. },
  479. 'trigger-event': {
  480. name: 'Trigger event',
  481. description: 'Trigger event',
  482. icon: 'riLightbulbFlashLine',
  483. component: 'BlockBasic',
  484. editComponent: 'EditTriggerEvent',
  485. category: 'interaction',
  486. inputs: 1,
  487. outputs: 1,
  488. allowedInputs: true,
  489. maxConnection: 1,
  490. refDataKeys: ['selector'],
  491. data: {
  492. description: '',
  493. findBy: 'cssSelector',
  494. waitForSelector: false,
  495. waitSelectorTimeout: 5000,
  496. selector: '',
  497. markEl: false,
  498. multiple: false,
  499. eventName: '',
  500. eventType: '',
  501. eventParams: { bubbles: true, cancelable: false },
  502. },
  503. },
  504. 'google-sheets': {
  505. name: 'Google sheets',
  506. description: 'Read Google Sheets data',
  507. icon: 'mdiGoogleSheet',
  508. component: 'BlockBasic',
  509. editComponent: 'EditGoogleSheets',
  510. category: 'onlineServices',
  511. inputs: 1,
  512. outputs: 1,
  513. allowedInputs: true,
  514. maxConnection: 1,
  515. refDataKeys: ['customData', 'range', 'spreadsheetId'],
  516. data: {
  517. range: '',
  518. refKey: '',
  519. type: 'get',
  520. customData: '',
  521. description: '',
  522. spreadsheetId: '',
  523. firstRowAsKey: false,
  524. keysAsFirstRow: false,
  525. valueInputOption: 'RAW',
  526. dataFrom: 'data-columns',
  527. },
  528. },
  529. conditions: {
  530. name: 'Conditions',
  531. description: 'Conditional block',
  532. icon: 'riAB',
  533. component: 'BlockConditions',
  534. editComponent: 'EditConditions',
  535. category: 'conditions',
  536. inputs: 1,
  537. outputs: 0,
  538. allowedInputs: true,
  539. maxConnection: 1,
  540. data: {
  541. conditions: [],
  542. },
  543. },
  544. 'element-exists': {
  545. name: 'Element exists',
  546. description: 'Check if an element is exists',
  547. icon: 'riFocus3Line',
  548. component: 'BlockElementExists',
  549. editComponent: 'EditElementExists',
  550. category: 'conditions',
  551. inputs: 1,
  552. outputs: 2,
  553. allowedInputs: true,
  554. maxConnection: 1,
  555. refDataKeys: ['selector'],
  556. data: {
  557. findBy: 'cssSelector',
  558. selector: '',
  559. tryCount: 1,
  560. timeout: 500,
  561. markEl: false,
  562. throwError: false,
  563. },
  564. },
  565. webhook: {
  566. name: 'HTTP Request',
  567. description: 'make an HTTP request',
  568. icon: 'riEarthLine',
  569. component: 'BlockBasic',
  570. editComponent: 'EditWebhook',
  571. category: 'general',
  572. inputs: 1,
  573. outputs: 1,
  574. allowedInputs: true,
  575. maxConnection: 1,
  576. refDataKeys: ['body', 'url'],
  577. data: {
  578. description: '',
  579. url: '',
  580. body: '{}',
  581. headers: [],
  582. method: 'POST',
  583. timeout: 10000,
  584. dataPath: '',
  585. contentType: 'json',
  586. variableName: '',
  587. assignVariable: false,
  588. saveData: false,
  589. dataColumn: '',
  590. responseType: 'json',
  591. },
  592. },
  593. 'loop-data': {
  594. name: 'Loop data',
  595. icon: 'riRefreshLine',
  596. component: 'BlockBasic',
  597. editComponent: 'EditLoopData',
  598. category: 'general',
  599. inputs: 1,
  600. outputs: 1,
  601. allowedInputs: true,
  602. maxConnection: 1,
  603. refDataKeys: ['loopData'],
  604. data: {
  605. loopId: '',
  606. maxLoop: 0,
  607. fromNumber: 1,
  608. toNumber: 10,
  609. loopData: '[]',
  610. description: '',
  611. variableName: '',
  612. referenceKey: '',
  613. elementSelector: '',
  614. specificRowAndCol: false,
  615. loopThrough: 'data-columns',
  616. },
  617. },
  618. 'loop-breakpoint': {
  619. name: 'Loop breakpoint',
  620. description: 'To tell where loop data must stop',
  621. icon: 'riStopLine',
  622. component: 'BlockLoopBreakpoint',
  623. category: 'general',
  624. disableEdit: true,
  625. inputs: 1,
  626. outputs: 1,
  627. allowedInputs: true,
  628. maxConnection: 1,
  629. data: {
  630. loopId: '',
  631. },
  632. },
  633. 'blocks-group': {
  634. name: 'Blocks group',
  635. description: 'Grouping blocks',
  636. icon: 'riFolderZipLine',
  637. component: 'BlockGroup',
  638. category: 'general',
  639. disableEdit: true,
  640. inputs: 1,
  641. outputs: 1,
  642. allowedInputs: true,
  643. maxConnection: 1,
  644. data: {
  645. name: '',
  646. blocks: [],
  647. },
  648. },
  649. clipboard: {
  650. name: 'Clipboard',
  651. description: 'Get the copied text from the clipboard',
  652. icon: 'riClipboardLine',
  653. component: 'BlockBasic',
  654. category: 'general',
  655. editComponent: 'EditClipboard',
  656. inputs: 1,
  657. outputs: 1,
  658. allowedInputs: true,
  659. maxConnection: 1,
  660. data: {
  661. description: '',
  662. assignVariable: false,
  663. variableName: '',
  664. saveData: true,
  665. dataColumn: '',
  666. },
  667. },
  668. 'switch-to': {
  669. name: 'Switch frame',
  670. description: 'Switch between main window and iframe',
  671. icon: 'riArrowUpDownLine',
  672. component: 'BlockBasic',
  673. editComponent: 'EditSwitchTo',
  674. category: 'interaction',
  675. inputs: 1,
  676. outputs: 1,
  677. allowedInputs: true,
  678. maxConnection: 1,
  679. refDataKeys: ['selector'],
  680. data: {
  681. findBy: 'cssSelector',
  682. selector: '',
  683. windowType: 'main-window',
  684. },
  685. },
  686. 'upload-file': {
  687. name: 'Upload file',
  688. description: 'Upload file into <input type="file"> element',
  689. icon: 'riFileUploadLine',
  690. component: 'BlockBasic',
  691. editComponent: 'EditUploadFile',
  692. category: 'interaction',
  693. inputs: 1,
  694. outputs: 1,
  695. allowedInputs: true,
  696. maxConnection: 1,
  697. refDataKeys: ['selector', 'filePaths'],
  698. data: {
  699. findBy: 'cssSelector',
  700. waitForSelector: false,
  701. waitSelectorTimeout: 5000,
  702. selector: '',
  703. filePaths: [],
  704. },
  705. },
  706. };
  707. export const categories = {
  708. interaction: {
  709. name: 'Web interaction',
  710. color: 'bg-green-200 dark:bg-green-300',
  711. },
  712. browser: {
  713. name: 'Browser',
  714. color: 'bg-orange-200 dark:bg-orange-300',
  715. },
  716. general: {
  717. name: 'General',
  718. color: 'bg-yellow-200 dark:bg-yellow-300',
  719. },
  720. onlineServices: {
  721. name: 'Online services',
  722. color: 'bg-red-200 dark:bg-red-300',
  723. },
  724. conditions: {
  725. name: 'Conditions',
  726. color: 'bg-blue-200 dark:bg-blue-300',
  727. },
  728. };
  729. export const eventList = [
  730. { id: 'click', name: 'Click', type: 'mouse-event' },
  731. { id: 'dblclick', name: 'Double Click', type: 'mouse-event' },
  732. { id: 'mouseup', name: 'Mouseup', type: 'mouse-event' },
  733. { id: 'mousedown', name: 'Mousedown', type: 'mouse-event' },
  734. { id: 'mouseenter', name: 'Mouseenter', type: 'mouse-event' },
  735. { id: 'mouseleave', name: 'Mouseleave', type: 'mouse-event' },
  736. { id: 'mouseover', name: 'Mouseover', type: 'mouse-event' },
  737. { id: 'mouseout', name: 'Mouseout', type: 'mouse-event' },
  738. { id: 'mousemove', name: 'Mousemove', type: 'mouse-event' },
  739. { id: 'focus', name: 'Focus', type: 'focus-event' },
  740. { id: 'blur', name: 'Blur', type: 'focus-event' },
  741. { id: 'input', name: 'Input', type: 'input-event' },
  742. { id: 'change', name: 'Change', type: 'event' },
  743. { id: 'touchstart', name: 'Touch start', type: 'touch-event' },
  744. { id: 'touchend', name: 'Touch end', type: 'touch-event' },
  745. { id: 'touchmove', name: 'Touch move', type: 'touch-event' },
  746. { id: 'touchcancel', name: 'Touch cancel', type: 'touch-event' },
  747. { id: 'keydown', name: 'Keydown', type: 'keyboard-event' },
  748. { id: 'keyup', name: 'Keyup', type: 'keyboard-event' },
  749. { id: 'submit', name: 'Submit', type: 'submit-event' },
  750. { id: 'wheel', name: 'Wheel', type: 'wheel-event' },
  751. ];
  752. export const dataExportTypes = [
  753. { name: 'JSON', id: 'json' },
  754. { name: 'CSV', id: 'csv' },
  755. { name: 'Plain text', id: 'plain-text' },
  756. ];
  757. export const firstWorkflows = [
  758. {
  759. id: nanoid(),
  760. name: 'Google search',
  761. createdAt: Date.now(),
  762. drawflow: `{"drawflow":{"Home":{"data":{"d634ff22-5dfe-44dc-83d2-842412bd9fbf":{"id":"d634ff22-5dfe-44dc-83d2-842412bd9fbf","name":"trigger","data":{"type":"manual","interval":10},"class":"trigger","html":"BlockBasic","typenode":"vue","inputs":{},"outputs":{"output_1":{"connections":[{"node":"b9e7e0d4-e86a-4635-a352-31c63723fef4","output":"input_1"}]}},"pos_x":50,"pos_y":300},"b9e7e0d4-e86a-4635-a352-31c63723fef4":{"id":"b9e7e0d4-e86a-4635-a352-31c63723fef4","name":"new-tab","data":{"url":"https://google.com","active":true},"class":"new-tab","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"d634ff22-5dfe-44dc-83d2-842412bd9fbf","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"09f3a14c-0514-4287-93b0-aa92b0064fba","output":"input_1"}]}},"pos_x":278,"pos_y":268},"09f3a14c-0514-4287-93b0-aa92b0064fba":{"id":"09f3a14c-0514-4287-93b0-aa92b0064fba","name":"forms","data":{"description":"Type query","selector":"[name='q']","markEl":false,"multiple":false,"selected":true,"type":"text-field","value":"Stackoverflow","delay":"120","events":[]},"class":"forms","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"b9e7e0d4-e86a-4635-a352-31c63723fef4","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"5f76370d-aa3d-4258-8319-230fcfc49a3a","output":"input_1"}]}},"pos_x":551,"pos_y":290},"5f76370d-aa3d-4258-8319-230fcfc49a3a":{"id":"5f76370d-aa3d-4258-8319-230fcfc49a3a","name":"event-click","data":{"description":"Click search","selector":"center:nth-child(1) > .gNO89b","markEl":false,"multiple":false},"class":"event-click","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"09f3a14c-0514-4287-93b0-aa92b0064fba","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]}},"pos_x":794,"pos_y":308}}}}}`,
  763. },
  764. {
  765. id: nanoid(),
  766. name: 'Generate lorem ipsum',
  767. createdAt: Date.now(),
  768. drawflow:
  769. '{"drawflow":{"Home":{"data":{"c5774692-0be4-457f-82be-d5e4b3344ad7":{"id":"c5774692-0be4-457f-82be-d5e4b3344ad7","name":"trigger","data":{"type":"manual"},"class":"trigger","html":"BlockBasic","typenode":"vue","inputs":{},"outputs":{"output_1":{"connections":[{"node":"10a0429e-b8c4-4c04-9ea3-df169cea78e4","output":"input_1"}]}},"pos_x":50,"pos_y":300},"10a0429e-b8c4-4c04-9ea3-df169cea78e4":{"id":"10a0429e-b8c4-4c04-9ea3-df169cea78e4","name":"new-tab","data":{"url":"http://lipsum.com","active":true},"class":"new-tab","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"c5774692-0be4-457f-82be-d5e4b3344ad7","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"24bdec44-1e80-4cee-9139-00545b8d33d9","output":"input_1"}]}},"pos_x":285,"pos_y":282},"df24edcc-4c29-49f5-8a29-0e572a4bc6ae":{"id":"df24edcc-4c29-49f5-8a29-0e572a4bc6ae","name":"delay","data":{"time":4000},"class":"delay","html":"BlockDelay","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"24bdec44-1e80-4cee-9139-00545b8d33d9","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"2d93c1de-42ca-4f39-8e61-e3e55529fbba","output":"input_1"}]}},"pos_x":833,"pos_y":297},"24bdec44-1e80-4cee-9139-00545b8d33d9":{"id":"24bdec44-1e80-4cee-9139-00545b8d33d9","name":"element-scroll","data":{"description":"","selector":"#amount","markEl":false,"multiple":false,"scrollY":0,"scrollX":0,"incX":false,"incY":false,"smooth":true,"scrollIntoView":true},"class":"element-scroll","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"10a0429e-b8c4-4c04-9ea3-df169cea78e4","input":"output_1"},{"node":"2f5fec61-a318-4e2b-b7d3-bc7328bd282c","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"df24edcc-4c29-49f5-8a29-0e572a4bc6ae","output":"input_1"}]}},"pos_x":566,"pos_y":317},"2d93c1de-42ca-4f39-8e61-e3e55529fbba":{"id":"2d93c1de-42ca-4f39-8e61-e3e55529fbba","name":"forms","data":{"description":"Lipsum length","selector":"#amount","markEl":false,"multiple":false,"selected":true,"type":"text-field","value":"3","delay":0,"events":[]},"class":"forms","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"df24edcc-4c29-49f5-8a29-0e572a4bc6ae","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"0f3e2baa-8d6d-4323-8ac7-362f1be39ecb","output":"input_1"}]}},"pos_x":1058,"pos_y":327},"0f3e2baa-8d6d-4323-8ac7-362f1be39ecb":{"id":"0f3e2baa-8d6d-4323-8ac7-362f1be39ecb","name":"event-click","data":{"description":"Generate button","selector":"#generate","markEl":false,"multiple":false},"class":"event-click","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"2d93c1de-42ca-4f39-8e61-e3e55529fbba","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"fb9be12f-8995-4876-8bfe-79323769474b","output":"input_1"}]}},"pos_x":1309,"pos_y":329},"fb9be12f-8995-4876-8bfe-79323769474b":{"id":"fb9be12f-8995-4876-8bfe-79323769474b","name":"delay","data":{"time":2000},"class":"delay","html":"BlockDelay","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"0f3e2baa-8d6d-4323-8ac7-362f1be39ecb","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"7205fcf2-deda-445e-9690-4e36adb52585","output":"input_1"}]}},"pos_x":1566,"pos_y":310},"7205fcf2-deda-445e-9690-4e36adb52585":{"id":"7205fcf2-deda-445e-9690-4e36adb52585","name":"get-text","data":{"description":"Get text result","selector":"#lipsum","markEl":false,"multiple":false,"regex":"","regexExp":["g"],"dataColumn":"","saveData":true},"class":"get-text","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"fb9be12f-8995-4876-8bfe-79323769474b","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"3d3e8fac-97fa-4c3d-84bc-a3db18740184","output":"input_1"}]}},"pos_x":1823,"pos_y":337},"3d3e8fac-97fa-4c3d-84bc-a3db18740184":{"id":"3d3e8fac-97fa-4c3d-84bc-a3db18740184","name":"repeat-task","data":{"repeatFor":2},"class":"repeat-task","html":"BlockRepeatTask","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"7205fcf2-deda-445e-9690-4e36adb52585","input":"output_1"}]}},"outputs":{"output_1":{"connections":[{"node":"4d39ecd5-f33f-4e57-b11d-2f26b1076334","output":"input_1"}]},"output_2":{"connections":[{"node":"2f5fec61-a318-4e2b-b7d3-bc7328bd282c","output":"input_1","points":[{"pos_x":2290.2500152587886,"pos_y":542.0000076293943},{"pos_x":1125.2500152587886,"pos_y":552.0000076293943}]}]}},"pos_x":2073,"pos_y":293.5},"2f5fec61-a318-4e2b-b7d3-bc7328bd282c":{"id":"2f5fec61-a318-4e2b-b7d3-bc7328bd282c","name":"go-back","data":{},"class":"go-back","html":"BlockBasic","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"3d3e8fac-97fa-4c3d-84bc-a3db18740184","input":"output_2"}]}},"outputs":{"output_1":{"connections":[{"node":"24bdec44-1e80-4cee-9139-00545b8d33d9","output":"input_1","points":[{"pos_x":1305.2500152587886,"pos_y":829.5000076293943},{"pos_x":545.250015258789,"pos_y":834.499988555908}]}]}},"pos_x":1135.5,"pos_y":628},"4d39ecd5-f33f-4e57-b11d-2f26b1076334":{"id":"4d39ecd5-f33f-4e57-b11d-2f26b1076334","name":"export-data","data":{"name":"Lipsum","type":"plain-text"},"class":"export-data","html":"BlockExportData","typenode":"vue","inputs":{"input_1":{"connections":[{"node":"3d3e8fac-97fa-4c3d-84bc-a3db18740184","input":"output_1"}]}},"outputs":{"output_1":{"connections":[]}},"pos_x":2409.75,"pos_y":289}}}}}',
  770. },
  771. ];
  772. export const workflowCategories = {
  773. scrape: 'Scraping',
  774. automation: 'Automation',
  775. productivity: 'Productivity',
  776. };
  777. export const contentTypes = [
  778. { name: 'application/json', value: 'json' },
  779. { name: 'application/x-www-form-urlencoded', value: 'form' },
  780. ];
  781. export const supportLocales = [
  782. { id: 'en', name: 'English' },
  783. { id: 'zh', name: '简体中文' },
  784. { id: 'zh-tw', name: '繁體中文' },
  785. { id: 'vi', name: 'Tiếng Việt' },
  786. { id: 'fr', name: 'Français' },
  787. ];