@procivis/one-react-native-components 0.3.91 → 0.3.95
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/lib/commonjs/components/history/history-list-item-icon.js +10 -2
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/locale/fi.json +21 -0
- package/lib/commonjs/ui-components/accessibility/locale/index.js +2 -0
- package/lib/commonjs/ui-components/accessibility/locale/index.js.map +1 -1
- package/lib/commonjs/utils/history.js +1 -41
- package/lib/commonjs/utils/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +3 -25
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +3 -11
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +7 -21
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +1 -1
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +10 -2
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/ui-components/accessibility/locale/fi.json +21 -0
- package/lib/module/ui-components/accessibility/locale/index.js +2 -0
- package/lib/module/ui-components/accessibility/locale/index.js.map +1 -1
- package/lib/module/utils/history.js +0 -38
- package/lib/module/utils/history.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +1 -1
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +3 -25
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +3 -11
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +7 -21
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js +1 -1
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/typescript/ui-components/accessibility/locale/index.d.ts +21 -0
- package/lib/typescript/utils/history.d.ts +1 -3
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +0 -1
- package/lib/typescript/utils/parsers/credential.d.ts +2 -23
- package/lib/typescript/utils/parsers/query.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/history/history-list-item-icon.tsx +9 -1
- package/src/ui-components/accessibility/locale/fi.json +21 -0
- package/src/ui-components/accessibility/locale/index.ts +2 -1
- package/src/utils/history.ts +1 -42
- package/src/utils/hooks/core/proofs.ts +4 -4
- package/src/utils/parsers/credential-sharing-v2.tsx +5 -26
- package/src/utils/parsers/credential-sharing.tsx +4 -14
- package/src/utils/parsers/credential.ts +8 -28
- package/src/utils/parsers/query.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CredentialStateEnum","DataTypeEnum","FormatFeatureEnum","CredentialErrorIcon","CredentialNoticeWarningIcon","CredentialWarningIcon","formatDateLocalized","formatDateTimeLocalized","concatTestID","getCarouselImagesFromClaims","ValidityState","getValidityState","credential","state","REVOKED","Revoked","SUSPENDED","Suspended","Valid","supportsSelectiveDisclosure","config","_formatConfig$capabil","formatConfig","format","schema","Boolean","capabilities","features","includes","SelectiveDisclosure","undefined","findClaimByPathParts","path","claims","length","first","second","rest","claim","find","c","key","dataType","Object","value","findClaimByPath","split","formatCredentialDetail","testID","_attributeValue$value","attributeValue","detailsCardAttributeValueFromClaim","hasMsoValidityIssues","mdocMsoValidity","mdocMsoValidityIssue","nextUpdate","Date","credentialDetailFromCredential","labels","_formatDateTimeLocali","_credential$issuanceD","layoutProperties","credentialDetailPrimary","suspendEndDate","suspendedUntil","suspended","credentialDetailTestID","statusIcon","revoked","credentialDetailErrorColor","validityIssues","issuanceDate","createdDate","credentialDetailSecondary","primary","primaryAttribute","secondary","secondaryAttribute","cardHeaderFromCredential","_layoutProperties$log","_layoutProperties$log2","_layoutProperties$log3","color","logo","backgroundColor","credentialName","name","icon","image","imageSource","uri","iconLabelColor","fontColor","getCredentialCardPropsFromCredential","notice","_layoutProperties$bac","_layoutProperties$bac2","text","validityIssuesNotice","noticeIcon","result","cardCarouselImages","cardImage","background","header","detailsCardAttributeFromClaim","id","pop","typeConfig","datatype","array","values","map","arrayValue","index","toString","type","Array","isArray","attributes","nestedClaim","_formatDateLocalized","String","date","Picture","SwiyuPicture","_typeConfig$params","params","showAs","detailsCardFromCredential","detailsCardFromCredentialWithClaims","card","nestAttributes","attribute","attributePath","push","parent","a","insertAttributeInParent","join","nestAttributeInDummyParent","pathParts","listValue","disabled","_parent$attributes","nextParent","_parent$values","_parent$attributes2","parseBase64Image","getCredentialSchemaWithoutImages","credentialSchema","_credentialSchema$lay","_credentialSchema$lay2","_credentialSchema$lay3","_credentialSchema$lay4"],"sources":["credential.ts"],"sourcesContent":["import {\n Claim,\n Config,\n CredentialDetail,\n CredentialListItem,\n CredentialSchema,\n CredentialStateEnum,\n DataTypeEnum,\n FormatFeatureEnum,\n} from '@procivis/react-native-one-core';\nimport { FC } from 'react';\nimport { SvgProps } from 'react-native-svg';\n\nimport {\n CredentialAttribute,\n CredentialAttributeValue,\n CredentialCardProps,\n CredentialDetailsCardProps,\n CredentialHeaderProps,\n} from '../../ui-components/credential';\nimport { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';\nimport { CredentialErrorIcon, CredentialNoticeWarningIcon, CredentialWarningIcon } from '../../ui-components/icons';\nimport { formatDateLocalized, formatDateTimeLocalized } from '../date';\nimport { concatTestID } from '../testID';\nimport { getCarouselImagesFromClaims } from './credential-images';\n\nexport enum ValidityState {\n Revoked = 'revoked',\n Suspended = 'suspended',\n Valid = 'valid',\n}\n\nexport const getValidityState = (credential: CredentialListItem | undefined) => {\n if (credential?.state === CredentialStateEnum.REVOKED) {\n return ValidityState.Revoked;\n }\n if (credential?.state === CredentialStateEnum.SUSPENDED) {\n return ValidityState.Suspended;\n }\n return ValidityState.Valid;\n};\n\nexport const supportsSelectiveDisclosure = (credential: CredentialListItem | undefined, config: Config | undefined) => {\n const formatConfig = credential && config?.format[credential.schema.format];\n return formatConfig\n ? Boolean(formatConfig.capabilities?.features?.includes(FormatFeatureEnum.SelectiveDisclosure))\n : undefined;\n};\n\nconst findClaimByPathParts = (path: string[], claims?: Claim[]): Claim | undefined => {\n if (!claims?.length) {\n return undefined;\n }\n const [first, second, ...rest] = path;\n const claim = claims.find((c) => c.key === first);\n if (claim === undefined || second === undefined || claim.dataType !== DataTypeEnum.Object) {\n return claim;\n }\n\n return findClaimByPathParts([`${first}/${second}`, ...rest], claim.value as Claim[]);\n};\n\nexport const findClaimByPath = (path: string | undefined, claims: Claim[] | undefined) =>\n path ? findClaimByPathParts(path.split('/'), claims) : undefined;\n\nconst formatCredentialDetail = (claim: Claim, config: Config, testID: string): string => {\n const attributeValue = detailsCardAttributeValueFromClaim(claim, config, testID);\n return attributeValue.value ?? '';\n};\n\nexport const hasMsoValidityIssues = (credential: CredentialDetail): boolean => {\n const mdocMsoValidity: { nextUpdate: string } | undefined =\n 'mdocMsoValidity' in credential ? (credential.mdocMsoValidity as { nextUpdate: string }) : undefined;\n\n const mdocMsoValidityIssue = Boolean(\n mdocMsoValidity?.nextUpdate && new Date(mdocMsoValidity.nextUpdate) < new Date(),\n );\n\n return mdocMsoValidityIssue;\n};\n\nexport type CardHeaderLabels = {\n validityIssues: string;\n revoked: string;\n suspended: string;\n suspendedUntil: (date: string) => string;\n};\n\nconst credentialDetailFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n testID: string,\n labels: CardHeaderLabels,\n): {\n credentialDetailPrimary?: string;\n credentialDetailSecondary?: string;\n credentialDetailErrorColor?: boolean;\n credentialDetailTestID?: string;\n statusIcon?: FC<SvgProps>;\n} => {\n const { layoutProperties } = credential.schema;\n\n switch (credential.state) {\n case CredentialStateEnum.SUSPENDED:\n return {\n credentialDetailPrimary: credential.suspendEndDate\n ? labels.suspendedUntil(formatDateTimeLocalized(new Date(credential.suspendEndDate))!)\n : labels.suspended,\n credentialDetailTestID: concatTestID(testID, 'suspended'),\n statusIcon: CredentialWarningIcon,\n };\n case CredentialStateEnum.REVOKED:\n return {\n credentialDetailPrimary: labels.revoked,\n credentialDetailErrorColor: true,\n credentialDetailTestID: concatTestID(testID, 'revoked'),\n statusIcon: CredentialErrorIcon,\n };\n }\n\n if (hasMsoValidityIssues(credential)) {\n return {\n credentialDetailPrimary: labels.validityIssues,\n credentialDetailTestID: concatTestID(testID, 'validity-issue'),\n statusIcon: CredentialWarningIcon,\n };\n }\n\n let credentialDetailPrimary =\n formatDateTimeLocalized(new Date(credential.issuanceDate ?? credential.createdDate)) ?? '';\n let credentialDetailSecondary: string | undefined;\n\n const primary = findClaimByPath(layoutProperties?.primaryAttribute, claims);\n\n if (primary) {\n credentialDetailPrimary = formatCredentialDetail(primary, config, concatTestID(testID, 'primary'));\n }\n\n const secondary = findClaimByPath(layoutProperties?.secondaryAttribute, claims);\n\n if (secondary) {\n credentialDetailSecondary = formatCredentialDetail(secondary, config, concatTestID(testID, 'secondary'));\n }\n\n return {\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailTestID: concatTestID(testID, 'detail'),\n };\n};\n\nexport const cardHeaderFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n testID: string,\n labels: CardHeaderLabels,\n): Omit<CredentialHeaderProps, 'style'> => {\n const {\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailErrorColor,\n credentialDetailTestID,\n statusIcon,\n } = credentialDetailFromCredential(credential, claims, config, testID, labels);\n const { layoutProperties } = credential.schema;\n\n return {\n color: layoutProperties?.logo?.backgroundColor,\n credentialDetailErrorColor,\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailTestID,\n credentialName: credential.schema.name,\n icon: layoutProperties?.logo?.image\n ? {\n imageSource: {\n uri: layoutProperties.logo.image,\n },\n }\n : undefined,\n iconLabelColor: layoutProperties?.logo?.fontColor,\n statusIcon,\n testID,\n };\n};\n\nexport type CardLabels = CardHeaderLabels & {\n validityIssuesNotice: string;\n};\n\nexport const getCredentialCardPropsFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'> => {\n const { layoutProperties } = credential.schema;\n\n if (hasMsoValidityIssues(credential)) {\n notice = {\n text: labels.validityIssuesNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n };\n }\n\n const result: Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'> = {\n cardCarouselImages: getCarouselImagesFromClaims(claims, layoutProperties, concatTestID(testID, 'carousel')),\n cardImage: layoutProperties?.background?.image\n ? { imageSource: { uri: layoutProperties.background.image } }\n : undefined,\n color: layoutProperties?.background?.color,\n header: cardHeaderFromCredential(credential, claims, config, concatTestID(testID, 'header'), labels),\n testID,\n notice,\n };\n\n return result;\n};\n\nexport const detailsCardAttributeFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttribute => {\n const value = detailsCardAttributeValueFromClaim(claim, config, testID);\n return {\n id: claim.id,\n name: claim.key.split('/').pop(),\n path: claim.key,\n ...value,\n };\n};\n\nconst detailsCardAttributeValueFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttributeValue => {\n const typeConfig = config?.datatype[claim.dataType];\n\n if (claim.array) {\n return {\n values: (claim.value || []).map((arrayValue, index) => {\n return detailsCardAttributeFromClaim(\n {\n ...arrayValue,\n id: `${arrayValue.id}/${index}`,\n },\n config,\n concatTestID(testID, index.toString()),\n );\n }),\n };\n } else {\n switch (typeConfig?.type) {\n case DataTypeEnum.Object: {\n if (!Array.isArray(claim.value)) {\n return { attributes: [] };\n }\n return {\n attributes: (claim.value as Claim[]).map((nestedClaim, index) =>\n detailsCardAttributeFromClaim(nestedClaim, config, concatTestID(testID, index.toString())),\n ),\n };\n }\n case DataTypeEnum.Date: {\n if (!claim.value) {\n // Don't try to parse empty values (which will return \"Invalid Date\")\n return { testID: testID, value: String(claim.value) };\n }\n const date = claim.value as string;\n return {\n testID: testID,\n value: formatDateLocalized(new Date(date)) ?? date,\n };\n }\n case DataTypeEnum.Picture: // fallback\n case DataTypeEnum.SwiyuPicture: {\n if (typeConfig.params?.showAs === 'IMAGE') {\n return { image: { uri: claim.value as string }, testID: testID };\n } else {\n return { testID: testID, value: claim.value as string };\n }\n }\n default:\n return { testID: testID, value: String(claim.value) };\n }\n }\n};\n\nexport type CredentialDetailsCardPropsWithoutWidth = Omit<CredentialDetailsCardProps, 'expanded' | 'card'> & {\n card: Omit<CredentialCardProps, 'width'>;\n};\n\nexport const detailsCardFromCredential = (\n credential: CredentialDetail,\n config: Config,\n testID: string,\n labels: CardLabels,\n): CredentialDetailsCardPropsWithoutWidth => {\n return detailsCardFromCredentialWithClaims(credential, credential.claims, config, testID, labels);\n};\n\nexport const detailsCardFromCredentialWithClaims = (\n credential: CredentialDetail,\n claims: Claim[],\n config: Config,\n testID: string,\n labels: CardLabels,\n): CredentialDetailsCardPropsWithoutWidth => {\n const attributes: CredentialAttribute[] = claims.map((claim, index) =>\n detailsCardAttributeFromClaim(claim, config, concatTestID(testID, 'attribute', index.toString())),\n );\n\n const card = getCredentialCardPropsFromCredential(\n credential,\n claims,\n config,\n undefined,\n concatTestID(testID, 'card'),\n labels,\n );\n\n return {\n attributes,\n card,\n };\n};\n\n// Converts a flat list of attributes into a nested structure\n// modifies the names to not include slashes\nexport const nestAttributes = (attributes: CredentialAttribute[]): CredentialAttribute[] => {\n const result: CredentialAttribute[] = [];\n\n for (const attribute of attributes) {\n const attributePath = attribute.path.split('/');\n if (attributePath.length === 0) {\n result.push(attribute);\n } else {\n const [first, ...rest] = attributePath;\n const parent = result.find((a) => a.name === first);\n if (parent) {\n insertAttributeInParent({ ...attribute, path: rest.join('/') }, parent);\n } else {\n result.push(nestAttributeInDummyParent(attribute));\n }\n }\n }\n\n return result;\n};\n\n// We nest the leaf node in a (one or more) nested object(s)\n// to make sure the tree structure is correctly rendered in proof request screens.\nconst nestAttributeInDummyParent = (attribute: CredentialAttribute): CredentialAttribute => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n if (!rest.length) {\n return attribute;\n }\n\n // The dummy object is not selectable, and contains a placeholder ID\n // the user can't interact with it.\n if (attribute.listValue) {\n return {\n values: [nestAttributeInDummyParent({ ...attribute, path: rest.join('/') })],\n disabled: true,\n id: `${attribute.id}/${first}`,\n name: first,\n path: first,\n };\n } else {\n return {\n attributes: [nestAttributeInDummyParent({ ...attribute, path: rest.join('/') })],\n disabled: true,\n id: `${attribute.id}/${first}`,\n name: first,\n path: first,\n };\n }\n};\n\n// Recursively insert an attribute into an parent\n// Will create nested parents if necessary\nconst insertAttributeInParent = (attribute: CredentialAttribute, parent: CredentialAttribute) => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n\n const nextParent = parent.attributes?.find((a) => a.name === first);\n\n if (!nextParent) {\n if (attribute.listValue) {\n parent.values?.push(nestAttributeInDummyParent(attribute));\n } else {\n parent.attributes?.push(nestAttributeInDummyParent(attribute));\n }\n } else {\n insertAttributeInParent({ ...attribute, path: rest.join('/') }, nextParent);\n }\n};\n\nfunction parseBase64Image(image: string | undefined) {\n return image ? '__BASE64IMAGE__' : '';\n}\n\nexport function getCredentialSchemaWithoutImages(credentialSchema: CredentialSchema) {\n return {\n ...credentialSchema,\n layoutProperties: {\n ...credentialSchema.layoutProperties,\n background: {\n ...credentialSchema.layoutProperties?.background,\n image: parseBase64Image(credentialSchema.layoutProperties?.background?.image),\n },\n logo: {\n ...credentialSchema.layoutProperties?.logo,\n image: parseBase64Image(credentialSchema.layoutProperties?.logo?.image),\n },\n },\n };\n}\n"],"mappings":"AAAA,SAMEA,mBAAmB,EACnBC,YAAY,EACZC,iBAAiB,QACZ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;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["CredentialStateEnum","DataTypeEnum","FormatFeatureEnum","CredentialErrorIcon","CredentialNoticeWarningIcon","CredentialWarningIcon","formatDateLocalized","formatDateTimeLocalized","concatTestID","getCarouselImagesFromClaims","ValidityState","getValidityState","credential","state","REVOKED","Revoked","SUSPENDED","Suspended","Valid","supportsSelectiveDisclosure","config","_formatConfig$capabil","formatConfig","format","schema","Boolean","capabilities","features","includes","SelectiveDisclosure","undefined","findClaimByPath","path","claims","find","claim","formatCredentialDetail","testID","_attributeValue$value","attributeValue","detailsCardAttributeValueFromClaim","value","hasMsoValidityIssues","mdocMsoValidity","mdocMsoValidityIssue","nextUpdate","Date","credentialDetailFromCredential","labels","_formatDateTimeLocali","_credential$issuanceD","layoutProperties","credentialDetailPrimary","suspendEndDate","suspendedUntil","suspended","credentialDetailTestID","statusIcon","revoked","credentialDetailErrorColor","validityIssues","issuanceDate","createdDate","credentialDetailSecondary","primary","primaryAttribute","secondary","secondaryAttribute","cardHeaderFromCredential","_layoutProperties$log","_layoutProperties$log2","_layoutProperties$log3","color","logo","backgroundColor","credentialName","name","icon","image","imageSource","uri","iconLabelColor","fontColor","getCredentialCardPropsFromCredential","notice","_layoutProperties$bac","_layoutProperties$bac2","text","validityIssuesNotice","noticeIcon","result","cardCarouselImages","cardImage","background","header","detailsCardAttributeFromClaim","id","split","pop","typeConfig","datatype","array","values","map","arrayValue","index","toString","type","Object","Array","isArray","attributes","nestedClaim","_formatDateLocalized","String","date","Picture","SwiyuPicture","_typeConfig$params","params","showAs","detailsCardFromCredential","detailsCardFromCredentialWithClaims","card","nestAttributes","attribute","attributePath","length","push","first","rest","parent","a","insertAttributeInParent","join","nestAttributeInDummyParent","pathParts","listValue","disabled","_parent$attributes","nextParent","_parent$values","_parent$attributes2","parseBase64Image","getCredentialSchemaWithoutImages","credentialSchema","_credentialSchema$lay","_credentialSchema$lay2","_credentialSchema$lay3","_credentialSchema$lay4"],"sources":["credential.ts"],"sourcesContent":["import {\n Claim,\n Config,\n CredentialDetail,\n CredentialListItem,\n CredentialSchema,\n CredentialStateEnum,\n DataTypeEnum,\n FormatFeatureEnum,\n} from '@procivis/react-native-one-core';\nimport { FC } from 'react';\nimport { SvgProps } from 'react-native-svg';\n\nimport {\n CredentialAttribute,\n CredentialAttributeValue,\n CredentialCardProps,\n CredentialDetailsCardProps,\n CredentialHeaderProps,\n} from '../../ui-components/credential';\nimport { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';\nimport { CredentialErrorIcon, CredentialNoticeWarningIcon, CredentialWarningIcon } from '../../ui-components/icons';\nimport { formatDateLocalized, formatDateTimeLocalized } from '../date';\nimport { concatTestID } from '../testID';\nimport { getCarouselImagesFromClaims } from './credential-images';\n\nexport enum ValidityState {\n Revoked = 'revoked',\n Suspended = 'suspended',\n Valid = 'valid',\n}\n\nexport const getValidityState = (credential: CredentialListItem | undefined) => {\n if (credential?.state === CredentialStateEnum.REVOKED) {\n return ValidityState.Revoked;\n }\n if (credential?.state === CredentialStateEnum.SUSPENDED) {\n return ValidityState.Suspended;\n }\n return ValidityState.Valid;\n};\n\nexport const supportsSelectiveDisclosure = (credential: CredentialListItem | undefined, config: Config | undefined) => {\n const formatConfig = credential && config?.format[credential.schema.format];\n return formatConfig\n ? Boolean(formatConfig.capabilities?.features?.includes(FormatFeatureEnum.SelectiveDisclosure))\n : undefined;\n};\n\nexport const findClaimByPath = (path: string | undefined, claims: Claim[] | undefined) =>\n path ? claims?.find((claim) => claim.path === path) : undefined;\n\nconst formatCredentialDetail = (claim: Claim, config: Config, testID: string): string => {\n const attributeValue = detailsCardAttributeValueFromClaim(claim, config, testID);\n return attributeValue.value ?? '';\n};\n\nexport const hasMsoValidityIssues = (credential: CredentialDetail): boolean => {\n const mdocMsoValidity: { nextUpdate: string } | undefined =\n 'mdocMsoValidity' in credential ? (credential.mdocMsoValidity as { nextUpdate: string }) : undefined;\n\n const mdocMsoValidityIssue = Boolean(\n mdocMsoValidity?.nextUpdate && new Date(mdocMsoValidity.nextUpdate) < new Date(),\n );\n\n return mdocMsoValidityIssue;\n};\n\nexport type CardHeaderLabels = {\n validityIssues: string;\n revoked: string;\n suspended: string;\n suspendedUntil: (date: string) => string;\n};\n\nconst credentialDetailFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n testID: string,\n labels: CardHeaderLabels,\n): {\n credentialDetailPrimary?: string;\n credentialDetailSecondary?: string;\n credentialDetailErrorColor?: boolean;\n credentialDetailTestID?: string;\n statusIcon?: FC<SvgProps>;\n} => {\n const { layoutProperties } = credential.schema;\n\n switch (credential.state) {\n case CredentialStateEnum.SUSPENDED:\n return {\n credentialDetailPrimary: credential.suspendEndDate\n ? labels.suspendedUntil(formatDateTimeLocalized(new Date(credential.suspendEndDate))!)\n : labels.suspended,\n credentialDetailTestID: concatTestID(testID, 'suspended'),\n statusIcon: CredentialWarningIcon,\n };\n case CredentialStateEnum.REVOKED:\n return {\n credentialDetailPrimary: labels.revoked,\n credentialDetailErrorColor: true,\n credentialDetailTestID: concatTestID(testID, 'revoked'),\n statusIcon: CredentialErrorIcon,\n };\n }\n\n if (hasMsoValidityIssues(credential)) {\n return {\n credentialDetailPrimary: labels.validityIssues,\n credentialDetailTestID: concatTestID(testID, 'validity-issue'),\n statusIcon: CredentialWarningIcon,\n };\n }\n\n let credentialDetailPrimary =\n formatDateTimeLocalized(new Date(credential.issuanceDate ?? credential.createdDate)) ?? '';\n let credentialDetailSecondary: string | undefined;\n\n const primary = findClaimByPath(layoutProperties?.primaryAttribute, claims);\n\n if (primary) {\n credentialDetailPrimary = formatCredentialDetail(primary, config, concatTestID(testID, 'primary'));\n }\n\n const secondary = findClaimByPath(layoutProperties?.secondaryAttribute, claims);\n\n if (secondary) {\n credentialDetailSecondary = formatCredentialDetail(secondary, config, concatTestID(testID, 'secondary'));\n }\n\n return {\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailTestID: concatTestID(testID, 'detail'),\n };\n};\n\nexport const cardHeaderFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n testID: string,\n labels: CardHeaderLabels,\n): Omit<CredentialHeaderProps, 'style'> => {\n const {\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailErrorColor,\n credentialDetailTestID,\n statusIcon,\n } = credentialDetailFromCredential(credential, claims, config, testID, labels);\n const { layoutProperties } = credential.schema;\n\n return {\n color: layoutProperties?.logo?.backgroundColor,\n credentialDetailErrorColor,\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailTestID,\n credentialName: credential.schema.name,\n icon: layoutProperties?.logo?.image\n ? {\n imageSource: {\n uri: layoutProperties.logo.image,\n },\n }\n : undefined,\n iconLabelColor: layoutProperties?.logo?.fontColor,\n statusIcon,\n testID,\n };\n};\n\nexport type CardLabels = CardHeaderLabels & {\n validityIssuesNotice: string;\n};\n\nexport const getCredentialCardPropsFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'> => {\n const { layoutProperties } = credential.schema;\n\n if (hasMsoValidityIssues(credential)) {\n notice = {\n text: labels.validityIssuesNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n };\n }\n\n const result: Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'> = {\n cardCarouselImages: getCarouselImagesFromClaims(claims, layoutProperties, concatTestID(testID, 'carousel')),\n cardImage: layoutProperties?.background?.image\n ? { imageSource: { uri: layoutProperties.background.image } }\n : undefined,\n color: layoutProperties?.background?.color,\n header: cardHeaderFromCredential(credential, claims, config, concatTestID(testID, 'header'), labels),\n testID,\n notice,\n };\n\n return result;\n};\n\nexport const detailsCardAttributeFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttribute => {\n const value = detailsCardAttributeValueFromClaim(claim, config, testID);\n return {\n id: claim.path,\n name: claim.path.split('/').pop(),\n path: claim.path,\n ...value,\n };\n};\n\nconst detailsCardAttributeValueFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttributeValue => {\n const typeConfig = config?.datatype[claim.schema.datatype];\n\n if (claim.schema.array) {\n return {\n values: ((claim.value as Claim[]) || []).map((arrayValue, index) => {\n return detailsCardAttributeFromClaim(arrayValue, config, concatTestID(testID, index.toString()));\n }),\n };\n } else {\n switch (typeConfig?.type) {\n case DataTypeEnum.Object: {\n if (!Array.isArray(claim.value)) {\n return { attributes: [] };\n }\n return {\n attributes: (claim.value as Claim[]).map((nestedClaim, index) =>\n detailsCardAttributeFromClaim(nestedClaim, config, concatTestID(testID, index.toString())),\n ),\n };\n }\n case DataTypeEnum.Date: {\n if (!claim.value) {\n // Don't try to parse empty values (which will return \"Invalid Date\")\n return { testID: testID, value: String(claim.value) };\n }\n const date = claim.value as string;\n return {\n testID: testID,\n value: formatDateLocalized(new Date(date)) ?? date,\n };\n }\n case DataTypeEnum.Picture: // fallback\n case DataTypeEnum.SwiyuPicture: {\n if (typeConfig.params?.showAs === 'IMAGE') {\n return { image: { uri: claim.value as string }, testID: testID };\n } else {\n return { testID: testID, value: claim.value as string };\n }\n }\n default:\n return { testID: testID, value: String(claim.value) };\n }\n }\n};\n\nexport type CredentialDetailsCardPropsWithoutWidth = Omit<CredentialDetailsCardProps, 'expanded' | 'card'> & {\n card: Omit<CredentialCardProps, 'width'>;\n};\n\nexport const detailsCardFromCredential = (\n credential: CredentialDetail,\n config: Config,\n testID: string,\n labels: CardLabels,\n): CredentialDetailsCardPropsWithoutWidth => {\n return detailsCardFromCredentialWithClaims(credential, credential.claims, config, testID, labels);\n};\n\nexport const detailsCardFromCredentialWithClaims = (\n credential: CredentialDetail,\n claims: Claim[],\n config: Config,\n testID: string,\n labels: CardLabels,\n): CredentialDetailsCardPropsWithoutWidth => {\n const attributes: CredentialAttribute[] = claims.map((claim, index) =>\n detailsCardAttributeFromClaim(claim, config, concatTestID(testID, 'attribute', index.toString())),\n );\n\n const card = getCredentialCardPropsFromCredential(\n credential,\n claims,\n config,\n undefined,\n concatTestID(testID, 'card'),\n labels,\n );\n\n return {\n attributes,\n card,\n };\n};\n\n// Converts a flat list of attributes into a nested structure\n// modifies the names to not include slashes\nexport const nestAttributes = (attributes: CredentialAttribute[]): CredentialAttribute[] => {\n const result: CredentialAttribute[] = [];\n\n for (const attribute of attributes) {\n const attributePath = attribute.path.split('/');\n if (attributePath.length === 0) {\n result.push(attribute);\n } else {\n const [first, ...rest] = attributePath;\n const parent = result.find((a) => a.name === first);\n if (parent) {\n insertAttributeInParent({ ...attribute, path: rest.join('/') }, parent);\n } else {\n result.push(nestAttributeInDummyParent(attribute));\n }\n }\n }\n\n return result;\n};\n\n// We nest the leaf node in a (one or more) nested object(s)\n// to make sure the tree structure is correctly rendered in proof request screens.\nconst nestAttributeInDummyParent = (attribute: CredentialAttribute): CredentialAttribute => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n if (!rest.length) {\n return attribute;\n }\n\n // The dummy object is not selectable, and contains a placeholder ID\n // the user can't interact with it.\n if (attribute.listValue) {\n return {\n values: [nestAttributeInDummyParent({ ...attribute, path: rest.join('/') })],\n disabled: true,\n id: `${attribute.id}/${first}`,\n name: first,\n path: first,\n };\n } else {\n return {\n attributes: [nestAttributeInDummyParent({ ...attribute, path: rest.join('/') })],\n disabled: true,\n id: `${attribute.id}/${first}`,\n name: first,\n path: first,\n };\n }\n};\n\n// Recursively insert an attribute into an parent\n// Will create nested parents if necessary\nconst insertAttributeInParent = (attribute: CredentialAttribute, parent: CredentialAttribute) => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n\n const nextParent = parent.attributes?.find((a) => a.name === first);\n\n if (!nextParent) {\n if (attribute.listValue) {\n parent.values?.push(nestAttributeInDummyParent(attribute));\n } else {\n parent.attributes?.push(nestAttributeInDummyParent(attribute));\n }\n } else {\n insertAttributeInParent({ ...attribute, path: rest.join('/') }, nextParent);\n }\n};\n\nfunction parseBase64Image(image: string | undefined) {\n return image ? '__BASE64IMAGE__' : '';\n}\n\nexport function getCredentialSchemaWithoutImages(credentialSchema: CredentialSchema) {\n return {\n ...credentialSchema,\n layoutProperties: {\n ...credentialSchema.layoutProperties,\n background: {\n ...credentialSchema.layoutProperties?.background,\n image: parseBase64Image(credentialSchema.layoutProperties?.background?.image),\n },\n logo: {\n ...credentialSchema.layoutProperties?.logo,\n image: parseBase64Image(credentialSchema.layoutProperties?.logo?.image),\n },\n },\n };\n}\n"],"mappings":"AAAA,SAMEA,mBAAmB,EACnBC,YAAY,EACZC,iBAAiB,QACZ,iCAAiC;AAYxC,SAASC,mBAAmB,EAAEC,2BAA2B,EAAEC,qBAAqB,QAAQ,2BAA2B;AACnH,SAASC,mBAAmB,EAAEC,uBAAuB,QAAQ,SAAS;AACtE,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,2BAA2B,QAAQ,qBAAqB;AAEjE,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAMzB,OAAO,MAAMC,gBAAgB,GAAIC,UAA0C,IAAK;EAC9E,IAAI,CAAAA,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,KAAK,MAAKb,mBAAmB,CAACc,OAAO,EAAE;IACrD,OAAOJ,aAAa,CAACK,OAAO;EAC9B;EACA,IAAI,CAAAH,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,KAAK,MAAKb,mBAAmB,CAACgB,SAAS,EAAE;IACvD,OAAON,aAAa,CAACO,SAAS;EAChC;EACA,OAAOP,aAAa,CAACQ,KAAK;AAC5B,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAGA,CAACP,UAA0C,EAAEQ,MAA0B,KAAK;EAAA,IAAAC,qBAAA;EACrH,MAAMC,YAAY,GAAGV,UAAU,KAAIQ,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEG,MAAM,CAACX,UA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I,IAAI,CAAC,GAAG;IAAE,CAAC,EAAEM,UAAU,CAAC;EAC7E;AACF,CAAC;AAED,SAASG,gBAAgBA,CAACjE,KAAyB,EAAE;EACnD,OAAOA,KAAK,GAAG,iBAAiB,GAAG,EAAE;AACvC;AAEA,OAAO,SAASkE,gCAAgCA,CAACC,gBAAkC,EAAE;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA;EACnF,OAAO;IACL,GAAGJ,gBAAgB;IACnB9F,gBAAgB,EAAE;MAChB,GAAG8F,gBAAgB,CAAC9F,gBAAgB;MACpC0C,UAAU,EAAE;QACV,KAAAqD,qBAAA,GAAGD,gBAAgB,CAAC9F,gBAAgB,cAAA+F,qBAAA,uBAAjCA,qBAAA,CAAmCrD,UAAU;QAChDf,KAAK,EAAEiE,gBAAgB,EAAAI,sBAAA,GAACF,gBAAgB,CAAC9F,gBAAgB,cAAAgG,sBAAA,gBAAAA,sBAAA,GAAjCA,sBAAA,CAAmCtD,UAAU,cAAAsD,sBAAA,uBAA7CA,sBAAA,CAA+CrE,KAAK;MAC9E,CAAC;MACDL,IAAI,EAAE;QACJ,KAAA2E,sBAAA,GAAGH,gBAAgB,CAAC9F,gBAAgB,cAAAiG,sBAAA,uBAAjCA,sBAAA,CAAmC3E,IAAI;QAC1CK,KAAK,EAAEiE,gBAAgB,EAAAM,sBAAA,GAACJ,gBAAgB,CAAC9F,gBAAgB,cAAAkG,sBAAA,gBAAAA,sBAAA,GAAjCA,sBAAA,CAAmC5E,IAAI,cAAA4E,sBAAA,uBAAvCA,sBAAA,CAAyCvE,KAAK;MACxE;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ export const getQueryKeyFromCredentialListQueryParams = (queryParams = {}) => {
|
|
|
8
8
|
return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', 'name', 'searchText', 'searchType', 'sort', 'sortDirection', 'exact', 'roles', 'ids', 'states', 'include', 'profiles', 'credentialSchemaIds', 'createdDateAfter', 'createdDateBefore', 'lastModifiedAfter', 'lastModifiedBefore', 'issuanceDateAfter', 'issuanceDateBefore', 'revocationDateAfter', 'revocationDateBefore']);
|
|
9
9
|
};
|
|
10
10
|
export const getQueryKeyFromHistoryListQueryParams = (queryParams = {}) => {
|
|
11
|
-
return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', '
|
|
11
|
+
return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', 'entityIds', 'actions', 'entityTypes', 'createdDateAfter', 'createdDateBefore', 'identifierId', 'credentialId', 'credentialSchemaId', 'proofSchemaId', 'search', 'users']);
|
|
12
12
|
};
|
|
13
13
|
export const getQueryKeyFromCredentialSchemaListQueryParams = (queryParams = {}) => {
|
|
14
14
|
return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', 'name', 'sort', 'sortDirection', 'exact', 'ids', 'include', 'schemaId', 'formats', 'createdDateAfter', 'createdDateBefore', 'lastModifiedAfter', 'lastModifiedBefore']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getQueryKey","queryParams","params","map","param","getQueryKeyFromCredentialListQueryParams","getQueryKeyFromHistoryListQueryParams","getQueryKeyFromCredentialSchemaListQueryParams","getQueryKeyFromProofSchemaListQueryParams","getQueryKeyFromProofListQueryParams","getQueryKeyFromDidListQueryParams","getQueryKeyFromIdentifierListQueryParams"],"sources":["query.ts"],"sourcesContent":["import {\n CredentialListQuery,\n CredentialSchemaListQuery,\n DidListQuery,\n HistoryListQuery,\n IdentifierListQuery,\n ProofListQuery,\n ProofSchemaListQuery,\n} from '@procivis/react-native-one-core';\n\ntype QueryKey<ListQuery, ParamList> = ParamList extends ReadonlyArray<keyof ListQuery> // all params are inside the ListQuery\n ? keyof ListQuery extends ParamList[number] // all ListQuery fields are in the params\n ? Array<ListQuery[keyof ListQuery]>\n : void\n : void; // otherwise produce a wrong return type which should trigger compilation error\n\n/** Typecheck that all query params are included in the query key */\nfunction getQueryKey<ListQuery extends {}, ParamList extends ReadonlyArray<keyof ListQuery>>(\n queryParams: ListQuery,\n params: ParamList,\n): QueryKey<ListQuery, ParamList> {\n return params.map((param) => queryParams[param]) as QueryKey<ListQuery, ParamList>;\n}\n\nexport const getQueryKeyFromCredentialListQueryParams = (queryParams: Partial<CredentialListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'searchText',\n 'searchType',\n 'sort',\n 'sortDirection',\n 'exact',\n 'roles',\n 'ids',\n 'states',\n 'include',\n 'profiles',\n 'credentialSchemaIds',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n 'issuanceDateAfter',\n 'issuanceDateBefore',\n 'revocationDateAfter',\n 'revocationDateBefore',\n ]);\n};\n\nexport const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<HistoryListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n '
|
|
1
|
+
{"version":3,"names":["getQueryKey","queryParams","params","map","param","getQueryKeyFromCredentialListQueryParams","getQueryKeyFromHistoryListQueryParams","getQueryKeyFromCredentialSchemaListQueryParams","getQueryKeyFromProofSchemaListQueryParams","getQueryKeyFromProofListQueryParams","getQueryKeyFromDidListQueryParams","getQueryKeyFromIdentifierListQueryParams"],"sources":["query.ts"],"sourcesContent":["import {\n CredentialListQuery,\n CredentialSchemaListQuery,\n DidListQuery,\n HistoryListQuery,\n IdentifierListQuery,\n ProofListQuery,\n ProofSchemaListQuery,\n} from '@procivis/react-native-one-core';\n\ntype QueryKey<ListQuery, ParamList> = ParamList extends ReadonlyArray<keyof ListQuery> // all params are inside the ListQuery\n ? keyof ListQuery extends ParamList[number] // all ListQuery fields are in the params\n ? Array<ListQuery[keyof ListQuery]>\n : void\n : void; // otherwise produce a wrong return type which should trigger compilation error\n\n/** Typecheck that all query params are included in the query key */\nfunction getQueryKey<ListQuery extends {}, ParamList extends ReadonlyArray<keyof ListQuery>>(\n queryParams: ListQuery,\n params: ParamList,\n): QueryKey<ListQuery, ParamList> {\n return params.map((param) => queryParams[param]) as QueryKey<ListQuery, ParamList>;\n}\n\nexport const getQueryKeyFromCredentialListQueryParams = (queryParams: Partial<CredentialListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'searchText',\n 'searchType',\n 'sort',\n 'sortDirection',\n 'exact',\n 'roles',\n 'ids',\n 'states',\n 'include',\n 'profiles',\n 'credentialSchemaIds',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n 'issuanceDateAfter',\n 'issuanceDateBefore',\n 'revocationDateAfter',\n 'revocationDateBefore',\n ]);\n};\n\nexport const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<HistoryListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'entityIds',\n 'actions',\n 'entityTypes',\n 'createdDateAfter',\n 'createdDateBefore',\n 'identifierId',\n 'credentialId',\n 'credentialSchemaId',\n 'proofSchemaId',\n 'search',\n 'users',\n ]);\n};\n\nexport const getQueryKeyFromCredentialSchemaListQueryParams = (\n queryParams: Partial<CredentialSchemaListQuery> = {},\n) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'sort',\n 'sortDirection',\n 'exact',\n 'ids',\n 'include',\n 'schemaId',\n 'formats',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n\nexport const getQueryKeyFromProofSchemaListQueryParams = (queryParams: Partial<ProofSchemaListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'sort',\n 'sortDirection',\n 'exact',\n 'ids',\n 'formats',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n\nexport const getQueryKeyFromProofListQueryParams = (queryParams: Partial<ProofListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'ids',\n 'proofStates',\n 'proofRoles',\n 'proofSchemaIds',\n 'exact',\n 'profiles',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n 'requestedDateAfter',\n 'requestedDateBefore',\n 'completedDateAfter',\n 'completedDateBefore',\n ]);\n};\n\nexport const getQueryKeyFromDidListQueryParams = (queryParams: Partial<DidListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'did',\n 'type',\n 'deactivated',\n 'exact',\n 'keyAlgorithms',\n 'keyRoles',\n 'keyStorages',\n 'keyIds',\n 'didMethods',\n ]);\n};\n\nexport const getQueryKeyFromIdentifierListQueryParams = (queryParams: Partial<IdentifierListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'types',\n 'states',\n 'exact',\n 'didMethods',\n 'isRemote',\n 'keyAlgorithms',\n 'keyRoles',\n 'keyStorages',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n"],"mappings":"AAcU;;AAEV;AACA,SAASA,WAAWA,CAClBC,WAAsB,EACtBC,MAAiB,EACe;EAChC,OAAOA,MAAM,CAACC,GAAG,CAAEC,KAAK,IAAKH,WAAW,CAACG,KAAK,CAAC,CAAC;AAClD;AAEA,OAAO,MAAMC,wCAAwC,GAAGA,CAACJ,WAAyC,GAAG,CAAC,CAAC,KAAK;EAC1G,OAAOD,WAAW,CAACC,WAAW,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,eAA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W,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,eAAe,EACf,MAAM,EACN,KAAK,EACL,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,CACtB,CAAC;AACJ,CAAC;AAED,OAAO,MAAMS,iCAAiC,GAAGA,CAACT,WAAkC,GAAG,CAAC,CAAC,KAAK;EAC5F,OAAOD,WAAW,CAACC,WAAW,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,eAAe,EACf,MAAM,EACN,KAAK,EACL,MAAM,EACN,aAAa,EACb,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,QAAQ,EACR,YAAY,CACb,CAAC;AACJ,CAAC;AAED,OAAO,MAAMU,wCAAwC,GAAGA,CAACV,WAAyC,GAAG,CAAC,CAAC,KAAK;EAC1G,OAAOD,WAAW,CAACC,WAAW,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,eAAe,EACf,MAAM,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,UAAU,EACV,eAAe,EACf,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,CACrB,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -42,6 +42,27 @@ export declare const defaultLanguageFiles: {
|
|
|
42
42
|
"accessibility.key.faceId": string;
|
|
43
43
|
"accessibility.key.fingerprint": string;
|
|
44
44
|
};
|
|
45
|
+
fi: {
|
|
46
|
+
"accessibility.control.combobox.expanded": string;
|
|
47
|
+
"accessibility.control.combobox.tapToSelect": string;
|
|
48
|
+
"accessibility.control.order": string;
|
|
49
|
+
"accessibility.control.progress": string;
|
|
50
|
+
"accessibility.control.checked": string;
|
|
51
|
+
"accessibility.control.unchecked": string;
|
|
52
|
+
"accessibility.control.clear": string;
|
|
53
|
+
"accessibility.control.delete": string;
|
|
54
|
+
"accessibility.control.list.moveDown": string;
|
|
55
|
+
"accessibility.control.list.moveUp": string;
|
|
56
|
+
"accessibility.nav.back": string;
|
|
57
|
+
"accessibility.nav.close": string;
|
|
58
|
+
"accessibility.nav.next": string;
|
|
59
|
+
"accessibility.icon.edit": string;
|
|
60
|
+
"accessibility.icon.add": string;
|
|
61
|
+
"accessibility.icon.filter": string;
|
|
62
|
+
"accessibility.icon.scan": string;
|
|
63
|
+
"accessibility.key.faceId": string;
|
|
64
|
+
"accessibility.key.fingerprint": string;
|
|
65
|
+
};
|
|
45
66
|
fr: {
|
|
46
67
|
"accessibility.control.combobox.expanded": string;
|
|
47
68
|
"accessibility.control.combobox.tapToSelect": string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryListItem } from '@procivis/react-native-one-core';
|
|
2
2
|
import { Moment } from 'moment';
|
|
3
3
|
export interface HistoryGroupByDaySection {
|
|
4
4
|
data: HistoryListItem[];
|
|
@@ -6,5 +6,3 @@ export interface HistoryGroupByDaySection {
|
|
|
6
6
|
firstYearEntry: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare const groupEntriesByDay: (entries: HistoryListItem[]) => HistoryGroupByDaySection[];
|
|
9
|
-
export declare const claimValueFromProofInputClaim: ({ schema, value }: ProofInputClaim) => ClaimValue | undefined;
|
|
10
|
-
export declare const claimFromProofInputClaim: (input: ProofInputClaim) => Claim | undefined;
|
|
@@ -5,7 +5,6 @@ import { CardLabels, CredentialDetailsCardPropsWithoutWidth } from './credential
|
|
|
5
5
|
export declare const validityCheckedCardFromCredential: (credential: CredentialDetail, invalidLVVC: boolean, expanded: boolean, multipleCredentialsAvailable: boolean, config: Config, notice: CredentialCardNotice | undefined, testID: string, labels: ShareCredentialCardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'testID' | 'width'>;
|
|
6
6
|
export declare const missingCredentialCardFromRequest: (request: PresentationDefinitionRequestedCredential, notice: CredentialCardNotice | undefined, testID: string, labels: ShareCredentialCardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'>;
|
|
7
7
|
type FlatClaim = Claim & {
|
|
8
|
-
path: string;
|
|
9
8
|
isArrayElement?: boolean;
|
|
10
9
|
};
|
|
11
10
|
export declare const shareCredentialCardAttributeFromClaim: (id: string, config: Config, testID: string, labels: ShareCredentialCardLabels, claim?: FlatClaim, field?: PresentationDefinitionField) => CredentialAttribute;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Claim, Config, CredentialDetail, CredentialListItem, CredentialSchema
|
|
1
|
+
import { Claim, Config, CredentialDetail, CredentialListItem, CredentialSchema } from '@procivis/react-native-one-core';
|
|
2
2
|
import { CredentialAttribute, CredentialCardProps, CredentialDetailsCardProps, CredentialHeaderProps } from '../../ui-components/credential';
|
|
3
3
|
import { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';
|
|
4
4
|
export declare enum ValidityState {
|
|
@@ -8,28 +8,7 @@ export declare enum ValidityState {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const getValidityState: (credential: CredentialListItem | undefined) => ValidityState;
|
|
10
10
|
export declare const supportsSelectiveDisclosure: (credential: CredentialListItem | undefined, config: Config | undefined) => boolean | undefined;
|
|
11
|
-
export declare const findClaimByPath: (path: string | undefined, claims: Claim[] | undefined) =>
|
|
12
|
-
dataType: DataTypeEnum.Object;
|
|
13
|
-
value: Claim[];
|
|
14
|
-
array: false;
|
|
15
|
-
} & {
|
|
16
|
-
id: string;
|
|
17
|
-
key: string;
|
|
18
|
-
}) | ({
|
|
19
|
-
dataType: string;
|
|
20
|
-
value: string | number | boolean;
|
|
21
|
-
array: false;
|
|
22
|
-
} & {
|
|
23
|
-
id: string;
|
|
24
|
-
key: string;
|
|
25
|
-
}) | ({
|
|
26
|
-
dataType: string;
|
|
27
|
-
value: Claim[];
|
|
28
|
-
array: true;
|
|
29
|
-
} & {
|
|
30
|
-
id: string;
|
|
31
|
-
key: string;
|
|
32
|
-
}) | undefined;
|
|
11
|
+
export declare const findClaimByPath: (path: string | undefined, claims: Claim[] | undefined) => Claim | undefined;
|
|
33
12
|
export declare const hasMsoValidityIssues: (credential: CredentialDetail) => boolean;
|
|
34
13
|
export type CardHeaderLabels = {
|
|
35
14
|
validityIssues: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CredentialListQuery, CredentialSchemaListQuery, DidListQuery, HistoryListQuery, IdentifierListQuery, ProofListQuery, ProofSchemaListQuery } from '@procivis/react-native-one-core';
|
|
2
2
|
export declare const getQueryKeyFromCredentialListQueryParams: (queryParams?: Partial<CredentialListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").CredentialListQueryExactColumnEnum[] | import("@procivis/react-native-one-core").CredentialRoleEnum[] | import("@procivis/react-native-one-core").CredentialStateEnum[] | import("@procivis/react-native-one-core").CredentialListIncludeEntityType[] | import("@procivis/react-native-one-core").CredentialListSearchType[] | undefined)[];
|
|
3
|
-
export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<HistoryListQuery>) => (string | number | import("@procivis/react-native-one-core").HistoryListSearch | import("@procivis/react-native-one-core").HistoryActionEnum[] | import("@procivis/react-native-one-core").HistoryEntityTypeEnum[] | undefined)[];
|
|
3
|
+
export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<HistoryListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").HistoryListSearch | import("@procivis/react-native-one-core").HistoryActionEnum[] | import("@procivis/react-native-one-core").HistoryEntityTypeEnum[] | undefined)[];
|
|
4
4
|
export declare const getQueryKeyFromCredentialSchemaListQueryParams: (queryParams?: Partial<CredentialSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactCredentialSchemaFilterColumnEnum[] | import("@procivis/react-native-one-core").CredentialSchemaListIncludeEntityType[] | undefined)[];
|
|
5
5
|
export declare const getQueryKeyFromProofSchemaListQueryParams: (queryParams?: Partial<ProofSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactProofSchemaFilterColumnEnum[] | undefined)[];
|
|
6
6
|
export declare const getQueryKeyFromProofListQueryParams: (queryParams?: Partial<ProofListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactProofFilterColumnEnum[] | import("@procivis/react-native-one-core").ProofStateEnum[] | import("@procivis/react-native-one-core").ProofRoleEnum[] | undefined)[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procivis/one-react-native-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.95",
|
|
4
4
|
"author": "Procivis AG (https://procivis.ch)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Common Procivis ONE UI components for react-native",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@babel/runtime": "^7.25.0",
|
|
52
52
|
"@commitlint/config-conventional": "^11.0.0",
|
|
53
53
|
"@gorhom/bottom-sheet": "^5.1.2",
|
|
54
|
-
"@procivis/react-native-one-core": "1.
|
|
54
|
+
"@procivis/react-native-one-core": "1.75508.0",
|
|
55
55
|
"@procivis/react-native-picker": "5.0.3",
|
|
56
56
|
"@react-native-async-storage/async-storage": "^1.17.3",
|
|
57
57
|
"@react-native-community/blur": "^4.4.0",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"vite": "^6.2.2"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
143
|
-
"@procivis/react-native-one-core": "^1.
|
|
143
|
+
"@procivis/react-native-one-core": "^1.75508.0",
|
|
144
144
|
"@procivis/react-native-picker": "*",
|
|
145
145
|
"@react-native-community/blur": "*",
|
|
146
146
|
"@react-native-community/netinfo": "^11.4.1",
|
|
@@ -54,6 +54,8 @@ const defaultIcons: {
|
|
|
54
54
|
REACTIVATED: HistoryStatusAcceptedIcon,
|
|
55
55
|
CSR_GENERATED: HistoryStatusAcceptedIcon,
|
|
56
56
|
EXPIRED: HistoryStatusErrorIcon,
|
|
57
|
+
INTERACTION_CREATED: HistoryStatusAcceptedIcon,
|
|
58
|
+
INTERACTION_ERRORED: HistoryStatusErrorIcon,
|
|
57
59
|
},
|
|
58
60
|
entityTypes: {
|
|
59
61
|
BACKUP: HistoryRevokeIcon,
|
|
@@ -69,7 +71,13 @@ const defaultIcons: {
|
|
|
69
71
|
TRUST_ANCHOR: HistoryTrustAnchorIcon,
|
|
70
72
|
TRUST_ENTITY: HistoryTrustedEntityIcon,
|
|
71
73
|
WALLET_UNIT: HistoryTrustedEntityIcon,
|
|
72
|
-
|
|
74
|
+
WALLET_RELYING_PARTY: HistoryTrustedEntityIcon,
|
|
75
|
+
USER: HistoryIdentifierIcon,
|
|
76
|
+
PROVIDER: HistoryIdentifierIcon,
|
|
77
|
+
STS_ROLE: HistoryIdentifierIcon,
|
|
78
|
+
STS_ORGANISATION: HistoryOrganisationIcon,
|
|
79
|
+
STS_IAM_ROLE: HistoryIdentifierIcon,
|
|
80
|
+
STS_TOKEN: HistoryKeyIcon,
|
|
73
81
|
},
|
|
74
82
|
};
|
|
75
83
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"accessibility.control.combobox.expanded": "Laajennettu",
|
|
3
|
+
"accessibility.control.combobox.tapToSelect": "Kaksoisnapauta valitaksesi",
|
|
4
|
+
"accessibility.control.order": "{current} / {length}",
|
|
5
|
+
"accessibility.control.progress": "{current} / {length}",
|
|
6
|
+
"accessibility.control.checked": "valittu",
|
|
7
|
+
"accessibility.control.unchecked": "ei valittu",
|
|
8
|
+
"accessibility.control.clear": "tyhjennä",
|
|
9
|
+
"accessibility.control.delete": "poista",
|
|
10
|
+
"accessibility.control.list.moveDown": "Siirrä alas",
|
|
11
|
+
"accessibility.control.list.moveUp": "Siirrä ylös",
|
|
12
|
+
"accessibility.nav.back": "takaisin",
|
|
13
|
+
"accessibility.nav.close": "sulje",
|
|
14
|
+
"accessibility.nav.next": "seuraava",
|
|
15
|
+
"accessibility.icon.edit": "muokkaa",
|
|
16
|
+
"accessibility.icon.add": "lisää",
|
|
17
|
+
"accessibility.icon.filter": "suodata",
|
|
18
|
+
"accessibility.icon.scan": "skannaa",
|
|
19
|
+
"accessibility.key.faceId": "faceId",
|
|
20
|
+
"accessibility.key.fingerprint": "sormenjälki"
|
|
21
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import de from './de.json';
|
|
2
2
|
import en from './en.json';
|
|
3
|
+
import fi from './fi.json';
|
|
3
4
|
import fr from './fr.json';
|
|
4
5
|
import it from './it.json';
|
|
5
6
|
|
|
6
|
-
export const defaultLanguageFiles = { en, de, fr, it };
|
|
7
|
+
export const defaultLanguageFiles = { en, de, fi, fr, it };
|
|
7
8
|
|
|
8
9
|
export type SupportedAccessibilityLanguage = keyof typeof defaultLanguageFiles;
|
|
9
10
|
export type AccessibilityLanguageFile = typeof en;
|
package/src/utils/history.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryListItem } from '@procivis/react-native-one-core';
|
|
2
2
|
import moment, { Moment } from 'moment';
|
|
3
3
|
|
|
4
|
-
import { nonEmptyFilter } from './filtering';
|
|
5
|
-
|
|
6
4
|
export interface HistoryGroupByDaySection {
|
|
7
5
|
data: HistoryListItem[];
|
|
8
6
|
date: Moment;
|
|
@@ -30,42 +28,3 @@ export const groupEntriesByDay = (entries: HistoryListItem[]) => {
|
|
|
30
28
|
return item;
|
|
31
29
|
});
|
|
32
30
|
};
|
|
33
|
-
|
|
34
|
-
export const claimValueFromProofInputClaim = ({ schema, value }: ProofInputClaim): ClaimValue | undefined => {
|
|
35
|
-
if (!value) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (Array.isArray(value)) {
|
|
40
|
-
const values = value.map(claimFromProofInputClaim).filter(nonEmptyFilter);
|
|
41
|
-
return schema.dataType === (DataTypeEnum.Object as string)
|
|
42
|
-
? {
|
|
43
|
-
array: schema.array,
|
|
44
|
-
dataType: DataTypeEnum.Object,
|
|
45
|
-
value: values,
|
|
46
|
-
}
|
|
47
|
-
: {
|
|
48
|
-
array: true,
|
|
49
|
-
dataType: schema.dataType,
|
|
50
|
-
value: values,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
array: false,
|
|
56
|
-
dataType: schema.dataType,
|
|
57
|
-
value,
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const claimFromProofInputClaim = (input: ProofInputClaim): Claim | undefined => {
|
|
62
|
-
const value = claimValueFromProofInputClaim(input);
|
|
63
|
-
if (!value) {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
...value,
|
|
68
|
-
id: input.schema.id,
|
|
69
|
-
key: input.schema.key,
|
|
70
|
-
};
|
|
71
|
-
};
|
|
@@ -58,7 +58,7 @@ export const useProofState = (proofId: string | undefined, isPolling: boolean) =
|
|
|
58
58
|
organisationId,
|
|
59
59
|
page: 0,
|
|
60
60
|
pageSize: 1,
|
|
61
|
-
|
|
61
|
+
entityIds: [proofId],
|
|
62
62
|
entityTypes: [HistoryEntityTypeEnum.PROOF],
|
|
63
63
|
actions: [HistoryActionEnum.ERRORED],
|
|
64
64
|
})
|
|
@@ -290,7 +290,7 @@ export const useProofForSchemaIdWithTransport = (
|
|
|
290
290
|
setProofId(undefined);
|
|
291
291
|
setDeleting(false);
|
|
292
292
|
})
|
|
293
|
-
.catch(() => {
|
|
293
|
+
.catch(() => {});
|
|
294
294
|
}, [proofIdRef, deleteProof, proofSchemaId, transport, setProofId]);
|
|
295
295
|
|
|
296
296
|
useEffect(() => {
|
|
@@ -307,7 +307,7 @@ export const useProofForSchemaIdWithTransport = (
|
|
|
307
307
|
setProofId(undefined);
|
|
308
308
|
setDeleting(false);
|
|
309
309
|
})
|
|
310
|
-
.catch(() => {
|
|
310
|
+
.catch(() => {});
|
|
311
311
|
}
|
|
312
312
|
}, [deleteProof, enabled, proofId, proofState, setProofId]);
|
|
313
313
|
|
|
@@ -334,7 +334,7 @@ export const useProofForSchemaIdWithTransport = (
|
|
|
334
334
|
.then((id) => {
|
|
335
335
|
setProofId(id);
|
|
336
336
|
})
|
|
337
|
-
.catch(() => {
|
|
337
|
+
.catch(() => {});
|
|
338
338
|
}, [proofSchemaId, identifiers, identifierFilter, createProof, enabled, transport, proofId, setProofId, deleting]);
|
|
339
339
|
|
|
340
340
|
return deleting ? undefined : proofId;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Claim,
|
|
3
|
+
ClaimValue,
|
|
3
4
|
Config,
|
|
4
|
-
DataTypeEnum,
|
|
5
5
|
FailureHint,
|
|
6
6
|
PresentationDefinitionV2ClaimValue,
|
|
7
7
|
PresentationDefinitionV2CredentialClaim,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from '.';
|
|
28
28
|
import { ShareCredentialCardLabels, validityCheckedCardFromCredential } from './credential-sharing';
|
|
29
29
|
|
|
30
|
-
const v2ClaimValueToClaimValue = (value: PresentationDefinitionV2ClaimValue):
|
|
30
|
+
const v2ClaimValueToClaimValue = (value: PresentationDefinitionV2ClaimValue): ClaimValue => {
|
|
31
31
|
if (!Array.isArray(value)) {
|
|
32
32
|
return value;
|
|
33
33
|
}
|
|
@@ -35,31 +35,10 @@ const v2ClaimValueToClaimValue = (value: PresentationDefinitionV2ClaimValue): st
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
const v2PresentationClaimToClaim = (claim: PresentationDefinitionV2CredentialClaim): Claim => {
|
|
38
|
-
if (Array.isArray(claim.value)) {
|
|
39
|
-
if (claim.schema.array) {
|
|
40
|
-
return {
|
|
41
|
-
array: claim.schema.array,
|
|
42
|
-
dataType: claim.schema.datatype,
|
|
43
|
-
id: claim.path,
|
|
44
|
-
key: claim.path,
|
|
45
|
-
value: v2ClaimValueToClaimValue(claim.value) as Claim[],
|
|
46
|
-
};
|
|
47
|
-
} else {
|
|
48
|
-
return {
|
|
49
|
-
array: claim.schema.array,
|
|
50
|
-
dataType: DataTypeEnum.Object,
|
|
51
|
-
id: claim.path,
|
|
52
|
-
key: claim.path,
|
|
53
|
-
value: v2ClaimValueToClaimValue(claim.value) as Claim[],
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
38
|
return {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
key: claim.path,
|
|
62
|
-
value: claim.value,
|
|
39
|
+
schema: claim.schema,
|
|
40
|
+
path: claim.path,
|
|
41
|
+
value: v2ClaimValueToClaimValue(claim.value),
|
|
63
42
|
};
|
|
64
43
|
};
|
|
65
44
|
|
|
@@ -124,28 +124,18 @@ const getAttributeSelectorStatus = (
|
|
|
124
124
|
return selected ? SelectorStatus.SelectedCheckmark : SelectorStatus.Empty;
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
type ClaimWithOptionalPath = Claim & {
|
|
128
|
-
path?: string;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
127
|
type FlatClaim = Claim & {
|
|
132
|
-
path: string;
|
|
133
128
|
isArrayElement?: boolean;
|
|
134
129
|
};
|
|
135
130
|
|
|
136
131
|
// Returns a spread list of all claims with their full JSON path as key, including all intermediate objects
|
|
137
|
-
const spreadClaims = (claims:
|
|
138
|
-
|
|
139
|
-
...c,
|
|
140
|
-
path: c.path ?? c.key,
|
|
141
|
-
}));
|
|
142
|
-
return claimsWithPath.reduce((acc, claim) => {
|
|
132
|
+
const spreadClaims = (claims: Claim[]): FlatClaim[] => {
|
|
133
|
+
return claims.reduce((acc, claim) => {
|
|
143
134
|
const result = [claim];
|
|
144
135
|
if (Array.isArray(claim.value)) {
|
|
145
|
-
const nestedClaimsWithPath: FlatClaim[] = claim.value.map((c
|
|
136
|
+
const nestedClaimsWithPath: FlatClaim[] = claim.value.map((c) => ({
|
|
146
137
|
...c,
|
|
147
|
-
|
|
148
|
-
isArrayElement: claim.array,
|
|
138
|
+
isArrayElement: claim.schema.array && claim.path.split('/').pop() !== claim.schema.key,
|
|
149
139
|
}));
|
|
150
140
|
result.push(...spreadClaims(nestedClaimsWithPath));
|
|
151
141
|
}
|
|
@@ -47,21 +47,8 @@ export const supportsSelectiveDisclosure = (credential: CredentialListItem | und
|
|
|
47
47
|
: undefined;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
const findClaimByPathParts = (path: string[], claims?: Claim[]): Claim | undefined => {
|
|
51
|
-
if (!claims?.length) {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
const [first, second, ...rest] = path;
|
|
55
|
-
const claim = claims.find((c) => c.key === first);
|
|
56
|
-
if (claim === undefined || second === undefined || claim.dataType !== DataTypeEnum.Object) {
|
|
57
|
-
return claim;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return findClaimByPathParts([`${first}/${second}`, ...rest], claim.value as Claim[]);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
50
|
export const findClaimByPath = (path: string | undefined, claims: Claim[] | undefined) =>
|
|
64
|
-
path ?
|
|
51
|
+
path ? claims?.find((claim) => claim.path === path) : undefined;
|
|
65
52
|
|
|
66
53
|
const formatCredentialDetail = (claim: Claim, config: Config, testID: string): string => {
|
|
67
54
|
const attributeValue = detailsCardAttributeValueFromClaim(claim, config, testID);
|
|
@@ -224,27 +211,20 @@ export const getCredentialCardPropsFromCredential = (
|
|
|
224
211
|
export const detailsCardAttributeFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttribute => {
|
|
225
212
|
const value = detailsCardAttributeValueFromClaim(claim, config, testID);
|
|
226
213
|
return {
|
|
227
|
-
id: claim.
|
|
228
|
-
name: claim.
|
|
229
|
-
path: claim.
|
|
214
|
+
id: claim.path,
|
|
215
|
+
name: claim.path.split('/').pop(),
|
|
216
|
+
path: claim.path,
|
|
230
217
|
...value,
|
|
231
218
|
};
|
|
232
219
|
};
|
|
233
220
|
|
|
234
221
|
const detailsCardAttributeValueFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttributeValue => {
|
|
235
|
-
const typeConfig = config?.datatype[claim.
|
|
222
|
+
const typeConfig = config?.datatype[claim.schema.datatype];
|
|
236
223
|
|
|
237
|
-
if (claim.array) {
|
|
224
|
+
if (claim.schema.array) {
|
|
238
225
|
return {
|
|
239
|
-
values: (claim.value || []).map((arrayValue, index) => {
|
|
240
|
-
return detailsCardAttributeFromClaim(
|
|
241
|
-
{
|
|
242
|
-
...arrayValue,
|
|
243
|
-
id: `${arrayValue.id}/${index}`,
|
|
244
|
-
},
|
|
245
|
-
config,
|
|
246
|
-
concatTestID(testID, index.toString()),
|
|
247
|
-
);
|
|
226
|
+
values: ((claim.value as Claim[]) || []).map((arrayValue, index) => {
|
|
227
|
+
return detailsCardAttributeFromClaim(arrayValue, config, concatTestID(testID, index.toString()));
|
|
248
228
|
}),
|
|
249
229
|
};
|
|
250
230
|
} else {
|
|
@@ -55,7 +55,7 @@ export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<Histo
|
|
|
55
55
|
'page',
|
|
56
56
|
'pageSize',
|
|
57
57
|
'organisationId',
|
|
58
|
-
'
|
|
58
|
+
'entityIds',
|
|
59
59
|
'actions',
|
|
60
60
|
'entityTypes',
|
|
61
61
|
'createdDateAfter',
|
|
@@ -65,7 +65,7 @@ export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<Histo
|
|
|
65
65
|
'credentialSchemaId',
|
|
66
66
|
'proofSchemaId',
|
|
67
67
|
'search',
|
|
68
|
-
'
|
|
68
|
+
'users',
|
|
69
69
|
]);
|
|
70
70
|
};
|
|
71
71
|
|