@abyss-project/main 1.0.77 → 1.0.79

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.
@@ -217,5 +217,14 @@ export declare enum AbyssApplicationEvent {
217
217
  ABYSS_MEMORIES_EVENT_MEDIA_OCR_RECEIPT = "abyss-memories.event.media.ocr-receipt",
218
218
  ABYSS_MEMORIES_EVENT_EXPENSE_CREATE = "abyss-memories.event.expense.create",
219
219
  ABYSS_MEMORIES_EVENT_EXPENSE_UPDATE = "abyss-memories.event.expense.update",
220
- ABYSS_MEMORIES_EVENT_EXPENSE_DELETE = "abyss-memories.event.expense.delete"
220
+ ABYSS_MEMORIES_EVENT_EXPENSE_DELETE = "abyss-memories.event.expense.delete",
221
+ ABYSS_TRAINING_EXERCISE_CREATE = "abyss-training.exercise.create",
222
+ ABYSS_TRAINING_EXERCISE_UPDATE = "abyss-training.exercise.update",
223
+ ABYSS_TRAINING_EXERCISE_DELETE = "abyss-training.exercise.delete",
224
+ ABYSS_TRAINING_WORKOUT_TEMPLATE_CREATE = "abyss-training.workout-template.create",
225
+ ABYSS_TRAINING_WORKOUT_TEMPLATE_UPDATE = "abyss-training.workout-template.update",
226
+ ABYSS_TRAINING_WORKOUT_TEMPLATE_DELETE = "abyss-training.workout-template.delete",
227
+ ABYSS_TRAINING_WORKOUT_SESSION_CREATE = "abyss-training.workout-session.create",
228
+ ABYSS_TRAINING_WORKOUT_SESSION_UPDATE = "abyss-training.workout-session.update",
229
+ ABYSS_TRAINING_WORKOUT_SESSION_DELETE = "abyss-training.workout-session.delete"
221
230
  }
@@ -222,4 +222,13 @@ var AbyssApplicationEvent;
222
222
  AbyssApplicationEvent["ABYSS_MEMORIES_EVENT_EXPENSE_CREATE"] = "abyss-memories.event.expense.create";
223
223
  AbyssApplicationEvent["ABYSS_MEMORIES_EVENT_EXPENSE_UPDATE"] = "abyss-memories.event.expense.update";
224
224
  AbyssApplicationEvent["ABYSS_MEMORIES_EVENT_EXPENSE_DELETE"] = "abyss-memories.event.expense.delete";
225
+ AbyssApplicationEvent["ABYSS_TRAINING_EXERCISE_CREATE"] = "abyss-training.exercise.create";
226
+ AbyssApplicationEvent["ABYSS_TRAINING_EXERCISE_UPDATE"] = "abyss-training.exercise.update";
227
+ AbyssApplicationEvent["ABYSS_TRAINING_EXERCISE_DELETE"] = "abyss-training.exercise.delete";
228
+ AbyssApplicationEvent["ABYSS_TRAINING_WORKOUT_TEMPLATE_CREATE"] = "abyss-training.workout-template.create";
229
+ AbyssApplicationEvent["ABYSS_TRAINING_WORKOUT_TEMPLATE_UPDATE"] = "abyss-training.workout-template.update";
230
+ AbyssApplicationEvent["ABYSS_TRAINING_WORKOUT_TEMPLATE_DELETE"] = "abyss-training.workout-template.delete";
231
+ AbyssApplicationEvent["ABYSS_TRAINING_WORKOUT_SESSION_CREATE"] = "abyss-training.workout-session.create";
232
+ AbyssApplicationEvent["ABYSS_TRAINING_WORKOUT_SESSION_UPDATE"] = "abyss-training.workout-session.update";
233
+ AbyssApplicationEvent["ABYSS_TRAINING_WORKOUT_SESSION_DELETE"] = "abyss-training.workout-session.delete";
225
234
  })(AbyssApplicationEvent || (exports.AbyssApplicationEvent = AbyssApplicationEvent = {}));
@@ -23,3 +23,4 @@ export * from './onboarding-steps.enum';
23
23
  export * from './board-column-type.enum';
24
24
  export * from './board-activity.enum';
25
25
  export * from './user-agent.enum';
26
+ export * from './measurement-unit.enum';
@@ -39,3 +39,4 @@ __exportStar(require("./onboarding-steps.enum"), exports);
39
39
  __exportStar(require("./board-column-type.enum"), exports);
40
40
  __exportStar(require("./board-activity.enum"), exports);
41
41
  __exportStar(require("./user-agent.enum"), exports);
