@react-native-kakao/user 1.5.0 → 1.5.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 mym0404
3
+ Copyright (c) 2024 MJ Studio
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  of this software and associated documentation files (the "Software"), to deal
6
6
  in the Software without restriction, including without limitation the rights
@@ -14,6 +14,7 @@ import com.kakao.sdk.auth.model.Prompt.SELECT_ACCOUNT
14
14
  import com.kakao.sdk.auth.model.Prompt.UNIFY_DAUM
15
15
  import com.kakao.sdk.common.model.KakaoSdkError
16
16
  import com.kakao.sdk.user.UserApiClient
17
+ import net.mjstudio.rnkakao.core.util.RNCKakaoResponseNotFoundException
17
18
  import net.mjstudio.rnkakao.core.util.RNCKakaoUtil
18
19
  import net.mjstudio.rnkakao.core.util.argArr
19
20
  import net.mjstudio.rnkakao.core.util.argMap
@@ -50,7 +51,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
50
51
  if (error != null) {
51
52
  promise.rejectWith(error)
52
53
  } else if (token == null) {
53
- promise.rejectWith("token not found")
54
+ promise.rejectWith(RNCKakaoResponseNotFoundException("token"))
54
55
  } else {
55
56
  promise.resolve(
56
57
  argMap().apply {
@@ -178,7 +179,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
178
179
  if (error != null) {
179
180
  promise.rejectWith(error)
180
181
  } else if (scopeInfo?.scopes == null) {
181
- promise.rejectWith("scopes not found")
182
+ promise.rejectWith(RNCKakaoResponseNotFoundException("scopes"))
182
183
  } else {
183
184
  promise.resolve(
184
185
  argArr().also { arr ->
@@ -212,7 +213,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
212
213
  if (error != null) {
213
214
  promise.rejectWith(error)
214
215
  } else if (scopeInfo == null) {
215
- promise.rejectWith("scopeInfo not found")
216
+ promise.rejectWith(RNCKakaoResponseNotFoundException("scopeInfo"))
216
217
  } else {
217
218
  promise.resolve(42)
218
219
  }
@@ -226,7 +227,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
226
227
  if (error != null) {
227
228
  promise.rejectWith(error)
228
229
  } else if (serviceTerms?.serviceTerms == null) {
229
- promise.rejectWith("serviceTerms not found")
230
+ promise.rejectWith(RNCKakaoResponseNotFoundException("serviceTerms"))
230
231
  } else {
231
232
  promise.resolve(
232
233
  argMap().apply {
@@ -259,7 +260,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
259
260
  if (error != null) {
260
261
  promise.rejectWith(error)
261
262
  } else if (addrs == null) {
262
- promise.rejectWith("shipping addresses not found")
263
+ promise.rejectWith(RNCKakaoResponseNotFoundException("shippingAddresses"))
263
264
  } else {
264
265
  promise.resolve(
265
266
  argMap().apply {
@@ -301,7 +302,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
301
302
  if (error != null) {
302
303
  promise.rejectWith(error)
303
304
  } else if (user == null) {
304
- promise.rejectWith("user not found")
305
+ promise.rejectWith(RNCKakaoResponseNotFoundException("user"))
305
306
  } else {
306
307
  promise.resolve(
307
308
  argMap().apply {
@@ -37,7 +37,7 @@ import RNCKakaoCore
37
37
  ) {
38
38
  onMain { [self] in
39
39
  guard let _ = try? KakaoSDK.shared.appKey() else {
40
- RNCKakaoUtil.reject(reject, "KakaoSdk is not initialized")
40
+ RNCKakaoUtil.reject(reject, RNCKakaoError.sdkNotInitialized)
41
41
  return
42
42
  }
43
43
  let callback = { (token: OAuthToken?, error: Error?) in
@@ -56,7 +56,7 @@ import RNCKakaoCore
56
56
  "scopes": token.scopes ?? []
57
57
  ])
58
58
  } else {
59
- RNCKakaoUtil.reject(reject, "token not found")
59
+ RNCKakaoUtil.reject(reject, RNCKakaoError.responseNotFound(name: "token"))
60
60
  }
61
61
  }
62
62
 
@@ -158,7 +158,7 @@ import RNCKakaoCore
158
158
  ]
159
159
  })
160
160
  } else {
161
- RNCKakaoUtil.reject(reject, "scopes not found")
161
+ RNCKakaoUtil.reject(reject, RNCKakaoError.responseNotFound(name: "scopes"))
162
162
  }
163
163
  }
164
164
  }
@@ -176,7 +176,7 @@ import RNCKakaoCore
176
176
  } else if info != nil {
177
177
  resolve(42)
178
178
  } else {
179
- RNCKakaoUtil.reject(reject, "scopeInfo not found")
179
+ RNCKakaoUtil.reject(reject, RNCKakaoError.responseNotFound(name: "scopeInfo"))
180
180
  }
181
181
  }
182
182
  }
@@ -201,7 +201,7 @@ import RNCKakaoCore
201
201
  ]
202
202
  })
203
203
  } else {
204
- RNCKakaoUtil.reject(reject, "serviceTerms not found")
204
+ RNCKakaoUtil.reject(reject, RNCKakaoError.responseNotFound(name: "serviceTerms"))
205
205
  }
206
206
  }
207
207
  }
@@ -237,7 +237,7 @@ import RNCKakaoCore
237
237
  } ?? []
238
238
  ])
239
239
  } else {
240
- RNCKakaoUtil.reject(reject, "shipping addresses not found")
240
+ RNCKakaoUtil.reject(reject, RNCKakaoError.responseNotFound(name: "shippingAddresses"))
241
241
  }
242
242
  }
243
243
  }
@@ -285,7 +285,7 @@ import RNCKakaoCore
285
285
  "legalBirthDateNeedsAgreement": user.kakaoAccount?.legalBirthDateNeedsAgreement as Any
286
286
  ])
287
287
  } else {
288
- RNCKakaoUtil.reject(reject, "user not found")
288
+ RNCKakaoUtil.reject(reject, RNCKakaoError.responseNotFound(name: "user"))
289
289
  }
290
290
  }
291
291
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@react-native-kakao/user",
3
3
  "description": "React Native Kakao User SDK",
4
- "version": "1.5.0",
4
+ "version": "1.5.2",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
7
7
  "types": "lib/typescript/src/index.d.ts",
@@ -62,7 +62,7 @@
62
62
  "access": "public"
63
63
  },
64
64
  "devDependencies": {
65
- "@react-native-kakao/core": "1.5.0",
65
+ "@react-native-kakao/core": "1.5.2",
66
66
  "@types/invariant": "^2",
67
67
  "@types/jest": "^29.5.5",
68
68
  "@types/react": "^18.2.44",
@@ -74,7 +74,7 @@
74
74
  "typescript": "5.1.6"
75
75
  },
76
76
  "peerDependencies": {
77
- "@react-native-kakao/core": "1.5.0",
77
+ "@react-native-kakao/core": "1.5.2",
78
78
  "react": "*",
79
79
  "react-native": "*"
80
80
  },
@@ -110,7 +110,7 @@
110
110
  "javaPackageName": "net.mjstudio.rnkakao.user"
111
111
  }
112
112
  },
113
- "gitHead": "ba7c3f3187831f8576c08cc9346d38fbf696049f",
113
+ "gitHead": "d2e36f7ac4fe2996320418ffb3020bd40bf4b73d",
114
114
  "dependencies": {
115
115
  "@mj-studio/js-util": "^1.0.34"
116
116
  }