@common-stack/store-mongo 7.1.1-alpha.17 → 7.1.1-alpha.22
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.
- package/lib/interfaces/getAllArgs.d.ts +1 -1
- package/lib/interfaces/getAllArgs.js +1 -1
- package/lib/interfaces/getAllArgs.js.map +1 -1
- package/lib/module.d.ts +1 -2
- package/lib/store/repositories/BaseMongoRepository.js +5 -4
- package/lib/store/repositories/BaseMongoRepository.js.map +1 -1
- package/lib/templates/constants/SERVER_TYPES.ts.template +3 -1
- package/package.json +3 -3
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* clear contracts for data manipulation throughout the application. They form the foundation
|
|
25
25
|
* of the data access pattern used across the entire system.
|
|
26
26
|
*
|
|
27
|
-
* @see
|
|
27
|
+
* @see IBaseMongoRepository - Uses these types for repository operations
|
|
28
28
|
* @see IBaseService2 - Implements service methods using these types
|
|
29
29
|
* @see IDataLoader2 - Utilizes these types for efficient data loading
|
|
30
30
|
*/
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* clear contracts for data manipulation throughout the application. They form the foundation
|
|
25
25
|
* of the data access pattern used across the entire system.
|
|
26
26
|
*
|
|
27
|
-
* @see
|
|
27
|
+
* @see IBaseMongoRepository - Uses these types for repository operations
|
|
28
28
|
* @see IBaseService2 - Implements service methods using these types
|
|
29
29
|
* @see IDataLoader2 - Utilizes these types for efficient data loading
|
|
30
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAllArgs.js","sources":["../../src/interfaces/getAllArgs.ts"],"sourcesContent":["/**\n * @file get-all-args.ts\n * @description Defines common types and interfaces used across the data access layer for MongoDB operations.\n * This file contains essential type definitions that standardize how data is queried, transformed, and returned.\n *\n * Key components include:\n * - GetAllArgs: Interface for pagination, sorting, and filtering when retrieving collections of documents\n * - AsDomainType: Type transformer that converts MongoDB schema types (with _id) to domain types (with id)\n * - GetAllWithCountResult: Type for paginated results that include both data and total count\n * - CreateType/UpdateType: Utility types that define the shape of data for create and update operations\n * - PAGINATION_OPTIONS: Default pagination settings used throughout the application\n *\n * Usage examples:\n * 1. Retrieving paginated data:\n * const result = await repository.getAllWithCount({ limit: 10, skip: 0, sort: { createdAt: -1 } });\n *\n * 2. Converting MongoDB documents to domain objects:\n * const domainUser: AsDomainType<UserSchema> = { ...userDoc, id: userDoc._id.toString() };\n *\n * 3. Creating new documents with proper typing:\n * const newUser: CreateType<UserSchema> = { name: 'John', email: 'john@example.com' };\n *\n * These types ensure consistency across repositories and services, providing type safety and\n * clear contracts for data manipulation throughout the application. They form the foundation\n * of the data access pattern used across the entire system.\n *\n * @see
|
|
1
|
+
{"version":3,"file":"getAllArgs.js","sources":["../../src/interfaces/getAllArgs.ts"],"sourcesContent":["/**\n * @file get-all-args.ts\n * @description Defines common types and interfaces used across the data access layer for MongoDB operations.\n * This file contains essential type definitions that standardize how data is queried, transformed, and returned.\n *\n * Key components include:\n * - GetAllArgs: Interface for pagination, sorting, and filtering when retrieving collections of documents\n * - AsDomainType: Type transformer that converts MongoDB schema types (with _id) to domain types (with id)\n * - GetAllWithCountResult: Type for paginated results that include both data and total count\n * - CreateType/UpdateType: Utility types that define the shape of data for create and update operations\n * - PAGINATION_OPTIONS: Default pagination settings used throughout the application\n *\n * Usage examples:\n * 1. Retrieving paginated data:\n * const result = await repository.getAllWithCount({ limit: 10, skip: 0, sort: { createdAt: -1 } });\n *\n * 2. Converting MongoDB documents to domain objects:\n * const domainUser: AsDomainType<UserSchema> = { ...userDoc, id: userDoc._id.toString() };\n *\n * 3. Creating new documents with proper typing:\n * const newUser: CreateType<UserSchema> = { name: 'John', email: 'john@example.com' };\n *\n * These types ensure consistency across repositories and services, providing type safety and\n * clear contracts for data manipulation throughout the application. They form the foundation\n * of the data access pattern used across the entire system.\n *\n * @see IBaseMongoRepository - Uses these types for repository operations\n * @see IBaseService2 - Implements service methods using these types\n * @see IDataLoader2 - Utilizes these types for efficient data loading\n */\n\nimport type { FilterQuery } from 'mongoose';\nimport type { ISort } from 'common';\n\n/**\n * Interface for the arguments used in the getAll method\n *\n * @property criteria - MongoDB filter query to narrow down results\n * @property sort - Sorting configuration with field names and directions (1 for ascending, -1 for descending)\n * @property skip - Number of documents to skip (for pagination)\n * @property limit - Maximum number of documents to return (for pagination)\n * @property selectedFields - String of space-separated field names to include in the results\n *\n * @example\n * // Get active users, sorted by creation date, second page with 10 items per page\n * const options: GetAllArgs<UserSchema> = {\n * criteria: { active: true },\n * sort: { createdAt: -1 },\n * skip: 10,\n * limit: 10,\n * selectedFields: 'name email createdAt'\n * };\n */\nexport interface GetAllArgs<T> {\n criteria?: FilterQuery<T>;\n sort?: ISort;\n skip?: number;\n limit?: number;\n selectedFields?: string;\n}\n\n/**\n * Type that converts a schema type with _id to a domain type with id\n * This transformation is essential for presenting MongoDB documents as domain objects\n * throughout the application, hiding the database-specific _id field.\n *\n * @example\n * // MongoDB document\n * const userDoc = { _id: '123', name: 'John', email: 'john@example.com' };\n *\n * // Transformed domain object\n * const user: AsDomainType<UserSchema> = { id: '123', name: 'John', email: 'john@example.com' };\n */\nexport type AsDomainType<SchemaType> = Omit<SchemaType, '_id'> & { id: string };\n\n/**\n * Type for the result of getAllWithCount\n * Provides both the paginated data and the total count of matching documents\n * This is used for implementing pagination UI components that need to know\n * the total number of pages or items.\n *\n * @property data - Array of domain objects matching the query criteria\n * @property totalCount - Total number of documents that match the criteria (without pagination)\n *\n * @example\n * const result: GetAllWithCountResult<UserSchema> = {\n * data: [{ id: '1', name: 'John' }, { id: '2', name: 'Jane' }],\n * totalCount: 50\n * };\n */\nexport type GetAllWithCountResult<SchemaType> = {\n data: AsDomainType<SchemaType>[];\n totalCount: number;\n};\n\n/**\n * Default pagination settings used throughout the application\n * These values are used when no explicit pagination parameters are provided\n */\nexport enum PAGINATION_OPTIONS {\n limit = 10,\n skip = 0,\n}\n\n/**\n * Type for create operations - omits _id, id, and auto-generated fields\n * This ensures that clients cannot specify fields that should be generated by the database\n *\n * @example\n * // Valid create operation data\n * const newUser: CreateType<UserSchema> = {\n * name: 'John Doe',\n * email: 'john@example.com',\n * role: 'user'\n * };\n *\n * // The following fields will be generated automatically and should not be included:\n * // - _id (MongoDB document ID)\n * // - id (Domain object ID)\n * // - createdAt (Creation timestamp)\n * // - updatedAt (Last update timestamp)\n */\nexport type CreateType<SchemaType> = Omit<Partial<SchemaType>, '_id' | 'id' | 'createdAt' | 'updatedAt'>;\n\n/**\n * Type for update operations - partial of the schema without _id\n * This allows for partial updates where only changed fields are specified\n *\n * @example\n * // Update a user's email and role\n * const updateData: UpdateType<UserSchema> = {\n * email: 'new.email@example.com',\n * role: 'admin'\n * };\n *\n * // Fields not specified will remain unchanged\n */\nexport type UpdateType<SchemaType> = Partial<Omit<SchemaType, '_id'>>;\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AAkEH;;;AAGG;IACS,mBAGX;AAHD,CAAA,UAAY,kBAAkB,EAAA;AAC1B,IAAA,kBAAA,CAAA,kBAAA,CAAA,OAAA,CAAA,GAAA,EAAA,CAAA,GAAA,OAAU,CAAA;AACV,IAAA,kBAAA,CAAA,kBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;AACZ,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAG7B,EAAA,CAAA,CAAA"}
|
package/lib/module.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {__decorate,__param,__metadata}from'tslib';import {isObject}from'lodash-es';import'@cdm-logger/core';import {Connection,Types}from'mongoose';import {injectable,unmanaged}from'inversify';import {IMongoOptions,PAGINATION_OPTIONS}from'common/server';var
|
|
2
|
-
|
|
1
|
+
import {__decorate,__param,__metadata}from'tslib';import {isObject}from'lodash-es';import'@cdm-logger/core';import {Connection,Types}from'mongoose';import {injectable,unmanaged}from'inversify';import {IMongoOptions,PAGINATION_OPTIONS}from'common/server';var BaseMongoRepository_1;
|
|
2
|
+
var _a;
|
|
3
|
+
let BaseMongoRepository = BaseMongoRepository_1 = class BaseMongoRepository {
|
|
3
4
|
modelFunc;
|
|
4
5
|
options;
|
|
5
6
|
logger;
|
|
@@ -8,7 +9,7 @@ let BaseMongoRepository = class BaseMongoRepository {
|
|
|
8
9
|
this.modelFunc = modelFunc;
|
|
9
10
|
this.model = modelFunc(db);
|
|
10
11
|
this.options = options;
|
|
11
|
-
this.logger = logger.child({ className:
|
|
12
|
+
this.logger = logger.child({ className: BaseMongoRepository_1.name });
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Transforms a document to the domain model format
|
|
@@ -379,7 +380,7 @@ let BaseMongoRepository = class BaseMongoRepository {
|
|
|
379
380
|
}
|
|
380
381
|
}
|
|
381
382
|
};
|
|
382
|
-
BaseMongoRepository = __decorate([
|
|
383
|
+
BaseMongoRepository = BaseMongoRepository_1 = __decorate([
|
|
383
384
|
injectable(),
|
|
384
385
|
__param(0, unmanaged()),
|
|
385
386
|
__param(1, unmanaged()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseMongoRepository.js","sources":["../../../src/store/repositories/BaseMongoRepository.ts"],"sourcesContent":["/* eslint-disable import/no-unresolved */\n/* eslint-disable import/no-extraneous-dependencies */\n/* eslint-disable no-param-reassign */\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable class-methods-use-this */\nimport { isObject } from 'lodash-es';\nimport { CdmLogger } from '@cdm-logger/core';\nimport { Connection, FilterQuery, Model, PipelineStage, Types, UpdateQuery } from 'mongoose';\nimport { injectable, unmanaged } from 'inversify';\nimport {\n GetAllArgs,\n ISort,\n IBaseMongoRepository,\n IMongoOptions,\n PAGINATION_OPTIONS,\n AsDomainType,\n CreateType,\n UpdateType,\n} from 'common/server';\n\n@injectable()\nexport class BaseMongoRepository<SchemaType> implements IBaseMongoRepository<SchemaType> {\n private options: IMongoOptions;\n\n protected logger: CdmLogger.ILogger;\n\n model: Model<SchemaType>;\n\n constructor(\n @unmanaged()\n private modelFunc: (db: Connection) => Model<SchemaType>,\n @unmanaged()\n db: Connection,\n @unmanaged()\n logger: CdmLogger.ILogger,\n @unmanaged()\n options?: IMongoOptions,\n ) {\n this.model = modelFunc(db);\n this.options = options;\n this.logger = logger.child({ className: BaseRepository2.name });\n }\n\n /**\n * Transforms a document to the domain model format\n */\n protected transformDocument(doc: any): AsDomainType<SchemaType> | null {\n if (!doc) return null;\n\n // If it's already a plain object (not a Mongoose document)\n if (!doc.toObject) {\n // Ensure id exists if _id is present\n if (doc._id && !doc.id) {\n doc.id = typeof doc._id === 'object' && doc._id.toString ? doc._id.toString() : doc._id;\n }\n return doc as AsDomainType<SchemaType>;\n }\n\n // For Mongoose documents, use the built-in toObject transformation\n return doc.toObject() as AsDomainType<SchemaType>;\n }\n\n /**\n * Transforms an array of documents\n */\n protected transformDocuments(docs: SchemaType[]): AsDomainType<SchemaType>[] {\n if (!docs || !Array.isArray(docs)) return [];\n return docs.map((doc) => this.transformDocument(doc)).filter(Boolean) as AsDomainType<SchemaType>[];\n }\n\n /**\n * Maps API criteria with 'id' to MongoDB criteria with '_id'\n */\n private mapConditions(conditions?: FilterQuery<SchemaType>): FilterQuery<SchemaType> {\n if (!conditions) return {};\n\n const { id, ...remaining } = conditions as any;\n\n if (!id) return remaining as FilterQuery<SchemaType>;\n\n // Handle custom _id that might not be an ObjectId\n let _id;\n if (Types.ObjectId.isValid(id)) {\n _id = new Types.ObjectId(id);\n } else {\n _id = id; // Use the id as-is if it's not a valid ObjectId\n }\n\n return {\n _id,\n ...remaining,\n } as FilterQuery<SchemaType>;\n }\n\n /**\n * Computes sort object from GetAllArgs sort parameter\n * Handles both string-based and object-based sort specifications\n */\n protected computeSort(sort: ISort | string | ISort[]): Record<string, 1 | -1> {\n // Default sort by createdAt descending if available, otherwise empty sort\n if (!sort) {\n return { createdAt: -1 };\n }\n\n // Handle object-based sort { key: 'fieldName', value: 'asc'|'desc' }\n if (isObject(sort) && 'key' in sort) {\n return {\n [sort.key]: sort.value?.toLowerCase() === 'asc' ? 1 : -1,\n };\n }\n\n // Handle string-based sort 'fieldName:asc' or 'fieldName:desc'\n if (typeof sort === 'string') {\n const [field, direction] = sort.split(':');\n if (field) {\n return {\n [field]: direction?.toLowerCase() === 'asc' ? 1 : -1,\n };\n }\n }\n\n // Handle array of sort specifications\n if (Array.isArray(sort)) {\n return sort.reduce((acc, sortItem) => {\n if (isObject(sortItem) && sortItem.key) {\n acc[sortItem.key] = sortItem.value?.toLowerCase() === 'asc' ? 1 : -1;\n }\n return acc;\n }, {});\n }\n\n // Fallback to default sort\n return { createdAt: -1 };\n }\n\n /**\n * Prepares an aggregation pipeline with standard stages\n * @param options Query options including filtering, sorting, pagination\n * @param customPipeline Optional custom pipeline stages to include\n * @returns Complete MongoDB aggregation pipeline\n */\n protected preparePipeline(options: GetAllArgs<SchemaType>, customPipeline: PipelineStage[] = []): PipelineStage[] {\n const { criteria, sort, limit, skip } = options;\n const pipeline: PipelineStage[] = [];\n\n // Match stage (filtering)\n if (criteria) {\n pipeline.push({\n $match: this.mapConditions(criteria),\n });\n }\n\n // Add custom pipeline stages\n if (customPipeline.length > 0) {\n pipeline.push(...customPipeline);\n }\n\n // Sort stage\n const sortBy = this.computeSort(sort);\n if (Object.keys(sortBy).length > 0) {\n pipeline.push({ $sort: sortBy });\n }\n\n // Pagination stages\n if (skip !== undefined) {\n pipeline.push({ $skip: skip || PAGINATION_OPTIONS.skip });\n }\n\n if (limit !== undefined) {\n pipeline.push({ $limit: limit || PAGINATION_OPTIONS.limit });\n }\n\n return pipeline;\n }\n\n /**\n * Execute an aggregation pipeline and transform the results\n */\n protected async aggregate(pipeline: PipelineStage[]): Promise<AsDomainType<SchemaType>[]> {\n try {\n const results = await this.model.aggregate(pipeline).exec();\n return this.transformDocuments(results);\n } catch (e) {\n this.logger.error(e, 'Error executing aggregation pipeline: %j', pipeline);\n throw e;\n }\n }\n\n public async count(conditions?: FilterQuery<SchemaType>): Promise<number> {\n return this.model.count(this.mapConditions(conditions)).exec();\n }\n\n public async get(\n conditions?: FilterQuery<SchemaType>,\n selectedFields?: string,\n ): Promise<AsDomainType<SchemaType> | null> {\n try {\n const response = await this.model.findOne(this.mapConditions(conditions), selectedFields).lean().exec();\n\n if (!response) return null;\n\n // Ensure id exists\n if (response && (response as any)._id && !(response as any).id) {\n (response as any).id = (response as any)._id.toString();\n }\n\n return response as AsDomainType<SchemaType>;\n } catch (e) {\n this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', conditions);\n throw e;\n }\n }\n\n public async find(\n conditions: Partial<FilterQuery<SchemaType>>,\n selectedFields?: string,\n ): Promise<AsDomainType<SchemaType> | null> {\n try {\n const response = await this.model.findOne(conditions, selectedFields).lean().exec();\n\n if (!response) return null;\n\n // Ensure id exists\n if (response && (response as any)._id && !(response as any).id) {\n (response as any).id = (response as any)._id.toString();\n }\n\n return response as AsDomainType<SchemaType>;\n } catch (e) {\n this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', conditions);\n throw e;\n }\n }\n\n public async getAll(options: GetAllArgs<SchemaType>): Promise<AsDomainType<SchemaType>[]> {\n try {\n const { criteria, selectedFields, sort, limit, skip } = options;\n const mappedCriteria = this.mapConditions(criteria);\n const sortBy = this.computeSort(sort);\n\n const response = await this.model\n .find(mappedCriteria, selectedFields)\n .sort(sortBy as any)\n .limit(limit || PAGINATION_OPTIONS.limit)\n .skip(skip || PAGINATION_OPTIONS.skip)\n .lean()\n .exec();\n\n // Ensure id exists for each document\n return response.map((doc) => {\n if (doc._id && !doc.id) {\n doc.id = doc._id.toString();\n }\n return doc as AsDomainType<SchemaType>;\n });\n } catch (e) {\n this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', options);\n throw e;\n }\n }\n\n /**\n * Get all documents using aggregation pipeline\n */\n public async getAllWithPipeline(\n options: GetAllArgs<SchemaType>,\n customPipeline: PipelineStage[] = [],\n ): Promise<AsDomainType<SchemaType>[]> {\n try {\n const pipeline = this.preparePipeline(options, customPipeline);\n return this.aggregate(pipeline);\n } catch (e) {\n this.logger.error(e, 'Unable to retrieve Model with pipeline [%j]', customPipeline);\n throw e;\n }\n }\n\n public async getAllWithCount(options: GetAllArgs<SchemaType>): Promise<{\n data: AsDomainType<SchemaType>[];\n totalCount: number;\n }> {\n const data = await this.getAll(options);\n const totalCount = await this.count(options.criteria);\n return { totalCount, data };\n }\n\n /**\n * Get all documents with count using aggregation pipeline\n */\n public async getAllWithCountAndPipeline(\n options: GetAllArgs<SchemaType>,\n customPipeline: PipelineStage[] = [],\n ): Promise<{\n data: AsDomainType<SchemaType>[];\n totalCount: number;\n }> {\n // Clone options to avoid modifying the original\n const countOptions = { ...options };\n\n // Remove pagination for count\n delete countOptions.limit;\n delete countOptions.skip;\n\n // Prepare count pipeline (without pagination)\n const countPipeline = this.preparePipeline(countOptions, customPipeline);\n countPipeline.push({ $count: 'total' });\n\n // Execute both queries in parallel\n const [data, countResult] = await Promise.all([\n this.getAllWithPipeline(options, customPipeline),\n this.model.aggregate(countPipeline).exec(),\n ]);\n\n const totalCount = countResult?.[0]?.total || 0;\n return { data, totalCount };\n }\n\n public async create<T = CreateType<SchemaType>>(data: T): Promise<AsDomainType<SchemaType>> {\n try {\n // Handle custom _id if provided in the data\n const createData = { ...data } as any;\n\n // If id is provided but _id is not, map id to _id\n if (createData.id && !createData._id) {\n createData._id = Types.ObjectId.isValid(createData.id)\n ? new Types.ObjectId(createData.id)\n : createData.id;\n delete createData.id; // Remove id to avoid conflicts\n }\n\n const response = await this.model.create(createData);\n return this.transformDocument(response);\n } catch (e) {\n this.logger.error(e, 'Unable to create Model with data [%j]', data);\n throw e;\n }\n }\n\n public async bulkCreate<T = CreateType<SchemaType>>(data: T[]): Promise<AsDomainType<SchemaType>[]> {\n try {\n const response = await this.model.insertMany(data, {\n lean: true,\n ordered: true,\n });\n\n // Ensure id exists for each document\n return response.map((doc: any) => {\n if (doc._id && !doc.id) {\n doc.id = doc._id.toString();\n }\n return doc as AsDomainType<SchemaType>;\n });\n } catch (e) {\n this.logger.error(e, 'Unable to bulk create due to error [%s]', e.message);\n throw e;\n }\n }\n\n public async upsert<T = UpdateType<SchemaType>>(\n conditions: FilterQuery<SchemaType>,\n update: T,\n options: Record<string, unknown> = {},\n ): Promise<AsDomainType<SchemaType>> {\n return this.update(conditions, update, {\n upsert: true,\n ...options,\n });\n }\n\n public async update<T = UpdateType<SchemaType>>(\n criteria: FilterQuery<SchemaType>,\n update: T | UpdateQuery<SchemaType>,\n options: Record<string, unknown> = {},\n ): Promise<AsDomainType<SchemaType>> {\n try {\n const mappedCriteria = this.mapConditions(criteria);\n const mergedOptions = {\n new: true,\n useFindAndModify: false,\n ...options,\n };\n\n const { id } = criteria as any;\n let response;\n\n if (id) {\n response = await this.model.findByIdAndUpdate(id, update as any, mergedOptions).exec();\n } else {\n response = await this.model.findOneAndUpdate(mappedCriteria, update as any, mergedOptions).exec();\n }\n\n return this.transformDocument(response);\n } catch (e) {\n this.logger.error(e, 'Unable to Update with criteria [%j] and data [%j]', criteria, update);\n throw e;\n }\n }\n\n public async bulkUpdate<T = UpdateType<SchemaType>>(\n criteria: FilterQuery<SchemaType>,\n update: T | UpdateQuery<SchemaType>,\n options: Record<string, unknown> = {},\n ): Promise<AsDomainType<SchemaType>[]> {\n try {\n const mappedCriteria = this.mapConditions(criteria);\n await this.model.updateMany(mappedCriteria, update as any, options);\n\n // Fetch the updated documents\n const response = await this.model.find(mappedCriteria).lean().exec();\n\n // Ensure id exists for each document\n return response.map((doc) => {\n if (doc._id && !doc.id) {\n doc.id = doc._id.toString();\n }\n return doc as AsDomainType<SchemaType>;\n });\n } catch (e) {\n this.logger.error(e, 'Unable to Bulk Update with criteria [%j] and data [%j]', criteria, update);\n throw e;\n }\n }\n\n public async delete(criteria: FilterQuery<SchemaType>): Promise<boolean> {\n try {\n const mappedCriteria = this.mapConditions(criteria);\n let deleted;\n\n if (criteria?.id) {\n deleted = await this.model.findByIdAndDelete(criteria.id);\n } else {\n deleted = await this.model.findOneAndDelete(mappedCriteria);\n }\n\n return !!deleted;\n } catch (e) {\n this.logger.error(e, 'Unable to delete the model with criteria [%j]', criteria);\n throw e;\n }\n }\n\n public async bulkDelete(criteria: FilterQuery<SchemaType>): Promise<number> {\n try {\n const mappedCriteria = this.mapConditions(criteria);\n const deleted = await this.model.deleteMany(mappedCriteria);\n return deleted?.deletedCount || 0;\n } catch (e) {\n this.logger.error(e, 'Unable to delete the model with criteria [%j]', criteria);\n throw e;\n }\n }\n\n public async bulkGet(ids: string[], selectedFields?: string): Promise<AsDomainType<SchemaType>[]> {\n try {\n // Create a query that handles both ObjectId and string IDs\n const query: any = { _id: { $in: [] } };\n\n // Process each ID\n ids.forEach((id) => {\n if (Types.ObjectId.isValid(id)) {\n query._id.$in.push(new Types.ObjectId(id));\n } else {\n query._id.$in.push(id); // Add as string\n }\n });\n\n const results = await this.model.find(query).select(selectedFields).lean().exec();\n\n // Ensure id exists for each document\n return results.map((doc) => {\n if ((doc as any)._id && !(doc as any).id) {\n (doc as any).id = (doc as any)._id.toString();\n }\n return doc as AsDomainType<SchemaType>;\n });\n } catch (e) {\n this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', ids);\n throw e;\n }\n }\n}\n"],"names":[],"mappings":";AAsBa,IAAA,mBAAmB,GAAzB,MAAM,mBAAmB,CAAA;AAShB,IAAA,SAAA,CAAA;AARJ,IAAA,OAAO,CAAgB;AAErB,IAAA,MAAM,CAAoB;AAEpC,IAAA,KAAK,CAAoB;AAEzB,IAAA,WAAA,CAEY,SAAgD,EAExD,EAAc,EAEd,MAAyB,EAEzB,OAAuB,EAAA;QANf,IAAS,CAAA,SAAA,GAAT,SAAS,CAAuC;AAQxD,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;AAC3B,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,QAAA,IAAI,CAAC,M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AA,CAAA,CAAA,EAAA,SAAS,EAAE,CAAA;IAEX,OAAA,CAAA,CAAA,EAAA,SAAS,EAAE,CAAA;+CAHR,UAAU,EAAA,MAAA,EAAA,QAAA,EAAA,GAAA,OAIJ,aAAa,KAAA,WAAA,IAAb,aAAa,CAAA,KAAA,UAAA,GAAA,EAAA,GAAA,MAAA,CAAA,CAAA;AAflB,CAAA,EAAA,mBAAmB,CA2c/B"}
|
|
1
|
+
{"version":3,"file":"BaseMongoRepository.js","sources":["../../../src/store/repositories/BaseMongoRepository.ts"],"sourcesContent":["/* eslint-disable import/no-unresolved */\n/* eslint-disable import/no-extraneous-dependencies */\n/* eslint-disable no-param-reassign */\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable class-methods-use-this */\nimport { isObject } from 'lodash-es';\nimport { CdmLogger } from '@cdm-logger/core';\nimport { Connection, FilterQuery, Model, PipelineStage, Types, UpdateQuery } from 'mongoose';\nimport { injectable, unmanaged } from 'inversify';\nimport {\n GetAllArgs,\n ISort,\n IBaseMongoRepository,\n IMongoOptions,\n PAGINATION_OPTIONS,\n AsDomainType,\n CreateType,\n UpdateType,\n} from 'common/server';\n\n@injectable()\nexport class BaseMongoRepository<SchemaType> implements IBaseMongoRepository<SchemaType> {\n private options: IMongoOptions;\n\n protected logger: CdmLogger.ILogger;\n\n model: Model<SchemaType>;\n\n constructor(\n @unmanaged()\n private modelFunc: (db: Connection) => Model<SchemaType>,\n @unmanaged()\n db: Connection,\n @unmanaged()\n logger: CdmLogger.ILogger,\n @unmanaged()\n options?: IMongoOptions,\n ) {\n this.model = modelFunc(db);\n this.options = options;\n this.logger = logger.child({ className: BaseMongoRepository.name });\n }\n\n /**\n * Transforms a document to the domain model format\n */\n protected transformDocument(doc: any): AsDomainType<SchemaType> | null {\n if (!doc) return null;\n\n // If it's already a plain object (not a Mongoose document)\n if (!doc.toObject) {\n // Ensure id exists if _id is present\n if (doc._id && !doc.id) {\n doc.id = typeof doc._id === 'object' && doc._id.toString ? doc._id.toString() : doc._id;\n }\n return doc as AsDomainType<SchemaType>;\n }\n\n // For Mongoose documents, use the built-in toObject transformation\n return doc.toObject() as AsDomainType<SchemaType>;\n }\n\n /**\n * Transforms an array of documents\n */\n protected transformDocuments(docs: SchemaType[]): AsDomainType<SchemaType>[] {\n if (!docs || !Array.isArray(docs)) return [];\n return docs.map((doc) => this.transformDocument(doc)).filter(Boolean) as AsDomainType<SchemaType>[];\n }\n\n /**\n * Maps API criteria with 'id' to MongoDB criteria with '_id'\n */\n private mapConditions(conditions?: FilterQuery<SchemaType>): FilterQuery<SchemaType> {\n if (!conditions) return {};\n\n const { id, ...remaining } = conditions as any;\n\n if (!id) return remaining as FilterQuery<SchemaType>;\n\n // Handle custom _id that might not be an ObjectId\n let _id;\n if (Types.ObjectId.isValid(id)) {\n _id = new Types.ObjectId(id);\n } else {\n _id = id; // Use the id as-is if it's not a valid ObjectId\n }\n\n return {\n _id,\n ...remaining,\n } as FilterQuery<SchemaType>;\n }\n\n /**\n * Computes sort object from GetAllArgs sort parameter\n * Handles both string-based and object-based sort specifications\n */\n protected computeSort(sort: ISort | string | ISort[]): Record<string, 1 | -1> {\n // Default sort by createdAt descending if available, otherwise empty sort\n if (!sort) {\n return { createdAt: -1 };\n }\n\n // Handle object-based sort { key: 'fieldName', value: 'asc'|'desc' }\n if (isObject(sort) && 'key' in sort) {\n return {\n [sort.key]: sort.value?.toLowerCase() === 'asc' ? 1 : -1,\n };\n }\n\n // Handle string-based sort 'fieldName:asc' or 'fieldName:desc'\n if (typeof sort === 'string') {\n const [field, direction] = sort.split(':');\n if (field) {\n return {\n [field]: direction?.toLowerCase() === 'asc' ? 1 : -1,\n };\n }\n }\n\n // Handle array of sort specifications\n if (Array.isArray(sort)) {\n return sort.reduce((acc, sortItem) => {\n if (isObject(sortItem) && sortItem.key) {\n acc[sortItem.key] = sortItem.value?.toLowerCase() === 'asc' ? 1 : -1;\n }\n return acc;\n }, {});\n }\n\n // Fallback to default sort\n return { createdAt: -1 };\n }\n\n /**\n * Prepares an aggregation pipeline with standard stages\n * @param options Query options including filtering, sorting, pagination\n * @param customPipeline Optional custom pipeline stages to include\n * @returns Complete MongoDB aggregation pipeline\n */\n protected preparePipeline(options: GetAllArgs<SchemaType>, customPipeline: PipelineStage[] = []): PipelineStage[] {\n const { criteria, sort, limit, skip } = options;\n const pipeline: PipelineStage[] = [];\n\n // Match stage (filtering)\n if (criteria) {\n pipeline.push({\n $match: this.mapConditions(criteria),\n });\n }\n\n // Add custom pipeline stages\n if (customPipeline.length > 0) {\n pipeline.push(...customPipeline);\n }\n\n // Sort stage\n const sortBy = this.computeSort(sort);\n if (Object.keys(sortBy).length > 0) {\n pipeline.push({ $sort: sortBy });\n }\n\n // Pagination stages\n if (skip !== undefined) {\n pipeline.push({ $skip: skip || PAGINATION_OPTIONS.skip });\n }\n\n if (limit !== undefined) {\n pipeline.push({ $limit: limit || PAGINATION_OPTIONS.limit });\n }\n\n return pipeline;\n }\n\n /**\n * Execute an aggregation pipeline and transform the results\n */\n protected async aggregate(pipeline: PipelineStage[]): Promise<AsDomainType<SchemaType>[]> {\n try {\n const results = await this.model.aggregate(pipeline).exec();\n return this.transformDocuments(results);\n } catch (e) {\n this.logger.error(e, 'Error executing aggregation pipeline: %j', pipeline);\n throw e;\n }\n }\n\n public async count(conditions?: FilterQuery<SchemaType>): Promise<number> {\n return this.model.count(this.mapConditions(conditions)).exec();\n }\n\n public async get(\n conditions?: FilterQuery<SchemaType>,\n selectedFields?: string,\n ): Promise<AsDomainType<SchemaType> | null> {\n try {\n const response = await this.model.findOne(this.mapConditions(conditions), selectedFields).lean().exec();\n\n if (!response) return null;\n\n // Ensure id exists\n if (response && (response as any)._id && !(response as any).id) {\n (response as any).id = (response as any)._id.toString();\n }\n\n return response as AsDomainType<SchemaType>;\n } catch (e) {\n this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', conditions);\n throw e;\n }\n }\n\n public async find(\n conditions: Partial<FilterQuery<SchemaType>>,\n selectedFields?: string,\n ): Promise<AsDomainType<SchemaType> | null> {\n try {\n const response = await this.model.findOne(conditions, selectedFields).lean().exec();\n\n if (!response) return null;\n\n // Ensure id exists\n if (response && (response as any)._id && !(response as any).id) {\n (response as any).id = (response as any)._id.toString();\n }\n\n return response as AsDomainType<SchemaType>;\n } catch (e) {\n this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', conditions);\n throw e;\n }\n }\n\n public async getAll(options: GetAllArgs<SchemaType>): Promise<AsDomainType<SchemaType>[]> {\n try {\n const { criteria, selectedFields, sort, limit, skip } = options;\n const mappedCriteria = this.mapConditions(criteria);\n const sortBy = this.computeSort(sort);\n\n const response = await this.model\n .find(mappedCriteria, selectedFields)\n .sort(sortBy as any)\n .limit(limit || PAGINATION_OPTIONS.limit)\n .skip(skip || PAGINATION_OPTIONS.skip)\n .lean()\n .exec();\n\n // Ensure id exists for each document\n return response.map((doc) => {\n if (doc._id && !doc.id) {\n doc.id = doc._id.toString();\n }\n return doc as AsDomainType<SchemaType>;\n });\n } catch (e) {\n this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', options);\n throw e;\n }\n }\n\n /**\n * Get all documents using aggregation pipeline\n */\n public async getAllWithPipeline(\n options: GetAllArgs<SchemaType>,\n customPipeline: PipelineStage[] = [],\n ): Promise<AsDomainType<SchemaType>[]> {\n try {\n const pipeline = this.preparePipeline(options, customPipeline);\n return this.aggregate(pipeline);\n } catch (e) {\n this.logger.error(e, 'Unable to retrieve Model with pipeline [%j]', customPipeline);\n throw e;\n }\n }\n\n public async getAllWithCount(options: GetAllArgs<SchemaType>): Promise<{\n data: AsDomainType<SchemaType>[];\n totalCount: number;\n }> {\n const data = await this.getAll(options);\n const totalCount = await this.count(options.criteria);\n return { totalCount, data };\n }\n\n /**\n * Get all documents with count using aggregation pipeline\n */\n public async getAllWithCountAndPipeline(\n options: GetAllArgs<SchemaType>,\n customPipeline: PipelineStage[] = [],\n ): Promise<{\n data: AsDomainType<SchemaType>[];\n totalCount: number;\n }> {\n // Clone options to avoid modifying the original\n const countOptions = { ...options };\n\n // Remove pagination for count\n delete countOptions.limit;\n delete countOptions.skip;\n\n // Prepare count pipeline (without pagination)\n const countPipeline = this.preparePipeline(countOptions, customPipeline);\n countPipeline.push({ $count: 'total' });\n\n // Execute both queries in parallel\n const [data, countResult] = await Promise.all([\n this.getAllWithPipeline(options, customPipeline),\n this.model.aggregate(countPipeline).exec(),\n ]);\n\n const totalCount = countResult?.[0]?.total || 0;\n return { data, totalCount };\n }\n\n public async create<T = CreateType<SchemaType>>(data: T): Promise<AsDomainType<SchemaType>> {\n try {\n // Handle custom _id if provided in the data\n const createData = { ...data } as any;\n\n // If id is provided but _id is not, map id to _id\n if (createData.id && !createData._id) {\n createData._id = Types.ObjectId.isValid(createData.id)\n ? new Types.ObjectId(createData.id)\n : createData.id;\n delete createData.id; // Remove id to avoid conflicts\n }\n\n const response = await this.model.create(createData);\n return this.transformDocument(response);\n } catch (e) {\n this.logger.error(e, 'Unable to create Model with data [%j]', data);\n throw e;\n }\n }\n\n public async bulkCreate<T = CreateType<SchemaType>>(data: T[]): Promise<AsDomainType<SchemaType>[]> {\n try {\n const response = await this.model.insertMany(data, {\n lean: true,\n ordered: true,\n });\n\n // Ensure id exists for each document\n return response.map((doc: any) => {\n if (doc._id && !doc.id) {\n doc.id = doc._id.toString();\n }\n return doc as AsDomainType<SchemaType>;\n });\n } catch (e) {\n this.logger.error(e, 'Unable to bulk create due to error [%s]', e.message);\n throw e;\n }\n }\n\n public async upsert<T = UpdateType<SchemaType>>(\n conditions: FilterQuery<SchemaType>,\n update: T,\n options: Record<string, unknown> = {},\n ): Promise<AsDomainType<SchemaType>> {\n return this.update(conditions, update, {\n upsert: true,\n ...options,\n });\n }\n\n public async update<T = UpdateType<SchemaType>>(\n criteria: FilterQuery<SchemaType>,\n update: T | UpdateQuery<SchemaType>,\n options: Record<string, unknown> = {},\n ): Promise<AsDomainType<SchemaType>> {\n try {\n const mappedCriteria = this.mapConditions(criteria);\n const mergedOptions = {\n new: true,\n useFindAndModify: false,\n ...options,\n };\n\n const { id } = criteria as any;\n let response;\n\n if (id) {\n response = await this.model.findByIdAndUpdate(id, update as any, mergedOptions).exec();\n } else {\n response = await this.model.findOneAndUpdate(mappedCriteria, update as any, mergedOptions).exec();\n }\n\n return this.transformDocument(response);\n } catch (e) {\n this.logger.error(e, 'Unable to Update with criteria [%j] and data [%j]', criteria, update);\n throw e;\n }\n }\n\n public async bulkUpdate<T = UpdateType<SchemaType>>(\n criteria: FilterQuery<SchemaType>,\n update: T | UpdateQuery<SchemaType>,\n options: Record<string, unknown> = {},\n ): Promise<AsDomainType<SchemaType>[]> {\n try {\n const mappedCriteria = this.mapConditions(criteria);\n await this.model.updateMany(mappedCriteria, update as any, options);\n\n // Fetch the updated documents\n const response = await this.model.find(mappedCriteria).lean().exec();\n\n // Ensure id exists for each document\n return response.map((doc) => {\n if (doc._id && !doc.id) {\n doc.id = doc._id.toString();\n }\n return doc as AsDomainType<SchemaType>;\n });\n } catch (e) {\n this.logger.error(e, 'Unable to Bulk Update with criteria [%j] and data [%j]', criteria, update);\n throw e;\n }\n }\n\n public async delete(criteria: FilterQuery<SchemaType>): Promise<boolean> {\n try {\n const mappedCriteria = this.mapConditions(criteria);\n let deleted;\n\n if (criteria?.id) {\n deleted = await this.model.findByIdAndDelete(criteria.id);\n } else {\n deleted = await this.model.findOneAndDelete(mappedCriteria);\n }\n\n return !!deleted;\n } catch (e) {\n this.logger.error(e, 'Unable to delete the model with criteria [%j]', criteria);\n throw e;\n }\n }\n\n public async bulkDelete(criteria: FilterQuery<SchemaType>): Promise<number> {\n try {\n const mappedCriteria = this.mapConditions(criteria);\n const deleted = await this.model.deleteMany(mappedCriteria);\n return deleted?.deletedCount || 0;\n } catch (e) {\n this.logger.error(e, 'Unable to delete the model with criteria [%j]', criteria);\n throw e;\n }\n }\n\n public async bulkGet(ids: string[], selectedFields?: string): Promise<AsDomainType<SchemaType>[]> {\n try {\n // Create a query that handles both ObjectId and string IDs\n const query: any = { _id: { $in: [] } };\n\n // Process each ID\n ids.forEach((id) => {\n if (Types.ObjectId.isValid(id)) {\n query._id.$in.push(new Types.ObjectId(id));\n } else {\n query._id.$in.push(id); // Add as string\n }\n });\n\n const results = await this.model.find(query).select(selectedFields).lean().exec();\n\n // Ensure id exists for each document\n return results.map((doc) => {\n if ((doc as any)._id && !(doc as any).id) {\n (doc as any).id = (doc as any)._id.toString();\n }\n return doc as AsDomainType<SchemaType>;\n });\n } catch (e) {\n this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', ids);\n throw e;\n }\n }\n}\n"],"names":[],"mappings":";;AAsBa,IAAA,mBAAmB,GAAzB,qBAAA,GAAA,MAAM,mBAAmB,CAAA;AAShB,IAAA,SAAA,CAAA;AARJ,IAAA,OAAO,CAAgB;AAErB,IAAA,MAAM,CAAoB;AAEpC,IAAA,KAAK,CAAoB;AAEzB,IAAA,WAAA,CAEY,SAAgD,EAExD,EAAc,EAEd,MAAyB,EAEzB,OAAuB,EAAA;QANf,IAAS,CAAA,SAAA,GAAT,SAAS,CAAuC;AAQxD,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;AAC3B,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,qBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC;KACvE;AAED;;AAEG;AACO,IAAA,iBAAiB,CAAC,GAAQ,EAAA;AAChC,QAAA,IAAI,CAAC,GAAG;AAAE,YAAA,OAAO,IAAI,CAAC;;AAGtB,QAAA,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;;YAEf,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE;AACpB,gBAAA,GAAG,CAAC,EAAE,GAAG,OAAO,GAAG,CAAC,GAAG,KAA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: Symbol.for('BaseMongoService'),
|
|
4
4
|
BaseService: Symbol.for('BaseService'),
|
|
5
|
-
|
|
5
|
+
MongoDBMigration: Symbol.for('MongodbMigration'),
|
|
6
|
+
MongoDBConnection: Symbol.for('MongoDBConnection'),
|
|
7
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/store-mongo",
|
|
3
|
-
"version": "7.1.1-alpha.
|
|
3
|
+
"version": "7.1.1-alpha.22",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@common-stack/core": "7.1.1-alpha.14"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"common": "7.1.1-alpha.
|
|
30
|
+
"common": "7.1.1-alpha.22",
|
|
31
31
|
"moleculer": "^0.14.33",
|
|
32
32
|
"mongoose": "^6.12.8"
|
|
33
33
|
},
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"typescript": {
|
|
59
59
|
"definition": "lib/index.d.ts"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "ed3eec97d069193db42215a063ecbfb76f54a4c0"
|
|
62
62
|
}
|