@things-factory/code-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 (38) hide show
  1. package/dist-client/codes-getter.js.map +1 -1
  2. package/dist-client/tsconfig.tsbuildinfo +1 -1
  3. package/dist-server/index.d.ts +1 -0
  4. package/dist-server/service/common-code/common-code-mutation.d.ts +10 -0
  5. package/dist-server/service/common-code/common-code-mutation.js +2 -2
  6. package/dist-server/service/common-code/common-code-mutation.js.map +1 -1
  7. package/dist-server/service/common-code/common-code-query.d.ts +14 -0
  8. package/dist-server/service/common-code/common-code-query.js +3 -3
  9. package/dist-server/service/common-code/common-code-query.js.map +1 -1
  10. package/dist-server/service/common-code/common-code-type.d.ts +17 -0
  11. package/dist-server/service/common-code/common-code-type.js +6 -6
  12. package/dist-server/service/common-code/common-code-type.js.map +1 -1
  13. package/dist-server/service/common-code/common-code.d.ts +17 -0
  14. package/dist-server/service/common-code/common-code.js +5 -5
  15. package/dist-server/service/common-code/common-code.js.map +1 -1
  16. package/dist-server/service/common-code/index.d.ts +5 -0
  17. package/dist-server/service/common-code-detail/common-code-detail-mutation.d.ts +10 -0
  18. package/dist-server/service/common-code-detail/common-code-detail-mutation.js +2 -2
  19. package/dist-server/service/common-code-detail/common-code-detail-mutation.js.map +1 -1
  20. package/dist-server/service/common-code-detail/common-code-detail-query.d.ts +14 -0
  21. package/dist-server/service/common-code-detail/common-code-detail-query.js +4 -4
  22. package/dist-server/service/common-code-detail/common-code-detail-query.js.map +1 -1
  23. package/dist-server/service/common-code-detail/common-code-detail-type.d.ts +22 -0
  24. package/dist-server/service/common-code-detail/common-code-detail-type.js +6 -6
  25. package/dist-server/service/common-code-detail/common-code-detail-type.js.map +1 -1
  26. package/dist-server/service/common-code-detail/common-code-detail.d.ts +20 -0
  27. package/dist-server/service/common-code-detail/common-code-detail.js +5 -5
  28. package/dist-server/service/common-code-detail/common-code-detail.js.map +1 -1
  29. package/dist-server/service/common-code-detail/index.d.ts +5 -0
  30. package/dist-server/service/index.d.ts +6 -0
  31. package/dist-server/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +5 -5
  33. package/server/service/common-code/common-code-query.ts +9 -2
  34. package/server/service/common-code/common-code.ts +14 -4
  35. package/server/service/common-code-detail/common-code-detail-query.ts +5 -2
  36. package/server/service/common-code-detail/common-code-detail.ts +23 -6
  37. package/dist-server/migrations/index.js +0 -12
  38. package/dist-server/migrations/index.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/code-base",
3
- "version": "7.0.0-alpha.9",
3
+ "version": "7.0.0",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -27,9 +27,9 @@
27
27
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
28
28
  },
29
29
  "dependencies": {
30
- "@operato/graphql": "^2.0.0-alpha.0",
31
- "@things-factory/auth-base": "^7.0.0-alpha.9",
32
- "@things-factory/shell": "^7.0.0-alpha.9"
30
+ "@operato/graphql": "^7.0.0",
31
+ "@things-factory/auth-base": "^7.0.0",
32
+ "@things-factory/shell": "^7.0.0"
33
33
  },
34
- "gitHead": "99fc5aead211b3c82e3ebbf76e8d5d1db01b1ddc"
34
+ "gitHead": "00f3917ca132679e3571f3f4fd16f4caf84f488e"
35
35
  }
@@ -19,7 +19,10 @@ export class CommonCodeQuery {
19
19
  }
20
20
 
21
21
  @Query(returns => CommonCodeList, { description: 'To fetch multiple CommonCodes' })
