@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.browser.es.js
CHANGED
|
@@ -5980,6 +5980,8 @@ class FileUploadApi {
|
|
|
5980
5980
|
this.conf = conf;
|
|
5981
5981
|
this.namespace = namespace;
|
|
5982
5982
|
/**
|
|
5983
|
+
* POST [/basic/v1/public/namespaces/{namespace}/folders/{folder}/files](api)
|
|
5984
|
+
*
|
|
5983
5985
|
* Generate an upload URL. It's valid for 10 minutes.
|
|
5984
5986
|
* Returns: URL data
|
|
5985
5987
|
*/
|
|
@@ -6102,12 +6104,18 @@ class MiscApi {
|
|
|
6102
6104
|
this.namespace = namespace;
|
|
6103
6105
|
this.cache = cache;
|
|
6104
6106
|
/**
|
|
6105
|
-
*
|
|
6106
|
-
*
|
|
6107
|
+
* GET [/basic/v1/public/namespaces/{namespace}/misc/countries](api)
|
|
6108
|
+
*
|
|
6109
|
+
* _Returns_: country code list
|
|
6107
6110
|
*/
|
|
6108
6111
|
this.getCountries = (lang) => {
|
|
6109
6112
|
return this.newInstance().fetchV1NsMiscCountries({ lang });
|
|
6110
6113
|
};
|
|
6114
|
+
/**
|
|
6115
|
+
* GET [/basic/v1/public/namespaces/{namespace}/misc/languages](api)
|
|
6116
|
+
*
|
|
6117
|
+
* _Returns_: language list
|
|
6118
|
+
*/
|
|
6111
6119
|
this.getLanguages = () => {
|
|
6112
6120
|
return this.newInstance().fetchV1NsMiscLanguages();
|
|
6113
6121
|
};
|
|
@@ -6197,9 +6205,10 @@ class NamespaceApi {
|
|
|
6197
6205
|
this.namespace = namespace;
|
|
6198
6206
|
this.cache = cache;
|
|
6199
6207
|
/**
|
|
6208
|
+
* GET [/basic/v1/public/namespaces](api)
|
|
6209
|
+
*
|
|
6200
6210
|
* Get all namespaces.
|
|
6201
6211
|
*
|
|
6202
|
-
* Other detail info:
|
|
6203
6212
|
* - _Required permission_: login user
|
|
6204
6213
|
* - _Action code_: 11303
|
|
6205
6214
|
* - _Returns_: list of namespaces
|
|
@@ -6509,6 +6518,8 @@ class UserProfileApi {
|
|
|
6509
6518
|
this.namespace = namespace;
|
|
6510
6519
|
this.cache = cache;
|
|
6511
6520
|
/**
|
|
6521
|
+
* GET [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
|
|
6522
|
+
*
|
|
6512
6523
|
* Get my profile
|
|
6513
6524
|
*
|
|
6514
6525
|
* __Client with user token can get user profile in target namespace__
|
|
@@ -6517,6 +6528,8 @@ class UserProfileApi {
|
|
|
6517
6528
|
return this.newInstance().fetchV1NsUsersMeProfiles();
|
|
6518
6529
|
};
|
|
6519
6530
|
/**
|
|
6531
|
+
* POST [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
|
|
6532
|
+
*
|
|
6520
6533
|
* Create my profile.
|
|
6521
6534
|
*
|
|
6522
6535
|
* __Client with user token can create user profile in target namespace__
|
|
@@ -6525,6 +6538,8 @@ class UserProfileApi {
|
|
|
6525
6538
|
return this.newInstance().postV1NsUsersMeProfiles(data);
|
|
6526
6539
|
};
|
|
6527
6540
|
/**
|
|
6541
|
+
* PUT [/basic/v1/public/namespaces/{namespace}/users/me/profiles](api)
|
|
6542
|
+
*
|
|
6528
6543
|
* Update my profile.
|
|
6529
6544
|
* 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.
|
|
6530
6545
|
*/
|
|
@@ -6532,6 +6547,8 @@ class UserProfileApi {
|
|
|
6532
6547
|
return this.newInstance().putV1NsUsersMeProfiles(data);
|
|
6533
6548
|
};
|
|
6534
6549
|
/**
|
|
6550
|
+
* PUT [/basic/v1/public/namespaces/{namespace}/users/{userId}/profiles/customAttributes](api)
|
|
6551
|
+
*
|
|
6535
6552
|
* Update partially custom attributes tied to user id.
|
|
6536
6553
|
* _Returns_: Updated custom attributes
|
|
6537
6554
|
*/
|
|
@@ -6600,16 +6617,17 @@ class CachingApi {
|
|
|
6600
6617
|
constructor(conf, namespace) {
|
|
6601
6618
|
this.conf = conf;
|
|
6602
6619
|
this.namespace = namespace;
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6620
|
+
/**
|
|
6621
|
+
* GET [/buildinfo/public/namespaces/{namespace}/diff/cache/source/{sourceBuildId}/dest/{destinationBuildId}](api)
|
|
6622
|
+
*
|
|
6623
|
+
* This API is used to retrieve detailed diff cache.
|
|
6624
|
+
* The response will contains list of diff cache files along with its download url.
|
|
6625
|
+
*
|
|
6626
|
+
* _Required permission_: login user
|
|
6627
|
+
*/
|
|
6628
|
+
this.getDiffCache = (sourceBuildId, destinationBuildId) => {
|
|
6629
|
+
return this.newInstance().fetchNsDiffCacheSourceBySourcebuildidDestByDestinationbuildid(sourceBuildId, destinationBuildId);
|
|
6630
|
+
};
|
|
6613
6631
|
}
|
|
6614
6632
|
newInstance() {
|
|
6615
6633
|
// this is expensive to cache, apply "cache: false"
|
|
@@ -6783,21 +6801,26 @@ class DlcApi {
|
|
|
6783
6801
|
constructor(conf, namespace) {
|
|
6784
6802
|
this.conf = conf;
|
|
6785
6803
|
this.namespace = namespace;
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6804
|
+
/**
|
|
6805
|
+
* GET [/buildinfo/public/namespaces/{namespace}/dlcs/latest/byGameAppId/{appId}](api)
|
|
6806
|
+
*
|
|
6807
|
+
* Retrieve the list of DLC available on specific game. Use game's appId to query.
|
|
6808
|
+
*
|
|
6809
|
+
* _Returns_: list of DLC
|
|
6810
|
+
*/
|
|
6811
|
+
this.getLatestDLCByGameAppId = (appId) => {
|
|
6812
|
+
return this.newInstance().fetchNsDlcsLatestByGameAppIdByAppid(appId);
|
|
6813
|
+
};
|
|
6814
|
+
/**
|
|
6815
|
+
* GET [/buildinfo/public/namespaces/{namespace}/apps/latest/byDLCAppId/{dlcAppId}](api)
|
|
6816
|
+
*
|
|
6817
|
+
* Retrieve the list of DLC available on specific game. Use DLC's appId to query.
|
|
6818
|
+
*
|
|
6819
|
+
* _Returns_: appId of game and list of its builds by platformId
|
|
6820
|
+
*/
|
|
6821
|
+
this.getBaseGamesByDlcAppId = (dlcAppId) => {
|
|
6822
|
+
return this.newInstance().fetchNsAppsLatestByDlcAppIdByDlcappid(dlcAppId);
|
|
6823
|
+
};
|
|
6801
6824
|
}
|
|
6802
6825
|
newInstance() {
|
|
6803
6826
|
// this is be expensive to cache, apply "cache: false"
|
|
@@ -7164,66 +7187,76 @@ class DownloaderApi {
|
|
|
7164
7187
|
constructor(conf, namespace) {
|
|
7165
7188
|
this.conf = conf;
|
|
7166
7189
|
this.namespace = namespace;
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7190
|
+
/**
|
|
7191
|
+
* GET [/buildinfo/public/namespaces/{namespace}/availablebuilds/{appId}](api)
|
|
7192
|
+
*
|
|
7193
|
+
* This API is used to get simple build manifest that contains list of current build in various platform.
|
|
7194
|
+
*
|
|
7195
|
+
* - _Required permission_: login user
|
|
7196
|
+
* - _Returns_: build manifest
|
|
7197
|
+
*/
|
|
7198
|
+
this.getAvailableBuilds = (appId) => {
|
|
7199
|
+
return this.newInstance().fetchNsAvailablebuildsByAppid(appId);
|
|
7200
|
+
};
|
|
7201
|
+
/**
|
|
7202
|
+
* GET [/buildinfo/public/namespaces/{namespace}/v2/updategame/{appId}/{platformId}](api)
|
|
7203
|
+
*
|
|
7204
|
+
* This API is used to get build manifest of release version of the application.
|
|
7205
|
+
*
|
|
7206
|
+
* - _Required permission_: login user
|
|
7207
|
+
* - _Returns_: build manifest
|
|
7208
|
+
*/
|
|
7209
|
+
this.getBuildManifest = (appId, platformId) => {
|
|
7210
|
+
const axios = Network.create({ ...this.conf, timeout: 1800000 });
|
|
7211
|
+
return new Downloader$(axios, this.namespace, false).fetchNsV2UpdategameByAppidByPlatformid(appId, platformId);
|
|
7212
|
+
};
|
|
7213
|
+
/**
|
|
7214
|
+
* GET [/buildinfo/public/namespaces/{namespace}/diff/cache/source/{sourceBuildId}/dest/{destinationBuildId}](api)
|
|
7215
|
+
*
|
|
7216
|
+
* This API is used to retrieve detailed diff cache.
|
|
7217
|
+
* The response will contains list of diff cache files along with its download url.
|
|
7218
|
+
*
|
|
7219
|
+
* - _Required permission_: login user
|
|
7220
|
+
*/
|
|
7221
|
+
this.getDiffCache = (sourceBuildId, destinationBuildId) => {
|
|
7222
|
+
return new Caching$(Network.create(this.conf), this.namespace, false).fetchNsDiffCacheSourceBySourcebuildidDestByDestinationbuildid(sourceBuildId, destinationBuildId);
|
|
7223
|
+
};
|
|
7224
|
+
/**
|
|
7225
|
+
* Check which platform is available for the user to download the game
|
|
7226
|
+
*
|
|
7227
|
+
* @internal
|
|
7228
|
+
*/
|
|
7229
|
+
this.getMatchPlatform = ({ buildsAvailability, userPlatform }) => {
|
|
7230
|
+
const availablePlatformID = new Set();
|
|
7231
|
+
for (const buildAvailability of buildsAvailability) {
|
|
7232
|
+
if (buildAvailability.platformId) {
|
|
7233
|
+
availablePlatformID.add(buildAvailability.platformId);
|
|
7234
|
+
}
|
|
7205
7235
|
}
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7236
|
+
const currentMatchPlatform = this.getCurrentPlatform(userPlatform);
|
|
7237
|
+
if (currentMatchPlatform) {
|
|
7238
|
+
for (const key in currentMatchPlatform.targetPlatform) {
|
|
7239
|
+
if (availablePlatformID.has(currentMatchPlatform.targetPlatform[key])) {
|
|
7240
|
+
return currentMatchPlatform.targetPlatform[key];
|
|
7241
|
+
}
|
|
7212
7242
|
}
|
|
7213
7243
|
}
|
|
7214
|
-
|
|
7215
|
-
|
|
7244
|
+
return null;
|
|
7245
|
+
};
|
|
7246
|
+
/**
|
|
7247
|
+
* @internal
|
|
7248
|
+
*/
|
|
7249
|
+
this.getCurrentPlatform = (userPlatform) => {
|
|
7250
|
+
const devicePlatform = userPlatform.platform;
|
|
7251
|
+
const deviceArch = userPlatform.arch;
|
|
7252
|
+
const currentPlatform = AvailablePlatform.find((platform) => platform.platform === devicePlatform && platform.arch.includes(deviceArch));
|
|
7253
|
+
return currentPlatform;
|
|
7254
|
+
};
|
|
7216
7255
|
}
|
|
7217
7256
|
newInstance() {
|
|
7218
7257
|
// this is be expensive to cache, apply "cache: false"
|
|
7219
7258
|
return new Downloader$(Network.create(this.conf), this.namespace, false);
|
|
7220
7259
|
}
|
|
7221
|
-
getCurrentPlatform(userPlatform) {
|
|
7222
|
-
const devicePlatform = userPlatform.platform;
|
|
7223
|
-
const deviceArch = userPlatform.arch;
|
|
7224
|
-
const currentPlatform = AvailablePlatform.find((platform) => platform.platform === devicePlatform && platform.arch.includes(deviceArch));
|
|
7225
|
-
return currentPlatform;
|
|
7226
|
-
}
|
|
7227
7260
|
}
|
|
7228
7261
|
|
|
7229
7262
|
/*
|
|
@@ -7327,6 +7360,8 @@ class EventApi {
|
|
|
7327
7360
|
this.namespace = namespace;
|
|
7328
7361
|
this.cache = cache;
|
|
7329
7362
|
/**
|
|
7363
|
+
* GET [/event/v2/public/namespaces/{namespace}/users/{userId}/edithistory](api)
|
|
7364
|
+
*
|
|
7330
7365
|
* Available Type:
|
|
7331
7366
|
* - email
|
|
7332
7367
|
* - password
|
|
@@ -7335,7 +7370,7 @@ class EventApi {
|
|
|
7335
7370
|
* - country
|
|
7336
7371
|
* - language
|
|
7337
7372
|
*
|
|
7338
|
-
*
|
|
7373
|
+
* _Requires a valid user access token_
|
|
7339
7374
|
*/
|
|
7340
7375
|
this.getAccountHistoryByUserId = ({ userId, queryParams }) => {
|
|
7341
7376
|
return this.newInstance().fetchEventV2NsUsersByUseridEdithistory(userId, queryParams);
|
|
@@ -7429,27 +7464,36 @@ class DataDeletionApi {
|
|
|
7429
7464
|
this.conf = conf;
|
|
7430
7465
|
this.namespace = namespace;
|
|
7431
7466
|
this.cache = cache;
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7467
|
+
/**
|
|
7468
|
+
* GET [/gdpr/public/namespaces/{namespace}/users/{userId}/deletions/status](api)
|
|
7469
|
+
*
|
|
7470
|
+
* Fetch the status to check whether or not a user's account is on a deletion status
|
|
7471
|
+
*
|
|
7472
|
+
* _Requires a valid user access token_
|
|
7473
|
+
*/
|
|
7474
|
+
this.getGdprDeletionStatus = (userId) => {
|
|
7475
|
+
return this.newInstance().fetchGdprNsUsersByUseridDeletionsStatus(userId);
|
|
7476
|
+
};
|
|
7477
|
+
/**
|
|
7478
|
+
* POST [/gdpr/public/namespaces/{namespace}/users/{userId}/deletions](api)
|
|
7479
|
+
*
|
|
7480
|
+
* Request an account's deletion
|
|
7481
|
+
*
|
|
7482
|
+
* _Requires a valid user access token and password_
|
|
7483
|
+
*/
|
|
7484
|
+
this.requestAccountDeletion = ({ userId, data }) => {
|
|
7485
|
+
return this.newInstance().postGdprNsUsersByUseridDeletions(userId, data);
|
|
7486
|
+
};
|
|
7487
|
+
/**
|
|
7488
|
+
* DELETE [/gdpr/public/namespaces/{namespace}/users/{userId}/deletions](api)
|
|
7489
|
+
*
|
|
7490
|
+
* Cancel a deletion request
|
|
7491
|
+
*
|
|
7492
|
+
* _Requires a valid user access token_
|
|
7493
|
+
*/
|
|
7494
|
+
this.cancelAccountDeletion = (userId) => {
|
|
7495
|
+
return this.newInstance().deleteGdprNsUsersByUseridDeletions(userId);
|
|
7496
|
+
};
|
|
7453
7497
|
}
|
|
7454
7498
|
newInstance() {
|
|
7455
7499
|
return new DataDeletion$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -7570,34 +7614,46 @@ class DataRetrievalApi {
|
|
|
7570
7614
|
this.conf = conf;
|
|
7571
7615
|
this.namespace = namespace;
|
|
7572
7616
|
this.cache = cache;
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7617
|
+
/**
|
|
7618
|
+
* GET [/gdpr/public/namespaces/{namespace}/users/{userId}/requests](api)
|
|
7619
|
+
*
|
|
7620
|
+
* Fetch personal data request list
|
|
7621
|
+
*
|
|
7622
|
+
* _Requires a valid user access token_
|
|
7623
|
+
*/
|
|
7624
|
+
this.getGdprDataRequestList = ({ userId, queryParams }) => {
|
|
7625
|
+
return this.newInstance().fetchGdprNsUsersByUseridRequests(userId, queryParams);
|
|
7626
|
+
};
|
|
7627
|
+
/**
|
|
7628
|
+
* POST [/gdpr/public/namespaces/{namespace}/users/{userId}/requests](api)
|
|
7629
|
+
*
|
|
7630
|
+
* Create a request for personal data download
|
|
7631
|
+
*
|
|
7632
|
+
* _Requires a valid user access token_
|
|
7633
|
+
*/
|
|
7634
|
+
this.requestGdprData = ({ userId, data }) => {
|
|
7635
|
+
return this.newInstance().postGdprNsUsersByUseridRequests(userId, data);
|
|
7636
|
+
};
|
|
7637
|
+
/**
|
|
7638
|
+
* DELETE [/gdpr/public/namespaces/{namespace}/users/{userId}/requests/{requestDate}](api)
|
|
7639
|
+
*
|
|
7640
|
+
* Cancel the request for personal data download
|
|
7641
|
+
*
|
|
7642
|
+
* _Requires a valid user access token_
|
|
7643
|
+
*/
|
|
7644
|
+
this.cancelGdprDataRequest = ({ userId, requestDate }) => {
|
|
7645
|
+
return this.newInstance().deleteGdprNsUsersByUseridRequestsByRequestdate(userId, requestDate);
|
|
7646
|
+
};
|
|
7647
|
+
/**
|
|
7648
|
+
* POST [/gdpr/public/namespaces/{namespace}/users/{userId}/requests/{requestDate}/generate](api)
|
|
7649
|
+
*
|
|
7650
|
+
* Create a download URL for personal data request
|
|
7651
|
+
*
|
|
7652
|
+
* _Requires a valid user access token_
|
|
7653
|
+
*/
|
|
7654
|
+
this.requestGdprDataDownloadUrl = ({ userId, requestDate, data }) => {
|
|
7655
|
+
return this.newInstance().postGdprNsUsersByUseridRequestsByRequestdateGenerate(userId, requestDate, data);
|
|
7656
|
+
};
|
|
7601
7657
|
}
|
|
7602
7658
|
newInstance() {
|
|
7603
7659
|
return new DataRetrieval$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -7690,10 +7746,11 @@ class InputValidationsApi {
|
|
|
7690
7746
|
this.namespace = namespace;
|
|
7691
7747
|
this.cache = cache;
|
|
7692
7748
|
/**
|
|
7749
|
+
* GET [/iam/v3/public/inputValidations](api)
|
|
7750
|
+
*
|
|
7693
7751
|
* No role required
|
|
7694
7752
|
* This method is to get list of input validation configuration.
|
|
7695
7753
|
* `regex` parameter will be returned if `isCustomRegex` is true. Otherwise, it will be empty.
|
|
7696
|
-
*
|
|
7697
7754
|
*/
|
|
7698
7755
|
this.getValidations = (languageCode, defaultOnEmpty) => {
|
|
7699
7756
|
const queryParams = { languageCode, defaultOnEmpty };
|
|
@@ -16678,6 +16735,8 @@ class UserAuthorizationApi {
|
|
|
16678
16735
|
this.cache = cache;
|
|
16679
16736
|
this.options = options;
|
|
16680
16737
|
/**
|
|
16738
|
+
* POST: [/iam/v3/oauth/token](api)
|
|
16739
|
+
*
|
|
16681
16740
|
* This method supports grant type:
|
|
16682
16741
|
* - Grant Type == `authorization_code`:
|
|
16683
16742
|
* It generates the user token by given the authorization
|
|
@@ -16784,6 +16843,9 @@ class UserAuthorizationApi {
|
|
|
16784
16843
|
CodeChallenge.clear();
|
|
16785
16844
|
return { ...result, mfaData };
|
|
16786
16845
|
};
|
|
16846
|
+
/**
|
|
16847
|
+
* @internal
|
|
16848
|
+
*/
|
|
16787
16849
|
this.getMfaDataFromError = (errorResponse) => {
|
|
16788
16850
|
const doesMFADataExist = Validate.safeParse(errorResponse.data, MFADataResponse);
|
|
16789
16851
|
if (!doesMFADataExist)
|
|
@@ -16795,13 +16857,44 @@ class UserAuthorizationApi {
|
|
|
16795
16857
|
}
|
|
16796
16858
|
return result;
|
|
16797
16859
|
};
|
|
16860
|
+
/**
|
|
16861
|
+
* @internal
|
|
16862
|
+
*/
|
|
16798
16863
|
this.getMfaDataFromStorage = () => {
|
|
16799
16864
|
const storedMFAData = BrowserHelper.isOnBrowser() && localStorage.getItem(MFA_DATA_STORAGE_KEY);
|
|
16800
16865
|
return storedMFAData ? JSON.parse(storedMFAData) : null;
|
|
16801
16866
|
};
|
|
16867
|
+
/**
|
|
16868
|
+
* @internal
|
|
16869
|
+
*/
|
|
16802
16870
|
this.removeMfaDataFromStorage = () => {
|
|
16803
16871
|
localStorage.removeItem(MFA_DATA_STORAGE_KEY);
|
|
16804
16872
|
};
|
|
16873
|
+
/**
|
|
16874
|
+
* @internal
|
|
16875
|
+
*/
|
|
16876
|
+
this.matchReceivedState = (maybeSentState) => {
|
|
16877
|
+
const sentStateResult = CodeChallenge.parseSentState(maybeSentState);
|
|
16878
|
+
if (sentStateResult.error)
|
|
16879
|
+
return { error: sentStateResult.error, result: null };
|
|
16880
|
+
const storedStateResult = CodeChallenge.load();
|
|
16881
|
+
if (storedStateResult.error)
|
|
16882
|
+
return { error: storedStateResult.error, result: null };
|
|
16883
|
+
const sentState = sentStateResult.sentState;
|
|
16884
|
+
const storedState = storedStateResult.storedState;
|
|
16885
|
+
if (sentState.csrf !== storedState.csrf)
|
|
16886
|
+
return { error: null, result: null };
|
|
16887
|
+
return {
|
|
16888
|
+
error: null,
|
|
16889
|
+
result: {
|
|
16890
|
+
payload: sentState.payload,
|
|
16891
|
+
codeVerifier: storedState.codeVerifier
|
|
16892
|
+
}
|
|
16893
|
+
};
|
|
16894
|
+
};
|
|
16895
|
+
/**
|
|
16896
|
+
* @internal
|
|
16897
|
+
*/
|
|
16805
16898
|
this.deduceLoginError = (error) => {
|
|
16806
16899
|
switch (error) {
|
|
16807
16900
|
case LoginErrorParam.Enum.login_session_expired:
|
|
@@ -16843,6 +16936,11 @@ class UserAuthorizationApi {
|
|
|
16843
16936
|
returnPath
|
|
16844
16937
|
};
|
|
16845
16938
|
};
|
|
16939
|
+
/**
|
|
16940
|
+
* GET [/iam/v3/oauth/authorize](api)
|
|
16941
|
+
*
|
|
16942
|
+
* Creates a URL to be used for Login, Register, Link to existing account or Twitch Link
|
|
16943
|
+
*/
|
|
16846
16944
|
this.createLoginURL = (returnPath, targetAuthPage, oneTimeLinkCode) => {
|
|
16847
16945
|
const { verifier, challenge } = CodeChallenge.generateChallenge();
|
|
16848
16946
|
const csrf = CodeChallenge.generateCsrf();
|
|
@@ -16866,6 +16964,11 @@ class UserAuthorizationApi {
|
|
|
16866
16964
|
const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
|
|
16867
16965
|
return url.toString();
|
|
16868
16966
|
};
|
|
16967
|
+
/**
|
|
16968
|
+
* GET [/iam/v3/oauth/authorize](api)
|
|
16969
|
+
*
|
|
16970
|
+
* Creates a URL to be used for password recovery
|
|
16971
|
+
*/
|
|
16869
16972
|
this.createForgotPasswordURL = () => {
|
|
16870
16973
|
const { verifier, challenge } = CodeChallenge.generateChallenge();
|
|
16871
16974
|
const csrf = CodeChallenge.generateCsrf();
|
|
@@ -16884,9 +16987,15 @@ class UserAuthorizationApi {
|
|
|
16884
16987
|
const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
|
|
16885
16988
|
return url.toString();
|
|
16886
16989
|
};
|
|
16990
|
+
/**
|
|
16991
|
+
* @internal
|
|
16992
|
+
*/
|
|
16887
16993
|
this.getCodeChallenge = () => {
|
|
16888
16994
|
return CodeChallenge.generateChallenge();
|
|
16889
16995
|
};
|
|
16996
|
+
/**
|
|
16997
|
+
* @internal
|
|
16998
|
+
*/
|
|
16890
16999
|
this.refreshToken = () => {
|
|
16891
17000
|
const { clientId, refreshToken } = this.options;
|
|
16892
17001
|
if (DesktopChecker.isDesktopApp()) {
|
|
@@ -16894,6 +17003,9 @@ class UserAuthorizationApi {
|
|
|
16894
17003
|
}
|
|
16895
17004
|
return refreshWithLock({ axiosConfig: this.conf, clientId });
|
|
16896
17005
|
};
|
|
17006
|
+
/**
|
|
17007
|
+
* @internal
|
|
17008
|
+
*/
|
|
16897
17009
|
this.getSearchParams = (sentState, challenge) => {
|
|
16898
17010
|
const searchParams = new URLSearchParams();
|
|
16899
17011
|
searchParams.append('response_type', 'code');
|
|
@@ -16905,25 +17017,6 @@ class UserAuthorizationApi {
|
|
|
16905
17017
|
return searchParams;
|
|
16906
17018
|
};
|
|
16907
17019
|
}
|
|
16908
|
-
matchReceivedState(maybeSentState) {
|
|
16909
|
-
const sentStateResult = CodeChallenge.parseSentState(maybeSentState);
|
|
16910
|
-
if (sentStateResult.error)
|
|
16911
|
-
return { error: sentStateResult.error, result: null };
|
|
16912
|
-
const storedStateResult = CodeChallenge.load();
|
|
16913
|
-
if (storedStateResult.error)
|
|
16914
|
-
return { error: storedStateResult.error, result: null };
|
|
16915
|
-
const sentState = sentStateResult.sentState;
|
|
16916
|
-
const storedState = storedStateResult.storedState;
|
|
16917
|
-
if (sentState.csrf !== storedState.csrf)
|
|
16918
|
-
return { error: null, result: null };
|
|
16919
|
-
return {
|
|
16920
|
-
error: null,
|
|
16921
|
-
result: {
|
|
16922
|
-
payload: sentState.payload,
|
|
16923
|
-
codeVerifier: storedState.codeVerifier
|
|
16924
|
-
}
|
|
16925
|
-
};
|
|
16926
|
-
}
|
|
16927
17020
|
}
|
|
16928
17021
|
function isAxiosError(error) {
|
|
16929
17022
|
return !!error && !!error.config;
|
|
@@ -17332,6 +17425,14 @@ class OAuthApi {
|
|
|
17332
17425
|
this.cache = cache;
|
|
17333
17426
|
this.options = options;
|
|
17334
17427
|
/**
|
|
17428
|
+
* @internal
|
|
17429
|
+
*/
|
|
17430
|
+
this.newOAuth20Extension = () => {
|
|
17431
|
+
return new OAuth20Extension$(Network.create(this.conf), this.namespace, this.cache);
|
|
17432
|
+
};
|
|
17433
|
+
/**
|
|
17434
|
+
* POST [/iam/v3/logout](api)
|
|
17435
|
+
*
|
|
17335
17436
|
* This method is used to remove __access_token__, __refresh_token__ from cookie and revoke token from usage.
|
|
17336
17437
|
* Supported methods:
|
|
17337
17438
|
* - VerifyToken to verify token from header
|
|
@@ -17347,6 +17448,8 @@ class OAuthApi {
|
|
|
17347
17448
|
return new OAuth20Extension$(axios, this.namespace, this.cache).postIamV3Logout();
|
|
17348
17449
|
};
|
|
17349
17450
|
/**
|
|
17451
|
+
* POST [/iam/v3/oauth/revoke](api)
|
|
17452
|
+
*
|
|
17350
17453
|
* This method revokes a token.
|
|
17351
17454
|
* This method requires authorized requests header with Basic Authentication from client that establish the token.action code: 10706
|
|
17352
17455
|
*/
|
|
@@ -17362,6 +17465,8 @@ class OAuthApi {
|
|
|
17362
17465
|
return new OAuth20$(axios, this.namespace, this.cache).postIamV3OauthRevoke({ token });
|
|
17363
17466
|
};
|
|
17364
17467
|
/**
|
|
17468
|
+
* POST [/iam/v3/oauth/mfa/verify](api)
|
|
17469
|
+
*
|
|
17365
17470
|
* Verify 2FA code
|
|
17366
17471
|
* This method is used for verifying 2FA code.
|
|
17367
17472
|
* ##2FA remember device
|
|
@@ -17377,6 +17482,9 @@ class OAuthApi {
|
|
|
17377
17482
|
localStorage.removeItem(MFA_DATA_STORAGE_KEY);
|
|
17378
17483
|
return result.response;
|
|
17379
17484
|
};
|
|
17485
|
+
/**
|
|
17486
|
+
* POST [/iam/v3/oauth/mfa/code](api)
|
|
17487
|
+
*/
|
|
17380
17488
|
this.request2FAEmailCode = async ({ mfaToken = null, factor }) => {
|
|
17381
17489
|
const result = await this.newInstance().postIamV3OauthMfaCode({ mfaToken, clientId: this.options.clientId, factor });
|
|
17382
17490
|
if (result.error)
|
|
@@ -17384,12 +17492,16 @@ class OAuthApi {
|
|
|
17384
17492
|
return result.response;
|
|
17385
17493
|
};
|
|
17386
17494
|
/**
|
|
17495
|
+
* GET [/iam/v3/location/country](api)
|
|
17496
|
+
*
|
|
17387
17497
|
* This method get country location based on the request.
|
|
17388
17498
|
*/
|
|
17389
17499
|
this.getCurrentLocationCountry = () => {
|
|
17390
17500
|
return this.newOAuth20Extension().fetchIamV3LocationCountry();
|
|
17391
17501
|
};
|
|
17392
17502
|
/**
|
|
17503
|
+
* GET [/iam/v3/oauth/namespaces/{namespace}/users/{userId}/platforms/{platformId}/platformToken](api)
|
|
17504
|
+
*
|
|
17393
17505
|
* Retrieve User Third Party Platform Token
|
|
17394
17506
|
*
|
|
17395
17507
|
* This method used for retrieving third party platform token for user that login using third party,
|
|
@@ -17409,6 +17521,8 @@ class OAuthApi {
|
|
|
17409
17521
|
return this.newInstance().fetchV3OauthUsersByUseridPlatformsByPlatformidPlatformToken(userId, platformId);
|
|
17410
17522
|
};
|
|
17411
17523
|
/**
|
|
17524
|
+
* POST [/iam/v3/authenticateWithLink](api)
|
|
17525
|
+
*
|
|
17412
17526
|
* This method is being used to authenticate a user account and perform platform link.
|
|
17413
17527
|
* It validates user's email / username and password.
|
|
17414
17528
|
* If user already enable 2FA, then invoke _/mfa/verify_ using __mfa_token__ from this method response.
|
|
@@ -17423,31 +17537,27 @@ class OAuthApi {
|
|
|
17423
17537
|
this.authenticateWithLink = (data) => {
|
|
17424
17538
|
return this.newOAuth20Extension().postIamV3AuthenticateWithLink(data);
|
|
17425
17539
|
};
|
|
17426
|
-
|
|
17427
|
-
|
|
17428
|
-
|
|
17429
|
-
|
|
17430
|
-
|
|
17431
|
-
|
|
17432
|
-
|
|
17433
|
-
|
|
17434
|
-
|
|
17435
|
-
|
|
17436
|
-
|
|
17437
|
-
|
|
17438
|
-
|
|
17439
|
-
|
|
17440
|
-
|
|
17441
|
-
|
|
17442
|
-
|
|
17443
|
-
|
|
17444
|
-
|
|
17445
|
-
|
|
17446
|
-
|
|
17447
|
-
*
|
|
17448
|
-
*/
|
|
17449
|
-
exchangeTokenByOneTimeLinkCode(data) {
|
|
17450
|
-
return this.newOAuth20Extension().postIamV3LinkTokenExchange(data);
|
|
17540
|
+
/**
|
|
17541
|
+
* POST [/iam/v3/link/code/validate](api)
|
|
17542
|
+
*
|
|
17543
|
+
* This method is being used to validate one time link code.
|
|
17544
|
+
* It require a valid user token.
|
|
17545
|
+
* Should specify the target platform id and current user should already linked to this platform.
|
|
17546
|
+
* Current user should be a headless account.
|
|
17547
|
+
*/
|
|
17548
|
+
this.validateOneTimeLinkCode = (data) => {
|
|
17549
|
+
return this.newOAuth20Extension().postIamV3LinkCodeValidate(data);
|
|
17550
|
+
};
|
|
17551
|
+
/**
|
|
17552
|
+
* POST [/iam/v3/link/token/exchange](api)
|
|
17553
|
+
*
|
|
17554
|
+
* This method is being used to generate user's token by one time link code.
|
|
17555
|
+
* It require publisher ClientID
|
|
17556
|
+
* It required a code which can be generated from __/iam/v3/link/code/request__.
|
|
17557
|
+
*/
|
|
17558
|
+
this.exchangeTokenByOneTimeLinkCode = (data) => {
|
|
17559
|
+
return this.newOAuth20Extension().postIamV3LinkTokenExchange(data);
|
|
17560
|
+
};
|
|
17451
17561
|
}
|
|
17452
17562
|
newInstance() {
|
|
17453
17563
|
return new OAuth20$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -17526,6 +17636,8 @@ class ThirdPartyCredentialApi {
|
|
|
17526
17636
|
this.namespace = namespace;
|
|
17527
17637
|
this.cache = cache;
|
|
17528
17638
|
/**
|
|
17639
|
+
* GET [/iam/v3/public/namespaces/{namespace}/platforms/clients/active](api)
|
|
17640
|
+
*
|
|
17529
17641
|
* This is the Public API to Get All Active 3rd Platform Credential.
|
|
17530
17642
|
*/
|
|
17531
17643
|
this.getThirdPartyPlatformInfo = () => {
|
|
@@ -18027,85 +18139,112 @@ class TwoFA {
|
|
|
18027
18139
|
this.namespace = namespace;
|
|
18028
18140
|
this.cache = cache;
|
|
18029
18141
|
/**
|
|
18142
|
+
* GET [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode](api)
|
|
18143
|
+
*
|
|
18030
18144
|
* This method is used to get 8-digits backup codes.
|
|
18031
18145
|
* Each code is a one-time code and will be deleted once used.
|
|
18032
|
-
* This method Requires valid user access token
|
|
18033
18146
|
*
|
|
18147
|
+
* _Requires a valid user access token_
|
|
18034
18148
|
*/
|
|
18035
18149
|
this.getBackupCode = () => {
|
|
18036
18150
|
return this.newInstance().fetchV4NsUsersMeMfaBackupCode();
|
|
18037
18151
|
};
|
|
18038
18152
|
/**
|
|
18153
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode/enable](api)
|
|
18154
|
+
*
|
|
18039
18155
|
* This method is used to enable 2FA backup codes.
|
|
18040
|
-
* This method Requires valid user access token
|
|
18041
18156
|
*
|
|
18157
|
+
* _Requires a valid user access token_
|
|
18042
18158
|
*/
|
|
18043
18159
|
this.enable2FABackupCodes = () => {
|
|
18044
18160
|
return this.newInstance().postV4NsUsersMeMfaBackupCodeEnable();
|
|
18045
18161
|
};
|
|
18046
18162
|
/**
|
|
18163
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode](api)
|
|
18164
|
+
*
|
|
18047
18165
|
* This method is used to enable 2FA backup codes.
|
|
18048
|
-
* This method Requires valid user access token
|
|
18049
18166
|
*
|
|
18167
|
+
* _Requires a valid user access token_
|
|
18050
18168
|
*/
|
|
18051
18169
|
this.generateBackupCodes = () => {
|
|
18052
18170
|
return this.newInstance().postV4NsUsersMeMfaBackupCode();
|
|
18053
18171
|
};
|
|
18054
18172
|
/**
|
|
18173
|
+
* DELETE [/iam/v4/public/namespaces/{namespace}/users/me/mfa/backupCode/disable](api)
|
|
18174
|
+
*
|
|
18055
18175
|
* This method is used to enable 2FA backup codes.
|
|
18056
|
-
* This method Requires valid user access token
|
|
18057
18176
|
*
|
|
18177
|
+
* _Requires a valid user access token_
|
|
18058
18178
|
*/
|
|
18059
18179
|
this.disableBackupCodes = () => {
|
|
18060
18180
|
return this.newInstance().deleteV4NsUsersMeMfaBackupCodeDisable();
|
|
18061
18181
|
};
|
|
18062
18182
|
/**
|
|
18183
|
+
* DELETE [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/disable](api)
|
|
18184
|
+
* }
|
|
18063
18185
|
* This method is used to disable 2FA authenticator.
|
|
18064
|
-
* This method Requires valid user access token
|
|
18065
18186
|
*
|
|
18187
|
+
* _Requires a valid user access token_
|
|
18066
18188
|
*/
|
|
18067
18189
|
this.disableAuthenticator = () => {
|
|
18068
18190
|
return this.newInstance().deleteV4NsUsersMeMfaAuthenticatorDisable();
|
|
18069
18191
|
};
|
|
18070
18192
|
/**
|
|
18193
|
+
* GET [/iam/v4/public/namespaces/{namespace}/users/me/mfa/factor](api)
|
|
18194
|
+
*
|
|
18071
18195
|
* This method is used to get user enabled factors.
|
|
18072
|
-
* This method Requires valid user access token
|
|
18073
18196
|
*
|
|
18197
|
+
* _Requires a valid user access token_
|
|
18074
18198
|
*/
|
|
18075
18199
|
this.getEnabledMethods = () => {
|
|
18076
18200
|
return this.newInstance().fetchV4NsUsersMeMfaFactor();
|
|
18077
18201
|
};
|
|
18078
18202
|
/**
|
|
18203
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/factor](api)
|
|
18204
|
+
*
|
|
18079
18205
|
* This method is used to make 2FA factor default.
|
|
18080
|
-
* This method Requires valid user access token
|
|
18081
18206
|
*
|
|
18207
|
+
* _Requires a valid user access token_
|
|
18082
18208
|
*/
|
|
18083
18209
|
this.set2FAAsDefault = (factor) => {
|
|
18084
18210
|
return this.newInstance().postV4NsUsersMeMfaFactor({ factor });
|
|
18085
18211
|
};
|
|
18086
18212
|
/**
|
|
18213
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/enable](api)
|
|
18214
|
+
*
|
|
18087
18215
|
* This method is used to enable 2FA authenticator.
|
|
18088
|
-
* This method Requires valid user access token
|
|
18089
18216
|
*
|
|
18217
|
+
* _Requires a valid user access token_
|
|
18090
18218
|
*/
|
|
18091
18219
|
this.enable2FAAuthenticator = (code) => {
|
|
18092
18220
|
return this.newInstance().postV4NsUsersMeMfaAuthenticatorEnable({ code });
|
|
18093
18221
|
};
|
|
18094
18222
|
/**
|
|
18223
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/authenticator/key](api)
|
|
18224
|
+
*
|
|
18095
18225
|
* This method is used to generate a secret key for 3rd-party authenticator app.
|
|
18096
18226
|
* A QR code URI is also returned so that frontend can generate QR code image.
|
|
18097
|
-
* This method Requires valid user access token
|
|
18098
18227
|
*
|
|
18228
|
+
* _Requires a valid user access token_
|
|
18099
18229
|
*/
|
|
18100
18230
|
this.generateSecretKey = () => {
|
|
18101
18231
|
return this.newInstance().postV4NsUsersMeMfaAuthenticatorKey();
|
|
18102
18232
|
};
|
|
18233
|
+
/**
|
|
18234
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/code](api)
|
|
18235
|
+
*/
|
|
18103
18236
|
this.requestEmailCode = () => {
|
|
18104
18237
|
return this.newInstance().postV4NsUsersMeMfaEmailCode();
|
|
18105
18238
|
};
|
|
18239
|
+
/**
|
|
18240
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/enable](api)
|
|
18241
|
+
*/
|
|
18106
18242
|
this.enableEmailMethod = (code) => {
|
|
18107
18243
|
return this.newInstance().postV4NsUsersMeMfaEmailEnable({ code });
|
|
18108
18244
|
};
|
|
18245
|
+
/**
|
|
18246
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/mfa/email/disable](api)
|
|
18247
|
+
*/
|
|
18109
18248
|
this.disableEmailMethod = () => {
|
|
18110
18249
|
return this.newInstance().postV4NsUsersMeMfaEmailDisable();
|
|
18111
18250
|
};
|
|
@@ -19319,30 +19458,40 @@ class UserApi {
|
|
|
19319
19458
|
this.namespace = namespace;
|
|
19320
19459
|
this.cache = cache;
|
|
19321
19460
|
/**
|
|
19322
|
-
*
|
|
19461
|
+
* GET [/iam/v3/public/users/me](api)
|
|
19462
|
+
*
|
|
19463
|
+
* get currently logged-in user
|
|
19323
19464
|
*/
|
|
19324
19465
|
this.getCurrentUser = () => {
|
|
19325
19466
|
return this.newInstance().fetchIamV3PublicUsersMe();
|
|
19326
19467
|
};
|
|
19327
19468
|
/**
|
|
19328
|
-
*
|
|
19469
|
+
* PATCH [/iam/v3/public/namespaces/{namespace}/users/me](api)
|
|
19470
|
+
*
|
|
19471
|
+
* Update current user
|
|
19329
19472
|
*/
|
|
19330
19473
|
this.updateUserMe = (data) => {
|
|
19331
19474
|
return this.newInstance().patchV3NsUsersMe(data);
|
|
19332
19475
|
};
|
|
19333
19476
|
/**
|
|
19477
|
+
* PUT [/iam/v4/public/namespaces/{namespace}/users/me/email](api)
|
|
19478
|
+
*
|
|
19334
19479
|
* update current user's email
|
|
19335
19480
|
*/
|
|
19336
19481
|
this.updateEmailMe = (data) => {
|
|
19337
19482
|
return this.newInstance4().putV4NsUsersMeEmail(data);
|
|
19338
19483
|
};
|
|
19339
19484
|
/**
|
|
19485
|
+
* PUT [/iam/v3/public/namespaces/{namespace}/users/me/password](api)
|
|
19486
|
+
*
|
|
19340
19487
|
* update current user's password
|
|
19341
19488
|
*/
|
|
19342
19489
|
this.updatePasswordMe = (data) => {
|
|
19343
19490
|
return this.newInstance().putV3NsUsersMePassword(data);
|
|
19344
19491
|
};
|
|
19345
19492
|
/**
|
|
19493
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/code/request](api)
|
|
19494
|
+
*
|
|
19346
19495
|
* Required valid user authorization
|
|
19347
19496
|
* The verification code is sent to email address
|
|
19348
19497
|
* Available contexts for use :
|
|
@@ -19365,6 +19514,8 @@ class UserApi {
|
|
|
19365
19514
|
return this.newInstance().postV3NsUsersMeCodeRequest(data);
|
|
19366
19515
|
};
|
|
19367
19516
|
/**
|
|
19517
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/code/verify](api)
|
|
19518
|
+
*
|
|
19368
19519
|
* Will consume code if validateOnly is set false
|
|
19369
19520
|
* Required valid user authorization
|
|
19370
19521
|
* Redeems a verification code sent to a user to verify the user's contact address is correct
|
|
@@ -19376,6 +19527,8 @@ class UserApi {
|
|
|
19376
19527
|
return this.newInstance().postV3NsUsersMeCodeVerify(data);
|
|
19377
19528
|
};
|
|
19378
19529
|
/**
|
|
19530
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/headless/code/verify](api)
|
|
19531
|
+
*
|
|
19379
19532
|
* If validateOnly is set false, consume code and upgrade headless account and automatically verified the email address if it is succeeded
|
|
19380
19533
|
* Require valid user access token.
|
|
19381
19534
|
* The method upgrades a headless account by linking the headless account with the email address and the password.
|
|
@@ -19395,6 +19548,8 @@ class UserApi {
|
|
|
19395
19548
|
return this.newInstance().postV3NsUsersMeHeadlessCodeVerify(data);
|
|
19396
19549
|
};
|
|
19397
19550
|
/**
|
|
19551
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users/me/headless/code/verify](api)
|
|
19552
|
+
*
|
|
19398
19553
|
* Require valid user access token.
|
|
19399
19554
|
* The method upgrades a headless account by linking the headless account with the email address, username, and password.
|
|
19400
19555
|
* By upgrading the headless account into a full account, the user could use the email address, username, and password for using Justice IAM.
|
|
@@ -19414,13 +19569,17 @@ class UserApi {
|
|
|
19414
19569
|
return this.newInstance4().postV4NsUsersMeHeadlessCodeVerify(data);
|
|
19415
19570
|
};
|
|
19416
19571
|
/**
|
|
19572
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/{userId}/platforms](api)
|
|
19573
|
+
*
|
|
19417
19574
|
* This method retrieves platform accounts linked to user. Required valid user authorization.
|
|
19418
|
-
*
|
|
19575
|
+
* action code: 10128
|
|
19419
19576
|
*/
|
|
19420
19577
|
this.getUserLinkedPlatform = (userId) => {
|
|
19421
19578
|
return this.newInstance().fetchV3NsUsersByUseridPlatforms(userId);
|
|
19422
19579
|
};
|
|
19423
19580
|
/**
|
|
19581
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}](api)
|
|
19582
|
+
*
|
|
19424
19583
|
* Required valid user authorization.
|
|
19425
19584
|
* __Prerequisite:__
|
|
19426
19585
|
* Platform client configuration need to be added to database for specific platformId. Namespace service URL need to be specified (refer to required environment variables).
|
|
@@ -19450,22 +19609,26 @@ class UserApi {
|
|
|
19450
19609
|
return this.newInstance().postV3NsUsersMePlatformsByPlatformid(platformId, data);
|
|
19451
19610
|
};
|
|
19452
19611
|
/**
|
|
19612
|
+
* GET [/iam/v3/public/namespaces/{namespace}/requests/{requestId}/async/status](api)
|
|
19613
|
+
*
|
|
19453
19614
|
* Get the linking status between a third-party platform to a user
|
|
19454
19615
|
*/
|
|
19455
19616
|
this.getLinkRequestStatus = (requestId) => {
|
|
19456
19617
|
return this.newInstance().fetchV3NsRequestsByRequestidAsyncStatus(requestId);
|
|
19457
19618
|
};
|
|
19458
19619
|
/**
|
|
19620
|
+
* @internal
|
|
19459
19621
|
* It is going to be __DEPRECATED__.
|
|
19460
19622
|
* Update Platform Account relation to current User Account.
|
|
19461
19623
|
* Note: Game progression data (statistics, reward, etc) associated with previous User Account will not be
|
|
19462
19624
|
* transferred. If the data is tight to game user ID, the user will have the game progression data.
|
|
19463
|
-
*
|
|
19464
19625
|
*/
|
|
19465
19626
|
this.linkPlatformToUserAccount = ({ userId, data }) => {
|
|
19466
19627
|
return this.newInstance().postV3NsUsersByUseridPlatformsLink(userId, data);
|
|
19467
19628
|
};
|
|
19468
19629
|
/**
|
|
19630
|
+
* DELETE [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}](api)
|
|
19631
|
+
*
|
|
19469
19632
|
* Required valid user authorization.
|
|
19470
19633
|
* ##Supported platforms:
|
|
19471
19634
|
*
|
|
@@ -19498,110 +19661,123 @@ class UserApi {
|
|
|
19498
19661
|
return this.newInstance().deleteV3NsUsersMePlatformsByPlatformid(platformId, data);
|
|
19499
19662
|
};
|
|
19500
19663
|
/**
|
|
19664
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}/web/link](api)
|
|
19665
|
+
*
|
|
19501
19666
|
* This method is used to generate third party login page which will redirected to establish method.
|
|
19502
19667
|
*/
|
|
19503
19668
|
this.getThirdPartyURL = ({ platformId, queryParams }) => {
|
|
19504
19669
|
return this.newInstance().fetchV3NsUsersMePlatformsByPlatformidWebLink(platformId, queryParams);
|
|
19505
19670
|
};
|
|
19506
19671
|
/**
|
|
19672
|
+
* GET [/iam/v3/public/namespaces/{namespace}/agerestrictions/countries/{countryCode}](api)
|
|
19673
|
+
*
|
|
19507
19674
|
* Get age restriction by country code. It will always get by publisher namespace
|
|
19508
19675
|
*/
|
|
19509
19676
|
this.getAgeRestrictionByCountry = (countryCode) => {
|
|
19510
19677
|
return this.newInstance().fetchV3NsAgerestrictionsCountriesByCountrycode(countryCode);
|
|
19511
19678
|
};
|
|
19512
|
-
|
|
19513
|
-
|
|
19514
|
-
|
|
19515
|
-
|
|
19516
|
-
|
|
19517
|
-
|
|
19518
|
-
|
|
19519
|
-
|
|
19520
|
-
|
|
19521
|
-
|
|
19522
|
-
|
|
19523
|
-
|
|
19524
|
-
|
|
19525
|
-
|
|
19526
|
-
|
|
19527
|
-
|
|
19528
|
-
|
|
19529
|
-
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19535
|
-
|
|
19536
|
-
|
|
19537
|
-
|
|
19538
|
-
|
|
19539
|
-
|
|
19540
|
-
|
|
19541
|
-
|
|
19542
|
-
|
|
19543
|
-
|
|
19544
|
-
|
|
19545
|
-
|
|
19546
|
-
|
|
19547
|
-
|
|
19548
|
-
|
|
19549
|
-
|
|
19550
|
-
|
|
19551
|
-
|
|
19552
|
-
|
|
19553
|
-
|
|
19554
|
-
|
|
19555
|
-
|
|
19556
|
-
|
|
19557
|
-
|
|
19558
|
-
|
|
19559
|
-
|
|
19560
|
-
|
|
19561
|
-
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
|
|
19575
|
-
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
19584
|
-
|
|
19585
|
-
|
|
19586
|
-
|
|
19587
|
-
|
|
19588
|
-
|
|
19589
|
-
|
|
19590
|
-
|
|
19591
|
-
|
|
19592
|
-
|
|
19593
|
-
|
|
19594
|
-
|
|
19595
|
-
|
|
19596
|
-
|
|
19597
|
-
|
|
19598
|
-
|
|
19599
|
-
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
|
|
19679
|
+
/**
|
|
19680
|
+
* Render 2D Avatar via readyplayer.me POST [](https://docs.readyplayer.me/ready-player-me/avatars/2d-avatars/render-api)
|
|
19681
|
+
* @internal
|
|
19682
|
+
*/
|
|
19683
|
+
this.renderImageFromGlbModel = (data) => {
|
|
19684
|
+
const axios = Network.create({
|
|
19685
|
+
...this.conf
|
|
19686
|
+
});
|
|
19687
|
+
return Validate.responseType(() => axios.post('https://render.readyplayer.me/render', data), ReadyPlayerMe);
|
|
19688
|
+
};
|
|
19689
|
+
/**
|
|
19690
|
+
* POST [/iam/v3/public/namespaces/{namespace}/users/code/request](api)
|
|
19691
|
+
*
|
|
19692
|
+
* This method will validate the request's email address.
|
|
19693
|
+
*
|
|
19694
|
+
* If it already been used, will response 409.
|
|
19695
|
+
*
|
|
19696
|
+
* If it is available, we will send a verification code to this email address.
|
|
19697
|
+
*/
|
|
19698
|
+
this.requestNewUserVerificationCode = (data) => {
|
|
19699
|
+
return this.newInstance().postV3NsUsersCodeRequest(data);
|
|
19700
|
+
};
|
|
19701
|
+
/**
|
|
19702
|
+
* POST [/iam/v4/public/namespaces/{namespace}/users](api)
|
|
19703
|
+
*
|
|
19704
|
+
* Create a new user with unique email address and username.
|
|
19705
|
+
*
|
|
19706
|
+
* __Required attributes:__
|
|
19707
|
+
* - authType: possible value is EMAILPASSWD
|
|
19708
|
+
* - emailAddress: Please refer to the rule from /v3/public/inputValidations API.
|
|
19709
|
+
* - username: Please refer to the rule from /v3/public/inputValidations API.
|
|
19710
|
+
* - password: Please refer to the rule from /v3/public/inputValidations API.
|
|
19711
|
+
* - country: ISO3166-1 alpha-2 two letter, e.g. US.
|
|
19712
|
+
* - dateOfBirth: YYYY-MM-DD, e.g. 1990-01-01. valid values are between 1905-01-01 until current date.
|
|
19713
|
+
*
|
|
19714
|
+
* __Not required attributes:__
|
|
19715
|
+
* - displayName: Please refer to the rule from /v3/public/inputValidations API.
|
|
19716
|
+
*
|
|
19717
|
+
* This method support accepting agreements for the created user. Supply the accepted agreements in acceptedPolicies attribute.
|
|
19718
|
+
*
|
|
19719
|
+
*/
|
|
19720
|
+
this.createUser = (data) => {
|
|
19721
|
+
return this.newInstance4().postV4NsUsers(data);
|
|
19722
|
+
};
|
|
19723
|
+
/**
|
|
19724
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/{userId}/distinctPlatforms](api)
|
|
19725
|
+
*
|
|
19726
|
+
* This method retrieves platform accounts linked to user.
|
|
19727
|
+
* It will query all linked platform accounts and result will be distinct & grouped, same platform we will pick oldest linked one.
|
|
19728
|
+
* Required valid user authorization.
|
|
19729
|
+
*/
|
|
19730
|
+
this.getUserDistinctLinkedPlatform = (userId) => {
|
|
19731
|
+
return this.newInstance().fetchV3NsUsersByUseridDistinctPlatforms(userId);
|
|
19732
|
+
};
|
|
19733
|
+
/**
|
|
19734
|
+
* DELETE [/iam/v3/public/namespaces/{namespace}/users/me/platforms/{platformId}/all](api)
|
|
19735
|
+
*
|
|
19736
|
+
* Required valid user authorization.
|
|
19737
|
+
* Unlink user's account from for all third platforms.
|
|
19738
|
+
*/
|
|
19739
|
+
this.unLinkAccountFromPlatformDistinct = (platformId) => {
|
|
19740
|
+
return this.newInstance().deleteV3NsUsersMePlatformsByPlatformidAll(platformId);
|
|
19741
|
+
};
|
|
19742
|
+
/**
|
|
19743
|
+
* POST [/iam/v3/public/users/me/verify_link/request](api)
|
|
19744
|
+
*
|
|
19745
|
+
* Required valid user authorization
|
|
19746
|
+
* The verification link is sent to email address
|
|
19747
|
+
* It will not send request if user email is already verified
|
|
19748
|
+
*/
|
|
19749
|
+
this.sendVerificationLink = (languageTag) => {
|
|
19750
|
+
return this.newInstance().postIamV3PublicUsersMeVerifyLinkRequest({ languageTag });
|
|
19751
|
+
};
|
|
19752
|
+
/**
|
|
19753
|
+
* GET [/iam/v3/public/namespaces/{namespace}/users/{userId}/platforms](api)
|
|
19754
|
+
*
|
|
19755
|
+
* This method retrieves platform accounts linked to user. Required valid user authorization.
|
|
19756
|
+
* action code: 10128
|
|
19757
|
+
*/
|
|
19758
|
+
this.getLinkedAccount = (userId) => {
|
|
19759
|
+
return this.newInstance().fetchV3NsUsersByUseridPlatforms(userId);
|
|
19760
|
+
};
|
|
19761
|
+
/**
|
|
19762
|
+
* GET [/iam/v3/public/users/me/headless/link/conflict](api)
|
|
19763
|
+
*
|
|
19764
|
+
* Note:
|
|
19765
|
+
* 1. My account should be full account
|
|
19766
|
+
* 2. My account not linked to request headless account's third platform.
|
|
19767
|
+
*/
|
|
19768
|
+
this.getLinkAccountByOneTimeCodeConflict = (params) => {
|
|
19769
|
+
return this.newInstance().fetchIamV3PublicUsersMeHeadlessLinkConflict(params);
|
|
19770
|
+
};
|
|
19771
|
+
/**
|
|
19772
|
+
* POST [/iam/v3/public/users/me/headless/linkWithProgression](api)
|
|
19773
|
+
*
|
|
19774
|
+
* Note:
|
|
19775
|
+
* 1. My account should be full account
|
|
19776
|
+
* 2. My account not linked to headless account's third platform.
|
|
19777
|
+
*/
|
|
19778
|
+
this.linkWithProgression = (data) => {
|
|
19779
|
+
return this.newInstance().postIamV3PublicUsersMeHeadlessLinkWithProgression(data);
|
|
19780
|
+
};
|
|
19605
19781
|
}
|
|
19606
19782
|
/**
|
|
19607
19783
|
* @internal
|
|
@@ -19758,27 +19934,36 @@ class AgreementApi {
|
|
|
19758
19934
|
this.conf = conf;
|
|
19759
19935
|
this.namespace = namespace;
|
|
19760
19936
|
this.cache = cache;
|
|
19761
|
-
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
|
|
19765
|
-
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19769
|
-
|
|
19770
|
-
|
|
19771
|
-
|
|
19772
|
-
|
|
19773
|
-
|
|
19774
|
-
|
|
19775
|
-
|
|
19776
|
-
|
|
19777
|
-
|
|
19778
|
-
|
|
19779
|
-
|
|
19780
|
-
|
|
19781
|
-
|
|
19937
|
+
/**
|
|
19938
|
+
* POST [/agreement/public/agreements/policies](api)
|
|
19939
|
+
*
|
|
19940
|
+
* Accepts many legal policy versions all at once. Supply with localized version policy id to accept an agreement.
|
|
19941
|
+
*
|
|
19942
|
+
* _Required permission_: login user
|
|
19943
|
+
*/
|
|
19944
|
+
this.acceptLegalPolicies = (acceptAgreements) => {
|
|
19945
|
+
return this.newInstance().postPublicAgreementsPolicies(acceptAgreements);
|
|
19946
|
+
};
|
|
19947
|
+
/**
|
|
19948
|
+
* GET [/agreement/public/agreements/policies](api)
|
|
19949
|
+
*
|
|
19950
|
+
* Retrieve accepted Legal Agreements.
|
|
19951
|
+
*
|
|
19952
|
+
* _Required permission_: login user
|
|
19953
|
+
*/
|
|
19954
|
+
this.getAgreements = () => {
|
|
19955
|
+
return this.newInstance().fetchPublicAgreementsPolicies();
|
|
19956
|
+
};
|
|
19957
|
+
/**
|
|
19958
|
+
* PATCH [/agreement/public/agreements/localized-policy-versions/preferences](api)
|
|
19959
|
+
*
|
|
19960
|
+
* Change marketing preference consent
|
|
19961
|
+
*
|
|
19962
|
+
* _Required permission_: login user
|
|
19963
|
+
*/
|
|
19964
|
+
this.updateMarketingPreferences = (acceptAgreements) => {
|
|
19965
|
+
return this.newInstance().patchPublicAgreementsLocalizedPolicyVersionsPreferences(acceptAgreements);
|
|
19966
|
+
};
|
|
19782
19967
|
}
|
|
19783
19968
|
newInstance() {
|
|
19784
19969
|
return new Agreement$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -19891,13 +20076,16 @@ class EligibilitiesApi {
|
|
|
19891
20076
|
this.conf = conf;
|
|
19892
20077
|
this.namespace = namespace;
|
|
19893
20078
|
this.cache = cache;
|
|
19894
|
-
|
|
19895
|
-
|
|
19896
|
-
|
|
19897
|
-
|
|
19898
|
-
|
|
19899
|
-
|
|
19900
|
-
|
|
20079
|
+
/**
|
|
20080
|
+
* GET [/agreement/public/eligibilities/namespaces/{namespace}](api)
|
|
20081
|
+
*
|
|
20082
|
+
* 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.
|
|
20083
|
+
*
|
|
20084
|
+
* _Required permission_: login user
|
|
20085
|
+
*/
|
|
20086
|
+
this.getUserEligibilities = () => {
|
|
20087
|
+
return this.newInstance().fetchPublicEligibilitiesNamespacesByNamespace();
|
|
20088
|
+
};
|
|
19901
20089
|
}
|
|
19902
20090
|
newInstance() {
|
|
19903
20091
|
return new Eligibilities$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -20000,12 +20188,14 @@ class LocalizedPolicyVersionsApi {
|
|
|
20000
20188
|
this.conf = conf;
|
|
20001
20189
|
this.namespace = namespace;
|
|
20002
20190
|
this.cache = cache;
|
|
20003
|
-
|
|
20004
|
-
|
|
20005
|
-
|
|
20006
|
-
|
|
20007
|
-
|
|
20008
|
-
|
|
20191
|
+
/**
|
|
20192
|
+
* GET [/agreement/public/localized-policy-versions/{localizedPolicyVersionId}](api)
|
|
20193
|
+
*
|
|
20194
|
+
* Retrieve specific localized policy version including the policy version and base policy version where the localized policy version located.
|
|
20195
|
+
*/
|
|
20196
|
+
this.fetchLocalizedPolicyVersionById = (localizedPolicyVersionId) => {
|
|
20197
|
+
return this.newInstance().fetchPublicLocalizedPolicyVersionsByLocalizedpolicyversionid(localizedPolicyVersionId);
|
|
20198
|
+
};
|
|
20009
20199
|
}
|
|
20010
20200
|
newInstance() {
|
|
20011
20201
|
return new LocalizedPolicyVersions$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -20111,36 +20301,37 @@ class PoliciesApi {
|
|
|
20111
20301
|
this.conf = conf;
|
|
20112
20302
|
this.namespace = namespace;
|
|
20113
20303
|
this.cache = cache;
|
|
20114
|
-
|
|
20115
|
-
|
|
20116
|
-
|
|
20117
|
-
|
|
20118
|
-
|
|
20119
|
-
|
|
20120
|
-
|
|
20121
|
-
|
|
20122
|
-
|
|
20123
|
-
|
|
20124
|
-
|
|
20125
|
-
|
|
20126
|
-
|
|
20127
|
-
|
|
20128
|
-
|
|
20129
|
-
|
|
20130
|
-
|
|
20131
|
-
|
|
20132
|
-
|
|
20133
|
-
|
|
20134
|
-
|
|
20135
|
-
|
|
20136
|
-
|
|
20137
|
-
|
|
20138
|
-
|
|
20139
|
-
|
|
20140
|
-
|
|
20141
|
-
|
|
20142
|
-
|
|
20143
|
-
|
|
20304
|
+
/**
|
|
20305
|
+
* GET [/agreement/public/policies/namespaces/{namespace}/countries/{countryCode}](api)
|
|
20306
|
+
*
|
|
20307
|
+
* Retrieve all active latest policies based on a namespace and country.
|
|
20308
|
+
*
|
|
20309
|
+
* - _Leave the policyType empty if you want to be responded with all policy type_
|
|
20310
|
+
* - _Fill the tags if you want to filter the responded policy by tags_
|
|
20311
|
+
* - _Fill the defaultOnEmpty with true if you want to be responded with default country-specific policy if your requested country is not exist_
|
|
20312
|
+
* - _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:_
|
|
20313
|
+
*
|
|
20314
|
+
* - Document 1 (default): Region US (default), UA
|
|
20315
|
+
* - Document 2 (default): Region US (default)
|
|
20316
|
+
* - Document 3 (default): Region US (default)
|
|
20317
|
+
* - User: Region UA
|
|
20318
|
+
* - Query: alwaysIncludeDefault: true
|
|
20319
|
+
* - Response: Document 1 (UA), Document 2 (US), Document 3 (US)
|
|
20320
|
+
*/
|
|
20321
|
+
this.fetchPoliciesByCountry = ({ countryCode, queryParams }) => {
|
|
20322
|
+
return this.newInstance().fetchPublicPoliciesNamespacesByNamespaceCountriesByCountrycode(countryCode, queryParams);
|
|
20323
|
+
};
|
|
20324
|
+
/**
|
|
20325
|
+
* GET [/agreement/public/policies/countries/{countryCode}](api)
|
|
20326
|
+
*
|
|
20327
|
+
* Retrieve all active latest policies based on country from all namespaces.
|
|
20328
|
+
* - _Leave the policyType empty if you want to be responded with all policy type_
|
|
20329
|
+
* - _Fill the tags if you want to filter the responded policy by tags_
|
|
20330
|
+
* - _Fill the defaultOnEmpty with true if you want to be responded with default country-specific policy if your requested country is not exist_
|
|
20331
|
+
*/
|
|
20332
|
+
this.fetchAllPoliciesByCountry = ({ countryCode, queryParams }) => {
|
|
20333
|
+
return this.newInstance().fetchPublicPoliciesCountriesByCountrycode(countryCode, queryParams);
|
|
20334
|
+
};
|
|
20144
20335
|
}
|
|
20145
20336
|
newInstance() {
|
|
20146
20337
|
return new Policies$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -20224,12 +20415,21 @@ class PublicTemplateApi {
|
|
|
20224
20415
|
this.conf = conf;
|
|
20225
20416
|
this.namespace = namespace;
|
|
20226
20417
|
this.cache = cache;
|
|
20418
|
+
/**
|
|
20419
|
+
* @internal
|
|
20420
|
+
*/
|
|
20227
20421
|
this.getTemplateConfigs = (template) => {
|
|
20228
20422
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigs(template);
|
|
20229
20423
|
};
|
|
20424
|
+
/**
|
|
20425
|
+
* @internal
|
|
20426
|
+
*/
|
|
20230
20427
|
this.getTemplateConfig = (template, configId) => {
|
|
20231
20428
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigsByConfig(template, configId);
|
|
20232
20429
|
};
|
|
20430
|
+
/**
|
|
20431
|
+
* @internal
|
|
20432
|
+
*/
|
|
20233
20433
|
this.getDiscoveryTemplateConfigs = () => {
|
|
20234
20434
|
return this.newInstance().fetchV1NsTemplatesByTemplateConfigs(DISCOVERY_TEMPLATE_NAME);
|
|
20235
20435
|
};
|
|
@@ -20299,7 +20499,10 @@ class CurrencyApi {
|
|
|
20299
20499
|
this.namespace = namespace;
|
|
20300
20500
|
this.cache = cache;
|
|
20301
20501
|
/**
|
|
20502
|
+
* GET [/platform/public/namespaces/{namespace}/currencies](api)
|
|
20503
|
+
*
|
|
20302
20504
|
* List currencies of a namespace.
|
|
20505
|
+
*
|
|
20303
20506
|
* Returns: Currency List
|
|
20304
20507
|
*/
|
|
20305
20508
|
this.getCurrencies = () => {
|
|
@@ -20307,6 +20510,8 @@ class CurrencyApi {
|
|
|
20307
20510
|
};
|
|
20308
20511
|
/**
|
|
20309
20512
|
* Get the currencies list and convert into a map of currency code and the currency itself
|
|
20513
|
+
*
|
|
20514
|
+
* @internal
|
|
20310
20515
|
*/
|
|
20311
20516
|
this.getCurrencyMap = async () => {
|
|
20312
20517
|
const result = await this.getCurrencies();
|
|
@@ -20919,40 +21124,42 @@ class EntitlementApi {
|
|
|
20919
21124
|
this.conf = conf;
|
|
20920
21125
|
this.namespace = namespace;
|
|
20921
21126
|
this.cache = cache;
|
|
20922
|
-
|
|
20923
|
-
|
|
20924
|
-
|
|
20925
|
-
|
|
20926
|
-
|
|
20927
|
-
|
|
20928
|
-
|
|
20929
|
-
|
|
20930
|
-
|
|
20931
|
-
|
|
20932
|
-
|
|
20933
|
-
|
|
20934
|
-
|
|
20935
|
-
|
|
20936
|
-
|
|
20937
|
-
|
|
20938
|
-
|
|
20939
|
-
|
|
20940
|
-
|
|
20941
|
-
|
|
20942
|
-
|
|
20943
|
-
|
|
20944
|
-
|
|
20945
|
-
|
|
20946
|
-
|
|
20947
|
-
|
|
20948
|
-
|
|
20949
|
-
|
|
20950
|
-
|
|
20951
|
-
|
|
20952
|
-
|
|
20953
|
-
|
|
20954
|
-
|
|
20955
|
-
|
|
21127
|
+
/**
|
|
21128
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/entitlements/byAppId](api)
|
|
21129
|
+
*
|
|
21130
|
+
* Get user app entitlement by appId.
|
|
21131
|
+
*/
|
|
21132
|
+
this.getEntitlementByAppId = ({ userId, appId }) => {
|
|
21133
|
+
return this.newInstance().fetchNsUsersByUseridEntitlementsByAppId(userId, {
|
|
21134
|
+
appId
|
|
21135
|
+
});
|
|
21136
|
+
};
|
|
21137
|
+
/**
|
|
21138
|
+
* Query user entitlements for a specific user.
|
|
21139
|
+
* Returns: entitlement list
|
|
21140
|
+
*/
|
|
21141
|
+
this.getEntitlements = ({ userId, queryParams }) => {
|
|
21142
|
+
return this.newInstance().fetchNsUsersByUseridEntitlements(userId, queryParams);
|
|
21143
|
+
};
|
|
21144
|
+
/**
|
|
21145
|
+
* Exists any user active entitlement of specified itemIds, skus and appIds
|
|
21146
|
+
*/
|
|
21147
|
+
this.getEntitlementOwnerShip = ({ userId, queryParams }) => {
|
|
21148
|
+
return this.newInstance().fetchNsUsersByUseridEntitlementsOwnershipAny(userId, queryParams);
|
|
21149
|
+
};
|
|
21150
|
+
/**
|
|
21151
|
+
* Get user entitlement ownership by itemIds.
|
|
21152
|
+
*/
|
|
21153
|
+
this.getEntitlementByItemIds = ({ userId, queryParams }) => {
|
|
21154
|
+
return this.newInstance().fetchNsUsersByUseridEntitlementsOwnershipByItemIds(userId, queryParams);
|
|
21155
|
+
};
|
|
21156
|
+
/**
|
|
21157
|
+
* 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
|
|
21158
|
+
* Returns: consumed entitlement
|
|
21159
|
+
*/
|
|
21160
|
+
this.claimEntitlement = ({ userId, entitlementId, data }) => {
|
|
21161
|
+
return this.newInstance().putNsUsersByUseridEntitlementsByEntitlementidDecrement(userId, entitlementId, data);
|
|
21162
|
+
};
|
|
20956
21163
|
}
|
|
20957
21164
|
newInstance() {
|
|
20958
21165
|
return new Entitlement$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -21052,7 +21259,10 @@ class FulfillmentApi {
|
|
|
21052
21259
|
this.namespace = namespace;
|
|
21053
21260
|
this.cache = cache;
|
|
21054
21261
|
/**
|
|
21055
|
-
*
|
|
21262
|
+
* POST [/platform/public/namespaces/{namespace}/users/{userId}/fulfillment/code](api)
|
|
21263
|
+
*
|
|
21264
|
+
* Redeem campaign code
|
|
21265
|
+
*
|
|
21056
21266
|
* Returns: fulfillment result
|
|
21057
21267
|
*/
|
|
21058
21268
|
this.redeemCode = ({ userId, data }) => {
|
|
@@ -21606,69 +21816,90 @@ class ItemApi {
|
|
|
21606
21816
|
this.conf = conf;
|
|
21607
21817
|
this.namespace = namespace;
|
|
21608
21818
|
this.cache = cache;
|
|
21609
|
-
|
|
21610
|
-
|
|
21611
|
-
|
|
21612
|
-
|
|
21613
|
-
|
|
21614
|
-
|
|
21615
|
-
|
|
21616
|
-
|
|
21617
|
-
|
|
21618
|
-
|
|
21619
|
-
|
|
21620
|
-
|
|
21621
|
-
|
|
21622
|
-
|
|
21623
|
-
|
|
21624
|
-
|
|
21625
|
-
|
|
21626
|
-
|
|
21627
|
-
|
|
21628
|
-
|
|
21629
|
-
|
|
21630
|
-
|
|
21631
|
-
|
|
21632
|
-
|
|
21633
|
-
|
|
21634
|
-
|
|
21635
|
-
|
|
21636
|
-
|
|
21637
|
-
|
|
21638
|
-
|
|
21639
|
-
|
|
21640
|
-
|
|
21641
|
-
|
|
21642
|
-
|
|
21643
|
-
|
|
21644
|
-
|
|
21645
|
-
|
|
21646
|
-
|
|
21647
|
-
|
|
21648
|
-
|
|
21649
|
-
|
|
21650
|
-
}
|
|
21651
|
-
|
|
21652
|
-
|
|
21653
|
-
|
|
21654
|
-
|
|
21655
|
-
|
|
21656
|
-
|
|
21657
|
-
|
|
21658
|
-
|
|
21659
|
-
|
|
21660
|
-
|
|
21661
|
-
|
|
21662
|
-
|
|
21663
|
-
|
|
21664
|
-
|
|
21665
|
-
|
|
21666
|
-
|
|
21667
|
-
|
|
21668
|
-
|
|
21669
|
-
|
|
21670
|
-
|
|
21671
|
-
|
|
21819
|
+
/**
|
|
21820
|
+
* GET [/platform/public/namespaces/{namespace}/items/byAppId](api)
|
|
21821
|
+
*
|
|
21822
|
+
* This API is used to get item by appId
|
|
21823
|
+
*
|
|
21824
|
+
* Returns: the item with that appId
|
|
21825
|
+
*/
|
|
21826
|
+
this.getItemByAppId = ({ ...queryParams }) => {
|
|
21827
|
+
return this.newInstance().fetchNsItemsByAppId(queryParams);
|
|
21828
|
+
};
|
|
21829
|
+
/**
|
|
21830
|
+
* GET [/platform/public/namespaces/{namespace}/items/{itemId}/dynamic](api)
|
|
21831
|
+
*
|
|
21832
|
+
* Get item dynamic data for a published item
|
|
21833
|
+
*
|
|
21834
|
+
* Returns: item dynamic data
|
|
21835
|
+
*/
|
|
21836
|
+
this.getItemByItemIdDynamic = (itemId) => {
|
|
21837
|
+
return this.newInstance().fetchNsItemsByItemidDynamic(itemId);
|
|
21838
|
+
};
|
|
21839
|
+
/**
|
|
21840
|
+
* GET [/platform/public/namespaces/{namespace}/items/byCriteria](api)
|
|
21841
|
+
*/
|
|
21842
|
+
this.fetchItemsByCriteria = ({ queryParams }) => {
|
|
21843
|
+
return this.newInstance().fetchNsItemsByCriteria(queryParams);
|
|
21844
|
+
};
|
|
21845
|
+
/**
|
|
21846
|
+
* GET [/platform/public/namespaces/{namespace}/items/locale/byIds](api)
|
|
21847
|
+
*
|
|
21848
|
+
* This API is used to query items by criteria within a store. If item not exist in specific region, default region item will return.
|
|
21849
|
+
*
|
|
21850
|
+
* Returns: the list of items
|
|
21851
|
+
*/
|
|
21852
|
+
this.getItemsByItemIds = ({ queryParams }) => {
|
|
21853
|
+
return this.newInstance().fetchNsItemsLocaleByIds(queryParams);
|
|
21854
|
+
};
|
|
21855
|
+
// TODO if not used, delete below
|
|
21856
|
+
// /**
|
|
21857
|
+
// * Fetch the items and convert it into a map of `itemId` and its item info
|
|
21858
|
+
// */
|
|
21859
|
+
// fetchAvailableItemInfoMap = async ({ queryParams }: { queryParams: QueryParamsItemIds }) => {
|
|
21860
|
+
// const result = await this.getItemsByItemIds({ queryParams })
|
|
21861
|
+
// if (result.response) {
|
|
21862
|
+
// return {
|
|
21863
|
+
// error: null,
|
|
21864
|
+
// value: result.response.data.reduce((map: Map<string, ItemInfo>, availableItemInfo) => {
|
|
21865
|
+
// const { itemId } = availableItemInfo
|
|
21866
|
+
// if (itemId) {
|
|
21867
|
+
// map.set(itemId, availableItemInfo)
|
|
21868
|
+
// }
|
|
21869
|
+
// return map
|
|
21870
|
+
// }, new Map())
|
|
21871
|
+
// }
|
|
21872
|
+
// }
|
|
21873
|
+
// return result
|
|
21874
|
+
// }
|
|
21875
|
+
/**
|
|
21876
|
+
* GET [/platform/public/namespaces/{namespace}/items/{itemId}/locale](api)
|
|
21877
|
+
*
|
|
21878
|
+
* This API is used to get an item in locale. If item not exist in specific region, default region item will return.
|
|
21879
|
+
*
|
|
21880
|
+
* Returns: item data
|
|
21881
|
+
*/
|
|
21882
|
+
this.getItemsByItemIdLocale = ({ itemId, queryParams }) => {
|
|
21883
|
+
return this.newInstance().fetchNsItemsByItemidLocale(itemId, queryParams);
|
|
21884
|
+
};
|
|
21885
|
+
/**
|
|
21886
|
+
* GET [/platform/public/namespaces/{namespace}/items/{itemId}/app/locale](api)
|
|
21887
|
+
*
|
|
21888
|
+
* This API is used to get an app in locale. If app not exist in specific region, default region app will return.
|
|
21889
|
+
*
|
|
21890
|
+
* Returns: app data
|
|
21891
|
+
*/
|
|
21892
|
+
this.getAppInfoByItemId = ({ itemId, queryParams }) => {
|
|
21893
|
+
return this.newInstance().fetchNsItemsByItemidAppLocale(itemId, queryParams);
|
|
21894
|
+
};
|
|
21895
|
+
/**
|
|
21896
|
+
* POST [/platform/public/namespaces/{namespace}/items/purchase/conditions/validate](api)
|
|
21897
|
+
*
|
|
21898
|
+
* This API is used to validate user item purchase condition
|
|
21899
|
+
*/
|
|
21900
|
+
this.validatePurchaseCondition = (data) => {
|
|
21901
|
+
return this.newInstance().postNsItemsPurchaseConditionsValidate(data);
|
|
21902
|
+
};
|
|
21672
21903
|
}
|
|
21673
21904
|
newInstance() {
|
|
21674
21905
|
return new Item$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -21909,36 +22140,102 @@ class OrderApi {
|
|
|
21909
22140
|
this.namespace = namespace;
|
|
21910
22141
|
this.cache = cache;
|
|
21911
22142
|
/**
|
|
21912
|
-
*
|
|
21913
|
-
*
|
|
22143
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/orders](api)
|
|
22144
|
+
*
|
|
22145
|
+
* Query user orders
|
|
22146
|
+
*
|
|
22147
|
+
* Returns a paginated list of `OrderInfo`:
|
|
22148
|
+
* <pre lang="json">{
|
|
22149
|
+
orderNo,
|
|
22150
|
+
paymentOrderNo,
|
|
22151
|
+
namespace,
|
|
22152
|
+
userId,
|
|
22153
|
+
itemId,
|
|
22154
|
+
sandbox,
|
|
22155
|
+
quantity,
|
|
22156
|
+
price,
|
|
22157
|
+
discountedPrice,
|
|
22158
|
+
creationOptions
|
|
22159
|
+
paymentProvider: ('WALLET', 'XSOLLA', 'ADYEN', 'STRIPE', 'CHECKOUT', 'ALIPAY', 'WXPAY', 'PAYPAL'),
|
|
22160
|
+
paymentMethod,
|
|
22161
|
+
tax,
|
|
22162
|
+
vat,
|
|
22163
|
+
salesTax,
|
|
22164
|
+
paymentProviderFee,
|
|
22165
|
+
paymentMethodFee
|
|
22166
|
+
currency: CurrencySummary,
|
|
22167
|
+
paymentStationUrl,
|
|
22168
|
+
itemSnapshot,
|
|
22169
|
+
region,
|
|
22170
|
+
language,
|
|
22171
|
+
status: (
|
|
22172
|
+
'INIT',
|
|
22173
|
+
'CHARGED',
|
|
22174
|
+
'CHARGEBACK',
|
|
22175
|
+
'CHARGEBACK_REVERSED',
|
|
22176
|
+
'FULFILLED',
|
|
22177
|
+
'FULFILL_FAILED',
|
|
22178
|
+
'REFUNDING',
|
|
22179
|
+
'REFUNDED',
|
|
22180
|
+
'REFUND_FAILED',
|
|
22181
|
+
'CLOSED',
|
|
22182
|
+
'DELETED'
|
|
22183
|
+
),
|
|
22184
|
+
statusReason,
|
|
22185
|
+
createdTime,
|
|
22186
|
+
chargedTime,
|
|
22187
|
+
fulfilledTime,
|
|
22188
|
+
refundedTime,
|
|
22189
|
+
chargebackTime,
|
|
22190
|
+
chargebackReversedTime,
|
|
22191
|
+
expireTime,
|
|
22192
|
+
paymentRemainSeconds,
|
|
22193
|
+
ext,
|
|
22194
|
+
totalTax,
|
|
22195
|
+
totalPrice,
|
|
22196
|
+
subtotalPrice,
|
|
22197
|
+
createdAt,
|
|
22198
|
+
updatedAt
|
|
22199
|
+
}</pre>
|
|
21914
22200
|
*/
|
|
21915
22201
|
this.getOrderList = ({ userId, queryParams }) => {
|
|
21916
22202
|
return this.newInstance().fetchNsUsersByUseridOrders(userId, queryParams);
|
|
21917
22203
|
};
|
|
21918
22204
|
/**
|
|
22205
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/orders/{orderNo}](api)
|
|
22206
|
+
*
|
|
21919
22207
|
* Get user order.
|
|
21920
|
-
*
|
|
22208
|
+
*
|
|
22209
|
+
* Returns: `OrderInfo`
|
|
21921
22210
|
*/
|
|
21922
22211
|
this.getOrderByOrderNo = ({ userId, orderNo }) => {
|
|
21923
22212
|
return this.newInstance().fetchNsUsersByUseridOrdersByOrderno(userId, orderNo);
|
|
21924
22213
|
};
|
|
21925
22214
|
/**
|
|
22215
|
+
* PUT [/platform/public/namespaces/{namespace}/users/{userId}/orders/{orderNo}/cancel](api)
|
|
22216
|
+
*
|
|
21926
22217
|
* Cancel user order.
|
|
21927
|
-
*
|
|
22218
|
+
*
|
|
22219
|
+
* Returns: cancelled `OrderInfo`
|
|
21928
22220
|
*/
|
|
21929
22221
|
this.cancelOrder = ({ userId, orderNo }) => {
|
|
21930
22222
|
return this.newInstance().putNsUsersByUseridOrdersByOrdernoCancel(userId, orderNo);
|
|
21931
22223
|
};
|
|
21932
22224
|
/**
|
|
22225
|
+
* POST [/platform/public/namespaces/{namespace}/users/{userId}/orders](api)
|
|
22226
|
+
*
|
|
21933
22227
|
* Create an order. The result contains the checkout link and payment token.
|
|
21934
22228
|
* User with permission SANDBOX will create sandbox order that not real paid for xsolla/alipay and not validate price for wxpay.
|
|
21935
|
-
*
|
|
22229
|
+
*
|
|
22230
|
+
* Returns: created `OrderInfo`
|
|
21936
22231
|
*/
|
|
21937
22232
|
this.createOrder = ({ userId, data }) => {
|
|
21938
22233
|
return this.newInstance().postNsUsersByUseridOrders(userId, data);
|
|
21939
22234
|
};
|
|
21940
22235
|
/**
|
|
21941
22236
|
* Fetch all information needed for a user to check the user's availability to purchase the item
|
|
22237
|
+
*
|
|
22238
|
+
* @internal
|
|
21942
22239
|
*/
|
|
21943
22240
|
this.fetchPrePurchaseInformation = async ({ userId, item }) => {
|
|
21944
22241
|
const currencyApi = new CurrencyApi(this.conf, this.namespace, this.cache);
|
|
@@ -22267,36 +22564,48 @@ class PaymentApi {
|
|
|
22267
22564
|
this.namespace = namespace;
|
|
22268
22565
|
this.cache = cache;
|
|
22269
22566
|
/**
|
|
22270
|
-
*
|
|
22271
|
-
*
|
|
22567
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/payment/accounts](api)
|
|
22568
|
+
*
|
|
22569
|
+
* Get payment accounts.
|
|
22570
|
+
*
|
|
22571
|
+
* Returns: Payment account list `PaymentAccountArray`
|
|
22272
22572
|
*/
|
|
22273
22573
|
this.getPaymentAccounts = (userId) => {
|
|
22274
22574
|
return this.newInstance().fetchNsUsersByUseridPaymentAccounts(userId);
|
|
22275
22575
|
};
|
|
22276
22576
|
/**
|
|
22277
|
-
*
|
|
22577
|
+
* DELETE [/platform/public/namespaces/{namespace}/users/{userId}/payment/accounts/{type}/{id}](api)
|
|
22278
22578
|
*
|
|
22279
|
-
*
|
|
22579
|
+
* Delete payment account.
|
|
22280
22580
|
*/
|
|
22281
22581
|
this.deletePaymentAccount = ({ userId, type, id }) => {
|
|
22282
22582
|
return this.newInstance().deleteNsUsersByUseridPaymentAccountsByTypeById(userId, type, id);
|
|
22283
22583
|
};
|
|
22284
22584
|
/**
|
|
22585
|
+
* GET [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/info](api)
|
|
22586
|
+
*
|
|
22285
22587
|
* Get payment order info.
|
|
22286
|
-
*
|
|
22588
|
+
*
|
|
22589
|
+
* Returns: Payment order details `PaymentOrderDetails`
|
|
22287
22590
|
*/
|
|
22288
22591
|
this.getPaymentInfo = (paymentOrderNo) => {
|
|
22289
22592
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentOrdersByPaymentordernoInfo(paymentOrderNo);
|
|
22290
22593
|
};
|
|
22291
22594
|
/**
|
|
22595
|
+
* POST [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/pay](api)
|
|
22596
|
+
*
|
|
22292
22597
|
* Do payment(For now, this only support checkout.com).
|
|
22598
|
+
*
|
|
22293
22599
|
* Returns: Payment process result
|
|
22294
22600
|
*/
|
|
22295
22601
|
this.processPaymentOrder = (paymentOrderNo, data, queryParams) => {
|
|
22296
22602
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).postNsPaymentOrdersByPaymentordernoPay(paymentOrderNo, data, queryParams);
|
|
22297
22603
|
};
|
|
22298
22604
|
/**
|
|
22605
|
+
* GET [/platform/public/namespaces/{namespace}/payment/publicconfig](api)
|
|
22606
|
+
*
|
|
22299
22607
|
* Get payment provider public config, at current only Strip provide public config.
|
|
22608
|
+
*
|
|
22300
22609
|
* Returns: Public config
|
|
22301
22610
|
*/
|
|
22302
22611
|
this.getPaymentProviderPublicConfig = (paymentProvider, region, sandbox) => {
|
|
@@ -22307,7 +22616,10 @@ class PaymentApi {
|
|
|
22307
22616
|
});
|
|
22308
22617
|
};
|
|
22309
22618
|
/**
|
|
22619
|
+
* GET [/platform/public/namespaces/{namespace}/payment/orders/{paymentOrderNo}/status](api)
|
|
22620
|
+
*
|
|
22310
22621
|
* Check payment order paid status.
|
|
22622
|
+
*
|
|
22311
22623
|
* Returns: Payment order paid result
|
|
22312
22624
|
*/
|
|
22313
22625
|
this.getPaymentOrderStatus = (paymentOrderNo) => {
|
|
@@ -22321,7 +22633,10 @@ class PaymentApi {
|
|
|
22321
22633
|
return new PaymentStation$(Network.create(this.conf), this.namespace, this.cache).fetchNsPaymentMethods({ paymentOrderNo });
|
|
22322
22634
|
};
|
|
22323
22635
|
/**
|
|
22636
|
+
* GET [/platform/public/namespaces/{namespace}/payment/methods](api)
|
|
22637
|
+
*
|
|
22324
22638
|
* Check and get a payment order's should pay tax.
|
|
22639
|
+
*
|
|
22325
22640
|
* Returns: tax result
|
|
22326
22641
|
*/
|
|
22327
22642
|
this.getPaymentTax = (paymentProvider, paymentOrderNo, zipCode) => {
|
|
@@ -22332,7 +22647,10 @@ class PaymentApi {
|
|
|
22332
22647
|
});
|
|
22333
22648
|
};
|
|
22334
22649
|
/**
|
|
22650
|
+
* POST [/platform/public/namespaces/{namespace}/payment/link](api)
|
|
22651
|
+
*
|
|
22335
22652
|
* Get payment url.
|
|
22653
|
+
*
|
|
22336
22654
|
* Returns: Get payment link
|
|
22337
22655
|
*/
|
|
22338
22656
|
this.createPaymentUrl = (data) => {
|
|
@@ -22589,56 +22907,73 @@ class SubscriptionApi {
|
|
|
22589
22907
|
this.conf = conf;
|
|
22590
22908
|
this.namespace = namespace;
|
|
22591
22909
|
this.cache = cache;
|
|
22592
|
-
|
|
22593
|
-
|
|
22594
|
-
|
|
22595
|
-
|
|
22596
|
-
|
|
22597
|
-
|
|
22598
|
-
|
|
22599
|
-
|
|
22600
|
-
|
|
22601
|
-
|
|
22602
|
-
|
|
22603
|
-
|
|
22604
|
-
|
|
22605
|
-
|
|
22606
|
-
|
|
22607
|
-
|
|
22608
|
-
|
|
22609
|
-
|
|
22610
|
-
|
|
22611
|
-
|
|
22612
|
-
|
|
22613
|
-
|
|
22614
|
-
|
|
22615
|
-
|
|
22616
|
-
|
|
22617
|
-
|
|
22618
|
-
|
|
22619
|
-
|
|
22620
|
-
|
|
22621
|
-
|
|
22622
|
-
|
|
22623
|
-
|
|
22624
|
-
|
|
22625
|
-
|
|
22626
|
-
|
|
22627
|
-
|
|
22628
|
-
|
|
22629
|
-
|
|
22630
|
-
|
|
22631
|
-
|
|
22632
|
-
|
|
22633
|
-
|
|
22634
|
-
|
|
22635
|
-
|
|
22636
|
-
|
|
22637
|
-
|
|
22638
|
-
|
|
22639
|
-
|
|
22640
|
-
|
|
22641
|
-
|
|
22910
|
+
/**
|
|
22911
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions](api)
|
|
22912
|
+
*
|
|
22913
|
+
* Query user subscriptions.
|
|
22914
|
+
*
|
|
22915
|
+
* Returns: paginated subscription
|
|
22916
|
+
*/
|
|
22917
|
+
this.getUserSubscriptions = ({ userId, queryParams }) => {
|
|
22918
|
+
return this.newInstance().fetchNsUsersByUseridSubscriptions(userId, queryParams);
|
|
22919
|
+
};
|
|
22920
|
+
/**
|
|
22921
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}](api)
|
|
22922
|
+
*
|
|
22923
|
+
* Get user subscription.
|
|
22924
|
+
*
|
|
22925
|
+
* Returns: subscription
|
|
22926
|
+
*/
|
|
22927
|
+
this.getUserSubscriptionBySubscriptionId = ({ userId, subscriptionId }) => {
|
|
22928
|
+
return this.newInstance().fetchNsUsersByUseridSubscriptionsBySubscriptionid(userId, subscriptionId);
|
|
22929
|
+
};
|
|
22930
|
+
/**
|
|
22931
|
+
* POST [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions](api)
|
|
22932
|
+
*
|
|
22933
|
+
* Subscribe a subscription. Support both real and virtual payment. Need go through payment flow using the paymentOrderNo if paymentFlowRequired true.
|
|
22934
|
+
* __ACTIVE USER subscription can't do subscribe again.__
|
|
22935
|
+
* __The next billing date will be X(default 4) hours before the current period ends if correctly subscribed.__
|
|
22936
|
+
* User with permission SANDBOX will create sandbox subscription that not real paid.
|
|
22937
|
+
*
|
|
22938
|
+
* Returns: created subscription
|
|
22939
|
+
*/
|
|
22940
|
+
this.createSubscription = ({ userId, data }) => {
|
|
22941
|
+
return this.newInstance().postNsUsersByUseridSubscriptions(userId, data);
|
|
22942
|
+
};
|
|
22943
|
+
/**
|
|
22944
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}/history](api)
|
|
22945
|
+
*
|
|
22946
|
+
* Get user subscription billing histories.
|
|
22947
|
+
*
|
|
22948
|
+
* Returns: paginated subscription history
|
|
22949
|
+
*/
|
|
22950
|
+
this.getUserSubscriptionBillingHistory = ({ userId, subscriptionId, queryParams }) => {
|
|
22951
|
+
return this.newInstance().fetchNsUsersByUseridSubscriptionsBySubscriptionidHistory(userId, subscriptionId, queryParams);
|
|
22952
|
+
};
|
|
22953
|
+
/**
|
|
22954
|
+
* PUT [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}/billingAccount](api)
|
|
22955
|
+
*
|
|
22956
|
+
* Request to change a subscription billing account, this will guide user to payment station.
|
|
22957
|
+
* The actual change will happen at the 0 payment notification successfully handled.
|
|
22958
|
+
* Only ACTIVE USER subscription with real currency billing account can be changed.
|
|
22959
|
+
*
|
|
22960
|
+
* Returns: updated subscription
|
|
22961
|
+
*/
|
|
22962
|
+
this.updateUserSubscriptionPaymentMethod = ({ userId, subscriptionId }) => {
|
|
22963
|
+
return this.newInstance().putNsUsersByUseridSubscriptionsBySubscriptionidBillingAccount(userId, subscriptionId);
|
|
22964
|
+
};
|
|
22965
|
+
/**
|
|
22966
|
+
* PUT [/platform/public/namespaces/{namespace}/users/{userId}/subscriptions/{subscriptionId}/cancel](api)
|
|
22967
|
+
*
|
|
22968
|
+
* Cancel a subscription, only ACTIVE subscription can be cancelled.
|
|
22969
|
+
* __Ensure successfully cancel, recommend at least 1 day before current period ends, otherwise it may be charging or charged.__
|
|
22970
|
+
* Set immediate true, the subscription will be terminated immediately, otherwise till the end of current billing cycle.
|
|
22971
|
+
*
|
|
22972
|
+
* Returns: cancelled subscription
|
|
22973
|
+
*/
|
|
22974
|
+
this.cancelUserSubscription = ({ userId, subscriptionId, data }) => {
|
|
22975
|
+
return this.newInstance().putNsUsersByUseridSubscriptionsBySubscriptionidCancel(userId, subscriptionId, data);
|
|
22976
|
+
};
|
|
22642
22977
|
}
|
|
22643
22978
|
newInstance() {
|
|
22644
22979
|
return new Subscription$(Network.create(this.conf), this.namespace, this.cache);
|
|
@@ -22805,9 +23140,12 @@ class WalletApi {
|
|
|
22805
23140
|
this.namespace = namespace;
|
|
22806
23141
|
this.cache = cache;
|
|
22807
23142
|
/**
|
|
23143
|
+
* GET [/platform/public/namespaces/{namespace}/users/me/wallets/{currencyCode}](api)
|
|
23144
|
+
*
|
|
22808
23145
|
* get my wallet by currency code and namespace.
|
|
22809
23146
|
*
|
|
22810
23147
|
* Returns: wallet info
|
|
23148
|
+
*
|
|
22811
23149
|
* Path's namespace:
|
|
22812
23150
|
* - can be filled with __publisher namespace__ in order to get __publisher user wallet__
|
|
22813
23151
|
* - can be filled with __game namespace__ in order to get __game user wallet__
|
|
@@ -22816,7 +23154,10 @@ class WalletApi {
|
|
|
22816
23154
|
return this.newInstance().fetchNsUsersMeWalletsByCurrencycode(currencyCode);
|
|
22817
23155
|
};
|
|
22818
23156
|
/**
|
|
23157
|
+
* GET [/platform/public/namespaces/{namespace}/users/{userId}/wallets/{currencyCode}](api)
|
|
23158
|
+
*
|
|
22819
23159
|
* Get a wallet by currency code.
|
|
23160
|
+
*
|
|
22820
23161
|
* Returns: wallet info
|
|
22821
23162
|
*/
|
|
22822
23163
|
this.getWalletByUserId = (userId, currencyCode) => {
|
|
@@ -22824,6 +23165,7 @@ class WalletApi {
|
|
|
22824
23165
|
};
|
|
22825
23166
|
/**
|
|
22826
23167
|
* get a map of wallet represented by its currency code
|
|
23168
|
+
* @internal
|
|
22827
23169
|
*/
|
|
22828
23170
|
this.getWalletMap = async ({ userId, currencyCodes }) => {
|
|
22829
23171
|
try {
|