hevy-shared 1.0.607 → 1.0.609

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,3 @@
1
+ import { Lookup } from './typeUtils';
2
+ export declare const AdminPermissions: string[];
3
+ export type AdminPermission = Lookup<typeof AdminPermissions>;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminPermissions = void 0;
4
+ exports.AdminPermissions = ['become_user', 'manage_settings'];
package/built/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export * from './normalizedWorkoutUtils';
16
16
  export * from './routineUtils';
17
17
  export * from './typeUtils';
18
18
  export * from './async';
19
+ export * from './adminPermissions';
19
20
  export declare const supportedLanguages: readonly ["en", "es", "de", "fr", "it", "pt", "tr", "zh_CN", "zh_TW", "ru", "ja", "ko"];
20
21
  export type Language = Lookup<typeof supportedLanguages>;
21
22
  export declare const isLanguage: (x: string) => x is Language;
@@ -1598,7 +1599,7 @@ export interface CancelSubscriptionFeedback extends BaseFeedback {
1598
1599
  };
1599
1600
  }
1600
1601
  export type Feedback = GeneralFeedback | FeatureRequestFeedback | BugReportFeedback | GetHelpFeedback | ReportCommentFeedback | ReportWorkoutFeedback | ReportProfileFeedback | RatingPromptFeedback | CancelSubscriptionFeedback;
1601
- export type SuggestedUserSource = 'popular' | 'local' | 'contact' | 'mutual_follows' | 'follows_you' | 'featured' | 'hyper_local';
1602
+ export type SuggestedUserSource = 'popular' | 'local' | 'contact' | 'mutual_follows' | 'follows_you' | 'featured';
1602
1603
  export type SuggestedUserLabel = 'contact' | 'mutual_friends' | 'follows_you' | 'featured';
1603
1604
  export interface SuggestedUser {
1604
1605
  id: string;
package/built/index.js CHANGED
@@ -33,6 +33,7 @@ __exportStar(require("./normalizedWorkoutUtils"), exports);
33
33
  __exportStar(require("./routineUtils"), exports);
34
34
  __exportStar(require("./typeUtils"), exports);
35
35
  __exportStar(require("./async"), exports);
36
+ __exportStar(require("./adminPermissions"), exports);
36
37
  exports.supportedLanguages = [
37
38
  'en',
38
39
  'es',
package/built/utils.d.ts CHANGED
@@ -199,14 +199,6 @@ type GenerateUserGroupError = 'invalid-number-of-groups' | 'invalid-uuid' | 'uui
199
199
  * `(userId, numGroups)` pair, or an error, inside a Result<T> object
200
200
  */
201
201
  export declare const generateUserGroup: (userId: string, numGroups: number) => Result<number, GenerateUserGroupError>;
202
- /**
203
- * Get the user group value for a given user id and number of groups.
204
- * @param userId a v4 UUID; _must_ be v4 to ensure random distribution
205
- * @param numGroups number of possible groups, from 2 to 2^32
206
- * @returns User group value (A, B, C, etc.), or undefined if the user id is not a v4 UUID
207
- * or if an error occurs.
208
- */
209
- export declare const generateUserGroupValue: (userId: string, numGroups: 2 | 3) => "A" | "B" | "C" | undefined;
210
202
  /**
211
203
  * @example
212
204
  * isVersionAGreaterOrEqualToVersionB('1.2.3', '1.2') // true
package/built/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getYoutubeVideoId = exports.validateYoutubeUrl = exports.splitAtUsernamesAndLinks = exports.isVersionAGreaterOrEqualToVersionB = exports.generateUserGroupValue = exports.generateUserGroup = exports.isBaseExerciseTemplate = exports.getStrengthLevelFromPercentile = exports.numberToLocaleString = exports.numberWithCommas = exports.setVolume = exports.oneRepMax = exports.oneRepMaxPercentageMap = exports.workoutSetCount = exports.userExerciseSetWeight = exports.workoutDistanceMeters = exports.workoutReps = exports.workoutDurationSeconds = exports.removeAccents = exports.getClosestDataPointAroundTargetDate = exports.getClosestDataPointBeforeTargetDate = exports.findMapped = exports.stringToNumber = exports.forceStringToNumber = exports.formatDurationInput = exports.isValidFormattedTime = exports.isWholeNumber = exports.isNumber = exports.isValidUuid = exports.isValidPhoneNumber = exports.isValidWebUrl = exports.URL_REGEX = exports.isValidEmail = exports.secondsToWordFormatMinutes = exports.secondsToWordFormat = exports.secondsToClockFormat = exports.isValidUsername = exports.roundToWholeNumber = exports.roundToOneDecimal = exports.roundToTwoDecimal = exports.divide = exports.clampNumber = exports.num = void 0;
3
+ exports.getYoutubeVideoId = exports.validateYoutubeUrl = exports.splitAtUsernamesAndLinks = exports.isVersionAGreaterOrEqualToVersionB = exports.generateUserGroup = exports.isBaseExerciseTemplate = exports.getStrengthLevelFromPercentile = exports.numberToLocaleString = exports.numberWithCommas = exports.setVolume = exports.oneRepMax = exports.oneRepMaxPercentageMap = exports.workoutSetCount = exports.userExerciseSetWeight = exports.workoutDistanceMeters = exports.workoutReps = exports.workoutDurationSeconds = exports.removeAccents = exports.getClosestDataPointAroundTargetDate = exports.getClosestDataPointBeforeTargetDate = exports.findMapped = exports.stringToNumber = exports.forceStringToNumber = exports.formatDurationInput = exports.isValidFormattedTime = exports.isWholeNumber = exports.isNumber = exports.isValidUuid = exports.isValidPhoneNumber = exports.isValidWebUrl = exports.URL_REGEX = exports.isValidEmail = exports.secondsToWordFormatMinutes = exports.secondsToWordFormat = exports.secondsToClockFormat = exports.isValidUsername = exports.roundToWholeNumber = exports.roundToOneDecimal = exports.roundToTwoDecimal = exports.divide = exports.clampNumber = exports.num = void 0;
4
4
  /**
5
5
  * Doesn't matter what you throw in the function it'll
6
6
  * always return a number. Non number values will return
@@ -547,32 +547,6 @@ const generateUserGroup = (userId, numGroups) => {
547
547
  };
548
548
  };
549
549
  exports.generateUserGroup = generateUserGroup;
550
- /**
551
- * Get the user group value for a given user id and number of groups.
552
- * @param userId a v4 UUID; _must_ be v4 to ensure random distribution
553
- * @param numGroups number of possible groups, from 2 to 2^32
554
- * @returns User group value (A, B, C, etc.), or undefined if the user id is not a v4 UUID
555
- * or if an error occurs.
556
- */
557
- const generateUserGroupValue = (userId, numGroups) => {
558
- const group = (0, exports.generateUserGroup)(userId, numGroups);
559
- if (group.isSuccess) {
560
- switch (group.value) {
561
- case 0:
562
- return 'A';
563
- case 1:
564
- return 'B';
565
- case 2:
566
- return 'C';
567
- default:
568
- return undefined;
569
- }
570
- }
571
- else {
572
- return undefined;
573
- }
574
- };
575
- exports.generateUserGroupValue = generateUserGroupValue;
576
550
  /**
577
551
  * @example
578
552
  * isVersionAGreaterOrEqualToVersionB('1.2.3', '1.2') // true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hevy-shared",
3
- "version": "1.0.607",
3
+ "version": "1.0.609",
4
4
  "description": "",
5
5
  "main": "built/index.js",
6
6
  "types": "built/index.d.ts",