@okf/ootils 1.6.12 → 1.6.13

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.
@@ -481,4 +481,21 @@ declare namespace BASE_BULLMQ_CONFIG {
481
481
  }
482
482
  }
483
483
 
484
- export { BASE_BULLMQ_CONFIG, deleteVal, extractAllBlocksFromTpl, genTagId, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
484
+ interface PlatformContextContentItem {
485
+ markdownText?: string;
486
+ [key: string]: any;
487
+ }
488
+ interface PlatformContextObject {
489
+ content?: Record<string, PlatformContextContentItem>;
490
+ [key: string]: any;
491
+ }
492
+ interface PlatformConfigsAI {
493
+ platformContext?: string | PlatformContextObject;
494
+ [key: string]: any;
495
+ }
496
+ interface GetPlatformContextContentParams {
497
+ platformConfigs_ai: PlatformConfigsAI;
498
+ }
499
+ declare const getPlatformContextContent: ({ platformConfigs_ai, }: GetPlatformContextContentParams) => string;
500
+
501
+ export { BASE_BULLMQ_CONFIG, deleteVal, extractAllBlocksFromTpl, genTagId, getPlatformContextContent, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
package/dist/browser.d.ts CHANGED
@@ -481,4 +481,21 @@ declare namespace BASE_BULLMQ_CONFIG {
481
481
  }
482
482
  }
483
483
 
484
- export { BASE_BULLMQ_CONFIG, deleteVal, extractAllBlocksFromTpl, genTagId, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
484
+ interface PlatformContextContentItem {
485
+ markdownText?: string;
486
+ [key: string]: any;
487
+ }
488
+ interface PlatformContextObject {
489
+ content?: Record<string, PlatformContextContentItem>;
490
+ [key: string]: any;
491
+ }
492
+ interface PlatformConfigsAI {
493
+ platformContext?: string | PlatformContextObject;
494
+ [key: string]: any;
495
+ }
496
+ interface GetPlatformContextContentParams {
497
+ platformConfigs_ai: PlatformConfigsAI;
498
+ }
499
+ declare const getPlatformContextContent: ({ platformConfigs_ai, }: GetPlatformContextContentParams) => string;
500
+
501
+ export { BASE_BULLMQ_CONFIG, deleteVal, extractAllBlocksFromTpl, genTagId, getPlatformContextContent, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
package/dist/browser.js CHANGED
@@ -24,6 +24,7 @@ __export(browser_exports, {
24
24
  deleteVal: () => deleteVal,
25
25
  extractAllBlocksFromTpl: () => extractAllBlocksFromTpl,
26
26
  genTagId: () => genTagId,
27
+ getPlatformContextContent: () => getPlatformContextContent,
27
28
  getVal: () => getVal,
28
29
  recursivelyExtractBlocks: () => _recursExtractBlocks,
29
30
  setVal: () => setVal,
@@ -545,12 +546,37 @@ var BASE_BULLMQ_CONFIG = {
545
546
  }
546
547
  }
547
548
  };
549
+
550
+ // src/utils/getPlatformContextContent.ts
551
+ var labelsLookup = {
552
+ q1: "Platform & Organization Overview",
553
+ q2: "Data Sources & Materials",
554
+ q4: "Research Goals & Outcomes"
555
+ };
556
+ var getPlatformContextContent = ({
557
+ platformConfigs_ai
558
+ }) => {
559
+ if (typeof platformConfigs_ai.platformContext === "string") {
560
+ return platformConfigs_ai.platformContext;
561
+ }
562
+ if (platformConfigs_ai.platformContext && typeof platformConfigs_ai.platformContext === "object" && platformConfigs_ai.platformContext.content) {
563
+ const content = platformConfigs_ai.platformContext.content;
564
+ return Object.keys(content).map((key) => {
565
+ const v = content[key];
566
+ const label = labelsLookup[key];
567
+ return label ? `${label}
568
+ ${v?.markdownText || ""}` : v?.markdownText || "";
569
+ }).join("\n\n");
570
+ }
571
+ return "";
572
+ };
548
573
  // Annotate the CommonJS export names for ESM import in node:
549
574
  0 && (module.exports = {
550
575
  BASE_BULLMQ_CONFIG,
551
576
  deleteVal,
552
577
  extractAllBlocksFromTpl,
553
578
  genTagId,
579
+ getPlatformContextContent,
554
580
  getVal,
555
581
  recursivelyExtractBlocks,
556
582
  setVal,
package/dist/browser.mjs CHANGED
@@ -512,11 +512,36 @@ var BASE_BULLMQ_CONFIG = {
512
512
  }
513
513
  }
514
514
  };
515
+
516
+ // src/utils/getPlatformContextContent.ts
517
+ var labelsLookup = {
518
+ q1: "Platform & Organization Overview",
519
+ q2: "Data Sources & Materials",
520
+ q4: "Research Goals & Outcomes"
521
+ };
522
+ var getPlatformContextContent = ({
523
+ platformConfigs_ai
524
+ }) => {
525
+ if (typeof platformConfigs_ai.platformContext === "string") {
526
+ return platformConfigs_ai.platformContext;
527
+ }
528
+ if (platformConfigs_ai.platformContext && typeof platformConfigs_ai.platformContext === "object" && platformConfigs_ai.platformContext.content) {
529
+ const content = platformConfigs_ai.platformContext.content;
530
+ return Object.keys(content).map((key) => {
531
+ const v = content[key];
532
+ const label = labelsLookup[key];
533
+ return label ? `${label}
534
+ ${v?.markdownText || ""}` : v?.markdownText || "";
535
+ }).join("\n\n");
536
+ }
537
+ return "";
538
+ };
515
539
  export {
516
540
  BASE_BULLMQ_CONFIG,
517
541
  deleteVal,
518
542
  extractAllBlocksFromTpl,
519
543
  genTagId,
544
+ getPlatformContextContent,
520
545
  getVal,
521
546
  _recursExtractBlocks as recursivelyExtractBlocks,
522
547
  setVal,
package/dist/node.d.mts CHANGED
@@ -488,6 +488,23 @@ declare namespace BASE_BULLMQ_CONFIG {
488
488
  }
489
489
  }
490
490
 
491
+ interface PlatformContextContentItem {
492
+ markdownText?: string;
493
+ [key: string]: any;
494
+ }
495
+ interface PlatformContextObject {
496
+ content?: Record<string, PlatformContextContentItem>;
497
+ [key: string]: any;
498
+ }
499
+ interface PlatformConfigsAI {
500
+ platformContext?: string | PlatformContextObject;
501
+ [key: string]: any;
502
+ }
503
+ interface GetPlatformContextContentParams {
504
+ platformConfigs_ai: PlatformConfigsAI;
505
+ }
506
+ declare const getPlatformContextContent: ({ platformConfigs_ai, }: GetPlatformContextContentParams) => string;
507
+
491
508
  declare class MongoConnector {
492
509
  static getInstance(): any;
493
510
  static getClusterConnections(): any;
@@ -1013,4 +1030,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
1013
1030
  };
1014
1031
  }): Object;
1015
1032
 
1016
- export { AIChatSchema, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getTplModelByTenant, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
1033
+ export { AIChatSchema, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getTplModelByTenant, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
package/dist/node.d.ts CHANGED
@@ -488,6 +488,23 @@ declare namespace BASE_BULLMQ_CONFIG {
488
488
  }
489
489
  }
490
490
 
491
+ interface PlatformContextContentItem {
492
+ markdownText?: string;
493
+ [key: string]: any;
494
+ }
495
+ interface PlatformContextObject {
496
+ content?: Record<string, PlatformContextContentItem>;
497
+ [key: string]: any;
498
+ }
499
+ interface PlatformConfigsAI {
500
+ platformContext?: string | PlatformContextObject;
501
+ [key: string]: any;
502
+ }
503
+ interface GetPlatformContextContentParams {
504
+ platformConfigs_ai: PlatformConfigsAI;
505
+ }
506
+ declare const getPlatformContextContent: ({ platformConfigs_ai, }: GetPlatformContextContentParams) => string;
507
+
491
508
  declare class MongoConnector {
492
509
  static getInstance(): any;
493
510
  static getClusterConnections(): any;
@@ -1013,4 +1030,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
1013
1030
  };
1014
1031
  }): Object;
