@decaf-ts/for-fabric 0.13.32 → 0.13.33

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.
@@ -18,11 +18,11 @@ export declare function deleteAuditHandler<M extends Model, R extends Repository
18
18
  export type AuditMetadata = {
19
19
  class: Constructor<Model>;
20
20
  };
21
- export declare function audit(model: Constructor<Model<boolean>>): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor | number) => void;
21
+ export declare function audit(model: Constructor<Model<boolean>>): any;
22
22
  export declare function createAssignGtinOwnerHandler<M extends Model, R extends Repo<M>, V>(this: R, context: FabricContractContext, data: V, key: keyof M, model: {
23
23
  productCode: string;
24
24
  }): Promise<void>;
25
25
  export declare function deleteAssignGtinOwnerHandler<M extends Model, R extends Repo<M>, V>(this: R, context: FabricContractContext, data: V, key: keyof M, model: {
26
26
  productCode: string;
27
27
  }): Promise<void>;
28
- export declare function assignProductOwner(): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor | number) => void;
28
+ export declare function assignProductOwner(): any;
@@ -3,6 +3,6 @@ export declare class GtinValidator extends Validator {
3
3
  constructor(message?: string);
4
4
  hasErrors(value: number | string, options?: ValidatorOptions): string | undefined;
5
5
  }
6
- export declare const gtin: (message?: string) => (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor | number) => void;
6
+ export declare const gtin: (message?: string) => any;
7
7
  export declare function generateGtin(): string;
8
8
  export declare function getBatch(): string;
@@ -3,6 +3,6 @@ export declare class GtinValidator extends Validator {
3
3
  constructor(message?: string);
4
4
  hasErrors(value: number | string, options?: ValidatorOptions): string | undefined;
5
5
  }
6
- export declare const gtin: (message?: string) => (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor | number) => void;
6
+ export declare const gtin: (message?: string) => any;
7
7
  export declare function generateGtin(): string;
8
8
  export declare function getBatch(): string;
@@ -3,4 +3,4 @@ import { Repository } from "@decaf-ts/core";
3
3
  import type { FabricContractContext } from "../../contracts/index.d.cts";
4
4
  export declare function updateHistoryHandler<M extends Model, R extends Repository<M, any>>(this: R, context: FabricContractContext, data: any, key: keyof M, model: M, oldModel: M): Promise<void>;
5
5
  export declare function deleteHistoryHandler<M extends Model, R extends Repository<M, any>>(this: R, context: FabricContractContext, data: any, key: keyof M, model: M): Promise<void>;
6
- export declare function historyDec(): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor | number) => void;
6
+ export declare function historyDec(): any;
@@ -3,4 +3,4 @@ import { Repository } from "@decaf-ts/core";
3
3
  import type { FabricContractContext } from "../../contracts/index.d.mts";
4
4
  export declare function updateHistoryHandler<M extends Model, R extends Repository<M, any>>(this: R, context: FabricContractContext, data: any, key: keyof M, model: M, oldModel: M): Promise<void>;
5
5
  export declare function deleteHistoryHandler<M extends Model, R extends Repository<M, any>>(this: R, context: FabricContractContext, data: any, key: keyof M, model: M): Promise<void>;
6
- export declare function historyDec(): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor | number) => void;
6
+ export declare function historyDec(): any;
@@ -5,7 +5,7 @@ import { FabricContractContext } from "./ContractContext.d.cts";
5
5
  import { BaseError, BulkCrudOperationKeys, OperationKeys, PrimaryKeyType } from "@decaf-ts/db-decorators";
6
6
  import { Context as Ctx } from "fabric-contract-api";
7
7
  import { Logger } from "@decaf-ts/logging";
