@equinor/mad-core 0.13.0 → 0.15.0

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/{chunk-DJMBVNB6.js → chunk-4MZFJLIZ.js} +2 -2
  3. package/dist/{chunk-U5IJVQDO.js → chunk-5JFNRREO.js} +1 -1
  4. package/dist/chunk-5O4PAUNU.js +13 -0
  5. package/dist/{chunk-7HGZLLNX.js → chunk-6HDRI6TU.js} +1 -1
  6. package/dist/chunk-ANDIOEIN.js +353 -0
  7. package/dist/{chunk-6RPJUHBL.js → chunk-BFY7M5I2.js} +1 -1
  8. package/dist/{chunk-STKI44UB.js → chunk-COSM7WGR.js} +4 -4
  9. package/dist/{chunk-TWUGCMPQ.js → chunk-D4SVYUGC.js} +2 -2
  10. package/dist/{chunk-KEH6NBFE.js → chunk-G4GPSIHD.js} +1 -1
  11. package/dist/{chunk-HVZWOPNE.js → chunk-HPDK6AZ3.js} +4 -11
  12. package/dist/{chunk-EOM477VC.js → chunk-IPJ2CVM4.js} +1 -1
  13. package/dist/{chunk-ETY3HZNI.js → chunk-IXKJM7VZ.js} +1 -1
  14. package/dist/{chunk-WWF7QKDX.js → chunk-LEWQGDM7.js} +2 -7
  15. package/dist/{chunk-SVBUWW4H.js → chunk-N7YMTR7Q.js} +2 -2
  16. package/dist/{chunk-O2GHT2UV.js → chunk-NVAF6GOY.js} +2 -2
  17. package/dist/{chunk-CKOB6JKU.js → chunk-OAVRCDCP.js} +4 -4
  18. package/dist/{chunk-HUG4RNGS.js → chunk-PYTNVR7M.js} +3 -5
  19. package/dist/{chunk-7FO6SNUK.js → chunk-QGFTS65Y.js} +5 -10
  20. package/dist/{chunk-GEEFQMRN.js → chunk-RBFR3YMY.js} +5 -5
  21. package/dist/{chunk-PB3TI2RT.js → chunk-RPD2KUSY.js} +1 -1
  22. package/dist/{chunk-IHCNAGT7.js → chunk-SRQFW6D5.js} +1 -1
  23. package/dist/{chunk-DIITQCRW.js → chunk-TO775HMH.js} +1 -1
  24. package/dist/{chunk-6LMMRQYQ.js → chunk-UOOFD7CI.js} +2 -2
  25. package/dist/{chunk-RJDKNHBE.js → chunk-XMQYRBUW.js} +1 -1
  26. package/dist/{chunk-4JWXJOGM.js → chunk-YTQLIYLS.js} +4 -4
  27. package/dist/{chunk-GNJZV3PL.js → chunk-ZAEB6ZS3.js} +5 -9
  28. package/dist/components/EnvironmentBanner.js +2 -2
  29. package/dist/components/EnvironmentProvider.js +2 -2
  30. package/dist/components/NavigationContainer.d.ts +2 -15
  31. package/dist/components/OfflineBanner.js +2 -2
  32. package/dist/components/createCoreStackNavigator.d.ts +18 -37
  33. package/dist/components/createCoreStackNavigator.js +37 -30
  34. package/dist/components/index.js +37 -40
  35. package/dist/components/navigation/MadCoreSubHeader.js +7 -7
  36. package/dist/components/navigation/index.js +8 -8
  37. package/dist/components/navigation/navigation-creators.d.ts +6 -7
  38. package/dist/components/navigation/navigation-creators.js +8 -8
  39. package/dist/components/screens/AboutScreen.js +2 -2
  40. package/dist/components/screens/LoginScreen.d.ts +2 -2
  41. package/dist/components/screens/LoginScreen.js +4 -4
  42. package/dist/components/screens/create-incident/CreateIncidentScreen.js +51 -5
  43. package/dist/components/screens/create-incident/createIncident.js +62 -1
  44. package/dist/components/screens/language/SelectLanguageScreen.js +5 -5
  45. package/dist/components/screens/language/components/SelectLanguageCellGroup.js +2 -2
  46. package/dist/components/screens/release-notes/ReleaseNotesScreen.js +5 -8
  47. package/dist/components/screens/release-notes/WhatsNewScreen.js +6 -6
  48. package/dist/components/screens/release-notes/fetchReleaseNotes.js +1 -11
  49. package/dist/components/screens/settings/Section.js +1 -9
  50. package/dist/components/screens/settings/SettingsScreen.js +6 -6
  51. package/dist/components/screens/settings/index.js +6 -6
  52. package/dist/components/screens/settings/useSignOut.d.ts +1 -1
  53. package/dist/components/screens/settings/useSignOut.js +4 -4
  54. package/dist/components/service-message/ServiceMessageBanner.js +4 -4
  55. package/dist/components/service-message/ServiceMessageProvider.js +3 -3
  56. package/dist/components/service-message/hooks/useFetchServiceMessage.d.ts +0 -1
  57. package/dist/components/service-message/hooks/useFetchServiceMessage.js +2 -2
  58. package/dist/hooks/UseReleaseNotes.js +3 -6
  59. package/dist/hooks/index.js +1 -9
  60. package/dist/hooks/useAccountOrDemoAccount.js +1 -9
  61. package/dist/hooks/useNavigateFromLanguageSelectScreen.js +2 -2
  62. package/dist/hooks/useNavigateFromLoginScreen.js +3 -3
  63. package/dist/hooks/useNavigateFromWhatsNewScreen.js +3 -3
  64. package/dist/hooks/useScreenTitleFromDictionary.js +2 -2
  65. package/dist/index.js +55 -77
  66. package/dist/language/useDictionary.js +1 -1
  67. package/dist/store/index.js +2 -2
  68. package/dist/store/language/index.js +1 -1
  69. package/dist/store/language/language.js +1 -1
  70. package/dist/store/mad-config/hooks.d.ts +3 -3
  71. package/dist/store/mad-config/hooks.js +1 -1
  72. package/dist/store/mad-config/index.js +1 -1
  73. package/dist/store/mad-config/mad-config.js +1 -1
  74. package/dist/utils/MadCoreProviders.d.ts +1 -1
  75. package/dist/utils/MadCoreProviders.js +5 -5
  76. package/dist/utils/createEnvironmentProxy.d.ts +2 -2
  77. package/dist/utils/createEnvironmentProxy.js +1 -1
  78. package/dist/utils/createMadCoreNavigator.d.ts +6 -6
  79. package/dist/utils/createMadCoreNavigator.js +41 -22
  80. package/dist/utils/initiateAuthenticationClient.js +1 -11
  81. package/package.json +10 -11
  82. package/dist/chunk-3YVGPC4G.js +0 -41
  83. package/dist/chunk-GE4JC2VP.js +0 -98
  84. package/dist/chunk-JYWP44JR.js +0 -0
  85. package/dist/chunk-NJ5W3O5I.js +0 -30
  86. package/dist/chunk-WDZF2C5R.js +0 -20
  87. package/dist/chunk-ZIV7DVBA.js +0 -158
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @equinor/mad-core
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 07f0174: Authentication package fix to accept scope after migration to expo auth session
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [07f0174]
12
+ - @equinor/mad-auth@0.4.0
13
+
14
+ ## 0.14.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 7bf5e2b: React Native Architecture Upgrade -> Expo sdk upgraded to version 53
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [7bf5e2b]
23
+ - @equinor/mad-components@0.23.0
24
+ - @equinor/mad-navigation@0.6.0
25
+ - @equinor/mad-insights@0.2.0
26
+ - @equinor/mad-toast@0.3.0
27
+ - @equinor/mad-auth@0.3.0
28
+
3
29
  ## 0.13.0