22
- async commonCodes(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<CommonCodeList> {
22
+ async commonCodes(
23
+ @Args(type => ListParam) params: ListParam,
24
+ @Ctx() context: ResolverContext
25
+ ): Promise<CommonCodeList> {
23
26
  const { domain } = context.state
24
27
 
25
28
  const queryBuilder = getQueryBuilderFromListParams({
@@ -36,7 +39,11 @@ export class CommonCodeQuery {
36
39
 
37
40
  /* TODO move to operato-wms module */
38
41
  @Query(returns => CommonCode, { description: "To fetch specific domain's CommonCodes by given name" })
39
- async partnerCommonCode(@Arg('name') name: string, @Arg('partnerDomainId') partnerDomainId: string, @Ctx() context: ResolverContext): Promise<CommonCode> {
42
+ async partnerCommonCode(
43
+ @Arg('name') name: string,
44
+ @Arg('partnerDomainId') partnerDomainId: string,
45
+ @Ctx() context: ResolverContext
46
+ ): Promise<CommonCode> {
40
47
  return await getRepository(CommonCode).findOne({
41
48
  where: { domain: { id: partnerDomainId }, name }
42
49
  })
@@ -1,5 +1,15 @@
1
1
  import { Field, ID, ObjectType } from 'type-graphql'
2
- import { Column, CreateDateColumn, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
2
+ import {
3
+ Column,
4
+ CreateDateColumn,
5
+ Entity,
6
+ Index,
7
+ ManyToOne,
8
+ OneToMany,
9
+ PrimaryGeneratedColumn,
10
+ RelationId,
11
+ UpdateDateColumn
12
+ } from 'typeorm'
3
13
 
4
14
  import { User } from '@things-factory/auth-base'
5
15
  import { Domain } from '@things-factory/shell'
@@ -16,7 +26,7 @@ export class CommonCode {
16
26
  readonly id: string
17
27
 
18
28
  @ManyToOne(type => Domain)
19
- @Field({ nullable: true })
29
+ @Field(type => Domain)
20
30
  domain?: Domain
21
31
 
22
32
  @RelationId((commonCode: CommonCode) => commonCode.domain)
@@ -46,7 +56,7 @@ export class CommonCode {
46
56
  @ManyToOne(type => User, {
47
57
  nullable: true
48
58
  })
49
- @Field({ nullable: true })
59
+ @Field(type => User, { nullable: true })
50
60
  creator?: User
51
61
 
52
62
  @RelationId((commonCode: CommonCode) => commonCode.creator)
@@ -55,7 +65,7 @@ export class CommonCode {
55
65
  @ManyToOne(type => User, {
56
66
  nullable: true
57
67
  })
58
- @Field({ nullable: true })
68
+ @Field(type => User, { nullable: true })
59
69
  updater?: User
60
70
 
61
71
  @RelationId((commonCode: CommonCode) => commonCode.updater)
@@ -19,7 +19,10 @@ export class CommonCodeDetailQuery {
19
19
  }
20
20
 
21
21
  @Query(returns => CommonCodeDetailList, { description: 'To fetch multiple CommonCodeDetails' })
22
- async commonCodeDetails(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<CommonCodeDetailList> {
22
+ async commonCodeDetails(
23
+ @Args(type => ListParam) params: ListParam,
24
+ @Ctx() context: ResolverContext
25
+ ): Promise<CommonCodeDetailList> {
23
26
  const { domain } = context.state
24
27
 
25
28
  const queryBuilder = getQueryBuilderFromListParams({
@@ -35,7 +38,7 @@ export class CommonCodeDetailQuery {
35
38
  return { items, total }
36
39
  }
37
40
 
38
- @FieldResolver(type => CommonCode)
41
+ @FieldResolver(type => String)
39
42
  async commonCode(commonCodeDetail): Promise<CommonCode> {
40
43
  return await getRepository(CommonCode).findOneBy({ id: commonCodeDetail.commonCodeId })
41
44
  }
@@ -1,5 +1,14 @@
1
1
  import { Field, ID, InputType, ObjectType } from 'type-graphql'
2
- import { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
2
+ import {
3
+ Column,
4
+ CreateDateColumn,
5
+ Entity,
6
+ Index,
7
+ ManyToOne,
8
+ PrimaryGeneratedColumn,
9
+ RelationId,
10
+ UpdateDateColumn
11
+ } from 'typeorm'
3
12
 
4
13
  import { User } from '@things-factory/auth-base'
5
14
  import { Domain, ScalarObject } from '@things-factory/shell'
@@ -7,8 +16,16 @@ import { Domain, ScalarObject } from '@things-factory/shell'
7
16
  import { CommonCode } from '../common-code/common-code'
8
17
 
9
18
  @Entity()
10
- @Index('ix_common_code_detail_0', (commonCodeDetail: CommonCodeDetail) => [commonCodeDetail.commonCode, commonCodeDetail.name], { unique: true })
11
- @Index('ix_common_code_detail_1', (commonCodeDetail: CommonCodeDetail) => [commonCodeDetail.commonCode, commonCodeDetail.rank], { unique: true })
19
+ @Index(
20
+ 'ix_common_code_detail_0',
21
+ (commonCodeDetail: CommonCodeDetail) => [commonCodeDetail.commonCode, commonCodeDetail.name],
22
+ { unique: true }
23
+ )
24
+ @Index(
25
+ 'ix_common_code_detail_1',
26
+ (commonCodeDetail: CommonCodeDetail) => [commonCodeDetail.commonCode, commonCodeDetail.rank],
27
+ { unique: true }
28
+ )
12
29
  @ObjectType({ description: 'Entity for CommonCodeDetail' })
13
30
  export class CommonCodeDetail {
14
31
  @PrimaryGeneratedColumn('uuid')
@@ -16,7 +33,7 @@ export class CommonCodeDetail {
16
33
  readonly id: string
17
34
 
18
35
  @ManyToOne(type => Domain)
19
- @Field({ nullable: true })
36
+ @Field(type => Domain)
20
37
  domain?: Domain
21
38
 
22
39
  @RelationId((commonCodeDetail: CommonCodeDetail) => commonCodeDetail.domain)
@@ -54,14 +71,14 @@ export class CommonCodeDetail {
54
71
  updatedAt?: Date
55
72
 
56
73
  @ManyToOne(type => User, { nullable: true })
57
- @Field({ nullable: true })
74
+ @Field(type => User, { nullable: true })
58
75
  creator?: User
59
76
 
60
77
  @RelationId((commonCodeDetail: CommonCodeDetail) => commonCodeDetail.creator)
61
78
  creatorId?: string
62
79
 
63
80
  @ManyToOne(type => User, { nullable: true })
64
- @Field({ nullable: true })
81
+ @Field(type => User, { nullable: true })
65
82
  updater?: User
66
83
 
67
84
  @RelationId((commonCodeDetail: CommonCodeDetail) => commonCodeDetail.updater)
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.migrations = void 0;
4
- const glob = require('glob');
5
- const path = require('path');
6
- exports.migrations = [];
7
- glob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function (file) {
8
- if (file.indexOf('index.js') !== -1)
9
- return;
10
- exports.migrations = exports.migrations.concat(Object.values(require(path.resolve(file))) || []);
11
- });
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA","sourcesContent":["const glob = require('glob')\nconst path = require('path')\n\nexport var migrations = []\n\nglob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function(file) {\n if (file.indexOf('index.js') !== -1) return\n migrations = migrations.concat(Object.values(require(path.resolve(file))) || [])\n})\n"]}