@boomi/embedkit-sdk 1.2.2 → 1.2.4

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.d.cts CHANGED
@@ -9571,6 +9571,7 @@ declare class EnvironmentExtensionsService {
9571
9571
  environmentId: string;
9572
9572
  integrationPackInstanceId: string;
9573
9573
  environmentIds?: string[];
9574
+ isSingleInstall?: boolean;
9574
9575
  }): Promise<EnvironmentExtensionsQueryResponse>;
9575
9576
  /** Fetch EnvironmentExtensionConnectionStatus for a given connection and fieldId. */
9576
9577
  fetchExtensionConnectionStatus(integrationPackInstanceId: string, environmentId: string, connectionId: string, fieldId: string): Promise<boolean>;
package/dist/index.d.ts CHANGED
@@ -9571,6 +9571,7 @@ declare class EnvironmentExtensionsService {
9571
9571
  environmentId: string;
9572
9572
  integrationPackInstanceId: string;
9573
9573
  environmentIds?: string[];
9574
+ isSingleInstall?: boolean;
9574
9575
  }): Promise<EnvironmentExtensionsQueryResponse>;
9575
9576
  /** Fetch EnvironmentExtensionConnectionStatus for a given connection and fieldId. */
9576
9577
  fetchExtensionConnectionStatus(integrationPackInstanceId: string, environmentId: string, connectionId: string, fieldId: string): Promise<boolean>;
package/dist/index.js CHANGED
@@ -4370,20 +4370,29 @@ async function fetchEnvironmentExtensions(httpRequest, requestBody) {
4370
4370
  }
4371
4371
 
4372
4372
  // lib/helpers/fetchExtensionsForPair.ts
4373
- async function fetchExtensionsForPair(httpRequest, processId, envId) {
4374
- const extensionFilter = nestedQueryFilter(
4375
- [
4376
- { property: "environmentId", operator: "EQUALS", value: envId },
4377
- { property: "extensionGroupId", operator: "EQUALS", value: processId }
4378
- ],
4379
- "and"
4380
- );
4373
+ async function fetchExtensionsForPair(httpRequest, processId, envId, isSingleInstall) {
4374
+ let extensionFilter;
4375
+ if (isSingleInstall) {
4376
+ const aFilter = queryFilter(
4377
+ "environmentId",
4378
+ "EQUALS",
4379
+ [envId]
4380
+ );
4381
+ } else {
4382
+ extensionFilter = nestedQueryFilter(
4383
+ [
4384
+ { property: "environmentId", operator: "EQUALS", value: envId },
4385
+ { property: "extensionGroupId", operator: "EQUALS", value: processId }
4386
+ ],
4387
+ "and"
4388
+ );
4389
+ }
4381
4390
  const extResponse = await fetchEnvironmentExtensions(httpRequest, extensionFilter);
4382
4391
  return extResponse?.result || [];
4383
4392
  }
4384
4393
 
4385
4394
  // lib/helpers/fetchExtensions.ts
4386
- async function fetchExtensions(httpRequest, integrationPackInstanceId, environmentId, environments) {
4395
+ async function fetchExtensions(httpRequest, integrationPackInstanceId, environmentId, environments, isSingleInstall) {
4387
4396
  const resp = await fetchProcesses(httpRequest, integrationPackInstanceId);
4388
4397
  if (!resp?.result) {
4389
4398
  throw new Error(
@@ -4392,7 +4401,7 @@ async function fetchExtensions(httpRequest, integrationPackInstanceId, environme
4392
4401
  }
4393
4402
  const processes = resp.result;
4394
4403
  const allExtensions = [];
4395
- const targetEnvs = resolveTargetEnvironments(environments, environmentId);
4404
+ const targetEnvs = environments || [];
4396
4405
  for (const process of processes) {
4397
4406
  if (!process.id) {
4398
4407
  throw new Error(
@@ -4400,21 +4409,17 @@ async function fetchExtensions(httpRequest, integrationPackInstanceId, environme
4400
4409
  );
4401
4410
  }
4402
4411
  if (!targetEnvs?.length) {
4403
- const exts = await fetchExtensionsForPair(httpRequest, process.id, environmentId);
4412
+ const exts = await fetchExtensionsForPair(httpRequest, process.id, environmentId, isSingleInstall);
4404
4413
  allExtensions.push(...exts);
4405
4414
  } else {
4406
4415
  for (const env of targetEnvs) {
4407
- const envId = env.id || "";
4408
- const exts = await fetchExtensionsForPair(httpRequest, process.id, envId);
4416
+ const exts = await fetchExtensionsForPair(httpRequest, process.id, env, isSingleInstall);
4409
4417
  allExtensions.push(...exts);
4410
4418
  }
4411
4419
  }
4412
4420
  }
4413
4421
  return allExtensions;
4414
4422
  }
4415
- function resolveTargetEnvironments(environments, environmentId) {
4416
- return environmentId ? [{ id: environmentId }] : environments;
4417
- }
4418
4423
 
4419
4424
  // lib/helpers/combineEnvironmentExtensions.ts
4420
4425
  function combineEnvironmentExtensions(exts) {
@@ -4912,7 +4917,7 @@ var EnvironmentExtensionsService = class {
4912
4917
  * @throws ApiError
4913
4918
  */
4914
4919
  async fetchEnvironmentExtensions(params) {
4915
- const { integrationPackInstanceId, environmentId, environmentIds } = params;
4920
+ const { integrationPackInstanceId, environmentId, environmentIds, isSingleInstall } = params;
4916
4921
  if (!integrationPackInstanceId) {
4917
4922
  throw Object.assign(new Error("integrationPackInstanceId is required"), { status: 400 });
4918
4923
  }
@@ -4925,7 +4930,13 @@ var EnvironmentExtensionsService = class {
4925
4930
  }
4926
4931
  const chunks = [];
4927
4932
  for (const envId of targets) {
4928
- const list = await fetchExtensions(this.httpRequest, integrationPackInstanceId, envId);
4933
+ const list = await fetchExtensions(
4934
+ this.httpRequest,
4935
+ integrationPackInstanceId,
4936
+ envId,
4937
+ environmentIds || [],
4938
+ isSingleInstall
4939
+ );
4929
4940
  chunks.push(list ?? []);
4930
4941
  }
4931
4942
  const items = [].concat(...chunks);