@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,88 @@
|
|
|
1
|
+
package io.velocitycareerlabs.reactnative.extensions
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap
|
|
5
|
+
import com.facebook.react.bridge.WritableArray
|
|
6
|
+
import java.lang.Exception
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Created by Michael Avoyan on 25/10/2021.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
fun ReadableArray.getBooleanOpt(index: Int): Boolean? {
|
|
13
|
+
return try {
|
|
14
|
+
this.getBoolean(index)
|
|
15
|
+
} catch (e: Exception) {
|
|
16
|
+
e.printStackTrace()
|
|
17
|
+
null
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
fun WritableArray.getBooleanOpt(index: Int): Boolean? {
|
|
22
|
+
return (this as ReadableArray).getBooleanOpt(index)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
fun ReadableArray.getDoubleOpt(index: Int): Double? {
|
|
26
|
+
return try {
|
|
27
|
+
this.getDouble(index)
|
|
28
|
+
} catch (e: Exception) {
|
|
29
|
+
e.printStackTrace()
|
|
30
|
+
null
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fun WritableArray.getDoubleOpt(index: Int): Double? {
|
|
35
|
+
return (this as ReadableArray).getDoubleOpt(index)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
fun ReadableArray.getIntOpt(index: Int): Int? {
|
|
39
|
+
return try {
|
|
40
|
+
this.getInt(index)
|
|
41
|
+
} catch (e: Exception) {
|
|
42
|
+
e.printStackTrace()
|
|
43
|
+
null
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
fun WritableArray.getIntOpt(index: Int): Int? {
|
|
48
|
+
return (this as ReadableArray).getIntOpt(index)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
fun ReadableArray.getStringOpt(index: Int): String? {
|
|
52
|
+
return try {
|
|
53
|
+
this.getString(index)
|
|
54
|
+
} catch (e: Exception) {
|
|
55
|
+
e.printStackTrace()
|
|
56
|
+
null
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
fun WritableArray.getStringOpt(index: Int): String? {
|
|
61
|
+
return (this as ReadableArray).getStringOpt(index)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
fun ReadableArray.getArrayOpt(index: Int): ReadableArray? {
|
|
65
|
+
return try {
|
|
66
|
+
this.getArray(index)
|
|
67
|
+
} catch (e: Exception) {
|
|
68
|
+
e.printStackTrace()
|
|
69
|
+
null
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
fun WritableArray.getArrayOpt(index: Int): ReadableArray? {
|
|
74
|
+
return (this as ReadableArray).getArrayOpt(index)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
fun ReadableArray.getMapOpt(index: Int): ReadableMap? {
|
|
78
|
+
return try {
|
|
79
|
+
this.getMap(index)
|
|
80
|
+
} catch (e: Exception) {
|
|
81
|
+
e.printStackTrace()
|
|
82
|
+
null
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
fun WritableArray.getMapOpt(index: Int): ReadableMap? {
|
|
87
|
+
return (this as ReadableArray).getMapOpt(index)
|
|
88
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
package io.velocitycareerlabs.reactnative.extensions
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.*
|
|
4
|
+
import org.json.JSONArray
|
|
5
|
+
import org.json.JSONException
|
|
6
|
+
import org.json.JSONObject
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Created by Michael Avoyan on 01/07/2021.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
@Throws(JSONException::class)
|
|
13
|
+
fun JSONObject.toWritableMap(): WritableMap {
|
|
14
|
+
val map = Arguments.createMap()
|
|
15
|
+
val keysItr: Iterator<String> = this.keys()
|
|
16
|
+
while (keysItr.hasNext()) {
|
|
17
|
+
val key = keysItr.next()
|
|
18
|
+
var value: Any = this.get(key)
|
|
19
|
+
if (value is JSONArray) {
|
|
20
|
+
value = value.toWritableArray()
|
|
21
|
+
} else if (value is JSONObject) {
|
|
22
|
+
value = value.toWritableMap()
|
|
23
|
+
}
|
|
24
|
+
when (value) {
|
|
25
|
+
is Boolean -> map.putBoolean(key, value)
|
|
26
|
+
is Double -> map.putDouble(key, value)
|
|
27
|
+
is Int -> map.putInt(key, value)
|
|
28
|
+
is String -> map.putString(key, value)
|
|
29
|
+
is ReadableMap -> map.putMap(key, value)
|
|
30
|
+
is WritableMap -> map.putMap(key, value)
|
|
31
|
+
is ReadableArray -> map.putArray(key, value)
|
|
32
|
+
is WritableArray -> map.putArray(key, value)
|
|
33
|
+
else -> map.putNull(key)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return map
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
fun JSONObject.toReadableMap(): ReadableMap = toWritableMap()
|
|
40
|
+
|
|
41
|
+
@Throws(JSONException::class)
|
|
42
|
+
fun JSONArray.toWritableArray(): WritableArray {
|
|
43
|
+
val array = Arguments.createArray()
|
|
44
|
+
for (i in 0 until this.length()) {
|
|
45
|
+
var value: Any = this[i]
|
|
46
|
+
if (value is JSONArray) {
|
|
47
|
+
value = value.toWritableArray()
|
|
48
|
+
} else if (value is JSONObject) {
|
|
49
|
+
value = value.toWritableMap()
|
|
50
|
+
}
|
|
51
|
+
when (value) {
|
|
52
|
+
is Boolean -> array.pushBoolean(value)
|
|
53
|
+
is Double -> array.pushDouble(value)
|
|
54
|
+
is Int -> array.pushInt(value)
|
|
55
|
+
is String -> array.pushString(value)
|
|
56
|
+
is ReadableArray -> array.pushArray(value)
|
|
57
|
+
is WritableArray -> array.pushArray(value)
|
|
58
|
+
is ReadableMap -> array.pushMap(value)
|
|
59
|
+
is WritableMap -> array.pushMap(value)
|
|
60
|
+
else -> array.pushNull()
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return array
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
fun JSONArray.toReadableArray(): ReadableArray = toWritableArray()
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
package io.velocitycareerlabs.reactnative.extensions
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap
|
|
5
|
+
import com.facebook.react.bridge.WritableMap
|
|
6
|
+
import java.lang.Exception
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Created by Michael Avoyan on 25/10/2021.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
fun ReadableMap.getBooleanOpt(key: String): Boolean? {
|
|
13
|
+
return try {
|
|
14
|
+
this.getBoolean(key)
|
|
15
|
+
} catch (e: Exception) {
|
|
16
|
+
e.printStackTrace()
|
|
17
|
+
null
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
fun WritableMap.getBooleanOpt(key: String): Boolean? {
|
|
22
|
+
return (this as ReadableMap).getBooleanOpt(key)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
fun ReadableMap.getDoubleOpt(key: String): Double? {
|
|
26
|
+
return try {
|
|
27
|
+
this.getDouble(key)
|
|
28
|
+
} catch (e: Exception) {
|
|
29
|
+
e.printStackTrace()
|
|
30
|
+
null
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fun WritableMap.getDoubleOpt(key: String): Double? {
|
|
35
|
+
return (this as ReadableMap).getDoubleOpt(key)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
fun ReadableMap.getIntOpt(key: String): Int? {
|
|
39
|
+
return try {
|
|
40
|
+
this.getInt(key)
|
|
41
|
+
} catch (e: Exception) {
|
|
42
|
+
e.printStackTrace()
|
|
43
|
+
null
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
fun WritableMap.getIntOpt(key: String): Int? {
|
|
48
|
+
return (this as ReadableMap).getIntOpt(key)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
fun ReadableMap.getStringOpt(key: String): String? {
|
|
52
|
+
return try {
|
|
53
|
+
this.getString(key)
|
|
54
|
+
} catch (e: Exception) {
|
|
55
|
+
e.printStackTrace()
|
|
56
|
+
null
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
fun WritableMap.getStringOpt(key: String): String? {
|
|
61
|
+
return (this as ReadableMap).getStringOpt(key)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
fun ReadableMap.getArrayOpt(key: String): ReadableArray? {
|
|
65
|
+
return try {
|
|
66
|
+
this.getArray(key)
|
|
67
|
+
} catch (e: Exception) {
|
|
68
|
+
e.printStackTrace()
|
|
69
|
+
null
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
fun WritableMap.getArrayOpt(key: String): ReadableArray? {
|
|
74
|
+
return (this as ReadableMap).getArrayOpt(key)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
fun ReadableMap.getMapOpt(key: String): ReadableMap? {
|
|
78
|
+
return try {
|
|
79
|
+
this.getMap(key)
|
|
80
|
+
} catch (e: Exception) {
|
|
81
|
+
e.printStackTrace()
|
|
82
|
+
null
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
fun WritableMap.getMapOpt(key: String): ReadableMap? {
|
|
87
|
+
return (this as ReadableMap).getMapOpt(key)
|
|
88
|
+
}
|
|
89
|
+
|
package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/RNCollectionExtensions.kt
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
package io.velocitycareerlabs.reactnative.extensions
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.*
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Created by Michael Avoyan on 01/07/2021.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
fun Map<String, Any>.toWritableMap(): WritableMap {
|
|
10
|
+
val writableMap = Arguments.createMap()
|
|
11
|
+
val keys: Set<String> = this.keys
|
|
12
|
+
keys.forEach{ key ->
|
|
13
|
+
var value: Any? = this[key]
|
|
14
|
+
if (value is List<*>) {
|
|
15
|
+
value = (value as? List<Any>)?.toWritableArray()
|
|
16
|
+
} else if (value is Map<*,*>) {
|
|
17
|
+
value = (value as? Map<String, Any>)?.toWritableMap()
|
|
18
|
+
}
|
|
19
|
+
when (value) {
|
|
20
|
+
is Boolean -> writableMap.putBoolean(key, value)
|
|
21
|
+
is Double -> writableMap.putDouble(key, value)
|
|
22
|
+
is Int -> writableMap.putInt(key, value)
|
|
23
|
+
is String -> writableMap.putString(key, value)
|
|
24
|
+
is WritableMap -> writableMap.putMap(key, value)
|
|
25
|
+
is WritableArray -> writableMap.putArray(key, value)
|
|
26
|
+
else -> {
|
|
27
|
+
value?.let { throw IllegalArgumentException("Unsupported value type ${value::class.java.name} for key [$key]") }
|
|
28
|
+
?: throw IllegalArgumentException("Unsupported value type NULL for key [$key]")
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return writableMap
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
fun Map<String, Any>.toReadableMap(): ReadableMap = toWritableMap()
|
|
36
|
+
|
|
37
|
+
fun List<Any>.toWritableArray(): WritableArray {
|
|
38
|
+
val writableArray = Arguments.createArray()
|
|
39
|
+
for (element in this) {
|
|
40
|
+
var value: Any? = element
|
|
41
|
+
if (value is List<*>) {
|
|
42
|
+
value = (value as? List<Any>)?.toWritableArray()
|
|
43
|
+
} else if (value is Map<*,*>) {
|
|
44
|
+
value = (value as? Map<String, Any>)?.toWritableMap()
|
|
45
|
+
}
|
|
46
|
+
when (value) {
|
|
47
|
+
is Boolean -> writableArray.pushBoolean(value)
|
|
48
|
+
is Double -> writableArray.pushDouble(value)
|
|
49
|
+
is Int -> writableArray.pushInt(value)
|
|
50
|
+
is String -> writableArray.pushString(value)
|
|
51
|
+
is WritableArray -> writableArray.pushArray(value)
|
|
52
|
+
is WritableMap -> writableArray.pushMap(value)
|
|
53
|
+
else -> {
|
|
54
|
+
value?.let { throw IllegalArgumentException("Unsupported type ${value::class.java.name}") }
|
|
55
|
+
?: throw IllegalArgumentException("Unsupported type NULL")
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return writableArray
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
fun List<Any>.toReadableArray(): ReadableArray = toWritableArray()
|