8
- import { RelationsMetadata, Sequence, SequenceOptions, Adapter, AdapterFlags, PreparedModel, Repository, ContextualizedArgs, Context, RawResult, Paginator, ContextualArgs, MaybeContextualArg, MethodOrOperation, AllOperationKeys, FlagsOf, ContextOf, EventIds, Dispatch } from "@decaf-ts/core";
8
+ import { RelationsMetadata, SerializedPage, Sequence, SequenceOptions, Adapter, AdapterFlags, PreparedModel, Repository, ContextualizedArgs, DirectionLimitOffset, Context, RawResult, Paginator, ContextualArgs, MaybeContextualArg, MethodOrOperation, AllOperationKeys, FlagsOf, ContextOf, OrderDirection, EventIds, Dispatch } from "@decaf-ts/core";
9
9
  import { FabricContractRepository } from "./FabricContractRepository.d.cts";
10
10
  import { ChaincodeStub, ClientIdentity, Iterators, StateQueryResponse } from "fabric-shim-api";
11
11
  import { FabricStatement } from "./FabricContractStatement.d.cts";
@@ -277,6 +277,7 @@ export declare class FabricContractAdapter extends CouchDBAdapter<any, void, Fab
277
277
  * @return {Promise<M[]>} Promise resolving to an array of reconstructed model instances
278
278
  */
279
279
  rangeList<M extends Model>(clazz: Constructor<M>, attributes?: string[], ...args: ContextualArgs<FabricContractContext>): Promise<M[]>;
280
+ paginateByPrimaryKeyRange<M extends Model>(clazz: Constructor<M>, order: OrderDirection, ref: Omit<DirectionLimitOffset, "direction">, ...args: ContextualArgs<FabricContractContext>): Promise<SerializedPage<M>>;
280
281
  view<R>(ddoc: string, viewName: string, options: Record<string, any>, ..._args: ContextualArgs<FabricContractContext>): Promise<ViewResponse<R>>;
281
282
  Statement<M extends Model>(overrides?: Partial<AdapterFlags>): FabricStatement<M, any>;
282
283
  updateAll<M extends Model>(tableName: Constructor<M>, id: PrimaryKeyType[], model: Record<string, any>[], ...args: ContextualArgs<FabricContractContext>): Promise<Record<string, any>[]>;
@@ -5,7 +5,7 @@ import { FabricContractContext } from "./ContractContext.d.mts";
5
5
  import { BaseError, BulkCrudOperationKeys, OperationKeys, PrimaryKeyType } from "@decaf-ts/db-decorators";
6
6
  import { Context as Ctx } from "fabric-contract-api";
7
7
  import { Logger } from "@decaf-ts/logging";
8
- import { RelationsMetadata, Sequence, SequenceOptions, Adapter, AdapterFlags, PreparedModel, Repository, ContextualizedArgs, Context, RawResult, Paginator, ContextualArgs, MaybeContextualArg, MethodOrOperation, AllOperationKeys, FlagsOf, ContextOf, EventIds, Dispatch } from "@decaf-ts/core";
8
+ import { RelationsMetadata, SerializedPage, Sequence, SequenceOptions, Adapter, AdapterFlags, PreparedModel, Repository, ContextualizedArgs, DirectionLimitOffset, Context, RawResult, Paginator, ContextualArgs, MaybeContextualArg, MethodOrOperation, AllOperationKeys, FlagsOf, ContextOf, OrderDirection, EventIds, Dispatch } from "@decaf-ts/core";
9
9
  import { FabricContractRepository } from "./FabricContractRepository.d.mts";
10
10
  import { ChaincodeStub, ClientIdentity, Iterators, StateQueryResponse } from "fabric-shim-api";
11
11
  import { FabricStatement } from "./FabricContractStatement.d.mts";
@@ -277,6 +277,7 @@ export declare class FabricContractAdapter extends CouchDBAdapter<any, void, Fab
277
277
  * @return {Promise<M[]>} Promise resolving to an array of reconstructed model instances
278
278
  */
279
279
  rangeList<M extends Model>(clazz: Constructor<M>, attributes?: string[], ...args: ContextualArgs<FabricContractContext>): Promise<M[]>;
