@things-factory/pdf 10.1.228 → 10.1.231

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 (71) hide show
  1. package/dist-client/index.d.ts +2 -0
  2. package/dist-client/index.js +2 -0
  3. package/dist-client/index.js.map +1 -0
  4. package/dist-client/issue-document.d.ts +44 -0
  5. package/dist-client/issue-document.js +162 -0
  6. package/dist-client/issue-document.js.map +1 -0
  7. package/dist-client/pages/issued-document/issued-document-list.d.ts +52 -0
  8. package/dist-client/pages/issued-document/issued-document-list.js +265 -0
  9. package/dist-client/pages/issued-document/issued-document-list.js.map +1 -0
  10. package/dist-client/pages/pdf-template/pdf-template-list-page.js +12 -0
  11. package/dist-client/pages/pdf-template/pdf-template-list-page.js.map +1 -1
  12. package/dist-client/route.d.ts +1 -1
  13. package/dist-client/route.js +3 -2
  14. package/dist-client/route.js.map +1 -1
  15. package/dist-client/tsconfig.tsbuildinfo +1 -1
  16. package/dist-server/controller/issued-document-kind.d.ts +60 -0
  17. package/dist-server/controller/issued-document-kind.js +48 -0
  18. package/dist-server/controller/issued-document-kind.js.map +1 -0
  19. package/dist-server/controller/pdf-release-reader.d.ts +1 -0
  20. package/dist-server/controller/pdf-release-reader.js +15 -0
  21. package/dist-server/controller/pdf-release-reader.js.map +1 -0
  22. package/dist-server/controller/pdf-release-service.d.ts +29 -4
  23. package/dist-server/controller/pdf-release-service.js +120 -9
  24. package/dist-server/controller/pdf-release-service.js.map +1 -1
  25. package/dist-server/index.d.ts +6 -1
  26. package/dist-server/index.js +13 -1
  27. package/dist-server/index.js.map +1 -1
  28. package/dist-server/role-tasks.js +3 -1
  29. package/dist-server/role-tasks.js.map +1 -1
  30. package/dist-server/service/index.d.ts +10 -1
  31. package/dist-server/service/index.js +1 -0
  32. package/dist-server/service/index.js.map +1 -1
  33. package/dist-server/service/pdf-generate/pdf-generate-resolver.d.ts +0 -2
  34. package/dist-server/service/pdf-generate/pdf-generate-resolver.js +8 -18
  35. package/dist-server/service/pdf-generate/pdf-generate-resolver.js.map +1 -1
  36. package/dist-server/service/pdf-release/index.d.ts +2 -2
  37. package/dist-server/service/pdf-release/index.js +4 -3
  38. package/dist-server/service/pdf-release/index.js.map +1 -1
  39. package/dist-server/service/pdf-release/pdf-release-query.d.ts +31 -5
  40. package/dist-server/service/pdf-release/pdf-release-query.js +213 -30
  41. package/dist-server/service/pdf-release/pdf-release-query.js.map +1 -1
  42. package/dist-server/service/pdf-release/pdf-release-type.d.ts +1 -16
  43. package/dist-server/service/pdf-release/pdf-release-type.js +4 -60
  44. package/dist-server/service/pdf-release/pdf-release-type.js.map +1 -1
  45. package/dist-server/service/pdf-release/pdf-release.d.ts +13 -1
  46. package/dist-server/service/pdf-release/pdf-release.js +67 -4
  47. package/dist-server/service/pdf-release/pdf-release.js.map +1 -1
  48. package/dist-server/service/pdf-template/pdf-template-type.d.ts +2 -0
  49. package/dist-server/service/pdf-template/pdf-template-type.js +8 -0
  50. package/dist-server/service/pdf-template/pdf-template-type.js.map +1 -1
  51. package/dist-server/service/pdf-template/pdf-template.d.ts +1 -0
  52. package/dist-server/service/pdf-template/pdf-template.js +5 -0
  53. package/dist-server/service/pdf-template/pdf-template.js.map +1 -1
  54. package/dist-server/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +4 -2
  56. package/things-factory.config.js +2 -1
  57. package/translations/en.json +30 -1
  58. package/translations/es.json +30 -1
  59. package/translations/ja.json +30 -1
  60. package/translations/ko.json +30 -1
  61. package/translations/ms.json +30 -1
  62. package/translations/zh.json +30 -1
  63. package/dist-client/pages/pdf-release/pdf-release-importer.d.ts +0 -23
  64. package/dist-client/pages/pdf-release/pdf-release-importer.js +0 -93
  65. package/dist-client/pages/pdf-release/pdf-release-importer.js.map +0 -1
  66. package/dist-client/pages/pdf-release/pdf-release-list-page.d.ts +0 -60
  67. package/dist-client/pages/pdf-release/pdf-release-list-page.js +0 -317
  68. package/dist-client/pages/pdf-release/pdf-release-list-page.js.map +0 -1
  69. package/dist-server/service/pdf-release/pdf-release-mutation.d.ts +0 -10
  70. package/dist-server/service/pdf-release/pdf-release-mutation.js +0 -156
  71. package/dist-server/service/pdf-release/pdf-release-mutation.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/pdf-release/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,2DAAqD;AACrD,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA;AACjD,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { PDFRelease } from './pdf-release'\nimport { PDFReleaseQuery } from './pdf-release-query'\nimport { PDFReleaseMutation } from './pdf-release-mutation'\n\nexport const entities = [PDFRelease]\nexport const resolvers = [PDFReleaseQuery, PDFReleaseMutation]\nexport const subscribers = []\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/pdf-release/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,2DAAqD;AAErD,yDAAiD;AAAxC,gHAAA,WAAW,OAAA;AAEP,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,CAAC,CAAA;AAC7B,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { PDFRelease } from './pdf-release'\nimport { PDFReleaseQuery } from './pdf-release-query'\n\nexport { OPEN_FIELDS } from './pdf-release-query'\n\nexport const entities = [PDFRelease]\nexport const resolvers = [PDFReleaseQuery]\nexport const subscribers = []\n"]}
@@ -1,13 +1,39 @@
1
- import { Domain, ListParam } from '@things-factory/shell';
2
- import { User } from '@things-factory/auth-base';
3
1
  import { Attachment } from '@things-factory/attachment-base';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { Domain, ListParam } from '@things-factory/shell';
4
4
  import { PDFRelease } from './pdf-release';
5
5
  import { PDFReleaseList } from './pdf-release-type';
6
+ export declare class IssueDocumentInput {
7
+ purpose?: string;
8
+ submittedTo?: string;
9
+ asOf?: string;
10
+ }
11
+ export declare class IssuedDocumentKindInfo {
12
+ kind: string;
13
+ prefix: string;
14
+ refType: string;
15
+ asOf: boolean;
16
+ issuable: boolean;
17
+ refId?: string;
18
+ }
6
19
  export declare class PDFReleaseQuery {
7
- pdfRelease(id: string, context: ResolverContext): Promise<PDFRelease>;
8
- pdfReleases(params: ListParam, context: ResolverContext): Promise<PDFReleaseList>;
9
- file(pdfRelease: PDFRelease): Promise<Attachment | null>;
20
+ issuedDocuments(params: ListParam, context: ResolverContext): Promise<PDFReleaseList>;
21
+ readableIssuedDocuments(params: ListParam, mine: boolean, context: ResolverContext): Promise<PDFReleaseList>;
22
+ issuedDocument(id: string, context: ResolverContext): Promise<PDFRelease | null>;
23
+ issuedDocumentKinds(context: ResolverContext): Promise<IssuedDocumentKindInfo[]>;
24
+ issueDocument(kind: string, refId: string | null, input: IssueDocumentInput, context: ResolverContext): Promise<PDFRelease>;
25
+ revokeIssuedDocument(id: string, reason: string, context: ResolverContext): Promise<PDFRelease>;
26
+ readable(pdfRelease: PDFRelease, context: ResolverContext): Promise<boolean>;
27
+ file(pdfRelease: PDFRelease, context: ResolverContext): Promise<Attachment | null>;
10
28
  domain(pdfRelease: PDFRelease): Promise<Domain>;
11
29
  updater(pdfRelease: PDFRelease): Promise<User>;
12
30
  creator(pdfRelease: PDFRelease): Promise<User>;
13
31
  }
32
+ /** The ledger's doors, open by design (auth-base `openFields`). */
33
+ export declare const OPEN_FIELDS: {
34
+ 'Query.readableIssuedDocuments': string;
35
+ 'Query.issuedDocument': string;
36
+ 'Query.issuedDocumentKinds': string;
37
+ 'Mutation.issueDocument': string;
38
+ 'Mutation.revokeIssuedDocument': string;
39
+ };
@@ -1,32 +1,161 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PDFReleaseQuery = void 0;
3
+ exports.OPEN_FIELDS = exports.PDFReleaseQuery = exports.IssuedDocumentKindInfo = exports.IssueDocumentInput = void 0;
4
4
  const tslib_1 = require("tslib");
5
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");
6
+ const typeorm_1 = require("typeorm");
8
7
  const attachment_base_1 = require("@things-factory/attachment-base");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ const shell_1 = require("@things-factory/shell");
10
+ const issued_document_kind_1 = require("../../controller/issued-document-kind");
11
+ const pdf_release_service_1 = require("../../controller/pdf-release-service");
9
12
  const pdf_release_1 = require("./pdf-release");
10
13
  const pdf_release_type_1 = require("./pdf-release-type");
