@finsemble/finsemble-electron-adapter 1.0.0-beta-1

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 (146) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +46 -0
  3. package/dist/app.js +3 -0
  4. package/dist/app.js.LICENSE.txt +331 -0
  5. package/dist/app.js.map +1 -0
  6. package/dist/e2o.js +2 -0
  7. package/dist/e2o.js.map +1 -0
  8. package/dist/exports.js +3 -0
  9. package/dist/exports.js.LICENSE.txt +331 -0
  10. package/dist/exports.js.map +1 -0
  11. package/exports.js +10 -0
  12. package/node_modules/electron-ipc-mock/.npmignore +2 -0
  13. package/node_modules/electron-ipc-mock/.travis.yml +8 -0
  14. package/node_modules/electron-ipc-mock/LICENSE +19 -0
  15. package/node_modules/electron-ipc-mock/README.md +42 -0
  16. package/node_modules/electron-ipc-mock/dist/constants.js +8 -0
  17. package/node_modules/electron-ipc-mock/dist/electron-ipc-mock.js +56 -0
  18. package/node_modules/electron-ipc-mock/dist/event.js +25 -0
  19. package/node_modules/electron-ipc-mock/dist/index.js +22 -0
  20. package/node_modules/electron-ipc-mock/dist/ipc-main.js +103 -0
  21. package/node_modules/electron-ipc-mock/dist/ipc-renderer.js +113 -0
  22. package/node_modules/electron-ipc-mock/dist/pipe.js +40 -0
  23. package/node_modules/electron-ipc-mock/dist/utils.js +33 -0
  24. package/node_modules/electron-ipc-mock/package.json +34 -0
  25. package/node_modules/image-size/LICENSE +9 -0
  26. package/node_modules/image-size/Readme.md +182 -0
  27. package/node_modules/image-size/bin/image-size.js +48 -0
  28. package/node_modules/image-size/dist/detector.d.ts +3 -0
  29. package/node_modules/image-size/dist/detector.js +30 -0
  30. package/node_modules/image-size/dist/index.d.ts +11 -0
  31. package/node_modules/image-size/dist/index.js +134 -0
  32. package/node_modules/image-size/dist/readUInt.d.ts +4 -0
  33. package/node_modules/image-size/dist/readUInt.js +11 -0
  34. package/node_modules/image-size/dist/types/bmp.d.ts +2 -0
  35. package/node_modules/image-size/dist/types/bmp.js +14 -0
  36. package/node_modules/image-size/dist/types/cur.d.ts +2 -0
  37. package/node_modules/image-size/dist/types/cur.js +16 -0
  38. package/node_modules/image-size/dist/types/dds.d.ts +2 -0
  39. package/node_modules/image-size/dist/types/dds.js +14 -0
  40. package/node_modules/image-size/dist/types/gif.d.ts +2 -0
  41. package/node_modules/image-size/dist/types/gif.js +16 -0
  42. package/node_modules/image-size/dist/types/icns.d.ts +2 -0
  43. package/node_modules/image-size/dist/types/icns.js +103 -0
  44. package/node_modules/image-size/dist/types/ico.d.ts +2 -0
  45. package/node_modules/image-size/dist/types/ico.js +67 -0
  46. package/node_modules/image-size/dist/types/interface.d.ts +14 -0
  47. package/node_modules/image-size/dist/types/interface.js +2 -0
  48. package/node_modules/image-size/dist/types/j2c.d.ts +2 -0
  49. package/node_modules/image-size/dist/types/j2c.js +15 -0
  50. package/node_modules/image-size/dist/types/jp2.d.ts +2 -0
  51. package/node_modules/image-size/dist/types/jp2.js +58 -0
  52. package/node_modules/image-size/dist/types/jpg.d.ts +2 -0
  53. package/node_modules/image-size/dist/types/jpg.js +123 -0
  54. package/node_modules/image-size/dist/types/ktx.d.ts +2 -0
  55. package/node_modules/image-size/dist/types/ktx.js +15 -0
  56. package/node_modules/image-size/dist/types/png.d.ts +2 -0
  57. package/node_modules/image-size/dist/types/png.js +34 -0
  58. package/node_modules/image-size/dist/types/pnm.d.ts +2 -0
  59. package/node_modules/image-size/dist/types/pnm.js +75 -0
  60. package/node_modules/image-size/dist/types/psd.d.ts +2 -0
  61. package/node_modules/image-size/dist/types/psd.js +14 -0
  62. package/node_modules/image-size/dist/types/svg.d.ts +2 -0
  63. package/node_modules/image-size/dist/types/svg.js +91 -0
  64. package/node_modules/image-size/dist/types/tiff.d.ts +2 -0
  65. package/node_modules/image-size/dist/types/tiff.js +97 -0
  66. package/node_modules/image-size/dist/types/webp.d.ts +2 -0
  67. package/node_modules/image-size/dist/types/webp.js +58 -0
  68. package/node_modules/image-size/dist/types.d.ts +19 -0
  69. package/node_modules/image-size/dist/types.js +38 -0
  70. package/node_modules/image-size/package.json +67 -0
  71. package/node_modules/inherits/LICENSE +16 -0
  72. package/node_modules/inherits/README.md +42 -0
  73. package/node_modules/inherits/inherits.js +9 -0
  74. package/node_modules/inherits/inherits_browser.js +27 -0
  75. package/node_modules/inherits/package.json +29 -0
  76. package/node_modules/queue/LICENSE +8 -0
  77. package/node_modules/queue/index.d.ts +173 -0
  78. package/node_modules/queue/index.js +195 -0
  79. package/node_modules/queue/package.json +43 -0
  80. package/node_modules/queue/readme.md +221 -0
  81. package/package.json +119 -0
  82. package/types/app.d.ts +1 -0
  83. package/types/deploy/deploymentHelpers.d.ts +10 -0
  84. package/types/deploy/installer.d.ts +5 -0
  85. package/types/deploy/packageCreator.d.ts +4 -0
  86. package/types/deploy/schemas/installer.d.ts +3 -0
  87. package/types/deploy/schemas/packager.d.ts +3 -0
  88. package/types/e2o.d.ts +2 -0
  89. package/types/exports.d.ts +19 -0
  90. package/types/logger/classes/LoggerMain.d.ts +21 -0
  91. package/types/logger/classes/LoggerRenderer.d.ts +11 -0
  92. package/types/logger/colorizer.d.ts +2 -0
  93. package/types/logger/config.d.ts +12 -0
  94. package/types/logger/formatters/basic.d.ts +2 -0
  95. package/types/logger/main.d.ts +2 -0
  96. package/types/logger/renderer.d.ts +1 -0
  97. package/types/logger/transports/winston-daily-rotate-file.d.ts +2 -0
  98. package/types/logger/transports/winston-terminal-transport.d.ts +2 -0
  99. package/types/logger/types.d.ts +9 -0
  100. package/types/main/AffinityGroupManager.d.ts +15 -0
  101. package/types/main/BrowserViews.d.ts +38 -0
  102. package/types/main/ExternalApplicationManager.d.ts +37 -0
  103. package/types/main/IAB.d.ts +17 -0
  104. package/types/main/IAC.d.ts +18 -0
  105. package/types/main/Main.d.ts +7 -0
  106. package/types/main/MainBus.d.ts +22 -0
  107. package/types/main/MainSystem.d.ts +75 -0
  108. package/types/main/MainWindow.d.ts +153 -0
  109. package/types/main/Manifest.d.ts +13 -0
  110. package/types/main/MonitorInfo.d.ts +4 -0
  111. package/types/main/PermissionsManager.d.ts +12 -0
  112. package/types/main/ScreenCapture.d.ts +7 -0
  113. package/types/main/SplashScreen.d.ts +13 -0
  114. package/types/main/appDataFolder.d.ts +9 -0
  115. package/types/main/autoUpdaterWrapper.d.ts +37 -0
  116. package/types/main/contentSecurity.d.ts +17 -0
  117. package/types/main/contextMenu.d.ts +2 -0
  118. package/types/main/download.d.ts +18 -0
  119. package/types/main/getWindowIdentity.d.ts +3 -0
  120. package/types/main/listeners.d.ts +6 -0
  121. package/types/main/mainStore.d.ts +3 -0
  122. package/types/main/preloads.d.ts +9 -0
  123. package/types/main/protocolHandler.d.ts +11 -0
  124. package/types/main/updateManager.d.ts +20 -0
  125. package/types/permissions/chromePermissions.d.ts +59 -0
  126. package/types/permissions/defaultWindowOptions.d.ts +377 -0
  127. package/types/render/InterApplicationBus.d.ts +16 -0
  128. package/types/render/Notification.d.ts +3 -0
  129. package/types/render/RequestHelper.d.ts +23 -0
  130. package/types/render/System.d.ts +62 -0
  131. package/types/render/Window.d.ts +75 -0
  132. package/types/render/renderHelpers.d.ts +1 -0
  133. package/types/server/AppD.d.ts +18 -0
  134. package/types/server/AppDStaticConfigPlugin.d.ts +8 -0
  135. package/types/server/CosaicCloud.d.ts +21 -0
  136. package/types/server/Progress.d.ts +26 -0
  137. package/types/server/Server.d.ts +17 -0
  138. package/types/server/SmartDesktop.d.ts +36 -0
  139. package/types/server/SmartDesktopEndpoints.d.ts +99 -0
  140. package/types/server/SmartDesktopStaticConfigPlugin.d.ts +9 -0
  141. package/types/server/cssUtilities.d.ts +6 -0
  142. package/types/server/writeJSON.d.ts +1 -0
  143. package/types/startup/e2oLauncher.d.ts +1 -0
  144. package/types/startup/runScriptInElectron.d.ts +6 -0
  145. package/types/types/types.d.ts +148 -0
  146. package/types/util.d.ts +13 -0
