Skip to content

Commit 9ab01e5

Browse files
committed
chore(deps): update @hawk.so/types to version 0.1.33 and enhance user model with UTM parameter support
1 parent a4a7903 commit 9ab01e5

5 files changed

Lines changed: 17 additions & 8 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@graphql-tools/schema": "^8.5.1",
3838
"@graphql-tools/utils": "^8.9.0",
3939
"@hawk.so/nodejs": "^3.1.1",
40-
"@hawk.so/types": "^0.1.31",
40+
"@hawk.so/types": "^0.1.33",
4141
"@types/amqp-connection-manager": "^2.0.4",
4242
"@types/bson": "^4.0.5",
4343
"@types/debug": "^4.1.5",

src/models/user.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ export default class UserModel extends AbstractModel<UserDBScheme> implements Us
133133
/**
134134
* Saved bank cards for one-click payments
135135
*/
136-
public bankCards?: BankCard[]
136+
public bankCards?: BankCard[];
137+
138+
/**
139+
* UTM parameters from signup - Data form where user went to sign up. Used for analytics purposes
140+
*/
141+
public utm?: UserDBScheme['utm'];
137142

138143
/**
139144
* Model's collection

src/models/usersFactory.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ export default class UsersFactory extends AbstractModelFactory<UserDBScheme, Use
6464
* @param password - user password
6565
* @param utm - Data form where user went to sign up. Used for analytics purposes
6666
*/
67-
public async create(email: string, password?: string, utm?: any): Promise<UserModel> {
67+
public async create(
68+
email: string,
69+
password?: string,
70+
utm?: UserDBScheme['utm']
71+
): Promise<UserModel> {
6872
const generatedPassword = password || (await UserModel.generatePassword());
6973
const hashedPassword = await UserModel.hashPassword(generatedPassword);
7074

src/resolvers/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default {
4242
*/
4343
async signUp(
4444
_obj: undefined,
45-
{ email, utm }: { email: string; utm?: any },
45+
{ email, utm }: { email: string; utm?: UserDBScheme['utm'] },
4646
{ factories }: ResolverContextBase
4747
): Promise<boolean | string> {
4848
let user;

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,10 @@
458458
dependencies:
459459
"@types/mongodb" "^3.5.34"
460460

461-
"@hawk.so/types@^0.1.31":
462-
version "0.1.31"
463-
resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.31.tgz#fba2c3451e927558bfcc3b1d942baaf8e72ad214"
464-
integrity sha512-o1LeA3JVIUPRSIZegKwAdl4noQ1KYxwr80eisJMlghP9knu6PbYw20rIMyan5qQ3epOWs8gO1CU3iwHZprFiCg==
461+
"@hawk.so/types@^0.1.33":
462+
version "0.1.33"
463+
resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.33.tgz#feb077b699b3e0001552588a372e1efe6cd58f40"
464+
integrity sha512-q3AdVxzQ8Qk8qyYiAcAacxNZXWTG/oLmVpjQlcLm2Eh5OJgpaZvH8hQCeRQ/ml1cqbYW8gUrRbMMCS2QOcwxEw==
465465
dependencies:
466466
"@types/mongodb" "^3.5.34"
467467

0 commit comments

Comments
 (0)