14
+ let IssueDocumentInput = class IssueDocumentInput {
15
+ };
16
+ exports.IssueDocumentInput = IssueDocumentInput;
17
+ tslib_1.__decorate([
18
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What the document is for (용도)' }),
19
+ tslib_1.__metadata("design:type", String)
20
+ ], IssueDocumentInput.prototype, "purpose", void 0);
21
+ tslib_1.__decorate([
22
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Where it is handed in (제출처)' }),
23
+ tslib_1.__metadata("design:type", String)
24
+ ], IssueDocumentInput.prototype, "submittedTo", void 0);
25
+ tslib_1.__decorate([
26
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The day it speaks of (기준일), YYYY-MM-DD - today in the domain when none' }),
27
+ tslib_1.__metadata("design:type", String)
28
+ ], IssueDocumentInput.prototype, "asOf", void 0);
29
+ exports.IssueDocumentInput = IssueDocumentInput = tslib_1.__decorate([
30
+ (0, type_graphql_1.InputType)({ description: 'What a person gives when issuing a document' })
31
+ ], IssueDocumentInput);
32
+ let IssuedDocumentKindInfo = class IssuedDocumentKindInfo {
33
+ };
34
+ exports.IssuedDocumentKindInfo = IssuedDocumentKindInfo;
35
+ tslib_1.__decorate([
36
+ (0, type_graphql_1.Field)({ description: '<module>.<document>' }),
37
+ tslib_1.__metadata("design:type", String)
38
+ ], IssuedDocumentKindInfo.prototype, "kind", void 0);
39
+ tslib_1.__decorate([
40
+ (0, type_graphql_1.Field)({ description: 'The head of its numbers' }),
41
+ tslib_1.__metadata("design:type", String)
42
+ ], IssuedDocumentKindInfo.prototype, "prefix", void 0);
43
+ tslib_1.__decorate([
44
+ (0, type_graphql_1.Field)({ description: 'What its subject is' }),
45
+ tslib_1.__metadata("design:type", String)
46
+ ], IssuedDocumentKindInfo.prototype, "refType", void 0);
47
+ tslib_1.__decorate([
48
+ (0, type_graphql_1.Field)({ description: 'Whether the issue form asks for the day it speaks of' }),
49
+ tslib_1.__metadata("design:type", Boolean)
50
+ ], IssuedDocumentKindInfo.prototype, "asOf", void 0);
51
+ tslib_1.__decorate([
52
+ (0, type_graphql_1.Field)({ description: 'Whether the caller may issue it here, in the ledger - a kind about the company itself, or about the caller' }),
53
+ tslib_1.__metadata("design:type", Boolean)
54
+ ], IssuedDocumentKindInfo.prototype, "issuable", void 0);
55
+ tslib_1.__decorate([
56
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The subject it is issued for here - the caller\'s own, for a kind about the caller' }),
57
+ tslib_1.__metadata("design:type", String)
58
+ ], IssuedDocumentKindInfo.prototype, "refId", void 0);
59
+ exports.IssuedDocumentKindInfo = IssuedDocumentKindInfo = tslib_1.__decorate([
60
+ (0, type_graphql_1.ObjectType)({ description: 'An issued document kind a module registered' })
61
+ ], IssuedDocumentKindInfo);
62
+ /** The ledger rows a person may read, newest first - each row asks its kind's module (`mayRead`). */
63
+ async function readableRows(context, where) {
64
+ const { domain } = context.state;
65
+ const rows = await (0, shell_1.getRepository)(pdf_release_1.PDFRelease).find({ where: { domain: { id: domain.id }, ...where }, order: { createdAt: 'DESC' } });
66
+ const kept = [];
67
+ for (const row of rows)
68
+ if (await (0, pdf_release_service_1.mayReadRelease)(context, row))
69
+ kept.push(row);
70
+ return kept;
71
+ }
72
+ const SEARCHED = ['number', 'subjectName', 'purpose', 'submittedTo'];
73
+ /** The ledger's filters - kind, refType, refId, state - and its search words, from a list's parameters. */
74
+ function listOf(params) {
75
+ const where = {};
76
+ let search = '';
77
+ for (const filter of params?.filters ?? []) {
78
+ if (['kind', 'refType', 'refId', 'state'].includes(filter.name))
79
+ where[filter.name] = filter.operator === 'in' ? (0, typeorm_1.In)(filter.value) : filter.value;
80
+ else if (filter.name === 'q' || SEARCHED.includes(filter.name))
81
+ search = String(filter.value ?? '').replace(/%/g, '').toLowerCase();
82
+ }
83
+ return { where, search };
84
+ }
85
+ /** A page of rows, after the search words. */
86
+ function pageOf(rows, search, params) {
87
+ const found = search ? rows.filter(row => SEARCHED.some(field => String(row[field] ?? '').toLowerCase().includes(search))) : rows;
88
+ const { page = 1, limit = 0 } = params?.pagination ?? {};
89
+ return { items: limit > 0 ? found.slice((page - 1) * limit, page * limit) : found, total: found.length };
90
+ }
91
+ /** Whether a row is about the caller - its kind's own subject for them (one's own employee record). */
92
+ async function aboutCaller(context, row, own) {
93
+ const kind = (0, issued_document_kind_1.issuedDocumentKindOf)(row.kind);
94
+ if (!kind?.ownSubject || !row.kind)
95
+ return false;
96
+ if (!own.has(row.kind))
97
+ own.set(row.kind, await kind.ownSubject(context).catch(() => null));
98
+ return !!row.refId && own.get(row.kind) === row.refId;
99
+ }
100
+ /*
101
+ * The issuance ledger (발급 대장, ADR-0176 decision 2), two ways:
102
+ *
103
+ * - The whole ledger - every row's number, kind, subject, purpose, recipient and issuer - is read under its own category
104
+ * `issued-document` (`pdf.issuance-ledger`; management support keeps it, the user 2026-10-30). A row's file still
105
+ * opens by its kind's rule.
106
+ * - Everyone else reads rows by each kind's rule (`mayRead`), asked row by row: their own (내 정보 › 내 증명서,
107
+ * `mine` - about them or issued by them), the registers on the register screen. Issuing and revoking ask the kind (`mayIssue`). These
108
+ * doors carry no `@privilege` and are declared open by design on `schema.openFields`.
109
+ */
11
110
  let PDFReleaseQuery = class PDFReleaseQuery {
12
- async pdfRelease(id, context) {
13
- const { domain } = context.state;
14
- return await (0, shell_1.getRepository)(pdf_release_1.PDFRelease).findOne({
15
- where: { domain: { id: domain.id }, id }
16
- });
111
+ async issuedDocuments(params, context) {
112
+ const { where, search } = listOf(params);
113
+ const rows = await (0, shell_1.getRepository)(pdf_release_1.PDFRelease).find({ where: { domain: { id: context.state.domain.id }, ...where }, order: { createdAt: 'DESC' } });
114
+ return pageOf(rows, search, params);
115
+ }
116
+ async readableIssuedDocuments(params, mine, context) {
117
+ const { where, search } = listOf(params);
118
+ let rows = await readableRows(context, where);
119
+ if (mine) {
120
+ const own = new Map();
121
+ const kept = [];
122
+ for (const row of rows)
123
+ if (row.creatorId === context.state.user?.id || (await aboutCaller(context, row, own)))
124
+ kept.push(row);
125
+ rows = kept;
126
+ }
127
+ return pageOf(rows, search, params);
128
+ }
129
+ async issuedDocument(id, context) {
130
+ return (await readableRows(context, { id }))[0] ?? null;
17
131
  }
18
- async pdfReleases(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)(pdf_release_1.PDFRelease),
24
- searchables: ['name', 'description']
25
- });
26
- const [items, total] = await queryBuilder.getManyAndCount();
27
- return { items, total };
132
+ async issuedDocumentKinds(context) {
133
+ const domainId = context.state.domain?.id;
134
+ const infos = [];
135
+ for (const one of (0, issued_document_kind_1.issuedDocumentKinds)()) {
136
+ /*
137
+ * Issued here: a kind about the company itself, and a kind about the caller (one's own 재직증명서). Anyone else's
138
+ * is issued from the screen of its subject.
139
+ */
140
+ const own = one.refType === 'Domain' ? null : ((await one.ownSubject?.(context).catch(() => null)) ?? null);
141
+ const subject = one.refType === 'Domain' ? domainId : own;
142
+ const issuable = !!subject && (await one.mayIssue(context, subject).catch(() => false));
143
+ infos.push({ kind: one.kind, prefix: one.prefix, refType: one.refType, asOf: !!one.asOf, issuable, refId: issuable && own ? own : undefined });
144
+ }
145
+ return infos;
28
146
  }
