@accelbyte/sdk 0.1.1-alpha.39 → 0.1.1-alpha.41
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 +5 -0
- package/dist/index.d.ts +262 -11
- package/dist/index.es.js +152 -10
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +153 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -45
- package/dist/package.json +0 -16
package/dist/index.js
CHANGED
|
@@ -2968,9 +2968,6 @@ const TokenWithDeviceCookieResponseV3 = zod.z.object({
|
|
|
2968
2968
|
xuid: zod.z.string().nullish()
|
|
2969
2969
|
});
|
|
2970
2970
|
|
|
2971
|
-
/**
|
|
2972
|
-
* DON'T EDIT THIS FILE, it is AUTO GENERATED
|
|
2973
|
-
*/
|
|
2974
2971
|
class OAuth20$ {
|
|
2975
2972
|
// @ts-ignore
|
|
2976
2973
|
constructor(axiosInstance, namespace, cache = false) {
|
|
@@ -11915,7 +11912,7 @@ class UserAuthorization {
|
|
|
11915
11912
|
returnPath
|
|
11916
11913
|
};
|
|
11917
11914
|
};
|
|
11918
|
-
this.createLoginURL = (returnPath, targetAuthPage) => {
|
|
11915
|
+
this.createLoginURL = (returnPath, targetAuthPage, oneTimeLinkCode) => {
|
|
11919
11916
|
const { verifier, challenge } = CodeChallenge.generateChallenge();
|
|
11920
11917
|
const csrf = CodeChallenge.generateCsrf();
|
|
11921
11918
|
const storedState = {
|
|
@@ -11932,6 +11929,9 @@ class UserAuthorization {
|
|
|
11932
11929
|
if (targetAuthPage) {
|
|
11933
11930
|
searchParams.append('target_auth_page', targetAuthPage);
|
|
11934
11931
|
}
|
|
11932
|
+
if (oneTimeLinkCode) {
|
|
11933
|
+
searchParams.append('oneTimeLinkCode', oneTimeLinkCode);
|
|
11934
|
+
}
|
|
11935
11935
|
const url = new URL(UrlHelper.combineURLPaths(this.options.baseURL, `${AUTHORIZE_URL}?${searchParams.toString()}`));
|
|
11936
11936
|
return url.toString();
|
|
11937
11937
|
};
|
|
@@ -12032,9 +12032,20 @@ const CountryLocationResponse = zod.z.object({ city: zod.z.string(), countryCode
|
|
|
12032
12032
|
*/
|
|
12033
12033
|
const GameTokenCodeResponse = zod.z.object({ code: zod.z.string() });
|
|
12034
12034
|
|
|
12035
|
-
|
|
12036
|
-
*
|
|
12035
|
+
/*
|
|
12036
|
+
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
12037
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
12038
|
+
* and restrictions contact your company contract manager.
|
|
12039
|
+
*/
|
|
12040
|
+
const OneTimeLinkingCodeResponse = zod.z.object({ exp: zod.z.number().int(), oneTimeLinkCode: zod.z.string(), oneTimeLinkUrl: zod.z.string() });
|
|
12041
|
+
|
|
12042
|
+
/*
|
|
12043
|
+
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
12044
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
12045
|
+
* and restrictions contact your company contract manager.
|
|
12037
12046
|
*/
|
|
12047
|
+
const OneTimeLinkingCodeValidationResponse = zod.z.object({ expired: zod.z.boolean(), valid: zod.z.boolean() });
|
|
12048
|
+
|
|
12038
12049
|
class OAuth20Extension$ {
|
|
12039
12050
|
// @ts-ignore
|
|
12040
12051
|
constructor(axiosInstance, namespace, cache = false) {
|
|
@@ -12098,6 +12109,53 @@ class OAuth20Extension$ {
|
|
|
12098
12109
|
});
|
|
12099
12110
|
return Validate.responseType(() => resultPromise, TokenResponseV3);
|
|
12100
12111
|
}
|
|
12112
|
+
/**
|
|
12113
|
+
* <p>This endpoint is being used to request the one time code [8 length] for headless account to link or upgrade to a full account.<br>
|
|
12114
|
+
* It require a valid user token.<br>
|
|
12115
|
+
* Should specify the target platform id and current user should already linked to this platform.<br>
|
|
12116
|
+
* Current user should be a headless account.<br>
|
|
12117
|
+
* </p>
|
|
12118
|
+
*/
|
|
12119
|
+
postIamV3LinkCodeRequest(data) {
|
|
12120
|
+
const params = {};
|
|
12121
|
+
const url = '/iam/v3/link/code/request';
|
|
12122
|
+
const resultPromise = this.axiosInstance.post(url, CodeGenUtil.getFormUrlEncodedData(data), {
|
|
12123
|
+
...params,
|
|
12124
|
+
headers: { ...params.headers, 'content-type': 'application/x-www-form-urlencoded' }
|
|
12125
|
+
});
|
|
12126
|
+
return Validate.responseType(() => resultPromise, OneTimeLinkingCodeResponse);
|
|
12127
|
+
}
|
|
12128
|
+
/**
|
|
12129
|
+
* <p>This endpoint is being used to validate one time link code.<br>
|
|
12130
|
+
* It require a valid user token.<br>
|
|
12131
|
+
* Should specify the target platform id and current user should already linked to this platform.<br>
|
|
12132
|
+
* Current user should be a headless account.<br>
|
|
12133
|
+
* </p>
|
|
12134
|
+
*/
|
|
12135
|
+
postIamV3LinkCodeValidate(data) {
|
|
12136
|
+
const params = {};
|
|
12137
|
+
const url = '/iam/v3/link/code/validate';
|
|
12138
|
+
const resultPromise = this.axiosInstance.post(url, CodeGenUtil.getFormUrlEncodedData(data), {
|
|
12139
|
+
...params,
|
|
12140
|
+
headers: { ...params.headers, 'content-type': 'application/x-www-form-urlencoded' }
|
|
12141
|
+
});
|
|
12142
|
+
return Validate.responseType(() => resultPromise, OneTimeLinkingCodeValidationResponse);
|
|
12143
|
+
}
|
|
12144
|
+
/**
|
|
12145
|
+
* <p>This endpoint is being used to generate user's token by one time link code.<br>
|
|
12146
|
+
* It require publisher ClientID<br>
|
|
12147
|
+
* It required a code which can be generated from <strong>/iam/v3/link/code/request</strong>.<br>
|
|
12148
|
+
* </p>
|
|
12149
|
+
*/
|
|
12150
|
+
postIamV3LinkTokenExchange(data) {
|
|
12151
|
+
const params = {};
|
|
12152
|
+
const url = '/iam/v3/link/token/exchange';
|
|
12153
|
+
const resultPromise = this.axiosInstance.post(url, CodeGenUtil.getFormUrlEncodedData(data), {
|
|
12154
|
+
...params,
|
|
12155
|
+
headers: { ...params.headers, 'content-type': 'application/x-www-form-urlencoded' }
|
|
12156
|
+
});
|
|
12157
|
+
return Validate.responseType(() => resultPromise, TokenResponseV3);
|
|
12158
|
+
}
|
|
12101
12159
|
/**
|
|
12102
12160
|
* <p>This endpoint get country location based on the request.</p>
|
|
12103
12161
|
*/
|
|
@@ -12309,6 +12367,25 @@ class OAuthApi {
|
|
|
12309
12367
|
newOAuth20Extension() {
|
|
12310
12368
|
return new OAuth20Extension$(Network.create(this.conf), this.namespace, this.cache);
|
|
12311
12369
|
}
|
|
12370
|
+
/**
|
|
12371
|
+
* This method is being used to validate one time link code.
|
|
12372
|
+
* It require a valid user token.
|
|
12373
|
+
* Should specify the target platform id and current user should already linked to this platform.
|
|
12374
|
+
* Current user should be a headless account.
|
|
12375
|
+
*
|
|
12376
|
+
*/
|
|
12377
|
+
validateOneTimeLinkCode(data) {
|
|
12378
|
+
return this.newOAuth20Extension().postIamV3LinkCodeValidate(data);
|
|
12379
|
+
}
|
|
12380
|
+
/**
|
|
12381
|
+
* This method is being used to generate user's token by one time link code.
|
|
12382
|
+
* It require publisher ClientID
|
|
12383
|
+
* It required a code which can be generated from <strong>/iam/v3/link/code/request</strong>.<br>
|
|
12384
|
+
*
|
|
12385
|
+
*/
|
|
12386
|
+
exchangeTokenByOneTimeLinkCode(data) {
|
|
12387
|
+
return this.newOAuth20Extension().postIamV3LinkTokenExchange(data);
|
|
12388
|
+
}
|
|
12312
12389
|
newInstance() {
|
|
12313
12390
|
return new OAuth20$(Network.create(this.conf), this.namespace, this.cache);
|
|
12314
12391
|
}
|
|
@@ -13022,6 +13099,31 @@ const DistinctLinkedPlatformV3 = zod.z.object({
|
|
|
13022
13099
|
*/
|
|
13023
13100
|
const DistinctPlatformResponseV3 = zod.z.object({ platforms: zod.z.array(DistinctLinkedPlatformV3) });
|
|
13024
13101
|
|
|
13102
|
+
/*
|
|
13103
|
+
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
13104
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
13105
|
+
* and restrictions contact your company contract manager.
|
|
13106
|
+
*/
|
|
13107
|
+
const AccountProgressionInfo = zod.z.object({
|
|
13108
|
+
displayName: zod.z.string().nullish(),
|
|
13109
|
+
email: zod.z.string().nullish(),
|
|
13110
|
+
linkedGames: zod.z.array(zod.z.string()).nullish(),
|
|
13111
|
+
userName: zod.z.string().nullish()
|
|
13112
|
+
});
|
|
13113
|
+
|
|
13114
|
+
/*
|
|
13115
|
+
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
13116
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
13117
|
+
* and restrictions contact your company contract manager.
|
|
13118
|
+
*/
|
|
13119
|
+
const GetLinkHeadlessAccountConflictResponse = zod.z.object({
|
|
13120
|
+
currentAccount: AccountProgressionInfo.nullish(),
|
|
13121
|
+
headlessAccount: AccountProgressionInfo.nullish(),
|
|
13122
|
+
platformAlreadyLinked: zod.z.boolean(),
|
|
13123
|
+
platformId: zod.z.string(),
|
|
13124
|
+
platformLinkConflict: zod.z.boolean()
|
|
13125
|
+
});
|
|
13126
|
+
|
|
13025
13127
|
/*
|
|
13026
13128
|
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
13027
13129
|
* This is licensed software from AccelByte Inc, for limitations
|
|
@@ -13346,9 +13448,6 @@ const UserPlatforms = zod.z.object({ userIdPlatforms: zod.z.array(UserPlatformIn
|
|
|
13346
13448
|
*/
|
|
13347
13449
|
const WebLinkingResponse = zod.z.object({ third_party_url: zod.z.string() });
|
|
13348
13450
|
|
|
13349
|
-
/**
|
|
13350
|
-
* DON'T EDIT THIS FILE, it is AUTO GENERATED
|
|
13351
|
-
*/
|
|
13352
13451
|
class Users$ {
|
|
13353
13452
|
// @ts-ignore
|
|
13354
13453
|
constructor(axiosInstance, namespace, cache = false) {
|
|
@@ -14077,6 +14176,33 @@ class Users$ {
|
|
|
14077
14176
|
const key = url + CodeGenUtil.hashCode(JSON.stringify({ params }));
|
|
14078
14177
|
return SdkCache.withCache(key, res);
|
|
14079
14178
|
}
|
|
14179
|
+
/**
|
|
14180
|
+
* Note:<br>
|
|
14181
|
+
* 1. My account should be full account
|
|
14182
|
+
* 2. My account not linked to request headless account's third platform.
|
|
14183
|
+
*/
|
|
14184
|
+
fetchIamV3PublicUsersMeHeadlessLinkConflict(queryParams) {
|
|
14185
|
+
const params = { ...queryParams };
|
|
14186
|
+
const url = '/iam/v3/public/users/me/headless/link/conflict';
|
|
14187
|
+
const resultPromise = this.axiosInstance.get(url, { params });
|
|
14188
|
+
const res = () => Validate.responseType(() => resultPromise, GetLinkHeadlessAccountConflictResponse);
|
|
14189
|
+
if (!this.cache) {
|
|
14190
|
+
return SdkCache.withoutCache(res);
|
|
14191
|
+
}
|
|
14192
|
+
const key = url + CodeGenUtil.hashCode(JSON.stringify({ params }));
|
|
14193
|
+
return SdkCache.withCache(key, res);
|
|
14194
|
+
}
|
|
14195
|
+
/**
|
|
14196
|
+
* Note:<br>
|
|
14197
|
+
* 1. My account should be full account
|
|
14198
|
+
* 2. My account not linked to headless account's third platform.
|
|
14199
|
+
*/
|
|
14200
|
+
postIamV3PublicUsersMeHeadlessLinkWithProgression(data) {
|
|
14201
|
+
const params = {};
|
|
14202
|
+
const url = '/iam/v3/public/users/me/headless/linkWithProgression';
|
|
14203
|
+
const resultPromise = this.axiosInstance.post(url, data, { params });
|
|
14204
|
+
return Validate.responseType(() => resultPromise, zod.z.unknown());
|
|
14205
|
+
}
|
|
14080
14206
|
/**
|
|
14081
14207
|
* Required valid user authorization
|
|
14082
14208
|
* <p>The verification link is sent to email address</p>
|
|
@@ -14394,6 +14520,22 @@ class UserApi {
|
|
|
14394
14520
|
getLinkedAccount(userId) {
|
|
14395
14521
|
return this.newInstance().fetchV3UsersByUseridPlatforms(userId);
|
|
14396
14522
|
}
|
|
14523
|
+
/**
|
|
14524
|
+
* Note:<br>
|
|
14525
|
+
* 1. My account should be full account
|
|
14526
|
+
* 2. My account not linked to request headless account's third platform.
|
|
14527
|
+
*/
|
|
14528
|
+
getLinkAccountByOneTimeCodeConflict(params) {
|
|
14529
|
+
return this.newInstance().fetchIamV3PublicUsersMeHeadlessLinkConflict(params);
|
|
14530
|
+
}
|
|
14531
|
+
/**
|
|
14532
|
+
* Note:<br>
|
|
14533
|
+
* 1. My account should be full account
|
|
14534
|
+
* 2. My account not linked to headless account's third platform.
|
|
14535
|
+
*/
|
|
14536
|
+
linkWithProgression(data) {
|
|
14537
|
+
return this.newInstance().postIamV3PublicUsersMeHeadlessLinkWithProgression(data);
|
|
14538
|
+
}
|
|
14397
14539
|
/**
|
|
14398
14540
|
* @internal
|
|
14399
14541
|
*/
|
|
@@ -25058,6 +25200,7 @@ exports.Accelbyte = Accelbyte;
|
|
|
25058
25200
|
exports.AcceptAgreementRequest = AcceptAgreementRequest;
|
|
25059
25201
|
exports.AcceptAgreementResponse = AcceptAgreementResponse;
|
|
25060
25202
|
exports.AcceptedPoliciesRequest = AcceptedPoliciesRequest;
|
|
25203
|
+
exports.AccountProgressionInfo = AccountProgressionInfo;
|
|
25061
25204
|
exports.AchievementInfo = AchievementInfo;
|
|
25062
25205
|
exports.Action = Action;
|
|
25063
25206
|
exports.AddCountryGroupRequest = AddCountryGroupRequest;
|
|
@@ -25332,6 +25475,7 @@ exports.FullItemPagingSlicedResult = FullItemPagingSlicedResult;
|
|
|
25332
25475
|
exports.GameTokenCodeResponse = GameTokenCodeResponse;
|
|
25333
25476
|
exports.GenericQueryPayload = GenericQueryPayload;
|
|
25334
25477
|
exports.GetAdminUsersResponse = GetAdminUsersResponse;
|
|
25478
|
+
exports.GetLinkHeadlessAccountConflictResponse = GetLinkHeadlessAccountConflictResponse;
|
|
25335
25479
|
exports.GetPublisherUserResponse = GetPublisherUserResponse;
|
|
25336
25480
|
exports.GetPublisherUserV3Response = GetPublisherUserV3Response;
|
|
25337
25481
|
exports.GetUserBanV3Response = GetUserBanV3Response;
|