whitelabel-db 1.4.1 → 1.4.3

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.
@@ -0,0 +1,3 @@
1
+ import { QueryInterface } from 'sequelize';
2
+ export declare const up: (queryInterface: QueryInterface) => Promise<void>;
3
+ export declare const down: (queryInterface: QueryInterface) => Promise<void>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.down = exports.up = void 0;
13
+ // Purpose: Add customCss and customJs columns to projects table
14
+ const sequelize_1 = require("sequelize");
15
+ const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
16
+ try {
17
+ const tableDescription = yield queryInterface.describeTable('projects');
18
+ const existingColumns = Object.keys(tableDescription);
19
+ if (!existingColumns.includes('customCss')) {
20
+ yield queryInterface.addColumn('projects', 'customCss', {
21
+ type: sequelize_1.DataTypes.TEXT,
22
+ allowNull: true,
23
+ });
24
+ console.log('customCss column added successfully.');
25
+ }
26
+ else {
27
+ console.log('customCss column already exists, skipping.');
28
+ }
29
+ if (!existingColumns.includes('customJs')) {
30
+ yield queryInterface.addColumn('projects', 'customJs', {
31
+ type: sequelize_1.DataTypes.TEXT,
32
+ allowNull: true,
33
+ });
34
+ console.log('customJs column added successfully.');
35
+ }
36
+ else {
37
+ console.log('customJs column already exists, skipping.');
38
+ }
39
+ console.log('customCss and customJs columns added to projects table successfully.');
40
+ }
41
+ catch (error) {
42
+ console.error('Error while adding customCss and customJs columns:', error.message);
43
+ throw error;
44
+ }
45
+ });
46
+ exports.up = up;
47
+ const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
48
+ try {
49
+ yield queryInterface.removeColumn('projects', 'customCss');
50
+ yield queryInterface.removeColumn('projects', 'customJs');
51
+ console.log('customCss and customJs columns removed from projects table successfully.');
52
+ }
53
+ catch (error) {
54
+ console.error('Error while removing customCss and customJs columns:', error.message);
55
+ throw error;
56
+ }
57
+ });
58
+ exports.down = down;
@@ -26,6 +26,8 @@ export declare class Project extends Model<Partial<Project>> {
26
26
  preferences?: object;
27
27
  appearance?: object;
28
28
  isActive?: boolean;
29
+ customCss?: string;
30
+ customJs?: string;
29
31
  generateSession(secret: string): string;
30
32
  getLiteApiClient(): LiteApiClient;
31
33
  getLiteApiClientV3(): LiteApiClientV3;
@@ -188,6 +188,20 @@ __decorate([
188
188
  }),
189
189
  __metadata("design:type", Boolean)
190
190
  ], Project.prototype, "isActive", void 0);
191
+ __decorate([
192
+ (0, sequelize_typescript_1.Column)({
193
+ type: sequelize_typescript_1.DataType.TEXT,
194
+ allowNull: true,
195
+ }),
196
+ __metadata("design:type", String)
197
+ ], Project.prototype, "customCss", void 0);
198
+ __decorate([
199
+ (0, sequelize_typescript_1.Column)({
200
+ type: sequelize_typescript_1.DataType.TEXT,
201
+ allowNull: true,
202
+ }),
203
+ __metadata("design:type", String)
204
+ ], Project.prototype, "customJs", void 0);
191
205
  exports.Project = Project = __decorate([
192
206
  (0, sequelize_typescript_1.Table)({
193
207
  tableName: 'projects',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whitelabel-db",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",