@kumori/aurora-backend-handler 1.1.24 → 1.1.25

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.
@@ -59,10 +59,7 @@ type DeploymentResource =
59
59
  | Port<DeploymentResourceSpec>
60
60
  | Certificate<DeploymentResourceSpec>;
61
61
  let pendingLinks = new Map<string, Link[]>();
62
- /**
63
- * Function to deploy a marketplace item
64
- * @param item A MarketplaceService object containing the item to deploy
65
- */
62
+
66
63
  export const deployMarketplaceItem = async (item: MarketplaceService) => {
67
64
  const complexDeployment = item.deploymentData.serverChannels.find(
68
65
  (channel) => channel.isPublic,
@@ -301,17 +298,7 @@ export const deployMarketplaceItem = async (item: MarketplaceService) => {
301
298
  ? {
302
299
  detail: {},
303
300
  }
304
- : // ? {
305
- // detail: item.roles.reduce(
306
- // (acc, role) => ({
307
- // ...acc,
308
- // [role]: { hsize: 1 },
309
- // }),
310
- // {},
311
- // ),
312
- // }
313
- { detail: {} };
314
- // : { detail: { [`${item.artifactName}`]: { hsize: 1 } } };
301
+ : { detail: {} };
315
302
 
316
303
  const scaling: {
317
304
  simple: {
@@ -462,23 +449,9 @@ export const getMarketplaceItems = async (
462
449
  domain: (value as any).domain,
463
450
  type: (value as any).artifactTypes[0],
464
451
  artifact: (value as any).artifact,
452
+ schema: undefined,
465
453
  };
466
454
 
467
- try {
468
- const schemaData = await getMarketplaceSchema(
469
- tenant,
470
- item,
471
- security,
472
- );
473
- item.schema = schemaData;
474
- } catch (schemaError) {
475
- console.error(
476
- `Error cargando schema para ${item.name}:`,
477
- schemaError,
478
- );
479
- item.schema = undefined;
480
- }
481
-
482
455
  return item;
483
456
  },
484
457
  );
@@ -998,11 +971,7 @@ const linkPendingServices = async (service: Service, token: string) => {
998
971
  );
999
972
  }
1000
973
  };
1001
- /**
1002
- * Function to load marketplace items for a specific tenant
1003
- * @param tenant Tenant ID
1004
- * @param security Authorization token
1005
- */
974
+
1006
975
  export const loadMarketplaceItemsForTenant = async (
1007
976
  tenant: string,
1008
977
  security: string,
@@ -1022,47 +991,27 @@ export const loadMarketplaceItemsForTenant = async (
1022
991
  return [];
1023
992
  }
1024
993
 
1025
- const itemPromises = items.map(async (item: any) => {
1026
- const marketplaceItem: MarketplaceItem = {
1027
- tenant: tenant,
1028
- name: item.module,
1029
- logo: item.icon,
1030
- description: item.description,
1031
- version: item.version,
1032
- requirements: {
1033
- cpu: item.requirements?.cpu || 0,
1034
- memory: item.requirements?.memory || 0,
1035
- },
1036
- status: "",
1037
- instances: [],
1038
- links: [],
1039
- resources: [],
1040
- domain: item.domain,
1041
- type: item.artifactTypes?.[0],
1042
- artifact: item.artifact,
1043
- package: item.package,
1044
- categories: item.categories || [],
1045
- };
1046
-
1047
- try {
1048
- const schemaData = await getMarketplaceSchema(
1049
- tenant,
1050
- marketplaceItem,
1051
- security,
1052
- );
1053
- marketplaceItem.schema = schemaData;
1054
- } catch (schemaError) {
1055
- console.error(
1056
- `Error loading schema for ${marketplaceItem.name}:`,
1057
- schemaError,
1058
- );
1059
- marketplaceItem.schema = undefined;
1060
- }
1061
-
1062
- return marketplaceItem;
1063
- });
1064
-
1065
- return await Promise.all(itemPromises);
994
+ return items.map((item: any): MarketplaceItem => ({
995
+ tenant,
996
+ name: item.module,
997
+ logo: item.icon,
998
+ description: item.description,
999
+ version: item.version,
1000
+ requirements: {
1001
+ cpu: item.requirements?.cpu || 0,
1002
+ memory: item.requirements?.memory || 0,
1003
+ },
1004
+ status: "",
1005
+ instances: [],
1006
+ links: [],
1007
+ resources: [],
1008
+ domain: item.domain,
1009
+ type: item.artifactTypes?.[0],
1010
+ artifact: item.artifact,
1011
+ package: item.package,
1012
+ categories: item.categories || [],
1013
+ schema: undefined,
1014
+ }));
1066
1015
  } catch (error) {
1067
1016
  console.error(
1068
1017
  `Error loading marketplace items for tenant ${tenant}:`,
@@ -1070,4 +1019,4 @@ export const loadMarketplaceItemsForTenant = async (
1070
1019
  );
1071
1020
  return [];
1072
1021
  }
1073
- };
1022
+ };