@brightchain/brightchain-api-lib 0.25.0 → 0.27.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 (130) hide show
  1. package/package.json +4 -3
  2. package/src/lib/appConstants.d.ts +1 -1
  3. package/src/lib/appConstants.js +1 -1
  4. package/src/lib/application.d.ts +3 -14
  5. package/src/lib/application.d.ts.map +1 -1
  6. package/src/lib/application.js +91 -34
  7. package/src/lib/application.js.map +1 -1
  8. package/src/lib/constants.d.ts.map +1 -1
  9. package/src/lib/constants.js +1 -1
  10. package/src/lib/constants.js.map +1 -1
  11. package/src/lib/databaseInit.d.ts +7 -11
  12. package/src/lib/databaseInit.d.ts.map +1 -1
  13. package/src/lib/databaseInit.js +41 -107
  14. package/src/lib/databaseInit.js.map +1 -1
  15. package/src/lib/datastore/block-document-store-factory.d.ts +3 -0
  16. package/src/lib/datastore/block-document-store-factory.d.ts.map +1 -1
  17. package/src/lib/datastore/block-document-store-factory.js +15 -18
  18. package/src/lib/datastore/block-document-store-factory.js.map +1 -1
  19. package/src/lib/datastore/block-document-store.d.ts +2 -191
  20. package/src/lib/datastore/block-document-store.d.ts.map +1 -1
  21. package/src/lib/datastore/block-document-store.js +4 -628
  22. package/src/lib/datastore/block-document-store.js.map +1 -1
  23. package/src/lib/datastore/document-store.d.ts +1 -62
  24. package/src/lib/datastore/document-store.d.ts.map +1 -1
  25. package/src/lib/datastore/memory-document-store.d.ts +1 -8
  26. package/src/lib/datastore/memory-document-store.d.ts.map +1 -1
  27. package/src/lib/datastore/memory-document-store.js +3 -214
  28. package/src/lib/datastore/memory-document-store.js.map +1 -1
  29. package/src/lib/environment.d.ts +4 -47
  30. package/src/lib/environment.d.ts.map +1 -1
  31. package/src/lib/environment.js +2 -136
  32. package/src/lib/environment.js.map +1 -1
  33. package/src/lib/interfaces/environment.d.ts +3 -25
  34. package/src/lib/interfaces/environment.d.ts.map +1 -1
  35. package/src/lib/interfaces/responses/emailGatewayResponses.d.ts +30 -0
  36. package/src/lib/interfaces/responses/emailGatewayResponses.d.ts.map +1 -0
  37. package/src/lib/interfaces/responses/emailGatewayResponses.js +3 -0
  38. package/src/lib/interfaces/responses/emailGatewayResponses.js.map +1 -0
  39. package/src/lib/interfaces/responses/index.d.ts +1 -0
  40. package/src/lib/interfaces/responses/index.d.ts.map +1 -1
  41. package/src/lib/middleware/index.d.ts +1 -1
  42. package/src/lib/middleware/index.d.ts.map +1 -1
  43. package/src/lib/middleware/index.js +3 -2
  44. package/src/lib/middleware/index.js.map +1 -1
  45. package/src/lib/middleware/validateBody.d.ts +1 -12
  46. package/src/lib/middleware/validateBody.d.ts.map +1 -1
  47. package/src/lib/middleware/validateBody.js +4 -32
  48. package/src/lib/middleware/validateBody.js.map +1 -1
  49. package/src/lib/middlewares.d.ts.map +1 -1
  50. package/src/lib/middlewares.js +7 -1
  51. package/src/lib/middlewares.js.map +1 -1
  52. package/src/lib/plugins/brightchain-database-plugin.d.ts +27 -79
  53. package/src/lib/plugins/brightchain-database-plugin.d.ts.map +1 -1
  54. package/src/lib/plugins/brightchain-database-plugin.js +32 -103
  55. package/src/lib/plugins/brightchain-database-plugin.js.map +1 -1
  56. package/src/lib/routers/app.d.ts.map +1 -1
  57. package/src/lib/routers/app.js +1 -0
  58. package/src/lib/routers/app.js.map +1 -1
  59. package/src/lib/services/emailGateway/antiSpamFilter.d.ts +229 -0
  60. package/src/lib/services/emailGateway/antiSpamFilter.d.ts.map +1 -0
  61. package/src/lib/services/emailGateway/antiSpamFilter.js +325 -0
  62. package/src/lib/services/emailGateway/antiSpamFilter.js.map +1 -0
  63. package/src/lib/services/emailGateway/bounceProcessor.d.ts +182 -0
  64. package/src/lib/services/emailGateway/bounceProcessor.d.ts.map +1 -0
  65. package/src/lib/services/emailGateway/bounceProcessor.js +391 -0
  66. package/src/lib/services/emailGateway/bounceProcessor.js.map +1 -0
  67. package/src/lib/services/emailGateway/emailAuthVerifier.d.ts +99 -0
  68. package/src/lib/services/emailGateway/emailAuthVerifier.d.ts.map +1 -0
  69. package/src/lib/services/emailGateway/emailAuthVerifier.js +202 -0
  70. package/src/lib/services/emailGateway/emailAuthVerifier.js.map +1 -0
  71. package/src/lib/services/emailGateway/emailGatewayConfig.d.ts +74 -0
  72. package/src/lib/services/emailGateway/emailGatewayConfig.d.ts.map +1 -0
  73. package/src/lib/services/emailGateway/emailGatewayConfig.js +107 -0
  74. package/src/lib/services/emailGateway/emailGatewayConfig.js.map +1 -0
  75. package/src/lib/services/emailGateway/emailGatewayService.d.ts +209 -0
  76. package/src/lib/services/emailGateway/emailGatewayService.d.ts.map +1 -0
  77. package/src/lib/services/emailGateway/emailGatewayService.js +254 -0
  78. package/src/lib/services/emailGateway/emailGatewayService.js.map +1 -0
  79. package/src/lib/services/emailGateway/gatewayObservability.d.ts +123 -0
  80. package/src/lib/services/emailGateway/gatewayObservability.d.ts.map +1 -0
  81. package/src/lib/services/emailGateway/gatewayObservability.js +186 -0
  82. package/src/lib/services/emailGateway/gatewayObservability.js.map +1 -0
  83. package/src/lib/services/emailGateway/inboundProcessor.d.ts +113 -0
  84. package/src/lib/services/emailGateway/inboundProcessor.d.ts.map +1 -0
  85. package/src/lib/services/emailGateway/inboundProcessor.js +298 -0
  86. package/src/lib/services/emailGateway/inboundProcessor.js.map +1 -0
  87. package/src/lib/services/emailGateway/index.d.ts +23 -0
  88. package/src/lib/services/emailGateway/index.d.ts.map +1 -0
  89. package/src/lib/services/emailGateway/index.js +26 -0
  90. package/src/lib/services/emailGateway/index.js.map +1 -0
  91. package/src/lib/services/emailGateway/outboundDeliveryWorker.d.ts +122 -0
  92. package/src/lib/services/emailGateway/outboundDeliveryWorker.d.ts.map +1 -0
  93. package/src/lib/services/emailGateway/outboundDeliveryWorker.js +110 -0
  94. package/src/lib/services/emailGateway/outboundDeliveryWorker.js.map +1 -0
  95. package/src/lib/services/emailGateway/outboundQueue.d.ts +135 -0
  96. package/src/lib/services/emailGateway/outboundQueue.d.ts.map +1 -0
  97. package/src/lib/services/emailGateway/outboundQueue.js +227 -0
  98. package/src/lib/services/emailGateway/outboundQueue.js.map +1 -0
  99. package/src/lib/services/emailGateway/outboundQueueStore.d.ts +110 -0
  100. package/src/lib/services/emailGateway/outboundQueueStore.d.ts.map +1 -0
  101. package/src/lib/services/emailGateway/outboundQueueStore.js +131 -0
  102. package/src/lib/services/emailGateway/outboundQueueStore.js.map +1 -0
  103. package/src/lib/services/emailGateway/recipientLookupService.d.ts +146 -0
  104. package/src/lib/services/emailGateway/recipientLookupService.d.ts.map +1 -0
  105. package/src/lib/services/emailGateway/recipientLookupService.js +307 -0
  106. package/src/lib/services/emailGateway/recipientLookupService.js.map +1 -0
  107. package/src/lib/services/emailGateway/retryBackoff.d.ts +79 -0
  108. package/src/lib/services/emailGateway/retryBackoff.d.ts.map +1 -0
  109. package/src/lib/services/emailGateway/retryBackoff.js +77 -0
  110. package/src/lib/services/emailGateway/retryBackoff.js.map +1 -0
  111. package/src/lib/services/index.d.ts +1 -0
  112. package/src/lib/services/index.d.ts.map +1 -1
  113. package/src/lib/services/index.js +1 -0
  114. package/src/lib/services/index.js.map +1 -1
  115. package/src/lib/services/quorumDatabaseAdapter.d.ts +7 -1
  116. package/src/lib/services/quorumDatabaseAdapter.d.ts.map +1 -1
  117. package/src/lib/services/quorumDatabaseAdapter.js +83 -0
  118. package/src/lib/services/quorumDatabaseAdapter.js.map +1 -1
  119. package/src/lib/services/sessionAdapter.d.ts +2 -61
  120. package/src/lib/services/sessionAdapter.d.ts.map +1 -1
  121. package/src/lib/services/sessionAdapter.js +2 -102
  122. package/src/lib/services/sessionAdapter.js.map +1 -1
  123. package/src/lib/shared-types.d.ts +7 -15
  124. package/src/lib/shared-types.d.ts.map +1 -1
  125. package/src/lib/types/backend-id.d.ts +1 -2
  126. package/src/lib/types/backend-id.d.ts.map +1 -1
  127. package/src/lib/validation/userValidation.d.ts +2 -43
  128. package/src/lib/validation/userValidation.d.ts.map +1 -1
  129. package/src/lib/validation/userValidation.js +6 -144
  130. package/src/lib/validation/userValidation.js.map +1 -1
