npm package diff
Package: @forge/storage
Versions: 1.5.15-experimental-f6dcf26 - 1.5.15-experimental-204139e
File: package/out/storage-adapter.d.ts
Index: package/out/storage-adapter.d.ts
===================================================================
--- package/out/storage-adapter.d.ts
+++ package/out/storage-adapter.d.ts
@@ -1,5 +1,6 @@
import { EntityStorageBuilderType } from './entity-storage';
+import { CustomEntityTransactionBuilder } from './entity-storage/custom-entity-transaction-api';
import { BeginsWithClause, BetweenClause, ExistsClause, DoesNotExistClause, GreaterThanClause, GreaterThanEqualToClause, StartsWith, NotEqualTo, In, LessThanClause, LessThanEqualToClause, ContainsClause, DoesNotContainClause, IsNotEqualToClause, EqualToClause } from './query-interfaces';
export interface BulkItem {
key: string;
value: string | number | boolean | Record<string, any> | any[];
@@ -33,8 +34,11 @@
export declare type SharedStorageAdapter = StorageAdapter & EntityStorageAdapter;
export interface QueryApi {
query(): QueryBuilder;
}
+export interface TransactionApi {
+ transaction(): TransactionBuilder;
+}
export declare type Predicate = StartsWith | NotEqualTo | In;
export declare type Condition = Predicate;
export interface QueryBuilder {
where(field: 'key', condition: Condition): QueryBuilder;
@@ -42,8 +46,18 @@
limit(limit: number): QueryBuilder;
getMany(): Promise<ListResult>;
getOne(): Promise<Result | undefined>;
}
+export interface KVSTransactionBuilderInterface {
+ set(key: string, value: string | number | boolean | Record<string, any> | any[]): KVSTransactionBuilderInterface;
+ delete(key: string): KVSTransactionBuilderInterface;
+ execute(): Promise<void>;
+}
+export interface TransactionBuilder {
+ entity(name: string): CustomEntityTransactionBuilder;
+ set(key: string, value: string | number | boolean | Record<string, any> | any[]): KVSTransactionBuilderInterface;
+ delete(key: string): KVSTransactionBuilderInterface;
+}
export declare type FilterPredicate = BetweenClause | BeginsWithClause | ExistsClause | DoesNotExistClause | GreaterThanClause | GreaterThanEqualToClause | LessThanClause | LessThanEqualToClause | ContainsClause | DoesNotContainClause | EqualToClause | IsNotEqualToClause;
export declare type WherePredicate = BetweenClause | BeginsWithClause | EqualToClause | GreaterThanClause | GreaterThanEqualToClause | LessThanClause | LessThanEqualToClause;
export interface Result<T = object> {
key: string;