@abyss-project/main 1.0.44 → 1.0.46

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.
@@ -18,3 +18,5 @@ export * from './subscription-level.enum';
18
18
  export * from './newsletter-type.enum';
19
19
  export * from './project-status.enum';
20
20
  export * from './abyss-application-event.enum';
21
+ export * from './user-type.enum';
22
+ export * from './onboarding-steps.enum';
@@ -34,3 +34,5 @@ __exportStar(require("./subscription-level.enum"), exports);
34
34
  __exportStar(require("./newsletter-type.enum"), exports);
35
35
  __exportStar(require("./project-status.enum"), exports);
36
36
  __exportStar(require("./abyss-application-event.enum"), exports);
37
+ __exportStar(require("./user-type.enum"), exports);
38
+ __exportStar(require("./onboarding-steps.enum"), exports);
@@ -0,0 +1,15 @@
1
+ export declare enum OnboardingSteps {
2
+ LANDING = "LANDING",
3
+ USER_DETAILS = "USER_DETAILS",
4
+ USER_TYPE = "USER_TYPE",
5
+ DEVELOPER_CREATE_PROJECT = "DEVELOPER_CREATE_PROJECT",
6
+ DEVELOPER_DISCOVER_MONITOR = "DEVELOPER_DISCOVER_MONITOR",
7
+ DEVELOPER_DISCOVER_STORAGE = "DEVELOPER_DISCOVER_STORAGE",
8
+ USER_FEATURE_SELECT = "USER_FEATURE_SELECT",
9
+ USER_CREATE_CLOUD = "USER_CREATE_CLOUD",
10
+ USER_CONNECT_BANK = "USER_CONNECT_BANK",
11
+ USER_CREATE_MEMORIES = "USER_CREATE_MEMORIES",
12
+ USER_CREATE_FORM = "USER_CREATE_FORM",
13
+ USER_CREATE_SPOTLIGHT = "USER_CREATE_SPOTLIGHT",
14
+ END = "END"
15
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OnboardingSteps = void 0;
4
+ var OnboardingSteps;
5
+ (function (OnboardingSteps) {
6
+ OnboardingSteps["LANDING"] = "LANDING";
7
+ OnboardingSteps["USER_DETAILS"] = "USER_DETAILS";
8
+ OnboardingSteps["USER_TYPE"] = "USER_TYPE";
9
+ OnboardingSteps["DEVELOPER_CREATE_PROJECT"] = "DEVELOPER_CREATE_PROJECT";
10
+ OnboardingSteps["DEVELOPER_DISCOVER_MONITOR"] = "DEVELOPER_DISCOVER_MONITOR";
11
+ OnboardingSteps["DEVELOPER_DISCOVER_STORAGE"] = "DEVELOPER_DISCOVER_STORAGE";
12
+ OnboardingSteps["USER_FEATURE_SELECT"] = "USER_FEATURE_SELECT";
13
+ OnboardingSteps["USER_CREATE_CLOUD"] = "USER_CREATE_CLOUD";
14
+ OnboardingSteps["USER_CONNECT_BANK"] = "USER_CONNECT_BANK";
15
+ OnboardingSteps["USER_CREATE_MEMORIES"] = "USER_CREATE_MEMORIES";
16
+ OnboardingSteps["USER_CREATE_FORM"] = "USER_CREATE_FORM";
17
+ OnboardingSteps["USER_CREATE_SPOTLIGHT"] = "USER_CREATE_SPOTLIGHT";
18
+ OnboardingSteps["END"] = "END";
19
+ })(OnboardingSteps || (exports.OnboardingSteps = OnboardingSteps = {}));
@@ -19,6 +19,12 @@ export declare enum ProjectApplicationAccessPermission {
19
19
  MONITOR_EVENT_UPDATE = "MONITOR_EVENT_UPDATE",
20
20
  MONITOR_EVENT_DELETE = "MONITOR_EVENT_DELETE",
21
21
  MONITOR_EVENT_CREATE = "MONITOR_EVENT_CREATE",
22
+ MONITOR_WEBHOOK_READ = "MONITOR_WEBHOOK_READ",
23
+ MONITOR_WEBHOOK_CREATE = "MONITOR_WEBHOOK_CREATE",
24
+ MONITOR_WEBHOOK_DELETE = "MONITOR_WEBHOOK_DELETE",
25
+ MONITOR_WEBHOOK_UPDATE = "MONITOR_WEBHOOK_UPDATE",
26
+ MONITOR_WEBHOOK_RESET_SECRET = "MONITOR_WEBHOOK_RESET_SECRET",
27
+ MONITOR_WEBHOOK_HISTORY_READ = "MONITOR_WEBHOOK_HISTORY_READ",
22
28
  STORAGE_FULL_ACCESS = "STORAGE_FULL_ACCESS",
23
29
  STORAGE_READ = "STORAGE_READ",
24
30
  STORAGE_FILE_READ = "STORAGE_FILE_READ",
@@ -23,6 +23,12 @@ var ProjectApplicationAccessPermission;
23
23
  ProjectApplicationAccessPermission["MONITOR_EVENT_UPDATE"] = "MONITOR_EVENT_UPDATE";
24
24
  ProjectApplicationAccessPermission["MONITOR_EVENT_DELETE"] = "MONITOR_EVENT_DELETE";
25
25
  ProjectApplicationAccessPermission["MONITOR_EVENT_CREATE"] = "MONITOR_EVENT_CREATE";
26
+ ProjectApplicationAccessPermission["MONITOR_WEBHOOK_READ"] = "MONITOR_WEBHOOK_READ";
27
+ ProjectApplicationAccessPermission["MONITOR_WEBHOOK_CREATE"] = "MONITOR_WEBHOOK_CREATE";
28
+ ProjectApplicationAccessPermission["MONITOR_WEBHOOK_DELETE"] = "MONITOR_WEBHOOK_DELETE";
29
+ ProjectApplicationAccessPermission["MONITOR_WEBHOOK_UPDATE"] = "MONITOR_WEBHOOK_UPDATE";
30
+ ProjectApplicationAccessPermission["MONITOR_WEBHOOK_RESET_SECRET"] = "MONITOR_WEBHOOK_RESET_SECRET";
31
+ ProjectApplicationAccessPermission["MONITOR_WEBHOOK_HISTORY_READ"] = "MONITOR_WEBHOOK_HISTORY_READ";
26
32
  ProjectApplicationAccessPermission["STORAGE_FULL_ACCESS"] = "STORAGE_FULL_ACCESS";
27
33
  ProjectApplicationAccessPermission["STORAGE_READ"] = "STORAGE_READ";
28
34
  ProjectApplicationAccessPermission["STORAGE_FILE_READ"] = "STORAGE_FILE_READ";
@@ -0,0 +1,4 @@
1
+ export declare enum UserType {
2
+ DEVELOPER = "DEVELOPER",
3
+ USER = "USER"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserType = void 0;
4
+ var UserType;
5
+ (function (UserType) {
6
+ UserType["DEVELOPER"] = "DEVELOPER";
7
+ UserType["USER"] = "USER";
8
+ })(UserType || (exports.UserType = UserType = {}));
@@ -1,5 +1,6 @@
1
1
  import { SubscriptionLevel, UserCreditPurchaseCurrency, UserLanguage } from '../../../enum';
2
2
  import { TokenHistoryMetadataUserInvitation } from '../../models/token-history.model';
3
+ import { UserOnboardingStatus } from '../../models/user.model';
3
4
  import { QueryPaginate } from '../type-message/base-paginate';
4
5
  import * as core from 'express-serve-static-core';
5
6
  export interface ISponsorUserQuery {
@@ -26,6 +27,7 @@ export type IPaginateSponsorUserQuery = {
26
27
  export interface IUpdateSettingsUserBody {
27
28
  language?: UserLanguage;
28
29
  currency?: UserCreditPurchaseCurrency;
30
+ onboardingStatus?: UserOnboardingStatus;
29
31
  }
30
32
  export interface ICreateSubscriptionUserBody {
31
33
  level: SubscriptionLevel;
@@ -1,10 +1,13 @@
1
1
  import { IGiftCodeActivation, IOAuthAccount, IProject, IUserTransaction } from '..';
2
- import { AbyssService, UserCreditPurchaseCurrency, UserLanguage } from '../../enum';
2
+ import { AbyssService, OnboardingSteps, UserCreditPurchaseCurrency, UserLanguage, UserType } from '../../enum';
3
+ import { OnboardingData } from '../../utils';
3
4
  import { ISubscription } from './subscription.model';
4
5
  import { IUserNotification } from './user-notification.model';
5
6
  export interface IUserSetting {
6
7
  language?: UserLanguage;
7
8
  currency?: UserCreditPurchaseCurrency | null;
9
+ onboardingStatus?: UserOnboardingStatus | null;
10
+ userType?: UserType;
8
11
  }
9
12
  export interface IUser {
10
13
  id?: string;
@@ -35,3 +38,8 @@ export interface IUser {
35
38
  subscription?: ISubscription | null;
36
39
  project?: IProject[];
37
40
  }
41
+ export type UserOnboardingStatus = {
42
+ completedAt?: Date | null;
43
+ step?: OnboardingSteps | null;
44
+ data?: OnboardingData | null;
45
+ };
@@ -4,4 +4,5 @@ export * from './convert-query.util';
4
4
  export * from './notifications.type-util';
5
5
  export * from './billing.util';
6
6
  export * from './email.utils';
7
+ export * from './onboarding.utils';
7
8
  export type ValueOf<T> = T[keyof T];
@@ -20,3 +20,4 @@ __exportStar(require("./convert-query.util"), exports);
20
20
  __exportStar(require("./notifications.type-util"), exports);
21
21
  __exportStar(require("./billing.util"), exports);
22
22
  __exportStar(require("./email.utils"), exports);
23
+ __exportStar(require("./onboarding.utils"), exports);
@@ -0,0 +1,34 @@
1
+ import { OnboardingSteps, UserType } from '../enum';
2
+ export declare const ABYSS_MEMORIES_PLAY_STORE_URL = "https://play.google.com/store/apps/details?id=abyss.project.memories&pcampaignid=web_share";
3
+ export declare const ABYSS_CLOUD_PLAY_STORE_URL = "https://play.google.com/store/apps/details?id=abyss.project.cloud&pcampaignid=web_share";
4
+ export declare const ABYSS_MEMORIES_APPLE_STORE_URL = "https://apps.apple.com/fr/app/abyss-memories/id6505037238";
5
+ export declare const ABYSS_CLOUD_APPLE_STORE_URL = "https://apps.apple.com/fr/app/abyss-cloud/id6636511562";
6
+ export declare const COMMONS_STEPS: OnboardingSteps[];
7
+ export type OnboardingData = {
8
+ userDetails: {
9
+ name: string;
10
+ familyName: string;
11
+ email: string;
12
+ signupAsCompany: boolean;
13
+ companyName?: string;
14
+ companyRole?: string;
15
+ companyWebsite?: string;
16
+ };
17
+ userType: {
18
+ type: UserType | null;
19
+ };
20
+ userFeatures: {
21
+ cloud: boolean;
22
+ banking: boolean;
23
+ memories: boolean;
24
+ form: boolean;
25
+ spotlight: boolean;
26
+ };
27
+ };
28
+ export declare const getOnboardingProgression: (currentStep: OnboardingSteps, onboardingData: OnboardingData) => {
29
+ nextStep: OnboardingSteps;
30
+ steps: OnboardingSteps[];
31
+ progression: number;
32
+ stepIndex: number;
33
+ isLastStep: boolean;
34
+ };
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOnboardingProgression = exports.COMMONS_STEPS = exports.ABYSS_CLOUD_APPLE_STORE_URL = exports.ABYSS_MEMORIES_APPLE_STORE_URL = exports.ABYSS_CLOUD_PLAY_STORE_URL = exports.ABYSS_MEMORIES_PLAY_STORE_URL = void 0;
4
+ const enum_1 = require("../enum");
5
+ exports.ABYSS_MEMORIES_PLAY_STORE_URL = 'https://play.google.com/store/apps/details?id=abyss.project.memories&pcampaignid=web_share';
6
+ exports.ABYSS_CLOUD_PLAY_STORE_URL = 'https://play.google.com/store/apps/details?id=abyss.project.cloud&pcampaignid=web_share';
7
+ exports.ABYSS_MEMORIES_APPLE_STORE_URL = 'https://apps.apple.com/fr/app/abyss-memories/id6505037238';
8
+ exports.ABYSS_CLOUD_APPLE_STORE_URL = 'https://apps.apple.com/fr/app/abyss-cloud/id6636511562';
9
+ exports.COMMONS_STEPS = [
10
+ enum_1.OnboardingSteps.LANDING,
11
+ enum_1.OnboardingSteps.USER_DETAILS,
12
+ enum_1.OnboardingSteps.USER_TYPE,
13
+ ];
14
+ const getOnboardingProgression = (currentStep, onboardingData) => {
15
+ var _a, _b, _c, _d, _e, _f, _g, _h;
16
+ const allSteps = [
17
+ ...exports.COMMONS_STEPS,
18
+ ...(((_a = onboardingData.userType) === null || _a === void 0 ? void 0 : _a.type) === enum_1.UserType.DEVELOPER
19
+ ? [
20
+ enum_1.OnboardingSteps.DEVELOPER_CREATE_PROJECT,
21
+ enum_1.OnboardingSteps.DEVELOPER_DISCOVER_MONITOR,
22
+ enum_1.OnboardingSteps.DEVELOPER_DISCOVER_STORAGE,
23
+ ]
24
+ : []),
25
+ ...(((_b = onboardingData.userType) === null || _b === void 0 ? void 0 : _b.type) === enum_1.UserType.USER
26
+ ? [enum_1.OnboardingSteps.USER_FEATURE_SELECT]
27
+ : []),
28
+ ...(((_c = onboardingData.userType) === null || _c === void 0 ? void 0 : _c.type) === enum_1.UserType.USER
29
+ ? [
30
+ ...(((_d = onboardingData.userFeatures) === null || _d === void 0 ? void 0 : _d.cloud) ? [enum_1.OnboardingSteps.USER_CREATE_CLOUD] : []),
31
+ ...(((_e = onboardingData.userFeatures) === null || _e === void 0 ? void 0 : _e.banking) ? [enum_1.OnboardingSteps.USER_CONNECT_BANK] : []),
32
+ ...(((_f = onboardingData.userFeatures) === null || _f === void 0 ? void 0 : _f.memories) ? [enum_1.OnboardingSteps.USER_CREATE_MEMORIES] : []),
33
+ ...(((_g = onboardingData.userFeatures) === null || _g === void 0 ? void 0 : _g.form) ? [enum_1.OnboardingSteps.USER_CREATE_FORM] : []),
34
+ ...(((_h = onboardingData.userFeatures) === null || _h === void 0 ? void 0 : _h.spotlight)
35
+ ? [enum_1.OnboardingSteps.USER_CREATE_SPOTLIGHT]
36
+ : []),
37
+ ]
38
+ : []),
39
+ enum_1.OnboardingSteps.END,
40
+ ];
41
+ const isLastStep = currentStep === allSteps.at(-1);
42
+ const currentIndex = allSteps.indexOf(currentStep);
43
+ return {
44
+ nextStep: enum_1.OnboardingSteps.USER_DETAILS,
45
+ steps: allSteps,
46
+ progression: (currentIndex + 1) / allSteps.length,
47
+ stepIndex: currentIndex,
48
+ isLastStep,
49
+ };
50
+ };
51
+ exports.getOnboardingProgression = getOnboardingProgression;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/main",
3
- "version": "1.0.44",
3
+ "version": "1.0.46",
4
4
  "description": "Core package to interact with Abyss-Project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",