@culturefy/shared 1.0.56 → 1.0.58

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 (42) hide show
  1. package/build/cjs/index.js +6 -0
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/middlewares/verify-middleware.js +7 -6
  4. package/build/cjs/middlewares/verify-middleware.js.map +1 -1
  5. package/build/cjs/models/config-mapping.model.js +41 -0
  6. package/build/cjs/models/config-mapping.model.js.map +1 -0
  7. package/build/cjs/repositories/index.js +16 -0
  8. package/build/cjs/repositories/index.js.map +1 -0
  9. package/build/cjs/repositories/multi-tenant.repository.js +266 -0
  10. package/build/cjs/repositories/multi-tenant.repository.js.map +1 -0
  11. package/build/cjs/repositories/tenant-base.repository.js +52 -0
  12. package/build/cjs/repositories/tenant-base.repository.js.map +1 -0
  13. package/build/esm/index.js +1 -0
  14. package/build/esm/index.js.map +1 -1
  15. package/build/esm/middlewares/verify-middleware.js +7 -6
  16. package/build/esm/middlewares/verify-middleware.js.map +1 -1
  17. package/build/esm/models/config-mapping.model.js +36 -0
  18. package/build/esm/models/config-mapping.model.js.map +1 -0
  19. package/build/esm/repositories/index.js +3 -0
  20. package/build/esm/repositories/index.js.map +1 -0
  21. package/build/esm/repositories/multi-tenant.repository.js +259 -0
  22. package/build/esm/repositories/multi-tenant.repository.js.map +1 -0
  23. package/build/esm/repositories/tenant-base.repository.js +48 -0
  24. package/build/esm/repositories/tenant-base.repository.js.map +1 -0
  25. package/build/src/index.d.ts +1 -0
  26. package/build/src/index.js +1 -0
  27. package/build/src/index.js.map +1 -1
  28. package/build/src/middlewares/verify-middleware.js +12 -11
  29. package/build/src/middlewares/verify-middleware.js.map +1 -1
  30. package/build/src/models/config-mapping.model.d.ts +20 -0
  31. package/build/src/models/config-mapping.model.js +41 -0
  32. package/build/src/models/config-mapping.model.js.map +1 -0
  33. package/build/src/repositories/index.d.ts +2 -0
  34. package/build/src/repositories/index.js +6 -0
  35. package/build/src/repositories/index.js.map +1 -0
  36. package/build/src/repositories/multi-tenant.repository.d.ts +44 -0
  37. package/build/src/repositories/multi-tenant.repository.js +295 -0
  38. package/build/src/repositories/multi-tenant.repository.js.map +1 -0
  39. package/build/src/repositories/tenant-base.repository.d.ts +17 -0
  40. package/build/src/repositories/tenant-base.repository.js +141 -0
  41. package/build/src/repositories/tenant-base.repository.js.map +1 -0
  42. package/package.json +1 -1