@@ -0,0 +1,36 @@
1
+ export declare type DeployInfo = {
2
+ manifestURL: string;
3
+ installerURL: string;
4
+ uuid: string;
5
+ buildID?: string;
6
+ };
7
+ export declare type ProjectPointer = {
8
+ name: string;
9
+ path: string;
10
+ };
11
+ export declare type ProjectConfig = {
12
+ name: string;
13
+ deployInfo: DeployInfo | null;
14
+ };
15
+ declare const smartDesktopsJSONLocation: () => string;
16
+ declare const setProjectPath: (name: string, _path: string) => void;
17
+ export declare const getProjectConfig: (name: string) => [Error | null, ProjectConfig | null];
18
+ declare const getSmartDesktopConfig: () => Promise<any>;
19
+ declare const getCurrentWorkingProject: () => Promise<ProjectPointer>;
20
+ export declare const getCurrentWorkingProjectConfig: () => Promise<[Error | null, ProjectConfig | null]>;
21
+ declare const saveDeployInfo: (deployInfo: DeployInfo) => Promise<void>;
22
+ declare const updateProjectName: (currentName: string, newName: string) => [Error | null];
23
+ declare const resetProject: (name: string) => Error | null;
24
+ declare const start: ({ appDataPath, reset, update }: {
25
+ appDataPath: string;
26
+ reset?: boolean | undefined;
27
+ update?: boolean | undefined;
28
+ }) => Promise<string>;
29
+ declare const enabled: () => boolean;
30
+ interface SDServerInfo {
31
+ enabled: boolean;
32
+ applicationRoot: string | null;
33
+ projectConfig?: ProjectConfig | null;
34
+ }
35
+ declare const info: () => Promise<SDServerInfo>;
36
+ export { enabled, start, getCurrentWorkingProject, getSmartDesktopConfig, smartDesktopsJSONLocation, saveDeployInfo, updateProjectName, info, resetProject, setProjectPath, };
@@ -0,0 +1,99 @@
1
+ import express from "express";
2
+ import { UploadedFile } from "express-fileupload";
3
+ import { ConsoleLogger } from "../logger/types";
4
+ import { DeployInfo } from "./SmartDesktop";
5
+ import { Progress } from "./Progress";
6
+ export interface CSSVariables {
7
+ [index: string]: string;
8
+ }
9
+ export declare type AssetMeta = {
10
+ key: string;
11
+ name: string;
12
+ type: string;
13
+ size: number;
14
+ targetPath: string | null;
15
+ };
16
+ export declare type Asset = {
17
+ meta: AssetMeta;
18
+ file: UploadedFile;
19
+ };
20
+ export declare enum AuthenticationType {
21
+ OAUTH2 = "OAUTH2",
22
+ PASSWORD = "PASSWORD"
23
+ }
24
+ export declare type AuthenticationProvider = {
25
+ name: string;
26
+ type: AuthenticationType;
27
+ client_id: string | null;
28
+ secret: string | null;
29
+ enabled: boolean;
30
+ redirect_uri: string;
31
+ authorization_endpoint?: string;
32
+ scope?: string;
33
+ nonce: boolean;
34
+ };
35
+ export declare type MenuObjType = {
36
+ displayName: string;
37
+ applications: string[];
38
+ position: number;
39
+ };
40
+ export declare type MenuType = {
41
+ [key: string]: MenuObjType;
42
+ };
43
+ export declare type CopiedFile = {
44
+ source: string;
45
+ target: string;
46
+ };
47
+ export declare type ProjectSettings = {
48
+ name: string;
49
+ path?: string;
50
+ version?: string;
51
+ authors?: string;
52
+ description?: string;
53
+ };
54
+ export declare type Preload = {
55
+ url: string;
56
+ alias: string;
57
+ };
58
+ export declare type PreloadUsage = {
59
+ all?: boolean;
60
+ launchable?: boolean;
61
+ apps?: string[];
62
+ };
63
+ export declare type preloadUsageType = "launchable" | "all" | "selection";
64
+ export declare type PreloadDetail = {
65
+ url: string;
66
+ autoload: preloadUsageType;
67
+ };
68
+ export declare type PreloadMap = {
69
+ [alias: string]: PreloadDetail;
70
+ };
71
+ export declare type SmartDesktopPlugin = {
72
+ saveTheme: (cssVariables: CSSVariables) => Promise<void>;
73
+ getTheme: (filename: string) => Promise<CSSVariables>;
74
+ getProjectSettings: (projectName: string) => Promise<ProjectSettings>;
75
+ updateProjectSettings: (projectName: string, settings: ProjectSettings) => Promise<void>;
76
+ updateInstallerConfig: (projectName: string, settings: any) => Promise<void>;
77
+ createProjectZip: (projectName: string, targetPath: string) => Promise<string>;
78
+ copyProjectFiles: (projectName: string, targetPath: string) => Promise<CopiedFile[]>;
79
+ saveAssets: (files: Asset[]) => Promise<string[]>;
80
+ publishToCosaicCloud: (uuid: string | null) => Promise<DeployInfo>;
81
+ getProgress: () => Promise<Progress>;
82
+ resetProject: (projectName: string) => Promise<void>;
83
+ getMenus: () => Promise<MenuType>;
84
+ addMenu: (definition: MenuObjType) => Promise<void>;
85
+ updateMenu: (menuId: any, definition: MenuObjType) => Promise<void>;
86
+ deleteMenu: (menuId: any) => Promise<void>;
87
+ getAuthenticationProviders: () => Promise<AuthenticationProvider[]>;
88
+ putAuthenticationProviders: (providers: AuthenticationProvider[]) => Promise<void>;
89
+ getPreloads: () => Promise<PreloadMap>;
90
+ savePreload: (oldAlias: string, newAlias: string, detail: PreloadDetail) => Promise<void>;
91
+ deletePreload: (alias: string) => Promise<void>;
92
+ };
93
+ declare type UseEndpointParams = {
94
+ app: express.Application;
95
+ plugin: SmartDesktopPlugin;
96
+ logger?: ConsoleLogger;
97
+ };
98
+ declare const useEndpoints: ({ app, plugin, logger }: UseEndpointParams) => void;
99
+ export { useEndpoints };
@@ -0,0 +1,9 @@
1
+ import { SmartDesktopPlugin } from "./SmartDesktopEndpoints";
2
+ import { ConsoleLogger } from "../logger/types";
3
+ export declare type SmartDesktopStaticConfigPluginParams = {
4
+ projectRoot: string;
5
+ logger?: ConsoleLogger;
6
+ appDataPath: string;
7
+ };
8
+ declare const initialize: ({ logger, projectRoot, appDataPath }: SmartDesktopStaticConfigPluginParams) => Promise<SmartDesktopPlugin>;
9
+ export { initialize };
@@ -0,0 +1,6 @@
1
+ export interface CSSVariables {
2
+ [index: string]: string;
3
+ }
4
+ export declare const fileToCssVariables: (path: string) => CSSVariables;
5
+ export declare const jsonToCssVariables: (cssVariables: CSSVariables) => string;
6
+ export declare const addCssVariablesToFile: (cssVariables: CSSVariables, path: string) => void;
@@ -0,0 +1 @@
1
+ export default function (targetPath: string, json: any): void;
@@ -0,0 +1 @@
1
+ export default function startFEA({ onElectronClose, manifest, socketCertificatePath, breakpointOnStart, args, chromiumFlags }: any, cb?: Function): void;
@@ -0,0 +1,6 @@
1
+ /// <reference types="node" />
2
+ import { ChildProcessWithoutNullStreams } from "child_process";
3
+ export declare function runScriptInElectron(params: {
4
+ script: string;
5
+ done?: (exitCode: number | null) => void;
6
+ }): ChildProcessWithoutNullStreams;
@@ -0,0 +1,148 @@
1
+ import { BrowserView, WebContents } from "electron";
2
+ import { MainWindow } from "../main/MainWindow";
3
+ import { IpcMainEvent, ProcessMetric } from "electron";
4
+ export declare type StandardError = string | null | undefined;
5
+ export declare type StandardErrorCallback<R = any> = (err: StandardError, response?: R) => void;
6
+ export declare type StandardPromise<R = any> = Promise<{
7
+ err?: StandardError;
8
+ data?: R;
9
+ }>;
10
+ export declare type StandardResponse<R = any> = {
11
+ err?: StandardError;
12
+ data?: R;
13
+ };
14
+ export declare type FEALogLevel = "error" | "warn" | "info" | "log" | "verbose" | "debug";
15
+ export declare type Manifest = Record<string, any>;
16
+ export declare type AnnotatedBrowserWindowOptions = Record<string, any>;
17
+ export declare type WebContentsId = WebContents["id"];
18
+ export declare type MainStore = {
19
+ webContents: {
20
+ [stringifiedWebContentsId: string]: {
21
+ id: WebContentsId;
22
+ isTitlebarWindow: boolean;
23
+ windowName: string;
24
+ webContentsName: string;
25
+ isView: boolean;
26
+ manifest: Manifest;
27
+ preloads: {
28
+ url: string;
29
+ fileName?: string;
30
+ src?: string;
31
+ error?: string | null;
32
+ trusted?: boolean;
33
+ }[];
34
+ contextIsolation: boolean;
35
+ };
36
+ };
37
+ downloads: {
38
+ [url: string]: {
39
+ url: string;
40
+ fileName?: string;
41
+ error?: string | null;
42
+ };
43
+ };
44
+ browserWindowOptions: {
45
+ [stringifiedWebContentsId: string]: AnnotatedBrowserWindowOptions;
46
+ };
47
+ unattachedChildWindows: {
48
+ [parentWebContentsId: string]: AnnotatedBrowserWindowOptions;
49
+ };
50
+ };
51
+ export declare type WebContentsRecord = MainStore["webContents"]["any"];
52
+ export declare type Preload = WebContentsRecord["preloads"][0];
53
+ export declare type Download = MainStore["downloads"]["any"];
54
+ export declare type WindowsIndex = {
55
+ byWindowName: {
56
+ [name: string]: MainWindow;
57
+ };
58
+ byWebContentsId: {
59
+ [id: number]: {
60
+ webContentsName: string;
61
+ webContents: WebContents;
62
+ mainWindow: MainWindow;
63
+ browserView?: BrowserView;
64
+ };
65
+ };
66
+ };
67
+ export declare type SocketCertificatePath = {
68
+ key: string;
69
+ cert: string;
70
+ };
71
+ export declare type BusEventPayload = {
72
+ topic: string;
73
+ data: any;
74
+ };
75
+ export declare type MainProcessBusEvent = {
76
+ sender: WebContents;
77
+ topic: string;
78
+ rawEvent: IpcMainEvent;
79
+ rawArgs: BusEventPayload;
80
+ data: any;
81
+ respondSync: Function;
82
+ respond: Function;
83
+ };
84
+ export declare type RendererBusResponse = {
85
+ topic: string;
86
+ data: any;
87
+ persistChannel: any;
88
+ responseUUID: string;
89
+ functionCB: Function;
90
+ };
91
+ export declare type WindowBounds = {
92
+ x: number;
93
+ y: number;
94
+ height: number;
95
+ width: number;
96
+ right: number;
97
+ bottom: number;
98
+ };
99
+ export declare type Asset = {
100
+ alias: string;
101
+ target: string;
102
+ src: string;
103
+ path?: string;
104
+ version: string;
105
+ };
106
+ export declare type Metric = {
107
+ cpuUsage: number;
108
+ name: string;
109
+ type: ProcessMetric["type"];
110
+ peakWorkingSetSize: number;
111
+ processId: number;
112
+ workingSetSize: number;
113
+ webContents: {
114
+ [webContentId: number]: {
115
+ windowName: string;
116
+ webContentsName: string;
117
+ type: "window" | "view";
118
+ };
119
+ };
120
+ affinity?: string | boolean;
121
+ };
122
+ export declare type IABSubscribeResponse = {
123
+ data: any;
124
+ listenerID: string;
125
+ };
126
+ export declare type IABPublish = {
127
+ destination: string;
128
+ data?: any;
129
+ };
130
+ export declare type IABUnsubscribe = {
131
+ listenerID: string;
132
+ };
133
+ export declare type IABSubscribe = {
134
+ listenerID: string;
135
+ source: string;
136
+ };
137
+ export declare type ErrorResponseFSA = {
138
+ type: "ErrorResponse";
139
+ payload: {
140
+ err: string;
141
+ };
142
+ };
143
+ export declare type SpawnResponseFSA = {
144
+ type: "SpawnResponse";
145
+ payload: {
146
+ windowName: string;
147
+ };
148
+ };
@@ -0,0 +1,13 @@
1
+ import { StandardResponse } from "./types/types";
2
+ export declare const hashFn: (str: string, asString?: boolean, seed?: number | undefined) => string | number;
3
+ export declare const safeStringify: (obj: any, replacer?: null, spaces?: number) => string;
4
+ export declare const deleteFolderRecursive: (_path: string) => void;
5
+ export declare const accessDenied: (methodName: string, cb?: Function | null) => any;
6
+ export declare const isValidURL: (str: string) => boolean;
7
+ export declare const getFilenameFromURL: (url: string) => string;
8
+ export declare const isDevLaunch: () => boolean;
9
+ export declare const isDevMode: () => boolean;
10
+ export declare const objectFlatMap: (obj: Record<string, any>, func: (key: string, value: any) => [key: string, value: any][]) => {
11
+ [k: string]: any;
12
+ };
13
+ export declare const pathJoinSecureRoot: (rootFolder: string, userProvidedPath: string) => StandardResponse<string>;