heartraite 1.0.5 → 1.0.6

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.
@@ -0,0 +1,3 @@
1
+ export type DeepPartial<T> = {
2
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
3
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,6 @@
1
1
  export * from "./assessment.types";
2
2
  export * from "./cloud-function-types";
3
+ export * from "./helper.types";
3
4
  export * from "./like.types";
4
5
  export * from "./match.types";
5
6
  export * from "./message.types";
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./assessment.types"), exports);
18
18
  __exportStar(require("./cloud-function-types"), exports);
19
+ __exportStar(require("./helper.types"), exports);
19
20
  __exportStar(require("./like.types"), exports);
20
21
  __exportStar(require("./match.types"), exports);
21
22
  __exportStar(require("./message.types"), exports);
@@ -1,5 +1,7 @@
1
1
  import { FeedbackAgreement, Gender, LikeType, ReportReason } from "../enum";
2
+ import { DeepPartial } from "./helper.types";
2
3
  import { Answer } from "./submission.types";
4
+ import { DatingPreferences, UserNotifications, UserProfile } from "./user.types";
3
5
  export type RegisterUserRequest = {
4
6
  email: string;
5
7
  password: string;
@@ -105,7 +107,11 @@ export type RegisterOnboardingRequest = {
105
107
  };
106
108
  };
107
109
  export type GetUserRequest = undefined;
108
- export type UpdateUserRequest = Partial<any>;
110
+ export type UpdateUserRequest = {
111
+ profile?: DeepPartial<UserProfile>;
112
+ preferences?: DeepPartial<DatingPreferences>;
113
+ notifications?: DeepPartial<UserNotifications>;
114
+ };
109
115
  export type AddImagesRequest = {
110
116
  images: string[];
111
117
  };
@@ -4,14 +4,14 @@ export type User = {
4
4
  email: string;
5
5
  created: Date;
6
6
  permissions: UserPermissions;
7
- profile: Profile;
7
+ profile: UserProfile;
8
8
  preferences: DatingPreferences;
9
9
  notifications: UserNotifications;
10
10
  };
11
11
  export type UserPermissions = {
12
12
  registrationReferralAllowed: boolean;
13
13
  };
14
- export type Profile = {
14
+ export type UserProfile = {
15
15
  intro: string;
16
16
  firstName: string;
17
17
  state: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heartraite",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Heartraite npm package for common functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,3 @@
1
+ export type DeepPartial<T> = {
2
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
3
+ };
@@ -1,5 +1,6 @@
1
1
  export * from "./assessment.types";
2
2
  export * from "./cloud-function-types";
3
+ export * from "./helper.types";
3
4
  export * from "./like.types";
4
5
  export * from "./match.types";
5
6
  export * from "./message.types";
@@ -1,5 +1,11 @@
1
1
  import { FeedbackAgreement, Gender, LikeType, ReportReason } from "../enum";
2
+ import { DeepPartial } from "./helper.types";
2
3
  import { Answer } from "./submission.types";
4
+ import {
5
+ DatingPreferences,
6
+ UserNotifications,
7
+ UserProfile,
8
+ } from "./user.types";
3
9
 
4
10
  // auth
5
11
  export type RegisterUserRequest = {
@@ -103,7 +109,11 @@ export type RegisterOnboardingRequest = {
103
109
  };
104
110
  };
105
111
  export type GetUserRequest = undefined;
106
- export type UpdateUserRequest = Partial<any>; // TODO; fix typing
112
+ export type UpdateUserRequest = {
113
+ profile?: DeepPartial<UserProfile>;
114
+ preferences?: DeepPartial<DatingPreferences>;
115
+ notifications?: DeepPartial<UserNotifications>;
116
+ };
107
117
 
108
118
  // storage
109
119
  export type AddImagesRequest = { images: string[] };
@@ -5,7 +5,7 @@ export type User = {
5
5
  email: string;
6
6
  created: Date;
7
7
  permissions: UserPermissions;
8
- profile: Profile;
8
+ profile: UserProfile;
9
9
  preferences: DatingPreferences;
10
10
  notifications: UserNotifications;
11
11
  };
@@ -14,7 +14,7 @@ export type UserPermissions = {
14
14
  registrationReferralAllowed: boolean;
15
15
  };
16
16
 
17
- export type Profile = {
17
+ export type UserProfile = {
18
18
  intro: string;
19
19
  firstName: string;
20
20
  state: string;