@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.
@@ -9541,6 +9541,8 @@ class FileUploadApi {
9541
9541
  this.conf = conf;
9542
9542
  this.namespace = namespace;
9543
9543
  /**
9544
+ * POST [/basic/v1/public/namespaces/{namespace}/folders/{folder}/files](api)
9545
+ *
9544
9546
  * Generate an upload URL. It's valid for 10 minutes.
9545
9547
  * Returns: URL data
9546
9548
  */
@@ -9663,12 +9665,18 @@ class MiscApi {
9663
9665
  this.namespace = namespace;
9664
9666
  this.cache = cache;
9665
9667
  /**
9666
- * List countries.
9667
- * - _Returns_: country code list
9668
+ * GET [/basic/v1/public/namespaces/{namespace}/misc/countries](api)
9669
+ *
9670
+ * _Returns_: country code list
9668
9671
  */
9669
9672
  this.getCountries = (lang) => {
9670
9673
  return this.newInstance().fetchV1NsMiscCountries({ lang });
9671
9674
  };
9675
+ /**
9676
+ * GET [/basic/v1/public/namespaces/{namespace}/misc/languages](api)
9677
+ *
9678
+ * _Returns_: language list
9679
+ */
9672
9680
  this.getLanguages = () => {
9673
9681
  return this.newInstance().fetchV1NsMiscLanguages();
9674
9682
  };
@@ -9758,9 +9766,10 @@ class NamespaceApi {
9758
9766
  this.namespace = namespace;
9759
9767
  this.cache = cache;
9760
9768
  /**
9769
+ * GET [/basic/v1/public/namespaces](api)
9770
+ *
9761
9771
  * Get all namespaces.
9762
9772
  *
9763
- * Other detail info:
9764
9773
  * - _Required permission_: login user
9765
9774
  * - _Action code_: 11303
9766
9775
  * - _Returns_: list of namespaces
@@ -10070,6 +10079,8 @@ class UserProfileApi {
10070
10079
  this.namespace = namespace;
10071
10080
  this.cache = cache;
10072
10081
  /**
10082
+ * GET [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
10083
+ *
10073
10084
  * Get my profile
10074
10085
  *
10075
10086
  * __Client with user token can get user profile in target namespace__
@@ -10078,6 +10089,8 @@ class UserProfileApi {
10078
10089
  return this.newInstance().fetchV1NsUsersMeProfiles();
10079
10090
  };
10080
10091
  /**
10092
+ * POST [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
10093
+ *
10081
10094
  * Create my profile.
10082
10095
  *
10083
10096
  * __Client with user token can create user profile in target namespace__
@@ -10086,6 +10099,8 @@ class UserProfileApi {
10086
10099
  return this.newInstance().postV1NsUsersMeProfiles(data);
10087
10100
  };
10088
10101
  /**
10102
+ * PUT [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
10103
+ *
10089
10104
  * Update my profile.
10090
10105
  * 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.
10091
10106
  */
@@ -10093,6 +10108,8 @@ class UserProfileApi {
10093
10108
  return this.newInstance().putV1NsUsersMeProfiles(data);
10094
10109
  };
10095
10110
  /**
10111
+ * PUT [/basic/v1/public/namespaces/{namespace}/users/{userId}/profiles/customAttributes](api)
10112
+ *
10096
10113
  * Update partially custom attributes tied to user id.
10097
10114
  * _Returns_: Updated custom attributes
10098
10115
  */
@@ -10161,16 +10178,17 @@ class CachingApi {
10161
10178
  constructor(conf, namespace) {
10162
10179
  this.conf = conf;
10163
10180
  this.namespace = namespace;
10164
- }
10165
- /**
10166
- * This API is used to retrieve detailed diff cache.
10167
- * The response will contains list of diff cache files along with its download url.
10168
- *
10169
- * Other detail info:
10170
- * - _Required permission_: login user
10171
- */
10172
- getDiffCache(sourceBuildId, destinationBuildId) {
10173
- return this.newInstance().fetchNsDiffCacheSourceBySourcebuildidDestByDestinationbuildid(sourceBuildId, destinationBuildId);
10181
+ /**
10182
+ * GET [/buildinfo/public/namespaces/{namespace}/diff/cache/source/{sourceBuildId}/dest/{destinationBuildId}](api)
10183
+ *
10184
+ * This API is used to retrieve detailed diff cache.
10185
+ * The response will contains list of diff cache files along with its download url.
10186
+ *
10187
+ * _Required permission_: login user
10188
+ */
10189
+ this.getDiffCache = (sourceBuildId, destinationBuildId) => {
10190
+ return this.newInstance().fetchNsDiffCacheSourceBySourcebuildidDestByDestinationbuildid(sourceBuildId, destinationBuildId);
10191
+ };
10174
10192
  }
10175
10193
  newInstance() {
10176
10194
  // this is expensive to cache, apply "cache: false"
@@ -10344,21 +10362,26 @@ class DlcApi {
10344
10362
  constructor(conf, namespace) {
10345
10363
  this.conf = conf;
10346
10364
  this.namespace = namespace;
10347
- }
10348
- /**
10349
- * Retrieve the list of DLC available on specific game. Use game's appId to query.
10350
- *
10351
- * - _Returns_: list of DLC
10352
- */
10353
- getLatestDLCByGameAppId(appId) {
10354
- return this.newInstance().fetchNsDlcsLatestByGameAppIdByAppid(appId);
10355
- }
10356
- /**
10357
- * Retrieve the list of DLC available on specific game. Use DLC's appId to query.
10358
- * - _Returns_: appId of game and list of its builds by platformId
10359
- */
10360
- getBaseGamesByDlcAppId(dlcAppId) {
10361
- return this.newInstance().fetchNsAppsLatestByDlcAppIdByDlcappid(dlcAppId);
10365
+ /**
10366
+ * GET [/buildinfo/public/namespaces/{namespace}/dlcs/latest/byGameAppId/{appId}](api)
10367
+ *
10368
+ * Retrieve the list of DLC available on specific game. Use game's appId to query.
10369
+ *
10370
+ * _Returns_: list of DLC
10371
+ */
10372
+ this.getLatestDLCByGameAppId = (appId) => {
10373
+ return this.newInstance().fetchNsDlcsLatestByGameAppIdByAppid(appId);
10374
+ };
10375
+ /**
10376
+ * GET [/buildinfo/public/namespaces/{namespace}/apps/latest/byDLCAppId/{dlcAppId}](api)
10377
+ *
10378
+ * Retrieve the list of DLC available on specific game. Use DLC's appId to query.
10379
+ *
10380
+ * _Returns_: appId of game and list of its builds by platformId
10381
+ */
10382
+ this.getBaseGamesByDlcAppId = (dlcAppId) => {
10383
+ return this.newInstance().fetchNsAppsLatestByDlcAppIdByDlcappid(dlcAppId);
10384
+ };
10362
10385
  }
10363
10386
  newInstance() {
10364
10387
  // this is be expensive to cache, apply "cache: false"
@@ -10725,66 +10748,76 @@ class DownloaderApi {
10725
10748
  constructor(conf, namespace) {
10726
10749
  this.conf = conf;
10727
10750
  this.namespace = namespace;
10728
- }
10729
- /**
10730
- * This API is used to get simple build manifest that contains list of current build in various platform.
10731
- * Other detail info:
10732
- * - _Required permission_: login user
10733
- * - _Returns_: build manifest
10734
- */
10735
- getAvailableBuilds(appId) {
10736
- return this.newInstance().fetchNsAvailablebuildsByAppid(appId);
10737
- }
10738
- /**
10739
- * This API is used to get build manifest of release version of the application.
10740
- *
10741
- * Other detail info:
10742
- * - _Required permission_: login user
10743
- * - _Returns_: build manifest
10744
- */
10745
- getBuildManifest(appId, platformId) {
10746
- const axios = Network.create({ ...this.conf, timeout: 1800000 });
10747
- return new Downloader$(axios, this.namespace, false).fetchNsV2UpdategameByAppidByPlatformid(appId, platformId);
10748
- }
10749
- /**
10750
- * This API is used to retrieve detailed diff cache.
10751
- * The response will contains list of diff cache files along with its download url.
10752
- *
10753
- * - _Required permission_: login user
10754
- */
10755
- getDiffCache(sourceBuildId, destinationBuildId) {
10756
- return new Caching$(Network.create(this.conf), this.namespace, false).fetchNsDiffCacheSourceBySourcebuildidDestByDestinationbuildid(sourceBuildId, destinationBuildId);
10757
- }
10758
- /**
10759
- * Check which platform is available for the user to download the game
10760
- */
10761
- getMatchPlatform({ buildsAvailability, userPlatform }) {
10762
- const availablePlatformID = new Set();
10763
- for (const buildAvailability of buildsAvailability) {
10764
- if (buildAvailability.platformId) {
10765
- availablePlatformID.add(buildAvailability.platformId);
10751
+ /**
10752
+ * GET [/buildinfo/public/namespaces/{namespace}/availablebuilds/{appId}](api)
10753
+ *
10754
+ * This API is used to get simple build manifest that contains list of current build in various platform.
10755
+ *
10756
+ * - _Required permission_: login user
10757
+ * - _Returns_: build manifest
10758
+ */
10759
+ this.getAvailableBuilds = (appId) => {
10760
+ return this.newInstance().fetchNsAvailablebuildsByAppid(appId);
10761
+ };
10762
+ /**
10763
+ * GET [/buildinfo/public/namespaces/{namespace}/v2/updategame/{appId}/{platformId}](api)
10764
+ *
10765
+ * This API is used to get build manifest of release version of the application.
10766
+ *
10767
+ * - _Required permission_: login user
10768
+ * - _Returns_: build manifest
10769
+ */
10770
+ this.getBuildManifest = (appId, platformId) => {
10771
+ const axios = Network.create({ ...this.conf, timeout: 1800000 });
10772
+ return new Downloader$(axios, this.namespace, false).fetchNsV2UpdategameByAppidByPlatformid(appId, platformId);
10773
+ };
10774
+ /**
10775
+ * GET [/buildinfo/public/namespaces/{namespace}/diff/cache/source/{sourceBuildId}/dest/{destinationBuildId}](api)
10776
+ *
10777
+ * This API is used to retrieve detailed diff cache.
10778
+ * The response will contains list of diff cache files along with its download url.
10779
+ *
10780
+ * - _Required permission_: login user
10781
+ */
10782
+ this.getDiffCache = (sourceBuildId, destinationBuildId) => {
10783
+ return new Caching$(Network.create(this.conf), this.namespace, false).fetchNsDiffCacheSourceBySourcebuildidDestByDestinationbuildid(sourceBuildId, destinationBuildId);
10784
+ };
10785
+ /**
10786
+ * Check which platform is available for the user to download the game
10787
+ *
10788
+ * @internal
10789
+ */
10790
+ this.getMatchPlatform = ({ buildsAvailability, userPlatform }) => {
10791
+ const availablePlatformID = new Set();
10792
+ for (const buildAvailability of buildsAvailability) {
10793
+ if (buildAvailability.platformId) {
10794
+ availablePlatformID.add(buildAvailability.platformId);
10795
+ }
10766
10796
  }
10767
- }
10768
- const currentMatchPlatform = this.getCurrentPlatform(userPlatform);
10769
- if (currentMatchPlatform) {
10770
- for (const key in currentMatchPlatform.targetPlatform) {
10771
- if (availablePlatformID.has(currentMatchPlatform.targetPlatform[key])) {
10772
- return currentMatchPlatform.targetPlatform[key];
10797
+ const currentMatchPlatform = this.getCurrentPlatform(userPlatform);
10798
+ if (currentMatchPlatform) {
10799
+ for (const key in currentMatchPlatform.targetPlatform) {
10800
+ if (availablePlatformID.has(currentMatchPlatform.targetPlatform[key])) {
10801
+ return currentMatchPlatform.targetPlatform[key];
10802
+ }
10773
10803
  }
10774
10804
  }
10775
- }
10776
- return null;
10805
+ return null;
10806
+ };
10807
+ /**
10808
+ * @internal
10809
+ */
10810
+ this.getCurrentPlatform = (userPlatform) => {
10811
+ const devicePlatform = userPlatform.platform;
10812
+ const deviceArch = userPlatform.arch;
10813
+ const currentPlatform = AvailablePlatform.find((platform) => platform.platform === devicePlatform && platform.arch.includes(deviceArch));
10814
+ return currentPlatform;
10815
+ };
10777
10816
  }
10778
10817
  newInstance() {
10779
10818
  // this is be expensive to cache, apply "cache: false"
10780
10819
  return new Downloader$(Network.create(this.conf), this.namespace, false);
10781
10820
  }
10782
- getCurrentPlatform(userPlatform) {
10783
- const devicePlatform = userPlatform.platform;
10784
- const deviceArch = userPlatform.arch;
10785
- const currentPlatform = AvailablePlatform.find((platform) => platform.platform === devicePlatform && platform.arch.includes(deviceArch));
10786
- return currentPlatform;
10787
- }
10788
10821
  }
10789
10822
 
10790
10823
  /*
@@ -10888,6 +10921,8 @@ class EventApi {
10888
10921
  this.namespace = namespace;
10889
10922
  this.cache = cache;
10890
10923
  /**
10924
+ * GET [/event/v2/public/namespaces/{namespace}/users/{userId}/edithistory](api)
10925
+ *
10891
10926
  * Available Type:
10892
10927
  * - email
10893
10928
  * - password
@@ -10896,7 +10931,7 @@ class EventApi {
10896
10931
  * - country
10897
10932
  * - language
10898
10933
  *
10899
- * Requires a valid user access token
10934
+ * _Requires a valid user access token_
10900
10935
  */
10901
10936
  this.getAccountHistoryByUserId = ({ userId, queryParams }) => {
10902
10937
  return this.newInstance().fetchEventV2NsUsersByUseridEdithistory(userId, queryParams);
@@ -10990,27 +11025,36 @@ class DataDeletionApi {
10990
11025
  this.conf = conf;
10991
11026
  this.namespace = namespace;
10992
11027
  this.cache = cache;
10993
- }
10994
- /**
10995
- * Fetch the status to check whether or not a user's account is on a deletion status
10996
- * Requires valid user access token
10997
- */
10998
- getGdprDeletionStatus(userId) {
10999
- return this.newInstance().fetchGdprNsUsersByUseridDeletionsStatus(userId);
11000
- }
11001
- /**
11002
- * Request an account's deletion
11003
- * Requires valid user access token and password
11004
- */
11005
- requestAccountDeletion({ userId, data }) {
11006
- return this.newInstance().postGdprNsUsersByUseridDeletions(userId, data);
11007
- }
11008
- /**
11009
- * Cancel a deletion request
11010
- * Requires valid user access token
11011
- */
11012
- cancelAccountDeletion(userId) {
11013
- return this.newInstance().deleteGdprNsUsersByUseridDeletions(userId);
11028
+ /**
11029
+ * GET [/gdpr/public/namespaces/{namespace}/users/{userId}/deletions/status](api)
11030
+ *
11031
+ * Fetch the status to check whether or not a user's account is on a deletion status
11032
+ *
11033
+ * _Requires a valid user access token_
11034
+ */
11035
+ this.getGdprDeletionStatus = (userId) => {
11036
+ return this.newInstance().fetchGdprNsUsersByUseridDeletionsStatus(userId);
11037
+ };
11038
+ /**
11039
+ * POST [/gdpr/public/namespaces/{namespace}/users/{userId}/deletions](api)
11040
+ *
11041
+ * Request an account's deletion
11042
+ *
11043
+ * _Requires a valid user access token and password_
11044
+ */
11045
+ this.requestAccountDeletion = ({ userId, data }) => {
11046
+ return this.newInstance().postGdprNsUsersByUseridDeletions(userId, data);
11047
+ };
11048
+ /**
11049
+ * DELETE [/gdpr/public/namespaces/{namespace}/users/{userId}/deletions](api)
11050
+ *
11051
+ * Cancel a deletion request
11052
+ *
11053
+ * _Requires a valid user access token_
11054
+ */
11055
+ this.cancelAccountDeletion = (userId) => {
11056
+ return this.newInstance().deleteGdprNsUsersByUseridDeletions(userId);
11057
+ };
11014
11058
  }
11015
11059
  newInstance() {
11016
11060
  return new DataDeletion$(Network.create(this.conf), this.namespace, this.cache);
@@ -11131,34 +11175,46 @@ class DataRetrievalApi {
11131
11175
  this.conf = conf;
11132
11176
  this.namespace = namespace;
11133
11177
  this.cache = cache;
11134
- }
11135
- /**
11136
- * Fetch personal data request list
11137
- * Requires valid user access token
11138
- */
11139
- getGdprDataRequestList({ userId, queryParams }) {
11140
- return this.newInstance().fetchGdprNsUsersByUseridRequests(userId, queryParams);
11141
- }
11142
- /**
11143
- * Create a request for personal data download
11144
- * Requires valid user access token
11145
- */
11146
- requestGdprData({ userId, data }) {
11147
- return this.newInstance().postGdprNsUsersByUseridRequests(userId, data);
11148
- }
11149
- /**
11150
- * Cancel the request for personal data dowwnload
11151
- * Requires valid user access token
11152
- */
11153
- cancelGdprDataRequest({ userId, requestDate }) {
11154
- return this.newInstance().deleteGdprNsUsersByUseridRequestsByRequestdate(userId, requestDate);
11155
- }
11156
- /**
11157
- * Create a download URL for personal data request
11158
- * Requires valid user access token
11159
- */
11160
- requestGdprDataDownloadUrl({ userId, requestDate, data }) {
11161
- return this.newInstance().postGdprNsUsersByUseridRequestsByRequestdateGenerate(userId, requestDate, data);
11178
+ /**
11179
+ * GET [/gdpr/public/namespaces/{namespace}/users/{userId}/requests](api)
11180
+ *
11181
+ * Fetch personal data request list
11182
+ *
11183
+ * _Requires a valid user access token_
11184
+ */
11185
+ this.getGdprDataRequestList = ({ userId, queryParams }) => {
11186
+ return this.newInstance().fetchGdprNsUsersByUseridRequests(userId, queryParams);
11187
+ };
11188
+ /**
11189
+ * POST [/gdpr/public/namespaces/{namespace}/users/{userId}/requests](api)
11190
+ *
11191
+ * Create a request for personal data download
11192
+ *
11193
+ * _Requires a valid user access token_
11194
+ */
11195
+ this.requestGdprData = ({ userId, data }) => {
11196
+ return this.newInstance().postGdprNsUsersByUseridRequests(userId, data);
11197
+ };
11198
+ /**
11199
+ * DELETE [/gdpr/public/namespaces/{namespace}/users/{userId}/requests/{requestDate}](api)
11200
+ *
11201
+ * Cancel the request for personal data download
11202
+ *
11203
+ * _Requires a valid user access token_
11204
+ */
11205
+ this.cancelGdprDataRequest = ({ userId, requestDate }) => {
11206
+ return this.newInstance().deleteGdprNsUsersByUseridRequestsByRequestdate(userId, requestDate);
11207
+ };
11208
+ /**
11209
+ * POST [/gdpr/public/namespaces/{namespace}/users/{userId}/requests/{requestDate}/generate](api)
11210
+ *
11211
+ * Create a download URL for personal data request
11212
+ *
11213
+ * _Requires a valid user access token_
11214
+ */
11215
+ this.requestGdprDataDownloadUrl = ({ userId, requestDate, data }) => {
11216
+ return this.newInstance().postGdprNsUsersByUseridRequestsByRequestdateGenerate(userId, requestDate, data);
11217
+ };
11162
11218
  }
11163
11219
  newInstance() {
11164
11220
  return new DataRetrieval$(Network.create(this.conf), this.namespace, this.cache);
@@ -11251,10 +11307,11 @@ class InputValidationsApi {
11251
11307
  this.namespace = namespace;
11252
11308
  this.cache = cache;
11253
11309
  /**
11310
+ * GET [/iam/v3/public/inputValidations](api)
11311
+ *
11254
11312
  * No role required
11255
11313
  * This method is to get list of input validation configuration.
11256
11314
  * `regex` parameter will be returned if `isCustomRegex` is true. Otherwise, it will be empty.
11257
- *
11258
11315
  */
11259
11316
  this.getValidations = (languageCode, defaultOnEmpty) => {
11260
11317
  const queryParams = { languageCode, defaultOnEmpty };
@@ -20230,6 +20287,8 @@ class UserAuthorizationApi {
20230
20287
  this.cache = cache;
20231
20288
  this.options = options;
20232
20289
  /**
20290
+ * POST: [/iam/v3/oauth/token](api)
20291
+ *
20233
20292
  * This method supports grant type:
20234
20293
  * - Grant Type == `authorization_code`:
20235
20294
  *     It generates the user token by given the authorization
@@ -20336,6 +20395,9 @@ class UserAuthorizationApi {
20336
20395
  CodeChallenge.clear();
20337
20396
  return { ...result, mfaData };
20338
20397
  };
20398
+ /**
20399
+ * @internal
20400
+ */
20339
20401
  this.getMfaDataFromError = (errorResponse) => {
20340
20402
  const doesMFADataExist = Validate.safeParse(errorResponse.data, MFADataResponse);
20341
20403
  if (!doesMFADataExist)
@@ -20347,13 +20409,44 @@ class UserAuthorizationApi {
20347
20409
  }
20348
20410
  return result;
20349
20411
  };
20412
+ /**
20413
+ * @internal
20414
+ */
20350
20415
  this.getMfaDataFromStorage = () => {
20351
20416
  const storedMFAData = BrowserHelper.isOnBrowser() && localStorage.getItem(MFA_DATA_STORAGE_KEY);
20352
20417
  return storedMFAData ? JSON.parse(storedMFAData) : null;
20353
20418
  };
20419
+ /**
20420
+ * @internal
20421
+ */
20354
20422
  this.removeMfaDataFromStorage = () => {
20355
20423
  localStorage.removeItem(MFA_DATA_STORAGE_KEY);
20356
20424
  };
20425
+ /**
20426
+ * @internal
20427
+ */
20428
+ this.matchReceivedState = (maybeSentState) => {
20429
+ const sentStateResult = CodeChallenge.parseSentState(maybeSentState);
20430
+ if (sentStateResult.error)
20431
+ return { error: sentStateResult.error, result: null };
20432
+ const storedStateResult = CodeChallenge.load();
20433
+ if (storedStateResult.error)
20434
+ return { error: storedStateResult.error, result: null };
20435
+ const sentState = sentStateResult.sentState;
20436
+ const storedState = storedStateResult.storedState;
20437
+ if (sentState.csrf !== storedState.csrf)
20438
+ return { error: null, result: null };
20439
+ return {
20440
+ error: null,
20441
+ result: {
20442
+ payload: sentState.payload,
20443
+ codeVerifier: storedState.codeVerifier
20444
+ }
20445
+ };
20446
+ };
20447
+ /**
20448
+ * @internal
20449
+ */
20357
20450
  this.deduceLoginError = (error) => {
20358
20451
  switch (error) {
20359
20452
  case LoginErrorParam.Enum.login_session_expired:
@@ -20395,6 +20488,11 @@ class UserAuthorizationApi {
20395
20488
  returnPath
20396
20489
  };
20397
20490
  };
20491
+ /**
20492
+ * GET [/iam/v3/oauth/authorize](api)
20493
+ *
20494
+ * Creates a URL to be used for Login, Register, Link to existing account or Twitch Link
20495
+ */
20398
20496
  this.createLoginURL = (returnPath, targetAuthPage, oneTimeLinkCode) => {
20399
20497
  const { verifier, challenge } = CodeChallenge.generateChallenge();
20400
20498
  const csrf = CodeChallenge.generateCsrf();
@@ -20418,6 +20516,11 @@ class UserAuthorizationApi {
20418
20516
  const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
20419
20517
  return url.toString();
20420
20518
  };
20519
+ /**
20520
+ * GET [/iam/v3/oauth/authorize](api)
20521
+ *
20522
+ * Creates a URL to be used for password recovery
20523
+ */
20421
20524
  this.createForgotPasswordURL = () => {
20422
20525
  const { verifier, challenge } = CodeChallenge.generateChallenge();
20423
20526
  const csrf = CodeChallenge.generateCsrf();
@@ -20436,9 +20539,15 @@ class UserAuthorizationApi {
20436
20539
  const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
20437
20540
  return url.toString();
20438
20541
  };
20542
+ /**
20543
+ * @internal
20544
+ */
20439
20545
  this.getCodeChallenge = () => {
20440
20546
  return CodeChallenge.generateChallenge();
20441
20547
  };
20548
+ /**
20549
+ * @internal
20550
+ */
20442
20551
  this.refreshToken = () => {
20443
20552
  const { clientId, refreshToken } = this.options;
20444
20553
  if (DesktopChecker.isDesktopApp()) {
@@ -20446,6 +20555,9 @@ class UserAuthorizationApi {
20446
20555
  }
20447
20556
  return refreshWithLock({ axiosConfig: this.conf, clientId });
20448
20557
  };
20558
+ /**
20559
+ * @internal
20560
+ */
20449
20561
  this.getSearchParams = (sentState, challenge) => {
20450
20562
  const searchParams = new URLSearchParams();
20451
20563
  searchParams.append('response_type', 'code');
@@ -20457,25 +20569,6 @@ class UserAuthorizationApi {
20457
20569
  return searchParams;
20458
20570
  };
20459
20571
  }
20460
- matchReceivedState(maybeSentState) {
20461
- const sentStateResult = CodeChallenge.parseSentState(maybeSentState);
20462
- if (sentStateResult.error)
20463
- return { error: sentStateResult.error, result: null };
20464
- const storedStateResult = CodeChallenge.load();
20465
- if (storedStateResult.error)
20466
- return { error: storedStateResult.error, result: null };
20467
- const sentState = sentStateResult.sentState;
20468
- const storedState = storedStateResult.storedState;
20469
- if (sentState.csrf !== storedState.csrf)
20470
- return { error: null, result: null };
20471
- return {
20472
- error: null,
20473
- result: {
20474
- payload: sentState.payload,
20475
- codeVerifier: storedState.codeVerifier
20476
- }
20477
- };
20478
- }
20479
20572
  }
20480
20573
  function isAxiosError(error) {
20481
20574
  return !!error && !!error.config;
@@ -20884,6 +20977,14 @@ class OAuthApi {
20884
20977
  this.cache = cache;
20885
20978
  this.options = options;
20886
20979
  /**
20980
+ * @internal
20981
+ */
20982
+ this.newOAuth20Extension = () => {
20983
+ return new OAuth20Extension$(Network.create(this.conf), this.namespace, this.cache);
20984
+ };
20985
+ /**
20986
+ * POST [/iam/v3/logout](api)
20987
+ *
20887
20988
  * This method is used to remove __access_token__, __refresh_token__ from cookie and revoke token from usage.
20888
20989
  * Supported methods:
20889
20990
  * - VerifyToken to verify token from header
@@ -20899,6 +21000,8 @@ class OAuthApi {
20899
21000
  return new OAuth20Extension$(axios, this.namespace, this.cache).postIamV3Logout();
20900
21001
  };
20901
21002
  /**
21003
+ * POST [/iam/v3/oauth/revoke](api)
21004
+ *
20902
21005
  * This method revokes a token.
20903
21006
  * This method requires authorized requests header with Basic Authentication from client that establish the token.action code: 10706
20904
21007
  */
@@ -20914,6 +21017,8 @@ class OAuthApi {
20914
21017
  return new OAuth20$(axios, this.namespace, this.cache).postIamV3OauthRevoke({ token });
20915
21018
  };
20916
21019
  /**
21020
+ * POST [/iam/v3/oauth/mfa/verify](api)
21021
+ *
20917
21022
  * Verify 2FA code
20918
21023
  * This method is used for verifying 2FA code.
20919
21024
  * ##2FA remember device
@@ -20929,6 +21034,9 @@ class OAuthApi {
20929
21034
  localStorage.removeItem(MFA_DATA_STORAGE_KEY);
20930
21035
  return result.response;
20931
21036
  };
21037
+ /**
21038
+ * POST [/iam/v3/oauth/mfa/code](api)
21039
+ */
20932
21040
  this.request2FAEmailCode = async ({ mfaToken = null, factor }) => {
20933
21041
  const result = await this.newInstance().postIamV3OauthMfaCode({ mfaToken, clientId: this.options.clientId, factor });
20934
21042
  if (result.error)
@@ -20936,12 +21044,16 @@ class OAuthApi {
20936
21044
  return result.response;
20937
21045
  };
20938
21046
  /**
21047
+ * GET [/iam/v3/location/country](api)
21048
+ *
20939
21049
  * This method get country location based on the request.
20940
21050
  */
20941
21051
  this.getCurrentLocationCountry = () => {
20942
21052
  return this.newOAuth20Extension().fetchIamV3LocationCountry();
20943
21053
  };
20944
21054
  /**
21055
+ * GET [/iam/v3/oauth/namespaces/{namespace}/users/{userId}/platforms/{platformId}/platformToken](api)
21056
+ *
20945
21057
  * Retrieve User Third Party Platform Token
20946
21058
  *
20947
21059
  * This method used for retrieving third party platform token for user that login using third party,
@@ -20961,6 +21073,8 @@ class OAuthApi {
20961
21073
  return this.newInstance().fetchV3OauthUsersByUseridPlatformsByPlatformidPlatformToken(userId, platformId);
20962
21074
  };
20963
21075
  /**
21076
+ * POST [/iam/v3/authenticateWithLink](api)
21077
+ *
20964
21078
  * This method is being used to authenticate a user account and perform platform link.
20965
21079
  * It validates user's email / username and password.
20966
21080
  * If user already enable 2FA, then invoke _/mfa/verify_ using __mfa_token__ from this method response.
@@ -20975,31 +21089,27 @@ class OAuthApi {
20975
21089
  this.authenticateWithLink = (data) => {
20976
21090
  return this.newOAuth20Extension().postIamV3AuthenticateWithLink(data);
20977
21091
  };
20978
- }
20979
- /**
20980
- * @internal
20981
- */
20982
- newOAuth20Extension() {
20983
- return new OAuth20Extension$(Network.create(this.conf), this.namespace, this.cache);
20984
- }
20985
- /**
20986
- * This method is being used to validate one time link code.
20987
- * It require a valid user token.
20988
- * Should specify the target platform id and current user should already linked to this platform.
20989
- * Current user should be a headless account.
20990
- *
20991
- */
20992
- validateOneTimeLinkCode(data) {
20993
- return this.newOAuth20Extension().postIamV3LinkCodeValidate(data);
20994
- }
20995
- /**
20996
- * This method is being used to generate user's token by one time link code.
20997
- * It require publisher ClientID
20998
- * It required a code which can be generated from __/iam/v3/link/code/request__.
20999
- *
21000
- */
21001
- exchangeTokenByOneTimeLinkCode(data) {
21002
- return this.newOAuth20Extension().postIamV3LinkTokenExchange(data);
21092
+ /**
21093
+ * POST [/iam/v3/link/code/validate](api)
21094
+ *
21095
+ * This method is being used to validate one time link code.
21096
+ * It require a valid user token.
21097
+ * Should specify the target platform id and current user should already linked to this platform.
21098
+ * Current user should be a headless account.
21099
+ */
21100
+ this.validateOneTimeLinkCode = (data) => {
21101
+ return this.newOAuth20Extension().postIamV3LinkCodeValidate(data);
21102
+ };
21103
+ /**
21104
+ * POST [/iam/v3/link/token/exchange](api)
21105
+ *
21106
+ * This method is being used to generate user's token by one time link code.
21107
+ * It require publisher ClientID
21108
+ * It required a code which can be generated from __/iam/v3/link/code/request__.
21109
+ */
21110
+ this.exchangeTokenByOneTimeLinkCode = (data) => {
21111
+ return this.newOAuth20Extension().postIamV3LinkTokenExchange(data);
21112
+ };
21003
21113
  }
21004
21114
  newInstance() {
21005
21115
  return new OAuth20$(Network.create(this.conf), this.namespace, this.cache);
@@ -21078,6 +21188,8 @@ class ThirdPartyCredentialApi {
21078
21188
  this.namespace = namespace;
21079
21189
  this.cache = cache;
21080
21190
  /**
21191
+ * GET [/iam/v3/public/namespaces/{namespace}/platforms/clients/active](api)
21192
+ *
21081
21193
  * This is the Public API to Get All Active 3rd Platform Credential.
21082
21194
  */
21083
21195
  this.getThirdPartyPlatformInfo = () => {
@@ -21579,85 +21691,112 @@ class TwoFA {
21579
21691
  this.namespace = namespace;
21580
21692
  this.cache = cache;
21581
21693
  /**
21694
+ * GET [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode](api)
21695
+ *
21582
21696
  * This method is used to get 8-digits backup codes.
21583
21697
  * Each code is a one-time code and will be deleted once used.
21584
- * This method Requires valid user access token
21585
21698
  *
21699
+ * _Requires a valid user access token_
21586
21700
  */
21587
21701
  this.getBackupCode = () => {
21588
21702
  return this.newInstance().fetchV4NsUsersMeMfaBackupCode();
21589
21703
  };
21590
21704
  /**
21705
+ * POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode/enable](api)
21706
+ *
21591
21707
  * This method is used to enable 2FA backup codes.
21592
- * This method Requires valid user access token
21593
21708
  *
21709
+ * _Requires a valid user access token_
21594
21710
  */
21595
21711
  this.enable2FABackupCodes = () => {
21596
21712
  return this.newInstance().postV4NsUsersMeMfaBackupCodeEnable();
21597
21713
  };
21598
21714
  /**
21715
+ * POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode](api)
21716
+ *
21599
21717
  * This method is used to enable 2FA backup codes.
21600
- * This method Requires valid user access token
21601
21718
  *
21719
+ * _Requires a valid user access token_
21602
21720
  */
21603
21721
  this.generateBackupCodes = () => {
21604
21722
  return this.newInstance().postV4NsUsersMeMfaBackupCode();
21605
21723
  };
21606
21724
  /**
21725
+ * DELETE [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode/disable](api)
21726
+ *
21607
21727
  * This method is used to enable 2FA backup codes.
21608
- * This method Requires valid user access token
21609
21728
  *
21729
+ * _Requires a valid user access token_
21610
21730
  */
21611
21731
  this.disableBackupCodes = () => {
21612
21732
  return this.newInstance().deleteV4NsUsersMeMfaBackupCodeDisable();
21613
21733
  };
21614
21734
  /**
21735
+ * DELETE [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/disable](api)
21736
+ * }
21615
21737
  * This method is used to disable 2FA authenticator.
21616
- * This method Requires valid user access token
21617
21738
  *
21739
+ * _Requires a valid user access token_
21618
21740
  */
21619
21741
  this.disableAuthenticator = () => {
21620
21742
  return this.newInstance().deleteV4NsUsersMeMfaAuthenticatorDisable();
21621
21743
  };
21622
21744
  /**
21745
+ * GET [/iam/v4/public/namespaces/{namespace}/users/me/mfa/factor](api)
21746
+ *
21623
21747
  * This method is used to get user enabled factors.
21624
- * This method Requires valid user access token
21625
21748
  *
21749
+ * _Requires a valid user access token_
21626
21750
  */
21627
21751
  this.getEnabledMethods = () => {
21628
21752
  return this.newInstance().fetchV4NsUsersMeMfaFactor();
21629
21753
  };
21630
21754
  /**
21755
+ * POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/factor](api)
21756
+ *
21631
21757
  * This method is used to make 2FA factor default.
21632
- * This method Requires valid user access token
21633
21758
  *
21759
+ * _Requires a valid user access token_
21634
21760
  */
21635
21761
  this.set2FAAsDefault = (factor) => {
21636
21762
  return this.newInstance().postV4NsUsersMeMfaFactor({ factor });
21637
21763
  };
21638
21764
  /**
21765
+ * POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/enable](api)
21766
+ *
21639
21767
  * This method is used to enable 2FA authenticator.
21640
- * This method Requires valid user access token
21641
21768
  *
21769
+ * _Requires a valid user access token_
21642
21770
  */
21643
21771
  this.enable2FAAuthenticator = (code) => {
21644
21772
  return this.newInstance().postV4NsUsersMeMfaAuthenticatorEnable({ code });
21645
21773
  };
21646
21774
  /**
21775
+ * POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/key](api)
21776
+ *
21647
21777
  * This method is used to generate a secret key for 3rd-party authenticator app.
21648
21778
  * A QR code URI is also returned so that frontend can generate QR code image.
21649
- * This method Requires valid user access token
21650
21779
  *
21780
+ * _Requires a valid user access token_
21651
21781
  */
21652
21782
  this.generateSecretKey = () => {
21653
21783
  return this.newInstance().postV4NsUsersMeMfaAuthenticatorKey();
21654
21784
  };
21785
+ /**
21786
+ * POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/code](api)
21787
+ */
21655
21788
  this.requestEmailCode = () => {
21656
21789
  return this.newInstance().postV4NsUsersMeMfaEmailCode();
21657
21790
  };
21791
+ /**
21792
+ * POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/enable](api)
21793
+ */
21658
21794
  this.enableEmailMethod = (code) => {
21659
21795
  return this.newInstance().postV4NsUsersMeMfaEmailEnable({ code });
21660
21796
  };
21797
+ /**
21798
+ * POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/disable](api)
21799
+ */
21661
21800
  this.disableEmailMethod = () => {
21662
21801
  return this.newInstance().postV4NsUsersMeMfaEmailDisable();
21663
21802
  };
@@ -22871,30 +23010,40 @@ class UserApi {
22871
23010
  this.namespace = namespace;
22872
23011
  this.cache = cache;
22873
23012
  /**
22874
- * get currently logged in user
23013
+ * GET [/iam/v3/public/users/me](api)
23014
+ *
23015
+ * get currently logged-in user
22875
23016
  */
22876
23017
  this.getCurrentUser = () => {
22877
23018
  return this.newInstance().fetchIamV3PublicUsersMe();
22878
23019
  };
22879
23020
  /**
22880
- * update current user
23021
+ * PATCH [/iam/v3/public/namespaces/{namespace}/users/me](api)
23022
+ *
23023
+ * Update current user
22881
23024
  */
22882
23025
  this.updateUserMe = (data) => {
22883
23026
  return this.newInstance().patchV3NsUsersMe(data);
22884
23027
  };
22885
23028
  /**
23029
+ * PUT [/iam/v4/public/namespaces/{namespace}/users/me/email](api)
23030
+ *
22886
23031
  * update current user's email
22887
23032
  */
22888
23033
  this.updateEmailMe = (data) => {
22889
23034
  return this.newInstance4().putV4NsUsersMeEmail(data);
22890
23035
  };
22891
23036
  /**
23037
+ * PUT [/iam/v3/public/namespaces/{namespace}/users/me/password](api)
23038
+ *
22892
23039
  * update current user's password
22893
23040
  */
22894
23041
  this.updatePasswordMe = (data) => {
22895
23042
  return this.newInstance().putV3NsUsersMePassword(data);
22896
23043
  };
22897
23044
  /**
23045
+ * POST [/iam/v3/public/namespaces/{namespace}/users/me/code/request](api)
23046
+ *
22898
23047
  * Required valid user authorization
22899
23048
  * The verification code is sent to email address
22900
23049
  * Available contexts for use :
@@ -22917,6 +23066,8 @@ class UserApi {
22917
23066
  return this.newInstance().postV3NsUsersMeCodeRequest(data);
22918
23067
  };
22919
23068
  /**
23069
+ * POST [/iam/v3/public/namespaces/{namespace}/users/me/code/verify](api)
23070
+ *
22920
23071
  * Will consume code if validateOnly is set false
22921
23072
  * Required valid user authorization
22922
23073
  * Redeems a verification code sent to a user to verify the user's contact address is correct
@@ -22928,6 +23079,8 @@ class UserApi {
22928
23079
  return this.newInstance().postV3NsUsersMeCodeVerify(data);
22929
23080
  };
22930
23081
  /**
23082
+ * POST [/iam/v3/public/namespaces/{namespace}/users/me/headless/code/verify](api)
23083
+ *
22931
23084
  * If validateOnly is set false, consume code and upgrade headless account and automatically verified the email address if it is succeeded
22932
23085
  * Require valid user access token.
22933
23086
  * The method upgrades a headless account by linking the headless account with the email address and the password.
@@ -22947,6 +23100,8 @@ class UserApi {
22947
23100
  return this.newInstance().postV3NsUsersMeHeadlessCodeVerify(data);
22948
23101
  };
22949
23102
  /**
23103
+ * POST [/iam/v4/public/namespaces/{namespace}/users/me/headless/code/verify](api)
23104
+ *
22950
23105
  * Require valid user access token.
22951
23106
  * The method upgrades a headless account by linking the headless account with the email address, username, and password.
22952
23107
  * By upgrading the headless account into a full account, the user could use the email address, username, and password for using Justice IAM.
@@ -22966,13 +23121,17 @@ class UserApi {
22966
23121
  return this.newInstance4().postV4NsUsersMeHeadlessCodeVerify(data);
22967
23122
  };
22968
23123
  /**
23124
+ * GET [/iam/v3/public/namespaces/{namespace}/users/{userId}/platforms](api)
23125
+ *
22969
23126
  * This method retrieves platform accounts linked to user. Required valid user authorization.
22970
- * action code: 10128
23127
+ * action code: 10128
22971
23128
  */
22972
23129
  this.getUserLinkedPlatform = (userId) => {
22973
23130
  return this.newInstance().fetchV3NsUsersByUseridPlatforms(userId);
22974
23131
  };
22975
23132
  /**
23133
+ * POST [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}](api)
23134
+ *
22976
23135
  * Required valid user authorization.
22977
23136
  * __Prerequisite:__
22978
23137
  * Platform client configuration need to be added to database for specific platformId. Namespace service URL need to be specified (refer to required environment variables).
@@ -23002,22 +23161,26 @@ class UserApi {
23002
23161
  return this.newInstance().postV3NsUsersMePlatformsByPlatformid(platformId, data);
23003
23162
  };
23004
23163
  /**
23164
+ * GET [/iam/v3/public/namespaces/{namespace}/requests/{requestId}/async/status](api)
23165
+ *
23005
23166
  * Get the linking status between a third-party platform to a user
23006
23167
  */
23007
23168
  this.getLinkRequestStatus = (requestId) => {
23008
23169
  return this.newInstance().fetchV3NsRequestsByRequestidAsyncStatus(requestId);
23009
23170
  };
23010
23171
  /**
23172
+ * @internal
23011
23173
  * It is going to be __DEPRECATED__.
23012
23174
  * Update Platform Account relation to current User Account.
23013
23175
  * Note: Game progression data (statistics, reward, etc) associated with previous User Account will not be
23014
23176
  * transferred. If the data is tight to game user ID, the user will have the game progression data.
23015
- *
23016
23177
  */
23017
23178
  this.linkPlatformToUserAccount = ({ userId, data }) => {
23018
23179
  return this.newInstance().postV3NsUsersByUseridPlatformsLink(userId, data);
23019
23180
  };
23020
23181
  /**
23182
+ * DELETE [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}](api)
23183
+ *
23021
23184
  * Required valid user authorization.
23022
23185
  * ##Supported platforms:
23023
23186
  *
@@ -23050,110 +23213,123 @@ class UserApi {
23050
23213
  return this.newInstance().deleteV3NsUsersMePlatformsByPlatformid(platformId, data);
23051
23214
  };
23052
23215
  /**
23216
+ * GET [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}/web/link](api)
23217
+ *
23053
23218
  * This method is used to generate third party login page which will redirected to establish method.
23054
23219
  */
23055
23220
  this.getThirdPartyURL = ({ platformId, queryParams }) => {
23056
23221
  return this.newInstance().fetchV3NsUsersMePlatformsByPlatformidWebLink(platformId, queryParams);
23057
23222
  };
23058
23223
  /**
23224
+ * GET [/iam/v3/public/namespaces/{namespace}/agerestrictions/countries/{countryCode}](api)
23225
+ *
23059
23226
  * Get age restriction by country code. It will always get by publisher namespace
23060
23227
  */
23061
23228
  this.getAgeRestrictionByCountry = (countryCode) => {
23062
23229
  return this.newInstance().fetchV3NsAgerestrictionsCountriesByCountrycode(countryCode);
23063
23230
  };
23064
- }
23065
- /**
23066
- * Render 2D Avatar via readyplayer.me (https://docs.readyplayer.me/ready-player-me/avatars/2d-avatars/render-api)
23067
- */
23068
- renderImageFromGlbModel(data) {
23069
- const axios = Network.create({
23070
- ...this.conf
23071
- });
23072
- return Validate.responseType(() => axios.post('https://render.readyplayer.me/render', data), ReadyPlayerMe);
23073
- }
23074
- // TODO: evaluate the use of this method. It looks too generic for a function that should notify game SDK
23075
- notifyGameSDK(url) {
23076
- const axios = Network.create({
23077
- ...this.conf
23078
- });
23079
- return Validate.responseType(() => axios.get(url), mod.string());
23080
- }
23081
- /**
23082
- * This method will validate the request's email address.
23083
- *
23084
- * If it already been used, will response 409.
23085
- *
23086
- * If it is available, we will send a verification code to this email address.
23087
- */
23088
- requestNewUserVerificationCode(data) {
23089
- return this.newInstance().postV3NsUsersCodeRequest(data);
23090
- }
23091
- /**
23092
- * Create a new user with unique email address and username.
23093
- *
23094
- * __Required attributes:__
23095
- * - authType: possible value is EMAILPASSWD
23096
- * - emailAddress: Please refer to the rule from /v3/public/inputValidations API.
23097
- * - username: Please refer to the rule from /v3/public/inputValidations API.
23098
- * - password: Please refer to the rule from /v3/public/inputValidations API.
23099
- * - country: ISO3166-1 alpha-2 two letter, e.g. US.
23100
- * - dateOfBirth: YYYY-MM-DD, e.g. 1990-01-01. valid values are between 1905-01-01 until current date.
23101
- *
23102
- * __Not required attributes:__
23103
- * - displayName: Please refer to the rule from /v3/public/inputValidations API.
23104
- *
23105
- * This method support accepting agreements for the created user. Supply the accepted agreements in acceptedPolicies attribute.
23106
- *
23107
- */
23108
- createUser(data) {
23109
- return this.newInstance4().postV4NsUsers(data);
23110
- }
23111
- /**
23112
- * This method retrieves platform accounts linked to user.
23113
- * It will query all linked platform accounts and result will be distinct & grouped, same platform we will pick oldest linked one.
23114
- * Required valid user authorization.
23115
- */
23116
- getUserDistinctLinkedPlatform(userId) {
23117
- return this.newInstance().fetchV3NsUsersByUseridDistinctPlatforms(userId);
23118
- }
23119
- /**
23120
- * Required valid user authorization.
23121
- * Unlink user's account from for all third platforms.
23122
- */
23123
- unLinkAccountFromPlatformDistinct(platformId) {
23124
- return this.newInstance().deleteV3NsUsersMePlatformsByPlatformidAll(platformId);
23125
- }
23126
- /**
23127
- * Required valid user authorization
23128
- * The verification link is sent to email address
23129
- * It will not send request if user email is already verified
23130
- *
23131
- */
23132
- sendVerificationLink(languageTag) {
23133
- return this.newInstance().postIamV3PublicUsersMeVerifyLinkRequest({ languageTag });
23134
- }
23135
- /**
23136
- * This method retrieves platform accounts linked to user. Required valid user authorization.
23137
- * action code: 10128
23138
- */
23139
- getLinkedAccount(userId) {
23140
- return this.newInstance().fetchV3NsUsersByUseridPlatforms(userId);
23141
- }
23142
- /**
23143
- * Note:
23144
- * 1. My account should be full account
23145
- * 2. My account not linked to request headless account's third platform.
23146
- */
23147
- getLinkAccountByOneTimeCodeConflict(params) {
23148
- return this.newInstance().fetchIamV3PublicUsersMeHeadlessLinkConflict(params);
23149
- }
23150
- /**
23151
- * Note:
23152
- * 1. My account should be full account
23153
- * 2. My account not linked to headless account's third platform.
23154
- */
23155
- linkWithProgression(data) {
23156
- return this.newInstance().postIamV3PublicUsersMeHeadlessLinkWithProgression(data);
23231
+ /**
23232
+ * Render 2D Avatar via readyplayer.me POST [](https://docs.readyplayer.me/ready-player-me/avatars/2d-avatars/render-api)
23233
+ * @internal
23234
+ */
23235
+ this.renderImageFromGlbModel = (data) => {
23236
+ const axios = Network.create({
23237
+ ...this.conf
23238
+ });
23239
+ return Validate.responseType(() => axios.post('https://render.readyplayer.me/render', data), ReadyPlayerMe);
23240
+ };
23241
+ /**
23242
+ * POST [/iam/v3/public/namespaces/{namespace}/users/code/request](api)
23243
+ *
23244
+ * This method will validate the request's email address.
23245
+ *
23246
+ * If it already been used, will response 409.
23247
+ *
23248
+ * If it is available, we will send a verification code to this email address.
23249
+ */
23250
+ this.requestNewUserVerificationCode = (data) => {
23251
+ return this.newInstance().postV3NsUsersCodeRequest(data);
23252
+ };
23253
+ /**
23254
+ * POST [/iam/v4/public/namespaces/{namespace}/users](api)
23255
+ *
23256
+ * Create a new user with unique email address and username.
23257
+ *
23258
+ * __Required attributes:__
23259
+ * - authType: possible value is EMAILPASSWD
23260
+ * - emailAddress: Please refer to the rule from /v3/public/inputValidations API.
23261
+ * - username: Please refer to the rule from /v3/public/inputValidations API.
23262
+ * - password: Please refer to the rule from /v3/public/inputValidations API.
23263
+ * - country: ISO3166-1 alpha-2 two letter, e.g. US.
23264
+ * - dateOfBirth: YYYY-MM-DD, e.g. 1990-01-01. valid values are between 1905-01-01 until current date.
23265
+ *
23266
+ * __Not required attributes:__
23267
+ * - displayName: Please refer to the rule from /v3/public/inputValidations API.
23268
+ *
23269
+ * This method support accepting agreements for the created user. Supply the accepted agreements in acceptedPolicies attribute.
23270
+ *
23271
+ */
23272
+ this.createUser = (data) => {
23273
+ return this.newInstance4().postV4NsUsers(data);
23274
+ };
23275
+ /**
23276
+ * GET [/iam/v3/public/namespaces/{namespace}/users/{userId}/distinctPlatforms](api)
23277
+ *
23278
+ * This method retrieves platform accounts linked to user.
23279
+ * It will query all linked platform accounts and result will be distinct & grouped, same platform we will pick oldest linked one.
23280
+ * Required valid user authorization.
23281
+ */
23282
+ this.getUserDistinctLinkedPlatform = (userId) => {
23283
+ return this.newInstance().fetchV3NsUsersByUseridDistinctPlatforms(userId);
23284
+ };
23285
+ /**
23286
+ * DELETE [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}/all](api)
23287
+ *
23288
+ * Required valid user authorization.
23289
+ * Unlink user's account from for all third platforms.
23290
+ */
23291
+ this.unLinkAccountFromPlatformDistinct = (platformId) => {
23292
+ return this.newInstance().deleteV3NsUsersMePlatformsByPlatformidAll(platformId);
23293
+ };
23294
+ /**
23295
+ * POST [/iam/v3/public/users/me/verify_link/request](api)
23296
+ *
23297
+ * Required valid user authorization
23298
+ * The verification link is sent to email address
23299
+ * It will not send request if user email is already verified
23300
+ */
23301
+ this.sendVerificationLink = (languageTag) => {
23302
+ return this.newInstance().postIamV3PublicUsersMeVerifyLinkRequest({ languageTag });
23303
+ };
23304
+ /**
23305
+ * GET [/iam/v3/public/namespaces/{namespace}/users/{userId}/platforms](api)
23306
+ *
23307
+ * This method retrieves platform accounts linked to user. Required valid user authorization.
23308
+ * action code: 10128
23309
+ */
23310
+ this.getLinkedAccount = (userId) => {
23311
+ return this.newInstance().fetchV3NsUsersByUseridPlatforms(userId);
23312
+ };
23313
+ /**
23314
+ * GET [/iam/v3/public/users/me/headless/link/conflict](api)
23315
+ *
23316
+ * Note:
23317
+ * 1. My account should be full account
23318
+ * 2. My account not linked to request headless account's third platform.
23319
+ */
23320
+ this.getLinkAccountByOneTimeCodeConflict = (params) => {
23321
+ return this.newInstance().fetchIamV3PublicUsersMeHeadlessLinkConflict(params);
23322
+ };
23323
+ /**
23324
+ * POST [/iam/v3/public/users/me/headless/linkWithProgression](api)
23325
+ *
23326
+ * Note:
23327
+ * 1. My account should be full account
23328
+ * 2. My account not linked to headless account's third platform.
23329
+ */
23330
+ this.linkWithProgression = (data) => {
23331
+ return this.newInstance().postIamV3PublicUsersMeHeadlessLinkWithProgression(data);
23332
+ };
23157
23333
  }
23158
23334
  /**
23159
23335
  * @internal
@@ -23310,27 +23486,36 @@ class AgreementApi {
23310
23486
  this.conf = conf;
23311
23487
  this.namespace = namespace;
23312
23488
  this.cache = cache;
23313
- }
23314
- /**
23315
- * Accepts many legal policy versions all at once. Supply with localized version policy id to accept an agreement.
23316
- * - _Required permission_: login user
23317
- */
23318
- acceptLegalPolicies(acceptAgreements) {
23319
- return this.newInstance().postPublicAgreementsPolicies(acceptAgreements);
23320
- }
23321
- /**
23322
- * Retrieve accepted Legal Agreements.
23323
- * - _Required permission_: login user
23324
- */
23325
- getAgreements() {
23326
- return this.newInstance().fetchPublicAgreementsPolicies();
23327
- }
23328
- /**
23329
- * Change marketing preference consent.
23330
- * - _Required permission_: login user
23331
- */
23332
- updateMarketingPreferences(acceptAgreements) {
23333
- return this.newInstance().patchPublicAgreementsLocalizedPolicyVersionsPreferences(acceptAgreements);
23489
+ /**
23490
+ * POST [/agreement/public/agreements/policies](api)
23491
+ *
23492
+ * Accepts many legal policy versions all at once. Supply with localized version policy id to accept an agreement.
23493
+ *
23494
+ * _Required permission_: login user
23495
+ */
23496
+ this.acceptLegalPolicies = (acceptAgreements) => {
23497
+ return this.newInstance().postPublicAgreementsPolicies(acceptAgreements);
23498
+ };
23499
+ /**
23500
+ * GET [/agreement/public/agreements/policies](api)
23501
+ *
23502
+ * Retrieve accepted Legal Agreements.
23503
+ *
23504
+ * _Required permission_: login user
23505
+ */
23506
+ this.getAgreements = () => {
23507
+ return this.newInstance().fetchPublicAgreementsPolicies();
23508
+ };
23509
+ /**
23510
+ * PATCH [/agreement/public/agreements/localized-policy-versions/preferences](api)
23511
+ *
23512
+ * Change marketing preference consent
23513
+ *
23514
+ * _Required permission_: login user
23515
+ */
23516
+ this.updateMarketingPreferences = (acceptAgreements) => {
23517
+ return this.newInstance().patchPublicAgreementsLocalizedPolicyVersionsPreferences(acceptAgreements);
23518
+ };
23334
23519
  }
23335
23520
  newInstance() {
23336
23521
  return new Agreement$(Network.create(this.conf), this.namespace, this.cache);
@@ -23443,13 +23628,16 @@ class EligibilitiesApi {
23443
23628
  this.conf = conf;
23444
23629
  this.namespace = namespace;
23445
23630
  this.cache = cache;
23446
- }
23447
- /**
23448
- * 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.Other detail info:
23449
- * - _Required permission_: login user
23450
- */
23451
- getUserEligibilities() {
23452
- return this.newInstance().fetchPublicEligibilitiesNamespacesByNamespace();
23631
+ /**
23632
+ * GET [/agreement/public/eligibilities/namespaces/{namespace}](api)
23633
+ *
23634
+ * 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.
23635
+ *
23636
+ * _Required permission_: login user
23637
+ */
23638
+ this.getUserEligibilities = () => {
23639
+ return this.newInstance().fetchPublicEligibilitiesNamespacesByNamespace();
23640
+ };
23453
23641
  }
23454
23642
  newInstance() {
23455
23643
  return new Eligibilities$(Network.create(this.conf), this.namespace, this.cache);
@@ -23552,12 +23740,14 @@ class LocalizedPolicyVersionsApi {
23552
23740
  this.conf = conf;
23553
23741
  this.namespace = namespace;
23554
23742
  this.cache = cache;
23555
- }
23556
- /**
23557
- * Retrieve specific localized policy version including the policy version and base policy version where the localized policy version located.Other detail info:
23558
- */
23559
- fetchLocalizedPolicyVersionById(localizedPolicyVersionId) {
23560
- return this.newInstance().fetchPublicLocalizedPolicyVersionsByLocalizedpolicyversionid(localizedPolicyVersionId);
23743
+ /**
23744
+ * GET [/agreement/public/localized-policy-versions/{localizedPolicyVersionId}](api)
23745
+ *
23746
+ * Retrieve specific localized policy version including the policy version and base policy version where the localized policy version located.
23747
+ */
23748
+ this.fetchLocalizedPolicyVersionById = (localizedPolicyVersionId) => {
23749
+ return this.newInstance().fetchPublicLocalizedPolicyVersionsByLocalizedpolicyversionid(localizedPolicyVersionId);
23750
+ };
23561
23751
  }
23562
23752
  newInstance() {
23563
23753
  return new LocalizedPolicyVersions$(Network.create(this.conf), this.namespace, this.cache);
@@ -23663,36 +23853,37 @@ class PoliciesApi {
23663
23853
  this.conf = conf;
23664
23854
  this.namespace = namespace;
23665
23855
  this.cache = cache;
23666
- }
23667
- /**
23668
- * Retrieve all active latest policies based on a namespace and country.Other detail info:
23669
- *
23670
- * - _Leave the policyType empty if you want to be responded with all policy type_
23671
- * - _Fill the tags if you want to filter the responded policy by tags_
23672
- * - _Fill the defaultOnEmpty with true if you want to be responded with default country-specific policy if your requested country is not exist_
23673
- * - _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:_
23674
- *
23675
- * - Document 1 (default): Region US (default), UA
23676
- * - Document 2 (default): Region US (default)
23677
- * - Document 3 (default): Region US (default)
23678
- * - User: Region UA
23679
- * - Query: alwaysIncludeDefault: true
23680
- * - Response: Document 1 (UA), Document 2 (US), Document 3 (US)
23681
- */
23682
- // TODO cpmmented -> docgen fix above to valid HTML
23683
- fetchPoliciesByCountry({ countryCode, queryParams }) {
23684
- return this.newInstance().fetchPublicPoliciesNamespacesByNamespaceCountriesByCountrycode(countryCode, queryParams);
23685
- }
23686
- /**
23687
- * Retrieve all active latest policies based on country from all namespaces.
23688
- * Other detail info:
23689
- *
23690
- * - _Leave the policyType empty if you want to be responded with all policy type_
23691
- * - _Fill the tags if you want to filter the responded policy by tags_
23692
- * - _Fill the defaultOnEmpty with true if you want to be responded with default country-specific policy if your requested country is not exist_
23693
- */
23694
- fetchAllPoliciesByCountry({ countryCode, queryParams }) {
23695
- return this.newInstance().fetchPublicPoliciesCountriesByCountrycode(countryCode, queryParams);
23856
+ /**
23857
+ * GET [/agreement/public/policies/namespaces/{namespace}/countries/{countryCode}](api)
23858
+ *
23859
+ * Retrieve all active latest policies based on a namespace and country.
23860
+ *
23861
+ * - _Leave the policyType empty if you want to be responded with all policy type_
23862
+ * - _Fill the tags if you want to filter the responded policy by tags_
23863
+ * - _Fill the defaultOnEmpty with true if you want to be responded with default country-specific policy if your requested country is not exist_
23864
+ * - _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:_
23865
+ *
23866
+ * - Document 1 (default): Region US (default), UA
23867
+ * - Document 2 (default): Region US (default)
23868
+ * - Document 3 (default): Region US (default)
23869
+ * - User: Region UA
23870
+ * - Query: alwaysIncludeDefault: true
23871
+ * - Response: Document 1 (UA), Document 2 (US), Document 3 (US)
23872
+ */
23873
+ this.fetchPoliciesByCountry = ({ countryCode, queryParams }) => {
23874
+ return this.newInstance().fetchPublicPoliciesNamespacesByNamespaceCountriesByCountrycode(countryCode, queryParams);
23875
+ };
23876
+ /**
23877
+ * GET [/agreement/public/policies/countries/{countryCode}](api)
23878
+ *
23879
+ * Retrieve all active latest policies based on country from all namespaces.
23880
+ * - _Leave the policyType empty if you want to be responded with all policy type_
23881
+ * - _Fill the tags if you want to filter the responded policy by tags_
23882
+ * - _Fill the defaultOnEmpty with true if you want to be responded with default country-specific policy if your requested country is not exist_
23883
+ */
23884
+ this.fetchAllPoliciesByCountry = ({ countryCode, queryParams }) => {
23885
+ return this.newInstance().fetchPublicPoliciesCountriesByCountrycode(countryCode, queryParams);
23886
+ };
23696
23887
  }
23697
23888
  newInstance() {
23698
23889
  return new Policies$(Network.create(this.conf), this.namespace, this.cache);
@@ -23776,12 +23967,21 @@ class PublicTemplateApi {
23776
23967
  this.conf = conf;
23777
23968
  this.namespace = namespace;
23778
23969
  this.cache = cache;
23970
+ /**
23971
+ * @internal
23972
+ */
23779
23973
  this.getTemplateConfigs = (template) => {
23780
23974
  return this.newInstance().fetchV1NsTemplatesByTemplateConfigs(template);
23781
23975
  };
23976
+ /**
23977
+ * @internal
23978
+ */
23782
23979
  this.getTemplateConfig = (template, configId) => {
23783
23980
  return this.newInstance().fetchV1NsTemplatesByTemplateConfigsByConfig(template, configId);
23784
23981
  };
23982
+ /**
23983
+ * @internal
23984
+ */
23785
23985
  this.getDiscoveryTemplateConfigs = () => {
23786
23986
  return this.newInstance().fetchV1NsTemplatesByTemplateConfigs(DISCOVERY_TEMPLATE_NAME);
23787
23987
  };
@@ -23851,7 +24051,10 @@ class CurrencyApi {
23851
24051
  this.namespace = namespace;
23852
24052
  this.cache = cache;
23853
24053
  /**
24054
+ * GET [/platform/public/namespaces/{namespace}/currencies](api)
24055
+ *
23854
24056
  * List currencies of a namespace.
24057
+ *
23855
24058
  * Returns: Currency List
23856
24059
  */
23857
24060
  this.getCurrencies = () => {
@@ -23859,6 +24062,8 @@ class CurrencyApi {
23859
24062
  };
23860
24063
  /**
23861
24064
  * Get the currencies list and convert into a map of currency code and the currency itself
24065
+ *
24066
+ * @internal
23862
24067
  */
23863
24068
  this.getCurrencyMap = async () => {
23864
24069
  const result = await this.getCurrencies();
@@ -24471,40 +24676,42 @@ class EntitlementApi {
24471
24676
  this.conf = conf;
24472
24677
  this.namespace = namespace;
24473
24678
  this.cache = cache;
24474
- }
24475
- /**
24476
- * Get user app entitlement by appId.
24477
- */
24478
- getEntitlementByAppId({ userId, appId }) {
24479
- return this.newInstance().fetchNsUsersByUseridEntitlementsByAppId(userId, {
24480
- appId
24481
- });
24482
- }
24483
- /**
24484
- * Query user entitlements for a specific user.
24485
- * Returns: entitlement list
24486
- */
24487
- getEntitlements({ userId, queryParams }) {
24488
- return this.newInstance().fetchNsUsersByUseridEntitlements(userId, queryParams);
24489
- }
24490
- /**
24491
- * Exists any user active entitlement of specified itemIds, skus and appIds
24492
- */
24493
- getEntitlementOwnerShip({ userId, queryParams }) {
24494
- return this.newInstance().fetchNsUsersByUseridEntitlementsOwnershipAny(userId, queryParams);
24495
- }
24496
- /**
24497
- * Get user entitlement ownership by itemIds.
24498
- */
24499
- getEntitlementByItemIds({ userId, queryParams }) {
24500
- return this.newInstance().fetchNsUsersByUseridEntitlementsOwnershipByItemIds(userId, queryParams);
24501
- }
24502
- /**
24503
- * 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
24504
- * Returns: consumed entitlement
24505
- */
24506
- claimEntitlement({ userId, entitlementId, data }) {
24507
- return this.newInstance().putNsUsersByUseridEntitlementsByEntitlementidDecrement(userId, entitlementId, data);
24679
+ /**
24680
+ * GET [/platform/public/namespaces/{namespace}/users/{userId}/entitlements/byAppId](api)
24681
+ *
24682
+ * Get user app entitlement by appId.
24683
+ */
24684
+ this.getEntitlementByAppId = ({ userId, appId }) => {
24685
+ return this.newInstance().fetchNsUsersByUseridEntitlementsByAppId(userId, {
24686
+ appId
24687
+ });
24688
+ };
24689
+ /**
24690
+ * Query user entitlements for a specific user.
24691
+ * Returns: entitlement list
24692
+ */
24693
+ this.getEntitlements = ({ userId, queryParams }) => {
24694
+ return this.newInstance().fetchNsUsersByUseridEntitlements(userId, queryParams);
24695
+ };
24696
+ /**
24697
+ * Exists any user active entitlement of specified itemIds, skus and appIds
24698
+ */
24699
+ this.getEntitlementOwnerShip = ({ userId, queryParams }) => {
24700
+ return this.newInstance().fetchNsUsersByUseridEntitlementsOwnershipAny(userId, queryParams);
24701
+ };
24702
+ /**
24703
+ * Get user entitlement ownership by itemIds.
24704
+ */
24705
+ this.getEntitlementByItemIds = ({ userId, queryParams }) => {
24706
+ return this.newInstance().fetchNsUsersByUseridEntitlementsOwnershipByItemIds(userId, queryParams);
24707
+ };
24708
+ /**
24709
+ * 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
24710
+ * Returns: consumed entitlement
24711
+ */
24712
+ this.claimEntitlement = ({ userId, entitlementId, data }) => {
24713
+ return this.newInstance().putNsUsersByUseridEntitlementsByEntitlementidDecrement(userId, entitlementId, data);
24714
+ };
24508
24715
  }
24509
24716
  newInstance() {
24510
24717
  return new Entitlement$(Network.create(this.conf), this.namespace, this.cache);
@@ -24604,7 +24811,10 @@ class FulfillmentApi {
24604
24811
  this.namespace = namespace;
24605
24812
  this.cache = cache;
24606
24813
  /**
24607
- * Redeem campaign code.
24814
+ * POST [/platform/public/namespaces/{namespace}/users/{userId}/fulfillment/code](api)
24815
+ *
24816
+ * Redeem campaign code
24817
+ *
24608
24818
  * Returns: fulfillment result
24609
24819
  */
24610
24820
  this.redeemCode = ({ userId, data }) => {
@@ -25158,69 +25368,90 @@ class ItemApi {
25158
25368
  this.conf = conf;
25159
25369
  this.namespace = namespace;
25160
25370
  this.cache = cache;
25161
- }
25162
- /**
25163
- * This API is used to get item by appId.
25164
- * Returns: the item with that appId
25165
- */
25166
- getItemByAppId({ ...queryParams }) {
25167
- return this.newInstance().fetchNsItemsByAppId(queryParams);
25168
- }
25169
- /**
25170
- * Get item dynamic data for a published item.
25171
- * Returns: item dynamic data
25172
- */
25173
- getItemByItemIdDynamic(itemId) {
25174
- return this.newInstance().fetchNsItemsByItemidDynamic(itemId);
25175
- }
25176
- fetchItemsByCriteria({ queryParams }) {
25177
- return this.newInstance().fetchNsItemsByCriteria(queryParams);
25178
- }
25179
- /**
25180
- * This API is used to query items by criteria within a store. If item not exist in specific region, default region item will return.
25181
- * Returns: the list of items
25182
- */
25183
- getItemsByItemIds({ queryParams }) {
25184
- return this.newInstance().fetchNsItemsLocaleByIds(queryParams);
25185
- }
25186
- /**
25187
- * Fetch the items and convert it into a map of `itemId` and its item info
25188
- */
25189
- async fetchAvailableItemInfoMap({ queryParams }) {
25190
- const result = await this.getItemsByItemIds({ queryParams });
25191
- if (result.response) {
25192
- return {
25193
- error: null,
25194
- value: result.response.data.reduce((map, availableItemInfo) => {
25195
- const { itemId } = availableItemInfo;
25196
- if (itemId) {
25197
- map.set(itemId, availableItemInfo);
25198
- }
25199
- return map;
25200
- }, new Map())
25201
- };
25202
- }
25203
- return result;
25204
- }
25205
- /**
25206
- * This API is used to get an item in locale. If item not exist in specific region, default region item will return.
25207
- * Returns: item data
25208
- */
25209
- getItemsByItemIdLocale({ itemId, queryParams }) {
25210
- return this.newInstance().fetchNsItemsByItemidLocale(itemId, queryParams);
25211
- }
25212
- /**
25213
- * This API is used to get an app in locale. If app not exist in specific region, default region app will return.
25214
- * Returns: app data
25215
- */
25216
- getAppInfoByItemId({ itemId, queryParams }) {
25217
- return this.newInstance().fetchNsItemsByItemidAppLocale(itemId, queryParams);
25218
- }
25219
- /**
25220
- * This API is used to validate user item purchase condition
25221
- */
25222
- validatePurchaseCondition(data) {
25223
- return this.newInstance().postNsItemsPurchaseConditionsValidate(data);
25371
+ /**
25372
+ * GET [/platform/public/namespaces/{namespace}/items/byAppId](api)
25373
+ *
25374
+ * This API is used to get item by appId
25375
+ *
25376
+ * Returns: the item with that appId
25377
+ */
25378
+ this.getItemByAppId = ({ ...queryParams }) => {
25379
+ return this.newInstance().fetchNsItemsByAppId(queryParams);
25380
+ };
25381
+ /**
25382
+ * GET [/platform/public/namespaces/{namespace}/items/{itemId}/dynamic](api)
25383
+ *
25384
+ * Get item dynamic data for a published item
25385
+ *
25386
+ * Returns: item dynamic data
25387
+ */
25388
+ this.getItemByItemIdDynamic = (itemId) => {
25389
+ return this.newInstance().fetchNsItemsByItemidDynamic(itemId);
25390
+ };
25391
+ /**
25392
+ * GET [/platform/public/namespaces/{namespace}/items/byCriteria](api)
25393
+ */
25394
+ this.fetchItemsByCriteria = ({ queryParams }) => {
25395
+ return this.newInstance().fetchNsItemsByCriteria(queryParams);
25396
+ };
25397
+ /**
25398
+ * GET [/platform/public/namespaces/{namespace}/items/locale/byIds](api)
25399
+ *
25400
+ * This API is used to query items by criteria within a store. If item not exist in specific region, default region item will return.
25401
+ *
25402
+ * Returns: the list of items
25403
+ */
25404
+ this.getItemsByItemIds = ({ queryParams }) => {
25405
+ return this.newInstance().fetchNsItemsLocaleByIds(queryParams);
25406
+ };
25407
+ // TODO if not used, delete below
25408
+ // /**
25409
+ // * Fetch the items and convert it into a map of `itemId` and its item info
25410
+ // */
25411
+ // fetchAvailableItemInfoMap = async ({ queryParams }: { queryParams: QueryParamsItemIds }) => {
25412
+ // const result = await this.getItemsByItemIds({ queryParams })
25413
+ // if (result.response) {
25414
+ // return {
25415
+ // error: null,
25416
+ // value: result.response.data.reduce((map: Map<string, ItemInfo>, availableItemInfo) => {
25417
+ // const { itemId } = availableItemInfo
25418
+ // if (itemId) {
25419
+ // map.set(itemId, availableItemInfo)
25420
+ // }
25421
+ // return map
25422
+ // }, new Map())
25423
+ // }
25424
+ // }
25425
+ // return result
25426
+ // }
25427
+ /**
25428
+ * GET [/platform/public/namespaces/{namespace}/items/{itemId}/locale](api)
25429
+ *
25430
+ * This API is used to get an item in locale. If item not exist in specific region, default region item will return.
25431
+ *
25432
+ * Returns: item data
25433
+ */
25434
+ this.getItemsByItemIdLocale = ({ itemId, queryParams }) => {
25435
+ return this.newInstance().fetchNsItemsByItemidLocale(itemId, queryParams);
25436
+ };
25437
+ /**
25438
+ * GET [/platform/public/namespaces/{namespace}/items/{itemId}/app/locale](api)
25439
+ *
25440
+ * This API is used to get an app in locale. If app not exist in specific region, default region app will return.
25441
+ *
25442
+ * Returns: app data
25443
+ */
25444
+ this.getAppInfoByItemId = ({ itemId, queryParams }) => {
25445
+ return this.newInstance().fetchNsItemsByItemidAppLocale(itemId, queryParams);
25446
+ };
25447
+ /**
25448
+ * POST [/platform/public/namespaces/{namespace}/items/purchase/conditions/validate](api)
25449
+ *
25450
+ * This API is used to validate user item purchase condition
25451
+ */
25452
+ this.validatePurchaseCondition = (data) => {
25453
+ return this.newInstance().postNsItemsPurchaseConditionsValidate(data);
25454
+ };
25224
25455
  }
25225
25456
  newInstance() {
25226
25457
  return new Item$(Network.create(this.conf), this.namespace, this.cache);
@@ -25461,36 +25692,102 @@ class OrderApi {
25461
25692
  this.namespace = namespace;
25462
25693
  this.cache = cache;
25463
25694
  /**
25464
- * Query user orders.
25465
- * Returns: get order
25695
+ * GET [/platform/public/namespaces/{namespace}/users/{userId}/orders](api)
25696
+ *
25697
+ * Query user orders
25698
+ *
25699
+ * Returns a paginated list of `OrderInfo`:
25700
+ * <pre lang="json">{
25701
+ orderNo,
25702
+ paymentOrderNo,
25703
+ namespace,
25704
+ userId,
25705
+ itemId,
25706
+ sandbox,
25707
+ quantity,
25708
+ price,
25709
+ discountedPrice,
25710
+ creationOptions
25711
+ paymentProvider: ('WALLET', 'XSOLLA', 'ADYEN', 'STRIPE', 'CHECKOUT', 'ALIPAY', 'WXPAY', 'PAYPAL'),
25712
+ paymentMethod,
25713
+ tax,
25714
+ vat,
25715
+ salesTax,
25716
+ paymentProviderFee,
25717
+ paymentMethodFee
25718
+ currency: CurrencySummary,
25719
+ paymentStationUrl,
25720
+ itemSnapshot,
25721
+ region,
25722
+ language,
25723
+ status: (
25724
+ 'INIT',
25725
+ 'CHARGED',
25726
+ 'CHARGEBACK',
25727
+ 'CHARGEBACK_REVERSED',
25728
+ 'FULFILLED',
25729
+ 'FULFILL_FAILED',
25730
+ 'REFUNDING',
25731
+ 'REFUNDED',
25732
+ 'REFUND_FAILED',
25733
+ 'CLOSED',
25734
+ 'DELETED'
25735
+ ),
25736
+ statusReason,
25737
+ createdTime,
25738
+ chargedTime,
25739
+ fulfilledTime,
25740
+ refundedTime,
25741
+ chargebackTime,
25742
+ chargebackReversedTime,
25743
+ expireTime,
25744
+ paymentRemainSeconds,
25745
+ ext,
25746
+ totalTax,
25747
+ totalPrice,
25748
+ subtotalPrice,
25749
+ createdAt,
25750
+ updatedAt
25751
+ }</pre>
25466
25752
  */
25467
25753
  this.getOrderList = ({ userId, queryParams }) => {
25468
25754
  return this.newInstance().fetchNsUsersByUseridOrders(userId, queryParams);
25469
25755
  };
25470
25756
  /**
25757
+ * GET [/platform/public/namespaces/{namespace}/users/{userId}/orders/{orderNo}](api)
25758
+ *
25471
25759
  * Get user order.
25472
- * Returns: get order
25760
+ *
25761
+ * Returns: `OrderInfo`
25473
25762
  */
25474
25763
  this.getOrderByOrderNo = ({ userId, orderNo }) => {
25475
25764
  return this.newInstance().fetchNsUsersByUseridOrdersByOrderno(userId, orderNo);
25476
25765
  };
25477
25766
  /**
25767
+ * PUT [/platform/public/namespaces/{namespace}/users/{userId}/orders/{orderNo}/cancel](api)
25768
+ *
25478
25769
  * Cancel user order.
25479
- * Returns: cancelled order
25770
+ *
25771
+ * Returns: cancelled `OrderInfo`
25480
25772
  */
25481
25773
  this.cancelOrder = ({ userId, orderNo }) => {
25482
25774
  return this.newInstance().putNsUsersByUseridOrdersByOrdernoCancel(userId, orderNo);
25483
25775
  };
25484
25776
  /**
25777
+ * POST [/platform/public/namespaces/{namespace}/users/{userId}/orders](api)
25778
+ *
25485
25779
  * Create an order. The result contains the checkout link and payment token.
25486
25780
  * User with permission SANDBOX will create sandbox order that not real paid for xsolla/alipay and not validate price for wxpay.
25487
- * Returns: created order
25781
+ *
25782
+ * Returns: created `OrderInfo`
25488
25783
  */
25489
25784
  this.createOrder = ({ userId, data }) => {
25490
25785
  return this.newInstance().postNsUsersByUseridOrders(userId, data);
25491
25786
  };
25492
25787
  /**
25493
25788
  * Fetch all information needed for a user to check the user's availability to purchase the item
25789
+ *
25790
+ * @internal
25494
25791
  */
25495
25792
  this.fetchPrePurchaseInformation = async ({ userId, item }) => {
25496
25793
  const currencyApi = new CurrencyApi(this.conf, this.namespace, this.cache);
@@ -25819,36 +26116,48 @@ class PaymentApi {
25819
26116
  this.namespace = namespace;
25820
26117
  this.cache = cache;
25821
26118
  /**
25822
- * Get payment accounts.\
25823
- * Returns: Payment account list
26119
+ * GET [/platform/public/namespaces/{namespace}/users/{userId}/payment/accounts](api)
26120
+ *
26121
+ * Get payment accounts.
26122
+ *
26123
+ * Returns: Payment account list `PaymentAccountArray`
25824
26124
  */
25825
26125
  this.getPaymentAccounts = (userId) => {
25826
26126
  return this.newInstance().fetchNsUsersByUseridPaymentAccounts(userId);
25827
26127
  };
25828
26128
  /**
25829
- * Delete payment account.
26129
+ * DELETE [/platform/public/namespaces/{namespace}/users/{userId}/payment/accounts/{type}/{id}](api)
25830
26130
  *
25831
- * Other detail info:
26131
+ * Delete payment account.
25832
26132
  */
25833
26133
  this.deletePaymentAccount = ({ userId, type, id }) => {
25834
26134
  return this.newInstance().deleteNsUsersByUseridPaymentAccountsByTypeById(userId, type, id);
25835
26135
  };
25836
26136
  /**
26137
+ * GET [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/info](api)
26138
+ *
25837
26139
  * Get payment order info.
25838
- * Returns: Payment order details
26140
+ *
26141
+ * Returns: Payment order details `PaymentOrderDetails`
25839
26142
  */
25840
26143
  this.getPaymentInfo = (paymentOrderNo) => {
25841
26144
  return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentOrdersByPaymentordernoInfo(paymentOrderNo);
25842
26145
  };
25843
26146
  /**
26147
+ * POST [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/pay](api)
26148
+ *
25844
26149
  * Do payment(For now, this only support checkout.com).
26150
+ *
25845
26151
  * Returns: Payment process result
25846
26152
  */
25847
26153
  this.processPaymentOrder = (paymentOrderNo, data, queryParams) => {
25848
26154
  return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).postNsPaymentOrdersByPaymentordernoPay(paymentOrderNo, data, queryParams);
25849
26155
  };
25850
26156
  /**
26157
+ * GET [/platform/public/namespaces/{namespace}/payment/publicconfig](api)
26158
+ *
25851
26159
  * Get payment provider public config, at current only Strip provide public config.
26160
+ *
25852
26161
  * Returns: Public config
25853
26162
  */
25854
26163
  this.getPaymentProviderPublicConfig = (paymentProvider, region, sandbox) => {
@@ -25859,7 +26168,10 @@ class PaymentApi {
25859
26168
  });
25860
26169
  };
25861
26170
  /**
26171
+ * GET [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/status](api)
26172
+ *
25862
26173
  * Check payment order paid status.
26174
+ *
25863
26175
  * Returns: Payment order paid result
25864
26176
  */
25865
26177
  this.getPaymentOrderStatus = (paymentOrderNo) => {
@@ -25873,7 +26185,10 @@ class PaymentApi {
25873
26185
  return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentMethods({ paymentOrderNo });
25874
26186
  };
25875
26187
  /**
26188
+ * GET [/platform/public/namespaces/{namespace}/payment/methods](api)
26189
+ *
25876
26190
  * Check and get a payment order's should pay tax.
26191
+ *
25877
26192
  * Returns: tax result
25878
26193
  */
25879
26194
  this.getPaymentTax = (paymentProvider, paymentOrderNo, zipCode) => {
@@ -25884,7 +26199,10 @@ class PaymentApi {
25884
26199
  });
25885
26200
  };
25886
26201
  /**
26202
+ * POST [/platform/public/namespaces/{namespace}/payment/link](api)
26203
+ *
25887
26204
  * Get payment url.
26205
+ *
25888
26206
  * Returns: Get payment link
25889
26207
  */
25890
26208
  this.createPaymentUrl = (data) => {
@@ -26141,56 +26459,73 @@ class SubscriptionApi {
26141
26459
  this.conf = conf;
26142
26460
  this.namespace = namespace;
26143
26461
  this.cache = cache;
26144
- }
26145
- /**
26146
- * Query user subscriptions.
26147
- * Returns: paginated subscription
26148
- */
26149
- getUserSubscriptions({ userId, queryParams }) {
26150
- return this.newInstance().fetchNsUsersByUseridSubscriptions(userId, queryParams);
26151
- }
26152
- /**
26153
- * Get user subscription.
26154
- * Returns: subscription
26155
- */
26156
- getUserSubscriptionBySubscriptionId({ userId, subscriptionId }) {
26157
- return this.newInstance().fetchNsUsersByUseridSubscriptionsBySubscriptionid(userId, subscriptionId);
26158
- }
26159
- /**
26160
- * Subscribe a subscription. Support both real and virtual payment. Need go through payment flow using the paymentOrderNo if paymentFlowRequired true.
26161
- * __ACTIVE USER subscription can't do subscribe again.__
26162
- * __The next billing date will be X(default 4) hours before the current period ends if correctly subscribed.__
26163
- * User with permission SANDBOX will create sandbox subscription that not real paid.
26164
- *
26165
- * Returns: created subscription
26166
- */
26167
- createSubscription({ userId, data }) {
26168
- return this.newInstance().postNsUsersByUseridSubscriptions(userId, data);
26169
- }
26170
- /**
26171
- * Get user subscription billing histories.
26172
- * Returns: paginated subscription history
26173
- */
26174
- getUserSubscriptionBillingHistory({ userId, subscriptionId, queryParams }) {
26175
- return this.newInstance().fetchNsUsersByUseridSubscriptionsBySubscriptionidHistory(userId, subscriptionId, queryParams);
26176
- }
26177
- /**
26178
- * Request to change a subscription billing account, this will guide user to payment station.
26179
- * The actual change will happen at the 0 payment notification successfully handled.
26180
- * Only ACTIVE USER subscription with real currency billing account can be changed.
26181
- * Returns: updated subscription
26182
- */
26183
- updateUserSubscriptionPaymentMethod({ userId, subscriptionId }) {
26184
- return this.newInstance().putNsUsersByUseridSubscriptionsBySubscriptionidBillingAccount(userId, subscriptionId);
26185
- }
26186
- /**
26187
- * Cancel a subscription, only ACTIVE subscription can be cancelled.
26188
- * __Ensure successfully cancel, recommend at least 1 day before current period ends, otherwise it may be charging or charged.__
26189
- * Set immediate true, the subscription will be terminated immediately, otherwise till the end of current billing cycle.
26190
- * Returns: cancelled subscription
26191
- */
26192
- cancelUserSubscription({ userId, subscriptionId, data }) {
26193
- return this.newInstance().putNsUsersByUseridSubscriptionsBySubscriptionidCancel(userId, subscriptionId, data);
26462
+ /**
26463
+ * GET [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions](api)
26464
+ *
26465
+ * Query user subscriptions.
26466
+ *
26467
+ * Returns: paginated subscription
26468
+ */
26469
+ this.getUserSubscriptions = ({ userId, queryParams }) => {
26470
+ return this.newInstance().fetchNsUsersByUseridSubscriptions(userId, queryParams);
26471
+ };
26472
+ /**
26473
+ * GET [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}](api)
26474
+ *
26475
+ * Get user subscription.
26476
+ *
26477
+ * Returns: subscription
26478
+ */
26479
+ this.getUserSubscriptionBySubscriptionId = ({ userId, subscriptionId }) => {
26480
+ return this.newInstance().fetchNsUsersByUseridSubscriptionsBySubscriptionid(userId, subscriptionId);
26481
+ };
26482
+ /**
26483
+ * POST [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions](api)
26484
+ *
26485
+ * Subscribe a subscription. Support both real and virtual payment. Need go through payment flow using the paymentOrderNo if paymentFlowRequired true.
26486
+ * __ACTIVE USER subscription can't do subscribe again.__
26487
+ * __The next billing date will be X(default 4) hours before the current period ends if correctly subscribed.__
26488
+ * User with permission SANDBOX will create sandbox subscription that not real paid.
26489
+ *
26490
+ * Returns: created subscription
26491
+ */
26492
+ this.createSubscription = ({ userId, data }) => {
26493
+ return this.newInstance().postNsUsersByUseridSubscriptions(userId, data);
26494
+ };
26495
+ /**
26496
+ * GET [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}/history](api)
26497
+ *
26498
+ * Get user subscription billing histories.
26499
+ *
26500
+ * Returns: paginated subscription history
26501
+ */
26502
+ this.getUserSubscriptionBillingHistory = ({ userId, subscriptionId, queryParams }) => {
26503
+ return this.newInstance().fetchNsUsersByUseridSubscriptionsBySubscriptionidHistory(userId, subscriptionId, queryParams);
26504
+ };
26505
+ /**
26506
+ * PUT [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}/billingAccount](api)
26507
+ *
26508
+ * Request to change a subscription billing account, this will guide user to payment station.
26509
+ * The actual change will happen at the 0 payment notification successfully handled.
26510
+ * Only ACTIVE USER subscription with real currency billing account can be changed.
26511
+ *
26512
+ * Returns: updated subscription
26513
+ */
26514
+ this.updateUserSubscriptionPaymentMethod = ({ userId, subscriptionId }) => {
26515
+ return this.newInstance().putNsUsersByUseridSubscriptionsBySubscriptionidBillingAccount(userId, subscriptionId);
26516
+ };
26517
+ /**
26518
+ * PUT [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}/cancel](api)
26519
+ *
26520
+ * Cancel a subscription, only ACTIVE subscription can be cancelled.
26521
+ * __Ensure successfully cancel, recommend at least 1 day before current period ends, otherwise it may be charging or charged.__
26522
+ * Set immediate true, the subscription will be terminated immediately, otherwise till the end of current billing cycle.
26523
+ *
26524
+ * Returns: cancelled subscription
26525
+ */
26526
+ this.cancelUserSubscription = ({ userId, subscriptionId, data }) => {
26527
+ return this.newInstance().putNsUsersByUseridSubscriptionsBySubscriptionidCancel(userId, subscriptionId, data);
26528
+ };
26194
26529
  }
26195
26530
  newInstance() {
26196
26531
  return new Subscription$(Network.create(this.conf), this.namespace, this.cache);
@@ -26357,9 +26692,12 @@ class WalletApi {
26357
26692
  this.namespace = namespace;
26358
26693
  this.cache = cache;
26359
26694
  /**
26695
+ * GET [/platform/public/namespaces/{namespace}/users/me/wallets/{currencyCode}](api)
26696
+ *
26360
26697
  * get my wallet by currency code and namespace.
26361
26698
  *
26362
26699
  * Returns: wallet info
26700
+ *
26363
26701
  * Path's namespace:
26364
26702
  * - can be filled with __publisher namespace__ in order to get __publisher user wallet__
26365
26703
  * - can be filled with __game namespace__ in order to get __game user wallet__
@@ -26368,7 +26706,10 @@ class WalletApi {
26368
26706
  return this.newInstance().fetchNsUsersMeWalletsByCurrencycode(currencyCode);
26369
26707
  };
26370
26708
  /**
26709
+ * GET [/platform/public/namespaces/{namespace}/users/{userId}/wallets/{currencyCode}](api)
26710
+ *
26371
26711
  * Get a wallet by currency code.
26712
+ *
26372
26713
  * Returns: wallet info
26373
26714
  */
26374
26715
  this.getWalletByUserId = (userId, currencyCode) => {
@@ -26376,6 +26717,7 @@ class WalletApi {
26376
26717
  };
26377
26718
  /**
26378
26719
  * get a map of wallet represented by its currency code
26720
+ * @internal
26379
26721
  */
26380
26722
  this.getWalletMap = async ({ userId, currencyCodes }) => {
26381
26723
  try {