@candlerip/shared3 0.0.146 → 0.0.147

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candlerip/shared3",
3
- "version": "0.0.146",
3
+ "version": "0.0.147",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.js",
@@ -1,3 +1,4 @@
1
1
  export * from './aggregate/index.js';
2
2
  export * from './connect-database/index.js';
3
+ export * from './model/index.js';
3
4
  export * from './mutation/index.js';
@@ -1,3 +1,4 @@
1
1
  export * from './aggregate/index.js';
2
2
  export * from './connect-database/index.js';
3
+ export * from './model/index.js';
3
4
  export * from './mutation/index.js';
@@ -0,0 +1,2 @@
1
+ import * as mongoose from 'mongoose';
2
+ export declare const getCandleDbModel: () => mongoose.Model<any, {}, {}, {}, any, any>;
@@ -0,0 +1,3 @@
1
+ import * as mongoose from 'mongoose';
2
+ import { CandleDbSchema } from './candle-db-schema.js';
3
+ export const getCandleDbModel = () => mongoose.models?.candles || mongoose.model('candles', CandleDbSchema);
@@ -1,2 +1,2 @@
1
- export * from './candle-db-model.js';
1
+ export * from './get-candle-db-model.js';
2
2
  export * from './candle-db-schema.js';
@@ -1,2 +1,2 @@
1
- export * from './candle-db-model.js';
1
+ export * from './get-candle-db-model.js';
2
2
  export * from './candle-db-schema.js';
@@ -0,0 +1,3 @@
1
+ export * from './candle/index.js';
2
+ export * from './error-log/index.js';
3
+ export * from './translation/index.js';
@@ -0,0 +1,3 @@
1
+ export * from './candle/index.js';
2
+ export * from './error-log/index.js';
3
+ export * from './translation/index.js';
@@ -1,7 +1,7 @@
1
1
  import { Types } from 'mongoose';
2
2
  import { customErrorWorker } from '@candlerip/shared3';
3
3
  import { CANDLE_PERSON_AGGREGATE } from '../../../aggregate/index.js';
4
- import { CandleDbModel } from '../../../model/candle/index.js';
4
+ import { getCandleDbModel } from '../../../model/index.js';
5
5
  export const getCandles = async (props) => {
6
6
  const { filterSort, withPerson } = props;
7
7
  const { composeCustomError } = customErrorWorker(props);
@@ -78,7 +78,7 @@ export const getCandles = async (props) => {
78
78
  ];
79
79
  let data;
80
80
  try {
81
- data = await CandleDbModel.aggregate(facetAggregates);
81
+ data = await getCandleDbModel().aggregate(facetAggregates);
82
82
  }
83
83
  catch (err) {
84
84
  return {
@@ -1,2 +0,0 @@
1
- import * as mongoose from 'mongoose';
2
- export declare const CandleDbModel: mongoose.Model<any, {}, {}, {}, any, any>;
@@ -1,3 +0,0 @@
1
- import * as mongoose from 'mongoose';
2
- import { CandleDbSchema } from './candle-db-schema.js';
3
- export const CandleDbModel = mongoose.models?.candles || mongoose.model('candles', CandleDbSchema);