@techextensor/tab-core-utility 2.2.133 → 2.2.135

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.
Files changed (35) hide show
  1. package/esm2022/index.mjs +2 -1
  2. package/esm2022/lib/tab-core-utility/app/enums/common.enum.mjs +23 -0
  3. package/esm2022/lib/tab-core-utility/app/enums/dsq.enum.mjs +17 -1
  4. package/esm2022/lib/tab-core-utility/app/enums/permission.enum.mjs +8 -1
  5. package/esm2022/lib/tab-core-utility/app/helpers/common/meta-data.helpers.mjs +161 -608
  6. package/esm2022/lib/tab-core-utility/app/interfaces/schema.interface.mjs +1 -2
  7. package/esm2022/lib/tab-core-utility/app/models/app-field.model.mjs +72 -0
  8. package/esm2022/lib/tab-core-utility/app/models/app-object.class.mjs +1 -1
  9. package/esm2022/lib/tab-core-utility/app/models/app-object.model.mjs +186 -0
  10. package/esm2022/lib/tab-core-utility/app/models/app-screen.model.mjs +37 -0
  11. package/esm2022/lib/tab-core-utility/app/models/common.class.mjs +1 -1
  12. package/esm2022/lib/tab-core-utility/app/models/data-source-queries.class.mjs +1 -1
  13. package/esm2022/lib/tab-core-utility/app/models/data-source-query.model.mjs +123 -0
  14. package/esm2022/lib/tab-core-utility/app/models/filter.model.mjs +24 -0
  15. package/esm2022/lib/tab-core-utility/app/models/orgInfo.model.mjs +38 -0
  16. package/esm2022/lib/tab-core-utility/app/models/parameter.model.mjs +18 -0
  17. package/esm2022/lib/tab-core-utility/app/models/sort.model.mjs +18 -0
  18. package/index.d.ts +1 -0
  19. package/lib/tab-core-utility/app/enums/common.enum.d.ts +18 -0
  20. package/lib/tab-core-utility/app/enums/dsq.enum.d.ts +14 -0
  21. package/lib/tab-core-utility/app/enums/permission.enum.d.ts +6 -0
  22. package/lib/tab-core-utility/app/helpers/common/meta-data.helpers.d.ts +84 -320
  23. package/lib/tab-core-utility/app/interfaces/schema.interface.d.ts +1 -2
  24. package/lib/tab-core-utility/app/models/app-field.model.d.ts +56 -0
  25. package/lib/tab-core-utility/app/models/app-object.class.d.ts +11 -8
  26. package/lib/tab-core-utility/app/models/app-object.model.d.ts +124 -0
  27. package/lib/tab-core-utility/app/models/app-screen.model.d.ts +27 -0
  28. package/lib/tab-core-utility/app/models/common.class.d.ts +3 -0
  29. package/lib/tab-core-utility/app/models/data-source-queries.class.d.ts +8 -4
  30. package/lib/tab-core-utility/app/models/data-source-query.model.d.ts +69 -0
  31. package/lib/tab-core-utility/app/models/filter.model.d.ts +21 -0
  32. package/lib/tab-core-utility/app/models/orgInfo.model.d.ts +23 -0
  33. package/lib/tab-core-utility/app/models/parameter.model.d.ts +14 -0
  34. package/lib/tab-core-utility/app/models/sort.model.d.ts +15 -0
  35. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import { ObjectCreationType } from '../enums/dsq.enum';
2
- import { DeploymentStatus } from '../enums/permission.enum';
2
+ import { DataAccessSet, DeploymentStatus } from '../enums/permission.enum';
3
3
  import { ChildRelationShip } from './api-query.class';
4
4
  import { Configurations, EmailTemplate, Profile, Resources, Role } from './common.class';
5
- import { AppFields, DataSourceQueries } from './data-source-queries.class';
5
+ import { AppFields, DataSourceQueries, FieldAccess } from './data-source-queries.class';
6
6
  export declare class Application {
7
7
  ID: string | any;
8
8
  AppName: string | any;
@@ -45,12 +45,15 @@ export declare class AppObject {
45
45
  }
46
46
  export declare class ObjectAccess {
47
47
  ID: string;
48
- ProfileID: Profile;
49
- IsVisible: boolean;
50
- IsReadOnly: boolean;
51
- CanCreate: boolean;
52
- CanEdit: boolean;
53
- CanDelete: boolean;
48
+ RoleID: string;
49
+ IsEnabled: string;
50
+ READ: DataAccessSet;
51
+ CREATE: DataAccessSet;
52
+ UPDATE: DataAccessSet;
53
+ DELETE: DataAccessSet;
54
+ AuthFilters: any;
55
+ fieldAccesses: Array<FieldAccess>;
56
+ ObjectID: string;
54
57
  }
55
58
  export declare class AppMenu {
56
59
  ID: string | any;
@@ -0,0 +1,124 @@
1
+ import { ObjectType } from '../enums/common.enum';
2
+ import { ObjectCreationType } from '../enums/dsq.enum';
3
+ import { DeploymentStatus } from '../enums/permission.enum';
4
+ import { AppFieldModel } from './app-field.model';
5
+ import { ObjectAccess } from './app-object.class';
6
+ import { Resources } from './common.class';
7
+ import { DataSourceQueryModel } from './data-source-query.model';
8
+ export declare class AppObjectModel {
9
+ private readonly raw;
10
+ readonly ID: string;
11
+ readonly ObjectName: string;
12
+ readonly DisplayName: string;
13
+ readonly Description: string;
14
+ readonly SystemDBTableName: string;
15
+ readonly IsSystem: boolean;
16
+ readonly IsVisible: boolean;
17
+ readonly IsDeprecated: boolean;
18
+ readonly IsSupportBluePrint: boolean | null;
19
+ readonly IsLocationTracking: boolean | null;
20
+ readonly ObjectType: ObjectType;
21
+ readonly DeploymentStatus: DeploymentStatus;
22
+ readonly CreationType: ObjectCreationType;
23
+ readonly AllowVersioning: boolean;
24
+ readonly EnableTracking: boolean;
25
+ readonly AllowSearchable: boolean;
26
+ readonly AllowReports: boolean;
27
+ readonly AllowActivities: boolean;
28
+ readonly AllowSharing: boolean;
29
+ readonly AllowSoftDelete: boolean | null;
30
+ readonly IsReplicationNeeded: boolean | null;
31
+ readonly IsCacheEnable: boolean | null;
32
+ readonly CacheTtl: number | null;
33
+ readonly AppObjectConfiguration: string;
34
+ readonly CRUDAppObjectId: string | null;
35
+ readonly ConnectionId: string | null;
36
+ readonly IsSupportLayout: boolean | null;
37
+ readonly AccessList: Array<ObjectAccess>;
38
+ readonly Resources: Array<Resources>;
39
+ readonly parsedAppObjectConfiguration: any;
40
+ private readonly fieldMap;
41
+ private readonly dsqMap;
42
+ private allFields;
43
+ private allDSQs;
44
+ constructor(raw: any);
45
+ /**
46
+ * Returns all fields associated with this AppObject. The fields are cached so that subsequent calls
47
+ * are faster. The cache is stored in a map by ID.
48
+ *
49
+ * @returns {AppFieldModel[]} An array of AppFieldModel objects.
50
+ */
51
+ fields(): AppFieldModel[];
52
+ /**
53
+ * Retrieves a field by its ID or name.
54
+ * If the field is cached, it returns it from the cache.
55
+ * Otherwise, it searches through all fields.
56
+ *
57
+ * @param {string} idOrName - The ID or name of the field to retrieve.
58
+ * @returns {AppFieldModel | undefined} - The field model if found, otherwise undefined.
59
+ */
60
+ field(idOrName: string): AppFieldModel | undefined;
61
+ /**
62
+ * Retrieves all fields of the app object that are lookup fields.
63
+ * A lookup field is a field that has a relationship with another field.
64
+ * It is used to perform lookups, such as retrieving a list of values
65
+ * from a related field.
66
+ *
67
+ * @returns {AppFieldModel[]} - An array of AppFieldModel objects that are lookup fields.
68
+ */
69
+ lookupFields(): AppFieldModel[];
70
+ /**
71
+ * Finds and returns the fields for the app object that satisfy the given filter function.
72
+ * The filter function is called with each field as an argument, and should return true if the field
73
+ * should be included in the result.
74
+ * @param {function} filterFn The filter function to apply to the fields.
75
+ * @returns {AppFieldModel[]} The array of fields that satisfy the filter function.
76
+ */
77
+ findFields(filterFn: (field: AppFieldModel) => boolean): AppFieldModel[];
78
+ /**
79
+ * Retrieves all data source queries associated with this AppObject.
80
+ * The queries are cached for faster subsequent access. The cache is stored in a map by ID, QueryName, and DisplayName.
81
+ *
82
+ * @returns {DataSourceQueryModel[]} An array of DataSourceQueryModel objects.
83
+ */
84
+ dataSourceQueries(): DataSourceQueryModel[];
85
+ /**
86
+ * Retrieves a data source query by its ID or name.
87
+ * If the query is cached, it returns it from the cache.
88
+ * Otherwise, it searches through all data source queries.
89
+ *
90
+ * @param {string} idOrName - The ID or name of the data source query to retrieve.
91
+ * @returns {DataSourceQueryModel | undefined} - The data source query model if found, otherwise undefined.
92
+ */
93
+ dataSourceQuery(idOrName: string): DataSourceQueryModel | undefined;
94
+ /**
95
+ * Finds and returns the data source queries that satisfy the given filter function.
96
+ * The filter function is called with each data source query as an argument.
97
+ * If the filter function returns true, the data source query is included in the result.
98
+ *
99
+ * @param {function} filterFn - The filter function to apply to the data source queries.
100
+ * @returns {DataSourceQueryModel[]} - The array of data source queries that satisfy the filter function.
101
+ */
102
+ findDataSourceQueries(filterFn: (dsq: DataSourceQueryModel) => boolean): DataSourceQueryModel[];
103
+ /**
104
+ * Searches for the given term in the fields and data source queries of this AppObject.
105
+ * The search is case-insensitive and performed on the following fields:
106
+ * - Field name and description
107
+ * - Data source query name, display name, and description
108
+ *
109
+ * @param {string} term - The search term to search for.
110
+ * @returns {{ fields: AppFieldModel[]; dsqs: DataSourceQueryModel[] }} - An object with the search results.
111
+ * The `fields` property contains an array of AppFieldModel objects that match the search term.
112
+ * The `dsqs` property contains an array of DataSourceQueryModel objects that match the search term.
113
+ */
114
+ search(term: string): {
115
+ fields: AppFieldModel[];
116
+ dsqs: DataSourceQueryModel[];
117
+ };
118
+ /**
119
+ * Converts the current object to a JSON object.
120
+ *
121
+ * @returns {any} The raw data as a JSON object.
122
+ */
123
+ toJSON(): any;
124
+ }
@@ -0,0 +1,27 @@
1
+ import { ScreenType } from "../enums/common.enum";
2
+ export declare class AppScreenModel {
3
+ private raw;
4
+ readonly ID: string;
5
+ readonly Name: string;
6
+ readonly Description: string;
7
+ readonly ScreenType: ScreenType;
8
+ readonly DataSourceQuery: string;
9
+ readonly Container: string | null;
10
+ readonly ScreenConfiguration: string;
11
+ readonly AppId: string;
12
+ readonly RecordId: string;
13
+ readonly IsSystemRecord: boolean;
14
+ constructor(raw: any);
15
+ /**
16
+ * Searches for the given term in the properties of the current app screen
17
+ * @param {string} term The search term
18
+ * @returns {boolean} Whether the search term is present in any field
19
+ */
20
+ search(term: string): boolean;
21
+ /**
22
+ * Converts the current object to a JSON object.
23
+ *
24
+ * @returns A JSON representation of the current object.
25
+ */
26
+ toJSON(): any;
27
+ }
@@ -1,3 +1,4 @@
1
+ import { ResourceType } from "../enums/common.enum";
1
2
  export declare class Role {
2
3
  ID: string | any;
3
4
  RoleName: string | any;
@@ -17,6 +18,8 @@ export declare class Profile {
17
18
  export declare class Resources {
18
19
  ID: string;
19
20
  Value: string;
21
+ Setting_Key: string;
22
+ resourceType: ResourceType;
20
23
  }
21
24
  export declare class EmailTemplate {
22
25
  ID: string;
@@ -1,7 +1,6 @@
1
1
  import { DataTypes } from '../enums/controllers.enum';
2
- import { SortSequence, ConjuctionClause, RelationalOperator, ObjectCreationType } from '../enums/dsq.enum';
2
+ import { SortSequence, ConjuctionClause, RelationalOperator, ObjectCreationType, DataSourceQueryFieldType } from '../enums/dsq.enum';
3
3
  import { AppObject } from './app-object.class';
4
- import { Profile } from './common.class';
5
4
  export declare class DataSourceQueries {
6
5
  ID: string;
7
6
  ObjectID: AppObject;
@@ -14,9 +13,14 @@ export declare class DataSourceQueries {
14
13
  Parameters: Parameters[];
15
14
  }
16
15
  export declare class DataSourceQueries_Fields {
16
+ ID: string;
17
+ Field: AppFields;
17
18
  SeqNo: number;
18
19
  Field_GridAttributes: string;
19
20
  LookupDetails: string;
21
+ FieldType: DataSourceQueryFieldType;
22
+ FieldDetails: string;
23
+ AppFieldID: string;
20
24
  }
21
25
  export declare class Parameters {
22
26
  ID: string;
@@ -72,10 +76,10 @@ export declare class LookUpDetails {
72
76
  LookupObject: string;
73
77
  LookupField: string;
74
78
  DisplayField: string;
79
+ selectQuery: any;
75
80
  }
76
81
  export declare class FieldAccess {
77
- ID: string;
78
- ProfileID: Profile;
82
+ FieldID: string;
79
83
  IsVisible: boolean;
80
84
  IsReadOnly: boolean;
81
85
  }
@@ -0,0 +1,69 @@
1
+ import { AppObjectModel } from './app-object.model';
2
+ import { DataSourceQueries_Fields } from './data-source-queries.class';
3
+ import { FilterModel } from './filter.model';
4
+ import { ParameterModel } from './parameter.model';
5
+ import { SortModel } from './sort.model';
6
+ export declare class DataSourceQueryModel {
7
+ private readonly raw;
8
+ readonly parentAppObject: AppObjectModel;
9
+ readonly ID: string;
10
+ readonly ObjectID: string;
11
+ readonly ObjectID_Tosave: string;
12
+ readonly QueryName: string;
13
+ readonly DisplayName: string;
14
+ readonly FilterLogic: string | null;
15
+ private enrichedFields;
16
+ private cachedParameters;
17
+ private cachedFilters;
18
+ private cachedSorts;
19
+ constructor(raw: any, parentAppObject: AppObjectModel);
20
+ /**
21
+ * Gets the fields for the data source query. The fields are enriched with the corresponding `AppFieldModel` objects.
22
+ * @returns {DataSourceQueries_Fields[]} The array of enriched fields.
23
+ */
24
+ fields(): DataSourceQueries_Fields[];
25
+ /**
26
+ * Finds and returns the fields for the data source query that satisfy the given filter function.
27
+ * @param {function} filterFn The filter function to apply to the fields.
28
+ * @returns {DataSourceQueries_Fields[]} The array of fields that satisfy the filter function.
29
+ */
30
+ findFields(filterFn: (field: DataSourceQueries_Fields) => boolean): DataSourceQueries_Fields[];
31
+ /**
32
+ * Retrieves and caches the parameters for the data source query.
33
+ * @returns {ParameterModel[]} The array of ParameterModel instances.
34
+ */
35
+ parameters(): ParameterModel[];
36
+ /**
37
+ * Retrieves the mandatory parameters for the data source query.
38
+ * @returns {ParameterModel[]} The array of mandatory ParameterModel instances.
39
+ */
40
+ mandatoryParameters(): ParameterModel[];
41
+ /**
42
+ * Finds a parameter by its name (case-insensitive).
43
+ * @param {string} name The name of the parameter to find.
44
+ * @returns {ParameterModel | undefined} The parameter model instance if found, otherwise undefined.
45
+ */
46
+ parameter(name: string): ParameterModel | undefined;
47
+ /**
48
+ * Retrieves and caches the filters for the data source query.
49
+ * @returns {FilterModel[]} The array of FilterModel instances.
50
+ */
51
+ filters(): FilterModel[];
52
+ /**
53
+ * Retrieves and caches the sorts for the data source query.
54
+ * @returns {SortModel[]} The array of SortModel instances.
55
+ */
56
+ sorts(): SortModel[];
57
+ /**
58
+ * Check if the given search term is present in any of the fields of the
59
+ * current data source query
60
+ * @param {string} term The search term
61
+ * @returns {boolean} Whether the search term is present in any field
62
+ */
63
+ search(term: string): boolean;
64
+ /**
65
+ * Converts the DataSourceQueryModel instance to a JSON representation.
66
+ * @returns {any} The raw data in JSON format.
67
+ */
68
+ toJSON(): any;
69
+ }
@@ -0,0 +1,21 @@
1
+ import { ConjuctionClause, DataSourceQueryFilterFieldType, FilterValueType, RelationalOperator } from "../enums/dsq.enum";
2
+ export declare class FilterModel {
3
+ private readonly raw;
4
+ readonly ID: string;
5
+ readonly ConjuctionClause: ConjuctionClause;
6
+ readonly RelationalOperator: RelationalOperator;
7
+ readonly ValueType: FilterValueType;
8
+ readonly value: string;
9
+ readonly Sequence: number;
10
+ readonly GroupID: number;
11
+ readonly LookupDetail: string | null;
12
+ readonly FieldType: DataSourceQueryFilterFieldType;
13
+ readonly FieldID: string;
14
+ constructor(raw: any);
15
+ /**
16
+ * Converts the current object to a JSON object.
17
+ *
18
+ * @returns A JSON representation of the current object.
19
+ */
20
+ toJSON(): any;
21
+ }
@@ -0,0 +1,23 @@
1
+ export declare class OrgInfoModel {
2
+ private raw;
3
+ readonly ID: string;
4
+ readonly OrganizationName: string;
5
+ readonly PrimaryContact: string;
6
+ readonly Address: string;
7
+ readonly LocaleSettings: string;
8
+ readonly Subdomain: string;
9
+ readonly TenantCode: string;
10
+ constructor(raw: any);
11
+ /**
12
+ * Check if the given search term is present in any of the fields of the
13
+ * current org info
14
+ * @param {string} term The search term
15
+ * @returns {boolean} Whether the search term is present in any field
16
+ */
17
+ search(term: string): boolean;
18
+ /**
19
+ * Get raw data for this app object
20
+ * @returns {any} The raw data for this app object
21
+ */
22
+ toJSON(): any;
23
+ }
@@ -0,0 +1,14 @@
1
+ export declare class ParameterModel {
2
+ private readonly raw;
3
+ readonly ID: string;
4
+ readonly ParameterName: string;
5
+ readonly DataSourceQueryID: string;
6
+ readonly MappingFieldName: string;
7
+ readonly IsMandatory: boolean;
8
+ constructor(raw: any);
9
+ /**
10
+ * Converts the model to JSON.
11
+ * @returns {any} The model as a JSON object.
12
+ */
13
+ toJSON(): any;
14
+ }
@@ -0,0 +1,15 @@
1
+ import { DataSourceQueryFilterFieldType, SortSequence } from "../enums/dsq.enum";
2
+ export declare class SortModel {
3
+ private readonly raw;
4
+ readonly ID: string;
5
+ readonly SortSequence: SortSequence;
6
+ readonly Sequence: number;
7
+ readonly LookupDetails: string | null;
8
+ readonly FieldType: DataSourceQueryFilterFieldType;
9
+ readonly AppFieldID: string;
10
+ constructor(raw: any);
11
+ /**
12
+ * Get raw data for this app object
13
+ */
14
+ toJSON(): any;
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techextensor/tab-core-utility",
3
- "version": "2.2.133",
3
+ "version": "2.2.135",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.0",
6
6
  "@angular/core": "^17.3.0",