@techextensor/tab-core-utility 2.1.5 → 2.1.7

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/.eslintrc.json +92 -0
  2. package/README.md +7 -0
  3. package/jest.config.ts +22 -0
  4. package/ng-package.json +7 -0
  5. package/package.json +18 -31
  6. package/project.json +42 -0
  7. package/{index.d.ts → src/index.ts} +77 -53
  8. package/src/lib/tab-core-utility/app/constants/api-constants.ts +33 -0
  9. package/src/lib/tab-core-utility/app/constants/common.ts +34 -0
  10. package/src/lib/tab-core-utility/app/constants/error-messages.ts +21 -0
  11. package/src/lib/tab-core-utility/app/constants/storage-constants.ts +17 -0
  12. package/src/lib/tab-core-utility/app/crud/tab-delete.service.ts +144 -0
  13. package/src/lib/tab-core-utility/app/crud/tab-get.service.ts +160 -0
  14. package/src/lib/tab-core-utility/app/crud/tab-insert.service.ts +75 -0
  15. package/src/lib/tab-core-utility/app/crud/tab-update.service.ts +105 -0
  16. package/src/lib/tab-core-utility/app/crud/tab-workflow.service.ts +39 -0
  17. package/src/lib/tab-core-utility/app/enums/controllers.enum.ts +24 -0
  18. package/src/lib/tab-core-utility/app/enums/dsq.enum.ts +46 -0
  19. package/src/lib/tab-core-utility/app/enums/permission.enum.ts +18 -0
  20. package/src/lib/tab-core-utility/app/enums/query.enum.ts +12 -0
  21. package/src/lib/tab-core-utility/app/enums/workflow.enum.ts +35 -0
  22. package/src/lib/tab-core-utility/app/helpers/common/app.helpers.ts +65 -0
  23. package/src/lib/tab-core-utility/app/helpers/common/dsq.helpers.ts +80 -0
  24. package/src/lib/tab-core-utility/app/helpers/common/req-res.helpers.ts +75 -0
  25. package/src/lib/tab-core-utility/app/helpers/common/where-clause.helpers.ts +262 -0
  26. package/src/lib/tab-core-utility/app/helpers/screen/forms.helpers.ts +33 -0
  27. package/src/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.ts +88 -0
  28. package/src/lib/tab-core-utility/app/helpers/screen/grid.helpers.ts +113 -0
  29. package/src/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.ts +74 -0
  30. package/src/lib/tab-core-utility/app/helpers/screen/plugin.helpers.ts +52 -0
  31. package/src/lib/tab-core-utility/app/helpers/screen/screen.helpers.ts +20 -0
  32. package/{lib/tab-core-utility/app/interfaces/auth.interface.d.ts → src/lib/tab-core-utility/app/interfaces/auth.interface.ts} +18 -15
  33. package/src/lib/tab-core-utility/app/interfaces/common-api.interface.ts +27 -0
  34. package/src/lib/tab-core-utility/app/interfaces/grid.interface.ts +118 -0
  35. package/src/lib/tab-core-utility/app/interfaces/orgInfo.interface.ts +34 -0
  36. package/src/lib/tab-core-utility/app/interfaces/schema.interface.ts +11 -0
  37. package/src/lib/tab-core-utility/app/interfaces/user.interface.ts +91 -0
  38. package/src/lib/tab-core-utility/app/models/api-query.class.ts +92 -0
  39. package/src/lib/tab-core-utility/app/models/app-object.class.ts +87 -0
  40. package/src/lib/tab-core-utility/app/models/common.class.ts +30 -0
  41. package/src/lib/tab-core-utility/app/models/data-source-queries.class.ts +114 -0
  42. package/src/lib/tab-core-utility/app/utils/filter.util.ts +78 -0
  43. package/src/lib/tab-core-utility/app/utils/form-builder.util.ts +31 -0
  44. package/src/lib/tab-core-utility/app/utils/json.util.ts +137 -0
  45. package/src/lib/tab-core-utility/app/utils/operators.util.ts +129 -0
  46. package/src/lib/tab-core-utility/app/utils/req-res.util.ts +189 -0
  47. package/src/lib/tab-core-utility/app/utils/tab-app.util.ts +131 -0
  48. package/src/lib/tab-core-utility/auth/auth.service.spec.ts +167 -0
  49. package/src/lib/tab-core-utility/auth/auth.service.ts +91 -0
  50. package/src/lib/tab-core-utility/auth/idb-storage.service.ts +77 -0
  51. package/src/lib/tab-core-utility/auth/local-storage.service.spec.ts +47 -0
  52. package/src/lib/tab-core-utility/auth/local-storage.service.ts +46 -0
  53. package/src/lib/tab-core-utility/auth/session-storage.service.spec.ts +47 -0
  54. package/src/lib/tab-core-utility/auth/session-storage.service.ts +46 -0
  55. package/src/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.ts +32 -0
  56. package/src/lib/tab-core-utility/core/error-handler/error-handler.store.spec.ts +16 -0
  57. package/src/lib/tab-core-utility/core/error-handler/error-handler.store.ts +26 -0
  58. package/src/lib/tab-core-utility/core/error-handler/models/error-handler.state.ts +9 -0
  59. package/src/lib/tab-core-utility/core/http-client/api-url.token.ts +4 -0
  60. package/src/lib/tab-core-utility/core/http-client/api.service.spec.ts +18 -0
  61. package/src/lib/tab-core-utility/core/http-client/api.service.ts +105 -0
  62. package/src/lib/tab-core-utility/core/util/auth.utils.ts +22 -0
  63. package/src/lib/tab-core-utility/store/auth.store.ts +54 -0
  64. package/src/lib/tab-core-utility/store/orginfo.store.ts +57 -0
  65. package/src/lib/tab-core-utility/store/schema.store.ts +85 -0
  66. package/src/test-setup.ts +8 -0
  67. package/tsconfig.json +29 -0
  68. package/tsconfig.lib.json +17 -0
  69. package/tsconfig.lib.prod.json +7 -0
  70. package/tsconfig.spec.json +16 -0
  71. package/esm2022/index.mjs +0 -64
  72. package/esm2022/lib/tab-core-utility/app/constants/api-constants.mjs +0 -33
  73. package/esm2022/lib/tab-core-utility/app/constants/common.mjs +0 -23
  74. package/esm2022/lib/tab-core-utility/app/constants/error-messages.mjs +0 -13
  75. package/esm2022/lib/tab-core-utility/app/constants/storage-constants.mjs +0 -15
  76. package/esm2022/lib/tab-core-utility/app/crud/tab-delete.service.mjs +0 -145
  77. package/esm2022/lib/tab-core-utility/app/crud/tab-get.service.mjs +0 -131
  78. package/esm2022/lib/tab-core-utility/app/crud/tab-insert.service.mjs +0 -77
  79. package/esm2022/lib/tab-core-utility/app/crud/tab-update.service.mjs +0 -105
  80. package/esm2022/lib/tab-core-utility/app/crud/tab-workflow.service.mjs +0 -43
  81. package/esm2022/lib/tab-core-utility/app/enums/controllers.enum.mjs +0 -26
  82. package/esm2022/lib/tab-core-utility/app/enums/dsq.enum.mjs +0 -48
  83. package/esm2022/lib/tab-core-utility/app/enums/permission.enum.mjs +0 -20
  84. package/esm2022/lib/tab-core-utility/app/enums/query.enum.mjs +0 -14
  85. package/esm2022/lib/tab-core-utility/app/enums/workflow.enum.mjs +0 -37
  86. package/esm2022/lib/tab-core-utility/app/helpers/common/app.helpers.mjs +0 -68
  87. package/esm2022/lib/tab-core-utility/app/helpers/common/dsq.helpers.mjs +0 -70
  88. package/esm2022/lib/tab-core-utility/app/helpers/common/req-res.helpers.mjs +0 -64
  89. package/esm2022/lib/tab-core-utility/app/helpers/common/where-clause.helpers.mjs +0 -208
  90. package/esm2022/lib/tab-core-utility/app/helpers/screen/forms.helpers.mjs +0 -38
  91. package/esm2022/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.mjs +0 -78
  92. package/esm2022/lib/tab-core-utility/app/helpers/screen/grid.helpers.mjs +0 -112
  93. package/esm2022/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.mjs +0 -77
  94. package/esm2022/lib/tab-core-utility/app/helpers/screen/plugin.helpers.mjs +0 -55
  95. package/esm2022/lib/tab-core-utility/app/helpers/screen/screen.helpers.mjs +0 -26
  96. package/esm2022/lib/tab-core-utility/app/interfaces/auth.interface.mjs +0 -2
  97. package/esm2022/lib/tab-core-utility/app/interfaces/common-api.interface.mjs +0 -2
  98. package/esm2022/lib/tab-core-utility/app/interfaces/grid.interface.mjs +0 -3
  99. package/esm2022/lib/tab-core-utility/app/interfaces/orgInfo.interface.mjs +0 -2
  100. package/esm2022/lib/tab-core-utility/app/interfaces/schema.interface.mjs +0 -2
  101. package/esm2022/lib/tab-core-utility/app/interfaces/user.interface.mjs +0 -2
  102. package/esm2022/lib/tab-core-utility/app/models/api-query.class.mjs +0 -47
  103. package/esm2022/lib/tab-core-utility/app/models/app-object.class.mjs +0 -30
  104. package/esm2022/lib/tab-core-utility/app/models/common.class.mjs +0 -12
  105. package/esm2022/lib/tab-core-utility/app/models/data-source-queries.class.mjs +0 -31
  106. package/esm2022/lib/tab-core-utility/app/utils/filter.util.mjs +0 -75
  107. package/esm2022/lib/tab-core-utility/app/utils/form-builder.util.mjs +0 -39
  108. package/esm2022/lib/tab-core-utility/app/utils/json.util.mjs +0 -138
  109. package/esm2022/lib/tab-core-utility/app/utils/operators.util.mjs +0 -129
  110. package/esm2022/lib/tab-core-utility/app/utils/req-res.util.mjs +0 -147
  111. package/esm2022/lib/tab-core-utility/app/utils/tab-app.util.mjs +0 -99
  112. package/esm2022/lib/tab-core-utility/auth/auth.service.mjs +0 -74
  113. package/esm2022/lib/tab-core-utility/auth/idb-storage.service.mjs +0 -69
  114. package/esm2022/lib/tab-core-utility/auth/local-storage.service.mjs +0 -52
  115. package/esm2022/lib/tab-core-utility/auth/session-storage.service.mjs +0 -52
  116. package/esm2022/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.mjs +0 -26
  117. package/esm2022/lib/tab-core-utility/core/error-handler/error-handler.store.mjs +0 -21
  118. package/esm2022/lib/tab-core-utility/core/error-handler/models/error-handler.state.mjs +0 -5
  119. package/esm2022/lib/tab-core-utility/core/http-client/api-url.token.mjs +0 -4
  120. package/esm2022/lib/tab-core-utility/core/http-client/api.service.mjs +0 -99
  121. package/esm2022/lib/tab-core-utility/core/util/auth.utils.mjs +0 -21
  122. package/esm2022/lib/tab-core-utility/store/auth.store.mjs +0 -43
  123. package/esm2022/lib/tab-core-utility/store/orginfo.store.mjs +0 -42
  124. package/esm2022/lib/tab-core-utility/store/schema.store.mjs +0 -68
  125. package/esm2022/techextensor-tab-core-utility.mjs +0 -5
  126. package/lib/tab-core-utility/app/constants/api-constants.d.ts +0 -30
  127. package/lib/tab-core-utility/app/constants/common.d.ts +0 -8
  128. package/lib/tab-core-utility/app/constants/error-messages.d.ts +0 -6
  129. package/lib/tab-core-utility/app/constants/storage-constants.d.ts +0 -14
  130. package/lib/tab-core-utility/app/crud/tab-delete.service.d.ts +0 -51
  131. package/lib/tab-core-utility/app/crud/tab-get.service.d.ts +0 -58
  132. package/lib/tab-core-utility/app/crud/tab-insert.service.d.ts +0 -37
  133. package/lib/tab-core-utility/app/crud/tab-update.service.d.ts +0 -14
  134. package/lib/tab-core-utility/app/crud/tab-workflow.service.d.ts +0 -20
  135. package/lib/tab-core-utility/app/enums/controllers.enum.d.ts +0 -24
  136. package/lib/tab-core-utility/app/enums/dsq.enum.d.ts +0 -42
  137. package/lib/tab-core-utility/app/enums/permission.enum.d.ts +0 -16
  138. package/lib/tab-core-utility/app/enums/query.enum.d.ts +0 -11
  139. package/lib/tab-core-utility/app/enums/workflow.enum.d.ts +0 -30
  140. package/lib/tab-core-utility/app/helpers/common/app.helpers.d.ts +0 -31
  141. package/lib/tab-core-utility/app/helpers/common/dsq.helpers.d.ts +0 -32
  142. package/lib/tab-core-utility/app/helpers/common/req-res.helpers.d.ts +0 -62
  143. package/lib/tab-core-utility/app/helpers/common/where-clause.helpers.d.ts +0 -82
  144. package/lib/tab-core-utility/app/helpers/screen/forms.helpers.d.ts +0 -11
  145. package/lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers.d.ts +0 -33
  146. package/lib/tab-core-utility/app/helpers/screen/grid.helpers.d.ts +0 -63
  147. package/lib/tab-core-utility/app/helpers/screen/media-upload.helpers.d.ts +0 -38
  148. package/lib/tab-core-utility/app/helpers/screen/plugin.helpers.d.ts +0 -25
  149. package/lib/tab-core-utility/app/helpers/screen/screen.helpers.d.ts +0 -11
  150. package/lib/tab-core-utility/app/interfaces/common-api.interface.d.ts +0 -24
  151. package/lib/tab-core-utility/app/interfaces/grid.interface.d.ts +0 -110
  152. package/lib/tab-core-utility/app/interfaces/orgInfo.interface.d.ts +0 -31
  153. package/lib/tab-core-utility/app/interfaces/schema.interface.d.ts +0 -11
  154. package/lib/tab-core-utility/app/interfaces/user.interface.d.ts +0 -84
  155. package/lib/tab-core-utility/app/models/api-query.class.d.ts +0 -69
  156. package/lib/tab-core-utility/app/models/app-object.class.d.ts +0 -74
  157. package/lib/tab-core-utility/app/models/common.class.d.ts +0 -24
  158. package/lib/tab-core-utility/app/models/data-source-queries.class.d.ts +0 -95
  159. package/lib/tab-core-utility/app/utils/filter.util.d.ts +0 -30
  160. package/lib/tab-core-utility/app/utils/form-builder.util.d.ts +0 -13
  161. package/lib/tab-core-utility/app/utils/json.util.d.ts +0 -25
  162. package/lib/tab-core-utility/app/utils/operators.util.d.ts +0 -21
  163. package/lib/tab-core-utility/app/utils/req-res.util.d.ts +0 -61
  164. package/lib/tab-core-utility/app/utils/tab-app.util.d.ts +0 -48
  165. package/lib/tab-core-utility/auth/auth.service.d.ts +0 -53
  166. package/lib/tab-core-utility/auth/idb-storage.service.d.ts +0 -14
  167. package/lib/tab-core-utility/auth/local-storage.service.d.ts +0 -22
  168. package/lib/tab-core-utility/auth/session-storage.service.d.ts +0 -22
  169. package/lib/tab-core-utility/core/error-handler/error-handler-interceptor.service.d.ts +0 -3
  170. package/lib/tab-core-utility/core/error-handler/error-handler.store.d.ts +0 -10
  171. package/lib/tab-core-utility/core/error-handler/models/error-handler.state.d.ts +0 -5
  172. package/lib/tab-core-utility/core/http-client/api-url.token.d.ts +0 -3
  173. package/lib/tab-core-utility/core/http-client/api.service.d.ts +0 -65
  174. package/lib/tab-core-utility/core/util/auth.utils.d.ts +0 -9
  175. package/lib/tab-core-utility/store/auth.store.d.ts +0 -19
  176. package/lib/tab-core-utility/store/orginfo.store.d.ts +0 -22
  177. package/lib/tab-core-utility/store/schema.store.d.ts +0 -32
