joye-backend-utility 8.2.5 → 8.2.7

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.
@@ -2,6 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AIResponsesTrackingSchema = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
+ /**
6
+ * Assistant replies captured when a chat session ends.
7
+ * `platformKey` + `tId` match Organization so rows can be queried per tenant.
8
+ */
5
9
  const AIResponsesTracking = new mongoose_1.Schema({
6
10
  date: {
7
11
  type: String,
@@ -13,6 +17,16 @@ const AIResponsesTracking = new mongoose_1.Schema({
13
17
  required: true,
14
18
  index: true,
15
19
  },
20
+ /** Organization.platformKey — teams, visit, pwa, chatgpt, and so on */
21
+ platformKey: {
22
+ type: String,
23
+ required: true,
24
+ },
25
+ /** Organization.tId */
26
+ tId: {
27
+ type: String,
28
+ required: true,
29
+ },
16
30
  createdAt: {
17
31
  type: Number,
18
32
  required: true,
@@ -23,4 +37,6 @@ const AIResponsesTracking = new mongoose_1.Schema({
23
37
  required: false,
24
38
  },
25
39
  });
40
+ AIResponsesTracking.index({ platformKey: 1, tId: 1, date: -1 });
41
+ AIResponsesTracking.index({ platformKey: 1, tId: 1, type: 1, date: -1 });
26
42
  exports.AIResponsesTrackingSchema = AIResponsesTracking;
@@ -72,6 +72,14 @@ const OrganizationUserAttrPermission = new mongoose_1.Schema({
72
72
  type: Object,
73
73
  required: false,
74
74
  },
75
+ /**
76
+ * Tenant crisis contacts as HTML (strong, links, tel:, mailto:).
77
+ * Used before platform safetyContacts, then the Joye master-data default.
78
+ */
79
+ safetyContacts: {
80
+ type: String,
81
+ required: false,
82
+ },
75
83
  // Sample data
76
84
  /* aiModels: {
77
85
  "brew": "claude-sonnet-4-20250514",
@@ -41,6 +41,13 @@ const Platform = new mongoose_1.Schema({
41
41
  type: Array,
42
42
  required: false,
43
43
  },
44
+ /**
45
+ * Platform crisis contacts as HTML. Used when the tenant has no safetyContacts.
46
+ */
47
+ safetyContacts: {
48
+ type: String,
49
+ required: false,
50
+ },
44
51
  // Sample data
45
52
  /* aiModels: {
46
53
  "brew": "claude-sonnet-4-20250514",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joye-backend-utility",
3
- "version": "8.2.5",
3
+ "version": "8.2.7",
4
4
  "description": "Joye backend utility for db functions and common functions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",