heartraite 1.0.59 → 1.0.61

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.
@@ -1,3 +1,4 @@
1
- import { Gender, SwedishState } from "../enum";
1
+ import { Gender, SwedishState, UserDeletionReason } from "../enum";
2
2
  export declare const SWEDISH_STATES: SwedishState[];
3
+ export declare const USER_DELETION_REASONS: UserDeletionReason[];
3
4
  export declare const GENDERS: Gender[];
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GENDERS = exports.SWEDISH_STATES = void 0;
3
+ exports.GENDERS = exports.USER_DELETION_REASONS = exports.SWEDISH_STATES = void 0;
4
4
  const enum_1 = require("../enum");
5
5
  exports.SWEDISH_STATES = Object.values(enum_1.SwedishState);
6
+ exports.USER_DELETION_REASONS = Object.values(enum_1.UserDeletionReason);
6
7
  exports.GENDERS = [enum_1.Gender.MALE, enum_1.Gender.FEMALE];
@@ -38,5 +38,6 @@ export declare enum CloudFunction {
38
38
  CREATE_CHECKOUT_SESSION = "stripe/create-checkout-session",
39
39
  REGISTER_ONBOARDING = "user/register-onboarding",
40
40
  UPDATE_USER = "user/update-user",
41
- GET_CURRENT_USER = "user/get-current-user"
41
+ GET_CURRENT_USER = "user/get-current-user",
42
+ DELETE_USER = "user/delete-user"
42
43
  }
@@ -43,4 +43,5 @@ var CloudFunction;
43
43
  CloudFunction["REGISTER_ONBOARDING"] = "user/register-onboarding";
44
44
  CloudFunction["UPDATE_USER"] = "user/update-user";
45
45
  CloudFunction["GET_CURRENT_USER"] = "user/get-current-user";
46
+ CloudFunction["DELETE_USER"] = "user/delete-user";
46
47
  })(CloudFunction || (exports.CloudFunction = CloudFunction = {}));
@@ -21,7 +21,6 @@ export declare enum ConversationCollection {
21
21
  }