42
+ __exportStar(require("./measurement-unit.enum"), exports);
@@ -0,0 +1,32 @@
1
+ export declare enum MeasurementSystem {
2
+ METRIC = "METRIC",
3
+ IMPERIAL = "IMPERIAL"
4
+ }
5
+ export declare enum TimeUnit {
6
+ SECONDS = "SECONDS",
7
+ MINUTES = "MINUTES",
8
+ HOURS = "HOURS"
9
+ }
10
+ export declare enum DistanceUnit {
11
+ METERS = "METERS",
12
+ KILOMETERS = "KILOMETERS",
13
+ MILES = "MILES"
14
+ }
15
+ export declare enum WeightUnit {
16
+ KILOGRAMS = "KILOGRAMS",
17
+ POUNDS = "POUNDS"
18
+ }
19
+ export declare const getUnitsFromMeasurementSystem: (system?: MeasurementSystem) => {
20
+ distance: DistanceUnit[];
21
+ weight: WeightUnit[];
22
+ };
23
+ export declare const convertToBaseUnit: {
24
+ time: (value: number, unit: TimeUnit) => number;
25
+ distance: (value: number, unit: DistanceUnit) => number;
26
+ weight: (value: number, unit: WeightUnit) => number;
27
+ };
28
+ export declare const convertFromBaseUnit: {
29
+ time: (value: number, unit: TimeUnit) => number;
30
+ distance: (value: number, unit: DistanceUnit) => number;
31
+ weight: (value: number, unit: WeightUnit) => number;
32
+ };
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertFromBaseUnit = exports.convertToBaseUnit = exports.getUnitsFromMeasurementSystem = exports.WeightUnit = exports.DistanceUnit = exports.TimeUnit = exports.MeasurementSystem = void 0;
4
+ var MeasurementSystem;
5
+ (function (MeasurementSystem) {
6
+ MeasurementSystem["METRIC"] = "METRIC";
7
+ MeasurementSystem["IMPERIAL"] = "IMPERIAL";
8
+ })(MeasurementSystem || (exports.MeasurementSystem = MeasurementSystem = {}));
9
+ var TimeUnit;
10
+ (function (TimeUnit) {
11
+ TimeUnit["SECONDS"] = "SECONDS";
12
+ TimeUnit["MINUTES"] = "MINUTES";
13
+ TimeUnit["HOURS"] = "HOURS";
14
+ })(TimeUnit || (exports.TimeUnit = TimeUnit = {}));
15
+ var DistanceUnit;
16
+ (function (DistanceUnit) {
17
+ DistanceUnit["METERS"] = "METERS";
18
+ DistanceUnit["KILOMETERS"] = "KILOMETERS";
19
+ DistanceUnit["MILES"] = "MILES";
20
+ })(DistanceUnit || (exports.DistanceUnit = DistanceUnit = {}));
21
+ var WeightUnit;
22
+ (function (WeightUnit) {
23
+ WeightUnit["KILOGRAMS"] = "KILOGRAMS";
24
+ WeightUnit["POUNDS"] = "POUNDS";
25
+ })(WeightUnit || (exports.WeightUnit = WeightUnit = {}));
26
+ const getUnitsFromMeasurementSystem = (system = MeasurementSystem.METRIC) => ({
27
+ distance: system === MeasurementSystem.METRIC
28
+ ? [DistanceUnit.METERS, DistanceUnit.KILOMETERS]
29
+ : [DistanceUnit.MILES],
30
+ weight: system === MeasurementSystem.METRIC ? [WeightUnit.KILOGRAMS] : [WeightUnit.POUNDS],
31
+ });
32
+ exports.getUnitsFromMeasurementSystem = getUnitsFromMeasurementSystem;
33
+ exports.convertToBaseUnit = {
34
+ time: (value, unit) => {
35
+ switch (unit) {
36
+ case TimeUnit.MINUTES:
37
+ return value * 60;
38
+ case TimeUnit.HOURS:
39
+ return value * 3600;
40
+ case TimeUnit.SECONDS:
41
+ default:
42
+ return value;
43
+ }
44
+ },
45
+ distance: (value, unit) => {
46
+ switch (unit) {
47
+ case DistanceUnit.KILOMETERS:
48
+ return value * 1000;
49
+ case DistanceUnit.MILES:
50
+ return value * 1609.34;
51
+ case DistanceUnit.METERS:
52
+ default:
53
+ return value;
54
+ }
55
+ },
56
+ weight: (value, unit) => {
57
+ switch (unit) {
58
+ case WeightUnit.POUNDS:
59
+ return value * 0.453592;
60
+ case WeightUnit.KILOGRAMS:
61
+ default:
62
+ return value;
63
+ }
64
+ },
65
+ };
66
+ exports.convertFromBaseUnit = {
67
+ time: (value, unit) => {
68
+ switch (unit) {
69
+ case TimeUnit.MINUTES:
70
+ return value / 60;
71
+ case TimeUnit.HOURS:
72
+ return value / 3600;
73
+ case TimeUnit.SECONDS:
74
+ default:
75
+ return value;
76
+ }
77
+ },
78
+ distance: (value, unit) => {
79
+ switch (unit) {
80
+ case DistanceUnit.KILOMETERS:
81
+ return value / 1000;
82
+ case DistanceUnit.MILES:
83
+ return value / 1609.34;
84
+ case DistanceUnit.METERS:
85
+ default:
86
+ return value;
87
+ }
88
+ },
89
+ weight: (value, unit) => {
90
+ switch (unit) {
91
+ case WeightUnit.POUNDS:
92
+ return value / 0.453592;
93
+ case WeightUnit.KILOGRAMS:
94
+ default:
95
+ return value;
96
+ }
97
+ },
98
+ };
@@ -38,6 +38,7 @@ export type UserConfigPerService = {
38
38
  maxSubmissionPerForm: number;
39
39
  allowSubmissionDocument: boolean;
40
40
  };
