@icure/cardinal-sdk 2.0.0-PREVIEW-18.1 → 2.0.0-PREVIEW-21

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 (384) hide show
  1. package/Kermit-kermit-core.mjs +45 -40
  2. package/Kermit-kermit.mjs +6 -6
  3. package/Kotlin-DateTime-library-kotlinx-datetime.mjs +1577 -1577
  4. package/api/HealthcarePartyApi.d.mts +2 -0
  5. package/api/HealthcarePartyApiInGroup.d.mts +5 -0
  6. package/api/HealthcarePartyApiInGroup.mjs +1 -0
  7. package/api/RecoveryApi.d.mts +5 -1
  8. package/api.d.mts +1 -0
  9. package/api.mjs +1 -0
  10. package/bitops-library-bits.mjs +197 -0
  11. package/bitops-library-endian.mjs +117 -0
  12. package/cardinal-sdk-ts.d.mts +2 -2
  13. package/cardinal-sdk-ts.mjs +57007 -56794
  14. package/cardinal-sdk.mjs +120895 -120501
  15. package/core-library-digest.mjs +186 -0
  16. package/crypto/CryptoService.d.mts +17 -7
  17. package/error-library-error.mjs +42 -0
  18. package/hash-library-sha2.mjs +183 -0
  19. package/internal/BytesEncoding.d.mts +3 -0
  20. package/internal/BytesEncoding.mjs +99 -0
  21. package/internal/JsonDecodeUtils.d.mts +20 -0
  22. package/internal/JsonDecodeUtils.mjs +99 -0
  23. package/kerberus.mjs +557 -389
  24. package/kotlin-kotlin-stdlib.mjs +2445 -2713
  25. package/kotlinx-atomicfu.mjs +13 -13
  26. package/kotlinx-coroutines-core.mjs +2455 -2450
  27. package/kotlinx-io-kotlinx-io-bytestring.mjs +36 -36
  28. package/kotlinx-io-kotlinx-io-core.mjs +459 -459
  29. package/kotlinx-serialization-kotlinx-serialization-core.mjs +2029 -2029
  30. package/kotlinx-serialization-kotlinx-serialization-json.mjs +1952 -1952
  31. package/kryptom-lib.mjs +3263 -1967
  32. package/ktor-ktor-client-content-negotiation.mjs +184 -184
  33. package/ktor-ktor-client-core.mjs +2713 -2713
  34. package/ktor-ktor-events.mjs +6 -6
  35. package/ktor-ktor-http-cio.mjs +481 -481
  36. package/ktor-ktor-http.mjs +693 -693
  37. package/ktor-ktor-io.mjs +963 -963
  38. package/ktor-ktor-serialization-kotlinx-json.mjs +7 -7
  39. package/ktor-ktor-serialization-kotlinx.mjs +238 -238
  40. package/ktor-ktor-serialization.mjs +109 -109
  41. package/ktor-ktor-utils.mjs +557 -557
  42. package/ktor-ktor-websockets.mjs +673 -673
  43. package/model/AccessLog.d.mts +5 -0
  44. package/model/AccessLog.mjs +168 -0
  45. package/model/Agenda.d.mts +2 -0
  46. package/model/Agenda.mjs +82 -0
  47. package/model/ApplicationSettings.d.mts +5 -0
  48. package/model/ApplicationSettings.mjs +140 -0
  49. package/model/BooleanResponse.d.mts +2 -0
  50. package/model/BooleanResponse.mjs +20 -0
  51. package/model/CalendarItem.d.mts +5 -0
  52. package/model/CalendarItem.mjs +290 -0
  53. package/model/CalendarItemType.d.mts +7 -0
  54. package/model/CalendarItemType.mjs +117 -0
  55. package/model/Classification.d.mts +5 -0
  56. package/model/Classification.mjs +148 -0
  57. package/model/Code.d.mts +2 -0
  58. package/model/Code.mjs +69 -0
  59. package/model/Contact.d.mts +5 -0
  60. package/model/Contact.mjs +218 -0
  61. package/model/CryptoActorStub.d.mts +2 -0
  62. package/model/CryptoActorStub.mjs +45 -0
  63. package/model/CryptoActorStubWithType.d.mts +2 -0
  64. package/model/CryptoActorStubWithType.mjs +25 -0
  65. package/model/DataOwnerRegistrationSuccess.d.mts +2 -0
  66. package/model/DataOwnerRegistrationSuccess.mjs +24 -0
  67. package/model/DataOwnerWithType.d.mts +7 -0
  68. package/model/DataOwnerWithType.mjs +80 -0
  69. package/model/DatabaseInitialisation.d.mts +2 -0
  70. package/model/DatabaseInitialisation.mjs +34 -0
  71. package/model/Device.d.mts +2 -0
  72. package/model/Device.mjs +99 -0
  73. package/model/Document.d.mts +5 -0
  74. package/model/Document.mjs +246 -0
  75. package/model/DocumentTemplate.d.mts +2 -0
  76. package/model/DocumentTemplate.mjs +91 -0
  77. package/model/EntityReference.d.mts +2 -0
  78. package/model/EntityReference.mjs +29 -0
  79. package/model/EntityReferenceInGroup.d.mts +2 -0
  80. package/model/EntityReferenceInGroup.mjs +23 -0
  81. package/model/EntityTemplate.d.mts +2 -0
  82. package/model/EntityTemplate.mjs +46 -0
  83. package/model/Form.d.mts +5 -0
  84. package/model/Form.mjs +204 -0
  85. package/model/FormTemplate.d.mts +2 -0
  86. package/model/FormTemplate.mjs +82 -0
  87. package/model/FrontEndMigration.d.mts +2 -0
  88. package/model/FrontEndMigration.mjs +57 -0
  89. package/model/Group.d.mts +2 -0
  90. package/model/Group.mjs +68 -0
  91. package/model/GroupDeletionReport.d.mts +2 -0
  92. package/model/GroupDeletionReport.mjs +24 -0
  93. package/model/HealthElement.d.mts +5 -0
  94. package/model/HealthElement.mjs +226 -0
  95. package/model/HealthcareParty.d.mts +2 -0
  96. package/model/HealthcareParty.mjs +182 -0
  97. package/model/IdWithRev.d.mts +2 -0
  98. package/model/IdWithRev.mjs +23 -0
  99. package/model/IndexingInfo.d.mts +2 -0
  100. package/model/IndexingInfo.mjs +21 -0
  101. package/model/Insurance.d.mts +2 -0
  102. package/model/Insurance.mjs +46 -0
  103. package/model/Invoice.d.mts +5 -0
  104. package/model/Invoice.mjs +468 -0
  105. package/model/Keyword.d.mts +2 -0
  106. package/model/Keyword.mjs +58 -0
  107. package/model/ListOfIds.d.mts +2 -0
  108. package/model/ListOfIds.mjs +20 -0
  109. package/model/ListOfProperties.d.mts +2 -0
  110. package/model/ListOfProperties.mjs +22 -0
  111. package/model/MaintenanceTask.d.mts +5 -0
  112. package/model/MaintenanceTask.mjs +152 -0
  113. package/model/MedicalLocation.d.mts +2 -0
  114. package/model/MedicalLocation.mjs +63 -0
  115. package/model/Message.d.mts +5 -0
  116. package/model/Message.mjs +248 -0
  117. package/model/PaginatedDocumentKeyIdPair.d.mts +2 -0
  118. package/model/PaginatedDocumentKeyIdPair.mjs +24 -0
  119. package/model/Patient.d.mts +5 -0
  120. package/model/Patient.mjs +491 -0
  121. package/model/Place.d.mts +2 -0
  122. package/model/Place.mjs +33 -0
  123. package/model/PropertyStub.d.mts +5 -0
  124. package/model/PropertyStub.mjs +74 -0
  125. package/model/PropertyTypeStub.d.mts +2 -0
  126. package/model/PropertyTypeStub.mjs +26 -0
  127. package/model/PublicAgendasAndCalendarItemTypes.d.mts +2 -0
  128. package/model/PublicAgendasAndCalendarItemTypes.mjs +25 -0
  129. package/model/PublicKey.d.mts +2 -0
  130. package/model/PublicKey.mjs +24 -0
  131. package/model/Receipt.d.mts +5 -0
  132. package/model/Receipt.mjs +159 -0
  133. package/model/RegistrationInformation.d.mts +2 -0
  134. package/model/RegistrationInformation.mjs +43 -0
  135. package/model/RegistrationSuccess.d.mts +2 -0
  136. package/model/RegistrationSuccess.mjs +24 -0
  137. package/model/Replication.d.mts +2 -0
  138. package/model/Replication.mjs +35 -0
  139. package/model/ReplicationInfo.d.mts +2 -0
  140. package/model/ReplicationInfo.mjs +28 -0
  141. package/model/Role.d.mts +2 -0
  142. package/model/Role.mjs +34 -0
  143. package/model/StoredDocumentIdentifier.d.mts +2 -0
  144. package/model/StoredDocumentIdentifier.mjs +22 -0
  145. package/model/Tarification.d.mts +2 -0
  146. package/model/Tarification.mjs +92 -0
  147. package/model/TimeTable.d.mts +2 -0
  148. package/model/TimeTable.mjs +64 -0
  149. package/model/Topic.d.mts +5 -0
  150. package/model/Topic.mjs +163 -0
  151. package/model/User.d.mts +4 -0
  152. package/model/User.mjs +118 -0
  153. package/model/UserGroup.d.mts +2 -0
  154. package/model/UserGroup.mjs +55 -0
  155. package/model/base/CodeStub.d.mts +2 -0
  156. package/model/base/CodeStub.mjs +40 -0
  157. package/model/base/CryptoActor.d.mts +3 -0
  158. package/model/base/CryptoActor.mjs +19 -1
  159. package/model/base/Identifier.d.mts +2 -0
  160. package/model/base/Identifier.mjs +44 -0
  161. package/model/couchdb/Basic.d.mts +2 -0
  162. package/model/couchdb/Basic.mjs +22 -0
  163. package/model/couchdb/DatabaseInfo.d.mts +2 -0
  164. package/model/couchdb/DatabaseInfo.mjs +47 -0
  165. package/model/couchdb/DesignDocument.d.mts +2 -0
  166. package/model/couchdb/DesignDocument.mjs +40 -0
  167. package/model/couchdb/DocIdentifier.d.mts +2 -0
  168. package/model/couchdb/DocIdentifier.mjs +24 -0
  169. package/model/couchdb/GroupDatabasesInfo.d.mts +2 -0
  170. package/model/couchdb/GroupDatabasesInfo.mjs +26 -0
  171. package/model/couchdb/Remote.d.mts +2 -0
  172. package/model/couchdb/Remote.mjs +25 -0
  173. package/model/couchdb/RemoteAuthentication.d.mts +2 -0
  174. package/model/couchdb/RemoteAuthentication.mjs +23 -0
  175. package/model/couchdb/ReplicationStats.d.mts +2 -0
  176. package/model/couchdb/ReplicationStats.mjs +45 -0
  177. package/model/couchdb/ReplicatorDocument.d.mts +2 -0
  178. package/model/couchdb/ReplicatorDocument.mjs +61 -0
  179. package/model/couchdb/View.d.mts +2 -0
  180. package/model/couchdb/View.mjs +23 -0
  181. package/model/data/LabelledOccurence.d.mts +2 -0
  182. package/model/data/LabelledOccurence.mjs +22 -0
  183. package/model/embed/Address.d.mts +5 -0
  184. package/model/embed/Address.mjs +133 -0
  185. package/model/embed/AdministrationQuantity.d.mts +2 -0
  186. package/model/embed/AdministrationQuantity.mjs +29 -0
  187. package/model/embed/AgendaSlottingAlgorithm.d.mts +3 -0
  188. package/model/embed/AgendaSlottingAlgorithm.mjs +30 -0
  189. package/model/embed/AgreementAppendix.d.mts +2 -0
  190. package/model/embed/AgreementAppendix.mjs +30 -0
  191. package/model/embed/Annotation.d.mts +2 -0
  192. package/model/embed/Annotation.mjs +46 -0
  193. package/model/embed/CalendarItemTag.d.mts +5 -0
  194. package/model/embed/CalendarItemTag.mjs +72 -0
  195. package/model/embed/CareTeamMember.d.mts +5 -0
  196. package/model/embed/CareTeamMember.mjs +71 -0
  197. package/model/embed/CareTeamMembership.d.mts +5 -0
  198. package/model/embed/CareTeamMembership.mjs +73 -0
  199. package/model/embed/Content.d.mts +5 -0
  200. package/model/embed/Content.mjs +125 -0
  201. package/model/embed/DataAttachment.d.mts +2 -0
  202. package/model/embed/DataAttachment.mjs +26 -0
  203. package/model/embed/DatabaseSynchronization.d.mts +2 -0
  204. package/model/embed/DatabaseSynchronization.mjs +30 -0
  205. package/model/embed/Delegation.d.mts +2 -0
  206. package/model/embed/Delegation.mjs +30 -0
  207. package/model/embed/DeletedAttachment.d.mts +2 -0
  208. package/model/embed/DeletedAttachment.mjs +30 -0
  209. package/model/embed/DocumentGroup.d.mts +2 -0
  210. package/model/embed/DocumentGroup.mjs +24 -0
  211. package/model/embed/Duration.d.mts +2 -0
  212. package/model/embed/Duration.mjs +26 -0
  213. package/model/embed/EmbeddedTimeTableHour.d.mts +2 -0
  214. package/model/embed/EmbeddedTimeTableHour.mjs +22 -0
  215. package/model/embed/EmbeddedTimeTableItem.d.mts +2 -0
  216. package/model/embed/EmbeddedTimeTableItem.mjs +41 -0
  217. package/model/embed/Employer.d.mts +2 -0
  218. package/model/embed/Employer.mjs +26 -0
  219. package/model/embed/EmploymentInfo.d.mts +5 -0
  220. package/model/embed/EmploymentInfo.mjs +74 -0
  221. package/model/embed/Episode.d.mts +5 -0
  222. package/model/embed/Episode.mjs +75 -0
  223. package/model/embed/FinancialInstitutionInformation.d.mts +5 -0
  224. package/model/embed/FinancialInstitutionInformation.mjs +88 -0
  225. package/model/embed/FlatRateTarification.d.mts +5 -0
  226. package/model/embed/FlatRateTarification.mjs +72 -0
  227. package/model/embed/FlowItem.d.mts +2 -0
  228. package/model/embed/FlowItem.mjs +117 -0
  229. package/model/embed/HealthcarePartyHistoryStatus.d.mts +2 -0
  230. package/model/embed/HealthcarePartyHistoryStatus.mjs +28 -0
  231. package/model/embed/IdentityDocumentReader.d.mts +2 -0
  232. package/model/embed/IdentityDocumentReader.mjs +33 -0
  233. package/model/embed/Insurability.d.mts +5 -0
  234. package/model/embed/Insurability.mjs +100 -0
  235. package/model/embed/InvoicingCode.d.mts +5 -0
  236. package/model/embed/InvoicingCode.mjs +377 -0
  237. package/model/embed/KeywordSubword.d.mts +2 -0
  238. package/model/embed/KeywordSubword.mjs +25 -0
  239. package/model/embed/LetterValue.d.mts +2 -0
  240. package/model/embed/LetterValue.mjs +30 -0
  241. package/model/embed/Measure.d.mts +2 -0
  242. package/model/embed/Measure.mjs +57 -0
  243. package/model/embed/MedicalHouseContract.d.mts +5 -0
  244. package/model/embed/MedicalHouseContract.mjs +223 -0
  245. package/model/embed/Medication.d.mts +2 -0
  246. package/model/embed/Medication.mjs +157 -0
  247. package/model/embed/Medicinalproduct.d.mts +2 -0
  248. package/model/embed/Medicinalproduct.mjs +33 -0
  249. package/model/embed/MessageAttachment.d.mts +2 -0
  250. package/model/embed/MessageAttachment.mjs +25 -0
  251. package/model/embed/MessageReadStatus.d.mts +2 -0
  252. package/model/embed/MessageReadStatus.mjs +23 -0
  253. package/model/embed/ParagraphAgreement.d.mts +2 -0
  254. package/model/embed/ParagraphAgreement.mjs +86 -0
  255. package/model/embed/Partnership.d.mts +2 -0
  256. package/model/embed/Partnership.mjs +36 -0
  257. package/model/embed/PatientHealthCareParty.d.mts +9 -0
  258. package/model/embed/PatientHealthCareParty.mjs +88 -0
  259. package/model/embed/Payment.d.mts +2 -0
  260. package/model/embed/Payment.mjs +28 -0
  261. package/model/embed/Periodicity.d.mts +2 -0
  262. package/model/embed/Periodicity.mjs +26 -0
  263. package/model/embed/PersonName.d.mts +2 -0
  264. package/model/embed/PersonName.mjs +41 -0
  265. package/model/embed/PlanOfAction.d.mts +8 -3
  266. package/model/embed/PlanOfAction.mjs +179 -0
  267. package/model/embed/Range.d.mts +2 -0
  268. package/model/embed/Range.mjs +24 -0
  269. package/model/embed/ReferenceRange.d.mts +2 -0
  270. package/model/embed/ReferenceRange.mjs +40 -0
  271. package/model/embed/ReferralPeriod.d.mts +2 -0
  272. package/model/embed/ReferralPeriod.mjs +27 -0
  273. package/model/embed/RegimenItem.d.mts +2 -0
  274. package/model/embed/RegimenItem.mjs +40 -0
  275. package/model/embed/Renewal.d.mts +2 -0
  276. package/model/embed/Renewal.mjs +26 -0
  277. package/model/embed/ResourceGroupAllocationSchedule.d.mts +2 -0
  278. package/model/embed/ResourceGroupAllocationSchedule.mjs +39 -0
  279. package/model/embed/Right.d.mts +2 -0
  280. package/model/embed/Right.mjs +27 -0
  281. package/model/embed/RoleConfiguration.d.mts +2 -0
  282. package/model/embed/RoleConfiguration.mjs +22 -0
  283. package/model/embed/SchoolingInfo.d.mts +5 -0
  284. package/model/embed/SchoolingInfo.mjs +73 -0
  285. package/model/embed/SecureDelegation.d.mts +2 -0
  286. package/model/embed/SecureDelegation.mjs +39 -0
  287. package/model/embed/SecurityMetadata.d.mts +2 -0
  288. package/model/embed/SecurityMetadata.mjs +22 -0
  289. package/model/embed/Service.d.mts +5 -0
  290. package/model/embed/Service.mjs +240 -0
  291. package/model/embed/ServiceLink.d.mts +2 -0
  292. package/model/embed/ServiceLink.mjs +21 -0
  293. package/model/embed/SubContact.d.mts +5 -0
  294. package/model/embed/SubContact.mjs +146 -0
  295. package/model/embed/Substanceproduct.d.mts +2 -0
  296. package/model/embed/Substanceproduct.mjs +33 -0
  297. package/model/embed/Suspension.d.mts +2 -0
  298. package/model/embed/Suspension.mjs +30 -0
  299. package/model/embed/Telecom.d.mts +5 -0
  300. package/model/embed/Telecom.mjs +67 -0
  301. package/model/embed/TimeSeries.d.mts +2 -0
  302. package/model/embed/TimeSeries.mjs +32 -0
  303. package/model/embed/TimeTableHour.d.mts +2 -0
  304. package/model/embed/TimeTableHour.mjs +24 -0
  305. package/model/embed/TimeTableItem.d.mts +2 -0
  306. package/model/embed/TimeTableItem.mjs +57 -0
  307. package/model/embed/TypedValue.d.mts +5 -0
  308. package/model/embed/TypedValue.mjs +85 -0
  309. package/model/embed/Valorisation.d.mts +5 -0
  310. package/model/embed/Valorisation.mjs +108 -0
  311. package/model/embed/ValueWithPrecision.d.mts +2 -0
  312. package/model/embed/ValueWithPrecision.mjs +22 -0
  313. package/model/embed/Weekday.d.mts +2 -0
  314. package/model/embed/Weekday.mjs +26 -0
  315. package/model/embed/form/template/Action.d.mts +2 -0
  316. package/model/embed/form/template/Action.mjs +30 -0
  317. package/model/embed/form/template/CheckBox.d.mts +2 -0
  318. package/model/embed/form/template/CheckBox.mjs +71 -0
  319. package/model/embed/form/template/DatePicker.d.mts +2 -0
  320. package/model/embed/form/template/DatePicker.mjs +71 -0
  321. package/model/embed/form/template/DateTimePicker.d.mts +2 -0
  322. package/model/embed/form/template/DateTimePicker.mjs +71 -0
  323. package/model/embed/form/template/DropdownField.d.mts +2 -0
  324. package/model/embed/form/template/DropdownField.mjs +71 -0
  325. package/model/embed/form/template/FieldsGroup.d.mts +2 -0
  326. package/model/embed/form/template/FieldsGroup.mjs +28 -0
  327. package/model/embed/form/template/FormTemplateLayout.d.mts +2 -0
  328. package/model/embed/form/template/FormTemplateLayout.mjs +33 -0
  329. package/model/embed/form/template/Launcher.d.mts +2 -0
  330. package/model/embed/form/template/Launcher.mjs +26 -0
  331. package/model/embed/form/template/MeasureField.d.mts +2 -0
  332. package/model/embed/form/template/MeasureField.mjs +71 -0
  333. package/model/embed/form/template/MultipleChoice.d.mts +2 -0
  334. package/model/embed/form/template/MultipleChoice.mjs +71 -0
  335. package/model/embed/form/template/NumberField.d.mts +2 -0
  336. package/model/embed/form/template/NumberField.mjs +71 -0
  337. package/model/embed/form/template/RadioButton.d.mts +2 -0
  338. package/model/embed/form/template/RadioButton.mjs +71 -0
  339. package/model/embed/form/template/Section.d.mts +2 -0
  340. package/model/embed/form/template/Section.mjs +30 -0
  341. package/model/embed/form/template/State.d.mts +2 -0
  342. package/model/embed/form/template/State.mjs +26 -0
  343. package/model/embed/form/template/StructureElement.d.mts +3 -0
  344. package/model/embed/form/template/StructureElement.mjs +32 -1
  345. package/model/embed/form/template/TextField.d.mts +2 -0
  346. package/model/embed/form/template/TextField.mjs +71 -0
  347. package/model/embed/form/template/TimePicker.d.mts +2 -0
  348. package/model/embed/form/template/TimePicker.mjs +71 -0
  349. package/model/filter/predicate/AlwaysPredicate.d.mts +2 -0
  350. package/model/filter/predicate/AlwaysPredicate.mjs +20 -0
  351. package/model/filter/predicate/AndPredicate.d.mts +2 -0
  352. package/model/filter/predicate/AndPredicate.mjs +25 -0
  353. package/model/filter/predicate/KeyValuePredicate.d.mts +2 -0
  354. package/model/filter/predicate/KeyValuePredicate.mjs +32 -0
  355. package/model/filter/predicate/NotPredicate.d.mts +2 -0
  356. package/model/filter/predicate/NotPredicate.mjs +25 -0
  357. package/model/filter/predicate/OrPredicate.d.mts +2 -0
  358. package/model/filter/predicate/OrPredicate.mjs +25 -0
  359. package/model/filter/predicate/Predicate.d.mts +3 -0
  360. package/model/filter/predicate/Predicate.mjs +20 -1
  361. package/model/security/AlwaysPermissionItem.d.mts +2 -0
  362. package/model/security/AlwaysPermissionItem.mjs +25 -0
  363. package/model/security/AuthenticationToken.d.mts +2 -0
  364. package/model/security/AuthenticationToken.mjs +28 -0
  365. package/model/security/Enable2faRequest.d.mts +2 -0
  366. package/model/security/Enable2faRequest.mjs +22 -0
  367. package/model/security/ExternalJwtConfig.d.mts +18 -0
  368. package/model/security/ExternalJwtConfig.mjs +199 -0
  369. package/model/security/LoginIdentifier.d.mts +2 -0
  370. package/model/security/LoginIdentifier.mjs +22 -0
  371. package/model/security/OperationToken.d.mts +2 -0
  372. package/model/security/OperationToken.mjs +31 -0
  373. package/model/security/Permission.d.mts +2 -0
  374. package/model/security/Permission.mjs +24 -0
  375. package/model/security/PermissionItem.d.mts +3 -0
  376. package/model/security/PermissionItem.mjs +12 -1
  377. package/model/security/TokenWithGroup.d.mts +2 -0
  378. package/model/security/TokenWithGroup.mjs +25 -0
  379. package/options/SdkOptions.d.mts +3 -23
  380. package/package.json +1 -1
  381. package/utils/Id.d.mts +5 -0
  382. package/utils/Id.mjs +19 -10
  383. package/KotlinBigInteger-bignum.mjs +0 -5902
  384. /package/{KotlinBigInteger-bignum-serialization-kotlinx.mjs → core-library-core.mjs} +0 -0
