@adyen/kyc-components 3.41.8 → 3.41.9

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.
@@ -32596,12 +32596,14 @@ const getRegularTaskStatus = ({
32596
32596
  if (importantProblems.length > 0) {
32597
32597
  return importantProblems[0].statusWithReason;
32598
32598
  }
32599
+ const pendingCapabilities = getPendingCapabilities(rootLegalEntity);
32600
+ if (!ignorePendingCapabilities && pendingCapabilities.length > 0)
32601
+ return {
32602
+ status: TaskStatus.PROCESSING,
32603
+ reason: "pendingCapabilities",
32604
+ details: { pendingCapabilities }
32605
+ };
32599
32606
  if (relevantEntityIds.includes(rootLegalEntity.id)) {
32600
- if (!ignorePendingCapabilities && hasPendingCapabilities(rootLegalEntity))
32601
- return {
32602
- status: TaskStatus.PROCESSING,
32603
- reason: "pendingCapabilities"
32604
- };
32605
32607
  if (hasAllCapabilitiesValid(rootLegalEntity))
32606
32608
  return {
32607
32609
  status: TaskStatus.FINISHED,
@@ -32625,9 +32627,7 @@ function findImportantProblems(type, capabilityProblems, entityIds) {
32625
32627
  (prev, curr) => curr.statusWithReason.status - prev.statusWithReason.status
32626
32628
  );
32627
32629
  }
32628
- const hasPendingCapabilities = (legalEntityResponse) => Object.values(legalEntityResponse.capabilities ?? {}).some(
32629
- (capability) => capability.verificationStatus === "pending"
32630
- );
32630
+ const getPendingCapabilities = (legalEntityResponse) => entriesOf(legalEntityResponse.capabilities ?? {}).filter(([, capability]) => (capability == null ? void 0 : capability.verificationStatus) === "pending").reduce((acc, [name]) => [...acc, name], []);
32631
32631
  const hasAllCapabilitiesResolved = (legalEntityResponse) => Object.values((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}).every(
32632
32632
  (capability) => capability.verificationStatus !== VerificationStatus.PENDING
32633
32633
  );
@@ -43655,7 +43655,7 @@ const ConfigurationApiProvider = ({
43655
43655
  }) => {
43656
43656
  const authContext = useAuthContext();
43657
43657
  const { isEmbeddedDropin, loadingContext } = authContext;
43658
- const sdkVersion = "3.41.8";
43658
+ const sdkVersion = "3.41.9";
43659
43659
  useAnalytics({
43660
43660
  onUserEvent,
43661
43661
  legalEntityId: rootLegalEntityId,
@@ -44345,6 +44345,10 @@ const ExplainDetails = ({ status }) => {
44345
44345
  ] }, subError.code)) }) : /* @__PURE__ */ jsx(Fragment, {})
44346
44346
  ] });
44347
44347
  }
44348
+ case "pendingCapabilities": {
44349
+ const pendingCapabilities = details.pendingCapabilities;
44350
+ return /* @__PURE__ */ jsx("ul", { children: pendingCapabilities.map((capabilityName) => /* @__PURE__ */ jsx("li", { children: capabilityName }, capabilityName)) });
44351
+ }
44348
44352
  }
44349
44353
  };
44350
44354
  const tabs = "adyen-kyc-tabs";
@@ -44496,7 +44500,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
44496
44500
  const { i18n } = useI18nContext();
44497
44501
  const [tab, setTab] = useState("metadata");
44498
44502
  const metadata = {
44499
- sdkVersion: "3.41.8",
44503
+ sdkVersion: "3.41.9",
44500
44504
  locale: i18n.locale,
44501
44505
  rootLegalEntityId
44502
44506
  };
@@ -2,6 +2,7 @@ import type { ExistingLegalEntity, LegalEntity } from '../../core/models/api/leg
2
2
  import type { CapabilityProblems } from '../../core/models/errors/capability-problems';
3
3
  import type { TaskStatusWithReason } from './taskStatus';
4
4
  import { TaskTypes } from './taskTypes';
5
+ import type { CapabilityName } from '../../core/models/api/capability';
5
6
  export declare const getRegularTaskStatus: ({ taskType, capabilityProblems, rootLegalEntity, relevantEntityIds, ignorePendingCapabilities, }: {
6
7
  taskType: TaskTypes;
7
8
  capabilityProblems: CapabilityProblems;
@@ -9,7 +10,7 @@ export declare const getRegularTaskStatus: ({ taskType, capabilityProblems, root
9
10
  relevantEntityIds: string[];
10
11
  ignorePendingCapabilities?: boolean;
11
12
  }) => TaskStatusWithReason;
12
- export declare const hasPendingCapabilities: (legalEntityResponse: LegalEntity) => boolean;
13
+ export declare const getPendingCapabilities: (legalEntityResponse: LegalEntity) => CapabilityName[];
13
14
  export declare const hasAllCapabilitiesResolved: (legalEntityResponse: LegalEntity) => boolean;
14
15
  export declare const hasRejectedCapabilities: (legalEntityResponse: LegalEntity) => boolean;
15
16
  export declare const hasInvalidCapabilities: (legalEntityResponse: LegalEntity) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.41.8",
3
+ "version": "3.41.9",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",