heartraite 1.0.3 → 1.0.5

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 @@
1
+ export * from "./user.constants";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./user.constants"), exports);
@@ -0,0 +1,3 @@
1
+ import { Gender, SwedishState } from "../enum";
2
+ export declare const SWEDISH_STATES: SwedishState[];
3
+ export declare const GENDERS: Gender[];
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GENDERS = exports.SWEDISH_STATES = void 0;
4
+ const enum_1 = require("../enum");
5
+ exports.SWEDISH_STATES = Object.values(enum_1.SwedishState);
6
+ exports.GENDERS = [enum_1.Gender.MALE, enum_1.Gender.FEMALE];
@@ -29,6 +29,7 @@ export declare enum CloudFunction {
29
29
  STRIPE_WEBWOOK = "stripe/webhook",
30
30
  CREATE_BILLING_PORTAL = "stripe/create-billing-portal",
31
31
  CREATE_CHECKOUT_SESSION = "stripe/create-checkout-session",
32
+ REGISTER_ONBOARDING = "user/register-onboarding",
32
33
  UPDATE_USER = "user/update-user",
33
34
  GET_CURRENT_USER = "user/get-current-user"
34
35
  }
@@ -33,6 +33,7 @@ var CloudFunction;
33
33
  CloudFunction["STRIPE_WEBWOOK"] = "stripe/webhook";
34
34
  CloudFunction["CREATE_BILLING_PORTAL"] = "stripe/create-billing-portal";
35
35
  CloudFunction["CREATE_CHECKOUT_SESSION"] = "stripe/create-checkout-session";
36
+ CloudFunction["REGISTER_ONBOARDING"] = "user/register-onboarding";
36
37
  CloudFunction["UPDATE_USER"] = "user/update-user";
37
38
  CloudFunction["GET_CURRENT_USER"] = "user/get-current-user";
38
39
  })(CloudFunction || (exports.CloudFunction = CloudFunction = {}));
@@ -7,3 +7,5 @@ export * from "./evaluation.enum";
7
7
  export * from "./report.enum";
8
8
  export * from "./gender.enum";
9
9
  export * from "./provider.enum";
10
+ export * from "./state.enum";
11
+ export * from "./notification.enum";
@@ -23,3 +23,5 @@ __exportStar(require("./evaluation.enum"), exports);
23
23
  __exportStar(require("./report.enum"), exports);
24
24
  __exportStar(require("./gender.enum"), exports);
25
25
  __exportStar(require("./provider.enum"), exports);
