biz-slide-core 1.2.104 → 1.2.106

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.
@@ -31,6 +31,7 @@ export interface ICustomerSchema {
31
31
  userId: string;
32
32
  emailId: string;
33
33
  emailTemplateStatus: Record<string, IEmailTemplateStatus>;
34
+ country: string;
34
35
  }
35
36
  export declare const CustomerModel: import("mongoose").Model<ICustomerSchema, {}, {}, {}, import("mongoose").Document<unknown, {}, ICustomerSchema> & Omit<ICustomerSchema & {
36
37
  _id: import("mongoose").Types.ObjectId;
@@ -1 +1 @@
1
- {"version":3,"file":"customer.entity.d.ts","sourceRoot":"","sources":["../../src/entity/customer.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;CACf;AAGD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;CAC1D;AA2BD,eAAO,MAAM,aAAa;;eAAqD,CAAC"}
1
+ {"version":3,"file":"customer.entity.d.ts","sourceRoot":"","sources":["../../src/entity/customer.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;CACf;AAGD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC1D,OAAO,EAAE,MAAM,CAAC;CACjB;AA4BD,eAAO,MAAM,aAAa;;eAAqD,CAAC"}
@@ -12,7 +12,8 @@ const CustomerSchema = new mongoose_1.Schema({
12
12
  appName: { type: String, required: true },
13
13
  userId: { type: String, required: true },
14
14
  emailId: { type: String, default: "" },
15
- emailTemplateStatus: { type: Map, of: EmailTemplateStatusSchema }
15
+ emailTemplateStatus: { type: Map, of: EmailTemplateStatusSchema },
16
+ country: { type: String, default: "" }
16
17
  }, {
17
18
  timestamps: true,
18
19
  });
@@ -26,6 +26,7 @@ import { Types } from "mongoose";
26
26
  export interface IPPTFTPQueueSchema {
27
27
  url: string;
28
28
  sent: boolean;
29
+ fileName: string;
29
30
  }
30
31
  export declare const PPTFTPQueueModel: import("mongoose").Model<IPPTFTPQueueSchema, {}, {}, {}, import("mongoose").Document<unknown, {}, IPPTFTPQueueSchema> & Omit<IPPTFTPQueueSchema & {
31
32
  _id: Types.ObjectId;
@@ -1 +1 @@
1
- {"version":3,"file":"ppt-ftp.entity.d.ts","sourceRoot":"","sources":["../../src/entity/ppt-ftp.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAiB,KAAK,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf;AAcD,eAAO,MAAM,gBAAgB;;eAAgE,CAAC"}
1
+ {"version":3,"file":"ppt-ftp.entity.d.ts","sourceRoot":"","sources":["../../src/entity/ppt-ftp.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAiB,KAAK,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAeD,eAAO,MAAM,gBAAgB;;eAAgE,CAAC"}
@@ -4,7 +4,8 @@ exports.PPTFTPQueueModel = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const PPTFTPQueueSchema = new mongoose_1.Schema({
6
6
  url: { type: String, required: true },
7
- sent: { type: Boolean, default: false }
7
+ sent: { type: Boolean, default: false },
8
+ fileName: { type: String, required: true },
8
9
  }, {
9
10
  timestamps: true,
10
11
  });
@@ -1 +1 @@
1
- {"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middleware/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIpC,QAAA,MAAM,SAAS,UAAW,MAAM,EAAE,WACJ,QAAQ,OAAO,QAAQ,QAAQ,YAAY,4DA+BxE,CAAA;AAeD,QAAA,MAAM,qBAAqB,cACG,QAAQ,OAAO,QAAQ,QAAQ,YAAY,4DAiCxE,CAAA;AAED,QAAA,MAAM,wBAAwB,cACA,QAAQ,OAAO,QAAQ,QAAQ,YAAY,4DAkCxE,CAAA;AAGD,QAAA,MAAM,gBAAgB,cACQ,QAAQ,OAAO,QAAQ,QAAQ,YAAY,4DAmBxE,CAAA;AAED,OAAO,EAAC,SAAS,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,gBAAgB,EAAC,CAAC"}
1
+ {"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middleware/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIpC,QAAA,MAAM,SAAS,UAAW,MAAM,EAAE,WACJ,QAAQ,OAAO,QAAQ,QAAQ,YAAY,4DA+BxE,CAAA;AAgBD,QAAA,MAAM,qBAAqB,cACG,QAAQ,OAAO,QAAQ,QAAQ,YAAY,4DAoCxE,CAAA;AAED,QAAA,MAAM,wBAAwB,cACA,QAAQ,OAAO,QAAQ,QAAQ,YAAY,4DAqCxE,CAAA;AAGD,QAAA,MAAM,gBAAgB,cACQ,QAAQ,OAAO,QAAQ,QAAQ,YAAY,4DAmBxE,CAAA;AAED,OAAO,EAAC,SAAS,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,gBAAgB,EAAC,CAAC"}
@@ -42,14 +42,15 @@ const authorize = (roles) => {
42
42
  };
43
43
  };
44
44
  exports.authorize = authorize;
45
- const createUser = async (emailId, userId, appName) => {
45
+ const createUser = async (emailId, userId, country, appName) => {
46
46
  const customer = await entity_1.CustomerModel.findOne({ userId });
47
47
  if (!customer) {
48
48
  const newCustomer = new entity_1.CustomerModel({
49
49
  appName: appName || "default",
50
50
  emailId,
51
51
  emailTemplateStatus: {},
52
- userId
52
+ userId,
53
+ country
53
54
  });
54
55
  await newCustomer.save();
55
56
  }
@@ -68,6 +69,7 @@ const authorizeWithSlideApp = () => {
68
69
  return res.status(401).json({ message: 'Session Expired' });
69
70
  }
70
71
  const userId = (token === null || token === void 0 ? void 0 : token.customer_id) || ((_a = token === null || token === void 0 ? void 0 : token.value) === null || _a === void 0 ? void 0 : _a.email);
72
+ const country = (token === null || token === void 0 ? void 0 : token.country_name) || "";
71
73
  if (!userId) {
72
74
  return res.status(401).json({ message: 'userId not found' });
73
75
  }
@@ -76,9 +78,10 @@ const authorizeWithSlideApp = () => {
76
78
  sessionId,
77
79
  ipAddress,
78
80
  appName: req.headers['x-app-name'],
79
- email: (token === null || token === void 0 ? void 0 : token.customer_email) || ""
81
+ email: (token === null || token === void 0 ? void 0 : token.customer_email) || "",
82
+ country
80
83
  };
81
- await createUser(req.user.email, req.user.userId, req.user.appName);
84
+ await createUser(req.user.email, req.user.userId, req.user.country, req.user.appName);
82
85
  next();
83
86
  }
84
87
  };
@@ -91,6 +94,7 @@ const nonAuthorizeWithSlideApp = () => {
91
94
  const sessionId = req.headers['x-fingerprint-key'];
92
95
  let userId = "guest";
93
96
  let email = "";
97
+ let country = "";
94
98
  if (req.headers.authorization) {
95
99
  const token = await (0, utilities_1.verifyUid)(req.headers.authorization);
96
100
  if (!token) {
@@ -98,10 +102,11 @@ const nonAuthorizeWithSlideApp = () => {
98
102
  }
99
103
  userId = (token === null || token === void 0 ? void 0 : token.customer_id) || ((_a = token === null || token === void 0 ? void 0 : token.value) === null || _a === void 0 ? void 0 : _a.email);
100
104
  email = (token === null || token === void 0 ? void 0 : token.customer_email) || "";
105
+ country = (token === null || token === void 0 ? void 0 : token.country_name) || "";
101
106
  if (!userId) {
102
107
  return res.status(401).json({ message: 'userId not found' });
103
108
  }
104
- await createUser(email, userId, req.headers['x-app-name']);
109
+ await createUser(email, userId, country, req.headers['x-app-name']);
105
110
  }
106
111
  else {
107
112
  if (!ipAddress || !sessionId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz-slide-core",
3
- "version": "1.2.104",
3
+ "version": "1.2.106",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",