impaktapps-ui-builder 0.0.412-g → 0.0.412-hi

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.
@@ -1,7 +1,7 @@
1
1
  import { handlersProps } from "./interface";
2
2
  export declare const executeEvents: (params: handlersProps) => any;
3
3
  export declare function getRefreshElements(eventConfig: any, eventGropus: any): string[];
4
- export declare function executeRefreshHandler(params: handlersProps): Promise<any[][]>;
4
+ export declare function executeRefreshHandler(params: handlersProps): Promise<PromiseSettledResult<void | PromiseSettledResult<any>[]>[]>;
5
5
  export declare function executeApiRequest(params: any): any;
6
6
  export declare function shouldEventExecute(params: handlersProps): any;
7
7
  export declare function buildApiPayload(compConfig: any, body: any, headers: any, store: any, dynamicData: any, userValue: any, service: any): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.412g",
3
+ "version": "0.0.412hi",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -96,15 +96,32 @@ export function getRefreshElements(eventConfig: any, eventGropus: any) {
96
96
  console.log(result);
97
97
  return result;
98
98
  }
99
- export function executeRefreshHandler(params: handlersProps) {
99
+ export async function executeRefreshHandler(params: handlersProps) {
100
100
  const compToRefresh: string[] = getRefreshElements(params.config, params.eventGroups);
101
-
102
- return Promise.all(compToRefresh.map(componentName => {
103
- return Promise.all(params.eventGroups.onLoad[componentName].map(compEventConfig => {
101
+
102
+ // Create an array of promises for the components to refresh
103
+ return Promise.allSettled(compToRefresh.map(componentName => {
104
+ const eventConfigs = params.eventGroups.onLoad[componentName];
105
+
106
+ // If eventConfigs is undefined, return a resolved promise
107
+ if (!eventConfigs) {
108
+ return Promise.resolve(); // Resolve immediately if there are no events to load
109
+ }
110
+
111
+ // Create an array of promises for the defined eventConfigs
112
+ return Promise.allSettled(eventConfigs.map(compEventConfig => {
104
113
  return executeEvents({ ...params, config: compEventConfig, componentName });
105
114
  }));
106
- }))
107
- };
115
+ }));
116
+ }
117
+ // export function executeRefreshHandler(params: handlersProps) {
118
+ // const compToRefresh: string[] = getRefreshElements(params.config, params.eventGroups);
119
+ // return Promise.all(compToRefresh.map(componentName => {
120
+ // return Promise.all(params.eventGroups.onLoad[componentName].map(compEventConfig => {
121
+ // return executeEvents({ ...params, config: compEventConfig, componentName });
122
+ // }));
123
+ // }))
124
+ // };
108
125
  export function executeApiRequest(params: any) {
109
126
  const initialBody = { ...params.userValue?.payload };
110
127
  const initialHeaders = {
@@ -103,6 +103,8 @@ export default (funcParams: funcParamsProps) => {
103
103
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
104
104
  serviceHolder: this, eventGroups
105
105
  })
106
+ const jsonres = await fetch('https://jsonplaceholder.typicode.com/todos/1');
107
+ const result = await jsonres.json()
106
108
  funcParams.store.setSchema(
107
109
  (pre: any) => {
108
110
  return {