4
30
 
5
31
  ### Minor Changes
@@ -3,14 +3,14 @@ import {
3
3
  } from "./chunk-4DXH3SPN.js";
4
4
  import {
5
5
  fetchAllReleaseNotes
6
- } from "./chunk-7FO6SNUK.js";
6
+ } from "./chunk-QGFTS65Y.js";
7
7
  import {
8
8
  useDemoMode
9
9
  } from "./chunk-UZ6YMQV2.js";
10
10
  import {
11
11
  useEnvironment,
12
12
  useServicePortalName
13
- } from "./chunk-GEEFQMRN.js";
13
+ } from "./chunk-RBFR3YMY.js";
14
14
 
15
15
  // src/hooks/UseReleaseNotes.tsx
16
16
  import { useEffect, useMemo, useState } from "react";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BIMOM43W.js";
4
4
  import {
5
5
  useDictionary
6
- } from "./chunk-GEEFQMRN.js";
6
+ } from "./chunk-RBFR3YMY.js";
7
7
 
8
8
  // src/hooks/useScreenTitleFromDictionary.ts
9
9
  import { useLayoutEffect } from "react";
@@ -0,0 +1,13 @@
1
+ // src/utils/initiateAuthenticationClient.ts
2
+ import { ExpoAuthSession } from "@equinor/mad-auth";
3
+ var initiateAuthenticationClient = () => {
4
+ const discovery = ExpoAuthSession.getDiscovery();
5
+ const config = ExpoAuthSession.getConfig();
6
+ if (!(!discovery || !config)) {
7
+ void ExpoAuthSession.initiateAuthenticationClient(config, discovery);
8
+ }
9
+ };
10
+
11
+ export {
12
+ initiateAuthenticationClient
13
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useEnvironment
3
- } from "./chunk-GEEFQMRN.js";
3
+ } from "./chunk-RBFR3YMY.js";
4
4
 
