@things-factory/document-template-base 7.0.0-alpha.9 → 7.0.0

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 (43) hide show
  1. package/client/bootstrap.js +1 -1
  2. package/dist-server/constants/index.d.ts +1 -0
  3. package/dist-server/constants/template-type.d.ts +18 -0
  4. package/dist-server/controllers/index.d.ts +1 -0
  5. package/dist-server/controllers/report-to-html.d.ts +20 -0
  6. package/dist-server/controllers/report-to-html.js +4 -5
  7. package/dist-server/controllers/report-to-html.js.map +1 -1
  8. package/dist-server/index.d.ts +4 -0
  9. package/dist-server/migrations/index.d.ts +1 -0
  10. package/dist-server/routes.d.ts +1 -0
  11. package/dist-server/service/doc-template/doc-template-mutation.d.ts +9 -0
  12. package/dist-server/service/doc-template/doc-template-mutation.js +2 -2
  13. package/dist-server/service/doc-template/doc-template-mutation.js.map +1 -1
  14. package/dist-server/service/doc-template/doc-template-query.d.ts +12 -0
  15. package/dist-server/service/doc-template/doc-template-query.js +3 -3
  16. package/dist-server/service/doc-template/doc-template-query.js.map +1 -1
  17. package/dist-server/service/doc-template/doc-template-type.d.ts +29 -0
  18. package/dist-server/service/doc-template/doc-template-type.js +6 -6
  19. package/dist-server/service/doc-template/doc-template-type.js.map +1 -1
  20. package/dist-server/service/doc-template/doc-template.d.ts +22 -0
  21. package/dist-server/service/doc-template/doc-template.js +4 -4
  22. package/dist-server/service/doc-template/doc-template.js.map +1 -1
  23. package/dist-server/service/doc-template/index.d.ts +5 -0
  24. package/dist-server/service/index.d.ts +7 -0
  25. package/dist-server/service/template-file/index.d.ts +5 -0
  26. package/dist-server/service/template-file/template-file-mutation.d.ts +9 -0
  27. package/dist-server/service/template-file/template-file-mutation.js +2 -2
  28. package/dist-server/service/template-file/template-file-mutation.js.map +1 -1
  29. package/dist-server/service/template-file/template-file-query.d.ts +14 -0
  30. package/dist-server/service/template-file/template-file-query.js +3 -3
  31. package/dist-server/service/template-file/template-file-query.js.map +1 -1
  32. package/dist-server/service/template-file/template-file-type.d.ts +28 -0
  33. package/dist-server/service/template-file/template-file-type.js +6 -6
  34. package/dist-server/service/template-file/template-file-type.js.map +1 -1
  35. package/dist-server/service/template-file/template-file.d.ts +23 -0
  36. package/dist-server/service/template-file/template-file.js +5 -6
  37. package/dist-server/service/template-file/template-file.js.map +1 -1
  38. package/dist-server/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +5 -5
  40. package/server/service/doc-template/doc-template-query.ts +6 -7
  41. package/server/service/doc-template/doc-template.ts +26 -27
  42. package/server/service/template-file/template-file-query.ts +8 -9
  43. package/server/service/template-file/template-file.ts +27 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/document-template-base",
3
- "version": "7.0.0-alpha.9",
3
+ "version": "7.0.0",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,11 +24,11 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/auth-base": "^7.0.0-alpha.9",
28
- "@things-factory/env": "^7.0.0-alpha.0",
29
- "@things-factory/shell": "^7.0.0-alpha.9",
27
+ "@things-factory/auth-base": "^7.0.0",
28
+ "@things-factory/env": "^7.0.0",
29
+ "@things-factory/shell": "^7.0.0",
30
30
  "form-data": "^3.0.0",
31
31
  "node-fetch": "^2.6.0"
32
32
  },
33
- "gitHead": "99fc5aead211b3c82e3ebbf76e8d5d1db01b1ddc"
33
+ "gitHead": "00f3917ca132679e3571f3f4fd16f4caf84f488e"
34
34
  }
@@ -1,4 +1,3 @@
1
-
2
1
  import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
3
2
  import { ListParam, convertListParams, getRepository, getQueryBuilderFromListParams } from '@things-factory/shell'
4
3
  import { DocTemplate } from './doc-template'
@@ -18,7 +17,7 @@ export class DocTemplateQuery {
18
17
  }
19
18
 
20
19
  @Query(returns => DocTemplateList, { description: 'To fetch multiple DocTemplates' })
