@techextensor/tab-core-utility 2.1.7 → 2.1.8

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 (177) hide show
  1. package/esm2022/index.mjs +64 -0
  2. package/esm2022/lib/tab-core-utility/app/constants/api-constants.mjs +33 -0
  3. package/esm2022/lib/tab-core-utility/app/constants/common.mjs +25 -0
  4. package/esm2022/lib/tab-core-utility/app/constants/error-messages.mjs +13 -0
  5. package/esm2022/lib/tab-core-utility/app/constants/storage-constants.mjs +16 -0
  6. package/esm2022/lib/tab-core-utility/app/crud/tab-delete.service.mjs +145 -0
  7. package/esm2022/lib/tab-core-utility/app/crud/tab-get.service.mjs +131 -0
  8. package/esm2022/lib/tab-core-utility/app/crud/tab-insert.service.mjs +77 -0
  9. package/esm2022/lib/tab-core-utility/app/crud/tab-update.service.mjs +105 -0
  10. package/esm2022/lib/tab-core-utility/app/crud/tab-workflow.service.mjs +43 -0
  11. package/esm2022/lib/tab-core-utility/app/enums/controllers.enum.mjs +26 -0
  12. package/esm2022/lib/tab-core-utility/app/enums/dsq.enum.mjs +48 -0
  13. package/esm2022/lib/tab-core-utility/app/enums/permission.enum.mjs +20 -0
  14. package/esm2022/lib/tab-core-utility/app/enums/query.enum.mjs +14 -0
  15. package/esm2022/lib/tab-core-utility/app/enums/workflow.enum.mjs +37 -0
  16. package/esm2022/lib/tab-core-utility/app/helpers/common/app.helpers.mjs +68 -0
  17. package/esm2022/lib/tab-core-utility/app/helpers/common/dsq.helpers.mjs +70 -0
  18. package/esm2022/lib/tab-core-utility/app/helpers/common/req-res.helpers.mjs +64 -0
  19. package/esm2022/lib/tab-core-utility/app/helpers/common/where-clause.helpers.mjs +208 -0
  20. package/esm2022/lib/tab-core-utility/app/helpers/screen/forms.helpers.mjs +38 -0
  21. package/esm2022/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.mjs +78 -0
  22. package/esm2022/lib/tab-core-utility/app/helpers/screen/grid.helpers.mjs +112 -0
  23. package/esm2022/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.mjs +77 -0
  24. package/esm2022/lib/tab-core-utility/app/helpers/screen/plugin.helpers.mjs +55 -0
  25. package/esm2022/lib/tab-core-utility/app/helpers/screen/screen.helpers.mjs +26 -0
  26. package/esm2022/lib/tab-core-utility/app/interfaces/auth.interface.mjs +2 -0
  27. package/esm2022/lib/tab-core-utility/app/interfaces/common-api.interface.mjs +2 -0
  28. package/esm2022/lib/tab-core-utility/app/interfaces/grid.interface.mjs +3 -0
  29. package/esm2022/lib/tab-core-utility/app/interfaces/orgInfo.interface.mjs +2 -0
  30. package/esm2022/lib/tab-core-utility/app/interfaces/schema.interface.mjs +2 -0
  31. package/esm2022/lib/tab-core-utility/app/interfaces/user.interface.mjs +2 -0
  32. package/esm2022/lib/tab-core-utility/app/models/api-query.class.mjs +47 -0
  33. package/esm2022/lib/tab-core-utility/app/models/app-object.class.mjs +30 -0
  34. package/esm2022/lib/tab-core-utility/app/models/common.class.mjs +12 -0
  35. package/esm2022/lib/tab-core-utility/app/models/data-source-queries.class.mjs +31 -0
  36. package/esm2022/lib/tab-core-utility/app/utils/filter.util.mjs +75 -0
  37. package/esm2022/lib/tab-core-utility/app/utils/form-builder.util.mjs +39 -0
  38. package/esm2022/lib/tab-core-utility/app/utils/json.util.mjs +138 -0
  39. package/esm2022/lib/tab-core-utility/app/utils/operators.util.mjs +129 -0
  40. package/esm2022/lib/tab-core-utility/app/utils/req-res.util.mjs +168 -0
  41. package/esm2022/lib/tab-core-utility/app/utils/tab-app.util.mjs +99 -0
  42. package/esm2022/lib/tab-core-utility/auth/auth.service.mjs +74 -0
  43. package/esm2022/lib/tab-core-utility/auth/idb-storage.service.mjs +69 -0
  44. package/esm2022/lib/tab-core-utility/auth/local-storage.service.mjs +52 -0
  45. package/esm2022/lib/tab-core-utility/auth/session-storage.service.mjs +52 -0
  46. package/esm2022/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.mjs +26 -0
  47. package/esm2022/lib/tab-core-utility/core/error-handler/error-handler.store.mjs +21 -0
  48. package/esm2022/lib/tab-core-utility/core/error-handler/models/error-handler.state.mjs +5 -0
  49. package/esm2022/lib/tab-core-utility/core/http-client/api-url.token.mjs +4 -0
  50. package/esm2022/lib/tab-core-utility/core/http-client/api.service.mjs +99 -0
  51. package/esm2022/lib/tab-core-utility/core/util/auth.utils.mjs +21 -0
  52. package/esm2022/lib/tab-core-utility/store/auth.store.mjs +43 -0
  53. package/esm2022/lib/tab-core-utility/store/orginfo.store.mjs +42 -0
  54. package/esm2022/lib/tab-core-utility/store/schema.store.mjs +68 -0
  55. package/esm2022/techextensor-tab-core-utility.mjs +5 -0
  56. package/{src/index.ts → index.d.ts} +53 -77
  57. package/lib/tab-core-utility/app/constants/api-constants.d.ts +30 -0
  58. package/lib/tab-core-utility/app/constants/common.d.ts +8 -0
  59. package/lib/tab-core-utility/app/constants/error-messages.d.ts +6 -0
  60. package/lib/tab-core-utility/app/constants/storage-constants.d.ts +15 -0
  61. package/lib/tab-core-utility/app/crud/tab-delete.service.d.ts +51 -0
  62. package/lib/tab-core-utility/app/crud/tab-get.service.d.ts +58 -0
  63. package/lib/tab-core-utility/app/crud/tab-insert.service.d.ts +37 -0
  64. package/lib/tab-core-utility/app/crud/tab-update.service.d.ts +14 -0
  65. package/lib/tab-core-utility/app/crud/tab-workflow.service.d.ts +20 -0
  66. package/lib/tab-core-utility/app/enums/controllers.enum.d.ts +24 -0
  67. package/lib/tab-core-utility/app/enums/dsq.enum.d.ts +42 -0
  68. package/lib/tab-core-utility/app/enums/permission.enum.d.ts +16 -0
  69. package/lib/tab-core-utility/app/enums/query.enum.d.ts +11 -0
  70. package/lib/tab-core-utility/app/enums/workflow.enum.d.ts +30 -0
  71. package/lib/tab-core-utility/app/helpers/common/app.helpers.d.ts +31 -0
  72. package/lib/tab-core-utility/app/helpers/common/dsq.helpers.d.ts +32 -0
  73. package/lib/tab-core-utility/app/helpers/common/req-res.helpers.d.ts +62 -0
  74. package/lib/tab-core-utility/app/helpers/common/where-clause.helpers.d.ts +82 -0
  75. package/lib/tab-core-utility/app/helpers/screen/forms.helpers.d.ts +11 -0
  76. package/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.d.ts +33 -0
  77. package/lib/tab-core-utility/app/helpers/screen/grid.helpers.d.ts +63 -0
  78. package/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.d.ts +38 -0
  79. package/lib/tab-core-utility/app/helpers/screen/plugin.helpers.d.ts +25 -0
  80. package/lib/tab-core-utility/app/helpers/screen/screen.helpers.d.ts +11 -0
  81. package/{src/lib/tab-core-utility/app/interfaces/auth.interface.ts → lib/tab-core-utility/app/interfaces/auth.interface.d.ts} +15 -18
  82. package/lib/tab-core-utility/app/interfaces/common-api.interface.d.ts +24 -0
  83. package/lib/tab-core-utility/app/interfaces/grid.interface.d.ts +110 -0
  84. package/lib/tab-core-utility/app/interfaces/orgInfo.interface.d.ts +31 -0
  85. package/lib/tab-core-utility/app/interfaces/schema.interface.d.ts +11 -0
  86. package/lib/tab-core-utility/app/interfaces/user.interface.d.ts +84 -0
  87. package/lib/tab-core-utility/app/models/api-query.class.d.ts +69 -0
  88. package/lib/tab-core-utility/app/models/app-object.class.d.ts +74 -0
  89. package/lib/tab-core-utility/app/models/common.class.d.ts +24 -0
  90. package/lib/tab-core-utility/app/models/data-source-queries.class.d.ts +95 -0
  91. package/lib/tab-core-utility/app/utils/filter.util.d.ts +30 -0
  92. package/lib/tab-core-utility/app/utils/form-builder.util.d.ts +13 -0
  93. package/lib/tab-core-utility/app/utils/json.util.d.ts +25 -0
  94. package/lib/tab-core-utility/app/utils/operators.util.d.ts +21 -0
  95. package/lib/tab-core-utility/app/utils/req-res.util.d.ts +61 -0
  96. package/lib/tab-core-utility/app/utils/tab-app.util.d.ts +48 -0
  97. package/lib/tab-core-utility/auth/auth.service.d.ts +53 -0
  98. package/lib/tab-core-utility/auth/idb-storage.service.d.ts +14 -0
  99. package/lib/tab-core-utility/auth/local-storage.service.d.ts +22 -0
  100. package/lib/tab-core-utility/auth/session-storage.service.d.ts +22 -0
  101. package/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.d.ts +3 -0
  102. package/lib/tab-core-utility/core/error-handler/error-handler.store.d.ts +10 -0
  103. package/lib/tab-core-utility/core/error-handler/models/error-handler.state.d.ts +5 -0
  104. package/lib/tab-core-utility/core/http-client/api-url.token.d.ts +3 -0
  105. package/lib/tab-core-utility/core/http-client/api.service.d.ts +65 -0
  106. package/lib/tab-core-utility/core/util/auth.utils.d.ts +9 -0
  107. package/lib/tab-core-utility/store/auth.store.d.ts +19 -0
  108. package/lib/tab-core-utility/store/orginfo.store.d.ts +22 -0
  109. package/lib/tab-core-utility/store/schema.store.d.ts +32 -0
  110. package/package.json +31 -18
  111. package/.eslintrc.json +0 -92
  112. package/README.md +0 -7
  113. package/jest.config.ts +0 -22
  114. package/ng-package.json +0 -7
  115. package/project.json +0 -42
  116. package/src/lib/tab-core-utility/app/constants/api-constants.ts +0 -33
  117. package/src/lib/tab-core-utility/app/constants/common.ts +0 -34
  118. package/src/lib/tab-core-utility/app/constants/error-messages.ts +0 -21
  119. package/src/lib/tab-core-utility/app/constants/storage-constants.ts +0 -17
  120. package/src/lib/tab-core-utility/app/crud/tab-delete.service.ts +0 -144
  121. package/src/lib/tab-core-utility/app/crud/tab-get.service.ts +0 -160
  122. package/src/lib/tab-core-utility/app/crud/tab-insert.service.ts +0 -75
  123. package/src/lib/tab-core-utility/app/crud/tab-update.service.ts +0 -105
  124. package/src/lib/tab-core-utility/app/crud/tab-workflow.service.ts +0 -39
  125. package/src/lib/tab-core-utility/app/enums/controllers.enum.ts +0 -24
  126. package/src/lib/tab-core-utility/app/enums/dsq.enum.ts +0 -46
  127. package/src/lib/tab-core-utility/app/enums/permission.enum.ts +0 -18
  128. package/src/lib/tab-core-utility/app/enums/query.enum.ts +0 -12
  129. package/src/lib/tab-core-utility/app/enums/workflow.enum.ts +0 -35
  130. package/src/lib/tab-core-utility/app/helpers/common/app.helpers.ts +0 -65
  131. package/src/lib/tab-core-utility/app/helpers/common/dsq.helpers.ts +0 -80
  132. package/src/lib/tab-core-utility/app/helpers/common/req-res.helpers.ts +0 -75
  133. package/src/lib/tab-core-utility/app/helpers/common/where-clause.helpers.ts +0 -262
  134. package/src/lib/tab-core-utility/app/helpers/screen/forms.helpers.ts +0 -33
  135. package/src/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.ts +0 -88
  136. package/src/lib/tab-core-utility/app/helpers/screen/grid.helpers.ts +0 -113
  137. package/src/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.ts +0 -74
  138. package/src/lib/tab-core-utility/app/helpers/screen/plugin.helpers.ts +0 -52
  139. package/src/lib/tab-core-utility/app/helpers/screen/screen.helpers.ts +0 -20
  140. package/src/lib/tab-core-utility/app/interfaces/common-api.interface.ts +0 -27
  141. package/src/lib/tab-core-utility/app/interfaces/grid.interface.ts +0 -118
  142. package/src/lib/tab-core-utility/app/interfaces/orgInfo.interface.ts +0 -34
  143. package/src/lib/tab-core-utility/app/interfaces/schema.interface.ts +0 -11
  144. package/src/lib/tab-core-utility/app/interfaces/user.interface.ts +0 -91
  145. package/src/lib/tab-core-utility/app/models/api-query.class.ts +0 -92
  146. package/src/lib/tab-core-utility/app/models/app-object.class.ts +0 -87
  147. package/src/lib/tab-core-utility/app/models/common.class.ts +0 -30
  148. package/src/lib/tab-core-utility/app/models/data-source-queries.class.ts +0 -114
  149. package/src/lib/tab-core-utility/app/utils/filter.util.ts +0 -78
  150. package/src/lib/tab-core-utility/app/utils/form-builder.util.ts +0 -31
  151. package/src/lib/tab-core-utility/app/utils/json.util.ts +0 -137
  152. package/src/lib/tab-core-utility/app/utils/operators.util.ts +0 -129
  153. package/src/lib/tab-core-utility/app/utils/req-res.util.ts +0 -189
  154. package/src/lib/tab-core-utility/app/utils/tab-app.util.ts +0 -131
  155. package/src/lib/tab-core-utility/auth/auth.service.spec.ts +0 -167
  156. package/src/lib/tab-core-utility/auth/auth.service.ts +0 -91
  157. package/src/lib/tab-core-utility/auth/idb-storage.service.ts +0 -77
  158. package/src/lib/tab-core-utility/auth/local-storage.service.spec.ts +0 -47
  159. package/src/lib/tab-core-utility/auth/local-storage.service.ts +0 -46
  160. package/src/lib/tab-core-utility/auth/session-storage.service.spec.ts +0 -47
  161. package/src/lib/tab-core-utility/auth/session-storage.service.ts +0 -46
  162. package/src/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.ts +0 -32
  163. package/src/lib/tab-core-utility/core/error-handler/error-handler.store.spec.ts +0 -16
  164. package/src/lib/tab-core-utility/core/error-handler/error-handler.store.ts +0 -26
  165. package/src/lib/tab-core-utility/core/error-handler/models/error-handler.state.ts +0 -9
  166. package/src/lib/tab-core-utility/core/http-client/api-url.token.ts +0 -4
  167. package/src/lib/tab-core-utility/core/http-client/api.service.spec.ts +0 -18
  168. package/src/lib/tab-core-utility/core/http-client/api.service.ts +0 -105
  169. package/src/lib/tab-core-utility/core/util/auth.utils.ts +0 -22
  170. package/src/lib/tab-core-utility/store/auth.store.ts +0 -54
  171. package/src/lib/tab-core-utility/store/orginfo.store.ts +0 -57
  172. package/src/lib/tab-core-utility/store/schema.store.ts +0 -85
  173. package/src/test-setup.ts +0 -8
  174. package/tsconfig.json +0 -29
  175. package/tsconfig.lib.json +0 -17
  176. package/tsconfig.lib.prod.json +0 -7
  177. package/tsconfig.spec.json +0 -16
