shuttlepro-shared 1.4.48 → 1.4.49

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.
@@ -109,6 +109,13 @@ class CallRepository {
109
109
  );
110
110
  }
111
111
 
112
+ getCallByFilter(filter) {
113
+ return this._safeExec(
114
+ Call.findOne({ filter }).lean().exec(),
115
+ `Failed to get call filter`
116
+ );
117
+ }
118
+
112
119
  endCall(callId, updateObj = {}, history = {}) {
113
120
  return this._safeExec(
114
121
  Call.findOneAndUpdate(
@@ -1,16 +1,22 @@
1
1
  const mongoose = require("mongoose");
2
2
  const { Schema } = mongoose;
3
- const { v4: uuidv4 } = require("uuid");
3
+
4
+ // Load uuid dynamically since it's ESM-only
5
+ let uuidv4;
6
+ (async () => {
7
+ const { v4 } = await import("uuid");
8
+ uuidv4 = v4;
9
+ })();
4
10
 
5
11
  const FeedbackResponseSchema = new Schema(
6
12
  {
7
13
  paramId: {
8
14
  type: String,
9
- default: uuidv4(),
15
+ default: () => uuidv4?.() || "", // use function so each doc gets unique UUID
10
16
  },
11
17
  type: {
12
18
  type: String,
13
- enum: ["conversation", "order","shop"],
19
+ enum: ["conversation", "order", "shop"],
14
20
  default: "conversation",
15
21
  },
16
22
  refId: {
@@ -49,15 +55,6 @@ const FeedbackResponseSchema = new Schema(
49
55
  type: Date,
50
56
  default: Date.now,
51
57
  },
52
-
53
- workspaceId: {
54
- type: String,
55
- default: "",
56
- },
57
- feedbackFormId: {
58
- type: String,
59
- default: "",
60
- },
61
58
  qr: {
62
59
  link: {
63
60
  type: String,
@@ -20,13 +20,6 @@ const InteractiveSchema = new Schema({
20
20
  enum: ["button", "list"],
21
21
  default: "list",
22
22
  },
23
- messages: [
24
- {
25
- type: { type: String, default: "" },
26
- url: { type: String, default: "" },
27
- value: { type: String, default: "" },
28
- },
29
- ],
30
23
  header: {
31
24
  type: {
32
25
  type: String,
@@ -20,10 +20,6 @@ const WorkflowRunSchema = new Schema(
20
20
  type: String,
21
21
  default: "",
22
22
  },
23
- messageId: {
24
- type: String,
25
- default: "",
26
- },
27
23
  initialMessageId: {
28
24
  type: Schema.Types.ObjectId,
29
25
  ref: "DescriptionTemplate",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.4.48",
3
+ "version": "1.4.49",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {