@accelbyte/sdk 0.2.0-beta.1 → 0.2.0-beta.11
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 +24 -0
- package/README.md +5 -5
- package/dist/index.browser.es.js +1226 -685
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.d.ts +51890 -51681
- package/dist/index.node.es.js +1226 -685
- package/dist/index.node.es.js.map +1 -1
- package/dist/index.node.js +1227 -685
- package/dist/index.node.js.map +1 -1
- package/examples/next/README.md +1 -22
- 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/README.md +13 -0
- 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 };
|
|
@@ -12102,7 +12188,7 @@ const uponRefreshComplete = (error, tokenResponse, onGetUserSession, onSessionEx
|
|
|
12102
12188
|
};
|
|
12103
12189
|
|
|
12104
12190
|
/*
|
|
12105
|
-
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
12191
|
+
* Copyright (c) 2022-2023 AccelByte Inc. All Rights Reserved
|
|
12106
12192
|
* This is licensed software from AccelByte Inc, for limitations
|
|
12107
12193
|
* and restrictions contact your company contract manager.
|
|
12108
12194
|
*/
|
|
@@ -18813,7 +18899,7 @@ var rabbitLegacy = {exports: {}};
|
|
|
18813
18899
|
var cryptoJs = cryptoJs$1.exports;
|
|
18814
18900
|
|
|
18815
18901
|
/*
|
|
18816
|
-
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
18902
|
+
* Copyright (c) 2022-2023 AccelByte Inc. All Rights Reserved
|
|
18817
18903
|
* This is licensed software from AccelByte Inc, for limitations
|
|
18818
18904
|
* and restrictions contact your company contract manager.
|
|
18819
18905
|
*/
|
|
@@ -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();
|
|
@@ -20294,7 +20382,7 @@ class UserAuthorization {
|
|
|
20294
20382
|
const axios = Network.create(config);
|
|
20295
20383
|
const data = {
|
|
20296
20384
|
grant_type: 'authorization_code',
|
|
20297
|
-
code
|
|
20385
|
+
code,
|
|
20298
20386
|
code_verifier: codeVerifier,
|
|
20299
20387
|
client_id: this.options.clientId,
|
|
20300
20388
|
redirect_uri: this.options.redirectURI
|
|
@@ -20309,25 +20397,58 @@ 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)
|
|
20315
20406
|
return;
|
|
20316
|
-
|
|
20317
|
-
const {
|
|
20318
|
-
const result = { mfaToken: mfa_token, factors, defaultFactor: default_factor, email };
|
|
20407
|
+
const { mfa_token: mfaToken, factors, default_factor: defaultFactor, email } = errorResponse.data;
|
|
20408
|
+
const result = { mfaToken, factors, defaultFactor, email };
|
|
20319
20409
|
if (BrowserHelper.isOnBrowser()) {
|
|
20320
20410
|
localStorage.setItem(MFA_DATA_STORAGE_KEY, JSON.stringify(result));
|
|
20321
20411
|
}
|
|
20322
20412
|
return result;
|
|
20323
20413
|
};
|
|
20414
|
+
/**
|
|
20415
|
+
* @internal
|
|
20416
|
+
*/
|
|
20324
20417
|
this.getMfaDataFromStorage = () => {
|
|
20325
20418
|
const storedMFAData = BrowserHelper.isOnBrowser() && localStorage.getItem(MFA_DATA_STORAGE_KEY);
|
|
20326
20419
|
return storedMFAData ? JSON.parse(storedMFAData) : null;
|
|
20327
20420
|
};
|
|
20421
|
+
/**
|
|
20422
|
+
* @internal
|
|
20423
|
+
*/
|
|
20328
20424
|
this.removeMfaDataFromStorage = () => {
|
|
20329
20425
|
localStorage.removeItem(MFA_DATA_STORAGE_KEY);
|
|
20330
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
|
+
*/
|
|
20331
20452
|
this.deduceLoginError = (error) => {
|
|
20332
20453
|
switch (error) {
|
|
20333
20454
|
case LoginErrorParam.Enum.login_session_expired:
|
|
@@ -20369,6 +20490,11 @@ class UserAuthorization {
|
|
|
20369
20490
|
returnPath
|
|
20370
20491
|
};
|
|
20371
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
|
+
*/
|
|
20372
20498
|
this.createLoginURL = (returnPath, targetAuthPage, oneTimeLinkCode) => {
|
|
20373
20499
|
const { verifier, challenge } = CodeChallenge.generateChallenge();
|
|
20374
20500
|
const csrf = CodeChallenge.generateCsrf();
|
|
@@ -20392,6 +20518,11 @@ class UserAuthorization {
|
|
|
20392
20518
|
const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
|
|
20393
20519
|
return url.toString();
|
|
20394
20520
|
};
|
|
20521
|
+
/**
|
|
20522
|
+
* GET [/iam/v3/oauth/authorize](api)
|
|
20523
|
+
*
|
|
20524
|
+
* Creates a URL to be used for password recovery
|
|
20525
|
+
*/
|
|
20395
20526
|
this.createForgotPasswordURL = () => {
|
|
20396
20527
|
const { verifier, challenge } = CodeChallenge.generateChallenge();
|
|
20397
20528
|
const csrf = CodeChallenge.generateCsrf();
|
|
@@ -20410,9 +20541,15 @@ class UserAuthorization {
|
|
|
20410
20541
|
const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
|
|
20411
20542
|
return url.toString();
|
|
20412
20543
|
};
|
|
20544
|
+
/**
|
|
20545
|
+
* @internal
|
|
20546
|
+
*/
|
|
20413
20547
|
this.getCodeChallenge = () => {
|
|
20414
20548
|
return CodeChallenge.generateChallenge();
|
|
20415
20549
|
};
|
|
20550
|
+
/**
|
|
20551
|
+
* @internal
|
|
20552
|
+
*/
|
|
20416
20553
|
this.refreshToken = () => {
|
|
20417
20554
|
const { clientId, refreshToken } = this.options;
|
|
20418
20555
|
if (DesktopChecker.isDesktopApp()) {
|
|
@@ -20420,6 +20557,9 @@ class UserAuthorization {
|
|
|
20420
20557
|
}
|
|
20421
20558
|
return refreshWithLock({ axiosConfig: this.conf, clientId });
|
|
20422
20559
|
};
|
|
20560
|
+
/**
|
|
20561
|
+
* @internal
|
|
20562
|
+
*/
|
|
20423
20563
|
this.getSearchParams = (sentState, challenge) => {
|
|
20424
20564
|
const searchParams = new URLSearchParams();
|
|
20425
20565
|
searchParams.append('response_type', 'code');
|
|
@@ -20431,25 +20571,6 @@ class UserAuthorization {
|
|
|
20431
20571
|
return searchParams;
|
|
20432
20572
|
};
|
|
20433
20573
|
}
|
|
20434
|
-
matchReceivedState(maybeSentState) {
|
|
20435
|
-
const sentStateResult = CodeChallenge.parseSentState(maybeSentState);
|
|
20436
|
-
if (sentStateResult.error)
|
|
20437
|
-
return { error: sentStateResult.error, result: null };
|
|
20438
|
-
const storedStateResult = CodeChallenge.load();
|
|
20439
|
-
if (storedStateResult.error)
|
|
20440
|
-
return { error: storedStateResult.error, result: null };
|
|
20441
|
-
const sentState = sentStateResult.sentState;
|
|
20442
|
-
const storedState = storedStateResult.storedState;
|
|
20443
|
-
if (sentState.csrf !== storedState.csrf)
|
|
20444
|
-
return { error: null, result: null };
|
|
20445
|
-
return {
|
|
20446
|
-
error: null,
|
|
20447
|
-
result: {
|
|
20448
|
-
payload: sentState.payload,
|
|
20449
|
-
codeVerifier: storedState.codeVerifier
|
|
20450
|
-
}
|
|
20451
|
-
};
|
|
20452
|
-
}
|
|
20453
20574
|
}
|
|
20454
20575
|
function isAxiosError(error) {
|
|
20455
20576
|
return !!error && !!error.config;
|
|
@@ -20858,12 +20979,18 @@ class OAuthApi {
|
|
|
20858
20979
|
this.cache = cache;
|
|
20859
20980
|
this.options = options;
|
|
20860
20981
|
/**
|
|
20861
|
-
*
|
|
20862
|
-
|
|
20863
|
-
|
|
20864
|
-
|
|
20865
|
-
|
|
20866
|
-
|
|
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
|
|
20867
20994
|
*/
|
|
20868
20995
|
this.logout = () => {
|
|
20869
20996
|
const axios = Network.create({
|
|
@@ -20875,8 +21002,10 @@ class OAuthApi {
|
|
|
20875
21002
|
return new OAuth20Extension$(axios, this.namespace, this.cache).postIamV3Logout();
|
|
20876
21003
|
};
|
|
20877
21004
|
/**
|
|
20878
|
-
*
|
|
20879
|
-
*
|
|
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
|
|
20880
21009
|
*/
|
|
20881
21010
|
this.revoke = ({ token }) => {
|
|
20882
21011
|
const axios = Network.create({
|
|
@@ -20890,10 +21019,12 @@ class OAuthApi {
|
|
|
20890
21019
|
return new OAuth20$(axios, this.namespace, this.cache).postIamV3OauthRevoke({ token });
|
|
20891
21020
|
};
|
|
20892
21021
|
/**
|
|
20893
|
-
*
|
|
20894
|
-
*
|
|
20895
|
-
*
|
|
20896
|
-
*
|
|
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
|
|
20897
21028
|
*
|
|
20898
21029
|
*/
|
|
20899
21030
|
this.verify2FA = async ({ factor, code, mfaToken = null, rememberDevice }) => {
|
|
@@ -20905,6 +21036,9 @@ class OAuthApi {
|
|
|
20905
21036
|
localStorage.removeItem(MFA_DATA_STORAGE_KEY);
|
|
20906
21037
|
return result.response;
|
|
20907
21038
|
};
|
|
21039
|
+
/**
|
|
21040
|
+
* POST [/iam/v3/oauth/mfa/code](api)
|
|
21041
|
+
*/
|
|
20908
21042
|
this.request2FAEmailCode = async ({ mfaToken = null, factor }) => {
|
|
20909
21043
|
const result = await this.newInstance().postIamV3OauthMfaCode({ mfaToken, clientId: this.options.clientId, factor });
|
|
20910
21044
|
if (result.error)
|
|
@@ -20912,70 +21046,72 @@ class OAuthApi {
|
|
|
20912
21046
|
return result.response;
|
|
20913
21047
|
};
|
|
20914
21048
|
/**
|
|
20915
|
-
*
|
|
21049
|
+
* GET [/iam/v3/location/country](api)
|
|
21050
|
+
*
|
|
21051
|
+
* This method get country location based on the request.
|
|
20916
21052
|
*/
|
|
20917
21053
|
this.getCurrentLocationCountry = () => {
|
|
20918
21054
|
return this.newOAuth20Extension().fetchIamV3LocationCountry();
|
|
20919
21055
|
};
|
|
20920
21056
|
/**
|
|
20921
|
-
*
|
|
20922
|
-
*
|
|
21057
|
+
* GET [/iam/v3/oauth/namespaces/{namespace}/users/{userId}/platforms/{platformId}/platformToken](api)
|
|
21058
|
+
*
|
|
21059
|
+
* Retrieve User Third Party Platform Token
|
|
21060
|
+
*
|
|
20923
21061
|
* This method used for retrieving third party platform token for user that login using third party,
|
|
20924
21062
|
* if user have not link requested platform in game namespace, will try to retrieving third party platform token from publisher namespace.
|
|
20925
21063
|
* Passing platform group name or it's member will return same access token that can be used across the platform members.
|
|
20926
|
-
*
|
|
20927
|
-
*
|
|
20928
|
-
*
|
|
20929
|
-
*
|
|
20930
|
-
*
|
|
20931
|
-
*
|
|
20932
|
-
*
|
|
20933
|
-
*
|
|
20934
|
-
*
|
|
20935
|
-
* </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
|
+
*
|
|
20936
21073
|
*/
|
|
20937
21074
|
this.getThirdPartyPlatformToken = (userId, platformId) => {
|
|
20938
21075
|
return this.newInstance().fetchV3OauthUsersByUseridPlatformsByPlatformidPlatformToken(userId, platformId);
|
|
20939
21076
|
};
|
|
20940
21077
|
/**
|
|
21078
|
+
* POST [/iam/v3/authenticateWithLink](api)
|
|
21079
|
+
*
|
|
20941
21080
|
* This method is being used to authenticate a user account and perform platform link.
|
|
20942
21081
|
* It validates user's email / username and password.
|
|
20943
|
-
* If user already enable 2FA, then invoke
|
|
21082
|
+
* If user already enable 2FA, then invoke _/mfa/verify_ using __mfa_token__ from this method response.
|
|
20944
21083
|
*
|
|
20945
|
-
*
|
|
21084
|
+
* ##Device Cookie Validation
|
|
20946
21085
|
*
|
|
20947
|
-
* Device Cookie is used to protect the user account from brute force login attack,
|
|
20948
|
-
*
|
|
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.
|
|
20949
21089
|
*
|
|
20950
21090
|
*/
|
|
20951
21091
|
this.authenticateWithLink = (data) => {
|
|
20952
21092
|
return this.newOAuth20Extension().postIamV3AuthenticateWithLink(data);
|
|
20953
21093
|
};
|
|
20954
|
-
|
|
20955
|
-
|
|
20956
|
-
|
|
20957
|
-
|
|
20958
|
-
|
|
20959
|
-
|
|
20960
|
-
|
|
20961
|
-
|
|
20962
|
-
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
-
|
|
20972
|
-
|
|
20973
|
-
|
|
20974
|
-
|
|
20975
|
-
*
|
|
20976
|
-
*/
|
|
20977
|
-
exchangeTokenByOneTimeLinkCode(data) {
|
|
20978
|
-
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
|
+
};
|
|
20979
21115
|
}
|
|
20980
21116
|
newInstance() {
|
|
20981
21117
|
return new OAuth20$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -21054,6 +21190,8 @@ class ThirdPartyCredentialApi {
|
|
|
21054
21190
|
this.namespace = namespace;
|
|
21055
21191
|
this.cache = cache;
|
|
21056
21192
|
/**
|
|
21193
|
+
* GET [/iam/v3/public/namespaces/{namespace}/platforms/clients/active](api)
|
|
21194
|
+
*
|
|
21057
21195
|
* This is the Public API to Get All Active 3rd Platform Credential.
|
|
21058
21196
|
*/
|
|
21059
21197
|
this.getThirdPartyPlatformInfo = () => {
|
|
@@ -21555,85 +21693,112 @@ class TwoFA {
|
|
|
21555
21693
|
this.namespace = namespace;
|
|
21556
21694
|
this.cache = cache;
|
|
21557
21695
|
/**
|
|
21558
|
-
*
|
|
21559
|
-
*
|
|
21560
|
-
*
|
|
21696
|
+
* GET [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode](api)
|
|
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.
|
|
21561
21700
|
*
|
|
21701
|
+
* _Requires a valid user access token_
|
|
21562
21702
|
*/
|
|
21563
21703
|
this.getBackupCode = () => {
|
|
21564
21704
|
return this.newInstance().fetchV4NsUsersMeMfaBackupCode();
|
|
21565
21705
|
};
|
|
21566
21706
|
/**
|
|
21567
|
-
*
|
|
21568
|
-
* <p>This method Requires valid user access token</p>
|
|
21707
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode/enable](api)
|
|
21569
21708
|
*
|
|
21709
|
+
* This method is used to enable 2FA backup codes.
|
|
21710
|
+
*
|
|
21711
|
+
* _Requires a valid user access token_
|
|
21570
21712
|
*/
|
|
21571
21713
|
this.enable2FABackupCodes = () => {
|
|
21572
21714
|
return this.newInstance().postV4NsUsersMeMfaBackupCodeEnable();
|
|
21573
21715
|
};
|
|
21574
21716
|
/**
|
|
21575
|
-
*
|
|
21576
|
-
*
|
|
21717
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode](api)
|
|
21718
|
+
*
|
|
21719
|
+
* This method is used to enable 2FA backup codes.
|
|
21577
21720
|
*
|
|
21721
|
+
* _Requires a valid user access token_
|
|
21578
21722
|
*/
|
|
21579
21723
|
this.generateBackupCodes = () => {
|
|
21580
21724
|
return this.newInstance().postV4NsUsersMeMfaBackupCode();
|
|
21581
21725
|
};
|
|
21582
21726
|
/**
|
|
21583
|
-
*
|
|
21584
|
-
* <p>This method Requires valid user access token</p>
|
|
21727
|
+
* DELETE [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode/disable](api)
|
|
21585
21728
|
*
|
|
21729
|
+
* This method is used to enable 2FA backup codes.
|
|
21730
|
+
*
|
|
21731
|
+
* _Requires a valid user access token_
|
|
21586
21732
|
*/
|
|
21587
21733
|
this.disableBackupCodes = () => {
|
|
21588
21734
|
return this.newInstance().deleteV4NsUsersMeMfaBackupCodeDisable();
|
|
21589
21735
|
};
|
|
21590
21736
|
/**
|
|
21591
|
-
*
|
|
21592
|
-
*
|
|
21737
|
+
* DELETE [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/disable](api)
|
|
21738
|
+
* }
|
|
21739
|
+
* This method is used to disable 2FA authenticator.
|
|
21593
21740
|
*
|
|
21741
|
+
* _Requires a valid user access token_
|
|
21594
21742
|
*/
|
|
21595
21743
|
this.disableAuthenticator = () => {
|
|
21596
21744
|
return this.newInstance().deleteV4NsUsersMeMfaAuthenticatorDisable();
|
|
21597
21745
|
};
|
|
21598
21746
|
/**
|
|
21599
|
-
*
|
|
21600
|
-
*
|
|
21747
|
+
* GET [/iam/v4/public/namespaces/{namespace}/users/me/mfa/factor](api)
|
|
21748
|
+
*
|
|
21749
|
+
* This method is used to get user enabled factors.
|
|
21601
21750
|
*
|
|
21751
|
+
* _Requires a valid user access token_
|
|
21602
21752
|
*/
|
|
21603
21753
|
this.getEnabledMethods = () => {
|
|
21604
21754
|
return this.newInstance().fetchV4NsUsersMeMfaFactor();
|
|
21605
21755
|
};
|
|
21606
21756
|
/**
|
|
21607
|
-
*
|
|
21608
|
-
* <p>This method Requires valid user access token</p>
|
|
21757
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/factor](api)
|
|
21609
21758
|
*
|
|
21759
|
+
* This method is used to make 2FA factor default.
|
|
21760
|
+
*
|
|
21761
|
+
* _Requires a valid user access token_
|
|
21610
21762
|
*/
|
|
21611
21763
|
this.set2FAAsDefault = (factor) => {
|
|
21612
21764
|
return this.newInstance().postV4NsUsersMeMfaFactor({ factor });
|
|
21613
21765
|
};
|
|
21614
21766
|
/**
|
|
21615
|
-
*
|
|
21616
|
-
*
|
|
21767
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/enable](api)
|
|
21768
|
+
*
|
|
21769
|
+
* This method is used to enable 2FA authenticator.
|
|
21617
21770
|
*
|
|
21771
|
+
* _Requires a valid user access token_
|
|
21618
21772
|
*/
|
|
21619
21773
|
this.enable2FAAuthenticator = (code) => {
|
|
21620
21774
|
return this.newInstance().postV4NsUsersMeMfaAuthenticatorEnable({ code });
|
|
21621
21775
|
};
|
|
21622
21776
|
/**
|
|
21623
|
-
*
|
|
21624
|
-
*
|
|
21625
|
-
*
|
|
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.
|
|
21626
21781
|
*
|
|
21782
|
+
* _Requires a valid user access token_
|
|
21627
21783
|
*/
|
|
21628
21784
|
this.generateSecretKey = () => {
|
|
21629
21785
|
return this.newInstance().postV4NsUsersMeMfaAuthenticatorKey();
|
|
21630
21786
|
};
|
|
21787
|
+
/**
|
|
21788
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/code](api)
|
|
21789
|
+
*/
|
|
21631
21790
|
this.requestEmailCode = () => {
|
|
21632
21791
|
return this.newInstance().postV4NsUsersMeMfaEmailCode();
|
|
21633
21792
|
};
|
|
21793
|
+
/**
|
|
21794
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/enable](api)
|
|
21795
|
+
*/
|
|
21634
21796
|
this.enableEmailMethod = (code) => {
|
|
21635
21797
|
return this.newInstance().postV4NsUsersMeMfaEmailEnable({ code });
|
|
21636
21798
|
};
|
|
21799
|
+
/**
|
|
21800
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/disable](api)
|
|
21801
|
+
*/
|
|
21637
21802
|
this.disableEmailMethod = () => {
|
|
21638
21803
|
return this.newInstance().postV4NsUsersMeMfaEmailDisable();
|
|
21639
21804
|
};
|
|
@@ -22847,295 +23012,326 @@ class UserApi {
|
|
|
22847
23012
|
this.namespace = namespace;
|
|
22848
23013
|
this.cache = cache;
|
|
22849
23014
|
/**
|
|
22850
|
-
*
|
|
23015
|
+
* GET [/iam/v3/public/users/me](api)
|
|
23016
|
+
*
|
|
23017
|
+
* get currently logged-in user
|
|
22851
23018
|
*/
|
|
22852
23019
|
this.getCurrentUser = () => {
|
|
22853
23020
|
return this.newInstance().fetchIamV3PublicUsersMe();
|
|
22854
23021
|
};
|
|
22855
23022
|
/**
|
|
22856
|
-
*
|
|
23023
|
+
* PATCH [/iam/v3/public/namespaces/{namespace}/users/me](api)
|
|
23024
|
+
*
|
|
23025
|
+
* Update current user
|
|
22857
23026
|
*/
|
|
22858
23027
|
this.updateUserMe = (data) => {
|
|
22859
23028
|
return this.newInstance().patchV3NsUsersMe(data);
|
|
22860
23029
|
};
|
|
22861
23030
|
/**
|
|
23031
|
+
* PUT [/iam/v4/public/namespaces/{namespace}/users/me/email](api)
|
|
23032
|
+
*
|
|
22862
23033
|
* update current user's email
|
|
22863
23034
|
*/
|
|
22864
23035
|
this.updateEmailMe = (data) => {
|
|
22865
23036
|
return this.newInstance4().putV4NsUsersMeEmail(data);
|
|
22866
23037
|
};
|
|
22867
23038
|
/**
|
|
23039
|
+
* PUT [/iam/v3/public/namespaces/{namespace}/users/me/password](api)
|
|
23040
|
+
*
|
|
22868
23041
|
* update current user's password
|
|
22869
23042
|
*/
|
|
22870
23043
|
this.updatePasswordMe = (data) => {
|
|
22871
23044
|
return this.newInstance().putV3NsUsersMePassword(data);
|
|
22872
23045
|
};
|
|
22873
23046
|
/**
|
|
23047
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/code/request](api)
|
|
23048
|
+
*
|
|
22874
23049
|
* Required valid user authorization
|
|
22875
|
-
*
|
|
22876
|
-
*
|
|
22877
|
-
*
|
|
22878
|
-
*
|
|
22879
|
-
*
|
|
22880
|
-
*
|
|
22881
|
-
*
|
|
22882
|
-
*
|
|
22883
|
-
*
|
|
22884
|
-
*
|
|
22885
|
-
*
|
|
22886
|
-
*
|
|
22887
|
-
*
|
|
22888
|
-
*
|
|
22889
|
-
*
|
|
22890
|
-
* </li>
|
|
22891
|
-
* </ol>
|
|
22892
|
-
* <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__
|
|
23056
|
+
*
|
|
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
|
|
22893
23065
|
*
|
|
22894
23066
|
*/
|
|
22895
23067
|
this.requestVerificationCode = (data) => {
|
|
22896
23068
|
return this.newInstance().postV3NsUsersMeCodeRequest(data);
|
|
22897
23069
|
};
|
|
22898
23070
|
/**
|
|
22899
|
-
*
|
|
22900
|
-
*
|
|
22901
|
-
*
|
|
22902
|
-
*
|
|
22903
|
-
*
|
|
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
|
|
22904
23078
|
*
|
|
22905
23079
|
*/
|
|
22906
23080
|
this.verifyCode = (data) => {
|
|
22907
23081
|
return this.newInstance().postV3NsUsersMeCodeVerify(data);
|
|
22908
23082
|
};
|
|
22909
23083
|
/**
|
|
22910
|
-
*
|
|
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
|
|
22911
23087
|
* Require valid user access token.
|
|
22912
|
-
*
|
|
22913
|
-
* By upgrading the headless account into a full account, the user could use the email address and password for using Justice IAM.
|
|
22914
|
-
*
|
|
22915
|
-
* In order to get a verification code for the method, please check the send verification code method
|
|
22916
|
-
*
|
|
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.
|
|
22917
23093
|
* Supported user data fields :
|
|
22918
|
-
*
|
|
22919
|
-
*
|
|
22920
|
-
*
|
|
22921
|
-
*
|
|
22922
|
-
*
|
|
22923
|
-
*
|
|
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
|
|
22924
23100
|
*/
|
|
22925
23101
|
this.upgradeHeadlessAccount = (data) => {
|
|
22926
23102
|
return this.newInstance().postV3NsUsersMeHeadlessCodeVerify(data);
|
|
22927
23103
|
};
|
|
22928
23104
|
/**
|
|
23105
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/headless/code/verify](api)
|
|
23106
|
+
*
|
|
22929
23107
|
* Require valid user access token.
|
|
22930
23108
|
* The method upgrades a headless account by linking the headless account with the email address, username, and password.
|
|
22931
23109
|
* By upgrading the headless account into a full account, the user could use the email address, username, and password for using Justice IAM.
|
|
22932
|
-
*
|
|
23110
|
+
*
|
|
22933
23111
|
* The method is a shortcut for upgrading a headless account and verifying the email address in one call.
|
|
22934
|
-
*
|
|
22935
|
-
* <br>
|
|
23112
|
+
*
|
|
22936
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.
|
|
22937
23114
|
* Supported user data fields:
|
|
22938
|
-
*
|
|
22939
|
-
*
|
|
22940
|
-
*
|
|
22941
|
-
*
|
|
22942
|
-
*
|
|
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
|
+
*
|
|
22943
23120
|
* action code : 10124
|
|
22944
23121
|
*/
|
|
22945
23122
|
this.upgradeHeadlessAccountV4 = (data) => {
|
|
22946
23123
|
return this.newInstance4().postV4NsUsersMeHeadlessCodeVerify(data);
|
|
22947
23124
|
};
|
|
22948
23125
|
/**
|
|
22949
|
-
*
|
|
22950
|
-
*
|
|
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
|
|
22951
23130
|
*/
|
|
22952
23131
|
this.getUserLinkedPlatform = (userId) => {
|
|
22953
23132
|
return this.newInstance().fetchV3NsUsersByUseridPlatforms(userId);
|
|
22954
23133
|
};
|
|
22955
23134
|
/**
|
|
23135
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}](api)
|
|
23136
|
+
*
|
|
22956
23137
|
* Required valid user authorization.
|
|
22957
|
-
*
|
|
23138
|
+
* __Prerequisite:__
|
|
22958
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).
|
|
22959
|
-
*
|
|
22960
|
-
*
|
|
22961
|
-
*
|
|
22962
|
-
*
|
|
22963
|
-
*
|
|
22964
|
-
*
|
|
22965
|
-
*
|
|
22966
|
-
*
|
|
22967
|
-
*
|
|
22968
|
-
*
|
|
22969
|
-
*
|
|
22970
|
-
*
|
|
22971
|
-
*
|
|
22972
|
-
*
|
|
22973
|
-
*
|
|
22974
|
-
*
|
|
22975
|
-
*
|
|
22976
|
-
*
|
|
22977
|
-
*
|
|
22978
|
-
*
|
|
22979
|
-
*
|
|
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
|
|
22980
23161
|
*/
|
|
22981
23162
|
this.linkAccountToPlatform = ({ platformId, data }) => {
|
|
22982
23163
|
return this.newInstance().postV3NsUsersMePlatformsByPlatformid(platformId, data);
|
|
22983
23164
|
};
|
|
22984
23165
|
/**
|
|
23166
|
+
* GET [/iam/v3/public/namespaces/{namespace}/requests/{requestId}/async/status](api)
|
|
23167
|
+
*
|
|
22985
23168
|
* Get the linking status between a third-party platform to a user
|
|
22986
23169
|
*/
|
|
22987
23170
|
this.getLinkRequestStatus = (requestId) => {
|
|
22988
23171
|
return this.newInstance().fetchV3NsRequestsByRequestidAsyncStatus(requestId);
|
|
22989
23172
|
};
|
|
22990
23173
|
/**
|
|
22991
|
-
*
|
|
23174
|
+
* @internal
|
|
23175
|
+
* It is going to be __DEPRECATED__.
|
|
22992
23176
|
* Update Platform Account relation to current User Account.
|
|
22993
23177
|
* Note: Game progression data (statistics, reward, etc) associated with previous User Account will not be
|
|
22994
23178
|
* transferred. If the data is tight to game user ID, the user will have the game progression data.
|
|
22995
|
-
*
|
|
22996
23179
|
*/
|
|
22997
23180
|
this.linkPlatformToUserAccount = ({ userId, data }) => {
|
|
22998
23181
|
return this.newInstance().postV3NsUsersByUseridPlatformsLink(userId, data);
|
|
22999
23182
|
};
|
|
23000
23183
|
/**
|
|
23184
|
+
* DELETE [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}](api)
|
|
23185
|
+
*
|
|
23001
23186
|
* Required valid user authorization.
|
|
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
|
-
*
|
|
23027
|
-
*
|
|
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
|
|
23028
23213
|
*/
|
|
23029
23214
|
this.unLinkAccountFromPlatform = ({ platformId, data }) => {
|
|
23030
23215
|
return this.newInstance().deleteV3NsUsersMePlatformsByPlatformid(platformId, data);
|
|
23031
23216
|
};
|
|
23032
23217
|
/**
|
|
23218
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}/web/link](api)
|
|
23219
|
+
*
|
|
23033
23220
|
* This method is used to generate third party login page which will redirected to establish method.
|
|
23034
23221
|
*/
|
|
23035
23222
|
this.getThirdPartyURL = ({ platformId, queryParams }) => {
|
|
23036
23223
|
return this.newInstance().fetchV3NsUsersMePlatformsByPlatformidWebLink(platformId, queryParams);
|
|
23037
23224
|
};
|
|
23038
23225
|
/**
|
|
23226
|
+
* GET [/iam/v3/public/namespaces/{namespace}/agerestrictions/countries/{countryCode}](api)
|
|
23227
|
+
*
|
|
23039
23228
|
* Get age restriction by country code. It will always get by publisher namespace
|
|
23040
23229
|
*/
|
|
23041
23230
|
this.getAgeRestrictionByCountry = (countryCode) => {
|
|
23042
23231
|
return this.newInstance().fetchV3NsAgerestrictionsCountriesByCountrycode(countryCode);
|
|
23043
23232
|
};
|
|
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
|
-
|
|
23138
|
-
|
|
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
|
+
};
|
|
23139
23335
|
}
|
|
23140
23336
|
/**
|
|
23141
23337
|
* @internal
|
|
@@ -23292,24 +23488,36 @@ class AgreementApi {
|
|
|
23292
23488
|
this.conf = conf;
|
|
23293
23489
|
this.namespace = namespace;
|
|
23294
23490
|
this.cache = cache;
|
|
23295
|
-
|
|
23296
|
-
|
|
23297
|
-
|
|
23298
|
-
|
|
23299
|
-
|
|
23300
|
-
|
|
23301
|
-
|
|
23302
|
-
|
|
23303
|
-
|
|
23304
|
-
|
|
23305
|
-
|
|
23306
|
-
|
|
23307
|
-
|
|
23308
|
-
|
|
23309
|
-
|
|
23310
|
-
|
|
23311
|
-
|
|
23312
|
-
|
|
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
|
+
};
|
|
23313
23521
|
}
|
|
23314
23522
|
newInstance() {
|
|
23315
23523
|
return new Agreement$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23422,12 +23630,16 @@ class EligibilitiesApi {
|
|
|
23422
23630
|
this.conf = conf;
|
|
23423
23631
|
this.namespace = namespace;
|
|
23424
23632
|
this.cache = cache;
|
|
23425
|
-
|
|
23426
|
-
|
|
23427
|
-
|
|
23428
|
-
|
|
23429
|
-
|
|
23430
|
-
|
|
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
|
+
};
|
|
23431
23643
|
}
|
|
23432
23644
|
newInstance() {
|
|
23433
23645
|
return new Eligibilities$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23530,12 +23742,14 @@ class LocalizedPolicyVersionsApi {
|
|
|
23530
23742
|
this.conf = conf;
|
|
23531
23743
|
this.namespace = namespace;
|
|
23532
23744
|
this.cache = cache;
|
|
23533
|
-
|
|
23534
|
-
|
|
23535
|
-
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
|
|
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
|
+
};
|
|
23539
23753
|
}
|
|
23540
23754
|
newInstance() {
|
|
23541
23755
|
return new LocalizedPolicyVersions$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23641,18 +23855,37 @@ class PoliciesApi {
|
|
|
23641
23855
|
this.conf = conf;
|
|
23642
23856
|
this.namespace = namespace;
|
|
23643
23857
|
this.cache = cache;
|
|
23644
|
-
|
|
23645
|
-
|
|
23646
|
-
|
|
23647
|
-
|
|
23648
|
-
|
|
23649
|
-
|
|
23650
|
-
|
|
23651
|
-
|
|
23652
|
-
|
|
23653
|
-
|
|
23654
|
-
|
|
23655
|
-
|
|
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
|
+
};
|
|
23656
23889
|
}
|
|
23657
23890
|
newInstance() {
|
|
23658
23891
|
return new Policies$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23736,12 +23969,21 @@ class PublicTemplateApi {
|
|
|
23736
23969
|
this.conf = conf;
|
|
23737
23970
|
this.namespace = namespace;
|
|
23738
23971
|
this.cache = cache;
|
|
23972
|
+
/**
|
|
23973
|
+
* @internal
|
|
23974
|
+
*/
|
|
23739
23975
|
this.getTemplateConfigs = (template) => {
|
|
23740
23976
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigs(template);
|
|
23741
23977
|
};
|
|
23978
|
+
/**
|
|
23979
|
+
* @internal
|
|
23980
|
+
*/
|
|
23742
23981
|
this.getTemplateConfig = (template, configId) => {
|
|
23743
23982
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigsByConfig(template, configId);
|
|
23744
23983
|
};
|
|
23984
|
+
/**
|
|
23985
|
+
* @internal
|
|
23986
|
+
*/
|
|
23745
23987
|
this.getDiscoveryTemplateConfigs = () => {
|
|
23746
23988
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigs(DISCOVERY_TEMPLATE_NAME);
|
|
23747
23989
|
};
|
|
@@ -23811,13 +24053,19 @@ class CurrencyApi {
|
|
|
23811
24053
|
this.namespace = namespace;
|
|
23812
24054
|
this.cache = cache;
|
|
23813
24055
|
/**
|
|
23814
|
-
*
|
|
24056
|
+
* GET [/platform/public/namespaces/{namespace}/currencies](api)
|
|
24057
|
+
*
|
|
24058
|
+
* List currencies of a namespace.
|
|
24059
|
+
*
|
|
24060
|
+
* Returns: Currency List
|
|
23815
24061
|
*/
|
|
23816
24062
|
this.getCurrencies = () => {
|
|
23817
24063
|
return this.newInstance().fetchNsCurrencies();
|
|
23818
24064
|
};
|
|
23819
24065
|
/**
|
|
23820
24066
|
* Get the currencies list and convert into a map of currency code and the currency itself
|
|
24067
|
+
*
|
|
24068
|
+
* @internal
|
|
23821
24069
|
*/
|
|
23822
24070
|
this.getCurrencyMap = async () => {
|
|
23823
24071
|
const result = await this.getCurrencies();
|
|
@@ -24430,38 +24678,42 @@ class EntitlementApi {
|
|
|
24430
24678
|
this.conf = conf;
|
|
24431
24679
|
this.namespace = namespace;
|
|
24432
24680
|
this.cache = cache;
|
|
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
|
-
|
|
24464
|
-
|
|
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
|
+
};
|
|
24465
24717
|
}
|
|
24466
24718
|
newInstance() {
|
|
24467
24719
|
return new Entitlement$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -24561,7 +24813,11 @@ class FulfillmentApi {
|
|
|
24561
24813
|
this.namespace = namespace;
|
|
24562
24814
|
this.cache = cache;
|
|
24563
24815
|
/**
|
|
24564
|
-
*
|
|
24816
|
+
* POST [/platform/public/namespaces/{namespace}/users/{userId}/fulfillment/code](api)
|
|
24817
|
+
*
|
|
24818
|
+
* Redeem campaign code
|
|
24819
|
+
*
|
|
24820
|
+
* Returns: fulfillment result
|
|
24565
24821
|
*/
|
|
24566
24822
|
this.redeemCode = ({ userId, data }) => {
|
|
24567
24823
|
return this.newInstance().postNsUsersByUseridFulfillmentCode(userId, data);
|
|
@@ -25114,64 +25370,90 @@ class ItemApi {
|
|
|
25114
25370
|
this.conf = conf;
|
|
25115
25371
|
this.namespace = namespace;
|
|
25116
25372
|
this.cache = cache;
|
|
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
|
-
|
|
25174
|
-
|
|
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
|
+
};
|
|
25175
25457
|
}
|
|
25176
25458
|
newInstance() {
|
|
25177
25459
|
return new Item$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -25412,31 +25694,102 @@ class OrderApi {
|
|
|
25412
25694
|
this.namespace = namespace;
|
|
25413
25695
|
this.cache = cache;
|
|
25414
25696
|
/**
|
|
25415
|
-
*
|
|
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>
|
|
25416
25754
|
*/
|
|
25417
25755
|
this.getOrderList = ({ userId, queryParams }) => {
|
|
25418
25756
|
return this.newInstance().fetchNsUsersByUseridOrders(userId, queryParams);
|
|
25419
25757
|
};
|
|
25420
25758
|
/**
|
|
25421
|
-
*
|
|
25759
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/orders/{orderNo}](api)
|
|
25760
|
+
*
|
|
25761
|
+
* Get user order.
|
|
25762
|
+
*
|
|
25763
|
+
* Returns: `OrderInfo`
|
|
25422
25764
|
*/
|
|
25423
25765
|
this.getOrderByOrderNo = ({ userId, orderNo }) => {
|
|
25424
25766
|
return this.newInstance().fetchNsUsersByUseridOrdersByOrderno(userId, orderNo);
|
|
25425
25767
|
};
|
|
25426
25768
|
/**
|
|
25427
|
-
*
|
|
25769
|
+
* PUT [/platform/public/namespaces/{namespace}/users/{userId}/orders/{orderNo}/cancel](api)
|
|
25770
|
+
*
|
|
25771
|
+
* Cancel user order.
|
|
25772
|
+
*
|
|
25773
|
+
* Returns: cancelled `OrderInfo`
|
|
25428
25774
|
*/
|
|
25429
25775
|
this.cancelOrder = ({ userId, orderNo }) => {
|
|
25430
25776
|
return this.newInstance().putNsUsersByUseridOrdersByOrdernoCancel(userId, orderNo);
|
|
25431
25777
|
};
|
|
25432
25778
|
/**
|
|
25433
|
-
*
|
|
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`
|
|
25434
25785
|
*/
|
|
25435
25786
|
this.createOrder = ({ userId, data }) => {
|
|
25436
25787
|
return this.newInstance().postNsUsersByUseridOrders(userId, data);
|
|
25437
25788
|
};
|
|
25438
25789
|
/**
|
|
25439
25790
|
* Fetch all information needed for a user to check the user's availability to purchase the item
|
|
25791
|
+
*
|
|
25792
|
+
* @internal
|
|
25440
25793
|
*/
|
|
25441
25794
|
this.fetchPrePurchaseInformation = async ({ userId, item }) => {
|
|
25442
25795
|
const currencyApi = new CurrencyApi(this.conf, this.namespace, this.cache);
|
|
@@ -25765,31 +26118,49 @@ class PaymentApi {
|
|
|
25765
26118
|
this.namespace = namespace;
|
|
25766
26119
|
this.cache = cache;
|
|
25767
26120
|
/**
|
|
25768
|
-
*
|
|
26121
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/payment/accounts](api)
|
|
26122
|
+
*
|
|
26123
|
+
* Get payment accounts.
|
|
26124
|
+
*
|
|
26125
|
+
* Returns: Payment account list `PaymentAccountArray`
|
|
25769
26126
|
*/
|
|
25770
26127
|
this.getPaymentAccounts = (userId) => {
|
|
25771
26128
|
return this.newInstance().fetchNsUsersByUseridPaymentAccounts(userId);
|
|
25772
26129
|
};
|
|
25773
26130
|
/**
|
|
25774
|
-
*
|
|
26131
|
+
* DELETE [/platform/public/namespaces/{namespace}/users/{userId}/payment/accounts/{type}/{id}](api)
|
|
26132
|
+
*
|
|
26133
|
+
* Delete payment account.
|
|
25775
26134
|
*/
|
|
25776
26135
|
this.deletePaymentAccount = ({ userId, type, id }) => {
|
|
25777
26136
|
return this.newInstance().deleteNsUsersByUseridPaymentAccountsByTypeById(userId, type, id);
|
|
25778
26137
|
};
|
|
25779
26138
|
/**
|
|
25780
|
-
*
|
|
26139
|
+
* GET [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/info](api)
|
|
26140
|
+
*
|
|
26141
|
+
* Get payment order info.
|
|
26142
|
+
*
|
|
26143
|
+
* Returns: Payment order details `PaymentOrderDetails`
|
|
25781
26144
|
*/
|
|
25782
26145
|
this.getPaymentInfo = (paymentOrderNo) => {
|
|
25783
26146
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentOrdersByPaymentordernoInfo(paymentOrderNo);
|
|
25784
26147
|
};
|
|
25785
26148
|
/**
|
|
25786
|
-
*
|
|
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
|
|
25787
26154
|
*/
|
|
25788
26155
|
this.processPaymentOrder = (paymentOrderNo, data, queryParams) => {
|
|
25789
26156
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).postNsPaymentOrdersByPaymentordernoPay(paymentOrderNo, data, queryParams);
|
|
25790
26157
|
};
|
|
25791
26158
|
/**
|
|
25792
|
-
*
|
|
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
|
|
25793
26164
|
*/
|
|
25794
26165
|
this.getPaymentProviderPublicConfig = (paymentProvider, region, sandbox) => {
|
|
25795
26166
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentPublicconfig({
|
|
@@ -25799,19 +26170,28 @@ class PaymentApi {
|
|
|
25799
26170
|
});
|
|
25800
26171
|
};
|
|
25801
26172
|
/**
|
|
25802
|
-
*
|
|
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
|
|
25803
26178
|
*/
|
|
25804
26179
|
this.getPaymentOrderStatus = (paymentOrderNo) => {
|
|
25805
26180
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentOrdersByPaymentordernoStatus(paymentOrderNo);
|
|
25806
26181
|
};
|
|
25807
26182
|
/**
|
|
25808
|
-
* Get payment methods
|
|
26183
|
+
* Get payment methods.
|
|
26184
|
+
* Returns: Payment method list
|
|
25809
26185
|
*/
|
|
25810
26186
|
this.getPaymentMethods = (paymentOrderNo) => {
|
|
25811
26187
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentMethods({ paymentOrderNo });
|
|
25812
26188
|
};
|
|
25813
26189
|
/**
|
|
25814
|
-
*
|
|
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
|
|
25815
26195
|
*/
|
|
25816
26196
|
this.getPaymentTax = (paymentProvider, paymentOrderNo, zipCode) => {
|
|
25817
26197
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentTax({
|
|
@@ -25821,7 +26201,11 @@ class PaymentApi {
|
|
|
25821
26201
|
});
|
|
25822
26202
|
};
|
|
25823
26203
|
/**
|
|
25824
|
-
*
|
|
26204
|
+
* POST [/platform/public/namespaces/{namespace}/payment/link](api)
|
|
26205
|
+
*
|
|
26206
|
+
* Get payment url.
|
|
26207
|
+
*
|
|
26208
|
+
* Returns: Get payment link
|
|
25825
26209
|
*/
|
|
25826
26210
|
this.createPaymentUrl = (data) => {
|
|
25827
26211
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).postNsPaymentLink(data);
|
|
@@ -26077,42 +26461,73 @@ class SubscriptionApi {
|
|
|
26077
26461
|
this.conf = conf;
|
|
26078
26462
|
this.namespace = namespace;
|
|
26079
26463
|
this.cache = cache;
|
|
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
|
-
|
|
26115
|
-
|
|
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
|
+
};
|
|
26116
26531
|
}
|
|
26117
26532
|
newInstance() {
|
|
26118
26533
|
return new Subscription$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -26279,19 +26694,32 @@ class WalletApi {
|
|
|
26279
26694
|
this.namespace = namespace;
|
|
26280
26695
|
this.cache = cache;
|
|
26281
26696
|
/**
|
|
26282
|
-
*
|
|
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__
|
|
26283
26706
|
*/
|
|
26284
26707
|
this.getUserMeWallet = (currencyCode) => {
|
|
26285
26708
|
return this.newInstance().fetchNsUsersMeWalletsByCurrencycode(currencyCode);
|
|
26286
26709
|
};
|
|
26287
26710
|
/**
|
|
26288
|
-
*
|
|
26711
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/wallets/{currencyCode}](api)
|
|
26712
|
+
*
|
|
26713
|
+
* Get a wallet by currency code.
|
|
26714
|
+
*
|
|
26715
|
+
* Returns: wallet info
|
|
26289
26716
|
*/
|
|
26290
26717
|
this.getWalletByUserId = (userId, currencyCode) => {
|
|
26291
26718
|
return this.newInstance().fetchNsUsersByUseridWalletsByCurrencycode(userId, currencyCode);
|
|
26292
26719
|
};
|
|
26293
26720
|
/**
|
|
26294
26721
|
* get a map of wallet represented by its currency code
|
|
26722
|
+
* @internal
|
|
26295
26723
|
*/
|
|
26296
26724
|
this.getWalletMap = async ({ userId, currencyCodes }) => {
|
|
26297
26725
|
try {
|
|
@@ -26321,7 +26749,7 @@ class WalletApi {
|
|
|
26321
26749
|
class ApiFactory {
|
|
26322
26750
|
static userAuthorization(config, options, refreshToken, namespace, overrides) {
|
|
26323
26751
|
const conf = ApiFactory.mergedConfigs(config, overrides);
|
|
26324
|
-
return new
|
|
26752
|
+
return new UserAuthorizationApi(conf, namespace, false, {
|
|
26325
26753
|
clientId: options.clientId,
|
|
26326
26754
|
redirectURI: options.redirectURI,
|
|
26327
26755
|
baseURL: options.baseURL,
|
|
@@ -26482,7 +26910,93 @@ const injectErrorInterceptors = (baseUrl, onUserEligibilityChange, onError) => {
|
|
|
26482
26910
|
var version="x.y.z";var build$1="x.y.z";var timestamp="x.y.z";var buildInfo = {version:version,build:build$1,timestamp:timestamp};
|
|
26483
26911
|
|
|
26484
26912
|
/*
|
|
26485
|
-
* Copyright (c)
|
|
26913
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26914
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26915
|
+
* and restrictions contact your company contract manager.
|
|
26916
|
+
*/
|
|
26917
|
+
var BasicVersion = {
|
|
26918
|
+
title: '-',
|
|
26919
|
+
name: 'justice-basic-service',
|
|
26920
|
+
version: '2.6.0',
|
|
26921
|
+
buildDate: '2023-02-21T23:52:43.996Z'
|
|
26922
|
+
};
|
|
26923
|
+
|
|
26924
|
+
/*
|
|
26925
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26926
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26927
|
+
* and restrictions contact your company contract manager.
|
|
26928
|
+
*/
|
|
26929
|
+
var BuildinfoVersion = {
|
|
26930
|
+
title: '-',
|
|
26931
|
+
name: 'justice-buildinfo-service',
|
|
26932
|
+
version: '3.28.2',
|
|
26933
|
+
buildDate: '2023-02-21T23:52:43.996Z'
|
|
26934
|
+
};
|
|
26935
|
+
|
|
26936
|
+
/*
|
|
26937
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26938
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26939
|
+
* and restrictions contact your company contract manager.
|
|
26940
|
+
*/
|
|
26941
|
+
var EventVersion = {
|
|
26942
|
+
title: '-',
|
|
26943
|
+
name: 'justice-event-log-service',
|
|
26944
|
+
version: undefined,
|
|
26945
|
+
buildDate: '2023-02-21T23:52:43.996Z'
|
|
26946
|
+
};
|
|
26947
|
+
|
|
26948
|
+
/*
|
|
26949
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26950
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26951
|
+
* and restrictions contact your company contract manager.
|
|
26952
|
+
*/
|
|
26953
|
+
var GdprVersion = {
|
|
26954
|
+
title: '-',
|
|
26955
|
+
name: 'justice-gdpr-service',
|
|
26956
|
+
version: '1.19.1',
|
|
26957
|
+
buildDate: '2023-02-21T23:52:43.996Z'
|
|
26958
|
+
};
|
|
26959
|
+
|
|
26960
|
+
/*
|
|
26961
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26962
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26963
|
+
* and restrictions contact your company contract manager.
|
|
26964
|
+
*/
|
|
26965
|
+
var IamVersion = {
|
|
26966
|
+
title: '-',
|
|
26967
|
+
name: 'justice-iam-service',
|
|
26968
|
+
version: '5.28.0',
|
|
26969
|
+
buildDate: '2023-02-21T23:52:43.996Z'
|
|
26970
|
+
};
|
|
26971
|
+
|
|
26972
|
+
/*
|
|
26973
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26974
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26975
|
+
* and restrictions contact your company contract manager.
|
|
26976
|
+
*/
|
|
26977
|
+
var LegalVersion = {
|
|
26978
|
+
title: '-',
|
|
26979
|
+
name: 'justice-legal-service',
|
|
26980
|
+
version: '1.27.0',
|
|
26981
|
+
buildDate: '2023-02-21T23:52:43.996Z'
|
|
26982
|
+
};
|
|
26983
|
+
|
|
26984
|
+
/*
|
|
26985
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26986
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26987
|
+
* and restrictions contact your company contract manager.
|
|
26988
|
+
*/
|
|
26989
|
+
var OdinConfigVersion = { title: '-', name: 'config-service-app', version: 'dev', buildDate: '2023-02-21T23:43:05.354Z' };
|
|
26990
|
+
|
|
26991
|
+
/*
|
|
26992
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26993
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26994
|
+
* and restrictions contact your company contract manager.
|
|
26995
|
+
*/
|
|
26996
|
+
var PlatformVersion = { title: '-', name: 'justice-platform-service', version: '4.24.0', buildDate: '2023-02-21T23:43:05.402Z' };
|
|
26997
|
+
|
|
26998
|
+
/*
|
|
26999
|
+
* Copyright (c) 2022-2023 AccelByte Inc. All Rights Reserved
|
|
26486
27000
|
* This is licensed software from AccelByte Inc, for limitations
|
|
26487
27001
|
* and restrictions contact your company contract manager.
|
|
26488
27002
|
*/
|
|
@@ -26559,18 +27073,21 @@ class AccelbyteSDKFactory {
|
|
|
26559
27073
|
OAuth: (overrides) => ApiFactory.oauthApi(this.config, this.options, this.options.namespace, this.override(overrides)),
|
|
26560
27074
|
InputValidation: (overrides) => ApiFactory.inputValidationApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26561
27075
|
ThirdPartyCredential: (overrides) => ApiFactory.thirdPartyCredentialApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26562
|
-
TwoFA: (overrides) => ApiFactory.twoFA(this.config, this.options.namespace, this.override(overrides))
|
|
27076
|
+
TwoFA: (overrides) => ApiFactory.twoFA(this.config, this.options.namespace, this.override(overrides)),
|
|
27077
|
+
version: IamVersion
|
|
26563
27078
|
},
|
|
26564
27079
|
BuildInfo: {
|
|
26565
27080
|
Downloader: (overrides) => ApiFactory.downloaderApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26566
27081
|
Caching: (overrides) => ApiFactory.cachingApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26567
|
-
DLC: (overrides) => ApiFactory.dlcApi(this.config, this.options.namespace, this.override(overrides))
|
|
27082
|
+
DLC: (overrides) => ApiFactory.dlcApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27083
|
+
version: BuildinfoVersion
|
|
26568
27084
|
},
|
|
26569
27085
|
Basic: {
|
|
26570
27086
|
Misc: (overrides) => ApiFactory.miscApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26571
27087
|
UserProfile: (overrides) => ApiFactory.userProfileApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26572
27088
|
FileUpload: (overrides) => ApiFactory.fileUploadApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26573
|
-
Namespace: (overrides) => ApiFactory.namespaceApi(this.config, this.options.namespace, this.override(overrides))
|
|
27089
|
+
Namespace: (overrides) => ApiFactory.namespaceApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27090
|
+
version: BasicVersion
|
|
26574
27091
|
},
|
|
26575
27092
|
Platform: {
|
|
26576
27093
|
Currency: (overrides) => ApiFactory.currencyApi(this.config, this.options.namespace, this.override(overrides)),
|
|
@@ -26580,23 +27097,47 @@ class AccelbyteSDKFactory {
|
|
|
26580
27097
|
Order: (overrides) => ApiFactory.orderApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26581
27098
|
Payment: (overrides) => ApiFactory.paymentApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26582
27099
|
Subscription: (overrides) => ApiFactory.subscriptionApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26583
|
-
Wallet: (overrides) => ApiFactory.walletApi(this.config, this.options.namespace, this.override(overrides))
|
|
27100
|
+
Wallet: (overrides) => ApiFactory.walletApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27101
|
+
version: PlatformVersion
|
|
26584
27102
|
},
|
|
26585
27103
|
Legal: {
|
|
26586
27104
|
Eligibilities: (overrides) => ApiFactory.eligibillitiesApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26587
27105
|
Agreement: (overrides) => ApiFactory.agreementApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26588
27106
|
Policies: (overrides) => ApiFactory.policiesApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26589
|
-
LocalizedPolicyVersions: (overrides) => ApiFactory.localizedPolicyVersionsApi(this.config, this.options.namespace, this.override(overrides))
|
|
27107
|
+
LocalizedPolicyVersions: (overrides) => ApiFactory.localizedPolicyVersionsApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27108
|
+
version: LegalVersion
|
|
26590
27109
|
},
|
|
26591
27110
|
GDPR: {
|
|
26592
27111
|
DataDeletion: (overrides) => ApiFactory.dataDeletionApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26593
|
-
DataRetrieval: (overrides) => ApiFactory.dataRetrievalApi(this.config, this.options.namespace, this.override(overrides))
|
|
27112
|
+
DataRetrieval: (overrides) => ApiFactory.dataRetrievalApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27113
|
+
version: GdprVersion
|
|
26594
27114
|
},
|
|
26595
27115
|
Event: {
|
|
26596
|
-
Event: (overrides) => ApiFactory.eventApi(this.config, this.options.namespace, this.override(overrides))
|
|
27116
|
+
Event: (overrides) => ApiFactory.eventApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27117
|
+
version: EventVersion
|
|
26597
27118
|
},
|
|
26598
27119
|
AccelbyteConfig: {
|
|
26599
|
-
PublicTemplate: (overrides) => ApiFactory.publicTemplateApi(this.config, this.options.namespace, this.override(overrides))
|
|
27120
|
+
PublicTemplate: (overrides) => ApiFactory.publicTemplateApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27121
|
+
version: OdinConfigVersion
|
|
27122
|
+
},
|
|
27123
|
+
version: () => {
|
|
27124
|
+
console.log('IamVersion: ', IamVersion.version);
|
|
27125
|
+
console.log('BuildinfoVersion: ', BuildinfoVersion.version);
|
|
27126
|
+
console.log('BasicVersion: ', BasicVersion.version);
|
|
27127
|
+
console.log('PlatformVersion: ', PlatformVersion.version);
|
|
27128
|
+
console.log('LegalVersion: ', LegalVersion.version);
|
|
27129
|
+
console.log('GdprVersion: ', GdprVersion.version);
|
|
27130
|
+
console.log('EventVersion: ', EventVersion.version);
|
|
27131
|
+
const axiosInstance = Network.create(this.config);
|
|
27132
|
+
axiosInstance
|
|
27133
|
+
.get('https://development.accelbyte.io/iam/version')
|
|
27134
|
+
.then(res => {
|
|
27135
|
+
console.log('-- axiosInstance res', res);
|
|
27136
|
+
console.log('-- current ver', IamVersion);
|
|
27137
|
+
})
|
|
27138
|
+
.catch(err => {
|
|
27139
|
+
console.log('-- axiosInstance err', err);
|
|
27140
|
+
});
|
|
26600
27141
|
}
|
|
26601
27142
|
};
|
|
26602
27143
|
}
|
|
@@ -39408,7 +39949,7 @@ const PageConfig = mod.object({
|
|
|
39408
39949
|
});
|
|
39409
39950
|
|
|
39410
39951
|
/*
|
|
39411
|
-
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
39952
|
+
* Copyright (c) 2022-2023 AccelByte Inc. All Rights Reserved
|
|
39412
39953
|
* This is licensed software from AccelByte Inc, for limitations
|
|
39413
39954
|
* and restrictions contact your company contract manager.
|
|
39414
39955
|
*/
|
|
@@ -39956,6 +40497,7 @@ exports.DeletionData = DeletionData;
|
|
|
39956
40497
|
exports.DeletionStatus = DeletionStatus;
|
|
39957
40498
|
exports.DependencyObject = DependencyObject;
|
|
39958
40499
|
exports.Description = Description;
|
|
40500
|
+
exports.DesktopChecker = DesktopChecker;
|
|
39959
40501
|
exports.DetailedWalletTransactionInfo = DetailedWalletTransactionInfo;
|
|
39960
40502
|
exports.DetailedWalletTransactionPagingSlicedResult = DetailedWalletTransactionPagingSlicedResult;
|
|
39961
40503
|
exports.DeviceBanRequestV4 = DeviceBanRequestV4;
|
|
@@ -40540,7 +41082,7 @@ exports.UserActiveBanResponse = UserActiveBanResponse;
|
|
|
40540
41082
|
exports.UserActiveBanResponseV3 = UserActiveBanResponseV3;
|
|
40541
41083
|
exports.UserActiveBanResponseV4 = UserActiveBanResponseV4;
|
|
40542
41084
|
exports.UserApi = UserApi;
|
|
40543
|
-
exports.
|
|
41085
|
+
exports.UserAuthorizationApi = UserAuthorizationApi;
|
|
40544
41086
|
exports.UserBan = UserBan;
|
|
40545
41087
|
exports.UserBanRequest = UserBanRequest;
|
|
40546
41088
|
exports.UserBanResponse = UserBanResponse;
|