@boomi/embedkit-sdk 1.2.15 → 1.2.17
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 +14 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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",
|
|
@@ -7509,24 +7510,29 @@ var IntegrationPackInstanceService = class {
|
|
|
7509
7510
|
});
|
|
7510
7511
|
const allInstances = instResp?.result ?? [];
|
|
7511
7512
|
const searchLc = search?.toLowerCase();
|
|
7512
|
-
const filtered = searchLc ? allInstances.filter(
|
|
7513
|
+
const filtered = (searchLc ? allInstances.filter(
|
|
7513
7514
|
(inst) => (inst?.integrationPackInstancName?.toLowerCase?.().includes(searchLc) ?? false) || (inst?.integrationPackOverrideName?.toLowerCase?.().includes(searchLc) ?? false)
|
|
7514
|
-
) : allInstances
|
|
7515
|
+
) : allInstances).filter((inst) => {
|
|
7516
|
+
const isAgentInstance = hasAgentTag(inst?.integrationPackDescription);
|
|
7517
|
+
if (renderTypeFilter === "agent" && !isAgentInstance) return false;
|
|
7518
|
+
if (renderTypeFilter === "integration" && isAgentInstance) return false;
|
|
7519
|
+
return true;
|
|
7520
|
+
});
|
|
7515
7521
|
const total = filtered.length;
|
|
7516
7522
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
7517
7523
|
const clampedPage = Math.min(Math.max(1, page), totalPages);
|
|
7518
7524
|
const start = (clampedPage - 1) * pageSize;
|
|
7519
7525
|
const slice = filtered.slice(start, start + pageSize);
|
|
7520
|
-
const
|
|
7526
|
+
const enrichedRaw = await Promise.all(
|
|
7521
7527
|
slice.map(async (instance) => {
|
|
7522
7528
|
const inst = { ...instance };
|
|
7523
|
-
inst.installed = true;
|
|
7524
7529
|
const ipId = inst.integrationPackId;
|
|
7530
|
+
inst.integrationPackDescription = packDescById.get(ipId);
|
|
7531
|
+
inst.isAgent = hasAgentTag(inst.integrationPackDescription);
|
|
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,
|