@kumori/aurora-backend-handler 1.0.99 → 1.0.111

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
+ errors,
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[] = [];
@@ -1067,7 +1064,7 @@ export const updateUser = async (user: User) => {
1067
1064
  eventHelper.user.publish.updated(user);
1068
1065
  eventHelper.notification.publish.creation({
1069
1066
  type: "success",
1070
- subtype: "user-updated",
1067
+ subtype: errors.user.updated.subtype,
1071
1068
  date: Date.now().toString(),
1072
1069
  status: "unread",
1073
1070
  callToAction: false,
@@ -1082,7 +1079,7 @@ 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: errors.user.updateError.subtype,
1086
1083
  date: Date.now().toString(),
1087
1084
  status: "unread",
1088
1085
  callToAction: false,
@@ -1110,7 +1107,7 @@ export const deleteUSer = async (user: User, security: string) => {
1110
1107
  );
1111
1108
  eventHelper.notification.publish.creation({
1112
1109
  type: "success",
1113
- subtype: "user-deleted",
1110
+ subtype: errors.user.deleted.subtype,
1114
1111
  date: Date.now().toString(),
1115
1112
  status: "unread",
1116
1113
  callToAction: false,
@@ -1121,7 +1118,7 @@ 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: errors.user.deleteError.subtype,
1125
1122
  date: Date.now().toString(),
1126
1123
  status: "unread",
1127
1124
  callToAction: false,
@@ -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
+ };