package/.eslintrc.json ADDED
@@ -0,0 +1,92 @@
1
+ {
2
+ "extends": ["../../.eslintrc.json"],
3
+ "ignorePatterns": ["!**/*"],
4
+ "overrides": [
5
+ {
6
+ "files": ["*.ts"],
7
+ "extends": [
8
+ "plugin:@nx/angular",
9
+ "plugin:@angular-eslint/template/process-inline-templates"
10
+ ],
11
+ "rules": {
12
+ "@angular-eslint/directive-selector": [
13
+ "error",
14
+ {
15
+ "type": "attribute",
16
+ "prefix": "ngl",
17
+ "style": "camelCase"
18
+ }
19
+ ],
20
+ "@angular-eslint/component-selector": [
21
+ "error",
22
+ {
23
+ "type": "element",
24
+ "prefix": "ngl",
25
+ "style": "kebab-case"
26
+ }
27
+ ],
28
+ "@nx/enforce-module-boundaries": [
29
+ "error",
30
+ {
31
+ "enforceBuildableLibDependency": true,
32
+ "allow": [],
33
+ "depConstraints": [
34
+ {
35
+ "sourceTag": "type:e2e",
36
+ "onlyDependOnLibsWithTags": ["type:app"]
37
+ },
38
+ {
39
+ "sourceTag": "type:app",
40
+ "onlyDependOnLibsWithTags": ["type:feature", "type:util"]
41
+ },
42
+ {
43
+ "sourceTag": "type:feature",
44
+ "onlyDependOnLibsWithTags": [
45
+ "type:data-access",
46
+ "type:ui",
47
+ "type:util"
48
+ ]
49
+ },
50
+ {
51
+ "sourceTag": "type:ui",
52
+ "onlyDependOnLibsWithTags": ["type:ui", "type:util"]
53
+ },
54
+ {
55
+ "sourceTag": "type:data-access",
56
+ "onlyDependOnLibsWithTags": ["type:api", "type:util"]
57
+ },
58
+ {
59
+ "sourceTag": "scope:shared",
60
+ "onlyDependOnLibsWithTags": ["scope:shared"]
61
+ },
62
+ {
63
+ "sourceTag": "scope:tab-core-utility",
64
+ "onlyDependOnLibsWithTags": [
65
+ "scope:shared",
66
+ "scope:tab-core-utility"
67
+ ]
68
+ }
69
+ ]
70
+ }
71
+ ]
72
+ }
73
+ },
74
+ {
75
+ "files": ["*.html"],
76
+ "extends": ["plugin:@nx/angular-template"],
77
+ "rules": {}
78
+ },
79
+ {
80
+ "files": ["*.json"],
81
+ "parser": "jsonc-eslint-parser",
82
+ "rules": {
83
+ "@nx/dependency-checks": [
84
+ "error",
85
+ {
86
+ "ignoredDependencies": ["tslib"]
87
+ }
88
+ ]
89
+ }
90
+ }
91
+ ]
92
+ }
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # tab-core-utility
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running unit tests
6
+
7
+ Run `nx test tab-core-utility` to execute the unit tests.
package/jest.config.ts ADDED
@@ -0,0 +1,22 @@
1
+ /* eslint-disable */
2
+ export default {
3
+ displayName: 'tab-core-utility',
4
+ preset: '../../jest.preset.js',
5
+ setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6
+ coverageDirectory: '../../coverage/libs/data-access',
7
+ transform: {
8
+ '^.+\\.(ts|mjs|js|html)$': [
9
+ 'jest-preset-angular',
10
+ {
11
+ tsconfig: '<rootDir>/tsconfig.spec.json',
12
+ stringifyContentPathRegex: '\\.(html|svg)$',
13
+ },
14
+ ],
15
+ },
16
+ transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
17
+ snapshotSerializers: [
18
+ 'jest-preset-angular/build/serializers/no-ng-attributes',
19
+ 'jest-preset-angular/build/serializers/ng-snapshot',
20
+ 'jest-preset-angular/build/serializers/html-comment',
21
+ ],
22
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/libs/data-access",
4
+ "lib": {
5
+ "entryFile": "src/index.ts"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,31 +1,18 @@
1
- {
2
- "name": "@techextensor/tab-core-utility",
3
- "version": "2.1.5",
4
- "peerDependencies": {
5
- "@angular/common": "^17.3.0",
6
- "@angular/core": "^17.3.0",
7
- "rxjs": "^7.8.1",
8
- "@ngrx/signals": "^17.1.1",
9
- "@angular/router": "^17.3.0"
10
- },
11
- "dependencies": {
12
- "tslib": "^2.3.0"
13
- },
14
- "sideEffects": false,
15
- "publishConfig": {
16
- "access": "public"
17
- },
18
- "module": "esm2022/techextensor-tab-core-utility.mjs",
19
- "typings": "index.d.ts",
20
- "exports": {
21
- "./package.json": {
22
- "default": "./package.json"
23
- },
24
- ".": {
25
- "types": "./index.d.ts",
26
- "esm2022": "./esm2022/techextensor-tab-core-utility.mjs",
27
- "esm": "./esm2022/techextensor-tab-core-utility.mjs",
28
- "default": "./esm2022/techextensor-tab-core-utility.mjs"
29
- }
30
- }
31
- }
1
+ {
2
+ "name": "@techextensor/tab-core-utility",
3
+ "version": "2.1.7",
4
+ "peerDependencies": {
5
+ "@angular/common": "^17.3.0",
6
+ "@angular/core": "^17.3.0",
7
+ "rxjs": "^7.8.1",
8
+ "@ngrx/signals": "^17.1.1",
9
+ "@angular/router": "^17.3.0"
10
+ },
11
+ "dependencies": {
12
+ "tslib": "^2.3.0"
13
+ },
14
+ "sideEffects": false,
15
+ "publishConfig": {
16
+ "access": "public"
17
+ }
18
+ }
package/project.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "tab-core-utility",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "sourceRoot": "libs/data-access/src",
5
+ "prefix": "ngl",
6
+ "projectType": "library",
7
+ "tags": [],
8
+ "targets": {
9
+ "build": {
10
+ "executor": "@nx/angular:ng-packagr-lite",
11
+ "outputs": ["{workspaceRoot}/dist/{projectRoot}"],
12
+ "options": {
13
+ "project": "libs/data-access/ng-package.json"
14
+ },
15
+ "configurations": {
16
+ "production": {
17
+ "tsConfig": "libs/data-access/tsconfig.lib.prod.json"
18
+ },
19
+ "development": {
20
+ "tsConfig": "libs/data-access/tsconfig.lib.json"
21
+ }
22
+ },
23
+ "defaultConfiguration": "production"
24
+ },
25
+ "test": {
26
+ "executor": "@nx/jest:jest",
27
+ "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
28
+ "options": {
29
+ "jestConfig": "libs/data-access/jest.config.ts"
30
+ }
31
+ },
32
+ "lint": {
33
+ "executor": "@nx/eslint:lint"
34
+ },
35
+ "release": {
36
+ "executor": "nx-release:build-update-publish",
37
+ "options": {
38
+ "libName": "tab-core-utility"
39
+ }
40
+ }
41
+ }
42
+ }
@@ -1,53 +1,77 @@
1
- export * from './lib/tab-core-utility/app/constants/api-constants';
2
- export * from './lib/tab-core-utility/app/constants/common';
3
- export * from './lib/tab-core-utility/app/constants/error-messages';
4
- export * from './lib/tab-core-utility/app/constants/storage-constants';
5
- export * from './lib/tab-core-utility/app/crud/tab-get.service';
6
- export * from './lib/tab-core-utility/app/crud/tab-insert.service';
7
- export * from './lib/tab-core-utility/app/crud/tab-delete.service';
8
- export * from './lib/tab-core-utility/app/crud/tab-update.service';
9
- export * from './lib/tab-core-utility/app/crud/tab-workflow.service';
10
- export * from './lib/tab-core-utility/app/enums/controllers.enum';
11
- export * from './lib/tab-core-utility/app/enums/dsq.enum';
12
- export * from './lib/tab-core-utility/app/enums/permission.enum';
13
- export * from './lib/tab-core-utility/app/enums/query.enum';
14
- export * from './lib/tab-core-utility/app/enums/workflow.enum';
15
- export * from './lib/tab-core-utility/app/helpers/common/app.helpers';
16
- export * from './lib/tab-core-utility/app/helpers/common/dsq.helpers';
17
- export * from './lib/tab-core-utility/app/helpers/common/req-res.helpers';
18
- export * from './lib/tab-core-utility/app/helpers/common/where-clause.helpers';
19
- export * from './lib/tab-core-utility/app/helpers/screen/forms.helpers';
20
- export * from './lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers';
21
- export * from './lib/tab-core-utility/app/helpers/screen/grid.helpers';
22
- export * from './lib/tab-core-utility/app/helpers/screen/media-upload.helpers';
23
- export * from './lib/tab-core-utility/app/helpers/screen/plugin.helpers';
24
- export * from './lib/tab-core-utility/app/helpers/screen/screen.helpers';
25
- export * from './lib/tab-core-utility/app/interfaces/auth.interface';
26
- export * from './lib/tab-core-utility/app/interfaces/common-api.interface';
27
- export * from './lib/tab-core-utility/app/interfaces/user.interface';
28
- export * from './lib/tab-core-utility/app/interfaces/orgInfo.interface';
29
- export * from './lib/tab-core-utility/app/interfaces/schema.interface';
30
- export * from './lib/tab-core-utility/app/interfaces/grid.interface';
31
- export * from './lib/tab-core-utility/app/models/api-query.class';
32
- export * from './lib/tab-core-utility/app/models/app-object.class';
33
- export * from './lib/tab-core-utility/app/models/common.class';
34
- export * from './lib/tab-core-utility/app/models/data-source-queries.class';
35
- export * from './lib/tab-core-utility/app/utils/filter.util';
36
- export * from './lib/tab-core-utility/app/utils/form-builder.util';
37
- export * from './lib/tab-core-utility/app/utils/json.util';
38
- export * from './lib/tab-core-utility/app/utils/operators.util';
39
- export * from './lib/tab-core-utility/app/utils/req-res.util';
40
- export * from './lib/tab-core-utility/app/utils/tab-app.util';
41
- export * from './lib/tab-core-utility/auth/auth.service';
42
- export * from './lib/tab-core-utility/auth/local-storage.service';
43
- export * from './lib/tab-core-utility/auth/session-storage.service';
44
- export * from './lib/tab-core-utility/auth/idb-storage.service';
45
- export * from './lib/tab-core-utility/core/error-handler/error-handler-interceptor.service';
46
- export * from './lib/tab-core-utility/core/error-handler/error-handler.store';
47
- export * from './lib/tab-core-utility/core/error-handler/models/error-handler.state';
48
- export * from './lib/tab-core-utility/core/http-client/api-url.token';
49
- export * from './lib/tab-core-utility/core/http-client/api.service';
50
- export * from './lib/tab-core-utility/core/util/auth.utils';
51
- export * from './lib/tab-core-utility/store/orginfo.store';
52
- export * from './lib/tab-core-utility/store/schema.store';
53
- export * from './lib/tab-core-utility/store/auth.store';
1
+ // App / constants
2
+ export * from './lib/tab-core-utility/app/constants/api-constants';
3
+ export * from './lib/tab-core-utility/app/constants/common';
4
+ export * from './lib/tab-core-utility/app/constants/error-messages';
5
+ export * from './lib/tab-core-utility/app/constants/storage-constants';
6
+
7
+ // App / crud
8
+ export * from './lib/tab-core-utility/app/crud/tab-get.service';
9
+ export * from './lib/tab-core-utility/app/crud/tab-insert.service';
10
+ export * from './lib/tab-core-utility/app/crud/tab-delete.service';
11
+ export * from './lib/tab-core-utility/app/crud/tab-update.service';
12
+ export * from './lib/tab-core-utility/app/crud/tab-workflow.service';
13
+
14
+ // App / enum
15
+ export * from './lib/tab-core-utility/app/enums/controllers.enum';
16
+ export * from './lib/tab-core-utility/app/enums/dsq.enum';
17
+ export * from './lib/tab-core-utility/app/enums/permission.enum';
18
+ export * from './lib/tab-core-utility/app/enums/query.enum';
19
+ export * from './lib/tab-core-utility/app/enums/workflow.enum';
20
+
21
+ // App / helpers
22
+ export * from './lib/tab-core-utility/app/helpers/common/app.helpers';
23
+ export * from './lib/tab-core-utility/app/helpers/common/dsq.helpers';
24
+ export * from './lib/tab-core-utility/app/helpers/common/req-res.helpers';
25
+ export * from './lib/tab-core-utility/app/helpers/common/where-clause.helpers';
26
+
27
+ export * from './lib/tab-core-utility/app/helpers/screen/forms.helpers';
28
+ export * from './lib/tab-core-utility/app/helpers/screen/grid-column-data.helpers';
29
+ export * from './lib/tab-core-utility/app/helpers/screen/grid.helpers';
30
+ export * from './lib/tab-core-utility/app/helpers/screen/media-upload.helpers';
31
+ export * from './lib/tab-core-utility/app/helpers/screen/plugin.helpers';
32
+ export * from './lib/tab-core-utility/app/helpers/screen/screen.helpers';
33
+
34
+ // App / interfaces
35
+ export * from './lib/tab-core-utility/app/interfaces/auth.interface';
36
+ export * from './lib/tab-core-utility/app/interfaces/common-api.interface';
37
+ export * from './lib/tab-core-utility/app/interfaces/user.interface';
38
+ export * from './lib/tab-core-utility/app/interfaces/orgInfo.interface';
39
+ export * from './lib/tab-core-utility/app/interfaces/schema.interface';
40
+ export * from './lib/tab-core-utility/app/interfaces/grid.interface';
41
+
42
+ // App / models
43
+ export * from './lib/tab-core-utility/app/models/api-query.class';
44
+ export * from './lib/tab-core-utility/app/models/app-object.class';
45
+ export * from './lib/tab-core-utility/app/models/common.class';
46
+ export * from './lib/tab-core-utility/app/models/data-source-queries.class';
47
+
48
+ // App / utils
49
+ export * from './lib/tab-core-utility/app/utils/filter.util';
50
+ export * from './lib/tab-core-utility/app/utils/form-builder.util';
51
+ export * from './lib/tab-core-utility/app/utils/json.util';
52
+ export * from './lib/tab-core-utility/app/utils/operators.util';
53
+ export * from './lib/tab-core-utility/app/utils/req-res.util';
54
+ export * from './lib/tab-core-utility/app/utils/tab-app.util';
55
+
56
+ // Auth
57
+ export * from './lib/tab-core-utility/auth/auth.service';
58
+ export * from './lib/tab-core-utility/auth/local-storage.service';
59
+ export * from './lib/tab-core-utility/auth/session-storage.service';
60
+ export * from './lib/tab-core-utility/auth/idb-storage.service';
61
+
62
+ // Core
63
+ export * from './lib/tab-core-utility/core/error-handler/error-handler-interceptor.service';
64
+ export * from './lib/tab-core-utility/core/error-handler/error-handler.store';
65
+ export * from './lib/tab-core-utility/core/error-handler/models/error-handler.state';
66
+
67
+ export * from './lib/tab-core-utility/core/http-client/api-url.token';
68
+ export * from './lib/tab-core-utility/core/http-client/api.service';
69
+
70
+ export * from './lib/tab-core-utility/core/util/auth.utils';
71
+
72
+
73
+ // store
74
+
75
+ export * from './lib/tab-core-utility/store/orginfo.store'
76
+ export * from './lib/tab-core-utility/store/schema.store'
77
+ export * from './lib/tab-core-utility/store/auth.store'
@@ -0,0 +1,33 @@
1
+ export const API = {
2
+ applicationIdentifier: '02dPlGXCKCPy', //phoenix
3
+ applicationIdentifierForPMS: 'qqmXweGB1DbG', // pms
4
+ // endpoint: 'http://192.168.10.181:8441/api/v1/',
5
+ // workflowEndPoint: 'http://192.168.10.181/',
6
+ novuBackendUrl: 'https://novuapi.techextensor.com',
7
+ novuSocketUrl: 'https://novuws.techextensor.com',
8
+
9
+ insert: 'CRUD/Insert',
10
+ update: 'CRUD/Update',
11
+ delete: 'CRUD/Delete',
12
+ select: 'CRUD/Select',
13
+ getDSQ: 'CRUD/DSQ',
14
+ getScreen: 'Layout/GetScreen',
15
+ getListFromDsq: 'List/Get?dataSourceQueryId=',
16
+ buildApp: 'Application/BuildApp',
17
+ getSchema: 'Application/GetSchemaFile',
18
+ login: 'identity/login',
19
+ pluginUpload: 'Plugins/Upload',
20
+ getFile: 'Plugins/GetFileById',
21
+ getAllPluginByType: 'Plugins/GetAll',
22
+ templateParse: 'Template/Parse',
23
+ publishApp: 'Application/PublishApp',
24
+ getrecord: 'GetRecord',
25
+ rawSQL: 'CRUD/RawSQL?query=',
26
+ fileUpload: 'File/Upload',
27
+ getMediaFile: 'File/GetFile',
28
+ getHistory: 'GetHistory',
29
+ changePassword: 'identity/ChangePassword',
30
+ restpassword: 'identity/ResetPassword',
31
+ getImage: 'File/GetImage',
32
+ pmjayImport: 'ImportData',
33
+ };
@@ -0,0 +1,34 @@
1
+ // import { inject } from '@angular/core';
2
+ import { IdbService } from '../../auth/idb-storage.service';
3
+ import { SessionStorageService } from '../../auth/session-storage.service';
4
+ import { Application } from '../models/app-object.class';
5
+ import { StorageConstants } from './storage-constants';
6
+
7
+ // const sessionStorageService = inject(SessionStorageService);
8
+ const sessionStorageService = new SessionStorageService();
9
+ const idbService = new IdbService();
10
+
11
+
12
+ export const Common = {
13
+ applicationCode: sessionStorageService.getSessionStorage(StorageConstants.applicationCode)
14
+ ? String(
15
+ sessionStorageService.getSessionStorage(StorageConstants.applicationCode)
16
+ )
17
+ : StorageConstants.TAB,
18
+ staticApplicationCode:'Tab_Backup',
19
+ tabJson: null,
20
+
21
+ appInfo: null,
22
+ orgId: '1B602229-57F9-4DF8-860C-586A96E5BC68',
23
+ staticToken:
24
+ 'bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJoYXJkaWsudGhha2thckB0ZWNoZXh0ZW5zb3IuY29tIiwianRpIjoiMDBlMzA2ZTctMjE3ZS00MzI2LTg0ZDEtNmZjY2E1NmYwMWY0IiwiZW1haWwiOiJoYXJkaWsudGhha2thckB0ZWNoZXh0ZW5zb3IuY29tIiwiaWQiOiIwYjYwMDY5ZS02ZTM4LTQ0YTUtODMyYS1lMTBmYWQ3MTUyYjYiLCJsb2NhbGVTZXR0aW5nIjoie1wiVGltZVpvbmVJZFwiOlwiSW5kaWEgU3RhbmRhcmQgVGltZVwiLFwiTG9jYWxlXCI6MCxcIkxhbmd1YWdlXCI6MCxcIkRhdGVGb3JtYXRcIjpcImRkLU1NLXl5eXlcIixcIlRpbWVGb3JtYXRcIjpcImhoOm1tOnNzIHR0XCIsXCJOdW1iZXJGb3JtYXRcIjpudWxsLFwiQ3VycmVuY3lcIjpudWxsfSIsInJvbGUiOiJBZG1pbmlzdHJhdG9yIiwiUm9sZUlkcyI6IjJjYjQzMWE2LTUxZWUtNDYzZS04NDBjLTNhMThjNWZlOTE1MCIsIm5iZiI6MTcxNDAyNTkwNSwiZXhwIjoxNzQ1NTYxOTA1LCJpYXQiOjE3MTQwMjU5MDV9.FrguHY0px3wnitfgsodTJpexFr5Fzvbx5USDBF66mQA',
25
+ };
26
+
27
+
28
+ async function getLocalStorageTabData() {
29
+ let data:any = await idbService.getItem(StorageConstants.tabData)
30
+ if(data){
31
+ Common.tabJson= JSON.parse(data);
32
+ }
33
+ }
34
+ getLocalStorageTabData();
@@ -0,0 +1,21 @@
1
+ export const ServerErrorMessages: {
2
+ [key: string]: string;
3
+ } = {
4
+ DELETE_CONFLICT:
5
+ 'The DELETE statement conflicted with the REFERENCE constraint',
6
+ UNIQUE_KEY_CONSTRAINT_USER: "Violation of UNIQUE KEY constraint 'U_Name'.",
7
+ INSUFFICIENT_ACCESS: 'Insufficient Acces',
8
+ CONVERSATION_FAILED_STRING_TO_UNIQUEIDENTIFIER:
9
+ 'Conversation failed when converting from a character string to uniqueidentifier',
10
+ };
11
+
12
+ export const UserFriendlyMessages = {
13
+ [ServerErrorMessages['DELETE_CONFLICT']]:
14
+ 'Unable to Delete Record. Please check associated records and try again.',
15
+ [ServerErrorMessages['UNIQUE_KEY_CONSTRAINT_USER']]:
16
+ 'Username already exist.',
17
+ [ServerErrorMessages['INSUFFICIENT_ACCESS']]:
18
+ "You don't have enough permission to perform this action.",
19
+ [ServerErrorMessages['CONVERSATION_FAILED_STRING_TO_UNIQUEIDENTIFIER']]:
20
+ 'Something went wrong!',
21
+ };
@@ -0,0 +1,17 @@
1
+ export const StorageConstants = {
2
+ tabData: 'tabData',
3
+ formJson: 'FormJson',
4
+ schemaJSON: 'schemaJSON',
5
+ orgInfo: 'orgInfo',
6
+ applicationCode: 'applicationCode',
7
+ TAB: 'TAB',
8
+ userInfo: 'userInfo',
9
+ token: 'token',
10
+ staticToken: 'staticToken',
11
+ screenId: 'screenId',
12
+ editScreenQueryParam: 'editScreenQueryParam',
13
+ layoutScreenId: 'layoutScreenId',
14
+ tabScreen: 'tabScreen',
15
+
16
+
17
+ };
@@ -0,0 +1,144 @@
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 { AppObject, AppScreen } from "../models/app-object.class";
9
+ import { getAppObject, getAppObjectFromSystemDBTableName, getDataFromDataSourceQueryID } from "../utils/tab-app.util";
10
+ import { getEditRecordId, getPrimaryKeyFields } from "../utils/req-res.util";
11
+ import { APIDeleteQuery, APIFilterCriteria } from "../models/api-query.class";
12
+ import { QueryType } from "../enums/query.enum";
13
+
14
+
15
+
16
+
17
+ @Injectable({ providedIn: 'root' })
18
+ export class TabDeleteService {
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
+ /**
25
+ * Deletes a record based on the given screen ID, data, and object ID.
26
+ * @param screenId The ID of the screen.
27
+ * @param data The data of the record to delete.
28
+ * @param objectIDToSave The object ID of the record to save.
29
+ * @returns An Observable emitting the response of the delete operation.
30
+ */
31
+ deleteRecord(screenId: string, data: any, objectIDToSave: any) {
32
+ let fields;
33
+ let appObject: AppObject = new AppObject();
34
+ let crudTableName;
35
+ if (screenId) {
36
+ // Retrieve screen information and fields
37
+ const screen: AppScreen = this.screenHelper.getScreen(screenId);
38
+ const screenDataSource = getDataFromDataSourceQueryID(screen.DataSourceQuery);
39
+ fields = screenDataSource.Fields;
40
+ appObject = getAppObject(screenDataSource.ObjectID_Tosave);
41
+ crudTableName = appObject.SystemDBTableName;
42
+ }
43
+ if (objectIDToSave) {
44
+ // Retrieve fields based on object ID
45
+ fields = [];
46
+ appObject = getAppObject(objectIDToSave);
47
+ appObject.Fields.forEach(element => {
48
+ fields.push({ Field: element })
49
+ });
50
+ crudTableName = appObject.SystemDBTableName;
51
+ }
52
+ const primaryKeyFields: any = getPrimaryKeyFields(appObject);
53
+ if (appObject) {
54
+ let whereClause: any = APIFilterCriteria;
55
+ if (primaryKeyFields && primaryKeyFields.length > 1) {
56
+ // Bind where clause for delete operation with multiple primary keys
57
+ whereClause = this.whereClauseHelper.bindWhereClauseForDeleteWithMultiplePrimaryKeys(data.data, primaryKeyFields, crudTableName);
58
+ } else if (primaryKeyFields && primaryKeyFields.length === 1) {
59
+ // Bind where clause for delete operation with single primary key
60
+ const recordId = getEditRecordId(data.data, primaryKeyFields[0]?.FieldName);
61
+ whereClause = this.whereClauseHelper.bindWhereClauseForDelete(fields, recordId, primaryKeyFields[0]?.FieldName, crudTableName);
62
+ }
63
+ const dataObj = this.requestResponseHelper.deletePayload(crudTableName, whereClause);
64
+ return this.delete(dataObj);
65
+ }
66
+ return null;
67
+ }
68
+
69
+ /**
70
+ * Deletes a record by the specified table name and primary key value.
71
+ * @param tableName The name of the table.
72
+ * @param primaryKey The primary key field.
73
+ * @param primaryKeyValue The value of the primary key.
74
+ * @returns An Observable emitting the response of the delete operation.
75
+ */
76
+ deleteRecordByTable(tableName: string, primaryKey: string, primaryKeyValue: string) {
77
+ // Bind where clause for delete operation by table
78
+ const whereClause: APIFilterCriteria = this.whereClauseHelper.bindWhereClauseForDeleteByTable(tableName, primaryKey, primaryKeyValue);
79
+ const dataObj = this.requestResponseHelper.deletePayload(tableName, whereClause);
80
+ return this.delete(dataObj);
81
+ }
82
+
83
+ /**
84
+ * Executes the delete operation.
85
+ * @param data The delete query payload.
86
+ * @returns An Observable emitting the response of the delete operation.
87
+ */
88
+ delete(data: APIDeleteQuery) {
89
+ // Display delete confirmation popup
90
+ const deleteConfirmation = this.deleteRecordPopup();
91
+ if (deleteConfirmation) {
92
+ return this.dsqHelper.executeQuery(data, QueryType.Delete);
93
+ } else {
94
+ return null;
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Displays a delete confirmation popup.
100
+ * @returns True if the user confirms the delete operation, otherwise false.
101
+ */
102
+ deleteRecordPopup() {
103
+ const text = "You are going to delete selected record. Are you sure want to delete the same?";
104
+ if (confirm(text) == true) {
105
+ return true;
106
+ } else {
107
+ return false;
108
+ }
109
+ }
110
+
111
+ /**
112
+ * Deletes multiple records by table name and values.
113
+ * @param tableName The name of the table.
114
+ * @param values The values of the records to delete.
115
+ * @returns An Observable emitting the response of the delete operation.
116
+ */
117
+ deleteMultipleRecordByTable(tableName: string, values: any) {
118
+ // Retrieve app object and primary key fields
119
+ const appObject = getAppObjectFromSystemDBTableName(tableName);
120
+ const primaryKeyFields: any = getPrimaryKeyFields(appObject);
121
+ // Generate values array from data
122
+ const valueArray = this.generateValuesArrayFromData(values, primaryKeyFields[0]?.FieldName)
123
+ // Bind where clause for delete operation using IN operator by table
124
+ const whereClause: APIFilterCriteria = this.whereClauseHelper.bindWhereClauseForDeleteUsingInOperatorByTable(tableName, primaryKeyFields[0]?.FieldName, valueArray);
125
+ const dataObj = this.requestResponseHelper.deletePayload(tableName, whereClause);
126
+ return this.delete(dataObj);
127
+ }
128
+
129
+ /**
130
+ * Generates a values array from the data.
131
+ * @param dataArray The array of data.
132
+ * @param key The key to extract from each element.
133
+ * @returns The array of values.
134
+ */
135
+ generateValuesArrayFromData(dataArray: any, key: any) {
136
+ const valueArray: any = []
137
+ if (dataArray && dataArray.length) {
138
+ dataArray.forEach((element: any) => {
139
+ valueArray.push(element[key])
140
+ });
141
+ }
142
+ return valueArray
143
+ }
144
+ }