@intra-mart/smartlime 1.1.2 → 1.2.0-dev.20240124

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.
@@ -9,7 +9,7 @@ const fetchWrapper = async (token, input, init = {}) => {
9
9
  credentials: 'omit',
10
10
  ...init,
11
11
  headers: {
12
- 'X-Intramart-Session': 'never',
12
+ 'X-Intramart-Session': 'never', // enforce "never" unless explicitly overridden by user
13
13
  ...init.headers,
14
14
  Authorization: `Bearer ${token}`,
15
15
  },
@@ -11,6 +11,7 @@ export interface SuccessResult {
11
11
  }
12
12
  export interface ErrorResult {
13
13
  status: 'error';
14
+ couse?: unknown;
14
15
  }
15
16
  export declare const useRequestIMMe: (setter: ReturnType<typeof useMeStateRef>[1]) => () => Promise<SuccessResult | ErrorResult>;
16
17
  declare const useMeStateRef: (renderTarget: RenderTarget) => readonly [import("react").MutableRefObject<Me | null>, (state: Me, silent?: boolean) => void, () => Me | null];
@@ -22,8 +22,8 @@ export const useRequestIMMe = (setter) => {
22
22
  }
23
23
  throw new IMMeError('failed to get me information.');
24
24
  }
25
- catch {
26
- return { status: 'error' };
25
+ catch (e) {
26
+ return { status: 'error', couse: e };
27
27
  }
28
28
  }, [imFetch]);
29
29
  return request;
@@ -6,6 +6,8 @@ import { IMOAuthError } from './IMOAuthError';
6
6
  import { useRenderTarget } from '../../_shared/renderTarget';
7
7
  import { useIMBaseUrl } from '../..';
8
8
  import { join } from '../../utils/path';
9
+ import * as WebBrowser from 'expo-web-browser';
10
+ WebBrowser.maybeCompleteAuthSession();
9
11
  const SUCCESS = 'success';
10
12
  const EXCEPTION = 'exception';
11
13
  const DEFAULT_STORAGE_KEY = '@example:IMAuthKey';
@@ -8,6 +8,7 @@ export interface SuccessResult {
8
8
  }
9
9
  export interface ErrorResult {
10
10
  status: 'error';
11
+ couse?: unknown;
11
12
  }
12
13
  export interface IMSessionProps {
13
14
  children: JSX.Element;
@@ -78,8 +78,8 @@ const useRequest = (setter, getter) => {
78
78
  }
79
79
  throw new IMSessionError('failed to get session.');
80
80
  }
81
- catch {
82
- return { status: 'error' };
81
+ catch (e) {
82
+ return { status: 'error', couse: e };
83
83
  }
84
84
  }, [imFetch]);
85
85
  return request;
@@ -0,0 +1 @@
1
+ export declare const useHackSearchUI: () => {};
@@ -0,0 +1,4 @@
1
+ export const useHackSearchUI = () => {
2
+ console.error('useHackSearchUI is not implemented on web.');
3
+ return {};
4
+ };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const IMWebView: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export const IMWebView = React.forwardRef(() => {
3
+ console.error('IMWebView is not implemented on web.');
4
+ return null;
5
+ });
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": "1.1.2",
4
+ "version": "1.2.0-dev.20240124",
5
5
  "keywords": [
6
6
  "intra-mart",
7
7
  "AccelPlatform",
@@ -42,40 +42,39 @@
42
42
  "type": "tsc --noEmit"
43
43
  },
44
44
  "peerDependencies": {
45
- "expo": "^49.0.6",
45
+ "expo": "^50.0.2",
46
46
  "react": "18.2.0"
47
47
  },
48
48
  "dependencies": {
49
- "@react-native-async-storage/async-storage": "~1.19.0",
50
- "expo-auth-session": "~5.0.2",
51
- "expo-crypto": "~12.4.1",
52
- "expo-random": "~13.2.0",
53
- "react-native-webview": "13.2.2",
49
+ "@react-native-async-storage/async-storage": "~1.21.0",
50
+ "expo-auth-session": "~5.4.0",
51
+ "expo-crypto": "~12.8.0",
52
+ "expo-random": "~13.6.0",
53
+ "react-native-webview": "13.6.4",
54
54
  "set-cookie-parser": "^2.6.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@babel/core": "^7.20.12",
58
- "@babel/preset-env": "^7.20.2",
59
- "@types/jest": "^29.5.2",
60
- "@types/react": "~18.2.14",
61
- "@types/react-native": "~0.72.2",
62
- "@types/react-test-renderer": "18.0.0",
63
- "@types/set-cookie-parser": "^2.4.2",
64
- "@typescript-eslint/eslint-plugin": "^5.61.0",
65
- "@typescript-eslint/parser": "^5.61.0",
66
- "eslint": "^8.44.0",
67
- "eslint-config-prettier": "^8.8.0",
68
- "eslint-plugin-react": "^7.32.2",
69
- "expo": "^49.0.6",
70
- "jest": "^29.6.1",
71
- "jest-expo": "^49.0.0",
72
- "prettier": "^2.8.3",
57
+ "@babel/core": "^7.23.7",
58
+ "@babel/preset-env": "^7.23.8",
59
+ "@types/jest": "^29.5.11",
60
+ "@types/react": "~18.2.48",
61
+ "@types/react-test-renderer": "18.0.7",
62
+ "@types/set-cookie-parser": "^2.4.7",
63
+ "@typescript-eslint/eslint-plugin": "^6.19.1",
64
+ "@typescript-eslint/parser": "^6.19.1",
65
+ "eslint": "^8.56.0",
66
+ "eslint-config-prettier": "^9.1.0",
67
+ "eslint-plugin-react": "^7.33.2",
68
+ "expo": "^50.0.2",
69
+ "jest": "^29.7.0",
70
+ "jest-expo": "^50.0.1",
71
+ "prettier": "^3.2.4",
73
72
  "react": "18.2.0",
74
73
  "react-dom": "18.2.0",
75
- "react-native": "0.72.3",
74
+ "react-native": "0.73.2",
76
75
  "react-test-renderer": "18.2.0",
77
- "ts-jest": "^29.1.1",
78
- "typescript": "^5.1.3"
76
+ "ts-jest": "^29.1.2",
77
+ "typescript": "^5.3.3"
79
78
  },
80
79
  "resolutions": {
81
80
  "@types/react": "^18.2.14"