5
5
  // src/components/EnvironmentProvider.tsx
6
6
  import { EnvironmentProvider as ProvideEnvironment } from "@equinor/mad-components";
@@ -0,0 +1,353 @@
1
+ import {
2
+ WhatsNewScreen
3
+ } from "./chunk-OAVRCDCP.js";
4
+ import {
5
+ UserInfo
6
+ } from "./chunk-3WUJAVUO.js";
7
+ import {
8
+ SelectLanguageScreen
9
+ } from "./chunk-COSM7WGR.js";
10
+ import {
11
+ ReleaseNotesScreen
12
+ } from "./chunk-D4SVYUGC.js";
13
+ import {
14
+ createNativeStackNavigator,
15
+ createStackNavigator
16
+ } from "./chunk-XMQYRBUW.js";
17
+ import {
18
+ AboutScreen
19
+ } from "./chunk-PYTNVR7M.js";
20
+ import {
21
+ LoginScreen
22
+ } from "./chunk-ZAEB6ZS3.js";
23
+ import {
24
+ initiateAuthenticationClient
25
+ } from "./chunk-5O4PAUNU.js";
26
+ import {
27
+ MadCoreProviders
28
+ } from "./chunk-UOOFD7CI.js";
29
+ import {
30
+ getDefaultScreenOptionsForLoginScreen
31
+ } from "./chunk-RGJ4RWVB.js";
32
+ import {
33
+ getMadCommonBaseUrl,
34
+ getMadCommonScopes
35
+ } from "./chunk-ZB37EIZB.js";
36
+ import {
37
+ useAccountOrDemoAccount
38
+ } from "./chunk-LEWQGDM7.js";
39
+ import {
40
+ setConfig,
41
+ useEnvironment,
42
+ useMadConfig,
43
+ useServiceNow
44
+ } from "./chunk-RBFR3YMY.js";
45
+ import {
46
+ CoreRoutes
47
+ } from "./chunk-UKAZW3CQ.js";
48
+ import {
49
+ __async,
50
+ __spreadProps,
51
+ __spreadValues
52
+ } from "./chunk-CWMXXUWU.js";
53
+
54
+ // src/utils/createMadCoreNavigator.tsx
55
+ import React2 from "react";
56
+
57
+ // src/components/screens/create-incident/CreateIncidentScreen.tsx
58
+ import {
59
+ Button,
60
+ Cell,
61
+ EDSStyleSheet,
62
+ Spacer,
63
+ TextField,
64
+ Typography,
65
+ useStyles
66
+ } from "@equinor/mad-components";
67
+ import * as Device from "expo-device";
68
+ import * as Localization from "expo-localization";
69
+ import React, { useState } from "react";
70
+ import { KeyboardAvoidingView, LayoutAnimation, Platform, ScrollView, View } from "react-native";
71
+ var CreateIncidentScreen = () => {
72
+ var _a, _b, _c, _d;
73
+ const [error, setError] = useState(null);
74
+ const [ticketNumber, setTicketNumber] = useState(void 0);
75
+ const [ticketTitle, setTicketTitle] = useState(void 0);
76
+ const [ticketDescription, setTicketDescription] = useState(void 0);
77
+ const [isSending, setIsSending] = useState(false);
78
+ const account = useAccountOrDemoAccount();
79
+ const serviceNowConfigurationItem = useServiceNow();
80
+ const environment = useEnvironment();
81
+ const styles = useStyles(createIncidentStyles);
82
+ const timeZone = (_b = (_a = Localization.getCalendars()[0]) == null ? void 0 : _a.timeZone) != null ? _b : "Unknown TimeZone";
83
+ const locale = (_d = (_c = Localization.getLocales()[0]) == null ? void 0 : _c.languageTag) != null ? _d : "Unknown Locale";
84
+ const onSubmit = () => {
85
+ setIsSending(true);
86
+ const data = {
87
+ callerEmail: account == null ? void 0 : account.username,
88
+ title: ticketTitle,
89
+ description: createDescription()
90
+ };
91
+ createIncident(data, environment, serviceNowConfigurationItem).then((response) => {
92
+ LayoutAnimation.configureNext({
93
+ duration: 500,
94
+ update: {
95
+ type: LayoutAnimation.Types.easeInEaseOut
96
+ },
97
+ create: {
98
+ type: LayoutAnimation.Types.easeInEaseOut,
99
+ property: LayoutAnimation.Properties.opacity
100
+ }
101
+ });
102
+ if (response.result.details.number) {
103
+ setTicketNumber(response.result.details.number);
104
+ } else {
105
+ setError(response);
106
+ }
107
+ setTicketDescription(void 0);
108
+ setTicketTitle(void 0);
109
+ setIsSending(false);
110
+ }).catch(setError).finally(() => setIsSending(false));
111
+ };
112
+ const createDescription = () => {
113
+ let description = "";
114
+ description += `User: ${account == null ? void 0 : account.username}
115
+ `;
116
+ description += `Device Brand: ${Device.brand}
117
+ `;
118
+ description += `Device: ${Device.deviceName}
119
+ `;
120
+ description += `Operating System: ${Device.osVersion}
121
+ `;
122
+ description += `Time Zone: ${timeZone}
123
+ `;
124
+ description += `Locale: ${locale}
125
+ `;
126
+ return `${description}
127
+ ${ticketDescription}`;
128
+ };
129
+ return /* @__PURE__ */ React.createElement(
130
+ KeyboardAvoidingView,
131
+ {
132
+ behavior: "padding",
133
+ keyboardVerticalOffset: 115,
134
+ style: styles.container
135
+ },
136
+ /* @__PURE__ */ React.createElement(ScrollView, { contentInsetAdjustmentBehavior: "automatic" }, /* @__PURE__ */ React.createElement(Spacer, null), /* @__PURE__ */ React.createElement(Cell, null, /* @__PURE__ */ React.createElement(View, { style: styles.topTextContainer }, /* @__PURE__ */ React.createElement(Typography, { variant: "h1" }, "Create ticket in ServiceNow"), /* @__PURE__ */ React.createElement(Typography, { group: "paragraph", variant: "body_short" }, "We collect information about your device as part of our feedback process. By submitting, you agree to share the following information:")), /* @__PURE__ */ React.createElement(UserInfo, { infoType: "User", infoValue: account == null ? void 0 : account.username }), Platform.OS !== "web" && /* @__PURE__ */ React.createElement(UserInfo, { infoType: "Device Brand", infoValue: Device.brand }), Platform.OS !== "web" && /* @__PURE__ */ React.createElement(UserInfo, { infoType: "Device", infoValue: Device.deviceName }), /* @__PURE__ */ React.createElement(UserInfo, { infoType: "Operating System", infoValue: Device.osVersion }), /* @__PURE__ */ React.createElement(UserInfo, { infoType: "Time Zone", infoValue: timeZone }), /* @__PURE__ */ React.createElement(UserInfo, { infoType: "Locale", infoValue: locale }), ticketNumber && /* @__PURE__ */ React.createElement(View, { style: [styles.popupBox, styles.popupSuccess] }, /* @__PURE__ */ React.createElement(Typography, null, "Ticket number: "), /* @__PURE__ */ React.createElement(Typography, { selectable: true }, ticketNumber)), error && /* @__PURE__ */ React.createElement(View, { style: [styles.popupBox, styles.popupDanger] }, /* @__PURE__ */ React.createElement(Typography, null, "An error occurred creating your ticket:"), /* @__PURE__ */ React.createElement(Typography, { selectable: true }, error instanceof Error ? error.message : "")), /* @__PURE__ */ React.createElement(View, { style: styles.titleField }, /* @__PURE__ */ React.createElement(
137
+ TextField,
138
+ {
139
+ onChange: setTicketTitle,
140
+ value: ticketTitle,
141
+ placeholder: "Write a title for the Service Now ticket",
142
+ readOnly: isSending
143
+ }
144
+ )), /* @__PURE__ */ React.createElement(View, { style: styles.titleField }, /* @__PURE__ */ React.createElement(
145
+ TextField,
146
+ {
147
+ multiline: true,
148
+ onChange: setTicketDescription,
149
+ placeholder: "Write a complete description of your issue. You do not need to provide information about your device.",
150
+ value: ticketDescription,
151
+ readOnly: isSending
152
+ }
153
+ )), /* @__PURE__ */ React.createElement(View, { style: styles.buttonContainer }, /* @__PURE__ */ React.createElement(
154
+ Button,
155
+ {
156
+ disabled: !ticketTitle || !ticketDescription || isSending,
157
+ onPress: onSubmit,
158
+ style: { width: 81 },
159
+ title: "Send"
160
+ }
161
+ ))))
162
+ );
163
+ };
164
+ var createIncidentStyles = EDSStyleSheet.create((theme) => ({
165
+ container: {
166
+ flex: 1
167
+ },
168
+ topTextContainer: {
169
+ paddingBottom: theme.geometry.dimension.cell.minHeight
170
+ },
171
+ titleField: {
172
+ marginVertical: theme.spacing.textField.paddingVertical * 3
173
+ },
174
+ multiTextField: {
175
+ height: theme.geometry.dimension.dialog.minHeight
176
+ },
177
+ buttonContainer: {
178
+ flexDirection: "row",
179
+ justifyContent: "flex-end"
180
+ },
181
+ popupBox: {
182
+ padding: 24,
183
+ marginTop: 16,
184
+ borderWidth: 2,
185
+ borderRadius: 4,
186
+ flexDirection: "row",
187
+ gap: 8,
188
+ flexWrap: "wrap"
189
+ },
190
+ popupDanger: {
191
+ borderColor: theme.colors.feedback.danger
192
+ },
193
+ popupSuccess: {
194
+ borderColor: theme.colors.feedback.success
195
+ }
196
+ }));
197
+
198
+ // src/utils/createMadCoreNavigator.tsx
199
+ var createMadCoreNativeStackNavigator = (Stack) => {
200
+ function MadCoreNavigator(props) {
201
+ const config = useMadConfig();
202
+ if (!config) return null;
203
+ return /* @__PURE__ */ React2.createElement(MadCoreProviders, { config, type: "native-stack" }, /* @__PURE__ */ React2.createElement(Stack.Navigator, __spreadProps(__spreadValues({}, props), { initialRouteName: CoreRoutes.LOGIN }), config.login.addScreenManually !== true && /* @__PURE__ */ React2.createElement(
204
+ Stack.Screen,
205
+ {
206
+ name: CoreRoutes.LOGIN,
207
+ component: LoginScreen,
208
+ options: getDefaultScreenOptionsForLoginScreen()
209
+ }
210
+ ), /* @__PURE__ */ React2.createElement(Stack.Screen, { name: CoreRoutes.RELEASE_NOTES, component: ReleaseNotesScreen }), /* @__PURE__ */ React2.createElement(Stack.Screen, { name: CoreRoutes.WHATS_NEW, component: WhatsNewScreen }), config.about && /* @__PURE__ */ React2.createElement(Stack.Screen, { name: CoreRoutes.ABOUT, component: AboutScreen }), config.serviceNow && /* @__PURE__ */ React2.createElement(Stack.Screen, { name: CoreRoutes.FEEDBACK, component: CreateIncidentScreen }), config.language.supportedLanguages.length > 1 && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
211
+ Stack.Screen,
212
+ {
213
+ name: CoreRoutes.SELECT_LANGUAGE,
214
+ component: SelectLanguageScreen
215
+ }
216
+ ), /* @__PURE__ */ React2.createElement(
217
+ Stack.Screen,
218
+ {
219
+ name: CoreRoutes.SELECT_LANGUAGE_ONBOARDING,
220
+ component: SelectLanguageScreen,
221
+ options: { headerBackVisible: false }
222
+ }
223
+ )), props.children));
224
+ }
225
+ return MadCoreNavigator;
226
+ };
227
+ var createMadCoreStackNavigator = (Stack) => {
228
+ function MadCoreNavigator(props) {
229
+ const config = useMadConfig();
230
+ if (!config) return null;
231
+ return /* @__PURE__ */ React2.createElement(MadCoreProviders, { config, type: "stack" }, /* @__PURE__ */ React2.createElement(Stack.Navigator, __spreadProps(__spreadValues({}, props), { initialRouteName: CoreRoutes.LOGIN }), config.login.addScreenManually !== true && /* @__PURE__ */ React2.createElement(
232
+ Stack.Screen,
233
+ {
234
+ name: CoreRoutes.LOGIN,
235
+ component: LoginScreen,
236
+ options: getDefaultScreenOptionsForLoginScreen()
237
+ }
238
+ ), /* @__PURE__ */ React2.createElement(Stack.Screen, { name: CoreRoutes.RELEASE_NOTES, component: ReleaseNotesScreen }), /* @__PURE__ */ React2.createElement(Stack.Screen, { name: CoreRoutes.WHATS_NEW, component: WhatsNewScreen }), config.about && /* @__PURE__ */ React2.createElement(Stack.Screen, { name: CoreRoutes.ABOUT, component: AboutScreen }), config.serviceNow && /* @__PURE__ */ React2.createElement(Stack.Screen, { name: CoreRoutes.FEEDBACK, component: CreateIncidentScreen }), config.language.supportedLanguages.length > 1 && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
239
+ Stack.Screen,
240
+ {
241
+ name: CoreRoutes.SELECT_LANGUAGE,
242
+ component: SelectLanguageScreen
243
+ }
244
+ ), /* @__PURE__ */ React2.createElement(
245
+ Stack.Screen,
246
+ {
247
+ name: CoreRoutes.SELECT_LANGUAGE_ONBOARDING,
248
+ component: SelectLanguageScreen,
249
+ options: { headerLeft: () => null }
250
+ }
251
+ )), props.children));
252
+ }
253
+ return MadCoreNavigator;
254
+ };
255
+
256
+ // src/components/createCoreStackNavigator.tsx
257
+ var createStackCoreNavigator = (config) => {
258
+ setConfig(config);
259
+ initiateAuthenticationClient();
260
+ const Stack = createStackNavigator();
261
+ const Navigator = createMadCoreStackNavigator(Stack);
262
+ return __spreadProps(__spreadValues({}, Stack), { Navigator });
263
+ };
264
+ var createNativeStackCoreNavigator = (config) => {
265
+ setConfig(config);
266
+ initiateAuthenticationClient();
267
+ const Stack = createNativeStackNavigator();
268
+ const Navigator = createMadCoreNativeStackNavigator(Stack);
269
+ return __spreadProps(__spreadValues({}, Stack), { Navigator });
270
+ };
271
+ var createCoreStackNavigator = (config) => createNativeStackCoreNavigator(config);
272
+
273
+ // src/index.ts
274
+ import {
275
+ appInsightsHasBeenInitialized,
276
+ addTelemetryInitializer,
277
+ Envelope,
278
+ metricKeys,
279
+ metricStatus,
280
+ track,
281
+ trackCustom,
282
+ trackLongTerm,
283
+ trackShortTerm
284
+ } from "@equinor/mad-insights";
285
+ import { addToast, ToastTypes, ToastType } from "@equinor/mad-toast";
286
+ import { MadAccount, MadAuthenticationResult } from "@equinor/mad-auth";
287
+ import { ExpoAuthSession } from "@equinor/mad-auth";
288
+ var authenticateSilently = (scopes) => (
289
+ // hasExpoAuthSession()
290
+ ExpoAuthSession.authenticateSilently(scopes)
291
+ );
292
+ var getAccount = () => __async(null, null, function* () {
293
+ return (
294
+ // hasExpoAuthSession() ?
295
+ Promise.resolve(ExpoAuthSession.getAccount())
296
+ );
297
+ });
298
+ var signOut = () => __async(null, null, function* () {
299
+ return (
300
+ // hasExpoAuthSession() ?
301
+ ExpoAuthSession.signOut()
302
+ );
303
+ });
304
+ var authenticateInteractively = (scopes) => (
305
+ // hasExpoAuthSession()
306
+ ExpoAuthSession.authenticateInteractively(scopes)
307
+ );
308
+
309
+ // src/components/screens/create-incident/createIncident.ts
310
+ var createIncident = (data, env, serviceNow) => __async(null, null, function* () {
311
+ const baseUrl = getMadCommonBaseUrl(env);
312
+ const scopes = getMadCommonScopes(env);
313
+ const authenticationResponse = yield authenticateSilently(scopes);
314
+ if (!authenticationResponse) throw new Error("Unable to authenticate silently");
315
+ const fetchResponse = yield fetch(`${baseUrl}/ServiceNow/apps/${serviceNow}/incidents`, {
316
+ method: "POST",
317
+ body: JSON.stringify(data),
318
+ headers: new Headers({
319
+ Accept: "application/json",
320
+ "Content-Type": "application/json",
321
+ Authorization: `Bearer ${authenticationResponse.accessToken}`
322
+ })
323
+ });
324
+ return yield fetchResponse.json().then((result) => JSON.parse(result));
325
+ });
326
+
327
+ export {
328
+ createIncident,
329
+ CreateIncidentScreen,
330
+ createMadCoreNativeStackNavigator,
331
+ createMadCoreStackNavigator,
332
+ createStackCoreNavigator,
333
+ createNativeStackCoreNavigator,
334
+ createCoreStackNavigator,
335
+ authenticateSilently,
336
+ getAccount,
337
+ signOut,
338
+ authenticateInteractively,
339
+ appInsightsHasBeenInitialized,
340
+ addTelemetryInitializer,
341
+ Envelope,
342
+ metricKeys,
343
+ metricStatus,
344
+ track,
345
+ trackCustom,
346
+ trackLongTerm,
347
+ trackShortTerm,
348
+ addToast,
349
+ ToastTypes,
350
+ ToastType,
351
+ MadAccount,
352
+ MadAuthenticationResult
353
+ };
@@ -17,7 +17,7 @@ import {
17
17
  useLanguage,
18
18
  useMadConfig,
19
19
  useNavigateToMainRoute
20
- } from "./chunk-GEEFQMRN.js";
20
+ } from "./chunk-RBFR3YMY.js";
21
21
 
