@fjell/lib-sequelize 4.4.75 → 4.4.76
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/QueryBuilder.d.ts +18 -3
- package/dist/QueryBuilder.d.ts.map +1 -1
- package/dist/RowProcessor.d.ts +1 -1
- package/dist/RowProcessor.d.ts.map +1 -1
- package/dist/index.js +508 -108
- package/dist/index.js.map +4 -4
- package/dist/metrics/QueryMetrics.d.ts +31 -0
- package/dist/metrics/QueryMetrics.d.ts.map +1 -0
- package/dist/metrics/index.d.ts +2 -0
- package/dist/metrics/index.d.ts.map +1 -0
- package/dist/ops/all.d.ts.map +1 -1
- package/dist/ops/create.d.ts.map +1 -1
- package/dist/ops/get.d.ts.map +1 -1
- package/dist/ops/remove.d.ts.map +1 -1
- package/dist/ops/update.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/QueryBuilder.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { CompoundCondition, Condition, ItemQuery } from '@fjell/core';
|
|
2
2
|
import { ModelStatic } from 'sequelize';
|
|
3
|
+
import { SequelizeReferenceDefinition } from './processing/ReferenceBuilder';
|
|
4
|
+
import type { Registry } from '@fjell/lib';
|
|
3
5
|
export type QueryOptions = {
|
|
4
6
|
where: Record<string, any>;
|
|
5
7
|
limit?: number;
|
|
@@ -7,8 +9,21 @@ export type QueryOptions = {
|
|
|
7
9
|
order?: Array<[string, string]>;
|
|
8
10
|
include?: Array<any>;
|
|
9
11
|
};
|
|
10
|
-
export declare const addCompoundCondition: (options: any, compoundCondition: CompoundCondition, model: ModelStatic<any
|
|
11
|
-
export declare const addCondition: (conditions: Record<string, any>, condition: Condition, model: ModelStatic<any
|
|
12
|
+
export declare const addCompoundCondition: (options: any, compoundCondition: CompoundCondition, model: ModelStatic<any>, references?: SequelizeReferenceDefinition[], allReferences?: Map<string, SequelizeReferenceDefinition[]>, registry?: Registry) => any;
|
|
13
|
+
export declare const addCondition: (conditions: Record<string, any>, condition: Condition, model: ModelStatic<any>, options?: any, references?: SequelizeReferenceDefinition[], allReferences?: Map<string, SequelizeReferenceDefinition[]>, registry?: Registry) => Record<string, any>;
|
|
14
|
+
/**
|
|
15
|
+
* Detects references that can be loaded via Sequelize INCLUDE and adds them to options.
|
|
16
|
+
* This prevents N+1 queries by using JOIN instead of separate queries per item.
|
|
17
|
+
*
|
|
18
|
+
* @param options - Query options to modify
|
|
19
|
+
* @param model - Sequelize model to check for associations
|
|
20
|
+
* @param referenceDefinitions - Reference definitions from library config
|
|
21
|
+
* @returns Modified options with includes added, plus array of property names that were included
|
|
22
|
+
*/
|
|
23
|
+
export declare const addReferenceIncludes: (options: any, model: ModelStatic<any>, referenceDefinitions: SequelizeReferenceDefinition[]) => {
|
|
24
|
+
options: any;
|
|
25
|
+
includedReferences: string[];
|
|
26
|
+
};
|
|
12
27
|
/**
|
|
13
28
|
* Detects aggregations that can be loaded via Sequelize INCLUDE and adds them to options.
|
|
14
29
|
* This prevents N+1 queries by using JOIN instead of separate queries per item.
|
|
@@ -22,5 +37,5 @@ export declare const addAggregationIncludes: (options: any, model: ModelStatic<a
|
|
|
22
37
|
options: any;
|
|
23
38
|
includedAggregations: string[];
|
|
24
39
|
};
|
|
25
|
-
export declare const buildQuery: (itemQuery: ItemQuery, model: ModelStatic<any
|
|
40
|
+
export declare const buildQuery: (itemQuery: ItemQuery, model: ModelStatic<any>, references?: SequelizeReferenceDefinition[], registry?: Registry) => any;
|
|
26
41
|
//# sourceMappingURL=QueryBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBuilder.d.ts","sourceRoot":"","sources":["../src/QueryBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,SAAS,EAKT,SAAS,EAIV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAe,WAAW,EAAM,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"QueryBuilder.d.ts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AE,GAAG,CAAC;IAAC,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAiD9C,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,GAAG,EACZ,OAAO,WAAW,CAAC,GAAG,CAAC,EACvB,wBAAwB,GAAG,EAAE,KAC5B;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,oBAAoB,EAAE,MAAM,EAAE,CAAA;CAiDhD,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,WAAW,SAAS,EACpB,OAAO,WAAW,CAAC,GAAG,CAAC,EACvB,aAAa,4BAA4B,EAAE,EAC3C,WAAW,QAAQ,KAClB,GAuEF,CAAA"}
|
package/dist/RowProcessor.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ import * as Library from "@fjell/lib";
|
|
|
5
5
|
import { contextManager, createOperationContext, OperationContext } from "@fjell/lib";
|
|
6
6
|
export type { OperationContext };
|
|
7
7
|
export { createOperationContext, contextManager };
|
|
8
|
-
export declare const processRow: <S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(row: Model<any, any>, keyTypes: AllItemTypeArrays<S, L1, L2, L3, L4, L5>, referenceDefinitions: SequelizeReferenceDefinition[], aggregationDefinitions: AggregationDefinition[], registry: Library.Registry, context?: OperationContext, includedAggregations?: string[]) => Promise<Item<S, L1, L2, L3, L4, L5>>;
|
|
8
|
+
export declare const processRow: <S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(row: Model<any, any>, keyTypes: AllItemTypeArrays<S, L1, L2, L3, L4, L5>, referenceDefinitions: SequelizeReferenceDefinition[], aggregationDefinitions: AggregationDefinition[], registry: Library.Registry, context?: OperationContext, includedAggregations?: string[], includedReferences?: string[]) => Promise<Item<S, L1, L2, L3, L4, L5>>;
|
|
9
9
|
//# sourceMappingURL=RowProcessor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowProcessor.d.ts","sourceRoot":"","sources":["../src/RowProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,EAEL,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAUpB,YAAY,EAAE,gBAAgB,EAAE,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,CAAC;AAElD,eAAO,MAAM,UAAU,GAAU,CAAC,SAAS,MAAM,EAC/C,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACzB,EAAE,SAAS,MAAM,GAAG,KAAK,EACvB,KAAK,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EACpB,UAAU,iBAAiB,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAClD,sBAAsB,4BAA4B,EAAE,EACpD,wBAAwB,qBAAqB,EAAE,EAC/C,UAAU,OAAO,CAAC,QAAQ,EAC1B,UAAU,gBAAgB,EAC1B,uBAAuB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"RowProcessor.d.ts","sourceRoot":"","sources":["../src/RowProcessor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAChF,O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