@things-factory/auth-base 7.0.1-beta.8 → 7.0.1-rc.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 (256) hide show
  1. package/dist-client/auth.js.map +1 -1
  2. package/dist-client/directive/privileged.d.ts +5 -5
  3. package/dist-client/directive/privileged.js.map +1 -1
  4. package/dist-client/profiled.js.map +1 -1
  5. package/dist-client/reducers/auth.js.map +1 -1
  6. package/dist-client/tsconfig.tsbuildinfo +1 -1
  7. package/dist-server/constants/error-code.d.ts +1 -0
  8. package/dist-server/constants/error-code.js +2 -1
  9. package/dist-server/constants/error-code.js.map +1 -1
  10. package/dist-server/controllers/change-pwd.js +1 -2
  11. package/dist-server/controllers/change-pwd.js.map +1 -1
  12. package/dist-server/controllers/checkin.js +1 -2
  13. package/dist-server/controllers/checkin.js.map +1 -1
  14. package/dist-server/controllers/delete-user.js +2 -3
  15. package/dist-server/controllers/delete-user.js.map +1 -1
  16. package/dist-server/controllers/invitation.js +4 -5
  17. package/dist-server/controllers/invitation.js.map +1 -1
  18. package/dist-server/controllers/profile.js +1 -2
  19. package/dist-server/controllers/profile.js.map +1 -1
  20. package/dist-server/controllers/reset-password.js +2 -3
  21. package/dist-server/controllers/reset-password.js.map +1 -1
  22. package/dist-server/controllers/signin.js +1 -2
  23. package/dist-server/controllers/signin.js.map +1 -1
  24. package/dist-server/controllers/signup.js +1 -2
  25. package/dist-server/controllers/signup.js.map +1 -1
  26. package/dist-server/controllers/unlock-user.js +2 -3
  27. package/dist-server/controllers/unlock-user.js.map +1 -1
  28. package/dist-server/controllers/utils/make-invitation-token.js +1 -2
  29. package/dist-server/controllers/utils/make-invitation-token.js.map +1 -1
  30. package/dist-server/controllers/utils/make-verification-token.js +1 -2
  31. package/dist-server/controllers/utils/make-verification-token.js.map +1 -1
  32. package/dist-server/controllers/utils/password-rule.js +10 -10
  33. package/dist-server/controllers/utils/password-rule.js.map +1 -1
  34. package/dist-server/controllers/utils/save-invitation-token.js +1 -2
  35. package/dist-server/controllers/utils/save-invitation-token.js.map +1 -1
  36. package/dist-server/controllers/utils/save-verification-token.js +1 -2
  37. package/dist-server/controllers/utils/save-verification-token.js.map +1 -1
  38. package/dist-server/controllers/verification.js +3 -4
  39. package/dist-server/controllers/verification.js.map +1 -1
  40. package/dist-server/index.js.map +1 -1
  41. package/dist-server/middlewares/authenticate-401-middleware.js +1 -2
  42. package/dist-server/middlewares/authenticate-401-middleware.js.map +1 -1
  43. package/dist-server/middlewares/domain-authenticate-middleware.js +1 -2
  44. package/dist-server/middlewares/domain-authenticate-middleware.js.map +1 -1
  45. package/dist-server/middlewares/graphql-authenticate-middleware.js +1 -2
  46. package/dist-server/middlewares/graphql-authenticate-middleware.js.map +1 -1
  47. package/dist-server/middlewares/index.js +1 -2
  48. package/dist-server/middlewares/index.js.map +1 -1
  49. package/dist-server/middlewares/jwt-authenticate-middleware.js +1 -2
  50. package/dist-server/middlewares/jwt-authenticate-middleware.js.map +1 -1
  51. package/dist-server/middlewares/signin-middleware.js +1 -2
  52. package/dist-server/middlewares/signin-middleware.js.map +1 -1
  53. package/dist-server/middlewares/webauthn-middleware.js +9 -3
  54. package/dist-server/middlewares/webauthn-middleware.js.map +1 -1
  55. package/dist-server/migrations/1548206416130-SeedUser.js.map +1 -1
  56. package/dist-server/migrations/1566805283882-SeedPrivilege.js.map +1 -1
  57. package/dist-server/router/auth-checkin-router.js.map +1 -1
  58. package/dist-server/router/auth-private-process-router.js.map +1 -1
  59. package/dist-server/router/auth-public-process-router.js.map +1 -1
  60. package/dist-server/router/auth-signin-router.js.map +1 -1
  61. package/dist-server/router/auth-signup-router.js.map +1 -1
  62. package/dist-server/router/oauth2/oauth2-authorize-router.js.map +1 -1
  63. package/dist-server/router/oauth2/oauth2-router.js.map +1 -1
  64. package/dist-server/router/oauth2/oauth2-server.js.map +1 -1
  65. package/dist-server/router/oauth2/passport-oauth2-client-password.js +1 -2
  66. package/dist-server/router/oauth2/passport-oauth2-client-password.js.map +1 -1
  67. package/dist-server/router/oauth2/passport-refresh-token.js +1 -2
  68. package/dist-server/router/oauth2/passport-refresh-token.js.map +1 -1
  69. package/dist-server/router/site-root-router.js.map +1 -1
  70. package/dist-server/routes.js.map +1 -1
  71. package/dist-server/service/app-binding/app-binding-mutation.js +2 -2
  72. package/dist-server/service/app-binding/app-binding-mutation.js.map +1 -1
  73. package/dist-server/service/app-binding/app-binding-query.js +3 -3
  74. package/dist-server/service/app-binding/app-binding-query.js.map +1 -1
  75. package/dist-server/service/app-binding/app-binding-types.js +2 -2
  76. package/dist-server/service/app-binding/app-binding-types.js.map +1 -1
  77. package/dist-server/service/app-binding/app-binding.js +2 -2
  78. package/dist-server/service/app-binding/app-binding.js.map +1 -1
  79. package/dist-server/service/appliance/appliance-mutation.js +2 -2
  80. package/dist-server/service/appliance/appliance-mutation.js.map +1 -1
  81. package/dist-server/service/appliance/appliance-query.js +4 -4
  82. package/dist-server/service/appliance/appliance-query.js.map +1 -1
  83. package/dist-server/service/appliance/appliance-types.js +6 -6
  84. package/dist-server/service/appliance/appliance-types.js.map +1 -1
  85. package/dist-server/service/appliance/appliance.js +2 -2
  86. package/dist-server/service/appliance/appliance.js.map +1 -1
  87. package/dist-server/service/application/application-mutation.js +2 -2
  88. package/dist-server/service/application/application-mutation.js.map +1 -1
  89. package/dist-server/service/application/application-query.js +3 -3
  90. package/dist-server/service/application/application-query.js.map +1 -1
  91. package/dist-server/service/application/application-types.js +8 -8
  92. package/dist-server/service/application/application-types.js.map +1 -1
  93. package/dist-server/service/application/application.js +6 -6
  94. package/dist-server/service/application/application.js.map +1 -1
  95. package/dist-server/service/auth-provider/auth-provider-mutation.js +2 -2
  96. package/dist-server/service/auth-provider/auth-provider-mutation.js.map +1 -1
  97. package/dist-server/service/auth-provider/auth-provider-parameter-spec.js +2 -2
  98. package/dist-server/service/auth-provider/auth-provider-parameter-spec.js.map +1 -1
  99. package/dist-server/service/auth-provider/auth-provider-query.js +3 -3
  100. package/dist-server/service/auth-provider/auth-provider-query.js.map +1 -1
  101. package/dist-server/service/auth-provider/auth-provider-type.js +6 -6
  102. package/dist-server/service/auth-provider/auth-provider-type.js.map +1 -1
  103. package/dist-server/service/auth-provider/auth-provider.js +6 -6
  104. package/dist-server/service/auth-provider/auth-provider.js.map +1 -1
  105. package/dist-server/service/domain-generator/domain-generator-mutation.js +2 -2
  106. package/dist-server/service/domain-generator/domain-generator-mutation.js.map +1 -1
  107. package/dist-server/service/domain-generator/domain-generator-types.js +6 -6
  108. package/dist-server/service/domain-generator/domain-generator-types.js.map +1 -1
  109. package/dist-server/service/granted-role/granted-role-mutation.js +6 -6
  110. package/dist-server/service/granted-role/granted-role-mutation.js.map +1 -1
  111. package/dist-server/service/granted-role/granted-role-query.js +2 -2
  112. package/dist-server/service/granted-role/granted-role-query.js.map +1 -1
  113. package/dist-server/service/granted-role/granted-role.js +2 -2
  114. package/dist-server/service/granted-role/granted-role.js.map +1 -1
  115. package/dist-server/service/invitation/invitation-mutation.js +2 -2
  116. package/dist-server/service/invitation/invitation-mutation.js.map +1 -1
  117. package/dist-server/service/invitation/invitation-query.js +2 -2
  118. package/dist-server/service/invitation/invitation-query.js.map +1 -1
  119. package/dist-server/service/invitation/invitation-types.js +2 -2
  120. package/dist-server/service/invitation/invitation-types.js.map +1 -1
  121. package/dist-server/service/invitation/invitation.js +2 -2
  122. package/dist-server/service/invitation/invitation.js.map +1 -1
  123. package/dist-server/service/login-history/login-history-query.js +3 -3
  124. package/dist-server/service/login-history/login-history-query.js.map +1 -1
  125. package/dist-server/service/login-history/login-history-type.js +2 -2
  126. package/dist-server/service/login-history/login-history-type.js.map +1 -1
  127. package/dist-server/service/login-history/login-history.js +2 -2
  128. package/dist-server/service/login-history/login-history.js.map +1 -1
  129. package/dist-server/service/partner/partner-mutation.js +2 -2
  130. package/dist-server/service/partner/partner-mutation.js.map +1 -1
  131. package/dist-server/service/partner/partner-query.js +4 -4
  132. package/dist-server/service/partner/partner-query.js.map +1 -1
  133. package/dist-server/service/partner/partner-types.js +2 -2
  134. package/dist-server/service/partner/partner-types.js.map +1 -1
  135. package/dist-server/service/partner/partner.js +2 -2
  136. package/dist-server/service/partner/partner.js.map +1 -1
  137. package/dist-server/service/password-history/password-history.js +2 -2
  138. package/dist-server/service/password-history/password-history.js.map +1 -1
  139. package/dist-server/service/privilege/privilege-directive.js.map +1 -1
  140. package/dist-server/service/privilege/privilege-mutation.js +2 -2
  141. package/dist-server/service/privilege/privilege-mutation.js.map +1 -1
  142. package/dist-server/service/privilege/privilege-query.js +3 -3
  143. package/dist-server/service/privilege/privilege-query.js.map +1 -1
  144. package/dist-server/service/privilege/privilege-types.js +8 -8
  145. package/dist-server/service/privilege/privilege-types.js.map +1 -1
  146. package/dist-server/service/privilege/privilege.js +6 -6
  147. package/dist-server/service/privilege/privilege.js.map +1 -1
  148. package/dist-server/service/role/role-mutation.js +2 -2
  149. package/dist-server/service/role/role-mutation.js.map +1 -1
  150. package/dist-server/service/role/role-query.js +3 -3
  151. package/dist-server/service/role/role-query.js.map +1 -1
  152. package/dist-server/service/role/role-types.js +10 -10
  153. package/dist-server/service/role/role-types.js.map +1 -1
  154. package/dist-server/service/role/role.js +2 -2
  155. package/dist-server/service/role/role.js.map +1 -1
  156. package/dist-server/service/user/domain-query.js +2 -2
  157. package/dist-server/service/user/domain-query.js.map +1 -1
  158. package/dist-server/service/user/user-mutation.js +2 -2
  159. package/dist-server/service/user/user-mutation.js.map +1 -1
  160. package/dist-server/service/user/user-query.js +3 -3
  161. package/dist-server/service/user/user-query.js.map +1 -1
  162. package/dist-server/service/user/user-types.js +6 -6
  163. package/dist-server/service/user/user-types.js.map +1 -1
  164. package/dist-server/service/user/user.js +5 -5
  165. package/dist-server/service/user/user.js.map +1 -1
  166. package/dist-server/service/users-auth-providers/users-auth-providers.js +2 -2
  167. package/dist-server/service/users-auth-providers/users-auth-providers.js.map +1 -1
  168. package/dist-server/service/verification-token/verification-token.js +3 -3
  169. package/dist-server/service/verification-token/verification-token.js.map +1 -1
  170. package/dist-server/service/web-auth-credential/web-auth-credential.js +2 -2
  171. package/dist-server/service/web-auth-credential/web-auth-credential.js.map +1 -1
  172. package/dist-server/templates/account-unlock-email.js +1 -2
  173. package/dist-server/templates/account-unlock-email.js.map +1 -1
  174. package/dist-server/templates/invitation-email.js +1 -2
  175. package/dist-server/templates/invitation-email.js.map +1 -1
  176. package/dist-server/templates/reset-password-email.js +1 -2
  177. package/dist-server/templates/reset-password-email.js.map +1 -1
  178. package/dist-server/templates/verification-email.js +1 -2
  179. package/dist-server/templates/verification-email.js.map +1 -1
  180. package/dist-server/tsconfig.tsbuildinfo +1 -1
  181. package/dist-server/utils/accepts.js +1 -2
  182. package/dist-server/utils/accepts.js.map +1 -1
  183. package/dist-server/utils/access-token-cookie.js +4 -5
  184. package/dist-server/utils/access-token-cookie.js.map +1 -1
  185. package/dist-server/utils/check-permission.js +1 -2
  186. package/dist-server/utils/check-permission.js.map +1 -1
  187. package/dist-server/utils/check-user-belongs-domain.js +1 -2
  188. package/dist-server/utils/check-user-belongs-domain.js.map +1 -1
  189. package/dist-server/utils/encrypt-state.js +2 -3
  190. package/dist-server/utils/encrypt-state.js.map +1 -1
  191. package/dist-server/utils/get-aes-256-key.js.map +1 -1
  192. package/dist-server/utils/get-domain-from-hostname.js +1 -2
  193. package/dist-server/utils/get-domain-from-hostname.js.map +1 -1
  194. package/dist-server/utils/get-domain-users.js +2 -3
  195. package/dist-server/utils/get-domain-users.js.map +1 -1
  196. package/dist-server/utils/get-secret.js.map +1 -1
  197. package/dist-server/utils/get-user-domains.js +4 -5
  198. package/dist-server/utils/get-user-domains.js.map +1 -1
  199. package/helps/config/SECRET.ja.md +13 -0
  200. package/helps/config/SECRET.ko.md +13 -0
  201. package/helps/config/SECRET.md +3 -3
  202. package/helps/config/SECRET.ms.md +13 -0
  203. package/helps/config/SECRET.zh.md +13 -0
  204. package/helps/config/accessTokenCookieKey.ja.md +11 -0
  205. package/helps/config/accessTokenCookieKey.ko.md +11 -0
  206. package/helps/config/accessTokenCookieKey.md +1 -1
  207. package/helps/config/accessTokenCookieKey.ms.md +11 -0
  208. package/helps/config/accessTokenCookieKey.zh.md +11 -0
  209. package/helps/config/applianceJwtExpiresIn.ja.md +26 -0
  210. package/helps/config/applianceJwtExpiresIn.ko.md +26 -0
  211. package/helps/config/applianceJwtExpiresIn.md +18 -15
  212. package/helps/config/applianceJwtExpiresIn.ms.md +30 -0
  213. package/helps/config/applianceJwtExpiresIn.zh.md +26 -0
  214. package/helps/config/disableUserSignupProcess.ja.md +22 -0
  215. package/helps/config/disableUserSignupProcess.ko.md +22 -0
  216. package/helps/config/disableUserSignupProcess.md +3 -3
  217. package/helps/config/disableUserSignupProcess.ms.md +22 -0
  218. package/helps/config/disableUserSignupProcess.zh.md +22 -0
  219. package/helps/config/i18n.ja.md +44 -0
  220. package/helps/config/i18n.ko.md +44 -0
  221. package/helps/config/i18n.md +6 -6
  222. package/helps/config/i18n.ms.md +44 -0
  223. package/helps/config/i18n.zh.md +44 -0
  224. package/helps/config/password.ja.md +53 -0
  225. package/helps/config/password.ko.md +65 -0
  226. package/helps/config/password.md +8 -36
  227. package/helps/config/password.ms.md +65 -0
  228. package/helps/config/password.zh.md +65 -0
  229. package/helps/config/publicHomeRoute.ja.md +14 -0
  230. package/helps/config/publicHomeRoute.ko.md +14 -0
  231. package/helps/config/publicHomeRoute.md +3 -3
  232. package/helps/config/publicHomeRoute.ms.md +14 -0
  233. package/helps/config/publicHomeRoute.zh.md +14 -0
  234. package/helps/config/session.ja.md +45 -0
  235. package/helps/config/session.ko.md +49 -0
  236. package/helps/config/session.md +10 -10
  237. package/helps/config/session.ms.md +46 -0
  238. package/helps/config/session.zh.md +49 -0
  239. package/package.json +6 -6
  240. package/server/constants/error-code.ts +1 -0
  241. package/server/middlewares/webauthn-middleware.ts +6 -1
  242. package/server/service/app-binding/app-binding-query.ts +1 -1
  243. package/server/service/appliance/appliance-query.ts +5 -2
  244. package/server/service/application/application-query.ts +1 -1
  245. package/server/service/application/application.ts +2 -2
  246. package/server/service/auth-provider/auth-provider-query.ts +4 -1
  247. package/server/service/login-history/login-history-query.ts +4 -1
  248. package/server/service/partner/partner-query.ts +5 -2
  249. package/server/service/privilege/privilege-query.ts +14 -3
  250. package/server/service/role/role-query.ts +1 -1
  251. package/server/service/user/user-query.ts +1 -1
  252. package/translations/en.json +1 -0
  253. package/translations/ja.json +1 -0
  254. package/translations/ko.json +1 -0
  255. package/translations/ms.json +1 -0
  256. package/translations/zh.json +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"user.js","sourceRoot":"","sources":["../../../server/service/user/user.ts"],"names":[],"mappings":";;;;;AAAA,4DAA2B;AAC3B,wEAA8B;AAC9B,+CAA+D;AAC/D,qDAAqD;AACrD,qCAAoK;AAEpK,6CAA4C;AAC5C,iDAA6D;AAE7D,yEAA8E;AAC9E,wDAAmD;AACnD,uDAA+C;AAC/C,uCAAmC;AACnC,sDAAkD;AAClD,oFAA8E;AAC9E,uFAAiF;AACjF,mEAAsE;AAEtE,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,MAAM,oBAAoB,GAAG,MAAM,CAAC,YAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,IAAI,IAAI,CAAA;AAEhF,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,qCAAuB,CAAA;IACvB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,4DAA8C,CAAA;AAChD,CAAC,EAPW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAOrB;AAKM,IAAM,IAAI,YAAV,MAAM,IAAI;IAqGf,8BAA8B;IAC9B,KAAK,CAAC,IAAI,CAAC,OAAQ;QACjB,IAAI,EAAE,SAAS,GAAG,oBAAoB,EAAE,S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-graphql'\nimport { GraphQLEmailAddress } from 'graphql-scalars'\nimport { Column, CreateDateColumn, Entity, Index, JoinTable, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { config } from '@things-factory/env'\nimport { Domain, getRepository } from '@things-factory/shell'\n\nimport { validatePasswordByRule } from '../../controllers/utils/password-rule'\nimport { AuthError } from '../../errors/auth-error'\nimport { SECRET } from '../../utils/get-secret'\nimport { Role } from '../role/role'\nimport { Privilege } from '../privilege/privilege'\nimport { WebAuthCredential } from '../web-auth-credential/web-auth-credential'\nimport { UsersAuthProviders } from '../users-auth-providers/users-auth-providers'\nimport { getDomainsWithPrivilege } from '../../utils/get-user-domains'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\nconst sessionExpirySeconds = Number(config.get('session/expirySeconds')) || '7d'\n\nexport enum UserStatus {\n INACTIVE = 'inactive',\n ACTIVATED = 'activated',\n DELETED = 'deleted',\n LOCKED = 'locked',\n BANNED = 'banned',\n PWD_RESET_REQUIRED = 'password_reset_required'\n}\n\n@Entity()\n@Index('ix_user_0', (user: User) => [user.email], { unique: true })\n@ObjectType()\nexport class User {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column()\n @Field({ nullable: true })\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description: string\n\n @ManyToMany(type => Domain)\n @JoinTable({ name: 'users_domains' })\n @Field(type => [Domain])\n domains?: Domain[]\n\n @Column()\n @Field(type => GraphQLEmailAddress)\n email: string\n\n @Directive('@privilege(category: \"security\", privilege: \"query\", domainOwnerGranted: true)')\n @Column({\n nullable: true,\n type: DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? 'longtext' : DATABASE_TYPE == 'oracle' ? 'clob' : 'varchar'\n })\n password: string\n\n @ManyToMany(type => Role, role => role.users)\n @JoinTable({ name: 'users_roles' })\n @Field(type => [Role])\n roles?: Role[]\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n userType: string // default: 'user', enum: 'user', 'application', 'appliance'\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n reference: string\n\n @Directive('@privilege(category: \"security\", privilege: \"query\", domainOwnerGranted: true)')\n @Column({ nullable: true })\n salt: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n locale: string\n\n @Directive('@privilege(category: \"security\", privilege: \"query\", domainOwnerGranted: true)')\n @Column({ nullable: true })\n @Field({ nullable: true })\n ssoId: string\n\n @Column({\n type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? 'enum' : DATABASE_TYPE == 'oracle' ? 'varchar2' : 'smallint',\n enum: UserStatus,\n default: UserStatus.INACTIVE\n })\n @Field(type => String)\n status: UserStatus\n\n @Column({ type: 'smallint', default: 0 })\n failCount: number\n\n @Column({ nullable: true })\n passwordUpdatedAt: Date\n\n @Field({ nullable: true })\n owner: boolean /* should not be a column */\n\n @OneToMany(() => WebAuthCredential, credential => credential.user)\n credentials: WebAuthCredential[]\n\n @OneToMany(() => UsersAuthProviders, usersAuthProviders => usersAuthProviders.user)\n @Field(type => [UsersAuthProviders], { nullable: true })\n usersAuthProviders: UsersAuthProviders[]\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator: User\n\n @RelationId((user: User) => user.creator)\n creatorId: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((user: User) => user.updater)\n updaterId: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n /* signing for jsonwebtoken */\n async sign(options?) {\n var { expiresIn = sessionExpirySeconds, subdomain } = options || {}\n\n var user = {\n id: this.id,\n userType: this.userType,\n status: this.status,\n domain: {\n subdomain\n }\n }\n\n return await jwt.sign(user, SECRET, {\n expiresIn,\n issuer: 'hatiolab.com',\n subject: 'user'\n })\n }\n\n /* validate password through password rule */\n static validatePasswordByRule(password, lng) {\n validatePasswordByRule(password, lng)\n }\n\n /* generate salt */\n static generateSalt() {\n return crypto.randomBytes(16).toString('hex')\n }\n\n /* encode password */\n static encode(password: string, salt) {\n return crypto\n .createHmac('sha256', salt || SECRET)\n .update(password)\n .digest('base64')\n }\n\n /* verify password */\n static verify(hashed, password, salt) {\n return (\n hashed ==\n crypto\n .createHmac('sha256', salt || SECRET)\n .update(password)\n .digest('base64') ||\n hashed ==\n crypto\n .createHmac('sha1', salt || SECRET)\n .update(password)\n .digest('base64')\n )\n }\n\n static async checkAuthWithEmail(decoded) {\n if (!decoded?.email) {\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_FOUND\n })\n }\n\n const repository = getRepository(User)\n var user = await repository.findOne({\n where: { email: decoded.email },\n relations: ['domains'],\n cache: true\n })\n\n if (!user)\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_FOUND\n })\n else {\n switch (user.status) {\n case UserStatus.INACTIVE:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_ACTIVATED,\n detail: {\n email: user.email\n }\n })\n case UserStatus.LOCKED:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_LOCKED,\n detail: {\n email: user.email\n }\n })\n case UserStatus.DELETED:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_DELETED\n })\n }\n\n return user\n }\n }\n\n static async checkAuth(decoded) {\n if (decoded?.id === undefined) {\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_FOUND\n })\n }\n\n const repository = getRepository(User)\n var user = await repository.findOne({\n where: { id: decoded.id },\n relations: ['domains', 'credentials'],\n cache: true\n })\n\n if (!user)\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_FOUND\n })\n else {\n switch (user.status) {\n case UserStatus.INACTIVE:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_ACTIVATED,\n detail: {\n email: user.email\n }\n })\n case UserStatus.LOCKED:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_LOCKED,\n detail: {\n email: user.email\n }\n })\n case UserStatus.DELETED:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_DELETED\n })\n }\n\n const { defaultPassword } = config.get('password')\n\n if (defaultPassword && user.password === this.encode(defaultPassword, user.salt)) {\n user.status = UserStatus.PWD_RESET_REQUIRED\n }\n\n return user\n }\n }\n\n static async hasPrivilege(privilege: string, category: string, domain: Domain, user: User): Promise<boolean> {\n const result = await getRepository(Privilege)\n .createQueryBuilder('privilege')\n .innerJoin('privilege.roles', 'role')\n .innerJoin('role.users', 'user')\n .where('privilege.category = :category', { category })\n .andWhere('privilege.name = :privilege', { privilege })\n .andWhere('user.id = :userId', { userId: user.id })\n .andWhere('role.domain.id = :domainId', { domainId: domain.id })\n .getCount()\n\n return result > 0\n }\n\n static async getPrivilegesByDomain(user: User, domain: Domain): Promise<{ category: string; privilege: string }[]> {\n const result = await getRepository(User)\n .createQueryBuilder('user')\n .leftJoinAndSelect('user.roles', 'role')\n .leftJoinAndSelect('role.privileges', 'privilege')\n .select(['privilege.name AS privilege', 'privilege.category AS category'])\n .where('user.id = :userId', { userId: user.id })\n .andWhere('role.domain.id = :domainId', { domainId: domain.id })\n .orderBy('privilege.category')\n .addOrderBy('privilege.name')\n .getRawMany()\n\n const distinct = result.reduce((acc, current) => {\n const last = acc[acc.length - 1]\n if (!last || last.privilege !== current.privilege || last.category !== current.category) {\n acc.push(current)\n }\n return acc\n }, [])\n\n return distinct\n }\n\n static async getDomainsWithPrivilege(privilege: string, category: string, user: User) {\n return getDomainsWithPrivilege(user, privilege, category)\n }\n}\n"]}
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../../server/service/user/user.ts"],"names":[],"mappings":";;;;;AAAA,4DAA2B;AAC3B,wEAA8B;AAC9B,+CAA+D;AAC/D,qDAAqD;AACrD,q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;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,IAAI;qCAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;;uCACxB;AAIjB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;uCAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;IAEf,8BAA8B;;uCAFf;eAnGJ,IAAI;IAHhB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,WAAW,EAAE,CAAC,IAAU,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClE,IAAA,yBAAU,GAAE;GACA,IAAI,CAiShB","sourcesContent":["import crypto from 'crypto'\nimport jwt from 'jsonwebtoken'\nimport { Directive, Field, ID, ObjectType } from 'type-graphql'\nimport { GraphQLEmailAddress } from 'graphql-scalars'\nimport { Column, CreateDateColumn, Entity, Index, JoinTable, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { config } from '@things-factory/env'\nimport { Domain, getRepository } from '@things-factory/shell'\n\nimport { validatePasswordByRule } from '../../controllers/utils/password-rule'\nimport { AuthError } from '../../errors/auth-error'\nimport { SECRET } from '../../utils/get-secret'\nimport { Role } from '../role/role'\nimport { Privilege } from '../privilege/privilege'\nimport { WebAuthCredential } from '../web-auth-credential/web-auth-credential'\nimport { UsersAuthProviders } from '../users-auth-providers/users-auth-providers'\nimport { getDomainsWithPrivilege } from '../../utils/get-user-domains'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\nconst sessionExpirySeconds = Number(config.get('session/expirySeconds')) || '7d'\n\nexport enum UserStatus {\n INACTIVE = 'inactive',\n ACTIVATED = 'activated',\n DELETED = 'deleted',\n LOCKED = 'locked',\n BANNED = 'banned',\n PWD_RESET_REQUIRED = 'password_reset_required'\n}\n\n@Entity()\n@Index('ix_user_0', (user: User) => [user.email], { unique: true })\n@ObjectType()\nexport class User {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column()\n @Field({ nullable: true })\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description: string\n\n @ManyToMany(type => Domain)\n @JoinTable({ name: 'users_domains' })\n @Field(type => [Domain])\n domains?: Domain[]\n\n @Column()\n @Field(type => GraphQLEmailAddress)\n email: string\n\n @Directive('@privilege(category: \"security\", privilege: \"query\", domainOwnerGranted: true)')\n @Column({\n nullable: true,\n type: DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? 'longtext' : DATABASE_TYPE == 'oracle' ? 'clob' : 'varchar'\n })\n password: string\n\n @ManyToMany(type => Role, role => role.users)\n @JoinTable({ name: 'users_roles' })\n @Field(type => [Role])\n roles?: Role[]\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n userType: string // default: 'user', enum: 'user', 'application', 'appliance'\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n reference: string\n\n @Directive('@privilege(category: \"security\", privilege: \"query\", domainOwnerGranted: true)')\n @Column({ nullable: true })\n salt: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n locale: string\n\n @Directive('@privilege(category: \"security\", privilege: \"query\", domainOwnerGranted: true)')\n @Column({ nullable: true })\n @Field({ nullable: true })\n ssoId: string\n\n @Column({\n type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? 'enum' : DATABASE_TYPE == 'oracle' ? 'varchar2' : 'smallint',\n enum: UserStatus,\n default: UserStatus.INACTIVE\n })\n @Field(type => String)\n status: UserStatus\n\n @Column({ type: 'smallint', default: 0 })\n failCount: number\n\n @Column({ nullable: true })\n passwordUpdatedAt: Date\n\n @Field({ nullable: true })\n owner: boolean /* should not be a column */\n\n @OneToMany(() => WebAuthCredential, credential => credential.user)\n credentials: WebAuthCredential[]\n\n @OneToMany(() => UsersAuthProviders, usersAuthProviders => usersAuthProviders.user)\n @Field(type => [UsersAuthProviders], { nullable: true })\n usersAuthProviders: UsersAuthProviders[]\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator: User\n\n @RelationId((user: User) => user.creator)\n creatorId: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((user: User) => user.updater)\n updaterId: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n /* signing for jsonwebtoken */\n async sign(options?) {\n var { expiresIn = sessionExpirySeconds, subdomain } = options || {}\n\n var user = {\n id: this.id,\n userType: this.userType,\n status: this.status,\n domain: {\n subdomain\n }\n }\n\n return await jwt.sign(user, SECRET, {\n expiresIn,\n issuer: 'hatiolab.com',\n subject: 'user'\n })\n }\n\n /* validate password through password rule */\n static validatePasswordByRule(password, lng) {\n validatePasswordByRule(password, lng)\n }\n\n /* generate salt */\n static generateSalt() {\n return crypto.randomBytes(16).toString('hex')\n }\n\n /* encode password */\n static encode(password: string, salt) {\n return crypto\n .createHmac('sha256', salt || SECRET)\n .update(password)\n .digest('base64')\n }\n\n /* verify password */\n static verify(hashed, password, salt) {\n return (\n hashed ==\n crypto\n .createHmac('sha256', salt || SECRET)\n .update(password)\n .digest('base64') ||\n hashed ==\n crypto\n .createHmac('sha1', salt || SECRET)\n .update(password)\n .digest('base64')\n )\n }\n\n static async checkAuthWithEmail(decoded) {\n if (!decoded?.email) {\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_FOUND\n })\n }\n\n const repository = getRepository(User)\n var user = await repository.findOne({\n where: { email: decoded.email },\n relations: ['domains'],\n cache: true\n })\n\n if (!user)\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_FOUND\n })\n else {\n switch (user.status) {\n case UserStatus.INACTIVE:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_ACTIVATED,\n detail: {\n email: user.email\n }\n })\n case UserStatus.LOCKED:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_LOCKED,\n detail: {\n email: user.email\n }\n })\n case UserStatus.DELETED:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_DELETED\n })\n }\n\n return user\n }\n }\n\n static async checkAuth(decoded) {\n if (decoded?.id === undefined) {\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_FOUND\n })\n }\n\n const repository = getRepository(User)\n var user = await repository.findOne({\n where: { id: decoded.id },\n relations: ['domains', 'credentials'],\n cache: true\n })\n\n if (!user)\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_FOUND\n })\n else {\n switch (user.status) {\n case UserStatus.INACTIVE:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_NOT_ACTIVATED,\n detail: {\n email: user.email\n }\n })\n case UserStatus.LOCKED:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_LOCKED,\n detail: {\n email: user.email\n }\n })\n case UserStatus.DELETED:\n throw new AuthError({\n errorCode: AuthError.ERROR_CODES.USER_DELETED\n })\n }\n\n const { defaultPassword } = config.get('password')\n\n if (defaultPassword && user.password === this.encode(defaultPassword, user.salt)) {\n user.status = UserStatus.PWD_RESET_REQUIRED\n }\n\n return user\n }\n }\n\n static async hasPrivilege(privilege: string, category: string, domain: Domain, user: User): Promise<boolean> {\n const result = await getRepository(Privilege)\n .createQueryBuilder('privilege')\n .innerJoin('privilege.roles', 'role')\n .innerJoin('role.users', 'user')\n .where('privilege.category = :category', { category })\n .andWhere('privilege.name = :privilege', { privilege })\n .andWhere('user.id = :userId', { userId: user.id })\n .andWhere('role.domain.id = :domainId', { domainId: domain.id })\n .getCount()\n\n return result > 0\n }\n\n static async getPrivilegesByDomain(user: User, domain: Domain): Promise<{ category: string; privilege: string }[]> {\n const result = await getRepository(User)\n .createQueryBuilder('user')\n .leftJoinAndSelect('user.roles', 'role')\n .leftJoinAndSelect('role.privileges', 'privilege')\n .select(['privilege.name AS privilege', 'privilege.category AS category'])\n .where('user.id = :userId', { userId: user.id })\n .andWhere('role.domain.id = :domainId', { domainId: domain.id })\n .orderBy('privilege.category')\n .addOrderBy('privilege.name')\n .getRawMany()\n\n const distinct = result.reduce((acc, current) => {\n const last = acc[acc.length - 1]\n if (!last || last.privilege !== current.privilege || last.category !== current.category) {\n acc.push(current)\n }\n return acc\n }, [])\n\n return distinct\n }\n\n static async getDomainsWithPrivilege(privilege: string, category: string, user: User) {\n return getDomainsWithPrivilege(user, privilege, category)\n }\n}\n"]}
@@ -9,6 +9,7 @@ const user_1 = require("../user/user");
9
9
  const auth_provider_1 = require("../auth-provider/auth-provider");
10
10
  let UsersAuthProviders = class UsersAuthProviders {
11
11
  };
12
+ exports.UsersAuthProviders = UsersAuthProviders;
12
13
  tslib_1.__decorate([
13
14
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
14
15
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -60,7 +61,7 @@ tslib_1.__decorate([
60
61
  (0, type_graphql_1.Field)({ nullable: true }),
61
62
  tslib_1.__metadata("design:type", Date)
62
63
  ], UsersAuthProviders.prototype, "updatedAt", void 0);
63
- UsersAuthProviders = tslib_1.__decorate([
64
+ exports.UsersAuthProviders = UsersAuthProviders = tslib_1.__decorate([
64
65
  (0, typeorm_1.Entity)(),
65
66
  (0, typeorm_1.Index)('ix_users_auth_providers_0', (usersAuthProviders) => [
66
67
  usersAuthProviders.domain,
@@ -69,5 +70,4 @@ UsersAuthProviders = tslib_1.__decorate([
69
70
  ], { unique: true }),
70
71
  (0, type_graphql_1.ObjectType)({ description: 'Entity for UsersAuthProviders' })
71
72
  ], UsersAuthProviders);
72
- exports.UsersAuthProviders = UsersAuthProviders;
73
73
  //# sourceMappingURL=users-auth-providers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"users-auth-providers.js","sourceRoot":"","sources":["../../../server/service/users-auth-providers/users-auth-providers.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,uCAAmC;AACnC,kEAA6D;AAatD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAyC9B,CAAA;AAxCC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;8CACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;kDAAA;AAEf;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC;;oDACjE;AAEjB;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,WAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE;QACtD,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAClC,WAAI;gDAAA;AAEV;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;;kDACjE;AAEf;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4BAAY,EAAE,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,kBAAkB,EAAE;QAC9E,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,4BAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAClC,4BAAY;wDAAA;AAE1B;IAAC,IAAA,oBAAU,EAAC,CAAC,kBAAsC,EAAE,EAAE,CAAC,kBAAkB,CAAC,YAAY,CAAC;;0DACjE;AAEvB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACb;AAEb;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;qDAAA;AAEhB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;qDAAA;AAxCJ,kBAAkB;IAX9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,2BAA2B,EAC3B,CAAC,kBAAsC,EAAE,EAAE,CAAC;QAC1C,kBAAkB,CAAC,MAAM;QACzB,kBAAkB,CAAC,IAAI;QACvB,kBAAkB,CAAC,YAAY;KAChC,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CAyC9B;AAzCY,gDAAkB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '../user/user'\nimport { AuthProvider } from '../auth-provider/auth-provider'\n\n@Entity()\n@Index(\n 'ix_users_auth_providers_0',\n (usersAuthProviders: UsersAuthProviders) => [\n usersAuthProviders.domain,\n usersAuthProviders.user,\n usersAuthProviders.authProvider\n ],\n { unique: true }\n)\n@ObjectType({ description: 'Entity for UsersAuthProviders' })\nexport class UsersAuthProviders {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((usersAuthProviders: UsersAuthProviders) => usersAuthProviders.domain)\n domainId?: string\n\n @ManyToOne(() => User, user => user.usersAuthProviders, {\n onDelete: 'CASCADE'\n })\n @Field(type => User, { nullable: true })\n user: User\n\n @RelationId((usersAuthProviders: UsersAuthProviders) => usersAuthProviders.user)\n userId?: string\n\n @ManyToOne(() => AuthProvider, authProvider => authProvider.usersAuthProviders, {\n onDelete: 'CASCADE'\n })\n @Field(type => AuthProvider, { nullable: true })\n authProvider: AuthProvider\n\n @RelationId((usersAuthProviders: UsersAuthProviders) => usersAuthProviders.authProvider)\n authProviderId?: string\n\n @Column()\n @Field({ nullable: true })\n ssoId: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n}\n"]}
1
+ {"version":3,"file":"users-auth-providers.js","sourceRoot":"","sources":["../../../server/service/users-auth-providers/users-auth-providers.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,uCAAmC;AACnC,kEAA6D;AAatD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAyC9B,CAAA;AAzCY,gDAAkB;AAGpB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;8CACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,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EAAE,CAAC;sCACf,IAAI;qDAAA;6BAxCJ,kBAAkB;IAX9B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,2BAA2B,EAC3B,CAAC,kBAAsC,EAAE,EAAE,CAAC;QAC1C,kBAAkB,CAAC,MAAM;QACzB,kBAAkB,CAAC,IAAI;QACvB,kBAAkB,CAAC,YAAY;KAChC,EACD,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAChD,kBAAkB,CAyC9B","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n VersionColumn\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '../user/user'\nimport { AuthProvider } from '../auth-provider/auth-provider'\n\n@Entity()\n@Index(\n 'ix_users_auth_providers_0',\n (usersAuthProviders: UsersAuthProviders) => [\n usersAuthProviders.domain,\n usersAuthProviders.user,\n usersAuthProviders.authProvider\n ],\n { unique: true }\n)\n@ObjectType({ description: 'Entity for UsersAuthProviders' })\nexport class UsersAuthProviders {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((usersAuthProviders: UsersAuthProviders) => usersAuthProviders.domain)\n domainId?: string\n\n @ManyToOne(() => User, user => user.usersAuthProviders, {\n onDelete: 'CASCADE'\n })\n @Field(type => User, { nullable: true })\n user: User\n\n @RelationId((usersAuthProviders: UsersAuthProviders) => usersAuthProviders.user)\n userId?: string\n\n @ManyToOne(() => AuthProvider, authProvider => authProvider.usersAuthProviders, {\n onDelete: 'CASCADE'\n })\n @Field(type => AuthProvider, { nullable: true })\n authProvider: AuthProvider\n\n @RelationId((usersAuthProviders: UsersAuthProviders) => usersAuthProviders.authProvider)\n authProviderId?: string\n\n @Column()\n @Field({ nullable: true })\n ssoId: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n}\n"]}
@@ -13,9 +13,10 @@ var VerificationTokenType;
13
13
  VerificationTokenType["PASSWORD_RESET"] = "password-reset";
14
14
  VerificationTokenType["UNLOCK"] = "unlock";
15
15
  VerificationTokenType["REQUEST_ACCESS_TOKEN"] = "access-token";
16
- })(VerificationTokenType = exports.VerificationTokenType || (exports.VerificationTokenType = {}));
16
+ })(VerificationTokenType || (exports.VerificationTokenType = VerificationTokenType = {}));
17
17
  let VerificationToken = class VerificationToken {
18
18
  };
19
+ exports.VerificationToken = VerificationToken;
19
20
  tslib_1.__decorate([
20
21
  (0, typeorm_1.PrimaryColumn)(),
21
22
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -59,9 +60,8 @@ tslib_1.__decorate([
59
60
  (0, type_graphql_1.Field)(),
60
61
  tslib_1.__metadata("design:type", Date)
61
62
  ], VerificationToken.prototype, "updatedAt", void 0);
62
- VerificationToken = tslib_1.__decorate([
63
+ exports.VerificationToken = VerificationToken = tslib_1.__decorate([
63
64
  (0, typeorm_1.Entity)(),
64
65
  (0, type_graphql_1.ObjectType)()
65
66
  ], VerificationToken);
66
- exports.VerificationToken = VerificationToken;
67
67
  //# sourceMappingURL=verification-token.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verification-token.js","sourceRoot":"","sources":["../../../server/service/verification-token/verification-token.ts"],"names":[],"mappings":";;;;AAAA,qCAA2F;AAC3F,6CAA4C;AAC5C,+CAAoD;AACpD,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,kDAAyB,CAAA;IACzB,0DAAiC,CAAA;IACjC,0CAAiB,CAAA;IACjB,8DAAqC,CAAA;AACvC,CAAC,EALW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKhC;AAIM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAsC7B,CAAA;AArCC;IAAC,IAAA,uBAAa,GAAE;IACf,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;iDACJ;AAEd;IAAC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,oBAAK,GAAE;;gDACK;AAEb;IAAC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,KAAK;QACf,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,aAAa,IAAI,QAAQ;gBAC3B,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,UAAU;QAChB,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,qBAAqB,CAAC,UAAU;KAC1C,CAAC;IACD,IAAA,oBAAK,GAAE;;+CACmB;AAE3B;IAAC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACR;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,GAAE;sCACG,IAAI;oDAAA;AAEf;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,GAAE;sCACG,IAAI;oDAAA;AArCJ,iBAAiB;IAF7B,IAAA,gBAAM,GAAE;IACR,IAAA,yBAAU,GAAE;GACA,iBAAiB,CAsC7B;AAtCY,8CAAiB","sourcesContent":["import { Column, CreateDateColumn, Entity, PrimaryColumn, UpdateDateColumn } from 'typeorm'\nimport { config } from '@things-factory/env'\nimport { ObjectType, Field, ID } from 'type-graphql'\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\nexport enum VerificationTokenType {\n ACTIVATION = 'activation',\n PASSWORD_RESET = 'password-reset',\n UNLOCK = 'unlock',\n REQUEST_ACCESS_TOKEN = 'access-token'\n}\n\n@Entity()\n@ObjectType()\nexport class VerificationToken {\n @PrimaryColumn()\n @Field(type => ID)\n userId: string\n\n @Column({\n nullable: false\n })\n @Field()\n token: string\n\n @Column({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : 'smallint',\n enum: VerificationTokenType,\n default: VerificationTokenType.ACTIVATION\n })\n @Field()\n type: VerificationTokenType\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n suppliment: string\n\n @CreateDateColumn()\n @Field()\n createdAt: Date\n\n @UpdateDateColumn()\n @Field()\n updatedAt: Date\n}\n"]}
1
+ {"version":3,"file":"verification-token.js","sourceRoot":"","sources":["../../../server/service/verification-token/verification-token.ts"],"names":[],"mappings":";;;;AAAA,qCAA2F;AAC3F,6CAA4C;AAC5C,+CAAoD;AACpD,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAEpC,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,kDAAyB,CAAA;IACzB,0DAAiC,CAAA;IACjC,0CAAiB,CAAA;IACjB,8DAAqC,CAAA;AACvC,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAIM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAsC7B,CAAA;AAtCY,8CAAiB;AAG5B;IAFC,IAAA,uBAAa,GAAE;IACf,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;iDACJ;AAMd;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,oBAAK,GAAE;;gDACK;AAcb;IAZC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,KAAK;QACf,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,aAAa,IAAI,QAAQ;gBAC3B,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,UAAU;QAChB,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,qBAAqB,CAAC,UAAU;KAC1C,CAAC;IACD,IAAA,oBAAK,GAAE;;+CACmB;AAM3B;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACR;AAIlB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,GAAE;sCACG,IAAI;oDAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,GAAE;sCACG,IAAI;oDAAA;4BArCJ,iBAAiB;IAF7B,IAAA,gBAAM,GAAE;IACR,IAAA,yBAAU,GAAE;GACA,iBAAiB,CAsC7B","sourcesContent":["import { Column, CreateDateColumn, Entity, PrimaryColumn, UpdateDateColumn } from 'typeorm'\nimport { config } from '@things-factory/env'\nimport { ObjectType, Field, ID } from 'type-graphql'\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\nexport enum VerificationTokenType {\n ACTIVATION = 'activation',\n PASSWORD_RESET = 'password-reset',\n UNLOCK = 'unlock',\n REQUEST_ACCESS_TOKEN = 'access-token'\n}\n\n@Entity()\n@ObjectType()\nexport class VerificationToken {\n @PrimaryColumn()\n @Field(type => ID)\n userId: string\n\n @Column({\n nullable: false\n })\n @Field()\n token: string\n\n @Column({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : 'smallint',\n enum: VerificationTokenType,\n default: VerificationTokenType.ACTIVATION\n })\n @Field()\n type: VerificationTokenType\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n suppliment: string\n\n @CreateDateColumn()\n @Field()\n createdAt: Date\n\n @UpdateDateColumn()\n @Field()\n updatedAt: Date\n}\n"]}
@@ -7,6 +7,7 @@ const typeorm_1 = require("typeorm");
7
7
  const user_1 = require("../user/user");
8
8
  let WebAuthCredential = class WebAuthCredential {
9
9
  };
10
+ exports.WebAuthCredential = WebAuthCredential;
10
11
  tslib_1.__decorate([
11
12
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
12
13
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -64,9 +65,8 @@ tslib_1.__decorate([
64
65
  (0, typeorm_1.RelationId)((webAuthCredential) => webAuthCredential.updater),
65
66
  tslib_1.__metadata("design:type", String)
66
67
  ], WebAuthCredential.prototype, "updaterId", void 0);
67
- WebAuthCredential = tslib_1.__decorate([
68
+ exports.WebAuthCredential = WebAuthCredential = tslib_1.__decorate([
68
69
  (0, typeorm_1.Entity)(),
69
70
  (0, typeorm_1.Index)('ix_web_auth_credential_0', (webAuthCredential) => [webAuthCredential.user, webAuthCredential.credentialId], { unique: true })
70
71
  ], WebAuthCredential);
71
- exports.WebAuthCredential = WebAuthCredential;
72
72
  //# sourceMappingURL=web-auth-credential.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-auth-credential.js","sourceRoot":"","sources":["../../../server/service/web-auth-credential/web-auth-credential.ts"],"names":[],"mappings":";;;;AAAA,+CAAwC;AACxC,qCASgB;AAEhB,uCAAmC;AAQ5B,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB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AA,oBAAU,EAAC,CAAC,iBAAoC,EAAE,EAAE,CAAC,iBAAiB,CAAC,OAAO,CAAC;;oDAC9D;AAElB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,WAAI;kDAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,iBAAoC,EAAE,EAAE,CAAC,iBAAiB,CAAC,OAAO,CAAC;;oDAC9D;AA5CP,iBAAiB;IAN7B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,0BAA0B,EAC1B,CAAC,iBAAoC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,YAAY,CAAC,EAClG,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;GACY,iBAAiB,CA6C7B;AA7CY,8CAAiB","sourcesContent":["import { Field, ID } from 'type-graphql'\nimport {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\n\nimport { User } from '../user/user'\n\n@Entity()\n@Index(\n 'ix_web_auth_credential_0',\n (webAuthCredential: WebAuthCredential) => [webAuthCredential.user, webAuthCredential.credentialId],\n { unique: true }\n)\nexport class WebAuthCredential {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n user?: User\n\n @RelationId((webAuthCredential: WebAuthCredential) => webAuthCredential.user)\n userId?: string\n\n @Column()\n @Field({ nullable: true })\n credentialId: string\n\n @Column()\n @Field({ nullable: true })\n publicKey: string\n\n @Column()\n @Field({ nullable: true })\n counter: number\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((webAuthCredential: WebAuthCredential) => webAuthCredential.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((webAuthCredential: WebAuthCredential) => webAuthCredential.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"web-auth-credential.js","sourceRoot":"","sources":["../../../server/service/web-auth-credential/web-auth-credential.ts"],"names":[],"mappings":";;;;AAAA,+CAAwC;AACxC,qCASgB;AAEhB,uCAAmC;AAQ5B,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CA6C7B,CAAA;AA7CY,8CAAiB;AAGnB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;6CACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,WAAI;+CAAA;AAGX;IADC,IAAA,oBAAU,EAAC,CAAC,iBAAoC,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC;;iDAC9D;AAIf;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACN;AAIpB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACT;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,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ManyToOne,\n PrimaryGeneratedColumn\n} from 'typeorm'\n\nimport { User } from '../user/user'\n\n@Entity()\n@Index(\n 'ix_web_auth_credential_0',\n (webAuthCredential: WebAuthCredential) => [webAuthCredential.user, webAuthCredential.credentialId],\n { unique: true }\n)\nexport class WebAuthCredential {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n user?: User\n\n @RelationId((webAuthCredential: WebAuthCredential) => webAuthCredential.user)\n userId?: string\n\n @Column()\n @Field({ nullable: true })\n credentialId: string\n\n @Column()\n @Field({ nullable: true })\n publicKey: string\n\n @Column()\n @Field({ nullable: true })\n counter: number\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((webAuthCredential: WebAuthCredential) => webAuthCredential.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((webAuthCredential: WebAuthCredential) => webAuthCredential.updater)\n updaterId?: string\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getUnlockUserEmailForm = void 0;
3
+ exports.getUnlockUserEmailForm = getUnlockUserEmailForm;
4
4
  function getUnlockUserEmailForm({ name, resetUrl }) {
5
5
  return `
6
6
  <html lang="en">
@@ -66,5 +66,4 @@ function getUnlockUserEmailForm({ name, resetUrl }) {
66
66
  </html>
67
67
  `;
68
68
  }
69
- exports.getUnlockUserEmailForm = getUnlockUserEmailForm;
70
69
  //# sourceMappingURL=account-unlock-email.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"account-unlock-email.js","sourceRoot":"","sources":["../../server/templates/account-unlock-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,IAAI;;;;;;;;;;;;;oBAaF,QAAQ;;;;;;;;;;;;;;;;;GAiBzB,CAAA;AACH,CAAC;AAhED,wDAgEC","sourcesContent":["export function getUnlockUserEmailForm({ name, resetUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>reset password</title>\n <meta name=\"description\" content=\"Password Reset\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${name}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Unlock Account</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n Click the button below to unlock account and reset password.\n <br />\n <a\n href=\"${resetUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >unlock account</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
1
+ {"version":3,"file":"account-unlock-email.js","sourceRoot":"","sources":["../../server/templates/account-unlock-email.ts"],"names":[],"mappings":";;AAAA,wDAgEC;AAhED,SAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,IAAI;;;;;;;;;;;;;oBAaF,QAAQ;;;;;;;;;;;;;;;;;GAiBzB,CAAA;AACH,CAAC","sourcesContent":["export function getUnlockUserEmailForm({ name, resetUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>reset password</title>\n <meta name=\"description\" content=\"Password Reset\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${name}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Unlock Account</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n Click the button below to unlock account and reset password.\n <br />\n <a\n href=\"${resetUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >unlock account</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getInvitationEmailForm = void 0;
3
+ exports.getInvitationEmailForm = getInvitationEmailForm;
4
4
  function getInvitationEmailForm({ email, acceptUrl }) {
5
5
  return `
6
6
  <html lang="en">
@@ -67,5 +67,4 @@ function getInvitationEmailForm({ email, acceptUrl }) {
67
67
  </html>
68
68
  `;
69
69
  }
70
- exports.getInvitationEmailForm = getInvitationEmailForm;
71
70
  //# sourceMappingURL=invitation-email.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"invitation-email.js","sourceRoot":"","sources":["../../server/templates/invitation-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE;IACzD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,KAAK;;;;;;;;;;;;;;oBAcH,SAAS;;;;;;;;;;;;;;;;;GAiB1B,CAAA;AACH,CAAC;AAjED,wDAiEC","sourcesContent":["export function getInvitationEmailForm({ email, acceptUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>Invitation from Operato</title>\n <meta name=\"description\" content=\"Invitation\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${email}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Verify your email</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n You're invited from Operato. \n Simply click the button below to verify your email address.\n <br />\n <a\n href=\"${acceptUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >Verify</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
1
+ {"version":3,"file":"invitation-email.js","sourceRoot":"","sources":["../../server/templates/invitation-email.ts"],"names":[],"mappings":";;AAAA,wDAiEC;AAjED,SAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE;IACzD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,KAAK;;;;;;;;;;;;;;oBAcH,SAAS;;;;;;;;;;;;;;;;;GAiB1B,CAAA;AACH,CAAC","sourcesContent":["export function getInvitationEmailForm({ email, acceptUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>Invitation from Operato</title>\n <meta name=\"description\" content=\"Invitation\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${email}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Verify your email</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n You're invited from Operato. \n Simply click the button below to verify your email address.\n <br />\n <a\n href=\"${acceptUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >Verify</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getResetPasswordEmailForm = void 0;
3
+ exports.getResetPasswordEmailForm = getResetPasswordEmailForm;
4
4
  function getResetPasswordEmailForm({ name, resetUrl }) {
5
5
  return `
6
6
  <html lang="en">
@@ -66,5 +66,4 @@ function getResetPasswordEmailForm({ name, resetUrl }) {
66
66
  </html>
67
67
  `;
68
68
  }
69
- exports.getResetPasswordEmailForm = getResetPasswordEmailForm;
70
69
  //# sourceMappingURL=reset-password-email.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reset-password-email.js","sourceRoot":"","sources":["../../server/templates/reset-password-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,yBAAyB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1D,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,IAAI;;;;;;;;;;;;;oBAaF,QAAQ;;;;;;;;;;;;;;;;;GAiBzB,CAAA;AACH,CAAC;AAhED,8DAgEC","sourcesContent":["export function getResetPasswordEmailForm({ name, resetUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>reset password</title>\n <meta name=\"description\" content=\"Password Reset\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${name}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Reset password</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n Click the button below to reset password.\n <br />\n <a\n href=\"${resetUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >reset password</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
1
+ {"version":3,"file":"reset-password-email.js","sourceRoot":"","sources":["../../server/templates/reset-password-email.ts"],"names":[],"mappings":";;AAAA,8DAgEC;AAhED,SAAgB,yBAAyB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1D,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,IAAI;;;;;;;;;;;;;oBAaF,QAAQ;;;;;;;;;;;;;;;;;GAiBzB,CAAA;AACH,CAAC","sourcesContent":["export function getResetPasswordEmailForm({ name, resetUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>reset password</title>\n <meta name=\"description\" content=\"Password Reset\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${name}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Reset password</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n Click the button below to reset password.\n <br />\n <a\n href=\"${resetUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >reset password</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getVerificationEmailForm = void 0;
3
+ exports.getVerificationEmailForm = getVerificationEmailForm;
4
4
  function getVerificationEmailForm({ name, verifyUrl }) {
5
5
  return `
6
6
  <html lang="en">
@@ -67,5 +67,4 @@ function getVerificationEmailForm({ name, verifyUrl }) {
67
67
  </html>
68
68
  `;
69
69
  }
70
- exports.getVerificationEmailForm = getVerificationEmailForm;
71
70
  //# sourceMappingURL=verification-email.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verification-email.js","sourceRoot":"","sources":["../../server/templates/verification-email.ts"],"names":[],"mappings":";;;AAAA,SAAgB,wBAAwB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1D,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,IAAI;;;;;;;;;;;;;;oBAcF,SAAS;;;;;;;;;;;;;;;;;GAiB1B,CAAA;AACH,CAAC;AAjED,4DAiEC","sourcesContent":["export function getVerificationEmailForm({ name, verifyUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>Verify your email</title>\n <meta name=\"description\" content=\"Email Verification\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${name}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Verify your email</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n You're almost ready to start enjoying Operato. \n Simply click the button below to verify your email address.\n <br />\n <a\n href=\"${verifyUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >Verify</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}
1
+ {"version":3,"file":"verification-email.js","sourceRoot":"","sources":["../../server/templates/verification-email.ts"],"names":[],"mappings":";;AAAA,4DAiEC;AAjED,SAAgB,wBAAwB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1D,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgCS,IAAI;;;;;;;;;;;;;;oBAcF,SAAS;;;;;;;;;;;;;;;;;GAiB1B,CAAA;AACH,CAAC","sourcesContent":["export function getVerificationEmailForm({ name, verifyUrl }) {\n return `\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n \n <title>Verify your email</title>\n <meta name=\"description\" content=\"Email Verification\" />\n <meta name=\"author\" content=\"hatiolab\" />\n <meta name=\"google\" content=\"notranslate\"/>\n </head>\n\n <body>\n <div style=\"background-color:#f6f6f6\">\n <!--header begin-->\n <div style=\"background-color:#fff;padding:0 10px;border-top: 2px solid #394e64;\">\n <a href=\"#\" target=\"_blank\"\n ><img\n src=\"http://www.hatiolab.com/assets/img/logo-operato.png\"\n style=\"max-height:50px\"\n /></a>\n </div>\n <!--header end-->\n\n <!--title begin-->\n <div\n style=\"background-color:#22a6a7;padding:12px 10px 10px 10px;min-height:50px;\"\n >\n <img\n src=\"http://www.hatiolab.com/assets/img/icon-mail.png\"\n style=\"float:left;margin:0 10px 0 40px\"\n />\n <span style=\"display:block;color:#fff;font-size:20px\"\n >Hi ${name}!</span\n >\n <span style=\"display:block;color:#fff;font-size:34px;font-weight:bold\"\n >Verify your email</span\n >\n </div>\n <!--title end-->\n\n <!--body begin-->\n <p style=\"padding:10px 20px;line-height:1.5;font-size:16px\">\n You're almost ready to start enjoying Operato. \n Simply click the button below to verify your email address.\n <br />\n <a\n href=\"${verifyUrl}\"\n style=\"display:inline-block;margin:10px 5px 5px 0;border-radius:7px;background-color:#22a6a7;padding:7px 15px;color:#fff;font-size:18px;text-decoration:none;text-transform:capitalize;\"\n >Verify</a\n >\n </p>\n <!--body end-->\n\n <!--footer begin-->\n <div\n style=\"background-color:#3d5874;padding:7px 20px 5px 20px;font-size:12px;color:#efefef\"\n >\n © Hatio, Lab. Inc. All rights reserved.\n </div>\n <!--footer end-->\n </div>\n </body>\n </html>\n `\n}\n"]}