@things-factory/auth-base 8.0.0-alpha.22 → 8.0.0-alpha.27

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/auth-base",
3
- "version": "8.0.0-alpha.22",
3
+ "version": "8.0.0-alpha.27",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -32,9 +32,9 @@
32
32
  "dependencies": {
33
33
  "@simplewebauthn/browser": "^10.0.0",
34
34
  "@simplewebauthn/server": "^10.0.0",
35
- "@things-factory/email-base": "^8.0.0-alpha.22",
35
+ "@things-factory/email-base": "^8.0.0-alpha.27",
36
36
  "@things-factory/env": "^8.0.0-alpha.8",
37
- "@things-factory/shell": "^8.0.0-alpha.22",
37
+ "@things-factory/shell": "^8.0.0-alpha.27",
38
38
  "@things-factory/utils": "^8.0.0-alpha.14",
39
39
  "@types/webappsec-credential-management": "^0.6.8",
40
40
  "jsonwebtoken": "^9.0.0",
@@ -46,5 +46,5 @@
46
46
  "passport-jwt": "^4.0.0",
47
47
  "passport-local": "^1.0.0"
48
48
  },
49
- "gitHead": "27cd29ef5f60c8fc8a177dd52eb0f4979b463991"
49
+ "gitHead": "6c55d218253341cc51e8fa7b2f9dc8a7c061aa55"
50
50
  }
@@ -73,7 +73,10 @@ export class Appliance {
73
73
  ? 'longtext'
74
74
  : DATABASE_TYPE == 'oracle'
75
75
  ? 'clob'
76
- : 'varchar'
76
+ : DATABASE_TYPE == 'mssql'
77
+ ? 'nvarchar'
78
+ : 'varchar',
79
+ length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined
77
80
  })
78
81
  @Field({ nullable: true })
79
82
  @Directive('@privilege(category: "security", privilege: "query", domainOwnerGranted: true)')
@@ -99,7 +99,10 @@ export class Application {
99
99
  ? 'longtext'
100
100
  : DATABASE_TYPE == 'oracle'
101
101
  ? 'clob'
102
- : 'varchar'
102
+ : DATABASE_TYPE == 'mssql'
103
+ ? 'nvarchar'
104
+ : 'varchar',
105
+ length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined
103
106
  })
104
107
  @Field({ nullable: true })
105
108
  @Directive('@privilege(category: "security", privilege: "query", domainOwnerGranted: true)')
@@ -115,8 +118,14 @@ export class Application {
115
118
  ? 'enum'
116
119
  : DATABASE_TYPE == 'oracle'
117
120
  ? 'varchar2'
118
- : 'smallint',
119
- enum: ApplicationType,
121
+ : DATABASE_TYPE == 'mssql'
122
+ ? 'nvarchar'
123
+ : 'varchar',
124
+ enum:
125
+ DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
126
+ ? ApplicationType
127
+ : undefined,
128
+ length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 32,
120
129
  default: ApplicationType.OTHERS
121
130
  })
122
131
  @Field()
@@ -2,7 +2,19 @@ import crypto from 'crypto'
2
2
  import jwt from 'jsonwebtoken'
3
3
  import { Directive, Field, ID, ObjectType } from 'type-graphql'
4
4
  import { GraphQLEmailAddress } from 'graphql-scalars'
5
- import { Column, CreateDateColumn, Entity, Index, JoinTable, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
5
+ import {
6
+ Column,
7
+ CreateDateColumn,
8
+ Entity,
9
+ Index,
10
+ JoinTable,
11
+ ManyToMany,
12
+ ManyToOne,
13
+ OneToMany,
14
+ PrimaryGeneratedColumn,
15
+ RelationId,
16
+ UpdateDateColumn
17
+ } from 'typeorm'
6
18
 
7
19
  import { config } from '@things-factory/env'
8
20
  import { Domain, getRepository } from '@things-factory/shell'
@@ -58,7 +70,15 @@ export class User {
58
70
  @Directive('@privilege(category: "security", privilege: "query", domainOwnerGranted: true)')
59
71
  @Column({
60
72
  nullable: true,
61
- type: DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? 'longtext' : DATABASE_TYPE == 'oracle' ? 'clob' : 'varchar'
73
+ type:
74
+ DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
75
+ ? 'longtext'
76
+ : DATABASE_TYPE == 'oracle'
77
+ ? 'clob'
78
+ : DATABASE_TYPE == 'mssql'
79
+ ? 'nvarchar'
80
+ : 'varchar',
81
+ length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined
62
82
  })
63
83
  password: string
64
84
 
@@ -89,8 +109,17 @@ export class User {
89
109
  ssoId: string
90
110
 
91
111
  @Column({
92
- type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? 'enum' : DATABASE_TYPE == 'oracle' ? 'varchar2' : 'smallint',
93
- enum: UserStatus,
112
+ type:
113
+ DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
114
+ ? 'enum'
115
+ : DATABASE_TYPE == 'oracle'
116
+ ? 'varchar2'
117
+ : DATABASE_TYPE == 'mssql'
118
+ ? 'nvarchar'
119
+ : 'varchar',
120
+ enum:
121
+ DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? UserStatus : undefined,
122
+ length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 32,
94
123
  default: UserStatus.INACTIVE
95
124
  })
96
125
  @Field(type => String)
@@ -30,9 +30,15 @@ export class VerificationToken {
30
30
  DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
31
31
  ? 'enum'
32
32
  : DATABASE_TYPE == 'oracle'
33
- ? 'varchar2'
34
- : 'smallint',
35
- enum: VerificationTokenType,
33
+ ? 'varchar2'
34
+ : DATABASE_TYPE == 'mssql'
35
+ ? 'nvarchar'
36
+ : 'varchar',
37
+ enum:
38
+ DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
39
+ ? VerificationTokenType
40
+ : undefined,
41
+ length: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? undefined : 32,
36
42
  default: VerificationTokenType.ACTIVATION
37
43
  })
38
44
  @Field()