@decaf-ts/for-fabric 0.11.0 → 0.12.0

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 (295) hide show
  1. package/lib/cjs/version.cjs +1 -1
  2. package/lib/esm/version.js +1 -1
  3. package/lib/types/client/FabricClientAdapter.d.cts +3 -3
  4. package/lib/types/client/FabricClientAdapter.d.mts +3 -3
  5. package/lib/types/client/FabricClientDispatch.d.cts +2 -2
  6. package/lib/types/client/FabricClientDispatch.d.mts +2 -2
  7. package/lib/types/client/FabricClientPaginator.d.cts +1 -1
  8. package/lib/types/client/FabricClientPaginator.d.mts +1 -1
  9. package/lib/types/client/FabricClientRepository.d.cts +1 -1
  10. package/lib/types/client/FabricClientRepository.d.mts +1 -1
  11. package/lib/types/client/FabricClientStatement.d.cts +2 -2
  12. package/lib/types/client/FabricClientStatement.d.mts +2 -2
  13. package/lib/types/client/collections/index.d.cts +1 -1
  14. package/lib/types/client/collections/index.d.mts +1 -1
  15. package/lib/types/client/constants.d.cts +1 -1
  16. package/lib/types/client/constants.d.mts +1 -1
  17. package/lib/types/client/erc20/FabricERC20ClientRepository.d.cts +3 -3
  18. package/lib/types/client/erc20/FabricERC20ClientRepository.d.mts +3 -3
  19. package/lib/types/client/erc20/index.d.cts +1 -1
  20. package/lib/types/client/erc20/index.d.mts +1 -1
  21. package/lib/types/client/ids/index.d.cts +1 -1
  22. package/lib/types/client/ids/index.d.mts +1 -1
  23. package/lib/types/client/index.d.cts +14 -14
  24. package/lib/types/client/index.d.mts +14 -14
  25. package/lib/types/client/indexes/index.d.cts +1 -1
  26. package/lib/types/client/indexes/index.d.mts +1 -1
  27. package/lib/types/client/services/FabricEnrollmentService.d.cts +4 -4
  28. package/lib/types/client/services/FabricEnrollmentService.d.mts +4 -4
  29. package/lib/types/client/services/FabricIdentityService.d.cts +5 -5
  30. package/lib/types/client/services/FabricIdentityService.d.mts +5 -5
  31. package/lib/types/client/services/RegistrationRequestBuilder.d.cts +1 -1
  32. package/lib/types/client/services/RegistrationRequestBuilder.d.mts +1 -1
  33. package/lib/types/client/services/index.d.cts +4 -4
  34. package/lib/types/client/services/index.d.mts +4 -4
  35. package/lib/types/client/types.d.cts +1 -1
  36. package/lib/types/client/types.d.mts +1 -1
  37. package/lib/types/client/utils.d.cts +1 -1
  38. package/lib/types/client/utils.d.mts +1 -1
  39. package/lib/types/contract/AddressContract.d.cts +2 -2
  40. package/lib/types/contract/AddressContract.d.mts +2 -2
  41. package/lib/types/contract/AuditContract.d.cts +2 -2
  42. package/lib/types/contract/AuditContract.d.mts +2 -2
  43. package/lib/types/contract/BatchContract.d.cts +2 -2
  44. package/lib/types/contract/BatchContract.d.mts +2 -2
  45. package/lib/types/contract/MarketContract.d.cts +2 -2
  46. package/lib/types/contract/MarketContract.d.mts +2 -2
  47. package/lib/types/contract/OtherAuditContract.d.cts +2 -2
  48. package/lib/types/contract/OtherAuditContract.d.mts +2 -2
  49. package/lib/types/contract/OtherBatchContract.d.cts +2 -2
  50. package/lib/types/contract/OtherBatchContract.d.mts +2 -2
  51. package/lib/types/contract/OtherMarketContract.d.cts +2 -2
  52. package/lib/types/contract/OtherMarketContract.d.mts +2 -2
  53. package/lib/types/contract/OtherProductContract.d.cts +2 -2
  54. package/lib/types/contract/OtherProductContract.d.mts +2 -2
  55. package/lib/types/contract/OtherProductImageContract.d.cts +2 -2
  56. package/lib/types/contract/OtherProductImageContract.d.mts +2 -2
  57. package/lib/types/contract/OtherProductSharedContract.d.cts +2 -2
  58. package/lib/types/contract/OtherProductSharedContract.d.mts +2 -2
  59. package/lib/types/contract/OtherProductStrengthContract.d.cts +2 -2
  60. package/lib/types/contract/OtherProductStrengthContract.d.mts +2 -2
  61. package/lib/types/contract/Product.d.cts +1 -1
  62. package/lib/types/contract/Product.d.mts +1 -1
  63. package/lib/types/contract/ProductContract.d.cts +2 -2
  64. package/lib/types/contract/ProductContract.d.mts +2 -2
  65. package/lib/types/contract/ProductStrengthContract.d.cts +2 -2
  66. package/lib/types/contract/ProductStrengthContract.d.mts +2 -2
  67. package/lib/types/contract/SegregatedPrivateDocumentContract.d.cts +2 -2
  68. package/lib/types/contract/SegregatedPrivateDocumentContract.d.mts +2 -2
  69. package/lib/types/contract/SegregatedSharedDocumentContract.d.cts +2 -2
  70. package/lib/types/contract/SegregatedSharedDocumentContract.d.mts +2 -2
  71. package/lib/types/contract/UserContract.d.cts +2 -2
  72. package/lib/types/contract/UserContract.d.mts +2 -2
  73. package/lib/types/contract/models/Audit.d.cts +2 -2
  74. package/lib/types/contract/models/Audit.d.mts +2 -2
  75. package/lib/types/contract/models/BaseIdentifiedModel.d.cts +1 -1
  76. package/lib/types/contract/models/BaseIdentifiedModel.d.mts +1 -1
  77. package/lib/types/contract/models/Batch.d.cts +1 -1
  78. package/lib/types/contract/models/Batch.d.mts +1 -1
  79. package/lib/types/contract/models/GtinOwner.d.cts +1 -1
  80. package/lib/types/contract/models/GtinOwner.d.mts +1 -1
  81. package/lib/types/contract/models/Leaflet.d.cts +1 -1
  82. package/lib/types/contract/models/Leaflet.d.mts +1 -1
  83. package/lib/types/contract/models/LeafletFile.d.cts +1 -1
  84. package/lib/types/contract/models/LeafletFile.d.mts +1 -1
  85. package/lib/types/contract/models/Market.d.cts +1 -1
  86. package/lib/types/contract/models/Market.d.mts +1 -1
  87. package/lib/types/contract/models/OtherAudit.d.cts +2 -2
  88. package/lib/types/contract/models/OtherAudit.d.mts +2 -2
  89. package/lib/types/contract/models/OtherBatchShared.d.cts +1 -1
  90. package/lib/types/contract/models/OtherBatchShared.d.mts +1 -1
  91. package/lib/types/contract/models/OtherLeaflet.d.cts +2 -2
  92. package/lib/types/contract/models/OtherLeaflet.d.mts +2 -2
  93. package/lib/types/contract/models/OtherLeafletFile.d.cts +1 -1
  94. package/lib/types/contract/models/OtherLeafletFile.d.mts +1 -1
  95. package/lib/types/contract/models/OtherMarket.d.cts +1 -1
  96. package/lib/types/contract/models/OtherMarket.d.mts +1 -1
  97. package/lib/types/contract/models/OtherProduct.d.cts +1 -1
  98. package/lib/types/contract/models/OtherProduct.d.mts +1 -1
  99. package/lib/types/contract/models/OtherProductImage.d.cts +1 -1
  100. package/lib/types/contract/models/OtherProductImage.d.mts +1 -1
  101. package/lib/types/contract/models/OtherProductShared.d.cts +4 -4
  102. package/lib/types/contract/models/OtherProductShared.d.mts +4 -4
  103. package/lib/types/contract/models/OtherProductStrength.d.cts +1 -1
  104. package/lib/types/contract/models/OtherProductStrength.d.mts +1 -1
  105. package/lib/types/contract/models/Product.d.cts +3 -3
  106. package/lib/types/contract/models/Product.d.mts +3 -3
  107. package/lib/types/contract/models/ProductStrength.d.cts +1 -1
  108. package/lib/types/contract/models/ProductStrength.d.mts +1 -1
  109. package/lib/types/contract/models/SegregatedDocument.d.cts +1 -1
  110. package/lib/types/contract/models/SegregatedDocument.d.mts +1 -1
  111. package/lib/types/contract/models/decorators-private.d.cts +2 -2
  112. package/lib/types/contract/models/decorators-private.d.mts +2 -2
  113. package/lib/types/contract/models/decorators.d.cts +2 -2
  114. package/lib/types/contract/models/decorators.d.mts +2 -2
  115. package/lib/types/contract/models/history-dec.d.cts +1 -1
  116. package/lib/types/contract/models/history-dec.d.mts +1 -1
  117. package/lib/types/contracts/ContractAdapter.d.cts +5 -5
  118. package/lib/types/contracts/ContractAdapter.d.mts +5 -5
  119. package/lib/types/contracts/ContractContext.d.cts +1 -1
  120. package/lib/types/contracts/ContractContext.d.mts +1 -1
  121. package/lib/types/contracts/FabricContractDispatch.d.cts +2 -2
  122. package/lib/types/contracts/FabricContractDispatch.d.mts +2 -2
  123. package/lib/types/contracts/FabricContractPaginator.d.cts +1 -1
  124. package/lib/types/contracts/FabricContractPaginator.d.mts +1 -1
  125. package/lib/types/contracts/FabricContractRepository.d.cts +3 -3
  126. package/lib/types/contracts/FabricContractRepository.d.mts +3 -3
  127. package/lib/types/contracts/FabricContractRepositoryObservableHandler.d.cts +1 -1
  128. package/lib/types/contracts/FabricContractRepositoryObservableHandler.d.mts +1 -1
  129. package/lib/types/contracts/FabricContractStatement.d.cts +1 -1
  130. package/lib/types/contracts/FabricContractStatement.d.mts +1 -1
  131. package/lib/types/contracts/MigrationContract.d.cts +3 -3
  132. package/lib/types/contracts/MigrationContract.d.mts +3 -3
  133. package/lib/types/contracts/auth/index.d.cts +1 -1
  134. package/lib/types/contracts/auth/index.d.mts +1 -1
  135. package/lib/types/contracts/crud/crud-contract.d.cts +5 -5
  136. package/lib/types/contracts/crud/crud-contract.d.mts +5 -5
  137. package/lib/types/contracts/crud/index.d.cts +2 -2
  138. package/lib/types/contracts/crud/index.d.mts +2 -2
  139. package/lib/types/contracts/crud/serialized-crud-contract.d.cts +1 -1
  140. package/lib/types/contracts/crud/serialized-crud-contract.d.mts +1 -1
  141. package/lib/types/contracts/erc20/erc20contract.d.cts +3 -3
  142. package/lib/types/contracts/erc20/erc20contract.d.mts +3 -3
  143. package/lib/types/contracts/erc20/index.d.cts +1 -1
  144. package/lib/types/contracts/erc20/index.d.mts +1 -1
  145. package/lib/types/contracts/index.d.cts +13 -13
  146. package/lib/types/contracts/index.d.mts +13 -13
  147. package/lib/types/contracts/types.d.cts +1 -1
  148. package/lib/types/contracts/types.d.mts +1 -1
  149. package/lib/types/index.d.cts +3 -3
  150. package/lib/types/index.d.mts +3 -3
  151. package/lib/types/shared/decorators.d.cts +3 -3
  152. package/lib/types/shared/decorators.d.mts +3 -3
  153. package/lib/types/shared/erc20/index.d.cts +1 -1
  154. package/lib/types/shared/erc20/index.d.mts +1 -1
  155. package/lib/types/shared/index.d.cts +14 -14
  156. package/lib/types/shared/index.d.mts +14 -14
  157. package/lib/types/shared/interfaces/index.d.cts +1 -1
  158. package/lib/types/shared/interfaces/index.d.mts +1 -1
  159. package/lib/types/shared/model/FabricIdentifiedBaseModel.d.cts +1 -1
  160. package/lib/types/shared/model/FabricIdentifiedBaseModel.d.mts +1 -1
  161. package/lib/types/shared/model/Identity.d.cts +2 -2
  162. package/lib/types/shared/model/Identity.d.mts +2 -2
  163. package/lib/types/shared/model/index.d.cts +4 -4
  164. package/lib/types/shared/model/index.d.mts +4 -4
  165. package/lib/types/shared/overrides/Model.d.cts +2 -2
  166. package/lib/types/shared/overrides/Model.d.mts +2 -2
  167. package/lib/types/shared/overrides/index.d.cts +2 -2
  168. package/lib/types/shared/overrides/index.d.mts +2 -2
  169. package/lib/types/version.d.cts +1 -1
  170. package/lib/types/version.d.mts +1 -1
  171. package/package.json +1 -1
  172. package/lib/types/bin/cli.d.ts +0 -1
  173. package/lib/types/cli-module.d.ts +0 -3
  174. package/lib/types/cli-utils.d.ts +0 -21
  175. package/lib/types/client/FabricClientAdapter.d.ts +0 -404
  176. package/lib/types/client/FabricClientDispatch.d.ts +0 -133
  177. package/lib/types/client/FabricClientPaginator.d.ts +0 -12
  178. package/lib/types/client/FabricClientRepository.d.ts +0 -71
  179. package/lib/types/client/FabricClientStatement.d.ts +0 -64
  180. package/lib/types/client/collections/generation.d.ts +0 -46
  181. package/lib/types/client/collections/index.d.ts +0 -1
  182. package/lib/types/client/constants.d.ts +0 -2
  183. package/lib/types/client/crypto.d.ts +0 -107
  184. package/lib/types/client/erc20/FabricERC20ClientRepository.d.ts +0 -254
  185. package/lib/types/client/erc20/index.d.ts +0 -1
  186. package/lib/types/client/fabric-fs.d.ts +0 -92
  187. package/lib/types/client/fabric-hsm.d.ts +0 -24
  188. package/lib/types/client/ids/id-extraction.d.ts +0 -4
  189. package/lib/types/client/ids/index.d.ts +0 -1
  190. package/lib/types/client/index.d.ts +0 -23
  191. package/lib/types/client/indexes/generation.d.ts +0 -10
  192. package/lib/types/client/indexes/index.d.ts +0 -1
  193. package/lib/types/client/logging.d.ts +0 -60
  194. package/lib/types/client/services/FabricEnrollmentService.d.ts +0 -176
  195. package/lib/types/client/services/FabricIdentityService.d.ts +0 -98
  196. package/lib/types/client/services/RegistrationRequestBuilder.d.ts +0 -19
  197. package/lib/types/client/services/constants.d.ts +0 -15
  198. package/lib/types/client/services/index.d.ts +0 -4
  199. package/lib/types/client/types.d.ts +0 -20
  200. package/lib/types/client/utils.d.ts +0 -71
  201. package/lib/types/contract/Address.d.ts +0 -13
  202. package/lib/types/contract/AddressContract.d.ts +0 -5
  203. package/lib/types/contract/AuditContract.d.ts +0 -5
  204. package/lib/types/contract/BatchContract.d.ts +0 -5
  205. package/lib/types/contract/MarketContract.d.ts +0 -5
  206. package/lib/types/contract/OtherAuditContract.d.ts +0 -5
  207. package/lib/types/contract/OtherBatchContract.d.ts +0 -5
  208. package/lib/types/contract/OtherMarketContract.d.ts +0 -5
  209. package/lib/types/contract/OtherProductContract.d.ts +0 -5
  210. package/lib/types/contract/OtherProductImageContract.d.ts +0 -5
  211. package/lib/types/contract/OtherProductSharedContract.d.ts +0 -5
  212. package/lib/types/contract/OtherProductStrengthContract.d.ts +0 -5
  213. package/lib/types/contract/Product.d.ts +0 -7
  214. package/lib/types/contract/ProductContract.d.ts +0 -5
  215. package/lib/types/contract/ProductStrengthContract.d.ts +0 -5
  216. package/lib/types/contract/SegregatedPrivateDocumentContract.d.ts +0 -5
  217. package/lib/types/contract/SegregatedSharedDocumentContract.d.ts +0 -5
  218. package/lib/types/contract/User.d.ts +0 -7
  219. package/lib/types/contract/UserContract.d.ts +0 -5
  220. package/lib/types/contract/index.d.ts +0 -2
  221. package/lib/types/contract/logging-context.d.ts +0 -8
  222. package/lib/types/contract/models/Audit.d.ts +0 -13
  223. package/lib/types/contract/models/BaseIdentifiedModel.d.ts +0 -7
  224. package/lib/types/contract/models/BaseModel.d.ts +0 -7
  225. package/lib/types/contract/models/Batch.d.ts +0 -18
  226. package/lib/types/contract/models/GtinOwner.d.ts +0 -8
  227. package/lib/types/contract/models/History.d.ts +0 -9
  228. package/lib/types/contract/models/Leaflet.d.ts +0 -12
  229. package/lib/types/contract/models/LeafletFile.d.ts +0 -9
  230. package/lib/types/contract/models/Market.d.ts +0 -12
  231. package/lib/types/contract/models/OtherAudit.d.ts +0 -15
  232. package/lib/types/contract/models/OtherBatchShared.d.ts +0 -18
  233. package/lib/types/contract/models/OtherLeaflet.d.ts +0 -16
  234. package/lib/types/contract/models/OtherLeafletFile.d.ts +0 -10
  235. package/lib/types/contract/models/OtherMarket.d.ts +0 -13
  236. package/lib/types/contract/models/OtherProduct.d.ts +0 -12
  237. package/lib/types/contract/models/OtherProductImage.d.ts +0 -9
  238. package/lib/types/contract/models/OtherProductShared.d.ts +0 -18
  239. package/lib/types/contract/models/OtherProductStrength.d.ts +0 -12
  240. package/lib/types/contract/models/Product.d.ts +0 -15
  241. package/lib/types/contract/models/ProductStrength.d.ts +0 -11
  242. package/lib/types/contract/models/SegregatedDocument.d.ts +0 -18
  243. package/lib/types/contract/models/constants.d.ts +0 -24
  244. package/lib/types/contract/models/decorators-private.d.ts +0 -16
  245. package/lib/types/contract/models/decorators.d.ts +0 -28
  246. package/lib/types/contract/models/gtin.d.ts +0 -8
  247. package/lib/types/contract/models/history-dec.d.ts +0 -6
  248. package/lib/types/contracts/ContractAdapter.d.ts +0 -287
  249. package/lib/types/contracts/ContractContext.d.ts +0 -89
  250. package/lib/types/contracts/FabricContractDispatch.d.ts +0 -7
  251. package/lib/types/contracts/FabricContractPaginator.d.ts +0 -105
  252. package/lib/types/contracts/FabricContractRepository.d.ts +0 -119
  253. package/lib/types/contracts/FabricContractRepositoryObservableHandler.d.ts +0 -62
  254. package/lib/types/contracts/FabricContractSequence.d.ts +0 -87
  255. package/lib/types/contracts/FabricContractStatement.d.ts +0 -36
  256. package/lib/types/contracts/MigrationContract.d.ts +0 -22
  257. package/lib/types/contracts/PrivateSequence.d.ts +0 -15
  258. package/lib/types/contracts/auth/decorators.d.ts +0 -6
  259. package/lib/types/contracts/auth/index.d.ts +0 -1
  260. package/lib/types/contracts/crud/crud-contract.d.ts +0 -199
  261. package/lib/types/contracts/crud/index.d.ts +0 -2
  262. package/lib/types/contracts/crud/serialized-crud-contract.d.ts +0 -42
  263. package/lib/types/contracts/erc20/erc20contract.d.ts +0 -152
  264. package/lib/types/contracts/erc20/index.d.ts +0 -2
  265. package/lib/types/contracts/erc20/models.d.ts +0 -114
  266. package/lib/types/contracts/index.d.ts +0 -20
  267. package/lib/types/contracts/logging.d.ts +0 -54
  268. package/lib/types/contracts/overrides.d.ts +0 -1
  269. package/lib/types/contracts/types.d.ts +0 -38
  270. package/lib/types/contracts/uuid.d.ts +0 -2
  271. package/lib/types/index.d.ts +0 -8
  272. package/lib/types/shared/ClientSerializer.d.ts +0 -52
  273. package/lib/types/shared/DeterministicSerializer.d.ts +0 -47
  274. package/lib/types/shared/SimpleDeterministicSerializer.d.ts +0 -7
  275. package/lib/types/shared/constants.d.ts +0 -35
  276. package/lib/types/shared/decorators.d.ts +0 -81
  277. package/lib/types/shared/erc20/erc20-constants.d.ts +0 -25
  278. package/lib/types/shared/erc20/index.d.ts +0 -1
  279. package/lib/types/shared/errors.d.ts +0 -140
  280. package/lib/types/shared/events.d.ts +0 -37
  281. package/lib/types/shared/fabric-types.d.ts +0 -32
  282. package/lib/types/shared/index.d.ts +0 -21
  283. package/lib/types/shared/interfaces/Checkable.d.ts +0 -23
  284. package/lib/types/shared/interfaces/index.d.ts +0 -1
  285. package/lib/types/shared/math.d.ts +0 -34
  286. package/lib/types/shared/model/FabricBaseModel.d.ts +0 -7
  287. package/lib/types/shared/model/FabricIdentifiedBaseModel.d.ts +0 -7
  288. package/lib/types/shared/model/Identity.d.ts +0 -42
  289. package/lib/types/shared/model/IdentityCredentials.d.ts +0 -41
  290. package/lib/types/shared/model/index.d.ts +0 -4
  291. package/lib/types/shared/overrides/Model.d.ts +0 -22
  292. package/lib/types/shared/overrides/index.d.ts +0 -2
  293. package/lib/types/shared/overrides/overrides.d.ts +0 -1
  294. package/lib/types/shared/types.d.ts +0 -125
  295. package/lib/types/version.d.ts +0 -2
