heartraite 1.0.1 → 1.0.3

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 (61) hide show
  1. package/dist/enum/ai-verification-status.enum.d.ts +6 -0
  2. package/dist/enum/ai-verification-status.enum.js +10 -0
  3. package/dist/enum/app-route.enum.d.ts +30 -0
  4. package/dist/enum/app-route.enum.js +34 -0
  5. package/dist/enum/cloudfunction.enum.d.ts +34 -0
  6. package/dist/enum/cloudfunction.enum.js +38 -0
  7. package/dist/enum/evaluation.enum.d.ts +6 -0
  8. package/dist/enum/evaluation.enum.js +10 -0
  9. package/dist/enum/gender.enum.d.ts +4 -0
  10. package/dist/enum/gender.enum.js +8 -0
  11. package/dist/enum/index.d.ts +9 -0
  12. package/dist/enum/index.js +25 -0
  13. package/dist/enum/like.enum.d.ts +6 -0
  14. package/dist/enum/like.enum.js +10 -0
  15. package/dist/enum/match.enum.d.ts +6 -0
  16. package/dist/enum/match.enum.js +10 -0
  17. package/dist/enum/provider.enum.d.ts +5 -0
  18. package/dist/enum/provider.enum.js +9 -0
  19. package/dist/enum/report.enum.d.ts +11 -0
  20. package/dist/enum/report.enum.js +16 -0
  21. package/dist/firebase/function.caller.d.ts +9 -0
  22. package/dist/firebase/function.caller.js +11 -0
  23. package/dist/firebase/index.d.ts +1 -0
  24. package/dist/firebase/index.js +17 -0
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.js +19 -0
  27. package/dist/types/assessment.types.d.ts +11 -0
  28. package/dist/types/assessment.types.js +2 -0
  29. package/dist/types/cloud-function-types.d.ts +129 -0
  30. package/dist/types/cloud-function-types.js +3 -0
  31. package/dist/types/index.d.ts +12 -0
  32. package/dist/types/index.js +28 -0
  33. package/dist/types/like.types.d.ts +8 -0
  34. package/dist/types/like.types.js +2 -0
  35. package/dist/types/match.types.d.ts +68 -0
  36. package/dist/types/match.types.js +2 -0
  37. package/dist/types/message.types.d.ts +9 -0
  38. package/dist/types/message.types.js +2 -0
  39. package/dist/types/pls.types.d.ts +8 -0
  40. package/dist/types/pls.types.js +2 -0
  41. package/dist/types/rating.types.d.ts +1 -0
  42. package/dist/types/rating.types.js +2 -0
  43. package/dist/types/report.types.d.ts +11 -0
  44. package/dist/types/report.types.js +2 -0
  45. package/dist/types/request.types.d.ts +101 -0
  46. package/dist/types/request.types.js +2 -0
  47. package/dist/types/response.types.d.ts +64 -0
  48. package/dist/types/response.types.js +2 -0
  49. package/dist/types/stripe.types.d.ts +8 -0
  50. package/dist/types/stripe.types.js +2 -0
  51. package/dist/types/submission.types.d.ts +27 -0
  52. package/dist/types/submission.types.js +2 -0
  53. package/dist/types/user.types.d.ts +42 -0
  54. package/dist/types/user.types.js +50 -0
  55. package/package.json +5 -4
  56. package/src/enum/cloudfunction.enum.ts +1 -1
  57. package/src/enum/index.ts +1 -0
  58. package/src/enum/provider.enum.ts +5 -0
  59. package/src/types/cloud-function-types.ts +5 -4
  60. package/src/types/request.types.ts +0 -2
  61. package/src/types/user.types.ts +0 -27
