@rentman/rm-core 1.0.19 → 1.0.21

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.
@@ -0,0 +1,16 @@
1
+ import ApiResponseProcessorFactory from '../factories/ApiResponseProcessorFactory';
2
+ import ApiRequestServiceInterface from '../interfaces/ApiRequestServiceInterface';
3
+ export default class ApiRequestService {
4
+ private externalApiRequestService;
5
+ private apiResponseProcessorFactory;
6
+ constructor(externalApiRequestService: ApiRequestServiceInterface, apiResponseProcessorFactory: ApiResponseProcessorFactory);
7
+ template(itemType: string, params: any): Promise<any>;
8
+ create(itemType: string, itemId: number, values: any, parentType?: string, parentId?: number): Promise<any>;
9
+ delete(itemType: string, itemIds: number[]): Promise<any>;
10
+ updateItems(itemType: string, items: object, columns: any): Promise<any>;
11
+ requestSkeleton(params: any, requestCanceler?: Promise<any>): Promise<any>;
12
+ moveItems(parentType: string, parentId: number, items: object): Promise<any>;
13
+ columns(itemType: string, columns: object, params?: any): Promise<any>;
14
+ query(itemType: string, query: object, columns: object, allLinks?: boolean, limit?: object): Promise<any>;
15
+ processResponse(request: any): any;
16
+ }
@@ -11,6 +11,7 @@ export default class ColumnUtil {
11
11
  'D': string;
12
12
  'd': string;
13
13
  };
14
+ isStringColumn(column: any): boolean;
14
15
  isFloatColumn(column: any): boolean;
15
16
  isIntColumn(column: any): boolean;
16
17
  isNumberColumn(column: any): boolean;
@@ -81,7 +81,11 @@ export default class ItemAdministrator {
81
81
  saveCurrentResourceCache(closeTab: boolean, parameters: any, breakupByParent: boolean, onAfterCreateCallback: any, keepTabHeading?: boolean): any;
82
82
  getCurrentCollections(): CollectionCache;
83
83
  getCurrentItems(): ItemCache;
84
- getCurrentChanges(): void;
84
+ getCurrentChanges(): {
85
+ itemType: string;
86
+ itemId: number;
87
+ items: any;
88
+ };
85
89
  addSingleItem(itemEntry: any, options: any, isRoot?: boolean): ItemResource;
86
90
  addSingleItems(itemEntries: any[], options: any): any[];
87
91
  addCollection(collectionEntry: any, resourceOptions: any, processOptions?: any): CollectionResource;
@@ -6,7 +6,7 @@ export default class ItemCache {
6
6
  private itemEntryService;
7
7
  entries: {};
8
8
  constructor(queryMatcherFactory: QueryMatcherFactory, itemEntryService: ItemEntryService);
9
- some(callback: any): boolean;
9
+ some(callback: (itemEntry) => boolean): boolean;
10
10
  getByItemType(itemType: any): any[];
11
11
  getByQuery(itemType: any, query: any): any[];
12
12
  getLocalByQuery(itemType: any, query: any): any[];
@@ -10,7 +10,11 @@ export default class ModuleChangesCompiler {
10
10
  parentMap: any;
11
11
  destination: any;
12
12
  constructor(itemEntryService: ItemEntryService, rootItemEntry: ItemEntry, singleItemCache: ItemCache, collectionCache: CollectionCache);
13
- process(): void;
13
+ process(): {
14
+ itemType: string;
15
+ itemId: number;
16
+ items: any;
17
+ };
14
18
  private createParentMap(itemCache);
15
19
  private processItems(itemType, itemEntries, linkAccumulator);
16
20
  private processItem(itemEntry);
@@ -1,7 +1,7 @@
1
1
  export default class QueryParser {
2
2
  query: any;
3
3
  parameters: any;
4
- constructor(query: any, parameters: any);
4
+ constructor(query: any, parameters?: any);
5
5
  private processValue(value);
6
6
  private compareParsedQueries(a, b);
7
7
  parse(query?: any): any;
@@ -3,7 +3,6 @@ import ColumnSetFactory from '../factories/ColumnSetFactory';
3
3
  import RequestColumnExpansionFactory from '../factories/RequestColumnExpansionFactory';
4
4
  import ApiRequestServiceInterface from '../interfaces/ApiRequestServiceInterface';
5
5
  import ErrorHandlerInterface from '../interfaces/ErrorHandlerInterface';
6
- import SocketMessageInterface from '../interfaces/SocketMessageInterface';
7
6
  import ApiFormatter from './ApiFormatter';
8
7
  import CollectionHandler from './CollectionHandler';
9
8
  import ItemEntryService from './ItemEntryService';
@@ -12,7 +11,6 @@ import PromiseService from './PromiseService';
12
11
  export default class SocketMessageHandler {
13
12
  private promiseService;
14
13
  private apiRequestService;
15
- private socketMessageService;
16
14
  private itemHandler;
17
15
  private itemEntryService;
18
16
  private collectionHandler;
@@ -21,9 +19,7 @@ export default class SocketMessageHandler {
21
19
  private requestColumnExpansionFactory;
22
20
  private apiFormatter;
23
21
  private errorHandler;
24
- private deregisterEventListener;
25
- constructor(promiseService: PromiseService, apiRequestService: ApiRequestServiceInterface, socketMessageService: SocketMessageInterface, itemHandler: ItemHandler, itemEntryService: ItemEntryService, collectionHandler: CollectionHandler, columnSetFactory: ColumnSetFactory, columnExpansionFactory: ColumnExpansionFactory, requestColumnExpansionFactory: RequestColumnExpansionFactory, apiFormatter: ApiFormatter, errorHandler: ErrorHandlerInterface);
26
- destroy(): void;
22
+ constructor(promiseService: PromiseService, apiRequestService: ApiRequestServiceInterface, itemHandler: ItemHandler, itemEntryService: ItemEntryService, collectionHandler: CollectionHandler, columnSetFactory: ColumnSetFactory, columnExpansionFactory: ColumnExpansionFactory, requestColumnExpansionFactory: RequestColumnExpansionFactory, apiFormatter: ApiFormatter, errorHandler: ErrorHandlerInterface);
27
23
  onMessageReceived(message: any): void;
28
24
  formatMessageValues(values: any, columns: any): {};
29
25
  createCollectionMap(itemType: any, items: any, columns: any): {};
@@ -22,4 +22,4 @@ export declare function isElement(node: any): boolean;
22
22
  export declare function isWindow(obj: any): boolean;
23
23
  export declare function isDefined(value: any): boolean;
24
24
  export declare function equals(o1: any, o2: any): boolean;
25
- export declare function copy(source: any, destination?: any, maxDepth?: number): any;
25
+ export declare function copy(source: any, destination?: any, maxDepth?: any): any;
@@ -1,12 +1,25 @@
1
+ import ApiFormatter from '../classes/ApiFormatter';
2
+ import ChangesProcessor from '../classes/ChangesProcessor';
3
+ import CollectionHandler from '../classes/CollectionHandler';
1
4
  import ItemEntryService from '../classes/ItemEntryService';
2
5
  import ItemResourceService from "../classes/ItemResourceService";
6
+ import LockService from '../classes/LockService';
7
+ import PromiseService from '../classes/PromiseService';
8
+ import ErrorHandlerInterface from '../interfaces/ErrorHandlerInterface';
3
9
  import { EditResource } from "../models/EditResource";
4
10
  import ItemEntry from "../models/ItemEntry";
5
11
  import ItemResource from "../models/ItemResource";
12
+ import { ViewResource } from "../models/ViewResource";
6
13
  export default class ItemResourceFactory {
7
14
  private itemEntryService;
8
15
  private itemResourceService;
9
- constructor(itemEntryService: ItemEntryService, itemResourceService: ItemResourceService);
10
- getConstructor(options: any): (itemEntry: any) => EditResource;
16
+ private apiFormatter;
17
+ private lockService;
18
+ private changesProcessor;
19
+ private collectionHandler;
20
+ private errorHandler;
21
+ private promiseService;
22
+ constructor(itemEntryService: ItemEntryService, itemResourceService: ItemResourceService, apiFormatter: ApiFormatter, lockService: LockService, changesProcessor: ChangesProcessor, collectionHandler: CollectionHandler, errorHandler: ErrorHandlerInterface, promiseService: PromiseService);
23
+ getConstructor(options: any): (itemEntry: any) => EditResource | ViewResource;
11
24
  construct(itemEntry: ItemEntry, options: any): ItemResource;
12
25
  }
@@ -1,5 +1,5 @@
1
1
  import QueryParser from "../classes/QueryParser";
2
2
  export default class QueryParserFactory {
3
3
  constructor();
4
- construct(query: any, parameters: any): QueryParser;
4
+ construct(query: any, parameters?: any): QueryParser;
5
5
  }
@@ -1,4 +1,5 @@
1
1
  import ApiFormatter from './classes/ApiFormatter';
2
+ import ApiRequestService from './classes/ApiRequestService';
2
3
  import CollectionEntryService from "./classes/CollectionEntryService";
3
4
  import CollectionHandler from "./classes/CollectionHandler";
4
5
  import CollectionResourceService from './classes/CollectionResourceService';
@@ -37,8 +38,8 @@ import ApiRequestServiceInterface from './interfaces/ApiRequestServiceInterface'
37
38
  import AuthInterface from './interfaces/AuthInterface';
38
39
  import ErrorHandlerInterface from './interfaces/ErrorHandlerInterface';
39
40
  import ResourceCacheInterface from './interfaces/ResourceCacheInterface';
40
- import SocketMessageInterface from './interfaces/SocketMessageInterface';
41
41
  export default class RmCore {
42
+ version: string;
42
43
  promiseService: PromiseService;
43
44
  apiFormatter: ApiFormatter;
44
45
  keyService: KeyService;
@@ -74,8 +75,9 @@ export default class RmCore {
74
75
  queryParserFactory: QueryParserFactory;
75
76
  batchStatusFactory: BatchStatusFactory;
76
77
  socketMessageHandler: SocketMessageHandler;
78
+ apiRequestService: ApiRequestService;
77
79
  destroy: () => void;
78
- constructor(apiRequestService: ApiRequestServiceInterface, resourceCacheInterface: ResourceCacheInterface, authInterface: AuthInterface, errorHandlerInterface: ErrorHandlerInterface, socketMessageService: SocketMessageInterface);
80
+ constructor(externalApiRequestService: ApiRequestServiceInterface, resourceCacheInterface: ResourceCacheInterface, authInterface: AuthInterface, errorHandlerInterface: ErrorHandlerInterface);
79
81
  }
80
82
  export declare function noop(): void;
81
83
  export declare function identity(value: any): any;
@@ -1,7 +1,31 @@
1
+ import ApiFormatter from '../classes/ApiFormatter';
2
+ import ChangesProcessor from '../classes/ChangesProcessor';
3
+ import CollectionHandler from '../classes/CollectionHandler';
1
4
  import ItemEntryService from "../classes/ItemEntryService";
5
+ import LockService from '../classes/LockService';
6
+ import PromiseService from '../classes/PromiseService';
7
+ import ErrorHandlerInterface from '../interfaces/ErrorHandlerInterface';
2
8
  import ItemEntry from "./ItemEntry";
3
9
  import ItemResource from "./ItemResource";
4
10
  export declare class EditResource extends ItemResource {
11
+ private apiFormatter;
12
+ private lockService;
13
+ private changesProcessor;
14
+ private collectionHandler;
15
+ private errorHandler;
16
+ private promiseService;
5
17
  fields: any;
6
- constructor(itemEntryService: ItemEntryService, entry: ItemEntry, options: any);
18
+ localCopies: any[];
19
+ transactions: number;
20
+ hasChanges: boolean;
21
+ constructor(itemEntryService: ItemEntryService, entry: ItemEntry, options: any, apiFormatter: ApiFormatter, lockService: LockService, changesProcessor: ChangesProcessor, collectionHandler: CollectionHandler, errorHandler: ErrorHandlerInterface, promiseService: PromiseService);
22
+ startTransaction(): void;
23
+ rollback(): void;
24
+ commit(initial: any): void;
25
+ getLocalCopy(): any;
26
+ copyFields(destination?: any): any;
27
+ setFields(values: any, callOnChange: any): this;
28
+ callOnChange(previous: any): void;
29
+ save(parameters?: any): any;
30
+ saveLocal(): any;
7
31
  }
@@ -1,13 +1,14 @@
1
1
  import ItemEntryService from '../classes/ItemEntryService';
2
2
  import ItemEntry from "./ItemEntry";
3
3
  export default class ItemResource {
4
- private itemEntryService;
4
+ protected itemEntryService: ItemEntryService;
5
5
  entry: ItemEntry;
6
6
  options: any;
7
7
  derived: any;
8
8
  columns: any;
9
9
  fields: any;
10
10
  constructor(itemEntryService: ItemEntryService, entry: ItemEntry, options: any);
11
+ isNewResource(resource: any): boolean;
11
12
  isLocal(): boolean;
12
13
  clearResource(): void;
13
14
  deactivate(): void;