41
+ [AbyssService.ABYSS_TRAINING]: {};
41
42
  };
42
43
  export type UserSubscriptionConfig = Record<SubscriptionLevel, UserConfigPerService>;
43
44
  export declare const USER_SUBSCRIPTION_CONFIG: UserSubscriptionConfig;
@@ -45,6 +45,7 @@ exports.USER_SUBSCRIPTION_CONFIG = {
45
45
  maxSubmissionPerForm: 2000,
46
46
  allowSubmissionDocument: false,
47
47
  },
48
+ ABYSS_TRAINING: {},
48
49
  },
49
50
  [SubscriptionLevel.ADVANCED]: {
50
51
  ABYSS: {
@@ -70,6 +71,7 @@ exports.USER_SUBSCRIPTION_CONFIG = {
70
71
  maxSubmissionPerForm: Infinity,
71
72
  allowSubmissionDocument: true,
72
73
  },
74
+ ABYSS_TRAINING: {},
73
75
  },
74
76
  [SubscriptionLevel.PREMIUM]: {
75
77
  ABYSS: {
@@ -95,6 +97,7 @@ exports.USER_SUBSCRIPTION_CONFIG = {
95
97
  maxSubmissionPerForm: Infinity,
96
98
  allowSubmissionDocument: true,
97
99
  },
100
+ ABYSS_TRAINING: {},
98
101
  },
99
102
  };
100
103
  exports.PROJECT_SUBSCRIPTION_CONFIG = {
@@ -1,4 +1,4 @@
1
- import { SubscriptionLevel, UserCreditPurchaseCurrency, UserLanguage } from '../../../enum';
1
+ import { MeasurementSystem, SubscriptionLevel, UserCreditPurchaseCurrency, UserLanguage } from '../../../enum';
2
2
  import { TokenHistoryMetadataUserInvitation } from '../../models/token-history.model';
3
3
  import { UserOnboardingStatus } from '../../models/user.model';
4
4
  import { QueryPaginate } from '../type-message/base-paginate';
@@ -28,6 +28,10 @@ export interface IUpdateSettingsUserBody {
28
28
  currency?: UserCreditPurchaseCurrency;
29
29
  onboardingStatus?: UserOnboardingStatus;
30
30
  enableSoundNotification?: boolean;
31
+ units?: {
32
+ length?: MeasurementSystem;
33
+ weight?: MeasurementSystem;
34
+ };
31
35
  }
32
36
  export interface ICreateSubscriptionUserBody {
33
37
  level: SubscriptionLevel;
@@ -1,5 +1,5 @@
1
1
  import { IAtlas, IBoard, IGiftCodeActivation, IMemo, IOAuthAccount, IProject, IRetrospective, IShortLink, IUserTransaction } from '..';
2
- import { AbyssService, OnboardingSteps, UserCreditPurchaseCurrency, UserLanguage, UserType } from '../../enum';
2
+ import { AbyssService, MeasurementSystem, OnboardingSteps, UserCreditPurchaseCurrency, UserLanguage, UserType } from '../../enum';
3
3
  import { OnboardingData } from '../../utils';
4
4
  import { IBoardCardComment } from './board-card-comment.model';
5
5
  import { IDraw } from './draw.model';
@@ -11,6 +11,10 @@ export interface IUserSetting {
11
11
  onboardingStatus?: UserOnboardingStatus | null;
12
12
  userType?: UserType;
13
13
  enableSoundNotification?: boolean;
14
+ units?: {
15
+ length?: MeasurementSystem;
16
+ weight?: MeasurementSystem;
17
+ };
14
18
  }
15
19
  export interface IUser {
16
20
  id?: string;
@@ -1,2 +1,2 @@
1
1
  import { AbyssService } from '../types';
2
- export declare const getServiceName: (service: AbyssService) => "Abyss" | "Cloud" | "Crypt" | "Storage" | "Monitor" | "Memories" | "Banking" | "Odyssey" | "Spotlight" | "Form" | undefined;
2
+ export declare const getServiceName: (service: AbyssService) => "Abyss" | "Cloud" | "Crypt" | "Storage" | "Monitor" | "Memories" | "Banking" | "Odyssey" | "Spotlight" | "Form" | "Training" | undefined;
@@ -24,6 +24,8 @@ const getServiceName = (service) => {
24
24
  return 'Spotlight';
25
25
  case types_1.AbyssService.ABYSS_FORM:
26
26
  return 'Form';
27
+ case types_1.AbyssService.ABYSS_TRAINING:
28
+ return 'Training';
27
29
  default:
28
30
  break;
29
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/main",
3
- "version": "1.0.77",
3
+ "version": "1.0.79",
4
4
  "description": "Core package to interact with Abyss-Project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",