@sankhyalabs/sankhyablocks 8.15.0-dev.53 → 8.15.0-dev.55

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 (166) hide show
  1. package/dist/cjs/{ConfigStorage-8d4e9d53.js → ConfigStorage-085c7117.js} +11 -12
  2. package/dist/cjs/{SnkMultiSelectionListDataSource-d15f7aac.js → IExporterProvider-955812ad.js} +52 -5
  3. package/dist/cjs/RecordIDUtils-3735135c.js +43 -0
  4. package/dist/cjs/{SnkFormConfigManager-33995e92.js → SnkFormConfigManager-8986431f.js} +2 -2
  5. package/dist/cjs/{auth-fetcher-bb8e9ae4.js → auth-fetcher-eddaf17f.js} +1 -1
  6. package/dist/cjs/{DataFetcher-99f0f6ed.js → form-config-fetcher-cdd644a7.js} +251 -0
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{pesquisa-fetcher-bdbbe9ac.js → pesquisa-fetcher-6e934fb5.js} +30 -16
  9. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  10. package/dist/cjs/snk-actions-button_4.cjs.entry.js +8 -9
  11. package/dist/cjs/snk-application.cjs.entry.js +22 -23
  12. package/dist/cjs/snk-attach.cjs.entry.js +12 -13
  13. package/dist/cjs/snk-crud.cjs.entry.js +4 -5
  14. package/dist/cjs/snk-data-exporter.cjs.entry.js +195 -78
  15. package/dist/cjs/{snk-data-unit-41c29713.js → snk-data-unit-abd2113f.js} +2 -37
  16. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -1
  17. package/dist/cjs/snk-detail-view.cjs.entry.js +6 -7
  18. package/dist/cjs/snk-filter-bar.cjs.entry.js +2 -3
  19. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +2 -3
  20. package/dist/cjs/snk-form-config.cjs.entry.js +1 -2
  21. package/dist/cjs/snk-form.cjs.entry.js +3 -4
  22. package/dist/cjs/snk-grid.cjs.entry.js +65 -102
  23. package/dist/cjs/{snk-guides-viewer-a8dd24a3.js → snk-guides-viewer-4e8b517b.js} +4 -5
  24. package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -7
  25. package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -3
  26. package/dist/cjs/snk-simple-crud.cjs.entry.js +115 -32
  27. package/dist/cjs/snk-taskbar.cjs.entry.js +3 -2
  28. package/dist/cjs/{taskbar-elements-3ecd1278.js → taskbar-elements-d9392685.js} +2 -2
  29. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +90 -0
  30. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +68 -0
  31. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +48 -1
  32. package/dist/collection/components/snk-data-exporter/interfaces/IExporterStrategy.js +1 -0
  33. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +53 -0
  34. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +55 -0
  35. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +35 -45
  36. package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +88 -0
  37. package/dist/collection/components/snk-data-exporter/utils/RecordIDUtils.js +38 -0
  38. package/dist/collection/components/snk-data-unit/snk-data-unit.js +3 -42
  39. package/dist/collection/components/snk-grid/snk-grid.js +3 -94
  40. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +81 -9
  41. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  42. package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -1
  43. package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
  44. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +3 -0
  45. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +4 -0
  46. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +8 -1
  47. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
  48. package/dist/components/ConfigStorage.js +1 -2
  49. package/dist/components/{field-search.js → IExporterProvider.js} +52 -7
  50. package/dist/components/ISave.js +42 -0
  51. package/dist/components/dataunit-fetcher.js +18 -4
  52. package/dist/components/form-config-fetcher.js +7022 -3
  53. package/dist/components/index2.js +198 -33
  54. package/dist/components/snk-actions-button2.js +3 -12
  55. package/dist/components/snk-application2.js +1 -1
  56. package/dist/components/snk-attach2.js +3 -4
  57. package/dist/components/snk-crud.js +3 -4
  58. package/dist/components/snk-data-exporter2.js +192 -79
  59. package/dist/components/snk-data-unit2.js +41 -39
  60. package/dist/components/snk-detail-view2.js +4 -5
  61. package/dist/components/snk-expression-item2.js +1 -1
  62. package/dist/components/snk-form-config2.js +1 -1
  63. package/dist/components/snk-grid2.js +63 -100
  64. package/dist/components/snk-personalized-filter2.js +1 -1
  65. package/dist/components/snk-simple-crud2.js +101 -16
  66. package/dist/components/snk-taskbar2.js +6 -5
  67. package/dist/esm/{ConfigStorage-6e241cd7.js → ConfigStorage-cc3f3dd3.js} +1 -2
  68. package/dist/esm/{SnkMultiSelectionListDataSource-7084f3b3.js → IExporterProvider-6ebf47ab.js} +52 -6
  69. package/dist/esm/RecordIDUtils-87d02110.js +41 -0
  70. package/dist/esm/{SnkFormConfigManager-7a4e678f.js → SnkFormConfigManager-7edda7eb.js} +2 -2
  71. package/dist/esm/{auth-fetcher-8ec448b0.js → auth-fetcher-11dd9cae.js} +1 -1
  72. package/dist/esm/{DataFetcher-a650ae58.js → form-config-fetcher-13cd3285.js} +250 -1
  73. package/dist/esm/loader.js +1 -1
  74. package/dist/esm/{pesquisa-fetcher-96d2f351.js → pesquisa-fetcher-4eed47c6.js} +18 -4
  75. package/dist/esm/sankhyablocks.js +1 -1
  76. package/dist/esm/snk-actions-button_4.entry.js +3 -4
  77. package/dist/esm/snk-application.entry.js +4 -5
  78. package/dist/esm/snk-attach.entry.js +4 -5
  79. package/dist/esm/snk-crud.entry.js +4 -5
  80. package/dist/esm/snk-data-exporter.entry.js +195 -78
  81. package/dist/esm/{snk-data-unit-de1d140d.js → snk-data-unit-29eba11a.js} +3 -38
  82. package/dist/esm/snk-data-unit.entry.js +2 -1
  83. package/dist/esm/snk-detail-view.entry.js +6 -7
  84. package/dist/esm/snk-filter-bar.entry.js +2 -3
  85. package/dist/esm/snk-filter-modal-item.entry.js +2 -3
  86. package/dist/esm/snk-form-config.entry.js +1 -2
  87. package/dist/esm/snk-form.entry.js +3 -4
  88. package/dist/esm/snk-grid.entry.js +63 -100
  89. package/dist/esm/{snk-guides-viewer-131e9660.js → snk-guides-viewer-2742a9db.js} +4 -5
  90. package/dist/esm/snk-guides-viewer.entry.js +6 -7
  91. package/dist/esm/snk-personalized-filter.entry.js +2 -3
  92. package/dist/esm/snk-simple-crud.entry.js +102 -19
  93. package/dist/esm/snk-taskbar.entry.js +3 -2
  94. package/dist/esm/{taskbar-elements-2473c8ac.js → taskbar-elements-ad766858.js} +2 -2
  95. package/dist/sankhyablocks/p-07825198.js +1 -0
  96. package/dist/sankhyablocks/p-1d9d07b4.entry.js +1 -0
  97. package/dist/sankhyablocks/p-201e5588.entry.js +1 -0
  98. package/dist/sankhyablocks/p-33a6728e.js +26 -0
  99. package/dist/sankhyablocks/p-37afb96a.js +1 -0
  100. package/dist/sankhyablocks/p-411fe937.entry.js +1 -0
  101. package/dist/sankhyablocks/p-44d52fc6.js +1 -0
  102. package/dist/sankhyablocks/p-4ddf7add.entry.js +1 -0
  103. package/dist/sankhyablocks/p-7b797d8f.entry.js +1 -0
  104. package/dist/sankhyablocks/p-87cb937d.js +65 -0
  105. package/dist/sankhyablocks/{p-0624f62d.js → p-8a4c4b54.js} +6 -6
  106. package/dist/sankhyablocks/p-9863d682.js +1 -0
  107. package/dist/sankhyablocks/{p-125bb902.js → p-99b51d06.js} +1 -1
  108. package/dist/sankhyablocks/p-9ee96756.entry.js +1 -0
  109. package/dist/sankhyablocks/p-a4c94582.entry.js +1 -0
  110. package/dist/sankhyablocks/p-bf209f48.entry.js +1 -0
  111. package/dist/sankhyablocks/p-c2f3ebf3.entry.js +1 -0
  112. package/dist/sankhyablocks/p-c3c0ad0b.entry.js +1 -0
  113. package/dist/sankhyablocks/{p-619c5f6f.entry.js → p-c801a38a.entry.js} +2 -2
  114. package/dist/sankhyablocks/p-cfb98f51.entry.js +1 -0
  115. package/dist/sankhyablocks/{p-efeca7ba.js → p-d24c9dc6.js} +1 -1
  116. package/dist/sankhyablocks/p-e4225e8b.entry.js +1 -0
  117. package/dist/sankhyablocks/p-edd9dd1c.entry.js +1 -0
  118. package/dist/sankhyablocks/p-fa84e72f.entry.js +1 -0
  119. package/dist/sankhyablocks/p-fd44c905.entry.js +1 -0
  120. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  121. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +13 -0
  122. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +11 -0
  123. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +21 -4
  124. package/dist/types/components/snk-data-exporter/interfaces/IExporterStrategy.d.ts +5 -0
  125. package/dist/types/components/snk-data-exporter/providers/ClientSideExporterProvider.d.ts +17 -0
  126. package/dist/types/components/snk-data-exporter/providers/ServerSideExporterProvider.d.ts +17 -0
  127. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +3 -1
  128. package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +77 -0
  129. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +3 -0
  130. package/dist/types/components/snk-grid/snk-grid.d.ts +0 -3
  131. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +14 -2
  132. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +1 -1
  133. package/dist/types/components.d.ts +16 -0
  134. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +2 -1
  135. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +1 -0
  136. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
  137. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +1 -0
  138. package/package.json +1 -1
  139. package/dist/cjs/form-config-fetcher-d73f4449.js +0 -256
  140. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +0 -34
  141. package/dist/components/DataFetcher.js +0 -7023
  142. package/dist/components/index3.js +0 -199
  143. package/dist/esm/form-config-fetcher-765b8498.js +0 -253
  144. package/dist/sankhyablocks/p-004c356e.js +0 -26
  145. package/dist/sankhyablocks/p-075bba4c.entry.js +0 -1
  146. package/dist/sankhyablocks/p-07a61550.entry.js +0 -1
  147. package/dist/sankhyablocks/p-103c5956.entry.js +0 -1
  148. package/dist/sankhyablocks/p-1048bd26.entry.js +0 -1
  149. package/dist/sankhyablocks/p-13ae1a89.entry.js +0 -1
  150. package/dist/sankhyablocks/p-24ed6ad6.entry.js +0 -1
  151. package/dist/sankhyablocks/p-34a7f2ab.js +0 -65
  152. package/dist/sankhyablocks/p-52c8e589.js +0 -1
  153. package/dist/sankhyablocks/p-5833cff9.js +0 -1
  154. package/dist/sankhyablocks/p-5a2e016a.entry.js +0 -1
  155. package/dist/sankhyablocks/p-6f560924.entry.js +0 -1
  156. package/dist/sankhyablocks/p-8967fa78.js +0 -1
  157. package/dist/sankhyablocks/p-9b1beac5.entry.js +0 -1
  158. package/dist/sankhyablocks/p-a87149e4.entry.js +0 -1
  159. package/dist/sankhyablocks/p-ac77949b.entry.js +0 -1
  160. package/dist/sankhyablocks/p-b10b9934.entry.js +0 -1
  161. package/dist/sankhyablocks/p-be75153c.js +0 -1
  162. package/dist/sankhyablocks/p-bf39bdb8.entry.js +0 -1
  163. package/dist/sankhyablocks/p-f7d0fab9.entry.js +0 -1
  164. package/dist/sankhyablocks/p-f7d9d148.entry.js +0 -1
  165. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +0 -3
  166. /package/dist/sankhyablocks/{p-ae4fc9a9.js → p-61dd89eb.js} +0 -0
@@ -1,256 +0,0 @@
1
- 'use strict';
2
-
3
- const DataFetcher = require('./DataFetcher-99f0f6ed.js');
4
- const core = require('@sankhyalabs/core');
5
-
6
- class ResourceFetcher {
7
- constructor() {
8
- this.templateByQuery = new Map();
9
- this.buldTemplates();
10
- }
11
- buldTemplates() {
12
- this.templateByQuery.set("fetchResource", DataFetcher.dist.gql `query($name: String!) {
13
- $queryAlias$: fetchResource(name: $name){
14
- resource
15
- }
16
- }`);
17
- this.templateByQuery.set("saveResource", DataFetcher.dist.gql `mutation($resource: InputResource!) {
18
- $queryAlias$: saveResource(resource: $resource){
19
- name
20
- resource
21
- }
22
- }`);
23
- }
24
- loadResource(name) {
25
- if (ResourceFetcher._loadingResource.has(name)) {
26
- return ResourceFetcher._loadingResource.get(name);
27
- }
28
- const promiseLoadResource = new Promise((resolve, reject) => {
29
- DataFetcher.DataFetcher.get()
30
- .callGraphQL({
31
- values: { name },
32
- query: this.templateByQuery.get("fetchResource"),
33
- })
34
- .then((result) => {
35
- resolve(result === null || result === void 0 ? void 0 : result.resource);
36
- ResourceFetcher._loadingResource.delete(name);
37
- })
38
- .catch((error) => {
39
- reject(error);
40
- ResourceFetcher._loadingResource.delete(name);
41
- });
42
- });
43
- ResourceFetcher._loadingResource.set(name, promiseLoadResource);
44
- return promiseLoadResource;
45
- }
46
- saveResource(resource, name) {
47
- return new Promise((resolve, reject) => {
48
- DataFetcher.DataFetcher.get()
49
- .callGraphQL({
50
- values: {
51
- resource: {
52
- name: name,
53
- resource: JSON.stringify(resource)
54
- }
55
- },
56
- query: this.templateByQuery.get("saveResource")
57
- })
58
- .then((resp) => {
59
- resolve(resp);
60
- })
61
- .catch((error) => {
62
- reject(error);
63
- });
64
- });
65
- }
66
- }
67
- ResourceFetcher._loadingResource = new Map();
68
-
69
- class FormConfigFetcher extends ResourceFetcher {
70
- constructor() {
71
- super();
72
- this.queryConfig = new Map();
73
- this.buildTemplatesConfig();
74
- }
75
- buildTemplatesConfig() {
76
- this.queryConfig.set("fetchUserAvailableConfigs", DataFetcher.dist.gql `query($name: String!) {
77
- $queryAlias$: fetchUserAvailableConfigs(name: $name){
78
- name
79
- origin
80
- key
81
- }
82
- }`);
83
- this.queryConfig.set("fetchLegacyConfig", DataFetcher.dist.gql `query($name: String!) {
84
- $queryAlias$: fetchLegacyConfig(name: $name){
85
- name
86
- resource
87
- }
88
- }`);
89
- this.queryConfig.set("fetchDefaultConfig", DataFetcher.dist.gql `query($name: String!) {
90
- $queryAlias$: fetchDefaultConfig(name: $name){
91
- name
92
- resource
93
- }
94
- }`);
95
- }
96
- loadFormConfig(formName, resourceID) {
97
- return new Promise((accept, reject) => {
98
- Promise.all([
99
- this.loadResource(this.getPath(resourceID, formName)),
100
- this.loadResource(this.getPath(`FormCardState:${resourceID}`, formName, "form-card")),
101
- this.loadResource(this.getPath(resourceID, formName, "summary")),
102
- this.loadResource(this.getPath(resourceID, formName, "defaultValues"))
103
- ])
104
- .then(([configAsString, formCardState, summary, defaultValues]) => {
105
- let config;
106
- if (configAsString != undefined) {
107
- config = Object.assign(Object.assign({}, JSON.parse(configAsString)), { emptyConfig: false });
108
- const { tabs, fields } = config;
109
- if (tabs) {
110
- const allTabs = new Map(tabs.map(t => [t.label, t]));
111
- fields === null || fields === void 0 ? void 0 : fields.forEach(f => { var _a; return f.tab = ((_a = allTabs.get(this.getTabName(f.tab))) === null || _a === void 0 ? void 0 : _a.label) || allTabs.get(this.getTabName(f.tab)); });
112
- }
113
- config.fields = fields === null || fields === void 0 ? void 0 : fields.map((field) => {
114
- if ("readonly" in field) {
115
- const readOnly = field['readonly'] === true;
116
- delete field['readonly'];
117
- field.readOnly = readOnly;
118
- }
119
- return field;
120
- });
121
- }
122
- if (formCardState != undefined) {
123
- if (config == undefined) {
124
- config = { emptyConfig: true, fields: [] };
125
- }
126
- config.cardsState = new Map(JSON.parse(formCardState));
127
- }
128
- if (summary != undefined) {
129
- if (config == undefined) {
130
- config = { emptyConfig: true, fields: [] };
131
- }
132
- config.summary = new Map(Object.entries(JSON.parse(summary)));
133
- }
134
- if (defaultValues != undefined) {
135
- if (config == undefined) {
136
- config = { emptyConfig: true, fields: [] };
137
- }
138
- config.defaultVars = new Map(Object.entries(JSON.parse(defaultValues)));
139
- }
140
- accept(config);
141
- })
142
- .catch((error) => {
143
- reject(error);
144
- });
145
- });
146
- }
147
- getTabName(tab) {
148
- if (typeof tab === 'object') { // ITabConfig type
149
- return tab.label;
150
- }
151
- return tab; //string type
152
- }
153
- saveCardState(cardsState, formName, resourceID) {
154
- const completePath = this.getPath(`FormCardState:${resourceID}`, formName, "form-card");
155
- return new Promise((resolve, reject) => {
156
- this.saveResource(Array.from(cardsState.entries()), completePath)
157
- .then((resp) => {
158
- resolve(new Map(JSON.parse(resp.resource)));
159
- })
160
- .catch((error) => {
161
- reject(error);
162
- });
163
- });
164
- }
165
- saveConfig(config, formName, resourceID) {
166
- //Essas informações não devem ser salvas na configuração
167
- delete config.cardsState;
168
- delete config.defaultVars;
169
- delete config.summary;
170
- const completePath = this.getPath(resourceID, formName);
171
- return new Promise((resolve, reject) => {
172
- this.saveResource(config, completePath)
173
- .then((resp) => {
174
- resolve(JSON.parse(resp.resource));
175
- })
176
- .catch((error) => {
177
- reject(error);
178
- });
179
- });
180
- }
181
- fetchUserAvailableConfigs(formName, resourceID) {
182
- const name = this.getPath(resourceID, formName);
183
- return new Promise((resolve, reject) => {
184
- DataFetcher.DataFetcher.get()
185
- .callGraphQL({
186
- values: { name },
187
- query: this.queryConfig.get("fetchUserAvailableConfigs"),
188
- })
189
- .then((result) => {
190
- resolve(result);
191
- })
192
- .catch((error) => {
193
- reject(error);
194
- });
195
- });
196
- }
197
- fetchLegacyConfig(formName, resourceID) {
198
- const name = this.getPath(resourceID, formName);
199
- return new Promise((resolve, reject) => {
200
- DataFetcher.DataFetcher.get()
201
- .callGraphQL({
202
- values: { name },
203
- query: this.queryConfig.get("fetchLegacyConfig"),
204
- })
205
- .then((result) => {
206
- resolve(core.ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
207
- })
208
- .catch((error) => {
209
- reject(error);
210
- });
211
- });
212
- }
213
- fetchDefaultConfig(formName, resourceID) {
214
- const name = this.getPath(resourceID, formName);
215
- return new Promise((resolve, reject) => {
216
- DataFetcher.DataFetcher.get()
217
- .callGraphQL({
218
- values: { name },
219
- query: this.queryConfig.get("fetchDefaultConfig"),
220
- })
221
- .then((result) => {
222
- resolve(core.ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
223
- })
224
- .catch((error) => {
225
- reject(error);
226
- });
227
- });
228
- }
229
- getPath(resourceID, name, authority = "form") {
230
- if (name) {
231
- return `cfg://${authority}/${resourceID}/${name}`;
232
- }
233
- return `cfg://${authority}/${resourceID}`;
234
- }
235
- async fetchLegacyConfigurableForm(configName) {
236
- const payload = { 'requestBody': { 'config': { 'chave': configName, 'tipo': 'T' } } };
237
- const response = await DataFetcher.DataFetcher.get().callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
238
- if (core.ObjectUtils.isEmpty(response))
239
- return undefined;
240
- return this.buildLegacyConfigurableForm(response);
241
- }
242
- buildLegacyConfigurableForm(config) {
243
- var _a, _b, _c;
244
- const rawFields = (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
245
- return { emptyConfig: false, fields: Array.isArray(rawFields) ? rawFields : [rawFields] };
246
- }
247
- }
248
- exports.UserConfigType = void 0;
249
- (function (UserConfigType) {
250
- UserConfigType["USER"] = "USER";
251
- UserConfigType["DEFAULT"] = "DEFAULT";
252
- UserConfigType["SHARED"] = "SHARED";
253
- })(exports.UserConfigType || (exports.UserConfigType = {}));
254
-
255
- exports.FormConfigFetcher = FormConfigFetcher;
256
- exports.ResourceFetcher = ResourceFetcher;
@@ -1,34 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s)
4
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- import { ApplicationContext, ObjectUtils } from "@sankhyalabs/core";
14
- import { DataFetcher } from '../../DataFetcher';
15
- export default function fetchDataExporter(_a) {
16
- var { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
17
- const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
18
- const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
19
- const payload = { serviceName, requestBody };
20
- return new Promise((resolve, reject) => {
21
- DataFetcher.get()
22
- .callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
23
- .then(result => resolve(getFormatResponse(result)))
24
- .catch(error => reject(error));
25
- });
26
- }
27
- function getFormatResponse(result) {
28
- var _a;
29
- const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
30
- if (response == undefined) {
31
- return;
32
- }
33
- return ObjectUtils.stringToObject(response);
34
- }