@@ -2,131 +2,65 @@
2
2
  /**
3
3
  * @fileoverview BrightChain database initialization function.
4
4
  *
5
- * Replaces the no-op DatabaseInitFunction with a real implementation that
6
- * creates persistent (or ephemeral) stores based on environment configuration.
5
+ * Wraps the generic brightchainDatabaseInit from @brightchain/node-express-suite,
6
+ * passing domain-specific model registrations (energy account hydration schema)
7
+ * as a callback. Returns the full IBrightChainInitData including MemberStore
8
+ * and EnergyAccountStore.
7
9
  *
8
10
  * @module databaseInit
9
11
  */
10
12
  Object.defineProperty(exports, "__esModule", { value: true });
11
13
  exports.brightchainDatabaseInit = brightchainDatabaseInit;
12
14
  const brightchain_lib_1 = require("@brightchain/brightchain-lib");
13
- const db_1 = require("@brightchain/db");
14
- const fs_1 = require("fs");
15
- const promises_1 = require("fs/promises");
16
- const blockStoreFactory_1 = require("./factories/blockStoreFactory");
15
+ const node_express_suite_1 = require("@brightchain/node-express-suite");
17
16
  const energyAccountHydration_1 = require("./hydration/energyAccountHydration");
18
- /**
19
- * Validate that the given directory path exists and is accessible.
20
- * If the directory does not exist, attempt to create it recursively.
21
- * Throws if the path is inaccessible after creation attempt.
22
- */
23
- async function validateDataDir(dirPath) {
24
- try {
25
- await (0, promises_1.access)(dirPath, fs_1.constants.R_OK | fs_1.constants.W_OK);
26
- }
27
- catch {
28
- // Directory doesn't exist or isn't accessible — try to create it
29
- try {
30
- await (0, promises_1.mkdir)(dirPath, { recursive: true });
31
- }
32
- catch (mkdirError) {
33
- const message = mkdirError instanceof Error ? mkdirError.message : String(mkdirError);
34
- throw new Error(`Cannot create or access data directory "${dirPath}": ${message}`);
35
- }
36
- }
37
- }
38
17
  /**
39
18
  * Initialize the BrightChain database stack.
40
19
  *
41
- * Reads `blockStorePath` and `blockStoreBlockSizes` from the Environment:
42
- * - If `blockStorePath` is set: validates the path, creates a DiskBlockStore,
43
- * and creates a BrightDb with a PersistentHeadRegistry via `dataDir`.
44
- * - If `blockStorePath` is not set: creates a MemoryBlockStore, logs a warning,
45
- * and creates a BrightDb with an InMemoryHeadRegistry.
46
- *
47
- * Registers an `energy_accounts` Model on BrightDB with the energy account
48
- * hydration schema, then passes the Model (as ITypedCollection) directly to
49
- * EnergyAccountStore — no adapter needed.
20
+ * Delegates to the Suite's generic brightchainDatabaseInit for block store
21
+ * and BrightDb creation, then adds domain-specific stores (MemberStore,
22
+ * EnergyAccountStore) on top via the modelRegistrations callback.
50
23
  *
51
24
  * @returns An IInitResult containing the initialized stores on success,
52
25
  * or a failure result with a descriptive error message.
53
26
  */