22
22
  // src/hooks/useNavigateFromLoginScreen.ts
23
23
  var useNavigateFromLoginScreen = () => {
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  SelectLanguageCellGroup
3
- } from "./chunk-KEH6NBFE.js";
3
+ } from "./chunk-G4GPSIHD.js";
4
4
  import {
5
5
  useScreenTitleFromDictionary
6
- } from "./chunk-U5IJVQDO.js";
6
+ } from "./chunk-5JFNRREO.js";
7
7
  import {
8
8
  useNavigateFromLanguageSelectScreen
9
- } from "./chunk-IHCNAGT7.js";
9
+ } from "./chunk-SRQFW6D5.js";
10
10
  import {
11
11
  useDictionary,
12
12
  useLanguage
13
- } from "./chunk-GEEFQMRN.js";
13
+ } from "./chunk-RBFR3YMY.js";
14
14
 
15
15
  // src/components/screens/language/SelectLanguageScreen.tsx
16
16
  import React, { useState } from "react";
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-OCWASWDK.js";
7
7
  import {
8
8
  useScreenTitleFromDictionary
9
- } from "./chunk-U5IJVQDO.js";
9
+ } from "./chunk-5JFNRREO.js";
10
10
  import {
11
11
  useReleaseNotes
12
- } from "./chunk-DJMBVNB6.js";
12
+ } from "./chunk-4MZFJLIZ.js";
13
13
 