@@ -0,0 +1,295 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TenantModelRepository = exports.MultiTenantRepository = void 0;
4
+ exports.WithTenantDb = WithTenantDb;
5
+ const tslib_1 = require("tslib");
6
+ const mongoose_1 = tslib_1.__importStar(require("mongoose"));
7
+ const crypto = tslib_1.__importStar(require("crypto"));
8
+ const identity_1 = require("@azure/identity");
9
+ const keyvault_secrets_1 = require("@azure/keyvault-secrets");
10
+ const enums_1 = require("../enums");
11
+ const cache_1 = require("../utils/cache");
12
+ const secrets_1 = require("../utils/secrets");
13
+ const config_mapping_model_1 = require("../models/config-mapping.model");
14
+ const tenantDbCache = (0, cache_1.createCache)("tenant-db", 600);
15
+ const tenantBridgeCache = (0, cache_1.createCache)("tenant-bridge-db-connection-string", 1800);
16
+ const encryptionKeyCache = (0, cache_1.createCache)("db-enc-key", 1800);
17
+ /**
18
+ * Decorator that ensures tenant DB is connected before the method runs.
19
+ */
20
+ function WithTenantDb(_target, _propertyKey, descriptor) {
21
+ if (!descriptor.value)
22
+ return;
23
+ const originalMethod = descriptor.value;
24
+ descriptor.value = function (...args) {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
+ yield this.ensureClientConnection();
27
+ return originalMethod.apply(this, args);
28
+ });
29
+ };
30
+ }
31
+ class MultiTenantRepository {
32
+ constructor(context, businessId, appId, config, serviceDBType) {
33
+ this.context = context;
34
+ this.businessId = businessId;
35
+ this.appId = appId;
36
+ this.serviceDBType = serviceDBType !== null && serviceDBType !== void 0 ? serviceDBType : "main";
37
+ this.tenantBridgeConfig = Object.assign({ tenantBridgeEnvKey: "TENANT_BRIDGE_DB_URI", tenantBridgeSecretKey: enums_1.AzureSecretKeysEnum.DB_CONNECTING_STRING_TENANT_BRIDGE }, config);
38
+ this.connectionPromise = this.ensureClientConnection();
39
+ }
40
+ getEncryptionIv() {
41
+ const iv = process.env.DB_CONNECTION_STRING_ENCRYPTION_IV;
42
+ if (!iv) {
43
+ return Buffer.alloc(16, 0);
44
+ }
45
+ return this.normalizeFixedSize(iv, "IV");
46
+ }
47
+ normalizeFixedSize(value, label) {
48
+ const utf8Value = Buffer.from(value, "utf8");
49
+ if (utf8Value.length === 16) {
50
+ return utf8Value;
51
+ }
52
+ const base64Value = Buffer.from(value, "base64");
53
+ if (base64Value.length === 16) {
54
+ return base64Value;
55
+ }
56
+ const hexValue = Buffer.from(value, "hex");
57
+ if (hexValue.length === 16) {
58
+ return hexValue;
59
+ }
60
+ throw new Error(`${label} must be 16 bytes for aes-128-cbc (got ${utf8Value.length})`);
61
+ }
62
+ getOrCreateCachedConnection(connectionString) {
63
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
64
+ const existing = MultiTenantRepository.connections.get(connectionString);
65
+ if (existing && existing.connection.readyState === 1) {
66
+ return existing;
67
+ }
68
+ this.context.info(`Initializing database connection... ${connectionString}`);
69
+ const instance = new mongoose_1.default.Mongoose();
70
+ try {
71
+ yield instance.connect(connectionString, {
72
+ serverSelectionTimeoutMS: 10000,
73
+ connectTimeoutMS: 10000,
74
+ socketTimeoutMS: 45000,
75
+ });
76
+ this.context.info(`✅ MongoDB connected successfully ${connectionString}`);
77
+ MultiTenantRepository.connections.set(connectionString, instance);
78
+ return instance;
79
+ }
80
+ catch (err) {
81
+ this.context.error(`❌ MongoDB connection error for ${connectionString}`, {
82
+ message: err.message,
83
+ name: err.name,
84
+ code: err.code,
85
+ stack: err.stack,
86
+ });
87
+ throw new Error(`Failed to connect to MongoDB: ${err.message}`);
88
+ }
89
+ });
90
+ }
91
+ toObjectId(id, fieldName) {
92
+ if (!mongoose_1.Types.ObjectId.isValid(id)) {
93
+ throw new Error(`Invalid ${fieldName}`);
94
+ }
95
+ return new mongoose_1.Types.ObjectId(id);
96
+ }
97
+ getTenantBridgeSrvDbConnectionString() {
98
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
99
+ const envKey = this.tenantBridgeConfig.tenantBridgeEnvKey;
100
+ const localUri = (envKey ? process.env[envKey] : undefined);
101
+ if (localUri) {
102
+ return localUri;
103
+ }
104
+ const vault = process.env.AZURE_KEY_VAULT_NAME || "";
105
+ const secretKey = this.tenantBridgeConfig.tenantBridgeSecretKey ||
106
+ enums_1.AzureSecretKeysEnum.DB_CONNECTING_STRING_TENANT_BRIDGE;
107
+ const dbUrl = yield (0, secrets_1.getAzureVaultSecretByKey)(this.context, vault, secretKey);
108
+ if (!dbUrl) {
109
+ throw new Error("TenantBridge database connection string not found");
110
+ }
111
+ return dbUrl;
112
+ });
113
+ }
114
+ getDbConnectionEncryptionKey() {
115
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
116
+ var _a;
117
+ if (this.dbConnectionEncryptionKey) {
118
+ return this.dbConnectionEncryptionKey;
119
+ }
120
+ const envKey = process.env.DB_CONNECTION_STRING_ENCRYPTION_KEY;
121
+ if (envKey) {
122
+ this.dbConnectionEncryptionKey = envKey;
123
+ return envKey;
124
+ }
125
+ const vault = process.env.AZURE_KEY_VAULT_NAME || "";
126
+ if (!vault) {
127
+ throw new Error("AZURE_KEY_VAULT_NAME is required to fetch encryption key");
128
+ }
129
+ const vaultUrl = `https://${vault}.vault.azure.net`;
130
+ const credential = new identity_1.DefaultAzureCredential();
131
+ const client = new keyvault_secrets_1.SecretClient(vaultUrl, credential);
132
+ const secret = yield client.getSecret("DB-CONNECTION-STRING-ENCRYPTION-KEY");
133
+ const key = (_a = secret.value) !== null && _a !== void 0 ? _a : "";
134
+ if (!key) {
135
+ throw new Error("DB connection string encryption key not found");
136
+ }
137
+ this.dbConnectionEncryptionKey = key;
138
+ return key;
139
+ });
140
+ }
141
+ decryptConnectionString(encryptedValue) {
142
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
143
+ const key = yield this.getDbConnectionEncryptionKey();
144
+ const keyBuffer = this.normalizeEncryptionKey(key);
145
+ const ivBuffer = this.getEncryptionIv();
146
+ const decipher = crypto.createDecipheriv("aes-128-cbc", keyBuffer, ivBuffer);
147
+ let decrypted = decipher.update(encryptedValue, "base64", "utf8");
148
+ decrypted += decipher.final("utf8");
149
+ return decrypted;
150
+ });
151
+ }
152
+ normalizeEncryptionKey(key) {
153
+ const utf8Key = Buffer.from(key, "utf8");
154
+ if (utf8Key.length === 16) {
155
+ return utf8Key;
156
+ }
157
+ const base64Key = Buffer.from(key, "base64");
158
+ if (base64Key.length === 16) {
159
+ return base64Key;
160
+ }
161
+ const hexKey = Buffer.from(key, "hex");
162
+ if (hexKey.length === 16) {
163
+ return hexKey;
164
+ }
165
+ throw new Error(`DB connection string encryption key must be 16 bytes for aes-128-cbc (got ${utf8Key.length})`);
166
+ }
167
+ getClientDbConnectionString(businessId, appId, serviceDBType) {
168
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
169
+ const resolvedServiceDbType = serviceDBType !== null && serviceDBType !== void 0 ? serviceDBType : "main";
170
+ const tenantBridgeUrl = yield this.getTenantBridgeSrvDbConnectionString();
171
+ const connection = yield this.getOrCreateCachedConnection(tenantBridgeUrl);
172
+ const ConfigMapping = this.getModel(connection, config_mapping_model_1.CONFIG_MAPPING_DOCUMENT_NAME, config_mapping_model_1.ConfigMappingModel.schema, config_mapping_model_1.CONFIG_MAPPING_COLLECTION_NAME);
173
+ const filter = {
174
+ businessId: this.toObjectId(businessId, "businessId"),
175
+ };
176
+ if (appId) {
177
+ filter.appId = appId;
178
+ }
179
+ filter.serviceDBType = resolvedServiceDbType;
180
+ const configMapping = (yield ConfigMapping.findOne(filter).lean().exec());
181
+ if (!(configMapping === null || configMapping === void 0 ? void 0 : configMapping.connectionString)) {
182
+ throw new Error("Config mapping not found for this business");
183
+ }
184
+ const decryptedConnectionString = yield this.decryptConnectionString(configMapping.connectionString);
185
+ this.context.info(`Resolved tenant DB connection string from bridge: ${decryptedConnectionString}`);
186
+ return decryptedConnectionString;
187
+ });
188
+ }
189
+ getConnection() {
190
+ if (!this.clientConnectionString)
191
+ return undefined;
192
+ return MultiTenantRepository.connections.get(this.clientConnectionString);
193
+ }
194
+ ensureClientConnection() {
195
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
196
+ if (this.connectionPromise) {
197
+ return this.connectionPromise;
198
+ }
199
+ if (this.clientConnectionString) {
200
+ const existing = this.getConnection();
201
+ if (existing && existing.connection.readyState === 1) {
202
+ return existing;
203
+ }
204
+ }
205
+ const clientDbUrl = yield this.getClientDbConnectionString(this.businessId, this.appId, this.serviceDBType);
206
+ this.clientConnectionString = clientDbUrl;
207
+ this.connectionPromise = this.getOrCreateCachedConnection(clientDbUrl);
208
+ return this.connectionPromise;
209
+ });
210
+ }
211
+ disconnectByConnectionString(connectionString) {
212
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
213
+ const existing = MultiTenantRepository.connections.get(connectionString);
214
+ if (!existing)
215
+ return;
216
+ try {
217
+ yield existing.disconnect();
218
+ this.context.info(`✅ Disconnected from database: ${connectionString}`);
219
+ }
220
+ catch (error) {
221
+ this.context.error(`❌ Error disconnecting from database: ${connectionString}`, error);
222
+ }
223
+ finally {
224
+ MultiTenantRepository.connections.delete(connectionString);
225
+ }
226
+ });
227
+ }
228
+ disconnectClient() {
229
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
230
+ const clientDbUrl = yield this.getClientDbConnectionString(this.businessId, this.appId);
231
+ yield this.disconnectByConnectionString(clientDbUrl);
232
+ this.clientConnectionString = undefined;
233
+ this.connectionPromise = undefined;
234
+ });
235
+ }
236
+ getTenantModel(modelName, schema, collectionName) {
237
+ const connection = this.getConnection();
238
+ if (!connection) {
239
+ throw new Error("database connection not established");
240
+ }
241
+ return this.getModel(connection, modelName, schema, collectionName);
242
+ }
243
+ model(model, collectionName) {
244
+ return this.getTenantModel(model.modelName, model.schema, collectionName);
245
+ }
246
+ getModel(connection, modelName, schema, collectionName) {
247
+ if (connection.models[modelName]) {
248
+ return connection.models[modelName];
249
+ }
250
+ return connection.model(modelName, schema, collectionName);
251
+ }
252
+ }
253
+ exports.MultiTenantRepository = MultiTenantRepository;
254
+ MultiTenantRepository.connections = new Map();
255
+ tslib_1.__decorate([
256
+ (0, cache_1.Cacheable)({
257
+ cache: tenantBridgeCache,
258
+ key: () => ["tenant-bridge"],
259
+ getContext: (instance) => instance.context,
260
+ }),
261
+ tslib_1.__metadata("design:type", Function),
262
+ tslib_1.__metadata("design:paramtypes", []),
263
+ tslib_1.__metadata("design:returntype", Promise)
264
+ ], MultiTenantRepository.prototype, "getTenantBridgeSrvDbConnectionString", null);
265
+ tslib_1.__decorate([
266
+ (0, cache_1.Cacheable)({
267
+ cache: encryptionKeyCache,
268
+ key: () => ["key"],
269
+ getContext: (instance) => instance.context,
270
+ }),
271
+ tslib_1.__metadata("design:type", Function),
272
+ tslib_1.__metadata("design:paramtypes", []),
273
+ tslib_1.__metadata("design:returntype", Promise)
274
+ ], MultiTenantRepository.prototype, "getDbConnectionEncryptionKey", null);
275
+ tslib_1.__decorate([
276
+ (0, cache_1.Cacheable)({
277
+ cache: tenantDbCache,
278
+ key: (businessId, appId, serviceDbType) => [
279
+ businessId,
280
+ appId,
281
+ serviceDbType,
282
+ ],
283
+ getContext: (instance) => instance.context,
284
+ }),
285
+ tslib_1.__metadata("design:type", Function),
286
+ tslib_1.__metadata("design:paramtypes", [String, String, String]),
287
+ tslib_1.__metadata("design:returntype", Promise)
288
+ ], MultiTenantRepository.prototype, "getClientDbConnectionString", null);
289
+ class TenantModelRepository extends MultiTenantRepository {
290
+ get dbModel() {
291
+ return this.model(this.modelDef);
292
+ }
293
+ }
294
+ exports.TenantModelRepository = TenantModelRepository;
295
+ //# sourceMappingURL=multi-tenant.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-tenant.repository.js","sourceRoot":"","sources":["../../../src/repositories/multi-tenant.repository.ts"],"names":[],"mappings":";;;AA6BA,oCAcC;;AA3CD,6DAA0D;AAC1D,uDAAiC;AAEjC,8CAAyD;AACzD,8DAAuD;AACvD,oCAA+C;AAC/C,0CAAwD;AACxD,8CAA4D;AAC5D,yEAKwC;AASxC,MAAM,aAAa,GAAG,IAAA,mBAAW,EAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AACpD,MAAM,iBAAiB,GAAG,IAAA,mBAAW,EAAC,oCAAoC,EAAE,IAAI,CAAC,CAAC;AAClF,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAE3D;;GAEG;AACH,SAAgB,YAAY,CAC1B,OAAY,EACZ,YAA6B,EAC7B,UAAqE;IAErE,IAAI,CAAC,UAAU,CAAC,KAAK;QAAE,OAAO;IAC9B,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;IACxC,UAAU,CAAC,KAAK,GAAG,UAEjB,GAAG,IAAW;;YAEd,MAAM,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACpC,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC;KAAA,CAAC;AACJ,CAAC;AAED,MAAa,qBAAqB;IAWhC,YACE,OAA0B,EAC1B,UAAkB,EAClB,KAAc,EACd,MAA2B,EAC3B,aAAsB;QAEtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,MAAM,CAAC;QAC7C,IAAI,CAAC,kBAAkB,mBACrB,kBAAkB,EAAE,sBAAsB,EAC1C,qBAAqB,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D,OAAO,UAAU,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;IAC7D,CAAC;;AAvUH,sDAwUC;AAvUgB,iCAAW,GAAkB,IAAI,GAAG,EAAE,CAAC;AA0GhD;IANL,IAAA,iBAAS,EAAC;QACT,KAAK,EAAE,iBAAiB;QACxB,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC;QAC5B,UAAU,EAAE,CAAC,QAAiB,EAAE,EAAE,CAC/B,QAAkC,CAAC,OAAO;KAC9C,CAAC;;;;iFAwBD;AAQa;IANb,IAAA,iBAAS,EAAC;QACT,KAAK,EAAE,kBAAkB;QACzB,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC;QAClB,UAAU,EAAE,CAAC,QAAiB,EAAE,EAAE,CAC/B,QAAkC,CAAC,OAAO;KAC9C,CAAC;;;;yEA0BD;AA4CK;IAVL,IAAA,iBAAS,EAAC;QACT,KAAK,EAAE,aAAa;QACpB,GAAG,EAAE,CAAC,UAAkB,EAAE,KAAc,EAAE,aAAsB,EAAE,EAAE,CAAC;YACnE,UAAU;YACV,KAAK;YACL,aAAa;SACd;QACD,UAAU,EAAE,CAAC,QAAiB,EAAE,EAAE,CAC/B,QAAkC,CAAC,OAAO;KAC9C,CAAC;;;;wEAuCD;AAqFH,MAAsB,qBAAyB,SAAQ,qBAAqB;IAG1E,IAAc,OAAO;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;CACF;AAND,sDAMC"}
@@ -0,0 +1,17 @@
1
+ import { FilterQuery, Model, PipelineStage, ProjectionType, QueryOptions, UpdateQuery } from "mongoose";
2
+ import { TenantModelRepository } from "./multi-tenant.repository";
3
+ export declare abstract class TenantBaseRepository<T> extends TenantModelRepository<T> {
4
+ protected abstract readonly modelDef: Model<T>;
5
+ aggregate(pipeline: PipelineStage[]): Promise<any[]>;
6
+ create(body: T): Promise<T>;
7
+ createMany(body: T[]): Promise<T[]>;
8
+ count(query?: FilterQuery<T>): Promise<number>;
9
+ findById(id: string, projection?: ProjectionType<T>, options?: QueryOptions<T>): Promise<T | null>;
10
+ findOne(query: FilterQuery<T>, projection?: ProjectionType<T>, options?: QueryOptions<T>): Promise<T | null>;
11
+ find(query?: FilterQuery<T>, projection?: ProjectionType<T>, options?: QueryOptions<T>): Promise<T[]>;
12
+ updateById(id: string, body: UpdateQuery<T>, options?: any): Promise<T | null>;
13
+ updateOne(query: FilterQuery<T>, body: UpdateQuery<T>, options?: any): Promise<any>;
14
+ updateMany(query: FilterQuery<T>, body: UpdateQuery<T>, options?: any): Promise<any>;
15
+ deleteById(id: string): Promise<T | null>;
16
+ deleteMany(query?: FilterQuery<T>): Promise<any>;
17
+ }
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TenantBaseRepository = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const multi_tenant_repository_1 = require("./multi-tenant.repository");
6
+ class TenantBaseRepository extends multi_tenant_repository_1.TenantModelRepository {
7
+ aggregate(pipeline) {
8
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
+ return this.dbModel.aggregate(pipeline).exec();
10
+ });
11
+ }
12
+ create(body) {
13
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
+ return this.dbModel.create(body);
15
+ });
16
+ }
17
+ createMany(body) {
18
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
+ return this.dbModel.insertMany(body);
20
+ });
21
+ }
22
+ count() {
23
+ return tslib_1.__awaiter(this, arguments, void 0, function* (query = {}) {
24
+ return this.dbModel.countDocuments(query).exec();
25
+ });
26
+ }
27
+ findById(id_1) {
28
+ return tslib_1.__awaiter(this, arguments, void 0, function* (id, projection = {}, options = {}) {
29
+ return this.dbModel.findById(id, projection, options).exec();
30
+ });
31
+ }
32
+ findOne(query_1) {
33
+ return tslib_1.__awaiter(this, arguments, void 0, function* (query, projection = {}, options = {}) {
34
+ return this.dbModel.findOne(query, projection, options).exec();
35
+ });
36
+ }
37
+ find() {
38
+ return tslib_1.__awaiter(this, arguments, void 0, function* (query = {}, projection = {}, options = {}) {
39
+ return this.dbModel.find(query, projection, options).exec();
40
+ });
41
+ }
42
+ updateById(id_1, body_1) {
43
+ return tslib_1.__awaiter(this, arguments, void 0, function* (id, body, options = { new: true }) {
44
+ return this.dbModel.findByIdAndUpdate(id, body, options).exec();
45
+ });
46
+ }
47
+ updateOne(query_1, body_1) {
48
+ return tslib_1.__awaiter(this, arguments, void 0, function* (query, body, options = {}) {
49
+ return this.dbModel.updateOne(query, body, options).exec();
50
+ });
51
+ }
52
+ updateMany(query_1, body_1) {
53
+ return tslib_1.__awaiter(this, arguments, void 0, function* (query, body, options = {}) {
54
+ return this.dbModel.updateMany(query, body, options).exec();
55
+ });
56
+ }
57
+ deleteById(id) {
58
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
+ return this.dbModel.findByIdAndDelete(id).exec();
60
+ });
61
+ }
62
+ deleteMany() {
63
+ return tslib_1.__awaiter(this, arguments, void 0, function* (query = {}) {
64
+ return this.dbModel.deleteMany(query).exec();
65
+ });
66
+ }
67
+ }
68
+ exports.TenantBaseRepository = TenantBaseRepository;
69
+ tslib_1.__decorate([
70
+ multi_tenant_repository_1.WithTenantDb,
71
+ tslib_1.__metadata("design:type", Function),
72
+ tslib_1.__metadata("design:paramtypes", [Array]),
73
+ tslib_1.__metadata("design:returntype", Promise)
74
+ ], TenantBaseRepository.prototype, "aggregate", null);
75
+ tslib_1.__decorate([
76
+ multi_tenant_repository_1.WithTenantDb,
77
+ tslib_1.__metadata("design:type", Function),
78
+ tslib_1.__metadata("design:paramtypes", [Object]),
79
+ tslib_1.__metadata("design:returntype", Promise)
80
+ ], TenantBaseRepository.prototype, "create", null);
81
+ tslib_1.__decorate([
82
+ multi_tenant_repository_1.WithTenantDb,
83
+ tslib_1.__metadata("design:type", Function),
84
+ tslib_1.__metadata("design:paramtypes", [Array]),
85
+ tslib_1.__metadata("design:returntype", Promise)
86
+ ], TenantBaseRepository.prototype, "createMany", null);
87
+ tslib_1.__decorate([
88
+ multi_tenant_repository_1.WithTenantDb,
89
+ tslib_1.__metadata("design:type", Function),
90
+ tslib_1.__metadata("design:paramtypes", [Object]),
91
+ tslib_1.__metadata("design:returntype", Promise)
92
+ ], TenantBaseRepository.prototype, "count", null);
93
+ tslib_1.__decorate([
94
+ multi_tenant_repository_1.WithTenantDb,
95
+ tslib_1.__metadata("design:type", Function),
96
+ tslib_1.__metadata("design:paramtypes", [String, Object, Object]),
97
+ tslib_1.__metadata("design:returntype", Promise)
98
+ ], TenantBaseRepository.prototype, "findById", null);
99
+ tslib_1.__decorate([
100
+ multi_tenant_repository_1.WithTenantDb,
101
+ tslib_1.__metadata("design:type", Function),
102
+ tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
103
+ tslib_1.__metadata("design:returntype", Promise)
104
+ ], TenantBaseRepository.prototype, "findOne", null);
105
+ tslib_1.__decorate([
106
+ multi_tenant_repository_1.WithTenantDb,
107
+ tslib_1.__metadata("design:type", Function),
108
+ tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
109
+ tslib_1.__metadata("design:returntype", Promise)
110
+ ], TenantBaseRepository.prototype, "find", null);
111
+ tslib_1.__decorate([
112
+ multi_tenant_repository_1.WithTenantDb,
113
+ tslib_1.__metadata("design:type", Function),
114
+ tslib_1.__metadata("design:paramtypes", [String, Object, Object]),
115
+ tslib_1.__metadata("design:returntype", Promise)
116
+ ], TenantBaseRepository.prototype, "updateById", null);
117
+ tslib_1.__decorate([
118
+ multi_tenant_repository_1.WithTenantDb,
119
+ tslib_1.__metadata("design:type", Function),
120
+ tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
121
+ tslib_1.__metadata("design:returntype", Promise)
122
+ ], TenantBaseRepository.prototype, "updateOne", null);
123
+ tslib_1.__decorate([
124
+ multi_tenant_repository_1.WithTenantDb,
125
+ tslib_1.__metadata("design:type", Function),
126
+ tslib_1.__metadata("design:paramtypes", [Object, Object, Object]),
127
+ tslib_1.__metadata("design:returntype", Promise)
128
+ ], TenantBaseRepository.prototype, "updateMany", null);
129
+ tslib_1.__decorate([
130
+ multi_tenant_repository_1.WithTenantDb,
131
+ tslib_1.__metadata("design:type", Function),
132
+ tslib_1.__metadata("design:paramtypes", [String]),
133
+ tslib_1.__metadata("design:returntype", Promise)
134
+ ], TenantBaseRepository.prototype, "deleteById", null);
135
+ tslib_1.__decorate([
136
+ multi_tenant_repository_1.WithTenantDb,
137
+ tslib_1.__metadata("design:type", Function),
138
+ tslib_1.__metadata("design:paramtypes", [Object]),
139
+ tslib_1.__metadata("design:returntype", Promise)
140
+ ], TenantBaseRepository.prototype, "deleteMany", null);
141
+ //# sourceMappingURL=tenant-base.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenant-base.repository.js","sourceRoot":"","sources":["../../../src/repositories/tenant-base.repository.ts"],"names":[],"mappings":";;;;AAQA,uEAAgF;AAEhF,MAAsB,oBAAwB,SAAQ,+CAAwB;IAItE,SAAS,CACb,QAAyB;;YAEzB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,CAAC;KAAA;IAGK,MAAM,CAAC,IAAO;;YAClB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;KAAA;IAGK,UAAU,CAAC,IAAS;;YACxB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;KAAA;IAGK,KAAK;qEAAC,QAAwB,EAAE;YACpC,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QACnD,CAAC;KAAA;IAGK,QAAQ;qEACZ,EAAU,EACV,aAAgC,EAAE,EAClC,UAA2B,EAAE;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AGK,UAAU;qEAAC,QAAwB,EAAE;YACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/C,CAAC;KAAA;CACF;AA1FD,oDA0FC;AAtFO;IADL,sCAAY;;;;qDAKZ;AAGK;IADL,sCAAY;;;;kDAGZ;AAGK;IADL,sCAAY;;;;sDAGZ;AAGK;IADL,sCAAY;;;;iDAGZ;AAGK;IADL,sCAAY;;;;oDAOZ;AAGK;IADL,sCAAY;;;;mDAOZ;AAGK;IADL,sCAAY;;;;gDAOZ;AAGK;IADL,sCAAY;;;;sDASZ;AAGK;IADL,sCAAY;;;;qDAOZ;AAGK;IADL,sCAAY;;;;sDAOZ;AAGK;IADL,sCAAY;;;;sDAGZ;AAGK;IADL,sCAAY;;;;sDAGZ"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@culturefy/shared",
3
3
  "description": "Shared utilities for culturefy serverless services",
4
- "version": "1.0.56",
4
+ "version": "1.0.58",
5
5
  "main": "build/cjs/index.js",
6
6
  "module": "build/esm/index.js",
7
7
  "types": "build/src/index.d.ts",