@axelor/aos-mobile-core 6.4.1 → 6.5.0

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 (234) hide show
  1. package/README.md +89 -28
  2. package/lib/api/attached-files-api.js +1 -1
  3. package/lib/api/attached-files-api.js.map +1 -1
  4. package/lib/api/login-api.js +2 -0
  5. package/lib/api/login-api.js.map +1 -1
  6. package/lib/api/mail-message-api.js +1 -1
  7. package/lib/api/mail-message-api.js.map +1 -1
  8. package/lib/api/menu-config-api.js +24 -29
  9. package/lib/api/menu-config-api.js.map +1 -1
  10. package/lib/api/metafile-api.d.ts +4 -6
  11. package/lib/api/metafile-api.js +24 -25
  12. package/lib/api/metafile-api.js.map +1 -1
  13. package/lib/api/mobile-config-api.js +1 -1
  14. package/lib/api/mobile-config-api.js.map +1 -1
  15. package/lib/api/net-info-utils.js +1 -1
  16. package/lib/api/net-info-utils.js.map +1 -1
  17. package/lib/apiProviders/Action/ActionApiProvider.d.ts +5 -0
  18. package/lib/apiProviders/Action/ActionApiProvider.js +19 -0
  19. package/lib/apiProviders/Action/ActionApiProvider.js.map +1 -0
  20. package/lib/apiProviders/Action/ActionProvider.d.ts +12 -0
  21. package/lib/apiProviders/Action/ActionProvider.js +43 -0
  22. package/lib/apiProviders/Action/ActionProvider.js.map +1 -0
  23. package/lib/apiProviders/Action/AosActionApi.d.ts +8 -0
  24. package/lib/apiProviders/Action/AosActionApi.js +34 -0
  25. package/lib/apiProviders/Action/AosActionApi.js.map +1 -0
  26. package/lib/apiProviders/Action/GatewayActionApi.d.ts +8 -0
  27. package/lib/apiProviders/Action/GatewayActionApi.js +43 -0
  28. package/lib/apiProviders/Action/GatewayActionApi.js.map +1 -0
  29. package/lib/apiProviders/Action/index.d.ts +5 -0
  30. package/lib/apiProviders/Action/index.js +21 -0
  31. package/lib/apiProviders/Action/index.js.map +1 -0
  32. package/lib/apiProviders/Action/utils.d.ts +8 -0
  33. package/lib/apiProviders/Action/utils.js +19 -0
  34. package/lib/apiProviders/Action/utils.js.map +1 -0
  35. package/lib/apiProviders/Model/AopModelApi.d.ts +20 -0
  36. package/lib/apiProviders/Model/AopModelApi.js +42 -0
  37. package/lib/apiProviders/Model/AopModelApi.js.map +1 -0
  38. package/lib/apiProviders/Model/GatewayModelApi.d.ts +20 -0
  39. package/lib/apiProviders/Model/GatewayModelApi.js +52 -0
  40. package/lib/apiProviders/Model/GatewayModelApi.js.map +1 -0
  41. package/lib/apiProviders/Model/ModelApiProvider.d.ts +22 -0
  42. package/lib/apiProviders/Model/ModelApiProvider.js +19 -0
  43. package/lib/apiProviders/Model/ModelApiProvider.js.map +1 -0
  44. package/lib/apiProviders/Model/Provider.d.ts +12 -0
  45. package/lib/apiProviders/Model/Provider.js +43 -0
  46. package/lib/apiProviders/Model/Provider.js.map +1 -0
  47. package/lib/apiProviders/Model/index.d.ts +5 -0
  48. package/lib/apiProviders/Model/index.js +22 -0
  49. package/lib/apiProviders/Model/index.js.map +1 -0
  50. package/lib/apiProviders/Model/utils.d.ts +28 -0
  51. package/lib/apiProviders/Model/utils.js +19 -0
  52. package/lib/apiProviders/Model/utils.js.map +1 -0
  53. package/lib/apiProviders/Standard/AxiosProvider.d.ts +29 -0
  54. package/lib/{axios/AxiosApi.js → apiProviders/Standard/AxiosProvider.js} +4 -1
  55. package/lib/apiProviders/Standard/AxiosProvider.js.map +1 -0
  56. package/lib/apiProviders/Standard/ObjectFieldsProvider.d.ts +20 -0
  57. package/lib/apiProviders/Standard/ObjectFieldsProvider.js +84 -0
  58. package/lib/apiProviders/Standard/ObjectFieldsProvider.js.map +1 -0
  59. package/lib/apiProviders/Standard/index.d.ts +3 -0
  60. package/lib/apiProviders/Standard/index.js +21 -0
  61. package/lib/apiProviders/Standard/index.js.map +1 -0
  62. package/lib/apiProviders/Standard/requests.helper.d.ts +28 -0
  63. package/lib/apiProviders/Standard/requests.helper.js +80 -0
  64. package/lib/apiProviders/Standard/requests.helper.js.map +1 -0
  65. package/lib/apiProviders/index.d.ts +4 -0
  66. package/lib/apiProviders/index.js +22 -0
  67. package/lib/apiProviders/index.js.map +1 -0
  68. package/lib/{api → apiProviders}/utils.js +1 -1
  69. package/lib/apiProviders/utils.js.map +1 -0
  70. package/lib/app/Application.d.ts +18 -2
  71. package/lib/app/Application.js +6 -3
  72. package/lib/app/Application.js.map +1 -1
  73. package/lib/app/ContextedApplication.d.ts +15 -1
  74. package/lib/app/ContextedApplication.js +4 -4
  75. package/lib/app/ContextedApplication.js.map +1 -1
  76. package/lib/app/ContextsProvider.d.ts +3 -1
  77. package/lib/app/ContextsProvider.js +31 -4
  78. package/lib/app/ContextsProvider.js.map +1 -1
  79. package/lib/app/Module.d.ts +44 -16
  80. package/lib/app/RootNavigator.d.ts +2 -1
  81. package/lib/app/RootNavigator.js +6 -2
  82. package/lib/app/RootNavigator.js.map +1 -1
  83. package/lib/app/context.helper.d.ts +5 -0
  84. package/lib/app/context.helper.js +69 -0
  85. package/lib/app/context.helper.js.map +1 -0
  86. package/lib/app/index.d.ts +2 -1
  87. package/lib/app/index.js +1 -0
  88. package/lib/app/index.js.map +1 -1
  89. package/lib/app/module-generation.helper.d.ts +14 -0
  90. package/lib/app/module-generation.helper.js +56 -0
  91. package/lib/app/module-generation.helper.js.map +1 -0
  92. package/lib/auth/api/company-api.js +7 -10
  93. package/lib/auth/api/company-api.js.map +1 -1
  94. package/lib/auth/api/config-api.d.ts +5 -1
  95. package/lib/auth/api/config-api.js +12 -2
  96. package/lib/auth/api/config-api.js.map +1 -1
  97. package/lib/auth/api/language-api.js +1 -1
  98. package/lib/auth/api/language-api.js.map +1 -1
  99. package/lib/auth/api/user-api.js +1 -1
  100. package/lib/auth/api/user-api.js.map +1 -1
  101. package/lib/auth/features/companySlice.js +1 -1
  102. package/lib/auth/features/companySlice.js.map +1 -1
  103. package/lib/auth/features/configSlice.js +2 -1
  104. package/lib/auth/features/configSlice.js.map +1 -1
  105. package/lib/auth/features/languageSlice.js +1 -1
  106. package/lib/auth/features/languageSlice.js.map +1 -1
  107. package/lib/auth/features/userSlice.js +1 -1
  108. package/lib/auth/features/userSlice.js.map +1 -1
  109. package/lib/auth/index.js +4 -0
  110. package/lib/auth/index.js.map +1 -1
  111. package/lib/auth/models/index.d.ts +1 -0
  112. package/lib/auth/models/index.js +19 -0
  113. package/lib/auth/models/index.js.map +1 -0
  114. package/lib/auth/models/objectFields.d.ts +2 -0
  115. package/lib/auth/models/objectFields.js +25 -0
  116. package/lib/auth/models/objectFields.js.map +1 -0
  117. package/lib/auth/screens/SettingsScreen.d.ts +2 -1
  118. package/lib/auth/screens/SettingsScreen.js +18 -3
  119. package/lib/auth/screens/SettingsScreen.js.map +1 -1
  120. package/lib/components/external/CodeHighlighter/CodeHighlighter.d.ts +9 -0
  121. package/lib/components/external/CodeHighlighter/CodeHighlighter.js +30 -0
  122. package/lib/components/external/CodeHighlighter/CodeHighlighter.js.map +1 -0
  123. package/lib/components/external/CodeHighlighter/code-highlighter.helper.d.ts +39 -0
  124. package/lib/components/external/CodeHighlighter/code-highlighter.helper.js +60 -0
  125. package/lib/components/external/CodeHighlighter/code-highlighter.helper.js.map +1 -0
  126. package/lib/components/external/PlanningView/PlanningView.d.ts +5 -4
  127. package/lib/components/external/PlanningView/PlanningView.js +58 -12
  128. package/lib/components/external/PlanningView/PlanningView.js.map +1 -1
  129. package/lib/components/external/PlanningView/agenda.helpers.d.ts +15 -2
  130. package/lib/components/external/PlanningView/agenda.helpers.js +69 -9
  131. package/lib/components/external/PlanningView/agenda.helpers.js.map +1 -1
  132. package/lib/components/external/index.d.ts +2 -0
  133. package/lib/components/external/index.js +2 -0
  134. package/lib/components/external/index.js.map +1 -1
  135. package/lib/components/molecules/DatePicker/DatePicker.d.ts +8 -0
  136. package/lib/components/molecules/DatePicker/DatePicker.js +33 -0
  137. package/lib/components/molecules/DatePicker/DatePicker.js.map +1 -0
  138. package/lib/components/molecules/index.d.ts +1 -0
  139. package/lib/components/molecules/index.js +1 -0
  140. package/lib/components/molecules/index.js.map +1 -1
  141. package/lib/components/organisms/AutoCompleteSearchInput/AutoCompleteSearchInput.d.ts +19 -0
  142. package/lib/components/organisms/AutoCompleteSearchInput/AutoCompleteSearchInput.js +58 -0
  143. package/lib/components/organisms/AutoCompleteSearchInput/AutoCompleteSearchInput.js.map +1 -0
  144. package/lib/components/organisms/DateInput/DateInput.d.ts +11 -0
  145. package/lib/components/organisms/DateInput/DateInput.js +133 -0
  146. package/lib/components/organisms/DateInput/DateInput.js.map +1 -0
  147. package/lib/components/organisms/DateInput/date-input.helper.d.ts +17 -0
  148. package/lib/components/organisms/DateInput/date-input.helper.js +63 -0
  149. package/lib/components/organisms/DateInput/date-input.helper.js.map +1 -0
  150. package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js +6 -9
  151. package/lib/components/organisms/MailMessageCommentCard/MailMessageCommentCard.js.map +1 -1
  152. package/lib/components/organisms/UsernameInput/UsernameInput.d.ts +5 -1
  153. package/lib/components/organisms/UsernameInput/UsernameInput.js +10 -3
  154. package/lib/components/organisms/UsernameInput/UsernameInput.js.map +1 -1
  155. package/lib/components/organisms/index.d.ts +2 -0
  156. package/lib/components/organisms/index.js +2 -0
  157. package/lib/components/organisms/index.js.map +1 -1
  158. package/lib/components/templates/AttachedFilesView/AttachedFilesView.js +14 -20
  159. package/lib/components/templates/AttachedFilesView/AttachedFilesView.js.map +1 -1
  160. package/lib/components/templates/MailMessageView/MailMessageView.js +2 -2
  161. package/lib/components/templates/MailMessageView/MailMessageView.js.map +1 -1
  162. package/lib/features/attachedFilesSlice.js +1 -1
  163. package/lib/features/attachedFilesSlice.js.map +1 -1
  164. package/lib/features/authSlice.d.ts +13 -5
  165. package/lib/features/authSlice.js +1 -1
  166. package/lib/features/authSlice.js.map +1 -1
  167. package/lib/features/index.d.ts +1 -0
  168. package/lib/features/index.js +1 -0
  169. package/lib/features/index.js.map +1 -1
  170. package/lib/features/mailMessageSlice.js +1 -1
  171. package/lib/features/mailMessageSlice.js.map +1 -1
  172. package/lib/features/menuConfigSlice.js +1 -1
  173. package/lib/features/menuConfigSlice.js.map +1 -1
  174. package/lib/features/metafileSlice.js +1 -1
  175. package/lib/features/metafileSlice.js.map +1 -1
  176. package/lib/features/mobileConfigSlice.js +1 -1
  177. package/lib/features/mobileConfigSlice.js.map +1 -1
  178. package/lib/features/onlineSlice.d.ts +11 -0
  179. package/lib/features/onlineSlice.js +49 -0
  180. package/lib/features/onlineSlice.js.map +1 -0
  181. package/lib/hooks/use-background-function.d.ts +1 -0
  182. package/lib/hooks/use-background-function.js +35 -0
  183. package/lib/hooks/use-background-function.js.map +1 -0
  184. package/lib/i18n/helpers/langages.d.ts +7 -3
  185. package/lib/i18n/helpers/langages.js.map +1 -1
  186. package/lib/i18n/i18n.d.ts +4 -3
  187. package/lib/i18n/i18n.js +5 -5
  188. package/lib/i18n/i18n.js.map +1 -1
  189. package/lib/i18n/translations/en.json +7 -1
  190. package/lib/i18n/translations/fr.json +7 -1
  191. package/lib/index.d.ts +3 -4
  192. package/lib/index.js +3 -4
  193. package/lib/index.js.map +1 -1
  194. package/lib/models/index.d.ts +1 -0
  195. package/lib/models/index.js +19 -0
  196. package/lib/models/index.js.map +1 -0
  197. package/lib/models/objectFields.d.ts +2 -0
  198. package/lib/models/objectFields.js +30 -0
  199. package/lib/models/objectFields.js.map +1 -0
  200. package/lib/navigator/Navigator.js +5 -5
  201. package/lib/navigator/Navigator.js.map +1 -1
  202. package/lib/navigator/drawer/DrawerContent.js +24 -4
  203. package/lib/navigator/drawer/DrawerContent.js.map +1 -1
  204. package/lib/navigator/module.helper.d.ts +14 -8
  205. package/lib/navigator/module.helper.js +47 -3
  206. package/lib/navigator/module.helper.js.map +1 -1
  207. package/lib/screens/LoginScreen.js +36 -7
  208. package/lib/screens/LoginScreen.js.map +1 -1
  209. package/lib/storage/Storage.d.ts +5 -1
  210. package/lib/storage/Storage.js +7 -1
  211. package/lib/storage/Storage.js.map +1 -1
  212. package/lib/tools/FilePicker.d.ts +1 -0
  213. package/lib/tools/FilePicker.js +42 -0
  214. package/lib/tools/FilePicker.js.map +1 -0
  215. package/lib/utils/date.d.ts +3 -0
  216. package/lib/utils/date.js +16 -0
  217. package/lib/utils/date.js.map +1 -1
  218. package/lib/utils/filter.d.ts +9 -0
  219. package/lib/utils/filter.js +31 -0
  220. package/lib/utils/filter.js.map +1 -0
  221. package/lib/utils/formatters.d.ts +1 -0
  222. package/lib/utils/formatters.js +8 -0
  223. package/lib/utils/formatters.js.map +1 -1
  224. package/lib/utils/index.d.ts +6 -5
  225. package/lib/utils/index.js +6 -5
  226. package/lib/utils/index.js.map +1 -1
  227. package/lib/utils/object.d.ts +3 -0
  228. package/lib/utils/object.js +22 -0
  229. package/lib/utils/object.js.map +1 -1
  230. package/package.json +12 -6
  231. package/lib/api/utils.js.map +0 -1
  232. package/lib/axios/AxiosApi.d.ts +0 -12
  233. package/lib/axios/AxiosApi.js.map +0 -1
  234. /package/lib/{api → apiProviders}/utils.d.ts +0 -0
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import axios from 'axios';
19
+ import { getNetInfo } from '../../api/net-info-utils';
20
+ export class AosActionApi {
21
+ constructor() { }
22
+ static isOnlineAvailable = true;
23
+ async isAvailable() {
24
+ if (AosActionApi.isOnlineAvailable) {
25
+ const { isConnected } = await getNetInfo();
26
+ return isConnected;
27
+ }
28
+ return AosActionApi.isOnlineAvailable;
29
+ }
30
+ send(request) {
31
+ return axios[request.method](request.url, request.body);
32
+ }
33
+ }
34
+ //# sourceMappingURL=AosActionApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AosActionApi.js","sourceRoot":"","sources":["../../../src/apiProviders/Action/AosActionApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAIpD,MAAM,OAAO,YAAY;IACvB,gBAAe,CAAC;IAEhB,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAEhC,KAAK,CAAC,WAAW;QACf,IAAI,YAAY,CAAC,iBAAiB,EAAE;YAClC,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,UAAU,EAAE,CAAC;YACzC,OAAO,WAAW,CAAC;SACpB;QACD,OAAO,YAAY,CAAC,iBAAiB,CAAC;IACxC,CAAC;IAED,IAAI,CAAC,OAAsB;QACzB,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { ActionApi } from './ActionApiProvider';
2
+ import { ActionRequest } from './utils';
3
+ export declare class GatewayActionApi implements ActionApi {
4
+ private actionsApi;
5
+ constructor(...actionsApi: ActionApi[]);
6
+ isAvailable(): Promise<boolean>;
7
+ send(request: ActionRequest): Promise<void>;
8
+ }
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ function getAvailableActionApi(actionsApi) {
19
+ const actionApi = actionsApi.find(item => {
20
+ return item.isAvailable();
21
+ });
22
+ if (actionApi == null) {
23
+ throw new Error('No provider available, please check your configuration.');
24
+ }
25
+ return actionApi;
26
+ }
27
+ export class GatewayActionApi {
28
+ actionsApi;
29
+ constructor(...actionsApi) {
30
+ this.actionsApi = actionsApi;
31
+ }
32
+ isAvailable() {
33
+ const actionApi = getAvailableActionApi(this.actionsApi);
34
+ if (actionApi == null) {
35
+ throw new Error('No provider available, please check your configuration.');
36
+ }
37
+ return actionApi.isAvailable();
38
+ }
39
+ send(request) {
40
+ return getAvailableActionApi(this.actionsApi).send(request);
41
+ }
42
+ }
43
+ //# sourceMappingURL=GatewayActionApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GatewayActionApi.js","sourceRoot":"","sources":["../../../src/apiProviders/Action/GatewayActionApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,SAAS,qBAAqB,CAAC,UAAuB;IACpD,MAAM,SAAS,GAAc,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAClD,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;IACH,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;KAC5E;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,OAAO,gBAAgB;IACnB,UAAU,CAAc;IAEhC,YAAY,GAAG,UAAuB;QACpC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,WAAW;QACT,MAAM,SAAS,GAAc,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACpE,IAAI,SAAS,IAAI,IAAI,EAAE;YACrB,MAAM,IAAI,KAAK,CACb,yDAAyD,CAC1D,CAAC;SACH;QACD,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;IAED,IAAI,CAAC,OAAsB;QACzB,OAAO,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ export { AosActionApi } from './AosActionApi';
2
+ export { GatewayActionApi } from './GatewayActionApi';
3
+ export { ActionApi } from './ActionApiProvider';
4
+ export { getActionApi, actionProvider, registerActionApi, useActionApi, } from './ActionProvider';
5
+ export { ActionRequest } from './utils';
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export { AosActionApi } from './AosActionApi';
19
+ export { GatewayActionApi } from './GatewayActionApi';
20
+ export { getActionApi, actionProvider, registerActionApi, useActionApi, } from './ActionProvider';
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/apiProviders/Action/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,GACb,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,8 @@
1
+ type Method = 'put' | 'post';
2
+ export type ActionRequest = {
3
+ url: string;
4
+ method: Method;
5
+ body: any;
6
+ description: string;
7
+ };
8
+ export {};
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export {};
19
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/apiProviders/Action/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
@@ -0,0 +1,20 @@
1
+ import { ModelApi } from './ModelApiProvider';
2
+ import { Query } from './utils';
3
+ export declare class AopModelApi implements ModelApi {
4
+ constructor();
5
+ static isOnlineAvailable: boolean;
6
+ init(): void;
7
+ isAvailable(): Promise<boolean>;
8
+ getAll({ modelName, page }: {
9
+ modelName: string;
10
+ page: number;
11
+ }): Promise<any>;
12
+ get({ modelName, id }: {
13
+ modelName: string;
14
+ id: number;
15
+ }): Promise<any>;
16
+ search({ modelName, query }: {
17
+ modelName: string;
18
+ query: Query;
19
+ }): Promise<any>;
20
+ }
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import axios from 'axios';
19
+ import { getNetInfo } from '../../api/net-info-utils';
20
+ import { REQUEST_LIMIT } from './utils';
21
+ export class AopModelApi {
22
+ constructor() { }
23
+ static isOnlineAvailable = true;
24
+ init() { }
25
+ async isAvailable() {
26
+ if (AopModelApi.isOnlineAvailable) {
27
+ const { isConnected } = await getNetInfo();
28
+ return isConnected;
29
+ }
30
+ return AopModelApi.isOnlineAvailable;
31
+ }
32
+ getAll({ modelName, page }) {
33
+ return axios.get(`ws/rest/${modelName}?offset=${page * REQUEST_LIMIT}&limit=${REQUEST_LIMIT}`);
34
+ }
35
+ get({ modelName, id }) {
36
+ return axios.get(`ws/rest/${modelName}/${id}`);
37
+ }
38
+ search({ modelName, query }) {
39
+ return axios.post(`ws/rest/${modelName}/search`, query);
40
+ }
41
+ }
42
+ //# sourceMappingURL=AopModelApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AopModelApi.js","sourceRoot":"","sources":["../../../src/apiProviders/Model/AopModelApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAQ,aAAa,EAAC,MAAM,SAAS,CAAC;AAE7C,MAAM,OAAO,WAAW;IACtB,gBAAe,CAAC;IAEhB,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAEhC,IAAI,KAAU,CAAC;IAEf,KAAK,CAAC,WAAW;QACf,IAAI,WAAW,CAAC,iBAAiB,EAAE;YACjC,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,UAAU,EAAE,CAAC;YACzC,OAAO,WAAW,CAAC;SACpB;QACD,OAAO,WAAW,CAAC,iBAAiB,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,EAAC,SAAS,EAAE,IAAI,EAAoC;QACzD,OAAO,KAAK,CAAC,GAAG,CACd,WAAW,SAAS,WAClB,IAAI,GAAG,aACT,UAAU,aAAa,EAAE,CAC1B,CAAC;IACJ,CAAC;IAED,GAAG,CAAC,EAAC,SAAS,EAAE,EAAE,EAAkC;QAClD,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,SAAS,IAAI,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,EAAC,SAAS,EAAE,KAAK,EAAoC;QAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,SAAS,SAAS,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { ModelApi } from './ModelApiProvider';
2
+ import { Query } from './utils';
3
+ export declare class GatewayModelApi implements ModelApi {
4
+ private modelsApi;
5
+ constructor(...modelsApi: ModelApi[]);
6
+ init(): void;
7
+ isAvailable(): Promise<boolean>;
8
+ get({ modelName, id }: {
9
+ modelName: string;
10
+ id: number;
11
+ }): Promise<any[]>;
12
+ getAll({ modelName, page }: {
13
+ modelName: string;
14
+ page: number;
15
+ }): Promise<any[]>;
16
+ search({ modelName, query, }: {
17
+ modelName: string;
18
+ query: Query;
19
+ }): Promise<any[]>;
20
+ }
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ function getAvailableModelApi(modelsApi) {
19
+ const modelApi = modelsApi.find(item => {
20
+ return item.isAvailable();
21
+ });
22
+ if (modelApi == null) {
23
+ throw new Error('No provider available, please check your configuration.');
24
+ }
25
+ return modelApi;
26
+ }
27
+ export class GatewayModelApi {
28
+ modelsApi;
29
+ constructor(...modelsApi) {
30
+ this.modelsApi = modelsApi;
31
+ }
32
+ init() {
33
+ getAvailableModelApi(this.modelsApi)?.init();
34
+ }
35
+ isAvailable() {
36
+ const modelApi = getAvailableModelApi(this.modelsApi);
37
+ if (modelApi == null) {
38
+ throw new Error('No provider available, please check your configuration.');
39
+ }
40
+ return modelApi.isAvailable();
41
+ }
42
+ get({ modelName, id }) {
43
+ return getAvailableModelApi(this.modelsApi).get({ modelName, id });
44
+ }
45
+ getAll({ modelName, page }) {
46
+ return getAvailableModelApi(this.modelsApi).getAll({ modelName, page });
47
+ }
48
+ search({ modelName, query, }) {
49
+ return getAvailableModelApi(this.modelsApi).search({ modelName, query });
50
+ }
51
+ }
52
+ //# sourceMappingURL=GatewayModelApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GatewayModelApi.js","sourceRoot":"","sources":["../../../src/apiProviders/Model/GatewayModelApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,SAAS,oBAAoB,CAAC,SAAqB;IACjD,MAAM,QAAQ,GAAa,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC/C,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;IACH,IAAI,QAAQ,IAAI,IAAI,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;KAC5E;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,OAAO,eAAe;IAClB,SAAS,CAAa;IAE9B,YAAY,GAAG,SAAqB;QAClC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,IAAI;QACF,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAED,WAAW;QACT,MAAM,QAAQ,GAAa,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,MAAM,IAAI,KAAK,CACb,yDAAyD,CAC1D,CAAC;SACH;QACD,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;IAED,GAAG,CAAC,EAAC,SAAS,EAAE,EAAE,EAAkC;QAClD,OAAO,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,EAAC,SAAS,EAAE,EAAE,EAAC,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,EAAC,SAAS,EAAE,IAAI,EAAoC;QACzD,OAAO,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,CAAC,EACL,SAAS,EACT,KAAK,GAIN;QACC,OAAO,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAAC,SAAS,EAAE,KAAK,EAAC,CAAC,CAAC;IACzE,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ import { Query, ReadOptions } from './utils';
2
+ export interface ModelApi {
3
+ init(): void;
4
+ isAvailable(): Promise<boolean>;
5
+ getAll({ modelName, page }: {
6
+ modelName: string;
7
+ page: number;
8
+ }): Promise<any[]>;
9
+ get({ modelName, id }: {
10
+ modelName: string;
11
+ id: number;
12
+ }): Promise<any[]>;
13
+ fetch?({ modelName, id, query, }: {
14
+ modelName: string;
15
+ id: number;
16
+ query: ReadOptions;
17
+ }): Promise<any[]>;
18
+ search({ modelName, query }: {
19
+ modelName: string;
20
+ query: Query;
21
+ }): Promise<any[]>;
22
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export {};
19
+ //# sourceMappingURL=ModelApiProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelApiProvider.js","sourceRoot":"","sources":["../../../src/apiProviders/Model/ModelApiProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
@@ -0,0 +1,12 @@
1
+ import { ModelApi } from './ModelApiProvider';
2
+ declare class Provider {
3
+ private modelApi;
4
+ constructor(modelApi: ModelApi);
5
+ setModelApi(newModelApi: ModelApi): void;
6
+ getModelApi(): ModelApi;
7
+ }
8
+ export declare function useModelApi(): ModelApi;
9
+ export declare function getModelApi(): ModelApi;
10
+ export declare function registerModelApi(modelApi: ModelApi): void;
11
+ export declare const provider: Provider;
12
+ export {};
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { useMemo } from 'react';
19
+ import { AopModelApi } from './AopModelApi';
20
+ class Provider {
21
+ modelApi;
22
+ constructor(modelApi) {
23
+ this.modelApi = modelApi;
24
+ this.modelApi = modelApi;
25
+ }
26
+ setModelApi(newModelApi) {
27
+ this.modelApi = newModelApi;
28
+ }
29
+ getModelApi() {
30
+ return this.modelApi;
31
+ }
32
+ }
33
+ export function useModelApi() {
34
+ return useMemo(() => provider.getModelApi(), []);
35
+ }
36
+ export function getModelApi() {
37
+ return provider.getModelApi();
38
+ }
39
+ export function registerModelApi(modelApi) {
40
+ provider.setModelApi(modelApi);
41
+ }
42
+ export const provider = new Provider(new AopModelApi());
43
+ //# sourceMappingURL=Provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../src/apiProviders/Model/Provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAG1C,MAAM,QAAQ;IACQ;IAApB,YAAoB,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,WAAW,CAAC,WAAqB;QAC/B,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;IAC9B,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAkB;IACjD,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { AopModelApi } from './AopModelApi';
2
+ export { GatewayModelApi } from './GatewayModelApi';
3
+ export { ModelApi } from './ModelApiProvider';
4
+ export { getModelApi, provider, registerModelApi, useModelApi } from './Provider';
5
+ export * from './utils';
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export { AopModelApi } from './AopModelApi';
19
+ export { GatewayModelApi } from './GatewayModelApi';
20
+ export { getModelApi, provider, registerModelApi, useModelApi } from './Provider';
21
+ export * from './utils';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/apiProviders/Model/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAC,MAAM,YAAY,CAAC;AAChF,cAAc,SAAS,CAAC"}
@@ -0,0 +1,28 @@
1
+ export declare const REQUEST_LIMIT = 10;
2
+ export type CriteriaField = {
3
+ operator: '=' | '!=' | '<' | '>' | '<=' | '>=' | 'like' | 'notLike' | 'between' | 'notBetween' | 'isNull' | 'notNull';
4
+ fieldName: string;
5
+ value?: any;
6
+ value2?: any;
7
+ };
8
+ export type CriteriaGroup = {
9
+ operator: 'and' | 'or' | 'not';
10
+ criteria: Criteria[];
11
+ };
12
+ export type Criteria = CriteriaField | CriteriaGroup;
13
+ export type CriteriaQuery = {
14
+ criteria: Criteria[];
15
+ };
16
+ export type Query = {
17
+ data: CriteriaQuery;
18
+ fields?: string[];
19
+ sortBy?: string[];
20
+ offset?: number;
21
+ limit?: number;
22
+ };
23
+ export type ReadOptions = {
24
+ fields: string[];
25
+ related?: {
26
+ [fieldName: string]: string[];
27
+ };
28
+ };
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2023 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export const REQUEST_LIMIT = 10;
19
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/apiProviders/Model/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC"}
@@ -0,0 +1,29 @@
1
+ interface ApiCallProps {
2
+ url: string;
3
+ data?: any;
4
+ }
5
+ export interface ApiProvider {
6
+ post({ url, data }: {
7
+ url: any;
8
+ data: any;
9
+ }): Promise<any>;
10
+ put({ url, data }: {
11
+ url: any;
12
+ data: any;
13
+ }): Promise<any>;
14
+ get({ url }: {
15
+ url: any;
16
+ }): Promise<any>;
17
+ delete({ url }: {
18
+ url: any;
19
+ }): Promise<any>;
20
+ }
21
+ declare class AxiosApiProvider implements ApiProvider {
22
+ constructor();
23
+ post({ url, data }: ApiCallProps): Promise<any>;
24
+ put({ url, data }: ApiCallProps): Promise<any>;
25
+ get({ url }: ApiCallProps): Promise<any>;
26
+ delete({ url }: ApiCallProps): Promise<any>;
27
+ }
28
+ export declare const axiosApiProvider: AxiosApiProvider;
29
+ export {};
@@ -27,6 +27,9 @@ class AxiosApiProvider {
27
27
  get({ url }) {
28
28
  return axios.get(url);
29
29
  }
30
+ delete({ url }) {
31
+ return axios.delete(url);
32
+ }
30
33
  }
31
34
  export const axiosApiProvider = new AxiosApiProvider();
32
- //# sourceMappingURL=AxiosApi.js.map
35
+ //# sourceMappingURL=AxiosProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AxiosProvider.js","sourceRoot":"","sources":["../../../src/apiProviders/Standard/AxiosProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,MAAM,gBAAgB;IACpB,gBAAe,CAAC;IAEhB,IAAI,CAAC,EAAC,GAAG,EAAE,IAAI,EAAe;QAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,GAAG,CAAC,EAAC,GAAG,EAAE,IAAI,EAAe;QAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,GAAG,CAAC,EAAC,GAAG,EAAe;QACrB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,EAAC,GAAG,EAAe;QACxB,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Schema } from 'yup';
2
+ import { Models } from '../../app/Module';
3
+ import { CriteriaGroup } from '../Model';
4
+ declare class ObjectFieldsProvider {
5
+ private objectFields;
6
+ private searchFields;
7
+ private sortFields;
8
+ constructor();
9
+ init(models: Models): void;
10
+ getObjectSchema(objectKey: string): Schema;
11
+ getObjectFields(objectKey: string): string[];
12
+ getSortFields(objectKey: string): string[];
13
+ getSearchFields(objectKey: string): string[];
14
+ getSearchCriterias(objectKey: string, searchValue: string): CriteriaGroup;
15
+ }
16
+ export declare const objectFieldsProvider: ObjectFieldsProvider;
17
+ export declare function getObjectFields(objectKey: string): string[];
18
+ export declare function getSortFields(objectKey: string): string[];
19
+ export declare function getSearchCriterias(objectKey: string, searchValue: string): CriteriaGroup;
20
+ export {};