@fjell/lib-sequelize 4.4.5 → 4.4.10
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/cjs/Coordinate.cjs +9 -22
- package/dist/cjs/Definition.cjs +5 -26
- package/dist/cjs/Instance.cjs +26 -10
- package/dist/cjs/InstanceFactory.cjs +25 -0
- package/dist/cjs/Operations.cjs +7 -2
- package/dist/cjs/Options.cjs +14 -7
- package/dist/cjs/QueryBuilder.cjs +31 -25
- package/dist/cjs/contained/Instance.cjs +15 -8
- package/dist/cjs/index.cjs +7 -4
- package/dist/cjs/ops/all.cjs +44 -20
- package/dist/cjs/ops/create.cjs +138 -40
- package/dist/cjs/ops/find.cjs +9 -7
- package/dist/cjs/ops/get.cjs +9 -5
- package/dist/cjs/ops/one.cjs +7 -6
- package/dist/cjs/ops/remove.cjs +10 -7
- package/dist/cjs/ops/update.cjs +10 -7
- package/dist/cjs/primary/Instance.cjs +16 -9
- package/dist/cjs/util/general.cjs +1 -5
- package/dist/es/Coordinate.js +9 -3
- package/dist/es/Definition.js +5 -7
- package/dist/es/Instance.js +26 -11
- package/dist/es/InstanceFactory.js +21 -0
- package/dist/es/Operations.js +7 -2
- package/dist/es/Options.js +14 -7
- package/dist/es/QueryBuilder.js +31 -25
- package/dist/es/contained/Instance.js +15 -8
- package/dist/es/index.js +4 -3
- package/dist/es/ops/all.js +44 -20
- package/dist/es/ops/create.js +139 -41
- package/dist/es/ops/find.js +9 -7
- package/dist/es/ops/get.js +9 -5
- package/dist/es/ops/one.js +7 -6
- package/dist/es/ops/remove.js +11 -8
- package/dist/es/ops/update.js +11 -8
- package/dist/es/primary/Instance.js +16 -9
- package/dist/es/util/general.js +2 -5
- package/dist/index.cjs +412 -216
- package/dist/index.cjs.map +1 -1
- package/dist/types/AggregationBuilder.d.ts +1 -1
- package/dist/types/Coordinate.d.ts +3 -2
- package/dist/types/Definition.d.ts +3 -3
- package/dist/types/Instance.d.ts +22 -2
- package/dist/types/InstanceFactory.d.ts +14 -0
- package/dist/types/Operations.d.ts +3 -2
- package/dist/types/Options.d.ts +1 -1
- package/dist/types/Registry.d.ts +6 -0
- package/dist/types/contained/Instance.d.ts +3 -3
- package/dist/types/index.d.ts +4 -1
- package/dist/types/primary/Instance.d.ts +2 -2
- package/package.json +23 -23
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,4 +2,4 @@ import { Item } from '@fjell/core';
|
|
|
2
2
|
import { AggregationDefinition } from './Options';
|
|
3
3
|
import { OperationContext } from './OperationContext';
|
|
4
4
|
import * as Library from "@fjell/lib";
|
|
5
|
-
export declare const buildAggregation: (item: Item, aggregationDefinition: AggregationDefinition, registry: Library.Registry, context?: OperationContext) => Promise<
|
|
5
|
+
export declare const buildAggregation: (item: Item, aggregationDefinition: AggregationDefinition, registry: Library.Registry, context?: OperationContext) => Promise<any>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ItemTypeArray } from '@fjell/core';
|
|
2
|
-
import
|
|
2
|
+
import { Coordinate } from '@fjell/registry';
|
|
3
3
|
export declare const SCOPE_SEQUELIZE = "sequelize";
|
|
4
|
-
export declare const createCoordinate: <S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(kta: ItemTypeArray<S, L1, L2, L3, L4, L5>, scopes?: string[]) =>
|
|
4
|
+
export declare const createCoordinate: <S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(kta: ItemTypeArray<S, L1, L2, L3, L4, L5>, scopes?: string[]) => Coordinate<S, L1, L2, L3, L4, L5>;
|
|
5
|
+
export type { Coordinate } from '@fjell/registry';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Item, ItemTypeArray } from '@fjell/core';
|
|
2
2
|
import { Options } from './Options';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface Definition<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> {
|
|
4
|
+
coordinate: import('@fjell/registry').Coordinate<S, L1, L2, L3, L4, L5>;
|
|
5
5
|
options: Options<V, S, L1, L2, L3, L4, L5>;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
7
|
+
export declare const createDefinition: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(kta: ItemTypeArray<S, L1, L2, L3, L4, L5>, scopes: string[], libOptions?: Partial<Options<V, S, L1, L2, L3, L4, L5>>) => Definition<V, S, L1, L2, L3, L4, L5>;
|
package/dist/types/Instance.d.ts
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
import { Item
|
|
1
|
+
import { Item } from '@fjell/core';
|
|
2
|
+
import { Coordinate } from '@fjell/registry';
|
|
3
|
+
import { Registry } from './Registry';
|
|
2
4
|
import { ModelStatic } from 'sequelize';
|
|
3
5
|
import { Options } from './Options';
|
|
4
6
|
import * as Library from '@fjell/lib';
|
|
7
|
+
/**
|
|
8
|
+
* The Sequelize Instance interface extends the fjell-lib Instance
|
|
9
|
+
* and adds Sequelize-specific functionality:
|
|
10
|
+
* - models: Array of Sequelize model classes for this instance
|
|
11
|
+
*
|
|
12
|
+
* @template V - The type of the data model item, extending Item
|
|
13
|
+
* @template S - The string literal type representing the model's key type
|
|
14
|
+
* @template L1-L5 - Optional string literal types for location hierarchy levels
|
|
15
|
+
*/
|
|
5
16
|
export interface Instance<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> extends Library.Instance<V, S, L1, L2, L3, L4, L5> {
|
|
17
|
+
/** Array of Sequelize model classes associated with this instance */
|
|
6
18
|
models: ModelStatic<any>[];
|
|
7
19
|
}
|
|
8
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new Sequelize instance that extends the fjell-lib instance
|
|
22
|
+
* with Sequelize-specific functionality
|
|
23
|
+
*/
|
|
24
|
+
export declare const createInstance: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(registry: Registry, coordinate: Coordinate<S, L1, L2, L3, L4, L5>, models: ModelStatic<any>[], options: Options<V, S, L1, L2, L3, L4, L5>) => Instance<V, S, L1, L2, L3, L4, L5>;
|
|
25
|
+
/**
|
|
26
|
+
* Type guard to check if an object is a Sequelize Instance
|
|
27
|
+
*/
|
|
28
|
+
export declare const isInstance: (instance: any) => instance is Instance<any, any, any, any, any, any, any>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Item } from '@fjell/core';
|
|
2
|
+
import { Options } from './Options';
|
|
3
|
+
import { InstanceFactory as BaseInstanceFactory } from '@fjell/registry';
|
|
4
|
+
import { ModelStatic } from 'sequelize';
|
|
5
|
+
/**
|
|
6
|
+
* Sequelize Instance Factory type that extends the base factory
|
|
7
|
+
* to include Sequelize-specific models parameter
|
|
8
|
+
*/
|
|
9
|
+
export type InstanceFactory<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> = (models: ModelStatic<any>[], options: Options<V, S, L1, L2, L3, L4, L5>) => BaseInstanceFactory<S, L1, L2, L3, L4, L5>;
|
|
10
|
+
/**
|
|
11
|
+
* Factory function for creating Sequelize instances
|
|
12
|
+
* This extends the fjell-lib pattern by adding Sequelize-specific models
|
|
13
|
+
*/
|
|
14
|
+
export declare const createInstanceFactory: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(models: ModelStatic<any>[], options: Options<V, S, L1, L2, L3, L4, L5>) => BaseInstanceFactory<S, L1, L2, L3, L4, L5>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Item } from '@fjell/core';
|
|
2
|
+
import { Registry } from './Registry';
|
|
2
3
|
import { ModelStatic } from 'sequelize';
|
|
3
|
-
import {
|
|
4
|
+
import { Coordinate } from '@fjell/registry';
|
|
4
5
|
import * as Library from "@fjell/lib";
|
|
5
|
-
export declare const createOperations: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(models: Array<ModelStatic<any>>,
|
|
6
|
+
export declare const createOperations: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(models: Array<ModelStatic<any>>, coordinate: Coordinate<S, L1, L2, L3, L4, L5>, registry: Registry, options: import('./Options').Options<V, S, L1, L2, L3, L4, L5>) => Library.Operations<V, S, L1, L2, L3, L4, L5>;
|
package/dist/types/Options.d.ts
CHANGED
|
@@ -15,4 +15,4 @@ export interface Options<V extends Item<S, L1, L2, L3, L4, L5>, S extends string
|
|
|
15
15
|
references: ReferenceDefinition[];
|
|
16
16
|
aggregations: AggregationDefinition[];
|
|
17
17
|
}
|
|
18
|
-
export declare const createOptions: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(
|
|
18
|
+
export declare const createOptions: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(sequelizeOptions?: Partial<Options<V, S, L1, L2, L3, L4, L5>>) => Options<V, S, L1, L2, L3, L4, L5>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Instance as AbstractSequelizeInstance } from '../Instance';
|
|
2
2
|
import { Item, ItemTypeArray } from '@fjell/core';
|
|
3
|
-
import { Contained } from '@fjell/lib';
|
|
4
3
|
import { ModelStatic } from 'sequelize';
|
|
5
|
-
import
|
|
4
|
+
import { Registry } from '../Registry';
|
|
5
|
+
import { Options } from '../Options';
|
|
6
6
|
export interface Instance<V extends Item<S>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> extends AbstractSequelizeInstance<V, S, L1, L2, L3, L4, L5> {
|
|
7
7
|
models: ModelStatic<any>[];
|
|
8
8
|
}
|
|
9
|
-
export declare function createInstance<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(keyTypes: ItemTypeArray<S, L1, L2, L3, L4, L5>, models: ModelStatic<any>[], libOptions:
|
|
9
|
+
export declare function createInstance<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(keyTypes: ItemTypeArray<S, L1, L2, L3, L4, L5>, models: ModelStatic<any>[], libOptions: Partial<Options<V, S, L1, L2, L3, L4, L5>> | undefined, scopes: string[] | undefined, registry: Registry): Instance<V, S, L1, L2, L3, L4, L5>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
export * from './Coordinate';
|
|
2
1
|
export * from './Definition';
|
|
3
2
|
export * from './Instance';
|
|
3
|
+
export * from './InstanceFactory';
|
|
4
4
|
export * from './Options';
|
|
5
5
|
export * from './Operations';
|
|
6
|
+
export * from './Registry';
|
|
6
7
|
export * as Contained from './contained';
|
|
7
8
|
export * as Primary from './primary';
|
|
9
|
+
export { createCoordinate, SCOPE_SEQUELIZE } from './Coordinate';
|
|
10
|
+
export type { Coordinate } from './Coordinate';
|
|
@@ -2,8 +2,8 @@ import { Instance as AbstractSequelizeInstance } from '../Instance';
|
|
|
2
2
|
import { Item } from '@fjell/core';
|
|
3
3
|
import { ModelStatic } from 'sequelize';
|
|
4
4
|
import { Options } from '../Options';
|
|
5
|
-
import
|
|
5
|
+
import { Registry } from '../Registry';
|
|
6
6
|
export interface Instance<V extends Item<S>, S extends string> extends AbstractSequelizeInstance<V, S> {
|
|
7
7
|
models: ModelStatic<any>[];
|
|
8
8
|
}
|
|
9
|
-
export declare function createInstance<V extends Item<S>, S extends string>(keyType: S, models: ModelStatic<any>[], libOptions: Partial<Options<V, S>> | undefined, scopes: string[] | undefined, registry:
|
|
9
|
+
export declare function createInstance<V extends Item<S>, S extends string>(keyType: S, models: ModelStatic<any>[], libOptions: Partial<Options<V, S>> | undefined, scopes: string[] | undefined, registry: Registry): Instance<V, S>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjell/lib-sequelize",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"library",
|
|
7
|
+
"persistence",
|
|
8
|
+
"database",
|
|
9
|
+
"orm",
|
|
10
|
+
"sequelize",
|
|
11
|
+
"fjell"
|
|
12
|
+
],
|
|
5
13
|
"description": "Sequelize Library for Fjell",
|
|
6
14
|
"engines": {
|
|
7
15
|
"node": ">=21"
|
|
@@ -21,40 +29,32 @@
|
|
|
21
29
|
"dist"
|
|
22
30
|
],
|
|
23
31
|
"dependencies": {
|
|
24
|
-
"@fjell/core": "^4.4.
|
|
25
|
-
"@fjell/lib": "^4.4.
|
|
26
|
-
"@fjell/logging": "^4.4.
|
|
32
|
+
"@fjell/core": "^4.4.7",
|
|
33
|
+
"@fjell/lib": "^4.4.11",
|
|
34
|
+
"@fjell/logging": "^4.4.7",
|
|
35
|
+
"@fjell/registry": "^4.4.7",
|
|
27
36
|
"dayjs": "^1.11.13",
|
|
28
37
|
"deepmerge": "^4.3.1",
|
|
29
|
-
"
|
|
30
|
-
"sequelize": "^6.37.7",
|
|
31
|
-
"specifier-resolution-node": "^1.1.4",
|
|
32
|
-
"winston": "^3.17.0"
|
|
38
|
+
"sequelize": "^6.37.7"
|
|
33
39
|
},
|
|
34
40
|
"devDependencies": {
|
|
35
|
-
"@babel/preset-env": "^7.27.2",
|
|
36
|
-
"@babel/preset-react": "^7.27.1",
|
|
37
|
-
"@babel/preset-typescript": "^7.27.1",
|
|
38
41
|
"@eslint/eslintrc": "^3.3.1",
|
|
39
|
-
"@eslint/js": "^9.
|
|
40
|
-
"@swc/core": "^1.
|
|
42
|
+
"@eslint/js": "^9.31.0",
|
|
43
|
+
"@swc/core": "^1.13.1",
|
|
41
44
|
"@tsconfig/recommended": "^1.0.10",
|
|
42
|
-
"@types/
|
|
43
|
-
"@
|
|
44
|
-
"@typescript-eslint/
|
|
45
|
-
"@typescript-eslint/parser": "^8.35.0",
|
|
45
|
+
"@types/node": "^24.0.15",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^8.37.0",
|
|
47
|
+
"@typescript-eslint/parser": "^8.37.0",
|
|
46
48
|
"@vitest/coverage-v8": "^3.2.4",
|
|
47
49
|
"@vitest/ui": "^3.2.4",
|
|
48
|
-
"
|
|
49
|
-
"eslint": "^9.30.0",
|
|
50
|
-
"nodemon": "^3.1.10",
|
|
50
|
+
"eslint": "^9.31.0",
|
|
51
51
|
"rimraf": "^6.0.1",
|
|
52
52
|
"ts-node": "^10.9.2",
|
|
53
53
|
"tsc-alias": "^1.8.16",
|
|
54
54
|
"typescript": "^5.8.3",
|
|
55
|
-
"vite": "^7.0.
|
|
55
|
+
"vite": "^7.0.5",
|
|
56
56
|
"vite-plugin-dts": "^4.5.4",
|
|
57
|
-
"vite-plugin-node": "^
|
|
57
|
+
"vite-plugin-node": "^7.0.0",
|
|
58
58
|
"vitest": "^3.2.4"
|
|
59
59
|
},
|
|
60
60
|
"repository": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"url": "git+https://github.com/getfjell/lib-sequelize.git"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
|
-
"build": "tsc --noEmit && vite build",
|
|
65
|
+
"build": "pnpm run lint && tsc --noEmit && vite build",
|
|
66
66
|
"dev": "vite build --watch",
|
|
67
67
|
"lint": "eslint . --ext .ts --fix",
|
|
68
68
|
"clean": "rimraf dist",
|