Spaces:
Running

File size: 2,772 Bytes
14111d2
 
 
 
 
 
 
 
ea5a1e6
 
 
 
964bd64
ea5a1e6
 
 
 
 
 
6acd609
ea5a1e6
6acd609
 
 
 
 
 
 
 
 
 
ea5a1e6
 
4d76eb9
 
 
96f5313
 
ea5a1e6
 
96f5313
3a892b0
 
 
14111d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
'use strict';
const { contextBridge, ipcRenderer } = require('electron');

const on = channel => fn => { const h = (_e, p) => fn(p); ipcRenderer.on(channel, h); return () => ipcRenderer.removeListener(channel, h); };

contextBridge.exposeInMainWorld('ora', {
    state: () => ipcRenderer.invoke('state'),
    createProject: name => ipcRenderer.invoke('project:create', name),
    startImages: job => ipcRenderer.invoke('image:start', job),
    cancel: () => ipcRenderer.invoke('job:cancel'),
    onJobUpdate: on('job:update'),
    onJobEnd: on('job:end'),
    pickPhoto: purpose => ipcRenderer.invoke('photo:pick', purpose),
    savePoster: (id, index, bytes, spec) => ipcRenderer.invoke('poster:save', id, index, bytes, spec),
    deletePicture: id => ipcRenderer.invoke('picture:delete', id),
    reveal: p => ipcRenderer.invoke('reveal', p),
    openFolder: which => ipcRenderer.invoke('open:folder', which),
    onlineStatus: () => ipcRenderer.invoke('online:status'),
    connectCloudflare: (account, token) => ipcRenderer.invoke('online:cloudflare', account, token),
    testCloudflare: () => ipcRenderer.invoke('online:cfTest'),
    disconnectOnline: which => ipcRenderer.invoke('online:disconnect', which),
    n8nTest: url => ipcRenderer.invoke('n8n:test', url),
    n8nSend: posts => ipcRenderer.invoke('n8n:send', posts),
    n8nSetSheet: link => ipcRenderer.invoke('n8n:sheet', link),
    n8nSetEmail: address => ipcRenderer.invoke('n8n:email', address),
    n8nRemind: list => ipcRenderer.invoke('n8n:remind', list),
    n8nAccount: (id, use) => ipcRenderer.invoke('n8n:account', id, use),
    n8nLinkedIn: list => ipcRenderer.invoke('n8n:linkedin', list),
    n8nUnlog: ids => ipcRenderer.invoke('n8n:unlog', ids),
    n8nCancel: links => ipcRenderer.invoke('n8n:cancel', links),
    n8nWorkflow: label => ipcRenderer.invoke('n8n:workflow', label),
    openOnline: which => ipcRenderer.invoke('online:open', which),
    improvePrompt: (text, kind) => ipcRenderer.invoke('prompt:improve', text, kind),
    planGet: slot => ipcRenderer.invoke('plan:get', slot),
    planSet: (plan, slot) => ipcRenderer.invoke('plan:set', plan, slot),
    planAi: (task, facts) => ipcRenderer.invoke('plan:ai', task, facts),
    planPdf: (name, html, page) => ipcRenderer.invoke('plan:pdf', name, html, page),
    planExport: (name, bytes, ext) => ipcRenderer.invoke('plan:export', name, bytes, ext),
    demoInstall: () => ipcRenderer.invoke('demo:install'),
    demoRemove: () => ipcRenderer.invoke('demo:remove'),
    writeCaption: (ctx, platform) => ipcRenderer.invoke('caption:write', ctx, platform),
    checkUpdate: () => ipcRenderer.invoke('update:check'),
    installUpdate: () => ipcRenderer.invoke('update:install'),
    onUpdateProgress: on('update:progress'),
});