@apollo-annotation/common 0.3.10 → 0.3.12

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 (58) hide show
  1. package/dist/ApolloPlugin.d.ts +1 -0
  2. package/dist/ApolloPlugin.d.ts.map +1 -0
  3. package/dist/ApolloPlugin.js +2 -7
  4. package/dist/ApolloPlugin.js.map +1 -1
  5. package/dist/AssemblySpecificChange.d.ts +5 -3
  6. package/dist/AssemblySpecificChange.d.ts.map +1 -0
  7. package/dist/AssemblySpecificChange.js +16 -14
  8. package/dist/AssemblySpecificChange.js.map +1 -1
  9. package/dist/Change.d.ts +4 -3
  10. package/dist/Change.d.ts.map +1 -0
  11. package/dist/Change.js +6 -11
  12. package/dist/Change.js.map +1 -1
  13. package/dist/ChangeTypeRegistry.d.ts +2 -1
  14. package/dist/ChangeTypeRegistry.d.ts.map +1 -0
  15. package/dist/ChangeTypeRegistry.js +2 -7
  16. package/dist/ChangeTypeRegistry.js.map +1 -1
  17. package/dist/Check.d.ts +2 -1
  18. package/dist/Check.d.ts.map +1 -0
  19. package/dist/Check.js +1 -5
  20. package/dist/Check.js.map +1 -1
  21. package/dist/CheckRegistry.d.ts +2 -1
  22. package/dist/CheckRegistry.d.ts.map +1 -0
  23. package/dist/CheckRegistry.js +2 -7
  24. package/dist/CheckRegistry.js.map +1 -1
  25. package/dist/FeatureChange.d.ts +5 -4
  26. package/dist/FeatureChange.d.ts.map +1 -0
  27. package/dist/FeatureChange.js +12 -19
  28. package/dist/FeatureChange.js.map +1 -1
  29. package/dist/Operation.d.ts +8 -6
  30. package/dist/Operation.d.ts.map +1 -0
  31. package/dist/Operation.js +3 -7
  32. package/dist/Operation.js.map +1 -1
  33. package/dist/OperationTypeRegistry.d.ts +2 -1
  34. package/dist/OperationTypeRegistry.d.ts.map +1 -0
  35. package/dist/OperationTypeRegistry.js +2 -7
  36. package/dist/OperationTypeRegistry.js.map +1 -1
  37. package/dist/Validation.d.ts +6 -5
  38. package/dist/Validation.d.ts.map +1 -0
  39. package/dist/Validation.js +2 -7
  40. package/dist/Validation.js.map +1 -1
  41. package/dist/index.d.ts +11 -10
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +10 -13
  44. package/dist/index.js.map +1 -1
  45. package/dist/tsconfig.tsbuildinfo +1 -1
  46. package/package.json +14 -11
  47. package/src/AssemblySpecificChange.ts +16 -6
  48. package/src/Change.ts +10 -10
  49. package/src/ChangeTypeRegistry.ts +1 -1
  50. package/src/Check.ts +3 -3
  51. package/src/CheckRegistry.ts +1 -1
  52. package/src/FeatureChange.ts +5 -5
  53. package/src/Operation.ts +18 -15
  54. package/src/OperationTypeRegistry.ts +1 -1
  55. package/src/Validation.ts +5 -5
  56. package/src/declare.d.ts +29 -0
  57. package/src/index.ts +10 -10
  58. package/tsconfig.json +4 -7
package/package.json CHANGED
@@ -1,40 +1,43 @@
1
1
  {
2
2
  "name": "@apollo-annotation/common",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/GMOD/Apollo3.git",
7
7
  "directory": "packages/apollo-common"
8
8
  },
9
- "main": "./dist/index.js",
9
+ "sideEffects": false,
10
+ "type": "module",
11
+ "exports": "./dist/index.js",
10
12
  "scripts": {
11
- "build": "tsc"
13
+ "build": "tsc --build"
12
14
  },
13
15
  "dependencies": {
14
- "@apollo-annotation/schemas": "^0.3.10",
15
- "@jbrowse/core": "^3.6.5",
16
+ "@apollo-annotation/schemas": "^0.3.12",
17
+ "@jbrowse/core": "^4.1.1",
16
18
  "bson-objectid": "^2.0.4",
17
19
  "tslib": "^2.3.1"
18
20
  },
19
21
  "devDependencies": {
20
- "@apollo-annotation/mst": "^0.3.10",
21
- "@gmod/gff": "^2.0.0",
22
+ "@apollo-annotation/mst": "^0.3.12",
23
+ "@gmod/gff": "^2.1.0",
22
24
  "@nestjs/common": "^10.1.0",
23
25
  "@nestjs/core": "^10.1.0",
24
- "@types/node": "^20.19.15",
25
- "generic-filehandle": "^3.0.0",
26
+ "@types/node": "^24.10.9",
27
+ "generic-filehandle2": "^2.0.18",
26
28
  "mongoose": "^6.12.0",
27
29
  "typescript": "^5.5.3"
28
30
  },
29
31
  "peerDependencies": {
30
- "@mui/material": "^7.0.0",
32
+ "@jbrowse/mobx-state-tree": "^5.5.0",
33
+ "@mui/material": "^7.3.7",
31
34
  "@mui/x-data-grid": "^8.0.0",
32
35
  "mobx": "^6.6.1",
33
36
  "mobx-react": "^7.2.1",
34
- "mobx-state-tree": "^5.4.0",
35
37
  "prop-types": "^15.8.1",
36
38
  "react": "^18.2.0",
37
39
  "react-dom": "^18.2.0",
40
+ "reflect-metadata": "^0.1.13",
38
41
  "rxjs": "^7.4.0",
39
42
  "tss-react": "^4.6.1"
40
43
  },
@@ -1,12 +1,13 @@
1
1
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
2
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
3
+ import type { Feature } from '@apollo-annotation/schemas'
3
4
 
4
5
  import {
5
6
  Change,
6
7
  type ChangeOptions,
7
8
  type SerializedChange,
8
9
  isChange,
9
- } from './Change'
10
+ } from './Change.js'
10
11
 