@@ -0,0 +1,6 @@
1
+ export declare enum AiVerificationStatus {
2
+ PENDING = "pending",
3
+ ERROR = "error",
4
+ SUCCESS = "success",
5
+ ACTION_REQUIRED = "action required"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AiVerificationStatus = void 0;
4
+ var AiVerificationStatus;
5
+ (function (AiVerificationStatus) {
6
+ AiVerificationStatus["PENDING"] = "pending";
7
+ AiVerificationStatus["ERROR"] = "error";
8
+ AiVerificationStatus["SUCCESS"] = "success";
9
+ AiVerificationStatus["ACTION_REQUIRED"] = "action required";
10
+ })(AiVerificationStatus || (exports.AiVerificationStatus = AiVerificationStatus = {}));
@@ -0,0 +1,30 @@
1
+ export declare enum AppRoute {
2
+ START = "start",
3
+ LOGIN = "login",
4
+ REGISTER = "register",
5
+ DISCOVER = "discover",
6
+ PROFILE = "profile",
7
+ MATCH = "match",
8
+ MESSAGES = "messages",
9
+ MATCHES = "matches",
10
+ SETTINGS = "settings",
11
+ ACOUNT_SETTINGS = "account_settings",
12
+ MATCH_SETTINGS = "match_settings",
13
+ MEMBERSHIP = "membership",
14
+ USER_PROFILE = "user_profile",
15
+ BLOG = "blog",
16
+ QUESTIONS = "questions",
17
+ CHAT = "chat",
18
+ SUBSCRIPTIONS = "membership",
19
+ NOTIFICATIONS = "notifications",
20
+ QUESTION = "question",
21
+ IMAGES = "images",
22
+ IMAGES_MODAL = "image_modal",
23
+ ADVANCED_MATCH = "advanced_match",
24
+ SUPPORT = "common_questions",
25
+ IMAGE_MODAL_REGISTRATION = "image_modal_registration",
26
+ GENERAL = "general",
27
+ MATCH_SCANNER = "match_scanner",
28
+ MATCH_CHECK = "match_check",
29
+ PROFILE_INPUT = "profile_input"
30
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppRoute = void 0;
4
+ var AppRoute;
5
+ (function (AppRoute) {
6
+ AppRoute["START"] = "start";
7
+ AppRoute["LOGIN"] = "login";
8
+ AppRoute["REGISTER"] = "register";
9
+ AppRoute["DISCOVER"] = "discover";
10
+ AppRoute["PROFILE"] = "profile";
11
+ AppRoute["MATCH"] = "match";
12
+ AppRoute["MESSAGES"] = "messages";
13
+ AppRoute["MATCHES"] = "matches";
14
+ AppRoute["SETTINGS"] = "settings";
15
+ AppRoute["ACOUNT_SETTINGS"] = "account_settings";
16
+ AppRoute["MATCH_SETTINGS"] = "match_settings";
17
+ AppRoute["MEMBERSHIP"] = "membership";
18
+ AppRoute["USER_PROFILE"] = "user_profile";
19
+ AppRoute["BLOG"] = "blog";
20
+ AppRoute["QUESTIONS"] = "questions";
21
+ AppRoute["CHAT"] = "chat";
22
+ AppRoute["SUBSCRIPTIONS"] = "membership";
23
+ AppRoute["NOTIFICATIONS"] = "notifications";
24
+ AppRoute["QUESTION"] = "question";
25
+ AppRoute["IMAGES"] = "images";
26
+ AppRoute["IMAGES_MODAL"] = "image_modal";
27
+ AppRoute["ADVANCED_MATCH"] = "advanced_match";
28
+ AppRoute["SUPPORT"] = "common_questions";
29
+ AppRoute["IMAGE_MODAL_REGISTRATION"] = "image_modal_registration";
30
+ AppRoute["GENERAL"] = "general";
31
+ AppRoute["MATCH_SCANNER"] = "match_scanner";
32
+ AppRoute["MATCH_CHECK"] = "match_check";
33
+ AppRoute["PROFILE_INPUT"] = "profile_input";
34
+ })(AppRoute || (exports.AppRoute = AppRoute = {}));
@@ -0,0 +1,34 @@
1
+ export declare enum CloudFunction {
2
+ CREATE_ASSESSMENT = "assessment/create-assessment",
3
+ GET_ASSESSMENT = "assessment/get-assessment",
4
+ GET_ASSESSMENTS = "assessment/get-assessments",
5
+ CREATE_SUBMISSION = "assessment/create-submission",
6
+ GET_SUBMISSION = "assessment/get-submission",
7
+ UPDATE_ANSWER = "assessment/update-answer",
8
+ SUBMIT_CATEGORY_FEEDBACK = "assessment/submit-category-feedback",
9
+ REGISTER_USER = "auth/register-user",
10
+ AUTHENTICATE_BANKID = "bankid/authenticate",
11
+ COLLECT_BANKID = "bankid/collect",
12
+ CREATE_LIKE = "like/create-like",
13
+ GET_LIKES = "like/get-likes",
14
+ HANDLE_LIKE_SEEN = "like/handle-like-seen",
15
+ GET_MATCH = "match/get-match",
16
+ HANDLE_MATCH_SEEN = "match/handle-match-seen",
17
+ GET_MATCHES = "match/get-matches",
18
+ GET_MATCH_CHECK = "match/get-match-check",
19
+ REMOVE_MATCH = "match/remove-match",
20
+ GET_MATCHABLE_USER = "match/get-matchable-user",
21
+ GET_MATCHABLE_USERS = "match/get-matchable-users",
22
+ SEND_MESSAGE = "message/send-message",
23
+ GET_MESSAGES = "message/get-messages",
24
+ CREATE_PLS = "pls/create-pls",
25
+ UPDATE_QUESTIONS = "rating/update-quesitons",
26
+ CREATE_REPORT = "report/create-report",
27
+ ADD_IMAGES = "storage/add-images",
28
+ GET_PRODUCTS = "stripe/get-products",
29
+ STRIPE_WEBWOOK = "stripe/webhook",
30
+ CREATE_BILLING_PORTAL = "stripe/create-billing-portal",
31
+ CREATE_CHECKOUT_SESSION = "stripe/create-checkout-session",
32
+ UPDATE_USER = "user/update-user",
33
+ GET_CURRENT_USER = "user/get-current-user"
34
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CloudFunction = void 0;
4
+ var CloudFunction;
5
+ (function (CloudFunction) {
6
+ CloudFunction["CREATE_ASSESSMENT"] = "assessment/create-assessment";
7
+ CloudFunction["GET_ASSESSMENT"] = "assessment/get-assessment";
8
+ CloudFunction["GET_ASSESSMENTS"] = "assessment/get-assessments";
9
+ CloudFunction["CREATE_SUBMISSION"] = "assessment/create-submission";
10
+ CloudFunction["GET_SUBMISSION"] = "assessment/get-submission";
11
+ CloudFunction["UPDATE_ANSWER"] = "assessment/update-answer";
12
+ CloudFunction["SUBMIT_CATEGORY_FEEDBACK"] = "assessment/submit-category-feedback";
13
+ CloudFunction["REGISTER_USER"] = "auth/register-user";
14
+ CloudFunction["AUTHENTICATE_BANKID"] = "bankid/authenticate";
15
+ CloudFunction["COLLECT_BANKID"] = "bankid/collect";
16
+ CloudFunction["CREATE_LIKE"] = "like/create-like";
17
+ CloudFunction["GET_LIKES"] = "like/get-likes";
18
+ CloudFunction["HANDLE_LIKE_SEEN"] = "like/handle-like-seen";
19
+ CloudFunction["GET_MATCH"] = "match/get-match";
20
+ CloudFunction["HANDLE_MATCH_SEEN"] = "match/handle-match-seen";
21
+ CloudFunction["GET_MATCHES"] = "match/get-matches";
22
+ CloudFunction["GET_MATCH_CHECK"] = "match/get-match-check";
23
+ CloudFunction["REMOVE_MATCH"] = "match/remove-match";
24
+ CloudFunction["GET_MATCHABLE_USER"] = "match/get-matchable-user";
25
+ CloudFunction["GET_MATCHABLE_USERS"] = "match/get-matchable-users";
26
+ CloudFunction["SEND_MESSAGE"] = "message/send-message";
27
+ CloudFunction["GET_MESSAGES"] = "message/get-messages";
28
+ CloudFunction["CREATE_PLS"] = "pls/create-pls";
29
+ CloudFunction["UPDATE_QUESTIONS"] = "rating/update-quesitons";
30
+ CloudFunction["CREATE_REPORT"] = "report/create-report";
31
+ CloudFunction["ADD_IMAGES"] = "storage/add-images";
32
+ CloudFunction["GET_PRODUCTS"] = "stripe/get-products";
33
+ CloudFunction["STRIPE_WEBWOOK"] = "stripe/webhook";
34
+ CloudFunction["CREATE_BILLING_PORTAL"] = "stripe/create-billing-portal";
35
+ CloudFunction["CREATE_CHECKOUT_SESSION"] = "stripe/create-checkout-session";
36
+ CloudFunction["UPDATE_USER"] = "user/update-user";
37
+ CloudFunction["GET_CURRENT_USER"] = "user/get-current-user";
38
+ })(CloudFunction || (exports.CloudFunction = CloudFunction = {}));
@@ -0,0 +1,6 @@
1
+ export declare enum FeedbackAgreement {
2
+ YES = "yes",
3
+ NO = "no",
4
+ PARTIAL = "partial",
5
+ UNKNOWN = "unknown"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FeedbackAgreement = void 0;
4
+ var FeedbackAgreement;
5
+ (function (FeedbackAgreement) {
6
+ FeedbackAgreement["YES"] = "yes";
7
+ FeedbackAgreement["NO"] = "no";
8
+ FeedbackAgreement["PARTIAL"] = "partial";
9
+ FeedbackAgreement["UNKNOWN"] = "unknown";
10
+ })(FeedbackAgreement || (exports.FeedbackAgreement = FeedbackAgreement = {}));
@@ -0,0 +1,4 @@
1
+ export declare enum Gender {
2
+ MALE = "male",
3
+ FEMALE = "female"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Gender = void 0;
4
+ var Gender;
5
+ (function (Gender) {
6
+ Gender["MALE"] = "male";
7
+ Gender["FEMALE"] = "female";
8
+ })(Gender || (exports.Gender = Gender = {}));
@@ -0,0 +1,9 @@
1
+ export * from "./cloudfunction.enum";
2
+ export * from "./like.enum";
3
+ export * from "./match.enum";
4
+ export * from "./app-route.enum";
5
+ export * from "./ai-verification-status.enum";
6
+ export * from "./evaluation.enum";
7
+ export * from "./report.enum";
8
+ export * from "./gender.enum";
9
+ export * from "./provider.enum";
@@ -0,0 +1,25 @@
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("./cloudfunction.enum"), exports);
18
+ __exportStar(require("./like.enum"), exports);
19
+ __exportStar(require("./match.enum"), exports);
20
+ __exportStar(require("./app-route.enum"), exports);
21
+ __exportStar(require("./ai-verification-status.enum"), exports);
22
+ __exportStar(require("./evaluation.enum"), exports);
23
+ __exportStar(require("./report.enum"), exports);
24
+ __exportStar(require("./gender.enum"), exports);
25
+ __exportStar(require("./provider.enum"), exports);
@@ -0,0 +1,6 @@
1
+ export declare enum LikeType {
2
+ LIKE = "like",
3
+ DISLIKE = "dislike",
4
+ PULSE = "pulse",
5
+ REVERTED = "reverted"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LikeType = void 0;
4
+ var LikeType;
5
+ (function (LikeType) {
6
+ LikeType["LIKE"] = "like";
7
+ LikeType["DISLIKE"] = "dislike";
8
+ LikeType["PULSE"] = "pulse";
9
+ LikeType["REVERTED"] = "reverted";
10
+ })(LikeType || (exports.LikeType = LikeType = {}));
@@ -0,0 +1,6 @@
1
+ export declare enum AdvancedMatchStatus {
2
+ INITIAL = "initial",
3
+ LOADING = "loading",
4
+ ERROR = "error",
5
+ SUCCESS = "success"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdvancedMatchStatus = void 0;
4
+ var AdvancedMatchStatus;
5
+ (function (AdvancedMatchStatus) {
6
+ AdvancedMatchStatus["INITIAL"] = "initial";
7
+ AdvancedMatchStatus["LOADING"] = "loading";
8
+ AdvancedMatchStatus["ERROR"] = "error";
9
+ AdvancedMatchStatus["SUCCESS"] = "success";
10
+ })(AdvancedMatchStatus || (exports.AdvancedMatchStatus = AdvancedMatchStatus = {}));
@@ -0,0 +1,5 @@
1
+ export declare enum ProviderType {
2
+ PASSWORD = "password",
3
+ GOOGLE = "google.com",
4
+ FACEBOOK = "facebook.com"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProviderType = void 0;
4
+ var ProviderType;
5
+ (function (ProviderType) {
6
+ ProviderType["PASSWORD"] = "password";
7
+ ProviderType["GOOGLE"] = "google.com";
8
+ ProviderType["FACEBOOK"] = "facebook.com";
9
+ })(ProviderType || (exports.ProviderType = ProviderType = {}));
@@ -0,0 +1,11 @@
1
+ export declare enum ReportReason {
2
+ OFFENSIVE_CONTENT = "offensive_content",
3
+ FAKE_PROFILE = "fake_profile",
4
+ INAPPROPRIATE_MESSAGES = "inappropriate_messages",
5
+ UNDER_AGED = "underaged",
6
+ OTHER = "other"
7
+ }
8
+ export declare enum ReportStatus {
9
+ UNRESOLVED = "unresolved",
10
+ RESOLVED = "resolved"
11
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportStatus = exports.ReportReason = void 0;
4
+ var ReportReason;
5
+ (function (ReportReason) {
6
+ ReportReason["OFFENSIVE_CONTENT"] = "offensive_content";
7
+ ReportReason["FAKE_PROFILE"] = "fake_profile";
8
+ ReportReason["INAPPROPRIATE_MESSAGES"] = "inappropriate_messages";
9
+ ReportReason["UNDER_AGED"] = "underaged";
10
+ ReportReason["OTHER"] = "other";
11
+ })(ReportReason || (exports.ReportReason = ReportReason = {}));
12
+ var ReportStatus;
13
+ (function (ReportStatus) {
14
+ ReportStatus["UNRESOLVED"] = "unresolved";
15
+ ReportStatus["RESOLVED"] = "resolved";
16
+ })(ReportStatus || (exports.ReportStatus = ReportStatus = {}));
@@ -0,0 +1,9 @@
1
+ import { Functions } from "firebase/functions";
2
+ import { CloudFunctionTypes } from "../types";
3
+ interface Params<T extends keyof CloudFunctionTypes> {
4
+ functionName: T;
5
+ functions: Functions;
6
+ payload?: CloudFunctionTypes[T]["payload"];
7
+ }
8
+ export declare const callCloudFunction: <T extends keyof CloudFunctionTypes>({ payload, functions, functionName, }: Params<T>) => Promise<CloudFunctionTypes[T]["response"]>;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.callCloudFunction = void 0;
4
+ const functions_1 = require("firebase/functions");
5
+ // Generic function to call any Firebase Cloud Function
6
+ const callCloudFunction = async ({ payload, functions, functionName, }) => {
7
+ const fn = (0, functions_1.httpsCallable)(functions, functionName);
8
+ const res = payload ? await fn(payload) : await fn();
9
+ return res.data;
10
+ };
11
+ exports.callCloudFunction = callCloudFunction;
@@ -0,0 +1 @@
1
+ export * from "./function.caller";
@@ -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("./function.caller"), exports);
@@ -0,0 +1,3 @@
1
+ export * from "./enum";
2
+ export * from "./firebase";
3
+ export * from "./types";
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
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("./enum"), exports);
18
+ __exportStar(require("./firebase"), exports);
19
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,11 @@
1
+ import { Submission } from "./submission.types";
2
+ export type Assessment = {
3
+ id: string;
4
+ created: string;
5
+ createdBy: string;
6
+ intimateTopics: boolean;
7
+ version: string;
8
+ };
9
+ export type FullAssessment = Assessment & {
10
+ submissions: Submission[];
11
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,129 @@
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";
4
+ export type CloudFunctionTypes = {
5
+ [CloudFunction.CREATE_ASSESSMENT]: {
6
+ payload: CreateAssessmentRequest;
7
+ response: CreateAssessmentResponse;
8
+ };
9
+ [CloudFunction.GET_ASSESSMENT]: {
10
+ payload: GetAssessmentRequest;
11
+ response: GetAssessmentResponse;
12
+ };
13
+ [CloudFunction.GET_ASSESSMENTS]: {
14
+ payload?: undefined;
15
+ response: GetAssessmentsResponse;
16
+ };
17
+ [CloudFunction.REGISTER_USER]: {
18
+ payload: RegisterUserRequest;
19
+ response: RegisterUserResponse;
20
+ };
21
+ [CloudFunction.CREATE_SUBMISSION]: {
22
+ payload: CreateSubmissionRequest;
23
+ response: CreateSubmissionResponse;
24
+ };
25
+ [CloudFunction.GET_SUBMISSION]: {
26
+ payload: GetSubmissionRequest;
27
+ response: GetSubmissionResponse;
28
+ };
29
+ [CloudFunction.UPDATE_ANSWER]: {
30
+ payload: UpdateAnswerRequest;
31
+ response: UpdateAnswerResponse;
32
+ };
33
+ [CloudFunction.SUBMIT_CATEGORY_FEEDBACK]: {
34
+ payload: SubmitCategoryFeedbackRequest;
35
+ response: SubmitCategoryFeedbackResponse;
36
+ };
37
+ [CloudFunction.AUTHENTICATE_BANKID]: {
38
+ payload: AuthenticateBankIDRequest;
39
+ response: AuthenticateBankIDResponse;
40
+ };
41
+ [CloudFunction.COLLECT_BANKID]: {
42
+ payload: CollectBankIDRequest;
43
+ response: CollectBankIDResponse;
44
+ };
45
+ [CloudFunction.CREATE_LIKE]: {
46
+ payload: CreateLikeRequest;
47
+ response: CreateLikeResponse;
48
+ };
49
+ [CloudFunction.GET_LIKES]: {
50
+ payload: CreateLikeRequest;
51
+ response: CreateLikeResponse;
52
+ };
53
+ [CloudFunction.HANDLE_LIKE_SEEN]: {
54
+ payload: HandleLikeSeenRequest;
55
+ response: HandleLikeSeenResponse;
56
+ };
57
+ [CloudFunction.GET_MATCH]: {
58
+ payload: GetMatchRequest;
59
+ response: GetMatchResponse;
60
+ };
61
+ [CloudFunction.HANDLE_MATCH_SEEN]: {
62
+ payload: HandleMatchSeenRequest;
63
+ response: HandleMatchSeenResponse;
64
+ };
65
+ [CloudFunction.GET_MATCHES]: {
66
+ payload: GetMatchesRequest;
67
+ response: GetMatchesResponse;
68
+ };
69
+ [CloudFunction.GET_MATCH_CHECK]: {
70
+ payload: GetMatchCheckRequest;
71
+ response: GetMatchCheckResponse;
72
+ };
73
+ [CloudFunction.REMOVE_MATCH]: {
74
+ payload: RemoveMatchRequest;
75
+ response: RemoveMatchResponse;
76
+ };
77
+ [CloudFunction.GET_MATCHABLE_USER]: {
78
+ payload: GetMatchableUserRequest;
79
+ response: GetMatchableUserResponse;
80
+ };
81
+ [CloudFunction.GET_MATCHABLE_USERS]: {
82
+ payload: GetMatchableUsersResponse;
83
+ response: GetMatchableUsersResponse;
84
+ };
85
+ [CloudFunction.SEND_MESSAGE]: {
86
+ payload: SendMessageRequest;
87
+ response: SendMessageResponse;
88
+ };
89
+ [CloudFunction.GET_MESSAGES]: {
90
+ payload: GetMessagesRequest;
91
+ response: GetMessagesResponse;
92
+ };
93
+ [CloudFunction.CREATE_PLS]: {
94
+ payload: CreatePLSRequest;
95
+ response: CreatePLSResponse;
96
+ };
97
+ [CloudFunction.UPDATE_QUESTIONS]: {
98
+ payload: UpdateQuestionsRequest;
99
+ response: UpdateQuestionsResponse;
100
+ };
101
+ [CloudFunction.CREATE_REPORT]: {
102
+ payload: CreateReportRequest;
103
+ response: CreateReportResponse;
104
+ };
105
+ [CloudFunction.ADD_IMAGES]: {
106
+ payload: AddImagesRequest;
107
+ response: AddImagesResponse;
108
+ };
109
+ [CloudFunction.GET_PRODUCTS]: {
110
+ payload: GetProductsRequest;
111
+ response: GetProductsResponse;
112
+ };
113
+ [CloudFunction.CREATE_BILLING_PORTAL]: {
114
+ payload: CreateBillingPortalRequest;
115
+ response: CreateBillingPortalResponse;
116
+ };
117
+ [CloudFunction.CREATE_CHECKOUT_SESSION]: {
118
+ payload: CreateCheckoutSessionRequest;
119
+ response: CreateCheckoutSessionResponse;
120
+ };
121
+ [CloudFunction.UPDATE_USER]: {
122
+ payload: UpdateUserRequest;
123
+ response: UpdateUserResponse;
124
+ };
125
+ [CloudFunction.GET_CURRENT_USER]: {
126
+ payload: GetUserRequest;
127
+ response: GetUserResponse;
128
+ };
129
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const enum_1 = require("../enum");
@@ -0,0 +1,12 @@
1
+ export * from "./assessment.types";
2
+ export * from "./cloud-function-types";
3
+ export * from "./like.types";
4
+ export * from "./match.types";
5
+ export * from "./message.types";
6
+ export * from "./request.types";
7
+ export * from "./report.types";
8
+ export * from "./response.types";
9
+ export * from "./pls.types";
10
+ export * from "./stripe.types";
11
+ export * from "./submission.types";
12
+ export * from "./user.types";
@@ -0,0 +1,28 @@
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("./assessment.types"), exports);
18
+ __exportStar(require("./cloud-function-types"), exports);
19
+ __exportStar(require("./like.types"), exports);
20
+ __exportStar(require("./match.types"), exports);
21
+ __exportStar(require("./message.types"), exports);
22
+ __exportStar(require("./request.types"), exports);
23
+ __exportStar(require("./report.types"), exports);
24
+ __exportStar(require("./response.types"), exports);
25
+ __exportStar(require("./pls.types"), exports);
26
+ __exportStar(require("./stripe.types"), exports);
27
+ __exportStar(require("./submission.types"), exports);
28
+ __exportStar(require("./user.types"), exports);
@@ -0,0 +1,8 @@
1
+ import { LikeType } from "../enum";
2
+ export type Like = {
3
+ userId: string;
4
+ thumbnailBlurred?: string;
5
+ seen: boolean;
6
+ created: string;
7
+ type: LikeType;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,68 @@
1
+ import { LikeType } from "../enum";
2
+ import { AdvancedMatchStatus } from "../enum/match.enum";
3
+ import { RatedQuestions } from "./rating.types";
4
+ export type Match = {
5
+ id: string;
6
+ users: Record<string, boolean>;
7
+ created: string;
8
+ percentages: RatedQuestions;
9
+ totalPercentage: number;
10
+ conversationId: string;
11
+ advancedMatchStatus: AdvancedMatchStatus;
12
+ advancedMatch?: AdvancedMatch;
13
+ };
14
+ interface StrengthOrWeakness {
15
+ title: string;
16
+ summary: string;
17
+ }
18
+ export type AdvancedMatch = {
19
+ strengths: StrengthOrWeakness[];
20
+ weaknesses: StrengthOrWeakness[];
21
+ summary: string;
22
+ };
23
+ export type UserData = {
24
+ id: string;
25
+ intro: string;
26
+ firstName: string;
27
+ state: string;
28
+ birth: string;
29
+ gender: string;
30
+ distance: number;
31
+ interestedIn: string;
32
+ zodiacSign: string;
33
+ images: string[];
34
+ profileInput: Record<string, string>;
35
+ aiSummary?: string;
36
+ thumbnail: string;
37
+ image: string;
38
+ bankIDVerified: boolean;
39
+ };
40
+ export type MatchableUser = {
41
+ user: UserData;
42
+ percentages: RatedQuestions;
43
+ totalPercentage: number;
44
+ isMatch: boolean;
45
+ likeType?: LikeType;
46
+ isWildcard: boolean;
47
+ matchId?: string;
48
+ conversationId?: string;
49
+ advancedMatchStatus?: AdvancedMatchStatus;
50
+ };
51
+ export type MatchCheck = {
52
+ user: UserData;
53
+ percentages: RatedQuestions;
54
+ totalPercentage: number;
55
+ };
56
+ export type UserQuestions = {
57
+ questions: Record<string, string>;
58
+ invalidQuestions: string[];
59
+ favoriteQuestions: string[];
60
+ };
61
+ export type UserMatch = {
62
+ matchId: string;
63
+ userId: string;
64
+ seen: boolean;
65
+ created: string;
66
+ conversationId: string;
67
+ };
68
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export type Message = {
2
+ id: string;
3
+ conversationId: string;
4
+ recipient: string;
5
+ sender: string;
6
+ message: string;
7
+ created: string;
8
+ delivered: boolean;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export type PLS = {
2
+ id: string;
3
+ questionnaire: Record<string, string>;
4
+ channelId: string;
5
+ channel: string;
6
+ variation: string;
7
+ created: string;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type RatedQuestions = Record<string, number>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { ReportReason, ReportStatus } from "../enum";
2
+ export type Report = {
3
+ id: string;
4
+ reporterId: string;
5
+ reportedUserId: string;
6
+ reason: ReportReason;
7
+ description?: string;
8
+ status: ReportStatus;
9
+ resolvedBy?: string;
10
+ created: string;
11
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,101 @@
1
+ import { FeedbackAgreement, LikeType, ReportReason } from "../enum";
2
+ import { Answer } from "./submission.types";
3
+ export type CreateAssessmentRequest = {
4
+ intimateTopics: boolean;
5
+ };
6
+ export type GetAssessmentRequest = {
7
+ id: string;
8
+ };
9
+ export type CreateSubmissionRequest = {
10
+ assessmentId: string;
11
+ };
12
+ export type GetSubmissionRequest = {
13
+ assessmentId: string;
14
+ submissionId: string;
15
+ };
16
+ export type UpdateAnswerRequest = {
17
+ assessmentId: string;
18
+ submissionId: string;
19
+ categoryId: string;
20
+ answer: Answer;
21
+ };
22
+ export type SubmitCategoryFeedbackRequest = {
23
+ assessmentId: string;
24
+ submissionId: string;
25
+ categoryId: string;
26
+ agreement: FeedbackAgreement;
27
+ evaluationReflection: string;
28
+ additionalThoughts: string;
29
+ };
30
+ export type AuthenticateBankIDRequest = undefined;
31
+ export type CollectBankIDRequest = {
32
+ orderRef: string;
33
+ };
34
+ export type SendMessageRequest = {
35
+ conversationId: string;
36
+ messageId: string;
37
+ message: string;
38
+ };
39
+ export type GetMessagesRequest = {
40
+ conversationId: string;
41
+ limit: number;
42
+ offset: string;
43
+ };
44
+ export type CreateLikeRequest = {
45
+ recipientId: string;
46
+ type: LikeType;
47
+ };
48
+ export type GetLikesRequest = {
49
+ limit: number;
50
+ offset: string;
51
+ };
52
+ export type HandleLikeSeenRequest = {
53
+ userId: string;
54
+ };
55
+ export type RemoveMatchRequest = {
56
+ recipientId: string;
57
+ };
58
+ export type GetMatchRequest = {
59
+ matchId: string;
60
+ };
61
+ export type HandleMatchSeenRequest = {
62
+ userId: string;
63
+ };
64
+ export type GetMatchesRequest = {
65
+ limit: number;
66
+ offset: string;
67
+ };
68
+ export type GetMatchableUserRequest = {
69
+ userId: string;
70
+ };
71
+ export type GetMatchCheckRequest = {
72
+ userId: string;
73
+ };
74
+ export type CreatePLSRequest = {
75
+ questionnaire: Record<string, string>;
76
+ channelId: string;
77
+ variation: string;
78
+ };
79
+ export type UpdateQuestionsRequest = {
80
+ questions: Record<string, string>;
81
+ };
82
+ export type CreateReportRequest = {
83
+ reportedUserId: string;
84
+ reason: ReportReason;
85
+ description?: string;
86
+ };
87
+ export type CreateCheckoutSessionRequest = {
88
+ priceId: string;
89
+ };
90
+ export type RegisterUserRequest = {
91
+ email: string;
92
+ password: string;
93
+ referrerId?: string;
94
+ };
95
+ export type GetUserRequest = undefined;
96
+ export type UpdateUserRequest = Partial<any>;
97
+ export type AddImagesRequest = {
98
+ images: string[];
99
+ };
100
+ export type GetProductsRequest = undefined;
101
+ export type CreateBillingPortalRequest = undefined;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,64 @@
1
+ import { Assessment, FullAssessment } from "./assessment.types";
2
+ import { Submission, CategoryEvaluation } from "./submission.types";
3
+ import { Match, MatchableUser, MatchCheck, UserMatch } from "./match.types";
4
+ import { Message } from "./message.types";
5
+ import { StripeProduct } from "./stripe.types";
6
+ import { User } from "./user.types";
7
+ import { Like } from "./like.types";
8
+ export type CreateAssessmentResponse = Assessment;
9
+ export type GetAssessmentResponse = Assessment;
10
+ export type GetAssessmentsResponse = FullAssessment[];
11
+ export type CreateSubmissionResponse = Submission;
12
+ export type GetSubmissionResponse = Submission;
13
+ export type UpdateAnswerResponse = {
14
+ submission: Submission;
15
+ categoryEvaluation?: CategoryEvaluation;
16
+ };
17
+ export type SubmitCategoryFeedbackResponse = CategoryEvaluation;
18
+ export type AuthenticateBankIDResponse = {
19
+ orderRef: string;
20
+ qrStartToken: string;
21
+ autoStartToken: string;
22
+ };
23
+ export interface CollectBankIDResponse {
24
+ orderRef: string;
25
+ status: "pending" | "complete" | "failed";
26
+ qrCode?: string;
27
+ hintCode?: string;
28
+ }
29
+ export type SendMessageResponse = Message;
30
+ export type GetMessagesResponse = Message[];
31
+ export type HandleLikeResponse = boolean;
32
+ export type RemoveMatchResponse = void;
33
+ export type GetMatchResponse = Match;
34
+ export type HandleMatchSeenResponse = void;
35
+ export type GetMatchesResponse = UserMatch[];
36
+ export type GetMatchableUserResponse = MatchableUser;
37
+ export type GetMatchableUsersResponse = MatchableUser[];
38
+ export type CreateLikeResponse = {
39
+ isMatch: boolean;
40
+ };
41
+ export type GetLikesResponse = Like[];
42
+ export type HandleLikeSeenResponse = void;
43
+ export type CreatePLSResponse = void;
44
+ export type UpdateQuestionsResponse = void;
45
+ export type CreateReportResponse = void;
46
+ export type CreateBillingPortalResponse = {
47
+ url: string;
48
+ };
49
+ export type CreateCheckoutSessionResponse = {
50
+ url: string;
51
+ };
52
+ export type GetProductsResponse = StripeProduct[];
53
+ export type RegisterUserResponse = {
54
+ success: boolean;
55
+ message: string;
56
+ };
57
+ export type GetUserResponse = User;
58
+ export type UpdateUserResponse = User;
59
+ export type AddImagesResponse = {
60
+ images: string[];
61
+ thumbnail: string;
62
+ };
63
+ export type CancelBankIDResponse = void;
64
+ export type GetMatchCheckResponse = MatchCheck;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export type StripeProduct = {
2
+ id: string;
3
+ title: string;
4
+ description: string | null;
5
+ price: number | null;
6
+ priceId: string;
7
+ interval: string | null;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,27 @@
1
+ import { FeedbackAgreement } from "../enum";
2
+ type QuestionId = string;
3
+ type CategoryId = string;
4
+ export type Submission = {
5
+ id: string;
6
+ assessmentId: string;
7
+ introductionSeen: boolean;
8
+ answers: Record<QuestionId, Answer>;
9
+ categoryEvaluations: Record<CategoryId, CategoryEvaluation>;
10
+ lastUpdated: string;
11
+ created: string;
12
+ };
13
+ export type Answer = {
14
+ questionId: string;
15
+ answer: string | null;
16
+ elaboration?: string;
17
+ skipped: boolean;
18
+ reason: string | null;
19
+ };
20
+ export type CategoryEvaluation = {
21
+ categoryId: string;
22
+ aiSummary: string;
23
+ agreement: FeedbackAgreement | null;
24
+ evaluationReflection: string | null;
25
+ additionalThoughts: string | null;
26
+ };
27
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,42 @@
1
+ import { Gender } from "../enum";
2
+ export type User = {
3
+ id: string;
4
+ email: string;
5
+ bankIDVerified: boolean;
6
+ registrationReferralAllowed: boolean;
7
+ profile: Profile;
8
+ preferences: DatingPreferences;
9
+ notifications: UserNotifications;
10
+ };
11
+ export type Profile = {
12
+ intro: string;
13
+ firstName: string;
14
+ state: string;
15
+ birth: Date;
16
+ age: number;
17
+ gender: Gender;
18
+ zodiacSign: string;
19
+ images: string[];
20
+ thumbnail: string;
21
+ thumbnailBlurred: string;
22
+ image: string;
23
+ aiSummary?: string;
24
+ attachedSummary: boolean;
25
+ profileInput: Record<string, string>;
26
+ };
27
+ export type NotificationSettings = {
28
+ enabled: boolean;
29
+ settings: Record<string, boolean>;
30
+ };
31
+ export type UserNotifications = {
32
+ pushNotificationsEnabled: boolean;
33
+ emailNotificationsEnabled: boolean;
34
+ pushNotificationSettings: NotificationSettings;
35
+ emailNotificationSettings: NotificationSettings;
36
+ };
37
+ export type DatingPreferences = {
38
+ minAge: number;
39
+ maxAge: number;
40
+ interestedIn: Gender[];
41
+ distanceRadius: number;
42
+ };
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // export type User = {
4
+ // id: string;
5
+ // intro: string;
6
+ // firstName: string;
7
+ // state: string;
8
+ // birth: string;
9
+ // gender: string;
10
+ // interestedIn: string;
11
+ // zodiacSign: string;
12
+ // images: string[];
13
+ // profileInput: ProfileInput;
14
+ // lat: number;
15
+ // lng: number;
16
+ // radius: number;
17
+ // geohash: string;
18
+ // minAge: number;
19
+ // maxAge: number;
20
+ // aiSummary?: string;
21
+ // attachedSummary: boolean;
22
+ // thumbnail: string;
23
+ // image: string;
24
+ // bankIDVerified: boolean;
25
+ // emailNotificationsEnabled: boolean;
26
+ // pushNotificationsEnabled: boolean;
27
+ // pushNotificationSettings: NotificationSettings;
28
+ // registrationReferralAllowed: boolean;
29
+ // };
30
+ // export type UpdateUserData = {
31
+ // intro: string;
32
+ // firstName: string;
33
+ // state: string;
34
+ // birth: string;
35
+ // profileInput: ProfileInput;
36
+ // lat: number;
37
+ // lng: number;
38
+ // radius: number;
39
+ // geohash: string;
40
+ // minAge: number;
41
+ // maxAge: number;
42
+ // interestedIn: string; // maybe to be removed before release
43
+ // attachedSummary: boolean;
44
+ // expoPushToken?: string;
45
+ // pushNotificationsEnabled: boolean;
46
+ // emailNotificationsEnabled: boolean;
47
+ // pushNotificationSettings?: NotificationSettings;
48
+ // emailNotificationSettings?: NotificationSettings;
49
+ // };
50
+ // export type ProfileInput = Record<string, string>;
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "heartraite",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Heartraite npm package for common functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "rootDir": "src",
8
8
  "scripts": {
9
- "build": "rm -rf ./dist && tsc",
10
- "test": "jest"
9
+ "test": "jest",
10
+ "build": "tsc",
11
+ "prepublishOnly": "npm run build"
11
12
  },
12
13
  "repository": {
13
14
  "type": "git",
@@ -27,4 +28,4 @@
27
28
  "typescript": "^5.6.3",
28
29
  "firebase": "^11.0.1"
29
30
  }
30
- }
31
+ }
@@ -6,6 +6,7 @@ export enum CloudFunction {
6
6
  GET_SUBMISSION = "assessment/get-submission",
7
7
  UPDATE_ANSWER = "assessment/update-answer",
8
8
  SUBMIT_CATEGORY_FEEDBACK = "assessment/submit-category-feedback",
9
+ REGISTER_USER = "auth/register-user",
9
10
  AUTHENTICATE_BANKID = "bankid/authenticate",
10
11
  COLLECT_BANKID = "bankid/collect",
11
12
  CREATE_LIKE = "like/create-like",
@@ -28,7 +29,6 @@ export enum CloudFunction {
28
29
  STRIPE_WEBWOOK = "stripe/webhook",
29
30
  CREATE_BILLING_PORTAL = "stripe/create-billing-portal",
30
31
  CREATE_CHECKOUT_SESSION = "stripe/create-checkout-session",
31
- REGISTER_USER = "user/register-user",
32
32
  UPDATE_USER = "user/update-user",
33
33
  GET_CURRENT_USER = "user/get-current-user",
34
34
  }
package/src/enum/index.ts CHANGED
@@ -6,3 +6,4 @@ export * from "./ai-verification-status.enum";
6
6
  export * from "./evaluation.enum";
7
7
  export * from "./report.enum";
8
8
  export * from "./gender.enum";
9
+ export * from "./provider.enum";
@@ -0,0 +1,5 @@
1
+ export enum ProviderType {
2
+ PASSWORD = "password",
3
+ GOOGLE = "google.com",
4
+ FACEBOOK = "facebook.com",
5
+ }
@@ -77,6 +77,11 @@ export type CloudFunctionTypes = {
77
77
  payload?: undefined;
78
78
  response: GetAssessmentsResponse;
79
79
  };
80
+ // Auth
81
+ [CloudFunction.REGISTER_USER]: {
82
+ payload: RegisterUserRequest;
83
+ response: RegisterUserResponse;
84
+ };
80
85
  // Submission
81
86
  [CloudFunction.CREATE_SUBMISSION]: {
82
87
  payload: CreateSubmissionRequest;
@@ -188,10 +193,6 @@ export type CloudFunctionTypes = {
188
193
  response: CreateCheckoutSessionResponse;
189
194
  };
190
195
  // User
191
- [CloudFunction.REGISTER_USER]: {
192
- payload: RegisterUserRequest;
193
- response: RegisterUserResponse;
194
- };
195
196
  [CloudFunction.UPDATE_USER]: {
196
197
  payload: UpdateUserRequest;
197
198
  response: UpdateUserResponse;
@@ -1,6 +1,5 @@
1
1
  import { FeedbackAgreement, LikeType, ReportReason } from "../enum";
2
2
  import { Answer } from "./submission.types";
3
- import { RegistrationData } from "./user.types";
4
3
 
5
4
  // assessment
6
5
  export type CreateAssessmentRequest = { intimateTopics: boolean };
@@ -88,7 +87,6 @@ export type RegisterUserRequest = {
88
87
  email: string;
89
88
  password: string;
90
89
  referrerId?: string;
91
- data: RegistrationData;
92
90
  };
93
91
  export type GetUserRequest = undefined;
94
92
  export type UpdateUserRequest = Partial<any>; // TODO; fix typing
@@ -46,18 +46,6 @@ export type DatingPreferences = {
46
46
  distanceRadius: number;
47
47
  };
48
48
 
49
- export type RegistrationData = {
50
- firstName: string;
51
- lat: number;
52
- lng: number;
53
- birth: Date;
54
- gender: Gender;
55
- interestedIn: Gender[];
56
- minAge: number;
57
- maxAge: number;
58
- distanceRadius: number;
59
- };
60
-
61
49
  // export type User = {
62
50
  // id: string;
63
51
  // intro: string;
@@ -86,21 +74,6 @@ export type RegistrationData = {
86
74
  // registrationReferralAllowed: boolean;
87
75
  // };
88
76
 
89
- // export type UserRegistrationData = {
90
- // firstName: string;
91
- // state: string;
92
- // birth: string;
93
- // gender: string;
94
- // images: string[];
95
- // intro: string;
96
- // interestedIn: string;
97
- // lat?: number;
98
- // lng?: number;
99
- // radius?: number;
100
- // minAge?: number;
101
- // maxAge?: number;
102
- // };
103
-
104
77
  // export type UpdateUserData = {
105
78
  // intro: string;
106
79
  // firstName: string;