14
14
  // src/components/screens/release-notes/ReleaseNotesScreen.tsx
15
15
  import React from "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useLanguage
3
- } from "./chunk-GEEFQMRN.js";
3
+ } from "./chunk-RBFR3YMY.js";
4
4
 
5
5
  // src/components/screens/language/components/SelectLanguageCellGroup.tsx
6
6
  import React from "react";
@@ -4,27 +4,20 @@ import {
4
4
  import {
5
5
  useDemoMode
6
6
  } from "./chunk-UZ6YMQV2.js";
7
- import {
8
- getConfig
9
- } from "./chunk-GEEFQMRN.js";
10
7
  import {
11
8
  CoreRoutes
12
9
  } from "./chunk-UKAZW3CQ.js";
13
- import {
14
- __async
15
- } from "./chunk-CWMXXUWU.js";
16
10
 
17
11
  // src/components/screens/settings/useSignOut.ts
18
12
  import { useCallback } from "react";
19
- import { ExpoAuthSession, signOut } from "@equinor/mad-auth";
13
+ import { ExpoAuthSession } from "@equinor/mad-auth";
20
14
  import { alert } from "@equinor/mad-components";
21
15
  var useSignOut = () => {
22
16
  const navigation = useCoreStackNavigation();
23
17
  const demoMode = useDemoMode();
24
- const signOutFn = useCallback(() => __async(void 0, null, function* () {
25
- var _a;
18
+ const signOutFn = useCallback(() => {
26
19
  try {
27
- const result = ((_a = getConfig().experimental) == null ? void 0 : _a.useExpoAuthSession) ? ExpoAuthSession.signOut() : yield signOut();
20
+ const result = ExpoAuthSession.signOut();
28
21
  if (!demoMode.isEnabled && !result) throw new Error("Unable to sign out");
29
22
  demoMode.disableDemoMode();
30
23
  navigation.navigate(CoreRoutes.LOGIN);
@@ -34,7 +27,7 @@ var useSignOut = () => {
34
27
  { text: "Cancel", onPress: () => void 0 }
35
28
  ]);
36
29
  }
37
- }), [navigation, demoMode]);
30
+ }, [navigation, demoMode]);
38
31
  return signOutFn;
39
32
  };
