@velocitycareerlabs/vcl-react-native 1.0.1
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/LICENSE +21 -0
- package/README.md +126 -0
- package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.4.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +134 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativeModule.kt +320 -0
- package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativePackage.kt +19 -0
- package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/ArrayExtensions.kt +88 -0
- package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/JSONExtensions.kt +66 -0
- package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/MapExtensions.kt +89 -0
- package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/RNCollectionExtensions.kt +62 -0
- package/android/src/main/java/io/velocitycareerlabs/reactnative/utlis/Converter.kt +514 -0
- package/ios/Extensions/StringExtensions.swift +21 -0
- package/ios/Utils/Converter.swift +507 -0
- package/ios/VclReactNative-Bridging-Header.h +2 -0
- package/ios/VclReactNative.m +70 -0
- package/ios/VclReactNative.swift +249 -0
- package/ios/VclReactNative.xcodeproj/project.pbxproj +303 -0
- package/lib/commonjs/api/Dictionary.js +2 -0
- package/lib/commonjs/api/Dictionary.js.map +1 -0
- package/lib/commonjs/api/VCLApi.js +6 -0
- package/lib/commonjs/api/VCLApi.js.map +1 -0
- package/lib/commonjs/api/VCLEnvironment.js +15 -0
- package/lib/commonjs/api/VCLEnvironment.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCountries.js +263 -0
- package/lib/commonjs/api/entities/VCLCountries.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCountry.js +6 -0
- package/lib/commonjs/api/entities/VCLCountry.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialManifest.js +6 -0
- package/lib/commonjs/api/entities/VCLCredentialManifest.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptor.js +6 -0
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptor.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByDeepLink.js +6 -0
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByDeepLink.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByService.js +6 -0
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByService.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorRefresh.js +6 -0
- package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorRefresh.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialType.js +6 -0
- package/lib/commonjs/api/entities/VCLCredentialType.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialTypeSchema.js +6 -0
- package/lib/commonjs/api/entities/VCLCredentialTypeSchema.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialTypeSchemas.js +6 -0
- package/lib/commonjs/api/entities/VCLCredentialTypeSchemas.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialTypes.js +6 -0
- package/lib/commonjs/api/entities/VCLCredentialTypes.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchema.js +6 -0
- package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchema.js.map +1 -0
- package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js +2 -0
- package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js.map +1 -0
- package/lib/commonjs/api/entities/VCLDeepLink.js +2 -0
- package/lib/commonjs/api/entities/VCLDeepLink.js.map +1 -0
- package/lib/commonjs/api/entities/VCLError.js +2 -0
- package/lib/commonjs/api/entities/VCLError.js.map +1 -0
- package/lib/commonjs/api/entities/VCLExchange.js +2 -0
- package/lib/commonjs/api/entities/VCLExchange.js.map +1 -0
- package/lib/commonjs/api/entities/VCLExchangeDescriptor.js +6 -0
- package/lib/commonjs/api/entities/VCLExchangeDescriptor.js.map +1 -0
- package/lib/commonjs/api/entities/VCLFilter.js +6 -0
- package/lib/commonjs/api/entities/VCLFilter.js.map +1 -0
- package/lib/commonjs/api/entities/VCLFinalizeOffersDescriptor.js +6 -0
- package/lib/commonjs/api/entities/VCLFinalizeOffersDescriptor.js.map +1 -0
- package/lib/commonjs/api/entities/VCLGenerateOffersDescriptor.js +6 -0
- package/lib/commonjs/api/entities/VCLGenerateOffersDescriptor.js.map +1 -0
- package/lib/commonjs/api/entities/VCLJWT.js +2 -0
- package/lib/commonjs/api/entities/VCLJWT.js.map +1 -0
- package/lib/commonjs/api/entities/VCLJwtVerifiableCredentials.js +6 -0
- package/lib/commonjs/api/entities/VCLJwtVerifiableCredentials.js.map +1 -0
- package/lib/commonjs/api/entities/VCLOffers.js +6 -0
- package/lib/commonjs/api/entities/VCLOffers.js.map +1 -0
- package/lib/commonjs/api/entities/VCLOrganization.js +6 -0
- package/lib/commonjs/api/entities/VCLOrganization.js.map +1 -0
- package/lib/commonjs/api/entities/VCLOrganizations.js +6 -0
- package/lib/commonjs/api/entities/VCLOrganizations.js.map +1 -0
- package/lib/commonjs/api/entities/VCLOrganizationsSearchDescriptor.js +6 -0
- package/lib/commonjs/api/entities/VCLOrganizationsSearchDescriptor.js.map +1 -0
- package/lib/commonjs/api/entities/VCLPage.js +2 -0
- package/lib/commonjs/api/entities/VCLPage.js.map +1 -0
- package/lib/commonjs/api/entities/VCLPresentationRequest.js +6 -0
- package/lib/commonjs/api/entities/VCLPresentationRequest.js.map +1 -0
- package/lib/commonjs/api/entities/VCLPresentationSubmission.js +6 -0
- package/lib/commonjs/api/entities/VCLPresentationSubmission.js.map +1 -0
- package/lib/commonjs/api/entities/VCLPresentationSubmissionResult.js +6 -0
- package/lib/commonjs/api/entities/VCLPresentationSubmissionResult.js.map +1 -0
- package/lib/commonjs/api/entities/VCLPublicKey.js +2 -0
- package/lib/commonjs/api/entities/VCLPublicKey.js.map +1 -0
- package/lib/commonjs/api/entities/VCLPushDelegate.js +2 -0
- package/lib/commonjs/api/entities/VCLPushDelegate.js.map +1 -0
- package/lib/commonjs/api/entities/VCLRegion.js +6 -0
- package/lib/commonjs/api/entities/VCLRegion.js.map +1 -0
- package/lib/commonjs/api/entities/VCLRegions.js +6 -0
- package/lib/commonjs/api/entities/VCLRegions.js.map +1 -0
- package/lib/commonjs/api/entities/VCLService.js +6 -0
- package/lib/commonjs/api/entities/VCLService.js.map +1 -0
- package/lib/commonjs/api/entities/VCLServiceCredentialAgentIssuer.js +6 -0
- package/lib/commonjs/api/entities/VCLServiceCredentialAgentIssuer.js.map +1 -0
- package/lib/commonjs/api/entities/VCLServiceType.js +20 -0
- package/lib/commonjs/api/entities/VCLServiceType.js.map +1 -0
- package/lib/commonjs/api/entities/VCLSubmissionResult.js +6 -0
- package/lib/commonjs/api/entities/VCLSubmissionResult.js.map +1 -0
- package/lib/commonjs/api/entities/VCLToken.js +2 -0
- package/lib/commonjs/api/entities/VCLToken.js.map +1 -0
- package/lib/commonjs/api/entities/VCLVerifiableCredential.js +2 -0
- package/lib/commonjs/api/entities/VCLVerifiableCredential.js.map +1 -0
- package/lib/commonjs/api/entities/VCLVerifiedProfile.js +6 -0
- package/lib/commonjs/api/entities/VCLVerifiedProfile.js.map +1 -0
- package/lib/commonjs/api/entities/VCLVerifiedProfileDescriptor.js +2 -0
- package/lib/commonjs/api/entities/VCLVerifiedProfileDescriptor.js.map +1 -0
- package/lib/commonjs/index.js +39 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/api/Dictionary.js +2 -0
- package/lib/module/api/Dictionary.js.map +1 -0
- package/lib/module/api/VCLApi.js +2 -0
- package/lib/module/api/VCLApi.js.map +1 -0
- package/lib/module/api/VCLEnvironment.js +8 -0
- package/lib/module/api/VCLEnvironment.js.map +1 -0
- package/lib/module/api/entities/VCLCountries.js +256 -0
- package/lib/module/api/entities/VCLCountries.js.map +1 -0
- package/lib/module/api/entities/VCLCountry.js +2 -0
- package/lib/module/api/entities/VCLCountry.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialManifest.js +2 -0
- package/lib/module/api/entities/VCLCredentialManifest.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptor.js +2 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptor.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptorByDeepLink.js +2 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptorByDeepLink.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptorByService.js +2 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptorByService.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptorRefresh.js +2 -0
- package/lib/module/api/entities/VCLCredentialManifestDescriptorRefresh.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialType.js +2 -0
- package/lib/module/api/entities/VCLCredentialType.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialTypeSchema.js +2 -0
- package/lib/module/api/entities/VCLCredentialTypeSchema.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialTypeSchemas.js +2 -0
- package/lib/module/api/entities/VCLCredentialTypeSchemas.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialTypes.js +2 -0
- package/lib/module/api/entities/VCLCredentialTypes.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialTypesUIFormSchema.js +2 -0
- package/lib/module/api/entities/VCLCredentialTypesUIFormSchema.js.map +1 -0
- package/lib/module/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js +2 -0
- package/lib/module/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js.map +1 -0
- package/lib/module/api/entities/VCLDeepLink.js +2 -0
- package/lib/module/api/entities/VCLDeepLink.js.map +1 -0
- package/lib/module/api/entities/VCLError.js +2 -0
- package/lib/module/api/entities/VCLError.js.map +1 -0
- package/lib/module/api/entities/VCLExchange.js +2 -0
- package/lib/module/api/entities/VCLExchange.js.map +1 -0
- package/lib/module/api/entities/VCLExchangeDescriptor.js +2 -0
- package/lib/module/api/entities/VCLExchangeDescriptor.js.map +1 -0
- package/lib/module/api/entities/VCLFilter.js +2 -0
- package/lib/module/api/entities/VCLFilter.js.map +1 -0
- package/lib/module/api/entities/VCLFinalizeOffersDescriptor.js +2 -0
- package/lib/module/api/entities/VCLFinalizeOffersDescriptor.js.map +1 -0
- package/lib/module/api/entities/VCLGenerateOffersDescriptor.js +2 -0
- package/lib/module/api/entities/VCLGenerateOffersDescriptor.js.map +1 -0
- package/lib/module/api/entities/VCLJWT.js +2 -0
- package/lib/module/api/entities/VCLJWT.js.map +1 -0
- package/lib/module/api/entities/VCLJwtVerifiableCredentials.js +2 -0
- package/lib/module/api/entities/VCLJwtVerifiableCredentials.js.map +1 -0
- package/lib/module/api/entities/VCLOffers.js +2 -0
- package/lib/module/api/entities/VCLOffers.js.map +1 -0
- package/lib/module/api/entities/VCLOrganization.js +2 -0
- package/lib/module/api/entities/VCLOrganization.js.map +1 -0
- package/lib/module/api/entities/VCLOrganizations.js +2 -0
- package/lib/module/api/entities/VCLOrganizations.js.map +1 -0
- package/lib/module/api/entities/VCLOrganizationsSearchDescriptor.js +2 -0
- package/lib/module/api/entities/VCLOrganizationsSearchDescriptor.js.map +1 -0
- package/lib/module/api/entities/VCLPage.js +2 -0
- package/lib/module/api/entities/VCLPage.js.map +1 -0
- package/lib/module/api/entities/VCLPresentationRequest.js +2 -0
- package/lib/module/api/entities/VCLPresentationRequest.js.map +1 -0
- package/lib/module/api/entities/VCLPresentationSubmission.js +2 -0
- package/lib/module/api/entities/VCLPresentationSubmission.js.map +1 -0
- package/lib/module/api/entities/VCLPresentationSubmissionResult.js +2 -0
- package/lib/module/api/entities/VCLPresentationSubmissionResult.js.map +1 -0
- package/lib/module/api/entities/VCLPublicKey.js +2 -0
- package/lib/module/api/entities/VCLPublicKey.js.map +1 -0
- package/lib/module/api/entities/VCLPushDelegate.js +2 -0
- package/lib/module/api/entities/VCLPushDelegate.js.map +1 -0
- package/lib/module/api/entities/VCLRegion.js +2 -0
- package/lib/module/api/entities/VCLRegion.js.map +1 -0
- package/lib/module/api/entities/VCLRegions.js +2 -0
- package/lib/module/api/entities/VCLRegions.js.map +1 -0
- package/lib/module/api/entities/VCLService.js +2 -0
- package/lib/module/api/entities/VCLService.js.map +1 -0
- package/lib/module/api/entities/VCLServiceCredentialAgentIssuer.js +2 -0
- package/lib/module/api/entities/VCLServiceCredentialAgentIssuer.js.map +1 -0
- package/lib/module/api/entities/VCLServiceType.js +13 -0
- package/lib/module/api/entities/VCLServiceType.js.map +1 -0
- package/lib/module/api/entities/VCLSubmissionResult.js +2 -0
- package/lib/module/api/entities/VCLSubmissionResult.js.map +1 -0
- package/lib/module/api/entities/VCLToken.js +2 -0
- package/lib/module/api/entities/VCLToken.js.map +1 -0
- package/lib/module/api/entities/VCLVerifiableCredential.js +2 -0
- package/lib/module/api/entities/VCLVerifiableCredential.js.map +1 -0
- package/lib/module/api/entities/VCLVerifiedProfile.js +2 -0
- package/lib/module/api/entities/VCLVerifiedProfile.js.map +1 -0
- package/lib/module/api/entities/VCLVerifiedProfileDescriptor.js +2 -0
- package/lib/module/api/entities/VCLVerifiedProfileDescriptor.js.map +1 -0
- package/lib/module/index.js +10 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/api/Dictionary.d.ts +3 -0
- package/lib/typescript/api/VCLApi.d.ts +44 -0
- package/lib/typescript/api/VCLEnvironment.d.ts +8 -0
- package/lib/typescript/api/entities/VCLCountries.d.ts +257 -0
- package/lib/typescript/api/entities/VCLCountry.d.ts +8 -0
- package/lib/typescript/api/entities/VCLCredentialManifest.d.ts +8 -0
- package/lib/typescript/api/entities/VCLCredentialManifestDescriptor.d.ts +5 -0
- package/lib/typescript/api/entities/VCLCredentialManifestDescriptorByDeepLink.d.ts +5 -0
- package/lib/typescript/api/entities/VCLCredentialManifestDescriptorByService.d.ts +5 -0
- package/lib/typescript/api/entities/VCLCredentialManifestDescriptorRefresh.d.ts +6 -0
- package/lib/typescript/api/entities/VCLCredentialType.d.ts +10 -0
- package/lib/typescript/api/entities/VCLCredentialTypeSchema.d.ts +4 -0
- package/lib/typescript/api/entities/VCLCredentialTypeSchemas.d.ts +5 -0
- package/lib/typescript/api/entities/VCLCredentialTypes.d.ts +5 -0
- package/lib/typescript/api/entities/VCLCredentialTypesUIFormSchema.d.ts +4 -0
- package/lib/typescript/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.d.ts +4 -0
- package/lib/typescript/api/entities/VCLDeepLink.d.ts +3 -0
- package/lib/typescript/api/entities/VCLError.d.ts +4 -0
- package/lib/typescript/api/entities/VCLExchange.d.ts +6 -0
- package/lib/typescript/api/entities/VCLExchangeDescriptor.d.ts +6 -0
- package/lib/typescript/api/entities/VCLFilter.d.ts +6 -0
- package/lib/typescript/api/entities/VCLFinalizeOffersDescriptor.d.ts +6 -0
- package/lib/typescript/api/entities/VCLGenerateOffersDescriptor.d.ts +8 -0
- package/lib/typescript/api/entities/VCLJWT.d.ts +3 -0
- package/lib/typescript/api/entities/VCLJwtVerifiableCredentials.d.ts +4 -0
- package/lib/typescript/api/entities/VCLOffers.d.ts +7 -0
- package/lib/typescript/api/entities/VCLOrganization.d.ts +6 -0
- package/lib/typescript/api/entities/VCLOrganizations.d.ts +4 -0
- package/lib/typescript/api/entities/VCLOrganizationsSearchDescriptor.d.ts +8 -0
- package/lib/typescript/api/entities/VCLPage.d.ts +4 -0
- package/lib/typescript/api/entities/VCLPresentationRequest.d.ts +10 -0
- package/lib/typescript/api/entities/VCLPresentationSubmission.d.ts +6 -0
- package/lib/typescript/api/entities/VCLPresentationSubmissionResult.d.ts +6 -0
- package/lib/typescript/api/entities/VCLPublicKey.d.ts +3 -0
- package/lib/typescript/api/entities/VCLPushDelegate.d.ts +4 -0
- package/lib/typescript/api/entities/VCLRegion.d.ts +6 -0
- package/lib/typescript/api/entities/VCLRegions.d.ts +5 -0
- package/lib/typescript/api/entities/VCLService.d.ts +4 -0
- package/lib/typescript/api/entities/VCLServiceCredentialAgentIssuer.d.ts +3 -0
- package/lib/typescript/api/entities/VCLServiceType.d.ts +10 -0
- package/lib/typescript/api/entities/VCLSubmissionResult.d.ts +6 -0
- package/lib/typescript/api/entities/VCLToken.d.ts +3 -0
- package/lib/typescript/api/entities/VCLVerifiableCredential.d.ts +4 -0
- package/lib/typescript/api/entities/VCLVerifiedProfile.d.ts +8 -0
- package/lib/typescript/api/entities/VCLVerifiedProfileDescriptor.d.ts +3 -0
- package/lib/typescript/index.d.ts +49 -0
- package/package.json +154 -0
- package/src/api/Dictionary.tsx +3 -0
- package/src/api/VCLApi.tsx +80 -0
- package/src/api/VCLEnvironment.tsx +9 -0
- package/src/api/entities/VCLCountries.tsx +259 -0
- package/src/api/entities/VCLCountry.tsx +9 -0
- package/src/api/entities/VCLCredentialManifest.tsx +9 -0
- package/src/api/entities/VCLCredentialManifestDescriptor.tsx +6 -0
- package/src/api/entities/VCLCredentialManifestDescriptorByDeepLink.tsx +7 -0
- package/src/api/entities/VCLCredentialManifestDescriptorByService.tsx +7 -0
- package/src/api/entities/VCLCredentialManifestDescriptorRefresh.tsx +8 -0
- package/src/api/entities/VCLCredentialType.tsx +11 -0
- package/src/api/entities/VCLCredentialTypeSchema.tsx +5 -0
- package/src/api/entities/VCLCredentialTypeSchemas.tsx +6 -0
- package/src/api/entities/VCLCredentialTypes.tsx +6 -0
- package/src/api/entities/VCLCredentialTypesUIFormSchema.tsx +5 -0
- package/src/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.tsx +4 -0
- package/src/api/entities/VCLDeepLink.tsx +3 -0
- package/src/api/entities/VCLError.tsx +4 -0
- package/src/api/entities/VCLExchange.tsx +6 -0
- package/src/api/entities/VCLExchangeDescriptor.tsx +7 -0
- package/src/api/entities/VCLFilter.tsx +7 -0
- package/src/api/entities/VCLFinalizeOffersDescriptor.tsx +7 -0
- package/src/api/entities/VCLGenerateOffersDescriptor.tsx +9 -0
- package/src/api/entities/VCLJWT.tsx +3 -0
- package/src/api/entities/VCLJwtVerifiableCredentials.tsx +5 -0
- package/src/api/entities/VCLOffers.tsx +8 -0
- package/src/api/entities/VCLOrganization.tsx +7 -0
- package/src/api/entities/VCLOrganizations.tsx +5 -0
- package/src/api/entities/VCLOrganizationsSearchDescriptor.tsx +9 -0
- package/src/api/entities/VCLPage.tsx +4 -0
- package/src/api/entities/VCLPresentationRequest.tsx +11 -0
- package/src/api/entities/VCLPresentationSubmission.tsx +7 -0
- package/src/api/entities/VCLPresentationSubmissionResult.tsx +7 -0
- package/src/api/entities/VCLPublicKey.tsx +3 -0
- package/src/api/entities/VCLPushDelegate.tsx +4 -0
- package/src/api/entities/VCLRegion.tsx +7 -0
- package/src/api/entities/VCLRegions.tsx +6 -0
- package/src/api/entities/VCLService.tsx +5 -0
- package/src/api/entities/VCLServiceCredentialAgentIssuer.tsx +3 -0
- package/src/api/entities/VCLServiceType.tsx +10 -0
- package/src/api/entities/VCLSubmissionResult.tsx +7 -0
- package/src/api/entities/VCLToken.tsx +3 -0
- package/src/api/entities/VCLVerifiableCredential.tsx +4 -0
- package/src/api/entities/VCLVerifiedProfile.tsx +9 -0
- package/src/api/entities/VCLVerifiedProfileDescriptor.tsx +3 -0
- package/src/index.tsx +98 -0
- package/vcl-react-native.podspec +22 -0
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Converter.swift
|
|
3
|
+
// VclReactNative
|
|
4
|
+
//
|
|
5
|
+
// Created by Michael Avoyan on 05/07/2021.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import VCL
|
|
10
|
+
|
|
11
|
+
func dictionaryToEnvironment(
|
|
12
|
+
_ environmentDictionary: [String: String]
|
|
13
|
+
) -> VCLEnvironment {
|
|
14
|
+
switch environmentDictionary["value"] {
|
|
15
|
+
case VCLEnvironment.DEV.rawValue:
|
|
16
|
+
return VCLEnvironment.DEV
|
|
17
|
+
case VCLEnvironment.STAGING.rawValue:
|
|
18
|
+
return VCLEnvironment.STAGING
|
|
19
|
+
case VCLEnvironment.PROD.rawValue:
|
|
20
|
+
return VCLEnvironment.PROD
|
|
21
|
+
default:
|
|
22
|
+
return VCLEnvironment.PROD
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
func regionToDictionary(
|
|
27
|
+
_ region: VCLRegion
|
|
28
|
+
) -> [String: Any] {
|
|
29
|
+
var regionDict = [String: Any]()
|
|
30
|
+
regionDict["payload"] = region.payload
|
|
31
|
+
regionDict["code"] = region.code
|
|
32
|
+
regionDict["name"] = region.name
|
|
33
|
+
return regionDict
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
func regionsToDictionary(
|
|
37
|
+
_ regions: VCLRegions
|
|
38
|
+
) -> [String: Any] {
|
|
39
|
+
var regionsMap = [String: Any]()
|
|
40
|
+
var regionsArr = [[String: Any]]()
|
|
41
|
+
for i in 0..<regions.all.count {
|
|
42
|
+
regionsArr.append(regionToDictionary(regions.all[i]))
|
|
43
|
+
}
|
|
44
|
+
regionsMap["all"] = regionsArr
|
|
45
|
+
return regionsMap
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
func countryToDictionary(
|
|
49
|
+
_ country: VCLCountry
|
|
50
|
+
) -> [String: Any] {
|
|
51
|
+
var countryDict = [String: Any]()
|
|
52
|
+
countryDict["payload"] = country.payload
|
|
53
|
+
countryDict["code"] = country.code
|
|
54
|
+
countryDict["name"] = country.name
|
|
55
|
+
if let regions = country.regions {
|
|
56
|
+
countryDict["regions"] = regionsToDictionary(regions)
|
|
57
|
+
}
|
|
58
|
+
return countryDict
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
func countriesToDictionary(
|
|
62
|
+
_ countries: VCLCountries
|
|
63
|
+
) -> [String: [[String: Any]?]] {
|
|
64
|
+
var countriesArr = [[String: Any]?] ()
|
|
65
|
+
if let all = countries.all {
|
|
66
|
+
for i in 0..<all.count {
|
|
67
|
+
countriesArr.append(countryToDictionary(all[i]))
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return ["all": countriesArr]
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
func credentialTypeSchemasToDictionary(
|
|
74
|
+
_ credentialTypeSchemas: VCLCredentialTypeSchemas
|
|
75
|
+
) -> [String: [String: Any]] {
|
|
76
|
+
var credentialTypeSchemasMap = [String: [String: Any]]()
|
|
77
|
+
if let all = credentialTypeSchemas.all {
|
|
78
|
+
for (key, credentialTypeSchema) in all {
|
|
79
|
+
var credentialTypeSchemaDictionary = [String: Any]()
|
|
80
|
+
credentialTypeSchemaDictionary["payload"] = credentialTypeSchema.payload
|
|
81
|
+
credentialTypeSchemasMap[key] = credentialTypeSchemaDictionary
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return ["all": credentialTypeSchemasMap]
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
func credentialTypesToDictionary(
|
|
88
|
+
_ credentialTypes: VCLCredentialTypes
|
|
89
|
+
) -> [String: [[String: Any?]]] {
|
|
90
|
+
var credentialTypesArray = [[String: Any?]]()
|
|
91
|
+
var recommendedCredentialTypesArray = [[String: Any?]]()
|
|
92
|
+
if let all = credentialTypes.all {
|
|
93
|
+
credentialTypesArray = parseCredentialTypesArray(all)
|
|
94
|
+
}
|
|
95
|
+
if let recommendedTypes = credentialTypes.recommendedTypes {
|
|
96
|
+
recommendedCredentialTypesArray = parseCredentialTypesArray(recommendedTypes)
|
|
97
|
+
}
|
|
98
|
+
return ["all": credentialTypesArray, "recommendedTypes": recommendedCredentialTypesArray]
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private func parseCredentialTypesArray(_ credentialTypesArr: [VCLCredentialType]) -> [[String: Any?]] {
|
|
102
|
+
var credentialTypesArray = [[String: Any?]]()
|
|
103
|
+
credentialTypesArr.forEach {
|
|
104
|
+
var credentialType = [String: Any?]()
|
|
105
|
+
credentialType["payload"] = $0.payload
|
|
106
|
+
credentialType["id"] = $0.id
|
|
107
|
+
credentialType["schema"] = $0.schema
|
|
108
|
+
credentialType["createdAt"] = $0.createdAt
|
|
109
|
+
credentialType["schemaName"] = $0.schemaName
|
|
110
|
+
credentialType["credentialType"] = $0.credentialType
|
|
111
|
+
credentialType["recommended"] = $0.recommended
|
|
112
|
+
credentialTypesArray.append(credentialType)
|
|
113
|
+
}
|
|
114
|
+
return credentialTypesArray
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
func dictionaryToDeepLink(_ deepLinkDictionary: [String: Any]?) -> VCLDeepLink {
|
|
118
|
+
return VCLDeepLink(value: deepLinkDictionary?["value"] as? String ?? "")
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
func deepLinkToDictionary(_ deepLink: VCLDeepLink) -> [String: Any] {
|
|
122
|
+
return ["value": deepLink.value]
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
func dictionaryToToken(_ tokenDictionary: [String: Any]?) -> VCLToken {
|
|
126
|
+
return VCLToken(value: tokenDictionary?["value"] as? String ?? "")
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
func tokenToDictionary(_ token: VCLToken) -> [String: Any] {
|
|
130
|
+
return ["value": token.value]
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
func dictionaryToPresentationRequest(
|
|
134
|
+
_ presentationRequestDictionary: [String: Any]?
|
|
135
|
+
) -> VCLPresentationRequest {
|
|
136
|
+
return VCLPresentationRequest(
|
|
137
|
+
jwt: dictionaryToJwt(presentationRequestDictionary?["jwt"] as? [String : Any]),
|
|
138
|
+
publicKey: dictionaryToPublicKey(presentationRequestDictionary?["publicKey"] as? [String: Any]),
|
|
139
|
+
deepLink: dictionaryToDeepLink(presentationRequestDictionary?["deepLink"] as? [String : Any])
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
func presentationRequestToDictionary(
|
|
144
|
+
_ presentationRequest: VCLPresentationRequest
|
|
145
|
+
) -> [String: Any] {
|
|
146
|
+
var presentationRequestDictionary = [String: Any]()
|
|
147
|
+
presentationRequestDictionary["jwt"] = ["encodedJwt": presentationRequest.jwt.encodedJwt]
|
|
148
|
+
var jwkDictionary = [String: Any]()
|
|
149
|
+
jwkDictionary["jwkStr"] = presentationRequest.publicKey.jwkStr
|
|
150
|
+
presentationRequestDictionary["publicKey"] = jwkDictionary
|
|
151
|
+
presentationRequestDictionary["iss"] = presentationRequest.iss
|
|
152
|
+
presentationRequestDictionary["exchangeId"] = presentationRequest.exchangeId
|
|
153
|
+
presentationRequestDictionary["presentationDefinitionId"] = presentationRequest.presentationDefinitionId
|
|
154
|
+
presentationRequestDictionary["deepLink"] = deepLinkToDictionary(presentationRequest.deepLink)
|
|
155
|
+
return presentationRequestDictionary
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
func dictionaryToPresentationSubmission(
|
|
159
|
+
_ presentationSubmissionDictionary: [String: Any]?
|
|
160
|
+
) -> VCLPresentationSubmission {
|
|
161
|
+
var verifiableCredentialsList = [VCLVerifiableCredential]()
|
|
162
|
+
if let verifiableCredentialsArr = (presentationSubmissionDictionary?["verifiableCredentials"] as? [[String: String]]) {
|
|
163
|
+
for verifiableCredential in verifiableCredentialsArr {
|
|
164
|
+
verifiableCredentialsList.append(
|
|
165
|
+
VCLVerifiableCredential(
|
|
166
|
+
inputDescriptor: verifiableCredential["inputDescriptor"] ?? "",
|
|
167
|
+
jwtVc: verifiableCredential["jwtVc"] ?? ""
|
|
168
|
+
)
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return VCLPresentationSubmission(
|
|
173
|
+
presentationRequest: dictionaryToPresentationRequest(presentationSubmissionDictionary?["presentationRequest"] as? [String: Any]),
|
|
174
|
+
verifiableCredentials: verifiableCredentialsList
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
func presentationSubmissionResultToDictionary(
|
|
179
|
+
_ presentationSubmissionResult: VCLPresentationSubmissionResult
|
|
180
|
+
) -> [String: Any] {
|
|
181
|
+
var presentationSubmissionResulDictionary = [String: Any]()
|
|
182
|
+
presentationSubmissionResulDictionary["token"] = tokenToDictionary(presentationSubmissionResult.token)
|
|
183
|
+
presentationSubmissionResulDictionary["exchange"] = exchangeToDictionary(presentationSubmissionResult.exchange)
|
|
184
|
+
return presentationSubmissionResulDictionary
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
func exchangeToDictionary(
|
|
188
|
+
_ exchange: VCLExchange?
|
|
189
|
+
) -> [String: Any] {
|
|
190
|
+
var exchangeDictionary = [String: Any]()
|
|
191
|
+
exchangeDictionary["id"] = exchange?.id
|
|
192
|
+
exchangeDictionary["type"] = exchange?.type
|
|
193
|
+
exchangeDictionary["disclosureComplete"] = exchange?.disclosureComplete
|
|
194
|
+
exchangeDictionary["exchangeComplete"] = exchange?.exchangeComplete
|
|
195
|
+
return exchangeDictionary
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
func dictionaryToSubmissionResult(_ submissionResultDictionary: [String: Any]?) -> VCLSubmissionResult {
|
|
199
|
+
return VCLSubmissionResult(
|
|
200
|
+
token: dictionaryToToken(submissionResultDictionary?["token"] as? [String: Any]),
|
|
201
|
+
exchange: dictionaryToExchange(submissionResultDictionary?["exchange"] as? [String: Any])
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
func dictionaryToExchange(
|
|
206
|
+
_ exchangeReadableMap: [String: Any]?
|
|
207
|
+
) -> VCLExchange {
|
|
208
|
+
return VCLExchange(
|
|
209
|
+
id: exchangeReadableMap?["id"] as? String ?? "",
|
|
210
|
+
type: exchangeReadableMap?["type"] as? String ?? "",
|
|
211
|
+
disclosureComplete: exchangeReadableMap?["disclosureComplete"] as? Bool ?? false,
|
|
212
|
+
exchangeComplete: exchangeReadableMap?["exchangeComplete"] as? Bool ?? false
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
func dictionaryToExchangeDescriptor(
|
|
217
|
+
_ exchangeDescriptorDictionary: [String: Any]?
|
|
218
|
+
) -> VCLExchangeDescriptor {
|
|
219
|
+
return VCLExchangeDescriptor(
|
|
220
|
+
presentationSubmission: dictionaryToPresentationSubmission(exchangeDescriptorDictionary?["presentationSubmission"] as? [String: Any]),
|
|
221
|
+
submissionResult: dictionaryToSubmissionResult(exchangeDescriptorDictionary?["submissionResult"] as? [String: Any])
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
func stringToServiceType(
|
|
226
|
+
_ serviceTypeStr: String?
|
|
227
|
+
) -> VCLServiceType? {
|
|
228
|
+
var serviceType: VCLServiceType? = nil
|
|
229
|
+
guard (serviceTypeStr != nil) else {
|
|
230
|
+
return nil
|
|
231
|
+
}
|
|
232
|
+
switch serviceTypeStr {
|
|
233
|
+
case "Issuer":
|
|
234
|
+
serviceType = .Issuer
|
|
235
|
+
case "Inspector":
|
|
236
|
+
serviceType = .Inspector
|
|
237
|
+
case "CredentialAgentOperator":
|
|
238
|
+
serviceType = .CredentialAgentOperator
|
|
239
|
+
case "NodeOperator":
|
|
240
|
+
serviceType = .NodeOperator
|
|
241
|
+
case "TrustRoot":
|
|
242
|
+
serviceType = .TrustRoot
|
|
243
|
+
case "NotaryIssuer":
|
|
244
|
+
serviceType = .NotaryIssuer
|
|
245
|
+
case "IdentityIssuer":
|
|
246
|
+
serviceType = .IdentityIssuer
|
|
247
|
+
case "HolderAppProvider":
|
|
248
|
+
serviceType = .HolderAppProvider
|
|
249
|
+
default:
|
|
250
|
+
serviceType = nil
|
|
251
|
+
}
|
|
252
|
+
return serviceType
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
func dictionayToOrganizationsSearchDescriptor(
|
|
256
|
+
_ organizationsDescriptorDictionary: [String: Any]
|
|
257
|
+
) -> VCLOrganizationsSearchDescriptor {
|
|
258
|
+
return VCLOrganizationsSearchDescriptor(
|
|
259
|
+
filter: dictionaryToFilter(organizationsDescriptorDictionary["filter"] as? [String : Any]),
|
|
260
|
+
page: dictionaryToPage(organizationsDescriptorDictionary["page"] as? [String : Any]),
|
|
261
|
+
sort: organizationsDescriptorDictionary["sort"] as? [[String]],
|
|
262
|
+
query: organizationsDescriptorDictionary["query"] as? String
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
func dictionaryToFilter(
|
|
267
|
+
_ filterDictionary: [String: Any]?
|
|
268
|
+
) -> VCLFilter {
|
|
269
|
+
let did: String? = filterDictionary?["did"] as? String
|
|
270
|
+
var serviceTypesList: [VCLServiceType]? = nil
|
|
271
|
+
if let serviceTypesArr = (filterDictionary?["serviceTypes"] as? [String]) {
|
|
272
|
+
serviceTypesList = [VCLServiceType]()
|
|
273
|
+
for serviceTypeStr in serviceTypesArr {
|
|
274
|
+
let serviceType = stringToServiceType(serviceTypeStr)
|
|
275
|
+
if let st = serviceType {
|
|
276
|
+
serviceTypesList?.append(st)
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
var credentialTypesList: [String]? = nil
|
|
281
|
+
if let credentialTypesArr = (filterDictionary?["credentialTypes"] as? [String]) {
|
|
282
|
+
credentialTypesList = [String]()
|
|
283
|
+
for credentialType in credentialTypesArr {
|
|
284
|
+
credentialTypesList?.append(credentialType)
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return VCLFilter(did: did, serviceTypes: serviceTypesList, credentialTypes: credentialTypesList)
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
func dictionaryToPage(_ pageDictionary: [String: Any]?) -> VCLPage {
|
|
291
|
+
return VCLPage(
|
|
292
|
+
size: pageDictionary?["size"] as? String,
|
|
293
|
+
skip: pageDictionary?["skip"] as? String
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
func organizationsToDictionary(
|
|
298
|
+
_ organizations: VCLOrganizations
|
|
299
|
+
) -> [String: Any] {
|
|
300
|
+
var organizationsMap = [String: Any]()
|
|
301
|
+
var organizationsArr = [[String: Any]]()
|
|
302
|
+
organizations.all.forEach { organization in
|
|
303
|
+
var organizationMap = [String: Any]()
|
|
304
|
+
organizationMap["payload"] = organization.payload
|
|
305
|
+
var serviceCredentialAgentIssuersArr = [[String: Any]]()
|
|
306
|
+
organization.serviceCredentialAgentIssuers.forEach { service in
|
|
307
|
+
var serviceCredentialAgentIssuerMap = [String: Any]()
|
|
308
|
+
if let credentialTypes = service.credentialTypes {
|
|
309
|
+
serviceCredentialAgentIssuerMap["credentialTypes"] = credentialTypes
|
|
310
|
+
}
|
|
311
|
+
serviceCredentialAgentIssuerMap["id"] = service.id
|
|
312
|
+
serviceCredentialAgentIssuerMap["type"] = service.type
|
|
313
|
+
serviceCredentialAgentIssuerMap["serviceEndpoint"] = service.serviceEndpoint
|
|
314
|
+
serviceCredentialAgentIssuerMap["payload"] = service.payload
|
|
315
|
+
serviceCredentialAgentIssuersArr.append(serviceCredentialAgentIssuerMap)
|
|
316
|
+
}
|
|
317
|
+
organizationMap["serviceCredentialAgentIssuers"] = serviceCredentialAgentIssuersArr
|
|
318
|
+
organizationMap["payload"] = organization.payload
|
|
319
|
+
organizationsArr.append(organizationMap)
|
|
320
|
+
}
|
|
321
|
+
organizationsMap["all"] = organizationsArr
|
|
322
|
+
return organizationsMap
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
func dictionaryToCredentialManifestDescriptor(
|
|
326
|
+
_ credentialManifestDescriptorDictionary: [String: Any]
|
|
327
|
+
) -> VCLCredentialManifestDescriptor? {
|
|
328
|
+
if (credentialManifestDescriptorDictionary["deepLink"] != nil) {
|
|
329
|
+
return dictionaryToCredentialManifestDescriptorByDeepLink(credentialManifestDescriptorDictionary)
|
|
330
|
+
} else if (credentialManifestDescriptorDictionary["service"] != nil) {
|
|
331
|
+
if(credentialManifestDescriptorDictionary["credentialIds"] != nil) {
|
|
332
|
+
return dictionaryToCredentialManifestDescriptorRefresh(credentialManifestDescriptorDictionary)
|
|
333
|
+
} else {
|
|
334
|
+
return dictionaryToCredentialManifestDescriptorByService(credentialManifestDescriptorDictionary)
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return nil
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
func dictionaryToCredentialManifestDescriptorByDeepLink(
|
|
341
|
+
_ credentialManifestDescriptorByDeepLinkDictionary: [String: Any]
|
|
342
|
+
) -> VCLCredentialManifestDescriptorByDeepLink {
|
|
343
|
+
return VCLCredentialManifestDescriptorByDeepLink(
|
|
344
|
+
deepLink: dictionaryToDeepLink(
|
|
345
|
+
credentialManifestDescriptorByDeepLinkDictionary["deepLink"] as? [String : Any]
|
|
346
|
+
)
|
|
347
|
+
)
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
func dictionaryToCredentialManifestDescriptorByService(
|
|
351
|
+
_ credentialManifestDescriptorByServiceDictionary: [String: Any]
|
|
352
|
+
) -> VCLCredentialManifestDescriptorByService {
|
|
353
|
+
let pushDelegateDictionary = credentialManifestDescriptorByServiceDictionary["pushDelegate"] as? [String: Any]
|
|
354
|
+
let pushDelegate = VCLPushDelegate(
|
|
355
|
+
pushUrl: pushDelegateDictionary?["pushUrl"] as? String ?? "",
|
|
356
|
+
pushToken: pushDelegateDictionary?["pushToken"] as? String ?? ""
|
|
357
|
+
)
|
|
358
|
+
return VCLCredentialManifestDescriptorByService(
|
|
359
|
+
service: dictionaryToServiceCredentialAgentIssuer(
|
|
360
|
+
credentialManifestDescriptorByServiceDictionary["service"] as? [String : Any]
|
|
361
|
+
),
|
|
362
|
+
credentialTypes: credentialManifestDescriptorByServiceDictionary["credentialTypes"] as? [String],
|
|
363
|
+
pushDelegate: pushDelegate
|
|
364
|
+
)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
func dictionaryToCredentialManifestDescriptorRefresh(
|
|
368
|
+
_ credentialManifestDescriptorRefreshDictionary: [String: Any]
|
|
369
|
+
) -> VCLCredentialManifestDescriptorRefresh {
|
|
370
|
+
return VCLCredentialManifestDescriptorRefresh(
|
|
371
|
+
service: dictionaryToServiceCredentialAgentIssuer(
|
|
372
|
+
credentialManifestDescriptorRefreshDictionary["service"] as? [String : Any]
|
|
373
|
+
),
|
|
374
|
+
credentialIds: credentialManifestDescriptorRefreshDictionary["credentialIds"] as? [String] ?? [String]()
|
|
375
|
+
)
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
func dictionaryToServiceCredentialAgentIssuer(
|
|
379
|
+
_ serviceDictionary: [String: Any]?
|
|
380
|
+
) -> VCLServiceCredentialAgentIssuer {
|
|
381
|
+
return VCLServiceCredentialAgentIssuer(payload: serviceDictionary?["payload"] as? [String : Any] ?? [String: Any]())
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
func credentialManifestToDictionary(
|
|
385
|
+
_ credentialManifest: VCLCredentialManifest
|
|
386
|
+
) -> [String: Any] {
|
|
387
|
+
var credentialManifestDictinary = [String: Any]()
|
|
388
|
+
credentialManifestDictinary["jwt"] = ["encodedJwt": credentialManifest.jwt.encodedJwt]
|
|
389
|
+
credentialManifestDictinary["did"] = credentialManifest.did
|
|
390
|
+
credentialManifestDictinary["iss"] = credentialManifest.iss
|
|
391
|
+
credentialManifestDictinary["exchangeId"] = credentialManifest.exchangeId
|
|
392
|
+
credentialManifestDictinary["vendorOriginContext"] = credentialManifest.vendorOriginContext
|
|
393
|
+
return credentialManifestDictinary
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
func dictionaryToCredentialManifest(
|
|
397
|
+
_ credentialMAnifestDictionary: [String: Any]?
|
|
398
|
+
) -> VCLCredentialManifest {
|
|
399
|
+
let jwt: VCLJWT = VCLJWT(encodedJwt: (credentialMAnifestDictionary?["jwt"] as? [String: Any])?["encodedJwt"] as? String ?? "")
|
|
400
|
+
let vendorOriginContext: String? = credentialMAnifestDictionary?["vendorOriginContext"] as? String
|
|
401
|
+
return VCLCredentialManifest(jwt: jwt, vendorOriginContext: vendorOriginContext)
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
func dictionaryToGenerateOffersDescriptor(
|
|
405
|
+
_ generateOffersDescriptorDictionary: [String: Any]
|
|
406
|
+
) -> VCLGenerateOffersDescriptor {
|
|
407
|
+
let verifiableCredentialsArr = generateOffersDescriptorDictionary["identificationVerifiableCredentials"] as? [Any]
|
|
408
|
+
var verifiableCredentialsList = [VCLVerifiableCredential]()
|
|
409
|
+
if let verifiableCredentials = verifiableCredentialsArr {
|
|
410
|
+
for i in 0..<verifiableCredentials.count {
|
|
411
|
+
let verifiableCredentialDict = verifiableCredentials[i] as? [String: String]
|
|
412
|
+
verifiableCredentialsList.append(
|
|
413
|
+
VCLVerifiableCredential(
|
|
414
|
+
inputDescriptor: verifiableCredentialDict?["inputDescriptor"] ?? "",
|
|
415
|
+
jwtVc: verifiableCredentialDict?["jwtVc"] ?? ""
|
|
416
|
+
)
|
|
417
|
+
)
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return VCLGenerateOffersDescriptor(
|
|
421
|
+
credentialManifest: dictionaryToCredentialManifest(generateOffersDescriptorDictionary["credentialManifest"] as? [String: Any]),
|
|
422
|
+
types: generateOffersDescriptorDictionary["types"] as? [String],
|
|
423
|
+
offerHashes: generateOffersDescriptorDictionary["offerHashes"] as? [String],
|
|
424
|
+
identificationVerifiableCredentials: verifiableCredentialsList
|
|
425
|
+
)
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
func generatedOffersToDictionary(
|
|
429
|
+
_ offers: VCLOffers
|
|
430
|
+
) -> [String: Any] {
|
|
431
|
+
var generatedOffersDictionary = [String: Any]()
|
|
432
|
+
generatedOffersDictionary["all"] = offers.all
|
|
433
|
+
generatedOffersDictionary["responseCode"] = offers.responseCode
|
|
434
|
+
generatedOffersDictionary["token"] = tokenToDictionary(offers.token)
|
|
435
|
+
return generatedOffersDictionary
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
func credentialTypesFormSchemaToDictionary(
|
|
439
|
+
_ credentialTypesFormSchema: VCLCredentialTypesUIFormSchema
|
|
440
|
+
) -> [String: Any] {
|
|
441
|
+
var credentialTypesFormSchemaDictionary = [String: Any]()
|
|
442
|
+
credentialTypesFormSchemaDictionary["payload"] = credentialTypesFormSchema.payload
|
|
443
|
+
return credentialTypesFormSchemaDictionary
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
func dictionaryToJwt(
|
|
447
|
+
_ jwtDictionary: [String: Any]?
|
|
448
|
+
) -> VCLJWT {
|
|
449
|
+
return VCLJWT(encodedJwt: jwtDictionary?["encodedJwt"] as? String ?? "")
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
func dictionaryToPublicKey(
|
|
453
|
+
_ publicKeyDictionary: [String: Any]?
|
|
454
|
+
) -> VCLPublicKey {
|
|
455
|
+
return VCLPublicKey(jwkStr: (publicKeyDictionary?["jwkStr"] as? String ?? ""))
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
func dictionaryToFinalizedOffersDescriptor(
|
|
459
|
+
_ finalizedOffersDescriptorDictionary: [String: Any]
|
|
460
|
+
) -> VCLFinalizeOffersDescriptor {
|
|
461
|
+
return VCLFinalizeOffersDescriptor(
|
|
462
|
+
credentialManifest: dictionaryToCredentialManifest(finalizedOffersDescriptorDictionary["credentialManifest"] as? [String : Any]),
|
|
463
|
+
approvedOfferIds: finalizedOffersDescriptorDictionary["approvedOfferIds"] as? [String] ?? [String](),
|
|
464
|
+
rejectedOfferIds: finalizedOffersDescriptorDictionary["rejectedOfferIds"] as? [String] ?? [String]()
|
|
465
|
+
)
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
func jwtVerifiableCredentialsToDictionary(
|
|
469
|
+
_ jwtVerifiableCredentials: VCLJwtVerifiableCredentials
|
|
470
|
+
) -> [String: Any] {
|
|
471
|
+
var jwtVerifiableCredentialsDictionary = [String: Any]()
|
|
472
|
+
let jwtArr = jwtVerifiableCredentials.all.map {
|
|
473
|
+
$0.encodedJwt
|
|
474
|
+
}
|
|
475
|
+
jwtVerifiableCredentialsDictionary["all"] = jwtArr
|
|
476
|
+
return jwtVerifiableCredentialsDictionary
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
func jwtToReadableMap(_ jwt: VCLJWT) -> [String: Any] {
|
|
480
|
+
return ["encodedJwt": jwt.encodedJwt]
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
func readableMapToCredentialTypesUIFormSchemaDescriptor(
|
|
484
|
+
_ credentialTypesUIFormSchemaDescriptorDictionary: [String: Any]
|
|
485
|
+
) -> VCLCredentialTypesUIFormSchemaDescriptor {
|
|
486
|
+
return VCLCredentialTypesUIFormSchemaDescriptor(
|
|
487
|
+
credentialType: credentialTypesUIFormSchemaDescriptorDictionary["credentialType"] as? String ?? "",
|
|
488
|
+
countryCode: credentialTypesUIFormSchemaDescriptorDictionary["countryCode"] as? String ?? ""
|
|
489
|
+
)
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
func dictionaryToVerifiedProfileDescriptor(
|
|
493
|
+
_ verifiedProfileDescriptor: [String: Any]
|
|
494
|
+
) -> VCLVerifiedProfileDescriptor {
|
|
495
|
+
return VCLVerifiedProfileDescriptor(did: (verifiedProfileDescriptor["did"] as? String) ?? "")
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
func verifiedProfileToDictionary(
|
|
499
|
+
_ verifiedProfile: VCLVerifiedProfile
|
|
500
|
+
) -> [String: Any] {
|
|
501
|
+
var verifiedProfileDictionary = [String: Any]()
|
|
502
|
+
verifiedProfileDictionary["payload"] = verifiedProfile.payload
|
|
503
|
+
verifiedProfileDictionary["id"] = verifiedProfile.id
|
|
504
|
+
verifiedProfileDictionary["logo"] = verifiedProfile.logo
|
|
505
|
+
verifiedProfileDictionary["name"] = verifiedProfile.name
|
|
506
|
+
return verifiedProfileDictionary
|
|
507
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#import <React/RCTBridgeModule.h>
|
|
2
|
+
|
|
3
|
+
@interface RCT_EXTERN_MODULE(VclReactNative, NSObject)
|
|
4
|
+
|
|
5
|
+
RCT_EXTERN_METHOD(initialize:(NSDictionary*)environmentDictionary
|
|
6
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
7
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
8
|
+
|
|
9
|
+
RCT_EXTERN_METHOD(getCountries:(RCTPromiseResolveBlock)resolve
|
|
10
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
11
|
+
|
|
12
|
+
RCT_EXTERN_METHOD(getCredentialTypeSchemas:(RCTPromiseResolveBlock)resolve
|
|
13
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
14
|
+
|
|
15
|
+
RCT_EXTERN_METHOD(getCredentialTypes:(RCTPromiseResolveBlock)resolve
|
|
16
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
17
|
+
|
|
18
|
+
RCT_EXTERN_METHOD(getPresentationRequest:(NSDictionary*)deepLink
|
|
19
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
20
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
21
|
+
|
|
22
|
+
RCT_EXTERN_METHOD(submitPresentation:(NSDictionary*)presentationSubmissionDictionary
|
|
23
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
24
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
25
|
+
|
|
26
|
+
RCT_EXTERN_METHOD(getExchangeProgress:(NSDictionary*)exchangeDescriptorDictionary
|
|
27
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
28
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
29
|
+
|
|
30
|
+
RCT_EXTERN_METHOD(searchForOrganizations:(NSDictionary*)organizationsSearchDescriptorDictionary
|
|
31
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
32
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
33
|
+
|
|
34
|
+
RCT_EXTERN_METHOD(getCredentialManifest:(NSDictionary*)credentialManifestDescriptorDictionary
|
|
35
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
36
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
37
|
+
|
|
38
|
+
RCT_EXTERN_METHOD(generateOffers:(NSDictionary*)generateOffersDescriptorDictionary
|
|
39
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
40
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
41
|
+
|
|
42
|
+
RCT_EXTERN_METHOD(checkForOffers:(NSDictionary*)generateOffersDescriptorDictionary
|
|
43
|
+
withTokenDictionary:(NSDictionary*)tokenDictionary
|
|
44
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
45
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
46
|
+
|
|
47
|
+
RCT_EXTERN_METHOD(finalizeOffers:(NSDictionary*)finalizeOffersDescriptorDictionary
|
|
48
|
+
withTokenDictionary:(NSDictionary*)tokenDictionary
|
|
49
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
50
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
51
|
+
|
|
52
|
+
RCT_EXTERN_METHOD(getCredentialTypesUIFormSchema:(NSDictionary*)credentialTypesUIFormSchemaDescriptorDictionary
|
|
53
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
54
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
55
|
+
|
|
56
|
+
RCT_EXTERN_METHOD(getVerifiedProfile:(NSDictionary*)verifiedProfileDescriptorDictionary
|
|
57
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
58
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
59
|
+
|
|
60
|
+
RCT_EXTERN_METHOD(verifyJwt:(NSDictionary*)jwtDictionary
|
|
61
|
+
withPublicKeyDictionary:(NSDictionary*)publicKeyDictionary
|
|
62
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
63
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
64
|
+
|
|
65
|
+
RCT_EXTERN_METHOD(generateSignedJwt:(NSDictionary*)jwtDictionary
|
|
66
|
+
withIss:(NSString*)iss
|
|
67
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
68
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
69
|
+
|
|
70
|
+
@end
|