@okf/ootils 1.3.0 → 1.3.2

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/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Connection, Document, Schema, Model } from 'mongoose';
2
+ import IORedis from 'ioredis';
2
3
 
3
4
  declare function add(a: number, b: number): number;
4
5
 
@@ -163,5 +164,6 @@ declare const getTpl: ({ name, tenant }: GetTplParams) => Promise<Template>;
163
164
  declare const getAIConfigs: ({ tenant }: GetAIConfigsParams) => Promise<AIconfig>;
164
165
 
165
166
  declare const connectToRedis: () => Promise<void>;
167
+ declare const getRedisClient: () => IORedis;
166
168
 
167
- export { add, connectToRedis, deleteVal, getAIConfigs, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getTpl, getTplModelByTenant, getVal, initializeGlobalConfig, multiConnectToMongoDB, setVal, updateGlobalConfig };
169
+ export { add, connectToRedis, deleteVal, getAIConfigs, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getRedisClient, getTpl, getTplModelByTenant, getVal, initializeGlobalConfig, multiConnectToMongoDB, setVal, updateGlobalConfig };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Connection, Document, Schema, Model } from 'mongoose';
2
+ import IORedis from 'ioredis';
2
3
 
3
4
  declare function add(a: number, b: number): number;
4
5
 
@@ -163,5 +164,6 @@ declare const getTpl: ({ name, tenant }: GetTplParams) => Promise<Template>;
163
164
  declare const getAIConfigs: ({ tenant }: GetAIConfigsParams) => Promise<AIconfig>;
164
165
 
165
166
  declare const connectToRedis: () => Promise<void>;
167
+ declare const getRedisClient: () => IORedis;
166
168
 
167
- export { add, connectToRedis, deleteVal, getAIConfigs, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getTpl, getTplModelByTenant, getVal, initializeGlobalConfig, multiConnectToMongoDB, setVal, updateGlobalConfig };
169
+ export { add, connectToRedis, deleteVal, getAIConfigs, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getRedisClient, getTpl, getTplModelByTenant, getVal, initializeGlobalConfig, multiConnectToMongoDB, setVal, updateGlobalConfig };
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ var require_Annotations = __commonJS({
41
41
  // Tags section - dynamic structure for various tag categories
42
42
  tags: {
43
43
  type: Map,
44
- of: {
44
+ of: new Schema({
45
45
  data: [
46
46
  {
47
47
  _id: { type: Schema.Types.ObjectId },
@@ -49,8 +49,9 @@ var require_Annotations = __commonJS({
49
49
  tagId: String
50
50
  }
51
51
  ],
52
- collectionId: String
53
- }
52
+ collectionId: String,
53
+ _id: false
54
+ })
54
55
  },
55
56
  // Meta information
56
57
  meta: {
@@ -73,7 +74,8 @@ var require_Annotations = __commonJS({
73
74
  annotations: {
74
75
  tags: {
75
76
  type: Map,
76
- of: {
77
+ _id: false,
78
+ of: new Schema({
77
79
  collectionId: String,
78
80
  data: [
79
81
  {
@@ -82,7 +84,7 @@ var require_Annotations = __commonJS({
82
84
  tagId: String
83
85
  }
84
86
  ]
85
- }
87
+ })
86
88
  },
87
89
  fragment: {
88
90
  isLexical: Boolean,
@@ -323,6 +325,7 @@ __export(index_exports, {
323
325
  getDbByTenant: () => getDbByTenant,
324
326
  getModelByTenant: () => getModelByTenant,
325
327
  getPlatformConfigsModelByTenant: () => getPlatformConfigsModelByTenant,
328
+ getRedisClient: () => getRedisClient,
326
329
  getTpl: () => getTpl,
327
330
  getTplModelByTenant: () => getTplModelByTenant,
328
331
  getVal: () => getVal,
@@ -373,7 +376,7 @@ var updateGlobalConfig = (updates) => {
373
376
  var mongoOptions = {
374
377
  // Note: These legacy options are no longer needed in newer versions of mongoose
375
378
  // useUnifiedTopology, useNewUrlParser, useCreateIndex, useFindAndModify are deprecated
376
- maxPoolSize: 10
379
+ maxPoolSize: 20
377
380
  // replaces poolSize
378
381
  };
379
382
  var multiConnectToMongoDB = ({ env, dbConfigs } = {}) => {
@@ -721,6 +724,7 @@ var getAIConfigs = async ({
721
724
  getDbByTenant,
722
725
  getModelByTenant,
723
726
  getPlatformConfigsModelByTenant,
727
+ getRedisClient,
724
728
  getTpl,
725
729
  getTplModelByTenant,
726
730
  getVal,
package/dist/index.mjs CHANGED
@@ -20,7 +20,7 @@ var require_Annotations = __commonJS({
20
20
  // Tags section - dynamic structure for various tag categories
21
21
  tags: {
22
22
  type: Map,
23
- of: {
23
+ of: new Schema({
24
24
  data: [
25
25
  {
26
26
  _id: { type: Schema.Types.ObjectId },
@@ -28,8 +28,9 @@ var require_Annotations = __commonJS({
28
28
  tagId: String
29
29
  }
30
30
  ],
31
- collectionId: String
32
- }
31
+ collectionId: String,
32
+ _id: false
33
+ })
33
34
  },
34
35
  // Meta information
35
36
  meta: {
@@ -52,7 +53,8 @@ var require_Annotations = __commonJS({
52
53
  annotations: {
53
54
  tags: {
54
55
  type: Map,
55
- of: {
56
+ _id: false,
57
+ of: new Schema({
56
58
  collectionId: String,
57
59
  data: [
58
60
  {
@@ -61,7 +63,7 @@ var require_Annotations = __commonJS({
61
63
  tagId: String
62
64
  }
63
65
  ]
64
- }
66
+ })
65
67
  },
66
68
  fragment: {
67
69
  isLexical: Boolean,
@@ -331,7 +333,7 @@ var updateGlobalConfig = (updates) => {
331
333
  var mongoOptions = {
332
334
  // Note: These legacy options are no longer needed in newer versions of mongoose
333
335
  // useUnifiedTopology, useNewUrlParser, useCreateIndex, useFindAndModify are deprecated
334
- maxPoolSize: 10
336
+ maxPoolSize: 20
335
337
  // replaces poolSize
336
338
  };
337
339
  var multiConnectToMongoDB = ({ env, dbConfigs } = {}) => {
@@ -678,6 +680,7 @@ export {
678
680
  getDbByTenant,
679
681
  getModelByTenant,
680
682
  getPlatformConfigsModelByTenant,
683
+ getRedisClient,
681
684
  getTpl,
682
685
  getTplModelByTenant,
683
686
  getVal,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.3.0",
6
+ "version": "1.3.2",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",