22
22
  export declare enum UserCollection {
23
23
  CONVERSATIONS = "conversations",
24
- MESSAGES = "messages",
25
24
  MATCHES = "matches",
26
25
  OUTGOING_LIKES = "outgoing_likes",
27
26
  INCOMING_LIKES = "incoming_likes",
@@ -27,7 +27,6 @@ var ConversationCollection;
27
27
  var UserCollection;
28
28
  (function (UserCollection) {
29
29
  UserCollection["CONVERSATIONS"] = "conversations";
30
- UserCollection["MESSAGES"] = "messages";
31
30
  UserCollection["MATCHES"] = "matches";
32
31
  UserCollection["OUTGOING_LIKES"] = "outgoing_likes";
33
32
  UserCollection["INCOMING_LIKES"] = "incoming_likes";
@@ -12,3 +12,19 @@ export declare enum UserPlan {
12
12
  BASIC = "basic",
13
13
  PREMIUM = "premium"
14
14
  }
15
+ export declare enum UserDeletionReason {
16
+ NO_LONGER_INTERESTED = "no_longer_interested",
17
+ PRIVACY_CONCERNS = "privacy_concerns",
18
+ FOUND_MATCH = "found_match",
19
+ FOUND_MATCH_ELSEWHERE = "found_match_elsewhere",
20
+ TECHNICAL_ISSUES = "technical_issues",
21
+ NEGATIVE_EXPERIENCE = "negative_experience",
22
+ POOR_SELECTION = "poor_selection",
23
+ BAD_MATCHING_ALGORITHM = "bad_matching_algorithm",
24
+ OTHER = "other"
25
+ }
26
+ export declare enum UserDeletionType {
27
+ USER_REQUEST = "user_request",
28
+ BANNED = "banned",
29
+ INACTIVE_PURGE = "inactive_purge"
30
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserPlan = exports.UserClaim = exports.UserLanguage = void 0;
3
+ exports.UserDeletionType = exports.UserDeletionReason = exports.UserPlan = exports.UserClaim = exports.UserLanguage = void 0;
4
4
  var UserLanguage;
5
5
  (function (UserLanguage) {
6
6
  UserLanguage["SWEDISH"] = "sv";
@@ -18,3 +18,21 @@ var UserPlan;
18
18
  UserPlan["BASIC"] = "basic";
19
19
  UserPlan["PREMIUM"] = "premium";
20
20
  })(UserPlan || (exports.UserPlan = UserPlan = {}));
21
+ var UserDeletionReason;
22
+ (function (UserDeletionReason) {
23
+ UserDeletionReason["NO_LONGER_INTERESTED"] = "no_longer_interested";
24
+ UserDeletionReason["PRIVACY_CONCERNS"] = "privacy_concerns";
25
+ UserDeletionReason["FOUND_MATCH"] = "found_match";
26
+ UserDeletionReason["FOUND_MATCH_ELSEWHERE"] = "found_match_elsewhere";
27
+ UserDeletionReason["TECHNICAL_ISSUES"] = "technical_issues";
28
+ UserDeletionReason["NEGATIVE_EXPERIENCE"] = "negative_experience";
29
+ UserDeletionReason["POOR_SELECTION"] = "poor_selection";
30
+ UserDeletionReason["BAD_MATCHING_ALGORITHM"] = "bad_matching_algorithm";
31
+ UserDeletionReason["OTHER"] = "other";
32
+ })(UserDeletionReason || (exports.UserDeletionReason = UserDeletionReason = {}));
33
+ var UserDeletionType;
34
+ (function (UserDeletionType) {
35
+ UserDeletionType["USER_REQUEST"] = "user_request";
36
+ UserDeletionType["BANNED"] = "banned";
37
+ UserDeletionType["INACTIVE_PURGE"] = "inactive_purge";
38
+ })(UserDeletionType || (exports.UserDeletionType = UserDeletionType = {}));
@@ -1,6 +1,6 @@
1
1
  import { CloudFunction } from "../enum";
2
- import { AddImagesRequest, AuthenticateBankIDRequest, CollectBankIDRequest, CreateBillingPortalRequest, CreateCheckoutSessionRequest, CreateLikeRequest, CreatePLSInputRequest, CreatePLSSubmissionRequest, CreateReportRequest, GetCARequest, GetLikesRequest, GetMatchableUserRequest, GetMatchCheckRequest, GetMatchesRequest, GetMatchRequest, GetMessagesRequest, GetPLSScoresRequest, GetPLSSubmissionRequest, GetProductsRequest, GetUserRequest, HandleLastMessageSeenRequest, HandleLikeSeenRequest, HandleMatchSeenRequest, RegisterOnboardingRequest, RegisterUserRequest, RemoveMatchRequest, SendMessageRequest, SubmitAnswerRequest, SubmitCategoryFeedbackRequest, SubmitPLSCategoryFeedbackRequest, SubmitPLSDemographicsRequest, UpdatePLSAnswerRequest, UpdateQuestionsRequest, UpdateUserRequest } from "./request.types";
3
- import { AddImagesResponse, AuthenticateBankIDResponse, CollectBankIDResponse, CreateBillingPortalResponse, CreateCheckoutSessionResponse, CreateLikeResponse, CreatePLSInputResponse, CreatePLSSubmissionResponse, CreateReportResponse, GetCAResponse, GetLikesResponse, GetMatchableUserResponse, GetMatchableUsersResponse, GetMatchCheckResponse, GetMatchesResponse, GetMatchResponse, GetMessagesResponse, GetPLSScoresResponse, GetPLSSubmissionResponse, GetProductsResponse, GetUserResponse, HandleLastMessageSeenResponse, HandleLikeSeenResponse, HandleMatchSeenResponse, RegisterOnboardingResponse, RegisterUserResponse, RemoveMatchResponse, SendMessageResponse, SubmitAnswerResponse, SubmitCategoryFeedbackResponse, SubmitPLSCategoryFeedbackResponse, SubmitPLSDemographicsResponse, UpdatePLSAnswerResponse, UpdateQuestionsResponse, UpdateUserResponse } from "./response.types";
2
+ import { AddImagesRequest, AuthenticateBankIDRequest, CollectBankIDRequest, CreateBillingPortalRequest, CreateCheckoutSessionRequest, CreateLikeRequest, CreatePLSInputRequest, CreatePLSSubmissionRequest, CreateReportRequest, DeleteUserRequest, GetCARequest, GetLikesRequest, GetMatchableUserRequest, GetMatchCheckRequest, GetMatchesRequest, GetMatchRequest, GetMessagesRequest, GetPLSScoresRequest, GetPLSSubmissionRequest, GetProductsRequest, GetUserRequest, HandleLastMessageSeenRequest, HandleLikeSeenRequest, HandleMatchSeenRequest, RegisterOnboardingRequest, RegisterUserRequest, RemoveMatchRequest, SendMessageRequest, SubmitAnswerRequest, SubmitCategoryFeedbackRequest, SubmitPLSCategoryFeedbackRequest, SubmitPLSDemographicsRequest, UpdatePLSAnswerRequest, UpdateQuestionsRequest, UpdateUserRequest } from "./request.types";
3
+ import { AddImagesResponse, AuthenticateBankIDResponse, CollectBankIDResponse, CreateBillingPortalResponse, CreateCheckoutSessionResponse, CreateLikeResponse, CreatePLSInputResponse, CreatePLSSubmissionResponse, CreateReportResponse, DeleteUserResponse, GetCAResponse, GetLikesResponse, GetMatchableUserResponse, GetMatchableUsersResponse, GetMatchCheckResponse, GetMatchesResponse, GetMatchResponse, GetMessagesResponse, GetPLSScoresResponse, GetPLSSubmissionResponse, GetProductsResponse, GetUserResponse, HandleLastMessageSeenResponse, HandleLikeSeenResponse, HandleMatchSeenResponse, RegisterOnboardingResponse, RegisterUserResponse, RemoveMatchResponse, SendMessageResponse, SubmitAnswerResponse, SubmitCategoryFeedbackResponse, SubmitPLSCategoryFeedbackResponse, SubmitPLSDemographicsResponse, UpdatePLSAnswerResponse, UpdateQuestionsResponse, UpdateUserResponse } from "./response.types";
4
4
  export type CloudFunctionTypes = {
5
5
  [CloudFunction.REGISTER_USER]: {
6
6
  payload: RegisterUserRequest;
@@ -142,4 +142,8 @@ export type CloudFunctionTypes = {
142
142
  payload: GetUserRequest;
143
143
  response: GetUserResponse;
144
144
  };
145
+ [CloudFunction.DELETE_USER]: {
146
+ payload: DeleteUserRequest;
147
+ response: DeleteUserResponse;
148
+ };
145
149
  };
@@ -26,5 +26,6 @@ export type UserMatch = {
26
26
  created: string;
27
27
  conversationId: string;
28
28
  initiatedBy: string;
29
+ users: Record<string, boolean>;
29
30
  };
30
31
  export {};
@@ -1,4 +1,4 @@
1
- import { FeedbackAgreement, Gender, LikeType, ProviderType, ReportReason } from "../enum";
1
+ import { FeedbackAgreement, Gender, LikeType, ProviderType, ReportReason, UserDeletionReason } from "../enum";
2
2
  import { DeepPartial } from "./helper.types";
3
3
  import { Answer, Demographics } from "./submission.types";
4
4
  import { DatingPreferences, UserNotifications, UserProfile } from "./user.types";
@@ -133,6 +133,11 @@ export type UpdateUserRequest = {
133
133
  lng: number;
134
134
  };
135
135
  };
136
+ export type DeleteUserRequest = {
137
+ validationPhrase: string;
138
+ deletionReason: UserDeletionReason;
139
+ customDeletionReason?: string;
140
+ };
136
141
  export type GetPLSScoresRequest = undefined;
137
142
  export type AddImagesRequest = {
138
143
  images: string[];
@@ -62,6 +62,7 @@ export type GetProductsResponse = StripeProduct[];
62
62
  export type RegisterOnboardingResponse = User;
63
63
  export type GetUserResponse = User;
64
64
  export type UpdateUserResponse = User;
65
+ export type DeleteUserResponse = void;
65
66
  export type AddImagesResponse = {
66
67
  images: string[];
67
68
  thumbnail: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heartraite",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "Heartraite npm package for common functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,7 @@
1
- import { Gender, SwedishState } from "../enum";
1
+ import { Gender, SwedishState, UserDeletionReason } from "../enum";
2
2
 
3
3
  export const SWEDISH_STATES = Object.values(SwedishState);
4
4
 
5
+ export const USER_DELETION_REASONS = Object.values(UserDeletionReason);
6
+
5
7
  export const GENDERS = [Gender.MALE, Gender.FEMALE];
@@ -39,4 +39,5 @@ export enum CloudFunction {
39
39
  REGISTER_ONBOARDING = "user/register-onboarding",
40
40
  UPDATE_USER = "user/update-user",
41
41
  GET_CURRENT_USER = "user/get-current-user",
42
+ DELETE_USER = "user/delete-user",
42
43
  }
@@ -23,7 +23,6 @@ export enum ConversationCollection {
23
23
 
24
24
  export enum UserCollection {
25
25
  CONVERSATIONS = "conversations",
26
- MESSAGES = "messages",
27
26
  MATCHES = "matches",
28
27
  OUTGOING_LIKES = "outgoing_likes",
29
28
  INCOMING_LIKES = "incoming_likes",
@@ -14,3 +14,21 @@ export enum UserPlan {
14
14
  BASIC = "basic",
15
15
  PREMIUM = "premium",
16
16
  }
17
+
18
+ export enum UserDeletionReason {
19
+ NO_LONGER_INTERESTED = "no_longer_interested",
20
+ PRIVACY_CONCERNS = "privacy_concerns",
21
+ FOUND_MATCH = "found_match",
22
+ FOUND_MATCH_ELSEWHERE = "found_match_elsewhere",
23
+ TECHNICAL_ISSUES = "technical_issues",
24
+ NEGATIVE_EXPERIENCE = "negative_experience",
25
+ POOR_SELECTION = "poor_selection",
26
+ BAD_MATCHING_ALGORITHM = "bad_matching_algorithm",
27
+ OTHER = "other",
28
+ }
29
+
30
+ export enum UserDeletionType {
31
+ USER_REQUEST = "user_request",
32
+ BANNED = "banned",
33
+ INACTIVE_PURGE = "inactive_purge",
34
+ }
@@ -9,6 +9,7 @@ import {
9
9
  CreatePLSInputRequest,
10
10
  CreatePLSSubmissionRequest,
11
11
  CreateReportRequest,
12
+ DeleteUserRequest,
12
13
  GetCARequest,
13
14
  GetLikesRequest,
14
15
  GetMatchableUserRequest,
@@ -45,6 +46,7 @@ import {
45
46
  CreatePLSInputResponse,
46
47
  CreatePLSSubmissionResponse,
47
48
  CreateReportResponse,
49
+ DeleteUserResponse,
48
50
  GetCAResponse,
49
51
  GetLikesResponse,
50
52
  GetMatchableUserResponse,
@@ -240,4 +242,8 @@ export type CloudFunctionTypes = {
240
242
  payload: GetUserRequest;
241
243
  response: GetUserResponse;
242
244
  };
245
+ [CloudFunction.DELETE_USER]: {
246
+ payload: DeleteUserRequest;
247
+ response: DeleteUserResponse;
248
+ };
243
249
  };
@@ -30,4 +30,5 @@ export type UserMatch = {
30
30
  created: string;
31
31
  conversationId: string;
32
32
  initiatedBy: string;
33
+ users: Record<string, boolean>;
33
34
  };
@@ -4,6 +4,7 @@ import {
4
4
  LikeType,
5
5
  ProviderType,
6
6
  ReportReason,
7
+ UserDeletionReason,
7
8
  } from "../enum";
8
9
  import { DeepPartial } from "./helper.types";
9
10
  import { Answer, Demographics } from "./submission.types";
@@ -137,6 +138,11 @@ export type UpdateUserRequest = {
137
138
  >;
138
139
  geoLocation?: { lat: number; lng: number };
139
140
  };
141
+ export type DeleteUserRequest = {
142
+ validationPhrase: string;
143
+ deletionReason: UserDeletionReason;
144
+ customDeletionReason?: string;
145
+ };
140
146
 
141
147
  // score
142
148
  export type GetPLSScoresRequest = undefined;
@@ -83,6 +83,7 @@ export type GetProductsResponse = StripeProduct[];
83
83
  export type RegisterOnboardingResponse = User;
84
84
  export type GetUserResponse = User;
85
85
  export type UpdateUserResponse = User;
86
+ export type DeleteUserResponse = void;
86
87
 
87
88
  // storage
88
89
  export type AddImagesResponse = {