@trackunit/iris-app-runtime-core 0.3.173 → 0.3.174
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 +6 -5
- package/index.esm.js +6 -5
- package/package.json +1 -1
- package/src/AnalyticsRuntime.d.ts +1 -1
- package/src/AssetRuntime.d.ts +2 -2
- package/src/AssetSortingRuntime.d.ts +2 -2
- package/src/CurrentPreferenceUserRuntime.d.ts +2 -2
- package/src/CurrentUserRuntime.d.ts +2 -2
- package/src/CustomFieldRuntime.d.ts +3 -1
- package/src/CustomerRuntime.d.ts +2 -2
- package/src/EnvironmentRuntime.d.ts +2 -2
- package/src/EventRuntime.d.ts +2 -2
- package/src/FilterBarRuntime.d.ts +2 -2
- package/src/IrisOemManifestRuntime.d.ts +2 -2
- package/src/ParamsRuntime.d.ts +2 -2
- package/src/RestRuntime.d.ts +2 -2
- package/src/RouterRuntime.d.ts +2 -2
- package/src/SiteRuntime.d.ts +2 -2
- package/src/TokenRuntime.d.ts +2 -2
- package/src/UserSubscriptionRuntime.d.ts +2 -2
package/index.cjs.js
CHANGED
|
@@ -43,10 +43,9 @@ const doNothingByDefault = () => { };
|
|
|
43
43
|
* @returns { Connection<HostConnectorApi> } the connection to the host
|
|
44
44
|
*/
|
|
45
45
|
const setupHostConnector = (subscribedMethods) => {
|
|
46
|
-
var _a;
|
|
47
46
|
const methods = Object.assign({ onFilterBarValuesChanged: doNothingByDefault, onTokenChanged: doNothingByDefault, onAssetSortingStateChanged: doNothingByDefault }, subscribedMethods);
|
|
48
47
|
const connection = penpal.connectToParent({ methods });
|
|
49
|
-
|
|
48
|
+
connection.promise.catch(err => {
|
|
50
49
|
// TODO consider how to handle this catch
|
|
51
50
|
// eslint-disable-next-line no-console
|
|
52
51
|
console.log(err);
|
|
@@ -135,6 +134,8 @@ const CurrentUserRuntime = {
|
|
|
135
134
|
* Get the value of a custom field from a raw value.
|
|
136
135
|
*
|
|
137
136
|
* @param customFieldDefinition the definition of the custom field
|
|
137
|
+
* @param customFieldDefinition.type the type of the custom field definition
|
|
138
|
+
* @param customFieldDefinition.isInteger whether the custom field is an integer
|
|
138
139
|
* @param newValue the new value to set
|
|
139
140
|
* @returns { CustomFieldValue } an updated CustomFieldValue
|
|
140
141
|
*/
|
|
@@ -171,7 +172,7 @@ const getCustomFieldValueToSaveFromRawValue = (customFieldDefinition, newValue)
|
|
|
171
172
|
stringArrayValue.push(item);
|
|
172
173
|
}
|
|
173
174
|
else {
|
|
174
|
-
stringArrayValue.push(item
|
|
175
|
+
stringArrayValue.push(item.value);
|
|
175
176
|
}
|
|
176
177
|
});
|
|
177
178
|
}
|
|
@@ -180,7 +181,7 @@ const getCustomFieldValueToSaveFromRawValue = (customFieldDefinition, newValue)
|
|
|
180
181
|
stringArrayValue.push(newValue);
|
|
181
182
|
}
|
|
182
183
|
else if (typeof newValue === "object") {
|
|
183
|
-
stringArrayValue.push(newValue
|
|
184
|
+
stringArrayValue.push(newValue.value);
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
return {
|
|
@@ -237,7 +238,7 @@ const getCustomFieldValueToSaveFromRawValue = (customFieldDefinition, newValue)
|
|
|
237
238
|
*/
|
|
238
239
|
const getStringValue = (value) => {
|
|
239
240
|
const stringValue = value;
|
|
240
|
-
if (
|
|
241
|
+
if (value === null || value === undefined) {
|
|
241
242
|
return null;
|
|
242
243
|
}
|
|
243
244
|
else if (stringValue.trim().length === 0) {
|
package/index.esm.js
CHANGED
|
@@ -39,10 +39,9 @@ const doNothingByDefault = () => { };
|
|
|
39
39
|
* @returns { Connection<HostConnectorApi> } the connection to the host
|
|
40
40
|
*/
|
|
41
41
|
const setupHostConnector = (subscribedMethods) => {
|
|
42
|
-
var _a;
|
|
43
42
|
const methods = Object.assign({ onFilterBarValuesChanged: doNothingByDefault, onTokenChanged: doNothingByDefault, onAssetSortingStateChanged: doNothingByDefault }, subscribedMethods);
|
|
44
43
|
const connection = connectToParent({ methods });
|
|
45
|
-
|
|
44
|
+
connection.promise.catch(err => {
|
|
46
45
|
// TODO consider how to handle this catch
|
|
47
46
|
// eslint-disable-next-line no-console
|
|
48
47
|
console.log(err);
|
|
@@ -131,6 +130,8 @@ const CurrentUserRuntime = {
|
|
|
131
130
|
* Get the value of a custom field from a raw value.
|
|
132
131
|
*
|
|
133
132
|
* @param customFieldDefinition the definition of the custom field
|
|
133
|
+
* @param customFieldDefinition.type the type of the custom field definition
|
|
134
|
+
* @param customFieldDefinition.isInteger whether the custom field is an integer
|
|
134
135
|
* @param newValue the new value to set
|
|
135
136
|
* @returns { CustomFieldValue } an updated CustomFieldValue
|
|
136
137
|
*/
|
|
@@ -167,7 +168,7 @@ const getCustomFieldValueToSaveFromRawValue = (customFieldDefinition, newValue)
|
|
|
167
168
|
stringArrayValue.push(item);
|
|
168
169
|
}
|
|
169
170
|
else {
|
|
170
|
-
stringArrayValue.push(item
|
|
171
|
+
stringArrayValue.push(item.value);
|
|
171
172
|
}
|
|
172
173
|
});
|
|
173
174
|
}
|
|
@@ -176,7 +177,7 @@ const getCustomFieldValueToSaveFromRawValue = (customFieldDefinition, newValue)
|
|
|
176
177
|
stringArrayValue.push(newValue);
|
|
177
178
|
}
|
|
178
179
|
else if (typeof newValue === "object") {
|
|
179
|
-
stringArrayValue.push(newValue
|
|
180
|
+
stringArrayValue.push(newValue.value);
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
183
|
return {
|
|
@@ -233,7 +234,7 @@ const getCustomFieldValueToSaveFromRawValue = (customFieldDefinition, newValue)
|
|
|
233
234
|
*/
|
|
234
235
|
const getStringValue = (value) => {
|
|
235
236
|
const stringValue = value;
|
|
236
|
-
if (
|
|
237
|
+
if (value === null || value === undefined) {
|
|
237
238
|
return null;
|
|
238
239
|
}
|
|
239
240
|
else if (stringValue.trim().length === 0) {
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IAnalyticsContextAsync } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
export declare const AnalyticsContextRuntime: IAnalyticsContextAsync<
|
|
2
|
+
export declare const AnalyticsContextRuntime: IAnalyticsContextAsync<Record<string, never>>;
|
package/src/AssetRuntime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AssetInfo } from "@trackunit/iris-app-runtime-core-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface AssetRuntimeApi {
|
|
3
3
|
getAssetInfo: () => Promise<AssetInfo>;
|
|
4
4
|
}
|
|
5
|
-
export declare const AssetRuntime:
|
|
5
|
+
export declare const AssetRuntime: AssetRuntimeApi;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AssetSortingContextValue } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface AssetSortingRuntimeApi {
|
|
3
3
|
getAssetSortingState: () => Promise<AssetSortingContextValue["sortingState"]>;
|
|
4
4
|
setAssetSortingState: (...args: Parameters<AssetSortingContextValue["setSortBy"]>) => Promise<void>;
|
|
5
5
|
}
|
|
6
|
-
export declare const AssetSortingRuntime:
|
|
6
|
+
export declare const AssetSortingRuntime: AssetSortingRuntimeApi;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ICurrentUserPreferenceContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface CurrentUserPreferenceRuntimeApi extends ICurrentUserPreferenceContext {
|
|
3
3
|
}
|
|
4
|
-
export declare const CurrentUserPreferenceRuntime:
|
|
4
|
+
export declare const CurrentUserPreferenceRuntime: CurrentUserPreferenceRuntimeApi;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICurrentUserContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface CurrentUserRuntimeApi {
|
|
3
3
|
getCurrentUserContext: () => Promise<ICurrentUserContext>;
|
|
4
4
|
}
|
|
5
|
-
export declare const CurrentUserRuntime:
|
|
5
|
+
export declare const CurrentUserRuntime: CurrentUserRuntimeApi;
|
|
@@ -7,6 +7,8 @@ export interface DropdownSelection {
|
|
|
7
7
|
* Get the value of a custom field from a raw value.
|
|
8
8
|
*
|
|
9
9
|
* @param customFieldDefinition the definition of the custom field
|
|
10
|
+
* @param customFieldDefinition.type the type of the custom field definition
|
|
11
|
+
* @param customFieldDefinition.isInteger whether the custom field is an integer
|
|
10
12
|
* @param newValue the new value to set
|
|
11
13
|
* @returns { CustomFieldValue } an updated CustomFieldValue
|
|
12
14
|
*/
|
|
@@ -17,7 +19,7 @@ export declare const getCustomFieldValueToSaveFromRawValue: (customFieldDefiniti
|
|
|
17
19
|
/**
|
|
18
20
|
* Convert the received value to a string
|
|
19
21
|
*/
|
|
20
|
-
export declare const getStringValue: (value: boolean | string | string[] | DropdownSelection[] | DropdownSelection | number) => string | null;
|
|
22
|
+
export declare const getStringValue: (value: boolean | string | string[] | DropdownSelection[] | DropdownSelection | number | null | undefined) => string | null;
|
|
21
23
|
/**
|
|
22
24
|
* Format the received value to a date string
|
|
23
25
|
* yyyy-mm-dd
|
package/src/CustomerRuntime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CustomerInfo } from "@trackunit/iris-app-runtime-core-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface CustomerRuntimeApi {
|
|
3
3
|
getCustomerInfo: () => Promise<CustomerInfo>;
|
|
4
4
|
}
|
|
5
|
-
export declare const CustomerRuntime:
|
|
5
|
+
export declare const CustomerRuntime: CustomerRuntimeApi;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IEnvironmentContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface EnvironmentRuntimeApi {
|
|
3
3
|
getEnvironmentContext: () => Promise<IEnvironmentContext>;
|
|
4
4
|
}
|
|
5
|
-
export declare const EnvironmentRuntime:
|
|
5
|
+
export declare const EnvironmentRuntime: EnvironmentRuntimeApi;
|
package/src/EventRuntime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventInfo } from "@trackunit/iris-app-runtime-core-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface EventRuntimeApi {
|
|
3
3
|
getEventInfo: () => Promise<EventInfo>;
|
|
4
4
|
}
|
|
5
|
-
export declare const EventRuntime:
|
|
5
|
+
export declare const EventRuntime: EventRuntimeApi;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterBarValues } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface FilterBarRuntimeApi {
|
|
3
3
|
getFilterBarValues: () => Promise<FilterBarValues>;
|
|
4
4
|
}
|
|
5
|
-
export declare const FilterBarRuntime:
|
|
5
|
+
export declare const FilterBarRuntime: FilterBarRuntimeApi;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IOemBrandingContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface OemBrandingContextRuntimeApi {
|
|
3
3
|
getOemBrandingContextRuntime: () => Promise<IOemBrandingContext>;
|
|
4
4
|
}
|
|
5
|
-
export declare const OemBrandingContextRuntime:
|
|
5
|
+
export declare const OemBrandingContextRuntime: OemBrandingContextRuntimeApi;
|
package/src/ParamsRuntime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface ParamsRuntimeApi {
|
|
2
2
|
getAppName: () => Promise<string | undefined>;
|
|
3
3
|
getExtensionName: () => Promise<string | undefined>;
|
|
4
4
|
getOrgName: () => Promise<string | undefined>;
|
|
5
5
|
}
|
|
6
|
-
export declare const ParamsRuntime:
|
|
6
|
+
export declare const ParamsRuntime: ParamsRuntimeApi;
|
package/src/RestRuntime.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BodyType, HttpResponse, RequestParams } from "@trackunit/iris-app-runtime-core-api";
|
|
2
2
|
export type RestRunTimeResponse = HttpResponse<any, any>;
|
|
3
|
-
export interface
|
|
3
|
+
export interface RestRuntimeApi {
|
|
4
4
|
apiHost: string;
|
|
5
5
|
request: (path: string, method: string, requestParams?: RequestParams | undefined, body?: unknown, bodyType?: BodyType | undefined, secureByDefault?: boolean | undefined) => Promise<RestRunTimeResponse>;
|
|
6
6
|
}
|
|
7
|
-
export declare const RestRuntime:
|
|
7
|
+
export declare const RestRuntime: RestRuntimeApi;
|
package/src/RouterRuntime.d.ts
CHANGED
package/src/SiteRuntime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SiteInfo } from "@trackunit/iris-app-runtime-core-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface SiteRuntimeApi {
|
|
3
3
|
getSiteInfo: () => Promise<SiteInfo>;
|
|
4
4
|
}
|
|
5
|
-
export declare const SiteRuntime:
|
|
5
|
+
export declare const SiteRuntime: SiteRuntimeApi;
|
package/src/TokenRuntime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ITokenContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface TokenRuntimeApi {
|
|
3
3
|
getTokenContext: () => Promise<ITokenContext>;
|
|
4
4
|
}
|
|
5
|
-
export declare const TokenRuntime:
|
|
5
|
+
export declare const TokenRuntime: TokenRuntimeApi;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IUserSubscriptionContext } from "@trackunit/react-core-contexts-api";
|
|
2
|
-
export interface
|
|
2
|
+
export interface UserSubscriptionRuntimeApi {
|
|
3
3
|
getUserSubscriptionContext: () => Promise<IUserSubscriptionContext>;
|
|
4
4
|
}
|
|
5
|
-
export declare const UserSubscriptionRuntime:
|
|
5
|
+
export declare const UserSubscriptionRuntime: UserSubscriptionRuntimeApi;
|