@rentman/rm-core 1.6.7 → 1.6.10

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.
@@ -63,7 +63,7 @@ export declare class ItemAdministrator {
63
63
  }, isRoot?: boolean): PromiseInterface<RemoteViewResource>;
64
64
  getItemByState(itemType: ItemType, stateKey: ItemId | string, options: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<LocalViewResource>;
65
65
  getCollectionDef(itemType: ItemType, options: CollectionOptionsInterface): CollectionDefinition;
66
- getLinkCollectionsDef(linkType: ItemType, linkIdArray: ItemId[] | (() => ItemId[]), itemType: ItemType, linkField: string, options: CollectionOptionsInterface): LinkCollectionDefinition;
66
+ getLinkCollectionsDef(itemType: ItemType, linkField: string, options: CollectionOptionsInterface): LinkCollectionDefinition;
67
67
  getCollection(itemType: ItemType, options: CollectionOptionsInterface & {
68
68
  editCollection: true;
69
69
  editItems: true;
@@ -105,7 +105,7 @@ export declare class ItemAdministrator {
105
105
  remoteItems: true;
106
106
  }): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<RemoteViewResource>>>;
107
107
  getLinkCollections(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemType, options: CollectionOptionsInterface): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<LocalViewResource>>>;
108
- getLinkCollectionsFromDef(definition: LinkCollectionDefinition): PromiseInterface<CollectionResourceParentIdMap>;
108
+ getLinkCollectionsFromDef(linkType: ItemType, linkIdArray: ItemId[], definition: LinkCollectionDefinition): PromiseInterface<CollectionResourceParentIdMap>;
109
109
  getAllLinkCollections(linkType: ItemType, itemType: ItemType, options: CollectionOptionsInterface & {
110
110
  editItems: true;
111
111
  editCollection: true;
@@ -1,5 +1,5 @@
1
1
  import { ApiFormatter } from '../classes';
2
- import { EntryParentNull, FieldMap, ItemType } from '../types';
2
+ import { ApiQuery, EntryParentNull, FieldMap, ItemType } from '../types';
3
3
  export declare class QueryMatcher {
4
4
  private apiFormatter;
5
5
  itemType: ItemType;
@@ -7,7 +7,7 @@ export declare class QueryMatcher {
7
7
  parent: EntryParentNull;
8
8
  constructor(apiFormatter: ApiFormatter, itemType: ItemType, fields: FieldMap, parent?: EntryParentNull);
9
9
  private compareValues;
10
- matchQuery(query: any): boolean | 'maybe';
10
+ matchQuery(query: ApiQuery): boolean | 'maybe';
11
11
  private matchLinkedToQuery;
12
12
  private matchComplexQuery;
13
13
  private matchSimpleQuery;
@@ -1,4 +1,19 @@
1
1
  import { ApiQuery } from '../types';
2
+ export declare enum OPERATORS {
3
+ OR = "OR",
4
+ AND = "AND"
5
+ }
6
+ export declare type OPERATORS_TYPE = 'OR' | 'AND' | 'or' | 'and' | OPERATORS;
7
+ export declare enum COMPARATORS {
8
+ EQUALS = "=",
9
+ NOT_EQUALS = "!=",
10
+ LESS_THAN = "<",
11
+ MORE_THAN = ">",
12
+ LESS_OR_EQUAL_THAN = "<=",
13
+ EQUAL_OR_MORE_THAN = ">=",
14
+ IN = "IN"
15
+ }
16
+ export declare type COMPARATORS_TYPE = '=' | '!=' | '<' | '>' | '<=' | '>=' | 'IN' | COMPARATORS;
2
17
  export declare class QueryParser {
3
18
  query: ApiQuery;
4
19
  parameters: any;
@@ -1,8 +1,14 @@
1
1
  import { ApiQuery, EntryParentNull, ItemId } from '../types';
2
+ import { COMPARATORS } from './QueryParser';
2
3
  export declare class QueryService {
3
4
  constructor();
4
5
  addAndCondition(query: ApiQuery, condition: ApiQuery): ApiQuery;
5
6
  addOrCondition(query: ApiQuery, condition: ApiQuery): ApiQuery;
6
7
  addParentCondition(query: ApiQuery, parent: EntryParentNull): ApiQuery;
7
- createNotIn(idArray: ItemId[]): ApiQuery;
8
+ createNotIn(idArray: ItemId[]): {
9
+ comparator: COMPARATORS;
10
+ key: string;
11
+ value: number[];
12
+ not: boolean;
13
+ };
8
14
  }
@@ -11,23 +11,16 @@ export declare type FieldMap = {
11
11
  };
12
12
  export declare type ItemOptionsInterface = ItemEntryOptionsInterface & ItemResourceOptionsInterface;
13
13
  export declare type CollectionOptionsInterface = CollectionEntryOptionsInterface & CollectionResourceOptionsInterface;
14
- export declare type CollectionDefinition = {
14
+ export interface CollectionDefinition {
15
15
  itemType: ItemType;
16
16
  options: {
17
17
  entry: CollectionEntryOptions;
18
18
  resource: CollectionResourceOptions;
19
19
  };
20
- };
21
- export declare type LinkCollectionDefinition = {
22
- itemType: ItemType;
23
- linkType: ItemType;
24
- linkIdArray: ItemId[] | (() => ItemId[]);
20
+ }
21
+ export interface LinkCollectionDefinition extends CollectionDefinition {
25
22
  linkField: string;
26
- options: {
27
- entry: CollectionEntryOptions;
28
- resource: CollectionResourceOptions;
29
- };
30
- };
23
+ }
31
24
  export declare type OnChangeFunction = (itemResource: ItemResource, previous?: FieldMap) => void;
32
25
  export declare const enum StateKeyType {
33
26
  New = "new",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rentman/rm-core",
3
- "version": "1.6.7",
3
+ "version": "1.6.10",
4
4
  "description": "Rentman core functionalities",
5
5
  "main": "./dist/rm-core.js",
6
6
  "types": "./dist/src/index.d.ts",