21
- async docTemplates(@Args() params: ListParam, @Ctx() context: any): Promise<DocTemplateList> {
20
+ async docTemplates(@Args(type => ListParam) params: ListParam, @Ctx() context: any): Promise<DocTemplateList> {
22
21
  const { domain } = context.state
23
22
 
24
23
  const queryBuilder = getQueryBuilderFromListParams({
@@ -34,16 +33,16 @@ export class DocTemplateQuery {
34
33
 
35
34
  @FieldResolver(type => Domain)
36
35
  async domain(@Root() docTemplate: DocTemplate): Promise<Domain> {
37
- return await getRepository(Domain).findOneBy({id:docTemplate.domainId})
36
+ return await getRepository(Domain).findOneBy({ id: docTemplate.domainId })
38
37
  }
39
38
 
40
39
  @FieldResolver(type => User)
41
- async creator(@Root() docTemplate: DocTemplate): Promise<User> {
42
- return await getRepository(User).findOneBy({id:docTemplate.creatorId})
40
+ async creator(@Root() docTemplate: DocTemplate): Promise<User> {
41
+ return await getRepository(User).findOneBy({ id: docTemplate.creatorId })
43
42
  }
44
43
 
45
44
  @FieldResolver(type => User)
46
- async updater(@Root() docTemplate: DocTemplate): Promise<User> {
47
- return await getRepository(User).findOneBy({id:docTemplate.updaterId})
45
+ async updater(@Root() docTemplate: DocTemplate): Promise<User> {
46
+ return await getRepository(User).findOneBy({ id: docTemplate.updaterId })
48
47
  }
49
48
  }
@@ -1,4 +1,3 @@
1
-
2
1
  import {
3
2
  CreateDateColumn,
4
3
  UpdateDateColumn,
@@ -15,66 +14,66 @@ import { User } from '@things-factory/auth-base'
15
14
  import { Domain } from '@things-factory/shell'
16
15
 
17
16
  @Entity('doc_templates')
18
- @Index('ix_doc_template_0', (docTemplate: DocTemplate) => [docTemplate.domain,docTemplate.name], { unique: true })
19
- @Index('ix_doc_template_1', (docTemplate: DocTemplate) => [docTemplate.domain,docTemplate.activeFlag])
17
+ @Index('ix_doc_template_0', (docTemplate: DocTemplate) => [docTemplate.domain, docTemplate.name], { unique: true })
18
+ @Index('ix_doc_template_1', (docTemplate: DocTemplate) => [docTemplate.domain, docTemplate.activeFlag])
20
19
  @ObjectType({ description: 'Entity for DocTemplate' })
21
20
  export class DocTemplate {
22
21
  @PrimaryGeneratedColumn('uuid')
23
22
  @Field(type => ID)
24
23
  readonly id: string
25
24
 
26
- @Column({ name:'name', nullable:false })
27
- @Field({ nullable:false })
25
+ @Column({ name: 'name', nullable: false })
26
+ @Field({ nullable: false })
28
27
  name: string
29
28
 
30
- @Column({ name:'description', nullable:false })
31
- @Field({ nullable:false })
29
+ @Column({ name: 'description', nullable: false })
30
+ @Field({ nullable: false })
32
31
  description: string
33
32
 
34
- @Column({ name:'job_type', nullable:true })
35
- @Field({ nullable:true })
33
+ @Column({ name: 'job_type', nullable: true })
34
+ @Field({ nullable: true })
36
35
  jobType?: string
37
36
 
38
- @Column({ name:'job_class', nullable:true })
39
- @Field({ nullable:true })
37
+ @Column({ name: 'job_class', nullable: true })
38
+ @Field({ nullable: true })
40
39
  jobClass?: string
41
40
 
42
- @Column({ name:'job_category', nullable:true })
43
- @Field({ nullable:true })
41
+ @Column({ name: 'job_category', nullable: true })
42
+ @Field({ nullable: true })
44
43
  jobCategory?: string
45
44
 
46
- @Column({ name:'template', type:'text', nullable:true })
47
- @Field({ nullable:true })
45
+ @Column({ name: 'template', type: 'text', nullable: true })
46
+ @Field({ nullable: true })
48
47
  template?: string
49
48
 
50
- @Column({ name:'logic', type:'text', nullable:true })
51
- @Field({ nullable:true })
49
+ @Column({ name: 'logic', type: 'text', nullable: true })
50
+ @Field({ nullable: true })
52
51
  logic?: string
53
52
 
54
- @Column({ name:'active_flag', type:'boolean', nullable:true })
55
- @Field({ nullable:true })
53
+ @Column({ name: 'active_flag', type: 'boolean', nullable: true })
54
+ @Field({ nullable: true })
56
55
  activeFlag?: boolean
57
56
 
58
- @Column({ name:'note', nullable:true })
59
- @Field({ nullable:true })
57
+ @Column({ name: 'note', nullable: true })
58
+ @Field({ nullable: true })
60
59
  note?: string
61
-
62
- @ManyToOne(type => Domain, {createForeignKeyConstraints: false, nullable: false})
60
+
61
+ @ManyToOne(type => Domain, { createForeignKeyConstraints: false, nullable: false })
63
62
  @Field({ nullable: false })
64
63
  domain: Domain
65
64
 
66
65
  @RelationId((docTemplate: DocTemplate) => docTemplate.domain)
67
66
  domainId: string
68
67
 
69
- @ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})
70
- @Field({ nullable: true })
68
+ @ManyToOne(type => User, { createForeignKeyConstraints: false, nullable: true })
69
+ @Field(type => User, { nullable: true })
71
70
  creator?: User
72
71
 
73
72
  @RelationId((docTemplate: DocTemplate) => docTemplate.creator)
74
73
  creatorId?: string
75
74
 
76
- @ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})
77
- @Field({ nullable: true })
75
+ @ManyToOne(type => User, { createForeignKeyConstraints: false, nullable: true })
76
+ @Field(type => User, { nullable: true })
78
77
  updater?: User
79
78
 
80
79
  @RelationId((docTemplate: DocTemplate) => docTemplate.updater)
@@ -1,4 +1,3 @@
1
-
2
1
  import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
3
2
  import { ListParam, getRepository, getQueryBuilderFromListParams } from '@things-factory/shell'
4
3
  import { TemplateFile } from './template-file'
@@ -19,7 +18,7 @@ export class TemplateFileQuery {
19
18
  }
20
19
 
21
20
  @Query(returns => TemplateFileList, { description: 'To fetch multiple TemplateFiles' })
22
- async templateFiles(@Args() params: ListParam, @Ctx() context: any): Promise<TemplateFileList> {
21
+ async templateFiles(@Args(type => ListParam) params: ListParam, @Ctx() context: any): Promise<TemplateFileList> {
23
22
  const { domain } = context.state
24
23
 
25
24
  const queryBuilder = getQueryBuilderFromListParams({
@@ -35,21 +34,21 @@ export class TemplateFileQuery {
35
34
 
36
35
  @FieldResolver(type => Attachment)
37
36
  async attachment(@Root() templateFile: TemplateFile): Promise<Attachment> {
38
- return await getRepository(Attachment).findOneBy({id:templateFile.attachmentId})
39
- }
37
+ return await getRepository(Attachment).findOneBy({ id: templateFile.attachmentId })
38
+ }
40
39
 
41
40
  @FieldResolver(type => Domain)
42
41
  async domain(@Root() templateFile: TemplateFile): Promise<Domain> {
43
- return await getRepository(Domain).findOneBy({id:templateFile.domainId})
42
+ return await getRepository(Domain).findOneBy({ id: templateFile.domainId })
44
43
  }
45
44
 
46
45
  @FieldResolver(type => User)
47
- async creator(@Root() templateFile: TemplateFile): Promise<User> {
48
- return await getRepository(User).findOneBy({id:templateFile.creatorId})
46
+ async creator(@Root() templateFile: TemplateFile): Promise<User> {
47
+ return await getRepository(User).findOneBy({ id: templateFile.creatorId })
49
48
  }
50
49
 
51
50
  @FieldResolver(type => User)
52
- async updater(@Root() templateFile: TemplateFile): Promise<User> {
53
- return await getRepository(User).findOneBy({id:templateFile.updaterId})
51
+ async updater(@Root() templateFile: TemplateFile): Promise<User> {
52
+ return await getRepository(User).findOneBy({ id: templateFile.updaterId })
54
53
  }
55
54
  }
@@ -1,4 +1,3 @@
1
-
2
1
  import {
3
2
  CreateDateColumn,
4
3
  UpdateDateColumn,
@@ -8,7 +7,7 @@ import {
8
7
  RelationId,
9
8
  ManyToOne,
10
9
  OneToOne,
11
- PrimaryGeneratedColumn,
10
+ PrimaryGeneratedColumn
12
11
  } from 'typeorm'
13
12
  import { ObjectType, Field, ID } from 'type-graphql'
14
13
 
@@ -17,68 +16,68 @@ import { Domain } from '@things-factory/shell'
17
16
  import { Attachment } from '@things-factory/attachment-base'
18
17
 
19
18
  @Entity('template_files')
20
- @Index('ix_template_file_0', (templateFile: TemplateFile) => [templateFile.domain,templateFile.name], { unique: true })
21
- @Index('ix_template_file_1', (templateFile: TemplateFile) => [templateFile.domain,templateFile.jobType])
22
- @Index('ix_template_file_2', (templateFile: TemplateFile) => [templateFile.domain,templateFile.jobClass])
23
- @Index('ix_template_file_3', (templateFile: TemplateFile) => [templateFile.domain,templateFile.jobCategory])
24
- @Index('ix_template_file_4', (templateFile: TemplateFile) => [templateFile.domain,templateFile.attachment])
19
+ @Index('ix_template_file_0', (templateFile: TemplateFile) => [templateFile.domain, templateFile.name], { unique: true })
20
+ @Index('ix_template_file_1', (templateFile: TemplateFile) => [templateFile.domain, templateFile.jobType])
21
+ @Index('ix_template_file_2', (templateFile: TemplateFile) => [templateFile.domain, templateFile.jobClass])
22
+ @Index('ix_template_file_3', (templateFile: TemplateFile) => [templateFile.domain, templateFile.jobCategory])
23
+ @Index('ix_template_file_4', (templateFile: TemplateFile) => [templateFile.domain, templateFile.attachment])
25
24
  @ObjectType({ description: 'Entity for TemplateFile' })
26
25
  export class TemplateFile {
27
26
  @PrimaryGeneratedColumn('uuid')
28
27
  @Field(type => ID)
29
28
  readonly id: string
30
29
 
31
- @Column({ name:'name', nullable:false })
32
- @Field({ nullable:false })
30
+ @Column({ name: 'name', nullable: false })
31
+ @Field({ nullable: false })
33
32
  name: string
34
33
 
35
- @Column({ name:'description', nullable:false })
36
- @Field({ nullable:false })
34
+ @Column({ name: 'description', nullable: false })
35
+ @Field({ nullable: false })
37
36
  description: string
38
37
 
39
- @Column({ name:'job_type', nullable:true })
40
- @Field({ nullable:true })
38
+ @Column({ name: 'job_type', nullable: true })
39
+ @Field({ nullable: true })
41
40
  jobType?: string
42
41
 
43
- @Column({ name:'job_class', nullable:true })
44
- @Field({ nullable:true })
42
+ @Column({ name: 'job_class', nullable: true })
43
+ @Field({ nullable: true })
45
44
  jobClass?: string
46
45
 
47
- @Column({ name:'job_category', nullable:true })
48
- @Field({ nullable:true })
46
+ @Column({ name: 'job_category', nullable: true })
47
+ @Field({ nullable: true })
49
48
  jobCategory?: string
50
49
 
51
- @Column({ name:'active_flag', type:'boolean', nullable:true })
52
- @Field( { nullable:true })
50
+ @Column({ name: 'active_flag', type: 'boolean', nullable: true })
51
+ @Field({ nullable: true })
53
52
  activeFlag?: boolean
54
53
 
55
- @Column({ name:'note', nullable:true })
56
- @Field({ nullable:true })
54
+ @Column({ name: 'note', nullable: true })
55
+ @Field({ nullable: true })
57
56
  note?: string
58
57
 
59
- @ManyToOne(type => Attachment, {createForeignKeyConstraints: false, nullable: true})
60
- @Field({ nullable: true})
58
+ @ManyToOne(type => Attachment, { createForeignKeyConstraints: false, nullable: true })
59
+ @Field({ nullable: true })
61
60
  attachment: Attachment
62
61
 
63
62
  @RelationId((templateFile: TemplateFile) => templateFile.attachment)
64
63
  attachmentId?: string
65
64
 
66
- @ManyToOne(type => Domain, {createForeignKeyConstraints: false, nullable: false})
65
+ @ManyToOne(type => Domain, { createForeignKeyConstraints: false, nullable: false })
67
66
  @Field({ nullable: false })
68
67
  domain: Domain
69
68
 
70
69
  @RelationId((templateFile: TemplateFile) => templateFile.domain)
71
70
  domainId: string
72
71
 
73
- @ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})
74
- @Field({ nullable: true })
72
+ @ManyToOne(type => User, { createForeignKeyConstraints: false, nullable: true })
73
+ @Field(type => User, { nullable: true })
75
74
  creator?: User
76
75
 
77
76
  @RelationId((templateFile: TemplateFile) => templateFile.creator)
78
77
  creatorId?: string
79
78
 
80
- @ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})
81
- @Field({ nullable: true })
79
+ @ManyToOne(type => User, { createForeignKeyConstraints: false, nullable: true })
80
+ @Field(type => User, { nullable: true })
82
81
  updater?: User
83
82
 
84
83
  @RelationId((templateFile: TemplateFile) => templateFile.updater)