@intra-mart/smartlime 2.0.0-dev.20241121 → 2.0.0-dev.20241210

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,50 @@
1
+ import tsParser from '@typescript-eslint/parser';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import js from '@eslint/js';
5
+ import { FlatCompat } from '@eslint/eslintrc';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ const compat = new FlatCompat({
10
+ baseDirectory: __dirname,
11
+ recommendedConfig: js.configs.recommended,
12
+ allConfig: js.configs.all,
13
+ });
14
+
15
+ export default [
16
+ ...compat.extends(
17
+ 'plugin:react/recommended',
18
+ 'plugin:@typescript-eslint/recommended',
19
+ 'prettier'
20
+ ),
21
+ {
22
+ languageOptions: {
23
+ parser: tsParser,
24
+ ecmaVersion: 2020,
25
+ sourceType: 'module',
26
+
27
+ parserOptions: {
28
+ ecmaFeatures: {
29
+ jsx: true,
30
+ },
31
+ },
32
+ },
33
+
34
+ settings: {
35
+ react: {
36
+ version: 'detect',
37
+ },
38
+ },
39
+
40
+ rules: {
41
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
42
+ '@typescript-eslint/ban-ts-comment': 'off',
43
+ '@typescript-eslint/no-empty-function': 'off',
44
+ 'react/react-in-jsx-scope': 'off',
45
+ 'react/prop-types': 'off',
46
+ 'react/display-name': 'off',
47
+ 'react/jsx-key': 'off',
48
+ },
49
+ },
50
+ ];
@@ -1,14 +1,14 @@
1
- type ForceRender<T> = (args?: T) => void;
2
- export declare const createRenderTarget: <T = undefined>() => {
3
- addEventListener: (callback: ForceRender<T>) => void;
4
- removeEventListener: (callback: ForceRender<T>) => void;
5
- dispatch: (args?: T | undefined) => void;
1
+ type ForceRender = () => void;
2
+ export declare const createRenderTarget: () => {
3
+ addEventListener: (callback: ForceRender) => void;
4
+ removeEventListener: (callback: ForceRender) => void;
5
+ dispatch: () => void;
6
6
  };
7
- export type CreateRenderTarget<T = undefined> = typeof createRenderTarget<T>;
8
- export type RenderTarget<T = undefined> = ReturnType<CreateRenderTarget<T>>;
9
- export declare const useRenderTarget: <T = undefined>() => {
10
- addEventListener: (callback: ForceRender<T>) => void;
11
- removeEventListener: (callback: ForceRender<T>) => void;
12
- dispatch: (args?: T | undefined) => void;
7
+ export type CreateRenderTarget = typeof createRenderTarget;
8
+ export type RenderTarget = ReturnType<CreateRenderTarget>;
9
+ export declare const useRenderTarget: () => {
10
+ addEventListener: (callback: ForceRender) => void;
11
+ removeEventListener: (callback: ForceRender) => void;
12
+ dispatch: () => void;
13
13
  };
14
14
  export {};
@@ -12,11 +12,11 @@ export const createRenderTarget = () => {
12
12
  }
13
13
  }
14
14
  };