@@ -1,75 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { Injectable, inject } from '@angular/core';
3
- import { DSQHelper } from '../helpers/common/dsq.helpers';
4
- import { ScreenHelper } from '../helpers/screen/screen.helpers';
5
- import { WhereClauseHelper } from '../helpers/common/where-clause.helpers';
6
- import { RequestResponseHelper } from '../helpers/common/req-res.helpers';
7
- import { getAppObject, getDataFromDataSourceQueryID, syncAppObjectFields } from '../utils/tab-app.util';
8
- import { AppObject, AppScreen } from '../models/app-object.class';
9
- import { getPrimaryKeyFields, removeMultiplePrimaryKey, removePrimaryKey } from '../utils/req-res.util';
10
- import { APIFilterCriteria } from '../models/api-query.class';
11
- import { createDynamicData, removeBlankValue } from '../utils/json.util';
12
- import { QueryType } from '../enums/query.enum';
13
-
14
-
15
- @Injectable({ providedIn: 'root' })
16
- export class TabInsertService {
17
- private readonly dsqHelper = inject(DSQHelper);
18
- private readonly screenHelper = inject(ScreenHelper);
19
- private readonly whereClauseHelper = inject(WhereClauseHelper);
20
- private readonly requestResponseHelper = inject(RequestResponseHelper);
21
-
22
- /**
23
- * Inserts data by screen ID.
24
- * @param screenId The ID of the screen.
25
- * @param data The data to insert.
26
- * @returns An Observable with the insert result.
27
- */
28
- insertByScreenId(screenId: string, data: any) {
29
- const screen: AppScreen = this.screenHelper.getScreen(screenId);
30
- const screenDataSource = getDataFromDataSourceQueryID(screen.DataSourceQuery);
31
- return this.insertByObjectId(screenDataSource.ObjectID_Tosave, data);
32
- }
33
-
34
- /**
35
- * Inserts data by object ID.
36
- * @param objectId The ID of the object.
37
- * @param data The data to insert.
38
- * @returns An Observable with the insert result.
39
- */
40
- insertByObjectId(objectId: string, data: any) {
41
- const appObject: AppObject = getAppObject(objectId);
42
- return this.prepareInsert(appObject, data);
43
- }
44
-
45
- /**
46
- * Prepares data for insertion.
47
- * @param appObject The app object.
48
- * @param data The data to insert.
49
- * @returns An Observable with the prepared data.
50
- */
51
- prepareInsert(appObject: AppObject, data: any) {
52
- const crudTableName = appObject.SystemDBTableName;
53
- syncAppObjectFields(data.data, appObject);
54
- const PrimaryKeyFields = getPrimaryKeyFields(appObject);
55
- if (PrimaryKeyFields && PrimaryKeyFields.length === 1) {
56
- removePrimaryKey(data.data, PrimaryKeyFields[0]?.FieldName);
57
- } else if (PrimaryKeyFields && PrimaryKeyFields.length > 1) {
58
- removeMultiplePrimaryKey(data.data, PrimaryKeyFields);
59
- }
60
- const whereClause: APIFilterCriteria = this.whereClauseHelper.bindWhereClauseForInsert();
61
- const dataObj: any = createDynamicData(data.data);
62
- removeBlankValue(dataObj);
63
- const requestPayload = this.requestResponseHelper.insertPayload(crudTableName, whereClause, dataObj);
64
- return this.insert(requestPayload);
65
- }
66
-
67
- /**
68
- * Inserts data.
69
- * @param data The data to insert.
70
- * @returns An Observable with the insert result.
71
- */
72
- insert(data: any) {
73
- return this.dsqHelper.executeQuery(data, QueryType.Insert);
74
- }
75
- }
@@ -1,105 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
-
3
- import { Injectable, inject } from "@angular/core";
4
- import { DSQHelper } from "../helpers/common/dsq.helpers";
5
- import { ScreenHelper } from "../helpers/screen/screen.helpers";
6
- import { WhereClauseHelper } from "../helpers/common/where-clause.helpers";
7
- import { RequestResponseHelper } from "../helpers/common/req-res.helpers";
8
- import { APIFilterCriteria, APIUpdateQuery } from "../models/api-query.class";
9
- import { QueryType } from "../enums/query.enum";
10
- import { getAppObject, getAppObjectFromSystemDBTableName, getDataFromDataSourceQueryID, syncAppObjectFields } from "../utils/tab-app.util";
11
- import { AppObject, AppScreen } from "../models/app-object.class";
12
- import { createDynamicData, removeBlankValue } from "../utils/json.util";
13
- import { getEditRecordId, getPrimaryKeyFields, removeMultiplePrimaryKey, removePrimaryKey } from "../utils/req-res.util";
14
- import { UpdateQueryParameter } from "../models/data-source-queries.class";
15
-
16
-
17
- @Injectable({ providedIn: 'root' })
18
- export class TabUpdateService {
19
- private readonly dsqHelper = inject(DSQHelper);
20
- private readonly screenHelper = inject(ScreenHelper);
21
- private readonly whereClauseHelper = inject(WhereClauseHelper);
22
- private readonly requestResponseHelper = inject(RequestResponseHelper);
23
-
24
- update(data: APIUpdateQuery) {
25
- return this.dsqHelper.executeQuery(data, QueryType.Update);
26
- }
27
-
28
- updateUsingDSQ(dsqId: string, data: any, tableName: string, queryFieldsArray?: any) {
29
- const appObject: AppObject = getDataFromDataSourceQueryID(dsqId);
30
- if (appObject) {
31
- if (data && data.data) {
32
- const whereClause: APIFilterCriteria = this.whereClauseHelper.bindWhereClauseForUpdate(tableName, queryFieldsArray);
33
- let dataObj: any = [];
34
- dataObj = createDynamicData(data.data);
35
- const requestPayload = this.requestResponseHelper.updateRequestPayload(tableName, whereClause, dataObj);
36
- return this.update(requestPayload);
37
- }
38
- }
39
- return null;
40
- }
41
-
42
- updateUsingScreenId(screenId: string, data: any, objectIdToSave?: string) {
43
- let fields;
44
- let appObject: any = AppObject;
45
- let crudTableName;
46
- if (screenId) {
47
- const screen: AppScreen = this.screenHelper.getScreen(screenId);
48
- const screenDataSource = getDataFromDataSourceQueryID(screen.DataSourceQuery);
49
- fields = screenDataSource.Fields;
50
- appObject = getAppObject(screenDataSource.ObjectID_Tosave);
51
- crudTableName = appObject.SystemDBTableName;
52
- syncAppObjectFields(data.data, appObject);
53
- }
54
- if (objectIdToSave) {
55
- fields = [];
56
- appObject = getAppObject(objectIdToSave);
57
- appObject.Fields.forEach((element: any) => {
58
- fields.push({ Field: element })
59
- });
60
- crudTableName = appObject.SystemDBTableName;
61
- syncAppObjectFields(data.data, appObject);
62
- }
63
-
64
- const PrimaryKeyFields: any = getPrimaryKeyFields(appObject);
65
- let whereClause: any = APIFilterCriteria;
66
- if (appObject) {
67
- if (data.data) {
68
- const recordId = getEditRecordId(data.data, PrimaryKeyFields[0]?.FieldName);
69
- data['recordId'] = recordId;
70
-
71
- if (PrimaryKeyFields && PrimaryKeyFields.length === 1) {
72
- removePrimaryKey(data.data, PrimaryKeyFields[0]?.FieldName);
73
- whereClause = this.whereClauseHelper.bindWhereClauseForUpdateGrid(fields, data.recordId, PrimaryKeyFields[0].FieldName, crudTableName);
74
- } else if (PrimaryKeyFields && PrimaryKeyFields.length > 1) {
75
- whereClause = this.whereClauseHelper.bindWhereClauseForMultiplePrimaryKeys(data.data, PrimaryKeyFields, crudTableName);
76
- removeMultiplePrimaryKey(data.data, PrimaryKeyFields);
77
- }
78
- const dataObj: any = createDynamicData(data.data);
79
- removeBlankValue(dataObj);
80
- const requestPayload = this.requestResponseHelper.updateRequestPayload(crudTableName, whereClause, dataObj);
81
- return this.update(requestPayload);
82
- }
83
- }
84
- return null;
85
- }
86
-
87
- updateScreen(screenId: string, screenData: any) {
88
- const screen: AppScreen = this.screenHelper.getScreen(screenId);
89
- if (screen) {
90
- const appObject = getAppObjectFromSystemDBTableName('TABMD_AppScreen');
91
- if (appObject) {
92
- syncAppObjectFields(screenData, appObject);
93
- }
94
- Object.assign({}, screen, { Container: screenData.Container });
95
- const queryFilters: UpdateQueryParameter[] = [];
96
- queryFilters.push({ FieldName: 'ID', FieldValue: screenId })
97
- const whereClause = this.whereClauseHelper.bindWhereClauseForUpdate('TABMD_AppScreen', queryFilters);
98
- const dataObj: any = createDynamicData(screenData);
99
- removeBlankValue(dataObj);
100
- const requestPayload = this.requestResponseHelper.updateRequestPayload('TABMD_AppScreen', whereClause, dataObj);
101
- return this.update(requestPayload);
102
- }
103
- return null;
104
- }
105
- }
@@ -1,39 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
-
3
- import { Injectable, inject } from "@angular/core";
4
- import { ApiService } from "../../core/http-client/api.service";
5
- import { getHeaders } from "../utils/req-res.util";
6
-
7
-
8
- @Injectable({ providedIn: 'root' })
9
- export class TabWorkflowService {
10
- private readonly apiService = inject(ApiService);
11
-
12
- /**
13
- * Executes a TAB workflow.
14
- * @param endPoint The endpoint for the workflow.
15
- * @param data The data to send with the request.
16
- * @returns An observable of the workflow execution result.
17
- */
18
- executeTABWorkflow(endPoint: string, data: string) {
19
- const headers = getHeaders();
20
- if (headers) {
21
- return this.apiService.post(endPoint, data, headers);
22
- }
23
- return null;
24
- }
25
-
26
- /**
27
- * Executes an ELSA workflow.
28
- * @param endPoint The endpoint for the workflow.
29
- * @param data The data to send with the request.
30
- * @returns An observable of the workflow execution result.
31
- */
32
- executeELSAWorkflow(endPoint: string, data: string) {
33
- const headers = getHeaders();
34
- if (headers) {
35
- return this.apiService.postWorkflow(endPoint, data, headers);
36
- }
37
- return null;
38
- }
39
- }
@@ -1,24 +0,0 @@
1
- export enum DataTypes {
2
- AutoNumber = 1,
3
- Number = 2,
4
- CheckBox = 3,
5
- Currency = 4,
6
- Date = 5,
7
- DateTime = 6,
8
- Email = 7,
9
- GeoLocation = 8,
10
- Percent = 9,
11
- PhoneNumber = 10,
12
- PickList = 11,
13
- PickList_MultiSelect = 12,
14
- Text = 13,
15
- TextArea = 14,
16
- TextArea_RICHEDITOR = 15,
17
- URL = 16,
18
- UniqueIdentifier = 17,
19
- Insert_TimeStamp = 18,
20
- Update_TimeStamp = 19,
21
- NextNumber = 20,
22
- Array = 21,
23
- JSON = 22,
24
- }
@@ -1,46 +0,0 @@
1
- export enum ConjuctionClause {
2
- AND = 1,
3
- OR = 2,
4
- AND_NOT = 3,
5
- OR_NOT = 4,
6
- }
7
-
8
- export enum RelationalOperator {
9
- GreaterThan = 1,
10
- LessThan = 2,
11
- EqualTo = 3,
12
- IN = 4,
13
- NOTIN = 5,
14
- IsNULL = 6,
15
- IsNotNULL = 7,
16
- NotEqualTo = 8,
17
- GreaterThanOREqualTo = 9,
18
- LessThanOREqualTo = 10,
19
- Contains = 11,
20
- NotContains = 12,
21
- StartsWith = 13,
22
- NotStartsWith = 14,
23
- EndsWith = 15,
24
- NotEndsWith = 16,
25
- Between = 17,
26
- NotBetween = 18,
27
- SplitContains = 19,
28
- NotSplitContains = 20,
29
- }
30
-
31
- export enum FilterValueType {
32
- Literal = 1,
33
- Parameter = 2,
34
- Property = 3,
35
- Global = 4,
36
- }
37
-
38
- export enum SortSequence {
39
- Asc = 1,
40
- Desc = 2,
41
- }
42
-
43
- export enum ObjectCreationType {
44
- Standard = 1,
45
- Custom = 2,
46
- }
@@ -1,18 +0,0 @@
1
- export enum AccessType {
2
- READ = 'READ',
3
- CREATE = 'CREATE',
4
- UPDATE = 'UPDATE',
5
- DELETE = 'DELETE',
6
- }
7
-
8
- export enum AccessPermission {
9
- None = 1,
10
- Own = 2,
11
- Team = 3,
12
- All = 4,
13
- }
14
-
15
- export enum DeploymentStatus {
16
- InDevelopment = 1,
17
- Deployed = 2,
18
- }
@@ -1,12 +0,0 @@
1
- export enum QueryType {
2
- Select,
3
- Insert,
4
- Update,
5
- Delete,
6
- Upsert,
7
- }
8
-
9
- export enum JoinType {
10
- LeftJoin = 1,
11
- RightJoin = 2,
12
- }
@@ -1,35 +0,0 @@
1
- export enum WorkFlowTriggerType {
2
- EventBased = 1,
3
- DateBased = 2,
4
- }
5
-
6
- export enum WorkFlowEventExecution_WorkFlowTriggerEvent {
7
- Created = 1,
8
- Edited = 2,
9
- CreatedOrEdited = 3,
10
- Deleted = 4,
11
- }
12
-
13
- export enum WorkFlowEventExecution_WorkFlowTriggerFieldCriteria {
14
- WhenAnyFieldIsUpdated = 1,
15
- WhenAnySelectedFieldIsUpdated = 2,
16
- WhenSelectedAllFieldsAreUpdated = 3,
17
- }
18
-
19
- export enum WorkFlowEventExecution_WorkFlowTriggerOccurence {
20
- Everytime = 1,
21
- FirstTime = 2,
22
- }
23
-
24
- export enum WorkFlowTimeExecution_DaysRelationalOperator {
25
- Before = 1,
26
- After = 2,
27
- }
28
-
29
- export enum WorkFlowTimeExecution_ExecutionCycle {
30
- Once = 1,
31
- Weekly = 2,
32
- Monthly = 3,
33
- Yearly = 4,
34
- Daily = 5,
35
- }
@@ -1,65 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
-
3
- import { Injectable, inject } from '@angular/core';
4
- import { ApiService } from '../../../core/http-client/api.service';
5
- import { getHeaders } from '../../utils/req-res.util';
6
- import { API } from '../../constants/api-constants';
7
- import { LocalStorageService } from '../../../auth/local-storage.service';
8
-
9
- @Injectable({ providedIn: 'root' })
10
- export class AppHelper {
11
- private readonly apiService = inject(ApiService);
12
- private readonly localStorageService = inject(LocalStorageService);
13
-
14
- /**
15
- * Rebuilds the application.
16
- * @param data Optional data for rebuilding the application
17
- * @returns Result of the rebuild operation
18
- */
19
- rebuildApp(data?: any) {
20
- const headers = getHeaders();
21
- if (headers) {
22
- return this.apiService.post(API.buildApp, data ? data : {}, headers);
23
- }
24
- return null;
25
- }
26
-
27
- /**
28
- * Publishes the application.
29
- * @param params Optional parameters for publishing the application
30
- * @returns Result of the publish operation
31
- */
32
- publishApp(params?: any) {
33
- const headers = getHeaders();
34
- if (headers) {
35
- return this.apiService.get(API.publishApp, params, headers);
36
- }
37
- return null;
38
- }
39
-
40
- /**
41
- * Retrieves screen data.
42
- * @param params Optional parameters for retrieving screen data
43
- * @returns Screen data
44
- */
45
- getScreen(params?: any) {
46
- const headers = getHeaders();
47
- if (headers) {
48
- return this.apiService.get(API.getScreen, params, headers);
49
- }
50
- return null;
51
- }
52
-
53
- /**
54
- * Retrieves schema data.
55
- * @param params Optional parameters for retrieving schema data
56
- * @returns Subscription for getting schema data
57
- */
58
- getSchema(params?: any) {
59
- const headers = getHeaders();
60
- if (headers) {
61
- return this.apiService.get(API.getSchema, params, headers);
62
- }
63
- return null;
64
- }
65
- }
@@ -1,80 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
-
3
- import { Injectable, inject } from '@angular/core';
4
- import { ApiService } from '../../../core/http-client/api.service';
5
- import { QueryType } from '../../enums/query.enum';
6
- import { API } from '../../constants/api-constants';
7
- import { getHeaders } from '../../utils/req-res.util';
8
- import { getAppObjectFromDataSourceQueryID } from '../../utils/tab-app.util';
9
- import { AccessPermission, AccessType } from '../../enums/permission.enum';
10
-
11
- @Injectable({ providedIn: 'root' })
12
- export class DSQHelper {
13
- private readonly apiService = inject(ApiService);
14
-
15
- /**
16
- * Executes a query based on the query type
17
- * @param data The data to be executed
18
- * @param queryType The type of query to be executed
19
- * @returns The result of the query execution
20
- */
21
- executeQuery(data: any, queryType: QueryType) {
22
- switch (queryType) {
23
- case QueryType.Insert:
24
- return this.execution(data, API.insert);
25
- case QueryType.Update:
26
- return this.execution(data, API.update);
27
- case QueryType.Delete:
28
- return this.execution(data, API.delete);
29
- case QueryType.Select:
30
- return this.execution(data, API.select);
31
- default:
32
- return null;
33
- }
34
- }
35
-
36
- /**
37
- * Executes an HTTP POST request with the provided data and URL
38
- * @param data The data to be sent in the POST request
39
- * @param endPointName The URL to send the POST request to
40
- * @returns The result of the POST request if headers are available, otherwise null
41
- */
42
- private execution(data: any, endPointName: string) {
43
- const headers = getHeaders();
44
- if (headers) {
45
- return this.apiService.post(endPointName, data, headers);
46
- }
47
- return null;
48
- }
49
-
50
- /**
51
- * Checks if the user has access to the specified object based on roles and access type
52
- * @param dsqId The DataSourceQuery ID to check access for
53
- * @param accessType The type of access to check (e.g., read, write)
54
- * @param roles The roles of the user with IDs
55
- * @returns True if the user has access, false otherwise
56
- */
57
- doesHaveObjectAccess(
58
- dsqId: string,
59
- accessType: AccessType,
60
- roles: [{ ID: string }]
61
- ) {
62
- const appObject = getAppObjectFromDataSourceQueryID(dsqId);
63
-
64
- if (appObject) {
65
- const accessList: any[] = appObject.AccessList.filter((access: any) =>
66
- roles.some(
67
- (role) =>
68
- access.RoleID.toLowerCase() === role.ID.toLowerCase() &&
69
- access.IsEnabled
70
- )
71
- );
72
-
73
- return accessList.some(
74
- (access) => access[accessType] === AccessPermission.All
75
- );
76
- }
77
-
78
- return false;
79
- }
80
- }
@@ -1,75 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
-
3
- import { Injectable } from '@angular/core';
4
- import { APIFilterCriteria, APIValueSets } from '../../models/api-query.class';
5
- import { QueryType } from '../../enums/query.enum';
6
- @Injectable({ providedIn: 'root' })
7
- export class RequestResponseHelper {
8
- /**
9
- * Generates the payload for inserting data into a table
10
- * @param table The table name to insert data into
11
- * @param whereClause The filter criteria for the insert operation
12
- * @param value The value sets to be inserted
13
- * @returns The payload for the insert operation
14
- */
15
- insertPayload(
16
- table: string,
17
- whereClause: APIFilterCriteria,
18
- value: APIValueSets[]
19
- ) {
20
- return this.createPayload(table, whereClause, value, QueryType.Insert);
21
- }
22
-
23
- /**
24
- * Generates the payload for deleting data from a table
25
- * @param tableName The table name to delete data from
26
- * @param whereClause The filter criteria for the delete operation
27
- * @returns The payload for the delete operation
28
- */
29
- deletePayload(tableName: string, whereClause: APIFilterCriteria) {
30
- return {
31
- QueryObjectID: tableName,
32
- QueryType: QueryType.Delete,
33
- Joins: [],
34
- WhereClause: whereClause,
35
- };
36
- }
37
-
38
- /**
39
- * Generates the payload for updating data in a table
40
- * @param tableName The table name to update data in
41
- * @param whereClause The filter criteria for the update operation
42
- * @param value The value sets to be updated
43
- * @returns The payload for the update operation
44
- */
45
- updateRequestPayload(
46
- tableName: string,
47
- whereClause: APIFilterCriteria,
48
- value: APIValueSets[]
49
- ) {
50
- return this.createPayload(tableName, whereClause, value, QueryType.Update);
51
- }
52
-
53
- /**
54
- * Creates a payload object based on the input parameters
55
- * @param table The table name for the payload
56
- * @param whereClause The filter criteria for the payload
57
- * @param value The value sets for the payload
58
- * @param queryType The type of query for the payload
59
- * @returns The payload object with QueryObjectID, QueryType, Joins, WhereClause, and Values
60
- */
61
- createPayload(
62
- table: string,
63
- whereClause: APIFilterCriteria,
64
- value: APIValueSets[],
65
- queryType: QueryType
66
- ) {
67
- return {
68
- QueryObjectID: table,
69
- QueryType: queryType,
70
- Joins: [],
71
- WhereClause: whereClause,
72
- Values: value,
73
- };
74
- }
75
- }