@credebl/ssi-mobile-openid4vc 2.1.2-alpha-20260526071029 → 2.1.2

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.
@@ -83,6 +83,12 @@ function getSelectedCredentialsForRequest(dcqlQueryResult, selectedCredentials)
83
83
  disclosedPayload: matchWithRecord.claims.valid_claim_sets[0].output,
84
84
  useMode: CredentialMultiInstanceUseMode.NewOrFirst
85
85
  }];
86
+ else if (matchWithRecord.record.type === "W3cCredentialRecord") credentials[credentialQueryId] = [{
87
+ claimFormat: ClaimFormat.JwtVc,
88
+ credentialRecord: matchWithRecord.record,
89
+ disclosedPayload: matchWithRecord.claims.valid_claim_sets[0].output,
90
+ useMode: CredentialMultiInstanceUseMode.NewOrFirst
91
+ }];
86
92
  }
87
93
  }
88
94
  return credentials;
@@ -1 +1 @@
1
- {"version":3,"file":"proof.mjs","names":[],"sources":["../../src/display/proof.ts"],"sourcesContent":["import type {\n DcqlCredentialsForRequest,\n DcqlQueryResult,\n DifPexCredentialsForRequest,\n JsonObject,\n Kms,\n MdocNameSpaces,\n MdocRecord,\n SdJwtVcRecord,\n W3cCredentialRecord,\n W3cV2CredentialRecord,\n} from '@credo-ts/core'\nimport { ClaimFormat, CredentialMultiInstanceUseMode, DateOnly, Hasher, TypedArrayEncoder } from '@credo-ts/core'\nimport type { OpenId4VpResolvedAuthorizationRequest } from '@credo-ts/openid4vc'\nimport { formatDate, isDateString } from '../utils'\nimport { detectImageMimeType } from '../utils/attributes'\nimport type { CredentialMetadata, FormattedSubmissionEntrySatisfiedCredential } from './display'\n\ntype MappedAttributesReturnType =\n | string\n | number\n | boolean\n | { [key: string]: MappedAttributesReturnType }\n | null\n | undefined\n | Array<MappedAttributesReturnType>\n\nexport interface FormattedSubmission {\n name?: string\n purpose?: string\n areAllSatisfied: boolean\n entries: FormattedSubmissionEntry[]\n}\n\nexport interface OpenId4VPRequestRecord extends OpenId4VpResolvedAuthorizationRequest {\n verifierHostName: string | undefined\n createdAt: string | Date\n credentialsForRequest: DifPexCredentialsForRequest | undefined\n type: string\n}\n\nexport interface FormattedSubmissionEntrySatisfied {\n /**\n * can be either:\n * - AnonCreds groupName\n * - PEX inputDescriptorId\n * - DCQL credential query id\n */\n inputDescriptorId: string\n\n name?: string\n description?: string\n\n /**\n * Whether the entry is satisfied\n */\n isSatisfied: true\n\n /**\n * Credentials that match the request entry. Wallet always needs to pick one.\n */\n credentials: [FormattedSubmissionEntrySatisfiedCredential, ...FormattedSubmissionEntrySatisfiedCredential[]]\n}\n\nexport interface FormattedSubmissionEntryNotSatisfied {\n /**\n * can be either:\n * - AnonCreds groupName\n * - PEX inputDescriptorId\n * - DCQL credential query id\n */\n inputDescriptorId: string\n\n name?: string\n description?: string\n\n /**\n * Whether the entry is satisfied\n */\n isSatisfied: false\n\n requestedAttributePaths: Array<Array<string | number | null>>\n}\n\nexport type FormattedSubmissionEntry = FormattedSubmissionEntryNotSatisfied | FormattedSubmissionEntrySatisfied\n\nexport function getDisclosedAttributePathArrays(\n payload: object,\n maxDepth: number | undefined = undefined,\n prefix: string[] = []\n): string[][] {\n let attributePaths: string[][] = []\n\n for (const [key, value] of Object.entries(payload)) {\n if (!value) continue\n\n // TODO: handle arrays\n const newPath = [...prefix, key]\n if (value && typeof value === 'object' && maxDepth !== 0) {\n // If the value is a nested object, recurse\n attributePaths = [\n ...attributePaths,\n ...getDisclosedAttributePathArrays(value, maxDepth !== undefined ? maxDepth - 1 : undefined, newPath),\n ]\n } else {\n // If the value is a primitive or maxDepth is reached, add the key to the list\n attributePaths.push(newPath)\n }\n }\n\n return attributePaths\n}\n\nexport function getAttributesAndMetadataForSdJwtPayload(sdJwtVcPayload: Record<string, unknown>) {\n type SdJwtVcPayload = {\n iss: string\n cnf: Record<string, unknown>\n vct: string\n iat?: number\n nbf?: number\n exp?: number\n [key: string]: unknown\n }\n const { _sd_alg, _sd_hash, iss, vct, cnf, iat, exp, nbf, ...visibleProperties } = sdJwtVcPayload as SdJwtVcPayload\n\n const holder = (cnf.kid ?? cnf.jwk) ? safeCalculateJwkThumbprint(cnf.jwk as Kms.Jwk) : undefined\n const credentialMetadata: CredentialMetadata = {\n type: vct,\n issuer: iss,\n holder,\n }\n\n if (iat) {\n credentialMetadata.issuedAt = formatDate(new Date(iat * 1000))\n }\n if (exp) {\n credentialMetadata.validUntil = formatDate(new Date(exp * 1000))\n }\n if (nbf) {\n credentialMetadata.validFrom = formatDate(new Date(nbf * 1000))\n }\n\n return {\n attributes: Object.fromEntries(\n Object.entries(visibleProperties).map(([key, value]) => [key, recursivelyMapAttributes(value)])\n ),\n metadata: credentialMetadata,\n raw: {\n issuedAt: iat ? new Date(iat * 1000) : undefined,\n validUntil: exp ? new Date(exp * 1000) : undefined,\n validFrom: nbf ? new Date(nbf * 1000) : undefined,\n },\n }\n}\n\nexport function safeCalculateJwkThumbprint(jwk: Kms.Jwk): string | undefined {\n try {\n const thumbprint = TypedArrayEncoder.toBase64URL(\n Hasher.hash(\n JSON.stringify({ k: jwk.k, e: jwk.e, crv: jwk.crv, kty: jwk.kty, n: jwk.n, x: jwk.x, y: jwk.y }),\n 'sha-256'\n )\n )\n return `urn:ietf:params:oauth:jwk-thumbprint:sha-256:${thumbprint}`\n } catch (_e) {\n return undefined\n }\n}\n\nexport function recursivelyMapAttributes(value: unknown): MappedAttributesReturnType {\n if (value instanceof Uint8Array) {\n const imageMimeType = detectImageMimeType(value)\n if (imageMimeType) {\n return `data:${imageMimeType};base64,${TypedArrayEncoder.toBase64(value)}`\n }\n\n return TypedArrayEncoder.toUtf8String(value)\n }\n if (value === null || value === undefined || typeof value === 'number' || typeof value === 'boolean') return value\n\n if (value instanceof Date || value instanceof DateOnly || (typeof value === 'string' && isDateString(value))) {\n return formatDate(value instanceof DateOnly ? value.toISOString() : value)\n }\n if (typeof value === 'string') return value\n if (value instanceof Map) {\n return Object.fromEntries(Array.from(value.entries()).map(([key, value]) => [key, recursivelyMapAttributes(value)]))\n }\n if (Array.isArray(value)) return value.map(recursivelyMapAttributes)\n\n return Object.fromEntries(Object.entries(value).map(([key, value]) => [key, recursivelyMapAttributes(value)]))\n}\n\nexport function getSelectedCredentialsForRequest(\n dcqlQueryResult: DcqlQueryResult,\n selectedCredentials: { [credentialQueryId: string]: string }\n): DcqlCredentialsForRequest {\n if (!dcqlQueryResult.can_be_satisfied) {\n throw new Error('Cannot select the credentials for the dcql query presentation if the request cannot be satisfied')\n }\n\n const credentials: DcqlCredentialsForRequest = {}\n\n type WithRecord<T> = T & {\n record: MdocRecord | SdJwtVcRecord | W3cCredentialRecord | W3cV2CredentialRecord\n }\n\n for (const [credentialQueryId, credentialRecordId] of Object.entries(selectedCredentials)) {\n const matchesForCredentialQuery = dcqlQueryResult.credential_matches[credentialQueryId]\n if (matchesForCredentialQuery.success) {\n const validCredentialMatch = matchesForCredentialQuery.valid_credentials.find(\n (credential) => (credential as WithRecord<typeof credential>).record.id === credentialRecordId\n )\n\n if (!validCredentialMatch) {\n throw new Error(\n `Could not find credential record ${credentialRecordId} in valid credential matches for credentialQueryId ${credentialQueryId}`\n )\n }\n\n // TODO: fix the typing, make selection in Credo easier\n const matchWithRecord = validCredentialMatch as typeof validCredentialMatch & {\n record: MdocRecord | SdJwtVcRecord | W3cCredentialRecord | W3cV2CredentialRecord\n }\n\n if (matchWithRecord.record.type === 'MdocRecord') {\n credentials[credentialQueryId] = [\n {\n claimFormat: ClaimFormat.MsoMdoc,\n credentialRecord: matchWithRecord.record,\n disclosedPayload: matchWithRecord.claims.valid_claim_sets[0].output as MdocNameSpaces,\n // FIXME: we currently allow re-sharing if we don't have new instances anymore\n // we should make this configurable maybe? Or dependant on credential type?\n useMode: CredentialMultiInstanceUseMode.NewOrFirst,\n },\n ]\n } else if (matchWithRecord.record.type === 'SdJwtVcRecord') {\n credentials[credentialQueryId] = [\n {\n claimFormat: ClaimFormat.SdJwtDc,\n credentialRecord: matchWithRecord.record,\n disclosedPayload: matchWithRecord.claims.valid_claim_sets[0].output as JsonObject,\n // FIXME: we currently allow re-sharing if we don't have new instances anymore\n // we should make this configurable maybe? Or dependant on credential type?\n useMode: CredentialMultiInstanceUseMode.NewOrFirst,\n },\n ]\n }\n }\n }\n\n return credentials\n}\n"],"mappings":";;;;;;AAsFA,SAAgB,gCACd,SACA,WAA+B,QAC/B,SAAmB,EAAE,EACT;CACZ,IAAI,iBAA6B,EAAE;AAEnC,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,QAAQ,EAAE;AAClD,MAAI,CAAC,MAAO;EAGZ,MAAM,UAAU,CAAC,GAAG,QAAQ,IAAI;AAChC,MAAI,SAAS,OAAO,UAAU,YAAY,aAAa,EAErD,kBAAiB,CACf,GAAG,gBACH,GAAG,gCAAgC,OAAO,aAAa,SAAY,WAAW,IAAI,QAAW,QAAQ,CACtG;MAGD,gBAAe,KAAK,QAAQ;;AAIhC,QAAO;;AAGT,SAAgB,wCAAwC,gBAAyC;CAU/F,MAAM,EAAE,SAAS,UAAU,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG,sBAAsB;CAGlF,MAAM,qBAAyC;EAC7C,MAAM;EACN,QAAQ;EACR,QAJc,IAAI,OAAO,IAAI,MAAO,2BAA2B,IAAI,IAAe,GAAG;EAKtF;AAED,KAAI,IACF,oBAAmB,WAAW,2BAAW,IAAI,KAAK,MAAM,IAAK,CAAC;AAEhE,KAAI,IACF,oBAAmB,aAAa,2BAAW,IAAI,KAAK,MAAM,IAAK,CAAC;AAElE,KAAI,IACF,oBAAmB,YAAY,2BAAW,IAAI,KAAK,MAAM,IAAK,CAAC;AAGjE,QAAO;EACL,YAAY,OAAO,YACjB,OAAO,QAAQ,kBAAkB,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,yBAAyB,MAAM,CAAC,CAAC,CAChG;EACD,UAAU;EACV,KAAK;GACH,UAAU,sBAAM,IAAI,KAAK,MAAM,IAAK,GAAG;GACvC,YAAY,sBAAM,IAAI,KAAK,MAAM,IAAK,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;AAMjD,MAAK,MAAM,CAAC,mBAAmB,uBAAuB,OAAO,QAAQ,oBAAoB,EAAE;EACzF,MAAM,4BAA4B,gBAAgB,mBAAmB;AACrE,MAAI,0BAA0B,SAAS;GACrC,MAAM,uBAAuB,0BAA0B,kBAAkB,MACtE,eAAgB,WAA6C,OAAO,OAAO,mBAC7E;AAED,OAAI,CAAC,qBACH,OAAM,IAAI,MACR,oCAAoC,mBAAmB,qDAAqD,oBAC7G;GAIH,MAAM,kBAAkB;AAIxB,OAAI,gBAAgB,OAAO,SAAS,aAClC,aAAY,qBAAqB,CAC/B;IACE,aAAa,YAAY;IACzB,kBAAkB,gBAAgB;IAClC,kBAAkB,gBAAgB,OAAO,iBAAiB,GAAG;IAG7D,SAAS,+BAA+B;IACzC,CACF;YACQ,gBAAgB,OAAO,SAAS,gBACzC,aAAY,qBAAqB,CAC/B;IACE,aAAa,YAAY;IACzB,kBAAkB,gBAAgB;IAClC,kBAAkB,gBAAgB,OAAO,iBAAiB,GAAG;IAG7D,SAAS,+BAA+B;IACzC,CACF;;;AAKP,QAAO"}
1
+ {"version":3,"file":"proof.mjs","names":[],"sources":["../../src/display/proof.ts"],"sourcesContent":["import type {\n DcqlCredentialsForRequest,\n DcqlQueryResult,\n DifPexCredentialsForRequest,\n JsonObject,\n Kms,\n MdocNameSpaces,\n MdocRecord,\n SdJwtVcRecord,\n W3cCredentialRecord,\n W3cV2CredentialRecord,\n} from '@credo-ts/core'\nimport { ClaimFormat, CredentialMultiInstanceUseMode, DateOnly, Hasher, TypedArrayEncoder } from '@credo-ts/core'\nimport type { OpenId4VpResolvedAuthorizationRequest } from '@credo-ts/openid4vc'\nimport { formatDate, isDateString } from '../utils'\nimport { detectImageMimeType } from '../utils/attributes'\nimport type { CredentialMetadata, FormattedSubmissionEntrySatisfiedCredential } from './display'\n\ntype MappedAttributesReturnType =\n | string\n | number\n | boolean\n | { [key: string]: MappedAttributesReturnType }\n | null\n | undefined\n | Array<MappedAttributesReturnType>\n\nexport interface FormattedSubmission {\n name?: string\n purpose?: string\n areAllSatisfied: boolean\n entries: FormattedSubmissionEntry[]\n}\n\nexport interface OpenId4VPRequestRecord extends OpenId4VpResolvedAuthorizationRequest {\n verifierHostName: string | undefined\n createdAt: string | Date\n credentialsForRequest: DifPexCredentialsForRequest | undefined\n type: string\n}\n\nexport interface FormattedSubmissionEntrySatisfied {\n /**\n * can be either:\n * - AnonCreds groupName\n * - PEX inputDescriptorId\n * - DCQL credential query id\n */\n inputDescriptorId: string\n\n name?: string\n description?: string\n\n /**\n * Whether the entry is satisfied\n */\n isSatisfied: true\n\n /**\n * Credentials that match the request entry. Wallet always needs to pick one.\n */\n credentials: [FormattedSubmissionEntrySatisfiedCredential, ...FormattedSubmissionEntrySatisfiedCredential[]]\n}\n\nexport interface FormattedSubmissionEntryNotSatisfied {\n /**\n * can be either:\n * - AnonCreds groupName\n * - PEX inputDescriptorId\n * - DCQL credential query id\n */\n inputDescriptorId: string\n\n name?: string\n description?: string\n\n /**\n * Whether the entry is satisfied\n */\n isSatisfied: false\n\n requestedAttributePaths: Array<Array<string | number | null>>\n}\n\nexport type FormattedSubmissionEntry = FormattedSubmissionEntryNotSatisfied | FormattedSubmissionEntrySatisfied\n\nexport function getDisclosedAttributePathArrays(\n payload: object,\n maxDepth: number | undefined = undefined,\n prefix: string[] = []\n): string[][] {\n let attributePaths: string[][] = []\n\n for (const [key, value] of Object.entries(payload)) {\n if (!value) continue\n\n // TODO: handle arrays\n const newPath = [...prefix, key]\n if (value && typeof value === 'object' && maxDepth !== 0) {\n // If the value is a nested object, recurse\n attributePaths = [\n ...attributePaths,\n ...getDisclosedAttributePathArrays(value, maxDepth !== undefined ? maxDepth - 1 : undefined, newPath),\n ]\n } else {\n // If the value is a primitive or maxDepth is reached, add the key to the list\n attributePaths.push(newPath)\n }\n }\n\n return attributePaths\n}\n\nexport function getAttributesAndMetadataForSdJwtPayload(sdJwtVcPayload: Record<string, unknown>) {\n type SdJwtVcPayload = {\n iss: string\n cnf: Record<string, unknown>\n vct: string\n iat?: number\n nbf?: number\n exp?: number\n [key: string]: unknown\n }\n const { _sd_alg, _sd_hash, iss, vct, cnf, iat, exp, nbf, ...visibleProperties } = sdJwtVcPayload as SdJwtVcPayload\n\n const holder = (cnf.kid ?? cnf.jwk) ? safeCalculateJwkThumbprint(cnf.jwk as Kms.Jwk) : undefined\n const credentialMetadata: CredentialMetadata = {\n type: vct,\n issuer: iss,\n holder,\n }\n\n if (iat) {\n credentialMetadata.issuedAt = formatDate(new Date(iat * 1000))\n }\n if (exp) {\n credentialMetadata.validUntil = formatDate(new Date(exp * 1000))\n }\n if (nbf) {\n credentialMetadata.validFrom = formatDate(new Date(nbf * 1000))\n }\n\n return {\n attributes: Object.fromEntries(\n Object.entries(visibleProperties).map(([key, value]) => [key, recursivelyMapAttributes(value)])\n ),\n metadata: credentialMetadata,\n raw: {\n issuedAt: iat ? new Date(iat * 1000) : undefined,\n validUntil: exp ? new Date(exp * 1000) : undefined,\n validFrom: nbf ? new Date(nbf * 1000) : undefined,\n },\n }\n}\n\nexport function safeCalculateJwkThumbprint(jwk: Kms.Jwk): string | undefined {\n try {\n const thumbprint = TypedArrayEncoder.toBase64URL(\n Hasher.hash(\n JSON.stringify({ k: jwk.k, e: jwk.e, crv: jwk.crv, kty: jwk.kty, n: jwk.n, x: jwk.x, y: jwk.y }),\n 'sha-256'\n )\n )\n return `urn:ietf:params:oauth:jwk-thumbprint:sha-256:${thumbprint}`\n } catch (_e) {\n return undefined\n }\n}\n\nexport function recursivelyMapAttributes(value: unknown): MappedAttributesReturnType {\n if (value instanceof Uint8Array) {\n const imageMimeType = detectImageMimeType(value)\n if (imageMimeType) {\n return `data:${imageMimeType};base64,${TypedArrayEncoder.toBase64(value)}`\n }\n\n return TypedArrayEncoder.toUtf8String(value)\n }\n if (value === null || value === undefined || typeof value === 'number' || typeof value === 'boolean') return value\n\n if (value instanceof Date || value instanceof DateOnly || (typeof value === 'string' && isDateString(value))) {\n return formatDate(value instanceof DateOnly ? value.toISOString() : value)\n }\n if (typeof value === 'string') return value\n if (value instanceof Map) {\n return Object.fromEntries(Array.from(value.entries()).map(([key, value]) => [key, recursivelyMapAttributes(value)]))\n }\n if (Array.isArray(value)) return value.map(recursivelyMapAttributes)\n\n return Object.fromEntries(Object.entries(value).map(([key, value]) => [key, recursivelyMapAttributes(value)]))\n}\n\nexport function getSelectedCredentialsForRequest(\n dcqlQueryResult: DcqlQueryResult,\n selectedCredentials: { [credentialQueryId: string]: string }\n): DcqlCredentialsForRequest {\n if (!dcqlQueryResult.can_be_satisfied) {\n throw new Error('Cannot select the credentials for the dcql query presentation if the request cannot be satisfied')\n }\n\n const credentials: DcqlCredentialsForRequest = {}\n\n type WithRecord<T> = T & {\n record: MdocRecord | SdJwtVcRecord | W3cCredentialRecord | W3cV2CredentialRecord\n }\n\n for (const [credentialQueryId, credentialRecordId] of Object.entries(selectedCredentials)) {\n const matchesForCredentialQuery = dcqlQueryResult.credential_matches[credentialQueryId]\n if (matchesForCredentialQuery.success) {\n const validCredentialMatch = matchesForCredentialQuery.valid_credentials.find(\n (credential) => (credential as WithRecord<typeof credential>).record.id === credentialRecordId\n )\n\n if (!validCredentialMatch) {\n throw new Error(\n `Could not find credential record ${credentialRecordId} in valid credential matches for credentialQueryId ${credentialQueryId}`\n )\n }\n\n // TODO: fix the typing, make selection in Credo easier\n const matchWithRecord = validCredentialMatch as typeof validCredentialMatch & {\n record: MdocRecord | SdJwtVcRecord | W3cCredentialRecord | W3cV2CredentialRecord\n }\n\n if (matchWithRecord.record.type === 'MdocRecord') {\n credentials[credentialQueryId] = [\n {\n claimFormat: ClaimFormat.MsoMdoc,\n credentialRecord: matchWithRecord.record,\n disclosedPayload: matchWithRecord.claims.valid_claim_sets[0].output as MdocNameSpaces,\n // FIXME: we currently allow re-sharing if we don't have new instances anymore\n // we should make this configurable maybe? Or dependant on credential type?\n useMode: CredentialMultiInstanceUseMode.NewOrFirst,\n },\n ]\n } else if (matchWithRecord.record.type === 'SdJwtVcRecord') {\n credentials[credentialQueryId] = [\n {\n claimFormat: ClaimFormat.SdJwtDc,\n credentialRecord: matchWithRecord.record,\n disclosedPayload: matchWithRecord.claims.valid_claim_sets[0].output as JsonObject,\n // FIXME: we currently allow re-sharing if we don't have new instances anymore\n // we should make this configurable maybe? Or dependant on credential type?\n useMode: CredentialMultiInstanceUseMode.NewOrFirst,\n },\n ]\n } else if (matchWithRecord.record.type === 'W3cCredentialRecord') {\n credentials[credentialQueryId] = [\n {\n claimFormat: ClaimFormat.JwtVc,\n credentialRecord: matchWithRecord.record,\n disclosedPayload: matchWithRecord.claims.valid_claim_sets[0].output as JsonObject,\n useMode: CredentialMultiInstanceUseMode.NewOrFirst,\n },\n ]\n }\n }\n }\n\n return credentials\n}\n"],"mappings":";;;;;;AAsFA,SAAgB,gCACd,SACA,WAA+B,QAC/B,SAAmB,EAAE,EACT;CACZ,IAAI,iBAA6B,EAAE;AAEnC,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,QAAQ,EAAE;AAClD,MAAI,CAAC,MAAO;EAGZ,MAAM,UAAU,CAAC,GAAG,QAAQ,IAAI;AAChC,MAAI,SAAS,OAAO,UAAU,YAAY,aAAa,EAErD,kBAAiB,CACf,GAAG,gBACH,GAAG,gCAAgC,OAAO,aAAa,SAAY,WAAW,IAAI,QAAW,QAAQ,CACtG;MAGD,gBAAe,KAAK,QAAQ;;AAIhC,QAAO;;AAGT,SAAgB,wCAAwC,gBAAyC;CAU/F,MAAM,EAAE,SAAS,UAAU,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG,sBAAsB;CAGlF,MAAM,qBAAyC;EAC7C,MAAM;EACN,QAAQ;EACR,QAJc,IAAI,OAAO,IAAI,MAAO,2BAA2B,IAAI,IAAe,GAAG;EAKtF;AAED,KAAI,IACF,oBAAmB,WAAW,2BAAW,IAAI,KAAK,MAAM,IAAK,CAAC;AAEhE,KAAI,IACF,oBAAmB,aAAa,2BAAW,IAAI,KA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
5
5
  "./package.json": "./package.json"
6
6
  },
7
- "version": "2.1.2-alpha-20260526071029",
7
+ "version": "2.1.2",
8
8
  "files": [
9
9
  "build"
10
10
  ],
@@ -28,7 +28,7 @@
28
28
  "expo-image": "^3.0.10",
29
29
  "expo-image-manipulator": "^14.0.7",
30
30
  "rxjs": "^7.8.2",
31
- "@credebl/ssi-mobile-core": "2.1.2-alpha-20260526071029"
31
+ "@credebl/ssi-mobile-core": "2.1.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/react": "^19.2.14",