26
+ __exportStar(require("./state.enum"), exports);
27
+ __exportStar(require("./notification.enum"), exports);
@@ -0,0 +1,5 @@
1
+ export declare enum NotificationSetting {
2
+ NEW_MATCH = "new-match",
3
+ NEW_LIKE = "new-like",
4
+ NEW_MESSAGE = "new-message"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationSetting = void 0;
4
+ var NotificationSetting;
5
+ (function (NotificationSetting) {
6
+ NotificationSetting["NEW_MATCH"] = "new-match";
7
+ NotificationSetting["NEW_LIKE"] = "new-like";
8
+ NotificationSetting["NEW_MESSAGE"] = "new-message";
9
+ })(NotificationSetting || (exports.NotificationSetting = NotificationSetting = {}));
@@ -0,0 +1,26 @@
1
+ export declare enum SwedishState {
2
+ BLEKINGE = "blekinge",
3
+ DALARNA = "dalarna",
4
+ GOTLAND = "gotland",
5
+ GAVLEBORG = "gavleborg",
6
+ GOTEBORG = "goteborg",
7
+ HALLAND = "halland",
8
+ JAMTLAND = "jamtland",
9
+ JONKOPING = "jonkoping",
10
+ KALMAR = "kalmar",
11
+ KRONOBERG = "kronoberg",
12
+ NORRBOTTEN = "norrbotten",
13
+ SKARABORG = "skaraborg",
14
+ SKANE = "skane",
15
+ STOCKHOLM = "stockholm",
16
+ SODERMANLAND = "sodermanland",
17
+ UPPSALA = "uppsala",
18
+ VARMLAND = "varmland",
19
+ VASTERBOTTEN = "vasterbotten",
20
+ VASTERNORRLAND = "vasternorrland",
21
+ VASTMANLAND = "vastmanland",
22
+ ALVSBORG = "alvsborg",
23
+ OREBRO = "orebro",
24
+ OSTERGOTLAND = "ostergotland",
25
+ ÖLAND = "oland"
26
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SwedishState = void 0;
4
+ var SwedishState;
5
+ (function (SwedishState) {
6
+ SwedishState["BLEKINGE"] = "blekinge";
7
+ SwedishState["DALARNA"] = "dalarna";
8
+ SwedishState["GOTLAND"] = "gotland";
9
+ SwedishState["GAVLEBORG"] = "gavleborg";
10
+ SwedishState["GOTEBORG"] = "goteborg";
11
+ SwedishState["HALLAND"] = "halland";
12
+ SwedishState["JAMTLAND"] = "jamtland";
13
+ SwedishState["JONKOPING"] = "jonkoping";
14
+ SwedishState["KALMAR"] = "kalmar";
15
+ SwedishState["KRONOBERG"] = "kronoberg";
16
+ SwedishState["NORRBOTTEN"] = "norrbotten";
17
+ SwedishState["SKARABORG"] = "skaraborg";
18
+ SwedishState["SKANE"] = "skane";
19
+ SwedishState["STOCKHOLM"] = "stockholm";
20
+ SwedishState["SODERMANLAND"] = "sodermanland";
21
+ SwedishState["UPPSALA"] = "uppsala";
22
+ SwedishState["VARMLAND"] = "varmland";
23
+ SwedishState["VASTERBOTTEN"] = "vasterbotten";
24
+ SwedishState["VASTERNORRLAND"] = "vasternorrland";
25
+ SwedishState["VASTMANLAND"] = "vastmanland";
26
+ SwedishState["ALVSBORG"] = "alvsborg";
27
+ SwedishState["OREBRO"] = "orebro";
28
+ SwedishState["OSTERGOTLAND"] = "ostergotland";
29
+ SwedishState["\u00D6LAND"] = "oland";
30
+ })(SwedishState || (exports.SwedishState = SwedishState = {}));
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./constants";
1
2
  export * from "./enum";
2
3
  export * from "./firebase";
3
4
  export * from "./types";
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants"), exports);
17
18
  __exportStar(require("./enum"), exports);
18
19
  __exportStar(require("./firebase"), exports);
19
20
  __exportStar(require("./types"), exports);
@@ -1,6 +1,6 @@
1
1
  import { CloudFunction } from "../enum";
2
- import { AddImagesRequest, AuthenticateBankIDRequest, CollectBankIDRequest, CreateAssessmentRequest, CreateBillingPortalRequest, CreateCheckoutSessionRequest, CreateLikeRequest, CreatePLSRequest, CreateReportRequest, CreateSubmissionRequest, GetAssessmentRequest, GetMatchableUserRequest, GetMatchCheckRequest, GetMatchesRequest, GetMatchRequest, GetMessagesRequest, GetProductsRequest, GetSubmissionRequest, GetUserRequest, HandleLikeSeenRequest, HandleMatchSeenRequest, RegisterUserRequest, RemoveMatchRequest, SendMessageRequest, SubmitCategoryFeedbackRequest, UpdateAnswerRequest, UpdateQuestionsRequest, UpdateUserRequest } from "./request.types";
3
- import { AddImagesResponse, AuthenticateBankIDResponse, CollectBankIDResponse, CreateAssessmentResponse, CreateBillingPortalResponse, CreateCheckoutSessionResponse, CreateLikeResponse, CreatePLSResponse, CreateReportResponse, CreateSubmissionResponse, GetAssessmentResponse, GetAssessmentsResponse, GetMatchableUserResponse, GetMatchableUsersResponse, GetMatchCheckResponse, GetMatchesResponse, GetMatchResponse, GetMessagesResponse, GetProductsResponse, GetSubmissionResponse, GetUserResponse, HandleLikeSeenResponse, HandleMatchSeenResponse, RegisterUserResponse, RemoveMatchResponse, SendMessageResponse, SubmitCategoryFeedbackResponse, UpdateAnswerResponse, UpdateQuestionsResponse, UpdateUserResponse } from "./response.types";
2
+ import { AddImagesRequest, AuthenticateBankIDRequest, CollectBankIDRequest, CreateAssessmentRequest, CreateBillingPortalRequest, CreateCheckoutSessionRequest, CreateLikeRequest, CreatePLSRequest, CreateReportRequest, CreateSubmissionRequest, GetAssessmentRequest, GetMatchableUserRequest, GetMatchCheckRequest, GetMatchesRequest, GetMatchRequest, GetMessagesRequest, GetProductsRequest, GetSubmissionRequest, GetUserRequest, HandleLikeSeenRequest, HandleMatchSeenRequest, RegisterOnboardingRequest, RegisterUserRequest, RemoveMatchRequest, SendMessageRequest, SubmitCategoryFeedbackRequest, UpdateAnswerRequest, UpdateQuestionsRequest, UpdateUserRequest } from "./request.types";
3
+ import { AddImagesResponse, AuthenticateBankIDResponse, CollectBankIDResponse, CreateAssessmentResponse, CreateBillingPortalResponse, CreateCheckoutSessionResponse, CreateLikeResponse, CreatePLSResponse, CreateReportResponse, CreateSubmissionResponse, GetAssessmentResponse, GetAssessmentsResponse, GetMatchableUserResponse, GetMatchableUsersResponse, GetMatchCheckResponse, GetMatchesResponse, GetMatchResponse, GetMessagesResponse, GetProductsResponse, GetSubmissionResponse, GetUserResponse, HandleLikeSeenResponse, HandleMatchSeenResponse, RegisterOnboardingResponse, RegisterUserResponse, RemoveMatchResponse, SendMessageResponse, SubmitCategoryFeedbackResponse, UpdateAnswerResponse, UpdateQuestionsResponse, UpdateUserResponse } from "./response.types";
4
4
  export type CloudFunctionTypes = {
5
5
  [CloudFunction.CREATE_ASSESSMENT]: {
6
6
  payload: CreateAssessmentRequest;
@@ -118,6 +118,10 @@ export type CloudFunctionTypes = {
118
118
  payload: CreateCheckoutSessionRequest;
119
119
  response: CreateCheckoutSessionResponse;
120
120
  };
121
+ [CloudFunction.REGISTER_ONBOARDING]: {
122
+ payload: RegisterOnboardingRequest;
123
+ response: RegisterOnboardingResponse;
124
+ };
121
125
  [CloudFunction.UPDATE_USER]: {
122
126
  payload: UpdateUserRequest;
123
127
  response: UpdateUserResponse;
@@ -1,5 +1,10 @@
1
- import { FeedbackAgreement, LikeType, ReportReason } from "../enum";
1
+ import { FeedbackAgreement, Gender, LikeType, ReportReason } from "../enum";
2
2
  import { Answer } from "./submission.types";
3
+ export type RegisterUserRequest = {
4
+ email: string;
5
+ password: string;
6
+ referrerId?: string;
7
+ };
3
8
  export type CreateAssessmentRequest = {
4
9
  intimateTopics: boolean;
5
10
  };
@@ -87,10 +92,17 @@ export type CreateReportRequest = {
87
92
  export type CreateCheckoutSessionRequest = {
88
93
  priceId: string;
89
94
  };
90
- export type RegisterUserRequest = {
91
- email: string;
92
- password: string;
93
- referrerId?: string;
95
+ export type RegisterOnboardingRequest = {
96
+ firstName: string;
97
+ state: string;
98
+ birth: Date;
99
+ images: string[];
100
+ interestedIn: Gender[];
101
+ gender: Gender;
102
+ coordinates: {
103
+ lat: number;
104
+ lng: number;
105
+ };
94
106
  };
95
107
  export type GetUserRequest = undefined;
96
108
  export type UpdateUserRequest = Partial<any>;
@@ -5,6 +5,10 @@ import { Message } from "./message.types";
5
5
  import { StripeProduct } from "./stripe.types";
6
6
  import { User } from "./user.types";
7
7
  import { Like } from "./like.types";
8
+ export type RegisterUserResponse = {
9
+ success: boolean;
10
+ message: string;
11
+ };
8
12
  export type CreateAssessmentResponse = Assessment;
9
13
  export type GetAssessmentResponse = Assessment;
10
14
  export type GetAssessmentsResponse = FullAssessment[];
@@ -50,10 +54,7 @@ export type CreateCheckoutSessionResponse = {
50
54
  url: string;
51
55
  };
52
56
  export type GetProductsResponse = StripeProduct[];
53
- export type RegisterUserResponse = {
54
- success: boolean;
55
- message: string;
56
- };
57
+ export type RegisterOnboardingResponse = User;
57
58
  export type GetUserResponse = User;
58
59
  export type UpdateUserResponse = User;
59
60
  export type AddImagesResponse = {
@@ -1,13 +1,16 @@
1
- import { Gender } from "../enum";
1
+ import { Gender, NotificationSetting } from "../enum";
2
2
  export type User = {
3
3
  id: string;
4
4
  email: string;
5
- bankIDVerified: boolean;
6
- registrationReferralAllowed: boolean;
5
+ created: Date;
6
+ permissions: UserPermissions;
7
7
  profile: Profile;
8
8
  preferences: DatingPreferences;
9
9
  notifications: UserNotifications;
10
10
  };
11
+ export type UserPermissions = {
12
+ registrationReferralAllowed: boolean;
13
+ };
11
14
  export type Profile = {
12
15
  intro: string;
13
16
  firstName: string;
@@ -26,11 +29,9 @@ export type Profile = {
26
29
  };
27
30
  export type NotificationSettings = {
28
31
  enabled: boolean;
29
- settings: Record<string, boolean>;
32
+ settings: Record<NotificationSetting, boolean>;
30
33
  };
31
34
  export type UserNotifications = {
32
- pushNotificationsEnabled: boolean;
33
- emailNotificationsEnabled: boolean;
34
35
  pushNotificationSettings: NotificationSettings;
35
36
  emailNotificationSettings: NotificationSettings;
36
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heartraite",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
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 @@
1
+ export * from "./user.constants";
@@ -0,0 +1,5 @@
1
+ import { Gender, SwedishState } from "../enum";
2
+
3
+ export const SWEDISH_STATES = Object.values(SwedishState);
4
+
5
+ export const GENDERS = [Gender.MALE, Gender.FEMALE];
@@ -29,6 +29,7 @@ export enum CloudFunction {
29
29
  STRIPE_WEBWOOK = "stripe/webhook",
30
30
  CREATE_BILLING_PORTAL = "stripe/create-billing-portal",
31
31
  CREATE_CHECKOUT_SESSION = "stripe/create-checkout-session",
32
+ REGISTER_ONBOARDING = "user/register-onboarding",
32
33
  UPDATE_USER = "user/update-user",
33
34
  GET_CURRENT_USER = "user/get-current-user",
34
35
  }
package/src/enum/index.ts CHANGED
@@ -7,3 +7,5 @@ export * from "./evaluation.enum";
7
7
  export * from "./report.enum";
8
8
  export * from "./gender.enum";
9
9
  export * from "./provider.enum";
10
+ export * from "./state.enum";
11
+ export * from "./notification.enum";
@@ -0,0 +1,5 @@
1
+ export enum NotificationSetting {
2
+ NEW_MATCH = "new-match",
3
+ NEW_LIKE = "new-like",
4
+ NEW_MESSAGE = "new-message",
5
+ }
@@ -0,0 +1,26 @@
1
+ export enum SwedishState {
2
+ BLEKINGE = "blekinge",
3
+ DALARNA = "dalarna",
4
+ GOTLAND = "gotland",
5
+ GAVLEBORG = "gavleborg",
6
+ GOTEBORG = "goteborg",
7
+ HALLAND = "halland",
8
+ JAMTLAND = "jamtland",
9
+ JONKOPING = "jonkoping",
10
+ KALMAR = "kalmar",
11
+ KRONOBERG = "kronoberg",
12
+ NORRBOTTEN = "norrbotten",
13
+ SKARABORG = "skaraborg",
14
+ SKANE = "skane",
15
+ STOCKHOLM = "stockholm",
16
+ SODERMANLAND = "sodermanland",
17
+ UPPSALA = "uppsala",
18
+ VARMLAND = "varmland",
19
+ VASTERBOTTEN = "vasterbotten",
20
+ VASTERNORRLAND = "vasternorrland",
21
+ VASTMANLAND = "vastmanland",
22
+ ALVSBORG = "alvsborg",
23
+ OREBRO = "orebro",
24
+ OSTERGOTLAND = "ostergotland",
25
+ ÖLAND = "oland",
26
+ }
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./constants";
1
2
  export * from "./enum";
2
3
  export * from "./firebase";
3
4
  export * from "./types";
@@ -21,6 +21,7 @@ import {
21
21
  GetUserRequest,
22
22
  HandleLikeSeenRequest,
23
23
  HandleMatchSeenRequest,
24
+ RegisterOnboardingRequest,
24
25
  RegisterUserRequest,
25
26
  RemoveMatchRequest,
26
27
  SendMessageRequest,
@@ -53,6 +54,7 @@ import {
53
54
  GetUserResponse,
54
55
  HandleLikeSeenResponse,
55
56
  HandleMatchSeenResponse,
57
+ RegisterOnboardingResponse,
56
58
  RegisterUserResponse,
57
59
  RemoveMatchResponse,
58
60
  SendMessageResponse,
@@ -193,6 +195,10 @@ export type CloudFunctionTypes = {
193
195
  response: CreateCheckoutSessionResponse;
194
196
  };
195
197
  // User
198
+ [CloudFunction.REGISTER_ONBOARDING]: {
199
+ payload: RegisterOnboardingRequest;
200
+ response: RegisterOnboardingResponse;
201
+ };
196
202
  [CloudFunction.UPDATE_USER]: {
197
203
  payload: UpdateUserRequest;
198
204
  response: UpdateUserResponse;
@@ -1,6 +1,13 @@
1
- import { FeedbackAgreement, LikeType, ReportReason } from "../enum";
1
+ import { FeedbackAgreement, Gender, LikeType, ReportReason } from "../enum";
2
2
  import { Answer } from "./submission.types";
3
3
 
4
+ // auth
5
+ export type RegisterUserRequest = {
6
+ email: string;
7
+ password: string;
8
+ referrerId?: string;
9
+ };
10
+
4
11
  // assessment
5
12
  export type CreateAssessmentRequest = { intimateTopics: boolean };
6
13
  export type GetAssessmentRequest = { id: string };
@@ -83,10 +90,17 @@ export type CreateCheckoutSessionRequest = {
83
90
  };
84
91
 
85
92
  // user
86
- export type RegisterUserRequest = {
87
- email: string;
88
- password: string;
89
- referrerId?: string;
93
+ export type RegisterOnboardingRequest = {
94
+ firstName: string;
95
+ state: string;
96
+ birth: Date;
97
+ images: string[];
98
+ interestedIn: Gender[];
99
+ gender: Gender;
100
+ coordinates: {
101
+ lat: number;
102
+ lng: number;
103
+ };
90
104
  };
91
105
  export type GetUserRequest = undefined;
92
106
  export type UpdateUserRequest = Partial<any>; // TODO; fix typing
@@ -6,6 +6,12 @@ import { StripeProduct } from "./stripe.types";
6
6
  import { User } from "./user.types";
7
7
  import { Like } from "./like.types";
8
8
 
9
+ // auth
10
+ export type RegisterUserResponse = {
11
+ success: boolean;
12
+ message: string;
13
+ };
14
+
9
15
  // assessment
10
16
  export type CreateAssessmentResponse = Assessment;
11
17
  export type GetAssessmentResponse = Assessment;
@@ -65,10 +71,7 @@ export type CreateCheckoutSessionResponse = { url: string };
65
71
  export type GetProductsResponse = StripeProduct[];
66
72
 
67
73
  // user
68
- export type RegisterUserResponse = {
69
- success: boolean;
70
- message: string;
71
- };
74
+ export type RegisterOnboardingResponse = User;
72
75
  export type GetUserResponse = User;
73
76
  export type UpdateUserResponse = User;
74
77
 
@@ -1,15 +1,19 @@
1
- import { Gender } from "../enum";
1
+ import { Gender, NotificationSetting } from "../enum";
2
2
 
3
3
  export type User = {
4
4
  id: string;
5
5
  email: string;
6
- bankIDVerified: boolean; // should this be used?
7
- registrationReferralAllowed: boolean; // should this be used?
6
+ created: Date;
7
+ permissions: UserPermissions;
8
8
  profile: Profile;
9
9
  preferences: DatingPreferences;
10
10
  notifications: UserNotifications;
11
11
  };
12
12
 
13
+ export type UserPermissions = {
14
+ registrationReferralAllowed: boolean;
15
+ };
16
+
13
17
  export type Profile = {
14
18
  intro: string;
15
19
  firstName: string;
@@ -29,12 +33,10 @@ export type Profile = {
29
33
 
30
34
  export type NotificationSettings = {
31
35
  enabled: boolean;
32
- settings: Record<string, boolean>; // e.g., push, email, etc.
36
+ settings: Record<NotificationSetting, boolean>;
33
37
  };
34
38
 
35
39
  export type UserNotifications = {
36
- pushNotificationsEnabled: boolean;
37
- emailNotificationsEnabled: boolean;
38
40
  pushNotificationSettings: NotificationSettings;
39
41
  emailNotificationSettings: NotificationSettings;
40
42
  };