@react-native-kakao/user 3.1.0-next.1 → 3.2.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/CHANGELOG.md +65 -0
- package/android/src/main/java/net/mjstudio/rnkakao/user/RNCKakaoUserModule.kt +37 -23
- package/ios/RNCKakaoUser.mm +6 -5
- package/ios/RNCKakaoUserManager.swift +36 -18
- package/lib/commonjs/index.js +31 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +30 -16
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/spec/NativeKakaoUser.ts +3 -2
- package/lib/module/index.js +31 -14
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +27 -15
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/spec/NativeKakaoUser.ts +3 -2
- package/lib/typescript/src/index.d.ts +35 -26
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/spec/NativeKakaoUser.d.ts +3 -3
- package/lib/typescript/src/spec/NativeKakaoUser.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +62 -37
- package/src/index.web.ts +45 -21
- package/src/spec/NativeKakaoUser.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 250d066: Expose group user tokens consistently on Android, iOS, and web.
|
|
8
|
+
- 63c6e87: Add result and tag filters to serviceTerms on Android, iOS, and web, and return an empty array for a successful response without terms.
|
|
9
|
+
- 3d92882: Expose the iOS token refresh request logging option without changing global SDK logging or Android behavior.
|
|
10
|
+
- f1fd1e2: Add manual signup and profile connection state on Android, iOS, and web.
|
|
11
|
+
- 5fe3050: Add shipping address ID and pagination options on Android, iOS, and web.
|
|
12
|
+
- f6e0207: Add a shared loginHint option for Kakao Account login on Android, iOS, and web.
|
|
13
|
+
- a8a2e24: Expose partner legal identity fields and consent flags on Android, iOS, and web.
|
|
14
|
+
- d81f9b7: Expose iOS authorization-code and certification-code token exchange with PKCE options, normalized web token issuance, and explicit unsupported-platform errors.
|
|
15
|
+
- f466ffa: Expose the iOS Kakao Talk launch method for login and reject web-only token helpers on native platforms.
|
|
16
|
+
- 3260517: Add a shipping address picker that returns the selected address ID on Android, iOS, and web.
|
|
17
|
+
|
|
18
|
+
Add the Expo plugin's shippingAddressHandlerActivity option to handle Android picker callbacks.
|
|
19
|
+
- 7fe7820: Add native login method selection and explicit refresh of stored OAuth tokens.
|
|
20
|
+
- 524be2c: Expose profile image defaults, leap-month flags, and the user's KakaoTalk UUID on Android, iOS, and web.
|
|
21
|
+
- 57954b3: Add revokeServiceTerms on Android, iOS, and web.
|
|
22
|
+
- e25e428: Allow explicit native tokens when refreshing and normalize remaining token lifetimes across native responses.
|
|
23
|
+
- 23ca142: Expose consent revocation results, service-term consent sources, Talk profile IDs, friend pagination links, and masked picker nicknames. Forward Android scope filters, preserve nullable friend nicknames, and return iOS friend thumbnails as URL strings.
|
|
24
|
+
- 845f1f2: Expose original user properties and property-key filters on Android, iOS, and web.
|
|
25
|
+
- 97a99b5: Add updateProfile to store registered custom user properties on Android, iOS, and web.
|
|
26
|
+
- 1a58199: Add local stored-token presence checks on Android, iOS, and web.
|
|
27
|
+
- b6ff8a9: Add channel selection to login on Android, iOS, and web.
|
|
28
|
+
- bd1bb64: Add the secureResource profile image URL option on Android, iOS, and web.
|
|
29
|
+
- 87e8aa7: Allow a custom Android KakaoTalk login request code while preserving the SDK default when omitted. Accept the SDK's full 32-bit request code range for regular and certification login.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- dfd32ca: Upgrade all Kakao Android SDK modules to 2.25.1 and preserve web shipping-address queries with JavaScript SDK 2.8.4.
|
|
34
|
+
- da4db1c: Return canonical profile enum strings on Android and preserve birthday type strings on iOS.
|
|
35
|
+
- f466ffa: Normalize APIs without success data to resolve without a value across platforms, while preserving friend-message results.
|
|
36
|
+
- Updated dependencies [d5c5fb8]
|
|
37
|
+
- Updated dependencies [3027207]
|
|
38
|
+
- Updated dependencies [dfd32ca]
|
|
39
|
+
- Updated dependencies [2b223bf]
|
|
40
|
+
- Updated dependencies [20c253b]
|
|
41
|
+
- Updated dependencies [67cd4e2]
|
|
42
|
+
- Updated dependencies [d81f9b7]
|
|
43
|
+
- Updated dependencies [3260517]
|
|
44
|
+
- @react-native-kakao/core@3.2.0
|
|
45
|
+
|
|
46
|
+
## 3.1.0-next.2
|
|
47
|
+
|
|
48
|
+
### Minor Changes
|
|
49
|
+
|
|
50
|
+
- f466ffa: Expose the iOS Kakao Talk launch method for login and reject web-only token helpers on native platforms.
|
|
51
|
+
- 23ca142: Expose consent revocation results, service-term consent sources, Talk profile IDs, friend pagination links, and masked picker nicknames. Forward Android scope filters, preserve nullable friend nicknames, and return iOS friend thumbnails as URL strings.
|
|
52
|
+
- 845f1f2: Expose original user properties and property-key filters on Android, iOS, and web.
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- f466ffa: Normalize APIs without success data to resolve without a value across platforms, while preserving friend-message results.
|
|
57
|
+
- @react-native-kakao/core@3.1.0-next.2
|
|
58
|
+
|
|
3
59
|
## 3.1.0-next.1
|
|
4
60
|
|
|
5
61
|
### Minor Changes
|
|
@@ -50,6 +106,15 @@
|
|
|
50
106
|
- Updated dependencies [71700aa]
|
|
51
107
|
- @react-native-kakao/core@3.1.0-next.0
|
|
52
108
|
|
|
109
|
+
## 3.1.0
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- 3afe0d3: Align web SDK options, response shapes, timestamps, and session errors with native APIs.
|
|
114
|
+
- Updated dependencies [3afe0d3]
|
|
115
|
+
- @react-native-kakao/core@3.1.0
|
|
116
|
+
|
|
117
|
+
|
|
53
118
|
## 3.0.0
|
|
54
119
|
|
|
55
120
|
### Major Changes
|
|
@@ -22,6 +22,7 @@ import com.kakao.sdk.user.model.AgeRange
|
|
|
22
22
|
import com.kakao.sdk.user.model.BirthdayType
|
|
23
23
|
import com.kakao.sdk.user.model.Gender
|
|
24
24
|
import com.kakao.sdk.user.model.LoginUiMode
|
|
25
|
+
import com.kakao.sdk.user.model.Scope
|
|
25
26
|
import com.kakao.sdk.user.model.UserShippingAddresses
|
|
26
27
|
import net.mjstudio.rnkakao.core.util.RNCKakaoResponseNotFoundException
|
|
27
28
|
import net.mjstudio.rnkakao.core.util.RNCKakaoUnsupportedPlatformException
|
|
@@ -51,6 +52,7 @@ class RNCKakaoUserModule internal constructor(
|
|
|
51
52
|
serviceTerms: ReadableArray?,
|
|
52
53
|
prompts: ReadableArray?,
|
|
53
54
|
useKakaoAccountLogin: Boolean,
|
|
55
|
+
iosLaunchMethod: String,
|
|
54
56
|
scopes: ReadableArray?,
|
|
55
57
|
nonce: String?,
|
|
56
58
|
loginHint: String?,
|
|
@@ -208,7 +210,7 @@ class RNCKakaoUserModule internal constructor(
|
|
|
208
210
|
if (it != null) {
|
|
209
211
|
promise.rejectWith(it)
|
|
210
212
|
} else {
|
|
211
|
-
promise.resolve(
|
|
213
|
+
promise.resolve(null)
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
216
|
}
|
|
@@ -220,7 +222,7 @@ class RNCKakaoUserModule internal constructor(
|
|
|
220
222
|
if (it != null) {
|
|
221
223
|
promise.rejectWith(it)
|
|
222
224
|
} else {
|
|
223
|
-
promise.resolve(
|
|
225
|
+
promise.resolve(null)
|
|
224
226
|
}
|
|
225
227
|
}
|
|
226
228
|
}
|
|
@@ -252,29 +254,13 @@ class RNCKakaoUserModule internal constructor(
|
|
|
252
254
|
scopes: ReadableArray?,
|
|
253
255
|
promise: Promise,
|
|
254
256
|
) = onMain {
|
|
255
|
-
UserApiClient.instance.scopes { scopeInfo, error ->
|
|
257
|
+
UserApiClient.instance.scopes(scopes = scopes?.filterIsInstance<String>()?.ifEmpty { null }) { scopeInfo, error ->
|
|
256
258
|
if (error != null) {
|
|
257
259
|
promise.rejectWith(error)
|
|
258
|
-
} else if (scopeInfo
|
|
260
|
+
} else if (scopeInfo == null) {
|
|
259
261
|
promise.rejectWith(RNCKakaoResponseNotFoundException("scopes"))
|
|
260
262
|
} else {
|
|
261
|
-
promise.resolve(
|
|
262
|
-
argArr().also { arr ->
|
|
263
|
-
scopeInfo.scopes!!.forEach { scope ->
|
|
264
|
-
arr.pushMap(
|
|
265
|
-
argMap().also { map ->
|
|
266
|
-
map.putString("id", scope.id)
|
|
267
|
-
map.putString("displayName", scope.displayName)
|
|
268
|
-
map.putString("type", scope.type.name)
|
|
269
|
-
map.putBoolean("using", scope.using)
|
|
270
|
-
map.putB("delegated", scope.delegated)
|
|
271
|
-
map.putBoolean("agreed", scope.agreed)
|
|
272
|
-
map.putB("revocable", scope.revocable)
|
|
273
|
-
},
|
|
274
|
-
)
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
)
|
|
263
|
+
promise.resolve(mapScopes(scopeInfo.scopes))
|
|
278
264
|
}
|
|
279
265
|
}
|
|
280
266
|
}
|
|
@@ -292,7 +278,7 @@ class RNCKakaoUserModule internal constructor(
|
|
|
292
278
|
} else if (scopeInfo == null) {
|
|
293
279
|
promise.rejectWith(RNCKakaoResponseNotFoundException("scopeInfo"))
|
|
294
280
|
} else {
|
|
295
|
-
promise.resolve(
|
|
281
|
+
promise.resolve(mapScopes(scopeInfo.scopes))
|
|
296
282
|
}
|
|
297
283
|
}
|
|
298
284
|
}
|
|
@@ -321,6 +307,9 @@ class RNCKakaoUserModule internal constructor(
|
|
|
321
307
|
putBoolean("agreed", term.agreed)
|
|
322
308
|
putBoolean("required", term.required)
|
|
323
309
|
putBoolean("revocable", term.revocable)
|
|
310
|
+
term.referer?.let {
|
|
311
|
+
putString("agreedBy", if (it.name == "KAUTH" || it.name == "KAPI") it.name else "unknown")
|
|
312
|
+
}
|
|
324
313
|
}
|
|
325
314
|
} ?: listOf(),
|
|
326
315
|
),
|
|
@@ -445,10 +434,14 @@ class RNCKakaoUserModule internal constructor(
|
|
|
445
434
|
|
|
446
435
|
@ReactMethod
|
|
447
436
|
override fun me(
|
|
437
|
+
propertyKeys: ReadableArray?,
|
|
448
438
|
secureResource: Boolean?,
|
|
449
439
|
promise: Promise,
|
|
450
440
|
) = onMain {
|
|
451
|
-
UserApiClient.instance.me(
|
|
441
|
+
UserApiClient.instance.me(
|
|
442
|
+
propertyKeys?.filterIsInstance<String>(),
|
|
443
|
+
secureResource = secureResource ?: true,
|
|
444
|
+
) { user, error ->
|
|
452
445
|
if (error != null) {
|
|
453
446
|
promise.rejectWith(error)
|
|
454
447
|
} else if (user == null) {
|
|
@@ -457,6 +450,12 @@ class RNCKakaoUserModule internal constructor(
|
|
|
457
450
|
promise.resolve(
|
|
458
451
|
argMap().apply {
|
|
459
452
|
putD("id", user.id?.toDouble())
|
|
453
|
+
putMap(
|
|
454
|
+
"properties",
|
|
455
|
+
argMap().apply {
|
|
456
|
+
user.properties?.forEach { (key, value) -> putString(key, value) }
|
|
457
|
+
},
|
|
458
|
+
)
|
|
460
459
|
putB("hasSignedUp", user.hasSignedUp)
|
|
461
460
|
putString("uuid", user.uuid)
|
|
462
461
|
putString("groupUserToken", user.groupUserToken)
|
|
@@ -558,6 +557,21 @@ class RNCKakaoUserModule internal constructor(
|
|
|
558
557
|
}
|
|
559
558
|
}
|
|
560
559
|
|
|
560
|
+
private fun mapScopes(scopes: List<Scope>?) =
|
|
561
|
+
argArr().pushMapList(
|
|
562
|
+
scopes.orEmpty().map { scope ->
|
|
563
|
+
argMap().apply {
|
|
564
|
+
putString("id", scope.id)
|
|
565
|
+
putString("displayName", scope.displayName)
|
|
566
|
+
putString("type", scope.type.name)
|
|
567
|
+
putBoolean("using", scope.using)
|
|
568
|
+
putB("delegated", scope.delegated)
|
|
569
|
+
putBoolean("agreed", scope.agreed)
|
|
570
|
+
putB("revocable", scope.revocable)
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
)
|
|
574
|
+
|
|
561
575
|
private fun tokenCallback(promise: Promise): (OAuthToken?, Throwable?) -> Unit =
|
|
562
576
|
{ token, error ->
|
|
563
577
|
if (error != null) {
|
package/ios/RNCKakaoUser.mm
CHANGED
|
@@ -19,13 +19,14 @@ RCT_EXPORT_METHOD(isKakaoTalkLoginAvailable : (RCTPromiseResolveBlock)
|
|
|
19
19
|
}
|
|
20
20
|
RCT_EXPORT_METHOD(
|
|
21
21
|
login : (NSArray*)serviceTerms prompts : (NSArray*)prompts useKakaoAccountLogin : (BOOL)
|
|
22
|
-
useKakaoAccountLogin
|
|
23
|
-
nonce loginHint : (NSString*)loginHint channelPublicIds : (NSArray*)
|
|
22
|
+
useKakaoAccountLogin iosLaunchMethod : (NSString*)iosLaunchMethod scopes : (NSArray*)scopes
|
|
23
|
+
nonce : (NSString*)nonce loginHint : (NSString*)loginHint channelPublicIds : (NSArray*)
|
|
24
24
|
channelPublicIds androidRequestCode : (NSNumber*)androidRequestCode resolve : (
|
|
25
25
|
RCTPromiseResolveBlock)resolve reject : (RCTPromiseRejectBlock)reject) {
|
|
26
26
|
[[self manager] login:serviceTerms
|
|
27
27
|
prompts:prompts
|
|
28
28
|
useKakaoAccountLogin:useKakaoAccountLogin
|
|
29
|
+
iosLaunchMethod:iosLaunchMethod
|
|
29
30
|
scopes:scopes
|
|
30
31
|
nonce:nonce
|
|
31
32
|
loginHint:loginHint
|
|
@@ -129,9 +130,9 @@ RCT_EXPORT_METHOD(updateProfile : (NSDictionary*)properties resolve : (RCTPromis
|
|
|
129
130
|
[[self manager] updateProfile:properties resolve:resolve reject:reject];
|
|
130
131
|
}
|
|
131
132
|
|
|
132
|
-
RCT_EXPORT_METHOD(me : (NSNumber*)secureResource resolve : (
|
|
133
|
-
|
|
134
|
-
[[self manager] me:secureResource resolve:resolve reject:reject];
|
|
133
|
+
RCT_EXPORT_METHOD(me : (NSArray*)propertyKeys secureResource : (NSNumber*)secureResource resolve : (
|
|
134
|
+
RCTPromiseResolveBlock)resolve reject : (RCTPromiseRejectBlock)reject) {
|
|
135
|
+
[[self manager] me:propertyKeys secureResource:secureResource resolve:resolve reject:reject];
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
RCT_EXPORT_METHOD(selectShippingAddress : (RCTPromiseResolveBlock)
|
|
@@ -31,6 +31,7 @@ import RNCKakaoCore
|
|
|
31
31
|
_ serviceTerms: [String],
|
|
32
32
|
prompts: [String],
|
|
33
33
|
useKakaoAccountLogin: Bool,
|
|
34
|
+
iosLaunchMethod: String,
|
|
34
35
|
scopes: [String],
|
|
35
36
|
nonce: String?,
|
|
36
37
|
loginHint: String?,
|
|
@@ -83,6 +84,7 @@ import RNCKakaoCore
|
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
UserApi.shared.loginWithKakaoTalk(
|
|
87
|
+
launchMethod: loginLaunchMethod(iosLaunchMethod),
|
|
86
88
|
channelPublicIds: emptyArrayToNil(channelPublicIds),
|
|
87
89
|
serviceTerms: emptyArrayToNil(serviceTerms),
|
|
88
90
|
nonce: nonce,
|
|
@@ -128,7 +130,7 @@ import RNCKakaoCore
|
|
|
128
130
|
),
|
|
129
131
|
loginProperties: LoginConfiguration(
|
|
130
132
|
talk: LoginConfiguration
|
|
131
|
-
.Talk(launchMethod: launchMethod
|
|
133
|
+
.Talk(launchMethod: loginLaunchMethod(launchMethod)),
|
|
132
134
|
account: LoginConfiguration.Account(
|
|
133
135
|
prompts: emptyArrayToNil(loginPrompts(prompts)),
|
|
134
136
|
loginHint: loginHint
|
|
@@ -232,7 +234,7 @@ import RNCKakaoCore
|
|
|
232
234
|
if let error {
|
|
233
235
|
RNCKakaoUtil.reject(reject, error)
|
|
234
236
|
} else {
|
|
235
|
-
resolve(
|
|
237
|
+
resolve(nil)
|
|
236
238
|
}
|
|
237
239
|
}
|
|
238
240
|
}
|
|
@@ -294,18 +296,8 @@ import RNCKakaoCore
|
|
|
294
296
|
UserApi.shared.scopes(scopes: emptyArrayToNil(scopes)) { scopeInfo, error in
|
|
295
297
|
if let error {
|
|
296
298
|
RNCKakaoUtil.reject(reject, error)
|
|
297
|
-
} else if let
|
|
298
|
-
resolve(scopes
|
|
299
|
-
[
|
|
300
|
-
"id": s.id,
|
|
301
|
-
"displayName": s.displayName,
|
|
302
|
-
"type": s.type.rawValue,
|
|
303
|
-
"using": s.using,
|
|
304
|
-
"delegated": s.delegated as Any,
|
|
305
|
-
"agreed": s.agreed,
|
|
306
|
-
"revocable": s.revocable as Any
|
|
307
|
-
]
|
|
308
|
-
})
|
|
299
|
+
} else if let scopeInfo {
|
|
300
|
+
resolve(self.mapScopes(scopeInfo.scopes))
|
|
309
301
|
} else {
|
|
310
302
|
RNCKakaoUtil.reject(reject, RNCKakaoError.responseNotFound(name: "scopes"))
|
|
311
303
|
}
|
|
@@ -322,8 +314,8 @@ import RNCKakaoCore
|
|
|
322
314
|
UserApi.shared.revokeScopes(scopes: scopes) { info, error in
|
|
323
315
|
if let error {
|
|
324
316
|
RNCKakaoUtil.reject(reject, error)
|
|
325
|
-
} else if info
|
|
326
|
-
resolve(
|
|
317
|
+
} else if let info {
|
|
318
|
+
resolve(self.mapScopes(info.scopes))
|
|
327
319
|
} else {
|
|
328
320
|
RNCKakaoUtil.reject(reject, RNCKakaoError.responseNotFound(name: "scopeInfo"))
|
|
329
321
|
}
|
|
@@ -352,6 +344,9 @@ import RNCKakaoCore
|
|
|
352
344
|
if let agreedAt = term.agreedAt {
|
|
353
345
|
response["agreedAt"] = agreedAt.timeIntervalSince1970
|
|
354
346
|
}
|
|
347
|
+
if let referer = term.referer {
|
|
348
|
+
response["agreedBy"] = referer.rawValue
|
|
349
|
+
}
|
|
355
350
|
return response
|
|
356
351
|
})
|
|
357
352
|
} else {
|
|
@@ -463,17 +458,22 @@ import RNCKakaoCore
|
|
|
463
458
|
}
|
|
464
459
|
|
|
465
460
|
@objc public func me(
|
|
466
|
-
_
|
|
461
|
+
_ propertyKeys: [String]?,
|
|
462
|
+
secureResource: NSNumber?,
|
|
467
463
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
468
464
|
reject: @escaping RCTPromiseRejectBlock
|
|
469
465
|
) {
|
|
470
466
|
onMain {
|
|
471
|
-
UserApi.shared.me(
|
|
467
|
+
UserApi.shared.me(
|
|
468
|
+
propertyKeys: propertyKeys,
|
|
469
|
+
secureResource: secureResource?.boolValue ?? true
|
|
470
|
+
) { user, error in
|
|
472
471
|
if let error {
|
|
473
472
|
RNCKakaoUtil.reject(reject, error)
|
|
474
473
|
} else if let user {
|
|
475
474
|
resolve([
|
|
476
475
|
"id": user.id as Any,
|
|
476
|
+
"properties": user.properties ?? [:],
|
|
477
477
|
"uuid": user.uuid as Any,
|
|
478
478
|
"groupUserToken": user.groupUserToken as Any,
|
|
479
479
|
"hasSignedUp": user.hasSignedUp as Any,
|
|
@@ -543,6 +543,24 @@ import RNCKakaoCore
|
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
|
|
546
|
+
private func mapScopes(_ scopes: [Scope]?) -> [[String: Any]] {
|
|
547
|
+
(scopes ?? []).map { scope in
|
|
548
|
+
[
|
|
549
|
+
"id": scope.id,
|
|
550
|
+
"displayName": scope.displayName,
|
|
551
|
+
"type": scope.type.rawValue,
|
|
552
|
+
"using": scope.using,
|
|
553
|
+
"delegated": scope.delegated as Any,
|
|
554
|
+
"agreed": scope.agreed,
|
|
555
|
+
"revocable": scope.revocable as Any
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
private func loginLaunchMethod(_ value: String) -> LaunchMethod {
|
|
561
|
+
value == "CustomScheme" ? .CustomScheme : .UniversalLink
|
|
562
|
+
}
|
|
563
|
+
|
|
546
564
|
private func loginPrompts(_ prompts: [String]) -> [Prompt] {
|
|
547
565
|
prompts
|
|
548
566
|
.compactMap { Prompt(rawValue: $0 == "SelectAccount" ? "select_account" : $0.lowercased()) }
|
package/lib/commonjs/index.js
CHANGED
|
@@ -16,6 +16,7 @@ exports.logout = logout;
|
|
|
16
16
|
exports.me = me;
|
|
17
17
|
exports.refreshToken = refreshToken;
|
|
18
18
|
exports.revokeScopes = revokeScopes;
|
|
19
|
+
exports.revokeScopesWithResult = revokeScopesWithResult;
|
|
19
20
|
exports.revokeServiceTerms = revokeServiceTerms;
|
|
20
21
|
exports.scopes = scopes;
|
|
21
22
|
exports.selectShippingAddress = selectShippingAddress;
|
|
@@ -32,6 +33,8 @@ var _validateShippingAddressOptions = require("./validateShippingAddressOptions"
|
|
|
32
33
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
33
34
|
const minActivityRequestCode = -2147483648;
|
|
34
35
|
const maxActivityRequestCode = 2147483647;
|
|
36
|
+
const defaultTalkLaunchMethod = 'UniversalLink';
|
|
37
|
+
const webOnlyErrorCode = 'Package-UnsupportedPlatform';
|
|
35
38
|
function login({
|
|
36
39
|
serviceTerms,
|
|
37
40
|
prompts,
|
|
@@ -40,14 +43,15 @@ function login({
|
|
|
40
43
|
nonce,
|
|
41
44
|
loginHint,
|
|
42
45
|
channelPublicIds,
|
|
43
|
-
android
|
|
46
|
+
android,
|
|
47
|
+
ios
|
|
44
48
|
} = {}) {
|
|
45
49
|
const requestCode = android?.requestCode;
|
|
46
50
|
(0, _core.kAssert)(requestCode == null || Number.isInteger(requestCode) && requestCode >= minActivityRequestCode && requestCode <= maxActivityRequestCode, `[login] android.requestCode must be an integer from ${minActivityRequestCode} to ${maxActivityRequestCode}`);
|
|
47
51
|
(0, _core.kAssert)(!useKakaoAccountLogin ? !_jsUtil.is.notEmptyArray(prompts) && !_jsUtil.is.notEmptyArray(scopes) : true, '[login] `prompts` and `scopes` cannot be passed if useKakaoAccountLogin is false.');
|
|
48
52
|
(0, _core.kAssert)(_jsUtil.is.notEmptyArray(scopes) ? !_jsUtil.is.notEmptyArray(prompts) && !_jsUtil.is.notEmptyArray(serviceTerms) && !_jsUtil.is.notEmptyArray(channelPublicIds) : true, '[login] `scopes` cannot be passed with `prompts`, `serviceTerms`, or `channelPublicIds`');
|
|
49
53
|
(0, _core.kAssert)(loginHint == null || !_jsUtil.is.notEmptyArray(scopes) && !_jsUtil.is.notEmptyArray(serviceTerms) && !_jsUtil.is.notEmptyArray(channelPublicIds), '[login] `loginHint` cannot be passed with `scopes`, `serviceTerms`, or `channelPublicIds` on native platforms.');
|
|
50
|
-
return _NativeKakaoUser.default.login(serviceTerms ?? [], prompts ?? [], useKakaoAccountLogin ?? false, scopes ?? [], nonce, loginHint, channelPublicIds ?? [], requestCode);
|
|
54
|
+
return _NativeKakaoUser.default.login(serviceTerms ?? [], prompts ?? [], useKakaoAccountLogin ?? false, ios?.launchMethod ?? defaultTalkLaunchMethod, scopes ?? [], nonce, loginHint, channelPublicIds ?? [], requestCode);
|
|
51
55
|
}
|
|
52
56
|
async function signup({
|
|
53
57
|
properties
|
|
@@ -63,7 +67,7 @@ function loginWithKakao({
|
|
|
63
67
|
serviceTerms,
|
|
64
68
|
ios
|
|
65
69
|
} = {}) {
|
|
66
|
-
return _NativeKakaoUser.default.loginWithKakao(uiMode, ios?.orientation ?? 'auto', ios?.launchMethod ??
|
|
70
|
+
return _NativeKakaoUser.default.loginWithKakao(uiMode, ios?.orientation ?? 'auto', ios?.launchMethod ?? defaultTalkLaunchMethod, prompts ?? [], loginHint, nonce, channelPublicIds ?? [], serviceTerms ?? []);
|
|
67
71
|
}
|
|
68
72
|
function refreshToken({
|
|
69
73
|
token,
|
|
@@ -77,11 +81,11 @@ function refreshToken({
|
|
|
77
81
|
}
|
|
78
82
|
return _NativeKakaoUser.default.refreshToken(token, ios?.loggingEnabled ?? true);
|
|
79
83
|
}
|
|
80
|
-
function logout() {
|
|
81
|
-
|
|
84
|
+
async function logout() {
|
|
85
|
+
await _NativeKakaoUser.default.logout();
|
|
82
86
|
}
|
|
83
|
-
function unlink() {
|
|
84
|
-
|
|
87
|
+
async function unlink() {
|
|
88
|
+
await _NativeKakaoUser.default.unlink();
|
|
85
89
|
}
|
|
86
90
|
function isLogined() {
|
|
87
91
|
return _NativeKakaoUser.default.isLogined();
|
|
@@ -93,7 +97,10 @@ function isKakaoTalkLoginAvailable() {
|
|
|
93
97
|
function scopes(scopes) {
|
|
94
98
|
return _NativeKakaoUser.default.scopes(scopes);
|
|
95
99
|
}
|
|
96
|
-
function revokeScopes(scopes) {
|
|
100
|
+
async function revokeScopes(scopes) {
|
|
101
|
+
await _NativeKakaoUser.default.revokeScopes(scopes);
|
|
102
|
+
}
|
|
103
|
+
function revokeScopesWithResult(scopes) {
|
|
97
104
|
return _NativeKakaoUser.default.revokeScopes(scopes);
|
|
98
105
|
}
|
|
99
106
|
function serviceTerms({
|
|
@@ -121,9 +128,10 @@ function selectShippingAddress() {
|
|
|
121
128
|
return _NativeKakaoUser.default.selectShippingAddress();
|
|
122
129
|
}
|
|
123
130
|
function me({
|
|
131
|
+
propertyKeys,
|
|
124
132
|
secureResource = true
|
|
125
133
|
} = {}) {
|
|
126
|
-
return _NativeKakaoUser.default.me(secureResource);
|
|
134
|
+
return _NativeKakaoUser.default.me(propertyKeys, secureResource);
|
|
127
135
|
}
|
|
128
136
|
async function issueAccessTokenWithCode({
|
|
129
137
|
code,
|
|
@@ -136,17 +144,26 @@ async function issueAccessTokenWithCode({
|
|
|
136
144
|
function getAccessToken() {
|
|
137
145
|
return _NativeKakaoUser.default.getAccessToken();
|
|
138
146
|
}
|
|
139
|
-
function updateProfile({
|
|
147
|
+
async function updateProfile({
|
|
140
148
|
properties
|
|
141
149
|
}) {
|
|
142
|
-
|
|
150
|
+
await _NativeKakaoUser.default.updateProfile(properties);
|
|
143
151
|
}
|
|
144
152
|
|
|
145
153
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
146
|
-
function setAccessTokenWeb(token) {
|
|
154
|
+
function setAccessTokenWeb(token) {
|
|
155
|
+
(0, _core.kCreateWebError)({
|
|
156
|
+
code: webOnlyErrorCode,
|
|
157
|
+
message: '[setAccessTokenWeb] This API is only supported on web.'
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
147
161
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
148
162
|
async function issueAccessTokenWithCodeWeb(params) {
|
|
149
|
-
|
|
163
|
+
(0, _core.kCreateWebError)({
|
|
164
|
+
code: webOnlyErrorCode,
|
|
165
|
+
message: '[issueAccessTokenWithCodeWeb] This API is only supported on web.'
|
|
166
|
+
});
|
|
150
167
|
}
|
|
151
168
|
const KakaoUser = {
|
|
152
169
|
login,
|
|
@@ -161,6 +178,7 @@ const KakaoUser = {
|
|
|
161
178
|
isKakaoTalkLoginAvailable,
|
|
162
179
|
scopes,
|
|
163
180
|
revokeScopes,
|
|
181
|
+
revokeScopesWithResult,
|
|
164
182
|
serviceTerms,
|
|
165
183
|
revokeServiceTerms,
|
|
166
184
|
shippingAddresses,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_jsUtil","require","_core","_NativeKakaoUser","_interopRequireDefault","_validateShippingAddressOptions","e","__esModule","default","minActivityRequestCode","maxActivityRequestCode","login","serviceTerms","prompts","useKakaoAccountLogin","scopes","nonce","loginHint","channelPublicIds","android","requestCode","kAssert","Number","isInteger","is","notEmptyArray","Native","signup","properties","loginWithKakao","uiMode","
|
|
1
|
+
{"version":3,"names":["_jsUtil","require","_core","_NativeKakaoUser","_interopRequireDefault","_validateShippingAddressOptions","e","__esModule","default","minActivityRequestCode","maxActivityRequestCode","defaultTalkLaunchMethod","webOnlyErrorCode","login","serviceTerms","prompts","useKakaoAccountLogin","scopes","nonce","loginHint","channelPublicIds","android","ios","requestCode","kAssert","Number","isInteger","is","notEmptyArray","Native","launchMethod","signup","properties","loginWithKakao","uiMode","orientation","refreshToken","token","loggingEnabled","undefined","string","accessToken","length","accessTokenExpiresAt","refreshTokenExpiresAt","every","value","isFinite","isNaN","Date","getTime","accessTokenExpiresIn","refreshTokenExpiresIn","tokenType","idToken","Array","isArray","scope","logout","unlink","isLogined","hasToken","exports","isKakaoTalkLoginAvailable","revokeScopes","revokeScopesWithResult","result","tags","shippingAddresses","addressId","fromUpdatedAt","pageSize","validateShippingAddressOptions","revokeServiceTerms","selectShippingAddress","me","propertyKeys","secureResource","issueAccessTokenWithCode","code","codeVerifier","redirectUri","getAccessToken","updateProfile","setAccessTokenWeb","kCreateWebError","message","issueAccessTokenWithCodeWeb","params","KakaoUser","_default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,+BAAA,GAAAJ,OAAA;AAAkF,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAoBlF,MAAMG,sBAAsB,GAAG,CAAC,UAAU;AAC1C,MAAMC,sBAAsB,GAAG,UAAU;AAIzC,MAAMC,uBAA8C,GAAG,eAAe;AACtE,MAAMC,gBAAgB,GAAG,6BAA6B;AA8F/C,SAASC,KAAKA,CAAC;EACpBC,YAAY;EACZC,OAAO;EACPC,oBAAoB;EACpBC,MAAM;EACNC,KAAK;EACLC,SAAS;EACTC,gBAAgB;EAChBC,OAAO;EACPC;AAqBF,CAAC,GAAG,CAAC,CAAC,EAA4B;EAChC,MAAMC,WAAW,GAAGF,OAAO,EAAEE,WAAW;EACxC,IAAAC,aAAO,EACLD,WAAW,IAAI,IAAI,IAChBE,MAAM,CAACC,SAAS,CAACH,WAAW,CAAC,IAC5BA,WAAW,IAAId,sBAAsB,IACrCc,WAAW,IAAIb,sBAAuB,EAC1C,uDAAuDD,sBAAsB,OAAOC,sBAAsB,EAC5G,CAAC;EAED,IAAAc,aAAO,EACL,CAACR,oBAAoB,GAAG,CAACW,UAAE,CAACC,aAAa,CAACb,OA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;AAEA;AACO,eAAeC,2BAA2BA,CAACC,MAKjD,EAQE;EACD,IAAAH,qBAAe,EAAC;IACdN,IAAI,EAAEnE,gBAAgB;IACtB0E,OAAO,EAAE;EACX,CAAC,CAAC;AACJ;AAEA,MAAMG,SAAS,GAAG;EAChB5E,KAAK;EACLoB,cAAc;EACdG,YAAY;EACZ0C,wBAAwB;EACxB/C,MAAM;EACN2B,MAAM;EACNC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRE,yBAAyB;EACzB9C,MAAM;EACN+C,YAAY;EACZC,sBAAsB;EACtBnD,YAAY;EACZ2D,kBAAkB;EAClBL,iBAAiB;EACjBM,qBAAqB;EACrBC,EAAE;EACFQ,aAAa;EACbD,cAAc;EACdE,iBAAiB;EACjBG;AACF,CAAC;AAAC,IAAAG,QAAA,GAAA5B,OAAA,CAAAtD,OAAA,GACaiF,SAAS","ignoreList":[]}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.revokeScopes = exports.refreshToken = exports.me = exports.logout = exports.loginWithKakao = exports.login = exports.issueAccessTokenWithCodeWeb = exports.issueAccessTokenWithCode = exports.isLogined = exports.isKakaoTalkLoginAvailable = exports.hasToken = exports.getAccessToken = exports.default = void 0;
|
|
7
|
+
exports.revokeScopesWithResult = revokeScopesWithResult;
|
|
8
|
+
exports.updateProfile = exports.unlink = exports.signup = exports.shippingAddresses = exports.setAccessTokenWeb = exports.serviceTerms = exports.selectShippingAddress = exports.scopes = exports.revokeServiceTerms = void 0;
|
|
7
9
|
var _jsUtil = require("@mj-studio/js-util");
|
|
8
10
|
var _core = require("@react-native-kakao/core");
|
|
9
11
|
var _validateShippingAddressOptions = require("./validateShippingAddressOptions");
|
|
@@ -169,16 +171,12 @@ const KakaoUser = {
|
|
|
169
171
|
scopes
|
|
170
172
|
} : undefined
|
|
171
173
|
});
|
|
172
|
-
return (0, _jsUtil.camelCaseObject)(response.scopes);
|
|
173
|
-
}),
|
|
174
|
-
revokeScopes: scopes => (0, _core.kRunWebAPI)(async () => {
|
|
175
|
-
await Kakao.API.request({
|
|
176
|
-
url: '/v2/user/revoke/scopes',
|
|
177
|
-
data: {
|
|
178
|
-
scopes
|
|
179
|
-
}
|
|
180
|
-
});
|
|
174
|
+
return (0, _jsUtil.camelCaseObject)(response.scopes ?? []);
|
|
181
175
|
}),
|
|
176
|
+
revokeScopes: async scopes => {
|
|
177
|
+
await revokeScopesWithResult(scopes);
|
|
178
|
+
},
|
|
179
|
+
revokeScopesWithResult,
|
|
182
180
|
serviceTerms: ({
|
|
183
181
|
result,
|
|
184
182
|
tags
|
|
@@ -190,12 +188,13 @@ const KakaoUser = {
|
|
|
190
188
|
tags: tags?.join(',')
|
|
191
189
|
})
|
|
192
190
|
});
|
|
193
|
-
return (response.service_terms ?? []).map(term => ({
|
|
191
|
+
return (response.service_terms ?? []).map(term => (0, _jsUtil.filterNonNullishKeys)({
|
|
194
192
|
tag: term.tag,
|
|
195
193
|
agreedAt: term.agreed_at ? isoToUnix(term.agreed_at) : undefined,
|
|
196
194
|
agreed: term.agreed,
|
|
197
195
|
required: term.required,
|
|
198
|
-
revocable: term.revocable
|
|
196
|
+
revocable: term.revocable,
|
|
197
|
+
agreedBy: term.agreed_by == null ? undefined : term.agreed_by === 'KAUTH' || term.agreed_by === 'KAPI' ? term.agreed_by : 'unknown'
|
|
199
198
|
}));
|
|
200
199
|
}),
|
|
201
200
|
revokeServiceTerms: tags => (0, _core.kRunWebAPI)(async () => {
|
|
@@ -267,20 +266,24 @@ const KakaoUser = {
|
|
|
267
266
|
});
|
|
268
267
|
}),
|
|
269
268
|
me: ({
|
|
269
|
+
propertyKeys,
|
|
270
270
|
secureResource = true
|
|
271
271
|
} = {}) => (0, _core.kRunWebAPI)(async () => {
|
|
272
|
-
const
|
|
272
|
+
const response = await Kakao.API.request({
|
|
273
273
|
url: '/v2/user/me',
|
|
274
|
-
data: {
|
|
274
|
+
data: (0, _jsUtil.filterNonNullishKeys)({
|
|
275
|
+
property_keys: propertyKeys,
|
|
275
276
|
secure_resource: secureResource
|
|
276
|
-
}
|
|
277
|
-
})
|
|
277
|
+
})
|
|
278
|
+
});
|
|
279
|
+
const ret = (0, _jsUtil.camelCaseObject)(response);
|
|
278
280
|
const kakaoAccount = ret.kakaoAccount ?? {};
|
|
279
281
|
const properties = ret.properties ?? {};
|
|
280
282
|
const profile = kakaoAccount.profile ?? {};
|
|
281
283
|
const legalGender = kakaoAccount.legalGender;
|
|
282
284
|
return {
|
|
283
285
|
id: ret.id,
|
|
286
|
+
properties: response.properties ?? {},
|
|
284
287
|
hasSignedUp: ret.hasSignedUp ?? null,
|
|
285
288
|
uuid: ret.forPartner?.uuid ?? null,
|
|
286
289
|
groupUserToken: ret.groupUserToken ?? null,
|
|
@@ -322,6 +325,17 @@ const KakaoUser = {
|
|
|
322
325
|
};
|
|
323
326
|
})
|
|
324
327
|
};
|
|
328
|
+
function revokeScopesWithResult(scopes) {
|
|
329
|
+
return (0, _core.kRunWebAPI)(async () => {
|
|
330
|
+
const response = await Kakao.API.request({
|
|
331
|
+
url: '/v2/user/revoke/scopes',
|
|
332
|
+
data: {
|
|
333
|
+
scopes
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
return (0, _jsUtil.camelCaseObject)(response.scopes ?? []);
|
|
337
|
+
});
|
|
338
|
+
}
|
|
325
339
|
const {
|
|
326
340
|
loginWithKakao,
|
|
327
341
|
refreshToken,
|