@apollo-annotation/shared 0.3.5 → 0.3.7
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/Changes/AddAssemblyAliasesChange.d.ts +16 -0
- package/dist/Changes/AddAssemblyAliasesChange.js +50 -0
- package/dist/Changes/AddAssemblyAliasesChange.js.map +1 -0
- package/dist/Changes/AddAssemblyAndFeaturesFromFileChange.d.ts +1 -1
- package/dist/Changes/AddAssemblyFromExternalChange.d.ts +1 -1
- package/dist/Changes/AddAssemblyFromFileChange.d.ts +1 -1
- package/dist/Changes/AddFeatureChange.d.ts +3 -2
- package/dist/Changes/AddFeatureChange.js +5 -25
- package/dist/Changes/AddFeatureChange.js.map +1 -1
- package/dist/Changes/AddFeaturesFromFileChange.d.ts +1 -1
- package/dist/Changes/AddRefSeqAliasesChange.d.ts +1 -1
- package/dist/Changes/DeleteAssemblyChange.d.ts +1 -1
- package/dist/Changes/DeleteFeatureChange.d.ts +12 -11
- package/dist/Changes/DeleteFeatureChange.js +37 -32
- package/dist/Changes/DeleteFeatureChange.js.map +1 -1
- package/dist/Changes/DeleteUserChange.d.ts +1 -1
- package/dist/Changes/FeatureAttributeChange.d.ts +3 -2
- package/dist/Changes/FeatureAttributeChange.js +14 -6
- package/dist/Changes/FeatureAttributeChange.js.map +1 -1
- package/dist/Changes/FromFileBaseChange.d.ts +3 -3
- package/dist/Changes/FromFileBaseChange.js.map +1 -1
- package/dist/Changes/ImportJBrowseConfigChange.d.ts +4 -1
- package/dist/Changes/ImportJBrowseConfigChange.js +17 -13
- package/dist/Changes/ImportJBrowseConfigChange.js.map +1 -1
- package/dist/Changes/LocationEndChange.d.ts +1 -1
- package/dist/Changes/LocationEndChange.js +40 -37
- package/dist/Changes/LocationEndChange.js.map +1 -1
- package/dist/Changes/LocationStartChange.d.ts +1 -1
- package/dist/Changes/LocationStartChange.js +40 -37
- package/dist/Changes/LocationStartChange.js.map +1 -1
- package/dist/Changes/MergeExonsChange.d.ts +30 -0
- package/dist/Changes/MergeExonsChange.js +130 -0
- package/dist/Changes/MergeExonsChange.js.map +1 -0
- package/dist/Changes/MergeTranscriptsChange.d.ts +36 -0
- package/dist/Changes/MergeTranscriptsChange.js +246 -0
- package/dist/Changes/MergeTranscriptsChange.js.map +1 -0
- package/dist/Changes/SplitExonChange.d.ts +33 -0
- package/dist/Changes/SplitExonChange.js +142 -0
- package/dist/Changes/SplitExonChange.js.map +1 -0
- package/dist/Changes/StrandChange.d.ts +1 -1
- package/dist/Changes/TypeChange.d.ts +1 -1
- package/dist/Changes/UndoMergeExonsChange.d.ts +27 -0
- package/dist/Changes/UndoMergeExonsChange.js +104 -0
- package/dist/Changes/UndoMergeExonsChange.js.map +1 -0
- package/dist/Changes/UndoMergeTranscriptsChange.d.ts +27 -0
- package/dist/Changes/UndoMergeTranscriptsChange.js +104 -0
- package/dist/Changes/UndoMergeTranscriptsChange.js.map +1 -0
- package/dist/Changes/UndoSplitExonChange.d.ts +32 -0
- package/dist/Changes/UndoSplitExonChange.js +111 -0
- package/dist/Changes/UndoSplitExonChange.js.map +1 -0
- package/dist/Changes/UserChange.d.ts +1 -1
- package/dist/Changes/index.d.ts +21 -0
- package/dist/Changes/index.js +21 -0
- package/dist/Changes/index.js.map +1 -1
- package/dist/Checks/CDSCheck.d.ts +1 -1
- package/dist/GFF3/annotationFeatureToGFF3.d.ts +2 -2
- package/dist/GFF3/annotationFeatureToGFF3.js +7 -1
- package/dist/GFF3/annotationFeatureToGFF3.js.map +1 -1
- package/dist/GFF3/annotationFeatureToGFF3.test.js +1 -1
- package/dist/GFF3/annotationFeatureToGFF3.test.js.map +1 -1
- package/dist/GFF3/gff3ToAnnotationFeature.d.ts +2 -2
- package/dist/GFF3/gff3ToAnnotationFeature.test.d.ts +1 -1
- package/dist/GFF3/gff3ToAnnotationFeature.test.js +1 -1
- package/dist/GFF3/gff3ToAnnotationFeature.test.js.map +1 -1
- package/dist/GFF3/gffReservedKeys.d.ts +7 -0
- package/dist/GFF3/gffReservedKeys.js +21 -1
- package/dist/GFF3/gffReservedKeys.js.map +1 -1
- package/dist/Messages.d.ts +2 -2
- package/dist/Operations/GetAssembliesOperation.d.ts +1 -1
- package/dist/Operations/GetFeaturesOperation.d.ts +1 -1
- package/dist/Validations/CoreValidation.d.ts +2 -2
- package/dist/Validations/CoreValidation.js +1 -1
- package/dist/Validations/CoreValidation.js.map +1 -1
- package/dist/Validations/ParentChildValidation.d.ts +5 -5
- package/dist/Validations/ParentChildValidation.js +3 -1
- package/dist/Validations/ParentChildValidation.js.map +1 -1
- package/dist/Validations/Validation.d.ts +5 -5
- package/dist/Validations/ValidationSet.d.ts +4 -4
- package/dist/Validations/ValidationSet.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/util.d.ts +2 -0
- package/dist/util.js +13 -0
- package/dist/util.js.map +1 -1
- package/package.json +4 -4
- package/src/Changes/AddAssemblyAliasesChange.ts +69 -0
- package/src/Changes/AddAssemblyAndFeaturesFromFileChange.ts +6 -6
- package/src/Changes/AddAssemblyFromExternalChange.ts +5 -5
- package/src/Changes/AddAssemblyFromFileChange.ts +5 -5
- package/src/Changes/AddFeatureChange.ts +11 -35
- package/src/Changes/AddFeaturesFromFileChange.ts +6 -6
- package/src/Changes/AddRefSeqAliasesChange.ts +6 -6
- package/src/Changes/DeleteAssemblyChange.ts +4 -4
- package/src/Changes/DeleteFeatureChange.ts +49 -43
- package/src/Changes/DeleteUserChange.ts +5 -5
- package/src/Changes/FeatureAttributeChange.ts +22 -13
- package/src/Changes/FromFileBaseChange.ts +6 -3
- package/src/Changes/ImportJBrowseConfigChange.ts +37 -22
- package/src/Changes/LocationEndChange.ts +47 -56
- package/src/Changes/LocationStartChange.ts +47 -56
- package/src/Changes/MergeExonsChange.ts +185 -0
- package/src/Changes/MergeTranscriptsChange.ts +379 -0
- package/src/Changes/SplitExonChange.ts +249 -0
- package/src/Changes/StrandChange.ts +6 -6
- package/src/Changes/TypeChange.ts +6 -6
- package/src/Changes/UndoMergeExonsChange.ts +149 -0
- package/src/Changes/UndoMergeTranscriptsChange.ts +153 -0
- package/src/Changes/UndoSplitExonChange.ts +174 -0
- package/src/Changes/UserChange.ts +5 -5
- package/src/Changes/index.ts +21 -0
- package/src/Checks/CDSCheck.ts +2 -2
- package/src/GFF3/annotationFeatureToGFF3.test.ts +4 -2
- package/src/GFF3/annotationFeatureToGFF3.ts +11 -5
- package/src/GFF3/gff3ToAnnotationFeature.test.ts +3 -3
- package/src/GFF3/gff3ToAnnotationFeature.ts +2 -2
- package/src/GFF3/gffReservedKeys.ts +25 -0
- package/src/Messages.ts +2 -2
- package/src/Operations/GetAssembliesOperation.ts +3 -3
- package/src/Operations/GetFeaturesOperation.ts +4 -4
- package/src/Validations/CoreValidation.ts +4 -3
- package/src/Validations/ParentChildValidation.ts +10 -8
- package/src/Validations/Validation.ts +5 -5
- package/src/Validations/ValidationSet.ts +8 -4
- package/src/util.ts +16 -0
- package/test_data/example01.json +3 -3
- package/test_data/example02.json +3 -3
- package/test_data/example04.json +3 -3
- package/test_data/gene_representations.gff3 +686 -1686
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AssemblySpecificChange, type Change, type ChangeOptions, type ClientDataStore, type LocalGFF3DataStore, type SerializedAssemblySpecificChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
|
+
export interface SerializedAssemblyAliasesChange extends SerializedAssemblySpecificChange {
|
|
3
|
+
typeName: 'AddAssemblyAliasesChange';
|
|
4
|
+
aliases: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare class AddAssemblyAliasesChange extends AssemblySpecificChange {
|
|
7
|
+
typeName: "AddAssemblyAliasesChange";
|
|
8
|
+
aliases: string[];
|
|
9
|
+
constructor(json: SerializedAssemblyAliasesChange, options?: ChangeOptions);
|
|
10
|
+
executeOnClient(clientDataStore: ClientDataStore): Promise<void>;
|
|
11
|
+
getInverse(): Change;
|
|
12
|
+
toJSON(): SerializedAssemblyAliasesChange;
|
|
13
|
+
executeOnServer(backend: ServerDataStore): Promise<void>;
|
|
14
|
+
executeOnLocalGFF3(_backend: LocalGFF3DataStore): Promise<unknown>;
|
|
15
|
+
get notification(): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddAssemblyAliasesChange = void 0;
|
|
4
|
+
const common_1 = require("@apollo-annotation/common");
|
|
5
|
+
const util_1 = require("@jbrowse/core/util");
|
|
6
|
+
class AddAssemblyAliasesChange extends common_1.AssemblySpecificChange {
|
|
7
|
+
typeName = 'AddAssemblyAliasesChange';
|
|
8
|
+
aliases;
|
|
9
|
+
constructor(json, options) {
|
|
10
|
+
super(json, options);
|
|
11
|
+
this.aliases = json.aliases;
|
|
12
|
+
}
|
|
13
|
+
executeOnClient(clientDataStore) {
|
|
14
|
+
const { assemblyManager } = (0, util_1.getSession)(clientDataStore);
|
|
15
|
+
const assembly = assemblyManager.get(this.assembly);
|
|
16
|
+
if (!assembly) {
|
|
17
|
+
throw new Error(`assembly ${this.assembly} not found`);
|
|
18
|
+
}
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
20
|
+
assembly.configuration.aliases.set(this.aliases);
|
|
21
|
+
return Promise.resolve();
|
|
22
|
+
}
|
|
23
|
+
getInverse() {
|
|
24
|
+
throw new Error('Method not implemented.');
|
|
25
|
+
}
|
|
26
|
+
toJSON() {
|
|
27
|
+
const { assembly, aliases, typeName } = this;
|
|
28
|
+
return { assembly, typeName, aliases };
|
|
29
|
+
}
|
|
30
|
+
async executeOnServer(backend) {
|
|
31
|
+
const { assemblyModel } = backend;
|
|
32
|
+
const { assembly, logger, aliases } = this;
|
|
33
|
+
logger.debug?.(`Updating assembly aliases for assembly: ${assembly}, aliases: ${JSON.stringify(aliases)}`);
|
|
34
|
+
const asm = await assemblyModel.findById(assembly);
|
|
35
|
+
if (!asm) {
|
|
36
|
+
throw new Error(`Assembly with ID ${assembly} not found`);
|
|
37
|
+
}
|
|
38
|
+
asm.aliases = aliases;
|
|
39
|
+
await asm.save();
|
|
40
|
+
}
|
|
41
|
+
executeOnLocalGFF3(_backend) {
|
|
42
|
+
throw new Error('Method not implemented.');
|
|
43
|
+
}
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/class-literal-property-style
|
|
45
|
+
get notification() {
|
|
46
|
+
return 'Assembly aliases have been added.';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.AddAssemblyAliasesChange = AddAssemblyAliasesChange;
|
|
50
|
+
//# sourceMappingURL=AddAssemblyAliasesChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddAssemblyAliasesChange.js","sourceRoot":"","sources":["../../src/Changes/AddAssemblyAliasesChange.ts"],"names":[],"mappings":";;;AAAA,sDAQkC;AAClC,6CAA+C;AAQ/C,MAAa,wBAAyB,SAAQ,+BAAsB;IAClE,QAAQ,GAAG,0BAAmC,CAAA;IAC9C,OAAO,CAAU;IAEjB,YAAY,IAAqC,EAAE,OAAuB;QACxE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;IAC7B,CAAC;IAED,eAAe,CAAC,eAAgC;QAC9C,MAAM,EAAE,eAAe,EAAE,GAAG,IAAA,iBAAU,EAAC,eAAe,CAAC,CAAA;QACvD,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACnD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,CAAC,QAAQ,YAAY,CAAC,CAAA;QACxD,CAAC;QACD,yGAAyG;QACzG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAChD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;IAED,UAAU;QACR,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;IAC5C,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;QAC5C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;IACxC,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAAwB;QAC5C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAA;QACjC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QAC1C,MAAM,CAAC,KAAK,EAAE,CACZ,2CAA2C,QAAQ,cAAc,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAC3F,CAAA;QACD,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAClD,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,oBAAoB,QAAQ,YAAY,CAAC,CAAA;QAC3D,CAAC;QACD,GAAG,CAAC,OAAO,GAAG,OAAO,CAAA;QACrB,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;IAClB,CAAC;IAED,kBAAkB,CAAC,QAA4B;QAC7C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAA;IAC5C,CAAC;IAED,2EAA2E;IAC3E,IAAI,YAAY;QACd,OAAO,mCAAmC,CAAA;IAC5C,CAAC;CACF;AAnDD,4DAmDC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeOptions, ClientDataStore, LocalGFF3DataStore, SerializedAssemblySpecificChange, ServerDataStore } from '@apollo-annotation/common';
|
|
1
|
+
import { type ChangeOptions, type ClientDataStore, type LocalGFF3DataStore, type SerializedAssemblySpecificChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
2
|
import { FromFileBaseChange } from './FromFileBaseChange';
|
|
3
3
|
export interface SerializedAddAssemblyAndFeaturesFromFileChangeBase extends SerializedAssemblySpecificChange {
|
|
4
4
|
typeName: 'AddAssemblyAndFeaturesFromFileChange';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssemblySpecificChange, ChangeOptions, ClientDataStore, LocalGFF3DataStore, SerializedAssemblySpecificChange, ServerDataStore } from '@apollo-annotation/common';
|
|
1
|
+
import { AssemblySpecificChange, type ChangeOptions, type ClientDataStore, type LocalGFF3DataStore, type SerializedAssemblySpecificChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
2
|
export interface SerializedAddAssemblyFromExternalChangeBase extends SerializedAssemblySpecificChange {
|
|
3
3
|
typeName: 'AddAssemblyFromExternalChange';
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeOptions, ClientDataStore, LocalGFF3DataStore, SerializedAssemblySpecificChange, ServerDataStore } from '@apollo-annotation/common';
|
|
1
|
+
import { type ChangeOptions, type ClientDataStore, type LocalGFF3DataStore, type SerializedAssemblySpecificChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
2
|
import { FromFileBaseChange } from './FromFileBaseChange';
|
|
3
3
|
export interface SerializedAddAssemblyFromFileChangeBase extends SerializedAssemblySpecificChange {
|
|
4
4
|
typeName: 'AddAssemblyFromFileChange';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChangeOptions, ClientDataStore, FeatureChange, LocalGFF3DataStore, SerializedFeatureChange, ServerDataStore } from '@apollo-annotation/common';
|
|
2
|
-
import { AnnotationFeatureSnapshot } from '@apollo-annotation/mst';
|
|
1
|
+
import { type ChangeOptions, type ClientDataStore, FeatureChange, type LocalGFF3DataStore, type SerializedFeatureChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
|
+
import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst';
|
|
3
3
|
import { DeleteFeatureChange } from './DeleteFeatureChange';
|
|
4
4
|
interface SerializedAddFeatureChangeBase extends SerializedFeatureChange {
|
|
5
5
|
typeName: 'AddFeatureChange';
|
|
@@ -20,6 +20,7 @@ export declare class AddFeatureChange extends FeatureChange {
|
|
|
20
20
|
typeName: "AddFeatureChange";
|
|
21
21
|
changes: AddFeatureChangeDetails[];
|
|
22
22
|
constructor(json: SerializedAddFeatureChange, options?: ChangeOptions);
|
|
23
|
+
get notification(): string;
|
|
23
24
|
toJSON(): SerializedAddFeatureChange;
|
|
24
25
|
/**
|
|
25
26
|
* Applies the required change to database
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AddFeatureChange = void 0;
|
|
4
4
|
exports.isAddFeatureChange = isAddFeatureChange;
|
|
5
5
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
7
6
|
/* eslint-disable @typescript-eslint/require-await */
|
|
8
7
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
9
8
|
const common_1 = require("@apollo-annotation/common");
|
|
@@ -15,6 +14,10 @@ class AddFeatureChange extends common_1.FeatureChange {
|
|
|
15
14
|
super(json, options);
|
|
16
15
|
this.changes = 'changes' in json ? json.changes : [json];
|
|
17
16
|
}
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/class-literal-property-style
|
|
18
|
+
get notification() {
|
|
19
|
+
return 'Feature added successfully';
|
|
20
|
+
}
|
|
18
21
|
toJSON() {
|
|
19
22
|
const { assembly, changedIds, changes, typeName } = this;
|
|
20
23
|
if (changes.length === 1) {
|
|
@@ -83,30 +86,7 @@ class AddFeatureChange extends common_1.FeatureChange {
|
|
|
83
86
|
if (!parentFeature) {
|
|
84
87
|
throw new Error(`Could not find feature with ID "${parentFeatureId}" in feature "${topLevelFeature._id}"`);
|
|
85
88
|
}
|
|
86
|
-
|
|
87
|
-
parentFeature.children = new Map();
|
|
88
|
-
}
|
|
89
|
-
if (!parentFeature.attributes?._id) {
|
|
90
|
-
let { attributes } = parentFeature;
|
|
91
|
-
if (!attributes) {
|
|
92
|
-
attributes = {};
|
|
93
|
-
}
|
|
94
|
-
attributes = {
|
|
95
|
-
_id: [parentFeature._id.toString()],
|
|
96
|
-
// eslint-disable-next-line unicorn/prefer-structured-clone
|
|
97
|
-
...JSON.parse(JSON.stringify(attributes)),
|
|
98
|
-
};
|
|
99
|
-
parentFeature.attributes = attributes;
|
|
100
|
-
}
|
|
101
|
-
parentFeature.children.set(_id, {
|
|
102
|
-
allIds: [],
|
|
103
|
-
...addedFeature,
|
|
104
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
105
|
-
// @ts-expect-error
|
|
106
|
-
_id,
|
|
107
|
-
});
|
|
108
|
-
// Child features should be sorted for click and drag of gene glyphs to work properly
|
|
109
|
-
parentFeature.children = new Map([...parentFeature.children.entries()].sort((a, b) => a[1].min - b[1].min));
|
|
89
|
+
this.addChild(parentFeature, addedFeature);
|
|
110
90
|
const childIds = this.getChildFeatureIds(addedFeature);
|
|
111
91
|
topLevelFeature.allIds.push(_id, ...childIds);
|
|
112
92
|
await topLevelFeature.save();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddFeatureChange.js","sourceRoot":"","sources":["../../src/Changes/AddFeatureChange.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AddFeatureChange.js","sourceRoot":"","sources":["../../src/Changes/AddFeatureChange.ts"],"names":[],"mappings":";;;AA4MA,gDAIC;AAhND,qEAAqE;AACrE,qDAAqD;AACrD,gEAAgE;AAChE,sDAOkC;AAGlC,+DAA2D;AA0B3D,MAAa,gBAAiB,SAAQ,sBAAa;IACjD,QAAQ,GAAG,kBAA2B,CAAA;IACtC,OAAO,CAA2B;IAElC,YAAY,IAAgC,EAAE,OAAuB;QACnE,KAAK,CAAC,IAAI,EAAE,OAAO,CA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C;YACvE,cAAc,EAAE,gBAAgB,CAAC,YAAY;YAC7C,eAAe,EAAE,gBAAgB,CAAC,eAAe;SAClD,CAAC,CAAC,CAAA;QAEH,OAAO,IAAI,yCAAmB,CAC5B;YACE,UAAU,EAAE,iBAAiB;YAC7B,QAAQ,EAAE,qBAAqB;YAC/B,OAAO,EAAE,cAAc;YACvB,QAAQ;SACT,EACD,EAAE,MAAM,EAAE,CACX,CAAA;IACH,CAAC;CACF;AAnKD,4CAmKC;AAED,SAAgB,kBAAkB,CAChC,MAAe;IAEf,OAAQ,MAA2B,CAAC,QAAQ,KAAK,kBAAkB,CAAA;AACrE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeOptions, ClientDataStore, LocalGFF3DataStore, SerializedAssemblySpecificChange, ServerDataStore } from '@apollo-annotation/common';
|
|
1
|
+
import { type ChangeOptions, type ClientDataStore, type LocalGFF3DataStore, type SerializedAssemblySpecificChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
2
|
import { FromFileBaseChange } from './FromFileBaseChange';
|
|
3
3
|
export interface SerializedAddFeaturesFromFileChangeBase extends SerializedAssemblySpecificChange {
|
|
4
4
|
typeName: 'AddFeaturesFromFileChange';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssemblySpecificChange, Change, ChangeOptions, ClientDataStore, LocalGFF3DataStore, SerializedAssemblySpecificChange, ServerDataStore } from '@apollo-annotation/common';
|
|
1
|
+
import { AssemblySpecificChange, type Change, type ChangeOptions, type ClientDataStore, type LocalGFF3DataStore, type SerializedAssemblySpecificChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
2
|
export interface SerializedRefSeqAliases {
|
|
3
3
|
refName: string;
|
|
4
4
|
aliases: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssemblySpecificChange, ClientDataStore, LocalGFF3DataStore, SerializedAssemblySpecificChange, ServerDataStore } from '@apollo-annotation/common';
|
|
1
|
+
import { AssemblySpecificChange, type ClientDataStore, type LocalGFF3DataStore, type SerializedAssemblySpecificChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
2
|
export interface SerializedDeleteAssemblyChange extends SerializedAssemblySpecificChange {
|
|
3
3
|
typeName: 'DeleteAssemblyChange';
|
|
4
4
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChangeOptions, ClientDataStore, FeatureChange, LocalGFF3DataStore, SerializedFeatureChange, ServerDataStore } from '@apollo-annotation/common';
|
|
2
|
-
import { AnnotationFeatureSnapshot } from '@apollo-annotation/mst';
|
|
3
|
-
import { Feature } from '@apollo-annotation/schemas';
|
|
1
|
+
import { type ChangeOptions, type ClientDataStore, FeatureChange, type LocalGFF3DataStore, type SerializedFeatureChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
|
+
import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst';
|
|
3
|
+
import { type Feature } from '@apollo-annotation/schemas';
|
|
4
4
|
import { AddFeatureChange } from './AddFeatureChange';
|
|
5
5
|
interface SerializedDeleteFeatureChangeBase extends SerializedFeatureChange {
|
|
6
6
|
typeName: 'DeleteFeatureChange';
|
|
@@ -19,6 +19,7 @@ export declare class DeleteFeatureChange extends FeatureChange {
|
|
|
19
19
|
typeName: "DeleteFeatureChange";
|
|
20
20
|
changes: DeleteFeatureChangeDetails[];
|
|
21
21
|
constructor(json: SerializedDeleteFeatureChange, options?: ChangeOptions);
|
|
22
|
+
get notification(): string;
|
|
22
23
|
toJSON(): SerializedDeleteFeatureChange;
|
|
23
24
|
/**
|
|
24
25
|
* Applies the required change to database
|
|
@@ -26,17 +27,17 @@ export declare class DeleteFeatureChange extends FeatureChange {
|
|
|
26
27
|
* @returns
|
|
27
28
|
*/
|
|
28
29
|
executeOnServer(backend: ServerDataStore): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Delete feature's subfeatures that match an ID and return the IDs of any
|
|
31
|
-
* sub-subfeatures that were deleted
|
|
32
|
-
* @param feature -
|
|
33
|
-
* @param featureIdToDelete -
|
|
34
|
-
* @returns - list of deleted feature IDs
|
|
35
|
-
*/
|
|
36
|
-
findAndDeleteChildFeature(feature: Feature, featureIdToDelete: string): string[];
|
|
37
30
|
executeOnLocalGFF3(_backend: LocalGFF3DataStore): Promise<void>;
|
|
38
31
|
executeOnClient(dataStore: ClientDataStore): Promise<void>;
|
|
39
32
|
getInverse(): AddFeatureChange;
|
|
40
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Delete feature's subfeatures that match an ID and return the IDs of any
|
|
36
|
+
* sub-subfeatures that were deleted
|
|
37
|
+
* @param feature -
|
|
38
|
+
* @param featureIdToDelete -
|
|
39
|
+
* @returns - list of deleted feature IDs
|
|
40
|
+
*/
|
|
41
|
+
export declare function findAndDeleteChildFeature(feature: Feature, featureIdToDelete: string, change: FeatureChange): string[];
|
|
41
42
|
export declare function isDeleteFeatureChange(change: unknown): change is DeleteFeatureChange;
|
|
42
43
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeleteFeatureChange = void 0;
|
|
4
|
+
exports.findAndDeleteChildFeature = findAndDeleteChildFeature;
|
|
4
5
|
exports.isDeleteFeatureChange = isDeleteFeatureChange;
|
|
5
6
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
6
7
|
/* eslint-disable @typescript-eslint/require-await */
|
|
@@ -14,6 +15,10 @@ class DeleteFeatureChange extends common_1.FeatureChange {
|
|
|
14
15
|
super(json, options);
|
|
15
16
|
this.changes = 'changes' in json ? json.changes : [json];
|
|
16
17
|
}
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/class-literal-property-style
|
|
19
|
+
get notification() {
|
|
20
|
+
return 'Feature deleted successfully';
|
|
21
|
+
}
|
|
17
22
|
toJSON() {
|
|
18
23
|
const { assembly, changedIds, changes, typeName } = this;
|
|
19
24
|
if (changes.length === 1) {
|
|
@@ -52,7 +57,7 @@ class DeleteFeatureChange extends common_1.FeatureChange {
|
|
|
52
57
|
logger.debug?.(`Feature "${deletedFeature._id}" deleted from document "${featureDoc._id}". Whole document deleted.`);
|
|
53
58
|
continue;
|
|
54
59
|
}
|
|
55
|
-
const deletedIds =
|
|
60
|
+
const deletedIds = findAndDeleteChildFeature(featureDoc, deletedFeature._id, this);
|
|
56
61
|
deletedIds.push(deletedFeature._id);
|
|
57
62
|
featureDoc.allIds = featureDoc.allIds.filter((id) => !deletedIds.includes(id));
|
|
58
63
|
// Save updated document in Mongo
|
|
@@ -67,34 +72,6 @@ class DeleteFeatureChange extends common_1.FeatureChange {
|
|
|
67
72
|
logger.debug?.(`Feature "${deletedFeature._id}" deleted from document "${featureDoc._id}"`);
|
|
68
73
|
}
|
|
69
74
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Delete feature's subfeatures that match an ID and return the IDs of any
|
|
72
|
-
* sub-subfeatures that were deleted
|
|
73
|
-
* @param feature -
|
|
74
|
-
* @param featureIdToDelete -
|
|
75
|
-
* @returns - list of deleted feature IDs
|
|
76
|
-
*/
|
|
77
|
-
findAndDeleteChildFeature(feature, featureIdToDelete) {
|
|
78
|
-
if (!feature.children) {
|
|
79
|
-
throw new Error(`Feature ${feature._id} has no children`);
|
|
80
|
-
}
|
|
81
|
-
const { _id, children } = feature;
|
|
82
|
-
const child = children.get(featureIdToDelete);
|
|
83
|
-
if (child) {
|
|
84
|
-
const deletedIds = this.getChildFeatureIds(child);
|
|
85
|
-
children.delete(featureIdToDelete);
|
|
86
|
-
return deletedIds;
|
|
87
|
-
}
|
|
88
|
-
for (const [, childFeature] of children) {
|
|
89
|
-
try {
|
|
90
|
-
return this.findAndDeleteChildFeature(childFeature, featureIdToDelete);
|
|
91
|
-
}
|
|
92
|
-
catch {
|
|
93
|
-
// pass
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
throw new Error(`Feature "${featureIdToDelete}" not found in ${_id}`);
|
|
97
|
-
}
|
|
98
75
|
async executeOnLocalGFF3(_backend) {
|
|
99
76
|
throw new Error('executeOnLocalGFF3 not implemented');
|
|
100
77
|
}
|
|
@@ -123,9 +100,9 @@ class DeleteFeatureChange extends common_1.FeatureChange {
|
|
|
123
100
|
const inverseChangedIds = [...changedIds].reverse();
|
|
124
101
|
const inverseChanges = [...changes]
|
|
125
102
|
.reverse()
|
|
126
|
-
.map((
|
|
127
|
-
addedFeature:
|
|
128
|
-
parentFeatureId:
|
|
103
|
+
.map((deleteFeatureChange) => ({
|
|
104
|
+
addedFeature: deleteFeatureChange.deletedFeature,
|
|
105
|
+
parentFeatureId: deleteFeatureChange.parentFeatureId,
|
|
129
106
|
}));
|
|
130
107
|
logger.debug?.(`INVERSE CHANGE '${JSON.stringify(inverseChanges)}'`);
|
|
131
108
|
return new AddFeatureChange_1.AddFeatureChange({
|
|
@@ -137,6 +114,34 @@ class DeleteFeatureChange extends common_1.FeatureChange {
|
|
|
137
114
|
}
|
|
138
115
|
}
|
|
139
116
|
exports.DeleteFeatureChange = DeleteFeatureChange;
|
|
117
|
+
/**
|
|
118
|
+
* Delete feature's subfeatures that match an ID and return the IDs of any
|
|
119
|
+
* sub-subfeatures that were deleted
|
|
120
|
+
* @param feature -
|
|
121
|
+
* @param featureIdToDelete -
|
|
122
|
+
* @returns - list of deleted feature IDs
|
|
123
|
+
*/
|
|
124
|
+
function findAndDeleteChildFeature(feature, featureIdToDelete, change) {
|
|
125
|
+
if (!feature.children) {
|
|
126
|
+
throw new Error(`Feature ${feature._id} has no children`);
|
|
127
|
+
}
|
|
128
|
+
const { _id, children } = feature;
|
|
129
|
+
const child = children.get(featureIdToDelete);
|
|
130
|
+
if (child) {
|
|
131
|
+
const deletedIds = change.getChildFeatureIds(child);
|
|
132
|
+
children.delete(featureIdToDelete);
|
|
133
|
+
return deletedIds;
|
|
134
|
+
}
|
|
135
|
+
for (const [, childFeature] of children) {
|
|
136
|
+
try {
|
|
137
|
+
return findAndDeleteChildFeature(childFeature, featureIdToDelete, change);
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
// pass
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
throw new Error(`Feature "${featureIdToDelete}" not found in ${_id}`);
|
|
144
|
+
}
|
|
140
145
|
function isDeleteFeatureChange(change) {
|
|
141
146
|
return change.typeName === 'DeleteFeatureChange';
|
|
142
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteFeatureChange.js","sourceRoot":"","sources":["../../src/Changes/DeleteFeatureChange.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"DeleteFeatureChange.js","sourceRoot":"","sources":["../../src/Changes/DeleteFeatureChange.ts"],"names":[],"mappings":";;;AA+KA,8DAwBC;AAED,sDAIC;AA7MD,qEAAqE;AACrE,qDAAqD;AACrD,gEAAgE;AAChE,sDAOkC;AAIlC,yDAAqD;AAwBrD,MAAa,mBAAoB,SAAQ,sBAAa;IACpD,QAAQ,GAAG,qBAA8B,CAAA;IACzC,OAAO,CAA8B;IAErC,YAAY,IAAmC,EAAE,OAAuB;QACtE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAC1D,CAAC;IACD,2EAA2E;IAC3E,IAAI,YAAY;QACd,OAAO,8BAA8B,CAAA;IACvC,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;QACxD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC,GAAG,OAAO,CAAA;YACrD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAA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EAAE,GAAG,OAAO,CAAA;IACjC,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IAC7C,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,UAAU,GAAG,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;QACnD,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAA;QAClC,OAAO,UAAU,CAAA;IACnB,CAAC;IACD,KAAK,MAAM,CAAC,EAAE,YAAY,CAAC,IAAI,QAAQ,EAAE,CAAC;QACxC,IAAI,CAAC;YACH,OAAO,yBAAyB,CAAC,YAAY,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAA;QAC3E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;QACT,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,YAAY,iBAAiB,kBAAkB,GAAG,EAAE,CAAC,CAAA;AACvE,CAAC;AAED,SAAgB,qBAAqB,CACnC,MAAe;IAEf,OAAQ,MAA8B,CAAC,QAAQ,KAAK,qBAAqB,CAAA;AAC3E,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Change, ChangeOptions, ClientDataStore, LocalGFF3DataStore, SerializedChange, ServerDataStore } from '@apollo-annotation/common';
|
|
1
|
+
import { Change, type ChangeOptions, type ClientDataStore, type LocalGFF3DataStore, type SerializedChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
2
|
export interface SerializedDeleteUserChangeBase extends SerializedChange {
|
|
3
3
|
typeName: 'DeleteUserChange';
|
|
4
4
|
userId: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ChangeOptions, ClientDataStore, FeatureChange, LocalGFF3DataStore, SerializedFeatureChange, ServerDataStore } from '@apollo-annotation/common';
|
|
1
|
+
import { type ChangeOptions, type ClientDataStore, FeatureChange, type LocalGFF3DataStore, type SerializedFeatureChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
2
|
interface SerializedFeatureAttributeChangeBase extends SerializedFeatureChange {
|
|
3
3
|
typeName: 'FeatureAttributeChange';
|
|
4
4
|
}
|
|
5
5
|
export interface FeatureAttributeChangeDetails {
|
|
6
6
|
featureId: string;
|
|
7
|
-
|
|
7
|
+
oldAttributes: Record<string, string[]>;
|
|
8
|
+
newAttributes: Record<string, string[]>;
|
|
8
9
|
}
|
|
9
10
|
interface SerializedFeatureAttributeChangeSingle extends SerializedFeatureAttributeChangeBase, FeatureAttributeChangeDetails {
|
|
10
11
|
}
|
|
@@ -16,8 +16,15 @@ class FeatureAttributeChange extends common_1.FeatureChange {
|
|
|
16
16
|
toJSON() {
|
|
17
17
|
const { assembly, changedIds, changes, typeName } = this;
|
|
18
18
|
if (changes.length === 1) {
|
|
19
|
-
const [{
|
|
20
|
-
return {
|
|
19
|
+
const [{ oldAttributes, newAttributes, featureId }] = changes;
|
|
20
|
+
return {
|
|
21
|
+
typeName,
|
|
22
|
+
changedIds,
|
|
23
|
+
assembly,
|
|
24
|
+
featureId,
|
|
25
|
+
oldAttributes,
|
|
26
|
+
newAttributes,
|
|
27
|
+
};
|
|
21
28
|
}
|
|
22
29
|
return { typeName, changedIds, assembly, changes };
|
|
23
30
|
}
|
|
@@ -56,9 +63,9 @@ class FeatureAttributeChange extends common_1.FeatureChange {
|
|
|
56
63
|
}
|
|
57
64
|
// Let's update objects
|
|
58
65
|
for (const [idx, change] of changes.entries()) {
|
|
59
|
-
const {
|
|
66
|
+
const { newAttributes } = change;
|
|
60
67
|
const { feature, topLevelFeature } = featuresForChanges[idx];
|
|
61
|
-
feature.attributes =
|
|
68
|
+
feature.attributes = newAttributes;
|
|
62
69
|
if (topLevelFeature._id.equals(feature._id)) {
|
|
63
70
|
topLevelFeature.markModified('attributes'); // Mark as modified. Without this save() -method is not updating data in database
|
|
64
71
|
}
|
|
@@ -87,7 +94,7 @@ class FeatureAttributeChange extends common_1.FeatureChange {
|
|
|
87
94
|
if (!feature) {
|
|
88
95
|
throw new Error(`Could not find feature with identifier "${changedId}"`);
|
|
89
96
|
}
|
|
90
|
-
feature.setAttributes(new Map(Object.entries(this.changes[idx].
|
|
97
|
+
feature.setAttributes(new Map(Object.entries(this.changes[idx].newAttributes)));
|
|
91
98
|
}
|
|
92
99
|
}
|
|
93
100
|
getInverse() {
|
|
@@ -95,7 +102,8 @@ class FeatureAttributeChange extends common_1.FeatureChange {
|
|
|
95
102
|
const inverseChangedIds = [...changedIds].reverse();
|
|
96
103
|
const inverseChanges = [...changes].reverse().map((oneChange) => ({
|
|
97
104
|
featureId: oneChange.featureId,
|
|
98
|
-
|
|
105
|
+
oldAttributes: oneChange.newAttributes,
|
|
106
|
+
newAttributes: oneChange.oldAttributes,
|
|
99
107
|
}));
|
|
100
108
|
return new FeatureAttributeChange({
|
|
101
109
|
changedIds: inverseChangedIds,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureAttributeChange.js","sourceRoot":"","sources":["../../src/Changes/FeatureAttributeChange.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"FeatureAttributeChange.js","sourceRoot":"","sources":["../../src/Changes/FeatureAttributeChange.ts"],"names":[],"mappings":";;;AAsKA,4DAMC;AA5KD,qEAAqE;AACrE,qDAAqD;AACrD,gEAAgE;AAChE,sDAOkC;AA0BlC,MAAa,sBAAuB,SAAQ,sBAAa;IACvD,QAAQ,GAAG,wBAAiC,CAAA;IAC5C,OAAO,CAAiC;IAExC,YAAY,IAAsC,EAAE,OAAuB;QACzE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAC1D,CAAC;IAED,MAAM;QACJ,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;QACxD,IAAI,OAAO,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;IACH,CAAC;CACF;AAhID,wDAgIC;AAED,SAAgB,wBAAwB,CACtC,MAAe;IAEf,OAAO,CACJ,MAAiC,CAAC,QAAQ,KAAK,wBAAwB,CACzE,CAAA;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AssemblySpecificChange, ServerDataStore } from '@apollo-annotation/common';
|
|
2
|
-
import { FileDocument } from '@apollo-annotation/schemas';
|
|
3
|
-
import { GFF3Feature } from '@gmod/gff';
|
|
1
|
+
import { AssemblySpecificChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
|
+
import { type FileDocument } from '@apollo-annotation/schemas';
|
|
3
|
+
import { type GFF3Feature } from '@gmod/gff';
|
|
4
4
|
export declare abstract class FromFileBaseChange extends AssemblySpecificChange {
|
|
5
5
|
addRefSeqIntoDb(fileDoc: FileDocument, assembly: string, backend: ServerDataStore): Promise<void>;
|
|
6
6
|
private refSeqCache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromFileBaseChange.js","sourceRoot":"","sources":["../../src/Changes/FromFileBaseChange.ts"],"names":[],"mappings":";;;AAAA,8DAA8D;AAC9D,4DAA4D;AAC5D,+DAA+D;AAC/D,sDAAsD;AACtD,0DAA0D;AAC1D,sDAGkC;
|
|
1
|
+
{"version":3,"file":"FromFileBaseChange.js","sourceRoot":"","sources":["../../src/Changes/FromFileBaseChange.ts"],"names":[],"mappings":";;;AAAA,8DAA8D;AAC9D,4DAA4D;AAC5D,+DAA+D;AAC/D,sDAAsD;AACtD,0DAA0D;AAC1D,sDAGkC;AAOlC,kCAAiD;AAEjD,MAAsB,kBAAmB,SAAQ,+BAAsB;IACrE,KAAK,CAAC,eAAe,CACnB,OAAqB,EACrB,QAAgB,EAChB,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QACvB,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;QAC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SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,qCAAqC,QAAQ,iBAAiB,OAAO,aAAa,CACnF,CAAA;QACH,CAAC;QACD,wCAAwC;QACxC,MAAM,UAAU,GAAa,EAAE,CAAA;QAE/B,MAAM,UAAU,GAAG,IAAA,8BAAuB,EACxC,WAAW,EACX,SAAS,CAAC,GAAG,EACb,UAAU,CACX,CAAA;QAED,iBAAiB;QACjB,iGAAiG;QACjG,MAAM,YAAY,CAAC,MAAM,CAAC;YACxB,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE;SACxD,CAAC,CAAA;IACJ,CAAC;CACF;AA9MD,gDA8MC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Change, ChangeOptions, ClientDataStore, LocalGFF3DataStore, ServerDataStore } from '@apollo-annotation/common';
|
|
1
|
+
import { Change, type ChangeOptions, type ClientDataStore, type LocalGFF3DataStore, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
2
|
interface JBrowseAssembly {
|
|
3
3
|
sequence: {
|
|
4
4
|
adapter: {
|
|
@@ -18,6 +18,9 @@ interface JBrowseInternetAccount {
|
|
|
18
18
|
}
|
|
19
19
|
export interface JBrowseConfig {
|
|
20
20
|
assemblies?: JBrowseAssembly[];
|
|
21
|
+
configuration?: {
|
|
22
|
+
ApolloPlugin?: Record<string, unknown>;
|
|
23
|
+
};
|
|
21
24
|
tracks?: JBrowseTrack[];
|
|
22
25
|
plugins?: JBrowsePlugin[];
|
|
23
26
|
internetAccounts?: JBrowseInternetAccount[];
|
|
@@ -5,23 +5,27 @@ exports.filterJBrowseConfig = filterJBrowseConfig;
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/require-await */
|
|
6
6
|
const common_1 = require("@apollo-annotation/common");
|
|
7
7
|
function filterJBrowseConfig(config) {
|
|
8
|
-
const { __v, _id, assemblies, internetAccounts, plugins, tracks, ...rest } = config;
|
|
9
|
-
|
|
10
|
-
const filteredTracks = tracks?.filter((t) => t.type !== 'ApolloTrack');
|
|
11
|
-
const filteredPlugins = plugins?.filter((p) => p.name !== 'Apollo');
|
|
12
|
-
const filteredInternetAccounts = internetAccounts?.filter((i) => i.type !== 'ApolloInternetAccount');
|
|
8
|
+
const { __v, _id, assemblies, configuration, internetAccounts, plugins, tracks, ...rest } = config;
|
|
9
|
+
// Need to make sure that configuration.ApolloPlugin.hasRole isn't set
|
|
13
10
|
const filteredConfig = rest;
|
|
14
|
-
if (
|
|
15
|
-
filteredConfig.assemblies =
|
|
11
|
+
if (assemblies) {
|
|
12
|
+
filteredConfig.assemblies = assemblies.filter((a) => a.sequence.adapter.type !== 'ApolloSequenceAdapter');
|
|
16
13
|
}
|
|
17
|
-
if (
|
|
18
|
-
|
|
14
|
+
if (configuration?.ApolloPlugin?.hasRole) {
|
|
15
|
+
const { hasRole, ...apolloPluginRest } = configuration.ApolloPlugin;
|
|
16
|
+
filteredConfig.configuration = {
|
|
17
|
+
...configuration,
|
|
18
|
+
ApolloPlugin: apolloPluginRest,
|
|
19
|
+
};
|
|
19
20
|
}
|
|
20
|
-
if (
|
|
21
|
-
filteredConfig.
|
|
21
|
+
if (internetAccounts) {
|
|
22
|
+
filteredConfig.internetAccounts = internetAccounts.filter((i) => i.type !== 'ApolloInternetAccount');
|
|
22
23
|
}
|
|
23
|
-
if (
|
|
24
|
-
filteredConfig.
|
|
24
|
+
if (plugins) {
|
|
25
|
+
filteredConfig.plugins = plugins.filter((p) => p.name !== 'Apollo');
|
|
26
|
+
}
|
|
27
|
+
if (tracks) {
|
|
28
|
+
filteredConfig.trackss = tracks.filter((t) => t.type !== 'ApolloTrack');
|
|
25
29
|
}
|
|
26
30
|
return filteredConfig;
|
|
27
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportJBrowseConfigChange.js","sourceRoot":"","sources":["../../src/Changes/ImportJBrowseConfigChange.ts"],"names":[],"mappings":";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ACR,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAA;QAC3D,OAAO,IAAI,yBAAyB,CAClC;YACE,QAAQ,EAAE,2BAA2B;YACrC,gBAAgB,EAAE,gBAAgB;YAClC,gBAAgB,EAAE,gBAAgB;SACnC,EACD,EAAE,MAAM,EAAE,CACX,CAAA;IACH,CAAC;CACF;AAjDD,8DAiDC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeOptions, ClientDataStore, FeatureChange, LocalGFF3DataStore, SerializedFeatureChange, ServerDataStore } from '@apollo-annotation/common';
|
|
1
|
+
import { type ChangeOptions, type ClientDataStore, FeatureChange, type LocalGFF3DataStore, type SerializedFeatureChange, type ServerDataStore } from '@apollo-annotation/common';
|
|
2
2
|
interface SerializedLocationEndChangeBase extends SerializedFeatureChange {
|
|
3
3
|
typeName: 'LocationEndChange';
|
|
4
4
|
}
|