40
33
 
@@ -8,7 +8,7 @@ import {
8
8
  useLanguage,
9
9
  useMadConfig,
10
10
  useNavigateToMainRoute
11
- } from "./chunk-GEEFQMRN.js";
11
+ } from "./chunk-RBFR3YMY.js";
12
12
 
13
13
  // src/hooks/useNavigateFromWhatsNewScreen.ts
14
14
  var useNavigateFromWhatsNewScreen = () => {
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-SHKOH7MA.js";
13
13
  import {
14
14
  useServiceMessageState
15
- } from "./chunk-DIITQCRW.js";
15
+ } from "./chunk-TO775HMH.js";
16
16
  import {
17
17
  __spreadProps,
18
18
  __spreadValues
@@ -1,23 +1,18 @@
1
1
  import {
2
2
  useDemoMode
3
3
  } from "./chunk-UZ6YMQV2.js";
4
- import {
5
- getConfig
6
- } from "./chunk-GEEFQMRN.js";
7
4
 
8
5
  // src/hooks/useAccountOrDemoAccount.ts
9
- import { ExpoAuthSession, useAccount } from "@equinor/mad-auth";
6
+ import { ExpoAuthSession } from "@equinor/mad-auth";
10
7
  var MAD_DEMO_USER = {
11
8
  name: "Demo user",
12
9
  username: "demo.user@example.com",
13
10
  identifier: "-1"
14
11
  };
15
12
  var useAccountOrDemoAccount = () => {
16
- var _a;
17
13
  const demoMode = useDemoMode();
18
- const msalAccount = useAccount();
19
14
  const expoAccount = ExpoAuthSession.useAccount();
20
- const account = ((_a = getConfig().experimental) == null ? void 0 : _a.useExpoAuthSession) ? expoAccount : msalAccount;
15
+ const account = expoAccount;
21
16
  if (demoMode.isEnabled) return MAD_DEMO_USER;
22
17
  return account;
23
18
  };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ZB37EIZB.js";
4
4
  import {
5
5
  getConfig
6
- } from "./chunk-GEEFQMRN.js";
6
+ } from "./chunk-RBFR3YMY.js";
7
7
 
