@things-factory/personalization 8.0.0-beta.1 → 8.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/personalization",
3
- "version": "8.0.0-beta.1",
3
+ "version": "8.0.0-beta.2",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -32,8 +32,8 @@
32
32
  "@operato/i18n": "^8.0.0-beta",
33
33
  "@operato/shell": "^8.0.0-beta",
34
34
  "@operato/styles": "^8.0.0-beta",
35
- "@things-factory/auth-base": "^8.0.0-beta.1",
36
- "@things-factory/shell": "^8.0.0-beta.1"
35
+ "@things-factory/auth-base": "^8.0.0-beta.2",
36
+ "@things-factory/shell": "^8.0.0-beta.2"
37
37
  },
38
- "gitHead": "36c494e587640c1490318ef7b95adab02606e0c2"
38
+ "gitHead": "f03431a09435511b2595515658f9cb8f78ba4ebb"
39
39
  }
package/client/index.ts DELETED
File without changes
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "../../tsconfig-base.json",
3
- "compilerOptions": {
4
- "strict": true,
5
- "declaration": true,
6
- "module": "esnext",
7
- "outDir": "../dist-client",
8
- "baseUrl": "./"
9
- },
10
- "include": ["./**/*"]
11
- }
package/client/types.ts DELETED
@@ -1,9 +0,0 @@
1
- export interface PagePreferenceProvider {
2
- page?: string
3
- element?: string
4
- preference?: any
5
-
6
- load: () => any | Promise<any>
7
- save: (preference: any) => any | Promise<any>
8
- reset: () => void | Promise<void>
9
- }
package/server/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './service'
2
-
3
- import './routes'
package/server/routes.ts DELETED
@@ -1,28 +0,0 @@
1
- const debug = require('debug')('things-factory:personalization:routes')
2
-
3
- process.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {
4
- /*
5
- * can add global public routes to application (auth not required, tenancy not required)
6
- *
7
- * ex) routes.get('/path', async(context, next) => {})
8
- * ex) routes.post('/path', async(context, next) => {})
9
- */
10
- })
11
-
12
- process.on('bootstrap-module-global-private-route' as any, (app, globalPrivateRouter) => {
13
- /*
14
- * can add global private routes to application (auth required, tenancy not required)
15
- */
16
- })
17
-
18
- process.on('bootstrap-module-domain-public-route' as any, (app, domainPublicRouter) => {
19
- /*
20
- * can add domain public routes to application (auth not required, tenancy required)
21
- */
22
- })
23
-
24
- process.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {
25
- /*
26
- * can add domain private routes to application (auth required, tenancy required)
27
- */
28
- })
@@ -1,30 +0,0 @@
1
- /* EXPORT ENTITY TYPES */
2
- export * from './user-preference/user-preference'
3
- export * from './page-preference/page-preference'
4
-
5
- /* IMPORT ENTITIES AND RESOLVERS */
6
- import {
7
- entities as UserPreferenceEntities,
8
- resolvers as UserPreferenceResolvers,
9
- subscribers as UserPreferenceSubscribers
10
- } from './user-preference'
11
- import { entities as PagePreferenceEntities, resolvers as PagePreferenceResolvers } from './page-preference'
12
-
13
- export const entities = [
14
- /* ENTITIES */
15
- ...UserPreferenceEntities,
16
- ...PagePreferenceEntities
17
- ]
18
-
19
- export const subscribers = [
20
- /* SUBSCRIBERS */
21
- ...UserPreferenceSubscribers
22
- ]
23
-
24
- export const schema = {
25
- resolverClasses: [
26
- /* RESOLVER CLASSES */
27
- ...UserPreferenceResolvers,
28
- ...PagePreferenceResolvers
29
- ]
30
- }
@@ -1,6 +0,0 @@
1
- import { PagePreference } from './page-preference'
2
- import { PagePreferenceQuery } from './page-preference-query'
3
- import { PagePreferenceMutation } from './page-preference-mutation'
4
-
5
- export const entities = [PagePreference]
6
- export const resolvers = [PagePreferenceQuery, PagePreferenceMutation]
@@ -1,101 +0,0 @@
1
- import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'
2
- import { In } from 'typeorm'
3
-
4
- import { ScalarObject } from '@things-factory/shell'
5
-
6
- import { PagePreference } from './page-preference'
7
- import { NewPagePreference, PagePreferencePatch } from './page-preference-type'
8
-
9
- @Resolver(PagePreference)
10
- export class PagePreferenceMutation {
11
- @Directive('@transaction')
12
- @Mutation(returns => PagePreference, { description: 'To create my new PagePreference' })
13
- async createMyPagePreference(
14
- @Arg('pagePreference') pagePreference: NewPagePreference,
15
- @Ctx() context: ResolverContext
16
- ): Promise<PagePreference> {
17
- const { domain, user, tx } = context.state
18
-
19
- return await tx.getRepository(PagePreference).save({
20
- ...pagePreference,
21
- domain,
22
- creator: user,
23
- updater: user
24
- })
25
- }
26
-
27
- @Directive('@transaction')
28
- @Mutation(returns => PagePreference, { description: 'To create or update my PagePreference' })
29
- async updateMyPagePreference(
30
- @Arg('page') page: string,
31
- @Arg('element') element: string,
32
- @Arg('preference', type => ScalarObject) preference: { [key: string]: any },
33
- @Ctx() context: any
34
- ): Promise<PagePreference> {
35
- const { domain, user, tx } = context.state
36
-
37
- if (!page || !element) {
38
- throw 'page and element are required.'
39
- }
40
-
41
- const pagePreference = await tx.getRepository(PagePreference).findOne({
42
- where: { domain: { id: domain.id }, user: { id: user.id }, page, element }
43
- })
44
-
45
- return await tx.getRepository(PagePreference).save({
46
- ...pagePreference,
47
- domain,
48
- user,
49
- page,
50
- element,
51
- preference,
52
- creator: user,
53
- updater: user
54
- })
55
- }
56
-
57
- @Directive('@transaction')
58
- @Mutation(returns => Boolean, { description: 'To delete my PagePreference' })
59
- async deleteMyPagePreference(
60
- @Arg('page') page: string,
61
- @Arg('element') element: string,
62
- @Ctx() context: ResolverContext
63
- ): Promise<boolean> {
64
- const { domain, user, tx } = context.state
65
-
66
- await tx.getRepository(PagePreference).delete({
67
- domain: { id: domain.id },
68
- user: { id: user.id },
69
- page,
70
- element
71
- })
72
-
73
- return true
74
- }
75
-
76
- @Directive('@transaction')
77
- @Mutation(returns => Boolean, { description: 'To delete PagePreference' })
78
- async deletePagePreference(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {
79
- const { domain, tx } = context.state
80
-
81
- await tx.getRepository(PagePreference).delete({ domain: { id: domain.id }, id })
82
-
83
- return true
84
- }
85
-
86
- @Directive('@transaction')
87
- @Mutation(returns => Boolean, { description: 'To delete multiple PagePreferences' })
88
- async deletePagePreferences(
89
- @Arg('ids', type => [String]) ids: string[],
90
- @Ctx() context: ResolverContext
91
- ): Promise<boolean> {
92
- const { domain, tx } = context.state
93
-
94
- await tx.getRepository(PagePreference).delete({
95
- domain: { id: domain.id },
96
- id: In(ids)
97
- })
98
-
99
- return true
100
- }
101
- }
@@ -1,73 +0,0 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
2
- import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
3
- import { User } from '@things-factory/auth-base'
4
- import { PagePreference } from './page-preference'
5
- import { PagePreferenceList } from './page-preference-type'
6
-
7
- @Resolver(PagePreference)
8
- export class PagePreferenceQuery {
9
- @Query(returns => PagePreference!, { nullable: true, description: 'To fetch a PagePreference' })
10
- async pagePreference(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<PagePreference> {
11
- const { domain } = context.state
12
-
13
- return await getRepository(PagePreference).findOne({
14
- where: { domain: { id: domain.id }, id }
15
- })
16
- }
17
-
18
- @Query(returns => PagePreference, { nullable: true, description: `To fetch a User's own PagePreference` })
19
- async myPagePreference(
20
- @Arg('page') page: string,
21
- @Arg('element') element: string,
22
- @Ctx() context: any
23
- ): Promise<PagePreference> {
24
- const { domain, user } = context.state
25
-
26
- return await getRepository(PagePreference).findOne({
27
- where: { domain: { id: domain.id }, user: { id: user.id }, page, element }
28
- })
29
- }
30
-
31
- @Query(returns => [PagePreference], { nullable: true, description: `To fetch a User's own PagePreference` })
32
- async myPageAllPreferences(@Arg('page') page: string, @Ctx() context: any): Promise<PagePreference[]> {
33
- const { domain, user } = context.state
34
-
35
- return await getRepository(PagePreference).find({
36
- where: { domain: { id: domain.id }, user: { id: user.id }, page }
37
- })
38
- }
39
-
40
- @Query(returns => PagePreferenceList, { description: 'To fetch multiple PagePreferences' })
41
- async myPagePreferences(
42
- @Args(type => ListParam) params: ListParam,
43
- @Ctx() context: ResolverContext
44
- ): Promise<PagePreferenceList> {
45
- const { domain, user } = context.state
46
-
47
- const queryBuilder = getQueryBuilderFromListParams({
48
- domain,
49
- params,
50
- repository: await getRepository(PagePreference),
51
- searchables: ['page']
52
- }).andWhere({ user: { id: user.id } })
53
-
54
- const [items, total] = await queryBuilder.getManyAndCount()
55
-
56
- return { items, total }
57
- }
58
-
59
- @FieldResolver(type => Domain)
60
- async domain(@Root() pagePreference: PagePreference): Promise<Domain> {
61
- return pagePreference.domainId && (await getRepository(Domain).findOneBy({ id: pagePreference.domainId }))
62
- }
63
-
64
- @FieldResolver(type => User)
65
- async updater(@Root() pagePreference: PagePreference): Promise<User> {
66
- return pagePreference.updaterId && (await getRepository(User).findOneBy({ id: pagePreference.updaterId }))
67
- }
68
-
69
- @FieldResolver(type => User)
70
- async creator(@Root() pagePreference: PagePreference): Promise<User> {
71
- return pagePreference.creatorId && (await getRepository(User).findOneBy({ id: pagePreference.creatorId }))
72
- }
73
- }
@@ -1,50 +0,0 @@
1
- import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
2
-
3
- import { ObjectRef, ScalarObject } from '@things-factory/shell'
4
-
5
- import { PagePreference } from './page-preference'
6
-
7
- @InputType()
8
- export class NewPagePreference {
9
- @Field(type => ObjectRef)
10
- user: ObjectRef
11
-
12
- @Field({ nullable: true })
13
- page?: string
14
-
15
- @Field({ nullable: true })
16
- element?: string
17
-
18
- @Field(type => ScalarObject, { nullable: false })
19
- preference: { [key: string]: any }
20
- }
21
-
22
- @InputType()
23
- export class PagePreferencePatch {
24
- @Field(type => ID, { nullable: true })
25
- id?: string
26
-
27
- @Field(type => ObjectRef)
28
- user: ObjectRef
29
-
30
- @Field({ nullable: true })
31
- page?: string
32
-
33
- @Field({ nullable: true })
34
- element?: string
35
-
36
- @Field(type => ScalarObject, { nullable: false })
37
- preference: { [key: string]: any }
38
-
39
- @Field()
40
- cuFlag: string
41
- }
42
-
43
- @ObjectType()
44
- export class PagePreferenceList {
45
- @Field(type => [PagePreference])
46
- items: PagePreference[]
47
-
48
- @Field(type => Int)
49
- total: number
50
- }
@@ -1,82 +0,0 @@
1
- import {
2
- CreateDateColumn,
3
- UpdateDateColumn,
4
- Entity,
5
- Index,
6
- Column,
7
- RelationId,
8
- ManyToOne,
9
- PrimaryGeneratedColumn
10
- } from 'typeorm'
11
- import { ObjectType, Field, ID } from 'type-graphql'
12
-
13
- import { Domain, ScalarObject } from '@things-factory/shell'
14
- import { User } from '@things-factory/auth-base'
15
-
16
- @Entity()
17
- @Index(
18
- 'ix_page_preference_0',
19
- (pagePreference: PagePreference) => [
20
- pagePreference.domain,
21
- pagePreference.user,
22
- pagePreference.page,
23
- pagePreference.element
24
- ],
25
- {
26
- unique: true
27
- }
28
- )
29
- @ObjectType({ description: 'Entity for PagePreference' })
30
- export class PagePreference {
31
- @PrimaryGeneratedColumn('uuid')
32
- @Field(type => ID)
33
- readonly id: string
34
-
35
- @ManyToOne(type => Domain)
36
- @Field(type => Domain)
37
- domain?: Domain
38
-
39
- @RelationId((pagePreference: PagePreference) => pagePreference.domain)
40
- domainId?: string
41
-
42
- @ManyToOne(type => User)
43
- @Field({ nullable: false })
44
- user: User
45
-
46
- @RelationId((pagePreference: PagePreference) => pagePreference.user)
47
- userId: string
48
-
49
- @Column({ nullable: true })
50
- @Field({ nullable: true })
51
- page: string
52
-
53
- @Column({ nullable: true })
54
- @Field({ nullable: true })
55
- element: string
56
-
57
- @Column('simple-json', { nullable: true })
58
- @Field(type => ScalarObject, { nullable: true })
59
- preference?: { [key: string]: any }
60
-
61
- @CreateDateColumn()
62
- @Field({ nullable: true })
63
- createdAt?: Date
64
-
65
- @UpdateDateColumn()
66
- @Field({ nullable: true })
67
- updatedAt?: Date
68
-
69
- @ManyToOne(type => User, { nullable: true })
70
- @Field(type => User, { nullable: true })
71
- creator?: User
72
-
73
- @RelationId((pagePreference: PagePreference) => pagePreference.creator)
74
- creatorId?: string
75
-
76
- @ManyToOne(type => User, { nullable: true })
77
- @Field(type => User, { nullable: true })
78
- updater?: User
79
-
80
- @RelationId((pagePreference: PagePreference) => pagePreference.updater)
81
- updaterId?: string
82
- }
@@ -1,7 +0,0 @@
1
- import { UserPreference } from './user-preference'
2
- import { UserPreferenceQuery } from './user-preference-query'
3
- import { UserPreferenceMutation } from './user-preference-mutation'
4
-
5
- export const entities = [UserPreference]
6
- export const resolvers = [UserPreferenceQuery, UserPreferenceMutation]
7
- export const subscribers = []
@@ -1,119 +0,0 @@
1
- import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'
2
- import { In } from 'typeorm'
3
-
4
- import { ScalarObject } from '@things-factory/shell'
5
-
6
- import { UserPreference } from './user-preference'
7
- import { NewUserPreference, UserPreferencePatch } from './user-preference-type'
8
-
9
- @Resolver(UserPreference)
10
- export class UserPreferenceMutation {
11
- @Directive('@transaction')
12
- @Mutation(returns => UserPreference, { description: 'To create new UserPreference' })
13
- async createUserPreference(
14
- @Arg('preference') preference: NewUserPreference,
15
- @Ctx() context: ResolverContext
16
- ): Promise<UserPreference> {
17
- const { domain, user, tx } = context.state
18
-
19
- return await tx.getRepository(UserPreference).save({
20
- ...preference,
21
- domain,
22
- creator: user,
23
- updater: user
24
- })
25
- }
26
-
27
- @Directive('@transaction')
28
- @Mutation(returns => UserPreference, { description: 'To modify UserPreference information' })
29
- async updateUserPreference(
30
- @Arg('id') id: string,
31
- @Arg('patch') patch: UserPreferencePatch,
32
- @Ctx() context: ResolverContext
33
- ): Promise<UserPreference> {
34
- const { domain, user, tx } = context.state
35
-
36
- const repository = tx.getRepository(UserPreference)
37
- const preference = await repository.findOne({
38
- where: { domain: { id: domain.id }, id }
39
- })
40
-
41
- return await repository.save({
42
- ...preference,
43
- ...patch,
44
- updater: user
45
- })
46
- }
47
-
48
- @Directive('@transaction')
49
- @Mutation(returns => UserPreference, { description: 'To create or update my preference' })
50
- async updateMyUserPreference(
51
- @Arg('key') key: string,
52
- @Arg('preference', type => ScalarObject) preference: { [key: string]: any },
53
- @Ctx() context: any
54
- ): Promise<UserPreference> {
55
- const { domain, user, tx } = context.state
56
-
57
- if (!key) {
58
- throw 'key is required.'
59
- }
60
-
61
- const myUserPreference = await tx.getRepository(UserPreference).findOne({
62
- where: { domain: { id: domain.id }, user: { id: user.id }, key }
63
- })
64
-
65
- return await tx.getRepository(UserPreference).save({
66
- ...myUserPreference,
67
- domain,
68
- user,
69
- key,
70
- preference,
71
- creator: user,
72
- updater: user
73
- })
74
- }
75
-
76
- @Directive('@transaction')
77
- @Mutation(returns => Boolean, { description: 'To delete my preference' })
78
- async deleteMyUserPreference(
79
- @Arg('key') key: string,
80
- @Arg('element') element: string,
81
- @Ctx() context: ResolverContext
82
- ): Promise<boolean> {
83
- const { domain, user, tx } = context.state
84
-
85
- await tx.getRepository(UserPreference).delete({
86
- domain: { id: domain.id },
87
- user: { id: user.id },
88
- key
89
- })
90
-
91
- return true
92
- }
93
-
94
- @Directive('@transaction')
95
- @Mutation(returns => Boolean, { description: 'To delete UserPreference' })
96
- async deleteUserPreference(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {
97
- const { domain, tx } = context.state
98
-
99
- await tx.getRepository(UserPreference).delete({ domain: { id: domain.id }, id })
100
-
101
- return true
102
- }
103
-
104
- @Directive('@transaction')
105
- @Mutation(returns => Boolean, { description: 'To delete multiple UserPreferences' })
106
- async deleteUserPreferences(
107
- @Arg('ids', type => [String]) ids: string[],
108
- @Ctx() context: ResolverContext
109
- ): Promise<boolean> {
110
- const { domain, tx } = context.state
111
-
112
- await tx.getRepository(UserPreference).delete({
113
- domain: { id: domain.id },
114
- id: In(ids)
115
- })
116
-
117
- return true
118
- }
119
- }
@@ -1,64 +0,0 @@
1
- import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'
2
- import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
3
- import { User } from '@things-factory/auth-base'
4
- import { UserPreference } from './user-preference'
5
- import { UserPreferenceList } from './user-preference-type'
6
-
7
- @Resolver(UserPreference)
8
- export class UserPreferenceQuery {
9
- @Query(returns => UserPreference!, { nullable: true, description: 'To fetch a UserPreference' })
10
- async preference(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<UserPreference> {
11
- const { domain } = context.state
12
-
13
- return await getRepository(UserPreference).findOne({
14
- where: { domain: { id: domain.id }, id }
15
- })
16
- }
17
-
18
- @Query(returns => UserPreference, { nullable: true, description: `To fetch a User's own UserPreference` })
19
- async myUserPreference(
20
- @Arg('key') key: string,
21
- @Arg('element') element: string,
22
- @Ctx() context: any
23
- ): Promise<UserPreference> {
24
- const { domain, user } = context.state
25
-
26
- return await getRepository(UserPreference).findOne({
27
- where: { domain: { id: domain.id }, user: { id: user.id }, key }
28
- })
29
- }
30
-
31
- @Query(returns => UserPreferenceList, { description: 'To fetch multiple UserPreferences' })
32
- async myUserPreferences(
33
- @Args(type => ListParam) params: ListParam,
34
- @Ctx() context: ResolverContext
35
- ): Promise<UserPreferenceList> {
36
- const { domain, user } = context.state
37
-
38
- const queryBuilder = getQueryBuilderFromListParams({
39
- domain,
40
- params,
41
- repository: await getRepository(UserPreference),
42
- searchables: ['key']
43
- }).andWhere({ user: { id: user.id } })
44
-
45
- const [items, total] = await queryBuilder.getManyAndCount()
46
-
47
- return { items, total }
48
- }
49
-
50
- @FieldResolver(type => Domain)
51
- async domain(@Root() preference: UserPreference): Promise<Domain> {
52
- return preference.domainId && (await getRepository(Domain).findOneBy({ id: preference.domainId }))
53
- }
54
-
55
- @FieldResolver(type => User)
56
- async updater(@Root() preference: UserPreference): Promise<User> {
57
- return preference.updaterId && (await getRepository(User).findOneBy({ id: preference.updaterId }))
58
- }
59
-
60
- @FieldResolver(type => User)
61
- async creator(@Root() preference: UserPreference): Promise<User> {
62
- return preference.creatorId && (await getRepository(User).findOneBy({ id: preference.creatorId }))
63
- }
64
- }
@@ -1,43 +0,0 @@
1
- import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'
2
- import { ObjectRef, ScalarObject } from '@things-factory/shell'
3
-
4
- import { UserPreference } from './user-preference'
5
-
6
- @InputType()
7
- export class NewUserPreference {
8
- @Field(type => ObjectRef)
9
- user: ObjectRef
10
-
11
- @Field()
12
- key: string
13
-
14
- @Field(type => ScalarObject, { nullable: false })
15
- preference: { [key: string]: any }
16
- }
17
-
18
- @InputType()
19
- export class UserPreferencePatch {
20
- @Field(type => ID, { nullable: true })
21
- id?: string
22
-
23
- @Field(type => ObjectRef)
24
- user?: ObjectRef
25
-
26
- @Field()
27
- key?: string
28
-
29
- @Field(type => ScalarObject, { nullable: false })
30
- preference?: { [key: string]: any }
31
-
32
- @Field({ nullable: true })
33
- cuFlag?: string
34
- }
35
-
36
- @ObjectType()
37
- export class UserPreferenceList {
38
- @Field(type => [UserPreference])
39
- items: UserPreference[]
40
-
41
- @Field(type => Int)
42
- total: number
43
- }
@@ -1,70 +0,0 @@
1
- import {
2
- CreateDateColumn,
3
- UpdateDateColumn,
4
- DeleteDateColumn,
5
- Entity,
6
- Index,
7
- Column,
8
- RelationId,
9
- ManyToOne,
10
- PrimaryGeneratedColumn
11
- } from 'typeorm'
12
- import { ObjectType, Field, ID } from 'type-graphql'
13
-
14
- import { Domain, ScalarObject } from '@things-factory/shell'
15
- import { User } from '@things-factory/auth-base'
16
-
17
- @Entity()
18
- @Index('ix_preference_0', (preference: UserPreference) => [preference.domain, preference.user], {
19
- unique: true
20
- })
21
- @ObjectType({ description: 'Entity for UserPreference' })
22
- export class UserPreference {
23
- @PrimaryGeneratedColumn('uuid')
24
- @Field(type => ID)
25
- readonly id: string
26
-
27
- @ManyToOne(type => Domain)
28
- @Field({ nullable: true })
29
- domain?: Domain
30
-
31
- @RelationId((preference: UserPreference) => preference.domain)
32
- domainId?: string
33
-
34
- @ManyToOne(type => User)
35
- @Field({ nullable: false })
36
- user: User
37
-
38
- @RelationId((preference: UserPreference) => preference.user)
39
- userId: string
40
-
41
- @Column()
42
- @Field({ nullable: true })
43
- key?: string
44
-
45
- @Column('simple-json', { nullable: true })
46
- @Field(type => ScalarObject, { nullable: true })
47
- preference?: { [key: string]: any }
48
-
49
- @CreateDateColumn()
50
- @Field({ nullable: true })
51
- createdAt?: Date
52
-
53
- @UpdateDateColumn()
54
- @Field({ nullable: true })
55
- updatedAt?: Date
56
-
57
- @ManyToOne(type => User, { nullable: true })
58
- @Field(type => User, { nullable: true })
59
- creator?: User
60
-
61
- @RelationId((preference: UserPreference) => preference.creator)
62
- creatorId?: string
63
-
64
- @ManyToOne(type => User, { nullable: true })
65
- @Field(type => User, { nullable: true })
66
- updater?: User
67
-
68
- @RelationId((preference: UserPreference) => preference.updater)
69
- updaterId?: string
70
- }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../tsconfig-base.json",
3
- "compilerOptions": {
4
- "strict": false,
5
- "module": "commonjs",
6
- "outDir": "../dist-server",
7
- "baseUrl": "./"
8
- },
9
- "include": ["./**/*"]
10
- }