29
- async file(pdfRelease) {
147
+ async issueDocument(kind, refId, input, context) {
148
+ return (await (0, pdf_release_service_1.releasePdf)(context, { kind, refId, input })).release;
149
+ }
150
+ async revokeIssuedDocument(id, reason, context) {
151
+ return await (0, pdf_release_service_1.revokeRelease)(context, id, reason);
152
+ }
153
+ async readable(pdfRelease, context) {
154
+ return await (0, pdf_release_service_1.mayReadRelease)(context, pdfRelease);
155
+ }
156
+ async file(pdfRelease, context) {
157
+ if (!(await (0, pdf_release_service_1.mayReadRelease)(context, pdfRelease)))
158
+ return null;
30
159
  return await (0, shell_1.getRepository)(attachment_base_1.Attachment).findOne({ where: { refType: 'PDFRelease', refBy: pdfRelease.id }, order: { createdAt: 'DESC' } });
31
160
  }
32
161
  async domain(pdfRelease) {
@@ -41,28 +170,73 @@ let PDFReleaseQuery = class PDFReleaseQuery {
41
170
  };
42
171
  exports.PDFReleaseQuery = PDFReleaseQuery;
43
172
  tslib_1.__decorate([
44
- (0, type_graphql_1.Directive)('@privilege(category: "pdf", privilege: "query", domainOwnerGranted: true)'),
45
- (0, type_graphql_1.Query)(returns => pdf_release_1.PDFRelease, { nullable: true, description: 'To fetch a PDFRelease' }),
173
+ (0, type_graphql_1.Directive)('@privilege(category: "issued-document", privilege: "query", domainOwnerGranted: true)'),
174
+ (0, type_graphql_1.Query)(returns => pdf_release_type_1.PDFReleaseList, { description: 'The whole issuance ledger, newest first - filter by kind, refType, refId, state; search number, subject, purpose or recipient' }),
175
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
176
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
177
+ tslib_1.__metadata("design:type", Function),
178
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
179
+ tslib_1.__metadata("design:returntype", Promise)
180
+ ], PDFReleaseQuery.prototype, "issuedDocuments", null);
181
+ tslib_1.__decorate([
182
+ (0, type_graphql_1.Query)(returns => pdf_release_type_1.PDFReleaseList, { description: "The issued documents the caller may read by their kinds' rules, newest first - with mine, those about the caller or issued by them" }),
183
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
184
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('mine', { nullable: true, description: 'Only the caller\'s own: the documents about them and those they issued' })),
185
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
186
+ tslib_1.__metadata("design:type", Function),
187
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Boolean, Object]),
188
+ tslib_1.__metadata("design:returntype", Promise)
189
+ ], PDFReleaseQuery.prototype, "readableIssuedDocuments", null);
190
+ tslib_1.__decorate([
191
+ (0, type_graphql_1.Query)(returns => pdf_release_1.PDFRelease, { nullable: true, description: 'One issued document, if the caller may read it' }),
46
192
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
47
193
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
48
194
  tslib_1.__metadata("design:type", Function),
49
195
  tslib_1.__metadata("design:paramtypes", [String, Object]),
50
196
  tslib_1.__metadata("design:returntype", Promise)
51
- ], PDFReleaseQuery.prototype, "pdfRelease", null);
197
+ ], PDFReleaseQuery.prototype, "issuedDocument", null);
52
198
  tslib_1.__decorate([
53
- (0, type_graphql_1.Directive)('@privilege(category: "pdf", privilege: "query", domainOwnerGranted: true)'),
54
- (0, type_graphql_1.Query)(returns => pdf_release_type_1.PDFReleaseList, { description: 'To fetch multiple PDFReleases' }),
55
- tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
199
+ (0, type_graphql_1.Query)(returns => [IssuedDocumentKindInfo], { description: 'The kinds of document the loaded modules issue' }),
200
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
201
+ tslib_1.__metadata("design:type", Function),
202
+ tslib_1.__metadata("design:paramtypes", [Object]),
203
+ tslib_1.__metadata("design:returntype", Promise)
204
+ ], PDFReleaseQuery.prototype, "issuedDocumentKinds", null);
205
+ tslib_1.__decorate([
206
+ (0, type_graphql_1.Directive)('@transaction'),
207
+ (0, type_graphql_1.Mutation)(returns => pdf_release_1.PDFRelease, { description: 'To issue a document of a kind for its subject - numbered, printed and kept in the ledger; the kind\'s module says who may' }),
208
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('kind')),
209
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('refId', { nullable: true, description: 'What it is about - none for a document about the company itself' })),
210
+ tslib_1.__param(2, (0, type_graphql_1.Arg)('input', type => IssueDocumentInput, { nullable: true })),
211
+ tslib_1.__param(3, (0, type_graphql_1.Ctx)()),
212
+ tslib_1.__metadata("design:type", Function),
213
+ tslib_1.__metadata("design:paramtypes", [String, String, IssueDocumentInput, Object]),
214
+ tslib_1.__metadata("design:returntype", Promise)
215
+ ], PDFReleaseQuery.prototype, "issueDocument", null);
216
+ tslib_1.__decorate([
217
+ (0, type_graphql_1.Directive)('@transaction'),
218
+ (0, type_graphql_1.Mutation)(returns => pdf_release_1.PDFRelease, { description: 'To revoke an issued document, with the reason - the row and its file stay' }),
219
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
220
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('reason')),
221
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
222
+ tslib_1.__metadata("design:type", Function),
223
+ tslib_1.__metadata("design:paramtypes", [String, String, Object]),
224
+ tslib_1.__metadata("design:returntype", Promise)
225
+ ], PDFReleaseQuery.prototype, "revokeIssuedDocument", null);
226
+ tslib_1.__decorate([
227
+ (0, type_graphql_1.FieldResolver)(type => Boolean, { description: "Whether the caller may open the file - its kind's rule" }),
228
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
56
229
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
57
230
  tslib_1.__metadata("design:type", Function),
58
- tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
231
+ tslib_1.__metadata("design:paramtypes", [pdf_release_1.PDFRelease, Object]),
59
232
  tslib_1.__metadata("design:returntype", Promise)
60
- ], PDFReleaseQuery.prototype, "pdfReleases", null);
233
+ ], PDFReleaseQuery.prototype, "readable", null);
61
234
  tslib_1.__decorate([
62
- (0, type_graphql_1.FieldResolver)(type => attachment_base_1.Attachment, { nullable: true, description: 'The PDF file of the release' }),
235
+ (0, type_graphql_1.FieldResolver)(type => attachment_base_1.Attachment, { nullable: true, description: "The PDF file of the release - for whoever may open it by its kind's rule" }),
63
236
  tslib_1.__param(0, (0, type_graphql_1.Root)()),
237
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
64
238
  tslib_1.__metadata("design:type", Function),
65
- tslib_1.__metadata("design:paramtypes", [pdf_release_1.PDFRelease]),
239
+ tslib_1.__metadata("design:paramtypes", [pdf_release_1.PDFRelease, Object]),
66
240
  tslib_1.__metadata("design:returntype", Promise)
67
241
  ], PDFReleaseQuery.prototype, "file", null);
