biz-slide-core 1.2.46 → 1.2.48

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,19 +13,20 @@ var PPTSchema = new mongoose_1.Schema({
13
13
  userSelectedTopics: { type: [String], default: [], _id: false },
14
14
  userReaction: { type: Number, default: 0 },
15
15
  userFeedback: { type: String, default: null },
16
- questions: { type: [String], default: [], _id: false },
17
16
  colors: { type: [String], default: [], _id: false },
18
- prompt: { type: String, default: null },
19
17
  templateId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'template' },
20
18
  hasError: { type: Boolean, default: false },
21
19
  slideRefs: { type: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'ppt-slide' }], default: [], _id: false },
22
20
  version: { type: String, default: null },
23
- noOfSlides: { type: Number, default: null },
24
21
  trackIP: { type: String, default: null },
25
22
  sessionId: { type: String, default: null },
26
23
  fileCreateCount: { type: Number, default: 0 },
27
24
  language: { type: String, default: "English" },
28
- addtionalInfoUrl: { type: String, default: null }
25
+ addtionalInfoUrl: { type: String, default: null },
26
+ info: { type: String, default: null },
27
+ prompt: { type: String, default: null },
28
+ noOfSlides: { type: Number, default: null },
29
+ appName: { type: String, default: null },
29
30
  }, {
30
31
  timestamps: true,
31
32
  });
@@ -2,27 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TemplateTypeModel = void 0;
4
4
  var mongoose_1 = require("mongoose");
5
- // Define the nested schema for language
6
- var questionLanguageSchema = new mongoose_1.Schema({
7
- question: { type: String },
8
- caption: { type: String },
9
- placeholder: { type: String },
10
- }, { _id: false }); // _id: false to prevent automatic creation of _id for subdocuments
11
- var questionSchema = new mongoose_1.Schema({
12
- keyId: { type: String },
13
- answerKeyName: { type: String },
14
- systemMessage: { type: String },
15
- caption: { type: String },
16
- question: { type: String },
17
- placeholder: { type: String },
18
- language: {
19
- type: Map,
20
- of: questionLanguageSchema
21
- }
22
- }, {
23
- timestamps: false,
24
- _id: false
25
- });
26
5
  var layoutsSchema = new mongoose_1.Schema({
27
6
  title: { type: String },
28
7
  layoutType: { type: String },
@@ -47,10 +26,9 @@ var systemSchema = new mongoose_1.Schema({
47
26
  var TemplateTypeSchema = new mongoose_1.Schema({
48
27
  published: { type: Boolean, default: false },
49
28
  name: { type: String, default: "", required: true },
50
- questions: [questionSchema],
51
- predefineSystemMessage: { type: String, default: "" },
52
29
  layouts: [layoutsSchema],
53
30
  suggestionPrompts: { type: [String], default: [], _id: false },
31
+ slidePrompt: messageSchema,
54
32
  topicPrompt: systemSchema,
55
33
  layoutPrompt: systemSchema,
56
34
  defaultLayout: { type: String, default: "" },
@@ -106,10 +106,12 @@ var authorizeWithSlideApp = function () {
106
106
  return function (req, res, next) {
107
107
  var _a;
108
108
  return __awaiter(this, void 0, void 0, function () {
109
- var token, userId;
109
+ var ipAddress, sessionId, token, userId;
110
110
  return __generator(this, function (_b) {
111
111
  switch (_b.label) {
112
112
  case 0:
113
+ ipAddress = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
114
+ sessionId = req.headers['x-fingerprint-key'];
113
115
  if (!req.headers.authorization) {
114
116
  return [2 /*return*/, res.status(401).json({ message: 'Unauthorized' })];
115
117
  }
@@ -125,7 +127,10 @@ var authorizeWithSlideApp = function () {
125
127
  return [2 /*return*/, res.status(401).json({ message: 'userId not found' })];
126
128
  }
127
129
  req.user = {
128
- userId: userId
130
+ userId: userId,
131
+ sessionId: sessionId,
132
+ ipAddress: ipAddress,
133
+ appName: req.headers['x-app-name']
129
134
  };
130
135
  next();
131
136
  _b.label = 2;
@@ -168,7 +173,8 @@ var nonAuthorizeWithSlideApp = function () {
168
173
  req.user = {
169
174
  userId: userId,
170
175
  sessionId: sessionId,
171
- ipAddress: ipAddress
176
+ ipAddress: ipAddress,
177
+ appName: req.headers['x-app-name']
172
178
  };
173
179
  next();
174
180
  return [2 /*return*/];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz-slide-core",
3
- "version": "1.2.46",
3
+ "version": "1.2.48",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {