@decaf-ts/core 0.26.2 → 0.26.4

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 (38) hide show
  1. package/README.md +1 -1
  2. package/dist/core.cjs +1 -1
  3. package/dist/core.cjs.map +1 -1
  4. package/dist/core.js +1 -1
  5. package/dist/core.js.map +1 -1
  6. package/lib/cjs/index.cjs +3 -3
  7. package/lib/cjs/migrations/MigrationService.cjs +9 -0
  8. package/lib/cjs/migrations/MigrationService.cjs.map +1 -1
  9. package/lib/cjs/model/indexing.cjs +4 -1
  10. package/lib/cjs/model/indexing.cjs.map +1 -1
  11. package/lib/cjs/overrides/overrides.cjs +9 -2
  12. package/lib/cjs/overrides/overrides.cjs.map +1 -1
  13. package/lib/cjs/persistence/constants.cjs +15 -1
  14. package/lib/cjs/persistence/constants.cjs.map +1 -1
  15. package/lib/cjs/utils/throttling.cjs +103 -78
  16. package/lib/cjs/utils/throttling.cjs.map +1 -1
  17. package/lib/esm/index.js +3 -3
  18. package/lib/esm/migrations/MigrationService.js +9 -0
  19. package/lib/esm/migrations/MigrationService.js.map +1 -1
  20. package/lib/esm/model/indexing.js +5 -2
  21. package/lib/esm/model/indexing.js.map +1 -1
  22. package/lib/esm/overrides/overrides.js +10 -3
  23. package/lib/esm/overrides/overrides.js.map +1 -1
  24. package/lib/esm/persistence/constants.js +7 -0
  25. package/lib/esm/persistence/constants.js.map +1 -1
  26. package/lib/esm/utils/throttling.js +101 -78
  27. package/lib/esm/utils/throttling.js.map +1 -1
  28. package/lib/types/index.d.cts +3 -3
  29. package/lib/types/index.d.mts +3 -3
  30. package/lib/types/migrations/MigrationService.d.cts +1 -0
  31. package/lib/types/migrations/MigrationService.d.mts +1 -0
  32. package/lib/types/migrations/types.d.cts +3 -0
  33. package/lib/types/migrations/types.d.mts +3 -0
  34. package/lib/types/persistence/constants.d.cts +7 -0
  35. package/lib/types/persistence/constants.d.mts +7 -0
  36. package/lib/types/utils/throttling.d.cts +13 -8
  37. package/lib/types/utils/throttling.d.mts +13 -8
  38. package/package.json +1 -1
@@ -8,6 +8,13 @@ import { PreparedStatementKeys } from "../query/constants.d.mts";
8
8
  * @readonly
9
9
  * @memberOf module:core
10
10
  */
11
+ /**
12
+ * @description Metadata key segment used for non-composite (single property) indexes
13
+ * @summary Reserved variant key under which a property's plain `@index()` metadata is stored, allowing it to coexist with composite `@index(directions, compositions)` declarations on the same property
14
+ * @const INDEX_SELF
15
+ * @memberOf module:core
16
+ */
17
+ export declare const INDEX_SELF = "__self__";
11
18
  export declare enum PersistenceKeys {
12
19
  PERSISTENCE = "persistence",
13
20
  /** @description Key for index metadata */
@@ -1,9 +1,14 @@
1
- export type BseThrottlingConfig = {
1
+ export declare enum ThrottleMode {
2
+ BY_COUNT = "count",
3
+ BY_SIZE = "size"
4
+ }
5
+ export type ThrottleSplitter<T = any> = (items: T[]) => T[][];
6
+ export interface ThrottleOptions {
2
7
  delayMs?: number;
3
- };
4
- export type ThrottlingConfig = ({
5
- count: number;
6
- } | {
7
- bufferSize: number;
8
- }) & BseThrottlingConfig;
9
- export declare function throttle(cfg?: ThrottlingConfig | ((...args: any[]) => ThrottlingConfig), argIndex?: number | number[]): (target: object, propertyKey?: any, descriptor?: any) => void;
8
+ argIndex?: number | number[];
9
+ breakOnSingleFailure?: boolean;
10
+ }
11
+ export declare function splitByCount<T>(count: number): ThrottleSplitter<T>;
12
+ export declare function splitBySize<T>(maxBytes: number): ThrottleSplitter<T>;
13
+ export declare function throttle(value: number | ThrottleSplitter, options?: ThrottleOptions): MethodDecorator;
14
+ export declare function throttle(value: number, mode: ThrottleMode, options?: ThrottleOptions): MethodDecorator;
@@ -1,9 +1,14 @@
1
- export type BseThrottlingConfig = {
1
+ export declare enum ThrottleMode {
2
+ BY_COUNT = "count",
3
+ BY_SIZE = "size"
4
+ }
5
+ export type ThrottleSplitter<T = any> = (items: T[]) => T[][];
6
+ export interface ThrottleOptions {
2
7
  delayMs?: number;
3
- };
4
- export type ThrottlingConfig = ({
5
- count: number;
6
- } | {
7
- bufferSize: number;
8
- }) & BseThrottlingConfig;
9
- export declare function throttle(cfg?: ThrottlingConfig | ((...args: any[]) => ThrottlingConfig), argIndex?: number | number[]): (target: object, propertyKey?: any, descriptor?: any) => void;
8
+ argIndex?: number | number[];
9
+ breakOnSingleFailure?: boolean;
10
+ }
11
+ export declare function splitByCount<T>(count: number): ThrottleSplitter<T>;
12
+ export declare function splitBySize<T>(maxBytes: number): ThrottleSplitter<T>;
13
+ export declare function throttle(value: number | ThrottleSplitter, options?: ThrottleOptions): MethodDecorator;
14
+ export declare function throttle(value: number, mode: ThrottleMode, options?: ThrottleOptions): MethodDecorator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/core",
3
- "version": "0.26.2",
3
+ "version": "0.26.4",
4
4
  "description": "Core persistence module for the decaf framework",
5
5
  "type": "module",
6
6
  "exports": {