@interopio/browser-platform 3.0.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.
- package/browser.platform.d.ts +455 -0
- package/changelog.md +69 -0
- package/dist/browser.platform.es.js +46074 -0
- package/dist/browser.platform.es.js.map +1 -0
- package/dist/browser.platform.umd.js +46082 -0
- package/dist/browser.platform.umd.js.map +1 -0
- package/license.md +21 -0
- package/package.json +78 -0
- package/readme.md +9 -0
- package/rollup.config.js +45 -0
- package/src/common/constants.ts +46 -0
- package/src/common/defaultConfig.ts +56 -0
- package/src/common/gateway.d.ts +32 -0
- package/src/common/types.ts +222 -0
- package/src/connection/gateway.ts +132 -0
- package/src/connection/no-gateway.ts +1 -0
- package/src/connection/portsBridge.ts +441 -0
- package/src/connection/preferred.ts +247 -0
- package/src/controllers/domains.ts +156 -0
- package/src/controllers/glue.ts +604 -0
- package/src/controllers/interception.ts +53 -0
- package/src/controllers/license.ts +50 -0
- package/src/controllers/main.ts +256 -0
- package/src/controllers/plugins.ts +121 -0
- package/src/controllers/serviceWorker.ts +193 -0
- package/src/controllers/state.ts +84 -0
- package/src/controllers/system.ts +99 -0
- package/src/controllers/transactions.ts +80 -0
- package/src/factory.ts +40 -0
- package/src/fallbacks/browser.ts +47 -0
- package/src/fallbacks/dekstop.ts +21 -0
- package/src/index.ts +18 -0
- package/src/libs/applications/appStore/directory.ts +235 -0
- package/src/libs/applications/appStore/remoteWatcher.ts +112 -0
- package/src/libs/applications/controller.ts +469 -0
- package/src/libs/applications/decoders.ts +98 -0
- package/src/libs/applications/defaults.ts +6 -0
- package/src/libs/applications/types.ts +98 -0
- package/src/libs/channels/controller.ts +109 -0
- package/src/libs/channels/decoders.ts +19 -0
- package/src/libs/extension/controller.ts +120 -0
- package/src/libs/extension/decoders.ts +18 -0
- package/src/libs/extension/types.ts +11 -0
- package/src/libs/intents/constants.ts +9 -0
- package/src/libs/intents/controller.ts +500 -0
- package/src/libs/intents/decoders.ts +96 -0
- package/src/libs/intents/resolverHelper.ts +264 -0
- package/src/libs/intents/types.ts +119 -0
- package/src/libs/layouts/constants.ts +3 -0
- package/src/libs/layouts/controller.ts +476 -0
- package/src/libs/layouts/decoders.ts +132 -0
- package/src/libs/layouts/global/builder.ts +400 -0
- package/src/libs/layouts/global/resetter.ts +116 -0
- package/src/libs/layouts/global/restorer.ts +217 -0
- package/src/libs/layouts/global/validator.ts +169 -0
- package/src/libs/layouts/idbStore.ts +63 -0
- package/src/libs/layouts/types.ts +133 -0
- package/src/libs/manager/controller.ts +175 -0
- package/src/libs/manager/decoders.ts +6 -0
- package/src/libs/manager/defaults.ts +5 -0
- package/src/libs/manager/identity.ts +92 -0
- package/src/libs/manager/session.ts +195 -0
- package/src/libs/manager/types.ts +51 -0
- package/src/libs/notifications/controller.ts +447 -0
- package/src/libs/notifications/decoders.ts +166 -0
- package/src/libs/notifications/types.ts +49 -0
- package/src/libs/notifications/utils.ts +7 -0
- package/src/libs/search/controller.ts +232 -0
- package/src/libs/search/decoders.ts +6 -0
- package/src/libs/search/repositories/applications.ts +62 -0
- package/src/libs/search/repositories/layouts.ts +48 -0
- package/src/libs/search/repositories/workspaces.ts +47 -0
- package/src/libs/search/types.ts +9 -0
- package/src/libs/themes/constants.ts +9 -0
- package/src/libs/themes/controller.ts +153 -0
- package/src/libs/themes/decoders.ts +28 -0
- package/src/libs/themes/types.ts +28 -0
- package/src/libs/windows/controller.ts +498 -0
- package/src/libs/windows/decoders.ts +64 -0
- package/src/libs/windows/types.ts +59 -0
- package/src/libs/workspaces/controller.ts +922 -0
- package/src/libs/workspaces/decoders.ts +868 -0
- package/src/libs/workspaces/defaultConfig.ts +11 -0
- package/src/libs/workspaces/frames.ts +239 -0
- package/src/libs/workspaces/hibernationWatcher.ts +231 -0
- package/src/libs/workspaces/types.ts +506 -0
- package/src/platform.ts +156 -0
- package/src/shared/decoders.ts +479 -0
- package/src/shared/fetchTimeout.ts +25 -0
- package/src/shared/ioc.ts +580 -0
- package/src/shared/logger.ts +19 -0
- package/src/shared/promisePlus.ts +62 -0
- package/src/shared/sequelizer.ts +48 -0
- package/src/shared/utils.ts +86 -0
- package/src/storage/local.ts +111 -0
- package/src/storage/session.ts +436 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,868 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
3
|
+
import { IOConnectWorkspaces } from "@interopio/workspaces-api";
|
|
4
|
+
import { anyJson, array, boolean, constant, Decoder, intersection, lazy, number, object, oneOf, optional, string } from "decoder-validate";
|
|
5
|
+
import { nonEmptyStringDecoder, nonNegativeNumberDecoder, windowLayoutItemDecoder } from "../../shared/decoders";
|
|
6
|
+
import { AddContainerConfig, AddItemResult, AddWindowConfig, BaseChildSnapshotConfig, BundleItemConfig, BundleWorkspaceConfig, ChildSnapshotResult, ColumnDefinitionConfig, ContainerStreamData, ContainerSummaryResult, DeleteLayoutConfig, ExportedLayoutsResult, FrameBounds, FrameBoundsResult, FrameHello, FrameInitializationConfigProtocol, FrameSnapshotConfig, FrameSnapshotResult, FrameStateConfig, FrameStateResult, FrameStreamData, FrameSummariesResult, FrameSummaryResult, GetFrameSummaryConfig, GetWorkspacesLayoutsConfig, GetWorkspacesLayoutsResponse, GetWorkspaceWindowsOnLayoutSaveContextConfig, GetWorkspaceWindowsOnLayoutSaveContextResult, GroupDefinitionConfig, IsWindowInSwimlaneResult, LayoutSummariesResult, LayoutSummary, LockColumnConfig, LockContainerConfig, LockGroupConfig, LockRowConfig, LockWindowConfig, LockWorkspaceConfig, MoveFrameConfig, MoveWindowConfig, OpenWorkspaceConfig, ParentSnapshotConfig, PingResult, PinWorkspaceConfig, ResizeItemConfig, RowDefinitionConfig, SetItemTitleConfig, SetMaximizationBoundaryConfig, SetWorkspaceIconConfig, SimpleItemConfig, SimpleWindowOperationSuccessResult, SwimlaneWindowSnapshotConfig, WindowStreamData, WorkspaceConfigResult, WorkspaceCreateConfigProtocol, WorkspaceEventAction, WorkspaceEventType, WorkspaceIconResult, WorkspaceSelector, WorkspacesLayoutImportConfig, WorkspaceSnapshotResult, WorkspacesOperationsTypes, WorkspaceStreamData, WorkspaceSummariesResult, WorkspaceSummaryResult, WorkspaceWindowData, WorkspaceWindowOnSaveData } from "./types";
|
|
7
|
+
|
|
8
|
+
export const workspacesOperationDecoder: Decoder<WorkspacesOperationsTypes> = oneOf<
|
|
9
|
+
"isWindowInWorkspace" | "createWorkspace" | "getAllFramesSummaries" | "getFrameSummary" |
|
|
10
|
+
"getAllWorkspacesSummaries" | "getWorkspaceSnapshot" | "getAllLayoutsSummaries" | "openWorkspace" |
|
|
11
|
+
"deleteLayout" | "saveLayout" | "importLayout" | "exportAllLayouts" | "restoreItem" | "maximizeItem" |
|
|
12
|
+
"focusItem" | "closeItem" | "resizeItem" | "moveFrame" | "getFrameSnapshot" | "forceLoadWindow" |
|
|
13
|
+
"ejectWindow" | "setItemTitle" | "moveWindowTo" | "addWindow" | "addContainer" |
|
|
14
|
+
"bundleWorkspace" | "bundleItem" | "changeFrameState" | "getFrameState" | "getFrameBounds" | "frameHello" | "hibernateWorkspace" | "resumeWorkspace" | "getWorkspacesConfig" |
|
|
15
|
+
"lockWorkspace" | "lockContainer" | "lockWindow" | "pinWorkspace" | "unpinWorkspace" | "getWorkspaceIcon" | "setWorkspaceIcon" | "createFrame" | "initFrame" | "checkStarted" | "getPlatformFrameId" |
|
|
16
|
+
"getWorkspaceWindowsOnLayoutSaveContext" | "getWorkspacesLayouts" | "setMaximizationBoundary" | "operationCheck" | "getWorkspaceWindowFrameBounds" | "focusChange"
|
|
17
|
+
>(
|
|
18
|
+
constant("isWindowInWorkspace"),
|
|
19
|
+
constant("createWorkspace"),
|
|
20
|
+
constant("createFrame"),
|
|
21
|
+
constant("initFrame"),
|
|
22
|
+
constant("getAllFramesSummaries"),
|
|
23
|
+
constant("getFrameSummary"),
|
|
24
|
+
constant("getAllWorkspacesSummaries"),
|
|
25
|
+
constant("getWorkspaceSnapshot"),
|
|
26
|
+
constant("getAllLayoutsSummaries"),
|
|
27
|
+
constant("openWorkspace"),
|
|
28
|
+
constant("deleteLayout"),
|
|
29
|
+
constant("saveLayout"),
|
|
30
|
+
constant("importLayout"),
|
|
31
|
+
constant("exportAllLayouts"),
|
|
32
|
+
constant("restoreItem"),
|
|
33
|
+
constant("maximizeItem"),
|
|
34
|
+
constant("focusItem"),
|
|
35
|
+
constant("closeItem"),
|
|
36
|
+
constant("resizeItem"),
|
|
37
|
+
constant("moveFrame"),
|
|
38
|
+
constant("getFrameSnapshot"),
|
|
39
|
+
constant("forceLoadWindow"),
|
|
40
|
+
constant("ejectWindow"),
|
|
41
|
+
constant("setItemTitle"),
|
|
42
|
+
constant("moveWindowTo"),
|
|
43
|
+
constant("addWindow"),
|
|
44
|
+
constant("addContainer"),
|
|
45
|
+
constant("bundleWorkspace"),
|
|
46
|
+
constant("bundleItem"),
|
|
47
|
+
constant("changeFrameState"),
|
|
48
|
+
constant("getFrameState"),
|
|
49
|
+
constant("getFrameBounds"),
|
|
50
|
+
constant("frameHello"),
|
|
51
|
+
constant("hibernateWorkspace"),
|
|
52
|
+
constant("resumeWorkspace"),
|
|
53
|
+
constant("getWorkspacesConfig"),
|
|
54
|
+
constant("lockWorkspace"),
|
|
55
|
+
constant("lockContainer"),
|
|
56
|
+
constant("lockWindow"),
|
|
57
|
+
constant("pinWorkspace"),
|
|
58
|
+
constant("unpinWorkspace"),
|
|
59
|
+
constant("getWorkspaceIcon"),
|
|
60
|
+
constant("setWorkspaceIcon"),
|
|
61
|
+
constant("checkStarted"),
|
|
62
|
+
constant("getPlatformFrameId"),
|
|
63
|
+
constant("getWorkspaceWindowsOnLayoutSaveContext"),
|
|
64
|
+
constant("getWorkspacesLayouts"),
|
|
65
|
+
constant("setMaximizationBoundary"),
|
|
66
|
+
constant("operationCheck"),
|
|
67
|
+
constant("getWorkspaceWindowFrameBounds"),
|
|
68
|
+
constant("focusChange")
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
export const frameHelloDecoder: Decoder<FrameHello> = object({
|
|
72
|
+
windowId: optional(nonEmptyStringDecoder)
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export const workspaceWindowDataDecoder: Decoder<WorkspaceWindowData> = object({
|
|
76
|
+
name: nonEmptyStringDecoder,
|
|
77
|
+
windowId: nonEmptyStringDecoder,
|
|
78
|
+
frameId: nonEmptyStringDecoder,
|
|
79
|
+
workspaceId: optional(nonEmptyStringDecoder),
|
|
80
|
+
appName: optional(nonEmptyStringDecoder),
|
|
81
|
+
context: optional(anyJson()),
|
|
82
|
+
title: optional(nonEmptyStringDecoder)
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const isWindowInSwimlaneResultDecoder: Decoder<IsWindowInSwimlaneResult> = object({
|
|
86
|
+
inWorkspace: boolean()
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export const allParentDecoder: Decoder<"workspace" | "row" | "column" | "group"> = oneOf<"workspace" | "row" | "column" | "group">(
|
|
90
|
+
constant("workspace"),
|
|
91
|
+
constant("row"),
|
|
92
|
+
constant("column"),
|
|
93
|
+
constant("group")
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
export const subParentDecoder: Decoder<"row" | "column" | "group"> = oneOf<"row" | "column" | "group">(
|
|
97
|
+
constant("row"),
|
|
98
|
+
constant("column"),
|
|
99
|
+
constant("group")
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
export const frameStateDecoder: Decoder<"maximized" | "minimized" | "normal"> = oneOf<"maximized" | "minimized" | "normal">(
|
|
103
|
+
constant("maximized"),
|
|
104
|
+
constant("minimized"),
|
|
105
|
+
constant("normal")
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
export const checkThrowCallback = (callback: unknown, allowUndefined?: boolean): void => {
|
|
109
|
+
const argumentType = typeof callback;
|
|
110
|
+
|
|
111
|
+
if (allowUndefined && argumentType !== "function" && argumentType !== "undefined") {
|
|
112
|
+
throw new Error(`Provided argument must be either undefined or of type function, provided: ${argumentType}`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (!allowUndefined && argumentType !== "function") {
|
|
116
|
+
throw new Error(`Provided argument must be of type function, provided: ${argumentType}`);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const workspaceBuilderCreateConfigDecoder: Decoder<IOConnectWorkspaces.WorkspaceCreateConfig> = object({
|
|
121
|
+
saveLayout: optional(boolean())
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export const deleteLayoutConfigDecoder: Decoder<DeleteLayoutConfig> = object({
|
|
125
|
+
name: nonEmptyStringDecoder
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
export const swimlaneWindowDefinitionDecoder: Decoder<IOConnectWorkspaces.WorkspaceWindowDefinition> = object({
|
|
130
|
+
type: optional(constant("window")),
|
|
131
|
+
appName: optional(nonEmptyStringDecoder),
|
|
132
|
+
windowId: optional(nonEmptyStringDecoder),
|
|
133
|
+
context: optional(anyJson())
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export const strictSwimlaneWindowDefinitionDecoder: Decoder<IOConnectWorkspaces.WorkspaceWindowDefinition> = object({
|
|
137
|
+
type: constant("window"),
|
|
138
|
+
appName: optional(nonEmptyStringDecoder),
|
|
139
|
+
windowId: optional(nonEmptyStringDecoder),
|
|
140
|
+
context: optional(anyJson())
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
export const parentDefinitionDecoder: Decoder<IOConnectWorkspaces.BoxDefinition> = object({
|
|
144
|
+
type: optional(subParentDecoder),
|
|
145
|
+
children: optional(
|
|
146
|
+
lazy(() => array(
|
|
147
|
+
oneOf<IOConnectWorkspaces.WorkspaceWindowDefinition | IOConnectWorkspaces.BoxDefinition>(
|
|
148
|
+
swimlaneWindowDefinitionDecoder,
|
|
149
|
+
parentDefinitionDecoder
|
|
150
|
+
)
|
|
151
|
+
))
|
|
152
|
+
),
|
|
153
|
+
config: optional(anyJson())
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
export const groupDefinitionConfigDecoder: Decoder<GroupDefinitionConfig> = object({
|
|
157
|
+
minWidth: optional(number()),
|
|
158
|
+
maxWidth: optional(number()),
|
|
159
|
+
minHeight: optional(number()),
|
|
160
|
+
maxHeight: optional(number()),
|
|
161
|
+
allowExtract: optional(boolean()),
|
|
162
|
+
allowReorder: optional(boolean()),
|
|
163
|
+
allowDrop: optional(boolean()),
|
|
164
|
+
allowDropHeader: optional(boolean()),
|
|
165
|
+
allowDropLeft: optional(boolean()),
|
|
166
|
+
allowDropTop: optional(boolean()),
|
|
167
|
+
allowDropRight: optional(boolean()),
|
|
168
|
+
allowDropBottom: optional(boolean()),
|
|
169
|
+
showMaximizeButton: optional(boolean()),
|
|
170
|
+
showEjectButton: optional(boolean()),
|
|
171
|
+
showAddWindowButton: optional(boolean())
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
export const rowDefinitionConfigDecoder: Decoder<RowDefinitionConfig> = object({
|
|
175
|
+
minHeight: optional(number()),
|
|
176
|
+
maxHeight: optional(number()),
|
|
177
|
+
allowDrop: optional(boolean()),
|
|
178
|
+
allowSplitters: optional(boolean()),
|
|
179
|
+
isPinned: optional(boolean()),
|
|
180
|
+
maximizationBoundary: optional(boolean())
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
export const columnDefinitionConfigDecoder: Decoder<ColumnDefinitionConfig> = object({
|
|
184
|
+
minWidth: optional(number()),
|
|
185
|
+
maxWidth: optional(number()),
|
|
186
|
+
allowDrop: optional(boolean()),
|
|
187
|
+
allowSplitters: optional(boolean()),
|
|
188
|
+
isPinned: optional(boolean()),
|
|
189
|
+
maximizationBoundary: optional(boolean())
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
export const strictColumnDefinitionDecoder: Decoder<IOConnectWorkspaces.BoxDefinition> = object({
|
|
193
|
+
type: constant("column"),
|
|
194
|
+
children: optional(
|
|
195
|
+
lazy(() => array(
|
|
196
|
+
oneOf<IOConnectWorkspaces.WorkspaceWindowDefinition | IOConnectWorkspaces.BoxDefinition>(
|
|
197
|
+
strictSwimlaneWindowDefinitionDecoder,
|
|
198
|
+
strictParentDefinitionDecoder
|
|
199
|
+
)
|
|
200
|
+
))
|
|
201
|
+
),
|
|
202
|
+
config: optional(columnDefinitionConfigDecoder)
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
export const strictRowDefinitionDecoder: Decoder<IOConnectWorkspaces.BoxDefinition> = object({
|
|
206
|
+
type: constant("row"),
|
|
207
|
+
children: optional(
|
|
208
|
+
lazy(() => array(
|
|
209
|
+
oneOf<IOConnectWorkspaces.WorkspaceWindowDefinition | IOConnectWorkspaces.BoxDefinition>(
|
|
210
|
+
strictSwimlaneWindowDefinitionDecoder,
|
|
211
|
+
strictParentDefinitionDecoder
|
|
212
|
+
)
|
|
213
|
+
))
|
|
214
|
+
),
|
|
215
|
+
config: optional(rowDefinitionConfigDecoder)
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
export const strictGroupDefinitionDecoder: Decoder<IOConnectWorkspaces.BoxDefinition> = object({
|
|
219
|
+
type: constant("group"),
|
|
220
|
+
children: optional(
|
|
221
|
+
lazy(() => array(
|
|
222
|
+
oneOf<IOConnectWorkspaces.WorkspaceWindowDefinition | IOConnectWorkspaces.BoxDefinition>(
|
|
223
|
+
strictSwimlaneWindowDefinitionDecoder,
|
|
224
|
+
strictParentDefinitionDecoder
|
|
225
|
+
)
|
|
226
|
+
))
|
|
227
|
+
),
|
|
228
|
+
config: optional(groupDefinitionConfigDecoder)
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
export const strictParentDefinitionDecoder: Decoder<IOConnectWorkspaces.BoxDefinition> = oneOf(strictGroupDefinitionDecoder, strictColumnDefinitionDecoder, strictRowDefinitionDecoder);
|
|
232
|
+
|
|
233
|
+
export const stateDecoder: Decoder<"maximized" | "normal"> = oneOf<"maximized" | "normal">(
|
|
234
|
+
(string().where((s) => s.toLowerCase() === "maximized", "Expected a case insensitive variation of 'maximized'") as Decoder<"maximized">),
|
|
235
|
+
(string().where((s) => s.toLowerCase() === "normal", "Expected a case insensitive variation of 'normal'") as Decoder<"normal">)
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
export const newFrameConfigDecoder: Decoder<IOConnectWorkspaces.NewFrameConfig> = object({
|
|
239
|
+
bounds: optional(object({
|
|
240
|
+
left: optional(number()),
|
|
241
|
+
top: optional(number()),
|
|
242
|
+
width: optional(nonNegativeNumberDecoder),
|
|
243
|
+
height: optional(nonNegativeNumberDecoder)
|
|
244
|
+
})),
|
|
245
|
+
frameId: optional(nonEmptyStringDecoder)
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
export const loadStrategyDecoder: Decoder<IOConnectWorkspaces.LoadingStrategy> = oneOf<"direct" | "delayed" | "lazy">(
|
|
249
|
+
constant("direct"),
|
|
250
|
+
constant("delayed"),
|
|
251
|
+
constant("lazy"),
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
export const restoreWorkspaceConfigDecoder: Decoder<IOConnectWorkspaces.RestoreWorkspaceConfig> = object({
|
|
255
|
+
app: optional(nonEmptyStringDecoder),
|
|
256
|
+
context: optional(anyJson()),
|
|
257
|
+
loadStrategy: optional(loadStrategyDecoder),
|
|
258
|
+
title: optional(nonEmptyStringDecoder),
|
|
259
|
+
reuseWorkspaceId: optional(nonEmptyStringDecoder),
|
|
260
|
+
frameId: optional(nonEmptyStringDecoder),
|
|
261
|
+
lockdown: optional(boolean()),
|
|
262
|
+
activateFrame: optional(boolean()),
|
|
263
|
+
newFrame: optional(oneOf<IOConnectWorkspaces.NewFrameConfig | boolean>(
|
|
264
|
+
newFrameConfigDecoder,
|
|
265
|
+
boolean()
|
|
266
|
+
)),
|
|
267
|
+
noTabHeader: optional(boolean()),
|
|
268
|
+
inMemoryLayout: optional(boolean()),
|
|
269
|
+
isPinned: optional(boolean()),
|
|
270
|
+
icon: optional(nonEmptyStringDecoder),
|
|
271
|
+
isSelected: optional(boolean()),
|
|
272
|
+
positionIndex: optional(nonNegativeNumberDecoder)
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
export const openWorkspaceConfigDecoder: Decoder<OpenWorkspaceConfig> = object({
|
|
276
|
+
name: nonEmptyStringDecoder,
|
|
277
|
+
restoreOptions: optional(restoreWorkspaceConfigDecoder)
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
export const workspaceDefinitionDecoder: Decoder<IOConnectWorkspaces.WorkspaceDefinition> = object({
|
|
281
|
+
children: optional(array(oneOf<IOConnectWorkspaces.WorkspaceWindowDefinition | IOConnectWorkspaces.BoxDefinition>(
|
|
282
|
+
swimlaneWindowDefinitionDecoder,
|
|
283
|
+
parentDefinitionDecoder
|
|
284
|
+
))),
|
|
285
|
+
context: optional(anyJson()),
|
|
286
|
+
config: optional(object({
|
|
287
|
+
title: optional(nonEmptyStringDecoder),
|
|
288
|
+
position: optional(nonNegativeNumberDecoder),
|
|
289
|
+
isFocused: optional(boolean()),
|
|
290
|
+
loadStrategy: optional(loadStrategyDecoder),
|
|
291
|
+
noTabHeader: optional(boolean()),
|
|
292
|
+
allowDrop: optional(boolean()),
|
|
293
|
+
allowDropLeft: optional(boolean()),
|
|
294
|
+
allowDropTop: optional(boolean()),
|
|
295
|
+
allowDropRight: optional(boolean()),
|
|
296
|
+
allowDropBottom: optional(boolean()),
|
|
297
|
+
allowExtract: optional(boolean()),
|
|
298
|
+
allowWindowReorder: optional(boolean()),
|
|
299
|
+
allowSystemHibernation: optional(boolean()),
|
|
300
|
+
showSaveButton: optional(boolean()),
|
|
301
|
+
allowWorkspaceTabReorder: optional(boolean()),
|
|
302
|
+
allowWorkspaceTabExtract: optional(boolean()),
|
|
303
|
+
showCloseButton: optional(boolean()),
|
|
304
|
+
allowSplitters: optional(boolean()),
|
|
305
|
+
positionIndex: optional(nonNegativeNumberDecoder)
|
|
306
|
+
})),
|
|
307
|
+
frame: optional(object({
|
|
308
|
+
reuseFrameId: optional(nonEmptyStringDecoder),
|
|
309
|
+
newFrame: optional(oneOf<boolean | IOConnectWorkspaces.NewFrameConfig>(
|
|
310
|
+
boolean(),
|
|
311
|
+
newFrameConfigDecoder
|
|
312
|
+
))
|
|
313
|
+
}))
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
export const builderConfigDecoder: Decoder<IOConnectWorkspaces.BuilderConfig> = object({
|
|
317
|
+
type: allParentDecoder,
|
|
318
|
+
definition: optional(oneOf<IOConnectWorkspaces.WorkspaceDefinition | IOConnectWorkspaces.BoxDefinition>(
|
|
319
|
+
workspaceDefinitionDecoder,
|
|
320
|
+
parentDefinitionDecoder
|
|
321
|
+
))
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
export const workspaceCreateConfigDecoder: Decoder<WorkspaceCreateConfigProtocol> = intersection(
|
|
325
|
+
workspaceDefinitionDecoder,
|
|
326
|
+
object({
|
|
327
|
+
saveConfig: optional(object({
|
|
328
|
+
saveLayout: optional(boolean())
|
|
329
|
+
}))
|
|
330
|
+
})
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
export const getFrameSummaryConfigDecoder: Decoder<GetFrameSummaryConfig> = object({
|
|
334
|
+
itemId: nonEmptyStringDecoder
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
export const frameSummaryDecoder: Decoder<FrameSummaryResult> = object({
|
|
338
|
+
id: nonEmptyStringDecoder,
|
|
339
|
+
isFocused: optional(boolean()),
|
|
340
|
+
isInitialized: optional(boolean()),
|
|
341
|
+
initializationContext: optional(object({
|
|
342
|
+
context: optional(anyJson())
|
|
343
|
+
}))
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
export const workspaceSummaryDecoder: Decoder<IOConnectWorkspaces.WorkspaceSummary> = object({
|
|
347
|
+
id: nonEmptyStringDecoder,
|
|
348
|
+
frameId: nonEmptyStringDecoder,
|
|
349
|
+
positionIndex: number(),
|
|
350
|
+
title: nonEmptyStringDecoder,
|
|
351
|
+
focused: boolean(),
|
|
352
|
+
layoutName: optional(nonEmptyStringDecoder),
|
|
353
|
+
isSelected: optional(boolean())
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
export const containerSummaryDecoder: Decoder<IOConnectWorkspaces.BoxSummary> = object({
|
|
357
|
+
type: subParentDecoder,
|
|
358
|
+
id: nonEmptyStringDecoder,
|
|
359
|
+
frameId: nonEmptyStringDecoder,
|
|
360
|
+
workspaceId: nonEmptyStringDecoder,
|
|
361
|
+
positionIndex: number()
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
export const eventTypeDecoder: Decoder<WorkspaceEventType> = oneOf<"frame" | "workspace" | "container" | "window">(
|
|
365
|
+
constant("frame"),
|
|
366
|
+
constant("workspace"),
|
|
367
|
+
constant("container"),
|
|
368
|
+
constant("window")
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
export const streamRequestArgumentsDecoder: Decoder<{ type: WorkspaceEventType; branch: string }> = object({
|
|
372
|
+
type: eventTypeDecoder,
|
|
373
|
+
branch: nonEmptyStringDecoder
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
export const workspaceEventActionDecoder: Decoder<WorkspaceEventAction> = oneOf<"opened" | "closing" | "closed" | "focus" | "added" | "loaded" | "removed" | "childrenUpdate" | "containerChange" | "maximized" | "restored" | "minimized" | "normal" | "selected" | "lock-configuration-changed" | "hibernated" | "resumed">(
|
|
377
|
+
constant("opened"),
|
|
378
|
+
constant("closing"),
|
|
379
|
+
constant("closed"),
|
|
380
|
+
constant("focus"),
|
|
381
|
+
constant("added"),
|
|
382
|
+
constant("loaded"),
|
|
383
|
+
constant("removed"),
|
|
384
|
+
constant("childrenUpdate"),
|
|
385
|
+
constant("containerChange"),
|
|
386
|
+
constant("maximized"),
|
|
387
|
+
constant("restored"),
|
|
388
|
+
constant("minimized"),
|
|
389
|
+
constant("normal"),
|
|
390
|
+
constant("selected"),
|
|
391
|
+
constant("lock-configuration-changed"),
|
|
392
|
+
constant("hibernated"),
|
|
393
|
+
constant("resumed")
|
|
394
|
+
);
|
|
395
|
+
|
|
396
|
+
export const workspaceConfigResultDecoder: Decoder<WorkspaceConfigResult> = object({
|
|
397
|
+
frameId: nonEmptyStringDecoder,
|
|
398
|
+
title: nonEmptyStringDecoder,
|
|
399
|
+
positionIndex: nonNegativeNumberDecoder,
|
|
400
|
+
name: nonEmptyStringDecoder,
|
|
401
|
+
layoutName: optional(nonEmptyStringDecoder),
|
|
402
|
+
isHibernated: boolean(),
|
|
403
|
+
isSelected: boolean(),
|
|
404
|
+
lastActive: number(),
|
|
405
|
+
allowDrop: optional(boolean()),
|
|
406
|
+
allowExtract: optional(boolean()),
|
|
407
|
+
allowWindowReorder: optional(boolean()),
|
|
408
|
+
allowSystemHibernation: optional(boolean()),
|
|
409
|
+
allowSplitters: optional(boolean()),
|
|
410
|
+
showCloseButton: optional(boolean()),
|
|
411
|
+
showSaveButton: optional(boolean()),
|
|
412
|
+
allowWorkspaceTabReorder: optional(boolean()),
|
|
413
|
+
allowDropLeft: optional(boolean()),
|
|
414
|
+
allowDropTop: optional(boolean()),
|
|
415
|
+
allowDropRight: optional(boolean()),
|
|
416
|
+
allowDropBottom: optional(boolean()),
|
|
417
|
+
showAddWindowButtons: optional(boolean()),
|
|
418
|
+
showEjectButtons: optional(boolean()),
|
|
419
|
+
showWindowCloseButtons: optional(boolean()),
|
|
420
|
+
minWidth: optional(number()),
|
|
421
|
+
maxWidth: optional(number()),
|
|
422
|
+
minHeight: optional(number()),
|
|
423
|
+
maxHeight: optional(number()),
|
|
424
|
+
widthInPx: optional(number()),
|
|
425
|
+
heightInPx: optional(number())
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
// todo: remove number positionIndex when fixed
|
|
429
|
+
export const baseChildSnapshotConfigDecoder: Decoder<BaseChildSnapshotConfig> = object({
|
|
430
|
+
frameId: nonEmptyStringDecoder,
|
|
431
|
+
workspaceId: nonEmptyStringDecoder,
|
|
432
|
+
positionIndex: number()
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
export const parentSnapshotConfigDecoder: Decoder<ParentSnapshotConfig> = anyJson();
|
|
436
|
+
|
|
437
|
+
// todo: remove this after isMaximized is fixed
|
|
438
|
+
export const swimlaneWindowSnapshotConfigDecoder: Decoder<SwimlaneWindowSnapshotConfig> = intersection(
|
|
439
|
+
baseChildSnapshotConfigDecoder,
|
|
440
|
+
object({
|
|
441
|
+
windowId: optional(nonEmptyStringDecoder),
|
|
442
|
+
isMaximized: optional(boolean()),
|
|
443
|
+
isFocused: boolean(),
|
|
444
|
+
isSelected: optional(boolean()),
|
|
445
|
+
title: optional(string()),
|
|
446
|
+
appName: optional(nonEmptyStringDecoder),
|
|
447
|
+
context: optional(anyJson())
|
|
448
|
+
})
|
|
449
|
+
) as any;
|
|
450
|
+
|
|
451
|
+
export const childSnapshotResultDecoder: Decoder<ChildSnapshotResult> = object({
|
|
452
|
+
id: optional(nonEmptyStringDecoder),
|
|
453
|
+
config: oneOf<ParentSnapshotConfig | SwimlaneWindowSnapshotConfig>(
|
|
454
|
+
parentSnapshotConfigDecoder,
|
|
455
|
+
swimlaneWindowSnapshotConfigDecoder
|
|
456
|
+
),
|
|
457
|
+
children: optional(lazy(() => array(childSnapshotResultDecoder))),
|
|
458
|
+
type: oneOf<"window" | "row" | "column" | "group">(
|
|
459
|
+
constant("window"),
|
|
460
|
+
constant("row"),
|
|
461
|
+
constant("column"),
|
|
462
|
+
constant("group")
|
|
463
|
+
)
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
export const workspaceSnapshotResultDecoder: Decoder<WorkspaceSnapshotResult> = object({
|
|
467
|
+
id: nonEmptyStringDecoder,
|
|
468
|
+
config: workspaceConfigResultDecoder,
|
|
469
|
+
children: array(childSnapshotResultDecoder),
|
|
470
|
+
frameSummary: frameSummaryDecoder,
|
|
471
|
+
context: optional(anyJson())
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
export const customWorkspaceChildSnapshotDecoder: Decoder<ChildSnapshotResult> = object({
|
|
475
|
+
id: nonEmptyStringDecoder,
|
|
476
|
+
config: oneOf<ParentSnapshotConfig | SwimlaneWindowSnapshotConfig>(
|
|
477
|
+
parentSnapshotConfigDecoder,
|
|
478
|
+
swimlaneWindowSnapshotConfigDecoder
|
|
479
|
+
),
|
|
480
|
+
children: optional(lazy(() => array(customWorkspaceChildSnapshotDecoder))),
|
|
481
|
+
type: oneOf<"window" | "row" | "column" | "group">(
|
|
482
|
+
constant("window"),
|
|
483
|
+
constant("row"),
|
|
484
|
+
constant("column"),
|
|
485
|
+
constant("group")
|
|
486
|
+
)
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
export const groupLayoutItemDecoder: Decoder<IOConnectWorkspaces.GroupLayoutItem> = object({
|
|
490
|
+
type: constant("group"),
|
|
491
|
+
config: anyJson(),
|
|
492
|
+
children: array(oneOf<IOConnectWorkspaces.WindowLayoutItem>(
|
|
493
|
+
windowLayoutItemDecoder
|
|
494
|
+
))
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
export const columnLayoutItemDecoder: Decoder<IOConnectWorkspaces.ColumnLayoutItem> = object({
|
|
498
|
+
type: constant("column"),
|
|
499
|
+
config: anyJson(),
|
|
500
|
+
children: array(oneOf<IOConnectWorkspaces.RowLayoutItem | IOConnectWorkspaces.ColumnLayoutItem | IOConnectWorkspaces.GroupLayoutItem | IOConnectWorkspaces.WindowLayoutItem>(
|
|
501
|
+
groupLayoutItemDecoder,
|
|
502
|
+
windowLayoutItemDecoder,
|
|
503
|
+
lazy(() => columnLayoutItemDecoder),
|
|
504
|
+
lazy(() => rowLayoutItemDecoder)
|
|
505
|
+
))
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
export const rowLayoutItemDecoder: Decoder<IOConnectWorkspaces.RowLayoutItem> = object({
|
|
509
|
+
type: constant("row"),
|
|
510
|
+
config: anyJson(),
|
|
511
|
+
children: array(oneOf<IOConnectWorkspaces.RowLayoutItem | IOConnectWorkspaces.ColumnLayoutItem | IOConnectWorkspaces.GroupLayoutItem | IOConnectWorkspaces.WindowLayoutItem>(
|
|
512
|
+
columnLayoutItemDecoder,
|
|
513
|
+
groupLayoutItemDecoder,
|
|
514
|
+
windowLayoutItemDecoder,
|
|
515
|
+
lazy(() => rowLayoutItemDecoder)
|
|
516
|
+
))
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
export const workspaceLayoutDecoder: Decoder<IOConnectWorkspaces.WorkspaceLayout> = object({
|
|
520
|
+
name: nonEmptyStringDecoder,
|
|
521
|
+
type: constant("Workspace"),
|
|
522
|
+
metadata: optional(anyJson()),
|
|
523
|
+
components: array(object({
|
|
524
|
+
type: constant("Workspace"),
|
|
525
|
+
application: optional(nonEmptyStringDecoder),
|
|
526
|
+
state: object({
|
|
527
|
+
config: anyJson(),
|
|
528
|
+
context: anyJson(),
|
|
529
|
+
children: array(oneOf<IOConnectWorkspaces.RowLayoutItem | IOConnectWorkspaces.ColumnLayoutItem | IOConnectWorkspaces.GroupLayoutItem | IOConnectWorkspaces.WindowLayoutItem>(
|
|
530
|
+
rowLayoutItemDecoder,
|
|
531
|
+
columnLayoutItemDecoder,
|
|
532
|
+
groupLayoutItemDecoder,
|
|
533
|
+
windowLayoutItemDecoder
|
|
534
|
+
))
|
|
535
|
+
})
|
|
536
|
+
}))
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
export const workspacesLayoutImportConfigDecoder: Decoder<WorkspacesLayoutImportConfig> = object({
|
|
540
|
+
layout: workspaceLayoutDecoder,
|
|
541
|
+
mode: oneOf<"replace" | "merge">(
|
|
542
|
+
constant("replace"),
|
|
543
|
+
constant("merge")
|
|
544
|
+
)
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
export const exportedLayoutsResultDecoder: Decoder<ExportedLayoutsResult> = object({
|
|
548
|
+
layouts: array(workspaceLayoutDecoder)
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
export const frameSummaryResultDecoder: Decoder<FrameSummaryResult> = frameSummaryDecoder;
|
|
552
|
+
|
|
553
|
+
export const frameSummariesResultDecoder: Decoder<FrameSummariesResult> = object({
|
|
554
|
+
summaries: array(frameSummaryResultDecoder)
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
export const workspaceSummaryResultDecoder: Decoder<WorkspaceSummaryResult> = object({
|
|
558
|
+
id: nonEmptyStringDecoder,
|
|
559
|
+
config: workspaceConfigResultDecoder
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
export const workspaceSummariesResultDecoder: Decoder<WorkspaceSummariesResult> = object({
|
|
563
|
+
summaries: array(workspaceSummaryResultDecoder)
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
export const frameSnapshotResultDecoder: Decoder<FrameSnapshotResult> = object({
|
|
567
|
+
id: nonEmptyStringDecoder,
|
|
568
|
+
config: anyJson(),
|
|
569
|
+
workspaces: array(workspaceSnapshotResultDecoder)
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
export const layoutSummaryDecoder: Decoder<LayoutSummary> = object({
|
|
573
|
+
name: nonEmptyStringDecoder
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
export const layoutSummariesDecoder: Decoder<LayoutSummariesResult> = object({
|
|
577
|
+
summaries: array(layoutSummaryDecoder)
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
export const simpleWindowOperationSuccessResultDecoder: Decoder<SimpleWindowOperationSuccessResult> = object({
|
|
581
|
+
windowId: nonEmptyStringDecoder
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
export const voidResultDecoder: Decoder<any> = anyJson();
|
|
585
|
+
|
|
586
|
+
export const frameStateResultDecoder: Decoder<FrameStateResult> = object({
|
|
587
|
+
state: frameStateDecoder
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
export const frameBoundsDecoder: Decoder<FrameBounds> = object({
|
|
591
|
+
top: number(),
|
|
592
|
+
left: number(),
|
|
593
|
+
width: nonNegativeNumberDecoder,
|
|
594
|
+
height: nonNegativeNumberDecoder
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
export const frameBoundsResultDecoder: Decoder<FrameBoundsResult> = object({
|
|
598
|
+
bounds: frameBoundsDecoder
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
export const resizeConfigDecoder: Decoder<IOConnectWorkspaces.ResizeConfig> = object({
|
|
602
|
+
width: optional(nonNegativeNumberDecoder),
|
|
603
|
+
height: optional(nonNegativeNumberDecoder),
|
|
604
|
+
relative: optional(boolean())
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
export const moveConfigDecoder: Decoder<IOConnectWorkspaces.MoveConfig> = object({
|
|
608
|
+
top: optional(number()),
|
|
609
|
+
left: optional(number()),
|
|
610
|
+
relative: optional(boolean())
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
export const simpleItemConfigDecoder: Decoder<SimpleItemConfig> = object({
|
|
614
|
+
itemId: nonEmptyStringDecoder
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
export const frameSnapshotConfigDecoder: Decoder<FrameSnapshotConfig> = object({
|
|
618
|
+
itemId: nonEmptyStringDecoder,
|
|
619
|
+
excludeIds: optional(boolean())
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
export const frameStateConfigDecoder: Decoder<FrameStateConfig> = object({
|
|
623
|
+
frameId: nonEmptyStringDecoder,
|
|
624
|
+
requestedState: frameStateDecoder
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
export const setItemTitleConfigDecoder: Decoder<SetItemTitleConfig> = object({
|
|
628
|
+
itemId: nonEmptyStringDecoder,
|
|
629
|
+
title: nonEmptyStringDecoder
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
export const moveWindowConfigDecoder: Decoder<MoveWindowConfig> = object({
|
|
633
|
+
itemId: nonEmptyStringDecoder,
|
|
634
|
+
containerId: nonEmptyStringDecoder
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
export const resizeItemConfigDecoder: Decoder<ResizeItemConfig> = intersection(
|
|
638
|
+
simpleItemConfigDecoder,
|
|
639
|
+
resizeConfigDecoder
|
|
640
|
+
);
|
|
641
|
+
|
|
642
|
+
export const moveFrameConfigDecoder: Decoder<MoveFrameConfig> = intersection(
|
|
643
|
+
simpleItemConfigDecoder,
|
|
644
|
+
moveConfigDecoder
|
|
645
|
+
);
|
|
646
|
+
|
|
647
|
+
export const simpleParentDecoder: Decoder<{ id: string; type: "row" | "column" | "group" }> = object({
|
|
648
|
+
id: nonEmptyStringDecoder,
|
|
649
|
+
type: subParentDecoder
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
export const addWindowConfigDecoder: Decoder<AddWindowConfig> = object({
|
|
653
|
+
definition: swimlaneWindowDefinitionDecoder,
|
|
654
|
+
parentId: nonEmptyStringDecoder,
|
|
655
|
+
parentType: allParentDecoder
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
export const addContainerConfigDecoder: Decoder<AddContainerConfig> = object({
|
|
659
|
+
definition: strictParentDefinitionDecoder,
|
|
660
|
+
parentId: nonEmptyStringDecoder,
|
|
661
|
+
parentType: allParentDecoder
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
export const addItemResultDecoder: Decoder<AddItemResult> = object({
|
|
665
|
+
itemId: nonEmptyStringDecoder,
|
|
666
|
+
windowId: optional(nonEmptyStringDecoder)
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
export const pingResultDecoder: Decoder<PingResult> = object({
|
|
670
|
+
live: boolean()
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
export const bundleWorkspaceConfigDecoder: Decoder<BundleWorkspaceConfig> = object({
|
|
674
|
+
type: oneOf<"row" | "column">(
|
|
675
|
+
constant("row"),
|
|
676
|
+
constant("column")
|
|
677
|
+
),
|
|
678
|
+
workspaceId: nonEmptyStringDecoder
|
|
679
|
+
});
|
|
680
|
+
|
|
681
|
+
export const bundleItemConfigDecoder: Decoder<BundleItemConfig> = object({
|
|
682
|
+
type: oneOf<"row" | "column">(
|
|
683
|
+
constant("row"),
|
|
684
|
+
constant("column")
|
|
685
|
+
),
|
|
686
|
+
itemId: nonEmptyStringDecoder
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
export const workspaceSelectorDecoder: Decoder<WorkspaceSelector> = object({
|
|
690
|
+
workspaceId: nonEmptyStringDecoder
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
export const containerSummaryResultDecoder: Decoder<ContainerSummaryResult> = object({
|
|
694
|
+
itemId: nonEmptyStringDecoder,
|
|
695
|
+
config: parentSnapshotConfigDecoder
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
export const frameStreamDataDecoder: Decoder<FrameStreamData> = object({
|
|
699
|
+
frameSummary: frameSummaryDecoder,
|
|
700
|
+
frameBounds: optional(frameBoundsDecoder)
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
export const workspaceStreamDataDecoder: Decoder<WorkspaceStreamData> = object({
|
|
704
|
+
workspaceSummary: workspaceSummaryResultDecoder,
|
|
705
|
+
frameSummary: frameSummaryDecoder,
|
|
706
|
+
frameBounds: optional(frameBoundsDecoder)
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
export const containerStreamDataDecoder: Decoder<ContainerStreamData> = object({
|
|
710
|
+
containerSummary: containerSummaryResultDecoder
|
|
711
|
+
});
|
|
712
|
+
|
|
713
|
+
export const windowStreamDataDecoder: Decoder<WindowStreamData> = object({
|
|
714
|
+
windowSummary: object({
|
|
715
|
+
itemId: nonEmptyStringDecoder,
|
|
716
|
+
parentId: nonEmptyStringDecoder,
|
|
717
|
+
config: swimlaneWindowSnapshotConfigDecoder
|
|
718
|
+
})
|
|
719
|
+
});
|
|
720
|
+
|
|
721
|
+
export const workspaceLayoutSaveConfigDecoder: Decoder<IOConnectWorkspaces.WorkspaceLayoutSaveConfig> = object({
|
|
722
|
+
name: nonEmptyStringDecoder,
|
|
723
|
+
workspaceId: nonEmptyStringDecoder,
|
|
724
|
+
saveContext: optional(boolean())
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
export const lockWorkspaceDecoder: Decoder<LockWorkspaceConfig> = object({
|
|
728
|
+
workspaceId: nonEmptyStringDecoder,
|
|
729
|
+
config: optional(object({
|
|
730
|
+
allowDrop: optional(boolean()),
|
|
731
|
+
allowDropLeft: optional(boolean()),
|
|
732
|
+
allowDropTop: optional(boolean()),
|
|
733
|
+
allowDropRight: optional(boolean()),
|
|
734
|
+
allowDropBottom: optional(boolean()),
|
|
735
|
+
allowExtract: optional(boolean()),
|
|
736
|
+
allowWindowReorder: optional(boolean()),
|
|
737
|
+
allowSystemHibernation: optional(boolean()),
|
|
738
|
+
allowSplitters: optional(boolean()),
|
|
739
|
+
showCloseButton: optional(boolean()),
|
|
740
|
+
showSaveButton: optional(boolean()),
|
|
741
|
+
allowWorkspaceTabReorder: optional(boolean()),
|
|
742
|
+
showWindowCloseButtons: optional(boolean()),
|
|
743
|
+
showEjectButtons: optional(boolean()),
|
|
744
|
+
showAddWindowButtons: optional(boolean())
|
|
745
|
+
}))
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
export const lockWindowDecoder: Decoder<LockWindowConfig> = object({
|
|
749
|
+
windowPlacementId: nonEmptyStringDecoder,
|
|
750
|
+
config: optional(object({
|
|
751
|
+
allowExtract: optional(boolean()),
|
|
752
|
+
allowReorder: optional(boolean()),
|
|
753
|
+
showCloseButton: optional(boolean())
|
|
754
|
+
}))
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
export const lockRowDecoder: Decoder<LockRowConfig> = object({
|
|
758
|
+
itemId: nonEmptyStringDecoder,
|
|
759
|
+
type: constant("row"),
|
|
760
|
+
config: optional(object({
|
|
761
|
+
allowDrop: optional(boolean()),
|
|
762
|
+
allowSplitters: optional(boolean()),
|
|
763
|
+
}))
|
|
764
|
+
});
|
|
765
|
+
|
|
766
|
+
export const lockColumnDecoder: Decoder<LockColumnConfig> = object({
|
|
767
|
+
itemId: nonEmptyStringDecoder,
|
|
768
|
+
type: constant("column"),
|
|
769
|
+
config: optional(object({
|
|
770
|
+
allowDrop: optional(boolean()),
|
|
771
|
+
allowSplitters: optional(boolean()),
|
|
772
|
+
|
|
773
|
+
}))
|
|
774
|
+
});
|
|
775
|
+
|
|
776
|
+
export const lockGroupDecoder: Decoder<LockGroupConfig> = object({
|
|
777
|
+
itemId: nonEmptyStringDecoder,
|
|
778
|
+
type: constant("group"),
|
|
779
|
+
config: optional(object({
|
|
780
|
+
allowExtract: optional(boolean()),
|
|
781
|
+
allowReorder: optional(boolean()),
|
|
782
|
+
allowDrop: optional(boolean()),
|
|
783
|
+
allowDropHeader: optional(boolean()),
|
|
784
|
+
allowDropLeft: optional(boolean()),
|
|
785
|
+
allowDropTop: optional(boolean()),
|
|
786
|
+
allowDropRight: optional(boolean()),
|
|
787
|
+
allowDropBottom: optional(boolean()),
|
|
788
|
+
showMaximizeButton: optional(boolean()),
|
|
789
|
+
showEjectButton: optional(boolean()),
|
|
790
|
+
showAddWindowButton: optional(boolean()),
|
|
791
|
+
}))
|
|
792
|
+
});
|
|
793
|
+
|
|
794
|
+
export const lockContainerDecoder: Decoder<LockContainerConfig> = oneOf<LockColumnConfig | LockGroupConfig | LockRowConfig>(lockColumnDecoder, lockGroupDecoder, lockRowDecoder);
|
|
795
|
+
|
|
796
|
+
export const pinWorkspaceDecoder: Decoder<PinWorkspaceConfig> = object({
|
|
797
|
+
workspaceId: nonEmptyStringDecoder,
|
|
798
|
+
icon: optional(nonEmptyStringDecoder)
|
|
799
|
+
});
|
|
800
|
+
|
|
801
|
+
export const setWorkspaceIconDecoder: Decoder<SetWorkspaceIconConfig> = object({
|
|
802
|
+
workspaceId: nonEmptyStringDecoder,
|
|
803
|
+
icon: optional(nonEmptyStringDecoder)
|
|
804
|
+
});
|
|
805
|
+
|
|
806
|
+
export const workspaceIconDecoder: Decoder<WorkspaceIconResult> = object({
|
|
807
|
+
icon: optional(nonEmptyStringDecoder)
|
|
808
|
+
});
|
|
809
|
+
|
|
810
|
+
export const emptyFrameDefinitionDecoder: Decoder<IOConnectWorkspaces.EmptyFrameDefinition> = object({
|
|
811
|
+
applicationName: optional(string()),
|
|
812
|
+
frameConfig: optional(newFrameConfigDecoder),
|
|
813
|
+
context: optional(object()),
|
|
814
|
+
layoutComponentId: optional(nonEmptyStringDecoder)
|
|
815
|
+
});
|
|
816
|
+
|
|
817
|
+
export const restoreWorkspaceDefinitionDecoder: Decoder<IOConnectWorkspaces.RestoreWorkspaceDefinition> = object({
|
|
818
|
+
name: nonEmptyStringDecoder,
|
|
819
|
+
restoreOptions: optional(restoreWorkspaceConfigDecoder)
|
|
820
|
+
});
|
|
821
|
+
|
|
822
|
+
export const frameInitProtocolConfigDecoder: Decoder<FrameInitializationConfigProtocol> = object({
|
|
823
|
+
frameId: nonEmptyStringDecoder,
|
|
824
|
+
workspaces: array(oneOf<IOConnectWorkspaces.WorkspaceDefinition | IOConnectWorkspaces.RestoreWorkspaceDefinition>(
|
|
825
|
+
workspaceDefinitionDecoder,
|
|
826
|
+
restoreWorkspaceDefinitionDecoder
|
|
827
|
+
))
|
|
828
|
+
});
|
|
829
|
+
|
|
830
|
+
export const getWorkspaceWindowsOnLayoutSaveContextConfigDecoder: Decoder<GetWorkspaceWindowsOnLayoutSaveContextConfig> = object({
|
|
831
|
+
layoutType: oneOf<"Global" | "Workspace">(
|
|
832
|
+
constant("Global"),
|
|
833
|
+
constant("Workspace")
|
|
834
|
+
),
|
|
835
|
+
layoutName: nonEmptyStringDecoder,
|
|
836
|
+
windowIds: array(nonEmptyStringDecoder),
|
|
837
|
+
context: optional(anyJson()),
|
|
838
|
+
instances: optional(array(nonEmptyStringDecoder)),
|
|
839
|
+
ignoreInstances: optional(array(nonEmptyStringDecoder))
|
|
840
|
+
});
|
|
841
|
+
|
|
842
|
+
export const setMaximizationBoundaryConfigDecoder: Decoder<SetMaximizationBoundaryConfig> = object({
|
|
843
|
+
itemId: nonEmptyStringDecoder,
|
|
844
|
+
enabled: boolean()
|
|
845
|
+
});
|
|
846
|
+
|
|
847
|
+
export const workspaceWindowOnSaveDataDecoder: Decoder<WorkspaceWindowOnSaveData> = object({
|
|
848
|
+
windowId: nonEmptyStringDecoder,
|
|
849
|
+
windowContext: optional(anyJson())
|
|
850
|
+
});
|
|
851
|
+
|
|
852
|
+
export const getWorkspaceWindowsOnLayoutSaveContextResult: Decoder<GetWorkspaceWindowsOnLayoutSaveContextResult> = object({
|
|
853
|
+
windowsOnSaveData: array(workspaceWindowOnSaveDataDecoder)
|
|
854
|
+
});
|
|
855
|
+
|
|
856
|
+
export const getWorkspacesLayoutsConfigDecoder: Decoder<GetWorkspacesLayoutsConfig> = object({
|
|
857
|
+
frameId: nonEmptyStringDecoder,
|
|
858
|
+
layoutName: nonEmptyStringDecoder,
|
|
859
|
+
layoutType: oneOf<"Global" | "Workspace">(
|
|
860
|
+
constant("Global"),
|
|
861
|
+
constant("Workspace")
|
|
862
|
+
),
|
|
863
|
+
context: optional(anyJson())
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
export const getWorkspacesLayoutsResponseDecoder: Decoder<GetWorkspacesLayoutsResponse> = object({
|
|
867
|
+
workspaces: array(workspaceSnapshotResultDecoder)
|
|
868
|
+
});
|