@jbrowse/plugin-rdf 5.0.0-beta.8 → 5.0.0-beta.9

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.
@@ -1,8 +1,8 @@
1
1
  import { readConfObject } from '@jbrowse/core/configuration';
2
2
  import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
3
+ import { checkAbortSignal } from '@jbrowse/core/util/aborting';
3
4
  import { ObservableCreate } from '@jbrowse/core/util/rxjs';
4
5
  import SimpleFeature from '@jbrowse/core/util/simpleFeature';
5
- import { checkStopToken } from '@jbrowse/core/util/stopToken';
6
6
  // fill `{name}` placeholders from data; `{{name}}` is an escaped literal.
7
7
  // replaces the `string-template` dependency
8
8
  const templateRegex = /\{([0-9a-zA-Z_]+)\}/g;
@@ -51,14 +51,14 @@ export default class SPARQLAdapter extends BaseFeatureDataAdapter {
51
51
  observer.next(feature);
52
52
  }
53
53
  observer.complete();
54
- }, opts.stopToken);
54
+ }, opts.signal);
55
55
  }
56
56
  async querySparql(query, opts) {
57
57
  let additionalQueryParams = '';
58
58
  if (this.additionalQueryParams.length) {
59
59
  additionalQueryParams = `&${this.additionalQueryParams.join('&')}`;
60
60
  }
61
- checkStopToken(opts?.stopToken);
61
+ checkAbortSignal(opts?.signal);
62
62
  const url = `${this.endpoint}?query=${query}${additionalQueryParams}`;
63
63
  const response = await fetch(url, {
64
64
  headers: {
@@ -68,7 +68,7 @@ export default class SPARQLAdapter extends BaseFeatureDataAdapter {
68
68
  if (!response.ok) {
69
69
  throw new Error(`SPARQL query failed: ${response.status} ${response.statusText}`);
70
70
  }
71
- checkStopToken(opts?.stopToken);
71
+ checkAbortSignal(opts?.signal);
72
72
  return response.json();
73
73
  }
74
74
  resultsToRefNames(response) {
@@ -24,49 +24,36 @@ import type { Instance } from '@jbrowse/mobx-state-tree';
24
24
  * ```
25
25
  */
26
26
  declare const SPARQLAdapterConfigSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
27
- /**
28
- * #slot
29
- */
27
+ type: {
28
+ type: "string";
29
+ } & {
30
+ defaultValue: string;
31
+ };
30
32
  readonly endpoint: {
31
- readonly type: "fileLocation";
32
- readonly defaultValue: {
33
- readonly uri: "https://somesite.com/sparql";
34
- readonly locationType: "UriLocation";
35
- };
36
- readonly description: "URL of the SPARQL endpoint";
33
+ type: "fileLocation";
34
+ } & {
35
+ defaultValue: unknown;
37
36
  };
38
- /**
39
- * #slot
40
- */
41
37
  readonly queryTemplate: {
42
- readonly type: "text";
43
- readonly defaultValue: "";
44
- readonly description: "SPARQL query where {start} {end} and {refName} will get replaced for each call";
38
+ type: "text";
39
+ } & {
40
+ defaultValue: string;
45
41
  };
46
- /**
47
- * #slot
48
- */
49
42
  readonly refNamesQueryTemplate: {
50
- readonly type: "text";
51
- readonly defaultValue: "";
52
- readonly description: "SPARQL query that returns the possible refNames in a ?refName column";
43
+ type: "text";
44
+ } & {
45
+ defaultValue: string;
53
46
  };
54
- /**
55
- * #slot
56
- */
57
47
  readonly refNames: {
58
- readonly type: "stringArray";
59
- readonly defaultValue: readonly [];
60
- readonly description: "Possible refNames used by the SPARQL endpoint (ignored if \"refNamesQueryTemplate\" is provided)";
48
+ type: "stringArray";
49
+ } & {
50
+ defaultValue: unknown;
61
51
  };
62
- /**
63
- * #slot
64
- */
65
52
  readonly additionalQueryParams: {
66
- readonly type: "stringArray";
67
- readonly defaultValue: readonly [];
68
- readonly description: "Additional parameters to add to the query, e.g. \"format=JSON\"";
53
+ type: "stringArray";
54
+ } & {
55
+ defaultValue: unknown;
69
56
  };
70
- }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
57
+ }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined, true, import("@jbrowse/core/configuration").ConfigurationSchemaRequirement<Partial<Record<string, string[]>>, string>>>;
71
58
  export default SPARQLAdapterConfigSchema;
72
59
  export type SPARQLAdapterConfig = Instance<typeof SPARQLAdapterConfigSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-rdf",
3
- "version": "5.0.0-beta.8",
3
+ "version": "5.0.0-beta.9",
4
4
  "type": "module",
5
5
  "description": "JBrowse 2 RDF resources",
6
6
  "keywords": [
@@ -21,10 +21,10 @@
21
21
  "esm"
22
22
  ],
23
23
  "dependencies": {
24
- "@jbrowse/mobx-state-tree": "^6.5.1",
24
+ "@jbrowse/mobx-state-tree": "^6.5.2",
25
25
  "mobx": "^7.0.3",
26
26
  "rxjs": "^7.8.2",
27
- "@jbrowse/core": "^5.0.0-beta.8"
27
+ "@jbrowse/core": "^5.0.0-beta.9"
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public"