@react-native-kakao/user 1.6.2 → 1.7.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  <a href="https://rnkakao.dev">
3
3
  <img width="160px" src="https://raw.githubusercontent.com/mym0404/image-archive/master/202404201234177.webp"><br/>
4
4
  </a>
5
- <h1 align="center">React Native Kakao Core</h1>
5
+ <h1 align="center">React Native Kakao User</h1>
6
6
  <p align="center">
7
7
  <a href="https://www.npmjs.com/package/@react-native-kakao/core"><img src="https://img.shields.io/npm/dm/@react-native-kakao/core.svg?style=flat-square" alt="NPM downloads"></a>
8
8
  <a href="https://www.npmjs.com/package/@react-native-kakao/core"><img src="https://img.shields.io/npm/v/@react-native-kakao/core.svg?style=flat-square" alt="NPM version"></a>
@@ -22,10 +22,10 @@ import net.mjstudio.rnkakao.core.util.filterIsInstance
22
22
  import net.mjstudio.rnkakao.core.util.onMain
23
23
  import net.mjstudio.rnkakao.core.util.pushMapList
24
24
  import net.mjstudio.rnkakao.core.util.pushStringList
25
- import net.mjstudio.rnkakao.core.util.putBooleanIfNotNull
26
- import net.mjstudio.rnkakao.core.util.putDoubleIfNotNull
27
- import net.mjstudio.rnkakao.core.util.putIntIfNotNull
25
+ import net.mjstudio.rnkakao.core.util.putB
26
+ import net.mjstudio.rnkakao.core.util.putD
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",
@@ -190,9 +190,9 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
190
190
  map.putString("displayName", scope.displayName)
191
191
  map.putString("type", scope.type.name)
192
192
  map.putBoolean("using", scope.using)
193
- map.putBooleanIfNotNull("delegated", scope.delegated)
193
+ map.putB("delegated", scope.delegated)
194
194
  map.putBoolean("agreed", scope.agreed)
195
- map.putBooleanIfNotNull("revocable", scope.revocable)
195
+ map.putB("revocable", scope.revocable)
196
196
  },
197
197
  )
198
198
  }
@@ -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
+ putD("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,18 +257,18 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
264
257
  } else {
265
258
  promise.resolve(
266
259
  argMap().apply {
267
- putIntIfNotNull("userId", addrs.userId?.toInt())
268
- putBooleanIfNotNull("needsAgreement", addrs.needsAgreement)
260
+ putD("userId", addrs.userId?.toDouble())
261
+ putB("needsAgreement", addrs.needsAgreement)
269
262
  putArray(
270
263
  "shippingAddresses",
271
264
  argArr().apply {
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
+ putD("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
+ putD("id", user.id?.toDouble())
310
303
  putString("name", user.kakaoAccount?.name)
311
304
 
312
305
  putString("email", user.kakaoAccount?.email)
@@ -319,58 +312,58 @@ class RNCKakaoUserModule internal constructor(context: ReactApplicationContext)
319
312
  putString("birthdayType", user.kakaoAccount?.birthdayType?.name)
320
313
  putString("birthyear", user.kakaoAccount?.birthyear)
321
314
  putString("gender", user.kakaoAccount?.gender?.name)
322
- putBooleanIfNotNull("isEmailValid", user.kakaoAccount?.isEmailValid)
323
- putBooleanIfNotNull("isEmailVerified", user.kakaoAccount?.isEmailVerified)
324
- putBooleanIfNotNull("isKorean", user.kakaoAccount?.isKorean)
325
- putBooleanIfNotNull(
315
+ putB("isEmailValid", user.kakaoAccount?.isEmailValid)
316
+ putB("isEmailVerified", user.kakaoAccount?.isEmailVerified)
317
+ putB("isKorean", user.kakaoAccount?.isKorean)
318
+ putB(
326
319
  "ageRangeNeedsAgreement",
327
320
  user.kakaoAccount?.ageRangeNeedsAgreement,
328
321
  )
329
- putBooleanIfNotNull(
322
+ putB(
330
323
  "birthdayNeedsAgreement",
331
324
  user.kakaoAccount?.birthdayNeedsAgreement,
332
325
  )
333
- putBooleanIfNotNull(
326
+ putB(
334
327
  "birthyearNeedsAgreement",
335
328
  user.kakaoAccount?.birthyearNeedsAgreement,
336
329
  )
337
- putBooleanIfNotNull(
330
+ putB(
338
331
  "emailNeedsAgreement",
339
332
  user.kakaoAccount?.emailNeedsAgreement,
340
333
  )
341
- putBooleanIfNotNull(
334
+ putB(
342
335
  "genderNeedsAgreement",
343
336
  user.kakaoAccount?.genderNeedsAgreement,
344
337
  )
345
- putBooleanIfNotNull(
338
+ putB(
346
339
  "isKoreanNeedsAgreement",
347
340
  user.kakaoAccount?.isKoreanNeedsAgreement,
348
341
  )
349
- putBooleanIfNotNull(
342
+ putB(
350
343
  "phoneNumberNeedsAgreement",
351
344
  user.kakaoAccount?.phoneNumberNeedsAgreement,
352
345
  )
353
- putBooleanIfNotNull(
346
+ putB(
354
347
  "profileNeedsAgreement",
355
348
  user.kakaoAccount?.profileNeedsAgreement,
356
349
  )
357
- putBooleanIfNotNull(
350
+ putB(
358
351
  "ciNeedsAgreement",
359
352
  user.kakaoAccount?.ciNeedsAgreement,
360
353
  )
361
- putBooleanIfNotNull(
354
+ putB(
362
355
  "nameNeedsAgreement",
363
356
  user.kakaoAccount?.nameNeedsAgreement,
364
357
  )
365
- putBooleanIfNotNull(
358
+ putB(
366
359
  "profileImageNeedsAgreement",
367
360
  user.kakaoAccount?.profileImageNeedsAgreement,
368
361
  )
369
- putBooleanIfNotNull(
362
+ putB(
370
363
  "profileNicknameNeedsAgreement",
371
364
  user.kakaoAccount?.profileNicknameNeedsAgreement,
372
365
  )
373
- putBooleanIfNotNull(
366
+ putB(
374
367
  "legalBirthDateNeedsAgreement",
375
368
  user.kakaoAccount?.legalBirthDateNeedsAgreement,
376
369
  )
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.7.0",
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.7.0",
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.7.0",
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": "33e4f3376565424bbf342612c8dde134386d9e4a",
114
114
  "dependencies": {
115
115
  "@mj-studio/js-util": "^1.0.34"
116
116
  }