15
- const dispatch = (args) => {
15
+ const dispatch = () => {
16
16
  for (let i = 0, l = listenerList.length; i < l; i++) {
17
17
  const listener = listenerList[i];
18
18
  if (listener)
19
- listener(args);
19
+ listener();
20
20
  }
21
21
  };
22
22
  return {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ErrorResult, SuccessResult } from '.';
3
2
  import { RenderTarget } from '../../_shared/renderTarget';
4
3
  import { Me } from './type';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { RenderTarget } from '../../_shared/renderTarget';
3
2
  import { Context as DefaultContext } from './Context';
4
3
  import { Me } from './type';
@@ -1,17 +1,5 @@
1
- /// <reference types="react" />
1
+ import { AuthState, StartAuthResult } from '.';
2
2
  import { RenderTarget } from '../../_shared/renderTarget';
3
- import { AuthSessionResult } from 'expo-auth-session';
4
- import { IMOAuthError } from './IMOAuthError';
5
- export type AuthState = 'initializing' | 'unauthorized' | 'authorized';
6
- export type StartAuthResult = {
7
- readonly type: 'cancel' | 'dismiss' | 'opened' | 'locked' | 'error';
8
- readonly detail: AuthSessionResult;
9
- } | {
10
- readonly type: 'success';
11
- } | {
12
- readonly type: 'exception';
13
- readonly exceptionDetail: unknown;
14
- };
15
3
  export interface OAuthContext {
16
4
  getAuthState: () => AuthState;
17
5
  getToken: () => string | null;
@@ -21,6 +9,5 @@ export interface OAuthContext {
21
9
  startAuth: () => Promise<StartAuthResult>;
22
10
  tokenRenderTarget: RenderTarget;
23
11
  authStateRenderTarget: RenderTarget;
24
- authErrorRenderTarget: RenderTarget<IMOAuthError>;
25
12
  }
26
13
  export declare const Context: import("react").Context<OAuthContext | null>;
@@ -3,4 +3,3 @@ export * from './useIMToken';
3
3
  export * from './useStartAuth';
4
4
  export * from './useAuthState';
5
5
  export * from './useAuthStateEffect';
6
- export * from './useAuthError';
@@ -3,4 +3,3 @@ export * from './useIMToken';
3
3
  export * from './useStartAuth';
4
4
  export * from './useAuthState';
5
5
  export * from './useAuthStateEffect';
6
- export * from './useAuthError';
@@ -1,2 +1,2 @@
1
1
  import { Context as DefaultContext } from '../Context';
2
- export declare const useAuthState: (Context?: typeof DefaultContext) => import("../Context").AuthState;
2
+ export declare const useAuthState: (Context?: typeof DefaultContext) => import("..").AuthState;
@@ -1,4 +1,4 @@
1
- import { AuthState } from '../Context';
1
+ import { AuthState } from '..';
2
2
  /**
3
3
  * sugar syntax that sets the return value of "useAuthState" to the deps of "useEffect"
4
4
  * this may be deprecated in the future
@@ -1,2 +1,2 @@
1
1
  import { Context as DefaultContext } from '../Context';
2
- export declare const useStartAuth: (Context?: typeof DefaultContext) => () => Promise<import("../Context").StartAuthResult>;
2
+ export declare const useStartAuth: (Context?: typeof DefaultContext) => () => Promise<import("..").StartAuthResult>;
@@ -1,13 +1,21 @@
1
- /// <reference types="react" />
2
- import * as SecureStore from 'expo-secure-store';
3
- import { Prompt } from 'expo-auth-session';
1
+ import { AuthSessionResult, Prompt } from 'expo-auth-session';
4
2
  import { Context as DefaultContext } from './Context';
3
+ export type AuthState = 'initializing' | 'unauthorized' | 'authorized';
5
4
  export type TokenState = {
6
5
  baseUrl: string;
7
6
  accessToken: string;
8
7
  refreshToken?: string;
9
8
  expirationDate?: number;
10
9
  };
10
+ export type StartAuthResult = {
11
+ readonly type: 'cancel' | 'dismiss' | 'opened' | 'locked' | 'error';
12
+ readonly detail: AuthSessionResult;
13
+ } | {
14
+ readonly type: 'success';
15
+ } | {
16
+ readonly type: 'exception';
17
+ readonly exceptionDetail: unknown;
18
+ };
11
19
  export declare const IMPrompt: {
12
20
  readonly Login: Prompt.Login;
13
21
  readonly None: Prompt.None;
@@ -20,16 +28,12 @@ interface RequestConfig {
20
28
  state?: string;
21
29
  prompt?: Prompt.Login | Prompt.None;
22
30
  }
23
- interface SecureStoreConfig {
24
- storeKey?: string;
25
- keychainAccessible?: SecureStore.KeychainAccessibilityConstant;
26
- }
27
31
  interface IMOAuthProps {
28
32
  children: JSX.Element;
29
33
  requestConfig: RequestConfig;
30
34
  remainingTimeToRunRefresh?: number;
31
- secureStore?: SecureStoreConfig;
35
+ storageKey?: string;
32
36
  oauthContext?: typeof DefaultContext;
33
37
  }
34
- export declare const IMOAuth: ({ children, requestConfig, remainingTimeToRunRefresh, secureStore, oauthContext, }: IMOAuthProps) => import("react").JSX.Element;
38
+ export declare const IMOAuth: ({ children, requestConfig, remainingTimeToRunRefresh, storageKey, oauthContext, }: IMOAuthProps) => import("react").JSX.Element;
35
39
  export {};
@@ -1,7 +1,7 @@
1
1
  import * as SecureStore from 'expo-secure-store';
2
2
  import { exchangeCodeAsync, loadAsync, Prompt, refreshAsync, } from 'expo-auth-session';
3
3
  import { useCallback, useLayoutEffect, useMemo, useRef, } from 'react';
4
- import { Context as DefaultContext, } from './Context';
4
+ import { Context as DefaultContext } from './Context';
5
5
  import { IMOAuthError } from './IMOAuthError';
6
6
  import { useRenderTarget } from '../../_shared/renderTarget';
7
7
  import { useIMBaseUrl } from '../..';
@@ -51,17 +51,10 @@ const useDiscovery = () => {
51
51
  };
52
52
  }, [encodedBaseUrl]);
53
53
  };
54
- const useStoreConfig = (secureStore) => {
55
- const storeKey = secureStore?.storeKey;
56
- const keychainAccessible = secureStore?.keychainAccessible;
54
+ const useStorageKey = (storageKey) => {
57
55
  return useMemo(() => {
58
- return {
59
- storeKey: storeKey ? storeKey : DEFAULT_STORAGE_KEY,
60
- keychainAccessible: keychainAccessible !== void 0
61
- ? keychainAccessible
62
- : SecureStore.WHEN_UNLOCKED,
63
- };
64
- }, [storeKey, keychainAccessible]);
56
+ return storageKey ? storageKey : DEFAULT_STORAGE_KEY;
57
+ }, [storageKey]);
65
58
  };
66
59
  const useRemainingTimeToRunRefresh = (remainingTimeToRunRefresh) => {
67
60
  return useMemo(() => {
@@ -70,26 +63,20 @@ const useRemainingTimeToRunRefresh = (remainingTimeToRunRefresh) => {
70
63
  : DEFAULT_REMAINING_TIME_TO_RUN_REFRESH;
71
64
  }, [remainingTimeToRunRefresh]);
72
65
  };
73
- const saveTokenStorage = async (storeConfig, baseUrl, accessToken, refreshToken, expirationDate) => {
66
+ const saveTokenStorage = async (storageKey, baseUrl, accessToken, refreshToken, expirationDate) => {
74
67
  const item = {
75
68
  baseUrl,
76
69
  accessToken,
77
70
  refreshToken,
78
71
  expirationDate,
79
72
  };
80
- return await SecureStore.setItemAsync(storeConfig.storeKey, JSON.stringify(item), {
81
- keychainAccessible: storeConfig.keychainAccessible,
82
- });
73
+ return await SecureStore.setItemAsync(storageKey, JSON.stringify(item));
83
74
  };
84
- const deleteTokenStorage = async (storeConfig) => {
85
- return await SecureStore.deleteItemAsync(storeConfig.storeKey, {
86
- keychainAccessible: storeConfig.keychainAccessible,
87
- });
75
+ const deleteTokenStorage = async (tokenStorageKey) => {
76
+ return await SecureStore.deleteItemAsync(tokenStorageKey);
88
77
  };
89
- const getTokenStorage = async (storeConfig) => {
90
- const state = await SecureStore.getItemAsync(storeConfig.storeKey, {
91
- keychainAccessible: storeConfig.keychainAccessible,
92
- });
78
+ const getTokenStorage = async (storageKey) => {
79
+ const state = await SecureStore.getItemAsync(storageKey);
93
80
  if (state == null)
94
81
  return;
95
82
  const result = JSON.parse(state);
@@ -129,7 +116,7 @@ const checkExpirationDateOfToken = (expirationDate, remainingTimeToRunRefresh) =
129
116
  return true;
130
117
  return false;
131
118
  };
132
- const useRefresh = (storeConfig, refreshTokenRef, expirationDateRef, requestConfig, discovery, setToken, destroy) => {
119
+ const useRefresh = (storageKey, refreshTokenRef, expirationDateRef, requestConfig, discovery, setToken, destroy) => {
133
120
  const baseUrl = useIMBaseUrl();
134
121
  const lockedRef = useRef(false);
135
122
  const waitingLineRef = useRef([]);
@@ -176,7 +163,7 @@ const useRefresh = (storeConfig, refreshTokenRef, expirationDateRef, requestConf
176
163
  }, discovery);
177
164
  const { accessToken, refreshToken, expiresIn } = tokenResponse;
178
165
  const expirationDate = expiresIn ? createExpirationDate(expiresIn) : 0;
179
- await saveTokenStorage(storeConfig, baseUrl, accessToken, refreshToken, expirationDate);
166
+ await saveTokenStorage(storageKey, baseUrl, accessToken, refreshToken, expirationDate);
180
167
  refreshTokenRef.current = refreshToken ? refreshToken : null;
181
168
  expirationDateRef.current = expirationDate;
182
169
  setToken(accessToken);
@@ -191,49 +178,36 @@ const useRefresh = (storeConfig, refreshTokenRef, expirationDateRef, requestConf
191
178
  throw error;
192
179
  }
193
180
  }
194
- }, [storeConfig, requestConfig, discovery, destroy]);
181
+ }, [storageKey, requestConfig, discovery, destroy]);
195
182
  };
196
- const useStartAuth = (storeConfig, remainingTimeToRunRefresh, refreshTokenRef, expirationDateRef, requestConfig, discovery, setToken, refresh, setAuthState, authErrorRenderTarget) => {
183
+ const useStartAuth = (storageKey, remainingTimeToRunRefresh, refreshTokenRef, expirationDateRef, requestConfig, discovery, setToken, refresh, setAuthState) => {
197
184
  const currentBaseUrl = useIMBaseUrl();
198
185
  useLayoutEffect(() => {
199
186
  (async () => {
200
- try {
201
- const tokenState = await getTokenStorage(storeConfig);
202
- if (tokenState) {
203
- const { baseUrl, accessToken, refreshToken, expirationDate } = tokenState;
204
- const expired = checkExpirationDateOfToken(expirationDate ? expirationDate : 0, remainingTimeToRunRefresh);
205
- refreshTokenRef.current = refreshToken ? refreshToken : null;
206
- expirationDateRef.current = expirationDate ? expirationDate : null;
207
- if (currentBaseUrl === baseUrl) {
208
- if (expired) {
209
- await refresh(); // NOTE consideration of how users can catch errors thrown here.
210
- }
211
- else {
212
- setToken(accessToken);
213
- }
214
- setAuthState('authorized');
187
+ const tokenState = await getTokenStorage(storageKey);
188
+ if (tokenState) {
189
+ const { baseUrl, accessToken, refreshToken, expirationDate } = tokenState;
190
+ const expired = checkExpirationDateOfToken(expirationDate ? expirationDate : 0, remainingTimeToRunRefresh);
191
+ refreshTokenRef.current = refreshToken ? refreshToken : null;
192
+ expirationDateRef.current = expirationDate ? expirationDate : null;
193
+ if (currentBaseUrl === baseUrl) {
194
+ if (expired) {
195
+ await refresh(); // NOTE consideration of how users can catch errors thrown here.
215
196
  }
216
197
  else {
217
- setAuthState('unauthorized');
198
+ setToken(accessToken);
218
199
  }
200
+ setAuthState('authorized');
219
201
  }
220
202
  else {
221
203
  setAuthState('unauthorized');
222
204
  }
223
205
  }
224
- catch (e) {
206
+ else {
225
207
  setAuthState('unauthorized');
226
- authErrorRenderTarget.dispatch(new IMOAuthError('an exception occurred while checking the token state.', {
227
- cause: e,
228
- }));
229
208
  }
230
209
  })();
231
- }, [
232
- storeConfig.storeKey,
233
- storeConfig.keychainAccessible,
234
- remainingTimeToRunRefresh,
235
- refresh,
236
- ]);
210
+ }, [storageKey, remainingTimeToRunRefresh, refresh]);
237
211
  const startAuth = useCallback(async () => {
238
212
  const authRequest = await loadAsync({
239
213
  ...requestConfig,
@@ -262,7 +236,7 @@ const useStartAuth = (storeConfig, remainingTimeToRunRefresh, refreshTokenRef, e
262
236
  }, discovery);
263
237
  const { accessToken, refreshToken, expiresIn } = tokenResponse;
264
238
  const expirationDate = expiresIn ? createExpirationDate(expiresIn) : 0;
265
- await saveTokenStorage(storeConfig, currentBaseUrl, accessToken, refreshToken, expirationDate);
239
+ await saveTokenStorage(storageKey, currentBaseUrl, accessToken, refreshToken, expirationDate);
266
240
  refreshTokenRef.current = refreshToken ? refreshToken : null;
267
241
  expirationDateRef.current = expirationDate;
268
242
  setToken(accessToken);
@@ -282,14 +256,14 @@ const useStartAuth = (storeConfig, remainingTimeToRunRefresh, refreshTokenRef, e
282
256
  }, [requestConfig, discovery]);
283
257
  return startAuth;
284
258
  };
285
- const useDestroy = (storeConfig, refreshTokenRef, expirationDateRef, setToken, setAuthState) => {
259
+ const useDestroy = (storageKey, refreshTokenRef, expirationDateRef, setToken, setAuthState) => {
286
260
  return useCallback(async () => {
287
- await deleteTokenStorage(storeConfig);
261
+ await deleteTokenStorage(storageKey);
288
262
  setToken(null);
289
263
  refreshTokenRef.current = null;
290
264
  expirationDateRef.current = null;
291
265
  setAuthState('unauthorized');
292
- }, [storeConfig, setAuthState]);
266
+ }, [storageKey, setAuthState]);
293
267
  };
294
268
  const useGetTokenAsync = (tokenRef, expirationDateRef, remainingTimeToRunRefresh, refresh) => {
295
269
  return useCallback(async () => {
@@ -302,7 +276,7 @@ const useGetTokenAsync = (tokenRef, expirationDateRef, remainingTimeToRunRefresh
302
276
  return tokenRef.current;
303
277
  }, [refresh]);
304
278
  };
305
- export const IMOAuth = ({ children, requestConfig, remainingTimeToRunRefresh, secureStore, oauthContext, }) => {
279
+ export const IMOAuth = ({ children, requestConfig, remainingTimeToRunRefresh, storageKey, oauthContext, }) => {
306
280
  const Context = oauthContext || DefaultContext;
307
281
  const contextRef = useRef();
308
282
  const authStateRenderTarget = useRenderTarget();
@@ -311,14 +285,13 @@ export const IMOAuth = ({ children, requestConfig, remainingTimeToRunRefresh, se
311
285
  const [tokenRef, setToken, getToken] = useTokenRef(tokenRenderTarget);
312
286
  const refreshTokenRef = useRef(null);
313
287
  const expirationDateRef = useRef(null);
314
- const storeConfig = useStoreConfig(secureStore);
288
+ const _storageKey = useStorageKey(storageKey);
315
289
  const _remainingTimeToRunRefresh = useRemainingTimeToRunRefresh(remainingTimeToRunRefresh);
316
290
  const _requestConfig = useRequestConfig(requestConfig);
317
291
  const _discovery = useDiscovery();
318
- const authErrorRenderTarget = useRenderTarget();
319
- const destroy = useDestroy(storeConfig, refreshTokenRef, expirationDateRef, setToken, setAuthState);
320
- const refresh = useRefresh(storeConfig, refreshTokenRef, expirationDateRef, _requestConfig, _discovery, setToken, destroy);
321
- const startAuth = useStartAuth(storeConfig, _remainingTimeToRunRefresh, refreshTokenRef, expirationDateRef, _requestConfig, _discovery, setToken, refresh, setAuthState, authErrorRenderTarget);
292
+ const destroy = useDestroy(_storageKey, refreshTokenRef, expirationDateRef, setToken, setAuthState);
293
+ const refresh = useRefresh(_storageKey, refreshTokenRef, expirationDateRef, _requestConfig, _discovery, setToken, destroy);
294
+ const startAuth = useStartAuth(_storageKey, _remainingTimeToRunRefresh, refreshTokenRef, expirationDateRef, _requestConfig, _discovery, setToken, refresh, setAuthState);
322
295
  const getTokenAsync = useGetTokenAsync(tokenRef, expirationDateRef, _remainingTimeToRunRefresh, refresh);
323
296
  contextRef.current = {
324
297
  getAuthState,
@@ -329,7 +302,6 @@ export const IMOAuth = ({ children, requestConfig, remainingTimeToRunRefresh, se
329
302
  startAuth,
330
303
  tokenRenderTarget,
331
304
  authStateRenderTarget,
332
- authErrorRenderTarget,
333
305
  };
334
306
  return (<Context.Provider value={contextRef.current}>{children}</Context.Provider>);
335
307
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { StartSearchArg, StartSearchResult } from '.';
3
2
  export interface SearchContext {
4
3
  start: ({ target, type, paramString, }: StartSearchArg) => Promise<StartSearchResult<typeof type>>;
@@ -1,4 +1,4 @@
1
1
  import { Context as DefaultContext } from '../Context';
2
2
  export declare const useIMSearch: (Context?: typeof DefaultContext) => {
3
- startSearch: ({ target, type, paramString, }: import("..").StartSearchArg) => Promise<import("..").StartSearchResult<import("..").SearchType>>;
3
+ startSearch: ({ target, type, paramString, }: import("..").StartSearchArg) => Promise<import("..").StartSearchResult<typeof type>>;
4
4
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Context as DefaultContext } from './Context';
3
2
  import { DepartmentPostSearchRecord, DepartmentSearchRecord, PostSearchRecord, PublicGroupSearchRecord, RoleSearchRecord, UserSearchRecord } from './types';
4
3
  export type SearchTarget = 'jp.co.intra_mart.master.search.user' | 'jp.co.intra_mart.master.search.company' | 'jp.co.intra_mart.master.search.company_post' | 'jp.co.intra_mart.master.search.department' | 'jp.co.intra_mart.master.search.public_group' | 'jp.co.intra_mart.master.search.private_group' | 'jp.co.intra_mart.master.search.public_group_role' | 'jp.co.intra_mart.master.search.role' | 'jp.co.intra_mart.master.search.attached_department_post' | 'jp.co.intra_mart.master.search.attached_public_group_role' | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ErrorResult, SuccessResult } from '.';
3
2
  import { RenderTarget } from '../../_shared/renderTarget';
4
3
  import setCookie from 'set-cookie-parser';
@@ -1,4 +1,3 @@
1
- /// <reference types="set-cookie-parser" />
2
1
  import { Context as DefaultContext } from '../Context';
3
2
  export declare const useSession: (Context?: typeof DefaultContext) => {
4
3
  getSession: () => {
@@ -1,4 +1,3 @@
1
- /// <reference types="set-cookie-parser" />
2
1
  import { Context as DefaultContext } from '../Context';
3
2
  export declare const useSessionState: (Context?: typeof DefaultContext) => {
4
3
  cookies: import("set-cookie-parser").Cookie[] | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Context as DefaultContext } from './Context';
3
2
  export interface SessionResponse {
4
3
  error: boolean;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { SelectSearchProps } from '../Search';
3
2
  export declare const NotSearchPropError: ({ error }: SelectSearchProps) => import("react").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IMMe } from '../Me';
3
2
  import { IMOAuth } from '../OAuth';
4
3
  import { IMSession } from '../Session';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FetchModuleState, Moudles } from '.';
3
2
  import { RenderTarget } from '../../_shared/renderTarget';
4
3
  export interface TenantContext {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Context as DefaultContext } from './Context';
3
2
  import { ModuleIds } from './modulesType';
4
3
  interface IMTenantProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import WebView, { WebViewMessageEvent } from 'react-native-webview';
3
2
  type ErrorCallBack = (error: unknown) => void;
4
3
  export declare const useHackSearchUI: (errorCallBack?: ErrorCallBack) => {
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
- export declare const mergeRef: <T>(...refs: (string | import("react").MutableRefObject<T> | ((instance: T | null) => void) | import("react").MutableRefObject<T | null> | ((instance: T | null) => void) | import("react").RefObject<T> | null)[]) => (instance: T | null) => void;
1
+ export declare const mergeRef: <T>(...refs: Array<React.MutableRefObject<T> | React.ForwardedRef<T> | React.LegacyRef<T> | React.ForwardedRef<T>>) => React.RefCallback<T>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@intra-mart/smartlime",
3
3
  "description": "expoで使用できるintra mart accelplatform SDK",
4
- "version": "2.0.0-dev.20241121",
4
+ "version": "2.0.0-dev.20241210",
5
5
  "keywords": [
6
6
  "intra-mart",
7
7
  "AccelPlatform",
@@ -42,40 +42,40 @@
42
42
  "type": "tsc --noEmit"
43
43
  },
44
44
  "peerDependencies": {
45
- "expo": "^51.0.31",
46
- "react": "18.2.0"
45
+ "expo": "^52.0.17",
46
+ "react": "18.3.1"
47
47
  },
48
48
  "dependencies": {
49
49
  "@react-native-async-storage/async-storage": "1.23.1",
50
- "expo-auth-session": "~5.5.2",
51
- "expo-crypto": "~13.0.2",
50
+ "expo-auth-session": "~6.0.1",
51
+ "expo-crypto": "~14.0.1",
52
52
  "expo-random": "~14.0.1",
53
- "expo-secure-store": "~13.0.2",
54
- "react-native-webview": "13.8.6",
55
- "set-cookie-parser": "^2.7.0"
53
+ "expo-secure-store": "~14.0.0",
54
+ "react-native-webview": "13.12.5",
55
+ "set-cookie-parser": "^2.7.1"
56
56
  },
57
57
  "devDependencies": {
58
- "@babel/core": "^7.25.2",
59
- "@babel/preset-env": "^7.25.4",
60
- "@types/jest": "^29.5.12",
58
+ "@babel/core": "^7.26.0",
59
+ "@babel/preset-env": "^7.26.0",
60
+ "@types/jest": "^29.5.14",
61
61
  "@types/react": "^18.2.79",
62
62
  "@types/react-test-renderer": "18.3.0",
63
63
  "@types/set-cookie-parser": "^2.4.10",
64
- "@typescript-eslint/eslint-plugin": "^8.3.0",
65
- "@typescript-eslint/parser": "^8.3.0",
66
- "eslint": "^8.57.0",
64
+ "@typescript-eslint/eslint-plugin": "^8.18.0",
65
+ "@typescript-eslint/parser": "^8.18.0",
66
+ "eslint": "^9.16.0",
67
67
  "eslint-config-prettier": "^9.1.0",
68
- "eslint-plugin-react": "^7.35.0",
69
- "expo": "^51.0.31",
68
+ "eslint-plugin-react": "^7.37.2",
69
+ "expo": "^52.0.17",
70
70
  "jest": "^29.7.0",
71
- "jest-expo": "^51.0.4",
72
- "prettier": "^3.3.3",
73
- "react": "18.2.0",
74
- "react-dom": "18.2.0",
75
- "react-native": "0.74.5",
71
+ "jest-expo": "^52.0.2",
72
+ "prettier": "^3.4.2",
73
+ "react": "18.3.1",
74
+ "react-dom": "18.3.1",
75
+ "react-native": "0.76.3",
76
76
  "react-test-renderer": "18.2.0",
77
77
  "ts-jest": "^29.2.5",
78
- "typescript": "^5.3.3"
78
+ "typescript": "^5.7.2"
79
79
  },
80
80
  "resolutions": {
81
81
  "@types/react": "^18.2.79"
@@ -1,2 +0,0 @@
1
- import { IMOAuthError } from '../IMOAuthError';
2
- export declare const useAuthError: (callBack: (error?: IMOAuthError) => void) => void;
@@ -1,15 +0,0 @@
1
- import { useContext, useEffect } from 'react';
2
- import { Context as DefaultContext } from '../Context';
3
- import { IMOAuthError } from '../IMOAuthError';
4
- export const useAuthError = (callBack) => {
5
- const oauthContext = useContext(DefaultContext);
6
- if (oauthContext == null) {
7
- throw new IMOAuthError('useAuthError requires either a Context provide or an ancestor element with a IMOAuthProvider.');
8
- }
9
- useEffect(() => {
10
- oauthContext.authErrorRenderTarget.addEventListener(callBack);
11
- return () => {
12
- oauthContext.authErrorRenderTarget.removeEventListener(callBack);
13
- };
14
- }, [callBack]);
15
- };