@things-factory/print-base 6.1.84 → 6.1.89

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.
Files changed (28) hide show
  1. package/dist-server/index.js +4 -0
  2. package/dist-server/index.js.map +1 -1
  3. package/dist-server/service/index.js +22 -0
  4. package/dist-server/service/index.js.map +1 -0
  5. package/dist-server/service/printer-device/index.js +9 -0
  6. package/dist-server/service/printer-device/index.js.map +1 -0
  7. package/dist-server/service/printer-device/printer-device-mutation.js +112 -0
  8. package/dist-server/service/printer-device/printer-device-mutation.js.map +1 -0
  9. package/dist-server/service/printer-device/printer-device-query.js +80 -0
  10. package/dist-server/service/printer-device/printer-device-query.js.map +1 -0
  11. package/dist-server/service/printer-device/printer-device-type.js +161 -0
  12. package/dist-server/service/printer-device/printer-device-type.js.map +1 -0
  13. package/dist-server/service/printer-device/printer-device.js +139 -0
  14. package/dist-server/service/printer-device/printer-device.js.map +1 -0
  15. package/dist-server/tsconfig.tsbuildinfo +1 -1
  16. package/package.json +4 -4
  17. package/server/index.ts +1 -0
  18. package/server/service/index.ts +21 -0
  19. package/server/service/printer-device/index.ts +7 -0
  20. package/server/service/printer-device/printer-device-mutation.ts +121 -0
  21. package/server/service/printer-device/printer-device-query.ts +53 -0
  22. package/server/service/printer-device/printer-device-type.ts +116 -0
  23. package/server/service/printer-device/printer-device.ts +118 -0
  24. package/translations/en.json +12 -0
  25. package/translations/ja.json +12 -0
  26. package/translations/ko.json +12 -0
  27. package/translations/ms.json +12 -0
  28. package/translations/zh.json +12 -0