8
8
  // src/components/service-message/hooks/useFetchServiceMessage.ts
9
9
  import { useEffect, useRef, useState } from "react";
@@ -13,7 +13,7 @@ var useFetchServiceMessage = () => {
13
13
  const [expansionEnabled, setExpansionEnabled] = useState(false);
14
14
  const [isExpanded, setIsExpanded] = useState(false);
15
15
  const [isError, setIsError] = useState(false);
16
- const lastInterval = useRef();
16
+ const lastInterval = useRef(void 0);
17
17
  useEffect(() => {
18
18
  function fetchServiceMessage() {
19
19
  const { currentEnvironment, servicePortalName } = getConfig();
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ServiceMessageBanner
3
- } from "./chunk-ETY3HZNI.js";
3
+ } from "./chunk-IXKJM7VZ.js";
4
4
  import {
5
5
  EnvironmentBanner
6
- } from "./chunk-PB3TI2RT.js";
6
+ } from "./chunk-RPD2KUSY.js";
7
7
  import {
8
8
  OfflineBanner
9
9
  } from "./chunk-SQL63BYO.js";
@@ -9,16 +9,16 @@ import {
9
9
  } from "./chunk-5BVQKJQB.js";
10
10
  import {
11
11
  useNavigateFromWhatsNewScreen
12
- } from "./chunk-EOM477VC.js";
12
+ } from "./chunk-IPJ2CVM4.js";
13
13
  import {
14
14
  useScreenTitleFromDictionary
15
- } from "./chunk-U5IJVQDO.js";
15
+ } from "./chunk-5JFNRREO.js";
16
16
  import {
17
17
  whats_new_exports
18
18
  } from "./chunk-4DXH3SPN.js";