11
12
  export interface SerializedAssemblySpecificChange extends SerializedChange {
12
13
  assembly: string
@@ -30,18 +31,27 @@ export abstract class AssemblySpecificChange extends Change {
30
31
  }
31
32
 
32
33
  getIndexedIds(
33
- feature: AnnotationFeatureSnapshot,
34
+ feature: AnnotationFeatureSnapshot | Feature,
34
35
  idsToIndex: string[] | undefined,
35
36
  ): string[] {
36
37
  const indexedIds: string[] = []
37
38
  for (const additionalId of idsToIndex ?? []) {
38
- const idValue = feature.attributes?.[additionalId]
39
- if (idValue) {
39
+ const { attributes } = feature
40
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
41
+ const idValue: string[] =
42
+ attributes instanceof Map
43
+ ? attributes.get(additionalId)
44
+ : attributes?.[additionalId]
45
+ if (idValue?.[0]) {
40
46
  indexedIds.push(idValue[0])
41
47
  }
42
48
  }
43
49
  if (feature.children) {
44
- for (const child of Object.values(feature.children)) {
50
+ const childrenIterable =
51
+ feature.children instanceof Map
52
+ ? feature.children.values()
53
+ : Object.values(feature.children)
54
+ for (const child of childrenIterable) {
45
55
  const childIndexedIds = this.getIndexedIds(child, idsToIndex)
46
56
  indexedIds.push(...childIndexedIds)
47
57
  }
package/src/Change.ts CHANGED
@@ -1,22 +1,22 @@
1
1
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
2
  /* eslint-disable @typescript-eslint/restrict-template-expressions */
3
- import {
4
- type AnnotationFeature,
5
- type AnnotationFeatureSnapshot,
6
- type ApolloAssemblyI,
7
- type BackendDriverType,
8
- type CheckResultI,
9
- type CheckResultSnapshot,
3
+ import type {
4
+ AnnotationFeature,
5
+ AnnotationFeatureSnapshot,
6
+ ApolloAssemblyI,
7
+ BackendDriverType,
8
+ CheckResultI,
9
+ CheckResultSnapshot,
10
10
  } from '@apollo-annotation/mst'
11
- import { type AppRootModel, type Region } from '@jbrowse/core/util'
11
+ import type { AppRootModel, Region } from '@jbrowse/core/util'
12
12
 
13
- import { changeRegistry } from './ChangeTypeRegistry'
13
+ import { changeRegistry } from './ChangeTypeRegistry.js'
14
14
  import {
15
15
  type BackendDataStore,
16
16
  Operation,
17
17
  type OperationOptions,
18
18
  type SerializedOperation,
19
- } from './Operation'
19
+ } from './Operation.js'
20
20
 
21
21
  export interface ClientDataStore {
22
22
  typeName: 'Client'
@@ -1,4 +1,4 @@
1
- import { type Change } from './Change'
1
+ import type { Change } from './Change.js'
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
4
  type ChangeType = new (...args: any[]) => Change
package/src/Check.ts CHANGED
@@ -1,6 +1,6 @@
1
- import {
2
- type AnnotationFeatureSnapshot,
3
- type CheckResultSnapshot,
1
+ import type {
2
+ AnnotationFeatureSnapshot,
3
+ CheckResultSnapshot,
4
4
  } from '@apollo-annotation/mst'
5
5
 
6
6
  export abstract class Check {
@@ -1,4 +1,4 @@
1
- import { type Check } from './Check'
1
+ import type { Check } from './Check.js'
2
2
 
3
3
  class CheckRegistry {
4
4
  checks = new Map<string, Check>()
@@ -1,16 +1,16 @@
1
1
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
2
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
3
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
4
- import { type Feature } from '@apollo-annotation/schemas'
3
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
4
+ import type { Feature } from '@apollo-annotation/schemas'
5
5
  import ObjectID from 'bson-objectid'
6
- import { type Types } from 'mongoose'
6
+ import type { Types } from 'mongoose'
7
7
 
8
8
  import {
9
9
  AssemblySpecificChange,
10
10
  type SerializedAssemblySpecificChange,
11
11
  isAssemblySpecificChange,
12
- } from './AssemblySpecificChange'
13
- import { type ChangeOptions } from './Change'
12
+ } from './AssemblySpecificChange.js'
13
+ import type { ChangeOptions } from './Change.js'
14
14
 
15
15
  export interface SerializedFeatureChange
16
16
  extends SerializedAssemblySpecificChange {
package/src/Operation.ts CHANGED
@@ -1,22 +1,22 @@
1
1
  /* eslint-disable @typescript-eslint/no-confusing-void-expression */
2
2
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
3
3
  /* eslint-disable @typescript-eslint/restrict-template-expressions */
4
- import { type FileHandle } from 'node:fs/promises'
4
+ import type { FileHandle } from 'node:fs/promises'
5
5
 
6
- import {
7
- type AssemblyDocument,
8
- type CheckDocument,
9
- type FeatureDocument,
10
- type FileDocument,
11
- type JBrowseConfigDocument,
12
- type RefSeqChunkDocument,
13
- type RefSeqDocument,
14
- type UserDocument,
6
+ import type {
7
+ AssemblyDocument,
8
+ CheckDocument,
9
+ FeatureDocument,
10
+ FileDocument,
11
+ JBrowseConfigDocument,
12
+ RefSeqChunkDocument,
13
+ RefSeqDocument,
14
+ UserDocument,
15
15
  } from '@apollo-annotation/schemas'
16
- import { type GFF3Feature } from '@gmod/gff'
17
- import { type LoggerService } from '@nestjs/common'
18
- import { type GenericFilehandle } from 'generic-filehandle'
19
- import { type ClientSession, type Model } from 'mongoose'
16
+ import type { GFF3Feature } from '@gmod/gff'
17
+ import type { LoggerService } from '@nestjs/common'
18
+ import type { GenericFilehandle } from 'generic-filehandle2'
19
+ import type { ClientSession, Model } from 'mongoose'
20
20
 
21
21
  export interface LocalGFF3DataStore {
22
22
  typeName: 'LocalGFF3'
@@ -47,7 +47,10 @@ export interface ServerDataStore {
47
47
  getFileHandle(file: FileDocument): GenericFilehandle
48
48
  parseGFF3(
49
49
  stream: ReadableStream<Uint8Array>,
50
- parseOptions?: { bufferSize?: number },
50
+ parseOptions?: {
51
+ bufferSize?: number
52
+ errorCallback?(errorMessage: string): void
53
+ },
51
54
  ): ReadableStream<GFF3Feature>
52
55
  create(createFileDto: CreateFileDto): void
53
56
  remove(id: string): void
@@ -1,4 +1,4 @@
1
- import { type Operation } from './Operation'
1
+ import type { Operation } from './Operation.js'
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
4
  type OperationType = new (...args: any[]) => Operation
package/src/Validation.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /* eslint-disable @typescript-eslint/require-await */
2
- import { type FeatureDocument } from '@apollo-annotation/schemas'
3
- import { type ExecutionContext } from '@nestjs/common'
4
- import { type Reflector } from '@nestjs/core'
5
- import { type ClientSession, type Model } from 'mongoose'
2
+ import type { FeatureDocument } from '@apollo-annotation/schemas'
3
+ import type { ExecutionContext } from '@nestjs/common'
4
+ import type { Reflector } from '@nestjs/core'
5
+ import type { ClientSession, Model } from 'mongoose'
6
6
 
7
- import { type Change, type ClientDataStore } from './Change'
7
+ import type { Change, ClientDataStore } from './Change.js'
8
8
 
9
9
  export interface Context {
10
10
  context: ExecutionContext
@@ -0,0 +1,29 @@
1
+ declare module 'bson-objectid' {
2
+ import type { Buffer } from 'node:buffer'
3
+
4
+ export default ObjectID
5
+
6
+ declare const ObjectID: ObjectIDCtor
7
+
8
+ declare interface ObjectID {
9
+ readonly id: string
10
+ readonly str: string
11
+
12
+ toHexString(): string
13
+ equals(other: ObjectID): boolean
14
+ getTimestamp(): Date
15
+ }
16
+
17
+ declare interface ObjectIDCtor {
18
+ (hexStringOrIdStringOrArrayOrBuffer?: string | number[] | Buffer): ObjectID
19
+
20
+ new (
21
+ hexStringOrIdStringOrArrayOrBuffer?: string | number[] | Buffer,
22
+ ): ObjectID
23
+
24
+ createFromTime(time: number): ObjectID
25
+ createFromHexString(hexString: string): ObjectID
26
+ isValid(hexStringOrObjectID: string | ObjectID): boolean
27
+ toString(): string
28
+ }
29
+ }
package/src/index.ts CHANGED
@@ -1,10 +1,10 @@
1
- export * from './ApolloPlugin'
2
- export * from './AssemblySpecificChange'
3
- export * from './Change'
4
- export * from './ChangeTypeRegistry'
5
- export * from './Check'
6
- export * from './CheckRegistry'
7
- export * from './FeatureChange'
8
- export * from './Operation'
9
- export * from './OperationTypeRegistry'
10
- export * from './Validation'
1
+ export * from './ApolloPlugin.js'
2
+ export * from './AssemblySpecificChange.js'
3
+ export * from './Change.js'
4
+ export * from './ChangeTypeRegistry.js'
5
+ export * from './Check.js'
6
+ export * from './CheckRegistry.js'
7
+ export * from './FeatureChange.js'
8
+ export * from './Operation.js'
9
+ export * from './OperationTypeRegistry.js'
10
+ export * from './Validation.js'
package/tsconfig.json CHANGED
@@ -1,17 +1,14 @@
1
1
  {
2
- "extends": "../../tsconfig-base.json",
2
+ "extends": "../../tsconfig",
3
3
  "compilerOptions": {
4
4
  "composite": true,
5
5
  "incremental": true,
6
6
  "outDir": "./dist",
7
7
  "rootDir": "./src",
8
- "target": "ES2019",
9
- "lib": ["ES2019", "DOM"],
10
- "module": "CommonJS",
11
8
  "tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo",
12
- "experimentalDecorators": true,
13
- "emitDecoratorMetadata": true,
14
- "strictPropertyInitialization": false,
9
+ // For nodejs:
10
+ "lib": ["esnext"],
11
+ "types": ["node"],
15
12
  },
16
13
  "include": ["./src"],
17
14
  "references": [{ "path": "../apollo-schemas" }, { "path": "../apollo-mst" }],