@boomi/embedkit-sdk 1.2.1 → 1.2.3

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
@@ -9570,7 +9570,8 @@ declare class EnvironmentExtensionsService {
9570
9570
  fetchEnvironmentExtensions(params: {
9571
9571
  environmentId: string;
9572
9572
  integrationPackInstanceId: string;
9573
- environmentIds?: string[];
9573
+ environmentIds?: Environment[];
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>;
@@ -22788,13 +22789,11 @@ type TenantCreds = {
22788
22789
  apiToken: string;
22789
22790
  childAccountId?: string;
22790
22791
  accountGroup?: string;
22791
- oauth2: {
22792
+ oauth2?: {
22792
22793
  connections: Record<string, OAuth2Connection>;
22793
22794
  };
22794
- listeners: {
22795
- connections: Record<string, Listener>;
22796
- };
22797
- ai: AiConfig;
22795
+ listeners?: Record<string, Listener>;
22796
+ ai?: AiConfig;
22798
22797
  };
22799
22798
  type AiConfig = {
22800
22799
  enabled?: boolean;
package/dist/index.d.ts CHANGED
@@ -9570,7 +9570,8 @@ declare class EnvironmentExtensionsService {
9570
9570
  fetchEnvironmentExtensions(params: {
9571
9571
  environmentId: string;
9572
9572
  integrationPackInstanceId: string;
9573
- environmentIds?: string[];
9573
+ environmentIds?: Environment[];
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>;
@@ -22788,13 +22789,11 @@ type TenantCreds = {
22788
22789
  apiToken: string;
22789
22790
  childAccountId?: string;
22790
22791
  accountGroup?: string;
22791
- oauth2: {
22792
+ oauth2?: {
22792
22793
  connections: Record<string, OAuth2Connection>;
22793
22794
  };
22794
- listeners: {
22795
- connections: Record<string, Listener>;
22796
- };
22797
- ai: AiConfig;
22795
+ listeners?: Record<string, Listener>;
22796
+ ai?: AiConfig;
22798
22797
  };
22799
22798
  type AiConfig = {
22800
22799
  enabled?: 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(
@@ -4400,12 +4409,12 @@ 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
4416
  const envId = env.id || "";
4408
- const exts = await fetchExtensionsForPair(httpRequest, process.id, envId);
4417
+ const exts = await fetchExtensionsForPair(httpRequest, process.id, envId, isSingleInstall);
4409
4418
  allExtensions.push(...exts);
4410
4419
  }
4411
4420
  }
@@ -4912,7 +4921,7 @@ var EnvironmentExtensionsService = class {
4912
4921
  * @throws ApiError
4913
4922
  */
4914
4923
  async fetchEnvironmentExtensions(params) {
4915
- const { integrationPackInstanceId, environmentId, environmentIds } = params;
4924
+ const { integrationPackInstanceId, environmentId, environmentIds, isSingleInstall } = params;
4916
4925
  if (!integrationPackInstanceId) {
4917
4926
  throw Object.assign(new Error("integrationPackInstanceId is required"), { status: 400 });
4918
4927
  }
@@ -4925,7 +4934,13 @@ var EnvironmentExtensionsService = class {
4925
4934
  }
4926
4935
  const chunks = [];
4927
4936
  for (const envId of targets) {
4928
- const list = await fetchExtensions(this.httpRequest, integrationPackInstanceId, envId);
4937
+ const list = await fetchExtensions(
4938
+ this.httpRequest,
4939
+ integrationPackInstanceId,
4940
+ envId,
4941
+ environmentIds || [],
4942
+ isSingleInstall
4943
+ );
4929
4944
  chunks.push(list ?? []);
4930
4945
  }
4931
4946
  const items = [].concat(...chunks);