@boomi/embedkit-sdk 1.2.14 → 1.2.16

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.
package/dist/index.cjs CHANGED
@@ -7455,8 +7455,9 @@ var IntegrationPackInstanceService = class {
7455
7455
  * @throws ApiError
7456
7456
  */
7457
7457
  async fetchIntegrationPackInstances(params) {
7458
- const { accountGroup, search, page = 1, pageSize = 12 } = params;
7458
+ const { renderType, accountGroup, search, page = 1, pageSize = 12 } = params;
7459
7459
  const hasAgentTag = (s) => typeof s === "string" && /{{\s*AGENT\s*}}/i.test(s);
7460
+ const renderTypeFilter = renderType === "agent" || renderType === "integration" ? renderType : "all";
7460
7461
  const agResp = await this.httpRequest.request({
7461
7462
  method: "POST",
7462
7463
  url: "/AccountGroup/query",
@@ -7517,16 +7518,21 @@ var IntegrationPackInstanceService = class {
7517
7518
  const clampedPage = Math.min(Math.max(1, page), totalPages);
7518
7519
  const start = (clampedPage - 1) * pageSize;
7519
7520
  const slice = filtered.slice(start, start + pageSize);
7520
- const enriched = await Promise.all(
7521
+ const enrichedRaw = await Promise.all(
7521
7522
  slice.map(async (instance) => {
7522
7523
  const inst = { ...instance };
7523
- inst.installed = true;
7524
7524
  const ipId = inst.integrationPackId;
7525
+ inst.integrationPackDescription = packDescById.get(ipId);
7526
+ inst.isAgent = hasAgentTag(inst.integrationPackDescription);
7527
+ if (renderTypeFilter === "agent" && !inst.isAgent) {
7528
+ return null;
7529
+ } else if (renderTypeFilter === "integration" && inst.isAgent) {
7530
+ return null;
7531
+ }
7532
+ inst.installed = true;
7525
7533
  const rawType = installationTypeById.get(ipId);
7526
7534
  inst.installationType = rawType === "SINGLE" || rawType === "MULTI" ? rawType : "SINGLE";
7527
7535
  inst.integrationPackName = packNameById.get(ipId);
7528
- inst.integrationPackDescription = packDescById.get(ipId);
7529
- inst.isAgent = hasAgentTag(inst.integrationPackDescription);
7530
7536
  if (inst.integrationPackDescription && hasAgentTag(inst.integrationPackDescription)) {
7531
7537
  inst.integrationPackDescription = inst.integrationPackDescription.replace(/{{\s*AGENT\s*}}/gi, "").trim();
7532
7538
  }
@@ -7543,6 +7549,7 @@ var IntegrationPackInstanceService = class {
7543
7549
  return inst;
7544
7550
  })
7545
7551
  );
7552
+ const enriched = enrichedRaw.filter((inst) => Boolean(inst));
7546
7553
  return {
7547
7554
  numberOfResults: total,
7548
7555
  result: enriched,