nx-mongo 3.3.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.
@@ -0,0 +1,366 @@
1
+ import { Db, Filter, UpdateFilter, OptionalUnlessRequiredId, Document, WithId, ClientSession, Sort, IndexSpecification, CreateIndexesOptions } from 'mongodb';
2
+ export interface PaginationOptions {
3
+ page?: number;
4
+ limit?: number;
5
+ sort?: Sort;
6
+ }
7
+ export interface PaginatedResult<T> {
8
+ data: WithId<T>[];
9
+ total: number;
10
+ page: number;
11
+ limit: number;
12
+ totalPages: number;
13
+ hasNext: boolean;
14
+ hasPrev: boolean;
15
+ }
16
+ export interface RetryOptions {
17
+ maxRetries?: number;
18
+ retryDelay?: number;
19
+ exponentialBackoff?: boolean;
20
+ }
21
+ export interface InputConfig {
22
+ ref: string;
23
+ collection: string;
24
+ query?: Filter<any>;
25
+ }
26
+ export interface OutputConfig {
27
+ ref: string;
28
+ collection: string;
29
+ keys?: string[];
30
+ mode?: 'append' | 'replace';
31
+ }
32
+ export interface HelperConfig {
33
+ inputs: InputConfig[];
34
+ outputs: OutputConfig[];
35
+ output?: {
36
+ mode?: 'append' | 'replace';
37
+ };
38
+ progress?: {
39
+ collection?: string;
40
+ uniqueIndexKeys?: string[];
41
+ provider?: string;
42
+ };
43
+ }
44
+ export interface WriteByRefResult {
45
+ inserted: number;
46
+ updated: number;
47
+ errors: Array<{
48
+ index: number;
49
+ error: Error;
50
+ doc?: any;
51
+ }>;
52
+ indexCreated: boolean;
53
+ }
54
+ export interface EnsureSignatureIndexResult {
55
+ created: boolean;
56
+ indexName: string;
57
+ }
58
+ export interface StageIdentity {
59
+ key: string;
60
+ process?: string;
61
+ provider?: string;
62
+ name?: string;
63
+ }
64
+ export interface StageMetadata {
65
+ itemCount?: number;
66
+ errorCount?: number;
67
+ durationMs?: number;
68
+ [key: string]: any;
69
+ }
70
+ export interface StageRecord extends StageIdentity {
71
+ completed: boolean;
72
+ startedAt?: Date;
73
+ completedAt?: Date;
74
+ metadata?: StageMetadata;
75
+ }
76
+ export type ProgressSessionOptions = {
77
+ session?: ClientSession;
78
+ };
79
+ export interface ProgressAPI {
80
+ isCompleted(key: string, options?: ProgressSessionOptions & {
81
+ process?: string;
82
+ provider?: string;
83
+ }): Promise<boolean>;
84
+ start(identity: StageIdentity, options?: ProgressSessionOptions): Promise<void>;
85
+ complete(identity: StageIdentity & {
86
+ metadata?: StageMetadata;
87
+ }, options?: ProgressSessionOptions): Promise<void>;
88
+ getCompleted(options?: ProgressSessionOptions & {
89
+ process?: string;
90
+ provider?: string;
91
+ }): Promise<Array<Pick<StageRecord, 'key' | 'name' | 'completedAt'>>>;
92
+ getProgress(options?: ProgressSessionOptions & {
93
+ process?: string;
94
+ provider?: string;
95
+ }): Promise<StageRecord[]>;
96
+ reset(key: string, options?: ProgressSessionOptions & {
97
+ process?: string;
98
+ provider?: string;
99
+ }): Promise<void>;
100
+ }
101
+ export interface WriteStageOptions {
102
+ ensureIndex?: boolean;
103
+ session?: ClientSession;
104
+ complete?: {
105
+ key: string;
106
+ process?: string;
107
+ name?: string;
108
+ provider?: string;
109
+ metadata?: StageMetadata;
110
+ };
111
+ }
112
+ export interface WriteStageResult extends WriteByRefResult {
113
+ completed?: boolean;
114
+ }
115
+ /**
116
+ * Extracts values from an object using dot-notation paths with array wildcard support.
117
+ * Supports nested object paths (dot notation) and array wildcards ([]) to collect values from all array elements.
118
+ * @param value - The object to extract values from
119
+ * @param path - Dot-notation path (e.g., "meta.id", "edges[].from", "segments[]")
120
+ * @returns Array of extracted values (flattened and deduplicated for arrays)
121
+ * @example
122
+ * getByDotPath({ segments: [1, 2, 3] }, "segments[]") // [1, 2, 3]
123
+ * getByDotPath({ edges: [{ from: "A" }, { from: "B" }] }, "edges[].from") // ["A", "B"]
124
+ * getByDotPath({ meta: { id: "123" } }, "meta.id") // ["123"]
125
+ */
126
+ export declare function getByDotPath(value: any, path: string): any[];
127
+ /**
128
+ * Computes a deterministic signature for a document based on specified keys.
129
+ * The signature is a SHA-256 hash of a canonical representation of the key values.
130
+ * @param doc - The document to compute signature for
131
+ * @param keys - Array of dot-notation paths to extract values from
132
+ * @param options - Optional configuration
133
+ * @param options.algorithm - Hash algorithm to use (default: "sha256")
134
+ * @returns Hex string signature
135
+ * @example
136
+ * computeSignature({ segments: [1, 2], role: "admin" }, ["segments[]", "role"])
137
+ */
138
+ export declare function computeSignature(doc: any, keys: string[], options?: {
139
+ algorithm?: 'sha256' | 'sha1' | 'md5';
140
+ }): string;
141
+ export declare class SimpleMongoHelper {
142
+ private connectionString;
143
+ private client;
144
+ protected db: Db | null;
145
+ private isInitialized;
146
+ private retryOptions;
147
+ private config;
148
+ readonly progress: ProgressAPI;
149
+ constructor(connectionString: string, retryOptions?: RetryOptions, config?: HelperConfig);
150
+ /**
151
+ * Sets or updates the configuration for ref-based operations.
152
+ * @param config - Configuration object with inputs and outputs
153
+ * @returns This instance for method chaining
154
+ */
155
+ useConfig(config: HelperConfig): this;
156
+ /**
157
+ * Tests the MongoDB connection and returns detailed error information if it fails.
158
+ * This method does not establish a persistent connection - use initialize() for that.
159
+ * @returns Object with success status and optional error details
160
+ */
161
+ testConnection(): Promise<{
162
+ success: boolean;
163
+ error?: {
164
+ type: 'missing_credentials' | 'invalid_connection_string' | 'connection_failed' | 'authentication_failed' | 'config_error' | 'unknown';
165
+ message: string;
166
+ details?: string;
167
+ };
168
+ }>;
169
+ /**
170
+ * Establishes MongoDB connection internally with retry logic.
171
+ * Must be called before using other methods.
172
+ * @throws Error if connection fails or if already initialized
173
+ */
174
+ initialize(): Promise<void>;
175
+ /**
176
+ * Loads data from a collection with optional query filter.
177
+ * @param collectionName - Name of the collection to query
178
+ * @param query - Optional MongoDB query filter
179
+ * @param options - Optional pagination and sorting options
180
+ * @returns Array of documents matching the query or paginated result
181
+ * @throws Error if not initialized or if query fails
182
+ */
183
+ loadCollection<T extends Document = Document>(collectionName: string, query?: Filter<T>, options?: PaginationOptions): Promise<WithId<T>[] | PaginatedResult<T>>;
184
+ /**
185
+ * Finds a single document in a collection.
186
+ * @param collectionName - Name of the collection to query
187
+ * @param query - MongoDB query filter
188
+ * @param options - Optional find options (e.g., sort, projection)
189
+ * @returns Single document matching the query or null
190
+ * @throws Error if not initialized or if query fails
191
+ */
192
+ findOne<T extends Document = Document>(collectionName: string, query: Filter<T>, options?: {
193
+ sort?: Sort;
194
+ projection?: Document;
195
+ }): Promise<WithId<T> | null>;
196
+ /**
197
+ * Inserts data into a collection.
198
+ * @param collectionName - Name of the collection to insert into
199
+ * @param data - Single document or array of documents to insert
200
+ * @param options - Optional insert options (e.g., session for transactions)
201
+ * @returns Insert result(s)
202
+ * @throws Error if not initialized or if insert fails
203
+ */
204
+ insert<T extends Document = Document>(collectionName: string, data: OptionalUnlessRequiredId<T> | OptionalUnlessRequiredId<T>[], options?: {
205
+ session?: ClientSession;
206
+ }): Promise<any>;
207
+ /**
208
+ * Updates records in a collection.
209
+ * @param collectionName - Name of the collection to update
210
+ * @param filter - MongoDB query filter to match documents
211
+ * @param updateData - Update operations to apply
212
+ * @param options - Optional update options (e.g., upsert, multi, session for transactions)
213
+ * @returns Update result
214
+ * @throws Error if not initialized or if update fails
215
+ */
216
+ update<T extends Document = Document>(collectionName: string, filter: Filter<T>, updateData: UpdateFilter<T>, options?: {
217
+ upsert?: boolean;
218
+ multi?: boolean;
219
+ session?: ClientSession;
220
+ }): Promise<any>;
221
+ /**
222
+ * Deletes documents from a collection.
223
+ * @param collectionName - Name of the collection to delete from
224
+ * @param filter - MongoDB query filter to match documents
225
+ * @param options - Optional delete options (multi: true for deleteMany, false for deleteOne)
226
+ * @returns Delete result
227
+ * @throws Error if not initialized or if delete fails
228
+ */
229
+ delete<T extends Document = Document>(collectionName: string, filter: Filter<T>, options?: {
230
+ multi?: boolean;
231
+ }): Promise<any>;
232
+ /**
233
+ * Counts documents in a collection matching a query.
234
+ * @param collectionName - Name of the collection to count
235
+ * @param query - Optional MongoDB query filter
236
+ * @returns Number of documents matching the query
237
+ * @throws Error if not initialized or if count fails
238
+ */
239
+ countDocuments<T extends Document = Document>(collectionName: string, query?: Filter<T>): Promise<number>;
240
+ /**
241
+ * Gets an estimated document count for a collection (faster but less accurate).
242
+ * @param collectionName - Name of the collection to count
243
+ * @returns Estimated number of documents
244
+ * @throws Error if not initialized or if count fails
245
+ */
246
+ estimatedDocumentCount(collectionName: string): Promise<number>;
247
+ /**
248
+ * Runs an aggregation pipeline on a collection.
249
+ * @param collectionName - Name of the collection to aggregate
250
+ * @param pipeline - Array of aggregation pipeline stages
251
+ * @returns Array of aggregated results
252
+ * @throws Error if not initialized or if aggregation fails
253
+ */
254
+ aggregate<T extends Document = Document>(collectionName: string, pipeline: Document[]): Promise<T[]>;
255
+ /**
256
+ * Creates an index on a collection.
257
+ * @param collectionName - Name of the collection
258
+ * @param indexSpec - Index specification (field name or index spec object)
259
+ * @param options - Optional index creation options
260
+ * @returns Index name
261
+ * @throws Error if not initialized or if index creation fails
262
+ */
263
+ createIndex(collectionName: string, indexSpec: IndexSpecification, options?: CreateIndexesOptions): Promise<string>;
264
+ /**
265
+ * Drops an index from a collection.
266
+ * @param collectionName - Name of the collection
267
+ * @param indexName - Name of the index to drop
268
+ * @returns Result object
269
+ * @throws Error if not initialized or if index drop fails
270
+ */
271
+ dropIndex(collectionName: string, indexName: string): Promise<any>;
272
+ /**
273
+ * Lists all indexes on a collection.
274
+ * @param collectionName - Name of the collection
275
+ * @returns Array of index information
276
+ * @throws Error if not initialized or if listing fails
277
+ */
278
+ listIndexes(collectionName: string): Promise<Document[]>;
279
+ /**
280
+ * Starts a new client session for transactions.
281
+ * @returns Client session
282
+ * @throws Error if not initialized
283
+ */
284
+ startSession(): ClientSession;
285
+ /**
286
+ * Executes a function within a transaction.
287
+ * @param callback - Function to execute within the transaction
288
+ * @returns Result of the callback function
289
+ * @throws Error if not initialized or if transaction fails
290
+ */
291
+ withTransaction<T>(callback: (session: ClientSession) => Promise<T>): Promise<T>;
292
+ /**
293
+ * Loads data from a collection using a ref name from the configuration.
294
+ * @param ref - Application-level reference name (must exist in config.inputs)
295
+ * @param options - Optional pagination and session options
296
+ * @returns Array of documents or paginated result
297
+ * @throws Error if ref not found in config, not initialized, or query fails
298
+ */
299
+ loadByRef<T extends Document = Document>(ref: string, options?: PaginationOptions & {
300
+ session?: ClientSession;
301
+ }): Promise<WithId<T>[] | PaginatedResult<T>>;
302
+ /**
303
+ * Ensures a unique index exists on the _sig field for signature-based deduplication.
304
+ * @param collectionName - Name of the collection
305
+ * @param options - Optional configuration
306
+ * @param options.fieldName - Field name for signature (default: "_sig")
307
+ * @param options.unique - Whether index should be unique (default: true)
308
+ * @returns Result object with creation status and index name
309
+ * @throws Error if not initialized or if index creation fails (with permission hints)
310
+ */
311
+ ensureSignatureIndex(collectionName: string, options?: {
312
+ fieldName?: string;
313
+ unique?: boolean;
314
+ }): Promise<EnsureSignatureIndexResult>;
315
+ /**
316
+ * Writes documents to a collection using a ref name from the configuration.
317
+ * Supports signature-based deduplication and append/replace modes.
318
+ * @param ref - Application-level reference name (must exist in config.outputs)
319
+ * @param documents - Array of documents to write
320
+ * @param options - Optional write options
321
+ * @param options.session - Transaction session
322
+ * @param options.ensureIndex - Whether to ensure signature index exists (default: true)
323
+ * @returns Result object with counts and errors
324
+ * @throws Error if ref not found in config or not initialized
325
+ */
326
+ writeByRef(ref: string, documents: any[], options?: {
327
+ session?: ClientSession;
328
+ ensureIndex?: boolean;
329
+ }): Promise<WriteByRefResult>;
330
+ /**
331
+ * Writes documents to a collection using a ref name and optionally marks a stage as complete.
332
+ * Combines writeByRef() with progress.complete() for atomic write-and-complete operations.
333
+ * @param ref - Application-level reference name (must exist in config.outputs)
334
+ * @param documents - Array of documents to write
335
+ * @param options - Optional write and completion options
336
+ * @param options.ensureIndex - Whether to ensure signature index exists (default: true)
337
+ * @param options.session - Transaction session (if provided, write and complete are atomic)
338
+ * @param options.complete - Stage completion information (optional)
339
+ * @returns Result object with write counts, errors, and completion status
340
+ * @throws Error if ref not found in config or not initialized
341
+ */
342
+ writeStage(ref: string, documents: any[], options?: WriteStageOptions): Promise<WriteStageResult>;
343
+ /**
344
+ * Closes the MongoDB connection and cleans up resources.
345
+ * @throws Error if disconnect fails
346
+ */
347
+ disconnect(): Promise<void>;
348
+ /**
349
+ * Ensures the helper is initialized before performing operations.
350
+ * @throws Error if not initialized
351
+ * @internal
352
+ */
353
+ ensureInitialized(): void;
354
+ /**
355
+ * Gets the database instance. Public for use by internal classes.
356
+ * @internal
357
+ */
358
+ getDb(): Db;
359
+ /**
360
+ * Extracts database name from MongoDB connection string.
361
+ * @param connectionString - MongoDB connection string
362
+ * @returns Database name or 'test' as default
363
+ */
364
+ private extractDatabaseName;
365
+ }
366
+ //# sourceMappingURL=simpleMongoHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleMongoHelper.d.ts","sourceRoot":"","sources":["../src/simpleMongoHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,EAAE,EAAc,MAAM,EAAE,YAAY,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGvL,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;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