280
+ paginateByPrimaryKeyRange<M extends Model>(clazz: Constructor<M>, order: OrderDirection, ref: Omit<DirectionLimitOffset, "direction">, ...args: ContextualArgs<FabricContractContext>): Promise<SerializedPage<M>>;
280
281
  view<R>(ddoc: string, viewName: string, options: Record<string, any>, ..._args: ContextualArgs<FabricContractContext>): Promise<ViewResponse<R>>;
281
282
  Statement<M extends Model>(overrides?: Partial<AdapterFlags>): FabricStatement<M, any>;
282
283
  updateAll<M extends Model>(tableName: Constructor<M>, id: PrimaryKeyType[], model: Record<string, any>[], ...args: ContextualArgs<FabricContractContext>): Promise<Record<string, any>[]>;
@@ -128,6 +128,11 @@ export type FabricFlags<LOG extends Logger = Logger> = AdapterFlags<LOG> & {
128
128
  * CouchDB index and an adapter-generated synthetic bookmark.
129
129
  */
130
130
  strictPrivateMangoPagination?: boolean;
131
+ /**
132
+ * Enables the pk-range pagination optimization for simple pk-ordered queries.
133
+ * When disabled, repository pagination keeps using the Mango-based path.
134
+ */
135
+ pkRangePagination?: boolean;
131
136
  /**
132
137
  * Field used as the deterministic tie-breaker for strict private Mango
133
138
  * pagination.
@@ -128,6 +128,11 @@ export type FabricFlags<LOG extends Logger = Logger> = AdapterFlags<LOG> & {
128
128
  * CouchDB index and an adapter-generated synthetic bookmark.
129
129
  */
130
130
  strictPrivateMangoPagination?: boolean;
131
+ /**
132
+ * Enables the pk-range pagination optimization for simple pk-ordered queries.
133
+ * When disabled, repository pagination keeps using the Mango-based path.
134
+ */
135
+ pkRangePagination?: boolean;
131
136
  /**
132
137
  * Field used as the deterministic tie-breaker for strict private Mango
133
138
  * pagination.
@@ -1,16 +1,16 @@
1
- export declare const VERSION = "0.13.31";
1
+ export declare const VERSION = "0.13.32";
2
2
  /**
3
3
  * @description Represents the current commit hash of the module build.
4
4
  * @summary Stores the current git commit hash for the package. The build replaces
5
5
  * the placeholder with the actual commit hash at publish time.
6
6
  * @const COMMIT
7
7
  */
8
- export declare const COMMIT = "556cef0";
8
+ export declare const COMMIT = "7778dfd";
9
9
  /**
10
10
  * @description Represents the full version string of the module.
11
11
  * @summary Stores the semver version and commit hash for the package.
12
12
  * The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
13
13
  * @const FULL_VERSION
14
14
  */
15
- export declare const FULL_VERSION = "0.13.31-556cef0";
15
+ export declare const FULL_VERSION = "0.13.32-7778dfd";
16
16
  export declare const PACKAGE_NAME = "@decaf-ts/for-fabric";
@@ -1,16 +1,16 @@
1
- export declare const VERSION = "0.13.31";
1
+ export declare const VERSION = "0.13.32";
2
2
  /**
3
3
  * @description Represents the current commit hash of the module build.
4
4
  * @summary Stores the current git commit hash for the package. The build replaces
5
5
  * the placeholder with the actual commit hash at publish time.
6
6
  * @const COMMIT
7
7
  */
8
- export declare const COMMIT = "556cef0";
8
+ export declare const COMMIT = "7778dfd";
9
9
  /**
10
10
  * @description Represents the full version string of the module.
11
11
  * @summary Stores the semver version and commit hash for the package.
12
12
  * The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
13
13
  * @const FULL_VERSION
14
14
  */
15
- export declare const FULL_VERSION = "0.13.31-556cef0";
15
+ export declare const FULL_VERSION = "0.13.32-7778dfd";
16
16
  export declare const PACKAGE_NAME = "@decaf-ts/for-fabric";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/for-fabric",
3
- "version": "0.13.32",
3
+ "version": "0.13.33",
4
4
  "packageManager": "npm@11.13.0",
5
5
  "description": "Abstracts fabric logic",
6
6
  "type": "module",