@rentman/rm-core 12.0.0 → 12.0.1

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.
@@ -32,7 +32,7 @@ export declare class ChangesDelta extends ChangesDeltaBase {
32
32
  * - If you want to set a parent set the proper field, you can't pass it as a separate object
33
33
  */
34
34
  setItemCreated<ItemTypeType extends ApiEnumItemType, Fields extends Partial<FieldMap<ItemTypeType>>>(itemType: ItemTypeType, values: Fields): PromiseInterface<this>;
35
- setItemUpdated<ItemTypeType extends ApiEnumItemType>(entry: ItemEntry<ItemTypeType>, fields: Partial<FieldMap<ItemTypeType>>, columnExpansionResult?: ColumnExpansionResult<ItemTypeType> | null, parent?: EntryParentNull, mode?: ChangesDeltaItemUpdateMode): this;
35
+ setItemUpdated<ItemTypeType extends ApiEnumItemType>(entry: ItemEntry<ItemTypeType>, fields: Partial<FieldMap<ItemTypeType>>, columnExpansionResult?: ColumnExpansionResult<ItemTypeType> | null, parent?: EntryParentNull, mode?: ChangesDeltaItemUpdateMode, didChangeAnyFieldOnParentTransaction?: boolean, previous?: FieldMap<ItemTypeType> | null): this;
36
36
  setItemDeleted(deleted: ChangesDeltaItemDeleteDelta): this;
37
37
  setItemsDeleted(deleted: ChangesDeltaItemDeleteDelta[]): this;
38
38
  /**
@@ -20,7 +20,9 @@ export declare type ChangesDeltaItemUpdateDelta<ItemTypeType extends ApiEnumItem
20
20
  fields: FieldMap<ItemTypeType>;
21
21
  parent: EntryParentNull;
22
22
  };
23
+ previous: FieldMap<ItemTypeType> | null;
23
24
  mode: ChangesDeltaItemUpdateMode;
25
+ didChangeAnyField: boolean;
24
26
  };
25
27
  export declare abstract class ChangesDeltaBase {
26
28
  protected itemEntryService: ItemEntryService;
@@ -78,7 +80,7 @@ export declare abstract class ChangesDeltaBase {
78
80
  _setQueryResult(itemType: ApiEnumItemType, queryString: string, itemIds: ItemId[] | {
79
81
  [itemId: string]: true;
80
82
  }): this;
81
- setItemUpdated<ItemTypeType extends ApiEnumItemType>(entry: ItemEntry<ItemTypeType>, fields: Partial<FieldMap<ItemTypeType>>, columnExpansionResult?: ColumnExpansionResult<ItemTypeType> | null, parent?: EntryParentNull, mode?: ChangesDeltaItemUpdateMode): this;
83
+ setItemUpdated<ItemTypeType extends ApiEnumItemType>(entry: ItemEntry<ItemTypeType>, fields: Partial<FieldMap<ItemTypeType>>, columnExpansionResult?: ColumnExpansionResult<ItemTypeType> | null, parent?: EntryParentNull, mode?: ChangesDeltaItemUpdateMode, didChangeAnyFieldOnParentTransaction?: boolean, previous?: FieldMap<ItemTypeType> | null): this;
82
84
  setItemRestored<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, transactionItemEntryChanges: FieldMap<ItemTypeType>): void;
83
85
  isEmpty(): boolean;
84
86
  }
@@ -11,10 +11,16 @@ export interface ItemEntryChangesTuple<ItemTypeType extends ApiEnumItemType> {
11
11
  }
12
12
  export declare type ProcessItemEntryChangesResult<ItemTypeType extends ApiEnumItemType> = {
13
13
  status: ItemCacheStatus.NO_CHANGES | ItemCacheStatus.NOT_CACHED;
14
- previous: null;
14
+ previous: {
15
+ rollback: null;
16
+ complete: null | FieldMap<ItemTypeType>;
17
+ };
15
18
  } | {
16
19
  status: ItemCacheStatus.CACHED;
17
- previous: FieldMap<ItemTypeType>;
20
+ previous: {
21
+ rollback: Partial<FieldMap<ItemTypeType>>;
22
+ complete: null | FieldMap<ItemTypeType>;
23
+ };
18
24
  };
19
25
  export declare abstract class ItemHandlerBase {
20
26
  protected columnUtil: ColumnUtil;
@@ -24,9 +24,9 @@ export declare abstract class TransactionValidator {
24
24
  * Will be called whenever an item is changed, allows you to set errors on the transaction
25
25
  * @param itemEntry
26
26
  * @param fields
27
- * @param previous
27
+ * @param previous Previous contain only fields changed on this transaction
28
28
  */
29
- abstract validateItem<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, fields: FieldMap<ItemTypeType>, previous: FieldMap<ItemTypeType>): void;
29
+ abstract validateItem<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, fields: FieldMap<ItemTypeType>, previous: Partial<FieldMap<ItemTypeType>>): void;
30
30
  protected setGlobalError(key: string, isInvalid: boolean | PromiseInterface<boolean>, saveButtonErrorTranslationFn: () => string, level: TransactionErrorLevel): void;
31
31
  protected setItemError(itemEntryId: ItemEntry['id'], columnId: string, errorKey: string, isInvalid: boolean | PromiseInterface<boolean>, fieldErrorTranslationFn: () => string, saveButtonErrorTranslationFn: () => string, level: TransactionErrorLevel): void;
32
32
  private getHash;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rentman/rm-core",
3
- "version": "12.0.0",
3
+ "version": "12.0.1",
4
4
  "description": "Rentman core functionalities",
5
5
  "main": "./dist/rm-core.js",
6
6
  "types": "./dist/types/src/index.d.ts",