whitelabel-db 1.0.22 → 1.0.23

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.
@@ -74,6 +74,6 @@ __decorate([
74
74
  ], Booking.prototype, "hasAcceptedTerms", void 0);
75
75
  exports.Booking = Booking = __decorate([
76
76
  (0, sequelize_typescript_1.Table)({
77
- tableName: 'booking',
77
+ tableName: 'bookings',
78
78
  })
79
79
  ], Booking);
@@ -8,4 +8,5 @@ export declare class Project extends Model<Partial<Project>> {
8
8
  settings?: object;
9
9
  agencyId?: string;
10
10
  agency?: Agency;
11
+ generateSession(secret: string): string;
11
12
  }
@@ -8,11 +8,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.Project = void 0;
13
16
  const sequelize_typescript_1 = require("sequelize-typescript");
17
+ const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
14
18
  const Agency_1 = require("./Agency");
15
19
  let Project = class Project extends sequelize_typescript_1.Model {
20
+ generateSession(secret) {
21
+ return jsonwebtoken_1.default.sign({ id: this.id }, secret, {
22
+ algorithm: 'HS256',
23
+ expiresIn: 86400, // 24 hours
24
+ });
25
+ }
16
26
  };
17
27
  exports.Project = Project;
18
28
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whitelabel-db",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",