@kumori/aurora-backend-handler 1.0.100 → 1.0.112

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.
@@ -8,9 +8,9 @@ import {
8
8
  Account,
9
9
  Container,
10
10
  Environment,
11
+ getWuiErrorCode,
11
12
  Instance,
12
13
  MarketplaceItem,
13
- Notification,
14
14
  Organization,
15
15
  Platform,
16
16
  Registry,
@@ -94,6 +94,7 @@ export const loadUserData = async () => {
94
94
 
95
95
  const userData: UserData = {
96
96
  id: userResponse.userRecord.id.name,
97
+ created: userResponse.userRecord.meta.created,
97
98
  name: userResponse.userRecord.spec.userinfo.name,
98
99
  surname: userResponse.userRecord.spec.userinfo.surname,
99
100
  provider: [{ name: provider, email: email || "", password: "" }],
@@ -170,10 +171,6 @@ export const loadUserData = async () => {
170
171
  if (tenantData?.domains && Object.keys(tenantData.domains)[0])
171
172
  registry.name = Object.keys(tenantData.domains)[0];
172
173
  tenant.registry.push(registry);
173
- } else {
174
- console.warn(
175
- `No se encontró información de registry para el tenant ${tenant.name}`,
176
- );
177
174
  }
178
175
 
179
176
  const tenantAccounts: Account[] = [];
@@ -1052,7 +1049,7 @@ export const updateUser = async (user: User) => {
1052
1049
  spec: {
1053
1050
  name: user.name,
1054
1051
  surname: user.surname,
1055
- discoveryMethod: "work",
1052
+ discoveryMethod: user.discoveryMethod,
1056
1053
  companyName: user.companyName,
1057
1054
  companyRole: user.rol,
1058
1055
  },
@@ -1070,7 +1067,7 @@ export const updateUser = async (user: User) => {
1070
1067
  subtype: "user-updated",
1071
1068
  date: Date.now().toString(),
1072
1069
  status: "unread",
1073
- callToAction: false,
1070
+ notificationType: "regular",
1074
1071
  data: { user: user.name },
1075
1072
  });
1076
1073
  } catch (error) {
@@ -1082,10 +1079,10 @@ export const updateUser = async (user: User) => {
1082
1079
  eventHelper.user.publish.updateError(user);
1083
1080
  eventHelper.notification.publish.creation({
1084
1081
  type: "error",
1085
- subtype: "tenant-update-error",
1082
+ subtype: getWuiErrorCode("user", "modifyUserInfo", (error as any).error.code) ?? "user-update-error",
1086
1083
  date: Date.now().toString(),
1087
1084
  status: "unread",
1088
- callToAction: false,
1085
+ notificationType: "regular",
1089
1086
  info_content: {
1090
1087
  code: (error as any).error.code,
1091
1088
  message: (error as any).error.content,
@@ -1113,7 +1110,7 @@ export const deleteUSer = async (user: User, security: string) => {
1113
1110
  subtype: "user-deleted",
1114
1111
  date: Date.now().toString(),
1115
1112
  status: "unread",
1116
- callToAction: false,
1113
+ notificationType: "regular",
1117
1114
  data: { user: user.name },
1118
1115
  });
1119
1116
  return response;
@@ -1121,10 +1118,10 @@ export const deleteUSer = async (user: User, security: string) => {
1121
1118
  console.error("Error deleting user:", error);
1122
1119
  eventHelper.notification.publish.creation({
1123
1120
  type: "error",
1124
- subtype: "user-delete-error",
1121
+ subtype: getWuiErrorCode("user", "deleteUser", (error as any).error.code) ?? "user-delete-error",
1125
1122
  date: Date.now().toString(),
1126
1123
  status: "unread",
1127
- callToAction: false,
1124
+ notificationType: "regular",
1128
1125
  info_content: {
1129
1126
  code: (error as any).error.code,
1130
1127
  message: (error as any).error.content,
@@ -1135,3 +1132,21 @@ export const deleteUSer = async (user: User, security: string) => {
1135
1132
  throw error;
1136
1133
  }
1137
1134
  };
1135
+ export const getUserHTTP = async () => {
1136
+ try {
1137
+ const url = new URL(
1138
+ `${environment.apiServer.baseUrl}/api/${environment.apiServer.apiVersion}/user/info`,
1139
+ );
1140
+ const response = await fetch(url.toString(), {
1141
+ method: "GET",
1142
+ headers: {
1143
+ },
1144
+ credentials: "include",
1145
+ });
1146
+ const userData = await response.json();
1147
+ return userData;
1148
+ } catch (error) {
1149
+ console.error("Error fetching user data:", error);
1150
+ throw error;
1151
+ }
1152
+ };