easywork-common-lib 1.0.661 → 1.0.663

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.
@@ -1,8 +1,8 @@
1
1
  import { Course } from './course.entity';
2
2
  import { CourseFolderPage } from './course-folder-page.entity';
3
3
  import { User } from '../user.entity';
4
- export declare class CourseAssigned {
5
- id: number;
4
+ import { EntityBase } from '../../common/database/base.entity';
5
+ export declare class CourseAssigned extends EntityBase {
6
6
  progress: number;
7
7
  completedPages: {
8
8
  pageId: number;
@@ -14,8 +14,8 @@ const typeorm_1 = require("typeorm");
14
14
  const course_entity_1 = require("./course.entity");
15
15
  const course_folder_page_entity_1 = require("./course-folder-page.entity");
16
16
  const user_entity_1 = require("../user.entity");
17
- let CourseAssigned = class CourseAssigned {
18
- id;
17
+ const base_entity_1 = require("../../common/database/base.entity");
18
+ let CourseAssigned = class CourseAssigned extends base_entity_1.EntityBase {
19
19
  progress;
20
20
  completedPages;
21
21
  lastCompletedPage;
@@ -23,10 +23,6 @@ let CourseAssigned = class CourseAssigned {
23
23
  course;
24
24
  };
25
25
  exports.CourseAssigned = CourseAssigned;
26
- __decorate([
27
- (0, typeorm_1.PrimaryGeneratedColumn)(),
28
- __metadata("design:type", Number)
29
- ], CourseAssigned.prototype, "id", void 0);
30
26
  __decorate([
31
27
  (0, typeorm_1.Column)({ default: 0 }),
32
28
  __metadata("design:type", Number)
@@ -1 +1 @@
1
- {"version":3,"file":"course-assigned.entity.js","sourceRoot":"","sources":["../../../src/entities/capacitation/course-assigned.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoF;AACpF,mDAAyC;AACzC,2EAA+D;AAC/D,gDAAsC;AAI/B,IAAM,cAAc,GAApB,MAAM,cAAc;IAEzB,EAAE,CAAS;IAMX,QAAQ,CAAS;IAGjB,cAAc,CAAiD;IAG/D,iBAAiB,CAA0B;IAG3C,IAAI,CAAO;IAGX,MAAM,CAAS;CAChB,CAAA;AArBY,wCAAc;AAEzB;IADC,IAAA,gCAAsB,GAAE;;0CACd;AAMX;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gDACN;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACqB;AAG/D;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4CAAgB,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAChE,4CAAgB;yDAAQ;AAG3C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC;8BAC9C,kBAAI;4CAAC;AAGX;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,sBAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC;8BAChD,sBAAM;8CAAC;yBApBJ,cAAc;IAF1B,IAAA,gBAAM,GAAE;IACR,IAAA,gBAAM,EAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;GACd,cAAc,CAqB1B"}
1
+ {"version":3,"file":"course-assigned.entity.js","sourceRoot":"","sources":["../../../src/entities/capacitation/course-assigned.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA4D;AAC5D,mDAAyC;AACzC,2EAA+D;AAC/D,gDAAsC;AACtC,mEAA+D;AAIxD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,wBAAU;IAE5C,QAAQ,CAAS;IAGjB,cAAc,CAAiD;IAG/D,iBAAiB,CAA0B;IAG3C,IAAI,CAAO;IAGX,MAAM,CAAS;CAChB,CAAA;AAfY,wCAAc;AAEzB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gDACN;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACqB;AAG/D;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4CAAgB,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAChE,4CAAgB;yDAAQ;AAG3C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC;8BAC9C,kBAAI;4CAAC;AAGX;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,sBAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC;8BAChD,sBAAM;8CAAC;yBAdJ,cAAc;IAF1B,IAAA,gBAAM,GAAE;IACR,IAAA,gBAAM,EAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;GACd,cAAc,CAe1B"}
@@ -1,7 +1,7 @@
1
1
  import { Course } from './course.entity';
2
2
  import { Group } from '../group.entity';
3
- export declare class CourseOrder {
4
- id: number;
3
+ import { EntityBase } from '../../common/database/base.entity';
4
+ export declare class CourseOrder extends EntityBase {
5
5
  group: Group;
6
6
  course: Course;
7
7
  order: number;
@@ -13,17 +13,14 @@ exports.CourseOrder = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const course_entity_1 = require("./course.entity");
15
15
  const group_entity_1 = require("../group.entity");
16
- let CourseOrder = class CourseOrder {
17
- id;
16
+ const swagger_1 = require("@nestjs/swagger");
17
+ const base_entity_1 = require("../../common/database/base.entity");
18
+ let CourseOrder = class CourseOrder extends base_entity_1.EntityBase {
18
19
  group;
19
20
  course;
20
21
  order;
21
22
  };
22
23
  exports.CourseOrder = CourseOrder;
23
- __decorate([
24
- (0, typeorm_1.PrimaryGeneratedColumn)(),
25
- __metadata("design:type", Number)
26
- ], CourseOrder.prototype, "id", void 0);
27
24
  __decorate([
28
25
  (0, typeorm_1.ManyToOne)(() => group_entity_1.Group),
29
26
  __metadata("design:type", group_entity_1.Group)
@@ -33,7 +30,12 @@ __decorate([
33
30
  __metadata("design:type", course_entity_1.Course)
34
31
  ], CourseOrder.prototype, "course", void 0);
35
32
  __decorate([
36
- (0, typeorm_1.Column)(),
33
+ (0, swagger_1.ApiProperty)({
34
+ type: String,
35
+ description: 'Course order',
36
+ required: false,
37
+ }),
38
+ (0, typeorm_1.Column)({ type: 'int', generated: 'increment' }),
37
39
  __metadata("design:type", Number)
38
40
  ], CourseOrder.prototype, "order", void 0);
39
41
  exports.CourseOrder = CourseOrder = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"course-order.entity.js","sourceRoot":"","sources":["../../../src/entities/capacitation/course-order.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoF;AACpF,mDAAyC;AACzC,kDAAwC;AAIjC,IAAM,WAAW,GAAjB,MAAM,WAAW;IAEtB,EAAE,CAAS;IAGX,KAAK,CAAQ;IAGb,MAAM,CAAS;IAGf,KAAK,CAAS;CACf,CAAA;AAZY,kCAAW;AAEtB;IADC,IAAA,gCAAsB,GAAE;;uCACd;AAGX;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,CAAC;8BAChB,oBAAK;0CAAC;AAGb;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,sBAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;8BACzC,sBAAM;2CAAC;AAGf;IADC,IAAA,gBAAM,GAAE;;0CACK;sBAXH,WAAW;IAFvB,IAAA,gBAAM,GAAE;IACR,IAAA,gBAAM,EAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;GACf,WAAW,CAYvB"}
1
+ {"version":3,"file":"course-order.entity.js","sourceRoot":"","sources":["../../../src/entities/capacitation/course-order.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA4D;AAC5D,mDAAyC;AACzC,kDAAwC;AACxC,6CAA8C;AAC9C,mEAA+D;AAIxD,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,wBAAU;IAEzC,KAAK,CAAQ;IAGb,MAAM,CAAS;IAQf,KAAK,CAAS;CACf,CAAA;AAdY,kCAAW;AAEtB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,CAAC;8BAChB,oBAAK;0CAAC;AAGb;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,sBAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;8BACzC,sBAAM;2CAAC;AAQf;IANC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,cAAc;QAC3B,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;;0CAClC;sBAbH,WAAW;IAFvB,IAAA,gBAAM,GAAE;IACR,IAAA,gBAAM,EAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;GACf,WAAW,CAcvB"}
@@ -0,0 +1,14 @@
1
+ import { Course } from './course.entity';
2
+ import { CourseFolderPage } from './course-folder-page.entity';
3
+ import { User } from '../user.entity';
4
+ export declare class CourseProgress {
5
+ id: number;
6
+ user: User;
7
+ course: Course;
8
+ lastCompletedPage: CourseFolderPage | null;
9
+ progress: number;
10
+ completedPages: {
11
+ pageId: number;
12
+ completedAt: Date;
13
+ }[] | null;
14
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CourseProgress = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const course_entity_1 = require("./course.entity");
15
+ const course_folder_page_entity_1 = require("./course-folder-page.entity");
16
+ const user_entity_1 = require("../user.entity");
17
+ let CourseProgress = class CourseProgress {
18
+ id;
19
+ user;
20
+ course;
21
+ lastCompletedPage;
22
+ progress;
23
+ completedPages;
24
+ };
25
+ exports.CourseProgress = CourseProgress;
26
+ __decorate([
27
+ (0, typeorm_1.PrimaryGeneratedColumn)(),
28
+ __metadata("design:type", Number)
29
+ ], CourseProgress.prototype, "id", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, user => user.courseProgress),
32
+ __metadata("design:type", user_entity_1.User)
33
+ ], CourseProgress.prototype, "user", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.ManyToOne)(() => course_entity_1.Course, course => course.courseProgress),
36
+ __metadata("design:type", course_entity_1.Course)
37
+ ], CourseProgress.prototype, "course", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.ManyToOne)(() => course_folder_page_entity_1.CourseFolderPage, page => page.courseProgress, { nullable: true }),
40
+ __metadata("design:type", course_folder_page_entity_1.CourseFolderPage)
41
+ ], CourseProgress.prototype, "lastCompletedPage", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ default: 0 }),
44
+ __metadata("design:type", Number)
45
+ ], CourseProgress.prototype, "progress", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
48
+ __metadata("design:type", Array)
49
+ ], CourseProgress.prototype, "completedPages", void 0);
50
+ exports.CourseProgress = CourseProgress = __decorate([
51
+ (0, typeorm_1.Entity)()
52
+ ], CourseProgress);
53
+ //# sourceMappingURL=course-progress.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-progress.entity.js","sourceRoot":"","sources":["../../../src/entities/capacitation/course-progress.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA4E;AAC5E,mDAAyC;AACzC,2EAA+D;AAC/D,gDAAsC;AAG/B,IAAM,cAAc,GAApB,MAAM,cAAc;IAEzB,EAAE,CAAS;IAGX,IAAI,CAAO;IAGX,MAAM,CAAS;IAGf,iBAAiB,CAA0B;IAG3C,QAAQ,CAAS;IAGjB,cAAc,CAAiD;CAChE,CAAA;AAlBY,wCAAc;AAEzB;IADC,IAAA,gCAAsB,GAAE;;0CACd;AAGX;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC;8BAC7C,kBAAI;4CAAC;AAGX;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,sBAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;8BACjD,sBAAM;8CAAC;AAGf;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4CAAgB,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAChE,4CAAgB;yDAAQ;AAG3C;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gDACN;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACqB;yBAjBpD,cAAc;IAD1B,IAAA,gBAAM,GAAE;GACI,cAAc,CAkB1B"}
@@ -0,0 +1,11 @@
1
+ import { EntityBase } from '../../common/database/base.entity';
2
+ import { CourseFolder } from './course-folder.entity';
3
+ import { LMSFileUploaded } from 'common';
4
+ export declare class FolderPage extends EntityBase {
5
+ name: string;
6
+ description?: string;
7
+ isCompleted: boolean;
8
+ isPublished: boolean;
9
+ files?: LMSFileUploaded[];
10
+ folder: CourseFolder;
11
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.FolderPage = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ const base_entity_1 = require("../../common/database/base.entity");
16
+ const course_folder_entity_1 = require("./course-folder.entity");
17
+ let FolderPage = class FolderPage extends base_entity_1.EntityBase {
18
+ name;
19
+ description;
20
+ isCompleted;
21
+ isPublished;
22
+ files;
23
+ folder;
24
+ };
25
+ exports.FolderPage = FolderPage;
26
+ __decorate([
27
+ (0, swagger_1.ApiProperty)({ type: String, description: 'Folder page name' }),
28
+ (0, typeorm_1.Column)(),
29
+ __metadata("design:type", String)
30
+ ], FolderPage.prototype, "name", void 0);
31
+ __decorate([
32
+ (0, swagger_1.ApiProperty)({ type: String, description: 'Folder page description', nullable: true }),
33
+ (0, typeorm_1.Column)({ nullable: true }),
34
+ __metadata("design:type", String)
35
+ ], FolderPage.prototype, "description", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ default: false }),
38
+ __metadata("design:type", Boolean)
39
+ ], FolderPage.prototype, "isCompleted", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({ default: false }),
42
+ __metadata("design:type", Boolean)
43
+ ], FolderPage.prototype, "isPublished", void 0);
44
+ __decorate([
45
+ (0, swagger_1.ApiProperty)({ isArray: true, type: String, description: 'Files uploaded to the content' }),
46
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true, default: [] }),
47
+ __metadata("design:type", Array)
48
+ ], FolderPage.prototype, "files", void 0);
49
+ __decorate([
50
+ (0, swagger_1.ApiProperty)({ type: () => course_folder_entity_1.CourseFolder, description: 'Folder owner of the page', required: false }),
51
+ (0, typeorm_1.ManyToOne)(() => course_folder_entity_1.CourseFolder, folder => folder.pages, { onDelete: 'CASCADE' }),
52
+ __metadata("design:type", course_folder_entity_1.CourseFolder)
53
+ ], FolderPage.prototype, "folder", void 0);
54
+ exports.FolderPage = FolderPage = __decorate([
55
+ (0, typeorm_1.Entity)()
56
+ ], FolderPage);
57
+ //# sourceMappingURL=folder-page.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"folder-page.entity.js","sourceRoot":"","sources":["../../../src/entities/capacitation/folder-page.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AACpD,6CAA8C;AAE9C,mEAA+D;AAC/D,iEAAsD;AAI/C,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,wBAAU;IAGxC,IAAI,CAAS;IAIb,WAAW,CAAU;IAGrB,WAAW,CAAU;IAGrB,WAAW,CAAU;IAIrB,KAAK,CAAqB;IAI1B,MAAM,CAAe;CACtB,CAAA;AAtBY,gCAAU;AAGrB;IAFC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAC9D,IAAA,gBAAM,GAAE;;wCACI;AAIb;IAFC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,yBAAyB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrF,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACN;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACN;AAIrB;IAFC,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAC1F,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;yCAC7B;AAI1B;IAFC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,mCAAY,EAAE,WAAW,EAAE,0BAA0B,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACnG,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAY,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;8BACvE,mCAAY;0CAAC;qBArBV,UAAU;IADtB,IAAA,gBAAM,GAAE;GACI,UAAU,CAsBtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easywork-common-lib",
3
- "version": "1.0.661",
3
+ "version": "1.0.663",
4
4
  "description": "Librería común de Easywork",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {