@rentman/rm-core 6.0.0 → 6.0.2
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.
- package/changelog.md +713 -707
- package/dist/rm-core.js +9559 -9558
- package/dist/rm-core.min.js +2 -2
- package/dist/types/classes/ApiFormatter.d.ts +55 -55
- package/dist/types/classes/ApiRequestService.d.ts +20 -20
- package/dist/types/classes/ApiResponseProcessor.d.ts +31 -31
- package/dist/types/classes/ChangesCompilation.d.ts +34 -34
- package/dist/types/classes/ChangesDelta.d.ts +59 -59
- package/dist/types/classes/ChangesDeltaBase.d.ts +50 -50
- package/dist/types/classes/ChangesProcessor.d.ts +47 -47
- package/dist/types/classes/CollectionEntryService.d.ts +26 -26
- package/dist/types/classes/CollectionMatcherBase.d.ts +21 -21
- package/dist/types/classes/CollectionMatcherCachedCollectionProcessor.d.ts +31 -31
- package/dist/types/classes/CollectionResourceService.d.ts +7 -7
- package/dist/types/classes/ColumnCache.d.ts +21 -21
- package/dist/types/classes/ColumnExpansion.d.ts +22 -22
- package/dist/types/classes/ColumnHandler.d.ts +21 -21
- package/dist/types/classes/ColumnInfo.d.ts +14 -14
- package/dist/types/classes/ColumnSet.d.ts +38 -38
- package/dist/types/classes/ColumnSubsetCache.d.ts +10 -10
- package/dist/types/classes/ColumnUtil.d.ts +99 -99
- package/dist/types/classes/ConversionMapService.d.ts +27 -27
- package/dist/types/classes/CreateRequest.d.ts +19 -19
- package/dist/types/classes/CreatedChangesDelta.d.ts +15 -15
- package/dist/types/classes/InternalChangesDelta.d.ts +39 -39
- package/dist/types/classes/ItemCache.d.ts +29 -29
- package/dist/types/classes/ItemCreateService.d.ts +24 -24
- package/dist/types/classes/ItemEntryService.d.ts +34 -34
- package/dist/types/classes/KeyService.d.ts +17 -17
- package/dist/types/classes/LockService.d.ts +32 -32
- package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -18
- package/dist/types/classes/QueryColumnExtractor.d.ts +20 -20
- package/dist/types/classes/QueryLinkedToParser.d.ts +16 -16
- package/dist/types/classes/QueryLocallyMatchableParser.d.ts +19 -19
- package/dist/types/classes/QueryMatcher.d.ts +18 -18
- package/dist/types/classes/QueryParser.d.ts +24 -24
- package/dist/types/classes/QueryParserBase.d.ts +29 -29
- package/dist/types/classes/QueryParserIdUpdater.d.ts +16 -16
- package/dist/types/classes/QueryService.d.ts +18 -18
- package/dist/types/classes/RequestBuffer.d.ts +28 -28
- package/dist/types/classes/RequestBufferManager.d.ts +25 -25
- package/dist/types/classes/RequestColumnExpansion.d.ts +15 -15
- package/dist/types/classes/SocketMessageHandler.d.ts +39 -39
- package/dist/types/classes/TemplateCache.d.ts +66 -66
- package/dist/types/classes/Util.d.ts +30 -30
- package/dist/types/classes/cache/AbstractCache.d.ts +102 -102
- package/dist/types/classes/cache/CachedQueryHandlerBase.d.ts +73 -73
- package/dist/types/classes/cache/CollectionMatcherCachedQueryProcessor.d.ts +35 -35
- package/dist/types/classes/cache/ItemHandlerBase.d.ts +93 -93
- package/dist/types/classes/cache/server/ServerCache.d.ts +82 -82
- package/dist/types/classes/cache/server/ServerCachedQueryHandler.d.ts +34 -34
- package/dist/types/classes/cache/server/ServerItemHandler.d.ts +52 -52
- package/dist/types/classes/cache/transaction/TransactionCache.d.ts +330 -330
- package/dist/types/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +23 -23
- package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +28 -28
- package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +24 -24
- package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +90 -90
- package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +28 -28
- package/dist/types/classes/index.d.ts +46 -46
- package/dist/types/constants.d.ts +7 -7
- package/dist/types/core.d.ts +51 -51
- package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
- package/dist/types/factories/ChangesCompilationFactory.d.ts +6 -6
- package/dist/types/factories/ChangesDeltaFactory.d.ts +11 -11
- package/dist/types/factories/ChangesProcessorFactory.d.ts +22 -22
- package/dist/types/factories/CollectionEntryFactory.d.ts +14 -14
- package/dist/types/factories/CollectionMatcherFactory.d.ts +19 -19
- package/dist/types/factories/CollectionResourceFactory.d.ts +22 -22
- package/dist/types/factories/ColumnExpansionFactory.d.ts +8 -8
- package/dist/types/factories/ColumnInfoFactory.d.ts +7 -7
- package/dist/types/factories/ColumnSetFactory.d.ts +19 -19
- package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +7 -7
- package/dist/types/factories/CreateRequestFactory.d.ts +11 -11
- package/dist/types/factories/ItemCacheFactory.d.ts +8 -8
- package/dist/types/factories/ItemEntryFactory.d.ts +15 -15
- package/dist/types/factories/ItemResourceFactory.d.ts +14 -14
- package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +5 -5
- package/dist/types/factories/QueryMatcherFactory.d.ts +7 -7
- package/dist/types/factories/QueryParserFactory.d.ts +6 -6
- package/dist/types/factories/RequestColumnExpansionFactory.d.ts +6 -6
- package/dist/types/factories/TemplateFactory.d.ts +10 -10
- package/dist/types/factories/TransactionCacheFactory.d.ts +15 -15
- package/dist/types/factories/index.d.ts +21 -21
- package/dist/types/index.d.ts +7 -7
- package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +43 -43
- package/dist/types/interfaces/ApiRequestServiceInterface.d.ts +11 -11
- package/dist/types/interfaces/AuthInterface.d.ts +9 -9
- package/dist/types/interfaces/ErrorHandlerInterface.d.ts +5 -5
- package/dist/types/interfaces/ExceptionHandlerInterface.d.ts +3 -3
- package/dist/types/interfaces/LinkTreeServiceInterface.d.ts +4 -4
- package/dist/types/interfaces/PromiseLibraryInterface.d.ts +25 -25
- package/dist/types/interfaces/ServerCacheDependencyInterface.d.ts +7 -7
- package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
- package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +20 -20
- package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +26 -26
- package/dist/types/interfaces/index.d.ts +11 -11
- package/dist/types/models/CollectionEntry.d.ts +23 -23
- package/dist/types/models/CollectionOptions.d.ts +18 -18
- package/dist/types/models/CollectionResource.d.ts +72 -72
- package/dist/types/models/ItemEntry.d.ts +19 -19
- package/dist/types/models/ItemEntryOptions.d.ts +8 -8
- package/dist/types/models/ItemResource.d.ts +84 -84
- package/dist/types/models/Template.d.ts +11 -11
- package/dist/types/models/index.d.ts +7 -7
- package/dist/types/types/ItemTypesCollection.d.ts +263 -263
- package/dist/types/types/PromiseInterface.d.ts +2 -2
- package/dist/types/types/index.d.ts +2 -2
- package/package.json +36 -36
- package/readme.md +15 -15
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ColumnSet } from '../classes';
|
|
2
|
-
import { ItemEntryFactory } from '../factories';
|
|
3
|
-
import { ItemId, ItemType } from '../types';
|
|
4
|
-
export declare class ItemEntry<ItemTypeType extends ItemType = any> {
|
|
5
|
-
private factory;
|
|
6
|
-
itemType: ItemTypeType;
|
|
7
|
-
itemId: ItemId;
|
|
8
|
-
columns: ColumnSet<ItemTypeType>;
|
|
9
|
-
id: number;
|
|
10
|
-
reloadQueued: boolean;
|
|
11
|
-
constructor(factory: ItemEntryFactory, itemType: ItemTypeType, itemId: ItemId, columns: ColumnSet<ItemTypeType>);
|
|
12
|
-
queueReload(): this;
|
|
13
|
-
isLocal(): boolean;
|
|
14
|
-
isLockable(): boolean;
|
|
15
|
-
toJSON(): {
|
|
16
|
-
id: number;
|
|
17
|
-
columns: ColumnSet<ItemTypeType>;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
1
|
+
import { ColumnSet } from '../classes';
|
|
2
|
+
import { ItemEntryFactory } from '../factories';
|
|
3
|
+
import { ItemId, ItemType } from '../types';
|
|
4
|
+
export declare class ItemEntry<ItemTypeType extends ItemType = any> {
|
|
5
|
+
private factory;
|
|
6
|
+
itemType: ItemTypeType;
|
|
7
|
+
itemId: ItemId;
|
|
8
|
+
columns: ColumnSet<ItemTypeType>;
|
|
9
|
+
id: number;
|
|
10
|
+
reloadQueued: boolean;
|
|
11
|
+
constructor(factory: ItemEntryFactory, itemType: ItemTypeType, itemId: ItemId, columns: ColumnSet<ItemTypeType>);
|
|
12
|
+
queueReload(): this;
|
|
13
|
+
isLocal(): boolean;
|
|
14
|
+
isLockable(): boolean;
|
|
15
|
+
toJSON(): {
|
|
16
|
+
id: number;
|
|
17
|
+
columns: ColumnSet<ItemTypeType>;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ApiRequestColumns, EntryParentNull } from '../types';
|
|
2
|
-
export declare type ItemEntryOptionsInterface = Partial<ItemEntryOptions>;
|
|
3
|
-
export declare class ItemEntryOptions {
|
|
4
|
-
columns: ApiRequestColumns;
|
|
5
|
-
parent: EntryParentNull;
|
|
6
|
-
templateOptions: any;
|
|
7
|
-
constructor(values: ItemEntryOptionsInterface);
|
|
8
|
-
}
|
|
1
|
+
import { ApiRequestColumns, EntryParentNull } from '../types';
|
|
2
|
+
export declare type ItemEntryOptionsInterface = Partial<ItemEntryOptions>;
|
|
3
|
+
export declare class ItemEntryOptions {
|
|
4
|
+
columns: ApiRequestColumns;
|
|
5
|
+
parent: EntryParentNull;
|
|
6
|
+
templateOptions: any;
|
|
7
|
+
constructor(values: ItemEntryOptionsInterface);
|
|
8
|
+
}
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import { TransactionCache } from '../classes';
|
|
2
|
-
import { ItemResourceFactory } from '../factories';
|
|
3
|
-
import { ItemEntry } from '../models';
|
|
4
|
-
import { EntryParentNull, FieldMap, ItemType, PromiseInterface, ResponseColumn } from '../types';
|
|
5
|
-
export declare class ItemResource<ItemTypeType extends ItemType = any> {
|
|
6
|
-
protected readonly factory: ItemResourceFactory;
|
|
7
|
-
readonly entry: ItemEntry<ItemTypeType>;
|
|
8
|
-
protected readonly _isNew: boolean;
|
|
9
|
-
protected readonly transaction: TransactionCache;
|
|
10
|
-
columns: {
|
|
11
|
-
[columnId: string]: ResponseColumn;
|
|
12
|
-
};
|
|
13
|
-
fields: FieldMap<ItemTypeType>;
|
|
14
|
-
initial: Readonly<FieldMap<ItemTypeType>>;
|
|
15
|
-
constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, _isNew: boolean, transaction: TransactionCache);
|
|
16
|
-
onConstruct(): void;
|
|
17
|
-
/**
|
|
18
|
-
* @description
|
|
19
|
-
* Updates the fields of the item and calls onChange, when updating many fields of many items it's better to create a {@link ChangesDelta ChangesDelta} yourself so all changes can be applied at once
|
|
20
|
-
*/
|
|
21
|
-
setFields(values: FieldMap<ItemTypeType>): PromiseInterface<this>;
|
|
22
|
-
copyFields(destination?: FieldMap<ItemTypeType>): FieldMap<ItemTypeType>;
|
|
23
|
-
/**
|
|
24
|
-
* Fetches the ItemResource's parent with the current fields
|
|
25
|
-
*
|
|
26
|
-
* ----------------
|
|
27
|
-
*
|
|
28
|
-
* @remark
|
|
29
|
-
* Use this if you need to get the parent after an item has been deleted
|
|
30
|
-
*/
|
|
31
|
-
getParent(fromInitial?: boolean): EntryParentNull;
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated
|
|
34
|
-
* Use {@link TransactionCache.applyChangesDelta transaction.applyChangesDelta} instead
|
|
35
|
-
*/
|
|
36
|
-
callOnChange(previous: FieldMap<ItemTypeType>): void;
|
|
37
|
-
/**
|
|
38
|
-
* @description
|
|
39
|
-
* Utility function to easily check if a field is changed.
|
|
40
|
-
* Will return `false` if the field is changed
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* onChange: (
|
|
44
|
-
* itemResource,
|
|
45
|
-
* previous,
|
|
46
|
-
* compareItemField
|
|
47
|
-
* ) {
|
|
48
|
-
* if (!compareItemField('columnId')) {
|
|
49
|
-
* processItem(itemResource);
|
|
50
|
-
* }
|
|
51
|
-
* }
|
|
52
|
-
*/
|
|
53
|
-
compareItemField(columnId: keyof FieldMap<ItemTypeType>, previous: FieldMap<ItemTypeType>): boolean;
|
|
54
|
-
hasChanges(): boolean;
|
|
55
|
-
setTransactionParameters(parameters: any): void;
|
|
56
|
-
/**
|
|
57
|
-
* @description
|
|
58
|
-
* 'isNew' means that the {@link ItemEntry ItemEntry} is a local item and that this resource was created when the {@link ItemEntry ItemEntry} was first created
|
|
59
|
-
*/
|
|
60
|
-
isNew(): boolean;
|
|
61
|
-
isLocal(): boolean;
|
|
62
|
-
toJSON(): {
|
|
63
|
-
columns: string[];
|
|
64
|
-
fields: FieldMap<ItemTypeType>;
|
|
65
|
-
entry: ItemEntry<ItemTypeType>;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* @description
|
|
69
|
-
* Returns the value of the columnPath, or undefined when the path couldn't be traversed
|
|
70
|
-
*
|
|
71
|
-
* @param columnPath Can either be an array of columnIds (['column', 'column2']) or a config column string ('column>column2')
|
|
72
|
-
*/
|
|
73
|
-
getDerivedValue<T extends any = any>(columnPath: string[] | string): T | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* @description
|
|
76
|
-
* Traverses the column path and returns the fields of the derived item, returns undefined if the item isn't found
|
|
77
|
-
*
|
|
78
|
-
* ---------------------
|
|
79
|
-
*
|
|
80
|
-
* @remark
|
|
81
|
-
* Assumes the derived item's values are already cached
|
|
82
|
-
*/
|
|
83
|
-
getDerivedValues(columnPath: string[]): Readonly<FieldMap> | undefined;
|
|
84
|
-
}
|
|
1
|
+
import { TransactionCache } from '../classes';
|
|
2
|
+
import { ItemResourceFactory } from '../factories';
|
|
3
|
+
import { ItemEntry } from '../models';
|
|
4
|
+
import { EntryParentNull, FieldMap, ItemType, PromiseInterface, ResponseColumn } from '../types';
|
|
5
|
+
export declare class ItemResource<ItemTypeType extends ItemType = any> {
|
|
6
|
+
protected readonly factory: ItemResourceFactory;
|
|
7
|
+
readonly entry: ItemEntry<ItemTypeType>;
|
|
8
|
+
protected readonly _isNew: boolean;
|
|
9
|
+
protected readonly transaction: TransactionCache;
|
|
10
|
+
columns: {
|
|
11
|
+
[columnId: string]: ResponseColumn;
|
|
12
|
+
};
|
|
13
|
+
fields: FieldMap<ItemTypeType>;
|
|
14
|
+
initial: Readonly<FieldMap<ItemTypeType>>;
|
|
15
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, _isNew: boolean, transaction: TransactionCache);
|
|
16
|
+
onConstruct(): void;
|
|
17
|
+
/**
|
|
18
|
+
* @description
|
|
19
|
+
* Updates the fields of the item and calls onChange, when updating many fields of many items it's better to create a {@link ChangesDelta ChangesDelta} yourself so all changes can be applied at once
|
|
20
|
+
*/
|
|
21
|
+
setFields(values: FieldMap<ItemTypeType>): PromiseInterface<this>;
|
|
22
|
+
copyFields(destination?: FieldMap<ItemTypeType>): FieldMap<ItemTypeType>;
|
|
23
|
+
/**
|
|
24
|
+
* Fetches the ItemResource's parent with the current fields
|
|
25
|
+
*
|
|
26
|
+
* ----------------
|
|
27
|
+
*
|
|
28
|
+
* @remark
|
|
29
|
+
* Use this if you need to get the parent after an item has been deleted
|
|
30
|
+
*/
|
|
31
|
+
getParent(fromInitial?: boolean): EntryParentNull;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
* Use {@link TransactionCache.applyChangesDelta transaction.applyChangesDelta} instead
|
|
35
|
+
*/
|
|
36
|
+
callOnChange(previous: FieldMap<ItemTypeType>): void;
|
|
37
|
+
/**
|
|
38
|
+
* @description
|
|
39
|
+
* Utility function to easily check if a field is changed.
|
|
40
|
+
* Will return `false` if the field is changed
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* onChange: (
|
|
44
|
+
* itemResource,
|
|
45
|
+
* previous,
|
|
46
|
+
* compareItemField
|
|
47
|
+
* ) {
|
|
48
|
+
* if (!compareItemField('columnId')) {
|
|
49
|
+
* processItem(itemResource);
|
|
50
|
+
* }
|
|
51
|
+
* }
|
|
52
|
+
*/
|
|
53
|
+
compareItemField(columnId: keyof FieldMap<ItemTypeType>, previous: FieldMap<ItemTypeType>): boolean;
|
|
54
|
+
hasChanges(): boolean;
|
|
55
|
+
setTransactionParameters(parameters: any): void;
|
|
56
|
+
/**
|
|
57
|
+
* @description
|
|
58
|
+
* 'isNew' means that the {@link ItemEntry ItemEntry} is a local item and that this resource was created when the {@link ItemEntry ItemEntry} was first created
|
|
59
|
+
*/
|
|
60
|
+
isNew(): boolean;
|
|
61
|
+
isLocal(): boolean;
|
|
62
|
+
toJSON(): {
|
|
63
|
+
columns: string[];
|
|
64
|
+
fields: FieldMap<ItemTypeType>;
|
|
65
|
+
entry: ItemEntry<ItemTypeType>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @description
|
|
69
|
+
* Returns the value of the columnPath, or undefined when the path couldn't be traversed
|
|
70
|
+
*
|
|
71
|
+
* @param columnPath Can either be an array of columnIds (['column', 'column2']) or a config column string ('column>column2')
|
|
72
|
+
*/
|
|
73
|
+
getDerivedValue<T extends any = any>(columnPath: string[] | string): T | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* @description
|
|
76
|
+
* Traverses the column path and returns the fields of the derived item, returns undefined if the item isn't found
|
|
77
|
+
*
|
|
78
|
+
* ---------------------
|
|
79
|
+
*
|
|
80
|
+
* @remark
|
|
81
|
+
* Assumes the derived item's values are already cached
|
|
82
|
+
*/
|
|
83
|
+
getDerivedValues(columnPath: string[]): Readonly<FieldMap> | undefined;
|
|
84
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ColumnSet } from '../classes';
|
|
2
|
-
import { TemplateFactory } from '../factories';
|
|
3
|
-
import { ApiRequestColumnMap, ApiResponse, FieldMap, ItemType, ResponseColumnItemTypeMap } from '../types';
|
|
4
|
-
export declare class Template<ItemTypeType extends ItemType = any> {
|
|
5
|
-
itemType: ItemTypeType;
|
|
6
|
-
response: ApiResponse;
|
|
7
|
-
responseColumns: ResponseColumnItemTypeMap;
|
|
8
|
-
columns: ColumnSet<ItemTypeType>;
|
|
9
|
-
constructor(factory: TemplateFactory, itemType: ItemTypeType, response: ApiResponse, additionalRequestColumns: ApiRequestColumnMap, additionalResponseColumns: ResponseColumnItemTypeMap);
|
|
10
|
-
getFields(): FieldMap<ItemTypeType>;
|
|
11
|
-
}
|
|
1
|
+
import { ColumnSet } from '../classes';
|
|
2
|
+
import { TemplateFactory } from '../factories';
|
|
3
|
+
import { ApiRequestColumnMap, ApiResponse, FieldMap, ItemType, ResponseColumnItemTypeMap } from '../types';
|
|
4
|
+
export declare class Template<ItemTypeType extends ItemType = any> {
|
|
5
|
+
itemType: ItemTypeType;
|
|
6
|
+
response: ApiResponse;
|
|
7
|
+
responseColumns: ResponseColumnItemTypeMap;
|
|
8
|
+
columns: ColumnSet<ItemTypeType>;
|
|
9
|
+
constructor(factory: TemplateFactory, itemType: ItemTypeType, response: ApiResponse, additionalRequestColumns: ApiRequestColumnMap, additionalResponseColumns: ResponseColumnItemTypeMap);
|
|
10
|
+
getFields(): FieldMap<ItemTypeType>;
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './ItemEntryOptions';
|
|
2
|
-
export * from './ItemEntry';
|
|
3
|
-
export * from './ItemResource';
|
|
4
|
-
export * from './CollectionOptions';
|
|
5
|
-
export * from './CollectionEntry';
|
|
6
|
-
export * from './CollectionResource';
|
|
7
|
-
export * from './Template';
|
|
1
|
+
export * from './ItemEntryOptions';
|
|
2
|
+
export * from './ItemEntry';
|
|
3
|
+
export * from './ItemResource';
|
|
4
|
+
export * from './CollectionOptions';
|
|
5
|
+
export * from './CollectionEntry';
|
|
6
|
+
export * from './CollectionResource';
|
|
7
|
+
export * from './Template';
|