@@ -1,37 +0,0 @@
1
- import { BulkCrudOperationKeys, OperationKeys } from "@decaf-ts/db-decorators";
2
- /**
3
- * @description Generates a Fabric event name from components
4
- * @summary Creates a standardized event name by joining table, event, and optional owner with underscores
5
- * @param {string} table - The table/collection name
6
- * @param {OperationKeys | BulkCrudOperationKeys | string} event - The event type
7
- * @param {string} [owner] - Optional owner identifier
8
- * @return {string} The generated event name in format "table_event" or "table_event_owner"
9
- * @function generateFabricEventName
10
- * @memberOf module:for-fabric.shared
11
- */
12
- export declare function generateFabricEventName(table: string, event: OperationKeys | BulkCrudOperationKeys | string, owner?: string): string;
13
- /**
14
- * @description Parses a Fabric event name into its components
15
- * @summary Splits an event name by underscores and extracts table, event, and optional owner
16
- * @param {string} name - The event name to parse
17
- * @return {{table: string, event: OperationKeys | BulkCrudOperationKeys | string, owner: string}} The parsed components as a structured object
18
- * @throws {InternalError} If the event name format is invalid
19
- * @function parseEventName
20
- * @mermaid
21
- * sequenceDiagram
22
- * participant Caller
23
- * participant Parser as parseEventName
24
- * Caller->>Parser: parseEventName(name)
25
- * Parser->>Parser: split name by "_"
26
- * alt parts length invalid
27
- * Parser-->>Caller: throw InternalError
28
- * else
29
- * Parser-->>Caller: { table, event, owner? }
30
- * end
31
- * @memberOf module:for-fabric.shared
32
- */
33
- export declare function parseEventName(name: string): {
34
- table?: string;
35
- event: OperationKeys | BulkCrudOperationKeys | string;
36
- owner?: string;
37
- };
@@ -1,32 +0,0 @@
1
- export type GetCertificatesRequest = {
2
- id?: string;
3
- aki?: string;
4
- serial?: string;
5
- revoked_start?: string;
6
- revoked_end?: string;
7
- expired_start?: string;
8
- expired_end?: string;
9
- notrevoked?: boolean;
10
- notexpired?: boolean;
11
- ca?: string;
12
- };
13
- export type CertificateResponse = {
14
- caname: string;
15
- certs: {
16
- PEM: string;
17
- }[];
18
- };
19
- export type FabricIdentity = {
20
- id: string;
21
- type: string;
22
- affiliation: string;
23
- attrs: {
24
- name: string;
25
- value: string;
26
- }[];
27
- max_enrollments: number;
28
- };
29
- export type IdentityResponse = {
30
- caname: string;
31
- identities: FabricIdentity[];
32
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * @description Hyperledger Fabric Shared Module for Decaf-ts
3
- * @summary This module provides common logic to the client and contract sides of Hyperledger Fabric
4
- * @namespace shared
5
- * @memberOf module:for-fabric
6
- */
7
- import "./overrides";
8
- export * from "./erc20";
9
- export * from "./interfaces";
10
- export * from "./model";
11
- export * from "./overrides";
12
- export * from "./ClientSerializer";
13
- export * from "./constants";
14
- export * from "./decorators";
15
- export * from "./DeterministicSerializer";
16
- export * from "./errors";
17
- export * from "./events";
18
- export * from "./fabric-types";
19
- export * from "./math";
20
- export * from "./SimpleDeterministicSerializer";
21
- export * from "./types";
@@ -1,23 +0,0 @@
1
- import { Context } from "fabric-contract-api";
2
- /**
3
- * @description Interface for health-check capable contracts/services
4
- * @summary Provides a standard healthcheck method signature to probe liveness/readiness of Fabric contracts or services using a Fabric context
5
- * @param {Context} ctx - Fabric transaction context used for performing the health check
6
- * @return {Promise<string|boolean>} A message describing health or a boolean status
7
- * @interface Checkable
8
- * @memberOf module:for-fabric.shared
9
- */
10
- export interface Checkable {
11
- /**
12
- * @description Perform a health check using the Fabric transaction context
13
- * @summary Allows implementers to report readiness/liveness information that can be a textual message or a boolean status
14
- * @param {Context} ctx - Fabric transaction context reference used during the check
15
- * @return {Promise<string|boolean>} A string message describing health or a boolean indicating healthy/unhealthy
16
- */
17
- healthcheck(ctx: Context): Promise<string | healthcheck>;
18
- }
19
- export type healthcheck = {
20
- healthcheck: boolean;
21
- version: string | number;
22
- package: string;
23
- };
@@ -1 +0,0 @@
1
- export * from "./Checkable";
@@ -1,34 +0,0 @@
1
- /**
2
- * @description Overflow-safe addition operation
3
- * @summary Adds two numbers and verifies no overflow by reverse-checking the operands
4
- * @param {number} a - First operand
5
- * @param {number} b - Second operand
6
- * @return {number} The sum of a and b
7
- * @function add
8
- * @throws {OverflowError} on addition overflow
9
- * @memberOf module:for-fabric.shared
10
- */
11
- export declare function add(a: number, b: number): number;
12
- /**
13
- * @description Overflow-safe subtraction operation
14
- * @summary Subtracts b from a and validates no overflow by reverse-checking the operands
15
- * @param {number} a - Minuend
16
- * @param {number} b - Subtrahend
17
- * @return {number} The difference a - b
18
- * @function sub
19
- * @throws {OverflowError} on subtaction overflow
20
- * @memberOf module:for-fabric.shared
21
- */
22
- export declare function sub(a: number, b: number): number;
23
- /**
24
- * @summary Safe Integer Parse
25
- *
26
- * @param {string} string
27
- *
28
- * @function safeParseInt
29
- *
30
- * @throws {ValidationError} if parseInt returns NaN
31
- *
32
- * @memberOf module:for-fabric.shared
33
- */
34
- export declare function safeParseInt(string: string): number;
@@ -1,7 +0,0 @@
1
- import { Model, type ModelArg } from "@decaf-ts/decorator-validation";
2
- export declare class FabricBaseModel extends Model {
3
- createdAt: Date;
4
- updatedAt: Date;
5
- version: number;
6
- constructor(arg?: ModelArg<FabricBaseModel>);
7
- }
@@ -1,7 +0,0 @@
1
- import { type ModelArg } from "@decaf-ts/decorator-validation";
2
- import { FabricBaseModel } from "./FabricBaseModel";
3
- export declare abstract class FabricIdentifiedBaseModel extends FabricBaseModel {
4
- createdBy: string;
5
- updatedBy: string;
6
- protected constructor(arg?: ModelArg<FabricIdentifiedBaseModel>);
7
- }
@@ -1,42 +0,0 @@
1
- import { BaseModel } from "@decaf-ts/core";
2
- import { type ModelArg } from "@decaf-ts/decorator-validation";
3
- import { IdentityCredentials } from "./IdentityCredentials";
4
- import { IdentityType } from "../constants";
5
- /**
6
- * @description Identity model representing a Fabric wallet entry
7
- * @summary Encapsulates an identity stored in a Fabric wallet, including its MSP identifier, credential linkage, and type information. Built on BaseModel for integration with Decaf validation and persistence.
8
- * @param {ModelArg<Identity>} [arg] - Optional initialization object used to populate model fields
9
- * @class Identity
10
- * @example
11
- * // Create a new identity referencing existing credentials
12
- * const id = new Identity({ id: "user1", mspId: "Org1MSP", type: IdentityType.X509 });
13
- * @mermaid
14
- * sequenceDiagram
15
- * participant App
16
- * participant Model as Identity
17
- * App->>Model: new Identity({ id, mspId, type })
18
- * Model-->>App: instance
19
- */
20
- export declare class Identity extends BaseModel {
21
- /**
22
- * @description Unique identifier of the identity in the wallet
23
- * @summary Primary key used to reference this identity record
24
- */
25
- id: string;
26
- /**
27
- * @description Link to the identity credentials stored separately
28
- * @summary One-to-one relationship to the credentials entity; cascades on update and delete
29
- */
30
- credentials: IdentityCredentials;
31
- /**
32
- * @description Membership Service Provider identifier
33
- * @summary The MSP ID corresponding to the organization that issued this identity
34
- */
35
- mspId: string;
36
- /**
37
- * @description Type of identity
38
- * @summary Indicates the identity encoding/format; defaults to X.509
39
- */
40
- type: IdentityType;
41
- constructor(arg: ModelArg<Identity>);
42
- }
@@ -1,41 +0,0 @@
1
- import { BaseModel } from "@decaf-ts/core";
2
- import { type ModelArg } from "@decaf-ts/decorator-validation";
3
- /**
4
- * @description Identity credential model storing cryptographic materials
5
- * @summary Holds certificate chain and private key information for a Fabric identity, managed as a separate entity linked from Identity
6
- * @param {ModelArg<IdentityCredentials>} [arg] - Optional initialization object used to populate model fields
7
- * @class IdentityCredentials
8
- * @example
9
- * // Create credentials entry
10
- * const creds = new IdentityCredentials({ id: "creds1", certificate: "...", rootCertificate: "...", privateKey: "..." });
11
- * @mermaid
12
- * sequenceDiagram
13
- * participant App
14
- * participant Model as IdentityCredentials
15
- * App->>Model: new IdentityCredentials({ id, certificate, rootCertificate, privateKey })
16
- * Model-->>App: instance
17
- * @see model
18
- */
19
- export declare class IdentityCredentials extends BaseModel {
20
- /**
21
- * @description Unique identifier of the credentials record
22
- * @summary Primary key for referencing this credentials entry
23
- */
24
- id: string;
25
- /**
26
- * @description PEM-encoded X.509 certificate for the identity
27
- * @summary Leaf certificate associated with the identity
28
- */
29
- certificate: string;
30
- /**
31
- * @description PEM-encoded root or intermediate certificate
32
- * @summary Root of trust used to validate the leaf certificate
33
- */
34
- rootCertificate: string;
35
- /**
36
- * @description PEM-encoded private key material
37
- * @summary Private key corresponding to the identity certificate
38
- */
39
- privateKey: string;
40
- constructor(arg?: ModelArg<IdentityCredentials>);
41
- }
@@ -1,4 +0,0 @@
1
- export * from "./FabricBaseModel";
2
- export * from "./FabricIdentifiedBaseModel";
3
- export * from "./Identity";
4
- export * from "./IdentityCredentials";
@@ -1,22 +0,0 @@
1
- import { SegregatedModel } from "../types";
2
- import { Constructor } from "@decaf-ts/decoration";
3
- import "@decaf-ts/decorator-validation";
4
- import { CollectionResolver, MirrorMetadata } from "../decorators";
5
- declare module "@decaf-ts/decorator-validation" {
6
- interface Model {
7
- isPrivate<M extends Model>(this: M): boolean;
8
- isShared<M extends Model>(this: M): boolean;
9
- segregate<M extends Model>(this: M): SegregatedModel<M>;
10
- }
11
- namespace Model {
12
- function isPrivate<M extends Model>(model: Constructor<M>): boolean;
13
- function isShared<M extends Model>(model: Constructor<M>): boolean;
14
- function segregate<M extends Model>(model: M): SegregatedModel<M>;
15
- function ownerOf<M extends Model>(model: M): string;
16
- function mirroredAt<M extends Model>(model: M | Constructor<M>): MirrorMetadata | undefined;
17
- function collectionsFor<M extends Model>(model: M | Constructor<M>): {
18
- privateCols: (string | CollectionResolver)[];
19
- sharedCols: (string | CollectionResolver)[];
20
- };
21
- }
22
- }
@@ -1,2 +0,0 @@
1
- export * from "./Model";
2
- export * from "./overrides";
@@ -1 +0,0 @@
1
- export {};
@@ -1,125 +0,0 @@
1
- import { TLSOptions } from "fabric-ca-client";
2
- import { ClientIdentity } from "fabric-shim-api";
3
- import { Model } from "@decaf-ts/decorator-validation";
4
- import { AdapterFlags } from "@decaf-ts/core";
5
- import { Logger } from "@decaf-ts/logging";
6
- export type HSMOptions = {
7
- library: string;
8
- slot?: number;
9
- tokenLabel?: string;
10
- pin: string;
11
- keyLabel?: string;
12
- keyIdHex?: string;
13
- };
14
- export type MspDetails = {
15
- endpoint: string;
16
- tlsCert?: string | Buffer;
17
- alias?: string;
18
- };
19
- /**
20
- * @description Configuration for connecting to a Hyperledger Fabric peer
21
- * @summary Contains all the necessary parameters to establish a connection to a Fabric peer and interact with chaincode
22
- * @typedef {Object} PeerConfig
23
- * @property {string} cryptoPath - Path to the crypto materials
24
- * @property {string} keyCertOrDirectoryPath - Key file contents or Path to the directory containing private keys
25
- * @property {string} certCertOrDirectoryPath - Cert file contents or Path to the directory containing certificates
26
- * @property {string} tlsCert - Path to the TLS certificate
27
- * @property {string} peerEndpoint - Endpoint URL for the peer
28
- * @property {string} peerHostAlias - Host alias for the peer
29
- * @property {string} caEndpoint - Endpoint URL for the certificate authority
30
- * @property {string} caTlsCertificate - TLS certificate for the certificate authority
31
- * @property {string} caCert - Certificate for the certificate authority
32
- * @property {string} caKey - Key for the certificate authority
33
- * @property {string} chaincodeName - Name of the chaincode to interact with
34
- * @property {string} [contractName] - Optional name of the specific contract within the chaincode
35
- * @property {string} [ca] - Optional certificate authority name
36
- * @property {string} mspId - Membership Service Provider ID
37
- * @property {string} channel - Channel name
38
- * @memberOf module:for-fabric.shared
39
- */
40
- export type PeerConfig = {
41
- cryptoPath: string;
42
- keyCertOrDirectoryPath: string | Buffer;
43
- certCertOrDirectoryPath: string | Buffer;
44
- tlsCert: string | Buffer;
45
- allowGatewayOverride?: boolean;
46
- mspMap?: Record<string, MspDetails[]>;
47
- legacyMspCount?: number;
48
- peerEndpoint: string;
49
- peerHostAlias: string;
50
- caEndpoint?: string;
51
- caTlsCertificate?: string;
52
- caCert?: string;
53
- caKey?: string;
54
- chaincodeName: string;
55
- contractName?: string;
56
- sizeLimit?: number;
57
- ca?: string;
58
- mspId: string;
59
- channel: string;
60
- evaluateTimeout: number;
61
- endorseTimeout: number;
62
- submitTimeout: number;
63
- commitTimeout: number;
64
- hsm?: HSMOptions;
65
- /**
66
- * When true, only chaincode events whose owner segment in the event name matches
67
- * this adapter's mspId are forwarded to observers. Events with a different owner,
68
- * or whose event name carries no owner segment, pass through unfiltered.
69
- * Defaults to false (all events are forwarded regardless of owner).
70
- */
71
- mspEventOnly?: boolean;
72
- /**
73
- * When true (default), the FabricClientDispatch uses a Proxy-based mechanism
74
- * to emit events for ALL CRUD operations without a live gateway connection.
75
- * When false, the dispatch opens a real chaincode-event subscription via the
76
- * gateway and limits the local proxy fallback to fully-segregated models only.
77
- */
78
- syntheticEvents?: boolean;
79
- };
80
- /**
81
- * @description Configuration for connecting to a Hyperledger Fabric peer
82
- * @summary Contains all the necessary parameters to establish a connection to a Fabric peer and interact with chaincode
83
- * @typedef {Object} CAConfig
84
- * @property {string} url - Path to the crypto materials
85
- * @property {TLSOptions} tls - Path to the directory containing private keys
86
- * @property {string} caName - Path to the directory containing certificates
87
- * @property {string} tlsCertPath - Path to the TLS certificate
88
- * @property {string} caCert - Endpoint URL for the peer
89
- * @property {string} [caKey] - Host alias for the peer or directory containing the admin private key
90
- * @memberOf module:for-fabric.shared
91
- */
92
- export type CAConfig = {
93
- url: string;
94
- tls?: TLSOptions;
95
- caName: string;
96
- caCert: string;
97
- caKey?: string;
98
- hsm?: HSMOptions;
99
- };
100
- /**
101
- * @description User credentials for CA enrollment or access
102
- * @summary Optional username/password pair used when enrolling with a Fabric CA or authenticating in client utilities
103
- * @interface Credentials
104
- * @property {string} [userName] - Optional username
105
- * @property {string} [password] - Optional password
106
- * @memberOf module:for-fabric.shared
107
- */
108
- export interface Credentials {
109
- userName?: string;
110
- password?: string;
111
- }
112
- export type SegregatedModel<M extends Model> = {
113
- model: M;
114
- public?: Record<keyof M, any>;
115
- transient?: Record<keyof M, any>;
116
- privates?: Record<string, Record<keyof M, any>>;
117
- shared?: Record<string, Record<keyof M, any>>;
118
- };
119
- export type FabricFlags<LOG extends Logger = Logger> = AdapterFlags<LOG> & {
120
- segregated?: string;
121
- mirror?: boolean;
122
- mirrorCollection?: string;
123
- identity?: string | ClientIdentity;
124
- ownerOverride?: string;
125
- };
@@ -1,2 +0,0 @@
1
- export declare const VERSION = "0.10.0";
2
- export declare const PACKAGE_NAME = "@decaf-ts/for-fabric";