@accelbyte/sdk 0.2.0-beta.3 → 0.2.0-beta.5
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 +9 -1
- package/README.md +2 -2
- package/dist/index.browser.es.js +1098 -669
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.d.ts +1568 -1147
- package/dist/index.node.es.js +1099 -670
- package/dist/index.node.es.js.map +1 -1
- package/dist/index.node.js +1099 -670
- package/dist/index.node.js.map +1 -1
- package/examples/next/package.json +1 -1
- package/examples/next/yarn.lock +4 -4
- package/examples/node/package.json +1 -1
- package/examples/node/yarn.lock +4 -4
- package/examples/vite/package.json +1 -1
- package/examples/vite/yarn.lock +4 -4
- package/package.json +1 -1
package/dist/index.node.js
CHANGED
|
@@ -9543,7 +9543,10 @@ class FileUploadApi {
|
|
|
9543
9543
|
this.conf = conf;
|
|
9544
9544
|
this.namespace = namespace;
|
|
9545
9545
|
/**
|
|
9546
|
-
*
|
|
9546
|
+
* POST [/basic/v1/public/namespaces/{namespace}/folders/{folder}/files](api)
|
|
9547
|
+
*
|
|
9548
|
+
* Generate an upload URL. It's valid for 10 minutes.
|
|
9549
|
+
* Returns: URL data
|
|
9547
9550
|
*/
|
|
9548
9551
|
this.generateFolderUploadFileUrl = ({ folder, queryParams }) => {
|
|
9549
9552
|
return this.newInstance().postV1NsFoldersByFolderFiles(folder, queryParams);
|
|
@@ -9664,11 +9667,18 @@ class MiscApi {
|
|
|
9664
9667
|
this.namespace = namespace;
|
|
9665
9668
|
this.cache = cache;
|
|
9666
9669
|
/**
|
|
9667
|
-
*
|
|
9670
|
+
* GET [/basic/v1/public/namespaces/{namespace}/misc/countries](api)
|
|
9671
|
+
*
|
|
9672
|
+
* _Returns_: country code list
|
|
9668
9673
|
*/
|
|
9669
9674
|
this.getCountries = (lang) => {
|
|
9670
9675
|
return this.newInstance().fetchV1NsMiscCountries({ lang });
|
|
9671
9676
|
};
|
|
9677
|
+
/**
|
|
9678
|
+
* GET [/basic/v1/public/namespaces/{namespace}/misc/languages](api)
|
|
9679
|
+
*
|
|
9680
|
+
* _Returns_: language list
|
|
9681
|
+
*/
|
|
9672
9682
|
this.getLanguages = () => {
|
|
9673
9683
|
return this.newInstance().fetchV1NsMiscLanguages();
|
|
9674
9684
|
};
|
|
@@ -9758,7 +9768,13 @@ class NamespaceApi {
|
|
|
9758
9768
|
this.namespace = namespace;
|
|
9759
9769
|
this.cache = cache;
|
|
9760
9770
|
/**
|
|
9761
|
-
*
|
|
9771
|
+
* GET [/basic/v1/public/namespaces](api)
|
|
9772
|
+
*
|
|
9773
|
+
* Get all namespaces.
|
|
9774
|
+
*
|
|
9775
|
+
* - _Required permission_: login user
|
|
9776
|
+
* - _Action code_: 11303
|
|
9777
|
+
* - _Returns_: list of namespaces
|
|
9762
9778
|
*/
|
|
9763
9779
|
this.getNamespaces = (activeOnly) => {
|
|
9764
9780
|
return this.newInstance().fetchV1PublicNamespaces({ activeOnly });
|
|
@@ -10065,25 +10081,39 @@ class UserProfileApi {
|
|
|
10065
10081
|
this.namespace = namespace;
|
|
10066
10082
|
this.cache = cache;
|
|
10067
10083
|
/**
|
|
10068
|
-
*
|
|
10084
|
+
* GET [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
|
|
10085
|
+
*
|
|
10086
|
+
* Get my profile
|
|
10087
|
+
*
|
|
10088
|
+
* __Client with user token can get user profile in target namespace__
|
|
10069
10089
|
*/
|
|
10070
10090
|
this.getUsersMeProfiles = () => {
|
|
10071
10091
|
return this.newInstance().fetchV1NsUsersMeProfiles();
|
|
10072
10092
|
};
|
|
10073
10093
|
/**
|
|
10074
|
-
*
|
|
10094
|
+
* POST [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
|
|
10095
|
+
*
|
|
10096
|
+
* Create my profile.
|
|
10097
|
+
*
|
|
10098
|
+
* __Client with user token can create user profile in target namespace__
|
|
10075
10099
|
*/
|
|
10076
10100
|
this.createUserMeProfile = (data) => {
|
|
10077
10101
|
return this.newInstance().postV1NsUsersMeProfiles(data);
|
|
10078
10102
|
};
|
|
10079
10103
|
/**
|
|
10080
|
-
*
|
|
10104
|
+
* PUT [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
|
|
10105
|
+
*
|
|
10106
|
+
* Update my profile.
|
|
10107
|
+
* Updates user profile in the target namespace. If token's namespace doesn't match the target namespace, the service automatically maps the token's user ID into the user ID in the target namespace. The method returns the updated user profile on a successful call.
|
|
10081
10108
|
*/
|
|
10082
10109
|
this.updateUserMeProfile = (data) => {
|
|
10083
10110
|
return this.newInstance().putV1NsUsersMeProfiles(data);
|
|
10084
10111
|
};
|
|
10085
10112
|
/**
|
|
10086
|
-
*
|
|
10113
|
+
* PUT [/basic/v1/public/namespaces/{namespace}/users/{userId}/profiles/customAttributes](api)
|
|
10114
|
+
*
|
|
10115
|
+
* Update partially custom attributes tied to user id.
|
|
10116
|
+
* _Returns_: Updated custom attributes
|
|
10087
10117
|
*/
|
|
10088
10118
|
this.updateUserCustomAttributes = (userId, data) => {
|
|
10089
10119
|
return this.newInstance().putV1NsUsersByUseridProfilesCustomAttributes(userId, data);
|
|
@@ -10150,12 +10180,17 @@ class CachingApi {
|
|
|
10150
10180
|
constructor(conf, namespace) {
|
|
10151
10181
|
this.conf = conf;
|
|
10152
10182
|
this.namespace = namespace;
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10183
|
+
/**
|
|
10184
|
+
* GET [/buildinfo/public/namespaces/{namespace}/diff/cache/source/{sourceBuildId}/dest/{destinationBuildId}](api)
|
|
10185
|
+
*
|
|
10186
|
+
* This API is used to retrieve detailed diff cache.
|
|
10187
|
+
* The response will contains list of diff cache files along with its download url.
|
|
10188
|
+
*
|
|
10189
|
+
* _Required permission_: login user
|
|
10190
|
+
*/
|
|
10191
|
+
this.getDiffCache = (sourceBuildId, destinationBuildId) => {
|
|
10192
|
+
return this.newInstance().fetchNsDiffCacheSourceBySourcebuildidDestByDestinationbuildid(sourceBuildId, destinationBuildId);
|
|
10193
|
+
};
|
|
10159
10194
|
}
|
|
10160
10195
|
newInstance() {
|
|
10161
10196
|
// this is expensive to cache, apply "cache: false"
|
|
@@ -10329,18 +10364,26 @@ class DlcApi {
|
|
|
10329
10364
|
constructor(conf, namespace) {
|
|
10330
10365
|
this.conf = conf;
|
|
10331
10366
|
this.namespace = namespace;
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10367
|
+
/**
|
|
10368
|
+
* GET [/buildinfo/public/namespaces/{namespace}/dlcs/latest/byGameAppId/{appId}](api)
|
|
10369
|
+
*
|
|
10370
|
+
* Retrieve the list of DLC available on specific game. Use game's appId to query.
|
|
10371
|
+
*
|
|
10372
|
+
* _Returns_: list of DLC
|
|
10373
|
+
*/
|
|
10374
|
+
this.getLatestDLCByGameAppId = (appId) => {
|
|
10375
|
+
return this.newInstance().fetchNsDlcsLatestByGameAppIdByAppid(appId);
|
|
10376
|
+
};
|
|
10377
|
+
/**
|
|
10378
|
+
* GET [/buildinfo/public/namespaces/{namespace}/apps/latest/byDLCAppId/{dlcAppId}](api)
|
|
10379
|
+
*
|
|
10380
|
+
* Retrieve the list of DLC available on specific game. Use DLC's appId to query.
|
|
10381
|
+
*
|
|
10382
|
+
* _Returns_: appId of game and list of its builds by platformId
|
|
10383
|
+
*/
|
|
10384
|
+
this.getBaseGamesByDlcAppId = (dlcAppId) => {
|
|
10385
|
+
return this.newInstance().fetchNsAppsLatestByDlcAppIdByDlcappid(dlcAppId);
|
|
10386
|
+
};
|
|
10344
10387
|
}
|
|
10345
10388
|
newInstance() {
|
|
10346
10389
|
// this is be expensive to cache, apply "cache: false"
|
|
@@ -10707,56 +10750,76 @@ class DownloaderApi {
|
|
|
10707
10750
|
constructor(conf, namespace) {
|
|
10708
10751
|
this.conf = conf;
|
|
10709
10752
|
this.namespace = namespace;
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
10737
|
-
|
|
10753
|
+
/**
|
|
10754
|
+
* GET [/buildinfo/public/namespaces/{namespace}/availablebuilds/{appId}](api)
|
|
10755
|
+
*
|
|
10756
|
+
* This API is used to get simple build manifest that contains list of current build in various platform.
|
|
10757
|
+
*
|
|
10758
|
+
* - _Required permission_: login user
|
|
10759
|
+
* - _Returns_: build manifest
|
|
10760
|
+
*/
|
|
10761
|
+
this.getAvailableBuilds = (appId) => {
|
|
10762
|
+
return this.newInstance().fetchNsAvailablebuildsByAppid(appId);
|
|
10763
|
+
};
|
|
10764
|
+
/**
|
|
10765
|
+
* GET [/buildinfo/public/namespaces/{namespace}/v2/updategame/{appId}/{platformId}](api)
|
|
10766
|
+
*
|
|
10767
|
+
* This API is used to get build manifest of release version of the application.
|
|
10768
|
+
*
|
|
10769
|
+
* - _Required permission_: login user
|
|
10770
|
+
* - _Returns_: build manifest
|
|
10771
|
+
*/
|
|
10772
|
+
this.getBuildManifest = (appId, platformId) => {
|
|
10773
|
+
const axios = Network.create({ ...this.conf, timeout: 1800000 });
|
|
10774
|
+
return new Downloader$(axios, this.namespace, false).fetchNsV2UpdategameByAppidByPlatformid(appId, platformId);
|
|
10775
|
+
};
|
|
10776
|
+
/**
|
|
10777
|
+
* GET [/buildinfo/public/namespaces/{namespace}/diff/cache/source/{sourceBuildId}/dest/{destinationBuildId}](api)
|
|
10778
|
+
*
|
|
10779
|
+
* This API is used to retrieve detailed diff cache.
|
|
10780
|
+
* The response will contains list of diff cache files along with its download url.
|
|
10781
|
+
*
|
|
10782
|
+
* - _Required permission_: login user
|
|
10783
|
+
*/
|
|
10784
|
+
this.getDiffCache = (sourceBuildId, destinationBuildId) => {
|
|
10785
|
+
return new Caching$(Network.create(this.conf), this.namespace, false).fetchNsDiffCacheSourceBySourcebuildidDestByDestinationbuildid(sourceBuildId, destinationBuildId);
|
|
10786
|
+
};
|
|
10787
|
+
/**
|
|
10788
|
+
* Check which platform is available for the user to download the game
|
|
10789
|
+
*
|
|
10790
|
+
* @internal
|
|
10791
|
+
*/
|
|
10792
|
+
this.getMatchPlatform = ({ buildsAvailability, userPlatform }) => {
|
|
10793
|
+
const availablePlatformID = new Set();
|
|
10794
|
+
for (const buildAvailability of buildsAvailability) {
|
|
10795
|
+
if (buildAvailability.platformId) {
|
|
10796
|
+
availablePlatformID.add(buildAvailability.platformId);
|
|
10797
|
+
}
|
|
10738
10798
|
}
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10799
|
+
const currentMatchPlatform = this.getCurrentPlatform(userPlatform);
|
|
10800
|
+
if (currentMatchPlatform) {
|
|
10801
|
+
for (const key in currentMatchPlatform.targetPlatform) {
|
|
10802
|
+
if (availablePlatformID.has(currentMatchPlatform.targetPlatform[key])) {
|
|
10803
|
+
return currentMatchPlatform.targetPlatform[key];
|
|
10804
|
+
}
|
|
10745
10805
|
}
|
|
10746
10806
|
}
|
|
10747
|
-
|
|
10748
|
-
|
|
10807
|
+
return null;
|
|
10808
|
+
};
|
|
10809
|
+
/**
|
|
10810
|
+
* @internal
|
|
10811
|
+
*/
|
|
10812
|
+
this.getCurrentPlatform = (userPlatform) => {
|
|
10813
|
+
const devicePlatform = userPlatform.platform;
|
|
10814
|
+
const deviceArch = userPlatform.arch;
|
|
10815
|
+
const currentPlatform = AvailablePlatform.find((platform) => platform.platform === devicePlatform && platform.arch.includes(deviceArch));
|
|
10816
|
+
return currentPlatform;
|
|
10817
|
+
};
|
|
10749
10818
|
}
|
|
10750
10819
|
newInstance() {
|
|
10751
10820
|
// this is be expensive to cache, apply "cache: false"
|
|
10752
10821
|
return new Downloader$(Network.create(this.conf), this.namespace, false);
|
|
10753
10822
|
}
|
|
10754
|
-
getCurrentPlatform(userPlatform) {
|
|
10755
|
-
const devicePlatform = userPlatform.platform;
|
|
10756
|
-
const deviceArch = userPlatform.arch;
|
|
10757
|
-
const currentPlatform = AvailablePlatform.find((platform) => platform.platform === devicePlatform && platform.arch.includes(deviceArch));
|
|
10758
|
-
return currentPlatform;
|
|
10759
|
-
}
|
|
10760
10823
|
}
|
|
10761
10824
|
|
|
10762
10825
|
/*
|
|
@@ -10860,16 +10923,17 @@ class EventApi {
|
|
|
10860
10923
|
this.namespace = namespace;
|
|
10861
10924
|
this.cache = cache;
|
|
10862
10925
|
/**
|
|
10863
|
-
*
|
|
10864
|
-
*
|
|
10865
|
-
*
|
|
10866
|
-
*
|
|
10867
|
-
*
|
|
10868
|
-
*
|
|
10869
|
-
*
|
|
10870
|
-
*
|
|
10871
|
-
*
|
|
10872
|
-
*
|
|
10926
|
+
* GET [/event/v2/public/namespaces/{namespace}/users/{userId}/edithistory](api)
|
|
10927
|
+
*
|
|
10928
|
+
* Available Type:
|
|
10929
|
+
* - email
|
|
10930
|
+
* - password
|
|
10931
|
+
* - displayname
|
|
10932
|
+
* - dateofbirth
|
|
10933
|
+
* - country
|
|
10934
|
+
* - language
|
|
10935
|
+
*
|
|
10936
|
+
* _Requires a valid user access token_
|
|
10873
10937
|
*/
|
|
10874
10938
|
this.getAccountHistoryByUserId = ({ userId, queryParams }) => {
|
|
10875
10939
|
return this.newInstance().fetchEventV2NsUsersByUseridEdithistory(userId, queryParams);
|
|
@@ -10963,27 +11027,36 @@ class DataDeletionApi {
|
|
|
10963
11027
|
this.conf = conf;
|
|
10964
11028
|
this.namespace = namespace;
|
|
10965
11029
|
this.cache = cache;
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
11030
|
+
/**
|
|
11031
|
+
* GET [/gdpr/public/namespaces/{namespace}/users/{userId}/deletions/status](api)
|
|
11032
|
+
*
|
|
11033
|
+
* Fetch the status to check whether or not a user's account is on a deletion status
|
|
11034
|
+
*
|
|
11035
|
+
* _Requires a valid user access token_
|
|
11036
|
+
*/
|
|
11037
|
+
this.getGdprDeletionStatus = (userId) => {
|
|
11038
|
+
return this.newInstance().fetchGdprNsUsersByUseridDeletionsStatus(userId);
|
|
11039
|
+
};
|
|
11040
|
+
/**
|
|
11041
|
+
* POST [/gdpr/public/namespaces/{namespace}/users/{userId}/deletions](api)
|
|
11042
|
+
*
|
|
11043
|
+
* Request an account's deletion
|
|
11044
|
+
*
|
|
11045
|
+
* _Requires a valid user access token and password_
|
|
11046
|
+
*/
|
|
11047
|
+
this.requestAccountDeletion = ({ userId, data }) => {
|
|
11048
|
+
return this.newInstance().postGdprNsUsersByUseridDeletions(userId, data);
|
|
11049
|
+
};
|
|
11050
|
+
/**
|
|
11051
|
+
* DELETE [/gdpr/public/namespaces/{namespace}/users/{userId}/deletions](api)
|
|
11052
|
+
*
|
|
11053
|
+
* Cancel a deletion request
|
|
11054
|
+
*
|
|
11055
|
+
* _Requires a valid user access token_
|
|
11056
|
+
*/
|
|
11057
|
+
this.cancelAccountDeletion = (userId) => {
|
|
11058
|
+
return this.newInstance().deleteGdprNsUsersByUseridDeletions(userId);
|
|
11059
|
+
};
|
|
10987
11060
|
}
|
|
10988
11061
|
newInstance() {
|
|
10989
11062
|
return new DataDeletion$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -11104,34 +11177,46 @@ class DataRetrievalApi {
|
|
|
11104
11177
|
this.conf = conf;
|
|
11105
11178
|
this.namespace = namespace;
|
|
11106
11179
|
this.cache = cache;
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11180
|
+
/**
|
|
11181
|
+
* GET [/gdpr/public/namespaces/{namespace}/users/{userId}/requests](api)
|
|
11182
|
+
*
|
|
11183
|
+
* Fetch personal data request list
|
|
11184
|
+
*
|
|
11185
|
+
* _Requires a valid user access token_
|
|
11186
|
+
*/
|
|
11187
|
+
this.getGdprDataRequestList = ({ userId, queryParams }) => {
|
|
11188
|
+
return this.newInstance().fetchGdprNsUsersByUseridRequests(userId, queryParams);
|
|
11189
|
+
};
|
|
11190
|
+
/**
|
|
11191
|
+
* POST [/gdpr/public/namespaces/{namespace}/users/{userId}/requests](api)
|
|
11192
|
+
*
|
|
11193
|
+
* Create a request for personal data download
|
|
11194
|
+
*
|
|
11195
|
+
* _Requires a valid user access token_
|
|
11196
|
+
*/
|
|
11197
|
+
this.requestGdprData = ({ userId, data }) => {
|
|
11198
|
+
return this.newInstance().postGdprNsUsersByUseridRequests(userId, data);
|
|
11199
|
+
};
|
|
11200
|
+
/**
|
|
11201
|
+
* DELETE [/gdpr/public/namespaces/{namespace}/users/{userId}/requests/{requestDate}](api)
|
|
11202
|
+
*
|
|
11203
|
+
* Cancel the request for personal data download
|
|
11204
|
+
*
|
|
11205
|
+
* _Requires a valid user access token_
|
|
11206
|
+
*/
|
|
11207
|
+
this.cancelGdprDataRequest = ({ userId, requestDate }) => {
|
|
11208
|
+
return this.newInstance().deleteGdprNsUsersByUseridRequestsByRequestdate(userId, requestDate);
|
|
11209
|
+
};
|
|
11210
|
+
/**
|
|
11211
|
+
* POST [/gdpr/public/namespaces/{namespace}/users/{userId}/requests/{requestDate}/generate](api)
|
|
11212
|
+
*
|
|
11213
|
+
* Create a download URL for personal data request
|
|
11214
|
+
*
|
|
11215
|
+
* _Requires a valid user access token_
|
|
11216
|
+
*/
|
|
11217
|
+
this.requestGdprDataDownloadUrl = ({ userId, requestDate, data }) => {
|
|
11218
|
+
return this.newInstance().postGdprNsUsersByUseridRequestsByRequestdateGenerate(userId, requestDate, data);
|
|
11219
|
+
};
|
|
11135
11220
|
}
|
|
11136
11221
|
newInstance() {
|
|
11137
11222
|
return new DataRetrieval$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -11224,10 +11309,11 @@ class InputValidationsApi {
|
|
|
11224
11309
|
this.namespace = namespace;
|
|
11225
11310
|
this.cache = cache;
|
|
11226
11311
|
/**
|
|
11227
|
-
*
|
|
11228
|
-
* <p>This method is to get list of input validation configuration.</p>
|
|
11229
|
-
* <p><code>regex</code> parameter will be returned if <code>isCustomRegex</code> is true. Otherwise, it will be empty.</p>
|
|
11312
|
+
* GET [/iam/v3/public/inputValidations](api)
|
|
11230
11313
|
*
|
|
11314
|
+
* No role required
|
|
11315
|
+
* This method is to get list of input validation configuration.
|
|
11316
|
+
* `regex` parameter will be returned if `isCustomRegex` is true. Otherwise, it will be empty.
|
|
11231
11317
|
*/
|
|
11232
11318
|
this.getValidations = (languageCode, defaultOnEmpty) => {
|
|
11233
11319
|
const queryParams = { languageCode, defaultOnEmpty };
|
|
@@ -20193,7 +20279,7 @@ class LoginErrorUnknown extends Error {
|
|
|
20193
20279
|
}
|
|
20194
20280
|
class LoginErrorUnmatchedState extends Error {
|
|
20195
20281
|
}
|
|
20196
|
-
class
|
|
20282
|
+
class UserAuthorizationApi {
|
|
20197
20283
|
/**
|
|
20198
20284
|
* @internal
|
|
20199
20285
|
*/
|
|
@@ -20203,81 +20289,83 @@ class UserAuthorization {
|
|
|
20203
20289
|
this.cache = cache;
|
|
20204
20290
|
this.options = options;
|
|
20205
20291
|
/**
|
|
20206
|
-
*
|
|
20207
|
-
*
|
|
20292
|
+
* POST: [/iam/v3/oauth/token](api)
|
|
20293
|
+
*
|
|
20294
|
+
* This method supports grant type:
|
|
20295
|
+
* - Grant Type == `authorization_code`:
|
|
20208
20296
|
* It generates the user token by given the authorization
|
|
20209
20297
|
* code which generated in "/iam/v3/authenticate" API response. It should also pass
|
|
20210
20298
|
* in the redirect_uri, which should be the same as generating the
|
|
20211
20299
|
* authorization code request.
|
|
20212
|
-
*
|
|
20213
|
-
*
|
|
20300
|
+
*
|
|
20301
|
+
* - Grant Type == `password`:
|
|
20214
20302
|
* The grant type to use for authenticating a user, whether it's by email / username and password combination
|
|
20215
20303
|
* or through platform.
|
|
20216
|
-
*
|
|
20217
|
-
*
|
|
20304
|
+
*
|
|
20305
|
+
* - Grant Type == `refresh_token`:
|
|
20218
20306
|
* Used to get a new access token for a valid refresh token.
|
|
20219
|
-
*
|
|
20220
|
-
*
|
|
20307
|
+
*
|
|
20308
|
+
* - Grant Type == `client_credentials`:
|
|
20221
20309
|
* It generates a token by checking the client credentials provided through Authorization header.
|
|
20222
|
-
*
|
|
20223
|
-
*
|
|
20224
|
-
*
|
|
20225
|
-
*
|
|
20226
|
-
*
|
|
20227
|
-
*
|
|
20228
|
-
*
|
|
20229
|
-
*
|
|
20230
|
-
*
|
|
20231
|
-
*
|
|
20232
|
-
*
|
|
20233
|
-
*
|
|
20234
|
-
*
|
|
20235
|
-
*
|
|
20236
|
-
*
|
|
20237
|
-
*
|
|
20238
|
-
*
|
|
20239
|
-
*
|
|
20240
|
-
*
|
|
20241
|
-
*
|
|
20242
|
-
*
|
|
20243
|
-
*
|
|
20244
|
-
*
|
|
20245
|
-
*
|
|
20246
|
-
*
|
|
20247
|
-
*
|
|
20248
|
-
*
|
|
20249
|
-
*
|
|
20250
|
-
*
|
|
20251
|
-
*
|
|
20252
|
-
*
|
|
20253
|
-
*
|
|
20254
|
-
*
|
|
20255
|
-
*
|
|
20256
|
-
*
|
|
20257
|
-
*
|
|
20258
|
-
*
|
|
20259
|
-
*
|
|
20260
|
-
*
|
|
20261
|
-
*
|
|
20262
|
-
*
|
|
20263
|
-
*
|
|
20264
|
-
*
|
|
20265
|
-
*
|
|
20266
|
-
*
|
|
20267
|
-
*
|
|
20268
|
-
*
|
|
20269
|
-
*
|
|
20270
|
-
*
|
|
20271
|
-
*
|
|
20272
|
-
*
|
|
20273
|
-
*
|
|
20274
|
-
*
|
|
20275
|
-
*
|
|
20276
|
-
*
|
|
20277
|
-
*
|
|
20278
|
-
*
|
|
20279
|
-
*
|
|
20280
|
-
*
|
|
20310
|
+
* ##Access Token Content
|
|
20311
|
+
* Following is the access token’s content:
|
|
20312
|
+
*
|
|
20313
|
+
* -
|
|
20314
|
+
* __namespace__. It is the namespace the token was generated from.
|
|
20315
|
+
*
|
|
20316
|
+
* -
|
|
20317
|
+
* __display_name__. The display name of the sub. It is empty if the token is generated from the client credential
|
|
20318
|
+
*
|
|
20319
|
+
* -
|
|
20320
|
+
* __roles__. The sub’s roles. It is empty if the token is generated from the client credential
|
|
20321
|
+
*
|
|
20322
|
+
* -
|
|
20323
|
+
* __namespace_roles__. The sub’s roles scoped to namespace. Improvement from roles, which make the role scoped to specific namespace instead of global to publisher namespace
|
|
20324
|
+
*
|
|
20325
|
+
* -
|
|
20326
|
+
* __permissions__. The sub or aud’ permissions
|
|
20327
|
+
*
|
|
20328
|
+
* -
|
|
20329
|
+
* __bans__. The sub’s list of bans. It is used by the IAM client for validating the token.
|
|
20330
|
+
*
|
|
20331
|
+
* -
|
|
20332
|
+
* __jflgs__. It stands for Justice Flags. It is a special flag used for storing additional status information regarding the sub. It is implemented as a bit mask. Following explains what each bit represents:
|
|
20333
|
+
*
|
|
20334
|
+
* - 1: Email Address Verified
|
|
20335
|
+
* - 2: Phone Number Verified
|
|
20336
|
+
* - 4: Anonymous
|
|
20337
|
+
* - 8: Suspicious Login
|
|
20338
|
+
*
|
|
20339
|
+
*
|
|
20340
|
+
* -
|
|
20341
|
+
* __aud__. The aud is the targeted resource server.
|
|
20342
|
+
*
|
|
20343
|
+
* -
|
|
20344
|
+
* __iat__. The time the token issues at. It is in Epoch time format
|
|
20345
|
+
*
|
|
20346
|
+
* -
|
|
20347
|
+
* __exp__. The time the token expires. It is in Epoch time format
|
|
20348
|
+
*
|
|
20349
|
+
* -
|
|
20350
|
+
* __client_id__. The UserID. The sub is omitted if the token is generated from client credential
|
|
20351
|
+
*
|
|
20352
|
+
* -
|
|
20353
|
+
* __scope__. The scope of the access request, expressed as a list of space-delimited, case-sensitive strings
|
|
20354
|
+
*
|
|
20355
|
+
*
|
|
20356
|
+
* ##Bans
|
|
20357
|
+
* The JWT contains user's active bans with its expiry date. List of ban types can be obtained from /bans.
|
|
20358
|
+
* ##Device Cookie Validation
|
|
20359
|
+
* __For grant type "password" only__
|
|
20360
|
+
* Device Cookie is used to protect the user account from brute force login attack,
|
|
20361
|
+
* [more detail from OWASP](https://owasp.org/www-community/Slow_Down_Online_Guessing_Attacks_with_Device_Cookies)
|
|
20362
|
+
* This method will read device cookie from request header __Auth-Trust-Id__. If device cookie not found, it will generate a new one and set it into response body __auth_trust_id__ when successfully login.
|
|
20363
|
+
* ##Track Login History
|
|
20364
|
+
* This method will track login history to detect suspicious login activity, please provide __Device-Id__ (alphanumeric) in request header parameter otherwise it will set to "unknown".
|
|
20365
|
+
* Align with General Data Protection Regulation in Europe, user login history will be kept within 28 days by default"
|
|
20366
|
+
* ##2FA remember device
|
|
20367
|
+
* To remember device for 2FA, should provide cookie: device_token or header: Device-Token
|
|
20368
|
+
* action code: 10703
|
|
20281
20369
|
*/
|
|
20282
20370
|
this.loginWithAuthorizationCode = async ({ code, codeVerifier }) => {
|
|
20283
20371
|
const deviceId = SdkDevice.getDeviceId();
|
|
@@ -20309,6 +20397,9 @@ class UserAuthorization {
|
|
|
20309
20397
|
CodeChallenge.clear();
|
|
20310
20398
|
return { ...result, mfaData };
|
|
20311
20399
|
};
|
|
20400
|
+
/**
|
|
20401
|
+
* @internal
|
|
20402
|
+
*/
|
|
20312
20403
|
this.getMfaDataFromError = (errorResponse) => {
|
|
20313
20404
|
const doesMFADataExist = Validate.safeParse(errorResponse.data, MFADataResponse);
|
|
20314
20405
|
if (!doesMFADataExist)
|
|
@@ -20320,13 +20411,44 @@ class UserAuthorization {
|
|
|
20320
20411
|
}
|
|
20321
20412
|
return result;
|
|
20322
20413
|
};
|
|
20414
|
+
/**
|
|
20415
|
+
* @internal
|
|
20416
|
+
*/
|
|
20323
20417
|
this.getMfaDataFromStorage = () => {
|
|
20324
20418
|
const storedMFAData = BrowserHelper.isOnBrowser() && localStorage.getItem(MFA_DATA_STORAGE_KEY);
|
|
20325
20419
|
return storedMFAData ? JSON.parse(storedMFAData) : null;
|
|
20326
20420
|
};
|
|
20421
|
+
/**
|
|
20422
|
+
* @internal
|
|
20423
|
+
*/
|
|
20327
20424
|
this.removeMfaDataFromStorage = () => {
|
|
20328
20425
|
localStorage.removeItem(MFA_DATA_STORAGE_KEY);
|
|
20329
20426
|
};
|
|
20427
|
+
/**
|
|
20428
|
+
* @internal
|
|
20429
|
+
*/
|
|
20430
|
+
this.matchReceivedState = (maybeSentState) => {
|
|
20431
|
+
const sentStateResult = CodeChallenge.parseSentState(maybeSentState);
|
|
20432
|
+
if (sentStateResult.error)
|
|
20433
|
+
return { error: sentStateResult.error, result: null };
|
|
20434
|
+
const storedStateResult = CodeChallenge.load();
|
|
20435
|
+
if (storedStateResult.error)
|
|
20436
|
+
return { error: storedStateResult.error, result: null };
|
|
20437
|
+
const sentState = sentStateResult.sentState;
|
|
20438
|
+
const storedState = storedStateResult.storedState;
|
|
20439
|
+
if (sentState.csrf !== storedState.csrf)
|
|
20440
|
+
return { error: null, result: null };
|
|
20441
|
+
return {
|
|
20442
|
+
error: null,
|
|
20443
|
+
result: {
|
|
20444
|
+
payload: sentState.payload,
|
|
20445
|
+
codeVerifier: storedState.codeVerifier
|
|
20446
|
+
}
|
|
20447
|
+
};
|
|
20448
|
+
};
|
|
20449
|
+
/**
|
|
20450
|
+
* @internal
|
|
20451
|
+
*/
|
|
20330
20452
|
this.deduceLoginError = (error) => {
|
|
20331
20453
|
switch (error) {
|
|
20332
20454
|
case LoginErrorParam.Enum.login_session_expired:
|
|
@@ -20368,6 +20490,11 @@ class UserAuthorization {
|
|
|
20368
20490
|
returnPath
|
|
20369
20491
|
};
|
|
20370
20492
|
};
|
|
20493
|
+
/**
|
|
20494
|
+
* GET [/iam/v3/oauth/authorize](api)
|
|
20495
|
+
*
|
|
20496
|
+
* Creates a URL to be used for Login, Register, Link to existing account or Twitch Link
|
|
20497
|
+
*/
|
|
20371
20498
|
this.createLoginURL = (returnPath, targetAuthPage, oneTimeLinkCode) => {
|
|
20372
20499
|
const { verifier, challenge } = CodeChallenge.generateChallenge();
|
|
20373
20500
|
const csrf = CodeChallenge.generateCsrf();
|
|
@@ -20391,6 +20518,11 @@ class UserAuthorization {
|
|
|
20391
20518
|
const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
|
|
20392
20519
|
return url.toString();
|
|
20393
20520
|
};
|
|
20521
|
+
/**
|
|
20522
|
+
* GET [/iam/v3/oauth/authorize](api)
|
|
20523
|
+
*
|
|
20524
|
+
* Creates a URL to be used for password recovery
|
|
20525
|
+
*/
|
|
20394
20526
|
this.createForgotPasswordURL = () => {
|
|
20395
20527
|
const { verifier, challenge } = CodeChallenge.generateChallenge();
|
|
20396
20528
|
const csrf = CodeChallenge.generateCsrf();
|
|
@@ -20409,9 +20541,15 @@ class UserAuthorization {
|
|
|
20409
20541
|
const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
|
|
20410
20542
|
return url.toString();
|
|
20411
20543
|
};
|
|
20544
|
+
/**
|
|
20545
|
+
* @internal
|
|
20546
|
+
*/
|
|
20412
20547
|
this.getCodeChallenge = () => {
|
|
20413
20548
|
return CodeChallenge.generateChallenge();
|
|
20414
20549
|
};
|
|
20550
|
+
/**
|
|
20551
|
+
* @internal
|
|
20552
|
+
*/
|
|
20415
20553
|
this.refreshToken = () => {
|
|
20416
20554
|
const { clientId, refreshToken } = this.options;
|
|
20417
20555
|
if (DesktopChecker.isDesktopApp()) {
|
|
@@ -20419,6 +20557,9 @@ class UserAuthorization {
|
|
|
20419
20557
|
}
|
|
20420
20558
|
return refreshWithLock({ axiosConfig: this.conf, clientId });
|
|
20421
20559
|
};
|
|
20560
|
+
/**
|
|
20561
|
+
* @internal
|
|
20562
|
+
*/
|
|
20422
20563
|
this.getSearchParams = (sentState, challenge) => {
|
|
20423
20564
|
const searchParams = new URLSearchParams();
|
|
20424
20565
|
searchParams.append('response_type', 'code');
|
|
@@ -20430,25 +20571,6 @@ class UserAuthorization {
|
|
|
20430
20571
|
return searchParams;
|
|
20431
20572
|
};
|
|
20432
20573
|
}
|
|
20433
|
-
matchReceivedState(maybeSentState) {
|
|
20434
|
-
const sentStateResult = CodeChallenge.parseSentState(maybeSentState);
|
|
20435
|
-
if (sentStateResult.error)
|
|
20436
|
-
return { error: sentStateResult.error, result: null };
|
|
20437
|
-
const storedStateResult = CodeChallenge.load();
|
|
20438
|
-
if (storedStateResult.error)
|
|
20439
|
-
return { error: storedStateResult.error, result: null };
|
|
20440
|
-
const sentState = sentStateResult.sentState;
|
|
20441
|
-
const storedState = storedStateResult.storedState;
|
|
20442
|
-
if (sentState.csrf !== storedState.csrf)
|
|
20443
|
-
return { error: null, result: null };
|
|
20444
|
-
return {
|
|
20445
|
-
error: null,
|
|
20446
|
-
result: {
|
|
20447
|
-
payload: sentState.payload,
|
|
20448
|
-
codeVerifier: storedState.codeVerifier
|
|
20449
|
-
}
|
|
20450
|
-
};
|
|
20451
|
-
}
|
|
20452
20574
|
}
|
|
20453
20575
|
function isAxiosError(error) {
|
|
20454
20576
|
return !!error && !!error.config;
|
|
@@ -20857,12 +20979,18 @@ class OAuthApi {
|
|
|
20857
20979
|
this.cache = cache;
|
|
20858
20980
|
this.options = options;
|
|
20859
20981
|
/**
|
|
20860
|
-
*
|
|
20861
|
-
|
|
20862
|
-
|
|
20863
|
-
|
|
20864
|
-
|
|
20865
|
-
|
|
20982
|
+
* @internal
|
|
20983
|
+
*/
|
|
20984
|
+
this.newOAuth20Extension = () => {
|
|
20985
|
+
return new OAuth20Extension$(Network.create(this.conf), this.namespace, this.cache);
|
|
20986
|
+
};
|
|
20987
|
+
/**
|
|
20988
|
+
* POST [/iam/v3/logout](api)
|
|
20989
|
+
*
|
|
20990
|
+
* This method is used to remove __access_token__, __refresh_token__ from cookie and revoke token from usage.
|
|
20991
|
+
* Supported methods:
|
|
20992
|
+
* - VerifyToken to verify token from header
|
|
20993
|
+
* - AddTokenToRevocationList to revoke token with TTL
|
|
20866
20994
|
*/
|
|
20867
20995
|
this.logout = () => {
|
|
20868
20996
|
const axios = Network.create({
|
|
@@ -20874,8 +21002,10 @@ class OAuthApi {
|
|
|
20874
21002
|
return new OAuth20Extension$(axios, this.namespace, this.cache).postIamV3Logout();
|
|
20875
21003
|
};
|
|
20876
21004
|
/**
|
|
20877
|
-
*
|
|
20878
|
-
*
|
|
21005
|
+
* POST [/iam/v3/oauth/revoke](api)
|
|
21006
|
+
*
|
|
21007
|
+
* This method revokes a token.
|
|
21008
|
+
* This method requires authorized requests header with Basic Authentication from client that establish the token.action code: 10706
|
|
20879
21009
|
*/
|
|
20880
21010
|
this.revoke = ({ token }) => {
|
|
20881
21011
|
const axios = Network.create({
|
|
@@ -20889,10 +21019,12 @@ class OAuthApi {
|
|
|
20889
21019
|
return new OAuth20$(axios, this.namespace, this.cache).postIamV3OauthRevoke({ token });
|
|
20890
21020
|
};
|
|
20891
21021
|
/**
|
|
20892
|
-
*
|
|
20893
|
-
*
|
|
20894
|
-
*
|
|
20895
|
-
*
|
|
21022
|
+
* POST [/iam/v3/oauth/mfa/verify](api)
|
|
21023
|
+
*
|
|
21024
|
+
* Verify 2FA code
|
|
21025
|
+
* This method is used for verifying 2FA code.
|
|
21026
|
+
* ##2FA remember device
|
|
21027
|
+
* To remember device for 2FA, should provide cookie: device_token or header: Device-Token
|
|
20896
21028
|
*
|
|
20897
21029
|
*/
|
|
20898
21030
|
this.verify2FA = async ({ factor, code, mfaToken = null, rememberDevice }) => {
|
|
@@ -20904,6 +21036,9 @@ class OAuthApi {
|
|
|
20904
21036
|
localStorage.removeItem(MFA_DATA_STORAGE_KEY);
|
|
20905
21037
|
return result.response;
|
|
20906
21038
|
};
|
|
21039
|
+
/**
|
|
21040
|
+
* POST [/iam/v3/oauth/mfa/code](api)
|
|
21041
|
+
*/
|
|
20907
21042
|
this.request2FAEmailCode = async ({ mfaToken = null, factor }) => {
|
|
20908
21043
|
const result = await this.newInstance().postIamV3OauthMfaCode({ mfaToken, clientId: this.options.clientId, factor });
|
|
20909
21044
|
if (result.error)
|
|
@@ -20911,70 +21046,72 @@ class OAuthApi {
|
|
|
20911
21046
|
return result.response;
|
|
20912
21047
|
};
|
|
20913
21048
|
/**
|
|
20914
|
-
*
|
|
21049
|
+
* GET [/iam/v3/location/country](api)
|
|
21050
|
+
*
|
|
21051
|
+
* This method get country location based on the request.
|
|
20915
21052
|
*/
|
|
20916
21053
|
this.getCurrentLocationCountry = () => {
|
|
20917
21054
|
return this.newOAuth20Extension().fetchIamV3LocationCountry();
|
|
20918
21055
|
};
|
|
20919
21056
|
/**
|
|
20920
|
-
*
|
|
20921
|
-
*
|
|
21057
|
+
* GET [/iam/v3/oauth/namespaces/{namespace}/users/{userId}/platforms/{platformId}/platformToken](api)
|
|
21058
|
+
*
|
|
21059
|
+
* Retrieve User Third Party Platform Token
|
|
21060
|
+
*
|
|
20922
21061
|
* This method used for retrieving third party platform token for user that login using third party,
|
|
20923
21062
|
* if user have not link requested platform in game namespace, will try to retrieving third party platform token from publisher namespace.
|
|
20924
21063
|
* Passing platform group name or it's member will return same access token that can be used across the platform members.
|
|
20925
|
-
*
|
|
20926
|
-
*
|
|
20927
|
-
*
|
|
20928
|
-
*
|
|
20929
|
-
*
|
|
20930
|
-
*
|
|
20931
|
-
*
|
|
20932
|
-
*
|
|
20933
|
-
*
|
|
20934
|
-
* </ul>
|
|
21064
|
+
*
|
|
21065
|
+
* The third party platform and platform group covered for this is:
|
|
21066
|
+
* - (psn) ps4web
|
|
21067
|
+
* - (psn) ps4
|
|
21068
|
+
* - (psn) ps5
|
|
21069
|
+
* - epicgames
|
|
21070
|
+
* - twitch
|
|
21071
|
+
* - awscognito
|
|
21072
|
+
*
|
|
20935
21073
|
*/
|
|
20936
21074
|
this.getThirdPartyPlatformToken = (userId, platformId) => {
|
|
20937
21075
|
return this.newInstance().fetchV3OauthUsersByUseridPlatformsByPlatformidPlatformToken(userId, platformId);
|
|
20938
21076
|
};
|
|
20939
21077
|
/**
|
|
21078
|
+
* POST [/iam/v3/authenticateWithLink](api)
|
|
21079
|
+
*
|
|
20940
21080
|
* This method is being used to authenticate a user account and perform platform link.
|
|
20941
21081
|
* It validates user's email / username and password.
|
|
20942
|
-
* If user already enable 2FA, then invoke
|
|
21082
|
+
* If user already enable 2FA, then invoke _/mfa/verify_ using __mfa_token__ from this method response.
|
|
20943
21083
|
*
|
|
20944
|
-
*
|
|
21084
|
+
* ##Device Cookie Validation
|
|
20945
21085
|
*
|
|
20946
|
-
* Device Cookie is used to protect the user account from brute force login attack,
|
|
20947
|
-
*
|
|
21086
|
+
* Device Cookie is used to protect the user account from brute force login attack,
|
|
21087
|
+
* [more detail from OWASP](https://owasp.org/www-community/Slow_Down_Online_Guessing_Attacks_with_Device_Cookies).
|
|
21088
|
+
* This method will read device cookie from cookie __auth-trust-id__. If device cookie not found, it will generate a new one and set it into cookie when successfully authenticate.
|
|
20948
21089
|
*
|
|
20949
21090
|
*/
|
|
20950
21091
|
this.authenticateWithLink = (data) => {
|
|
20951
21092
|
return this.newOAuth20Extension().postIamV3AuthenticateWithLink(data);
|
|
20952
21093
|
};
|
|
20953
|
-
|
|
20954
|
-
|
|
20955
|
-
|
|
20956
|
-
|
|
20957
|
-
|
|
20958
|
-
|
|
20959
|
-
|
|
20960
|
-
|
|
20961
|
-
|
|
20962
|
-
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
-
|
|
20972
|
-
|
|
20973
|
-
|
|
20974
|
-
*
|
|
20975
|
-
*/
|
|
20976
|
-
exchangeTokenByOneTimeLinkCode(data) {
|
|
20977
|
-
return this.newOAuth20Extension().postIamV3LinkTokenExchange(data);
|
|
21094
|
+
/**
|
|
21095
|
+
* POST [/iam/v3/link/code/validate](api)
|
|
21096
|
+
*
|
|
21097
|
+
* This method is being used to validate one time link code.
|
|
21098
|
+
* It require a valid user token.
|
|
21099
|
+
* Should specify the target platform id and current user should already linked to this platform.
|
|
21100
|
+
* Current user should be a headless account.
|
|
21101
|
+
*/
|
|
21102
|
+
this.validateOneTimeLinkCode = (data) => {
|
|
21103
|
+
return this.newOAuth20Extension().postIamV3LinkCodeValidate(data);
|
|
21104
|
+
};
|
|
21105
|
+
/**
|
|
21106
|
+
* POST [/iam/v3/link/token/exchange](api)
|
|
21107
|
+
*
|
|
21108
|
+
* This method is being used to generate user's token by one time link code.
|
|
21109
|
+
* It require publisher ClientID
|
|
21110
|
+
* It required a code which can be generated from __/iam/v3/link/code/request__.
|
|
21111
|
+
*/
|
|
21112
|
+
this.exchangeTokenByOneTimeLinkCode = (data) => {
|
|
21113
|
+
return this.newOAuth20Extension().postIamV3LinkTokenExchange(data);
|
|
21114
|
+
};
|
|
20978
21115
|
}
|
|
20979
21116
|
newInstance() {
|
|
20980
21117
|
return new OAuth20$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -21053,6 +21190,8 @@ class ThirdPartyCredentialApi {
|
|
|
21053
21190
|
this.namespace = namespace;
|
|
21054
21191
|
this.cache = cache;
|
|
21055
21192
|
/**
|
|
21193
|
+
* GET [/iam/v3/public/namespaces/{namespace}/platforms/clients/active](api)
|
|
21194
|
+
*
|
|
21056
21195
|
* This is the Public API to Get All Active 3rd Platform Credential.
|
|
21057
21196
|
*/
|
|
21058
21197
|
this.getThirdPartyPlatformInfo = () => {
|
|
@@ -21554,85 +21693,112 @@ class TwoFA {
|
|
|
21554
21693
|
this.namespace = namespace;
|
|
21555
21694
|
this.cache = cache;
|
|
21556
21695
|
/**
|
|
21557
|
-
*
|
|
21558
|
-
* Each code is a one-time code and will be deleted once used.</p>
|
|
21559
|
-
* <p>This method Requires valid user access token</p>
|
|
21696
|
+
* GET [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode](api)
|
|
21560
21697
|
*
|
|
21698
|
+
* This method is used to get 8-digits backup codes.
|
|
21699
|
+
* Each code is a one-time code and will be deleted once used.
|
|
21700
|
+
*
|
|
21701
|
+
* _Requires a valid user access token_
|
|
21561
21702
|
*/
|
|
21562
21703
|
this.getBackupCode = () => {
|
|
21563
21704
|
return this.newInstance().fetchV4NsUsersMeMfaBackupCode();
|
|
21564
21705
|
};
|
|
21565
21706
|
/**
|
|
21566
|
-
*
|
|
21567
|
-
*
|
|
21707
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode/enable](api)
|
|
21708
|
+
*
|
|
21709
|
+
* This method is used to enable 2FA backup codes.
|
|
21568
21710
|
*
|
|
21711
|
+
* _Requires a valid user access token_
|
|
21569
21712
|
*/
|
|
21570
21713
|
this.enable2FABackupCodes = () => {
|
|
21571
21714
|
return this.newInstance().postV4NsUsersMeMfaBackupCodeEnable();
|
|
21572
21715
|
};
|
|
21573
21716
|
/**
|
|
21574
|
-
*
|
|
21575
|
-
* <p>This method Requires valid user access token</p>
|
|
21717
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode](api)
|
|
21576
21718
|
*
|
|
21719
|
+
* This method is used to enable 2FA backup codes.
|
|
21720
|
+
*
|
|
21721
|
+
* _Requires a valid user access token_
|
|
21577
21722
|
*/
|
|
21578
21723
|
this.generateBackupCodes = () => {
|
|
21579
21724
|
return this.newInstance().postV4NsUsersMeMfaBackupCode();
|
|
21580
21725
|
};
|
|
21581
21726
|
/**
|
|
21582
|
-
*
|
|
21583
|
-
*
|
|
21727
|
+
* DELETE [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode/disable](api)
|
|
21728
|
+
*
|
|
21729
|
+
* This method is used to enable 2FA backup codes.
|
|
21584
21730
|
*
|
|
21731
|
+
* _Requires a valid user access token_
|
|
21585
21732
|
*/
|
|
21586
21733
|
this.disableBackupCodes = () => {
|
|
21587
21734
|
return this.newInstance().deleteV4NsUsersMeMfaBackupCodeDisable();
|
|
21588
21735
|
};
|
|
21589
21736
|
/**
|
|
21590
|
-
*
|
|
21591
|
-
*
|
|
21737
|
+
* DELETE [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/disable](api)
|
|
21738
|
+
* }
|
|
21739
|
+
* This method is used to disable 2FA authenticator.
|
|
21592
21740
|
*
|
|
21741
|
+
* _Requires a valid user access token_
|
|
21593
21742
|
*/
|
|
21594
21743
|
this.disableAuthenticator = () => {
|
|
21595
21744
|
return this.newInstance().deleteV4NsUsersMeMfaAuthenticatorDisable();
|
|
21596
21745
|
};
|
|
21597
21746
|
/**
|
|
21598
|
-
*
|
|
21599
|
-
* <p>This method Requires valid user access token</p>
|
|
21747
|
+
* GET [/iam/v4/public/namespaces/{namespace}/users/me/mfa/factor](api)
|
|
21600
21748
|
*
|
|
21749
|
+
* This method is used to get user enabled factors.
|
|
21750
|
+
*
|
|
21751
|
+
* _Requires a valid user access token_
|
|
21601
21752
|
*/
|
|
21602
21753
|
this.getEnabledMethods = () => {
|
|
21603
21754
|
return this.newInstance().fetchV4NsUsersMeMfaFactor();
|
|
21604
21755
|
};
|
|
21605
21756
|
/**
|
|
21606
|
-
*
|
|
21607
|
-
*
|
|
21757
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/factor](api)
|
|
21758
|
+
*
|
|
21759
|
+
* This method is used to make 2FA factor default.
|
|
21608
21760
|
*
|
|
21761
|
+
* _Requires a valid user access token_
|
|
21609
21762
|
*/
|
|
21610
21763
|
this.set2FAAsDefault = (factor) => {
|
|
21611
21764
|
return this.newInstance().postV4NsUsersMeMfaFactor({ factor });
|
|
21612
21765
|
};
|
|
21613
21766
|
/**
|
|
21614
|
-
*
|
|
21615
|
-
* <p>This method Requires valid user access token</p>
|
|
21767
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/enable](api)
|
|
21616
21768
|
*
|
|
21769
|
+
* This method is used to enable 2FA authenticator.
|
|
21770
|
+
*
|
|
21771
|
+
* _Requires a valid user access token_
|
|
21617
21772
|
*/
|
|
21618
21773
|
this.enable2FAAuthenticator = (code) => {
|
|
21619
21774
|
return this.newInstance().postV4NsUsersMeMfaAuthenticatorEnable({ code });
|
|
21620
21775
|
};
|
|
21621
21776
|
/**
|
|
21622
|
-
*
|
|
21623
|
-
*
|
|
21624
|
-
*
|
|
21777
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/key](api)
|
|
21778
|
+
*
|
|
21779
|
+
* This method is used to generate a secret key for 3rd-party authenticator app.
|
|
21780
|
+
* A QR code URI is also returned so that frontend can generate QR code image.
|
|
21625
21781
|
*
|
|
21782
|
+
* _Requires a valid user access token_
|
|
21626
21783
|
*/
|
|
21627
21784
|
this.generateSecretKey = () => {
|
|
21628
21785
|
return this.newInstance().postV4NsUsersMeMfaAuthenticatorKey();
|
|
21629
21786
|
};
|
|
21787
|
+
/**
|
|
21788
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/code](api)
|
|
21789
|
+
*/
|
|
21630
21790
|
this.requestEmailCode = () => {
|
|
21631
21791
|
return this.newInstance().postV4NsUsersMeMfaEmailCode();
|
|
21632
21792
|
};
|
|
21793
|
+
/**
|
|
21794
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/enable](api)
|
|
21795
|
+
*/
|
|
21633
21796
|
this.enableEmailMethod = (code) => {
|
|
21634
21797
|
return this.newInstance().postV4NsUsersMeMfaEmailEnable({ code });
|
|
21635
21798
|
};
|
|
21799
|
+
/**
|
|
21800
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/disable](api)
|
|
21801
|
+
*/
|
|
21636
21802
|
this.disableEmailMethod = () => {
|
|
21637
21803
|
return this.newInstance().postV4NsUsersMeMfaEmailDisable();
|
|
21638
21804
|
};
|
|
@@ -22846,295 +23012,326 @@ class UserApi {
|
|
|
22846
23012
|
this.namespace = namespace;
|
|
22847
23013
|
this.cache = cache;
|
|
22848
23014
|
/**
|
|
22849
|
-
*
|
|
23015
|
+
* GET [/iam/v3/public/users/me](api)
|
|
23016
|
+
*
|
|
23017
|
+
* get currently logged-in user
|
|
22850
23018
|
*/
|
|
22851
23019
|
this.getCurrentUser = () => {
|
|
22852
23020
|
return this.newInstance().fetchIamV3PublicUsersMe();
|
|
22853
23021
|
};
|
|
22854
23022
|
/**
|
|
22855
|
-
*
|
|
23023
|
+
* PATCH [/iam/v3/public/namespaces/{namespace}/users/me](api)
|
|
23024
|
+
*
|
|
23025
|
+
* Update current user
|
|
22856
23026
|
*/
|
|
22857
23027
|
this.updateUserMe = (data) => {
|
|
22858
23028
|
return this.newInstance().patchV3NsUsersMe(data);
|
|
22859
23029
|
};
|
|
22860
23030
|
/**
|
|
23031
|
+
* PUT [/iam/v4/public/namespaces/{namespace}/users/me/email](api)
|
|
23032
|
+
*
|
|
22861
23033
|
* update current user's email
|
|
22862
23034
|
*/
|
|
22863
23035
|
this.updateEmailMe = (data) => {
|
|
22864
23036
|
return this.newInstance4().putV4NsUsersMeEmail(data);
|
|
22865
23037
|
};
|
|
22866
23038
|
/**
|
|
23039
|
+
* PUT [/iam/v3/public/namespaces/{namespace}/users/me/password](api)
|
|
23040
|
+
*
|
|
22867
23041
|
* update current user's password
|
|
22868
23042
|
*/
|
|
22869
23043
|
this.updatePasswordMe = (data) => {
|
|
22870
23044
|
return this.newInstance().putV3NsUsersMePassword(data);
|
|
22871
23045
|
};
|
|
22872
23046
|
/**
|
|
23047
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/code/request](api)
|
|
23048
|
+
*
|
|
22873
23049
|
* Required valid user authorization
|
|
22874
|
-
*
|
|
22875
|
-
*
|
|
22876
|
-
*
|
|
22877
|
-
*
|
|
22878
|
-
*
|
|
22879
|
-
*
|
|
22880
|
-
* <strong><em>It is the default context if the Context field is empty</em></strong></p>
|
|
22881
|
-
* </li>
|
|
22882
|
-
* <li>
|
|
22883
|
-
* <strong>UpdateEmailAddress</strong>
|
|
22884
|
-
* <p>a context type used for verify user before updating email address.(Without email address verified checking)</p>
|
|
22885
|
-
* </li>
|
|
22886
|
-
* <li><strong>upgradeHeadlessAccount</strong>
|
|
22887
|
-
* <p>The context is intended to be used whenever the email address wanted to be automatically verified on upgrading a headless account.
|
|
22888
|
-
* If this context used, IAM rejects the request if the email address is already used by others by returning HTTP Status Code 409.</p>
|
|
22889
|
-
* </li>
|
|
22890
|
-
* </ol>
|
|
22891
|
-
* <p>action code: 10116</p>
|
|
23050
|
+
* The verification code is sent to email address
|
|
23051
|
+
* Available contexts for use :
|
|
23052
|
+
* -
|
|
23053
|
+
* __UserAccountRegistration__
|
|
23054
|
+
* a context type used for verifying email address in user account registration. It returns 409 if the email address already verified.
|
|
23055
|
+
* __It is the default context if the Context field is empty__
|
|
22892
23056
|
*
|
|
22893
|
-
|
|
23057
|
+
* -
|
|
23058
|
+
* __UpdateEmailAddress__
|
|
23059
|
+
* a context type used for verify user before updating email address.(Without email address verified checking)
|
|
23060
|
+
*
|
|
23061
|
+
* - __upgradeHeadlessAccount__
|
|
23062
|
+
* The context is intended to be used whenever the email address wanted to be automatically verified on upgrading a headless account.
|
|
23063
|
+
* If this context used, IAM rejects the request if the email address is already used by others by returning HTTP Status Code 409.
|
|
23064
|
+
* action code: 10116
|
|
23065
|
+
*
|
|
23066
|
+
*/
|
|
22894
23067
|
this.requestVerificationCode = (data) => {
|
|
22895
23068
|
return this.newInstance().postV3NsUsersMeCodeRequest(data);
|
|
22896
23069
|
};
|
|
22897
23070
|
/**
|
|
22898
|
-
*
|
|
22899
|
-
*
|
|
22900
|
-
*
|
|
22901
|
-
*
|
|
22902
|
-
*
|
|
23071
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/code/verify](api)
|
|
23072
|
+
*
|
|
23073
|
+
* Will consume code if validateOnly is set false
|
|
23074
|
+
* Required valid user authorization
|
|
23075
|
+
* Redeems a verification code sent to a user to verify the user's contact address is correct
|
|
23076
|
+
* Available ContactType : __email__
|
|
23077
|
+
* action code: 10107
|
|
22903
23078
|
*
|
|
22904
23079
|
*/
|
|
22905
23080
|
this.verifyCode = (data) => {
|
|
22906
23081
|
return this.newInstance().postV3NsUsersMeCodeVerify(data);
|
|
22907
23082
|
};
|
|
22908
23083
|
/**
|
|
22909
|
-
*
|
|
23084
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/headless/code/verify](api)
|
|
23085
|
+
*
|
|
23086
|
+
* If validateOnly is set false, consume code and upgrade headless account and automatically verified the email address if it is succeeded
|
|
22910
23087
|
* Require valid user access token.
|
|
22911
|
-
*
|
|
22912
|
-
* By upgrading the headless account into a full account, the user could use the email address and password for using Justice IAM.
|
|
22913
|
-
*
|
|
22914
|
-
* In order to get a verification code for the method, please check the send verification code method
|
|
22915
|
-
*
|
|
23088
|
+
* The method upgrades a headless account by linking the headless account with the email address and the password.
|
|
23089
|
+
* By upgrading the headless account into a full account, the user could use the email address and password for using Justice IAM.
|
|
23090
|
+
* The method is a shortcut for upgrading a headless account and verifying the email address in one call.
|
|
23091
|
+
* In order to get a verification code for the method, please check the send verification code method.
|
|
23092
|
+
* This method also have an ability to update user data (if the user data field is specified) right after the upgrade account process is done.
|
|
22916
23093
|
* Supported user data fields :
|
|
22917
|
-
*
|
|
22918
|
-
*
|
|
22919
|
-
*
|
|
22920
|
-
*
|
|
22921
|
-
*
|
|
22922
|
-
*
|
|
23094
|
+
*
|
|
23095
|
+
* - displayName
|
|
23096
|
+
* - dateOfBirth : format YYYY-MM-DD, e.g. 2019-04-29
|
|
23097
|
+
* - country : format ISO3166-1 alpha-2 two letter, e.g. US
|
|
23098
|
+
*
|
|
23099
|
+
* action code : 10124
|
|
22923
23100
|
*/
|
|
22924
23101
|
this.upgradeHeadlessAccount = (data) => {
|
|
22925
23102
|
return this.newInstance().postV3NsUsersMeHeadlessCodeVerify(data);
|
|
22926
23103
|
};
|
|
22927
23104
|
/**
|
|
23105
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/headless/code/verify](api)
|
|
23106
|
+
*
|
|
22928
23107
|
* Require valid user access token.
|
|
22929
23108
|
* The method upgrades a headless account by linking the headless account with the email address, username, and password.
|
|
22930
23109
|
* By upgrading the headless account into a full account, the user could use the email address, username, and password for using Justice IAM.
|
|
22931
|
-
*
|
|
23110
|
+
*
|
|
22932
23111
|
* The method is a shortcut for upgrading a headless account and verifying the email address in one call.
|
|
22933
|
-
*
|
|
22934
|
-
* <br>
|
|
23112
|
+
*
|
|
22935
23113
|
* This method also have an ability to update user data (if the user data field is specified) right after the upgrade account process is done.
|
|
22936
23114
|
* Supported user data fields:
|
|
22937
|
-
*
|
|
22938
|
-
*
|
|
22939
|
-
*
|
|
22940
|
-
*
|
|
22941
|
-
*
|
|
23115
|
+
*
|
|
23116
|
+
* - displayName
|
|
23117
|
+
* - dateOfBirth : format YYYY-MM-DD, e.g. 2019-04-29
|
|
23118
|
+
* - country : format ISO3166-1 alpha-2 two letter, e.g. US
|
|
23119
|
+
*
|
|
22942
23120
|
* action code : 10124
|
|
22943
23121
|
*/
|
|
22944
23122
|
this.upgradeHeadlessAccountV4 = (data) => {
|
|
22945
23123
|
return this.newInstance4().postV4NsUsersMeHeadlessCodeVerify(data);
|
|
22946
23124
|
};
|
|
22947
23125
|
/**
|
|
22948
|
-
*
|
|
22949
|
-
*
|
|
23126
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/{userId}/platforms](api)
|
|
23127
|
+
*
|
|
23128
|
+
* This method retrieves platform accounts linked to user. Required valid user authorization.
|
|
23129
|
+
* action code: 10128
|
|
22950
23130
|
*/
|
|
22951
23131
|
this.getUserLinkedPlatform = (userId) => {
|
|
22952
23132
|
return this.newInstance().fetchV3NsUsersByUseridPlatforms(userId);
|
|
22953
23133
|
};
|
|
22954
23134
|
/**
|
|
23135
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}](api)
|
|
23136
|
+
*
|
|
22955
23137
|
* Required valid user authorization.
|
|
22956
|
-
*
|
|
23138
|
+
* __Prerequisite:__
|
|
22957
23139
|
* Platform client configuration need to be added to database for specific platformId. Namespace service URL need to be specified (refer to required environment variables).
|
|
22958
|
-
*
|
|
22959
|
-
*
|
|
22960
|
-
*
|
|
22961
|
-
*
|
|
22962
|
-
*
|
|
22963
|
-
*
|
|
22964
|
-
*
|
|
22965
|
-
*
|
|
22966
|
-
*
|
|
22967
|
-
*
|
|
22968
|
-
*
|
|
22969
|
-
*
|
|
22970
|
-
*
|
|
22971
|
-
*
|
|
22972
|
-
*
|
|
22973
|
-
*
|
|
22974
|
-
*
|
|
22975
|
-
*
|
|
22976
|
-
*
|
|
22977
|
-
*
|
|
22978
|
-
*
|
|
23140
|
+
* ##Supported platforms:
|
|
23141
|
+
*
|
|
23142
|
+
* - __steam__: The ticket’s value is the authentication code returned by Steam.
|
|
23143
|
+
* - __steamopenid__: Steam's user authentication method using OpenID 2.0. The ticket's value is URL generated by Steam on web authentication
|
|
23144
|
+
* - __facebook__: The ticket’s value is the authorization code returned by Facebook OAuth
|
|
23145
|
+
* - __google__: The ticket’s value is the authorization code returned by Google OAuth
|
|
23146
|
+
* - __oculus__: The ticket’s value is a string composed of Oculus's user ID and the nonce separated by a colon (:).
|
|
23147
|
+
* - __twitch__: The ticket’s value is the authorization code returned by Twitch OAuth.
|
|
23148
|
+
* - __android__: The ticket's value is the Android’s device ID
|
|
23149
|
+
* - __ios__: The ticket's value is the iOS’s device ID.
|
|
23150
|
+
* - __apple__: The ticket’s value is the authorization code returned by Apple OAuth.
|
|
23151
|
+
* - __device__: Every device that doesn't run Android and iOS is categorized as a device platform. The ticket's value is the device’s ID.
|
|
23152
|
+
* - __discord__: The ticket’s value is the authorization code returned by Discord OAuth.
|
|
23153
|
+
* - __ps4web__: The ticket’s value is the authorization code returned by PSN OAuth.
|
|
23154
|
+
* - __xblweb__: The ticket’s value is the authorization code returned by XBox Live OAuth.
|
|
23155
|
+
* - __awscognito__: The ticket’s value is the aws cognito access token (JWT).
|
|
23156
|
+
* - __epicgames__: The ticket’s value is an access-token obtained from Epicgames EOS Account Service.
|
|
23157
|
+
* - __nintendo__: The ticket’s value is the authorization code(id_token) returned by Nintendo OAuth.
|
|
23158
|
+
* - __stadia__: The ticket’s value is a JWT Token, which can be obtained after calling the Stadia SDK's function.
|
|
23159
|
+
*
|
|
23160
|
+
* action code : 10144
|
|
22979
23161
|
*/
|
|
22980
23162
|
this.linkAccountToPlatform = ({ platformId, data }) => {
|
|
22981
23163
|
return this.newInstance().postV3NsUsersMePlatformsByPlatformid(platformId, data);
|
|
22982
23164
|
};
|
|
22983
23165
|
/**
|
|
23166
|
+
* GET [/iam/v3/public/namespaces/{namespace}/requests/{requestId}/async/status](api)
|
|
23167
|
+
*
|
|
22984
23168
|
* Get the linking status between a third-party platform to a user
|
|
22985
23169
|
*/
|
|
22986
23170
|
this.getLinkRequestStatus = (requestId) => {
|
|
22987
23171
|
return this.newInstance().fetchV3NsRequestsByRequestidAsyncStatus(requestId);
|
|
22988
23172
|
};
|
|
22989
23173
|
/**
|
|
22990
|
-
*
|
|
23174
|
+
* @internal
|
|
23175
|
+
* It is going to be __DEPRECATED__.
|
|
22991
23176
|
* Update Platform Account relation to current User Account.
|
|
22992
23177
|
* Note: Game progression data (statistics, reward, etc) associated with previous User Account will not be
|
|
22993
23178
|
* transferred. If the data is tight to game user ID, the user will have the game progression data.
|
|
22994
|
-
*
|
|
22995
23179
|
*/
|
|
22996
23180
|
this.linkPlatformToUserAccount = ({ userId, data }) => {
|
|
22997
23181
|
return this.newInstance().postV3NsUsersByUseridPlatformsLink(userId, data);
|
|
22998
23182
|
};
|
|
22999
23183
|
/**
|
|
23184
|
+
* DELETE [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}](api)
|
|
23185
|
+
*
|
|
23000
23186
|
* Required valid user authorization.
|
|
23001
|
-
*
|
|
23002
|
-
*
|
|
23003
|
-
*
|
|
23004
|
-
*
|
|
23005
|
-
*
|
|
23006
|
-
*
|
|
23007
|
-
*
|
|
23008
|
-
*
|
|
23009
|
-
*
|
|
23010
|
-
*
|
|
23011
|
-
*
|
|
23012
|
-
*
|
|
23013
|
-
*
|
|
23014
|
-
*
|
|
23015
|
-
*
|
|
23016
|
-
*
|
|
23017
|
-
*
|
|
23018
|
-
*
|
|
23019
|
-
*
|
|
23020
|
-
*
|
|
23021
|
-
*
|
|
23022
|
-
*
|
|
23023
|
-
*
|
|
23024
|
-
*
|
|
23025
|
-
*
|
|
23026
|
-
*
|
|
23187
|
+
* ##Supported platforms:
|
|
23188
|
+
*
|
|
23189
|
+
* - __steam__
|
|
23190
|
+
* - __steamopenid__
|
|
23191
|
+
* - __facebook__
|
|
23192
|
+
* - __google__
|
|
23193
|
+
* - __oculus__
|
|
23194
|
+
* - __twitch__
|
|
23195
|
+
* - __android__
|
|
23196
|
+
* - __ios__
|
|
23197
|
+
* - __apple__
|
|
23198
|
+
* - __device__
|
|
23199
|
+
* - __discord__
|
|
23200
|
+
* - __awscognito__
|
|
23201
|
+
* - __epicgames__
|
|
23202
|
+
* - __nintendo__
|
|
23203
|
+
* - __stadia__
|
|
23204
|
+
*
|
|
23205
|
+
* Unlink user's account from a specific platform. 'justice' platform might have multiple accounts from different namespaces linked.
|
|
23206
|
+
* _platformNamespace_ need to be specified when the platform ID is 'justice'.
|
|
23207
|
+
*
|
|
23208
|
+
* Unlink user's account from justice platform will enable password token grant and password update.
|
|
23209
|
+
*
|
|
23210
|
+
* If you want to unlink user's account in a game namespace, you have to specify _platformNamespace_ to that game namespace.
|
|
23211
|
+
*
|
|
23212
|
+
* action code : 10121
|
|
23027
23213
|
*/
|
|
23028
23214
|
this.unLinkAccountFromPlatform = ({ platformId, data }) => {
|
|
23029
23215
|
return this.newInstance().deleteV3NsUsersMePlatformsByPlatformid(platformId, data);
|
|
23030
23216
|
};
|
|
23031
23217
|
/**
|
|
23218
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}/web/link](api)
|
|
23219
|
+
*
|
|
23032
23220
|
* This method is used to generate third party login page which will redirected to establish method.
|
|
23033
23221
|
*/
|
|
23034
23222
|
this.getThirdPartyURL = ({ platformId, queryParams }) => {
|
|
23035
23223
|
return this.newInstance().fetchV3NsUsersMePlatformsByPlatformidWebLink(platformId, queryParams);
|
|
23036
23224
|
};
|
|
23037
23225
|
/**
|
|
23226
|
+
* GET [/iam/v3/public/namespaces/{namespace}/agerestrictions/countries/{countryCode}](api)
|
|
23227
|
+
*
|
|
23038
23228
|
* Get age restriction by country code. It will always get by publisher namespace
|
|
23039
23229
|
*/
|
|
23040
23230
|
this.getAgeRestrictionByCountry = (countryCode) => {
|
|
23041
23231
|
return this.newInstance().fetchV3NsAgerestrictionsCountriesByCountrycode(countryCode);
|
|
23042
23232
|
};
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
|
|
23054
|
-
|
|
23055
|
-
|
|
23056
|
-
|
|
23057
|
-
|
|
23058
|
-
|
|
23059
|
-
|
|
23060
|
-
|
|
23061
|
-
|
|
23062
|
-
|
|
23063
|
-
|
|
23064
|
-
|
|
23065
|
-
|
|
23066
|
-
|
|
23067
|
-
|
|
23068
|
-
|
|
23069
|
-
|
|
23070
|
-
|
|
23071
|
-
|
|
23072
|
-
|
|
23073
|
-
|
|
23074
|
-
|
|
23075
|
-
|
|
23076
|
-
|
|
23077
|
-
|
|
23078
|
-
|
|
23079
|
-
|
|
23080
|
-
|
|
23081
|
-
|
|
23082
|
-
|
|
23083
|
-
|
|
23084
|
-
|
|
23085
|
-
|
|
23086
|
-
|
|
23087
|
-
|
|
23088
|
-
|
|
23089
|
-
|
|
23090
|
-
|
|
23091
|
-
|
|
23092
|
-
|
|
23093
|
-
|
|
23094
|
-
|
|
23095
|
-
|
|
23096
|
-
|
|
23097
|
-
|
|
23098
|
-
|
|
23099
|
-
|
|
23100
|
-
|
|
23101
|
-
|
|
23102
|
-
|
|
23103
|
-
|
|
23104
|
-
|
|
23105
|
-
|
|
23106
|
-
|
|
23107
|
-
|
|
23108
|
-
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23112
|
-
|
|
23113
|
-
|
|
23114
|
-
|
|
23115
|
-
|
|
23116
|
-
|
|
23117
|
-
|
|
23118
|
-
|
|
23119
|
-
|
|
23120
|
-
|
|
23121
|
-
|
|
23122
|
-
|
|
23123
|
-
|
|
23124
|
-
|
|
23125
|
-
|
|
23126
|
-
|
|
23127
|
-
|
|
23128
|
-
|
|
23129
|
-
|
|
23130
|
-
|
|
23131
|
-
|
|
23132
|
-
|
|
23133
|
-
|
|
23134
|
-
|
|
23135
|
-
|
|
23136
|
-
|
|
23137
|
-
|
|
23233
|
+
/**
|
|
23234
|
+
* Render 2D Avatar via readyplayer.me POST [](https://docs.readyplayer.me/ready-player-me/avatars/2d-avatars/render-api)
|
|
23235
|
+
* @internal
|
|
23236
|
+
*/
|
|
23237
|
+
this.renderImageFromGlbModel = (data) => {
|
|
23238
|
+
const axios = Network.create({
|
|
23239
|
+
...this.conf
|
|
23240
|
+
});
|
|
23241
|
+
return Validate.responseType(() => axios.post('https://render.readyplayer.me/render', data), ReadyPlayerMe);
|
|
23242
|
+
};
|
|
23243
|
+
/**
|
|
23244
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/code/request](api)
|
|
23245
|
+
*
|
|
23246
|
+
* This method will validate the request's email address.
|
|
23247
|
+
*
|
|
23248
|
+
* If it already been used, will response 409.
|
|
23249
|
+
*
|
|
23250
|
+
* If it is available, we will send a verification code to this email address.
|
|
23251
|
+
*/
|
|
23252
|
+
this.requestNewUserVerificationCode = (data) => {
|
|
23253
|
+
return this.newInstance().postV3NsUsersCodeRequest(data);
|
|
23254
|
+
};
|
|
23255
|
+
/**
|
|
23256
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users](api)
|
|
23257
|
+
*
|
|
23258
|
+
* Create a new user with unique email address and username.
|
|
23259
|
+
*
|
|
23260
|
+
* __Required attributes:__
|
|
23261
|
+
* - authType: possible value is EMAILPASSWD
|
|
23262
|
+
* - emailAddress: Please refer to the rule from /v3/public/inputValidations API.
|
|
23263
|
+
* - username: Please refer to the rule from /v3/public/inputValidations API.
|
|
23264
|
+
* - password: Please refer to the rule from /v3/public/inputValidations API.
|
|
23265
|
+
* - country: ISO3166-1 alpha-2 two letter, e.g. US.
|
|
23266
|
+
* - dateOfBirth: YYYY-MM-DD, e.g. 1990-01-01. valid values are between 1905-01-01 until current date.
|
|
23267
|
+
*
|
|
23268
|
+
* __Not required attributes:__
|
|
23269
|
+
* - displayName: Please refer to the rule from /v3/public/inputValidations API.
|
|
23270
|
+
*
|
|
23271
|
+
* This method support accepting agreements for the created user. Supply the accepted agreements in acceptedPolicies attribute.
|
|
23272
|
+
*
|
|
23273
|
+
*/
|
|
23274
|
+
this.createUser = (data) => {
|
|
23275
|
+
return this.newInstance4().postV4NsUsers(data);
|
|
23276
|
+
};
|
|
23277
|
+
/**
|
|
23278
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/{userId}/distinctPlatforms](api)
|
|
23279
|
+
*
|
|
23280
|
+
* This method retrieves platform accounts linked to user.
|
|
23281
|
+
* It will query all linked platform accounts and result will be distinct & grouped, same platform we will pick oldest linked one.
|
|
23282
|
+
* Required valid user authorization.
|
|
23283
|
+
*/
|
|
23284
|
+
this.getUserDistinctLinkedPlatform = (userId) => {
|
|
23285
|
+
return this.newInstance().fetchV3NsUsersByUseridDistinctPlatforms(userId);
|
|
23286
|
+
};
|
|
23287
|
+
/**
|
|
23288
|
+
* DELETE [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}/all](api)
|
|
23289
|
+
*
|
|
23290
|
+
* Required valid user authorization.
|
|
23291
|
+
* Unlink user's account from for all third platforms.
|
|
23292
|
+
*/
|
|
23293
|
+
this.unLinkAccountFromPlatformDistinct = (platformId) => {
|
|
23294
|
+
return this.newInstance().deleteV3NsUsersMePlatformsByPlatformidAll(platformId);
|
|
23295
|
+
};
|
|
23296
|
+
/**
|
|
23297
|
+
* POST [/iam/v3/public/users/me/verify_link/request](api)
|
|
23298
|
+
*
|
|
23299
|
+
* Required valid user authorization
|
|
23300
|
+
* The verification link is sent to email address
|
|
23301
|
+
* It will not send request if user email is already verified
|
|
23302
|
+
*/
|
|
23303
|
+
this.sendVerificationLink = (languageTag) => {
|
|
23304
|
+
return this.newInstance().postIamV3PublicUsersMeVerifyLinkRequest({ languageTag });
|
|
23305
|
+
};
|
|
23306
|
+
/**
|
|
23307
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/{userId}/platforms](api)
|
|
23308
|
+
*
|
|
23309
|
+
* This method retrieves platform accounts linked to user. Required valid user authorization.
|
|
23310
|
+
* action code: 10128
|
|
23311
|
+
*/
|
|
23312
|
+
this.getLinkedAccount = (userId) => {
|
|
23313
|
+
return this.newInstance().fetchV3NsUsersByUseridPlatforms(userId);
|
|
23314
|
+
};
|
|
23315
|
+
/**
|
|
23316
|
+
* GET [/iam/v3/public/users/me/headless/link/conflict](api)
|
|
23317
|
+
*
|
|
23318
|
+
* Note:
|
|
23319
|
+
* 1. My account should be full account
|
|
23320
|
+
* 2. My account not linked to request headless account's third platform.
|
|
23321
|
+
*/
|
|
23322
|
+
this.getLinkAccountByOneTimeCodeConflict = (params) => {
|
|
23323
|
+
return this.newInstance().fetchIamV3PublicUsersMeHeadlessLinkConflict(params);
|
|
23324
|
+
};
|
|
23325
|
+
/**
|
|
23326
|
+
* POST [/iam/v3/public/users/me/headless/linkWithProgression](api)
|
|
23327
|
+
*
|
|
23328
|
+
* Note:
|
|
23329
|
+
* 1. My account should be full account
|
|
23330
|
+
* 2. My account not linked to headless account's third platform.
|
|
23331
|
+
*/
|
|
23332
|
+
this.linkWithProgression = (data) => {
|
|
23333
|
+
return this.newInstance().postIamV3PublicUsersMeHeadlessLinkWithProgression(data);
|
|
23334
|
+
};
|
|
23138
23335
|
}
|
|
23139
23336
|
/**
|
|
23140
23337
|
* @internal
|
|
@@ -23291,24 +23488,36 @@ class AgreementApi {
|
|
|
23291
23488
|
this.conf = conf;
|
|
23292
23489
|
this.namespace = namespace;
|
|
23293
23490
|
this.cache = cache;
|
|
23294
|
-
|
|
23295
|
-
|
|
23296
|
-
|
|
23297
|
-
|
|
23298
|
-
|
|
23299
|
-
|
|
23300
|
-
|
|
23301
|
-
|
|
23302
|
-
|
|
23303
|
-
|
|
23304
|
-
|
|
23305
|
-
|
|
23306
|
-
|
|
23307
|
-
|
|
23308
|
-
|
|
23309
|
-
|
|
23310
|
-
|
|
23311
|
-
|
|
23491
|
+
/**
|
|
23492
|
+
* POST [/agreement/public/agreements/policies](api)
|
|
23493
|
+
*
|
|
23494
|
+
* Accepts many legal policy versions all at once. Supply with localized version policy id to accept an agreement.
|
|
23495
|
+
*
|
|
23496
|
+
* _Required permission_: login user
|
|
23497
|
+
*/
|
|
23498
|
+
this.acceptLegalPolicies = (acceptAgreements) => {
|
|
23499
|
+
return this.newInstance().postPublicAgreementsPolicies(acceptAgreements);
|
|
23500
|
+
};
|
|
23501
|
+
/**
|
|
23502
|
+
* GET [/agreement/public/agreements/policies](api)
|
|
23503
|
+
*
|
|
23504
|
+
* Retrieve accepted Legal Agreements.
|
|
23505
|
+
*
|
|
23506
|
+
* _Required permission_: login user
|
|
23507
|
+
*/
|
|
23508
|
+
this.getAgreements = () => {
|
|
23509
|
+
return this.newInstance().fetchPublicAgreementsPolicies();
|
|
23510
|
+
};
|
|
23511
|
+
/**
|
|
23512
|
+
* PATCH [/agreement/public/agreements/localized-policy-versions/preferences](api)
|
|
23513
|
+
*
|
|
23514
|
+
* Change marketing preference consent
|
|
23515
|
+
*
|
|
23516
|
+
* _Required permission_: login user
|
|
23517
|
+
*/
|
|
23518
|
+
this.updateMarketingPreferences = (acceptAgreements) => {
|
|
23519
|
+
return this.newInstance().patchPublicAgreementsLocalizedPolicyVersionsPreferences(acceptAgreements);
|
|
23520
|
+
};
|
|
23312
23521
|
}
|
|
23313
23522
|
newInstance() {
|
|
23314
23523
|
return new Agreement$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23421,12 +23630,16 @@ class EligibilitiesApi {
|
|
|
23421
23630
|
this.conf = conf;
|
|
23422
23631
|
this.namespace = namespace;
|
|
23423
23632
|
this.cache = cache;
|
|
23424
|
-
|
|
23425
|
-
|
|
23426
|
-
|
|
23427
|
-
|
|
23428
|
-
|
|
23429
|
-
|
|
23633
|
+
/**
|
|
23634
|
+
* GET [/agreement/public/eligibilities/namespaces/{namespace}](api)
|
|
23635
|
+
*
|
|
23636
|
+
* Retrieve the active policies and its conformance status by user.This process supports cross-namespace checking, that means if the active policy already accepted by the same user in other namespace, then it will be considered as eligible.
|
|
23637
|
+
*
|
|
23638
|
+
* _Required permission_: login user
|
|
23639
|
+
*/
|
|
23640
|
+
this.getUserEligibilities = () => {
|
|
23641
|
+
return this.newInstance().fetchPublicEligibilitiesNamespacesByNamespace();
|
|
23642
|
+
};
|
|
23430
23643
|
}
|
|
23431
23644
|
newInstance() {
|
|
23432
23645
|
return new Eligibilities$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23529,12 +23742,14 @@ class LocalizedPolicyVersionsApi {
|
|
|
23529
23742
|
this.conf = conf;
|
|
23530
23743
|
this.namespace = namespace;
|
|
23531
23744
|
this.cache = cache;
|
|
23532
|
-
|
|
23533
|
-
|
|
23534
|
-
|
|
23535
|
-
|
|
23536
|
-
|
|
23537
|
-
|
|
23745
|
+
/**
|
|
23746
|
+
* GET [/agreement/public/localized-policy-versions/{localizedPolicyVersionId}](api)
|
|
23747
|
+
*
|
|
23748
|
+
* Retrieve specific localized policy version including the policy version and base policy version where the localized policy version located.
|
|
23749
|
+
*/
|
|
23750
|
+
this.fetchLocalizedPolicyVersionById = (localizedPolicyVersionId) => {
|
|
23751
|
+
return this.newInstance().fetchPublicLocalizedPolicyVersionsByLocalizedpolicyversionid(localizedPolicyVersionId);
|
|
23752
|
+
};
|
|
23538
23753
|
}
|
|
23539
23754
|
newInstance() {
|
|
23540
23755
|
return new LocalizedPolicyVersions$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23640,18 +23855,37 @@ class PoliciesApi {
|
|
|
23640
23855
|
this.conf = conf;
|
|
23641
23856
|
this.namespace = namespace;
|
|
23642
23857
|
this.cache = cache;
|
|
23643
|
-
|
|
23644
|
-
|
|
23645
|
-
|
|
23646
|
-
|
|
23647
|
-
|
|
23648
|
-
|
|
23649
|
-
|
|
23650
|
-
|
|
23651
|
-
|
|
23652
|
-
|
|
23653
|
-
|
|
23654
|
-
|
|
23858
|
+
/**
|
|
23859
|
+
* GET [/agreement/public/policies/namespaces/{namespace}/countries/{countryCode}](api)
|
|
23860
|
+
*
|
|
23861
|
+
* Retrieve all active latest policies based on a namespace and country.
|
|
23862
|
+
*
|
|
23863
|
+
* - _Leave the policyType empty if you want to be responded with all policy type_
|
|
23864
|
+
* - _Fill the tags if you want to filter the responded policy by tags_
|
|
23865
|
+
* - _Fill the defaultOnEmpty with true if you want to be responded with default country-specific policy if your requested country is not exist_
|
|
23866
|
+
* - _Fill the alwaysIncludeDefault with true if you want to be responded with always include default policy. If there are duplicate policies (default policies and country specific policies with same base policy) it'll include policy with same country code, for example:_
|
|
23867
|
+
*
|
|
23868
|
+
* - Document 1 (default): Region US (default), UA
|
|
23869
|
+
* - Document 2 (default): Region US (default)
|
|
23870
|
+
* - Document 3 (default): Region US (default)
|
|
23871
|
+
* - User: Region UA
|
|
23872
|
+
* - Query: alwaysIncludeDefault: true
|
|
23873
|
+
* - Response: Document 1 (UA), Document 2 (US), Document 3 (US)
|
|
23874
|
+
*/
|
|
23875
|
+
this.fetchPoliciesByCountry = ({ countryCode, queryParams }) => {
|
|
23876
|
+
return this.newInstance().fetchPublicPoliciesNamespacesByNamespaceCountriesByCountrycode(countryCode, queryParams);
|
|
23877
|
+
};
|
|
23878
|
+
/**
|
|
23879
|
+
* GET [/agreement/public/policies/countries/{countryCode}](api)
|
|
23880
|
+
*
|
|
23881
|
+
* Retrieve all active latest policies based on country from all namespaces.
|
|
23882
|
+
* - _Leave the policyType empty if you want to be responded with all policy type_
|
|
23883
|
+
* - _Fill the tags if you want to filter the responded policy by tags_
|
|
23884
|
+
* - _Fill the defaultOnEmpty with true if you want to be responded with default country-specific policy if your requested country is not exist_
|
|
23885
|
+
*/
|
|
23886
|
+
this.fetchAllPoliciesByCountry = ({ countryCode, queryParams }) => {
|
|
23887
|
+
return this.newInstance().fetchPublicPoliciesCountriesByCountrycode(countryCode, queryParams);
|
|
23888
|
+
};
|
|
23655
23889
|
}
|
|
23656
23890
|
newInstance() {
|
|
23657
23891
|
return new Policies$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23735,12 +23969,21 @@ class PublicTemplateApi {
|
|
|
23735
23969
|
this.conf = conf;
|
|
23736
23970
|
this.namespace = namespace;
|
|
23737
23971
|
this.cache = cache;
|
|
23972
|
+
/**
|
|
23973
|
+
* @internal
|
|
23974
|
+
*/
|
|
23738
23975
|
this.getTemplateConfigs = (template) => {
|
|
23739
23976
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigs(template);
|
|
23740
23977
|
};
|
|
23978
|
+
/**
|
|
23979
|
+
* @internal
|
|
23980
|
+
*/
|
|
23741
23981
|
this.getTemplateConfig = (template, configId) => {
|
|
23742
23982
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigsByConfig(template, configId);
|
|
23743
23983
|
};
|
|
23984
|
+
/**
|
|
23985
|
+
* @internal
|
|
23986
|
+
*/
|
|
23744
23987
|
this.getDiscoveryTemplateConfigs = () => {
|
|
23745
23988
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigs(DISCOVERY_TEMPLATE_NAME);
|
|
23746
23989
|
};
|
|
@@ -23810,13 +24053,19 @@ class CurrencyApi {
|
|
|
23810
24053
|
this.namespace = namespace;
|
|
23811
24054
|
this.cache = cache;
|
|
23812
24055
|
/**
|
|
23813
|
-
*
|
|
24056
|
+
* GET [/platform/public/namespaces/{namespace}/currencies](api)
|
|
24057
|
+
*
|
|
24058
|
+
* List currencies of a namespace.
|
|
24059
|
+
*
|
|
24060
|
+
* Returns: Currency List
|
|
23814
24061
|
*/
|
|
23815
24062
|
this.getCurrencies = () => {
|
|
23816
24063
|
return this.newInstance().fetchNsCurrencies();
|
|
23817
24064
|
};
|
|
23818
24065
|
/**
|
|
23819
24066
|
* Get the currencies list and convert into a map of currency code and the currency itself
|
|
24067
|
+
*
|
|
24068
|
+
* @internal
|
|
23820
24069
|
*/
|
|
23821
24070
|
this.getCurrencyMap = async () => {
|
|
23822
24071
|
const result = await this.getCurrencies();
|
|
@@ -24429,38 +24678,42 @@ class EntitlementApi {
|
|
|
24429
24678
|
this.conf = conf;
|
|
24430
24679
|
this.namespace = namespace;
|
|
24431
24680
|
this.cache = cache;
|
|
24432
|
-
|
|
24433
|
-
|
|
24434
|
-
|
|
24435
|
-
|
|
24436
|
-
|
|
24437
|
-
|
|
24438
|
-
|
|
24439
|
-
|
|
24440
|
-
|
|
24441
|
-
|
|
24442
|
-
|
|
24443
|
-
|
|
24444
|
-
|
|
24445
|
-
|
|
24446
|
-
|
|
24447
|
-
|
|
24448
|
-
|
|
24449
|
-
|
|
24450
|
-
|
|
24451
|
-
|
|
24452
|
-
|
|
24453
|
-
|
|
24454
|
-
|
|
24455
|
-
|
|
24456
|
-
|
|
24457
|
-
|
|
24458
|
-
|
|
24459
|
-
|
|
24460
|
-
|
|
24461
|
-
|
|
24462
|
-
|
|
24463
|
-
|
|
24681
|
+
/**
|
|
24682
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/entitlements/byAppId](api)
|
|
24683
|
+
*
|
|
24684
|
+
* Get user app entitlement by appId.
|
|
24685
|
+
*/
|
|
24686
|
+
this.getEntitlementByAppId = ({ userId, appId }) => {
|
|
24687
|
+
return this.newInstance().fetchNsUsersByUseridEntitlementsByAppId(userId, {
|
|
24688
|
+
appId
|
|
24689
|
+
});
|
|
24690
|
+
};
|
|
24691
|
+
/**
|
|
24692
|
+
* Query user entitlements for a specific user.
|
|
24693
|
+
* Returns: entitlement list
|
|
24694
|
+
*/
|
|
24695
|
+
this.getEntitlements = ({ userId, queryParams }) => {
|
|
24696
|
+
return this.newInstance().fetchNsUsersByUseridEntitlements(userId, queryParams);
|
|
24697
|
+
};
|
|
24698
|
+
/**
|
|
24699
|
+
* Exists any user active entitlement of specified itemIds, skus and appIds
|
|
24700
|
+
*/
|
|
24701
|
+
this.getEntitlementOwnerShip = ({ userId, queryParams }) => {
|
|
24702
|
+
return this.newInstance().fetchNsUsersByUseridEntitlementsOwnershipAny(userId, queryParams);
|
|
24703
|
+
};
|
|
24704
|
+
/**
|
|
24705
|
+
* Get user entitlement ownership by itemIds.
|
|
24706
|
+
*/
|
|
24707
|
+
this.getEntitlementByItemIds = ({ userId, queryParams }) => {
|
|
24708
|
+
return this.newInstance().fetchNsUsersByUseridEntitlementsOwnershipByItemIds(userId, queryParams);
|
|
24709
|
+
};
|
|
24710
|
+
/**
|
|
24711
|
+
* Consume user entitlement. If the entitlement useCount is 0, the status will be CONSUMED. Client should pass item id in options if entitlement clazz is OPTIONBOX
|
|
24712
|
+
* Returns: consumed entitlement
|
|
24713
|
+
*/
|
|
24714
|
+
this.claimEntitlement = ({ userId, entitlementId, data }) => {
|
|
24715
|
+
return this.newInstance().putNsUsersByUseridEntitlementsByEntitlementidDecrement(userId, entitlementId, data);
|
|
24716
|
+
};
|
|
24464
24717
|
}
|
|
24465
24718
|
newInstance() {
|
|
24466
24719
|
return new Entitlement$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -24560,7 +24813,11 @@ class FulfillmentApi {
|
|
|
24560
24813
|
this.namespace = namespace;
|
|
24561
24814
|
this.cache = cache;
|
|
24562
24815
|
/**
|
|
24563
|
-
*
|
|
24816
|
+
* POST [/platform/public/namespaces/{namespace}/users/{userId}/fulfillment/code](api)
|
|
24817
|
+
*
|
|
24818
|
+
* Redeem campaign code
|
|
24819
|
+
*
|
|
24820
|
+
* Returns: fulfillment result
|
|
24564
24821
|
*/
|
|
24565
24822
|
this.redeemCode = ({ userId, data }) => {
|
|
24566
24823
|
return this.newInstance().postNsUsersByUseridFulfillmentCode(userId, data);
|
|
@@ -25113,64 +25370,90 @@ class ItemApi {
|
|
|
25113
25370
|
this.conf = conf;
|
|
25114
25371
|
this.namespace = namespace;
|
|
25115
25372
|
this.cache = cache;
|
|
25116
|
-
|
|
25117
|
-
|
|
25118
|
-
|
|
25119
|
-
|
|
25120
|
-
|
|
25121
|
-
|
|
25122
|
-
|
|
25123
|
-
|
|
25124
|
-
|
|
25125
|
-
|
|
25126
|
-
|
|
25127
|
-
|
|
25128
|
-
|
|
25129
|
-
|
|
25130
|
-
|
|
25131
|
-
|
|
25132
|
-
|
|
25133
|
-
|
|
25134
|
-
|
|
25135
|
-
|
|
25136
|
-
|
|
25137
|
-
|
|
25138
|
-
|
|
25139
|
-
|
|
25140
|
-
|
|
25141
|
-
|
|
25142
|
-
|
|
25143
|
-
|
|
25144
|
-
|
|
25145
|
-
|
|
25146
|
-
|
|
25147
|
-
|
|
25148
|
-
|
|
25149
|
-
|
|
25150
|
-
|
|
25151
|
-
|
|
25152
|
-
|
|
25153
|
-
|
|
25154
|
-
|
|
25155
|
-
|
|
25156
|
-
|
|
25157
|
-
|
|
25158
|
-
|
|
25159
|
-
|
|
25160
|
-
|
|
25161
|
-
|
|
25162
|
-
|
|
25163
|
-
|
|
25164
|
-
|
|
25165
|
-
|
|
25166
|
-
|
|
25167
|
-
|
|
25168
|
-
|
|
25169
|
-
|
|
25170
|
-
|
|
25171
|
-
|
|
25172
|
-
|
|
25173
|
-
|
|
25373
|
+
/**
|
|
25374
|
+
* GET [/platform/public/namespaces/{namespace}/items/byAppId](api)
|
|
25375
|
+
*
|
|
25376
|
+
* This API is used to get item by appId
|
|
25377
|
+
*
|
|
25378
|
+
* Returns: the item with that appId
|
|
25379
|
+
*/
|
|
25380
|
+
this.getItemByAppId = ({ ...queryParams }) => {
|
|
25381
|
+
return this.newInstance().fetchNsItemsByAppId(queryParams);
|
|
25382
|
+
};
|
|
25383
|
+
/**
|
|
25384
|
+
* GET [/platform/public/namespaces/{namespace}/items/{itemId}/dynamic](api)
|
|
25385
|
+
*
|
|
25386
|
+
* Get item dynamic data for a published item
|
|
25387
|
+
*
|
|
25388
|
+
* Returns: item dynamic data
|
|
25389
|
+
*/
|
|
25390
|
+
this.getItemByItemIdDynamic = (itemId) => {
|
|
25391
|
+
return this.newInstance().fetchNsItemsByItemidDynamic(itemId);
|
|
25392
|
+
};
|
|
25393
|
+
/**
|
|
25394
|
+
* GET [/platform/public/namespaces/{namespace}/items/byCriteria](api)
|
|
25395
|
+
*/
|
|
25396
|
+
this.fetchItemsByCriteria = ({ queryParams }) => {
|
|
25397
|
+
return this.newInstance().fetchNsItemsByCriteria(queryParams);
|
|
25398
|
+
};
|
|
25399
|
+
/**
|
|
25400
|
+
* GET [/platform/public/namespaces/{namespace}/items/locale/byIds](api)
|
|
25401
|
+
*
|
|
25402
|
+
* This API is used to query items by criteria within a store. If item not exist in specific region, default region item will return.
|
|
25403
|
+
*
|
|
25404
|
+
* Returns: the list of items
|
|
25405
|
+
*/
|
|
25406
|
+
this.getItemsByItemIds = ({ queryParams }) => {
|
|
25407
|
+
return this.newInstance().fetchNsItemsLocaleByIds(queryParams);
|
|
25408
|
+
};
|
|
25409
|
+
// TODO if not used, delete below
|
|
25410
|
+
// /**
|
|
25411
|
+
// * Fetch the items and convert it into a map of `itemId` and its item info
|
|
25412
|
+
// */
|
|
25413
|
+
// fetchAvailableItemInfoMap = async ({ queryParams }: { queryParams: QueryParamsItemIds }) => {
|
|
25414
|
+
// const result = await this.getItemsByItemIds({ queryParams })
|
|
25415
|
+
// if (result.response) {
|
|
25416
|
+
// return {
|
|
25417
|
+
// error: null,
|
|
25418
|
+
// value: result.response.data.reduce((map: Map<string, ItemInfo>, availableItemInfo) => {
|
|
25419
|
+
// const { itemId } = availableItemInfo
|
|
25420
|
+
// if (itemId) {
|
|
25421
|
+
// map.set(itemId, availableItemInfo)
|
|
25422
|
+
// }
|
|
25423
|
+
// return map
|
|
25424
|
+
// }, new Map())
|
|
25425
|
+
// }
|
|
25426
|
+
// }
|
|
25427
|
+
// return result
|
|
25428
|
+
// }
|
|
25429
|
+
/**
|
|
25430
|
+
* GET [/platform/public/namespaces/{namespace}/items/{itemId}/locale](api)
|
|
25431
|
+
*
|
|
25432
|
+
* This API is used to get an item in locale. If item not exist in specific region, default region item will return.
|
|
25433
|
+
*
|
|
25434
|
+
* Returns: item data
|
|
25435
|
+
*/
|
|
25436
|
+
this.getItemsByItemIdLocale = ({ itemId, queryParams }) => {
|
|
25437
|
+
return this.newInstance().fetchNsItemsByItemidLocale(itemId, queryParams);
|
|
25438
|
+
};
|
|
25439
|
+
/**
|
|
25440
|
+
* GET [/platform/public/namespaces/{namespace}/items/{itemId}/app/locale](api)
|
|
25441
|
+
*
|
|
25442
|
+
* This API is used to get an app in locale. If app not exist in specific region, default region app will return.
|
|
25443
|
+
*
|
|
25444
|
+
* Returns: app data
|
|
25445
|
+
*/
|
|
25446
|
+
this.getAppInfoByItemId = ({ itemId, queryParams }) => {
|
|
25447
|
+
return this.newInstance().fetchNsItemsByItemidAppLocale(itemId, queryParams);
|
|
25448
|
+
};
|
|
25449
|
+
/**
|
|
25450
|
+
* POST [/platform/public/namespaces/{namespace}/items/purchase/conditions/validate](api)
|
|
25451
|
+
*
|
|
25452
|
+
* This API is used to validate user item purchase condition
|
|
25453
|
+
*/
|
|
25454
|
+
this.validatePurchaseCondition = (data) => {
|
|
25455
|
+
return this.newInstance().postNsItemsPurchaseConditionsValidate(data);
|
|
25456
|
+
};
|
|
25174
25457
|
}
|
|
25175
25458
|
newInstance() {
|
|
25176
25459
|
return new Item$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -25411,31 +25694,102 @@ class OrderApi {
|
|
|
25411
25694
|
this.namespace = namespace;
|
|
25412
25695
|
this.cache = cache;
|
|
25413
25696
|
/**
|
|
25414
|
-
*
|
|
25697
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/orders](api)
|
|
25698
|
+
*
|
|
25699
|
+
* Query user orders
|
|
25700
|
+
*
|
|
25701
|
+
* Returns a paginated list of `OrderInfo`:
|
|
25702
|
+
* <pre lang="json">{
|
|
25703
|
+
orderNo,
|
|
25704
|
+
paymentOrderNo,
|
|
25705
|
+
namespace,
|
|
25706
|
+
userId,
|
|
25707
|
+
itemId,
|
|
25708
|
+
sandbox,
|
|
25709
|
+
quantity,
|
|
25710
|
+
price,
|
|
25711
|
+
discountedPrice,
|
|
25712
|
+
creationOptions
|
|
25713
|
+
paymentProvider: ('WALLET', 'XSOLLA', 'ADYEN', 'STRIPE', 'CHECKOUT', 'ALIPAY', 'WXPAY', 'PAYPAL'),
|
|
25714
|
+
paymentMethod,
|
|
25715
|
+
tax,
|
|
25716
|
+
vat,
|
|
25717
|
+
salesTax,
|
|
25718
|
+
paymentProviderFee,
|
|
25719
|
+
paymentMethodFee
|
|
25720
|
+
currency: CurrencySummary,
|
|
25721
|
+
paymentStationUrl,
|
|
25722
|
+
itemSnapshot,
|
|
25723
|
+
region,
|
|
25724
|
+
language,
|
|
25725
|
+
status: (
|
|
25726
|
+
'INIT',
|
|
25727
|
+
'CHARGED',
|
|
25728
|
+
'CHARGEBACK',
|
|
25729
|
+
'CHARGEBACK_REVERSED',
|
|
25730
|
+
'FULFILLED',
|
|
25731
|
+
'FULFILL_FAILED',
|
|
25732
|
+
'REFUNDING',
|
|
25733
|
+
'REFUNDED',
|
|
25734
|
+
'REFUND_FAILED',
|
|
25735
|
+
'CLOSED',
|
|
25736
|
+
'DELETED'
|
|
25737
|
+
),
|
|
25738
|
+
statusReason,
|
|
25739
|
+
createdTime,
|
|
25740
|
+
chargedTime,
|
|
25741
|
+
fulfilledTime,
|
|
25742
|
+
refundedTime,
|
|
25743
|
+
chargebackTime,
|
|
25744
|
+
chargebackReversedTime,
|
|
25745
|
+
expireTime,
|
|
25746
|
+
paymentRemainSeconds,
|
|
25747
|
+
ext,
|
|
25748
|
+
totalTax,
|
|
25749
|
+
totalPrice,
|
|
25750
|
+
subtotalPrice,
|
|
25751
|
+
createdAt,
|
|
25752
|
+
updatedAt
|
|
25753
|
+
}</pre>
|
|
25415
25754
|
*/
|
|
25416
25755
|
this.getOrderList = ({ userId, queryParams }) => {
|
|
25417
25756
|
return this.newInstance().fetchNsUsersByUseridOrders(userId, queryParams);
|
|
25418
25757
|
};
|
|
25419
25758
|
/**
|
|
25420
|
-
*
|
|
25759
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/orders/{orderNo}](api)
|
|
25760
|
+
*
|
|
25761
|
+
* Get user order.
|
|
25762
|
+
*
|
|
25763
|
+
* Returns: `OrderInfo`
|
|
25421
25764
|
*/
|
|
25422
25765
|
this.getOrderByOrderNo = ({ userId, orderNo }) => {
|
|
25423
25766
|
return this.newInstance().fetchNsUsersByUseridOrdersByOrderno(userId, orderNo);
|
|
25424
25767
|
};
|
|
25425
25768
|
/**
|
|
25426
|
-
*
|
|
25769
|
+
* PUT [/platform/public/namespaces/{namespace}/users/{userId}/orders/{orderNo}/cancel](api)
|
|
25770
|
+
*
|
|
25771
|
+
* Cancel user order.
|
|
25772
|
+
*
|
|
25773
|
+
* Returns: cancelled `OrderInfo`
|
|
25427
25774
|
*/
|
|
25428
25775
|
this.cancelOrder = ({ userId, orderNo }) => {
|
|
25429
25776
|
return this.newInstance().putNsUsersByUseridOrdersByOrdernoCancel(userId, orderNo);
|
|
25430
25777
|
};
|
|
25431
25778
|
/**
|
|
25432
|
-
*
|
|
25779
|
+
* POST [/platform/public/namespaces/{namespace}/users/{userId}/orders](api)
|
|
25780
|
+
*
|
|
25781
|
+
* Create an order. The result contains the checkout link and payment token.
|
|
25782
|
+
* User with permission SANDBOX will create sandbox order that not real paid for xsolla/alipay and not validate price for wxpay.
|
|
25783
|
+
*
|
|
25784
|
+
* Returns: created `OrderInfo`
|
|
25433
25785
|
*/
|
|
25434
25786
|
this.createOrder = ({ userId, data }) => {
|
|
25435
25787
|
return this.newInstance().postNsUsersByUseridOrders(userId, data);
|
|
25436
25788
|
};
|
|
25437
25789
|
/**
|
|
25438
25790
|
* Fetch all information needed for a user to check the user's availability to purchase the item
|
|
25791
|
+
*
|
|
25792
|
+
* @internal
|
|
25439
25793
|
*/
|
|
25440
25794
|
this.fetchPrePurchaseInformation = async ({ userId, item }) => {
|
|
25441
25795
|
const currencyApi = new CurrencyApi(this.conf, this.namespace, this.cache);
|
|
@@ -25764,31 +26118,49 @@ class PaymentApi {
|
|
|
25764
26118
|
this.namespace = namespace;
|
|
25765
26119
|
this.cache = cache;
|
|
25766
26120
|
/**
|
|
25767
|
-
*
|
|
26121
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/payment/accounts](api)
|
|
26122
|
+
*
|
|
26123
|
+
* Get payment accounts.
|
|
26124
|
+
*
|
|
26125
|
+
* Returns: Payment account list `PaymentAccountArray`
|
|
25768
26126
|
*/
|
|
25769
26127
|
this.getPaymentAccounts = (userId) => {
|
|
25770
26128
|
return this.newInstance().fetchNsUsersByUseridPaymentAccounts(userId);
|
|
25771
26129
|
};
|
|
25772
26130
|
/**
|
|
25773
|
-
*
|
|
26131
|
+
* DELETE [/platform/public/namespaces/{namespace}/users/{userId}/payment/accounts/{type}/{id}](api)
|
|
26132
|
+
*
|
|
26133
|
+
* Delete payment account.
|
|
25774
26134
|
*/
|
|
25775
26135
|
this.deletePaymentAccount = ({ userId, type, id }) => {
|
|
25776
26136
|
return this.newInstance().deleteNsUsersByUseridPaymentAccountsByTypeById(userId, type, id);
|
|
25777
26137
|
};
|
|
25778
26138
|
/**
|
|
25779
|
-
*
|
|
26139
|
+
* GET [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/info](api)
|
|
26140
|
+
*
|
|
26141
|
+
* Get payment order info.
|
|
26142
|
+
*
|
|
26143
|
+
* Returns: Payment order details `PaymentOrderDetails`
|
|
25780
26144
|
*/
|
|
25781
26145
|
this.getPaymentInfo = (paymentOrderNo) => {
|
|
25782
26146
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentOrdersByPaymentordernoInfo(paymentOrderNo);
|
|
25783
26147
|
};
|
|
25784
26148
|
/**
|
|
25785
|
-
*
|
|
26149
|
+
* POST [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/pay](api)
|
|
26150
|
+
*
|
|
26151
|
+
* Do payment(For now, this only support checkout.com).
|
|
26152
|
+
*
|
|
26153
|
+
* Returns: Payment process result
|
|
25786
26154
|
*/
|
|
25787
26155
|
this.processPaymentOrder = (paymentOrderNo, data, queryParams) => {
|
|
25788
26156
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).postNsPaymentOrdersByPaymentordernoPay(paymentOrderNo, data, queryParams);
|
|
25789
26157
|
};
|
|
25790
26158
|
/**
|
|
25791
|
-
*
|
|
26159
|
+
* GET [/platform/public/namespaces/{namespace}/payment/publicconfig](api)
|
|
26160
|
+
*
|
|
26161
|
+
* Get payment provider public config, at current only Strip provide public config.
|
|
26162
|
+
*
|
|
26163
|
+
* Returns: Public config
|
|
25792
26164
|
*/
|
|
25793
26165
|
this.getPaymentProviderPublicConfig = (paymentProvider, region, sandbox) => {
|
|
25794
26166
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentPublicconfig({
|
|
@@ -25798,19 +26170,28 @@ class PaymentApi {
|
|
|
25798
26170
|
});
|
|
25799
26171
|
};
|
|
25800
26172
|
/**
|
|
25801
|
-
*
|
|
26173
|
+
* GET [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/status](api)
|
|
26174
|
+
*
|
|
26175
|
+
* Check payment order paid status.
|
|
26176
|
+
*
|
|
26177
|
+
* Returns: Payment order paid result
|
|
25802
26178
|
*/
|
|
25803
26179
|
this.getPaymentOrderStatus = (paymentOrderNo) => {
|
|
25804
26180
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentOrdersByPaymentordernoStatus(paymentOrderNo);
|
|
25805
26181
|
};
|
|
25806
26182
|
/**
|
|
25807
|
-
* Get payment methods
|
|
26183
|
+
* Get payment methods.
|
|
26184
|
+
* Returns: Payment method list
|
|
25808
26185
|
*/
|
|
25809
26186
|
this.getPaymentMethods = (paymentOrderNo) => {
|
|
25810
26187
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentMethods({ paymentOrderNo });
|
|
25811
26188
|
};
|
|
25812
26189
|
/**
|
|
25813
|
-
*
|
|
26190
|
+
* GET [/platform/public/namespaces/{namespace}/payment/methods](api)
|
|
26191
|
+
*
|
|
26192
|
+
* Check and get a payment order's should pay tax.
|
|
26193
|
+
*
|
|
26194
|
+
* Returns: tax result
|
|
25814
26195
|
*/
|
|
25815
26196
|
this.getPaymentTax = (paymentProvider, paymentOrderNo, zipCode) => {
|
|
25816
26197
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentTax({
|
|
@@ -25820,7 +26201,11 @@ class PaymentApi {
|
|
|
25820
26201
|
});
|
|
25821
26202
|
};
|
|
25822
26203
|
/**
|
|
25823
|
-
*
|
|
26204
|
+
* POST [/platform/public/namespaces/{namespace}/payment/link](api)
|
|
26205
|
+
*
|
|
26206
|
+
* Get payment url.
|
|
26207
|
+
*
|
|
26208
|
+
* Returns: Get payment link
|
|
25824
26209
|
*/
|
|
25825
26210
|
this.createPaymentUrl = (data) => {
|
|
25826
26211
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).postNsPaymentLink(data);
|
|
@@ -26076,42 +26461,73 @@ class SubscriptionApi {
|
|
|
26076
26461
|
this.conf = conf;
|
|
26077
26462
|
this.namespace = namespace;
|
|
26078
26463
|
this.cache = cache;
|
|
26079
|
-
|
|
26080
|
-
|
|
26081
|
-
|
|
26082
|
-
|
|
26083
|
-
|
|
26084
|
-
|
|
26085
|
-
|
|
26086
|
-
|
|
26087
|
-
|
|
26088
|
-
|
|
26089
|
-
|
|
26090
|
-
|
|
26091
|
-
|
|
26092
|
-
|
|
26093
|
-
|
|
26094
|
-
|
|
26095
|
-
|
|
26096
|
-
|
|
26097
|
-
|
|
26098
|
-
|
|
26099
|
-
|
|
26100
|
-
|
|
26101
|
-
|
|
26102
|
-
|
|
26103
|
-
|
|
26104
|
-
|
|
26105
|
-
|
|
26106
|
-
|
|
26107
|
-
|
|
26108
|
-
|
|
26109
|
-
|
|
26110
|
-
|
|
26111
|
-
|
|
26112
|
-
|
|
26113
|
-
|
|
26114
|
-
|
|
26464
|
+
/**
|
|
26465
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions](api)
|
|
26466
|
+
*
|
|
26467
|
+
* Query user subscriptions.
|
|
26468
|
+
*
|
|
26469
|
+
* Returns: paginated subscription
|
|
26470
|
+
*/
|
|
26471
|
+
this.getUserSubscriptions = ({ userId, queryParams }) => {
|
|
26472
|
+
return this.newInstance().fetchNsUsersByUseridSubscriptions(userId, queryParams);
|
|
26473
|
+
};
|
|
26474
|
+
/**
|
|
26475
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}](api)
|
|
26476
|
+
*
|
|
26477
|
+
* Get user subscription.
|
|
26478
|
+
*
|
|
26479
|
+
* Returns: subscription
|
|
26480
|
+
*/
|
|
26481
|
+
this.getUserSubscriptionBySubscriptionId = ({ userId, subscriptionId }) => {
|
|
26482
|
+
return this.newInstance().fetchNsUsersByUseridSubscriptionsBySubscriptionid(userId, subscriptionId);
|
|
26483
|
+
};
|
|
26484
|
+
/**
|
|
26485
|
+
* POST [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions](api)
|
|
26486
|
+
*
|
|
26487
|
+
* Subscribe a subscription. Support both real and virtual payment. Need go through payment flow using the paymentOrderNo if paymentFlowRequired true.
|
|
26488
|
+
* __ACTIVE USER subscription can't do subscribe again.__
|
|
26489
|
+
* __The next billing date will be X(default 4) hours before the current period ends if correctly subscribed.__
|
|
26490
|
+
* User with permission SANDBOX will create sandbox subscription that not real paid.
|
|
26491
|
+
*
|
|
26492
|
+
* Returns: created subscription
|
|
26493
|
+
*/
|
|
26494
|
+
this.createSubscription = ({ userId, data }) => {
|
|
26495
|
+
return this.newInstance().postNsUsersByUseridSubscriptions(userId, data);
|
|
26496
|
+
};
|
|
26497
|
+
/**
|
|
26498
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}/history](api)
|
|
26499
|
+
*
|
|
26500
|
+
* Get user subscription billing histories.
|
|
26501
|
+
*
|
|
26502
|
+
* Returns: paginated subscription history
|
|
26503
|
+
*/
|
|
26504
|
+
this.getUserSubscriptionBillingHistory = ({ userId, subscriptionId, queryParams }) => {
|
|
26505
|
+
return this.newInstance().fetchNsUsersByUseridSubscriptionsBySubscriptionidHistory(userId, subscriptionId, queryParams);
|
|
26506
|
+
};
|
|
26507
|
+
/**
|
|
26508
|
+
* PUT [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}/billingAccount](api)
|
|
26509
|
+
*
|
|
26510
|
+
* Request to change a subscription billing account, this will guide user to payment station.
|
|
26511
|
+
* The actual change will happen at the 0 payment notification successfully handled.
|
|
26512
|
+
* Only ACTIVE USER subscription with real currency billing account can be changed.
|
|
26513
|
+
*
|
|
26514
|
+
* Returns: updated subscription
|
|
26515
|
+
*/
|
|
26516
|
+
this.updateUserSubscriptionPaymentMethod = ({ userId, subscriptionId }) => {
|
|
26517
|
+
return this.newInstance().putNsUsersByUseridSubscriptionsBySubscriptionidBillingAccount(userId, subscriptionId);
|
|
26518
|
+
};
|
|
26519
|
+
/**
|
|
26520
|
+
* PUT [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}/cancel](api)
|
|
26521
|
+
*
|
|
26522
|
+
* Cancel a subscription, only ACTIVE subscription can be cancelled.
|
|
26523
|
+
* __Ensure successfully cancel, recommend at least 1 day before current period ends, otherwise it may be charging or charged.__
|
|
26524
|
+
* Set immediate true, the subscription will be terminated immediately, otherwise till the end of current billing cycle.
|
|
26525
|
+
*
|
|
26526
|
+
* Returns: cancelled subscription
|
|
26527
|
+
*/
|
|
26528
|
+
this.cancelUserSubscription = ({ userId, subscriptionId, data }) => {
|
|
26529
|
+
return this.newInstance().putNsUsersByUseridSubscriptionsBySubscriptionidCancel(userId, subscriptionId, data);
|
|
26530
|
+
};
|
|
26115
26531
|
}
|
|
26116
26532
|
newInstance() {
|
|
26117
26533
|
return new Subscription$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -26278,19 +26694,32 @@ class WalletApi {
|
|
|
26278
26694
|
this.namespace = namespace;
|
|
26279
26695
|
this.cache = cache;
|
|
26280
26696
|
/**
|
|
26281
|
-
*
|
|
26697
|
+
* GET [/platform/public/namespaces/{namespace}/users/me/wallets/{currencyCode}](api)
|
|
26698
|
+
*
|
|
26699
|
+
* get my wallet by currency code and namespace.
|
|
26700
|
+
*
|
|
26701
|
+
* Returns: wallet info
|
|
26702
|
+
*
|
|
26703
|
+
* Path's namespace:
|
|
26704
|
+
* - can be filled with __publisher namespace__ in order to get __publisher user wallet__
|
|
26705
|
+
* - can be filled with __game namespace__ in order to get __game user wallet__
|
|
26282
26706
|
*/
|
|
26283
26707
|
this.getUserMeWallet = (currencyCode) => {
|
|
26284
26708
|
return this.newInstance().fetchNsUsersMeWalletsByCurrencycode(currencyCode);
|
|
26285
26709
|
};
|
|
26286
26710
|
/**
|
|
26287
|
-
*
|
|
26711
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/wallets/{currencyCode}](api)
|
|
26712
|
+
*
|
|
26713
|
+
* Get a wallet by currency code.
|
|
26714
|
+
*
|
|
26715
|
+
* Returns: wallet info
|
|
26288
26716
|
*/
|
|
26289
26717
|
this.getWalletByUserId = (userId, currencyCode) => {
|
|
26290
26718
|
return this.newInstance().fetchNsUsersByUseridWalletsByCurrencycode(userId, currencyCode);
|
|
26291
26719
|
};
|
|
26292
26720
|
/**
|
|
26293
26721
|
* get a map of wallet represented by its currency code
|
|
26722
|
+
* @internal
|
|
26294
26723
|
*/
|
|
26295
26724
|
this.getWalletMap = async ({ userId, currencyCodes }) => {
|
|
26296
26725
|
try {
|
|
@@ -26320,7 +26749,7 @@ class WalletApi {
|
|
|
26320
26749
|
class ApiFactory {
|
|
26321
26750
|
static userAuthorization(config, options, refreshToken, namespace, overrides) {
|
|
26322
26751
|
const conf = ApiFactory.mergedConfigs(config, overrides);
|
|
26323
|
-
return new
|
|
26752
|
+
return new UserAuthorizationApi(conf, namespace, false, {
|
|
26324
26753
|
clientId: options.clientId,
|
|
26325
26754
|
redirectURI: options.redirectURI,
|
|
26326
26755
|
baseURL: options.baseURL,
|
|
@@ -40539,7 +40968,7 @@ exports.UserActiveBanResponse = UserActiveBanResponse;
|
|
|
40539
40968
|
exports.UserActiveBanResponseV3 = UserActiveBanResponseV3;
|
|
40540
40969
|
exports.UserActiveBanResponseV4 = UserActiveBanResponseV4;
|
|
40541
40970
|
exports.UserApi = UserApi;
|
|
40542
|
-
exports.
|
|
40971
|
+
exports.UserAuthorizationApi = UserAuthorizationApi;
|
|
40543
40972
|
exports.UserBan = UserBan;
|
|
40544
40973
|
exports.UserBanRequest = UserBanRequest;
|
|
40545
40974
|
exports.UserBanResponse = UserBanResponse;
|