@accelbyte/sdk 0.2.0-beta.4 → 0.2.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +1 -4
- package/dist/index.browser.es.js +845 -503
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.d.ts +1842 -1507
- package/dist/index.node.es.js +845 -503
- package/dist/index.node.es.js.map +1 -1
- package/dist/index.node.js +845 -503
- package/dist/index.node.js.map +1 -1
- package/examples/next/package.json +1 -1
- package/examples/node/package.json +1 -1
- package/examples/vite/package.json +1 -1
- package/package.json +1 -1
package/dist/index.node.js
CHANGED
|
@@ -9543,6 +9543,8 @@ class FileUploadApi {
|
|
|
9543
9543
|
this.conf = conf;
|
|
9544
9544
|
this.namespace = namespace;
|
|
9545
9545
|
/**
|
|
9546
|
+
* POST [/basic/v1/public/namespaces/{namespace}/folders/{folder}/files](api)
|
|
9547
|
+
*
|
|
9546
9548
|
* Generate an upload URL. It's valid for 10 minutes.
|
|
9547
9549
|
* Returns: URL data
|
|
9548
9550
|
*/
|
|
@@ -9665,12 +9667,18 @@ class MiscApi {
|
|
|
9665
9667
|
this.namespace = namespace;
|
|
9666
9668
|
this.cache = cache;
|
|
9667
9669
|
/**
|
|
9668
|
-
*
|
|
9669
|
-
*
|
|
9670
|
+
* GET [/basic/v1/public/namespaces/{namespace}/misc/countries](api)
|
|
9671
|
+
*
|
|
9672
|
+
* _Returns_: country code list
|
|
9670
9673
|
*/
|
|
9671
9674
|
this.getCountries = (lang) => {
|
|
9672
9675
|
return this.newInstance().fetchV1NsMiscCountries({ lang });
|
|
9673
9676
|
};
|
|
9677
|
+
/**
|
|
9678
|
+
* GET [/basic/v1/public/namespaces/{namespace}/misc/languages](api)
|
|
9679
|
+
*
|
|
9680
|
+
* _Returns_: language list
|
|
9681
|
+
*/
|
|
9674
9682
|
this.getLanguages = () => {
|
|
9675
9683
|
return this.newInstance().fetchV1NsMiscLanguages();
|
|
9676
9684
|
};
|
|
@@ -9760,9 +9768,10 @@ class NamespaceApi {
|
|
|
9760
9768
|
this.namespace = namespace;
|
|
9761
9769
|
this.cache = cache;
|
|
9762
9770
|
/**
|
|
9771
|
+
* GET [/basic/v1/public/namespaces](api)
|
|
9772
|
+
*
|
|
9763
9773
|
* Get all namespaces.
|
|
9764
9774
|
*
|
|
9765
|
-
* Other detail info:
|
|
9766
9775
|
* - _Required permission_: login user
|
|
9767
9776
|
* - _Action code_: 11303
|
|
9768
9777
|
* - _Returns_: list of namespaces
|
|
@@ -10072,6 +10081,8 @@ class UserProfileApi {
|
|
|
10072
10081
|
this.namespace = namespace;
|
|
10073
10082
|
this.cache = cache;
|
|
10074
10083
|
/**
|
|
10084
|
+
* GET [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
|
|
10085
|
+
*
|
|
10075
10086
|
* Get my profile
|
|
10076
10087
|
*
|
|
10077
10088
|
* __Client with user token can get user profile in target namespace__
|
|
@@ -10080,6 +10091,8 @@ class UserProfileApi {
|
|
|
10080
10091
|
return this.newInstance().fetchV1NsUsersMeProfiles();
|
|
10081
10092
|
};
|
|
10082
10093
|
/**
|
|
10094
|
+
* POST [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
|
|
10095
|
+
*
|
|
10083
10096
|
* Create my profile.
|
|
10084
10097
|
*
|
|
10085
10098
|
* __Client with user token can create user profile in target namespace__
|
|
@@ -10088,6 +10101,8 @@ class UserProfileApi {
|
|
|
10088
10101
|
return this.newInstance().postV1NsUsersMeProfiles(data);
|
|
10089
10102
|
};
|
|
10090
10103
|
/**
|
|
10104
|
+
* PUT [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
|
|
10105
|
+
*
|
|
10091
10106
|
* Update my profile.
|
|
10092
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.
|
|
10093
10108
|
*/
|
|
@@ -10095,6 +10110,8 @@ class UserProfileApi {
|
|
|
10095
10110
|
return this.newInstance().putV1NsUsersMeProfiles(data);
|
|
10096
10111
|
};
|
|
10097
10112
|
/**
|
|
10113
|
+
* PUT [/basic/v1/public/namespaces/{namespace}/users/{userId}/profiles/customAttributes](api)
|
|
10114
|
+
*
|
|
10098
10115
|
* Update partially custom attributes tied to user id.
|
|
10099
10116
|
* _Returns_: Updated custom attributes
|
|
10100
10117
|
*/
|
|
@@ -10163,16 +10180,17 @@ class CachingApi {
|
|
|
10163
10180
|
constructor(conf, namespace) {
|
|
10164
10181
|
this.conf = conf;
|
|
10165
10182
|
this.namespace = namespace;
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
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
|
+
};
|
|
10176
10194
|
}
|
|
10177
10195
|
newInstance() {
|
|
10178
10196
|
// this is expensive to cache, apply "cache: false"
|
|
@@ -10346,21 +10364,26 @@ class DlcApi {
|
|
|
10346
10364
|
constructor(conf, namespace) {
|
|
10347
10365
|
this.conf = conf;
|
|
10348
10366
|
this.namespace = namespace;
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
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
|
+
};
|
|
10364
10387
|
}
|
|
10365
10388
|
newInstance() {
|
|
10366
10389
|
// this is be expensive to cache, apply "cache: false"
|
|
@@ -10727,66 +10750,76 @@ class DownloaderApi {
|
|
|
10727
10750
|
constructor(conf, namespace) {
|
|
10728
10751
|
this.conf = conf;
|
|
10729
10752
|
this.namespace = namespace;
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10767
|
-
|
|
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
|
+
}
|
|
10768
10798
|
}
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
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
|
+
}
|
|
10775
10805
|
}
|
|
10776
10806
|
}
|
|
10777
|
-
|
|
10778
|
-
|
|
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
|
+
};
|
|
10779
10818
|
}
|
|
10780
10819
|
newInstance() {
|
|
10781
10820
|
// this is be expensive to cache, apply "cache: false"
|
|
10782
10821
|
return new Downloader$(Network.create(this.conf), this.namespace, false);
|
|
10783
10822
|
}
|
|
10784
|
-
getCurrentPlatform(userPlatform) {
|
|
10785
|
-
const devicePlatform = userPlatform.platform;
|
|
10786
|
-
const deviceArch = userPlatform.arch;
|
|
10787
|
-
const currentPlatform = AvailablePlatform.find((platform) => platform.platform === devicePlatform && platform.arch.includes(deviceArch));
|
|
10788
|
-
return currentPlatform;
|
|
10789
|
-
}
|
|
10790
10823
|
}
|
|
10791
10824
|
|
|
10792
10825
|
/*
|
|
@@ -10890,6 +10923,8 @@ class EventApi {
|
|
|
10890
10923
|
this.namespace = namespace;
|
|
10891
10924
|
this.cache = cache;
|
|
10892
10925
|
/**
|
|
10926
|
+
* GET [/event/v2/public/namespaces/{namespace}/users/{userId}/edithistory](api)
|
|
10927
|
+
*
|
|
10893
10928
|
* Available Type:
|
|
10894
10929
|
* - email
|
|
10895
10930
|
* - password
|
|
@@ -10898,7 +10933,7 @@ class EventApi {
|
|
|
10898
10933
|
* - country
|
|
10899
10934
|
* - language
|
|
10900
10935
|
*
|
|
10901
|
-
*
|
|
10936
|
+
* _Requires a valid user access token_
|
|
10902
10937
|
*/
|
|
10903
10938
|
this.getAccountHistoryByUserId = ({ userId, queryParams }) => {
|
|
10904
10939
|
return this.newInstance().fetchEventV2NsUsersByUseridEdithistory(userId, queryParams);
|
|
@@ -10992,27 +11027,36 @@ class DataDeletionApi {
|
|
|
10992
11027
|
this.conf = conf;
|
|
10993
11028
|
this.namespace = namespace;
|
|
10994
11029
|
this.cache = cache;
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
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
|
+
};
|
|
11016
11060
|
}
|
|
11017
11061
|
newInstance() {
|
|
11018
11062
|
return new DataDeletion$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -11133,34 +11177,46 @@ class DataRetrievalApi {
|
|
|
11133
11177
|
this.conf = conf;
|
|
11134
11178
|
this.namespace = namespace;
|
|
11135
11179
|
this.cache = cache;
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
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
|
+
};
|
|
11164
11220
|
}
|
|
11165
11221
|
newInstance() {
|
|
11166
11222
|
return new DataRetrieval$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -11253,10 +11309,11 @@ class InputValidationsApi {
|
|
|
11253
11309
|
this.namespace = namespace;
|
|
11254
11310
|
this.cache = cache;
|
|
11255
11311
|
/**
|
|
11312
|
+
* GET [/iam/v3/public/inputValidations](api)
|
|
11313
|
+
*
|
|
11256
11314
|
* No role required
|
|
11257
11315
|
* This method is to get list of input validation configuration.
|
|
11258
11316
|
* `regex` parameter will be returned if `isCustomRegex` is true. Otherwise, it will be empty.
|
|
11259
|
-
*
|
|
11260
11317
|
*/
|
|
11261
11318
|
this.getValidations = (languageCode, defaultOnEmpty) => {
|
|
11262
11319
|
const queryParams = { languageCode, defaultOnEmpty };
|
|
@@ -20232,6 +20289,8 @@ class UserAuthorizationApi {
|
|
|
20232
20289
|
this.cache = cache;
|
|
20233
20290
|
this.options = options;
|
|
20234
20291
|
/**
|
|
20292
|
+
* POST: [/iam/v3/oauth/token](api)
|
|
20293
|
+
*
|
|
20235
20294
|
* This method supports grant type:
|
|
20236
20295
|
* - Grant Type == `authorization_code`:
|
|
20237
20296
|
* It generates the user token by given the authorization
|
|
@@ -20338,6 +20397,9 @@ class UserAuthorizationApi {
|
|
|
20338
20397
|
CodeChallenge.clear();
|
|
20339
20398
|
return { ...result, mfaData };
|
|
20340
20399
|
};
|
|
20400
|
+
/**
|
|
20401
|
+
* @internal
|
|
20402
|
+
*/
|
|
20341
20403
|
this.getMfaDataFromError = (errorResponse) => {
|
|
20342
20404
|
const doesMFADataExist = Validate.safeParse(errorResponse.data, MFADataResponse);
|
|
20343
20405
|
if (!doesMFADataExist)
|
|
@@ -20349,13 +20411,44 @@ class UserAuthorizationApi {
|
|
|
20349
20411
|
}
|
|
20350
20412
|
return result;
|
|
20351
20413
|
};
|
|
20414
|
+
/**
|
|
20415
|
+
* @internal
|
|
20416
|
+
*/
|
|
20352
20417
|
this.getMfaDataFromStorage = () => {
|
|
20353
20418
|
const storedMFAData = BrowserHelper.isOnBrowser() && localStorage.getItem(MFA_DATA_STORAGE_KEY);
|
|
20354
20419
|
return storedMFAData ? JSON.parse(storedMFAData) : null;
|
|
20355
20420
|
};
|
|
20421
|
+
/**
|
|
20422
|
+
* @internal
|
|
20423
|
+
*/
|
|
20356
20424
|
this.removeMfaDataFromStorage = () => {
|
|
20357
20425
|
localStorage.removeItem(MFA_DATA_STORAGE_KEY);
|
|
20358
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
|
+
*/
|
|
20359
20452
|
this.deduceLoginError = (error) => {
|
|
20360
20453
|
switch (error) {
|
|
20361
20454
|
case LoginErrorParam.Enum.login_session_expired:
|
|
@@ -20397,6 +20490,11 @@ class UserAuthorizationApi {
|
|
|
20397
20490
|
returnPath
|
|
20398
20491
|
};
|
|
20399
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
|
+
*/
|
|
20400
20498
|
this.createLoginURL = (returnPath, targetAuthPage, oneTimeLinkCode) => {
|
|
20401
20499
|
const { verifier, challenge } = CodeChallenge.generateChallenge();
|
|
20402
20500
|
const csrf = CodeChallenge.generateCsrf();
|
|
@@ -20420,6 +20518,11 @@ class UserAuthorizationApi {
|
|
|
20420
20518
|
const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
|
|
20421
20519
|
return url.toString();
|
|
20422
20520
|
};
|
|
20521
|
+
/**
|
|
20522
|
+
* GET [/iam/v3/oauth/authorize](api)
|
|
20523
|
+
*
|
|
20524
|
+
* Creates a URL to be used for password recovery
|
|
20525
|
+
*/
|
|
20423
20526
|
this.createForgotPasswordURL = () => {
|
|
20424
20527
|
const { verifier, challenge } = CodeChallenge.generateChallenge();
|
|
20425
20528
|
const csrf = CodeChallenge.generateCsrf();
|
|
@@ -20438,9 +20541,15 @@ class UserAuthorizationApi {
|
|
|
20438
20541
|
const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
|
|
20439
20542
|
return url.toString();
|
|
20440
20543
|
};
|
|
20544
|
+
/**
|
|
20545
|
+
* @internal
|
|
20546
|
+
*/
|
|
20441
20547
|
this.getCodeChallenge = () => {
|
|
20442
20548
|
return CodeChallenge.generateChallenge();
|
|
20443
20549
|
};
|
|
20550
|
+
/**
|
|
20551
|
+
* @internal
|
|
20552
|
+
*/
|
|
20444
20553
|
this.refreshToken = () => {
|
|
20445
20554
|
const { clientId, refreshToken } = this.options;
|
|
20446
20555
|
if (DesktopChecker.isDesktopApp()) {
|
|
@@ -20448,6 +20557,9 @@ class UserAuthorizationApi {
|
|
|
20448
20557
|
}
|
|
20449
20558
|
return refreshWithLock({ axiosConfig: this.conf, clientId });
|
|
20450
20559
|
};
|
|
20560
|
+
/**
|
|
20561
|
+
* @internal
|
|
20562
|
+
*/
|
|
20451
20563
|
this.getSearchParams = (sentState, challenge) => {
|
|
20452
20564
|
const searchParams = new URLSearchParams();
|
|
20453
20565
|
searchParams.append('response_type', 'code');
|
|
@@ -20459,25 +20571,6 @@ class UserAuthorizationApi {
|
|
|
20459
20571
|
return searchParams;
|
|
20460
20572
|
};
|
|
20461
20573
|
}
|
|
20462
|
-
matchReceivedState(maybeSentState) {
|
|
20463
|
-
const sentStateResult = CodeChallenge.parseSentState(maybeSentState);
|
|
20464
|
-
if (sentStateResult.error)
|
|
20465
|
-
return { error: sentStateResult.error, result: null };
|
|
20466
|
-
const storedStateResult = CodeChallenge.load();
|
|
20467
|
-
if (storedStateResult.error)
|
|
20468
|
-
return { error: storedStateResult.error, result: null };
|
|
20469
|
-
const sentState = sentStateResult.sentState;
|
|
20470
|
-
const storedState = storedStateResult.storedState;
|
|
20471
|
-
if (sentState.csrf !== storedState.csrf)
|
|
20472
|
-
return { error: null, result: null };
|
|
20473
|
-
return {
|
|
20474
|
-
error: null,
|
|
20475
|
-
result: {
|
|
20476
|
-
payload: sentState.payload,
|
|
20477
|
-
codeVerifier: storedState.codeVerifier
|
|
20478
|
-
}
|
|
20479
|
-
};
|
|
20480
|
-
}
|
|
20481
20574
|
}
|
|
20482
20575
|
function isAxiosError(error) {
|
|
20483
20576
|
return !!error && !!error.config;
|
|
@@ -20886,6 +20979,14 @@ class OAuthApi {
|
|
|
20886
20979
|
this.cache = cache;
|
|
20887
20980
|
this.options = options;
|
|
20888
20981
|
/**
|
|
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
|
+
*
|
|
20889
20990
|
* This method is used to remove __access_token__, __refresh_token__ from cookie and revoke token from usage.
|
|
20890
20991
|
* Supported methods:
|
|
20891
20992
|
* - VerifyToken to verify token from header
|
|
@@ -20901,6 +21002,8 @@ class OAuthApi {
|
|
|
20901
21002
|
return new OAuth20Extension$(axios, this.namespace, this.cache).postIamV3Logout();
|
|
20902
21003
|
};
|
|
20903
21004
|
/**
|
|
21005
|
+
* POST [/iam/v3/oauth/revoke](api)
|
|
21006
|
+
*
|
|
20904
21007
|
* This method revokes a token.
|
|
20905
21008
|
* This method requires authorized requests header with Basic Authentication from client that establish the token.action code: 10706
|
|
20906
21009
|
*/
|
|
@@ -20916,6 +21019,8 @@ class OAuthApi {
|
|
|
20916
21019
|
return new OAuth20$(axios, this.namespace, this.cache).postIamV3OauthRevoke({ token });
|
|
20917
21020
|
};
|
|
20918
21021
|
/**
|
|
21022
|
+
* POST [/iam/v3/oauth/mfa/verify](api)
|
|
21023
|
+
*
|
|
20919
21024
|
* Verify 2FA code
|
|
20920
21025
|
* This method is used for verifying 2FA code.
|
|
20921
21026
|
* ##2FA remember device
|
|
@@ -20931,6 +21036,9 @@ class OAuthApi {
|
|
|
20931
21036
|
localStorage.removeItem(MFA_DATA_STORAGE_KEY);
|
|
20932
21037
|
return result.response;
|
|
20933
21038
|
};
|
|
21039
|
+
/**
|
|
21040
|
+
* POST [/iam/v3/oauth/mfa/code](api)
|
|
21041
|
+
*/
|
|
20934
21042
|
this.request2FAEmailCode = async ({ mfaToken = null, factor }) => {
|
|
20935
21043
|
const result = await this.newInstance().postIamV3OauthMfaCode({ mfaToken, clientId: this.options.clientId, factor });
|
|
20936
21044
|
if (result.error)
|
|
@@ -20938,12 +21046,16 @@ class OAuthApi {
|
|
|
20938
21046
|
return result.response;
|
|
20939
21047
|
};
|
|
20940
21048
|
/**
|
|
21049
|
+
* GET [/iam/v3/location/country](api)
|
|
21050
|
+
*
|
|
20941
21051
|
* This method get country location based on the request.
|
|
20942
21052
|
*/
|
|
20943
21053
|
this.getCurrentLocationCountry = () => {
|
|
20944
21054
|
return this.newOAuth20Extension().fetchIamV3LocationCountry();
|
|
20945
21055
|
};
|
|
20946
21056
|
/**
|
|
21057
|
+
* GET [/iam/v3/oauth/namespaces/{namespace}/users/{userId}/platforms/{platformId}/platformToken](api)
|
|
21058
|
+
*
|
|
20947
21059
|
* Retrieve User Third Party Platform Token
|
|
20948
21060
|
*
|
|
20949
21061
|
* This method used for retrieving third party platform token for user that login using third party,
|
|
@@ -20963,6 +21075,8 @@ class OAuthApi {
|
|
|
20963
21075
|
return this.newInstance().fetchV3OauthUsersByUseridPlatformsByPlatformidPlatformToken(userId, platformId);
|
|
20964
21076
|
};
|
|
20965
21077
|
/**
|
|
21078
|
+
* POST [/iam/v3/authenticateWithLink](api)
|
|
21079
|
+
*
|
|
20966
21080
|
* This method is being used to authenticate a user account and perform platform link.
|
|
20967
21081
|
* It validates user's email / username and password.
|
|
20968
21082
|
* If user already enable 2FA, then invoke _/mfa/verify_ using __mfa_token__ from this method response.
|
|
@@ -20977,31 +21091,27 @@ class OAuthApi {
|
|
|
20977
21091
|
this.authenticateWithLink = (data) => {
|
|
20978
21092
|
return this.newOAuth20Extension().postIamV3AuthenticateWithLink(data);
|
|
20979
21093
|
};
|
|
20980
|
-
|
|
20981
|
-
|
|
20982
|
-
|
|
20983
|
-
|
|
20984
|
-
|
|
20985
|
-
|
|
20986
|
-
|
|
20987
|
-
|
|
20988
|
-
|
|
20989
|
-
|
|
20990
|
-
|
|
20991
|
-
|
|
20992
|
-
|
|
20993
|
-
|
|
20994
|
-
|
|
20995
|
-
|
|
20996
|
-
|
|
20997
|
-
|
|
20998
|
-
|
|
20999
|
-
|
|
21000
|
-
|
|
21001
|
-
*
|
|
21002
|
-
*/
|
|
21003
|
-
exchangeTokenByOneTimeLinkCode(data) {
|
|
21004
|
-
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
|
+
};
|
|
21005
21115
|
}
|
|
21006
21116
|
newInstance() {
|
|
21007
21117
|
return new OAuth20$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -21080,6 +21190,8 @@ class ThirdPartyCredentialApi {
|
|
|
21080
21190
|
this.namespace = namespace;
|
|
21081
21191
|
this.cache = cache;
|
|
21082
21192
|
/**
|
|
21193
|
+
* GET [/iam/v3/public/namespaces/{namespace}/platforms/clients/active](api)
|
|
21194
|
+
*
|
|
21083
21195
|
* This is the Public API to Get All Active 3rd Platform Credential.
|
|
21084
21196
|
*/
|
|
21085
21197
|
this.getThirdPartyPlatformInfo = () => {
|
|
@@ -21581,85 +21693,112 @@ class TwoFA {
|
|
|
21581
21693
|
this.namespace = namespace;
|
|
21582
21694
|
this.cache = cache;
|
|
21583
21695
|
/**
|
|
21696
|
+
* GET [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode](api)
|
|
21697
|
+
*
|
|
21584
21698
|
* This method is used to get 8-digits backup codes.
|
|
21585
21699
|
* Each code is a one-time code and will be deleted once used.
|
|
21586
|
-
* This method Requires valid user access token
|
|
21587
21700
|
*
|
|
21701
|
+
* _Requires a valid user access token_
|
|
21588
21702
|
*/
|
|
21589
21703
|
this.getBackupCode = () => {
|
|
21590
21704
|
return this.newInstance().fetchV4NsUsersMeMfaBackupCode();
|
|
21591
21705
|
};
|
|
21592
21706
|
/**
|
|
21707
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode/enable](api)
|
|
21708
|
+
*
|
|
21593
21709
|
* This method is used to enable 2FA backup codes.
|
|
21594
|
-
* This method Requires valid user access token
|
|
21595
21710
|
*
|
|
21711
|
+
* _Requires a valid user access token_
|
|
21596
21712
|
*/
|
|
21597
21713
|
this.enable2FABackupCodes = () => {
|
|
21598
21714
|
return this.newInstance().postV4NsUsersMeMfaBackupCodeEnable();
|
|
21599
21715
|
};
|
|
21600
21716
|
/**
|
|
21717
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode](api)
|
|
21718
|
+
*
|
|
21601
21719
|
* This method is used to enable 2FA backup codes.
|
|
21602
|
-
* This method Requires valid user access token
|
|
21603
21720
|
*
|
|
21721
|
+
* _Requires a valid user access token_
|
|
21604
21722
|
*/
|
|
21605
21723
|
this.generateBackupCodes = () => {
|
|
21606
21724
|
return this.newInstance().postV4NsUsersMeMfaBackupCode();
|
|
21607
21725
|
};
|
|
21608
21726
|
/**
|
|
21727
|
+
* DELETE [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode/disable](api)
|
|
21728
|
+
*
|
|
21609
21729
|
* This method is used to enable 2FA backup codes.
|
|
21610
|
-
* This method Requires valid user access token
|
|
21611
21730
|
*
|
|
21731
|
+
* _Requires a valid user access token_
|
|
21612
21732
|
*/
|
|
21613
21733
|
this.disableBackupCodes = () => {
|
|
21614
21734
|
return this.newInstance().deleteV4NsUsersMeMfaBackupCodeDisable();
|
|
21615
21735
|
};
|
|
21616
21736
|
/**
|
|
21737
|
+
* DELETE [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/disable](api)
|
|
21738
|
+
* }
|
|
21617
21739
|
* This method is used to disable 2FA authenticator.
|
|
21618
|
-
* This method Requires valid user access token
|
|
21619
21740
|
*
|
|
21741
|
+
* _Requires a valid user access token_
|
|
21620
21742
|
*/
|
|
21621
21743
|
this.disableAuthenticator = () => {
|
|
21622
21744
|
return this.newInstance().deleteV4NsUsersMeMfaAuthenticatorDisable();
|
|
21623
21745
|
};
|
|
21624
21746
|
/**
|
|
21747
|
+
* GET [/iam/v4/public/namespaces/{namespace}/users/me/mfa/factor](api)
|
|
21748
|
+
*
|
|
21625
21749
|
* This method is used to get user enabled factors.
|
|
21626
|
-
* This method Requires valid user access token
|
|
21627
21750
|
*
|
|
21751
|
+
* _Requires a valid user access token_
|
|
21628
21752
|
*/
|
|
21629
21753
|
this.getEnabledMethods = () => {
|
|
21630
21754
|
return this.newInstance().fetchV4NsUsersMeMfaFactor();
|
|
21631
21755
|
};
|
|
21632
21756
|
/**
|
|
21757
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/factor](api)
|
|
21758
|
+
*
|
|
21633
21759
|
* This method is used to make 2FA factor default.
|
|
21634
|
-
* This method Requires valid user access token
|
|
21635
21760
|
*
|
|
21761
|
+
* _Requires a valid user access token_
|
|
21636
21762
|
*/
|
|
21637
21763
|
this.set2FAAsDefault = (factor) => {
|
|
21638
21764
|
return this.newInstance().postV4NsUsersMeMfaFactor({ factor });
|
|
21639
21765
|
};
|
|
21640
21766
|
/**
|
|
21767
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/enable](api)
|
|
21768
|
+
*
|
|
21641
21769
|
* This method is used to enable 2FA authenticator.
|
|
21642
|
-
* This method Requires valid user access token
|
|
21643
21770
|
*
|
|
21771
|
+
* _Requires a valid user access token_
|
|
21644
21772
|
*/
|
|
21645
21773
|
this.enable2FAAuthenticator = (code) => {
|
|
21646
21774
|
return this.newInstance().postV4NsUsersMeMfaAuthenticatorEnable({ code });
|
|
21647
21775
|
};
|
|
21648
21776
|
/**
|
|
21777
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/key](api)
|
|
21778
|
+
*
|
|
21649
21779
|
* This method is used to generate a secret key for 3rd-party authenticator app.
|
|
21650
21780
|
* A QR code URI is also returned so that frontend can generate QR code image.
|
|
21651
|
-
* This method Requires valid user access token
|
|
21652
21781
|
*
|
|
21782
|
+
* _Requires a valid user access token_
|
|
21653
21783
|
*/
|
|
21654
21784
|
this.generateSecretKey = () => {
|
|
21655
21785
|
return this.newInstance().postV4NsUsersMeMfaAuthenticatorKey();
|
|
21656
21786
|
};
|
|
21787
|
+
/**
|
|
21788
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/code](api)
|
|
21789
|
+
*/
|
|
21657
21790
|
this.requestEmailCode = () => {
|
|
21658
21791
|
return this.newInstance().postV4NsUsersMeMfaEmailCode();
|
|
21659
21792
|
};
|
|
21793
|
+
/**
|
|
21794
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/enable](api)
|
|
21795
|
+
*/
|
|
21660
21796
|
this.enableEmailMethod = (code) => {
|
|
21661
21797
|
return this.newInstance().postV4NsUsersMeMfaEmailEnable({ code });
|
|
21662
21798
|
};
|
|
21799
|
+
/**
|
|
21800
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/disable](api)
|
|
21801
|
+
*/
|
|
21663
21802
|
this.disableEmailMethod = () => {
|
|
21664
21803
|
return this.newInstance().postV4NsUsersMeMfaEmailDisable();
|
|
21665
21804
|
};
|
|
@@ -22873,30 +23012,40 @@ class UserApi {
|
|
|
22873
23012
|
this.namespace = namespace;
|
|
22874
23013
|
this.cache = cache;
|
|
22875
23014
|
/**
|
|
22876
|
-
*
|
|
23015
|
+
* GET [/iam/v3/public/users/me](api)
|
|
23016
|
+
*
|
|
23017
|
+
* get currently logged-in user
|
|
22877
23018
|
*/
|
|
22878
23019
|
this.getCurrentUser = () => {
|
|
22879
23020
|
return this.newInstance().fetchIamV3PublicUsersMe();
|
|
22880
23021
|
};
|
|
22881
23022
|
/**
|
|
22882
|
-
*
|
|
23023
|
+
* PATCH [/iam/v3/public/namespaces/{namespace}/users/me](api)
|
|
23024
|
+
*
|
|
23025
|
+
* Update current user
|
|
22883
23026
|
*/
|
|
22884
23027
|
this.updateUserMe = (data) => {
|
|
22885
23028
|
return this.newInstance().patchV3NsUsersMe(data);
|
|
22886
23029
|
};
|
|
22887
23030
|
/**
|
|
23031
|
+
* PUT [/iam/v4/public/namespaces/{namespace}/users/me/email](api)
|
|
23032
|
+
*
|
|
22888
23033
|
* update current user's email
|
|
22889
23034
|
*/
|
|
22890
23035
|
this.updateEmailMe = (data) => {
|
|
22891
23036
|
return this.newInstance4().putV4NsUsersMeEmail(data);
|
|
22892
23037
|
};
|
|
22893
23038
|
/**
|
|
23039
|
+
* PUT [/iam/v3/public/namespaces/{namespace}/users/me/password](api)
|
|
23040
|
+
*
|
|
22894
23041
|
* update current user's password
|
|
22895
23042
|
*/
|
|
22896
23043
|
this.updatePasswordMe = (data) => {
|
|
22897
23044
|
return this.newInstance().putV3NsUsersMePassword(data);
|
|
22898
23045
|
};
|
|
22899
23046
|
/**
|
|
23047
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/code/request](api)
|
|
23048
|
+
*
|
|
22900
23049
|
* Required valid user authorization
|
|
22901
23050
|
* The verification code is sent to email address
|
|
22902
23051
|
* Available contexts for use :
|
|
@@ -22919,6 +23068,8 @@ class UserApi {
|
|
|
22919
23068
|
return this.newInstance().postV3NsUsersMeCodeRequest(data);
|
|
22920
23069
|
};
|
|
22921
23070
|
/**
|
|
23071
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/code/verify](api)
|
|
23072
|
+
*
|
|
22922
23073
|
* Will consume code if validateOnly is set false
|
|
22923
23074
|
* Required valid user authorization
|
|
22924
23075
|
* Redeems a verification code sent to a user to verify the user's contact address is correct
|
|
@@ -22930,6 +23081,8 @@ class UserApi {
|
|
|
22930
23081
|
return this.newInstance().postV3NsUsersMeCodeVerify(data);
|
|
22931
23082
|
};
|
|
22932
23083
|
/**
|
|
23084
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/headless/code/verify](api)
|
|
23085
|
+
*
|
|
22933
23086
|
* If validateOnly is set false, consume code and upgrade headless account and automatically verified the email address if it is succeeded
|
|
22934
23087
|
* Require valid user access token.
|
|
22935
23088
|
* The method upgrades a headless account by linking the headless account with the email address and the password.
|
|
@@ -22949,6 +23102,8 @@ class UserApi {
|
|
|
22949
23102
|
return this.newInstance().postV3NsUsersMeHeadlessCodeVerify(data);
|
|
22950
23103
|
};
|
|
22951
23104
|
/**
|
|
23105
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/headless/code/verify](api)
|
|
23106
|
+
*
|
|
22952
23107
|
* Require valid user access token.
|
|
22953
23108
|
* The method upgrades a headless account by linking the headless account with the email address, username, and password.
|
|
22954
23109
|
* By upgrading the headless account into a full account, the user could use the email address, username, and password for using Justice IAM.
|
|
@@ -22968,13 +23123,17 @@ class UserApi {
|
|
|
22968
23123
|
return this.newInstance4().postV4NsUsersMeHeadlessCodeVerify(data);
|
|
22969
23124
|
};
|
|
22970
23125
|
/**
|
|
23126
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/{userId}/platforms](api)
|
|
23127
|
+
*
|
|
22971
23128
|
* This method retrieves platform accounts linked to user. Required valid user authorization.
|
|
22972
|
-
*
|
|
23129
|
+
* action code: 10128
|
|
22973
23130
|
*/
|
|
22974
23131
|
this.getUserLinkedPlatform = (userId) => {
|
|
22975
23132
|
return this.newInstance().fetchV3NsUsersByUseridPlatforms(userId);
|
|
22976
23133
|
};
|
|
22977
23134
|
/**
|
|
23135
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}](api)
|
|
23136
|
+
*
|
|
22978
23137
|
* Required valid user authorization.
|
|
22979
23138
|
* __Prerequisite:__
|
|
22980
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).
|
|
@@ -23004,22 +23163,26 @@ class UserApi {
|
|
|
23004
23163
|
return this.newInstance().postV3NsUsersMePlatformsByPlatformid(platformId, data);
|
|
23005
23164
|
};
|
|
23006
23165
|
/**
|
|
23166
|
+
* GET [/iam/v3/public/namespaces/{namespace}/requests/{requestId}/async/status](api)
|
|
23167
|
+
*
|
|
23007
23168
|
* Get the linking status between a third-party platform to a user
|
|
23008
23169
|
*/
|
|
23009
23170
|
this.getLinkRequestStatus = (requestId) => {
|
|
23010
23171
|
return this.newInstance().fetchV3NsRequestsByRequestidAsyncStatus(requestId);
|
|
23011
23172
|
};
|
|
23012
23173
|
/**
|
|
23174
|
+
* @internal
|
|
23013
23175
|
* It is going to be __DEPRECATED__.
|
|
23014
23176
|
* Update Platform Account relation to current User Account.
|
|
23015
23177
|
* Note: Game progression data (statistics, reward, etc) associated with previous User Account will not be
|
|
23016
23178
|
* transferred. If the data is tight to game user ID, the user will have the game progression data.
|
|
23017
|
-
*
|
|
23018
23179
|
*/
|
|
23019
23180
|
this.linkPlatformToUserAccount = ({ userId, data }) => {
|
|
23020
23181
|
return this.newInstance().postV3NsUsersByUseridPlatformsLink(userId, data);
|
|
23021
23182
|
};
|
|
23022
23183
|
/**
|
|
23184
|
+
* DELETE [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}](api)
|
|
23185
|
+
*
|
|
23023
23186
|
* Required valid user authorization.
|
|
23024
23187
|
* ##Supported platforms:
|
|
23025
23188
|
*
|
|
@@ -23052,110 +23215,123 @@ class UserApi {
|
|
|
23052
23215
|
return this.newInstance().deleteV3NsUsersMePlatformsByPlatformid(platformId, data);
|
|
23053
23216
|
};
|
|
23054
23217
|
/**
|
|
23218
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}/web/link](api)
|
|
23219
|
+
*
|
|
23055
23220
|
* This method is used to generate third party login page which will redirected to establish method.
|
|
23056
23221
|
*/
|
|
23057
23222
|
this.getThirdPartyURL = ({ platformId, queryParams }) => {
|
|
23058
23223
|
return this.newInstance().fetchV3NsUsersMePlatformsByPlatformidWebLink(platformId, queryParams);
|
|
23059
23224
|
};
|
|
23060
23225
|
/**
|
|
23226
|
+
* GET [/iam/v3/public/namespaces/{namespace}/agerestrictions/countries/{countryCode}](api)
|
|
23227
|
+
*
|
|
23061
23228
|
* Get age restriction by country code. It will always get by publisher namespace
|
|
23062
23229
|
*/
|
|
23063
23230
|
this.getAgeRestrictionByCountry = (countryCode) => {
|
|
23064
23231
|
return this.newInstance().fetchV3NsAgerestrictionsCountriesByCountrycode(countryCode);
|
|
23065
23232
|
};
|
|
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
|
-
|
|
23139
|
-
|
|
23140
|
-
|
|
23141
|
-
|
|
23142
|
-
|
|
23143
|
-
|
|
23144
|
-
|
|
23145
|
-
|
|
23146
|
-
|
|
23147
|
-
|
|
23148
|
-
|
|
23149
|
-
|
|
23150
|
-
|
|
23151
|
-
|
|
23152
|
-
|
|
23153
|
-
|
|
23154
|
-
|
|
23155
|
-
|
|
23156
|
-
|
|
23157
|
-
|
|
23158
|
-
|
|
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
|
+
};
|
|
23159
23335
|
}
|
|
23160
23336
|
/**
|
|
23161
23337
|
* @internal
|
|
@@ -23312,27 +23488,36 @@ class AgreementApi {
|
|
|
23312
23488
|
this.conf = conf;
|
|
23313
23489
|
this.namespace = namespace;
|
|
23314
23490
|
this.cache = cache;
|
|
23315
|
-
|
|
23316
|
-
|
|
23317
|
-
|
|
23318
|
-
|
|
23319
|
-
|
|
23320
|
-
|
|
23321
|
-
|
|
23322
|
-
|
|
23323
|
-
|
|
23324
|
-
|
|
23325
|
-
|
|
23326
|
-
|
|
23327
|
-
|
|
23328
|
-
|
|
23329
|
-
|
|
23330
|
-
|
|
23331
|
-
|
|
23332
|
-
|
|
23333
|
-
|
|
23334
|
-
|
|
23335
|
-
|
|
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
|
+
};
|
|
23336
23521
|
}
|
|
23337
23522
|
newInstance() {
|
|
23338
23523
|
return new Agreement$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23445,13 +23630,16 @@ class EligibilitiesApi {
|
|
|
23445
23630
|
this.conf = conf;
|
|
23446
23631
|
this.namespace = namespace;
|
|
23447
23632
|
this.cache = cache;
|
|
23448
|
-
|
|
23449
|
-
|
|
23450
|
-
|
|
23451
|
-
|
|
23452
|
-
|
|
23453
|
-
|
|
23454
|
-
|
|
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
|
+
};
|
|
23455
23643
|
}
|
|
23456
23644
|
newInstance() {
|
|
23457
23645
|
return new Eligibilities$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23554,12 +23742,14 @@ class LocalizedPolicyVersionsApi {
|
|
|
23554
23742
|
this.conf = conf;
|
|
23555
23743
|
this.namespace = namespace;
|
|
23556
23744
|
this.cache = cache;
|
|
23557
|
-
|
|
23558
|
-
|
|
23559
|
-
|
|
23560
|
-
|
|
23561
|
-
|
|
23562
|
-
|
|
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
|
+
};
|
|
23563
23753
|
}
|
|
23564
23754
|
newInstance() {
|
|
23565
23755
|
return new LocalizedPolicyVersions$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23665,36 +23855,37 @@ class PoliciesApi {
|
|
|
23665
23855
|
this.conf = conf;
|
|
23666
23856
|
this.namespace = namespace;
|
|
23667
23857
|
this.cache = cache;
|
|
23668
|
-
|
|
23669
|
-
|
|
23670
|
-
|
|
23671
|
-
|
|
23672
|
-
|
|
23673
|
-
|
|
23674
|
-
|
|
23675
|
-
|
|
23676
|
-
|
|
23677
|
-
|
|
23678
|
-
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
|
|
23683
|
-
|
|
23684
|
-
|
|
23685
|
-
|
|
23686
|
-
|
|
23687
|
-
|
|
23688
|
-
|
|
23689
|
-
|
|
23690
|
-
|
|
23691
|
-
|
|
23692
|
-
|
|
23693
|
-
|
|
23694
|
-
|
|
23695
|
-
|
|
23696
|
-
|
|
23697
|
-
|
|
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
|
+
};
|
|
23698
23889
|
}
|
|
23699
23890
|
newInstance() {
|
|
23700
23891
|
return new Policies$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -23778,12 +23969,21 @@ class PublicTemplateApi {
|
|
|
23778
23969
|
this.conf = conf;
|
|
23779
23970
|
this.namespace = namespace;
|
|
23780
23971
|
this.cache = cache;
|
|
23972
|
+
/**
|
|
23973
|
+
* @internal
|
|
23974
|
+
*/
|
|
23781
23975
|
this.getTemplateConfigs = (template) => {
|
|
23782
23976
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigs(template);
|
|
23783
23977
|
};
|
|
23978
|
+
/**
|
|
23979
|
+
* @internal
|
|
23980
|
+
*/
|
|
23784
23981
|
this.getTemplateConfig = (template, configId) => {
|
|
23785
23982
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigsByConfig(template, configId);
|
|
23786
23983
|
};
|
|
23984
|
+
/**
|
|
23985
|
+
* @internal
|
|
23986
|
+
*/
|
|
23787
23987
|
this.getDiscoveryTemplateConfigs = () => {
|
|
23788
23988
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigs(DISCOVERY_TEMPLATE_NAME);
|
|
23789
23989
|
};
|
|
@@ -23853,7 +24053,10 @@ class CurrencyApi {
|
|
|
23853
24053
|
this.namespace = namespace;
|
|
23854
24054
|
this.cache = cache;
|
|
23855
24055
|
/**
|
|
24056
|
+
* GET [/platform/public/namespaces/{namespace}/currencies](api)
|
|
24057
|
+
*
|
|
23856
24058
|
* List currencies of a namespace.
|
|
24059
|
+
*
|
|
23857
24060
|
* Returns: Currency List
|
|
23858
24061
|
*/
|
|
23859
24062
|
this.getCurrencies = () => {
|
|
@@ -23861,6 +24064,8 @@ class CurrencyApi {
|
|
|
23861
24064
|
};
|
|
23862
24065
|
/**
|
|
23863
24066
|
* Get the currencies list and convert into a map of currency code and the currency itself
|
|
24067
|
+
*
|
|
24068
|
+
* @internal
|
|
23864
24069
|
*/
|
|
23865
24070
|
this.getCurrencyMap = async () => {
|
|
23866
24071
|
const result = await this.getCurrencies();
|
|
@@ -24473,40 +24678,42 @@ class EntitlementApi {
|
|
|
24473
24678
|
this.conf = conf;
|
|
24474
24679
|
this.namespace = namespace;
|
|
24475
24680
|
this.cache = cache;
|
|
24476
|
-
|
|
24477
|
-
|
|
24478
|
-
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
|
|
24482
|
-
|
|
24483
|
-
|
|
24484
|
-
|
|
24485
|
-
|
|
24486
|
-
|
|
24487
|
-
|
|
24488
|
-
|
|
24489
|
-
|
|
24490
|
-
|
|
24491
|
-
|
|
24492
|
-
|
|
24493
|
-
|
|
24494
|
-
|
|
24495
|
-
|
|
24496
|
-
|
|
24497
|
-
|
|
24498
|
-
|
|
24499
|
-
|
|
24500
|
-
|
|
24501
|
-
|
|
24502
|
-
|
|
24503
|
-
|
|
24504
|
-
|
|
24505
|
-
|
|
24506
|
-
|
|
24507
|
-
|
|
24508
|
-
|
|
24509
|
-
|
|
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
|
+
};
|
|
24510
24717
|
}
|
|
24511
24718
|
newInstance() {
|
|
24512
24719
|
return new Entitlement$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -24606,7 +24813,10 @@ class FulfillmentApi {
|
|
|
24606
24813
|
this.namespace = namespace;
|
|
24607
24814
|
this.cache = cache;
|
|
24608
24815
|
/**
|
|
24609
|
-
*
|
|
24816
|
+
* POST [/platform/public/namespaces/{namespace}/users/{userId}/fulfillment/code](api)
|
|
24817
|
+
*
|
|
24818
|
+
* Redeem campaign code
|
|
24819
|
+
*
|
|
24610
24820
|
* Returns: fulfillment result
|
|
24611
24821
|
*/
|
|
24612
24822
|
this.redeemCode = ({ userId, data }) => {
|
|
@@ -25160,69 +25370,90 @@ class ItemApi {
|
|
|
25160
25370
|
this.conf = conf;
|
|
25161
25371
|
this.namespace = namespace;
|
|
25162
25372
|
this.cache = cache;
|
|
25163
|
-
|
|
25164
|
-
|
|
25165
|
-
|
|
25166
|
-
|
|
25167
|
-
|
|
25168
|
-
|
|
25169
|
-
|
|
25170
|
-
|
|
25171
|
-
|
|
25172
|
-
|
|
25173
|
-
|
|
25174
|
-
|
|
25175
|
-
|
|
25176
|
-
|
|
25177
|
-
|
|
25178
|
-
|
|
25179
|
-
|
|
25180
|
-
|
|
25181
|
-
|
|
25182
|
-
|
|
25183
|
-
|
|
25184
|
-
|
|
25185
|
-
|
|
25186
|
-
|
|
25187
|
-
|
|
25188
|
-
|
|
25189
|
-
|
|
25190
|
-
|
|
25191
|
-
|
|
25192
|
-
|
|
25193
|
-
|
|
25194
|
-
|
|
25195
|
-
|
|
25196
|
-
|
|
25197
|
-
|
|
25198
|
-
|
|
25199
|
-
|
|
25200
|
-
|
|
25201
|
-
|
|
25202
|
-
|
|
25203
|
-
|
|
25204
|
-
}
|
|
25205
|
-
|
|
25206
|
-
|
|
25207
|
-
|
|
25208
|
-
|
|
25209
|
-
|
|
25210
|
-
|
|
25211
|
-
|
|
25212
|
-
|
|
25213
|
-
|
|
25214
|
-
|
|
25215
|
-
|
|
25216
|
-
|
|
25217
|
-
|
|
25218
|
-
|
|
25219
|
-
|
|
25220
|
-
|
|
25221
|
-
|
|
25222
|
-
|
|
25223
|
-
|
|
25224
|
-
|
|
25225
|
-
|
|
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
|
+
};
|
|
25226
25457
|
}
|
|
25227
25458
|
newInstance() {
|
|
25228
25459
|
return new Item$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -25463,36 +25694,102 @@ class OrderApi {
|
|
|
25463
25694
|
this.namespace = namespace;
|
|
25464
25695
|
this.cache = cache;
|
|
25465
25696
|
/**
|
|
25466
|
-
*
|
|
25467
|
-
*
|
|
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>
|
|
25468
25754
|
*/
|
|
25469
25755
|
this.getOrderList = ({ userId, queryParams }) => {
|
|
25470
25756
|
return this.newInstance().fetchNsUsersByUseridOrders(userId, queryParams);
|
|
25471
25757
|
};
|
|
25472
25758
|
/**
|
|
25759
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/orders/{orderNo}](api)
|
|
25760
|
+
*
|
|
25473
25761
|
* Get user order.
|
|
25474
|
-
*
|
|
25762
|
+
*
|
|
25763
|
+
* Returns: `OrderInfo`
|
|
25475
25764
|
*/
|
|
25476
25765
|
this.getOrderByOrderNo = ({ userId, orderNo }) => {
|
|
25477
25766
|
return this.newInstance().fetchNsUsersByUseridOrdersByOrderno(userId, orderNo);
|
|
25478
25767
|
};
|
|
25479
25768
|
/**
|
|
25769
|
+
* PUT [/platform/public/namespaces/{namespace}/users/{userId}/orders/{orderNo}/cancel](api)
|
|
25770
|
+
*
|
|
25480
25771
|
* Cancel user order.
|
|
25481
|
-
*
|
|
25772
|
+
*
|
|
25773
|
+
* Returns: cancelled `OrderInfo`
|
|
25482
25774
|
*/
|
|
25483
25775
|
this.cancelOrder = ({ userId, orderNo }) => {
|
|
25484
25776
|
return this.newInstance().putNsUsersByUseridOrdersByOrdernoCancel(userId, orderNo);
|
|
25485
25777
|
};
|
|
25486
25778
|
/**
|
|
25779
|
+
* POST [/platform/public/namespaces/{namespace}/users/{userId}/orders](api)
|
|
25780
|
+
*
|
|
25487
25781
|
* Create an order. The result contains the checkout link and payment token.
|
|
25488
25782
|
* User with permission SANDBOX will create sandbox order that not real paid for xsolla/alipay and not validate price for wxpay.
|
|
25489
|
-
*
|
|
25783
|
+
*
|
|
25784
|
+
* Returns: created `OrderInfo`
|
|
25490
25785
|
*/
|
|
25491
25786
|
this.createOrder = ({ userId, data }) => {
|
|
25492
25787
|
return this.newInstance().postNsUsersByUseridOrders(userId, data);
|
|
25493
25788
|
};
|
|
25494
25789
|
/**
|
|
25495
25790
|
* Fetch all information needed for a user to check the user's availability to purchase the item
|
|
25791
|
+
*
|
|
25792
|
+
* @internal
|
|
25496
25793
|
*/
|
|
25497
25794
|
this.fetchPrePurchaseInformation = async ({ userId, item }) => {
|
|
25498
25795
|
const currencyApi = new CurrencyApi(this.conf, this.namespace, this.cache);
|
|
@@ -25821,36 +26118,48 @@ class PaymentApi {
|
|
|
25821
26118
|
this.namespace = namespace;
|
|
25822
26119
|
this.cache = cache;
|
|
25823
26120
|
/**
|
|
25824
|
-
*
|
|
25825
|
-
*
|
|
26121
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/payment/accounts](api)
|
|
26122
|
+
*
|
|
26123
|
+
* Get payment accounts.
|
|
26124
|
+
*
|
|
26125
|
+
* Returns: Payment account list `PaymentAccountArray`
|
|
25826
26126
|
*/
|
|
25827
26127
|
this.getPaymentAccounts = (userId) => {
|
|
25828
26128
|
return this.newInstance().fetchNsUsersByUseridPaymentAccounts(userId);
|
|
25829
26129
|
};
|
|
25830
26130
|
/**
|
|
25831
|
-
*
|
|
26131
|
+
* DELETE [/platform/public/namespaces/{namespace}/users/{userId}/payment/accounts/{type}/{id}](api)
|
|
25832
26132
|
*
|
|
25833
|
-
*
|
|
26133
|
+
* Delete payment account.
|
|
25834
26134
|
*/
|
|
25835
26135
|
this.deletePaymentAccount = ({ userId, type, id }) => {
|
|
25836
26136
|
return this.newInstance().deleteNsUsersByUseridPaymentAccountsByTypeById(userId, type, id);
|
|
25837
26137
|
};
|
|
25838
26138
|
/**
|
|
26139
|
+
* GET [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/info](api)
|
|
26140
|
+
*
|
|
25839
26141
|
* Get payment order info.
|
|
25840
|
-
*
|
|
26142
|
+
*
|
|
26143
|
+
* Returns: Payment order details `PaymentOrderDetails`
|
|
25841
26144
|
*/
|
|
25842
26145
|
this.getPaymentInfo = (paymentOrderNo) => {
|
|
25843
26146
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentOrdersByPaymentordernoInfo(paymentOrderNo);
|
|
25844
26147
|
};
|
|
25845
26148
|
/**
|
|
26149
|
+
* POST [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/pay](api)
|
|
26150
|
+
*
|
|
25846
26151
|
* Do payment(For now, this only support checkout.com).
|
|
26152
|
+
*
|
|
25847
26153
|
* Returns: Payment process result
|
|
25848
26154
|
*/
|
|
25849
26155
|
this.processPaymentOrder = (paymentOrderNo, data, queryParams) => {
|
|
25850
26156
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).postNsPaymentOrdersByPaymentordernoPay(paymentOrderNo, data, queryParams);
|
|
25851
26157
|
};
|
|
25852
26158
|
/**
|
|
26159
|
+
* GET [/platform/public/namespaces/{namespace}/payment/publicconfig](api)
|
|
26160
|
+
*
|
|
25853
26161
|
* Get payment provider public config, at current only Strip provide public config.
|
|
26162
|
+
*
|
|
25854
26163
|
* Returns: Public config
|
|
25855
26164
|
*/
|
|
25856
26165
|
this.getPaymentProviderPublicConfig = (paymentProvider, region, sandbox) => {
|
|
@@ -25861,7 +26170,10 @@ class PaymentApi {
|
|
|
25861
26170
|
});
|
|
25862
26171
|
};
|
|
25863
26172
|
/**
|
|
26173
|
+
* GET [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/status](api)
|
|
26174
|
+
*
|
|
25864
26175
|
* Check payment order paid status.
|
|
26176
|
+
*
|
|
25865
26177
|
* Returns: Payment order paid result
|
|
25866
26178
|
*/
|
|
25867
26179
|
this.getPaymentOrderStatus = (paymentOrderNo) => {
|
|
@@ -25875,7 +26187,10 @@ class PaymentApi {
|
|
|
25875
26187
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentMethods({ paymentOrderNo });
|
|
25876
26188
|
};
|
|
25877
26189
|
/**
|
|
26190
|
+
* GET [/platform/public/namespaces/{namespace}/payment/methods](api)
|
|
26191
|
+
*
|
|
25878
26192
|
* Check and get a payment order's should pay tax.
|
|
26193
|
+
*
|
|
25879
26194
|
* Returns: tax result
|
|
25880
26195
|
*/
|
|
25881
26196
|
this.getPaymentTax = (paymentProvider, paymentOrderNo, zipCode) => {
|
|
@@ -25886,7 +26201,10 @@ class PaymentApi {
|
|
|
25886
26201
|
});
|
|
25887
26202
|
};
|
|
25888
26203
|
/**
|
|
26204
|
+
* POST [/platform/public/namespaces/{namespace}/payment/link](api)
|
|
26205
|
+
*
|
|
25889
26206
|
* Get payment url.
|
|
26207
|
+
*
|
|
25890
26208
|
* Returns: Get payment link
|
|
25891
26209
|
*/
|
|
25892
26210
|
this.createPaymentUrl = (data) => {
|
|
@@ -26143,56 +26461,73 @@ class SubscriptionApi {
|
|
|
26143
26461
|
this.conf = conf;
|
|
26144
26462
|
this.namespace = namespace;
|
|
26145
26463
|
this.cache = cache;
|
|
26146
|
-
|
|
26147
|
-
|
|
26148
|
-
|
|
26149
|
-
|
|
26150
|
-
|
|
26151
|
-
|
|
26152
|
-
|
|
26153
|
-
|
|
26154
|
-
|
|
26155
|
-
|
|
26156
|
-
|
|
26157
|
-
|
|
26158
|
-
|
|
26159
|
-
|
|
26160
|
-
|
|
26161
|
-
|
|
26162
|
-
|
|
26163
|
-
|
|
26164
|
-
|
|
26165
|
-
|
|
26166
|
-
|
|
26167
|
-
|
|
26168
|
-
|
|
26169
|
-
|
|
26170
|
-
|
|
26171
|
-
|
|
26172
|
-
|
|
26173
|
-
|
|
26174
|
-
|
|
26175
|
-
|
|
26176
|
-
|
|
26177
|
-
|
|
26178
|
-
|
|
26179
|
-
|
|
26180
|
-
|
|
26181
|
-
|
|
26182
|
-
|
|
26183
|
-
|
|
26184
|
-
|
|
26185
|
-
|
|
26186
|
-
|
|
26187
|
-
|
|
26188
|
-
|
|
26189
|
-
|
|
26190
|
-
|
|
26191
|
-
|
|
26192
|
-
|
|
26193
|
-
|
|
26194
|
-
|
|
26195
|
-
|
|
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
|
+
};
|
|
26196
26531
|
}
|
|
26197
26532
|
newInstance() {
|
|
26198
26533
|
return new Subscription$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -26359,9 +26694,12 @@ class WalletApi {
|
|
|
26359
26694
|
this.namespace = namespace;
|
|
26360
26695
|
this.cache = cache;
|
|
26361
26696
|
/**
|
|
26697
|
+
* GET [/platform/public/namespaces/{namespace}/users/me/wallets/{currencyCode}](api)
|
|
26698
|
+
*
|
|
26362
26699
|
* get my wallet by currency code and namespace.
|
|
26363
26700
|
*
|
|
26364
26701
|
* Returns: wallet info
|
|
26702
|
+
*
|
|
26365
26703
|
* Path's namespace:
|
|
26366
26704
|
* - can be filled with __publisher namespace__ in order to get __publisher user wallet__
|
|
26367
26705
|
* - can be filled with __game namespace__ in order to get __game user wallet__
|
|
@@ -26370,7 +26708,10 @@ class WalletApi {
|
|
|
26370
26708
|
return this.newInstance().fetchNsUsersMeWalletsByCurrencycode(currencyCode);
|
|
26371
26709
|
};
|
|
26372
26710
|
/**
|
|
26711
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/wallets/{currencyCode}](api)
|
|
26712
|
+
*
|
|
26373
26713
|
* Get a wallet by currency code.
|
|
26714
|
+
*
|
|
26374
26715
|
* Returns: wallet info
|
|
26375
26716
|
*/
|
|
26376
26717
|
this.getWalletByUserId = (userId, currencyCode) => {
|
|
@@ -26378,6 +26719,7 @@ class WalletApi {
|
|
|
26378
26719
|
};
|
|
26379
26720
|
/**
|
|
26380
26721
|
* get a map of wallet represented by its currency code
|
|
26722
|
+
* @internal
|
|
26381
26723
|
*/
|
|
26382
26724
|
this.getWalletMap = async ({ userId, currencyCodes }) => {
|
|
26383
26725
|
try {
|