@react-native-kakao/user 1.6.2 → 1.6.3

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.
@@ -24,8 +24,8 @@ import net.mjstudio.rnkakao.core.util.pushMapList
24
24
  import net.mjstudio.rnkakao.core.util.pushStringList
25
25
  import net.mjstudio.rnkakao.core.util.putBooleanIfNotNull
26
26
  import net.mjstudio.rnkakao.core.util.putDoubleIfNotNull
27
- import net.mjstudio.rnkakao.core.util.putIntIfNotNull
28
27
  import net.mjstudio.rnkakao.core.util.rejectWith
28
+ import net.mjstudio.rnkakao.core.util.unix
29
29
  import java.util.Date
30
30
 
31
31
  class RNCKakaoUserModule internal constructor(context: ReactApplicationContext) :
@@ -61,11 +61,11 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
61
61
  putString("idToken", token.idToken)
62
62
  putDouble(
63
63
  "accessTokenExpiresAt",
64
- token.accessTokenExpiresAt.time.toDouble(),
64
+ token.accessTokenExpiresAt.unix.toDouble(),
65
65
  )
66
66
  putDouble(
67
67
  "refreshTokenExpiresAt",
68
- token.refreshTokenExpiresAt.time.toDouble(),
68
+ token.refreshTokenExpiresAt.unix.toDouble(),
69
69
  )
70
70
  putDouble(
71
71
  "accessTokenExpiresIn",
@@ -230,24 +230,17 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
230
230
  promise.rejectWith(RNCKakaoResponseNotFoundException("serviceTerms"))
231
231
  } else {
232
232
  promise.resolve(
233
- argMap().apply {
234
- putArray(
235
- "allowedServiceTerms",
236
- argArr().apply {
237
- serviceTerms.serviceTerms?.forEach { term ->
238
- pushMap(
239
- argMap().apply {
240
- putString("tag", term.tag)
241
- putDoubleIfNotNull("agreedAt", term.agreedAt?.time?.toDouble())
242
- putBoolean("agreed", term.agreed)
243
- putBoolean("required", term.required)
244
- putBoolean("revocable", term.revocable)
245
- },
246
- )
247
- }
248
- },
249
- )
250
- },
233
+ argArr().pushMapList(
234
+ serviceTerms.serviceTerms?.map { term ->
235
+ argMap().apply {
236
+ putString("tag", term.tag)
237
+ putDoubleIfNotNull("agreedAt", term.agreedAt?.unix?.toDouble())
238
+ putBoolean("agreed", term.agreed)
239
+ putBoolean("required", term.required)
240
+ putBoolean("revocable", term.revocable)
241
+ }
242
+ } ?: listOf(),
243
+ ),
251
244
  )
252
245
  }
253
246
  }
@@ -264,7 +257,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
264
257
  } else {
265
258
  promise.resolve(
266
259
  argMap().apply {
267
- putIntIfNotNull("userId", addrs.userId?.toInt())
260
+ putDoubleIfNotNull("userId", addrs.userId?.toDouble())
268
261
  putBooleanIfNotNull("needsAgreement", addrs.needsAgreement)
269
262
  putArray(
270
263
  "shippingAddresses",
@@ -272,10 +265,10 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
272
265
  pushMapList(
273
266
  addrs.shippingAddresses?.map { addr ->
274
267
  argMap().apply {
275
- putInt("id", addr.id.toInt())
268
+ putDouble("id", addr.id.toDouble())
276
269
  putString("name", addr.name)
277
270
  putBoolean("isDefault", addr.isDefault)
278
- putDoubleIfNotNull("updatedAt", addr.updatedAt?.time?.toDouble())
271
+ putDoubleIfNotNull("updatedAt", addr.updatedAt?.unix?.toDouble())
279
272
  putString("type", addr.type?.name)
280
273
  putString("baseAddress", addr.baseAddress)
281
274
  putString("detailAddress", addr.detailAddress)
@@ -306,7 +299,7 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
306
299
  } else {
307
300
  promise.resolve(
308
301
  argMap().apply {
309
- putIntIfNotNull("id", user.id?.toInt())
302
+ putDoubleIfNotNull("id", user.id?.toDouble())
310
303
  putString("name", user.kakaoAccount?.name)
311
304
 
312
305
  putString("email", user.kakaoAccount?.email)
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.6.2",
4
+ "version": "1.6.3",
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.6.2",
65
+ "@react-native-kakao/core": "1.6.3",
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.6.2",
77
+ "@react-native-kakao/core": "1.6.3",
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": "8c06cf3efbfddd30a78c9715d970e81a06f88402",
113
+ "gitHead": "029e997fe687bb4fde323d468075464d8e7e63d5",
114
114
  "dependencies": {
115
115
  "@mj-studio/js-util": "^1.0.34"
116
116
  }