@@ -0,0 +1,186 @@
1
+ import {
2
+ hashCodeq5arwsb9dgti as hashCode,
3
+ isBlank1dvkhjjvox3p0 as isBlank,
4
+ Unit_instance1fbcbse1fwigr as Unit_instance,
5
+ toString1pkumu07cwy4m as toString,
6
+ protoOf180f3jzyo7rfj as protoOf,
7
+ fill3lmv1pckd4inv as fill,
8
+ arrayCopytctsywo3h7gj as arrayCopy,
9
+ equals2au1ep9vhcato as equals,
10
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
11
+ } from './kotlin-kotlin-stdlib.mjs';
12
+ import { InvalidParameterException_init_$Create$1dn8z68oxsdqm as InvalidParameterException_init_$Create$ } from './error-library-error.mjs';
13
+ //region block: imports
14
+ //endregion
15
+ //region block: pre-declaration
16
+ initMetadataForClass(Digest, 'Digest');
17
+ //endregion
18
+ function _Buffer___init__impl__mrnqm7(value) {
19
+ return value;
20
+ }
21
+ function _Buffer___get_value__impl__xxr8tn($this) {
22
+ return $this;
23
+ }
24
+ function Buffer__hashCode_impl_3ylui6($this) {
25
+ return hashCode($this);
26
+ }
27
+ function Digest_init_$Init$(algorithm, blockSize, digestLength, $this) {
28
+ Digest.call($this);
29
+ var tmp = $this;
30
+ // Inline function 'org.kotlincrypto.core.digest.internal.initializeBuffer' call
31
+ // Inline function 'kotlin.text.isNotBlank' call
32
+ var tmp0 = !isBlank(algorithm);
33
+ $l$block: {
34
+ // Inline function 'org.kotlincrypto.error.requireParam' call
35
+ // Inline function 'kotlin.contracts.contract' call
36
+ if (tmp0) {
37
+ break $l$block;
38
+ }
39
+ var message = 'algorithm cannot be blank';
40
+ throw InvalidParameterException_init_$Create$(toString(message));
41
+ }
42
+ var tmp0_0 = blockSize > 0;
43
+ $l$block_0: {
44
+ // Inline function 'org.kotlincrypto.error.requireParam' call
45
+ // Inline function 'kotlin.contracts.contract' call
46
+ if (tmp0_0) {
47
+ break $l$block_0;
48
+ }
49
+ var message_0 = 'blockSize must be greater than 0';
50
+ throw InvalidParameterException_init_$Create$(toString(message_0));
51
+ }
52
+ var tmp0_1 = (blockSize % 8 | 0) === 0;
53
+ $l$block_1: {
54
+ // Inline function 'org.kotlincrypto.error.requireParam' call
55
+ // Inline function 'kotlin.contracts.contract' call
56
+ if (tmp0_1) {
57
+ break $l$block_1;
58
+ }
59
+ var message_1 = 'blockSize must be a factor of 8';
60
+ throw InvalidParameterException_init_$Create$(toString(message_1));
61
+ }
62
+ var tmp0_2 = digestLength >= 0;
63
+ $l$block_2: {
64
+ // Inline function 'org.kotlincrypto.error.requireParam' call
65
+ // Inline function 'kotlin.contracts.contract' call
66
+ if (tmp0_2) {
67
+ break $l$block_2;
68
+ }
69
+ var message_2 = 'digestLength cannot be negative';
70
+ throw InvalidParameterException_init_$Create$(toString(message_2));
71
+ }
72
+ tmp.g6y_1 = _Buffer___init__impl__mrnqm7(new Int8Array(blockSize));
73
+ $this.e6y_1 = algorithm;
74
+ $this.f6y_1 = digestLength;
75
+ $this.h6y_1 = 0;
76
+ return $this;
77
+ }
78
+ protoOf(Digest).i6y = function () {
79
+ return this.f6y_1;
80
+ };
81
+ protoOf(Digest).j6y = function () {
82
+ return this.e6y_1;
83
+ };
84
+ protoOf(Digest).k6y = function (input) {
85
+ this.l6y(input, 0, input.length);
86
+ };
87
+ protoOf(Digest).m6y = function () {
88
+ var tmp0 = this.g6y_1;
89
+ // Inline function 'org.kotlincrypto.core.digest.internal.commonDigest' call
90
+ var bufPos = this.h6y_1;
91
+ // Inline function 'kotlin.contracts.contract' call
92
+ fill(_Buffer___get_value__impl__xxr8tn(tmp0), 0, bufPos);
93
+ var p0 = _Buffer___get_value__impl__xxr8tn(tmp0);
94
+ var digest = this.n6y(p0, bufPos);
95
+ // Inline function 'org.kotlincrypto.core.digest.internal.commonReset' call
96
+ // Inline function 'kotlin.contracts.contract' call
97
+ fill(_Buffer___get_value__impl__xxr8tn(tmp0), 0);
98
+ this.h6y_1 = 0;
99
+ this.o6y();
100
+ return digest;
101
+ };
102
+ protoOf(Digest).l6y = function (input, offset, len) {
103
+ var tmp0 = this.g6y_1;
104
+ var tmp8 = this.h6y_1;
105
+ $l$block: {
106
+ // Inline function 'org.kotlincrypto.core.digest.internal.commonUpdate' call
107
+ // Inline function 'kotlin.contracts.contract' call
108
+ var buf = _Buffer___get_value__impl__xxr8tn(tmp0);
109
+ var blockSize = buf.length;
110
+ var limitInput = offset + len | 0;
111
+ var posInput = offset;
112
+ var posBuf = tmp8;
113
+ if (posBuf > 0) {
114
+ if ((posBuf + len | 0) < blockSize) {
115
+ var tmp4 = posBuf;
116
+ // Inline function 'kotlin.collections.copyInto' call
117
+ var startIndex = posInput;
118
+ // Inline function 'kotlin.js.unsafeCast' call
119
+ // Inline function 'kotlin.js.asDynamic' call
120
+ var tmp = input;
121
+ // Inline function 'kotlin.js.unsafeCast' call
122
+ // Inline function 'kotlin.js.asDynamic' call
123
+ arrayCopy(tmp, buf, tmp4, startIndex, limitInput);
124
+ this.h6y_1 = posBuf + len | 0;
125
+ break $l$block;
126
+ }
127
+ var needed = blockSize - posBuf | 0;
128
+ var tmp4_0 = posBuf;
129
+ var tmp6 = posInput;
130
+ // Inline function 'kotlin.collections.copyInto' call
131
+ var endIndex = posInput + needed | 0;
132
+ // Inline function 'kotlin.js.unsafeCast' call
133
+ // Inline function 'kotlin.js.asDynamic' call
134
+ var tmp_0 = input;
135
+ // Inline function 'kotlin.js.unsafeCast' call
136
+ // Inline function 'kotlin.js.asDynamic' call
137
+ arrayCopy(tmp_0, buf, tmp4_0, tmp6, endIndex);
138
+ this.p6y(buf, 0);
139
+ posBuf = 0;
140
+ posInput = posInput + needed | 0;
141
+ }
142
+ $l$loop: while (posInput < limitInput) {
143
+ var posNext = posInput + blockSize | 0;
144
+ if (posNext > limitInput) {
145
+ // Inline function 'kotlin.collections.copyInto' call
146
+ var startIndex_0 = posInput;
147
+ // Inline function 'kotlin.js.unsafeCast' call
148
+ // Inline function 'kotlin.js.asDynamic' call
149
+ var tmp_1 = input;
150
+ // Inline function 'kotlin.js.unsafeCast' call
151
+ // Inline function 'kotlin.js.asDynamic' call
152
+ arrayCopy(tmp_1, buf, 0, startIndex_0, limitInput);
153
+ posBuf = limitInput - posInput | 0;
154
+ break $l$loop;
155
+ }
156
+ var p1 = posInput;
157
+ this.p6y(input, p1);
158
+ posInput = posNext;
159
+ }
160
+ this.h6y_1 = posBuf;
161
+ }
162
+ };
163
+ protoOf(Digest).equals = function (other) {
164
+ var tmp;
165
+ if (other instanceof Digest) {
166
+ tmp = equals(other.g6y_1, this.g6y_1);
167
+ } else {
168
+ tmp = false;
169
+ }
170
+ return tmp;
171
+ };
172
+ protoOf(Digest).hashCode = function () {
173
+ return Buffer__hashCode_impl_3ylui6(this.g6y_1);
174
+ };
175
+ protoOf(Digest).toString = function () {
176
+ // Inline function 'org.kotlincrypto.core.digest.internal.commonToString' call
177
+ return 'Digest[' + this.j6y() + ']@' + this.hashCode();
178
+ };
179
+ function Digest() {
180
+ }
181
+ //region block: exports
182
+ export {
183
+ Digest_init_$Init$ as Digest_init_$Init$192xwc0pz8fza,
184
+ Digest as Digest1vc95ftpmqvn1,
185
+ };
186
+ //endregion
@@ -16,11 +16,15 @@ export interface XAesKey {
16
16
  readonly aesKey?: any;
17
17
  readonly algorithm: string;
18
18
  }