1015
1032
 
1016
- export { AIChatSchema, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getTplModelByTenant, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
1033
+ export { AIChatSchema, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, ElasticSearchConnector, GET_GLOBAL_BULLMQ_CONFIG, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, TplSchema, WorkerManager, deleteVal, extractAllBlocksFromTpl, genTagId, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getTplModelByTenant, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
package/dist/node.js CHANGED
@@ -1389,6 +1389,7 @@ __export(node_exports, {
1389
1389
  getDbByTenant: () => getDbByTenant,
1390
1390
  getModelByTenant: () => import_getModelByTenant2.getModelByTenant,
1391
1391
  getPlatformConfigsModelByTenant: () => import_getModelByTenant2.getPlatformConfigsModelByTenant,
1392
+ getPlatformContextContent: () => getPlatformContextContent,
1392
1393
  getTplModelByTenant: () => import_getModelByTenant2.getTplModelByTenant,
1393
1394
  getVal: () => getVal,
1394
1395
  recursivelyExtractBlocks: () => _recursExtractBlocks,
@@ -1675,6 +1676,30 @@ var _extractBlocksFromSomeBuilders = ({
1675
1676
  // src/universal.ts
1676
1677
  init_GLOBAL_BULLMQ_CONFIG();
1677
1678
 
1679
+ // src/utils/getPlatformContextContent.ts
1680
+ var labelsLookup = {
1681
+ q1: "Platform & Organization Overview",
1682
+ q2: "Data Sources & Materials",
1683
+ q4: "Research Goals & Outcomes"
1684
+ };
1685
+ var getPlatformContextContent = ({
1686
+ platformConfigs_ai
1687
+ }) => {
1688
+ if (typeof platformConfigs_ai.platformContext === "string") {
1689
+ return platformConfigs_ai.platformContext;
1690
+ }
1691
+ if (platformConfigs_ai.platformContext && typeof platformConfigs_ai.platformContext === "object" && platformConfigs_ai.platformContext.content) {
1692
+ const content = platformConfigs_ai.platformContext.content;
1693
+ return Object.keys(content).map((key) => {
1694
+ const v = content[key];
1695
+ const label = labelsLookup[key];
1696
+ return label ? `${label}
1697
+ ${v?.markdownText || ""}` : v?.markdownText || "";
1698
+ }).join("\n\n");
1699
+ }
1700
+ return "";
1701
+ };
1702
+
1678
1703
  // src/node.ts
1679
1704
  var import_MongoConnector2 = __toESM(require_MongoConnector());
1680
1705
  var import_ElasticSearchConnector = __toESM(require_ElasticSearchConnector());
@@ -2022,6 +2047,7 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
2022
2047
  getDbByTenant,
2023
2048
  getModelByTenant,
2024
2049
  getPlatformConfigsModelByTenant,
2050
+ getPlatformContextContent,
2025
2051
  getTplModelByTenant,
2026
2052
  getVal,
2027
2053
  recursivelyExtractBlocks,
package/dist/node.mjs CHANGED
@@ -1648,6 +1648,30 @@ var _extractBlocksFromSomeBuilders = ({
1648
1648
  // src/universal.ts
1649
1649
  init_GLOBAL_BULLMQ_CONFIG();
1650
1650
 
1651
+ // src/utils/getPlatformContextContent.ts
1652
+ var labelsLookup = {
1653
+ q1: "Platform & Organization Overview",
1654
+ q2: "Data Sources & Materials",
1655
+ q4: "Research Goals & Outcomes"
1656
+ };
1657
+ var getPlatformContextContent = ({
1658
+ platformConfigs_ai
1659
+ }) => {
1660
+ if (typeof platformConfigs_ai.platformContext === "string") {
1661
+ return platformConfigs_ai.platformContext;
1662
+ }
1663
+ if (platformConfigs_ai.platformContext && typeof platformConfigs_ai.platformContext === "object" && platformConfigs_ai.platformContext.content) {
1664
+ const content = platformConfigs_ai.platformContext.content;
1665
+ return Object.keys(content).map((key) => {
1666
+ const v = content[key];
1667
+ const label = labelsLookup[key];
1668
+ return label ? `${label}
1669
+ ${v?.markdownText || ""}` : v?.markdownText || "";
1670
+ }).join("\n\n");
1671
+ }
1672
+ return "";
1673
+ };
1674
+
1651
1675
  // src/node.ts
1652
1676
  var import_MongoConnector2 = __toESM(require_MongoConnector());
1653
1677
  var import_ElasticSearchConnector = __toESM(require_ElasticSearchConnector());
@@ -2006,6 +2030,7 @@ export {
2006
2030
  getDbByTenant,
2007
2031
  export_getModelByTenant as getModelByTenant,
2008
2032
  export_getPlatformConfigsModelByTenant as getPlatformConfigsModelByTenant,
2033
+ getPlatformContextContent,
2009
2034
  export_getTplModelByTenant as getTplModelByTenant,
2010
2035
  getVal,
2011
2036
  _recursExtractBlocks as recursivelyExtractBlocks,
@@ -481,4 +481,21 @@ declare namespace BASE_BULLMQ_CONFIG {
481
481
  }
482
482
  }
483
483
 
484
- export { BASE_BULLMQ_CONFIG, deleteVal, extractAllBlocksFromTpl, genTagId, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
484
+ interface PlatformContextContentItem {
485
+ markdownText?: string;
486
+ [key: string]: any;
487
+ }
488
+ interface PlatformContextObject {
489
+ content?: Record<string, PlatformContextContentItem>;
490
+ [key: string]: any;
491
+ }
492
+ interface PlatformConfigsAI {
493
+ platformContext?: string | PlatformContextObject;
494
+ [key: string]: any;
495
+ }
496
+ interface GetPlatformContextContentParams {
497
+ platformConfigs_ai: PlatformConfigsAI;
498
+ }
499
+ declare const getPlatformContextContent: ({ platformConfigs_ai, }: GetPlatformContextContentParams) => string;
500
+
501
+ export { BASE_BULLMQ_CONFIG, deleteVal, extractAllBlocksFromTpl, genTagId, getPlatformContextContent, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
@@ -481,4 +481,21 @@ declare namespace BASE_BULLMQ_CONFIG {
481
481
  }
482
482
  }
483
483
 
484
- export { BASE_BULLMQ_CONFIG, deleteVal, extractAllBlocksFromTpl, genTagId, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
484
+ interface PlatformContextContentItem {
485
+ markdownText?: string;
486
+ [key: string]: any;
487
+ }
488
+ interface PlatformContextObject {
489
+ content?: Record<string, PlatformContextContentItem>;
490
+ [key: string]: any;
491
+ }
492
+ interface PlatformConfigsAI {
493
+ platformContext?: string | PlatformContextObject;
494
+ [key: string]: any;
495
+ }
496
+ interface GetPlatformContextContentParams {
497
+ platformConfigs_ai: PlatformConfigsAI;
498
+ }
499
+ declare const getPlatformContextContent: ({ platformConfigs_ai, }: GetPlatformContextContentParams) => string;
500
+
501
+ export { BASE_BULLMQ_CONFIG, deleteVal, extractAllBlocksFromTpl, genTagId, getPlatformContextContent, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
package/dist/universal.js CHANGED
@@ -24,6 +24,7 @@ __export(universal_exports, {
24
24
  deleteVal: () => deleteVal,
25
25
  extractAllBlocksFromTpl: () => extractAllBlocksFromTpl,
26
26
  genTagId: () => genTagId,
27
+ getPlatformContextContent: () => getPlatformContextContent,
27
28
  getVal: () => getVal,
28
29
  recursivelyExtractBlocks: () => _recursExtractBlocks,
29
30
  setVal: () => setVal,
@@ -545,12 +546,37 @@ var BASE_BULLMQ_CONFIG = {
545
546
  }
546
547
  }
547
548
  };
549
+
550
+ // src/utils/getPlatformContextContent.ts
551
+ var labelsLookup = {
552
+ q1: "Platform & Organization Overview",
553
+ q2: "Data Sources & Materials",
554
+ q4: "Research Goals & Outcomes"
555
+ };
556
+ var getPlatformContextContent = ({
557
+ platformConfigs_ai
558
+ }) => {
559
+ if (typeof platformConfigs_ai.platformContext === "string") {
560
+ return platformConfigs_ai.platformContext;
561
+ }
562
+ if (platformConfigs_ai.platformContext && typeof platformConfigs_ai.platformContext === "object" && platformConfigs_ai.platformContext.content) {
563
+ const content = platformConfigs_ai.platformContext.content;
564
+ return Object.keys(content).map((key) => {
565
+ const v = content[key];
566
+ const label = labelsLookup[key];
567
+ return label ? `${label}
568
+ ${v?.markdownText || ""}` : v?.markdownText || "";
569
+ }).join("\n\n");
570
+ }
571
+ return "";
572
+ };
548
573
  // Annotate the CommonJS export names for ESM import in node:
549
574
  0 && (module.exports = {
550
575
  BASE_BULLMQ_CONFIG,
551
576
  deleteVal,
552
577
  extractAllBlocksFromTpl,
553
578
  genTagId,
579
+ getPlatformContextContent,
554
580
  getVal,
555
581
  recursivelyExtractBlocks,
556
582
  setVal,
@@ -512,11 +512,36 @@ var BASE_BULLMQ_CONFIG = {
512
512
  }
513
513
  }
514
514
  };
515
+
516
+ // src/utils/getPlatformContextContent.ts
517
+ var labelsLookup = {
518
+ q1: "Platform & Organization Overview",
519
+ q2: "Data Sources & Materials",
520
+ q4: "Research Goals & Outcomes"
521
+ };
522
+ var getPlatformContextContent = ({
523
+ platformConfigs_ai
524
+ }) => {
525
+ if (typeof platformConfigs_ai.platformContext === "string") {
526
+ return platformConfigs_ai.platformContext;
527
+ }
528
+ if (platformConfigs_ai.platformContext && typeof platformConfigs_ai.platformContext === "object" && platformConfigs_ai.platformContext.content) {
529
+ const content = platformConfigs_ai.platformContext.content;
530
+ return Object.keys(content).map((key) => {
531
+ const v = content[key];
532
+ const label = labelsLookup[key];
533
+ return label ? `${label}
534
+ ${v?.markdownText || ""}` : v?.markdownText || "";
535
+ }).join("\n\n");
536
+ }
537
+ return "";
538
+ };
515
539
  export {
516
540
  BASE_BULLMQ_CONFIG,
517
541
  deleteVal,
518
542
  extractAllBlocksFromTpl,
519
543
  genTagId,
544
+ getPlatformContextContent,
520
545
  getVal,
521
546
  _recursExtractBlocks as recursivelyExtractBlocks,
522
547
  setVal,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.6.12",
6
+ "version": "1.6.13",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",