@pipelab/asset-electron 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/LICENSE +110 -0
  2. package/package.json +18 -0
  3. package/template/config.cjs +45 -0
  4. package/template/forge.config.cjs +70 -0
  5. package/template/package.json +62 -0
  6. package/template/pipelab-plugin.cjs +160 -0
  7. package/template/src/custom-main.js +1 -0
  8. package/template/src/handlers/dialog/folder.js +25 -0
  9. package/template/src/handlers/dialog/open.js +25 -0
  10. package/template/src/handlers/dialog/save.js +24 -0
  11. package/template/src/handlers/discord/set-activity.js +68 -0
  12. package/template/src/handlers/fs/copy.js +29 -0
  13. package/template/src/handlers/fs/delete.js +23 -0
  14. package/template/src/handlers/fs/exist.js +37 -0
  15. package/template/src/handlers/fs/file-size.js +24 -0
  16. package/template/src/handlers/fs/folder-create.js +25 -0
  17. package/template/src/handlers/fs/list.js +61 -0
  18. package/template/src/handlers/fs/move.js +30 -0
  19. package/template/src/handlers/fs/read-binary.js +24 -0
  20. package/template/src/handlers/fs/read.js +42 -0
  21. package/template/src/handlers/fs/write-base64.js +32 -0
  22. package/template/src/handlers/fs/write.js +30 -0
  23. package/template/src/handlers/general/engine.js +17 -0
  24. package/template/src/handlers/general/exit.js +20 -0
  25. package/template/src/handlers/general/infos.js +23 -0
  26. package/template/src/handlers/general/open-in-explorer.js +21 -0
  27. package/template/src/handlers/general/open.js +21 -0
  28. package/template/src/handlers/general/run.js +27 -0
  29. package/template/src/handlers/steam/deleteItem.js +26 -0
  30. package/template/src/handlers/steam/download.js +26 -0
  31. package/template/src/handlers/steam/downloadInfo.js +26 -0
  32. package/template/src/handlers/steam/downloadScore.js +28 -0
  33. package/template/src/handlers/steam/getItem.js +28 -0
  34. package/template/src/handlers/steam/getItems.js +28 -0
  35. package/template/src/handlers/steam/installInfo.js +26 -0
  36. package/template/src/handlers/steam/raw.js +42 -0
  37. package/template/src/handlers/steam/saveScreenshot.js +66 -0
  38. package/template/src/handlers/steam/state.js +26 -0
  39. package/template/src/handlers/steam/subscribe.js +26 -0
  40. package/template/src/handlers/steam/unsubscribe.js +26 -0
  41. package/template/src/handlers/steam/updateItem.js +26 -0
  42. package/template/src/handlers/steam/uploadScore.js +27 -0
  43. package/template/src/handlers/steam/utils.js +78 -0
  44. package/template/src/handlers/user/folder.js +71 -0
  45. package/template/src/handlers/window/maximize.js +20 -0
  46. package/template/src/handlers/window/minimize.js +20 -0
  47. package/template/src/handlers/window/request-attention.js +20 -0
  48. package/template/src/handlers/window/restore.js +20 -0
  49. package/template/src/handlers/window/set-always-on-top.js +20 -0
  50. package/template/src/handlers/window/set-fullscreen.js +26 -0
  51. package/template/src/handlers/window/set-height.js +21 -0
  52. package/template/src/handlers/window/set-ignore-mouse-events.js +36 -0
  53. package/template/src/handlers/window/set-maximum-size.js +20 -0
  54. package/template/src/handlers/window/set-minimum-size.js +20 -0
  55. package/template/src/handlers/window/set-resizable.js +20 -0
  56. package/template/src/handlers/window/set-title.js +20 -0
  57. package/template/src/handlers/window/set-width.js +21 -0
  58. package/template/src/handlers/window/set-x.js +21 -0
  59. package/template/src/handlers/window/set-y.js +21 -0
  60. package/template/src/handlers/window/show-dev-tools.js +24 -0
  61. package/template/src/handlers/window/unmaximize.js +20 -0
  62. package/template/src/index.js +958 -0
  63. package/template/src/preload.js +27 -0
  64. package/template/src/utils.js +18 -0
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetWidth, 'input'>} json
3
+ * @param {import('ws').WebSocket} ws
4
+ * @param {import('electron').BrowserWindow} mainWindow
5
+ */
6
+ export default async (json, ws, mainWindow) => {
7
+ const [, height] = mainWindow.getSize();
8
+ mainWindow.setSize(json.body.value, height);
9
+
10
+ /**
11
+ * @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetWidth, 'output'>}
12
+ */
13
+ const setWidthResult = {
14
+ correlationId: json.correlationId,
15
+ url: json.url,
16
+ body: {
17
+ success: true,
18
+ },
19
+ };
20
+ ws.send(JSON.stringify(setWidthResult));
21
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetX, 'input'>} json
3
+ * @param {import('ws').WebSocket} ws
4
+ * @param {import('electron').BrowserWindow} mainWindow
5
+ */
6
+ export default async (json, ws, mainWindow) => {
7
+ const [x, y] = mainWindow.getPosition();
8
+ mainWindow.setPosition(json.body.value, y);
9
+
10
+ /**
11
+ * @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetX, 'output'>}
12
+ */
13
+ const setXResult = {
14
+ correlationId: json.correlationId,
15
+ url: json.url,
16
+ body: {
17
+ success: true,
18
+ },
19
+ };
20
+ ws.send(JSON.stringify(setXResult));
21
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetY, 'input'>} json
3
+ * @param {import('ws').WebSocket} ws
4
+ * @param {import('electron').BrowserWindow} mainWindow
5
+ */
6
+ export default async (json, ws, mainWindow) => {
7
+ const [x, y] = mainWindow.getPosition();
8
+ mainWindow.setPosition(x, json.body.value);
9
+
10
+ /**
11
+ * @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetY, 'output'>}
12
+ */
13
+ const setYResult = {
14
+ correlationId: json.correlationId,
15
+ url: json.url,
16
+ body: {
17
+ success: true,
18
+ },
19
+ };
20
+ ws.send(JSON.stringify(setYResult));
21
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageShowDevTools, 'input'>} json
3
+ * @param {import('ws').WebSocket} ws
4
+ * @param {import('electron').BrowserWindow} mainWindow
5
+ */
6
+ export default async (json, ws, mainWindow) => {
7
+ if (json.body.value === true) {
8
+ mainWindow.webContents.openDevTools();
9
+ } else {
10
+ mainWindow.webContents.closeDevTools();
11
+ }
12
+
13
+ /**
14
+ * @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageShowDevTools, 'output'>}
15
+ */
16
+ const showDevtoolsResult = {
17
+ correlationId: json.correlationId,
18
+ url: json.url,
19
+ body: {
20
+ success: true,
21
+ },
22
+ };
23
+ ws.send(JSON.stringify(showDevtoolsResult));
24
+ };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageWindowUnmaximize, 'input'>} json
3
+ * @param {import('ws').WebSocket} ws
4
+ * @param {import('electron').BrowserWindow} mainWindow
5
+ */
6
+ export default async (json, ws, mainWindow) => {
7
+ mainWindow.unmaximize();
8
+
9
+ /**
10
+ * @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageWindowUnmaximize, 'output'>}
11
+ */
12
+ const unmaximizeResult = {
13
+ correlationId: json.correlationId,
14
+ url: json.url,
15
+ body: {
16
+ success: true,
17
+ },
18
+ };
19
+ ws.send(JSON.stringify(unmaximizeResult));
20
+ };