@@ -1 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./service"), exports);
1
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB","sourcesContent":["export * from './service'\n"]}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribers = exports.schema = exports.entities = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* EXPORT ENTITY TYPES */
6
+ tslib_1.__exportStar(require("./printer-device/printer-device"), exports);
7
+ /* IMPORT ENTITIES AND RESOLVERS */
8
+ const printer_device_1 = require("./printer-device");
9
+ exports.entities = [
10
+ /* ENTITIES */
11
+ ...printer_device_1.entities
12
+ ];
13
+ exports.schema = {
14
+ resolverClasses: [
15
+ /* RESOLVER CLASSES */
16
+ ...printer_device_1.resolvers
17
+ ]
18
+ };
19
+ exports.subscribers = [
20
+ /* SUBSCRIBERS */
21
+ ];
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,0EAA+C;AAE/C,mCAAmC;AACnC,qDAAyG;AAE5F,QAAA,QAAQ,GAAG;IACtB,cAAc;IACf,GAAG,yBAAqB;CACxB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACxB,GAAG,0BAAsB;KACxB;CACF,CAAA;AAEY,QAAA,WAAW,GAAG;AACzB,iBAAiB;CAClB,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './printer-device/printer-device'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as PrinterDeviceEntities, resolvers as PrinterDeviceResolvers } from './printer-device'\n\nexport const entities = [\n /* ENTITIES */\n\t...PrinterDeviceEntities\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n\t\t...PrinterDeviceResolvers\n ]\n}\n\nexport const subscribers = [\n /* SUBSCRIBERS */\n]\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const printer_device_1 = require("./printer-device");
5
+ const printer_device_query_1 = require("./printer-device-query");
6
+ const printer_device_mutation_1 = require("./printer-device-mutation");
7
+ exports.entities = [printer_device_1.PrinterDevice];
8
+ exports.resolvers = [printer_device_query_1.PrinterDeviceQuery, printer_device_mutation_1.PrinterDeviceMutation];
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/printer-device/index.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAChD,iEAA2D;AAC3D,uEAAiE;AAEpD,QAAA,QAAQ,GAAG,CAAC,8BAAa,CAAC,CAAA;AAC1B,QAAA,SAAS,GAAG,CAAC,yCAAkB,EAAE,+CAAqB,CAAC,CAAA","sourcesContent":["\nimport { PrinterDevice } from './printer-device'\nimport { PrinterDeviceQuery } from './printer-device-query'\nimport { PrinterDeviceMutation } from './printer-device-mutation'\n\nexport const entities = [PrinterDevice]\nexport const resolvers = [PrinterDeviceQuery, PrinterDeviceMutation]\n"]}
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PrinterDeviceMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const printer_device_1 = require("./printer-device");
7
+ const printer_device_type_1 = require("./printer-device-type");
8
+ let PrinterDeviceMutation = class PrinterDeviceMutation {
9
+ async createPrinterDevice(printerDevice, context) {
10
+ const { domain, user, tx } = context.state;
11
+ return await tx.getRepository(printer_device_1.PrinterDevice).save(Object.assign(Object.assign({}, printerDevice), { domain, creator: user, updater: user }));
12
+ }
13
+ async updatePrinterDevice(id, patch, context) {
14
+ const { domain, user, tx } = context.state;
15
+ const repository = tx.getRepository(printer_device_1.PrinterDevice);
16
+ const printerDevice = await repository.findOne({
17
+ where: { domain: { id: domain.id }, id },
18
+ relations: ['domain', 'updater', 'creator']
19
+ });
20
+ return await repository.save(Object.assign(Object.assign(Object.assign({}, printerDevice), patch), { updater: user }));
21
+ }
22
+ async updateMultiplePrinterDevice(patches, context) {
23
+ const { domain, user, tx } = context.state;
24
+ let results = [];
25
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
26
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
27
+ const printerDeviceRepo = tx.getRepository(printer_device_1.PrinterDevice);
28
+ if (_createRecords.length > 0) {
29
+ for (let i = 0; i < _createRecords.length; i++) {
30
+ const newRecord = _createRecords[i];
31
+ const result = await printerDeviceRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
32
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
33
+ }
34
+ }
35
+ if (_updateRecords.length > 0) {
36
+ for (let i = 0; i < _updateRecords.length; i++) {
37
+ const updRecord = _updateRecords[i];
38
+ const printerDevice = await printerDeviceRepo.findOne({
39
+ where: { domain: { id: domain.id }, id: updRecord.id },
40
+ relations: ['domain', 'updater', 'creator']
41
+ });
42
+ const result = await printerDeviceRepo.save(Object.assign(Object.assign(Object.assign({}, printerDevice), updRecord), { updater: user }));
43
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
44
+ }
45
+ }
46
+ return results;
47
+ }
48
+ async deletePrinterDevice(id, context) {
49
+ const { domain, tx, user } = context.state;
50
+ await tx.getRepository(printer_device_1.PrinterDevice).remove({ domain, id, updater: user });
51
+ return true;
52
+ }
53
+ async deletePrinterDevices(ids, context) {
54
+ const { domain, tx, user } = context.state;
55
+ let delEntitis = ids.map(id => {
56
+ return { domain, id, updater: user };
57
+ });
58
+ await tx.getRepository(printer_device_1.PrinterDevice).remove(delEntitis);
59
+ return true;
60
+ }
61
+ };
62
+ tslib_1.__decorate([
63
+ (0, type_graphql_1.Directive)('@transaction'),
64
+ (0, type_graphql_1.Mutation)(returns => printer_device_1.PrinterDevice, { description: 'To create new PrinterDevice' }),
65
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('printerDevice')),
66
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
67
+ tslib_1.__metadata("design:type", Function),
68
+ tslib_1.__metadata("design:paramtypes", [printer_device_type_1.NewPrinterDevice, Object]),
69
+ tslib_1.__metadata("design:returntype", Promise)
70
+ ], PrinterDeviceMutation.prototype, "createPrinterDevice", null);
71
+ tslib_1.__decorate([
72
+ (0, type_graphql_1.Directive)('@transaction'),
73
+ (0, type_graphql_1.Mutation)(returns => printer_device_1.PrinterDevice, { description: 'To modify PrinterDevice information' }),
74
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
75
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
76
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
77
+ tslib_1.__metadata("design:type", Function),
78
+ tslib_1.__metadata("design:paramtypes", [String, printer_device_type_1.PrinterDevicePatch, Object]),
79
+ tslib_1.__metadata("design:returntype", Promise)
80
+ ], PrinterDeviceMutation.prototype, "updatePrinterDevice", null);
81
+ tslib_1.__decorate([
82
+ (0, type_graphql_1.Directive)('@transaction'),
83
+ (0, type_graphql_1.Mutation)(returns => [printer_device_1.PrinterDevice], { description: "To modify multiple PrinterDevices' information" }),
84
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [printer_device_type_1.PrinterDevicePatch])),
85
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
86
+ tslib_1.__metadata("design:type", Function),
87
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
88
+ tslib_1.__metadata("design:returntype", Promise)
89
+ ], PrinterDeviceMutation.prototype, "updateMultiplePrinterDevice", null);
90
+ tslib_1.__decorate([
91
+ (0, type_graphql_1.Directive)('@transaction'),
92
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete PrinterDevice' }),
93
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
94
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
95
+ tslib_1.__metadata("design:type", Function),
96
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
97
+ tslib_1.__metadata("design:returntype", Promise)
98
+ ], PrinterDeviceMutation.prototype, "deletePrinterDevice", null);
99
+ tslib_1.__decorate([
100
+ (0, type_graphql_1.Directive)('@transaction'),
101
+ (0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple printerDevices' }),
102
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
103
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
104
+ tslib_1.__metadata("design:type", Function),
105
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
106
+ tslib_1.__metadata("design:returntype", Promise)
107
+ ], PrinterDeviceMutation.prototype, "deletePrinterDevices", null);
108
+ PrinterDeviceMutation = tslib_1.__decorate([
109
+ (0, type_graphql_1.Resolver)(printer_device_1.PrinterDevice)
110
+ ], PrinterDeviceMutation);
111
+ exports.PrinterDeviceMutation = PrinterDeviceMutation;
112
+ //# sourceMappingURL=printer-device-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printer-device-mutation.js","sourceRoot":"","sources":["../../../server/service/printer-device/printer-device-mutation.ts"],"names":[],"mappings":";;;;AACA,+CAAsE;AAEtE,qDAAgD;AAChD,+DAA4E;AAKrE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAG1B,AAAN,KAAK,CAAC,mBAAmB,CAAuB,aAA+B,EAAS,OAAY;QAClG,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,8BAAa,CAAC,CAAC,IAAI,iCAC5C,aAAa,KAChB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,mBAAm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IAAI,CAAC,EAAE,CAAC,CAAC,wCAAkB,CAAC,CAAC,CAAA;IAC5C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wEA2CP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gEAItD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;IAEhF,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iEAWP;AA9GU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,8BAAa,CAAC;GACX,qBAAqB,CA+GjC;AA/GY,sDAAqB","sourcesContent":["\nimport { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { PrinterDevice } from './printer-device'\nimport { NewPrinterDevice, PrinterDevicePatch } from './printer-device-type'\nimport { Domain, getRepository } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Resolver(PrinterDevice)\nexport class PrinterDeviceMutation {\n @Directive('@transaction')\n @Mutation(returns => PrinterDevice, { description: 'To create new PrinterDevice' })\n async createPrinterDevice(@Arg('printerDevice') printerDevice: NewPrinterDevice, @Ctx() context: any): Promise<PrinterDevice> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(PrinterDevice).save({\n ...printerDevice,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => PrinterDevice, { description: 'To modify PrinterDevice information' })\n async updatePrinterDevice(\n @Arg('id') id: string,\n @Arg('patch') patch: PrinterDevicePatch,\n @Ctx() context: any\n ): Promise<PrinterDevice> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(PrinterDevice)\n const printerDevice = await repository.findOne(\n {\n where: { domain: { id: domain.id }, id },\n relations: ['domain','updater','creator']\n }\n )\n\n return await repository.save({\n ...printerDevice,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [PrinterDevice], { description: \"To modify multiple PrinterDevices' information\" })\n async updateMultiplePrinterDevice(\n @Arg('patches', type => [PrinterDevicePatch]) patches: PrinterDevicePatch[],\n @Ctx() context: any\n ): Promise<PrinterDevice[]> {\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 printerDeviceRepo = tx.getRepository(PrinterDevice)\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 printerDeviceRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\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 updRecord = _updateRecords[i]\n const printerDevice = await printerDeviceRepo.findOne({\n where: { domain: { id: domain.id }, id:updRecord.id },\n relations: ['domain','updater','creator']\n })\n \n const result = await printerDeviceRepo.save({\n ...printerDevice,\n ...updRecord,\n updater: user\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 PrinterDevice' })\n async deletePrinterDevice(@Arg('id') id: string, @Ctx() context: any): Promise<boolean> {\n const { domain, tx, user } = context.state\n await tx.getRepository(PrinterDevice).remove({ domain, id, updater:user })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple printerDevices' })\n async deletePrinterDevices(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: any\n ): Promise<boolean> {\n const { domain, tx, user } = context.state\n\n let delEntitis = ids.map(id=>{\n return {domain,id,updater:user}\n })\n\n await tx.getRepository(PrinterDevice).remove(delEntitis)\n\n return true\n }\n}\n"]}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PrinterDeviceQuery = 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 printer_device_1 = require("./printer-device");
8
+ const printer_device_type_1 = require("./printer-device-type");
9
+ const auth_base_1 = require("@things-factory/auth-base");
10
+ const shell_2 = require("@things-factory/shell");
11
+ let PrinterDeviceQuery = class PrinterDeviceQuery {
12
+ async printerDevice(id, context) {
13
+ const { domain } = context.state;
14
+ return await (0, shell_1.getRepository)(printer_device_1.PrinterDevice).findOne({
15
+ where: { domain: { id: domain.id }, id }
16
+ });
17
+ }
18
+ async printerDevices(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)(printer_device_1.PrinterDevice),
24
+ searchables: ['name', 'description', 'printerIp', 'printerDriver']
25
+ });
26
+ const [items, total] = await queryBuilder.getManyAndCount();
27
+ return { items, total };
28
+ }
29
+ async domain(printerDevice) {
30
+ return await (0, shell_1.getRepository)(shell_2.Domain).findOneBy({ id: printerDevice.domainId });
31
+ }
32
+ async creator(printerDevice) {
33
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: printerDevice.creatorId });
34
+ }
35
+ async updater(printerDevice) {
36
+ return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: printerDevice.updaterId });
37
+ }
38
+ };
39
+ tslib_1.__decorate([
40
+ (0, type_graphql_1.Query)(returns => printer_device_1.PrinterDevice, { description: 'To fetch a PrinterDevice' }),
41
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
42
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
43
+ tslib_1.__metadata("design:type", Function),
44
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
45
+ tslib_1.__metadata("design:returntype", Promise)
46
+ ], PrinterDeviceQuery.prototype, "printerDevice", null);
47
+ tslib_1.__decorate([
48
+ (0, type_graphql_1.Query)(returns => printer_device_type_1.PrinterDeviceList, { description: 'To fetch multiple PrinterDevices' }),
49
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
50
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
51
+ tslib_1.__metadata("design:type", Function),
52
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
53
+ tslib_1.__metadata("design:returntype", Promise)
54
+ ], PrinterDeviceQuery.prototype, "printerDevices", null);
55
+ tslib_1.__decorate([
56
+ (0, type_graphql_1.FieldResolver)(type => shell_2.Domain),
57
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
58
+ tslib_1.__metadata("design:type", Function),
59
+ tslib_1.__metadata("design:paramtypes", [printer_device_1.PrinterDevice]),
60
+ tslib_1.__metadata("design:returntype", Promise)
61
+ ], PrinterDeviceQuery.prototype, "domain", null);
62
+ tslib_1.__decorate([
63
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
64
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
65
+ tslib_1.__metadata("design:type", Function),
66
+ tslib_1.__metadata("design:paramtypes", [printer_device_1.PrinterDevice]),
67
+ tslib_1.__metadata("design:returntype", Promise)
68
+ ], PrinterDeviceQuery.prototype, "creator", null);
69
+ tslib_1.__decorate([
70
+ (0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
71
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
72
+ tslib_1.__metadata("design:type", Function),
73
+ tslib_1.__metadata("design:paramtypes", [printer_device_1.PrinterDevice]),
74
+ tslib_1.__metadata("design:returntype", Promise)
75
+ ], PrinterDeviceQuery.prototype, "updater", null);
76
+ PrinterDeviceQuery = tslib_1.__decorate([
77
+ (0, type_graphql_1.Resolver)(printer_device_1.PrinterDevice)
78
+ ], PrinterDeviceQuery);
79
+ exports.PrinterDeviceQuery = PrinterDeviceQuery;
80
+ //# sourceMappingURL=printer-device-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printer-device-query.js","sourceRoot":"","sources":["../../../server/service/printer-device/printer-device-query.ts"],"names":[],"mappings":";;;;AACA,+CAA8F;AAC9F,iDAAkH;AAClH,qDAAgD;AAChD,+DAAyD;AAEzD,yDAAgD;AAChD,iDAA8C;AAIvC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEvB,AAAN,KAAK,CAAC,aAAa,CAAY,EAAU,EAAS,OAAY;QAC5D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,OAAO,MAAM,IAAA,qBAAa,EAAC,8BAAa,CAAC,CAAC,OAAO,CAAC;YAChD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,cAAc,CAAS,MAAiB,EAAS,OAAY;QACjE,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,8BAAa,CAAC;YAC9C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,CAAC;SACnE,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,eAAe,EAAE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AAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAiB,8BAAa;;iDAElD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAiB,8BAAa;;iDAElD;AAxCU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,8BAAa,CAAC;GACX,kBAAkB,CAyC9B;AAzCY,gDAAkB","sourcesContent":["\nimport { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { ListParam, convertListParams, getRepository, getQueryBuilderFromListParams } from '@things-factory/shell'\nimport { PrinterDevice } from './printer-device'\nimport { PrinterDeviceList } from './printer-device-type'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\n\n@Resolver(PrinterDevice)\nexport class PrinterDeviceQuery {\n @Query(returns => PrinterDevice, { description: 'To fetch a PrinterDevice' })\n async printerDevice(@Arg('id') id: string, @Ctx() context: any): Promise<PrinterDevice> {\n const { domain } = context.state\n return await getRepository(PrinterDevice).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => PrinterDeviceList, { description: 'To fetch multiple PrinterDevices' })\n async printerDevices(@Args() params: ListParam, @Ctx() context: any): Promise<PrinterDeviceList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(PrinterDevice),\n searchables: ['name', 'description', 'printerIp', 'printerDriver']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n \n\n @FieldResolver(type => Domain)\n async domain(@Root() printerDevice: PrinterDevice): Promise<Domain> {\n return await getRepository(Domain).findOneBy({id:printerDevice.domainId})\n }\n\n @FieldResolver(type => User)\n async creator(@Root() printerDevice: PrinterDevice): Promise<User> {\n return await getRepository(User).findOneBy({id:printerDevice.creatorId})\n }\n\n @FieldResolver(type => User)\n async updater(@Root() printerDevice: PrinterDevice): Promise<User> {\n return await getRepository(User).findOneBy({id:printerDevice.updaterId})\n }\n}\n"]}
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PrinterDeviceList = exports.PrinterDevicePatch = exports.NewPrinterDevice = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const printer_device_1 = require("./printer-device");
7
+ let NewPrinterDevice = class NewPrinterDevice {
8
+ };
9
+ tslib_1.__decorate([
10
+ (0, type_graphql_1.Field)({ nullable: false }),
11
+ tslib_1.__metadata("design:type", String)
12
+ ], NewPrinterDevice.prototype, "name", void 0);
13
+ tslib_1.__decorate([
14
+ (0, type_graphql_1.Field)({ nullable: false }),
15
+ tslib_1.__metadata("design:type", String)
16
+ ], NewPrinterDevice.prototype, "description", void 0);
17
+ tslib_1.__decorate([
18
+ (0, type_graphql_1.Field)({ nullable: true }),
19
+ tslib_1.__metadata("design:type", String)
20
+ ], NewPrinterDevice.prototype, "type", void 0);
21
+ tslib_1.__decorate([
22
+ (0, type_graphql_1.Field)({ nullable: true }),
23
+ tslib_1.__metadata("design:type", String)
24
+ ], NewPrinterDevice.prototype, "jobType", void 0);
25
+ tslib_1.__decorate([
26
+ (0, type_graphql_1.Field)({ nullable: true }),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], NewPrinterDevice.prototype, "jobClass", void 0);
29
+ tslib_1.__decorate([
30
+ (0, type_graphql_1.Field)({ nullable: true }),
31
+ tslib_1.__metadata("design:type", String)
32
+ ], NewPrinterDevice.prototype, "jobCategory", void 0);
33
+ tslib_1.__decorate([
34
+ (0, type_graphql_1.Field)({ nullable: true }),
35
+ tslib_1.__metadata("design:type", String)
36
+ ], NewPrinterDevice.prototype, "printerIp", void 0);
37
+ tslib_1.__decorate([
38
+ (0, type_graphql_1.Field)({ nullable: true }),
39
+ tslib_1.__metadata("design:type", String)
40
+ ], NewPrinterDevice.prototype, "printerDriver", void 0);
41
+ tslib_1.__decorate([
42
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
43
+ tslib_1.__metadata("design:type", Number)
44
+ ], NewPrinterDevice.prototype, "printerPort", void 0);
45
+ tslib_1.__decorate([
46
+ (0, type_graphql_1.Field)({ nullable: true }),
47
+ tslib_1.__metadata("design:type", String)
48
+ ], NewPrinterDevice.prototype, "serviceUrl", void 0);
49
+ tslib_1.__decorate([
50
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
51
+ tslib_1.__metadata("design:type", Number)
52
+ ], NewPrinterDevice.prototype, "dpi", void 0);
53
+ tslib_1.__decorate([
54
+ (0, type_graphql_1.Field)({ nullable: true }),
55
+ tslib_1.__metadata("design:type", String)
56
+ ], NewPrinterDevice.prototype, "status", void 0);
57
+ tslib_1.__decorate([
58
+ (0, type_graphql_1.Field)({ nullable: true }),
59
+ tslib_1.__metadata("design:type", Boolean)
60
+ ], NewPrinterDevice.prototype, "defaultFlag", void 0);
61
+ tslib_1.__decorate([
62
+ (0, type_graphql_1.Field)({ nullable: true }),
63
+ tslib_1.__metadata("design:type", Boolean)
64
+ ], NewPrinterDevice.prototype, "activeFlag", void 0);
65
+ tslib_1.__decorate([
66
+ (0, type_graphql_1.Field)({ nullable: true }),
67
+ tslib_1.__metadata("design:type", String)
68
+ ], NewPrinterDevice.prototype, "note", void 0);
69
+ NewPrinterDevice = tslib_1.__decorate([
70
+ (0, type_graphql_1.InputType)()
71
+ ], NewPrinterDevice);
72
+ exports.NewPrinterDevice = NewPrinterDevice;
73
+ let PrinterDevicePatch = class PrinterDevicePatch {
74
+ };
75
+ tslib_1.__decorate([
76
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
77
+ tslib_1.__metadata("design:type", String)
78
+ ], PrinterDevicePatch.prototype, "id", void 0);
79
+ tslib_1.__decorate([
80
+ (0, type_graphql_1.Field)({ nullable: true }),
81
+ tslib_1.__metadata("design:type", String)
82
+ ], PrinterDevicePatch.prototype, "name", void 0);
83
+ tslib_1.__decorate([
84
+ (0, type_graphql_1.Field)({ nullable: true }),
85
+ tslib_1.__metadata("design:type", String)
86
+ ], PrinterDevicePatch.prototype, "description", void 0);
87
+ tslib_1.__decorate([
88
+ (0, type_graphql_1.Field)({ nullable: true }),
89
+ tslib_1.__metadata("design:type", String)
90
+ ], PrinterDevicePatch.prototype, "type", void 0);
91
+ tslib_1.__decorate([
92
+ (0, type_graphql_1.Field)({ nullable: true }),
93
+ tslib_1.__metadata("design:type", String)
94
+ ], PrinterDevicePatch.prototype, "jobType", void 0);
95
+ tslib_1.__decorate([
96
+ (0, type_graphql_1.Field)({ nullable: true }),
97
+ tslib_1.__metadata("design:type", String)
98
+ ], PrinterDevicePatch.prototype, "jobClass", void 0);
99
+ tslib_1.__decorate([
100
+ (0, type_graphql_1.Field)({ nullable: true }),
101
+ tslib_1.__metadata("design:type", String)
102
+ ], PrinterDevicePatch.prototype, "jobCategory", void 0);
103
+ tslib_1.__decorate([
104
+ (0, type_graphql_1.Field)({ nullable: true }),
105
+ tslib_1.__metadata("design:type", String)
106
+ ], PrinterDevicePatch.prototype, "printerIp", void 0);
107
+ tslib_1.__decorate([
108
+ (0, type_graphql_1.Field)({ nullable: true }),
109
+ tslib_1.__metadata("design:type", String)
110
+ ], PrinterDevicePatch.prototype, "printerDriver", void 0);
111
+ tslib_1.__decorate([
112
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
113
+ tslib_1.__metadata("design:type", Number)
114
+ ], PrinterDevicePatch.prototype, "printerPort", void 0);
115
+ tslib_1.__decorate([
116
+ (0, type_graphql_1.Field)({ nullable: true }),
117
+ tslib_1.__metadata("design:type", String)
118
+ ], PrinterDevicePatch.prototype, "serviceUrl", void 0);
119
+ tslib_1.__decorate([
120
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
121
+ tslib_1.__metadata("design:type", Number)
122
+ ], PrinterDevicePatch.prototype, "dpi", void 0);
123
+ tslib_1.__decorate([
124
+ (0, type_graphql_1.Field)({ nullable: true }),
125
+ tslib_1.__metadata("design:type", String)
126
+ ], PrinterDevicePatch.prototype, "status", void 0);
127
+ tslib_1.__decorate([
128
+ (0, type_graphql_1.Field)({ nullable: true }),
129
+ tslib_1.__metadata("design:type", Boolean)
130
+ ], PrinterDevicePatch.prototype, "defaultFlag", void 0);
131
+ tslib_1.__decorate([
132
+ (0, type_graphql_1.Field)({ nullable: true }),
133
+ tslib_1.__metadata("design:type", Boolean)
134
+ ], PrinterDevicePatch.prototype, "activeFlag", void 0);
135
+ tslib_1.__decorate([
136
+ (0, type_graphql_1.Field)({ nullable: true }),
137
+ tslib_1.__metadata("design:type", String)
138
+ ], PrinterDevicePatch.prototype, "note", void 0);
139
+ tslib_1.__decorate([
140
+ (0, type_graphql_1.Field)(),
141
+ tslib_1.__metadata("design:type", String)
142
+ ], PrinterDevicePatch.prototype, "cuFlag", void 0);
143
+ PrinterDevicePatch = tslib_1.__decorate([
144
+ (0, type_graphql_1.InputType)()
145
+ ], PrinterDevicePatch);
146
+ exports.PrinterDevicePatch = PrinterDevicePatch;
147
+ let PrinterDeviceList = class PrinterDeviceList {
148
+ };
149
+ tslib_1.__decorate([
150
+ (0, type_graphql_1.Field)(type => [printer_device_1.PrinterDevice]),
151
+ tslib_1.__metadata("design:type", Array)
152
+ ], PrinterDeviceList.prototype, "items", void 0);
153
+ tslib_1.__decorate([
154
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
155
+ tslib_1.__metadata("design:type", Number)
156
+ ], PrinterDeviceList.prototype, "total", void 0);
157
+ PrinterDeviceList = tslib_1.__decorate([
158
+ (0, type_graphql_1.ObjectType)()
159
+ ], PrinterDeviceList);
160
+ exports.PrinterDeviceList = PrinterDeviceList;
161
+ //# sourceMappingURL=printer-device-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printer-device-type.js","sourceRoot":"","sources":["../../../server/service/printer-device/printer-device-type.ts"],"names":[],"m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Q,EAAE,IAAI,EAAE,CAAC;;+CAC3B;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACX;AAEf;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACL;AAErB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACb;AAEb;IAAC,IAAA,oBAAK,GAAE;;kDACM;AAlDH,kBAAkB;IAD9B,IAAA,wBAAS,GAAE;GACC,kBAAkB,CAmD9B;AAnDY,gDAAkB;AAsDxB,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAM7B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,8BAAa,CAAC,CAAC;;gDACT;AAEtB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;gDACN;AALF,iBAAiB;IAD7B,IAAA,yBAAU,GAAE;GACA,iBAAiB,CAM7B;AANY,8CAAiB","sourcesContent":["\nimport { ObjectType, Field, InputType, Int, ID, Float, registerEnumType } from 'type-graphql'\nimport { ObjectRef } from '@things-factory/shell'\nimport { PrinterDevice } from './printer-device'\n\n@InputType()\nexport class NewPrinterDevice {\n\n @Field({ nullable: false })\n name: string\n\n @Field({ nullable: false })\n description: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n jobType?: string\n\n @Field({ nullable: true })\n jobClass?: string\n\n @Field({ nullable: true })\n jobCategory?: string\n\n @Field({ nullable: true })\n printerIp?: string\n\n @Field({ nullable: true })\n printerDriver?: string\n\n @Field(type =>Int, { nullable: true })\n printerPort?: number\n\n @Field({ nullable: true })\n serviceUrl?: string\n\n @Field(type =>Int, { nullable: true })\n dpi?: number\n\n @Field({ nullable: true })\n status?: string\n\n @Field({ nullable: true })\n defaultFlag?: boolean\n\n @Field({ nullable: true })\n activeFlag?: boolean\n\n @Field({ nullable: true })\n note?: string\n}\n\n@InputType()\nexport class PrinterDevicePatch {\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({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n jobType?: string\n\n @Field({ nullable: true })\n jobClass?: string\n\n @Field({ nullable: true })\n jobCategory?: string\n\n @Field({ nullable: true })\n printerIp?: string\n\n @Field({ nullable: true })\n printerDriver?: string\n\n @Field(type =>Int, { nullable: true })\n printerPort?: number\n\n @Field({ nullable: true })\n serviceUrl?: string\n\n @Field(type => Int, { nullable: true })\n dpi?: number\n\n @Field({ nullable: true })\n status?: string\n\n @Field({ nullable: true })\n defaultFlag?: boolean\n\n @Field({ nullable: true })\n activeFlag?: boolean\n\n @Field({ nullable: true })\n note?: string\n\n @Field()\n cuFlag: string\n}\n\n@ObjectType()\nexport class PrinterDeviceList {\n @Field(type => [PrinterDevice])\n items: PrinterDevice[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PrinterDevice = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const type_graphql_1 = require("type-graphql");
7
+ const auth_base_1 = require("@things-factory/auth-base");
8
+ const shell_1 = require("@things-factory/shell");
9
+ let PrinterDevice = class PrinterDevice {
10
+ };
11
+ tslib_1.__decorate([
12
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
13
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
14
+ tslib_1.__metadata("design:type", String)
15
+ ], PrinterDevice.prototype, "id", void 0);
16
+ tslib_1.__decorate([
17
+ (0, typeorm_1.Column)({ name: 'name', nullable: false }),
18
+ (0, type_graphql_1.Field)({ nullable: false }),
19
+ tslib_1.__metadata("design:type", String)
20
+ ], PrinterDevice.prototype, "name", void 0);
21
+ tslib_1.__decorate([
22
+ (0, typeorm_1.Column)({ name: 'description', nullable: false }),
23
+ (0, type_graphql_1.Field)({ nullable: false }),
24
+ tslib_1.__metadata("design:type", String)
25
+ ], PrinterDevice.prototype, "description", void 0);
26
+ tslib_1.__decorate([
27
+ (0, typeorm_1.Column)({ name: 'type', nullable: false }),
28
+ (0, type_graphql_1.Field)({ nullable: false }),
29
+ tslib_1.__metadata("design:type", String)
30
+ ], PrinterDevice.prototype, "type", void 0);
31
+ tslib_1.__decorate([
32
+ (0, typeorm_1.Column)({ name: 'job_type', nullable: true }),
33
+ (0, type_graphql_1.Field)({ nullable: true }),
34
+ tslib_1.__metadata("design:type", String)
35
+ ], PrinterDevice.prototype, "jobType", void 0);
36
+ tslib_1.__decorate([
37
+ (0, typeorm_1.Column)({ name: 'job_class', nullable: true }),
38
+ (0, type_graphql_1.Field)({ nullable: true }),
39
+ tslib_1.__metadata("design:type", String)
40
+ ], PrinterDevice.prototype, "jobClass", void 0);
41
+ tslib_1.__decorate([
42
+ (0, typeorm_1.Column)({ name: 'job_category', nullable: true }),
43
+ (0, type_graphql_1.Field)({ nullable: true }),
44
+ tslib_1.__metadata("design:type", String)
45
+ ], PrinterDevice.prototype, "jobCategory", void 0);
46
+ tslib_1.__decorate([
47
+ (0, typeorm_1.Column)({ name: 'printer_ip', nullable: true }),
48
+ (0, type_graphql_1.Field)({ nullable: true }),
49
+ tslib_1.__metadata("design:type", String)
50
+ ], PrinterDevice.prototype, "printerIp", void 0);
51
+ tslib_1.__decorate([
52
+ (0, typeorm_1.Column)({ name: 'printer_driver', nullable: true }),
53
+ (0, type_graphql_1.Field)({ nullable: true }),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], PrinterDevice.prototype, "printerDriver", void 0);
56
+ tslib_1.__decorate([
57
+ (0, typeorm_1.Column)({ name: 'printer_port', type: 'integer', nullable: true }),
58
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
59
+ tslib_1.__metadata("design:type", Number)
60
+ ], PrinterDevice.prototype, "printerPort", void 0);
61
+ tslib_1.__decorate([
62
+ (0, typeorm_1.Column)({ name: 'service_url', nullable: true }),
63
+ (0, type_graphql_1.Field)({ nullable: true }),
64
+ tslib_1.__metadata("design:type", String)
65
+ ], PrinterDevice.prototype, "serviceUrl", void 0);
66
+ tslib_1.__decorate([
67
+ (0, typeorm_1.Column)({ name: 'dpi', type: 'integer', nullable: true }),
68
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
69
+ tslib_1.__metadata("design:type", Number)
70
+ ], PrinterDevice.prototype, "dpi", void 0);
71
+ tslib_1.__decorate([
72
+ (0, typeorm_1.Column)({ name: 'status', nullable: true }),
73
+ (0, type_graphql_1.Field)({ nullable: true }),
74
+ tslib_1.__metadata("design:type", String)
75
+ ], PrinterDevice.prototype, "status", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.Column)({ name: 'default_flag', type: 'boolean', nullable: true, default: false }),
78
+ (0, type_graphql_1.Field)({ nullable: true }),
79
+ tslib_1.__metadata("design:type", Boolean)
80
+ ], PrinterDevice.prototype, "defaultFlag", void 0);
81
+ tslib_1.__decorate([
82
+ (0, typeorm_1.Column)({ name: 'active_flag', type: 'boolean', nullable: true, default: false }),
83
+ (0, type_graphql_1.Field)({ nullable: true }),
84
+ tslib_1.__metadata("design:type", Boolean)
85
+ ], PrinterDevice.prototype, "activeFlag", void 0);
86
+ tslib_1.__decorate([
87
+ (0, typeorm_1.Column)({ name: 'note', nullable: true }),
88
+ (0, type_graphql_1.Field)({ nullable: true }),
89
+ tslib_1.__metadata("design:type", String)
90
+ ], PrinterDevice.prototype, "note", void 0);
91
+ tslib_1.__decorate([
92
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain, { createForeignKeyConstraints: false, nullable: false }),
93
+ (0, type_graphql_1.Field)({ nullable: false }),
94
+ tslib_1.__metadata("design:type", shell_1.Domain)
95
+ ], PrinterDevice.prototype, "domain", void 0);
96
+ tslib_1.__decorate([
97
+ (0, typeorm_1.RelationId)((printerDevice) => printerDevice.domain),
98
+ tslib_1.__metadata("design:type", String)
99
+ ], PrinterDevice.prototype, "domainId", void 0);
100
+ tslib_1.__decorate([
101
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { createForeignKeyConstraints: false, nullable: true }),
102
+ (0, type_graphql_1.Field)({ nullable: true }),
103
+ tslib_1.__metadata("design:type", auth_base_1.User)
104
+ ], PrinterDevice.prototype, "creator", void 0);
105
+ tslib_1.__decorate([
106
+ (0, typeorm_1.RelationId)((printerDevice) => printerDevice.creator),
107
+ tslib_1.__metadata("design:type", String)
108
+ ], PrinterDevice.prototype, "creatorId", void 0);
109
+ tslib_1.__decorate([
110
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { createForeignKeyConstraints: false, nullable: true }),
111
+ (0, type_graphql_1.Field)({ nullable: true }),
112
+ tslib_1.__metadata("design:type", auth_base_1.User)
113
+ ], PrinterDevice.prototype, "updater", void 0);
114
+ tslib_1.__decorate([
115
+ (0, typeorm_1.RelationId)((printerDevice) => printerDevice.updater),
116
+ tslib_1.__metadata("design:type", String)
117
+ ], PrinterDevice.prototype, "updaterId", void 0);
118
+ tslib_1.__decorate([
119
+ (0, typeorm_1.CreateDateColumn)(),
120
+ (0, type_graphql_1.Field)({ nullable: true }),
121
+ tslib_1.__metadata("design:type", Date)
122
+ ], PrinterDevice.prototype, "createdAt", void 0);
123
+ tslib_1.__decorate([
124
+ (0, typeorm_1.UpdateDateColumn)(),
125
+ (0, type_graphql_1.Field)({ nullable: true }),
126
+ tslib_1.__metadata("design:type", Date)
127
+ ], PrinterDevice.prototype, "updatedAt", void 0);
128
+ PrinterDevice = tslib_1.__decorate([
129
+ (0, typeorm_1.Entity)('printer_devices'),
130
+ (0, typeorm_1.Index)('ix_printer_device_0', (printerDevice) => [printerDevice.domain, printerDevice.name], { unique: true }),
131
+ (0, typeorm_1.Index)('ix_printer_device_1', (printerDevice) => [printerDevice.domain, printerDevice.type]),
132
+ (0, typeorm_1.Index)('ix_printer_device_2', (printerDevice) => [printerDevice.domain, printerDevice.jobType]),
133
+ (0, typeorm_1.Index)('ix_printer_device_3', (printerDevice) => [printerDevice.domain, printerDevice.status]),
134
+ (0, typeorm_1.Index)('ix_printer_device_4', (printerDevice) => [printerDevice.domain, printerDevice.activeFlag]),
135
+ (0, typeorm_1.Index)('ix_printer_device_5', (printerDevice) => [printerDevice.domain, printerDevice.printerIp, printerDevice.printerDriver]),
136
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for PrinterDevice' })
137
+ ], PrinterDevice);
138
+ exports.PrinterDevice = PrinterDevice;
139
+ //# sourceMappingURL=printer-device.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printer-device.js","sourceRoot":"","sources":["../../../server/service/printer-device/printer-device.ts"],"names":[],"mappings":";;;;AACA,qCASgB;AAChB,+CAAyD;AAEzD,yDAAgD;AAChD,iDAA8C;AAUvC,IAAM,aAAa,GAAnB,MAAM,aAAa;CA6FzB,CAAA;AA5FC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;yCACC;AAEnB;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAC,MAAM,EAAE,QAAQ,EAAC,KAAK,EAAE,CAAC;IACvC,IAAA,oBAAK,EAAE,EAAE,QAAQ,EAAC,KAAK,EAAE,CAAC;;2CACf;AAEZ;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAC,aAAa,EAAE,QAAQ,EAAC,KAAK,EAAE,CAAC;IAC9C,IAAA,oBAAK,EAAE,EAAE,QAAQ,EAAC,KAAK,EAAE,CAAC;;kDACR;AAEnB;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAC,MAAM,EAAE,QAAQ,EAAC,KAAK,EA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AE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACzG,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC5G,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC3G,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAC/G,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAC,aAAa,CAAC,SAAS,EAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IAC1I,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;GAC3C,aAAa,CA6FzB;AA7FY,sCAAa","sourcesContent":["\nimport {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\n@Entity('printer_devices')\n@Index('ix_printer_device_0', (printerDevice: PrinterDevice) => [printerDevice.domain,printerDevice.name], { unique: true })\n@Index('ix_printer_device_1', (printerDevice: PrinterDevice) => [printerDevice.domain,printerDevice.type])\n@Index('ix_printer_device_2', (printerDevice: PrinterDevice) => [printerDevice.domain,printerDevice.jobType])\n@Index('ix_printer_device_3', (printerDevice: PrinterDevice) => [printerDevice.domain,printerDevice.status])\n@Index('ix_printer_device_4', (printerDevice: PrinterDevice) => [printerDevice.domain,printerDevice.activeFlag])\n@Index('ix_printer_device_5', (printerDevice: PrinterDevice) => [printerDevice.domain,printerDevice.printerIp,printerDevice.printerDriver])\n@ObjectType({ description: 'Entity for PrinterDevice' })\nexport class PrinterDevice {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ name:'name', nullable:false })\n @Field( { nullable:false })\n name: string\n\n @Column({ name:'description', nullable:false })\n @Field( { nullable:false })\n description: string\n\n @Column({ name:'type', nullable:false })\n @Field( { nullable:false })\n type?: string\n\n @Column({ name:'job_type', nullable:true })\n @Field({ nullable:true })\n jobType?: string\n\n @Column({ name:'job_class', nullable:true })\n @Field({ nullable:true })\n jobClass?: string\n\n @Column({ name:'job_category', nullable:true })\n @Field( { nullable:true })\n jobCategory?: string\n\n @Column({ name:'printer_ip', nullable:true })\n @Field( { nullable:true })\n printerIp?: string\n\n @Column({ name:'printer_driver', nullable:true })\n @Field({ nullable:true })\n printerDriver?: string\n\n @Column({ name:'printer_port', type:'integer', nullable:true })\n @Field(type =>Int, { nullable:true })\n printerPort?: number\n\n @Column({ name:'service_url', nullable:true })\n @Field({ nullable:true })\n serviceUrl?: string\n\n @Column({ name:'dpi', type:'integer', nullable:true })\n @Field(type =>Int, { nullable:true })\n dpi?: number\n\n @Column({ name:'status', nullable:true })\n @Field({ nullable:true })\n status?: string\n\n @Column({ name:'default_flag', type:'boolean', nullable:true, default: false })\n @Field({ nullable:true })\n defaultFlag?: boolean\n\n @Column({ name:'active_flag', type:'boolean', nullable:true, default: false })\n @Field({ nullable:true })\n activeFlag?: boolean\n\n @Column({ name:'note', nullable:true })\n @Field({ nullable:true })\n note?: string\n\n @ManyToOne(type => Domain, {createForeignKeyConstraints: false, nullable: false})\n @Field({ nullable: false })\n domain: Domain\n\n @RelationId((printerDevice: PrinterDevice) => printerDevice.domain)\n domainId: string\n\n @ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((printerDevice: PrinterDevice) => printerDevice.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((printerDevice: PrinterDevice) => printerDevice.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n}\n"]}