@jbrowse/plugin-legacy-jbrowse 1.6.9 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/JBrowse1Connection/configSchema.d.ts +2 -2
  2. package/dist/JBrowse1Connection/configSchema.js +30 -0
  3. package/dist/JBrowse1Connection/index.d.ts +2 -2
  4. package/dist/JBrowse1Connection/index.js +23 -0
  5. package/dist/JBrowse1Connection/jb1ConfigLoad.d.ts +36 -36
  6. package/dist/JBrowse1Connection/jb1ConfigLoad.js +555 -0
  7. package/dist/JBrowse1Connection/jb1ConfigParse.d.ts +11 -11
  8. package/dist/JBrowse1Connection/jb1ConfigParse.js +476 -0
  9. package/dist/JBrowse1Connection/jb1ToJb2.d.ts +47 -47
  10. package/dist/JBrowse1Connection/jb1ToJb2.js +556 -0
  11. package/dist/JBrowse1Connection/model.d.ts +15 -4
  12. package/dist/JBrowse1Connection/model.js +58 -0
  13. package/dist/JBrowse1Connection/types.d.ts +91 -91
  14. package/dist/JBrowse1Connection/types.js +5 -0
  15. package/dist/JBrowse1Connection/util.d.ts +26 -26
  16. package/dist/JBrowse1Connection/util.js +177 -0
  17. package/dist/JBrowse1TextSeachAdapter/HttpMap.d.ts +39 -39
  18. package/dist/JBrowse1TextSeachAdapter/HttpMap.js +350 -0
  19. package/dist/JBrowse1TextSeachAdapter/HttpMap.test.js +118 -0
  20. package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.d.ts +33 -33
  21. package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js +191 -0
  22. package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.test.js +98 -0
  23. package/dist/JBrowse1TextSeachAdapter/configSchema.d.ts +2 -2
  24. package/dist/JBrowse1TextSeachAdapter/configSchema.js +35 -0
  25. package/dist/JBrowse1TextSeachAdapter/index.d.ts +2 -2
  26. package/dist/JBrowse1TextSeachAdapter/index.js +23 -0
  27. package/dist/NCListAdapter/NCListAdapter.d.ts +31 -31
  28. package/dist/NCListAdapter/NCListAdapter.js +237 -0
  29. package/dist/NCListAdapter/NCListAdapter.test.js +108 -0
  30. package/dist/NCListAdapter/NCListFeature.d.ts +31 -31
  31. package/dist/NCListAdapter/NCListFeature.js +142 -0
  32. package/dist/NCListAdapter/configSchema.d.ts +2 -2
  33. package/dist/NCListAdapter/configSchema.js +27 -0
  34. package/dist/NCListAdapter/index.d.ts +1 -1
  35. package/dist/NCListAdapter/index.js +15 -0
  36. package/dist/declare.d.js +1 -0
  37. package/dist/index.d.ts +6 -6
  38. package/dist/index.js +122 -6
  39. package/dist/index.test.js +44 -0
  40. package/package.json +5 -7
  41. package/src/JBrowse1Connection/jb1ConfigLoad.ts +1 -1
  42. package/dist/index.test.d.ts +0 -1
  43. package/dist/plugin-legacy-jbrowse.cjs.development.js +0 -3567
  44. package/dist/plugin-legacy-jbrowse.cjs.development.js.map +0 -1
  45. package/dist/plugin-legacy-jbrowse.cjs.production.min.js +0 -2
  46. package/dist/plugin-legacy-jbrowse.cjs.production.min.js.map +0 -1
  47. package/dist/plugin-legacy-jbrowse.esm.js +0 -3561
  48. package/dist/plugin-legacy-jbrowse.esm.js.map +0 -1
@@ -1,91 +1,91 @@
1
- export interface ProtoTrack {
2
- backendVersion?: number;
3
- baseUrl?: string;
4
- category?: string;
5
- config?: Track;
6
- dataRoot?: string;
7
- features?: Feature[];
8
- histograms?: Track;
9
- index?: number;
10
- key?: string;
11
- label?: string;
12
- metadata?: Metadata;
13
- store?: Store | string;
14
- storeClass?: string;
15
- type?: string;
16
- urlTemplate?: string;
17
- baiUrlTemplate?: string;
18
- craiUrlTemplate?: string;
19
- tbiUrlTemplate?: string;
20
- csiUrlTemplate?: string;
21
- faiUrlTemplate?: string;
22
- gziUrlTemplate?: string;
23
- useAsRefSeqStore?: boolean;
24
- }
25
- export interface Track extends ProtoTrack {
26
- label: string;
27
- }
28
- export interface Metadata {
29
- category?: string;
30
- description?: string;
31
- Description?: string;
32
- }
33
- export interface Feature {
34
- seq_id: string;
35
- start: number;
36
- end: number;
37
- name?: string;
38
- }
39
- export interface Source {
40
- url: string;
41
- name?: string;
42
- type?: string;
43
- }
44
- export interface TrackMetadata {
45
- sources?: string | Source | (string | Source)[] | Record<string, Source>;
46
- }
47
- export interface Store extends ProtoTrack {
48
- name?: string;
49
- }
50
- export interface Names {
51
- baseUrl?: string;
52
- }
53
- export interface RefSeq {
54
- name: string;
55
- length: number;
56
- end: number;
57
- start: number;
58
- }
59
- export interface RefSeqs {
60
- url?: string;
61
- data?: RefSeq[];
62
- }
63
- export interface Include {
64
- url: string;
65
- cacheBuster?: boolean;
66
- format?: string;
67
- version?: number;
68
- }
69
- export interface Config {
70
- baseUrl?: string;
71
- cacheBuster?: boolean;
72
- dataRoot?: string;
73
- include?: string[];
74
- names?: Record<string, string>;
75
- nameUrl?: string;
76
- refSeqs?: string | RefSeqs;
77
- sourceUrl?: string;
78
- stores?: Record<string, Store>;
79
- trackMetadata?: TrackMetadata;
80
- tracks?: Track | Track[] | Record<string, Track | ProtoTrack>;
81
- }
82
- export interface UriLocation {
83
- uri: string;
84
- baseUri?: string;
85
- locationType: 'UriLocation';
86
- }
87
- export interface LocalPathLocation {
88
- localPath: string;
89
- locationType: 'LocalPathLocation';
90
- }
91
- export declare type JBLocation = UriLocation | LocalPathLocation;
1
+ export interface ProtoTrack {
2
+ backendVersion?: number;
3
+ baseUrl?: string;
4
+ category?: string;
5
+ config?: Track;
6
+ dataRoot?: string;
7
+ features?: Feature[];
8
+ histograms?: Track;
9
+ index?: number;
10
+ key?: string;
11
+ label?: string;
12
+ metadata?: Metadata;
13
+ store?: Store | string;
14
+ storeClass?: string;
15
+ type?: string;
16
+ urlTemplate?: string;
17
+ baiUrlTemplate?: string;
18
+ craiUrlTemplate?: string;
19
+ tbiUrlTemplate?: string;
20
+ csiUrlTemplate?: string;
21
+ faiUrlTemplate?: string;
22
+ gziUrlTemplate?: string;
23
+ useAsRefSeqStore?: boolean;
24
+ }
25
+ export interface Track extends ProtoTrack {
26
+ label: string;
27
+ }
28
+ export interface Metadata {
29
+ category?: string;
30
+ description?: string;
31
+ Description?: string;
32
+ }
33
+ export interface Feature {
34
+ seq_id: string;
35
+ start: number;
36
+ end: number;
37
+ name?: string;
38
+ }
39
+ export interface Source {
40
+ url: string;
41
+ name?: string;
42
+ type?: string;
43
+ }
44
+ export interface TrackMetadata {
45
+ sources?: string | Source | (string | Source)[] | Record<string, Source>;
46
+ }
47
+ export interface Store extends ProtoTrack {
48
+ name?: string;
49
+ }
50
+ export interface Names {
51
+ baseUrl?: string;
52
+ }
53
+ export interface RefSeq {
54
+ name: string;
55
+ length: number;
56
+ end: number;
57
+ start: number;
58
+ }
59
+ export interface RefSeqs {
60
+ url?: string;
61
+ data?: RefSeq[];
62
+ }
63
+ export interface Include {
64
+ url: string;
65
+ cacheBuster?: boolean;
66
+ format?: string;
67
+ version?: number;
68
+ }
69
+ export interface Config {
70
+ baseUrl?: string;
71
+ cacheBuster?: boolean;
72
+ dataRoot?: string;
73
+ include?: string[];
74
+ names?: Record<string, string>;
75
+ nameUrl?: string;
76
+ refSeqs?: string | RefSeqs;
77
+ sourceUrl?: string;
78
+ stores?: Record<string, Store>;
79
+ trackMetadata?: TrackMetadata;
80
+ tracks?: Track | Track[] | Record<string, Track | ProtoTrack>;
81
+ }
82
+ export interface UriLocation {
83
+ uri: string;
84
+ baseUri?: string;
85
+ locationType: 'UriLocation';
86
+ }
87
+ export interface LocalPathLocation {
88
+ localPath: string;
89
+ locationType: 'LocalPathLocation';
90
+ }
91
+ export declare type JBLocation = UriLocation | LocalPathLocation;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,26 +1,26 @@
1
- import { Track, Source } from './types';
2
- export declare function isTrack(arg: any): arg is Track;
3
- export declare function isSource(arg: any): arg is Source;
4
- /**
5
- * updates a with values from b, recursively
6
- */
7
- declare type Obj = Record<string, any>;
8
- export declare function deepUpdate(a: Obj, b: Obj): Obj;
9
- /**
10
- * replace variables in a template string with values
11
- * @param template - String with variable names in curly brackets
12
- * e.g., `http://foo/{bar}?arg={baz.foo}`
13
- * @param fillWith - object with attribute-value mappings
14
- * e.g., `{ 'bar': 'someurl', 'baz': { 'foo': 42 } }`
15
- * @returns the template string with variables in fillWith replaced
16
- * e.g., 'htp://foo/someurl?arg=valueforbaz'
17
- */
18
- export declare function fillTemplate(template: string, fillWith: Obj): string;
19
- /**
20
- * Clones objects (including DOM nodes) and all children.
21
- * Warning: do not clone cyclic structures
22
- * (Lifted from dojo https://github.com/dojo/dojo/blob/master/_base/lang.js)
23
- * @param src - The object to clone
24
- */
25
- export declare function clone(src: any): any;
26
- export {};
1
+ import { Track, Source } from './types';
2
+ export declare function isTrack(arg: any): arg is Track;
3
+ export declare function isSource(arg: any): arg is Source;
4
+ /**
5
+ * updates a with values from b, recursively
6
+ */
7
+ declare type Obj = Record<string, any>;
8
+ export declare function deepUpdate(a: Obj, b: Obj): Obj;
9
+ /**
10
+ * replace variables in a template string with values
11
+ * @param template - String with variable names in curly brackets
12
+ * e.g., `http://foo/{bar}?arg={baz.foo}`
13
+ * @param fillWith - object with attribute-value mappings
14
+ * e.g., `{ 'bar': 'someurl', 'baz': { 'foo': 42 } }`
15
+ * @returns the template string with variables in fillWith replaced
16
+ * e.g., 'htp://foo/someurl?arg=valueforbaz'
17
+ */
18
+ export declare function fillTemplate(template: string, fillWith: Obj): string;
19
+ /**
20
+ * Clones objects (including DOM nodes) and all children.
21
+ * Warning: do not clone cyclic structures
22
+ * (Lifted from dojo https://github.com/dojo/dojo/blob/master/_base/lang.js)
23
+ * @param src - The object to clone
24
+ */
25
+ export declare function clone(src: any): any;
26
+ export {};
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.clone = clone;
9
+ exports.deepUpdate = deepUpdate;
10
+ exports.fillTemplate = fillTemplate;
11
+ exports.isSource = isSource;
12
+ exports.isTrack = isTrack;
13
+
14
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
15
+
16
+ var _getValue = _interopRequireDefault(require("get-value"));
17
+
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
+ function isTrack(arg) {
20
+ return arg && arg.label && typeof arg.label === 'string';
21
+ } // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
+
23
+
24
+ function isSource(arg) {
25
+ return arg && arg.url && typeof arg.url === 'string';
26
+ }
27
+ /**
28
+ * updates a with values from b, recursively
29
+ */
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+
32
+
33
+ function deepUpdate(a, b) {
34
+ for (var _i = 0, _Object$keys = Object.keys(b); _i < _Object$keys.length; _i++) {
35
+ var prop = _Object$keys[_i];
36
+
37
+ if (prop in a && (0, _typeof2["default"])(b[prop]) === 'object' && (0, _typeof2["default"])(a[prop]) === 'object') {
38
+ deepUpdate(a[prop], b[prop]);
39
+ } else if (typeof a[prop] === 'undefined' || typeof b[prop] !== 'undefined') {
40
+ a[prop] = b[prop];
41
+ }
42
+ }
43
+
44
+ return a;
45
+ }
46
+ /**
47
+ * replace variables in a template string with values
48
+ * @param template - String with variable names in curly brackets
49
+ * e.g., `http://foo/{bar}?arg={baz.foo}`
50
+ * @param fillWith - object with attribute-value mappings
51
+ * e.g., `{ 'bar': 'someurl', 'baz': { 'foo': 42 } }`
52
+ * @returns the template string with variables in fillWith replaced
53
+ * e.g., 'htp://foo/someurl?arg=valueforbaz'
54
+ */
55
+
56
+
57
+ function fillTemplate(template, fillWith) {
58
+ var _this = this;
59
+
60
+ return template.replace(/\{([\w\s.]+)\}/g, function (match, varName) {
61
+ varName = varName.replace(/\s+/g, ''); // remove all whitespace
62
+
63
+ var fill = (0, _getValue["default"])(fillWith, varName);
64
+
65
+ if (fill !== undefined) {
66
+ if (typeof fill === 'function') {
67
+ return fill(varName);
68
+ }
69
+
70
+ return fill;
71
+ }
72
+
73
+ if (fillWith.callback) {
74
+ // @ts-ignore
75
+ var v = fillWith.callback.call(_this, varName);
76
+
77
+ if (v !== undefined) {
78
+ return v;
79
+ }
80
+ }
81
+
82
+ return match;
83
+ });
84
+ }
85
+ /**
86
+ * Clones objects (including DOM nodes) and all children.
87
+ * Warning: do not clone cyclic structures
88
+ * (Lifted from dojo https://github.com/dojo/dojo/blob/master/_base/lang.js)
89
+ * @param src - The object to clone
90
+ */
91
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
+
93
+
94
+ function clone(src) {
95
+ if (!src || (0, _typeof2["default"])(src) !== 'object' || Object.prototype.toString.call(src) === '[object Function]') {
96
+ // null, undefined, any non-object, or function
97
+ return src; // anything
98
+ }
99
+
100
+ if (src.nodeType && 'cloneNode' in src) {
101
+ // DOM Node
102
+ return src.cloneNode(true); // Node
103
+ }
104
+
105
+ if (src instanceof Date) {
106
+ // Date
107
+ return new Date(src.getTime()); // Date
108
+ }
109
+
110
+ if (src instanceof RegExp) {
111
+ // RegExp
112
+ return new RegExp(src); // RegExp
113
+ }
114
+
115
+ var r;
116
+ var i;
117
+ var l;
118
+
119
+ if (Array.isArray(src)) {
120
+ // array
121
+ r = [];
122
+
123
+ for (i = 0, l = src.length; i < l; ++i) {
124
+ if (i in src) {
125
+ r[i] = clone(src[i]);
126
+ }
127
+ } // we don't clone functions for performance reasons
128
+ // }else if(d.isFunction(src)){
129
+ // // function
130
+ // r = function(){ return src.apply(this, arguments); };
131
+
132
+ } else {
133
+ // generic objects
134
+ r = src.constructor ? new src.constructor() : {};
135
+ }
136
+
137
+ return mixin(r, src, clone);
138
+ }
139
+ /**
140
+ * Copies/adds all properties of source to dest; returns dest.
141
+ * (Lifted from dojo https://github.com/dojo/dojo/blob/master/_base/lang.js)
142
+ *
143
+ * All properties, including functions (sometimes termed "methods"), excluding
144
+ * any non-standard extensions found in Object.prototype, are copied/added to
145
+ * dest. Copying/adding each particular property is delegated to copyFunc
146
+ * (if any); copyFunc defaults to the Javascript assignment operator if not
147
+ * provided. Notice that by default, mixin executes a so-called "shallow copy"
148
+ * and aggregate types are copied/added by reference.
149
+ * @param dest - The object to which to copy/add all properties contained in
150
+ * source.
151
+ * @param source - The object from which to draw all properties to copy into dest.
152
+ * @param copyFunc - The process used to copy/add a property in source; defaults
153
+ * to the Javascript assignment operator.
154
+ * @returns dest, as modified
155
+ */
156
+
157
+
158
+ function mixin(dest, source, copyFunc) {
159
+ var name;
160
+ var s;
161
+ var empty = {};
162
+
163
+ for (name in source) {
164
+ // the (!(name in empty) || empty[name] !== s) condition avoids copying
165
+ // properties in "source" inherited from Object.prototype. For example,
166
+ // if dest has a custom toString() method, don't overwrite it with the
167
+ // toString() method that source inherited from Object.prototype
168
+ s = source[name];
169
+
170
+ if (!(name in dest) || // @ts-ignore
171
+ dest[name] !== s && (!(name in empty) || empty[name] !== s)) {
172
+ dest[name] = copyFunc ? copyFunc(s) : s;
173
+ }
174
+ }
175
+
176
+ return dest; // Object
177
+ }
@@ -1,39 +1,39 @@
1
- export default class HttpMap {
2
- url: string;
3
- constructor(args: {
4
- url: string;
5
- });
6
- /**
7
- * loads meta.json file from names directory and reads number of hash_bits used
8
- */
9
- readMeta(): Promise<{
10
- hashHexCharacters: number;
11
- compress: any;
12
- tracks: any;
13
- }>;
14
- getHashHexCharacters(): Promise<number>;
15
- getCompress(): Promise<any>;
16
- getTrackNames(): Promise<any>;
17
- /**
18
- * Returns contents of a bucket given a key
19
- * @param key - string
20
- */
21
- get(key: string): Promise<any>;
22
- /**
23
- * Returns a bucket given a key
24
- * @param key - string
25
- */
26
- getBucket(key: string): Promise<any>;
27
- /**
28
- * Loads a file using the url and provided id.
29
- * Returns response object with contents of the file
30
- * @param id - string
31
- */
32
- loadFile(id: string): Promise<any>;
33
- /**
34
- * Returns the corresponding path of the file given a hex string
35
- * @param hex - hex string
36
- */
37
- hexToDirPath(hex: string): Promise<string>;
38
- hash(data: string): string;
39
- }
1
+ export default class HttpMap {
2
+ url: string;
3
+ constructor(args: {
4
+ url: string;
5
+ });
6
+ /**
7
+ * loads meta.json file from names directory and reads number of hash_bits used
8
+ */
9
+ readMeta(): Promise<{
10
+ hashHexCharacters: number;
11
+ compress: any;
12
+ tracks: any;
13
+ }>;
14
+ getHashHexCharacters(): Promise<number>;
15
+ getCompress(): Promise<any>;
16
+ getTrackNames(): Promise<any>;
17
+ /**
18
+ * Returns contents of a bucket given a key
19
+ * @param key - string
20
+ */
21
+ get(key: string): Promise<any>;
22
+ /**
23
+ * Returns a bucket given a key
24
+ * @param key - string
25
+ */
26
+ getBucket(key: string): Promise<any>;
27
+ /**
28
+ * Loads a file using the url and provided id.
29
+ * Returns response object with contents of the file
30
+ * @param id - string
31
+ */
32
+ loadFile(id: string): Promise<any>;
33
+ /**
34
+ * Returns the corresponding path of the file given a hex string
35
+ * @param hex - hex string
36
+ */
37
+ hexToDirPath(hex: string): Promise<string>;
38
+ hash(data: string): string;
39
+ }