@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.
Files changed (308) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +126 -0
  3. package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
  4. package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  5. package/android/.gradle/7.4.2/dependencies-accessors/gc.properties +0 -0
  6. package/android/.gradle/7.4.2/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/7.4.2/gc.properties +0 -0
  10. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  11. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  12. package/android/.gradle/vcs-1/gc.properties +0 -0
  13. package/android/build.gradle +134 -0
  14. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  15. package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  16. package/android/gradle.properties +4 -0
  17. package/android/src/main/AndroidManifest.xml +3 -0
  18. package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativeModule.kt +320 -0
  19. package/android/src/main/java/io/velocitycareerlabs/reactnative/VclReactNativePackage.kt +19 -0
  20. package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/ArrayExtensions.kt +88 -0
  21. package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/JSONExtensions.kt +66 -0
  22. package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/MapExtensions.kt +89 -0
  23. package/android/src/main/java/io/velocitycareerlabs/reactnative/extensions/RNCollectionExtensions.kt +62 -0
  24. package/android/src/main/java/io/velocitycareerlabs/reactnative/utlis/Converter.kt +514 -0
  25. package/ios/Extensions/StringExtensions.swift +21 -0
  26. package/ios/Utils/Converter.swift +507 -0
  27. package/ios/VclReactNative-Bridging-Header.h +2 -0
  28. package/ios/VclReactNative.m +70 -0
  29. package/ios/VclReactNative.swift +249 -0
  30. package/ios/VclReactNative.xcodeproj/project.pbxproj +303 -0
  31. package/lib/commonjs/api/Dictionary.js +2 -0
  32. package/lib/commonjs/api/Dictionary.js.map +1 -0
  33. package/lib/commonjs/api/VCLApi.js +6 -0
  34. package/lib/commonjs/api/VCLApi.js.map +1 -0
  35. package/lib/commonjs/api/VCLEnvironment.js +15 -0
  36. package/lib/commonjs/api/VCLEnvironment.js.map +1 -0
  37. package/lib/commonjs/api/entities/VCLCountries.js +263 -0
  38. package/lib/commonjs/api/entities/VCLCountries.js.map +1 -0
  39. package/lib/commonjs/api/entities/VCLCountry.js +6 -0
  40. package/lib/commonjs/api/entities/VCLCountry.js.map +1 -0
  41. package/lib/commonjs/api/entities/VCLCredentialManifest.js +6 -0
  42. package/lib/commonjs/api/entities/VCLCredentialManifest.js.map +1 -0
  43. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptor.js +6 -0
  44. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptor.js.map +1 -0
  45. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByDeepLink.js +6 -0
  46. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByDeepLink.js.map +1 -0
  47. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByService.js +6 -0
  48. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorByService.js.map +1 -0
  49. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorRefresh.js +6 -0
  50. package/lib/commonjs/api/entities/VCLCredentialManifestDescriptorRefresh.js.map +1 -0
  51. package/lib/commonjs/api/entities/VCLCredentialType.js +6 -0
  52. package/lib/commonjs/api/entities/VCLCredentialType.js.map +1 -0
  53. package/lib/commonjs/api/entities/VCLCredentialTypeSchema.js +6 -0
  54. package/lib/commonjs/api/entities/VCLCredentialTypeSchema.js.map +1 -0
  55. package/lib/commonjs/api/entities/VCLCredentialTypeSchemas.js +6 -0
  56. package/lib/commonjs/api/entities/VCLCredentialTypeSchemas.js.map +1 -0
  57. package/lib/commonjs/api/entities/VCLCredentialTypes.js +6 -0
  58. package/lib/commonjs/api/entities/VCLCredentialTypes.js.map +1 -0
  59. package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchema.js +6 -0
  60. package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchema.js.map +1 -0
  61. package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js +2 -0
  62. package/lib/commonjs/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js.map +1 -0
  63. package/lib/commonjs/api/entities/VCLDeepLink.js +2 -0
  64. package/lib/commonjs/api/entities/VCLDeepLink.js.map +1 -0
  65. package/lib/commonjs/api/entities/VCLError.js +2 -0
  66. package/lib/commonjs/api/entities/VCLError.js.map +1 -0
  67. package/lib/commonjs/api/entities/VCLExchange.js +2 -0
  68. package/lib/commonjs/api/entities/VCLExchange.js.map +1 -0
  69. package/lib/commonjs/api/entities/VCLExchangeDescriptor.js +6 -0
  70. package/lib/commonjs/api/entities/VCLExchangeDescriptor.js.map +1 -0
  71. package/lib/commonjs/api/entities/VCLFilter.js +6 -0
  72. package/lib/commonjs/api/entities/VCLFilter.js.map +1 -0
  73. package/lib/commonjs/api/entities/VCLFinalizeOffersDescriptor.js +6 -0
  74. package/lib/commonjs/api/entities/VCLFinalizeOffersDescriptor.js.map +1 -0
  75. package/lib/commonjs/api/entities/VCLGenerateOffersDescriptor.js +6 -0
  76. package/lib/commonjs/api/entities/VCLGenerateOffersDescriptor.js.map +1 -0
  77. package/lib/commonjs/api/entities/VCLJWT.js +2 -0
  78. package/lib/commonjs/api/entities/VCLJWT.js.map +1 -0
  79. package/lib/commonjs/api/entities/VCLJwtVerifiableCredentials.js +6 -0
  80. package/lib/commonjs/api/entities/VCLJwtVerifiableCredentials.js.map +1 -0
  81. package/lib/commonjs/api/entities/VCLOffers.js +6 -0
  82. package/lib/commonjs/api/entities/VCLOffers.js.map +1 -0
  83. package/lib/commonjs/api/entities/VCLOrganization.js +6 -0
  84. package/lib/commonjs/api/entities/VCLOrganization.js.map +1 -0
  85. package/lib/commonjs/api/entities/VCLOrganizations.js +6 -0
  86. package/lib/commonjs/api/entities/VCLOrganizations.js.map +1 -0
  87. package/lib/commonjs/api/entities/VCLOrganizationsSearchDescriptor.js +6 -0
  88. package/lib/commonjs/api/entities/VCLOrganizationsSearchDescriptor.js.map +1 -0
  89. package/lib/commonjs/api/entities/VCLPage.js +2 -0
  90. package/lib/commonjs/api/entities/VCLPage.js.map +1 -0
  91. package/lib/commonjs/api/entities/VCLPresentationRequest.js +6 -0
  92. package/lib/commonjs/api/entities/VCLPresentationRequest.js.map +1 -0
  93. package/lib/commonjs/api/entities/VCLPresentationSubmission.js +6 -0
  94. package/lib/commonjs/api/entities/VCLPresentationSubmission.js.map +1 -0
  95. package/lib/commonjs/api/entities/VCLPresentationSubmissionResult.js +6 -0
  96. package/lib/commonjs/api/entities/VCLPresentationSubmissionResult.js.map +1 -0
  97. package/lib/commonjs/api/entities/VCLPublicKey.js +2 -0
  98. package/lib/commonjs/api/entities/VCLPublicKey.js.map +1 -0
  99. package/lib/commonjs/api/entities/VCLPushDelegate.js +2 -0
  100. package/lib/commonjs/api/entities/VCLPushDelegate.js.map +1 -0
  101. package/lib/commonjs/api/entities/VCLRegion.js +6 -0
  102. package/lib/commonjs/api/entities/VCLRegion.js.map +1 -0
  103. package/lib/commonjs/api/entities/VCLRegions.js +6 -0
  104. package/lib/commonjs/api/entities/VCLRegions.js.map +1 -0
  105. package/lib/commonjs/api/entities/VCLService.js +6 -0
  106. package/lib/commonjs/api/entities/VCLService.js.map +1 -0
  107. package/lib/commonjs/api/entities/VCLServiceCredentialAgentIssuer.js +6 -0
  108. package/lib/commonjs/api/entities/VCLServiceCredentialAgentIssuer.js.map +1 -0
  109. package/lib/commonjs/api/entities/VCLServiceType.js +20 -0
  110. package/lib/commonjs/api/entities/VCLServiceType.js.map +1 -0
  111. package/lib/commonjs/api/entities/VCLSubmissionResult.js +6 -0
  112. package/lib/commonjs/api/entities/VCLSubmissionResult.js.map +1 -0
  113. package/lib/commonjs/api/entities/VCLToken.js +2 -0
  114. package/lib/commonjs/api/entities/VCLToken.js.map +1 -0
  115. package/lib/commonjs/api/entities/VCLVerifiableCredential.js +2 -0
  116. package/lib/commonjs/api/entities/VCLVerifiableCredential.js.map +1 -0
  117. package/lib/commonjs/api/entities/VCLVerifiedProfile.js +6 -0
  118. package/lib/commonjs/api/entities/VCLVerifiedProfile.js.map +1 -0
  119. package/lib/commonjs/api/entities/VCLVerifiedProfileDescriptor.js +2 -0
  120. package/lib/commonjs/api/entities/VCLVerifiedProfileDescriptor.js.map +1 -0
  121. package/lib/commonjs/index.js +39 -0
  122. package/lib/commonjs/index.js.map +1 -0
  123. package/lib/module/api/Dictionary.js +2 -0
  124. package/lib/module/api/Dictionary.js.map +1 -0
  125. package/lib/module/api/VCLApi.js +2 -0
  126. package/lib/module/api/VCLApi.js.map +1 -0
  127. package/lib/module/api/VCLEnvironment.js +8 -0
  128. package/lib/module/api/VCLEnvironment.js.map +1 -0
  129. package/lib/module/api/entities/VCLCountries.js +256 -0
  130. package/lib/module/api/entities/VCLCountries.js.map +1 -0
  131. package/lib/module/api/entities/VCLCountry.js +2 -0
  132. package/lib/module/api/entities/VCLCountry.js.map +1 -0
  133. package/lib/module/api/entities/VCLCredentialManifest.js +2 -0
  134. package/lib/module/api/entities/VCLCredentialManifest.js.map +1 -0
  135. package/lib/module/api/entities/VCLCredentialManifestDescriptor.js +2 -0
  136. package/lib/module/api/entities/VCLCredentialManifestDescriptor.js.map +1 -0
  137. package/lib/module/api/entities/VCLCredentialManifestDescriptorByDeepLink.js +2 -0
  138. package/lib/module/api/entities/VCLCredentialManifestDescriptorByDeepLink.js.map +1 -0
  139. package/lib/module/api/entities/VCLCredentialManifestDescriptorByService.js +2 -0
  140. package/lib/module/api/entities/VCLCredentialManifestDescriptorByService.js.map +1 -0
  141. package/lib/module/api/entities/VCLCredentialManifestDescriptorRefresh.js +2 -0
  142. package/lib/module/api/entities/VCLCredentialManifestDescriptorRefresh.js.map +1 -0
  143. package/lib/module/api/entities/VCLCredentialType.js +2 -0
  144. package/lib/module/api/entities/VCLCredentialType.js.map +1 -0
  145. package/lib/module/api/entities/VCLCredentialTypeSchema.js +2 -0
  146. package/lib/module/api/entities/VCLCredentialTypeSchema.js.map +1 -0
  147. package/lib/module/api/entities/VCLCredentialTypeSchemas.js +2 -0
  148. package/lib/module/api/entities/VCLCredentialTypeSchemas.js.map +1 -0
  149. package/lib/module/api/entities/VCLCredentialTypes.js +2 -0
  150. package/lib/module/api/entities/VCLCredentialTypes.js.map +1 -0
  151. package/lib/module/api/entities/VCLCredentialTypesUIFormSchema.js +2 -0
  152. package/lib/module/api/entities/VCLCredentialTypesUIFormSchema.js.map +1 -0
  153. package/lib/module/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js +2 -0
  154. package/lib/module/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.js.map +1 -0
  155. package/lib/module/api/entities/VCLDeepLink.js +2 -0
  156. package/lib/module/api/entities/VCLDeepLink.js.map +1 -0
  157. package/lib/module/api/entities/VCLError.js +2 -0
  158. package/lib/module/api/entities/VCLError.js.map +1 -0
  159. package/lib/module/api/entities/VCLExchange.js +2 -0
  160. package/lib/module/api/entities/VCLExchange.js.map +1 -0
  161. package/lib/module/api/entities/VCLExchangeDescriptor.js +2 -0
  162. package/lib/module/api/entities/VCLExchangeDescriptor.js.map +1 -0
  163. package/lib/module/api/entities/VCLFilter.js +2 -0
  164. package/lib/module/api/entities/VCLFilter.js.map +1 -0
  165. package/lib/module/api/entities/VCLFinalizeOffersDescriptor.js +2 -0
  166. package/lib/module/api/entities/VCLFinalizeOffersDescriptor.js.map +1 -0
  167. package/lib/module/api/entities/VCLGenerateOffersDescriptor.js +2 -0
  168. package/lib/module/api/entities/VCLGenerateOffersDescriptor.js.map +1 -0
  169. package/lib/module/api/entities/VCLJWT.js +2 -0
  170. package/lib/module/api/entities/VCLJWT.js.map +1 -0
  171. package/lib/module/api/entities/VCLJwtVerifiableCredentials.js +2 -0
  172. package/lib/module/api/entities/VCLJwtVerifiableCredentials.js.map +1 -0
  173. package/lib/module/api/entities/VCLOffers.js +2 -0
  174. package/lib/module/api/entities/VCLOffers.js.map +1 -0
  175. package/lib/module/api/entities/VCLOrganization.js +2 -0
  176. package/lib/module/api/entities/VCLOrganization.js.map +1 -0
  177. package/lib/module/api/entities/VCLOrganizations.js +2 -0
  178. package/lib/module/api/entities/VCLOrganizations.js.map +1 -0
  179. package/lib/module/api/entities/VCLOrganizationsSearchDescriptor.js +2 -0
  180. package/lib/module/api/entities/VCLOrganizationsSearchDescriptor.js.map +1 -0
  181. package/lib/module/api/entities/VCLPage.js +2 -0
  182. package/lib/module/api/entities/VCLPage.js.map +1 -0
  183. package/lib/module/api/entities/VCLPresentationRequest.js +2 -0
  184. package/lib/module/api/entities/VCLPresentationRequest.js.map +1 -0
  185. package/lib/module/api/entities/VCLPresentationSubmission.js +2 -0
  186. package/lib/module/api/entities/VCLPresentationSubmission.js.map +1 -0
  187. package/lib/module/api/entities/VCLPresentationSubmissionResult.js +2 -0
  188. package/lib/module/api/entities/VCLPresentationSubmissionResult.js.map +1 -0
  189. package/lib/module/api/entities/VCLPublicKey.js +2 -0
  190. package/lib/module/api/entities/VCLPublicKey.js.map +1 -0
  191. package/lib/module/api/entities/VCLPushDelegate.js +2 -0
  192. package/lib/module/api/entities/VCLPushDelegate.js.map +1 -0
  193. package/lib/module/api/entities/VCLRegion.js +2 -0
  194. package/lib/module/api/entities/VCLRegion.js.map +1 -0
  195. package/lib/module/api/entities/VCLRegions.js +2 -0
  196. package/lib/module/api/entities/VCLRegions.js.map +1 -0
  197. package/lib/module/api/entities/VCLService.js +2 -0
  198. package/lib/module/api/entities/VCLService.js.map +1 -0
  199. package/lib/module/api/entities/VCLServiceCredentialAgentIssuer.js +2 -0
  200. package/lib/module/api/entities/VCLServiceCredentialAgentIssuer.js.map +1 -0
  201. package/lib/module/api/entities/VCLServiceType.js +13 -0
  202. package/lib/module/api/entities/VCLServiceType.js.map +1 -0
  203. package/lib/module/api/entities/VCLSubmissionResult.js +2 -0
  204. package/lib/module/api/entities/VCLSubmissionResult.js.map +1 -0
  205. package/lib/module/api/entities/VCLToken.js +2 -0
  206. package/lib/module/api/entities/VCLToken.js.map +1 -0
  207. package/lib/module/api/entities/VCLVerifiableCredential.js +2 -0
  208. package/lib/module/api/entities/VCLVerifiableCredential.js.map +1 -0
  209. package/lib/module/api/entities/VCLVerifiedProfile.js +2 -0
  210. package/lib/module/api/entities/VCLVerifiedProfile.js.map +1 -0
  211. package/lib/module/api/entities/VCLVerifiedProfileDescriptor.js +2 -0
  212. package/lib/module/api/entities/VCLVerifiedProfileDescriptor.js.map +1 -0
  213. package/lib/module/index.js +10 -0
  214. package/lib/module/index.js.map +1 -0
  215. package/lib/typescript/api/Dictionary.d.ts +3 -0
  216. package/lib/typescript/api/VCLApi.d.ts +44 -0
  217. package/lib/typescript/api/VCLEnvironment.d.ts +8 -0
  218. package/lib/typescript/api/entities/VCLCountries.d.ts +257 -0
  219. package/lib/typescript/api/entities/VCLCountry.d.ts +8 -0
  220. package/lib/typescript/api/entities/VCLCredentialManifest.d.ts +8 -0
  221. package/lib/typescript/api/entities/VCLCredentialManifestDescriptor.d.ts +5 -0
  222. package/lib/typescript/api/entities/VCLCredentialManifestDescriptorByDeepLink.d.ts +5 -0
  223. package/lib/typescript/api/entities/VCLCredentialManifestDescriptorByService.d.ts +5 -0
  224. package/lib/typescript/api/entities/VCLCredentialManifestDescriptorRefresh.d.ts +6 -0
  225. package/lib/typescript/api/entities/VCLCredentialType.d.ts +10 -0
  226. package/lib/typescript/api/entities/VCLCredentialTypeSchema.d.ts +4 -0
  227. package/lib/typescript/api/entities/VCLCredentialTypeSchemas.d.ts +5 -0
  228. package/lib/typescript/api/entities/VCLCredentialTypes.d.ts +5 -0
  229. package/lib/typescript/api/entities/VCLCredentialTypesUIFormSchema.d.ts +4 -0
  230. package/lib/typescript/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.d.ts +4 -0
  231. package/lib/typescript/api/entities/VCLDeepLink.d.ts +3 -0
  232. package/lib/typescript/api/entities/VCLError.d.ts +4 -0
  233. package/lib/typescript/api/entities/VCLExchange.d.ts +6 -0
  234. package/lib/typescript/api/entities/VCLExchangeDescriptor.d.ts +6 -0
  235. package/lib/typescript/api/entities/VCLFilter.d.ts +6 -0
  236. package/lib/typescript/api/entities/VCLFinalizeOffersDescriptor.d.ts +6 -0
  237. package/lib/typescript/api/entities/VCLGenerateOffersDescriptor.d.ts +8 -0
  238. package/lib/typescript/api/entities/VCLJWT.d.ts +3 -0
  239. package/lib/typescript/api/entities/VCLJwtVerifiableCredentials.d.ts +4 -0
  240. package/lib/typescript/api/entities/VCLOffers.d.ts +7 -0
  241. package/lib/typescript/api/entities/VCLOrganization.d.ts +6 -0
  242. package/lib/typescript/api/entities/VCLOrganizations.d.ts +4 -0
  243. package/lib/typescript/api/entities/VCLOrganizationsSearchDescriptor.d.ts +8 -0
  244. package/lib/typescript/api/entities/VCLPage.d.ts +4 -0
  245. package/lib/typescript/api/entities/VCLPresentationRequest.d.ts +10 -0
  246. package/lib/typescript/api/entities/VCLPresentationSubmission.d.ts +6 -0
  247. package/lib/typescript/api/entities/VCLPresentationSubmissionResult.d.ts +6 -0
  248. package/lib/typescript/api/entities/VCLPublicKey.d.ts +3 -0
  249. package/lib/typescript/api/entities/VCLPushDelegate.d.ts +4 -0
  250. package/lib/typescript/api/entities/VCLRegion.d.ts +6 -0
  251. package/lib/typescript/api/entities/VCLRegions.d.ts +5 -0
  252. package/lib/typescript/api/entities/VCLService.d.ts +4 -0
  253. package/lib/typescript/api/entities/VCLServiceCredentialAgentIssuer.d.ts +3 -0
  254. package/lib/typescript/api/entities/VCLServiceType.d.ts +10 -0
  255. package/lib/typescript/api/entities/VCLSubmissionResult.d.ts +6 -0
  256. package/lib/typescript/api/entities/VCLToken.d.ts +3 -0
  257. package/lib/typescript/api/entities/VCLVerifiableCredential.d.ts +4 -0
  258. package/lib/typescript/api/entities/VCLVerifiedProfile.d.ts +8 -0
  259. package/lib/typescript/api/entities/VCLVerifiedProfileDescriptor.d.ts +3 -0
  260. package/lib/typescript/index.d.ts +49 -0
  261. package/package.json +154 -0
  262. package/src/api/Dictionary.tsx +3 -0
  263. package/src/api/VCLApi.tsx +80 -0
  264. package/src/api/VCLEnvironment.tsx +9 -0
  265. package/src/api/entities/VCLCountries.tsx +259 -0
  266. package/src/api/entities/VCLCountry.tsx +9 -0
  267. package/src/api/entities/VCLCredentialManifest.tsx +9 -0
  268. package/src/api/entities/VCLCredentialManifestDescriptor.tsx +6 -0
  269. package/src/api/entities/VCLCredentialManifestDescriptorByDeepLink.tsx +7 -0
  270. package/src/api/entities/VCLCredentialManifestDescriptorByService.tsx +7 -0
  271. package/src/api/entities/VCLCredentialManifestDescriptorRefresh.tsx +8 -0
  272. package/src/api/entities/VCLCredentialType.tsx +11 -0
  273. package/src/api/entities/VCLCredentialTypeSchema.tsx +5 -0
  274. package/src/api/entities/VCLCredentialTypeSchemas.tsx +6 -0
  275. package/src/api/entities/VCLCredentialTypes.tsx +6 -0
  276. package/src/api/entities/VCLCredentialTypesUIFormSchema.tsx +5 -0
  277. package/src/api/entities/VCLCredentialTypesUIFormSchemaDescriptor.tsx +4 -0
  278. package/src/api/entities/VCLDeepLink.tsx +3 -0
  279. package/src/api/entities/VCLError.tsx +4 -0
  280. package/src/api/entities/VCLExchange.tsx +6 -0
  281. package/src/api/entities/VCLExchangeDescriptor.tsx +7 -0
  282. package/src/api/entities/VCLFilter.tsx +7 -0
  283. package/src/api/entities/VCLFinalizeOffersDescriptor.tsx +7 -0
  284. package/src/api/entities/VCLGenerateOffersDescriptor.tsx +9 -0
  285. package/src/api/entities/VCLJWT.tsx +3 -0
  286. package/src/api/entities/VCLJwtVerifiableCredentials.tsx +5 -0
  287. package/src/api/entities/VCLOffers.tsx +8 -0
  288. package/src/api/entities/VCLOrganization.tsx +7 -0
  289. package/src/api/entities/VCLOrganizations.tsx +5 -0
  290. package/src/api/entities/VCLOrganizationsSearchDescriptor.tsx +9 -0
  291. package/src/api/entities/VCLPage.tsx +4 -0
  292. package/src/api/entities/VCLPresentationRequest.tsx +11 -0
  293. package/src/api/entities/VCLPresentationSubmission.tsx +7 -0
  294. package/src/api/entities/VCLPresentationSubmissionResult.tsx +7 -0
  295. package/src/api/entities/VCLPublicKey.tsx +3 -0
  296. package/src/api/entities/VCLPushDelegate.tsx +4 -0
  297. package/src/api/entities/VCLRegion.tsx +7 -0
  298. package/src/api/entities/VCLRegions.tsx +6 -0
  299. package/src/api/entities/VCLService.tsx +5 -0
  300. package/src/api/entities/VCLServiceCredentialAgentIssuer.tsx +3 -0
  301. package/src/api/entities/VCLServiceType.tsx +10 -0
  302. package/src/api/entities/VCLSubmissionResult.tsx +7 -0
  303. package/src/api/entities/VCLToken.tsx +3 -0
  304. package/src/api/entities/VCLVerifiableCredential.tsx +4 -0
  305. package/src/api/entities/VCLVerifiedProfile.tsx +9 -0
  306. package/src/api/entities/VCLVerifiedProfileDescriptor.tsx +3 -0
  307. package/src/index.tsx +98 -0
  308. package/vcl-react-native.podspec +22 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Michael Avoyan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,126 @@
