@trackunit/iris-app-runtime-core 0.3.78 → 0.3.80

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.
package/index.cjs.js CHANGED
@@ -529,6 +529,21 @@ const AssetSortingRuntime = {
529
529
  }),
530
530
  };
531
531
 
532
+ const CurrentUserPreferenceRuntime = {
533
+ getCurrentUserLanguage: () => __awaiter(void 0, void 0, void 0, function* () {
534
+ const api = yield getHostConnector();
535
+ return api.getCurrentUserLanguage();
536
+ }),
537
+ getCurrentUserTimeZonePreference: () => __awaiter(void 0, void 0, void 0, function* () {
538
+ const api = yield getHostConnector();
539
+ return api.getCurrentUserTimeZonePreference();
540
+ }),
541
+ getCurrentUserSystemOfMeasurement: () => __awaiter(void 0, void 0, void 0, function* () {
542
+ const api = yield getHostConnector();
543
+ return api.getCurrentUserSystemOfMeasurement();
544
+ }),
545
+ };
546
+
532
547
  const CurrentUserRuntime = {
533
548
  getCurrentUserContext: () => __awaiter(void 0, void 0, void 0, function* () {
534
549
  const api = yield getHostConnector();
@@ -816,6 +831,7 @@ const UserSubscriptionRuntime = {
816
831
  exports.AnalyticsContextRuntime = AnalyticsContextRuntime;
817
832
  exports.AssetRuntime = AssetRuntime;
818
833
  exports.AssetSortingRuntime = AssetSortingRuntime;
834
+ exports.CurrentUserPreferenceRuntime = CurrentUserPreferenceRuntime;
819
835
  exports.CurrentUserRuntime = CurrentUserRuntime;
820
836
  exports.CustomFieldRuntime = CustomFieldRuntime;
821
837
  exports.EnvironmentRuntime = EnvironmentRuntime;
package/index.esm.js CHANGED
@@ -526,6 +526,21 @@ const AssetSortingRuntime = {
526
526
  }),
527
527
  };
528
528
 
529
+ const CurrentUserPreferenceRuntime = {
530
+ getCurrentUserLanguage: () => __awaiter(void 0, void 0, void 0, function* () {
531
+ const api = yield getHostConnector();
532
+ return api.getCurrentUserLanguage();
533
+ }),
534
+ getCurrentUserTimeZonePreference: () => __awaiter(void 0, void 0, void 0, function* () {
535
+ const api = yield getHostConnector();
536
+ return api.getCurrentUserTimeZonePreference();
537
+ }),
538
+ getCurrentUserSystemOfMeasurement: () => __awaiter(void 0, void 0, void 0, function* () {
539
+ const api = yield getHostConnector();
540
+ return api.getCurrentUserSystemOfMeasurement();
541
+ }),
542
+ };
543
+
529
544
  const CurrentUserRuntime = {
530
545
  getCurrentUserContext: () => __awaiter(void 0, void 0, void 0, function* () {
531
546
  const api = yield getHostConnector();
@@ -810,4 +825,4 @@ const UserSubscriptionRuntime = {
810
825
  }),
811
826
  };
812
827
 
813
- export { AnalyticsContextRuntime, AssetRuntime, AssetSortingRuntime, CurrentUserRuntime, CustomFieldRuntime, EnvironmentRuntime, FilterBarRuntime, GlobalSelectionRuntime, NavigationRuntime, OemBrandingContextRuntime, ParamsRuntime, RestRuntime, SiteRuntime, ToastRuntime, TokenRuntime, UserSubscriptionRuntime, getCustomFieldValueToSaveFromRawValue, getDateValue, getHostConnector, getStringValue, setupHostConnector };
828
+ export { AnalyticsContextRuntime, AssetRuntime, AssetSortingRuntime, CurrentUserPreferenceRuntime, CurrentUserRuntime, CustomFieldRuntime, EnvironmentRuntime, FilterBarRuntime, GlobalSelectionRuntime, NavigationRuntime, OemBrandingContextRuntime, ParamsRuntime, RestRuntime, SiteRuntime, ToastRuntime, TokenRuntime, UserSubscriptionRuntime, getCustomFieldValueToSaveFromRawValue, getDateValue, getHostConnector, getStringValue, setupHostConnector };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/iris-app-runtime-core",
3
- "version": "0.3.78",
3
+ "version": "0.3.80",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,8 +9,8 @@
9
9
  "module": "./index.esm.js",
10
10
  "main": "./index.cjs.js",
11
11
  "dependencies": {
12
- "@trackunit/iris-app-runtime-core-api": "0.3.70",
13
- "@trackunit/react-core-contexts-api": "0.2.58"
12
+ "@trackunit/iris-app-runtime-core-api": "0.3.72",
13
+ "@trackunit/react-core-contexts-api": "0.2.60"
14
14
  },
15
15
  "peerDependencies": {}
16
16
  }
@@ -0,0 +1,7 @@
1
+ import { SystemOfMeasurementType, TimeZonePreferenceType } from "@trackunit/react-core-contexts-api";
2
+ export interface ICurrentUserPreferenceRuntime {
3
+ getCurrentUserLanguage: () => Promise<string>;
4
+ getCurrentUserTimeZonePreference: () => Promise<TimeZonePreferenceType>;
5
+ getCurrentUserSystemOfMeasurement: () => Promise<SystemOfMeasurementType>;
6
+ }
7
+ export declare const CurrentUserPreferenceRuntime: ICurrentUserPreferenceRuntime;
@@ -1,9 +1,8 @@
1
1
  import { CustomFieldDefinition, CustomFieldError, CustomFieldValue, EntityIdentity, UnitSiType, UnitUsType, ValueAndDefinition, ValueAndDefinitionKey } from "@trackunit/iris-app-runtime-core-api";
2
+ import { SystemOfMeasurementType } from "@trackunit/react-core-contexts-api";
2
3
  export interface DropdownSelection {
3
4
  value: string;
4
5
  }
5
- /** System of measurement. */
6
- export type SystemOfMeasurement = "SI" | "US_CUSTOMARY";
7
6
  /**
8
7
  * Get the value of a custom field from a raw value.
9
8
  *
@@ -25,6 +24,6 @@ export interface ICustomFieldRuntime {
25
24
  getCustomFieldsFor: (entity: EntityIdentity) => Promise<ValueAndDefinition[]>;
26
25
  setCustomFieldsFor: (entity: EntityIdentity, values: ValueAndDefinitionKey[]) => Promise<void | CustomFieldError>;
27
26
  setCustomFieldsFromFormData: (entity: EntityIdentity, formData: Record<string, boolean | string | string[] | number>, originalDefinitions: ValueAndDefinition[]) => Promise<void | CustomFieldError>;
28
- getCustomFieldValueForDisplayInUI: (value: number | string | null | undefined, unit: UnitUsType | UnitSiType | null | undefined, systemOfMeasurement?: SystemOfMeasurement, language?: string) => number | string | null | undefined;
27
+ getCustomFieldValueForDisplayInUI: (value: number | string | null | undefined, unit: UnitUsType | UnitSiType | null | undefined, systemOfMeasurement?: SystemOfMeasurementType, language?: string) => number | string | null | undefined;
29
28
  }
30
29
  export declare const CustomFieldRuntime: ICustomFieldRuntime;
package/src/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "@trackunit/iris-app-runtime-core-api";
2
2
  export * from "./AnalyticsRuntime";
3
3
  export * from "./AssetRuntime";
4
4
  export * from "./AssetSortingRuntime";
5
+ export * from "./CurrentPreferenceUserRuntime";
5
6
  export * from "./CurrentUserRuntime";
6
7
  export * from "./CustomFieldRuntime";
7
8
  export * from "./EnvironmentRuntime";