@furystack/sequelize-store 6.0.27 → 6.0.29

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/README.md CHANGED
@@ -5,17 +5,28 @@ Sequelize physical store implementation for FuryStack.
5
5
  ## Initialization
6
6
 
7
7
  ```ts
8
- import '@furystack/sequelize-store'
8
+ import { Injector } from '@furystack/inject'
9
+ import { StoreManager, type PhysicalStore } from '@furystack/core'
10
+ import { useSequelize } from '@furystack/sequelize-store'
11
+ import { Model, type Options } from 'sequelize'
9
12
 
10
- export class TestEntry extends Model<...,...> {
11
- public declare _id: string
12
- public declare value: string
13
+ export class TestEntry extends Model {
14
+ declare public _id: string
15
+ declare public value: string
13
16
  }
14
17
 
15
- myInjector
16
- .setupStores(sm => {
17
- sm.useSequelize(TestEntry, '...other Sequelize-related options...')
18
- })
18
+ const myInjector = new Injector()
19
+ useSequelize({
20
+ injector: myInjector,
21
+ model: TestEntry,
22
+ sequelizeModel: TestEntry, // Your Sequelize Model class
23
+ primaryKey: '_id',
24
+ options: {
25
+ // Sequelize connection options
26
+ dialect: 'sqlite',
27
+ storage: ':memory:',
28
+ } as Options,
29
+ })
19
30
 
20
- const myStore: IPhysicalStore<TestEntry> = myInjector.getInstance(StoreManager).getStoreFor(TestEntry)
31
+ const myStore: PhysicalStore<TestEntry, '_id'> = myInjector.getInstance(StoreManager).getStoreFor(TestEntry, '_id')
21
32
  ```
@@ -20,12 +20,12 @@ export interface SequelizeStoreSettings<T extends object, M extends Model<T>, TP
20
20
  */
21
21
  getSequelizeClient: () => Sequelize;
22
22
  /**
23
- * Optional calback that will initialize the Model for the Sequelize instance
23
+ * Optional callback that will initialize the Model for the Sequelize instance
24
24
  */
25
25
  initModel?: (sequelize: Sequelize) => Promise<void>;
26
26
  }
27
27
  /**
28
- * TypeORM Store implementation for FuryStack
28
+ * Sequelize Store implementation for FuryStack
29
29
  */
30
30
  export declare class SequelizeStore<T extends object, M extends Model<T>, TPrimaryKey extends keyof T, TWriteableData = WithOptionalId<T, TPrimaryKey>> extends EventHub<{
31
31
  onEntityAdded: {
@@ -1,7 +1,7 @@
1
1
  import { EventHub } from '@furystack/utils';
2
2
  import { Lock } from 'semaphore-async-await';
3
3
  /**
4
- * TypeORM Store implementation for FuryStack
4
+ * Sequelize Store implementation for FuryStack
5
5
  */
6
6
  export class SequelizeStore extends EventHub {
7
7
  options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@furystack/sequelize-store",
3
- "version": "6.0.27",
3
+ "version": "6.0.29",
4
4
  "description": "Sequelize-based Store implementation for FuryStack",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -35,17 +35,17 @@
35
35
  },
36
36
  "homepage": "https://github.com/furystack/furystack",
37
37
  "dependencies": {
38
- "@furystack/core": "^15.0.27",
39
- "@furystack/inject": "^12.0.21",
40
- "@furystack/utils": "^8.1.3",
38
+ "@furystack/core": "^15.0.29",
39
+ "@furystack/inject": "^12.0.23",
40
+ "@furystack/utils": "^8.1.5",
41
41
  "semaphore-async-await": "^1.5.1",
42
42
  "sequelize": "^6.37.7"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/node": "^24.7.2",
45
+ "@types/node": "^24.10.1",
46
46
  "sqlite3": "5.1.7",
47
47
  "typescript": "^5.9.3",
48
- "vitest": "^3.2.4"
48
+ "vitest": "^4.0.10"
49
49
  },
50
50
  "typings": "./types/index.d.ts"
51
51
  }
@@ -30,13 +30,13 @@ export interface SequelizeStoreSettings<T extends object, M extends Model<T>, TP
30
30
  */
31
31
  getSequelizeClient: () => Sequelize
32
32
  /**
33
- * Optional calback that will initialize the Model for the Sequelize instance
33
+ * Optional callback that will initialize the Model for the Sequelize instance
34
34
  */
35
35
  initModel?: (sequelize: Sequelize) => Promise<void>
36
36
  }
37
37
 
38
38
  /**
39
- * TypeORM Store implementation for FuryStack
39
+ * Sequelize Store implementation for FuryStack
40
40
  */
41
41
  export class SequelizeStore<
42
42
  T extends object,