@things-factory/calendar 6.0.45
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.
- package/CHANGELOG.md +8 -0
- package/assets/images/hatiolab-logo.png +0 -0
- package/client/bootstrap.ts +1 -0
- package/client/index.ts +0 -0
- package/client/pages/attendee/attendee-importer.ts +97 -0
- package/client/pages/attendee/attendee-list-page.ts +348 -0
- package/client/pages/calendar/calendar-importer.ts +97 -0
- package/client/pages/calendar/calendar-list-page.ts +348 -0
- package/client/pages/calendar/calendar-page.ts +128 -0
- package/client/pages/event/event-importer.ts +97 -0
- package/client/pages/event/event-list-page.ts +348 -0
- package/client/route.ts +19 -0
- package/client/themes/calendar-theme.css +54 -0
- package/client/tsconfig.json +11 -0
- package/concept.md +31 -0
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +2 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/attendee/attendee-importer.d.ts +22 -0
- package/dist-client/pages/attendee/attendee-importer.js +100 -0
- package/dist-client/pages/attendee/attendee-importer.js.map +1 -0
- package/dist-client/pages/attendee/attendee-list-page.d.ts +62 -0
- package/dist-client/pages/attendee/attendee-list-page.js +326 -0
- package/dist-client/pages/attendee/attendee-list-page.js.map +1 -0
- package/dist-client/pages/calendar/calendar-importer.d.ts +22 -0
- package/dist-client/pages/calendar/calendar-importer.js +100 -0
- package/dist-client/pages/calendar/calendar-importer.js.map +1 -0
- package/dist-client/pages/calendar/calendar-list-page.d.ts +62 -0
- package/dist-client/pages/calendar/calendar-list-page.js +326 -0
- package/dist-client/pages/calendar/calendar-list-page.js.map +1 -0
- package/dist-client/pages/calendar/calendar-page.d.ts +26 -0
- package/dist-client/pages/calendar/calendar-page.js +128 -0
- package/dist-client/pages/calendar/calendar-page.js.map +1 -0
- package/dist-client/pages/event/event-importer.d.ts +22 -0
- package/dist-client/pages/event/event-importer.js +100 -0
- package/dist-client/pages/event/event-importer.js.map +1 -0
- package/dist-client/pages/event/event-list-page.d.ts +62 -0
- package/dist-client/pages/event/event-list-page.js +326 -0
- package/dist-client/pages/event/event-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +17 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/controllers/index.js +1 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/index.js +7 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/middlewares/index.js +8 -0
- package/dist-server/middlewares/index.js.map +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routes.js +25 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/attendee/attendee-mutation.js +124 -0
- package/dist-server/service/attendee/attendee-mutation.js.map +1 -0
- package/dist-server/service/attendee/attendee-query.js +47 -0
- package/dist-server/service/attendee/attendee-query.js.map +1 -0
- package/dist-server/service/attendee/attendee-type.js +65 -0
- package/dist-server/service/attendee/attendee-type.js.map +1 -0
- package/dist-server/service/attendee/attendee.js +46 -0
- package/dist-server/service/attendee/attendee.js.map +1 -0
- package/dist-server/service/attendee/index.js +10 -0
- package/dist-server/service/attendee/index.js.map +1 -0
- package/dist-server/service/calendar/calendar-mutation.js +168 -0
- package/dist-server/service/calendar/calendar-mutation.js.map +1 -0
- package/dist-server/service/calendar/calendar-query.js +97 -0
- package/dist-server/service/calendar/calendar-query.js.map +1 -0
- package/dist-server/service/calendar/calendar-type.js +86 -0
- package/dist-server/service/calendar/calendar-type.js.map +1 -0
- package/dist-server/service/calendar/calendar.js +93 -0
- package/dist-server/service/calendar/calendar.js.map +1 -0
- package/dist-server/service/calendar/index.js +10 -0
- package/dist-server/service/calendar/index.js.map +1 -0
- package/dist-server/service/event/event-mutation.js +124 -0
- package/dist-server/service/event/event-mutation.js.map +1 -0
- package/dist-server/service/event/event-query.js +66 -0
- package/dist-server/service/event/event-query.js.map +1 -0
- package/dist-server/service/event/event-type.js +86 -0
- package/dist-server/service/event/event-type.js.map +1 -0
- package/dist-server/service/event/event.js +94 -0
- package/dist-server/service/event/event.js.map +1 -0
- package/dist-server/service/event/index.js +10 -0
- package/dist-server/service/event/index.js.map +1 -0
- package/dist-server/service/index.js +33 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/helps/calendar/attendee.md +160 -0
- package/helps/calendar/calendar.md +160 -0
- package/helps/calendar/event.md +160 -0
- package/package.json +36 -0
- package/server/controllers/index.ts +0 -0
- package/server/index.ts +4 -0
- package/server/middlewares/index.ts +3 -0
- package/server/migrations/index.ts +9 -0
- package/server/routes.ts +28 -0
- package/server/service/attendee/attendee-mutation.ts +122 -0
- package/server/service/attendee/attendee-query.ts +31 -0
- package/server/service/attendee/attendee-type.ts +44 -0
- package/server/service/attendee/attendee.ts +36 -0
- package/server/service/attendee/index.ts +7 -0
- package/server/service/calendar/calendar-mutation.ts +198 -0
- package/server/service/calendar/calendar-query.ts +62 -0
- package/server/service/calendar/calendar-type.ts +61 -0
- package/server/service/calendar/calendar.ts +82 -0
- package/server/service/calendar/index.ts +7 -0
- package/server/service/event/event-mutation.ts +125 -0
- package/server/service/event/event-query.ts +38 -0
- package/server/service/event/event-type.ts +61 -0
- package/server/service/event/event.ts +85 -0
- package/server/service/event/index.ts +7 -0
- package/server/service/index.ts +32 -0
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +25 -0
- package/translations/en.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttendeeList = exports.AttendeePatch = exports.NewAttendee = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const attendee_1 = require("./attendee");
|
|
7
|
+
let NewAttendee = class NewAttendee {
|
|
8
|
+
};
|
|
9
|
+
tslib_1.__decorate([
|
|
10
|
+
(0, type_graphql_1.Field)(),
|
|
11
|
+
tslib_1.__metadata("design:type", String)
|
|
12
|
+
], NewAttendee.prototype, "name", void 0);
|
|
13
|
+
tslib_1.__decorate([
|
|
14
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
16
|
+
], NewAttendee.prototype, "description", void 0);
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, type_graphql_1.Field)(type => attendee_1.AttendeeStatus, { nullable: true }),
|
|
19
|
+
tslib_1.__metadata("design:type", String)
|
|
20
|
+
], NewAttendee.prototype, "state", void 0);
|
|
21
|
+
NewAttendee = tslib_1.__decorate([
|
|
22
|
+
(0, type_graphql_1.InputType)()
|
|
23
|
+
], NewAttendee);
|
|
24
|
+
exports.NewAttendee = NewAttendee;
|
|
25
|
+
let AttendeePatch = class AttendeePatch {
|
|
26
|
+
};
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
29
|
+
tslib_1.__metadata("design:type", String)
|
|
30
|
+
], AttendeePatch.prototype, "id", void 0);
|
|
31
|
+
tslib_1.__decorate([
|
|
32
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
33
|
+
tslib_1.__metadata("design:type", String)
|
|
34
|
+
], AttendeePatch.prototype, "name", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], AttendeePatch.prototype, "description", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, type_graphql_1.Field)(type => attendee_1.AttendeeStatus, { nullable: true }),
|
|
41
|
+
tslib_1.__metadata("design:type", String)
|
|
42
|
+
], AttendeePatch.prototype, "state", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
+
tslib_1.__metadata("design:type", String)
|
|
46
|
+
], AttendeePatch.prototype, "cuFlag", void 0);
|
|
47
|
+
AttendeePatch = tslib_1.__decorate([
|
|
48
|
+
(0, type_graphql_1.InputType)()
|
|
49
|
+
], AttendeePatch);
|
|
50
|
+
exports.AttendeePatch = AttendeePatch;
|
|
51
|
+
let AttendeeList = class AttendeeList {
|
|
52
|
+
};
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, type_graphql_1.Field)(type => [attendee_1.Attendee]),
|
|
55
|
+
tslib_1.__metadata("design:type", Array)
|
|
56
|
+
], AttendeeList.prototype, "items", void 0);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
59
|
+
tslib_1.__metadata("design:type", Number)
|
|
60
|
+
], AttendeeList.prototype, "total", void 0);
|
|
61
|
+
AttendeeList = tslib_1.__decorate([
|
|
62
|
+
(0, type_graphql_1.ObjectType)()
|
|
63
|
+
], AttendeeList);
|
|
64
|
+
exports.AttendeeList = AttendeeList;
|
|
65
|
+
//# sourceMappingURL=attendee-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attendee-type.js","sourceRoot":"","sources":["../../../server/service/attendee/attendee-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAItF,yCAAqD;AAG9C,IAAM,WAAW,GAAjB,MAAM,WAAW;CASvB,CAAA;AARC;IAAC,IAAA,oBAAK,GAAE;;yCACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,yBAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAC5B;AARX,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CASvB;AATY,kCAAW;AAYjB,IAAM,aAAa,GAAnB,MAAM,aAAa;CAezB,CAAA;AAdC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,yBAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC5B;AAEtB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;AAdJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAezB;AAfY,sCAAa;AAkBnB,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mBAAQ,CAAC,CAAC;;2CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;AALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB;AANY,oCAAY","sourcesContent":["import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { Attendee, AttendeeStatus } from './attendee'\n\n@InputType()\nexport class NewAttendee {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => AttendeeStatus, { nullable: true })\n state?: AttendeeStatus\n}\n\n@InputType()\nexport class AttendeePatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => AttendeeStatus, { nullable: true })\n state?: AttendeeStatus\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class AttendeeList {\n @Field(type => [Attendee])\n items: Attendee[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Attendee = exports.AttendeeStatus = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const event_1 = require("../event/event");
|
|
8
|
+
var AttendeeStatus;
|
|
9
|
+
(function (AttendeeStatus) {
|
|
10
|
+
AttendeeStatus["STATUS_A"] = "STATUS_A";
|
|
11
|
+
AttendeeStatus["STATUS_B"] = "STATUS_B";
|
|
12
|
+
})(AttendeeStatus = exports.AttendeeStatus || (exports.AttendeeStatus = {}));
|
|
13
|
+
(0, type_graphql_1.registerEnumType)(AttendeeStatus, {
|
|
14
|
+
name: 'AttendeeStatus',
|
|
15
|
+
description: 'state enumeration of a attendee'
|
|
16
|
+
});
|
|
17
|
+
let Attendee = class Attendee {
|
|
18
|
+
};
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
21
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
22
|
+
tslib_1.__metadata("design:type", String)
|
|
23
|
+
], Attendee.prototype, "id", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, typeorm_1.Column)(),
|
|
26
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
27
|
+
tslib_1.__metadata("design:type", String)
|
|
28
|
+
], Attendee.prototype, "name", void 0);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, typeorm_1.Column)(),
|
|
31
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], Attendee.prototype, "email", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, typeorm_1.ManyToMany)(() => event_1.Event),
|
|
36
|
+
(0, typeorm_1.JoinTable)(),
|
|
37
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
38
|
+
tslib_1.__metadata("design:type", Array)
|
|
39
|
+
], Attendee.prototype, "events", void 0);
|
|
40
|
+
Attendee = tslib_1.__decorate([
|
|
41
|
+
(0, typeorm_1.Entity)(),
|
|
42
|
+
(0, typeorm_1.Index)('ix_attendee_0', (attendee) => [attendee.email], { unique: false }),
|
|
43
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for Attendee' })
|
|
44
|
+
], Attendee);
|
|
45
|
+
exports.Attendee = Attendee;
|
|
46
|
+
//# sourceMappingURL=attendee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attendee.js","sourceRoot":"","sources":["../../../server/service/attendee/attendee.ts"],"names":[],"mappings":";;;;AAAA,qCAA8F;AAC9F,+CAA2E;AAE3E,0CAAsC;AAEtC,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;AACvB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAED,IAAA,+BAAgB,EAAC,cAAc,EAAE;IAC/B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,iCAAiC;CAC/C,CAAC,CAAA;AAKK,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAiBpB,CAAA;AAhBC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;oCACC;AAEnB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACb;AAEb;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACb;AAEb;IAAC,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,aAAK,CAAC;IACvB,IAAA,mBAAS,GAAE;IACX,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACX;AAhBJ,QAAQ;IAHpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACnF,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAiBpB;AAjBY,4BAAQ","sourcesContent":["import { Entity, Index, Column, ManyToMany, JoinTable, PrimaryGeneratedColumn } from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Event } from '../event/event'\n\nexport enum AttendeeStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(AttendeeStatus, {\n name: 'AttendeeStatus',\n description: 'state enumeration of a attendee'\n})\n\n@Entity()\n@Index('ix_attendee_0', (attendee: Attendee) => [attendee.email], { unique: false })\n@ObjectType({ description: 'Entity for Attendee' })\nexport class Attendee {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column()\n @Field({ nullable: true })\n email: string\n\n @ManyToMany(() => Event)\n @JoinTable()\n @Field({ nullable: true })\n events: Event[]\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const attendee_1 = require("./attendee");
|
|
5
|
+
const attendee_query_1 = require("./attendee-query");
|
|
6
|
+
const attendee_mutation_1 = require("./attendee-mutation");
|
|
7
|
+
exports.entities = [attendee_1.Attendee];
|
|
8
|
+
exports.resolvers = [attendee_query_1.AttendeeQuery, attendee_mutation_1.AttendeeMutation];
|
|
9
|
+
exports.subscribers = [];
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/attendee/index.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,qDAAgD;AAChD,2DAAsD;AAEzC,QAAA,QAAQ,GAAG,CAAC,mBAAQ,CAAC,CAAA;AACrB,QAAA,SAAS,GAAG,CAAC,8BAAa,EAAE,oCAAgB,CAAC,CAAA;AAC7C,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { Attendee } from './attendee'\nimport { AttendeeQuery } from './attendee-query'\nimport { AttendeeMutation } from './attendee-mutation'\n\nexport const entities = [Attendee]\nexport const resolvers = [AttendeeQuery, AttendeeMutation]\nexport const subscribers = []\n"]}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalendarMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const attachment_base_1 = require("@things-factory/attachment-base");
|
|
8
|
+
const calendar_1 = require("./calendar");
|
|
9
|
+
const calendar_type_1 = require("./calendar-type");
|
|
10
|
+
let CalendarMutation = class CalendarMutation {
|
|
11
|
+
async createCalendar(calendar, context) {
|
|
12
|
+
const { domain, user, tx } = context.state;
|
|
13
|
+
const result = await tx.getRepository(calendar_1.Calendar).save(Object.assign(Object.assign({}, calendar), { domain, creator: user, updater: user }));
|
|
14
|
+
if (calendar.thumbnail) {
|
|
15
|
+
await (0, attachment_base_1.createAttachment)(null, {
|
|
16
|
+
attachment: {
|
|
17
|
+
file: calendar.thumbnail,
|
|
18
|
+
refType: calendar_1.Calendar.name,
|
|
19
|
+
refBy: result.id
|
|
20
|
+
}
|
|
21
|
+
}, context);
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
async updateCalendar(id, patch, context) {
|
|
26
|
+
const { domain, user, tx } = context.state;
|
|
27
|
+
const repository = tx.getRepository(calendar_1.Calendar);
|
|
28
|
+
const calendar = await repository.findOne({
|
|
29
|
+
where: { domain: { id: domain.id }, id }
|
|
30
|
+
});
|
|
31
|
+
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, calendar), patch), { updater: user }));
|
|
32
|
+
if (patch.thumbnail) {
|
|
33
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [result.id] }, context);
|
|
34
|
+
await (0, attachment_base_1.createAttachment)(null, {
|
|
35
|
+
attachment: {
|
|
36
|
+
file: patch.thumbnail,
|
|
37
|
+
refType: calendar_1.Calendar.name,
|
|
38
|
+
refBy: result.id
|
|
39
|
+
}
|
|
40
|
+
}, context);
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
async updateMultipleCalendar(patches, context) {
|
|
45
|
+
const { domain, user, tx } = context.state;
|
|
46
|
+
let results = [];
|
|
47
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
48
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
49
|
+
const calendarRepo = tx.getRepository(calendar_1.Calendar);
|
|
50
|
+
if (_createRecords.length > 0) {
|
|
51
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
52
|
+
const newRecord = _createRecords[i];
|
|
53
|
+
const result = await calendarRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
54
|
+
if (newRecord.thumbnail) {
|
|
55
|
+
await (0, attachment_base_1.createAttachment)(null, {
|
|
56
|
+
attachment: {
|
|
57
|
+
file: newRecord.thumbnail,
|
|
58
|
+
refType: calendar_1.Calendar.name,
|
|
59
|
+
refBy: result.id
|
|
60
|
+
}
|
|
61
|
+
}, context);
|
|
62
|
+
}
|
|
63
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (_updateRecords.length > 0) {
|
|
67
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
68
|
+
const updateRecord = _updateRecords[i];
|
|
69
|
+
const calendar = await calendarRepo.findOneBy({ id: updateRecord.id });
|
|
70
|
+
const result = await calendarRepo.save(Object.assign(Object.assign(Object.assign({}, calendar), updateRecord), { updater: user }));
|
|
71
|
+
if (updateRecord.thumbnail) {
|
|
72
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [result.id] }, context);
|
|
73
|
+
await (0, attachment_base_1.createAttachment)(null, {
|
|
74
|
+
attachment: {
|
|
75
|
+
file: updateRecord.thumbnail,
|
|
76
|
+
refType: calendar_1.Calendar.name,
|
|
77
|
+
refBy: result.id
|
|
78
|
+
}
|
|
79
|
+
}, context);
|
|
80
|
+
}
|
|
81
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return results;
|
|
85
|
+
}
|
|
86
|
+
async deleteCalendar(id, context) {
|
|
87
|
+
const { domain, tx } = context.state;
|
|
88
|
+
await tx.getRepository(calendar_1.Calendar).delete({ domain: { id: domain.id }, id });
|
|
89
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
async deleteCalendars(ids, context) {
|
|
93
|
+
const { domain, tx } = context.state;
|
|
94
|
+
await tx.getRepository(calendar_1.Calendar).delete({
|
|
95
|
+
domain: { id: domain.id },
|
|
96
|
+
id: (0, typeorm_1.In)(ids)
|
|
97
|
+
});
|
|
98
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: ids }, context);
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
async importCalendars(calendars, context) {
|
|
102
|
+
const { domain, tx } = context.state;
|
|
103
|
+
await Promise.all(calendars.map(async (calendar) => {
|
|
104
|
+
const createdCalendar = await tx.getRepository(calendar_1.Calendar).save(Object.assign({ domain }, calendar));
|
|
105
|
+
}));
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
tslib_1.__decorate([
|
|
110
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
111
|
+
(0, type_graphql_1.Mutation)(returns => calendar_1.Calendar, { description: 'To create new Calendar' }),
|
|
112
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('calendar')),
|
|
113
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
114
|
+
tslib_1.__metadata("design:type", Function),
|
|
115
|
+
tslib_1.__metadata("design:paramtypes", [calendar_type_1.NewCalendar, Object]),
|
|
116
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
117
|
+
], CalendarMutation.prototype, "createCalendar", null);
|
|
118
|
+
tslib_1.__decorate([
|
|
119
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
120
|
+
(0, type_graphql_1.Mutation)(returns => calendar_1.Calendar, { description: 'To modify Calendar information' }),
|
|
121
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
122
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
123
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
124
|
+
tslib_1.__metadata("design:type", Function),
|
|
125
|
+
tslib_1.__metadata("design:paramtypes", [String, calendar_type_1.CalendarPatch, Object]),
|
|
126
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
127
|
+
], CalendarMutation.prototype, "updateCalendar", null);
|
|
128
|
+
tslib_1.__decorate([
|
|
129
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
130
|
+
(0, type_graphql_1.Mutation)(returns => [calendar_1.Calendar], { description: "To modify multiple Calendars' information" }),
|
|
131
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [calendar_type_1.CalendarPatch])),
|
|
132
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
133
|
+
tslib_1.__metadata("design:type", Function),
|
|
134
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
135
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
136
|
+
], CalendarMutation.prototype, "updateMultipleCalendar", null);
|
|
137
|
+
tslib_1.__decorate([
|
|
138
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
139
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Calendar' }),
|
|
140
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
141
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
142
|
+
tslib_1.__metadata("design:type", Function),
|
|
143
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
144
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
145
|
+
], CalendarMutation.prototype, "deleteCalendar", null);
|
|
146
|
+
tslib_1.__decorate([
|
|
147
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
148
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple Calendars' }),
|
|
149
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
150
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
151
|
+
tslib_1.__metadata("design:type", Function),
|
|
152
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
153
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
154
|
+
], CalendarMutation.prototype, "deleteCalendars", null);
|
|
155
|
+
tslib_1.__decorate([
|
|
156
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
157
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple Calendars' }),
|
|
158
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('calendars', type => [calendar_type_1.CalendarPatch])),
|
|
159
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
160
|
+
tslib_1.__metadata("design:type", Function),
|
|
161
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
162
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
163
|
+
], CalendarMutation.prototype, "importCalendars", null);
|
|
164
|
+
CalendarMutation = tslib_1.__decorate([
|
|
165
|
+
(0, type_graphql_1.Resolver)(calendar_1.Calendar)
|
|
166
|
+
], CalendarMutation);
|
|
167
|
+
exports.CalendarMutation = CalendarMutation;
|
|
168
|
+
//# sourceMappingURL=calendar-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-mutation.js","sourceRoot":"","sources":["../../../server/service/calendar/calendar-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,yCAAqC;AACrC,mDAA4D;AAGrD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGrB,AAAN,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAwB;QAC1F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAC,IAAI,iCAC/C,QAAQ,KACX,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,IAAI,QAAQ,CAAC,SAAS,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AAE,CAAC;IAE3E,mBAAA,IAAA,kBAAG,EAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,6BAAa,CAAC,CAAC,CAAA;IACzC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uDAWP;AA3LU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,gBAAgB,CA4L5B;AA5LY,4CAAgB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { Calendar } from './calendar'\nimport { NewCalendar, CalendarPatch } from './calendar-type'\n\n@Resolver(Calendar)\nexport class CalendarMutation {\n @Directive('@transaction')\n @Mutation(returns => Calendar, { description: 'To create new Calendar' })\n async createCalendar(@Arg('calendar') calendar: NewCalendar, @Ctx() context: ResolverContext): Promise<Calendar> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(Calendar).save({\n ...calendar,\n domain,\n creator: user,\n updater: user\n })\n\n if (calendar.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: calendar.thumbnail,\n refType: Calendar.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => Calendar, { description: 'To modify Calendar information' })\n async updateCalendar(\n @Arg('id') id: string,\n @Arg('patch') patch: CalendarPatch,\n @Ctx() context: ResolverContext\n ): Promise<Calendar> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Calendar)\n const calendar = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...calendar,\n ...patch,\n updater: user\n })\n\n if (patch.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: patch.thumbnail,\n refType: Calendar.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [Calendar], { description: \"To modify multiple Calendars' information\" })\n async updateMultipleCalendar(\n @Arg('patches', type => [CalendarPatch]) patches: CalendarPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Calendar[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const calendarRepo = tx.getRepository(Calendar)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await calendarRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n if (newRecord.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: newRecord.thumbnail,\n refType: Calendar.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const calendar = await calendarRepo.findOneBy({ id: updateRecord.id })\n\n const result = await calendarRepo.save({\n ...calendar,\n ...updateRecord,\n updater: user\n })\n\n if (updateRecord.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: updateRecord.thumbnail,\n refType: Calendar.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete Calendar' })\n async deleteCalendar(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Calendar).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Calendars' })\n async deleteCalendars(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Calendar).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple Calendars' })\n async importCalendars(\n @Arg('calendars', type => [CalendarPatch]) calendars: CalendarPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n calendars.map(async (calendar: CalendarPatch) => {\n const createdCalendar: Calendar = await tx.getRepository(Calendar).save({ domain, ...calendar })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalendarQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const attachment_base_1 = require("@things-factory/attachment-base");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
+
const calendar_1 = require("./calendar");
|
|
10
|
+
const calendar_type_1 = require("./calendar-type");
|
|
11
|
+
let CalendarQuery = class CalendarQuery {
|
|
12
|
+
async calendar(id, context) {
|
|
13
|
+
const { domain } = context.state;
|
|
14
|
+
return await (0, shell_1.getRepository)(calendar_1.Calendar).findOne({
|
|
15
|
+
where: { domain: { id: domain.id }, id }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async calendars(params, context) {
|
|
19
|
+
const { domain } = context.state;
|
|
20
|
+
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
21
|
+
domain,
|
|
22
|
+
params,
|
|
23
|
+
repository: await (0, shell_1.getRepository)(calendar_1.Calendar),
|
|
24
|
+
searchables: ['name', 'description']
|
|
25
|
+
});
|
|
26
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
27
|
+
return { items, total };
|
|
28
|
+
}
|
|
29
|
+
async thumbnail(calendar) {
|
|
30
|
+
const attachment = await (0, shell_1.getRepository)(attachment_base_1.Attachment).findOne({
|
|
31
|
+
where: {
|
|
32
|
+
domain: { id: calendar.domainId },
|
|
33
|
+
refType: calendar_1.Calendar.name,
|
|
34
|
+
refBy: calendar.id
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return attachment === null || attachment === void 0 ? void 0 : attachment.fullpath;
|
|
38
|
+
}
|
|
39
|
+
async domain(calendar) {
|
|
40
|
+
return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: calendar.domainId });
|
|
41
|
+
}
|
|
42
|
+
async updater(calendar) {
|
|
43
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: calendar.updaterId });
|
|
44
|
+
}
|
|
45
|
+
async creator(calendar) {
|
|
46
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: calendar.creatorId });
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, type_graphql_1.Query)(returns => calendar_1.Calendar, { nullable: true, description: 'To fetch a Calendar' }),
|
|
51
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
52
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
53
|
+
tslib_1.__metadata("design:type", Function),
|
|
54
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
55
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
56
|
+
], CalendarQuery.prototype, "calendar", null);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, type_graphql_1.Query)(returns => calendar_type_1.CalendarList, { description: 'To fetch multiple Calendars' }),
|
|
59
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
60
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
61
|
+
tslib_1.__metadata("design:type", Function),
|
|
62
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
63
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
64
|
+
], CalendarQuery.prototype, "calendars", null);
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, type_graphql_1.FieldResolver)(type => String),
|
|
67
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
68
|
+
tslib_1.__metadata("design:type", Function),
|
|
69
|
+
tslib_1.__metadata("design:paramtypes", [calendar_1.Calendar]),
|
|
70
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
71
|
+
], CalendarQuery.prototype, "thumbnail", null);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
74
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
75
|
+
tslib_1.__metadata("design:type", Function),
|
|
76
|
+
tslib_1.__metadata("design:paramtypes", [calendar_1.Calendar]),
|
|
77
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
78
|
+
], CalendarQuery.prototype, "domain", null);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
81
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
82
|
+
tslib_1.__metadata("design:type", Function),
|
|
83
|
+
tslib_1.__metadata("design:paramtypes", [calendar_1.Calendar]),
|
|
84
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
85
|
+
], CalendarQuery.prototype, "updater", null);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
88
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
89
|
+
tslib_1.__metadata("design:type", Function),
|
|
90
|
+
tslib_1.__metadata("design:paramtypes", [calendar_1.Calendar]),
|
|
91
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
92
|
+
], CalendarQuery.prototype, "creator", null);
|
|
93
|
+
CalendarQuery = tslib_1.__decorate([
|
|
94
|
+
(0, type_graphql_1.Resolver)(calendar_1.Calendar)
|
|
95
|
+
], CalendarQuery);
|
|
96
|
+
exports.CalendarQuery = CalendarQuery;
|
|
97
|
+
//# sourceMappingURL=calendar-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-query.js","sourceRoot":"","sources":["../../../server/service/calendar/calendar-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,yCAAqC;AACrC,mDAA8C;AAGvC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAElB,AAAN,KAAK,CAAC,QAAQ,CAAY,EAAU,EAAS,OAAwB;QACnE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CAAS,MAAiB,EAAS,OAAwB;QACxE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC;YACzC,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE,CAAA;QAE3D,OAAO,EAAE,KAAK,EAAE,KAAK,E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E,CAAC,4BAAY,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAC9D,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;8CAaxC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;8CAUzC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;2CAEtC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAW,mBAAQ;;4CAEvC;AApDU,aAAa;IADzB,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,aAAa,CAqDzB;AArDY,sCAAa","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Calendar } from './calendar'\nimport { CalendarList } from './calendar-type'\n\n@Resolver(Calendar)\nexport class CalendarQuery {\n @Query(returns => Calendar!, { nullable: true, description: 'To fetch a Calendar' })\n async calendar(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Calendar> {\n const { domain } = context.state\n\n return await getRepository(Calendar).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => CalendarList, { description: 'To fetch multiple Calendars' })\n async calendars(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<CalendarList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(Calendar),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() calendar: Calendar): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n domain: { id: calendar.domainId },\n refType: Calendar.name,\n refBy: calendar.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() calendar: Calendar): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: calendar.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() calendar: Calendar): Promise<User> {\n return await getRepository(User).findOneBy({ id: calendar.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() calendar: Calendar): Promise<User> {\n return await getRepository(User).findOneBy({ id: calendar.creatorId })\n }\n}\n"]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalendarList = exports.CalendarPatch = exports.NewCalendar = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const GraphQLUpload_js_1 = tslib_1.__importDefault(require("graphql-upload/GraphQLUpload.js"));
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const calendar_1 = require("./calendar");
|
|
8
|
+
let NewCalendar = class NewCalendar {
|
|
9
|
+
};
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, type_graphql_1.Field)(),
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
13
|
+
], NewCalendar.prototype, "name", void 0);
|
|
14
|
+
tslib_1.__decorate([
|
|
15
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
16
|
+
tslib_1.__metadata("design:type", String)
|
|
17
|
+
], NewCalendar.prototype, "description", void 0);
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, type_graphql_1.Field)(type => calendar_1.CalendarStatus, { nullable: true }),
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
21
|
+
], NewCalendar.prototype, "state", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
24
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
25
|
+
], NewCalendar.prototype, "active", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
28
|
+
tslib_1.__metadata("design:type", String)
|
|
29
|
+
], NewCalendar.prototype, "params", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
|
|
32
|
+
tslib_1.__metadata("design:type", Object)
|
|
33
|
+
], NewCalendar.prototype, "thumbnail", void 0);
|
|
34
|
+
NewCalendar = tslib_1.__decorate([
|
|
35
|
+
(0, type_graphql_1.InputType)()
|
|
36
|
+
], NewCalendar);
|
|
37
|
+
exports.NewCalendar = NewCalendar;
|
|
38
|
+
let CalendarPatch = class CalendarPatch {
|
|
39
|
+
};
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], CalendarPatch.prototype, "id", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], CalendarPatch.prototype, "name", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
50
|
+
tslib_1.__metadata("design:type", String)
|
|
51
|
+
], CalendarPatch.prototype, "description", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, type_graphql_1.Field)(type => calendar_1.CalendarStatus, { nullable: true }),
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
55
|
+
], CalendarPatch.prototype, "state", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
58
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
59
|
+
], CalendarPatch.prototype, "active", void 0);
|
|
60
|
+
tslib_1.__decorate([
|
|
61
|
+
(0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
|
|
62
|
+
tslib_1.__metadata("design:type", Object)
|
|
63
|
+
], CalendarPatch.prototype, "thumbnail", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
67
|
+
], CalendarPatch.prototype, "cuFlag", void 0);
|
|
68
|
+
CalendarPatch = tslib_1.__decorate([
|
|
69
|
+
(0, type_graphql_1.InputType)()
|
|
70
|
+
], CalendarPatch);
|
|
71
|
+
exports.CalendarPatch = CalendarPatch;
|
|
72
|
+
let CalendarList = class CalendarList {
|
|
73
|
+
};
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, type_graphql_1.Field)(type => [calendar_1.Calendar]),
|
|
76
|
+
tslib_1.__metadata("design:type", Array)
|
|
77
|
+
], CalendarList.prototype, "items", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
80
|
+
tslib_1.__metadata("design:type", Number)
|
|
81
|
+
], CalendarList.prototype, "total", void 0);
|
|
82
|
+
CalendarList = tslib_1.__decorate([
|
|
83
|
+
(0, type_graphql_1.ObjectType)()
|
|
84
|
+
], CalendarList);
|
|
85
|
+
exports.CalendarList = CalendarList;
|
|
86
|
+
//# sourceMappingURL=calendar-type.js.map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;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC3B;AAEtB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;AApBJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAqBzB;AArBY,sCAAa;AAwBnB,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mBAAQ,CAAC,CAAC;;2CACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;AALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB;AANY,oCAAY","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { Calendar, CalendarStatus } from './calendar'\n\n@InputType()\nexport class NewCalendar {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => CalendarStatus, { nullable: true })\n state?: CalendarStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class CalendarPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => CalendarStatus, { nullable: true })\n state?: CalendarStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class CalendarList {\n @Field(type => [Calendar])\n items: Calendar[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Calendar = exports.CalendarStatus = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
+
var CalendarStatus;
|
|
10
|
+
(function (CalendarStatus) {
|
|
11
|
+
CalendarStatus["STATUS_A"] = "STATUS_A";
|
|
12
|
+
CalendarStatus["STATUS_B"] = "STATUS_B";
|
|
13
|
+
})(CalendarStatus = exports.CalendarStatus || (exports.CalendarStatus = {}));
|
|
14
|
+
(0, type_graphql_1.registerEnumType)(CalendarStatus, {
|
|
15
|
+
name: 'CalendarStatus',
|
|
16
|
+
description: 'state enumeration of a calendar'
|
|
17
|
+
});
|
|
18
|
+
let Calendar = class Calendar {
|
|
19
|
+
};
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
24
|
+
], Calendar.prototype, "id", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
27
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
28
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
29
|
+
], Calendar.prototype, "domain", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.RelationId)((calendar) => calendar.domain),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], Calendar.prototype, "domainId", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, typeorm_1.Column)(),
|
|
36
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
37
|
+
tslib_1.__metadata("design:type", String)
|
|
38
|
+
], Calendar.prototype, "name", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
41
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], Calendar.prototype, "description", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
47
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
48
|
+
], Calendar.prototype, "active", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
52
|
+
tslib_1.__metadata("design:type", String)
|
|
53
|
+
], Calendar.prototype, "state", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
56
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
57
|
+
tslib_1.__metadata("design:type", String)
|
|
58
|
+
], Calendar.prototype, "params", void 0);
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
61
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
62
|
+
tslib_1.__metadata("design:type", Date)
|
|
63
|
+
], Calendar.prototype, "createdAt", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
66
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
67
|
+
tslib_1.__metadata("design:type", Date)
|
|
68
|
+
], Calendar.prototype, "updatedAt", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
71
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
72
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
73
|
+
], Calendar.prototype, "creator", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, typeorm_1.RelationId)((calendar) => calendar.creator),
|
|
76
|
+
tslib_1.__metadata("design:type", String)
|
|
77
|
+
], Calendar.prototype, "creatorId", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
80
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
81
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
82
|
+
], Calendar.prototype, "updater", void 0);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, typeorm_1.RelationId)((calendar) => calendar.updater),
|
|
85
|
+
tslib_1.__metadata("design:type", String)
|
|
86
|
+
], Calendar.prototype, "updaterId", void 0);
|
|
87
|
+
Calendar = tslib_1.__decorate([
|
|
88
|
+
(0, typeorm_1.Entity)(),
|
|
89
|
+
(0, typeorm_1.Index)('ix_calendar_0', (calendar) => [calendar.domain, calendar.name], { unique: true }),
|
|
90
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for Calendar' })
|
|
91
|
+
], Calendar);
|
|
92
|
+
exports.Calendar = Calendar;
|
|
93
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../server/service/calendar/calendar.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAA2E;AA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AAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;GACtC,QAAQ,CAqDpB;AArDY,4BAAQ","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum CalendarStatus {\n STATUS_A = 'STATUS_A',\n STATUS_B = 'STATUS_B'\n}\n\nregisterEnumType(CalendarStatus, {\n name: 'CalendarStatus',\n description: 'state enumeration of a calendar'\n})\n\n@Entity()\n@Index('ix_calendar_0', (calendar: Calendar) => [calendar.domain, calendar.name], { unique: true })\n@ObjectType({ description: 'Entity for Calendar' })\nexport class Calendar {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((calendar: Calendar) => calendar.domain)\n domainId?: string\n\n @Column()\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n state?: CalendarStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((calendar: Calendar) => calendar.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((calendar: Calendar) => calendar.updater)\n updaterId?: string\n}\n"]}
|