@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
@@ -0,0 +1,38 @@
1
+ export class OrgInfoModel {
2
+ constructor(raw) {
3
+ this.raw = raw;
4
+ this.ID = raw?.ID;
5
+ this.OrganizationName = raw?.OrganizationName;
6
+ this.PrimaryContact = raw?.PrimaryContact;
7
+ this.Address = raw?.Address;
8
+ this.LocaleSettings = raw?.LocaleSettings;
9
+ this.Subdomain = raw?.Subdomain;
10
+ this.TenantCode = raw?.TenantCode;
11
+ }
12
+ /**
13
+ * Check if the given search term is present in any of the fields of the
14
+ * current org info
15
+ * @param {string} term The search term
16
+ * @returns {boolean} Whether the search term is present in any field
17
+ */
18
+ search(term) {
19
+ const lowerTerm = term.toLowerCase();
20
+ return Boolean(
21
+ // Search in ID
22
+ (this.ID && this.ID?.toLowerCase()?.includes(lowerTerm)) ||
23
+ // Search in OrganizationName
24
+ (this.OrganizationName && this.OrganizationName?.toLowerCase()?.includes(lowerTerm)) ||
25
+ // Search in Subdomain
26
+ (this.Subdomain && this.Subdomain?.toLowerCase()?.includes(lowerTerm)) ||
27
+ // Search in TenantCode
28
+ (this.TenantCode && this.TenantCode?.toLowerCase()?.includes(lowerTerm)));
29
+ }
30
+ /**
31
+ * Get raw data for this app object
32
+ * @returns {any} The raw data for this app object
33
+ */
34
+ to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cy5Pcmdhbml6YXRpb25OYW1lPy50b0xvd2VyQ2FzZSgpPy5pbmNsdWRlcyhsb3dlclRlcm0pKSB8fFxuICAgICAgICAgICAgLy8gU2VhcmNoIGluIFN1YmRvbWFpblxuICAgICAgICAgICAgKHRoaXMuU3ViZG9tYWluICYmIHRoaXMuU3ViZG9tYWluPy50b0xvd2VyQ2FzZSgpPy5pbmNsdWRlcyhsb3dlclRlcm0pKSB8fFxuICAgICAgICAgICAgLy8gU2VhcmNoIGluIFRlbmFudENvZGVcbiAgICAgICAgICAgICh0aGlzLlRlbmFudENvZGUgJiYgdGhpcy5UZW5hbnRDb2RlPy50b0xvd2VyQ2FzZSgpPy5pbmNsdWRlcyhsb3dlclRlcm0pKVxuICAgICAgICApO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEdldCByYXcgZGF0YSBmb3IgdGhpcyBhcHAgb2JqZWN0XG4gICAgICogQHJldHVybnMge2FueX0gVGhlIHJhdyBkYXRhIGZvciB0aGlzIGFwcCBvYmplY3RcbiAgICAgKi9cbiAgICB0b0pTT04oKTogYW55IHtcbiAgICAgICAgcmV0dXJuIHRoaXMucmF3O1xuICAgIH1cbn1cbiJdfQ==
@@ -0,0 +1,18 @@
1
+ export class ParameterModel {
2
+ constructor(raw) {
3
+ this.raw = raw;
4
+ this.ID = raw?.ID;
5
+ this.ParameterName = raw?.ParameterName;
6
+ this.DataSourceQueryID = raw?.DataSourceQueryID;
7
+ this.MappingFieldName = raw?.MappingFieldName;
8
+ this.IsMandatory = raw?.IsMandatory;
9
+ }
10
+ /**
11
+ * Converts the model to JSON.
12
+ * @returns {any} The model as a JSON object.
13
+ */
14
+ toJSON() {
15
+ return this.raw;
16
+ }
17
+ }
18
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyYW1ldGVyLm1vZGVsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vL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GlzLlBhcmFtZXRlck5hbWUgPSByYXc/LlBhcmFtZXRlck5hbWU7XG4gICAgICAgIHRoaXMuRGF0YVNvdXJjZVF1ZXJ5SUQgPSByYXc/LkRhdGFTb3VyY2VRdWVyeUlEO1xuICAgICAgICB0aGlzLk1hcHBpbmdGaWVsZE5hbWUgPSByYXc/Lk1hcHBpbmdGaWVsZE5hbWU7XG4gICAgICAgIHRoaXMuSXNNYW5kYXRvcnkgPSByYXc/LklzTWFuZGF0b3J5O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENvbnZlcnRzIHRoZSBtb2RlbCB0byBKU09OLlxuICAgICAqIEByZXR1cm5zIHthbnl9IFRoZSBtb2RlbCBhcyBhIEpTT04gb2JqZWN0LlxuICAgICAqL1xuICAgIHRvSlNPTigpOiBhbnkge1xuICAgICAgICByZXR1cm4gdGhpcy5yYXc7XG4gICAgfVxufSJdfQ==
@@ -0,0 +1,18 @@
1
+ export class SortModel {
2
+ constructor(raw) {
3
+ this.raw = raw;
4
+ this.ID = raw?.ID;
5
+ this.SortSequence = raw?.SortSequence;
6
+ this.Sequence = raw?.Sequence;
7
+ this.LookupDetails = raw?.LookupDetails;
8
+ this.FieldType = raw?.FieldType;
9
+ this.AppFieldID = raw?.AppFieldID;
10
+ }
11
+ /**
12
+ * Get raw data for this app object
13
+ */
14
+ toJSON() {
15
+ return this.raw;
16
+ }
17
+ }
18
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29ydC5tb2RlbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvZGF0YS1hY2Nlc3Mvc3JjL2xpYi90YWItY29yZS11dGlsaXR5L2FwcC9tb2RlbHMvc29ydC5tb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLE9BQU8sU0FBUztJQVFwQixZQUE2QixHQUFRO1F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dz8uSUQ7XG4gICAgdGhpcy5Tb3J0U2VxdWVuY2UgPSByYXc/LlNvcnRTZXF1ZW5jZTtcbiAgICB0aGlzLlNlcXVlbmNlID0gcmF3Py5TZXF1ZW5jZTtcbiAgICB0aGlzLkxvb2t1cERldGFpbHMgPSByYXc/Lkxvb2t1cERldGFpbHM7XG4gICAgdGhpcy5GaWVsZFR5cGUgPSByYXc/LkZpZWxkVHlwZTtcbiAgICB0aGlzLkFwcEZpZWxkSUQgPSByYXc/LkFwcEZpZWxkSUQ7XG4gIH1cblxuICAvKipcbiAgICogR2V0IHJhdyBkYXRhIGZvciB0aGlzIGFwcCBvYmplY3RcbiAgICovXG4gIHRvSlNPTigpOiBhbnkge1xuICAgIHJldHVybiB0aGlzLnJhdztcbiAgfVxufSJdfQ==
package/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './lib/tab-core-utility/app/crud/tab-update.service';
10
10
  export * from './lib/tab-core-utility/app/crud/tab-workflow.service';
11
11
  export * from './lib/tab-core-utility/app/crud/tab-blueprint.service';
12
12
  export * from './lib/tab-core-utility/app/crud/tab-release.service';
13
+ export * from './lib/tab-core-utility/app/enums/common.enum';
13
14
  export * from './lib/tab-core-utility/app/enums/controllers.enum';
14
15
  export * from './lib/tab-core-utility/app/enums/dsq.enum';
15
16
  export * from './lib/tab-core-utility/app/enums/permission.enum';
@@ -0,0 +1,18 @@
1
+ export declare enum ScreenType {
2
+ List = 1,
3
+ Detail = 2
4
+ }
5
+ export declare enum ObjectType {
6
+ Table = 1,
7
+ View = 2
8
+ }
9
+ export declare enum ResourceType {
10
+ EmailTeamplate = 1,
11
+ LanguageTranslation = 2,
12
+ Settings = 3
13
+ }
14
+ export declare enum ReleaseContentType {
15
+ MetaData = 1,
16
+ Data = 2,
17
+ Script = 3
18
+ }
@@ -40,3 +40,17 @@ export declare enum ObjectCreationType {
40
40
  Standard = 1,
41
41
  Custom = 2
42
42
  }
43
+ export declare enum DataSourceQueryFieldType {
44
+ EntityField = 1,
45
+ LookupField = 2,
46
+ ActionField = 3,
47
+ SQLField = 4,
48
+ CSharpField = 5,
49
+ ChildRelationshipField = 6
50
+ }
51
+ export declare enum DataSourceQueryFilterFieldType {
52
+ EntityField = 1,
53
+ LookupField = 2,
54
+ GlobalField = 3,
55
+ AggregateField = 4
56
+ }
@@ -14,3 +14,9 @@ export declare enum DeploymentStatus {
14
14
  InDevelopment = 1,
15
15
  Deployed = 2
16
16
  }
17
+ export declare enum DataAccessSet {
18
+ NONE = 1,
19
+ OWN = 2,
20
+ TEAM = 3,
21
+ ALL = 4
22
+ }
@@ -1,355 +1,119 @@
1
- import { MetadataEntityType, OrgInfo } from "../../interfaces/schema.interface";
2
- import { AppMenu, AppObject, AppScreen } from "../../models/app-object.class";
3
- import { AppFields, DataSourceQueries, DataSourceQueries_Fields, Parameters } from "../../models/data-source-queries.class";
1
+ import { AppObjectModel } from "../../models/app-object.model";
2
+ import { AppFieldModel } from "../../models/app-field.model";
3
+ import { DataSourceQueryModel } from "../../models/data-source-query.model";
4
+ import { MetadataEntityType } from "../../interfaces/schema.interface";
5
+ import { AppScreenModel } from "../../models/app-screen.model";
6
+ import { OrgInfoModel } from "../../models/orgInfo.model";
4
7
  import * as i0 from "@angular/core";
5
- /**
6
- * MetadataUtils - Utility service for retrieving and manipulating application metadata
7
- *
8
- * This service provides methods to extract, filter, and format different parts of the
9
- * application metadata, including objects, fields, screens, menus, etc.
10
- */
11
8
  export declare class MetadataHelper {
12
- private formatResults;
9
+ private appObjectMap;
10
+ private allAppObjects;
11
+ private appScreenMap;
12
+ private allAppScreens;
13
+ private orgInfoMap;
14
+ private allOrgInfos;
13
15
  /**
14
- * Search across all metadata for a term
15
- *
16
- * @param searchTerm Term to search for
17
- * @param entityTypes Optional types of entities to search (if not provided, searches all)
18
- * @returns Search results grouped by entity type
19
- *
20
- * @example
21
- * // Search across all metadata
22
- * const results = metadataUtils.searchAcrossMetadata('Blueprint');
23
- *
24
- * // Search only in app objects and screens
25
- * const results = metadataUtils.searchAcrossMetadata(
26
- * 'Role',
27
- * [MetadataEntityType.APP_OBJECTS, MetadataEntityType.APP_SCREENS]
28
- * );
29
- */
30
- searchAcrossMetadata(searchTerm: string, entityTypes?: MetadataEntityType[]): Record<string, any[]>;
31
- /**
32
- * Search for a term within App Objects
33
- * @private
34
- */
35
- private searchAppObjects;
36
- /**
37
- * Search for a term within App Fields
38
- * @private
39
- */
40
- private searchAppFields;
41
- /**
42
- * Search for a term within Data Source Queries
43
- * @private
44
- */
45
- private searchDataSourceQueries;
46
- /**
47
- * Search for a term within App Screens
48
- * @private
49
- */
50
- private searchAppScreens;
51
- /**
52
- * Search for a term within App Menus
53
- * @private
16
+ * Returns the value associated with the given key from the given map.
17
+ * If the key does not exist in the map, and the source list contains an item that matches
18
+ * the given condition, it creates a new model using the given model factory and adds it to the map.
19
+ * @param map The map to search in.
20
+ * @param key The key to search for.
21
+ * @param sourceList The list of items to search in.
22
+ * @param matchFn The condition to match.
23
+ * @param modelFactory The factory to create a new model if the key does not exist.
24
+ * @returns The value associated with the given key, or null if no match is found.
54
25
  */
55
- private searchAppMenus;
26
+ private getFromMapOrCreate;
56
27
  /**
57
- * Helper method to check if a string contains a search term
58
- * @private
28
+ * Lazily initializes a list of models from a source list.
29
+ * It creates a new model for each item in the source list and adds it to the given map.
30
+ * It also sets the list of models to the given setter.
31
+ * @param listRef The reference to the list of models.
32
+ * @param setter The setter to set the list of models.
33
+ * @param sourceList The source list of items.
34
+ * @param map The map to store the models.
35
+ * @param getKeys The function to get the keys for the given item.
36
+ * @param modelFactory The factory to create a new model for the given item.
37
+ * @returns The list of models.
59
38
  */
60
- private containsTerm;
39
+ private lazyInitList;
61
40
  /**
62
- * Gets App Objects based on filter criteria
63
- *
64
- * @param filterFn Optional filter function to apply to app objects
65
- * @param columns Optional columns to include in the result
66
- * @returns Array of filtered app objects
67
- *
68
- * @example
69
- * // Get all system app objects
70
- * const systemObjects = metadataUtils.getAppObjects(obj => obj.IsSystem === true);
71
- *
72
- * // Get specific columns from non-deprecated objects
73
- * const objects = metadataUtils.getAppObjects(
74
- * obj => !obj.IsDeprecated,
75
- * ['ID', 'DisplayName', 'ObjectName']
76
- * );
77
- */
78
- getAppObjects(filterFn?: ((value: AppObject) => boolean), columns?: string[]): any[];
79
- /**
80
- * Gets a specific App Object by ID or Name
81
- *
82
- * @param appObject ID or Name of the app object to retrieve
83
- * @param columns Optional columns to include in the result
84
- * @returns The app object with specified columns or null if not found
85
- *
86
- * @example
87
- * // Get a specific app object with all properties
88
- * const appObj = metadataUtils.getAppObjectDetails('b4887d4d-bb1e-4d52-a7e8-2f943d69e44c' or 'TABMD_SYSTEM');
89
- *
90
- * // Get specific columns from an app object
91
- * const appObj = metadataUtils.getAppObjectDetails(
92
- * 'b4887d4d-bb1e-4d52-a7e8-2f943d69e44c',
93
- * ['ID', 'DisplayName', 'ObjectName']
94
- * );
95
- */
96
- getAppObjectDetails(appObject: string, columns?: string[]): any;
97
- /**
98
- * Gets all fields across all app objects with filter criteria
99
- *
100
- * @param filterFn Optional filter function to apply to fields
101
- * @param columns Optional columns to include in the result
102
- * @returns Array of filtered fields
103
- *
104
- * @example
105
- * // Get all required fields across all objects
106
- * const requiredFields = metadataUtils.getAppFields(field => field.IsRequired === true);
107
- *
108
- * // Get specific columns from searchable fields
109
- * const fields = metadataUtils.getAppFields(
110
- * field => field.IsSearchable === true,
111
- * ['ID', 'DisplayName', 'FieldName']
112
- * );
113
- */
114
- getAppFields(filterFn?: ((value: AppFields) => boolean), columns?: string[]): any[];
115
- /**
116
- * Gets fields for a specific app object
117
- *
118
- * @param appObject ID or Name of the app object
119
- * @param filterFn Optional filter function for fields
120
- * @returns Array of fields for the specified object
121
- *
122
- * @example
123
- * // Get all fields for an object
124
- * const fields = metadataUtils.getAppFieldsByAppObject('b4887d4d-bb1e-4d52-a7e8-2f943d69e44c' or 'TABMD_SYSTEM');
125
- *
126
- * // Get only required fields
127
- * const requiredFields = metadataUtils.getAppFieldsByAppObject(
128
- * 'b4887d4d-bb1e-4d52-a7e8-2f943d69e44c',
129
- * field => field.IsRequired === true
130
- * );
41
+ * Finds an app object in the map by its name or id.
42
+ * If the app object is not found, it creates a new one and adds it to the map.
43
+ * @param nameOrId The name or id of the app object to find.
44
+ * @returns The app object if found, or null if not found.
131
45
  */
132
- getAppFieldsByAppObject(appObject: string, filterFn?: ((value: AppFields, index: number, array: AppFields[]) => boolean), columns?: string[]): any[];
46
+ getAppObjectByIdOrName(nameOrId: string): AppObjectModel | null;
133
47
  /**
134
- * Gets lookup fields for a specific app object
135
- *
136
- * @param appObject ID or Name of the app object
137
- * @param filterFn Optional filter function for lookup fields
138
- * @param columns Optional columns to include in the result
139
- * @returns Array of lookup fields for the specified object
140
- *
141
- * @example
142
- * // Get all lookup fields for an object
143
- * const lookupFields = metadataUtils.getLookupFieldsByAppObject('TABD_Blueprint_SLASchemes');
144
- *
145
- * // Get specific lookup fields
146
- * const fields = metadataUtils.getLookupFieldsByAppObject(
147
- * 'b4887d4d-bb1e-4d52-a7e8-2f943d69e44c',
148
- * field => field.IsRequired === true
149
- * );
150
- */
151
- getLookupFieldsByAppObject(appObject: string, filterFn?: ((value: AppFields) => boolean), columns?: string[]): any[];
152
- /**
153
- * Gets data source queries with filter criteria
154
- *
155
- * @param filterFn Optional filter function to apply to queries
156
- * @param columns Optional columns to include in the result
157
- * @returns Array of filtered data source queries
158
- *
159
- * @example
160
- * // Get all queries with a specific naming pattern
161
- * const queries = metadataUtils.getDataSourceQueries(query => query.QueryName.includes('List'));
162
- *
163
- * // Get specific columns from all queries
164
- * const queries = metadataUtils.getDataSourceQueries(
165
- * undefined,
166
- * ['ID', 'QueryName', 'DisplayName']
167
- * );
48
+ * Returns a list of app objects in the metadata.
49
+ * If a filter function is given, it is applied to each app object.
50
+ * @param filterFn The filter function to apply to the app objects.
51
+ * @returns The list of app objects.
168
52
  */
169
- getDataSourceQueries(filterFn?: ((value: DataSourceQueries) => boolean), columns?: string[]): any[];
53
+ getAllAppObjects(filterFn?: (obj: AppObjectModel) => boolean): AppObjectModel[];
170
54
  /**
171
- * Gets data source queries for a specific app object
172
- *
173
- * @param appObject ID or Name of the app object
174
- * @param filterFn Optional filter function for queries
175
- * @param columns Optional columns to include in the result
176
- * @returns Array of queries for the specified object
177
- *
178
- * @example
179
- * // Get all queries for an object
180
- * const queries = metadataUtils.getDataSourceQueriesByAppObject('b4887d4d-bb1e-4d52-a7e8-2f943d69e44c');
181
- *
182
- * // Get queries with specific pattern
183
- * const filteredQueries = metadataUtils.getDataSourceQueriesByAppObject(
184
- * 'TABD_Blueprint_SLASchemes',
185
- * query => query.QueryName.includes('List')
186
- * );
55
+ * Returns a list of fields in the metadata.
56
+ * If a filter function is given, it is applied to each field.
57
+ * @param filterFn The filter function to apply to the fields.
58
+ * @returns The list of fields.
187
59
  */
188
- getDataSourceQueriesByAppObject(appObject: string, filterFn?: ((value: DataSourceQueries) => boolean), columns?: string[]): any[];
60
+ getAllFields(filterFn?: (field: AppFieldModel) => boolean): AppFieldModel[];
189
61
  /**
190
- * Gets a specific Data Source Query by ID or Name
191
- *
192
- * @param query ID or Name of the data source query to retrieve
193
- * @param columns Optional columns to include in the result
194
- * @returns The data source query with specified columns or null if not found
195
- *
196
- * @example
197
- * // Get a specific query with all properties
198
- * const query = metadataUtils.getDataSourceQueryDetails('73e590d0-c4eb-464d-abf9-01943e30ae09');
199
- *
200
- * // Get specific columns from a query by name
201
- * const query = metadataUtils.getDataSourceQueryDetails(
202
- * 'Get_SLASchemes_List',
203
- * ['ID', 'QueryName', 'DisplayName']
204
- * );
62
+ * Returns a list of data source queries in the metadata.
63
+ * If a filter function is given, it is applied to each data source query.
64
+ * @param filterFn The filter function to apply to the data source queries.
65
+ * @returns The list of data source queries.
205
66
  */
206
- getDataSourceQueryDetails(query: string, columns?: string[]): any;
67
+ getAllDataSourceQueries(filterFn?: (dsq: DataSourceQueryModel) => boolean): DataSourceQueryModel[];
207
68
  /**
208
- * Gets fields from a data source query
209
- *
210
- * @param query ID or Name of the data source query
211
- * @param filterFn Optional filter function for query fields
212
- * @param columns Optional columns to include in the result
213
- * @returns Array of fields for the specified query with app field details
214
- *
215
- * @example
216
- * // Get all fields for a query
217
- * const queryFields = metadataUtils.getDataSourceQueryFields('73e590d0-c4eb-464d-abf9-01943e30ae09');
69
+ * Retrieves a data source query by its ID, QueryName, or DisplayName.
70
+ * Searches through all data source queries and returns the first match.
218
71
  *
219
- * // Get fields for a query by name
220
- * const queryFields = metadataUtils.getDataSourceQueryFields('Get_SLASchemes_List');
221
- *
222
- * // Get fields with filter and specific columns
223
- * const fields = metadataUtils.getDataSourceQueryFields(
224
- * '73e590d0-c4eb-464d-abf9-01943e30ae09',
225
- * field => field.FieldType === 1,
226
- * ['ID', 'AppFieldID', 'FieldType']
227
- * );
228
- */
229
- getFieldsByDSQ(query: string, filterFn?: ((value: DataSourceQueries_Fields) => boolean), columns?: string[]): any[];
230
- /**
231
- * Enhances query fields with their corresponding app field details
232
- * @private
72
+ * @param {string} nameOrId - The ID, QueryName, or DisplayName of the data source query to retrieve.
73
+ * @returns {DataSourceQueryModel | null} - The data source query model if found, otherwise null.
233
74
  */
234
- private enhanceQueryFieldsWithAppFields;
75
+ getDataSourceQueryByIdOrName(nameOrId: string): DataSourceQueryModel | null;
235
76
  /**
236
- * Finds the parent app object that contains a specific data source query
237
- * @private
238
- */
239
- private findParentAppObjectForQuery;
240
- /**
241
- * Finds an app field by ID within a specific app object
242
- * @private
243
- */
244
- private findAppFieldById;
245
- /**
246
- * Gets query parameters from a data source query
247
- *
248
- * @param query ID or Name of the data source query
249
- * @param filterFn Optional filter function for query parameters
250
- * @param columns Optional columns to include in the result
251
- * @returns Array of parameters for the specified query
77
+ * Retrieves an app screen by its ID, Name, or DisplayName.
78
+ * Searches through all app screens and returns the first match.
252
79
  *
253
- * @example
254
- * // Get all parameters for a query
255
- * const queryParams = metadataUtils.getParametersByDSQ('73e590d0-c4eb-464d-abf9-01943e30ae09');
256
- *
257
- * // Get all parameters for a query by name
258
- * const queryParams = metadataUtils.getParametersByDSQ('Get_SLASchemes_List');
259
- *
260
- * // Get mandatory parameters only
261
- * const mandatoryParams = metadataUtils.getParametersByDSQ(
262
- * '73e590d0-c4eb-464d-abf9-01943e30ae09',
263
- * param => param.IsMandatory === true
264
- * );
80
+ * @param {string} nameOrId - The ID, Name, or DisplayName of the app screen to retrieve.
81
+ * @returns {AppScreenModel | null} - The app screen model if found, otherwise null.
265
82
  */
266
- getParametersByDSQ(query: string, filterFn?: ((value: Parameters) => boolean), columns?: string[]): any[];
83
+ getAppScreenByIdOrName(nameOrId: string): AppScreenModel | null;
267
84
  /**
268
- * Gets App Screens with filter criteria
269
- *
270
- * @param filterFn Optional filter function to apply to app screens
271
- * @param columns Optional columns to include in the result
272
- * @returns Array of filtered app screens
273
- *
274
- * @example
275
- * // Get all system screens
276
- * const systemScreens = metadataUtils.getAppScreens(screen => screen.IsSystemRecord === true);
277
- *
278
- * // Get specific columns from all screens
279
- * const screens = metadataUtils.getAppScreens(
280
- * undefined,
281
- * ['ID', 'Name', 'ScreenType']
282
- * );
283
- */
284
- getAppScreens(filterFn?: ((value: AppScreen) => boolean), columns?: string[]): any[];
285
- /**
286
- * Gets a specific App Screen by ID or Name
287
- *
288
- * @param screen ID or Name of the app screen to retrieve
289
- * @param columns Optional columns to include in the result
290
- * @returns The app screen with specified columns or null if not found
85
+ * Retrieves a list of all app screens.
86
+ * If a filter function is given, it is applied to the list of app screens.
291
87
  *
292
- * @example
293
- * // Get a specific screen with all properties
294
- * const screen = metadataUtils.getAppScreen('a5cd639e-31ba-4d33-8800-005a5248dfb2');
295
- *
296
- * // Get specific columns from a screen by name
297
- * const screen = metadataUtils.getAppScreen(
298
- * 'New Detail Role/Permission Appoject acess wise',
299
- * ['ID', 'Name', 'ScreenType']
300
- * );
88
+ * @param {function} filterFn - The filter function to apply to the app screens.
89
+ * @returns {AppScreenModel[]} - The list of app screens.
301
90
  */
302
- getAppScreen(screen: string, columns?: string[]): any;
91
+ getAllAppScreens(filterFn?: (screen: AppScreenModel) => boolean): AppScreenModel[];
303
92
  /**
304
- * Gets App Menus with filter criteria
305
- *
306
- * @param filterFn Optional filter function to apply to app menus
307
- * @param columns Optional columns to include in the result
308
- * @returns Array of filtered app menus
93
+ * Retrieves an organization info by its ID or TenantCode.
94
+ * Searches through all organization info and returns the first match.
309
95
  *
310
- * @example
311
- * // Get all top-level menus
312
- * const topMenus = metadataUtils.getAppMenus(menu => !menu.ParentID);
313
- *
314
- * // Get specific columns from all menus
315
- * const menus = metadataUtils.getAppMenus(
316
- * undefined,
317
- * ['ID', 'MenuName', 'DisplayName', 'ScreenID']
318
- * );
96
+ * @param {string} nameOrTenantCode - The ID or TenantCode of the organization info to retrieve.
97
+ * @returns {OrgInfoModel | null} - The organization info model if found, otherwise null.
319
98
  */
320
- getAppMenus(filterFn?: ((value: AppMenu) => boolean), columns?: string[]): any[];
99
+ getOrgInfoByIdOrTenantCode(nameOrTenantCode: string): OrgInfoModel | null;
321
100
  /**
322
- * Gets organization information with filter criteria
323
- *
324
- * @param filterFn Optional filter function to apply to organizations
325
- * @param columns Optional columns to include in the result
326
- * @returns Array of filtered organizations
101
+ * Retrieves a list of all organization info.
102
+ * If a filter function is given, it is applied to the list of organization info.
327
103
  *
328
- * @example
329
- * // Get all organizations
330
- * const orgs = metadataUtils.getOrgs();
331
- *
332
- * // Get organizations with specific subdomain pattern
333
- * const specificOrgs = metadataUtils.getOrgs(
334
- * org => org.Subdomain?.includes('test')
335
- * );
104
+ * @param {function} filterFn - The filter function to apply to the organization info.
105
+ * @returns {OrgInfoModel[]} - The list of organization info.
336
106
  */
337
- getOrgs(filterFn?: ((value: OrgInfo) => boolean), columns?: string[]): any[];
107
+ getAllOrgInfos(filterFn?: (org: OrgInfoModel) => boolean): OrgInfoModel[];
338
108
  /**
339
- * Gets a specific organization by ID or Name
340
- *
341
- * @param organization ID or OrganizationName of the organization
342
- * @param columns Optional columns to include in the result
343
- * @returns The organization or null if not found
344
- *
345
- * @example
346
- * // Get organization by ID
347
- * const org = metadataUtils.getOrgInfoDetails('0ec3d0f1-b2ec-47b7-8305-b767d0e5ea63');
109
+ * Performs a global search across all metadata for a given search term.
110
+ * You can narrow the search by providing a list of entity types to search within.
348
111
  *
349
- * // Get organization by name
350
- * const org = metadataUtils.getOrgInfoDetails('SquadFocus');
112
+ * @param {string} term - The search term to search for.
113
+ * @param {MetadataEntityType[]} entityTypes - The list of entity types to search within. If omitted, all entity types are searched.
114
+ * @returns {Record<string, any[]>} - A dictionary with results grouped by entity type.
351
115
  */
352
- getOrgInfoDetails(organization: string, columns?: string[]): any;
116
+ searchMetadata(term: string, entityTypes?: MetadataEntityType[]): Record<string, any[]>;
353
117
  static ɵfac: i0.ɵɵFactoryDeclaration<MetadataHelper, never>;
354
118
  static ɵprov: i0.ɵɵInjectableDeclaration<MetadataHelper>;
355
119
  }
@@ -22,6 +22,5 @@ export declare enum MetadataEntityType {
22
22
  APP_OBJECTS = "AppObjects",
23
23
  APP_FIELDS = "AppFields",
24
24
  DATA_SOURCE_QUERIES = "DataSourceQueries",
25
- APP_SCREENS = "AppScreens",
26
- APP_MENUS = "AppMenus"
25
+ APP_SCREENS = "AppScreens"
27
26
  }
@@ -0,0 +1,56 @@
1
+ import { DataSourceQueryFieldType, ObjectCreationType } from "../enums/dsq.enum";
2
+ import { FieldAccess, FieldType, LookUpDetails } from "./data-source-queries.class";
3
+ export declare class AppFieldModel {
4
+ private readonly raw;
5
+ readonly ID: string;
6
+ readonly ObjectID: string | null;
7
+ readonly ObjectID_Tosave: string;
8
+ readonly FieldName: string;
9
+ readonly DisplayName: string;
10
+ readonly Description: string;
11
+ readonly FieldType: FieldType;
12
+ readonly CreationType: ObjectCreationType;
13
+ readonly FieldBase: DataSourceQueryFieldType;
14
+ readonly IsRequired: boolean;
15
+ readonly IsUnique: boolean;
16
+ readonly BaseField: string | null;
17
+ readonly IsSearchable: boolean;
18
+ readonly IsUpdatable: boolean;
19
+ readonly IsConfidential: boolean;
20
+ readonly SystemDBFieldName: string;
21
+ readonly IsSystem: boolean;
22
+ readonly IsVisible: boolean;
23
+ readonly IsPrimaryKey: boolean;
24
+ readonly IsDeprecated: boolean;
25
+ readonly IsDisplayField: boolean;
26
+ readonly LookUpDetails: LookUpDetails;
27
+ readonly IsLookup: boolean;
28
+ readonly AccessList: FieldAccess[];
29
+ readonly Data: string | null;
30
+ readonly FieldConfiguration: any;
31
+ readonly FieldValidatorConfiguration: any;
32
+ constructor(raw: any);
33
+ private parseFieldConfiguration;
34
+ /**
35
+ * Gets the data type name of the field as a string.
36
+ * The data type name is obtained from the DataTypes enum.
37
+ * @returns {string} The data type name.
38
+ */
39
+ get dataTypeName(): string;
40
+ /**
41
+ * Searches for the given search term in the properties of the current AppFieldModel instance.
42
+ * The search is case-insensitive and is performed on the following properties:
43
+ * - ID
44
+ * - FieldName
45
+ * - DisplayName
46
+ * - SystemDBFieldName
47
+ * @param {string} term The search term.
48
+ * @returns {boolean} Whether the search term is present in any of the properties.
49
+ */
50
+ search(term: string): boolean;
51
+ /**
52
+ * Converts the AppFieldModel instance to a JSON representation.
53
+ * @returns {any} The raw data of the instance.
54
+ */
55
+ toJSON(): any;
56
+ }