19
19
  import {
20
20
  fetchReleaseNotes
21
- } from "./chunk-7FO6SNUK.js";
21
+ } from "./chunk-QGFTS65Y.js";
22
22
  import {
23
23
  useDemoMode
24
24
  } from "./chunk-UZ6YMQV2.js";
@@ -26,7 +26,7 @@ import {
26
26
  useAppVersion,
27
27
  useEnvironment,
28
28
  useServicePortalName
29
- } from "./chunk-GEEFQMRN.js";
29
+ } from "./chunk-RBFR3YMY.js";
30
30
  import {
31
31
  __spreadProps,
32
32
  __spreadValues
@@ -7,9 +7,8 @@ import {
7
7
  import {
8
8
  useAbout,
9
9
  useAppVersion,
10
- useEnvironment,
11
- useExperimentalFeatures
12
- } from "./chunk-GEEFQMRN.js";
10
+ useEnvironment
11
+ } from "./chunk-RBFR3YMY.js";
13
12
 
14
13
  // src/components/screens/AboutScreen.tsx
15
14
  import React from "react";
@@ -23,8 +22,7 @@ var AboutScreen = () => {
23
22
  const appVersion = useAppVersion();
24
23
  const about = useAbout();
25
24
  const coreNavigatorType = useCoreNavigatorType();
26
- const experimentalFeatures = useExperimentalFeatures();
27
- const authenticationMethod = (experimentalFeatures == null ? void 0 : experimentalFeatures.useExpoAuthSession) ? "Expo" : "MSAL";
25
+ const authenticationMethod = "Expo";
28
26
  const endpoints = Array.from(
29
27
  new Set([getMadCommonBaseUrl(environment)].concat((_a = about == null ? void 0 : about.endpoints) != null ? _a : []))
30
28
  );