@things-factory/contact 6.0.0-zeta.26
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/contact/contact-importer.ts +97 -0
- package/client/pages/contact/contact-list-page.ts +348 -0
- package/client/route.ts +7 -0
- package/client/tsconfig.json +11 -0
- package/dist-client/actions/main.d.ts +1 -0
- package/dist-client/actions/main.js +2 -0
- package/dist-client/actions/main.js.map +1 -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/components/contact-editor.d.ts +3 -0
- package/dist-client/components/contact-editor.js +4 -0
- package/dist-client/components/contact-editor.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/address/address-importer.d.ts +22 -0
- package/dist-client/pages/address/address-importer.js +100 -0
- package/dist-client/pages/address/address-importer.js.map +1 -0
- package/dist-client/pages/address/address-list-page.d.ts +62 -0
- package/dist-client/pages/address/address-list-page.js +326 -0
- package/dist-client/pages/address/address-list-page.js.map +1 -0
- package/dist-client/pages/contact/contact-importer.d.ts +22 -0
- package/dist-client/pages/contact/contact-importer.js +100 -0
- package/dist-client/pages/contact/contact-importer.js.map +1 -0
- package/dist-client/pages/contact/contact-list-page.d.ts +62 -0
- package/dist-client/pages/contact/contact-list-page.js +326 -0
- package/dist-client/pages/contact/contact-list-page.js.map +1 -0
- package/dist-client/pages/contact-item/contact-item-importer.d.ts +22 -0
- package/dist-client/pages/contact-item/contact-item-importer.js +100 -0
- package/dist-client/pages/contact-item/contact-item-importer.js.map +1 -0
- package/dist-client/pages/contact-item/contact-item-list-page.d.ts +62 -0
- package/dist-client/pages/contact-item/contact-item-list-page.js +326 -0
- package/dist-client/pages/contact-item/contact-item-list-page.js.map +1 -0
- package/dist-client/pages/email/email-importer.d.ts +22 -0
- package/dist-client/pages/email/email-importer.js +100 -0
- package/dist-client/pages/email/email-importer.js.map +1 -0
- package/dist-client/pages/email/email-list-page.d.ts +62 -0
- package/dist-client/pages/email/email-list-page.js +326 -0
- package/dist-client/pages/email/email-list-page.js.map +1 -0
- package/dist-client/pages/main.d.ts +1 -0
- package/dist-client/pages/main.js +27 -0
- package/dist-client/pages/main.js.map +1 -0
- package/dist-client/pages/phone/phone-importer.d.ts +22 -0
- package/dist-client/pages/phone/phone-importer.js +100 -0
- package/dist-client/pages/phone/phone-importer.js.map +1 -0
- package/dist-client/pages/phone/phone-list-page.d.ts +62 -0
- package/dist-client/pages/phone/phone-list-page.js +326 -0
- package/dist-client/pages/phone/phone-list-page.js.map +1 -0
- package/dist-client/reducers/main.d.ts +6 -0
- package/dist-client/reducers/main.js +14 -0
- package/dist-client/reducers/main.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +8 -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/contact/contact-item.js +44 -0
- package/dist-server/service/contact/contact-item.js.map +1 -0
- package/dist-server/service/contact/contact-mutation.js +168 -0
- package/dist-server/service/contact/contact-mutation.js.map +1 -0
- package/dist-server/service/contact/contact-query.js +94 -0
- package/dist-server/service/contact/contact-query.js.map +1 -0
- package/dist-server/service/contact/contact-type.js +50 -0
- package/dist-server/service/contact/contact-type.js.map +1 -0
- package/dist-server/service/contact/contact.js +96 -0
- package/dist-server/service/contact/contact.js.map +1 -0
- package/dist-server/service/contact/index.js +10 -0
- package/dist-server/service/contact/index.js.map +1 -0
- package/dist-server/service/index.js +23 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/helps/contact/contact.md +160 -0
- package/package.json +37 -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/contact/contact-item.ts +31 -0
- package/server/service/contact/contact-mutation.ts +195 -0
- package/server/service/contact/contact-query.ts +59 -0
- package/server/service/contact/contact-type.ts +35 -0
- package/server/service/contact/contact.ts +89 -0
- package/server/service/contact/index.ts +7 -0
- package/server/service/index.ts +22 -0
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +8 -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,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContactQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
7
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
+
const contact_1 = require("./contact");
|
|
9
|
+
const contact_item_1 = require("./contact-item");
|
|
10
|
+
const contact_type_1 = require("./contact-type");
|
|
11
|
+
let ContactQuery = class ContactQuery {
|
|
12
|
+
async contact(id, context) {
|
|
13
|
+
const { domain } = context.state;
|
|
14
|
+
return await (0, shell_1.getRepository)(contact_1.Contact).findOne({
|
|
15
|
+
where: { domain: { id: domain.id }, id }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async contacts(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)(contact_item_1.ContactItem),
|
|
24
|
+
searchables: ['value']
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Contact의 domain이 해당되는 범위에서 ContactItem의 value를 검색한다.
|
|
28
|
+
* 그런 후에 distinct 한 contact 들을 리턴한다.
|
|
29
|
+
*/
|
|
30
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
31
|
+
return { items, total };
|
|
32
|
+
}
|
|
33
|
+
async items(contact) {
|
|
34
|
+
return await (0, shell_1.getRepository)(contact_item_1.ContactItem).findBy({ contact: { id: contact.id } });
|
|
35
|
+
}
|
|
36
|
+
async domain(contact) {
|
|
37
|
+
return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: contact.domainId });
|
|
38
|
+
}
|
|
39
|
+
async updater(contact) {
|
|
40
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: contact.updaterId });
|
|
41
|
+
}
|
|
42
|
+
async creator(contact) {
|
|
43
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: contact.creatorId });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, type_graphql_1.Query)(returns => contact_1.Contact, { nullable: true, description: 'To fetch a Contact' }),
|
|
48
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
49
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
50
|
+
tslib_1.__metadata("design:type", Function),
|
|
51
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
52
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
53
|
+
], ContactQuery.prototype, "contact", null);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, type_graphql_1.Query)(returns => contact_type_1.ContactList, { description: 'To fetch multiple Contacts' }),
|
|
56
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
57
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
58
|
+
tslib_1.__metadata("design:type", Function),
|
|
59
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
60
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
61
|
+
], ContactQuery.prototype, "contacts", null);
|
|
62
|
+
tslib_1.__decorate([
|
|
63
|
+
(0, type_graphql_1.FieldResolver)(type => [contact_item_1.ContactItem]),
|
|
64
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
65
|
+
tslib_1.__metadata("design:type", Function),
|
|
66
|
+
tslib_1.__metadata("design:paramtypes", [contact_1.Contact]),
|
|
67
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
68
|
+
], ContactQuery.prototype, "items", null);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
71
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
72
|
+
tslib_1.__metadata("design:type", Function),
|
|
73
|
+
tslib_1.__metadata("design:paramtypes", [contact_1.Contact]),
|
|
74
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
75
|
+
], ContactQuery.prototype, "domain", null);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
78
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
79
|
+
tslib_1.__metadata("design:type", Function),
|
|
80
|
+
tslib_1.__metadata("design:paramtypes", [contact_1.Contact]),
|
|
81
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
82
|
+
], ContactQuery.prototype, "updater", null);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
85
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
86
|
+
tslib_1.__metadata("design:type", Function),
|
|
87
|
+
tslib_1.__metadata("design:paramtypes", [contact_1.Contact]),
|
|
88
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
89
|
+
], ContactQuery.prototype, "creator", null);
|
|
90
|
+
ContactQuery = tslib_1.__decorate([
|
|
91
|
+
(0, type_graphql_1.Resolver)(contact_1.Contact)
|
|
92
|
+
], ContactQuery);
|
|
93
|
+
exports.ContactQuery = ContactQuery;
|
|
94
|
+
//# sourceMappingURL=contact-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-query.js","sourceRoot":"","sources":["../../../server/service/contact/contact-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,iDAAuG;AACvG,yDAAgD;AAChD,uCAAmC;AACnC,iDAA4C;AAC5C,iDAA4C;AAGrC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAwB;QAClE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,iBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CAAS,MAAiB,EAAS,OAAwB;QACvE,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,0BAAW,CAAC;YAC5C,WAAW,EAAE,CAAC,OAAO,CAAC;SACvB,CAAC,CAAA;QAEF;;;WAGG;QAEH,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY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A,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;4CAkBvC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,0BAAW,CAAC,CAAC;IACxB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,iBAAO;;yCAEnC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,iBAAO;;0CAEpC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,iBAAO;;2CAErC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,iBAAO;;2CAErC;AAjDU,YAAY;IADxB,IAAA,uBAAQ,EAAC,iBAAO,CAAC;GACL,YAAY,CAkDxB;AAlDY,oCAAY","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Contact } from './contact'\nimport { ContactItem } from './contact-item'\nimport { ContactList } from './contact-type'\n\n@Resolver(Contact)\nexport class ContactQuery {\n @Query(returns => Contact!, { nullable: true, description: 'To fetch a Contact' })\n async contact(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Contact> {\n const { domain } = context.state\n\n return await getRepository(Contact).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => ContactList, { description: 'To fetch multiple Contacts' })\n async contacts(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ContactList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(ContactItem),\n searchables: ['value']\n })\n\n /**\n * Contact의 domain이 해당되는 범위에서 ContactItem의 value를 검색한다.\n * 그런 후에 distinct 한 contact 들을 리턴한다.\n */\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => [ContactItem])\n async items(@Root() contact: Contact): Promise<ContactItem[]> {\n return await getRepository(ContactItem).findBy({ contact: { id: contact.id } })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() contact: Contact): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: contact.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() contact: Contact): Promise<User> {\n return await getRepository(User).findOneBy({ id: contact.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() contact: Contact): Promise<User> {\n return await getRepository(User).findOneBy({ id: contact.creatorId })\n }\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContactList = exports.ContactPatch = exports.NewContact = 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 contact_1 = require("./contact");
|
|
8
|
+
let NewContact = class NewContact {
|
|
9
|
+
};
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
|
|
12
|
+
tslib_1.__metadata("design:type", Object)
|
|
13
|
+
], NewContact.prototype, "thumbnail", void 0);
|
|
14
|
+
NewContact = tslib_1.__decorate([
|
|
15
|
+
(0, type_graphql_1.InputType)()
|
|
16
|
+
], NewContact);
|
|
17
|
+
exports.NewContact = NewContact;
|
|
18
|
+
let ContactPatch = class ContactPatch {
|
|
19
|
+
};
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
22
|
+
tslib_1.__metadata("design:type", String)
|
|
23
|
+
], ContactPatch.prototype, "id", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true }),
|
|
26
|
+
tslib_1.__metadata("design:type", Object)
|
|
27
|
+
], ContactPatch.prototype, "thumbnail", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
31
|
+
], ContactPatch.prototype, "cuFlag", void 0);
|
|
32
|
+
ContactPatch = tslib_1.__decorate([
|
|
33
|
+
(0, type_graphql_1.InputType)()
|
|
34
|
+
], ContactPatch);
|
|
35
|
+
exports.ContactPatch = ContactPatch;
|
|
36
|
+
let ContactList = class ContactList {
|
|
37
|
+
};
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, type_graphql_1.Field)(type => [contact_1.Contact]),
|
|
40
|
+
tslib_1.__metadata("design:type", Array)
|
|
41
|
+
], ContactList.prototype, "items", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
44
|
+
tslib_1.__metadata("design:type", Number)
|
|
45
|
+
], ContactList.prototype, "total", void 0);
|
|
46
|
+
ContactList = tslib_1.__decorate([
|
|
47
|
+
(0, type_graphql_1.ObjectType)()
|
|
48
|
+
], ContactList);
|
|
49
|
+
exports.ContactList = ContactList;
|
|
50
|
+
//# sourceMappingURL=contact-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-type.js","sourceRoot":"","sources":["../../../server/service/contact/contact-type.ts"],"names":[],"mappings":";;;;AACA,+FAA2D;AAC3D,+CAAsF;AAItF,uCAAmC;AAI5B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAGtB,CAAA;AAFC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC3B;AAFX,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAGtB;AAHY,gCAAU;AAMhB,IAAM,YAAY,GAAlB,MAAM,YAAY;CASxB,CAAA;AARC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CAC3B;AAEtB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACX;AARJ,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CASxB;AATY,oCAAY;AAYlB,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,iBAAO,CAAC,CAAC;;0CACT;AAEhB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;0CACN;AALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB;AANY,kCAAW","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 { Contact } from './contact'\nimport { ContactItem } from './contact-item'\n\n@InputType()\nexport class NewContact {\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n}\n\n@InputType()\nexport class ContactPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field(type => GraphQLUpload, { nullable: true })\n thumbnail?: FileUpload\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ContactList {\n @Field(type => [Contact])\n items: Contact[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Contact = exports.ContactField = 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
|
+
const contact_item_1 = require("./contact-item");
|
|
10
|
+
var ContactField;
|
|
11
|
+
(function (ContactField) {
|
|
12
|
+
ContactField["Name"] = "name";
|
|
13
|
+
ContactField["JobTitle"] = "job-title";
|
|
14
|
+
ContactField["Phone"] = "phone";
|
|
15
|
+
ContactField["Address"] = "address";
|
|
16
|
+
ContactField["Email"] = "email";
|
|
17
|
+
ContactField["Birthday"] = "birthday";
|
|
18
|
+
ContactField["Profile"] = "profile";
|
|
19
|
+
ContactField["Picture"] = "picture";
|
|
20
|
+
ContactField["Department"] = "department";
|
|
21
|
+
ContactField["Company"] = "company";
|
|
22
|
+
ContactField["Homepage"] = "homepage";
|
|
23
|
+
})(ContactField = exports.ContactField || (exports.ContactField = {}));
|
|
24
|
+
(0, type_graphql_1.registerEnumType)(ContactField, {
|
|
25
|
+
name: 'ContactField',
|
|
26
|
+
description: 'field enumeration of a contact'
|
|
27
|
+
});
|
|
28
|
+
let Contact = class Contact {
|
|
29
|
+
};
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
32
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
33
|
+
tslib_1.__metadata("design:type", String)
|
|
34
|
+
], Contact.prototype, "id", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
37
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
38
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
39
|
+
], Contact.prototype, "domain", void 0);
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
(0, typeorm_1.RelationId)((contact) => contact.domain),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], Contact.prototype, "domainId", 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", String)
|
|
48
|
+
], Contact.prototype, "note", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, typeorm_1.OneToMany)(type => contact_item_1.ContactItem, contactItem => contactItem.contact),
|
|
51
|
+
(0, type_graphql_1.Field)(type => [contact_item_1.ContactItem]),
|
|
52
|
+
tslib_1.__metadata("design:type", Array)
|
|
53
|
+
], Contact.prototype, "items", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
56
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
57
|
+
tslib_1.__metadata("design:type", Date)
|
|
58
|
+
], Contact.prototype, "createdAt", void 0);
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
61
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
62
|
+
tslib_1.__metadata("design:type", Date)
|
|
63
|
+
], Contact.prototype, "updatedAt", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
66
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
67
|
+
tslib_1.__metadata("design:type", Date)
|
|
68
|
+
], Contact.prototype, "deletedAt", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
71
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
72
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
73
|
+
], Contact.prototype, "creator", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, typeorm_1.RelationId)((contact) => contact.creator),
|
|
76
|
+
tslib_1.__metadata("design:type", String)
|
|
77
|
+
], Contact.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)({ nullable: true }),
|
|
81
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
82
|
+
], Contact.prototype, "updater", void 0);
|
|
83
|
+
tslib_1.__decorate([
|
|
84
|
+
(0, typeorm_1.RelationId)((contact) => contact.updater),
|
|
85
|
+
tslib_1.__metadata("design:type", String)
|
|
86
|
+
], Contact.prototype, "updaterId", void 0);
|
|
87
|
+
tslib_1.__decorate([
|
|
88
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true }),
|
|
89
|
+
tslib_1.__metadata("design:type", String)
|
|
90
|
+
], Contact.prototype, "thumbnail", void 0);
|
|
91
|
+
Contact = tslib_1.__decorate([
|
|
92
|
+
(0, typeorm_1.Entity)(),
|
|
93
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for Contact' })
|
|
94
|
+
], Contact);
|
|
95
|
+
exports.Contact = Contact;
|
|
96
|
+
//# sourceMappingURL=contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact.js","sourceRoot":"","sources":["../../../server/service/contact/contact.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAE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rimaryGeneratedColumn\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\nimport { ContactItem } from './contact-item'\n\nexport enum ContactField {\n Name = 'name',\n JobTitle = 'job-title',\n Phone = 'phone',\n Address = 'address',\n Email = 'email',\n Birthday = 'birthday',\n Profile = 'profile',\n Picture = 'picture',\n Department = 'department',\n Company = 'company',\n Homepage = 'homepage'\n}\n\nregisterEnumType(ContactField, {\n name: 'ContactField',\n description: 'field enumeration of a contact'\n})\n\n@Entity()\n@ObjectType({ description: 'Entity for Contact' })\nexport class Contact {\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((contact: Contact) => contact.domain)\n domainId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n note?: string\n\n @OneToMany(type => ContactItem, contactItem => contactItem.contact)\n @Field(type => [ContactItem])\n items?: ContactItem[]\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((contact: Contact) => contact.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((contact: Contact) => contact.updater)\n updaterId?: string\n\n @Field(type => String, { nullable: true })\n thumbnail?: string\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const contact_1 = require("./contact");
|
|
5
|
+
const contact_item_1 = require("./contact-item");
|
|
6
|
+
const contact_query_1 = require("./contact-query");
|
|
7
|
+
const contact_mutation_1 = require("./contact-mutation");
|
|
8
|
+
exports.entities = [contact_1.Contact, contact_item_1.ContactItem];
|
|
9
|
+
exports.resolvers = [contact_query_1.ContactQuery, contact_mutation_1.ContactMutation];
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/contact/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,iDAA4C;AAC5C,mDAA8C;AAC9C,yDAAoD;AAEvC,QAAA,QAAQ,GAAG,CAAC,iBAAO,EAAE,0BAAW,CAAC,CAAA;AACjC,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA","sourcesContent":["import { Contact } from './contact'\nimport { ContactItem } from './contact-item'\nimport { ContactQuery } from './contact-query'\nimport { ContactMutation } from './contact-mutation'\n\nexport const entities = [Contact, ContactItem]\nexport const resolvers = [ContactQuery, ContactMutation]\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.schema = exports.subscribers = exports.entities = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/* EXPORT ENTITY TYPES */
|
|
6
|
+
tslib_1.__exportStar(require("./contact/contact-item"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./contact/contact"), exports);
|
|
8
|
+
/* IMPORT ENTITIES AND RESOLVERS */
|
|
9
|
+
const contact_1 = require("./contact");
|
|
10
|
+
exports.entities = [
|
|
11
|
+
/* ENTITIES */
|
|
12
|
+
...contact_1.entities
|
|
13
|
+
];
|
|
14
|
+
exports.subscribers = [
|
|
15
|
+
/* SUBSCRIBERS */
|
|
16
|
+
];
|
|
17
|
+
exports.schema = {
|
|
18
|
+
resolverClasses: [
|
|
19
|
+
/* RESOLVER CLASSES */
|
|
20
|
+
...contact_1.resolvers
|
|
21
|
+
]
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,iEAAsC;AACtC,4DAAiC;AAEjC,mCAAmC;AACnC,uCAAsF;AAEzE,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,kBAAe;CACnB,CAAA;AAEY,QAAA,WAAW,GAAG;AACzB,iBAAiB;CAClB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,mBAAgB;KACpB;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './contact/contact-item'\nexport * from './contact/contact'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as ContactEntities, resolvers as ContactResolvers } from './contact'\n\nexport const entities = [\n /* ENTITIES */\n ...ContactEntities\n]\n\nexport const subscribers = [\n /* SUBSCRIBERS */\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...ContactResolvers\n ]\n}\n"]}
|