1
+ # @velocitycareerlabs/vcl-react-native
2
+
3
+ Velocity Career Labs React Native SDK
4
+
5
+ ## Installation
6
+
7
+ Note that you should have access to [vcl-react-native](https://github.com/velocitycareerlabs/vcl-react-native) repository to be able to use the library
8
+
9
+ Note that SDK currently doesn't support projects with **IOS version < 11**
10
+ ### Common steps
11
+
12
+ #### authenticate to GitHub Packages
13
+
14
+ To authenticate by adding your personal access token to your `~/.npmrc` file, edit the `~/.npmrc` file for your project to include the following line, replacing TOKEN with your personal access token. Create a new ~/.npmrc file if one doesn't exist.
15
+
16
+ ```sh
17
+ //npm.pkg.github.com/:_authToken=TOKEN
18
+ ```
19
+
20
+ To authenticate by logging in to npm, use the `npm login` command, replacing USERNAME with your GitHub username, TOKEN with your personal access token, and PUBLIC-EMAIL-ADDRESS with your email address.
21
+
22
+ For more details please follow [Working with the npm registry
23
+ ](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry) documentation
24
+
25
+ #### install library
26
+
27
+ Yarn:
28
+
29
+ ```sh
30
+ yarn add @velocitycareerlabs/vcl-react-native --save
31
+ ```
32
+
33
+ npm:
34
+
35
+ ```sh
36
+ npm install @velocitycareerlabs/vcl-react-native --save
37
+ ```
38
+
39
+ ### Platform-specific steps
40
+
41
+ #### iOS
42
+
43
+ ##### 1. Swift support step
44
+
45
+ If you have no Swift integration in your project follow next steps:
46
+
47
+ 1. In XCode, in the project navigator, right click your `[your project's name]` folder, choose ➜ `Add Files to [your project's name]`
48
+
49
+ 2. Select `Swift File` ➜ `Next`
50
+
51
+ 3. Specify name for example `Dummy.swift` ➜ `Create`
52
+
53
+ 4. Now a pop up is shown select `Create Bridging Header`
54
+
55
+
56
+ ##### 2. Pods installation step
57
+
58
+
59
+ 1. Add next lines in the beginning of `Podfile`:
60
+
61
+ ```rb
62
+ source 'https://github.com/CocoaPods/Specs.git'
63
+ source 'https://github.com/velocitycareerlabs/Specs.git'
64
+ ```
65
+
66
+ 2. Add link path to `vcl-react-native` into target in `Podfile`:
67
+ ```rb
68
+ pod 'vcl-react-native', :path => '../node_modules/@velocitycareerlabs/vcl-react-native'
69
+ ```
70
+
71
+ 3. Install pods:
72
+
73
+ ```bash
74
+ cd ios && pod install && cd ..
75
+ ```
76
+
77
+
78
+ #### Android
79
+
80
+ ##### 1. Store your GitHub - Personal Access Token details
81
+
82
+ - Create a `github.properties` file within your root Android project
83
+ - In case of a public repository make sure you add this file to .gitignore to keep the token private
84
+ - Add properties gpr.usr=GITHUB_USERID and gpr.key=PERSONAL_ACCESS_TOKEN
85
+ ```rb
86
+ gpr.usr=GITHUB_USERID
87
+ gpr.key=PERSONAL_ACCESS_TOKEN
88
+ ```
89
+ - Replace GITHUB_USERID with personal / organisation Github User ID and PERSONAL_ACCESS_TOKEN with the token generated in #Step 1
90
+
91
+
92
+ ##### 2. Update build.gradle inside the application module
93
+
94
+ - Add the following code to build.gradle inside the application module that will be using the VCL SDK
95
+
96
+ ```sh
97
+ def githubProperties = new Properties()
98
+ githubProperties.load(new FileInputStream(rootProject.file("github.properties")))
99
+ ```
100
+
101
+ ```sh
102
+ repositories {
103
+ maven {
104
+ name = "GitHubPackages"
105
+ url = uri("https://maven.pkg.github.com/velocitycareerlabs/VCL-Kotlin")
106
+ credentials {
107
+ username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER")
108
+ password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY")
109
+ }
110
+ }
111
+ }
112
+ ```
113
+
114
+ ## Usage
115
+
116
+ ```js
117
+ import VclReactNative from "@velocitycareerlabs/vcl-react-native";
118
+
119
+ // ...
120
+
121
+ const result = await VclReactNative.initialize();
122
+ ```
123
+
124
+ ## License
125
+
126
+ MIT
File without changes
@@ -0,0 +1,2 @@
1
+ #Tue Aug 09 17:13:19 IDT 2022
2
+ gradle.version=7.4.2
File without changes
@@ -0,0 +1,134 @@
1
+ buildscript {
2
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
+ def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['VclReactNative_kotlinVersion']
4
+
5
+ repositories {
6
+ google()
7
+ jcenter()
8
+ }
9
+
10
+ dependencies {
11
+ classpath 'com.android.tools.build:gradle:7.2.1'
12
+ // noinspection DifferentKotlinGradleVersion
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
+ }
15
+ }
16
+
17
+ apply plugin: 'com.android.library'
18
+ apply plugin: 'kotlin-android'
19
+
20
+ def getExtOrDefault(name) {
21
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['VclReactNative_' + name]
22
+ }
23
+
24
+ def getExtOrIntegerDefault(name) {
25
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['VclReactNative_' + name]).toInteger()
26
+ }
27
+
28
+ android {
29
+ compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
30
+ buildToolsVersion getExtOrDefault('buildToolsVersion')
31
+ defaultConfig {
32
+ minSdkVersion 21
33
+ targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
34
+ versionCode 1
35
+ versionName "1.0"
36
+
37
+ }
38
+
39
+ buildTypes {
40
+ release {
41
+ minifyEnabled false
42
+ }
43
+ }
44
+ lintOptions {
45
+ disable 'GradleCompatible'
46
+ }
47
+ compileOptions {
48
+ sourceCompatibility JavaVersion.VERSION_1_8
49
+ targetCompatibility JavaVersion.VERSION_1_8
50
+ }
51
+ }
52
+
53
+ repositories {
54
+ mavenCentral()
55
+ jcenter()
56
+ google()
57
+
58
+ def found = false
59
+ def defaultDir = null
60
+ def androidSourcesName = 'React Native sources'
61
+
62
+ if (rootProject.ext.has('reactNativeAndroidRoot')) {
63
+ defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
64
+ } else {
65
+ defaultDir = new File(
66
+ projectDir,
67
+ '/../../../node_modules/react-native/android'
68
+ )
69
+ }
70
+
71
+ if (defaultDir.exists()) {
72
+ maven {
73
+ url defaultDir.toString()
74
+ name androidSourcesName
75
+ }
76
+
77
+ logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
78
+ found = true
79
+ } else {
80
+ def parentDir = rootProject.projectDir
81
+
82
+ 1.upto(5, {
83
+ if (found) return true
84
+ parentDir = parentDir.parentFile
85
+
86
+ def androidSourcesDir = new File(
87
+ parentDir,
88
+ 'node_modules/react-native'
89
+ )
90
+
91
+ def androidPrebuiltBinaryDir = new File(
92
+ parentDir,
93
+ 'node_modules/react-native/android'
94
+ )
95
+
96
+ if (androidPrebuiltBinaryDir.exists()) {
97
+ maven {
98
+ url androidPrebuiltBinaryDir.toString()
99
+ name androidSourcesName
100
+ }
101
+
102
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
103
+ found = true
104
+ } else if (androidSourcesDir.exists()) {
105
+ maven {
106
+ url androidSourcesDir.toString()
107
+ name androidSourcesName
108
+ }
109
+
110
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
111
+ found = true
112
+ }
113
+ })
114
+ }
115
+
116
+ if (!found) {
117
+ throw new Exception(
118
+ "${project.name}: unable to locate React Native android sources. " +
119
+ "Ensure you have you installed React Native as a dependency in your project and try again."
120
+ )
121
+ }
122
+ }
123
+
124
+ def kotlin_version = getExtOrDefault('kotlinVersion')
125
+
126
+ dependencies {
127
+ // noinspection GradleDynamicVersion
128
+ api 'com.facebook.react:react-native:+'
129
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
130
+
131
+ // VCL:
132
+ implementation "com.nimbusds:nimbus-jose-jwt:9.23"
133
+ implementation "io.velocitycareerlabs:vcl:1.0.1"
134
+ }
@@ -0,0 +1,5 @@
1
+ distributionBase=GRADLE_USER_HOME
2
+ distributionPath=wrapper/dists
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
4
+ zipStoreBase=GRADLE_USER_HOME
5
+ zipStorePath=wrapper/dists
@@ -0,0 +1,4 @@
1
+ VclReactNative_kotlinVersion=1.5.31
2
+ VclReactNative_compileSdkVersion=30
3
+ VclReactNative_buildToolsVersion=30.0.3
4
+ VclReactNative_targetSdkVersion=30
@@ -0,0 +1,3 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="io.velocitycareerlabs.reactnative">
3
+ </manifest>
@@ -0,0 +1,320 @@
1
+ package io.velocitycareerlabs.reactnative
2
+
3
+ import com.facebook.react.bridge.*
4
+ import io.velocitycareerlabs.reactnative.utlis.Converter
5
+ import io.velocitycareerlabs.reactnative.utlis.Converter.countriesToMap
6
+ import io.velocitycareerlabs.reactnative.utlis.Converter.credentialManifestToMap
7
+ import io.velocitycareerlabs.reactnative.utlis.Converter.credentialTypeSchemasToMap
8
+ import io.velocitycareerlabs.reactnative.utlis.Converter.credentialTypesFormSchemaToMap
9
+ import io.velocitycareerlabs.reactnative.utlis.Converter.credentialTypesToMap
10
+ import io.velocitycareerlabs.reactnative.utlis.Converter.exchangeToMap
11
+ import io.velocitycareerlabs.reactnative.utlis.Converter.jwtVerifiableCredentialsToMap
12
+ import io.velocitycareerlabs.reactnative.utlis.Converter.generatedOffersToMap
13
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToCredentialManifestDescriptor
14
+ import io.velocitycareerlabs.reactnative.utlis.Converter.organizationsToMap
15
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToPresentationSubmission
16
+ import io.velocitycareerlabs.reactnative.utlis.Converter.presentationRequestToMap
17
+ import io.velocitycareerlabs.reactnative.utlis.Converter.presentationSubmissionResultToMap
18
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToCredentialTypesUIFormSchemaDescriptor
19
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToDeepLink
20
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToEnvironment
21
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToExchangeDescriptor
22
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToFinalizedOffersDescriptor
23
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToGenerateOffersDescriptor
24
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToJwt
25
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToOrganizationsSearchDescriptor
26
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToPublicKey
27
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToToken
28
+ import io.velocitycareerlabs.reactnative.utlis.Converter.mapToVerifiedProfileDescriptor
29
+ import io.velocitycareerlabs.reactnative.utlis.Converter.verifiedProfileToMap
30
+ import io.velocitycareerlabs.api.VCLProvider
31
+ import io.velocitycareerlabs.api.entities.VCLError
32
+ import org.json.JSONObject
33
+ import java.lang.Exception
34
+
35
+ /**
36
+ * Created by Michael Avoyan on 01/07/2021.
37
+ */
38
+ class VclReactNativeModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
39
+
40
+ companion object {
41
+ const val ModuleName = "VclReactNative"
42
+ }
43
+
44
+ private val vcl = VCLProvider.vclInstance()
45
+
46
+ override fun getName(): String {
47
+ return ModuleName
48
+ }
49
+
50
+ @ReactMethod
51
+ fun initialize(environmentMap: ReadableMap, promise: Promise) {
52
+ try {
53
+ vcl.initialize(
54
+ context = reactContext,
55
+ environment = mapToEnvironment(environmentMap),
56
+ successHandler = {
57
+ promise.resolve("VCL initialization succeed!")
58
+ },
59
+ errorHandler = {
60
+ promise.reject(it)
61
+ })
62
+ } catch (ex: Exception) {
63
+ promise.reject(VCLError(ex.message))
64
+ }
65
+ }
66
+
67
+ @ReactMethod
68
+ fun getCountries(promise: Promise) {
69
+ try {
70
+ vcl.countries?.let { promise.resolve(countriesToMap(it)) }
71
+ ?: promise.reject(VCLError("Countries not found"))
72
+ } catch (ex: Exception) {
73
+ promise.reject(VCLError(ex.message))
74
+ }
75
+ }
76
+
77
+ @ReactMethod
78
+ fun getCredentialTypeSchemas(promise: Promise) {
79
+ try {
80
+ vcl.credentialTypeSchemas?.let { promise.resolve(credentialTypeSchemasToMap(it)) }
81
+ ?: promise.reject(VCLError("Credential Types not found"))
82
+ } catch (ex: Exception) {
83
+ promise.reject(VCLError(ex.message))
84
+ }
85
+ }
86
+
87
+ @ReactMethod
88
+ fun getCredentialTypes(promise: Promise) {
89
+ try {
90
+ vcl.credentialTypes?.let { promise.resolve(credentialTypesToMap(it)) }
91
+ ?: promise.reject(VCLError("Credential Types not found"))
92
+ } catch (ex: Exception) {
93
+ promise.reject(VCLError(ex.message))
94
+ }
95
+ }
96
+
97
+ @ReactMethod
98
+ fun getPresentationRequest(deepLinkReadableMap: ReadableMap, promise: Promise) {
99
+ try {
100
+ vcl.getPresentationRequest(
101
+ mapToDeepLink(deepLinkReadableMap),
102
+ {
103
+ promise.resolve(presentationRequestToMap(it))
104
+ },
105
+ {
106
+ promise.reject(it)
107
+ })
108
+ } catch (ex: Exception) {
109
+ promise.reject(VCLError(ex.message))
110
+ }
111
+ }
112
+
113
+ @ReactMethod
114
+ fun submitPresentation(
115
+ presentationSubmissionReadableMap: ReadableMap,
116
+ promise: Promise
117
+ ) {
118
+ try {
119
+ vcl.submitPresentation(
120
+ mapToPresentationSubmission(presentationSubmissionReadableMap),
121
+ {
122
+ promise.resolve(presentationSubmissionResultToMap(it))
123
+ },
124
+ {
125
+ promise.reject(it)
126
+ })
127
+ } catch (ex: Exception) {
128
+ promise.reject(VCLError(ex.message))
129
+ }
130
+ }
131
+
132
+ @ReactMethod
133
+ fun getExchangeProgress(
134
+ exchangeDescriptorReadableMap: ReadableMap,
135
+ promise: Promise
136
+ ) {
137
+ try {
138
+ vcl.getExchangeProgress(mapToExchangeDescriptor(exchangeDescriptorReadableMap),
139
+ {
140
+ promise.resolve(exchangeToMap(it))
141
+ },
142
+ {
143
+ promise.reject(it)
144
+ })
145
+ } catch (ex: Exception) {
146
+ promise.reject(VCLError(ex.message))
147
+ }
148
+ }
149
+
150
+ @ReactMethod
151
+ fun searchForOrganizations(
152
+ organizationsSearchDescriptorMap: ReadableMap,
153
+ promise: Promise
154
+ ) {
155
+ try {
156
+ vcl.searchForOrganizations(
157
+ mapToOrganizationsSearchDescriptor(organizationsSearchDescriptorMap),
158
+ {
159
+ promise.resolve(organizationsToMap(it))
160
+ },
161
+ {
162
+ promise.reject(it)
163
+ })
164
+ } catch (ex: Exception) {
165
+ promise.reject(VCLError(ex.message))
166
+ }
167
+ }
168
+
169
+ @ReactMethod
170
+ fun getCredentialManifest(
171
+ credentialManifestDescriptorMap: ReadableMap,
172
+ promise: Promise
173
+ ) {
174
+ try {
175
+ mapToCredentialManifestDescriptor(credentialManifestDescriptorMap)?.let{ credentialManifestDescriptor ->
176
+ vcl.getCredentialManifest(credentialManifestDescriptor,
177
+ {
178
+ promise.resolve(credentialManifestToMap(it))
179
+ },
180
+ {
181
+ promise.reject(it)
182
+ })
183
+ } ?: promise.reject(VCLError("Unexpected Credential Credential Manifest Descriptor: $credentialManifestDescriptorMap"))
184
+ } catch (ex: Exception) {
185
+ promise.reject(VCLError(ex.message))
186
+ }
187
+ }
188
+
189
+ @ReactMethod
190
+ fun generateOffers(
191
+ generateOffersDescriptorMap: ReadableMap,
192
+ promise: Promise
193
+ ) {
194
+ try {
195
+ vcl.generateOffers(
196
+ mapToGenerateOffersDescriptor(generateOffersDescriptorMap),
197
+ {
198
+ promise.resolve(generatedOffersToMap(it))
199
+ },
200
+ {
201
+ promise.reject(it)
202
+ })
203
+ } catch (ex: Exception) {
204
+ promise.reject(VCLError(ex.message))
205
+ }
206
+ }
207
+
208
+ @ReactMethod
209
+ fun checkForOffers(
210
+ generateOffersDescriptorMap: ReadableMap,
211
+ tokenMap: ReadableMap,
212
+ promise: Promise
213
+ ) {
214
+ try {
215
+ vcl.checkForOffers(
216
+ mapToGenerateOffersDescriptor(generateOffersDescriptorMap),
217
+ mapToToken(tokenMap),
218
+ {
219
+ promise.resolve(generatedOffersToMap(it))
220
+ },
221
+ {
222
+ promise.reject(it)
223
+ })
224
+ } catch (ex: Exception) {
225
+ promise.reject(VCLError(ex.message))
226
+ }
227
+ }
228
+
229
+ @ReactMethod
230
+ fun finalizeOffers(
231
+ finalizeOffersDescriptorMap: ReadableMap,
232
+ tokenMap: ReadableMap,
233
+ promise: Promise
234
+ ) {
235
+ try {
236
+ vcl.finalizeOffers(
237
+ mapToFinalizedOffersDescriptor(finalizeOffersDescriptorMap),
238
+ mapToToken(tokenMap),
239
+ {
240
+ promise.resolve(jwtVerifiableCredentialsToMap(it))
241
+ },
242
+ {
243
+ promise.reject(it)
244
+ })
245
+ } catch (ex: Exception) {
246
+ promise.reject(VCLError(ex.message))
247
+ }
248
+ }
249
+
250
+ @ReactMethod
251
+ fun getCredentialTypesUIFormSchema(
252
+ credentialTypesUIFormSchemaDescriptorMap: ReadableMap,
253
+ promise: Promise
254
+ ) {
255
+ try {
256
+ vcl.getCredentialTypesUIFormSchema(
257
+ mapToCredentialTypesUIFormSchemaDescriptor(credentialTypesUIFormSchemaDescriptorMap),
258
+ {
259
+ promise.resolve(credentialTypesFormSchemaToMap(it))
260
+ },
261
+ {
262
+ promise.reject(it)
263
+ }
264
+ )
265
+ } catch (ex: Exception) {
266
+ promise.reject(VCLError(ex.message))
267
+ }
268
+ }
269
+
270
+ @ReactMethod
271
+ fun getVerifiedProfile(
272
+ verifiedProfileDescriptorMap: ReadableMap,
273
+ promise: Promise
274
+ ) {
275
+ try {
276
+ vcl.getVerifiedProfile(mapToVerifiedProfileDescriptor(verifiedProfileDescriptorMap),
277
+ {
278
+ promise.resolve(verifiedProfileToMap(it))
279
+ },
280
+ {
281
+ promise.reject(it)
282
+ })
283
+ } catch (ex: Exception) {
284
+ promise.reject(VCLError(ex.message))
285
+ }
286
+ }
287
+
288
+ @ReactMethod
289
+ fun verifyJwt(jwtMap: ReadableMap, publicKeyMap: ReadableMap, promise: Promise) {
290
+ try {
291
+ vcl.verifyJwt(mapToJwt(jwtMap), mapToPublicKey(publicKeyMap),
292
+ {
293
+ promise.resolve(it)
294
+ },
295
+ {
296
+ promise.reject(it)
297
+ })
298
+ } catch (ex: Exception) {
299
+ promise.reject(VCLError(ex.message))
300
+ }
301
+ }
302
+
303
+ @ReactMethod
304
+ fun generateSignedJwt(jwtJsonMap: ReadableMap, iss: String, promise: Promise) {
305
+ var json: JSONObject? = null
306
+ try {
307
+ json = JSONObject(jwtJsonMap.toHashMap())
308
+ vcl.generateSignedJwt(json, iss,
309
+ {
310
+ promise.resolve(Converter.jwtToMap(it))
311
+ },
312
+ {
313
+ promise.reject(it)
314
+ })
315
+ } catch (e: Exception) {
316
+ promise.reject(VCLError(e.message))
317
+ }
318
+ }
319
+ }
320
+
@@ -0,0 +1,19 @@
1
+ package io.velocitycareerlabs.reactnative
2
+
3
+ import android.view.View
4
+ import com.facebook.react.ReactPackage
5
+ import com.facebook.react.bridge.NativeModule
6
+ import com.facebook.react.bridge.ReactApplicationContext
7
+ import com.facebook.react.uimanager.ReactShadowNode
8
+ import com.facebook.react.uimanager.ViewManager
9
+
10
+ /**
11
+ * Created by Michael Avoyan on 01/07/2021.
12
+ */
13
+ class VclReactNativePackage: ReactPackage {
14
+ override fun createNativeModules(reactContext: ReactApplicationContext): MutableList<NativeModule> =
15
+ mutableListOf(VclReactNativeModule(reactContext))
16
+
17
+ override fun createViewManagers(p0: ReactApplicationContext) =
18
+ mutableListOf<ViewManager<View, ReactShadowNode<*>>>()
19
+ }