@jbrowse/plugin-legacy-jbrowse 1.7.9 → 2.0.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/dist/JBrowse1Connection/configSchema.js +18 -28
- package/dist/JBrowse1Connection/configSchema.js.map +1 -0
- package/dist/JBrowse1Connection/index.js +10 -22
- package/dist/JBrowse1Connection/index.js.map +1 -0
- package/dist/JBrowse1Connection/jb1ConfigLoad.js +387 -501
- package/dist/JBrowse1Connection/jb1ConfigLoad.js.map +1 -0
- package/dist/JBrowse1Connection/jb1ConfigParse.js +414 -435
- package/dist/JBrowse1Connection/jb1ConfigParse.js.map +1 -0
- package/dist/JBrowse1Connection/jb1ToJb2.js +405 -546
- package/dist/JBrowse1Connection/jb1ToJb2.js.map +1 -0
- package/dist/JBrowse1Connection/model.js +49 -57
- package/dist/JBrowse1Connection/model.js.map +1 -0
- package/dist/JBrowse1Connection/types.js +2 -4
- package/dist/JBrowse1Connection/types.js.map +1 -0
- package/dist/JBrowse1Connection/util.js +123 -130
- package/dist/JBrowse1Connection/util.js.map +1 -0
- package/dist/JBrowse1TextSeachAdapter/HttpMap.js +181 -326
- package/dist/JBrowse1TextSeachAdapter/HttpMap.js.map +1 -0
- package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js +164 -185
- package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js.map +1 -0
- package/dist/JBrowse1TextSeachAdapter/configSchema.js +20 -33
- package/dist/JBrowse1TextSeachAdapter/configSchema.js.map +1 -0
- package/dist/JBrowse1TextSeachAdapter/index.js +10 -22
- package/dist/JBrowse1TextSeachAdapter/index.js.map +1 -0
- package/dist/NCListAdapter/NCListAdapter.js +164 -224
- package/dist/NCListAdapter/NCListAdapter.js.map +1 -0
- package/dist/NCListAdapter/NCListFeature.js +68 -125
- package/dist/NCListAdapter/NCListFeature.js.map +1 -0
- package/dist/NCListAdapter/configSchema.js +17 -26
- package/dist/NCListAdapter/configSchema.js.map +1 -0
- package/dist/NCListAdapter/index.js +8 -14
- package/dist/NCListAdapter/index.js.map +1 -0
- package/dist/index.js +97 -116
- package/dist/index.js.map +1 -0
- package/esm/JBrowse1Connection/configSchema.d.ts +2 -0
- package/esm/JBrowse1Connection/configSchema.js +18 -0
- package/esm/JBrowse1Connection/configSchema.js.map +1 -0
- package/esm/JBrowse1Connection/index.d.ts +2 -0
- package/esm/JBrowse1Connection/index.js +3 -0
- package/esm/JBrowse1Connection/index.js.map +1 -0
- package/esm/JBrowse1Connection/jb1ConfigLoad.d.ts +36 -0
- package/esm/JBrowse1Connection/jb1ConfigLoad.js +281 -0
- package/esm/JBrowse1Connection/jb1ConfigLoad.js.map +1 -0
- package/esm/JBrowse1Connection/jb1ConfigParse.d.ts +11 -0
- package/esm/JBrowse1Connection/jb1ConfigParse.js +377 -0
- package/esm/JBrowse1Connection/jb1ConfigParse.js.map +1 -0
- package/esm/JBrowse1Connection/jb1ToJb2.d.ts +49 -0
- package/esm/JBrowse1Connection/jb1ToJb2.js +424 -0
- package/esm/JBrowse1Connection/jb1ToJb2.js.map +1 -0
- package/esm/JBrowse1Connection/model.d.ts +15 -0
- package/esm/JBrowse1Connection/model.js +44 -0
- package/esm/JBrowse1Connection/model.js.map +1 -0
- package/esm/JBrowse1Connection/types.d.ts +91 -0
- package/esm/JBrowse1Connection/types.js +2 -0
- package/esm/JBrowse1Connection/types.js.map +1 -0
- package/esm/JBrowse1Connection/util.d.ts +26 -0
- package/esm/JBrowse1Connection/util.js +136 -0
- package/esm/JBrowse1Connection/util.js.map +1 -0
- package/esm/JBrowse1TextSeachAdapter/HttpMap.d.ts +39 -0
- package/esm/JBrowse1TextSeachAdapter/HttpMap.js +89 -0
- package/esm/JBrowse1TextSeachAdapter/HttpMap.js.map +1 -0
- package/esm/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.d.ts +33 -0
- package/esm/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js +67 -0
- package/esm/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js.map +1 -0
- package/esm/JBrowse1TextSeachAdapter/configSchema.d.ts +2 -0
- package/esm/JBrowse1TextSeachAdapter/configSchema.js +20 -0
- package/esm/JBrowse1TextSeachAdapter/configSchema.js.map +1 -0
- package/esm/JBrowse1TextSeachAdapter/index.d.ts +2 -0
- package/esm/JBrowse1TextSeachAdapter/index.js +3 -0
- package/esm/JBrowse1TextSeachAdapter/index.js.map +1 -0
- package/esm/NCListAdapter/NCListAdapter.d.ts +31 -0
- package/esm/NCListAdapter/NCListAdapter.js +62 -0
- package/esm/NCListAdapter/NCListAdapter.js.map +1 -0
- package/esm/NCListAdapter/NCListFeature.d.ts +31 -0
- package/esm/NCListAdapter/NCListFeature.js +78 -0
- package/esm/NCListAdapter/NCListFeature.js.map +1 -0
- package/esm/NCListAdapter/configSchema.d.ts +2 -0
- package/esm/NCListAdapter/configSchema.js +16 -0
- package/esm/NCListAdapter/configSchema.js.map +1 -0
- package/esm/NCListAdapter/index.d.ts +1 -0
- package/esm/NCListAdapter/index.js +2 -0
- package/esm/NCListAdapter/index.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +50 -0
- package/esm/index.js.map +1 -0
- package/package.json +15 -6
- package/dist/JBrowse1TextSeachAdapter/HttpMap.test.js +0 -118
- package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.test.js +0 -98
- package/dist/NCListAdapter/NCListAdapter.test.js +0 -108
- package/dist/declare.d.js +0 -1
- package/dist/index.test.js +0 -44
|
@@ -1,350 +1,205 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
42
|
/*
|
|
23
43
|
* Helper class allows reading names index generated in JBrowse1
|
|
24
44
|
* Adapted from https://github.com/GMOD/jbrowse/blob/master/src/JBrowse/Store/Hash.js
|
|
25
45
|
*/
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
case 4:
|
|
91
|
-
case "end":
|
|
92
|
-
return _context2.stop();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}, _callee2, this);
|
|
96
|
-
}));
|
|
97
|
-
|
|
98
|
-
function getHashHexCharacters() {
|
|
99
|
-
return _getHashHexCharacters.apply(this, arguments);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return getHashHexCharacters;
|
|
103
|
-
}()
|
|
104
|
-
}, {
|
|
105
|
-
key: "getCompress",
|
|
106
|
-
value: function () {
|
|
107
|
-
var _getCompress = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
108
|
-
var meta;
|
|
109
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
110
|
-
while (1) {
|
|
111
|
-
switch (_context3.prev = _context3.next) {
|
|
112
|
-
case 0:
|
|
113
|
-
_context3.next = 2;
|
|
114
|
-
return this.readMeta();
|
|
115
|
-
|
|
116
|
-
case 2:
|
|
117
|
-
meta = _context3.sent;
|
|
118
|
-
return _context3.abrupt("return", meta.compress);
|
|
119
|
-
|
|
120
|
-
case 4:
|
|
121
|
-
case "end":
|
|
122
|
-
return _context3.stop();
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}, _callee3, this);
|
|
126
|
-
}));
|
|
127
|
-
|
|
128
|
-
function getCompress() {
|
|
129
|
-
return _getCompress.apply(this, arguments);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return getCompress;
|
|
133
|
-
}()
|
|
134
|
-
}, {
|
|
135
|
-
key: "getTrackNames",
|
|
136
|
-
value: function () {
|
|
137
|
-
var _getTrackNames = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
138
|
-
var meta;
|
|
139
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
140
|
-
while (1) {
|
|
141
|
-
switch (_context4.prev = _context4.next) {
|
|
142
|
-
case 0:
|
|
143
|
-
_context4.next = 2;
|
|
144
|
-
return this.readMeta();
|
|
145
|
-
|
|
146
|
-
case 2:
|
|
147
|
-
meta = _context4.sent;
|
|
148
|
-
return _context4.abrupt("return", meta.tracks);
|
|
149
|
-
|
|
150
|
-
case 4:
|
|
151
|
-
case "end":
|
|
152
|
-
return _context4.stop();
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}, _callee4, this);
|
|
156
|
-
}));
|
|
157
|
-
|
|
158
|
-
function getTrackNames() {
|
|
159
|
-
return _getTrackNames.apply(this, arguments);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return getTrackNames;
|
|
163
|
-
}()
|
|
46
|
+
var buffer_crc32_1 = __importDefault(require("buffer-crc32"));
|
|
47
|
+
var HttpMap = /** @class */ (function () {
|
|
48
|
+
function HttpMap(args) {
|
|
49
|
+
// make sure url has a trailing slash
|
|
50
|
+
this.url = /\/$/.test(args.url) ? args.url : "".concat(args.url, "/");
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* loads meta.json file from names directory and reads number of hash_bits used
|
|
54
|
+
*/
|
|
55
|
+
HttpMap.prototype.readMeta = function () {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
+
var meta, compress, tracks, hashHexCharacters;
|
|
58
|
+
return __generator(this, function (_a) {
|
|
59
|
+
switch (_a.label) {
|
|
60
|
+
case 0: return [4 /*yield*/, this.loadFile('meta.json')];
|
|
61
|
+
case 1:
|
|
62
|
+
meta = _a.sent();
|
|
63
|
+
compress = meta.compress, tracks = meta.track_names;
|
|
64
|
+
hashHexCharacters = Math.ceil(meta.hash_bits / 4);
|
|
65
|
+
return [2 /*return*/, { hashHexCharacters: hashHexCharacters, compress: compress, tracks: tracks }];
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
HttpMap.prototype.getHashHexCharacters = function () {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
var meta;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0: return [4 /*yield*/, this.readMeta()];
|
|
76
|
+
case 1:
|
|
77
|
+
meta = _a.sent();
|
|
78
|
+
return [2 /*return*/, meta.hashHexCharacters];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
HttpMap.prototype.getCompress = function () {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
+
var meta;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0: return [4 /*yield*/, this.readMeta()];
|
|
89
|
+
case 1:
|
|
90
|
+
meta = _a.sent();
|
|
91
|
+
return [2 /*return*/, meta.compress];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
HttpMap.prototype.getTrackNames = function () {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
+
var meta;
|
|
99
|
+
return __generator(this, function (_a) {
|
|
100
|
+
switch (_a.label) {
|
|
101
|
+
case 0: return [4 /*yield*/, this.readMeta()];
|
|
102
|
+
case 1:
|
|
103
|
+
meta = _a.sent();
|
|
104
|
+
return [2 /*return*/, meta.tracks];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
164
109
|
/**
|
|
165
110
|
* Returns contents of a bucket given a key
|
|
166
111
|
* @param key - string
|
|
167
112
|
*/
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
case 2:
|
|
182
|
-
bucket = _context5.sent;
|
|
183
|
-
return _context5.abrupt("return", bucket[key]);
|
|
184
|
-
|
|
185
|
-
case 4:
|
|
186
|
-
case "end":
|
|
187
|
-
return _context5.stop();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}, _callee5, this);
|
|
191
|
-
}));
|
|
192
|
-
|
|
193
|
-
function get(_x) {
|
|
194
|
-
return _get.apply(this, arguments);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return get;
|
|
198
|
-
}()
|
|
113
|
+
HttpMap.prototype.get = function (key) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
+
var bucket;
|
|
116
|
+
return __generator(this, function (_a) {
|
|
117
|
+
switch (_a.label) {
|
|
118
|
+
case 0: return [4 /*yield*/, this.getBucket(key)];
|
|
119
|
+
case 1:
|
|
120
|
+
bucket = _a.sent();
|
|
121
|
+
return [2 /*return*/, bucket[key]];
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
};
|
|
199
126
|
/**
|
|
200
127
|
* Returns a bucket given a key
|
|
201
128
|
* @param key - string
|
|
202
129
|
*/
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
hexToDirPath = _context6.sent;
|
|
219
|
-
return _context6.abrupt("return", this.loadFile(hexToDirPath));
|
|
220
|
-
|
|
221
|
-
case 5:
|
|
222
|
-
case "end":
|
|
223
|
-
return _context6.stop();
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}, _callee6, this);
|
|
227
|
-
}));
|
|
228
|
-
|
|
229
|
-
function getBucket(_x2) {
|
|
230
|
-
return _getBucket.apply(this, arguments);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
return getBucket;
|
|
234
|
-
}()
|
|
130
|
+
HttpMap.prototype.getBucket = function (key) {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
132
|
+
var bucketIdent, hexToDirPath;
|
|
133
|
+
return __generator(this, function (_a) {
|
|
134
|
+
switch (_a.label) {
|
|
135
|
+
case 0:
|
|
136
|
+
bucketIdent = this.hash(key);
|
|
137
|
+
return [4 /*yield*/, this.hexToDirPath(bucketIdent)];
|
|
138
|
+
case 1:
|
|
139
|
+
hexToDirPath = _a.sent();
|
|
140
|
+
return [2 /*return*/, this.loadFile(hexToDirPath)];
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
};
|
|
235
145
|
/**
|
|
236
146
|
* Loads a file using the url and provided id.
|
|
237
147
|
* Returns response object with contents of the file
|
|
238
148
|
* @param id - string
|
|
239
149
|
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
case 2:
|
|
254
|
-
response = _context7.sent;
|
|
255
|
-
|
|
256
|
-
if (response.ok) {
|
|
257
|
-
_context7.next = 5;
|
|
258
|
-
break;
|
|
150
|
+
HttpMap.prototype.loadFile = function (id) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
+
var response;
|
|
153
|
+
return __generator(this, function (_a) {
|
|
154
|
+
switch (_a.label) {
|
|
155
|
+
case 0: return [4 /*yield*/, fetch("".concat(this.url).concat(id))];
|
|
156
|
+
case 1:
|
|
157
|
+
response = _a.sent();
|
|
158
|
+
if (!response.ok) {
|
|
159
|
+
throw new Error("HTTP ".concat(response.status, " ").concat(response.statusText));
|
|
160
|
+
}
|
|
161
|
+
return [2 /*return*/, response.json()];
|
|
259
162
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
case 5:
|
|
264
|
-
return _context7.abrupt("return", response.json());
|
|
265
|
-
|
|
266
|
-
case 6:
|
|
267
|
-
case "end":
|
|
268
|
-
return _context7.stop();
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}, _callee7, this);
|
|
272
|
-
}));
|
|
273
|
-
|
|
274
|
-
function loadFile(_x3) {
|
|
275
|
-
return _loadFile.apply(this, arguments);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return loadFile;
|
|
279
|
-
}()
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
};
|
|
280
166
|
/**
|
|
281
167
|
* Returns the corresponding path of the file given a hex string
|
|
282
168
|
* @param hex - hex string
|
|
283
169
|
*/
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
return this.getCompress();
|
|
307
|
-
|
|
308
|
-
case 6:
|
|
309
|
-
compress = _context8.sent;
|
|
310
|
-
|
|
311
|
-
while (hex.length < 8) {
|
|
312
|
-
hex = "0".concat(hex);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
hex = hex.substr(8 - hashHexCharacters);
|
|
316
|
-
dirpath = [];
|
|
317
|
-
|
|
318
|
-
for (i = 0; i < hex.length; i += 3) {
|
|
319
|
-
dirpath.push(hex.substring(i, i + 3));
|
|
170
|
+
HttpMap.prototype.hexToDirPath = function (hex) {
|
|
171
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
172
|
+
var hashHexCharacters, compress, dirpath, i;
|
|
173
|
+
return __generator(this, function (_a) {
|
|
174
|
+
switch (_a.label) {
|
|
175
|
+
case 0: return [4 /*yield*/, this.getHashHexCharacters()];
|
|
176
|
+
case 1:
|
|
177
|
+
hashHexCharacters = _a.sent();
|
|
178
|
+
if (!hashHexCharacters) return [3 /*break*/, 3];
|
|
179
|
+
return [4 /*yield*/, this.getCompress()];
|
|
180
|
+
case 2:
|
|
181
|
+
compress = _a.sent();
|
|
182
|
+
while (hex.length < 8) {
|
|
183
|
+
hex = "0".concat(hex);
|
|
184
|
+
}
|
|
185
|
+
hex = hex.substr(8 - hashHexCharacters);
|
|
186
|
+
dirpath = [];
|
|
187
|
+
for (i = 0; i < hex.length; i += 3) {
|
|
188
|
+
dirpath.push(hex.substring(i, i + 3));
|
|
189
|
+
}
|
|
190
|
+
return [2 /*return*/, "".concat(dirpath.join('/'), ".json").concat(compress ? 'z' : '')];
|
|
191
|
+
case 3: return [2 /*return*/, ''];
|
|
320
192
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
function hexToDirPath(_x4) {
|
|
336
|
-
return _hexToDirPath.apply(this, arguments);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
return hexToDirPath;
|
|
340
|
-
}()
|
|
341
|
-
}, {
|
|
342
|
-
key: "hash",
|
|
343
|
-
value: function hash(data) {
|
|
344
|
-
return (0, _bufferCrc.default)(Buffer.from(data)).toString('hex').toLowerCase().replace('-', 'n');
|
|
345
|
-
}
|
|
346
|
-
}]);
|
|
347
|
-
return HttpMap;
|
|
348
|
-
}();
|
|
349
|
-
|
|
350
|
-
exports.default = HttpMap;
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
HttpMap.prototype.hash = function (data) {
|
|
197
|
+
return (0, buffer_crc32_1.default)(Buffer.from(data))
|
|
198
|
+
.toString('hex')
|
|
199
|
+
.toLowerCase()
|
|
200
|
+
.replace('-', 'n');
|
|
201
|
+
};
|
|
202
|
+
return HttpMap;
|
|
203
|
+
}());
|
|
204
|
+
exports.default = HttpMap;
|
|
205
|
+
//# sourceMappingURL=HttpMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpMap.js","sourceRoot":"","sources":["../../src/JBrowse1TextSeachAdapter/HttpMap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,8DAAgC;AAEhC;IAGE,iBAAY,IAAqB;QAC/B,qCAAqC;QACrC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,UAAG,IAAI,CAAC,GAAG,MAAG,CAAA;IAC7D,CAAC;IAED;;OAEG;IACG,0BAAQ,GAAd;;;;;4BACe,qBAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAA;;wBAAvC,IAAI,GAAG,SAAgC;wBACrC,QAAQ,GAA0B,IAAI,SAA9B,EAAe,MAAM,GAAK,IAAI,YAAT,CAAS;wBACxC,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAA;wBACvD,sBAAO,EAAE,iBAAiB,mBAAA,EAAE,QAAQ,UAAA,EAAE,MAAM,QAAA,EAAE,EAAA;;;;KAC/C;IAEK,sCAAoB,GAA1B;;;;;4BACe,qBAAM,IAAI,CAAC,QAAQ,EAAE,EAAA;;wBAA5B,IAAI,GAAG,SAAqB;wBAClC,sBAAO,IAAI,CAAC,iBAAiB,EAAA;;;;KAC9B;IAEK,6BAAW,GAAjB;;;;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