npm package diff
Package: @forge/storage
Versions: 1.5.15-experimental-f6dcf26 - 1.5.15-experimental-204139e
File: package/out/entity-storage/custom-entity-transaction-api.d.ts
Index: package/out/entity-storage/custom-entity-transaction-api.d.ts
===================================================================
--- package/out/entity-storage/custom-entity-transaction-api.d.ts
+++ package/out/entity-storage/custom-entity-transaction-api.d.ts
@@ -0,0 +1,64 @@
+import { FilterPredicate, GlobalStorage } from '..';
+import { FilterOperator } from '../query-interfaces';
+interface CustomEntityTransactionSet {
+ transactionType: 'set' | 'delete' | 'check';
+ entity: string;
+ key: string;
+ value: Record<string, any>;
+ conditions?: any[];
+ conditionOperator?: FilterOperator;
+}
+interface CustomEntityTransactionDelete {
+ transactionType: 'set' | 'delete' | 'check';
+ entity: string;
+ key: string;
+ conditions?: any[];
+ conditionOperator?: FilterOperator;
+}
+export declare type CustomEntityTransactionOptions = Record<string, CustomEntityTransactionSet | CustomEntityTransactionDelete>;
+export declare class DefaultCustomEntityTransactionBuilder implements CustomEntityTransactionBuilder {
+ protected globalStorage: Pick<GlobalStorage, 'transaction'>;
+ protected entityName: string;
+ protected transactionOptions: CustomEntityTransactionOptions;
+ constructor(globalStorage: Pick<GlobalStorage, 'transaction'>, entityName: string, transactionOptions?: CustomEntityTransactionOptions);
+ private getKeyWithEntityName;
+ entity(name: string): CustomEntityTransactionBuilder;
+ set(key: string, value: Record<string, any>): CustomEntityTransactionBuilderWithAndOrCondition;
+ delete(key: string): CustomEntityTransactionBuilderWithAndOrCondition;
+ check(key: string): CustomEntityTransactionBuilderWithAndOrCondition;
+ execute(): Promise<void>;
+}
+export declare class CustomEntityTransactionBuilderWithAndCondition extends DefaultCustomEntityTransactionBuilder {
+ protected globalStorage: Pick<GlobalStorage, 'transaction'>;
+ protected entityName: string;
+ protected key: string;
+ protected transactionOptions: CustomEntityTransactionOptions;
+ constructor(globalStorage: Pick<GlobalStorage, 'transaction'>, entityName: string, key: string, transactionOptions?: CustomEntityTransactionOptions);
+ andCondition(field: string, condition: FilterPredicate): CustomEntityTransactionBuilderWithAndCondition;
+}
+export declare class CustomEntityTransactionBuilderWithOrCondition extends DefaultCustomEntityTransactionBuilder {
+ protected globalStorage: Pick<GlobalStorage, 'transaction'>;
+ protected entityName: string;
+ protected key: string;
+ protected transactionOptions: CustomEntityTransactionOptions;
+ constructor(globalStorage: Pick<GlobalStorage, 'transaction'>, entityName: string, key: string, transactionOptions?: CustomEntityTransactionOptions);
+ orCondition(field: string, condition: FilterPredicate): CustomEntityTransactionBuilderWithOrCondition;
+}
+export declare class CustomEntityTransactionBuilderWithAndOrCondition extends DefaultCustomEntityTransactionBuilder {
+ protected globalStorage: Pick<GlobalStorage, 'transaction'>;
+ protected entityName: string;
+ protected key: string;
+ protected transactionOptions: CustomEntityTransactionOptions;
+ constructor(globalStorage: Pick<GlobalStorage, 'transaction'>, entityName: string, key: string, transactionOptions?: CustomEntityTransactionOptions);
+ andCondition(field: string, condition: FilterPredicate): CustomEntityTransactionBuilderWithAndCondition;
+ orCondition(field: string, condition: FilterPredicate): CustomEntityTransactionBuilderWithOrCondition;
+}
+export interface CustomEntityTransactionBuilder {
+ entity(name: string): CustomEntityTransactionBuilder;
+ set(key: string, value: Record<string, any>, conditions?: any[]): CustomEntityTransactionBuilderWithAndOrCondition;
+ delete(key: string, conditions?: any[]): CustomEntityTransactionBuilderWithAndOrCondition;
+ check(key: string, conditions: any[]): CustomEntityTransactionBuilderWithAndOrCondition;
+ execute(): Promise<void>;
+}
+export {};
+//# sourceMappingURL=custom-entity-transaction-api.d.ts.map
\ No newline at end of file