68
242
  tslib_1.__decorate([
@@ -87,6 +261,15 @@ tslib_1.__decorate([
87
261
  tslib_1.__metadata("design:returntype", Promise)
88
262
  ], PDFReleaseQuery.prototype, "creator", null);
89
263
  exports.PDFReleaseQuery = PDFReleaseQuery = tslib_1.__decorate([
90
- (0, type_graphql_1.Resolver)(pdf_release_1.PDFRelease)
264
+ (0, type_graphql_1.Resolver)(pdf_release_1.PDFRelease),
265
+ (0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals)
91
266
  ], PDFReleaseQuery);
267
+ /** The ledger's doors, open by design (auth-base `openFields`). */
268
+ exports.OPEN_FIELDS = {
269
+ 'Query.readableIssuedDocuments': "each row is read by its kind's module rule (mayRead)",
270
+ 'Query.issuedDocument': "read by its kind's module rule (mayRead)",
271
+ 'Query.issuedDocumentKinds': 'the names of the kinds the loaded modules issue - no data',
272
+ 'Mutation.issueDocument': "issued by its kind's module rule (mayIssue)",
273
+ 'Mutation.revokeIssuedDocument': "revoked by whoever may issue the kind for its subject (mayIssue)"
274
+ };
92
275
  //# sourceMappingURL=pdf-release-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-release-query.js","sourceRoot":"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IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,4BAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACtF,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;2CAExC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;6CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;0BAjDU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAkD3B","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 { Attachment } from '@things-factory/attachment-base'\nimport { PDFRelease } from './pdf-release'\nimport { PDFReleaseList } from './pdf-release-type'\n\n@Resolver(PDFRelease)\nexport class PDFReleaseQuery {\n @Directive('@privilege(category: \"pdf\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => PDFRelease!, { nullable: true, description: 'To fetch a PDFRelease' })\n async pdfRelease(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<PDFRelease> {\n const { domain } = context.state\n\n return await getRepository(PDFRelease).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Directive('@privilege(category: \"pdf\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => PDFReleaseList, { description: 'To fetch multiple PDFReleases' })\n async pdfReleases(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): Promise<PDFReleaseList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(PDFRelease),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Attachment, { nullable: true, description: 'The PDF file of the release' })\n async file(@Root() pdfRelease: PDFRelease): Promise<Attachment | null> {\n return await getRepository(Attachment).findOne({ where: { refType: 'PDFRelease', refBy: pdfRelease.id }, order: { createdAt: 'DESC' } })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() pdfRelease: PDFRelease): Promise<Domain> {\n return pdfRelease.domainId && (await getRepository(Domain).findOneBy({ id: pdfRelease.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() pdfRelease: PDFRelease): Promise<User> {\n return pdfRelease.updaterId && (await getRepository(User).findOneBy({ id: pdfRelease.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() pdfRelease: PDFRelease): Promise<User> {\n return pdfRelease.creatorId && (await getRepository(User).findOneBy({ id: pdfRelease.creatorId }))\n }\n}\n"]}
1
+ {"version":3,"file":"pdf-release-query.js","sourceRoot":"","sources":["../../../server/service/pdf-release/pdf-release-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA0J;AAC1J,qCAA4B;AAE5B,qEAA4D;AAC5D,yDAAgD;AAChD,iDAAuF;AAEvF,gFAAiG;AACjG,8EAAgG;AAChG,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAI9B,CAAA;AAJY,gDAAkB;AAC4C;IAAxE,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;;mDAAiB;AAClB;IAAtE,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EA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A,IAAA,kBAAG,GAAE,CAAA;;6CAAlB,wBAAU;;+CAE5C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,4BAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,0EAA0E,EAAE,CAAC;IACnI,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAA0B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAlB,wBAAU;;2CAGxC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;6CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;0BAzFU,eAAe;IAF3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;IACpB,IAAA,4BAAa,EAAC,qBAAa,CAAC;GAChB,eAAe,CA0F3B;AAED,mEAAmE;AACtD,QAAA,WAAW,GAAG;IACzB,+BAA+B,EAAE,sDAAsD;IACvF,sBAAsB,EAAE,0CAA0C;IAClE,2BAA2B,EAAE,2DAA2D;IACxF,wBAAwB,EAAE,6CAA6C;IACvE,+BAA+B,EAAE,kEAAkE;CACpG,CAAA","sourcesContent":["import { Arg, Args, Ctx, Directive, Field, FieldResolver, InputType, Int, Mutation, ObjectType, Query, Resolver, Root, UseMiddleware } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { Attachment } from '@things-factory/attachment-base'\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getRepository, ListParam, SpeakRefusals } from '@things-factory/shell'\n\nimport { issuedDocumentKindOf, issuedDocumentKinds } from '../../controller/issued-document-kind'\nimport { mayReadRelease, releasePdf, revokeRelease } from '../../controller/pdf-release-service'\nimport { PDFRelease } from './pdf-release'\nimport { PDFReleaseList } from './pdf-release-type'\n\n@InputType({ description: 'What a person gives when issuing a document' })\nexport class IssueDocumentInput {\n @Field({ nullable: true, description: 'What the document is for (용도)' }) purpose?: string\n @Field({ nullable: true, description: 'Where it is handed in (제출처)' }) submittedTo?: string\n @Field({ nullable: true, description: 'The day it speaks of (기준일), YYYY-MM-DD - today in the domain when none' }) asOf?: string\n}\n\n@ObjectType({ description: 'An issued document kind a module registered' })\nexport class IssuedDocumentKindInfo {\n @Field({ description: '<module>.<document>' }) kind: string\n @Field({ description: 'The head of its numbers' }) prefix: string\n @Field({ description: 'What its subject is' }) refType: string\n @Field({ description: 'Whether the issue form asks for the day it speaks of' }) asOf: boolean\n @Field({ description: 'Whether the caller may issue it here, in the ledger - a kind about the company itself, or about the caller' }) issuable: boolean\n @Field({ nullable: true, description: 'The subject it is issued for here - the caller\\'s own, for a kind about the caller' }) refId?: string\n}\n\n/** The ledger rows a person may read, newest first - each row asks its kind's module (`mayRead`). */\nasync function readableRows(context: ResolverContext, where: Record<string, any>): Promise<PDFRelease[]> {\n const { domain } = context.state\n const rows = await getRepository(PDFRelease).find({ where: { domain: { id: domain.id }, ...where }, order: { createdAt: 'DESC' } })\n const kept: PDFRelease[] = []\n for (const row of rows) if (await mayReadRelease(context, row)) kept.push(row)\n return kept\n}\n\nconst SEARCHED = ['number', 'subjectName', 'purpose', 'submittedTo']\n\n/** The ledger's filters - kind, refType, refId, state - and its search words, from a list's parameters. */\nfunction listOf(params: ListParam) {\n const where: Record<string, any> = {}\n let search = ''\n for (const filter of params?.filters ?? []) {\n if (['kind', 'refType', 'refId', 'state'].includes(filter.name)) where[filter.name] = filter.operator === 'in' ? In(filter.value) : filter.value\n else if (filter.name === 'q' || SEARCHED.includes(filter.name)) search = String(filter.value ?? '').replace(/%/g, '').toLowerCase()\n }\n return { where, search }\n}\n\n/** A page of rows, after the search words. */\nfunction pageOf(rows: PDFRelease[], search: string, params: ListParam): PDFReleaseList {\n const found = search ? rows.filter(row => SEARCHED.some(field => String((row as any)[field] ?? '').toLowerCase().includes(search))) : rows\n const { page = 1, limit = 0 } = params?.pagination ?? {}\n return { items: limit > 0 ? found.slice((page - 1) * limit, page * limit) : found, total: found.length }\n}\n\n/** Whether a row is about the caller - its kind's own subject for them (one's own employee record). */\nasync function aboutCaller(context: ResolverContext, row: PDFRelease, own: Map<string, string | null>): Promise<boolean> {\n const kind = issuedDocumentKindOf(row.kind)\n if (!kind?.ownSubject || !row.kind) return false\n if (!own.has(row.kind)) own.set(row.kind, await kind.ownSubject(context).catch(() => null))\n return !!row.refId && own.get(row.kind) === row.refId\n}\n\n/*\n * The issuance ledger (발급 대장, ADR-0176 decision 2), two ways:\n *\n * - The whole ledger - every row's number, kind, subject, purpose, recipient and issuer - is read under its own category\n * `issued-document` (`pdf.issuance-ledger`; management support keeps it, the user 2026-10-30). A row's file still\n * opens by its kind's rule.\n * - Everyone else reads rows by each kind's rule (`mayRead`), asked row by row: their own (내 정보 › 내 증명서,\n * `mine` - about them or issued by them), the registers on the register screen. Issuing and revoking ask the kind (`mayIssue`). These\n * doors carry no `@privilege` and are declared open by design on `schema.openFields`.\n */\n@Resolver(PDFRelease)\n@UseMiddleware(SpeakRefusals)\nexport class PDFReleaseQuery {\n @Directive('@privilege(category: \"issued-document\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => PDFReleaseList, { description: 'The whole issuance ledger, newest first - filter by kind, refType, refId, state; search number, subject, purpose or recipient' })\n async issuedDocuments(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<PDFReleaseList> {\n const { where, search } = listOf(params)\n const rows = await getRepository(PDFRelease).find({ where: { domain: { id: context.state.domain.id }, ...where }, order: { createdAt: 'DESC' } })\n return pageOf(rows, search, params)\n }\n\n @Query(returns => PDFReleaseList, { description: \"The issued documents the caller may read by their kinds' rules, newest first - with mine, those about the caller or issued by them\" })\n async readableIssuedDocuments(\n @Args(type => ListParam) params: ListParam,\n @Arg('mine', { nullable: true, description: 'Only the caller\\'s own: the documents about them and those they issued' }) mine: boolean,\n @Ctx() context: ResolverContext\n ): Promise<PDFReleaseList> {\n const { where, search } = listOf(params)\n let rows = await readableRows(context, where)\n if (mine) {\n const own = new Map<string, string | null>()\n const kept: PDFRelease[] = []\n for (const row of rows) if (row.creatorId === context.state.user?.id || (await aboutCaller(context, row, own))) kept.push(row)\n rows = kept\n }\n return pageOf(rows, search, params)\n }\n\n @Query(returns => PDFRelease, { nullable: true, description: 'One issued document, if the caller may read it' })\n async issuedDocument(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<PDFRelease | null> {\n return (await readableRows(context, { id }))[0] ?? null\n }\n\n @Query(returns => [IssuedDocumentKindInfo], { description: 'The kinds of document the loaded modules issue' })\n async issuedDocumentKinds(@Ctx() context: ResolverContext): Promise<IssuedDocumentKindInfo[]> {\n const domainId = context.state.domain?.id\n const infos: IssuedDocumentKindInfo[] = []\n for (const one of issuedDocumentKinds()) {\n /*\n * Issued here: a kind about the company itself, and a kind about the caller (one's own 재직증명서). Anyone else's\n * is issued from the screen of its subject.\n */\n const own = one.refType === 'Domain' ? null : ((await one.ownSubject?.(context).catch(() => null)) ?? null)\n const subject = one.refType === 'Domain' ? domainId : own\n const issuable = !!subject && (await one.mayIssue(context, subject).catch(() => false))\n infos.push({ kind: one.kind, prefix: one.prefix, refType: one.refType, asOf: !!one.asOf, issuable, refId: issuable && own ? own : undefined })\n }\n return infos\n }\n\n @Directive('@transaction')\n @Mutation(returns => PDFRelease, { description: 'To issue a document of a kind for its subject - numbered, printed and kept in the ledger; the kind\\'s module says who may' })\n async issueDocument(\n @Arg('kind') kind: string,\n @Arg('refId', { nullable: true, description: 'What it is about - none for a document about the company itself' }) refId: string | null,\n @Arg('input', type => IssueDocumentInput, { nullable: true }) input: IssueDocumentInput,\n @Ctx() context: ResolverContext\n ): Promise<PDFRelease> {\n return (await releasePdf(context, { kind, refId, input })).release\n }\n\n @Directive('@transaction')\n @Mutation(returns => PDFRelease, { description: 'To revoke an issued document, with the reason - the row and its file stay' })\n async revokeIssuedDocument(@Arg('id') id: string, @Arg('reason') reason: string, @Ctx() context: ResolverContext): Promise<PDFRelease> {\n return await revokeRelease(context, id, reason)\n }\n\n @FieldResolver(type => Boolean, { description: \"Whether the caller may open the file - its kind's rule\" })\n async readable(@Root() pdfRelease: PDFRelease, @Ctx() context: ResolverContext): Promise<boolean> {\n return await mayReadRelease(context, pdfRelease)\n }\n\n @FieldResolver(type => Attachment, { nullable: true, description: \"The PDF file of the release - for whoever may open it by its kind's rule\" })\n async file(@Root() pdfRelease: PDFRelease, @Ctx() context: ResolverContext): Promise<Attachment | null> {\n if (!(await mayReadRelease(context, pdfRelease))) return null\n return await getRepository(Attachment).findOne({ where: { refType: 'PDFRelease', refBy: pdfRelease.id }, order: { createdAt: 'DESC' } })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() pdfRelease: PDFRelease): Promise<Domain> {\n return pdfRelease.domainId && (await getRepository(Domain).findOneBy({ id: pdfRelease.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() pdfRelease: PDFRelease): Promise<User> {\n return pdfRelease.updaterId && (await getRepository(User).findOneBy({ id: pdfRelease.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() pdfRelease: PDFRelease): Promise<User> {\n return pdfRelease.creatorId && (await getRepository(User).findOneBy({ id: pdfRelease.creatorId }))\n }\n}\n\n/** The ledger's doors, open by design (auth-base `openFields`). */\nexport const OPEN_FIELDS = {\n 'Query.readableIssuedDocuments': \"each row is read by its kind's module rule (mayRead)\",\n 'Query.issuedDocument': \"read by its kind's module rule (mayRead)\",\n 'Query.issuedDocumentKinds': 'the names of the kinds the loaded modules issue - no data',\n 'Mutation.issueDocument': \"issued by its kind's module rule (mayIssue)\",\n 'Mutation.revokeIssuedDocument': \"revoked by whoever may issue the kind for its subject (mayIssue)\"\n}\n"]}
@@ -1,19 +1,4 @@
1
- import { PDFRelease, PDFReleaseStatus } from './pdf-release';
2
- export declare class NewPDFRelease {
3
- name: string;
4
- description?: string;
5
- state?: PDFReleaseStatus;
6
- active?: boolean;
7
- params?: string;
8
- }
9
- export declare class PDFReleasePatch {
10
- id?: string;
11
- name?: string;
12
- description?: string;
13
- state?: PDFReleaseStatus;
14
- active?: boolean;
15
- cuFlag?: string;
16
- }
1
+ import { PDFRelease } from './pdf-release';
17
2
  export declare class PDFReleaseList {
18
3
  items: PDFRelease[];
19
4
  total: number;
@@ -1,77 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PDFReleaseList = exports.PDFReleasePatch = exports.NewPDFRelease = void 0;
3
+ exports.PDFReleaseList = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const type_graphql_1 = require("type-graphql");
6
6
  const pdf_release_1 = require("./pdf-release");
7
- let NewPDFRelease = class NewPDFRelease {
8
- };
9
- exports.NewPDFRelease = NewPDFRelease;
10
- tslib_1.__decorate([
11
- (0, type_graphql_1.Field)(),
12
- tslib_1.__metadata("design:type", String)
13
- ], NewPDFRelease.prototype, "name", void 0);
14
- tslib_1.__decorate([
15
- (0, type_graphql_1.Field)({ nullable: true }),
16
- tslib_1.__metadata("design:type", String)
17
- ], NewPDFRelease.prototype, "description", void 0);
18
- tslib_1.__decorate([
19
- (0, type_graphql_1.Field)(type => pdf_release_1.PDFReleaseStatus, { nullable: true }),
20
- tslib_1.__metadata("design:type", String)
21
- ], NewPDFRelease.prototype, "state", void 0);
22
- tslib_1.__decorate([
23
- (0, type_graphql_1.Field)({ nullable: true }),
24
- tslib_1.__metadata("design:type", Boolean)
25
- ], NewPDFRelease.prototype, "active", void 0);
26
- tslib_1.__decorate([
27
- (0, type_graphql_1.Field)({ nullable: true }),
28
- tslib_1.__metadata("design:type", String)
29
- ], NewPDFRelease.prototype, "params", void 0);
30
- exports.NewPDFRelease = NewPDFRelease = tslib_1.__decorate([
31
- (0, type_graphql_1.InputType)()
32
- ], NewPDFRelease);
33
- let PDFReleasePatch = class PDFReleasePatch {
34
- };
35
- exports.PDFReleasePatch = PDFReleasePatch;
36
- tslib_1.__decorate([
37
- (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
38
- tslib_1.__metadata("design:type", String)
39
- ], PDFReleasePatch.prototype, "id", void 0);
40
- tslib_1.__decorate([
41
- (0, type_graphql_1.Field)({ nullable: true }),
42
- tslib_1.__metadata("design:type", String)
43
- ], PDFReleasePatch.prototype, "name", void 0);
44
- tslib_1.__decorate([
45
- (0, type_graphql_1.Field)({ nullable: true }),
46
- tslib_1.__metadata("design:type", String)
47
- ], PDFReleasePatch.prototype, "description", void 0);
48
- tslib_1.__decorate([
49
- (0, type_graphql_1.Field)(type => pdf_release_1.PDFReleaseStatus, { nullable: true }),
50
- tslib_1.__metadata("design:type", String)
51
- ], PDFReleasePatch.prototype, "state", void 0);
52
- tslib_1.__decorate([
53
- (0, type_graphql_1.Field)({ nullable: true }),
54
- tslib_1.__metadata("design:type", Boolean)
55
- ], PDFReleasePatch.prototype, "active", void 0);
56
- tslib_1.__decorate([
57
- (0, type_graphql_1.Field)({ nullable: true }),
58
- tslib_1.__metadata("design:type", String)
59
- ], PDFReleasePatch.prototype, "cuFlag", void 0);
60
- exports.PDFReleasePatch = PDFReleasePatch = tslib_1.__decorate([
61
- (0, type_graphql_1.InputType)()
62
- ], PDFReleasePatch);
63
7
  let PDFReleaseList = class PDFReleaseList {
64
8
  };
65
9
  exports.PDFReleaseList = PDFReleaseList;
66
10
  tslib_1.__decorate([
67
- (0, type_graphql_1.Field)(type => [pdf_release_1.PDFRelease]),
11
+ (0, type_graphql_1.Field)(type => [pdf_release_1.PDFRelease], { description: 'The rows' }),
68
12
  tslib_1.__metadata("design:type", Array)
69
13
  ], PDFReleaseList.prototype, "items", void 0);
70
14
  tslib_1.__decorate([
71
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
15
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How many rows the caller may read in all' }),
72
16
  tslib_1.__metadata("design:type", Number)
73
17
  ], PDFReleaseList.prototype, "total", void 0);
74
18
  exports.PDFReleaseList = PDFReleaseList = tslib_1.__decorate([
75
- (0, type_graphql_1.ObjectType)()
19
+ (0, type_graphql_1.ObjectType)({ description: 'A page of issued documents' })
76
20
  ], PDFReleaseList);
77
21
  //# sourceMappingURL=pdf-release-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-release-type.js","sourceRoot":"","sources":["../../../server/service/pdf-release/pdf-release-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAItF,+CAA4D;AAGrD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAezB,CAAA;AAfY,sCAAa;AAExB;IADC,IAAA,oBAAK,GAAE;;2CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC5B;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;wBAdJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAezB;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAkB3B,CAAA;AAlBY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CAC5B;AAGxB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;0BAjBJ,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAkB3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,CAAC;;6CACT;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;yBALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B","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 { PDFRelease, PDFReleaseStatus } from './pdf-release'\n\n@InputType()\nexport class NewPDFRelease {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => PDFReleaseStatus, { nullable: true })\n state?: PDFReleaseStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class PDFReleasePatch {\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 => PDFReleaseStatus, { nullable: true })\n state?: PDFReleaseStatus\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class PDFReleaseList {\n @Field(type => [PDFRelease])\n items: PDFRelease[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"pdf-release-type.js","sourceRoot":"","sources":["../../../server/service/pdf-release/pdf-release-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAqD;AAErD,+CAA0C;AAGnC,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;;6CACtC;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;;6CACnE;yBALF,cAAc;IAD1B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;GAC7C,cAAc,CAM1B","sourcesContent":["import { Field, Int, ObjectType } from 'type-graphql'\n\nimport { PDFRelease } from './pdf-release'\n\n@ObjectType({ description: 'A page of issued documents' })\nexport class PDFReleaseList {\n @Field(type => [PDFRelease], { description: 'The rows' })\n items: PDFRelease[]\n\n @Field(type => Int, { description: 'How many rows the caller may read in all' })\n total: number\n}\n"]}
@@ -3,7 +3,8 @@ import { User } from '@things-factory/auth-base';
3
3
  import { PDFTemplate } from '../pdf-template/pdf-template';
4
4
  export declare enum PDFReleaseStatus {
5
5
  published = "published",
6
- failed = "failed"
6
+ failed = "failed",
7
+ revoked = "revoked"
7
8
  }
8
9
  export declare class PDFRelease {
9
10
  readonly id: string;
@@ -12,9 +13,20 @@ export declare class PDFRelease {
12
13
  name?: string;
13
14
  description?: string;
14
15
  active?: boolean;
16
+ kind?: string;
17
+ number?: string;
18
+ year?: number;
19
+ sequence?: number;
20
+ refType?: string;
21
+ refId?: string;
22
+ subjectName?: string;
23
+ purpose?: string;
24
+ submittedTo?: string;
15
25
  template?: PDFTemplate;
16
26
  templateId?: string;
17
27
  state?: PDFReleaseStatus;
28
+ revokedAt?: Date;
29
+ revokeReason?: string;
18
30
  createdAt?: Date;
19
31
  updatedAt?: Date;
20
32
  deletedAt?: Date;