@jbrowse/core 2.0.1 → 2.1.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.
- package/BaseFeatureWidget/BaseFeatureDetail.d.ts +6 -0
- package/BaseFeatureWidget/BaseFeatureDetail.js +313 -592
- package/BaseFeatureWidget/SequenceFeatureDetails.js +213 -479
- package/BaseFeatureWidget/index.js +88 -126
- package/BaseFeatureWidget/types.js +1 -4
- package/BaseFeatureWidget/util.js +40 -75
- package/CorePlugin.js +55 -94
- package/Plugin.js +9 -34
- package/PluginLoader.js +153 -422
- package/PluginManager.d.ts +17 -14
- package/PluginManager.js +377 -666
- package/ReExports/Attributes.js +3 -10
- package/ReExports/BaseCard.js +3 -10
- package/ReExports/DataGrid.js +5 -12
- package/ReExports/FeatureDetails.js +3 -10
- package/ReExports/index.js +6 -12
- package/ReExports/list.d.ts +5 -0
- package/ReExports/list.js +271 -7
- package/ReExports/material-ui-colors.js +15 -16
- package/ReExports/modules.d.ts +0 -1
- package/ReExports/modules.js +453 -798
- package/TextSearch/BaseResults.js +51 -123
- package/TextSearch/TextSearchManager.js +66 -144
- package/assemblyManager/assembly.js +280 -555
- package/assemblyManager/assemblyConfigSchema.js +47 -64
- package/assemblyManager/assemblyManager.js +126 -272
- package/assemblyManager/index.js +9 -22
- package/configuration/configurationSchema.js +167 -203
- package/configuration/configurationSlot.js +248 -326
- package/configuration/index.js +19 -35
- package/configuration/util.js +131 -173
- package/data_adapters/BaseAdapter.d.ts +2 -2
- package/data_adapters/BaseAdapter.js +132 -521
- package/data_adapters/CytobandAdapter.js +40 -126
- package/data_adapters/dataAdapterCache.js +77 -158
- package/package.json +4 -5
- package/pluggableElementTypes/AdapterType.js +24 -79
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +17 -0
- package/pluggableElementTypes/AddTrackWorkflowType.js +20 -0
- package/pluggableElementTypes/ConnectionType.js +22 -65
- package/pluggableElementTypes/DisplayType.js +35 -82
- package/pluggableElementTypes/InternetAccountType.js +23 -64
- package/pluggableElementTypes/PluggableElementBase.js +8 -20
- package/pluggableElementTypes/RpcMethodType.js +85 -427
- package/pluggableElementTypes/TextSearchAdapterType.js +16 -55
- package/pluggableElementTypes/TrackType.js +26 -70
- package/pluggableElementTypes/ViewType.js +21 -63
- package/pluggableElementTypes/WidgetType.js +21 -64
- package/pluggableElementTypes/index.d.ts +4 -3
- package/pluggableElementTypes/index.js +42 -125
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +28 -43
- package/pluggableElementTypes/models/BaseDisplayModel.js +58 -95
- package/pluggableElementTypes/models/BaseTrackModel.js +139 -199
- package/pluggableElementTypes/models/BaseViewModel.js +24 -40
- package/pluggableElementTypes/models/InternetAccountModel.js +116 -263
- package/pluggableElementTypes/models/baseConnectionConfig.js +14 -25
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +29 -38
- package/pluggableElementTypes/models/baseTrackConfig.js +106 -133
- package/pluggableElementTypes/models/index.js +21 -70
- package/pluggableElementTypes/renderers/BoxRendererType.js +132 -291
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +8 -38
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +60 -192
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +0 -2
- package/pluggableElementTypes/renderers/FeatureRendererType.js +89 -264
- package/pluggableElementTypes/renderers/RendererType.js +31 -105
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +61 -72
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +112 -265
- package/pluggableElementTypes/renderers/index.js +19 -62
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +27 -65
- package/rpc/BaseRpcDriver.js +169 -405
- package/rpc/MainThreadRpcDriver.js +27 -150
- package/rpc/RpcManager.js +58 -159
- package/rpc/WebWorkerRpcDriver.js +54 -171
- package/rpc/configSchema.js +25 -49
- package/rpc/coreRpcMethods.js +221 -959
- package/rpc/remoteAbortSignals.js +46 -70
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AboutDialog.js +106 -162
- package/ui/App.js +157 -242
- package/ui/AssemblySelector.js +59 -120
- package/ui/CascadingMenu.js +101 -196
- package/ui/ColorPicker.d.ts +16 -0
- package/ui/ColorPicker.js +97 -0
- package/ui/Drawer.js +28 -61
- package/ui/DrawerWidget.js +108 -202
- package/ui/DropDownMenu.js +60 -91
- package/ui/EditableTypography.js +87 -149
- package/ui/ErrorMessage.js +41 -56
- package/ui/FactoryResetDialog.js +24 -57
- package/ui/FatalErrorDialog.js +59 -91
- package/ui/FileSelector/FileSelector.js +123 -189
- package/ui/FileSelector/LocalFileChooser.js +44 -75
- package/ui/FileSelector/UrlChooser.js +17 -38
- package/ui/FileSelector/index.js +6 -12
- package/ui/Icons.js +45 -69
- package/ui/Logo.js +57 -110
- package/ui/Menu.js +232 -354
- package/ui/PrerenderedCanvas.js +63 -87
- package/ui/ResizeHandle.js +87 -116
- package/ui/ReturnToImportFormDialog.js +32 -63
- package/ui/SanitizedHTML.js +64 -47
- package/ui/Snackbar.js +74 -101
- package/ui/SnackbarModel.js +37 -51
- package/ui/Tooltip.js +49 -76
- package/ui/ViewContainer.js +113 -196
- package/ui/colors.d.ts +10 -0
- package/ui/colors.js +78 -0
- package/ui/index.js +51 -181
- package/ui/react-colorful.d.ts +17 -0
- package/ui/react-colorful.js +455 -0
- package/ui/theme.js +199 -247
- package/util/Base1DUtils.js +163 -202
- package/util/Base1DViewModel.js +121 -168
- package/util/QuickLRU.js +84 -332
- package/util/TimeTraveller.d.ts +19 -0
- package/util/TimeTraveller.js +86 -0
- package/util/aborting.js +49 -127
- package/util/analytics.js +91 -154
- package/util/blockTypes.js +106 -240
- package/util/calculateDynamicBlocks.js +98 -128
- package/util/calculateStaticBlocks.js +105 -125
- package/util/color/cssColorsLevel4.js +156 -160
- package/util/color/index.js +33 -55
- package/util/compositeMap.js +49 -333
- package/util/formatFastaStrings.js +9 -14
- package/util/idMaker.js +18 -31
- package/util/index.d.ts +7 -20
- package/util/index.js +742 -1188
- package/util/io/RemoteFileWithRangeCache.js +88 -257
- package/util/io/index.js +95 -169
- package/util/jexl.js +60 -115
- package/util/jexlStrings.js +24 -29
- package/util/layouts/BaseLayout.js +1 -4
- package/util/layouts/GranularRectLayout.js +388 -555
- package/util/layouts/MultiLayout.js +41 -109
- package/util/layouts/PrecomputedLayout.js +56 -112
- package/util/layouts/PrecomputedMultiLayout.js +22 -59
- package/util/layouts/SceneGraph.js +127 -197
- package/util/layouts/index.js +29 -66
- package/util/mst-reflection.js +55 -71
- package/util/offscreenCanvasPonyfill.js +66 -134
- package/util/offscreenCanvasUtils.d.ts +2 -7
- package/util/offscreenCanvasUtils.js +49 -146
- package/util/range.js +29 -40
- package/util/rxjs.js +20 -27
- package/util/simpleFeature.js +88 -152
- package/util/stats.js +91 -151
- package/util/tracks.js +130 -173
- package/util/types/index.js +110 -179
- package/util/types/mst.js +91 -146
- package/util/types/util.js +1 -4
- package/util/when.js +54 -101
- package/BaseFeatureWidget/SequenceFeatureDetails.test.js +0 -122
- package/BaseFeatureWidget/index.test.js +0 -69
- package/TextSearch/BaseResults.test.js +0 -42
- package/configuration/configurationSchema.test.js +0 -266
- package/configuration/configurationSlot.test.js +0 -69
- package/configuration/util.test.js +0 -39
- package/data_adapters/BaseAdapter.test.js +0 -200
- package/declare.d.js +0 -1
- package/pluggableElementTypes/RpcMethodType.test.js +0 -118
- package/pluggableElementTypes/renderers/declare.d.js +0 -1
- package/pluggableElementTypes/renderers/util/serializableFilterChain.test.js +0 -20
- package/rpc/BaseRpcDriver.test.js +0 -540
- package/rpc/declaration.d.js +0 -1
- package/ui/FatalErrorDialog.test.js +0 -82
- package/ui/SanitizedHTML.test.js +0 -36
- package/ui/theme.test.js +0 -92
- package/util/Base1DViewModel.test.js +0 -130
- package/util/calculateDynamicBlocks.test.js +0 -74
- package/util/calculateStaticBlocks.test.js +0 -297
- package/util/declare.d.js +0 -1
- package/util/formatFastaStrings.test.js +0 -40
- package/util/index.test.js +0 -213
- package/util/jexlStrings.test.js +0 -48
- package/util/layouts/GranularRectLayout.test.js +0 -99
- package/util/range.test.js +0 -64
- package/util/simpleFeature.test.js +0 -34
- package/util/stats.test.js +0 -172
package/util/types/index.js
CHANGED
|
@@ -1,214 +1,145 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
var _exportNames = {
|
|
9
|
-
isViewContainer: true,
|
|
10
|
-
isSessionModel: true,
|
|
11
|
-
isSessionModelWithConfigEditing: true,
|
|
12
|
-
isSessionWithAddTracks: true,
|
|
13
|
-
isSessionModelWithWidgets: true,
|
|
14
|
-
isSessionModelWithConnections: true,
|
|
15
|
-
isSessionWithSessionPlugins: true,
|
|
16
|
-
isSelectionContainer: true,
|
|
17
|
-
isViewModel: true,
|
|
18
|
-
isTrackModel: true,
|
|
19
|
-
isDisplayModel: true,
|
|
20
|
-
isTrackViewModel: true,
|
|
21
|
-
isAppRootModel: true,
|
|
22
|
-
isAbstractMenuManager: true,
|
|
23
|
-
isUriLocation: true,
|
|
24
|
-
AuthNeededError: true,
|
|
25
|
-
RetryError: true,
|
|
26
|
-
isAuthNeededException: true,
|
|
27
|
-
isRetryException: true
|
|
28
|
-
};
|
|
29
|
-
exports.RetryError = exports.AuthNeededError = void 0;
|
|
30
|
-
exports.isAbstractMenuManager = isAbstractMenuManager;
|
|
31
|
-
exports.isAppRootModel = isAppRootModel;
|
|
32
|
-
exports.isAuthNeededException = isAuthNeededException;
|
|
33
|
-
exports.isDisplayModel = isDisplayModel;
|
|
34
|
-
exports.isRetryException = isRetryException;
|
|
35
|
-
exports.isSelectionContainer = isSelectionContainer;
|
|
36
|
-
exports.isSessionModel = isSessionModel;
|
|
37
|
-
exports.isSessionModelWithConfigEditing = isSessionModelWithConfigEditing;
|
|
38
|
-
exports.isSessionModelWithConnections = isSessionModelWithConnections;
|
|
39
|
-
exports.isSessionModelWithWidgets = isSessionModelWithWidgets;
|
|
40
|
-
exports.isSessionWithAddTracks = isSessionWithAddTracks;
|
|
41
|
-
exports.isSessionWithSessionPlugins = isSessionWithSessionPlugins;
|
|
42
|
-
exports.isTrackModel = isTrackModel;
|
|
43
|
-
exports.isTrackViewModel = isTrackViewModel;
|
|
44
|
-
exports.isUriLocation = isUriLocation;
|
|
45
|
-
exports.isViewContainer = isViewContainer;
|
|
46
|
-
exports.isViewModel = isViewModel;
|
|
47
|
-
|
|
48
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
49
|
-
|
|
50
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
51
|
-
|
|
52
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
53
|
-
|
|
54
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
55
|
-
|
|
56
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
57
|
-
|
|
58
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
59
|
-
|
|
60
|
-
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
61
|
-
|
|
62
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
63
|
-
|
|
64
|
-
var _mobxStateTree = require("mobx-state-tree");
|
|
65
|
-
|
|
66
|
-
var _util = require("./util");
|
|
67
|
-
|
|
68
|
-
Object.keys(_util).forEach(function (key) {
|
|
69
|
-
if (key === "default" || key === "__esModule") return;
|
|
70
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
71
|
-
if (key in exports && exports[key] === _util[key]) return;
|
|
72
|
-
Object.defineProperty(exports, key, {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function get() {
|
|
75
|
-
return _util[key];
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
76
7
|
}
|
|
77
|
-
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.isRetryException = exports.isAuthNeededException = exports.RetryError = exports.AuthNeededError = exports.isUriLocation = exports.isAbstractMenuManager = exports.isAppRootModel = exports.isTrackViewModel = exports.isDisplayModel = exports.isTrackModel = exports.isViewModel = exports.isSelectionContainer = exports.isSessionWithSessionPlugins = exports.isSessionModelWithConnections = exports.isSessionModelWithWidgets = exports.isSessionWithAddTracks = exports.isSessionModelWithConfigEditing = exports.isSessionModel = exports.isViewContainer = void 0;
|
|
21
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
22
|
+
const TextSearchManager_1 = __importDefault(require("../../TextSearch/TextSearchManager"));
|
|
23
|
+
__exportStar(require("./util"), exports);
|
|
84
24
|
function isViewContainer(thing) {
|
|
85
|
-
|
|
25
|
+
return ((0, mobx_state_tree_1.isStateTreeNode)(thing) &&
|
|
26
|
+
'removeView' in thing &&
|
|
27
|
+
'addView' in thing &&
|
|
28
|
+
'views' in thing);
|
|
86
29
|
}
|
|
87
|
-
|
|
30
|
+
exports.isViewContainer = isViewContainer;
|
|
88
31
|
function isSessionModel(thing) {
|
|
89
|
-
|
|
32
|
+
return (typeof thing === 'object' &&
|
|
33
|
+
thing !== null &&
|
|
34
|
+
'rpcManager' in thing &&
|
|
35
|
+
'configuration' in thing);
|
|
90
36
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
37
|
+
exports.isSessionModel = isSessionModel;
|
|
94
38
|
function isSessionModelWithConfigEditing(thing) {
|
|
95
|
-
|
|
39
|
+
return isSessionModel(thing) && 'editConfiguration' in thing;
|
|
96
40
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
41
|
+
exports.isSessionModelWithConfigEditing = isSessionModelWithConfigEditing;
|
|
100
42
|
function isSessionWithAddTracks(thing) {
|
|
101
|
-
|
|
43
|
+
return isSessionModel(thing) && 'addTrackConf' in thing;
|
|
102
44
|
}
|
|
103
|
-
|
|
45
|
+
exports.isSessionWithAddTracks = isSessionWithAddTracks;
|
|
104
46
|
function isSessionModelWithWidgets(thing) {
|
|
105
|
-
|
|
47
|
+
return isSessionModel(thing) && 'widgets' in thing;
|
|
106
48
|
}
|
|
107
|
-
|
|
49
|
+
exports.isSessionModelWithWidgets = isSessionModelWithWidgets;
|
|
108
50
|
function isSessionModelWithConnections(thing) {
|
|
109
|
-
|
|
51
|
+
return isSessionModel(thing) && 'addConnectionConf' in thing;
|
|
110
52
|
}
|
|
111
|
-
|
|
53
|
+
exports.isSessionModelWithConnections = isSessionModelWithConnections;
|
|
112
54
|
function isSessionWithSessionPlugins(thing) {
|
|
113
|
-
|
|
55
|
+
return isSessionModel(thing) && 'sessionPlugins' in thing;
|
|
114
56
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
57
|
+
exports.isSessionWithSessionPlugins = isSessionWithSessionPlugins;
|
|
118
58
|
function isSelectionContainer(thing) {
|
|
119
|
-
|
|
59
|
+
return (typeof thing === 'object' &&
|
|
60
|
+
thing !== null &&
|
|
61
|
+
'selection' in thing &&
|
|
62
|
+
'setSelection' in thing);
|
|
120
63
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
64
|
+
exports.isSelectionContainer = isSelectionContainer;
|
|
124
65
|
function isViewModel(thing) {
|
|
125
|
-
|
|
66
|
+
return (typeof thing === 'object' &&
|
|
67
|
+
thing !== null &&
|
|
68
|
+
'width' in thing &&
|
|
69
|
+
'setWidth' in thing);
|
|
126
70
|
}
|
|
127
|
-
|
|
71
|
+
exports.isViewModel = isViewModel;
|
|
128
72
|
function isTrackModel(thing) {
|
|
129
|
-
|
|
130
|
-
|
|
73
|
+
return (typeof thing === 'object' &&
|
|
74
|
+
thing !== null &&
|
|
75
|
+
'configuration' in thing &&
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
thing.configuration.trackId);
|
|
131
78
|
}
|
|
132
|
-
|
|
79
|
+
exports.isTrackModel = isTrackModel;
|
|
133
80
|
function isDisplayModel(thing) {
|
|
134
|
-
|
|
135
|
-
|
|
81
|
+
return (typeof thing === 'object' &&
|
|
82
|
+
thing !== null &&
|
|
83
|
+
'configuration' in thing &&
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
thing.configuration.displayId);
|
|
136
86
|
}
|
|
137
|
-
|
|
87
|
+
exports.isDisplayModel = isDisplayModel;
|
|
138
88
|
function isTrackViewModel(thing) {
|
|
139
|
-
|
|
89
|
+
return (typeof thing === 'object' &&
|
|
90
|
+
thing !== null &&
|
|
91
|
+
'showTrack' in thing &&
|
|
92
|
+
'hideTrack' in thing);
|
|
140
93
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
94
|
+
exports.isTrackViewModel = isTrackViewModel;
|
|
144
95
|
function isAppRootModel(thing) {
|
|
145
|
-
|
|
96
|
+
return (typeof thing === 'object' &&
|
|
97
|
+
thing !== null &&
|
|
98
|
+
'isAssemblyEditing' in thing &&
|
|
99
|
+
'findAppropriateInternetAccount' in thing);
|
|
146
100
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
101
|
+
exports.isAppRootModel = isAppRootModel;
|
|
150
102
|
function isAbstractMenuManager(thing) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
103
|
+
return (typeof thing === 'object' &&
|
|
104
|
+
thing !== null &&
|
|
105
|
+
'appendMenu' in thing &&
|
|
106
|
+
'appendToSubMenu' in thing);
|
|
107
|
+
}
|
|
108
|
+
exports.isAbstractMenuManager = isAbstractMenuManager;
|
|
158
109
|
function isUriLocation(location) {
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
_this = _super.call(this, message);
|
|
172
|
-
_this.message = message;
|
|
173
|
-
_this.url = url;
|
|
174
|
-
_this.name = 'AuthNeededError';
|
|
175
|
-
Object.setPrototypeOf((0, _assertThisInitialized2.default)(_this), AuthNeededError.prototype);
|
|
176
|
-
return _this;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return (0, _createClass2.default)(AuthNeededError);
|
|
180
|
-
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
181
|
-
|
|
110
|
+
return typeof location === 'object' && location !== null && 'uri' in location;
|
|
111
|
+
}
|
|
112
|
+
exports.isUriLocation = isUriLocation;
|
|
113
|
+
class AuthNeededError extends Error {
|
|
114
|
+
constructor(message, url) {
|
|
115
|
+
super(message);
|
|
116
|
+
this.message = message;
|
|
117
|
+
this.url = url;
|
|
118
|
+
this.name = 'AuthNeededError';
|
|
119
|
+
Object.setPrototypeOf(this, AuthNeededError.prototype);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
182
122
|
exports.AuthNeededError = AuthNeededError;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
(0, _classCallCheck2.default)(this, RetryError);
|
|
193
|
-
_this2 = _super2.call(this, message);
|
|
194
|
-
_this2.message = message;
|
|
195
|
-
_this2.internetAccountId = internetAccountId;
|
|
196
|
-
_this2.name = 'RetryError';
|
|
197
|
-
return _this2;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
return (0, _createClass2.default)(RetryError);
|
|
201
|
-
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
|
|
202
|
-
|
|
123
|
+
class RetryError extends Error {
|
|
124
|
+
constructor(message, internetAccountId) {
|
|
125
|
+
super(message);
|
|
126
|
+
this.message = message;
|
|
127
|
+
this.internetAccountId = internetAccountId;
|
|
128
|
+
this.name = 'RetryError';
|
|
129
|
+
}
|
|
130
|
+
}
|
|
203
131
|
exports.RetryError = RetryError;
|
|
204
|
-
|
|
205
132
|
function isAuthNeededException(exception) {
|
|
206
|
-
|
|
207
|
-
|
|
133
|
+
return (exception instanceof Error &&
|
|
134
|
+
// DOMException
|
|
135
|
+
(exception.name === 'AuthNeededError' ||
|
|
136
|
+
exception.url !== undefined));
|
|
208
137
|
}
|
|
209
|
-
|
|
138
|
+
exports.isAuthNeededException = isAuthNeededException;
|
|
210
139
|
function isRetryException(exception) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
140
|
+
return (
|
|
141
|
+
// DOMException
|
|
142
|
+
exception.name === 'RetryError' ||
|
|
143
|
+
exception.internetAccountId !== undefined);
|
|
144
|
+
}
|
|
145
|
+
exports.isRetryException = isRetryException;
|
package/util/types/mst.js
CHANGED
|
@@ -1,153 +1,98 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.UriLocationRaw = exports.UriLocation = exports.Region = exports.PropTypes = exports.NoAssemblyRegion = exports.LocalPathLocation = exports.FileLocation = exports.ElementId = exports.BlobLocation = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
-
|
|
14
|
-
var _shortid = _interopRequireDefault(require("shortid"));
|
|
15
|
-
|
|
16
|
-
var _mobxStateTree = require("mobx-state-tree");
|
|
17
|
-
|
|
18
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
-
|
|
20
|
-
var _mobxReact = require("mobx-react");
|
|
21
|
-
|
|
22
|
-
var _excluded = ["baseUri"],
|
|
23
|
-
_excluded2 = ["locationType"];
|
|
24
|
-
|
|
25
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26
|
-
|
|
27
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28
|
-
|
|
29
|
-
var ElementId = _mobxStateTree.types.optional(_mobxStateTree.types.identifier, _shortid.default.generate); // PropTypes that are useful when working with instances of these in react components
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exports.ElementId = ElementId;
|
|
33
|
-
var PropTypes = {
|
|
34
|
-
Region: _propTypes.default.shape({
|
|
35
|
-
refName: _propTypes.default.string.isRequired,
|
|
36
|
-
start: _propTypes.default.number.isRequired,
|
|
37
|
-
end: _propTypes.default.number.isRequired
|
|
38
|
-
}),
|
|
39
|
-
ConfigSchema: _mobxReact.PropTypes.objectOrObservableObject,
|
|
40
|
-
Feature: _propTypes.default.shape({
|
|
41
|
-
get: _propTypes.default.func.isRequired,
|
|
42
|
-
id: _propTypes.default.func.isRequired
|
|
43
|
-
})
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
44
4
|
};
|
|
45
|
-
exports
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FileLocation = exports.UriLocation = exports.UriLocationRaw = exports.BlobLocation = exports.LocalPathLocation = exports.Region = exports.NoAssemblyRegion = exports.PropTypes = exports.ElementId = void 0;
|
|
7
|
+
const shortid_1 = __importDefault(require("shortid"));
|
|
8
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
9
|
+
const prop_types_1 = __importDefault(require("prop-types"));
|
|
10
|
+
const mobx_react_1 = require("mobx-react");
|
|
11
|
+
exports.ElementId = mobx_state_tree_1.types.optional(mobx_state_tree_1.types.identifier, shortid_1.default.generate);
|
|
12
|
+
// PropTypes that are useful when working with instances of these in react components
|
|
13
|
+
exports.PropTypes = {
|
|
14
|
+
Region: prop_types_1.default.shape({
|
|
15
|
+
refName: prop_types_1.default.string.isRequired,
|
|
16
|
+
start: prop_types_1.default.number.isRequired,
|
|
17
|
+
end: prop_types_1.default.number.isRequired,
|
|
18
|
+
}),
|
|
19
|
+
ConfigSchema: mobx_react_1.PropTypes.objectOrObservableObject,
|
|
20
|
+
Feature: prop_types_1.default.shape({
|
|
21
|
+
get: prop_types_1.default.func.isRequired,
|
|
22
|
+
id: prop_types_1.default.func.isRequired,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
exports.NoAssemblyRegion = mobx_state_tree_1.types
|
|
26
|
+
.model('NoAssemblyRegion', {
|
|
27
|
+
refName: mobx_state_tree_1.types.string,
|
|
28
|
+
start: mobx_state_tree_1.types.number,
|
|
29
|
+
end: mobx_state_tree_1.types.number,
|
|
30
|
+
reversed: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.boolean, false),
|
|
31
|
+
})
|
|
32
|
+
.actions(self => ({
|
|
33
|
+
setRefName(newRefName) {
|
|
34
|
+
self.refName = newRefName;
|
|
35
|
+
},
|
|
64
36
|
}));
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
locationType: _mobxStateTree.types.literal('BlobLocation'),
|
|
78
|
-
name: _mobxStateTree.types.string,
|
|
79
|
-
blobId: _mobxStateTree.types.string
|
|
37
|
+
exports.Region = mobx_state_tree_1.types.compose('Region', exports.NoAssemblyRegion, mobx_state_tree_1.types.model({
|
|
38
|
+
assemblyName: mobx_state_tree_1.types.string,
|
|
39
|
+
}));
|
|
40
|
+
exports.LocalPathLocation = mobx_state_tree_1.types.model('LocalPathLocation', {
|
|
41
|
+
locationType: mobx_state_tree_1.types.literal('LocalPathLocation'),
|
|
42
|
+
localPath: mobx_state_tree_1.types.string,
|
|
43
|
+
});
|
|
44
|
+
// like how blobId is used to get a blob map
|
|
45
|
+
exports.BlobLocation = mobx_state_tree_1.types.model('BlobLocation', {
|
|
46
|
+
locationType: mobx_state_tree_1.types.literal('BlobLocation'),
|
|
47
|
+
name: mobx_state_tree_1.types.string,
|
|
48
|
+
blobId: mobx_state_tree_1.types.string,
|
|
80
49
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
internetAccountType: _mobxStateTree.types.string,
|
|
93
|
-
authInfo: _mobxStateTree.types.frozen()
|
|
94
|
-
}))
|
|
50
|
+
exports.UriLocationRaw = mobx_state_tree_1.types.model('UriLocation', {
|
|
51
|
+
locationType: mobx_state_tree_1.types.literal('UriLocation'),
|
|
52
|
+
uri: mobx_state_tree_1.types.string,
|
|
53
|
+
baseUri: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
|
|
54
|
+
internetAccountId: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
|
|
55
|
+
// auths information (such as tokens) needed for using this resource.
|
|
56
|
+
// if provided, these must be completely sufficient for using it
|
|
57
|
+
internetAccountPreAuthorization: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.model('InternetAccountPreAuthorization', {
|
|
58
|
+
internetAccountType: mobx_state_tree_1.types.string,
|
|
59
|
+
authInfo: mobx_state_tree_1.types.frozen(),
|
|
60
|
+
})),
|
|
95
61
|
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (!baseUri) {
|
|
107
|
-
return rest;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return snap;
|
|
111
|
-
}
|
|
62
|
+
exports.UriLocation = mobx_state_tree_1.types.snapshotProcessor(exports.UriLocationRaw, {
|
|
63
|
+
postProcessor: snap => {
|
|
64
|
+
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
65
|
+
const { baseUri, ...rest } = snap;
|
|
66
|
+
if (!baseUri) {
|
|
67
|
+
return rest;
|
|
68
|
+
}
|
|
69
|
+
return snap;
|
|
70
|
+
},
|
|
112
71
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
_locationType = 'LocalPathLocation';
|
|
140
|
-
} else if (blob !== undefined) {
|
|
141
|
-
_locationType = 'BlobLocation';
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return _objectSpread(_objectSpread({}, rest), {}, {
|
|
145
|
-
locationType: _locationType
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return snap;
|
|
150
|
-
}
|
|
72
|
+
exports.FileLocation = mobx_state_tree_1.types.snapshotProcessor(mobx_state_tree_1.types.union(exports.LocalPathLocation, exports.UriLocation, exports.BlobLocation), {
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
preProcessor(snap) {
|
|
75
|
+
if (!snap) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
// xref https://github.com/mobxjs/mobx-state-tree/issues/1524 for Omit
|
|
80
|
+
const { locationType, ...rest } = snap;
|
|
81
|
+
if (!locationType) {
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
const { uri, localPath, blob } = rest;
|
|
84
|
+
let locationType = '';
|
|
85
|
+
if (uri !== undefined) {
|
|
86
|
+
locationType = 'UriLocation';
|
|
87
|
+
}
|
|
88
|
+
else if (localPath !== undefined) {
|
|
89
|
+
locationType = 'LocalPathLocation';
|
|
90
|
+
}
|
|
91
|
+
else if (blob !== undefined) {
|
|
92
|
+
locationType = 'BlobLocation';
|
|
93
|
+
}
|
|
94
|
+
return { ...rest, locationType };
|
|
95
|
+
}
|
|
96
|
+
return snap;
|
|
97
|
+
},
|
|
151
98
|
});
|
|
152
|
-
|
|
153
|
-
exports.FileLocation = FileLocation;
|
package/util/types/util.js
CHANGED