54
27
  async function brightchainDatabaseInit(environment) {
55
- try {
56
- const blockStorePath = environment.blockStorePath;
57
- const supportedBlockSizes = environment.blockStoreBlockSizes;
58
- const devPoolName = environment.devDatabasePoolName;
59
- let blockStore;
60
- let dataDir;
61
- if (devPoolName) {
62
- // DEV_DATABASE is set use ephemeral in-memory store for development
63
- console.info(`[BrightChain] DEV_DATABASE="${devPoolName}" using ephemeral MemoryBlockStore. Data will not persist across restarts.`);
64
- blockStore = blockStoreFactory_1.BlockStoreFactory.createMemoryStore({ supportedBlockSizes });
65
- }
66
- else if (environment.blockStoreType === brightchain_lib_1.BlockStoreType.AzureBlob) {
67
- // Factory must have been registered by the consuming app importing
68
- // '@brightchain/azure-store' at its entry point.
69
- blockStore = blockStoreFactory_1.BlockStoreFactory.createAzureStore(environment.azureConfig);
70
- }
71
- else if (environment.blockStoreType === brightchain_lib_1.BlockStoreType.S3) {
72
- // Factory must have been registered by the consuming app importing
73
- // '@brightchain/s3-store' at its entry point.
74
- blockStore = blockStoreFactory_1.BlockStoreFactory.createS3Store(environment.s3Config);
75
- }
76
- else if (blockStorePath) {
77
- // Validate path accessibility, create if needed
78
- await validateDataDir(blockStorePath);
79
- blockStore = blockStoreFactory_1.BlockStoreFactory.createDiskStore({
80
- storePath: blockStorePath,
81
- supportedBlockSizes,
82
- });
83
- dataDir = blockStorePath;
84
- }
85
- else {
86
- throw new Error('Neither DEV_DATABASE nor BRIGHTCHAIN_BLOCKSTORE_PATH is set. ' +
87
- 'Set DEV_DATABASE to a pool name for in-memory development mode, ' +
88
- 'or set BRIGHTCHAIN_BLOCKSTORE_PATH for persistent disk storage.');
89
- }
90
- // Create BrightDb — uses PersistentHeadRegistry when dataDir is set,
91
- // InMemoryHeadRegistry otherwise.
92
- // IMPORTANT: name must match what BrightChainMemberInitService uses
93
- // (config.memberPoolName) so the head registry keys are consistent across
94
- // the plugin's db and the seeding service's db.
95
- const db = new db_1.BrightDb(blockStore, dataDir ? { name: environment.memberPoolName, dataDir } : undefined);
96
- // Mark the db as connected (no-op for block-store-backed DB, but sets
97
- // the isConnected() flag that consumers check).
98
- await db.connect();
99
- // Register the energy_accounts Model with hydration schema.
100
- // The Model satisfies ITypedCollection<IEnergyAccountDto, EnergyAccount>
101
- // so EnergyAccountStore can use it directly — no adapter needed.
102
- const energyAccountModel = db.model('energy_accounts', { hydration: (0, energyAccountHydration_1.createEnergyAccountHydrationSchema)() });
103
- // Initialize stores
104
- const memberStore = new brightchain_lib_1.MemberStore(blockStore);
105
- const energyStore = new brightchain_lib_1.EnergyAccountStore(energyAccountModel);
106
- // Load persisted energy accounts (no-op if no typed collection)
107
- try {
108
- await energyStore.loadFromStore();
109
- }
110
- catch (loadError) {
111
- const message = loadError instanceof Error ? loadError.message : String(loadError);
112
- console.warn(`[BrightChain] Failed to load energy accounts from store, continuing with empty store: ${message}`);
113
- }
114
- return {
115
- success: true,
116
- backend: {
117
- blockStore,
118
- db,
119
- memberStore,
120
- energyStore,
121
- },
122
- };
123
- }
124
- catch (error) {
125
- const message = error instanceof Error ? error.message : String(error);
28
+ // Domain-specific references captured in the callback
29
+ let memberStore;
30
+ let energyStore;
31
+ const genericResult = await (0, node_express_suite_1.brightchainDatabaseInit)(environment, {
32
+ modelRegistrations: async (db, blockStore) => {
33
+ // Register the energy_accounts Model with hydration schema.
34
+ // The Model satisfies ITypedCollection<IEnergyAccountDto, EnergyAccount>
35
+ // so EnergyAccountStore can use it directly no adapter needed.
36
+ const energyAccountModel = db.model('energy_accounts', { hydration: (0, energyAccountHydration_1.createEnergyAccountHydrationSchema)() });
37
+ // Initialize stores
38
+ memberStore = new brightchain_lib_1.MemberStore(blockStore);
39
+ energyStore = new brightchain_lib_1.EnergyAccountStore(energyAccountModel);
40
+ // Load persisted energy accounts (no-op if no typed collection)
41
+ try {
42
+ await energyStore.loadFromStore();
43
+ }
44
+ catch (loadError) {
45
+ const message = loadError instanceof Error ? loadError.message : String(loadError);
46
+ console.warn(`[BrightChain] Failed to load energy accounts from store, continuing with empty store: ${message}`);
47
+ }
48
+ },
49
+ });
50
+ if (!genericResult.success || !genericResult.backend) {
126
51
  return {
127
52
  success: false,
128
- error: `Database initialization failed: ${message}`,
53
+ error: genericResult.error,
129
54
  };
130
55
  }
56
+ return {
57
+ success: true,
58
+ backend: {
59
+ blockStore: genericResult.backend.blockStore,
60
+ db: genericResult.backend.db,
61
+ memberStore: memberStore,
62
+ energyStore: energyStore,
63
+ },
64
+ };
131
65
  }
132
66
  //# sourceMappingURL=databaseInit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"databaseInit.js","sourceRoot":"","sources":["../../../../brightchain-api-lib/src/lib/databaseInit.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AA6DH,0DAgGC;AArJD,kEAMsC;AACtC,wCAA2C;AAE3C,2BAA8C;AAC9C,0CAA4C;AAE5C,qEAAkE;AAClE,+EAAwF;AAExF;;;;GAIG;AACH,KAAK,UAAU,eAAe,CAAC,OAAe;IAC5C,IAAI,CAAC;QACH,MAAM,IAAA,iBAAM,EAAC,OAAO,EAAE,cAAW,CAAC,IAAI,GAAG,cAAW,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,iEAAiE;QACjE,IAAI,CAAC;YACH,MAAM,IAAA,gBAAK,EAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5C,CAA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UAAU;gBACV,EAAE;gBACF,WAAW;gBACX,WAAW;aACZ;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,mCAAmC,OAAO,EAAE;SACpD,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"databaseInit.js","sourceRoot":"","sources":["../../../../brightchain-api-lib/src/lib/databaseInit.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AA6BH,0DAkDC;AAvED,kEAIsC;AAEtC,wEAAiG;AAGjG,+EAAwF;AAExF;;;;;;;;;GASG;AACI,KAAK,UAAU,uBAAuB,CAC3C,WAA6B;IAE7B,sDAAsD;IACtD,IAAI,WAAoC,CAAC;IACzC,IAAI,WAA2C,CAAC;IAEhD,MAAM,aAAa,GAAG,MAAM,IAAA,4CAAmB,EAAC,WAAW,EAAE;QAC3D,kBAAkB,EAAE,KAAK,EAAE,EAAY,EAAE,UAAuB,EAAE,EAAE;YAClE,4DAA4D;YAC5D,yEAAyE;YACzE,iEAAiE;YACjE,MAAM,kBAAkB,GAAG,EAAE,CAAC,KAAK,CACjC,iBAAiB,EACjB,EAAE,SAAS,EAAE,IAAA,2DAAkC,GAAE,EAAE,CACpD,CAAC;YAEF,oBAAoB;YACpB,WAAW,GAAG,IAAI,6BAAW,CAAC,UAAU,CAAC,CAAC;YAC1C,WAAW,GAAG,IAAI,oCAAkB,CAAC,kBAAkB,CAAC,CAAC;YAEzD,gEAAgE;YAChE,IAAI,CAAC;gBACH,MAAM,WAAW,CAAC,aAAa,EAAE,CAAC;YACpC,CAAC;YAAC,OAAO,SAAkB,EAAE,CAAC;gBAC5B,MAAM,OAAO,GACX,SAAS,YAAY,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBACrE,OAAO,CAAC,IAAI,CACV,yFAAyF,OAAO,EAAE,CACnG,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IAEH,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;QACrD,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,aAAa,CAAC,KAAK;SAC3B,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE;YACP,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,UAAU;YAC5C,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE;YAC5B,WAAW,EAAE,WAAY;YACzB,WAAW,EAAE,WAAY;SAC1B;KACF,CAAC;AACJ,CAAC"}
@@ -14,6 +14,9 @@ export type BlockDocumentStoreOptions = {
14
14
  /**
15
15
  * Create a BlockDocumentStore backed by either a provided BlockStore, a disk store, or an in-memory store.
16
16
  * Optionally supports encryption via QuorumService.
17
+ *
18
+ * This api-lib version automatically injects DiskBlockAsyncStore for disk-backed stores,
19
+ * maintaining backward compatibility with existing consumers.
17
20
  */
18
21
  export declare function createBlockDocumentStore(options: BlockDocumentStoreOptions): DocumentStore;
19
22
  //# sourceMappingURL=block-document-store-factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-document-store-factory.d.ts","sourceRoot":"","sources":["../../../../../brightchain-api-lib/src/lib/datastore/block-document-store-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,cAAc,EAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGxD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,yBAAyB,GACjC,aAAa,CAuBf"}
1
+ {"version":3,"file":"block-document-store-factory.d.ts","sourceRoot":"","sources":["../../../../../brightchain-api-lib/src/lib/datastore/block-document-store-factory.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,yBAAyB,GACjC,aAAa,CAWf"}
@@ -1,29 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createBlockDocumentStore = createBlockDocumentStore;
4
- const brightchain_lib_1 = require("@brightchain/brightchain-lib");
4
+ // Re-export the generic factory and options type from @brightchain/node-express-suite
5
+ // with backward-compatible DiskBlockAsyncStore integration
6
+ const node_express_suite_1 = require("@brightchain/node-express-suite");
5
7
  const diskBlockAsyncStore_1 = require("../stores/diskBlockAsyncStore");
6
- const block_document_store_1 = require("./block-document-store");
7
8
  /**
8
9
  * Create a BlockDocumentStore backed by either a provided BlockStore, a disk store, or an in-memory store.
9
10
  * Optionally supports encryption via QuorumService.
11
+ *
12
+ * This api-lib version automatically injects DiskBlockAsyncStore for disk-backed stores,
13
+ * maintaining backward compatibility with existing consumers.
10
14
  */
11
15
  function createBlockDocumentStore(options) {
12
- const blockSize = options.blockSize ?? brightchain_lib_1.BlockSize.Small;
13
- if (options.blockStore) {
14
- return new block_document_store_1.BlockDocumentStore(options.blockStore, options.quorumService);
15
- }
16
- if (options.useMemory) {
17
- const memoryStore = new brightchain_lib_1.MemoryBlockStore(blockSize);
18
- return new block_document_store_1.BlockDocumentStore(memoryStore, options.quorumService);
19
- }
20
- if (options.storePath) {
21
- const diskStore = new diskBlockAsyncStore_1.DiskBlockAsyncStore({
22
- storePath: options.storePath,
23
- blockSize,
24
- });
25
- return new block_document_store_1.BlockDocumentStore(diskStore, options.quorumService);
26
- }
27
- throw new Error('createBlockDocumentStore requires a blockStore, storePath, or useMemory=true');
16
+ // Convert to suite options, injecting DiskBlockAsyncStore as the disk factory
17
+ const suiteOptions = {
18
+ ...options,
19
+ diskBlockStoreFactory: (opts) => new diskBlockAsyncStore_1.DiskBlockAsyncStore({
20
+ storePath: opts.storePath,
21
+ blockSize: opts.blockSize,
22
+ }),
23
+ };
24
+ return (0, node_express_suite_1.createBlockDocumentStore)(suiteOptions);
28
25
  }
29
26
  //# sourceMappingURL=block-document-store-factory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-document-store-factory.js","sourceRoot":"","sources":["../../../../../brightchain-api-lib/src/lib/datastore/block-document-store-factory.ts"],"names":[],"mappings":";;AA0BA,4DAyBC;AAnDD,kEAKsC;AAEtC,uEAAoE;AACpE,iEAA4D;AAc5D;;;GAGG;AACH,SAAgB,wBAAwB,CACtC,OAAkC;IAElC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,2BAAS,CAAC,KAAK,CAAC;IAEvD,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QACvB,OAAO,IAAI,yCAAkB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,WAAW,GAAG,IAAI,kCAAgB,CAAC,SAAS,CAAC,CAAC;QACpD,OAAO,IAAI,yCAAkB,CAAC,WAAW,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,SAAS,GAAG,IAAI,yCAAmB,CAAC;YACxC,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,SAAS;SACV,CAAC,CAAC;QACH,OAAO,IAAI,yCAAkB,CAAC,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"block-document-store-factory.js","sourceRoot":"","sources":["../../../../../brightchain-api-lib/src/lib/datastore/block-document-store-factory.ts"],"names":[],"mappings":";;AAiCA,4DAaC;AA9CD,sFAAsF;AACtF,2DAA2D;AAC3D,wEAGyC;AAOzC,uEAAoE;AAcpE;;;;;;GAMG;AACH,SAAgB,wBAAwB,CACtC,OAAkC;IAElC,8EAA8E;IAC9E,MAAM,YAAY,GAAmC;QACnD,GAAG,OAAO;QACV,qBAAqB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC9B,IAAI,yCAAmB,CAAC;YACtB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;KACL,CAAC;IACF,OAAO,IAAA,6CAA6B,EAAC,YAAY,CAAC,CAAC;AACrD,CAAC"}
@@ -1,192 +1,3 @@
1
- import { IBlockStore, IQuorumService } from '@brightchain/brightchain-lib';
2
- import { HexString, IIdProvider, Member, PlatformID } from '@digitaldefiance/ecies-lib';
3
- import { DocumentCollection, DocumentId, DocumentRecord, DocumentStore, QueryBuilder } from './document-store';
4
- /**
5
- * Options for creating a document with optional encryption
6
- */
7
- export interface CreateDocumentOptions<TID extends PlatformID = Uint8Array> {
8
- /**
9
- * Whether to encrypt the document using quorum sealing
10
- */
11
- encrypt?: boolean;
12
- /**
13
- * The member performing the sealing operation (required if encrypt is true)
14
- */
15
- agent?: Member<TID>;
16
- /**
17
- * IDs of members who will receive shares (required if encrypt is true)
18
- */
19
- memberIds?: TID[];
20
- /**
21
- * Number of shares required to unseal (defaults to all members)
22
- */
23
- sharesRequired?: number;
24
- }
25
- /**
26
- * Options for retrieving an encrypted document
27
- */
28
- export interface RetrieveDocumentOptions<TID extends PlatformID = Uint8Array> {
29
- /**
30
- * Members with loaded private keys for decryption (required for encrypted documents)
31
- */
32
- membersWithPrivateKey?: Member<TID>[];
33
- }
34
- /**
35
- * Metadata stored alongside encrypted documents
36
- */
37
- interface EncryptedDocumentMetadata {
38
- isEncrypted: boolean;
39
- sealedDocumentId?: HexString;
40
- memberIds?: HexString[];
41
- sharesRequired?: number;
42
- createdAt?: string;
43
- }
44
- /**
45
- * Simple in-memory registry for collection head pointers.
46
- * This maps collection names to their latest index block IDs.
47
- *
48
- * In a production system, this would be persisted to a separate
49
- * key-value store or database. For now, we use a static map
50
- * that's shared across all BlockDocumentStore instances.
51
- */
52
- export declare class CollectionHeadRegistry {
53
- private static instance;
54
- private readonly heads;
55
- private constructor();
56
- static getInstance(): CollectionHeadRegistry;
57
- getHead(collectionKey: string): string | undefined;
58
- setHead(collectionKey: string, indexBlockId: string): void;
59
- /**
60
- * Generate a unique key for a collection based on store identity and collection name
61
- */
62
- static makeKey(storeId: string, collectionName: string): string;
63
- /**
64
- * Clear all heads (useful for testing)
65
- */
66
- clear(): void;
67
- }
68
- declare class BlockCollection<T extends DocumentRecord, TID extends PlatformID = PlatformID> implements DocumentCollection<T> {
69
- private readonly store;
70
- private readonly collectionName;
71
- private readonly quorumService?;
72
- private readonly storeId;
73
- private readonly generateId;
74
- private readonly index;
75
- private readonly registryKey;
76
- private indexLoaded;
77
- private indexLoading;
78
- constructor(store: IBlockStore, collectionName: string, quorumService?: IQuorumService<TID> | undefined, storeId?: string, generateId?: () => string);
79
- private ensureIndexLoaded;
80
- private persistIndex;
81
- private resolveBlockId;
82
- private writeDoc;
83
- private readDoc;
84
- private toSingleQuery;
85
- private toManyQuery;
86
- find(filter?: Partial<T>): QueryBuilder<T[]>;
87
- findOne(filter?: Partial<T>): QueryBuilder<T>;
88
- findById(id: DocumentId): QueryBuilder<T>;
89
- /**
90
- * Retrieve a document by ID, decrypting if necessary
91
- * @param id - The document ID
92
- * @param options - Options for retrieving encrypted documents
93
- * @returns The document (decrypted if it was encrypted)
94
- */
95
- findByIdDecrypted(id: DocumentId, options?: RetrieveDocumentOptions<TID>): Promise<T | null>;
96
- /**
97
- * Check if a document is encrypted
98
- * @param id - The document ID
99
- * @returns True if the document is encrypted
100
- */
101
- isEncrypted(id: DocumentId): Promise<boolean>;
102
- /**
103
- * Get encryption metadata for a document
104
- * @param id - The document ID
105
- * @returns The encryption metadata, or null if not encrypted
106
- */
107
- getEncryptionMetadata(id: DocumentId): Promise<EncryptedDocumentMetadata | null>;
108
- /**
109
- * Check if a member has access to a document
110
- * @param id - The document ID
111
- * @param memberId - The member ID to check access for
112
- * @returns True if the member has access (either unencrypted or member is in the encryption list)
113
- */
114
- hasAccess(id: DocumentId, memberId: HexString): Promise<boolean>;
115
- /**
116
- * Find all documents accessible by a specific member
117
- * @param memberId - The member ID to filter by
118
- * @param filter - Optional additional filter criteria
119
- * @returns Array of documents the member has access to
120
- */
121
- findAccessibleBy(memberId: HexString, filter?: Partial<T>): Promise<T[]>;
122
- /**
123
- * Find one document accessible by a specific member
124
- * @param memberId - The member ID to filter by
125
- * @param filter - Optional additional filter criteria
126
- * @returns The first document the member has access to, or null
127
- */
128
- findOneAccessibleBy(memberId: HexString, filter?: Partial<T>): Promise<T | null>;
129
- /**
130
- * Count documents accessible by a specific member
131
- * @param memberId - The member ID to filter by
132
- * @param filter - Optional additional filter criteria
133
- * @returns The count of documents the member has access to
134
- */
135
- countAccessibleBy(memberId: HexString, filter?: Partial<T>): Promise<number>;
136
- findOneAndUpdate(filter: Partial<T>, update: Partial<T>): QueryBuilder<T>;
137
- findOneAndDelete(filter: Partial<T>): QueryBuilder<T>;
138
- findByIdAndUpdate(id: DocumentId, update: Partial<T>): QueryBuilder<T>;
139
- findByIdAndDelete(id: DocumentId): QueryBuilder<T>;
140
- create(doc: T): Promise<T>;
141
- create(doc: T, options?: CreateDocumentOptions<TID>): Promise<T>;
142
- insertMany(docs: T[]): Promise<T[]>;
143
- updateOne(filter: Partial<T>, update: Partial<T>): Promise<{
144
- modifiedCount: number;
145
- matchedCount: number;
146
- }>;
147
- updateMany(filter: Partial<T>, update: Partial<T>): Promise<{
148
- modifiedCount: number;
149
- matchedCount: number;
150
- }>;
151
- replaceOne(filter: Partial<T>, doc: T): Promise<{
152
- modifiedCount: number;
153
- matchedCount: number;
154
- }>;
155
- deleteOne(filter: Partial<T>): Promise<{
156
- deletedCount: number;
157
- }>;
158
- deleteMany(filter: Partial<T>): Promise<{
159
- deletedCount: number;
160
- }>;
161
- countDocuments(filter?: Partial<T>): Promise<number>;
162
- estimatedDocumentCount(): Promise<number>;
163
- aggregate<U = unknown>(_pipeline: unknown[]): QueryBuilder<U[]>;
164
- distinct(field: keyof T): QueryBuilder<T[keyof T][]>;
165
- exists(filter: Partial<T>): Promise<{
166
- _id: DocumentId;
167
- } | null>;
168
- watch(): void;
169
- startSession(): unknown;
170
- }
171
- export declare class BlockDocumentStore<TID extends PlatformID = PlatformID> implements DocumentStore {
172
- private readonly blockStore;
173
- private readonly quorumService?;
174
- private readonly collections;
175
- private readonly storeId;
176
- private readonly generateId;
177
- constructor(blockStore: IBlockStore, quorumService?: IQuorumService<TID> | undefined, idProvider?: IIdProvider<TID>);
178
- /**
179
- * Attempt to resolve the ID provider from the global ServiceProvider.
180
- * Returns undefined if the ServiceProvider is not yet initialized.
181
- */
182
- private resolveIdProvider;
183
- collection<T extends DocumentRecord>(name: string): DocumentCollection<T>;
184
- /**
185
- * Get a collection with encryption support
186
- * @param name - The collection name
187
- * @returns The collection with encryption methods available
188
- */
189
- encryptedCollection<T extends DocumentRecord>(name: string): BlockCollection<T, TID>;
190
- }
191
- export {};
1
+ export type { CreateDocumentOptions, RetrieveDocumentOptions, } from '@brightchain/node-express-suite';
2
+ export { BlockDocumentStore, CollectionHeadRegistry, } from '@brightchain/node-express-suite';
192
3
  //# sourceMappingURL=block-document-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-document-store.d.ts","sourceRoot":"","sources":["../../../../../brightchain-api-lib/src/lib/datastore/block-document-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,cAAc,EAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,SAAS,EACT,WAAW,EACX,MAAM,EACN,UAAU,EACX,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,aAAa,EACb,YAAY,EAEb,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,qBAAqB,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IACxE;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAC1E;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;CACvC;AAED;;GAEG;AACH,UAAU,yBAAy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G,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC;IAI/D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAW9C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;aAGsB,UAAU;;IAG/D,KAAK,IAAI,IAAI;IAIb,YAAY,IAAI,OAAO;CAGxB;AAED,qBAAa,kBAAkB,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU,CACjE,YAAW,aAAa;IAUtB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;IATjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAGxB;IACJ,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAe;gBAGvB,UAAU,EAAE,WAAW,EACvB,aAAa,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,YAAA,EACpD,UAAU,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC;IAc/B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAQzB,UAAU,CAAC,CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC;IAgBzE;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,SAAS,cAAc,EAC1C,IAAI,EAAE,MAAM,GACX,eAAe,CAAC,CAAC,EAAE,GAAG,CAAC;CAkB3B"}
1
+ {"version":3,"file":"block-document-store.d.ts","sourceRoot":"","sources":["../../../../../brightchain-api-lib/src/lib/datastore/block-document-store.ts"],"names":[],"mappings":"AACA,YAAY,EACV,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,iCAAiC,CAAC"}