19
- export interface XCryptoService {
20
- readonly aes: XAesService;
21
- readonly digest: XDigestService;
19
+ export interface XCryptoService extends PartialXCryptoService {
22
20
  readonly rsa: XRsaService;
23
21
  readonly strongRandom: XStrongRandom;
22
+ }
23
+ export interface PartialXCryptoService {
24
+ readonly aes: XAesService;
25
+ readonly digest: XDigestService;
26
+ readonly rsa: PartialXRsaService & Partial<XRsaService>;
27
+ readonly strongRandom: PartialXStrongRandom & Partial<XStrongRandom>;
24
28
  readonly hmac: XHmacService;
25
29
  }
26
30
  export interface XDigestService {
@@ -54,17 +58,19 @@ export declare enum RsaSignatureAlgorithm {
54
58
  PssWithSha256 = "PssWithSha256"
55
59
  }
56
60
  export type RsaAlgorithm = RsaEncryptionAlgorithm | RsaSignatureAlgorithm;
57
- export interface XRsaService {
61
+ interface PartialXRsaService {
58
62
  generateKeyPair(algorithm: RsaAlgorithm, keySize: RsaKeySize): Promise<XRsaKeypair>;
59
63
  exportPrivateKeyPkcs8(key: XPrivateRsaKey): Promise<Int8Array>;
60
64
  exportPublicKeySpki(key: XPublicRsaKey): Promise<Int8Array>;
61
- loadKeyPairPkcs8(algorithm: RsaAlgorithm, privateKeyPkcs8: Int8Array): Promise<XRsaKeypair>;
62
65
  loadPrivateKeyPkcs8(algorithm: RsaAlgorithm, privateKeyPkcs8: Int8Array): Promise<XPrivateRsaKey>;
63
66
  loadPublicKeySpki(algorithm: RsaAlgorithm, publicKeySpki: Int8Array): Promise<XPublicRsaKey>;
64
67
  encrypt(data: Int8Array, publicKey: XPublicRsaKey): Promise<Int8Array>;
65
68
  decrypt(data: Int8Array, privateKey: XPrivateRsaKey): Promise<Int8Array>;
66
69
  sign(data: Int8Array, privateKey: XPrivateRsaKey): Promise<Int8Array>;
67
70
  verifySignature(signature: Int8Array, data: Int8Array, publicKey: XPublicRsaKey): Promise<boolean>;
71
+ }
72
+ interface XRsaService extends PartialXRsaService {
73
+ loadKeyPairPkcs8(algorithm: RsaAlgorithm, privateKeyPkcs8: Int8Array): Promise<XRsaKeypair>;
68
74
  exportPrivateKeyJwk(key: XPrivateRsaKey): Promise<JsonWebKey>;
69
75
  exportPublicKeyJwk(key: XPublicRsaKey): Promise<JsonWebKey>;
70
76
  loadPrivateKeyJwk(privateKeyJwk: JsonWebKey): Promise<XPrivateRsaKey>;
@@ -82,7 +88,11 @@ export interface XPublicRsaKey {
82
88
  readonly publicKey?: any;
83
89
  readonly algorithm: string;
84
90
  }
85
- export interface XStrongRandom {
86
- randomBytes(length: number): Int8Array;
91
+ export interface XStrongRandom extends PartialXStrongRandom {
87
92
  randomUUID(): string;
93
+ fill(array: Int8Array): void;
94
+ }
95
+ export interface PartialXStrongRandom {
96
+ randomBytes(length: number): Int8Array;
88
97
  }
98
+ export {};
@@ -0,0 +1,42 @@
1
+ import {
2
+ IllegalArgumentException_init_$Init$1blytbdgl1fky as IllegalArgumentException_init_$Init$,
3
+ protoOf180f3jzyo7rfj as protoOf,
4
+ objectCreate1ve4bgxiu4x98 as objectCreate,
5
+ captureStack1fzi4aczwc4hg as captureStack,
6
+ IllegalArgumentException_init_$Init$1ke5df1bctk2y as IllegalArgumentException_init_$Init$_0,
7
+ IllegalArgumentException2asla15b5jaob as IllegalArgumentException,
8
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
9
+ } from './kotlin-kotlin-stdlib.mjs';
10
+ //region block: imports
11
+ //endregion
12
+ //region block: pre-declaration
13
+ initMetadataForClass(InvalidParameterException, 'InvalidParameterException', InvalidParameterException_init_$Create$, IllegalArgumentException);
14
+ //endregion
15
+ function InvalidParameterException_init_$Init$($this) {
16
+ IllegalArgumentException_init_$Init$($this);
17
+ InvalidParameterException.call($this);
18
+ return $this;
19
+ }
20
+ function InvalidParameterException_init_$Create$() {
21
+ var tmp = InvalidParameterException_init_$Init$(objectCreate(protoOf(InvalidParameterException)));
22
+ captureStack(tmp, InvalidParameterException_init_$Create$);
23
+ return tmp;
24
+ }
25
+ function InvalidParameterException_init_$Init$_0(message, $this) {
26
+ IllegalArgumentException_init_$Init$_0(message, $this);
27
+ InvalidParameterException.call($this);
28
+ return $this;
29
+ }
30
+ function InvalidParameterException_init_$Create$_0(message) {
31
+ var tmp = InvalidParameterException_init_$Init$_0(message, objectCreate(protoOf(InvalidParameterException)));
32
+ captureStack(tmp, InvalidParameterException_init_$Create$_0);
33
+ return tmp;
34
+ }
35
+ function InvalidParameterException() {
36
+ captureStack(this, InvalidParameterException);
37
+ }
38
+ //region block: exports
39
+ export {
40
+ InvalidParameterException_init_$Create$_0 as InvalidParameterException_init_$Create$1dn8z68oxsdqm,
41
+ };
42
+ //endregion
@@ -0,0 +1,183 @@
1
+ import {
2
+ Digest_init_$Init$192xwc0pz8fza as Digest_init_$Init$,
3
+ Digest1vc95ftpmqvn1 as Digest,
4
+ } from './core-library-digest.mjs';
5
+ import { Bit32_init_$Create$3semccfol7xke as Bit32_init_$Create$ } from './bitops-library-bits.mjs';
6
+ import {
7
+ protoOf180f3jzyo7rfj as protoOf,
8
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
9
+ Unit_instance1fbcbse1fwigr as Unit_instance,
10
+ fill3lmv1pckd4inv as fill,
11
+ fill2542d4m9l93pn as fill_0,
12
+ arrayCopytctsywo3h7gj as arrayCopy,
13
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
14
+ VOID3gxj6tk5isa35 as VOID,
15
+ objectCreate1ve4bgxiu4x98 as objectCreate,
16
+ } from './kotlin-kotlin-stdlib.mjs';
17
+ import { Big_getInstancez5126ban219s as Big_getInstance } from './bitops-library-endian.mjs';
18
+ //region block: imports
19
+ //endregion
20
+ //region block: pre-declaration
21
+ initMetadataForCompanion(Companion);
22
+ initMetadataForClass(Bit32Digest, 'Bit32Digest', VOID, Digest);
23
+ initMetadataForCompanion(Companion_0);
24
+ initMetadataForClass(SHA256, 'SHA256', SHA256_init_$Create$, Bit32Digest);
25
+ //endregion
26
+ function Bit32Digest_init_$Init$(bitStrength, h, $this) {
27
+ Digest_init_$Init$('SHA-' + bitStrength, 64, bitStrength / 8 | 0, $this);
28
+ Bit32Digest.call($this);
29
+ $this.s6z_1 = h;
30
+ $this.t6z_1 = new Int32Array(64);
31
+ var tmp = $this;
32
+ // Inline function 'kotlin.collections.copyOf' call
33
+ // Inline function 'kotlin.js.asDynamic' call
34
+ tmp.u6z_1 = h.slice();
35
+ $this.v6z_1 = Bit32_init_$Create$(64);
36
+ return $this;
37
+ }
38
+ function Companion() {
39
+ Companion_instance = this;
40
+ this.w6z_1 = 64;
41
+ var tmp = this;
42
+ // Inline function 'kotlin.intArrayOf' call
43
+ tmp.x6z_1 = new Int32Array([1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993, -1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987, 1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, -1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885, -1035236496, -949202525, -778901479, -694614492, -200395387, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872, -1866530822, -1538233109, -1090935817, -965641998]);
44
+ }
45
+ var Companion_instance;
46
+ function Companion_getInstance() {
47
+ if (Companion_instance == null)
48
+ new Companion();
49
+ return Companion_instance;
50
+ }
51
+ protoOf(Bit32Digest).p6y = function (input, offset) {
52
+ var x = this.t6z_1;
53
+ Big_getInstance();
54
+ // Inline function 'org.kotlincrypto.bitops.endian.Big.bePackIntoUnsafe' call
55
+ var sourceIndexEnd = offset + 64 | 0;
56
+ Big_getInstance().n6z(input, x, 0, offset, sourceIndexEnd);
57
+ var inductionVariable = 16;
58
+ if (inductionVariable < 64)
59
+ do {
60
+ var i = inductionVariable;
61
+ inductionVariable = inductionVariable + 1 | 0;
62
+ var x15 = x[i - 15 | 0];
63
+ var s0 = (x15 >>> 7 | 0 | x15 << 25) ^ (x15 >>> 18 | 0 | x15 << 14) ^ (x15 >>> 3 | 0);
64
+ var x2 = x[i - 2 | 0];
65
+ var s1 = (x2 >>> 17 | 0 | x2 << 15) ^ (x2 >>> 19 | 0 | x2 << 13) ^ (x2 >>> 10 | 0);
66
+ var x16 = x[i - 16 | 0];
67
+ var x7 = x[i - 7 | 0];
68
+ x[i] = ((x16 + s0 | 0) + x7 | 0) + s1 | 0;
69
+ }
70
+ while (inductionVariable < 64);
71
+ var k = Companion_getInstance().x6z_1;
72
+ var state = this.u6z_1;
73
+ var a = state[0];
74
+ var b = state[1];
75
+ var c = state[2];
76
+ var d = state[3];
77
+ var e = state[4];
78
+ var f = state[5];
79
+ var g = state[6];
80
+ var h = state[7];
81
+ var inductionVariable_0 = 0;
82
+ if (inductionVariable_0 < 64)
83
+ do {
84
+ var i_0 = inductionVariable_0;
85
+ inductionVariable_0 = inductionVariable_0 + 1 | 0;
86
+ var s0_0 = (a >>> 2 | 0 | a << 30) ^ (a >>> 13 | 0 | a << 19) ^ (a >>> 22 | 0 | a << 10);
87
+ var s1_0 = (e >>> 6 | 0 | e << 26) ^ (e >>> 11 | 0 | e << 21) ^ (e >>> 25 | 0 | e << 7);
88
+ var ch = e & f ^ ~e & g;
89
+ var maj = a & b ^ a & c ^ b & c;
90
+ var t1 = (((h + s1_0 | 0) + ch | 0) + k[i_0] | 0) + x[i_0] | 0;
91
+ var t2 = s0_0 + maj | 0;
92
+ h = g;
93
+ g = f;
94
+ f = e;
95
+ e = d + t1 | 0;
96
+ d = c;
97
+ c = b;
98
+ b = a;
99
+ a = t1 + t2 | 0;
100
+ }
101
+ while (inductionVariable_0 < 64);
102
+ state[0] = state[0] + a | 0;
103
+ state[1] = state[1] + b | 0;
104
+ state[2] = state[2] + c | 0;
105
+ state[3] = state[3] + d | 0;
106
+ state[4] = state[4] + e | 0;
107
+ state[5] = state[5] + f | 0;
108
+ state[6] = state[6] + g | 0;
109
+ state[7] = state[7] + h | 0;
110
+ this.v6z_1.a6z();
111
+ };
112
+ protoOf(Bit32Digest).n6y = function (buf, bufPos) {
113
+ var digest = new Int8Array(this.i6y());
114
+ this.y6z(digest, 0, buf, bufPos);
115
+ return digest;
116
+ };
117
+ protoOf(Bit32Digest).y6z = function (dest, destOffset, buf, bufPos) {
118
+ var tmp0_container = this.v6z_1.b6z(bufPos).y6y();
119
+ var bitsLo = tmp0_container.na();
120
+ var bitsHi = tmp0_container.oa();
121
+ buf[bufPos] = -128;
122
+ if ((bufPos + 1 | 0) > 56) {
123
+ this.p6y(buf, 0);
124
+ fill(buf, 0, 0, 56);
125
+ }
126
+ // Inline function 'org.kotlincrypto.bitops.endian.Big.bePackIntoUnsafe' call
127
+ Big_getInstance();
128
+ Big_getInstance().l6z(bitsHi, buf, 56);
129
+ // Inline function 'org.kotlincrypto.bitops.endian.Big.bePackIntoUnsafe' call
130
+ Big_getInstance();
131
+ Big_getInstance().l6z(bitsLo, buf, 60);
132
+ this.p6y(buf, 0);
133
+ Big_getInstance();
134
+ var tmp2 = this.u6z_1;
135
+ // Inline function 'org.kotlincrypto.bitops.endian.Big.bePackIntoUnsafe' call
136
+ var sourceIndexEnd = this.i6y() / 4 | 0;
137
+ Big_getInstance().m6z(tmp2, dest, destOffset, 0, sourceIndexEnd);
138
+ };
139
+ protoOf(Bit32Digest).o6y = function () {
140
+ fill_0(this.t6z_1, 0);
141
+ var tmp0 = this.s6z_1;
142
+ // Inline function 'kotlin.collections.copyInto' call
143
+ var destination = this.u6z_1;
144
+ var endIndex = tmp0.length;
145
+ // Inline function 'kotlin.js.unsafeCast' call
146
+ // Inline function 'kotlin.js.asDynamic' call
147
+ var tmp = tmp0;
148
+ // Inline function 'kotlin.js.unsafeCast' call
149
+ // Inline function 'kotlin.js.asDynamic' call
150
+ arrayCopy(tmp, destination, 0, 0, endIndex);
151
+ this.v6z_1.c6z();
152
+ };
153
+ function Bit32Digest() {
154
+ Companion_getInstance();
155
+ }
156
+ function SHA256_init_$Init$($this) {
157
+ Bit32Digest_init_$Init$(256, Companion_getInstance_0().z6z_1, $this);
158
+ SHA256.call($this);
159
+ return $this;
160
+ }
161
+ function SHA256_init_$Create$() {
162
+ return SHA256_init_$Init$(objectCreate(protoOf(SHA256)));
163
+ }
164
+ function Companion_0() {
165
+ Companion_instance_0 = this;
166
+ var tmp = this;
167
+ // Inline function 'kotlin.intArrayOf' call
168
+ tmp.z6z_1 = new Int32Array([1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225]);
169
+ }
170
+ var Companion_instance_0;
171
+ function Companion_getInstance_0() {
172
+ if (Companion_instance_0 == null)
173
+ new Companion_0();
174
+ return Companion_instance_0;
175
+ }
176
+ function SHA256() {
177
+ Companion_getInstance_0();
178
+ }
179
+ //region block: exports
180
+ export {
181
+ SHA256_init_$Create$ as SHA256_init_$Create$1g9q29rq575z3,
182
+ };
183
+ //endregion
@@ -0,0 +1,3 @@
1
+ export declare function decodeBase64(s: string, path: string[]): Int8Array;
2
+ export declare function decodeBase64(s: string | undefined, path: string[]): Int8Array | undefined;
3
+ export declare function encodeBase64(bytes: Int8Array): string;
@@ -0,0 +1,99 @@
1
+ function bytesAsString(bytes) {
2
+ let str = '';
3
+ const ab = new Uint8Array(bytes.buffer);
4
+ const abLen = ab.length;
5
+ const CHUNK_SIZE = Math.pow(2, 8);
6
+ let offset, len, subab;
7
+ for (offset = 0; offset < abLen; offset += CHUNK_SIZE) {
8
+ len = Math.min(CHUNK_SIZE, abLen - offset);
9
+ subab = ab.subarray(offset, offset + len);
10
+ str += String.fromCharCode.apply(null, subab);
11
+ }
12
+ return str;
13
+ }
14
+ function stringAsBytes(s) {
15
+ const res = new Int8Array(s.length);
16
+ const asUa = new Uint8Array(res.buffer);
17
+ for (let i = 0; i < s.length; i++) {
18
+ asUa[i] = s.charCodeAt(i) & 0xff;
19
+ }
20
+ return res;
21
+ }
22
+ function b2a(a) {
23
+ if (typeof window !== 'undefined') {
24
+ //Favour btoa in browser
25
+ if (typeof btoa !== 'undefined') {
26
+ return btoa(a);
27
+ }
28
+ // @ts-ignore
29
+ if (typeof Buffer !== 'undefined') {
30
+ // @ts-ignore
31
+ const buf = Buffer.from(a, 'latin1');
32
+ return buf.toString('base64');
33
+ }
34
+ }
35
+ else {
36
+ // @ts-ignore
37
+ if (typeof Buffer !== 'undefined') {
38
+ // @ts-ignore
39
+ const buf = Buffer.from(a, 'latin1');
40
+ return buf.toString('base64');
41
+ }
42
+ if (typeof btoa !== 'undefined') {
43
+ return btoa(a);
44
+ }
45
+ }
46
+ throw new Error('Unsupported operation b2a');
47
+ }
48
+ // Check if the input is a valid base64 string, returning null if invalid, or the properly padded string otherwise.
49
+ // If the input is already padded but the amount of padding is wrong the method returns null else it is retuned as is
50
+ function validateAndPadBase64(str) {
51
+ if (str.length % 4 === 1)
52
+ return null;
53
+ if (!/^[A-Za-z0-9+/]*={0,2}$/.test(str))
54
+ return null;
55
+ const padding = (str.match(/=*$/) || [''])[0].length;
56
+ if (padding > 2)
57
+ return null;
58
+ if (padding > 0 && str.length % 4 !== 0)
59
+ return null;
60
+ return (padding > 0) ? str : str + '==='.slice((str.length + 3) % 4);
61
+ }
62
+ function a2b(s) {
63
+ if (typeof window !== 'undefined') {
64
+ //Favour atob in browser
65
+ if (typeof atob !== 'undefined') {
66
+ return atob(s);
67
+ }
68
+ // @ts-ignore
69
+ if (typeof Buffer !== 'undefined') {
70
+ // @ts-ignore
71
+ const buf = new Buffer(s, 'base64');
72
+ return buf.toString('latin1');
73
+ }
74
+ }
75
+ else {
76
+ // @ts-ignore
77
+ if (typeof Buffer !== 'undefined') {
78
+ // @ts-ignore
79
+ const buf = new Buffer(s, 'base64');
80
+ return buf.toString('latin1');
81
+ }
82
+ if (typeof atob !== 'undefined') {
83
+ return atob(s);
84
+ }
85
+ }
86
+ throw new Error('Unsupported operation a2b');
87
+ }
88
+ export function decodeBase64(s, path) {
89
+ if (s == undefined)
90
+ return undefined;
91
+ const padded = validateAndPadBase64(s);
92
+ if (padded == null)
93
+ throw new Error(`Invalid base64 string '${s}' at ${path.join()}`);
94
+ return stringAsBytes(a2b(s));
95
+ }
96
+ // Encode an Int8Array to a base64 string using the url-unsafe alphabet
97
+ export function encodeBase64(bytes) {
98
+ return b2a(bytesAsString(bytes));
99
+ }
@@ -0,0 +1,20 @@
1
+ export declare function extractEntry(json: any, name: string, required: boolean, path: string[]): any;
2
+ export declare function expectObject<T>(json: any, nullable: true, ignoreUnknown: boolean, path: string[], decoder: (j: any, i: boolean, p: string[]) => T): T | undefined;
3
+ export declare function expectObject<T>(json: any, nullable: false, ignoreUnknown: boolean, path: string[], decoder: (j: any, i: boolean, p: string[]) => T): T;
4
+ export declare function expectNullish(json: any, path: string[]): undefined;
5
+ export declare function expectString(json: any, nullable: true, path: string[]): string | undefined;
6
+ export declare function expectString(json: any, nullable: false, path: string[]): string;
7
+ export declare function expectBoolean(json: any, nullable: true, path: string[]): boolean | undefined;
8
+ export declare function expectBoolean(json: any, nullable: false, path: string[]): boolean;
9
+ export declare function expectNumber(json: any, nullable: true, integer: boolean, path: string[]): number | undefined;
10
+ export declare function expectNumber(json: any, nullable: false, integer: boolean, path: string[]): number;
11
+ export declare function expectArray<T>(json: any, nullable: true, path: string[], transform: (item: any, path: string[]) => T): T[] | undefined;
12
+ export declare function expectArray<T>(json: any, nullable: false, path: string[], transform: (item: any, path: string[]) => T): T[];
13
+ export declare function expectMap<K extends string | number, V>(json: any, nullable: true, path: string[], mapKey: (key: string, path: string[]) => K, mapValue: (value: any, path: string[]) => V): Record<K, V> | undefined;
14
+ export declare function expectMap<K extends string | number, V>(json: any, nullable: false, path: string[], mapKey: (key: string, path: string[]) => K, mapValue: (value: any, path: string[]) => V): Record<K, V>;
15
+ export declare function expectStringEnum<T extends {
16
+ [key: string]: string;
17
+ }>(json: any, nullable: true, path: string[], enumType: T, enumName: string): T[keyof T] | undefined;
18
+ export declare function expectStringEnum<T extends {
19
+ [key: string]: string;
20
+ }>(json: any, nullable: false, path: string[], enumType: T, enumName: string): T[keyof T];