@accelbyte/sdk 0.2.0-beta.5 → 0.2.0-beta.8
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 +12 -0
- package/dist/index.browser.es.js +105 -38
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.d.ts +118 -14
- package/dist/index.node.es.js +105 -38
- package/dist/index.node.es.js.map +1 -1
- package/dist/index.node.js +105 -38
- package/dist/index.node.js.map +1 -1
- package/examples/typescript-node/README.md +13 -0
- package/examples/typescript-node/node-example.ts +60 -0
- package/package.json +1 -1
package/dist/index.node.js
CHANGED
|
@@ -11993,28 +11993,12 @@ class DesktopChecker {
|
|
|
11993
11993
|
}
|
|
11994
11994
|
DesktopChecker.desktopApp = DesktopChecker.isElectron();
|
|
11995
11995
|
|
|
11996
|
-
/*
|
|
11997
|
-
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
11998
|
-
* This is licensed software from AccelByte Inc, for limitations
|
|
11999
|
-
* and restrictions contact your company contract manager.
|
|
12000
|
-
*/
|
|
12001
|
-
class BrowserHelper {
|
|
12002
|
-
}
|
|
12003
|
-
BrowserHelper.isOnBrowser = () => {
|
|
12004
|
-
return typeof window !== 'undefined' && window.document;
|
|
12005
|
-
};
|
|
12006
|
-
|
|
12007
|
-
/*
|
|
12008
|
-
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
12009
|
-
* This is licensed software from AccelByte Inc, for limitations
|
|
12010
|
-
* and restrictions contact your company contract manager.
|
|
12011
|
-
*/
|
|
12012
11996
|
class RefreshSession {
|
|
12013
11997
|
}
|
|
12014
11998
|
// --
|
|
12015
11999
|
RefreshSession.KEY = 'RefreshSession.lock';
|
|
12016
12000
|
RefreshSession.isLocked = () => {
|
|
12017
|
-
if (!
|
|
12001
|
+
if (!UrlHelper.isOnBrowser())
|
|
12018
12002
|
return false;
|
|
12019
12003
|
const lockStatus = localStorage.getItem(RefreshSession.KEY);
|
|
12020
12004
|
if (!lockStatus) {
|
|
@@ -12027,12 +12011,12 @@ RefreshSession.isLocked = () => {
|
|
|
12027
12011
|
return lockExpiry > new Date().getTime();
|
|
12028
12012
|
};
|
|
12029
12013
|
RefreshSession.lock = (expiry) => {
|
|
12030
|
-
if (!
|
|
12014
|
+
if (!UrlHelper.isOnBrowser())
|
|
12031
12015
|
return;
|
|
12032
12016
|
localStorage.setItem(RefreshSession.KEY, `${new Date().getTime() + expiry}`);
|
|
12033
12017
|
};
|
|
12034
12018
|
RefreshSession.unlock = () => {
|
|
12035
|
-
if (!
|
|
12019
|
+
if (!UrlHelper.isOnBrowser())
|
|
12036
12020
|
return;
|
|
12037
12021
|
localStorage.removeItem(RefreshSession.KEY);
|
|
12038
12022
|
};
|
|
@@ -18937,12 +18921,12 @@ CodeChallenge.load = () => {
|
|
|
18937
18921
|
return parseStoredState(localStorage.getItem('pp:pkce:cd') || '');
|
|
18938
18922
|
};
|
|
18939
18923
|
CodeChallenge.save = (codeVerifier) => {
|
|
18940
|
-
if (
|
|
18924
|
+
if (UrlHelper.isOnBrowser()) {
|
|
18941
18925
|
localStorage.setItem('pp:pkce:cd', stringifyStoredState(codeVerifier));
|
|
18942
18926
|
}
|
|
18943
18927
|
};
|
|
18944
18928
|
CodeChallenge.clear = () => {
|
|
18945
|
-
if (
|
|
18929
|
+
if (UrlHelper.isOnBrowser()) {
|
|
18946
18930
|
localStorage.removeItem('pp:pkce:cd');
|
|
18947
18931
|
}
|
|
18948
18932
|
};
|
|
@@ -18977,7 +18961,7 @@ const stringifyStoredState = (storedState) => {
|
|
|
18977
18961
|
};
|
|
18978
18962
|
|
|
18979
18963
|
/*
|
|
18980
|
-
* Copyright (c) 2022 AccelByte Inc. All Rights Reserved
|
|
18964
|
+
* Copyright (c) 2022-2023 AccelByte Inc. All Rights Reserved
|
|
18981
18965
|
* This is licensed software from AccelByte Inc, for limitations
|
|
18982
18966
|
* and restrictions contact your company contract manager.
|
|
18983
18967
|
*/
|
|
@@ -19012,6 +18996,9 @@ class UrlHelper {
|
|
|
19012
18996
|
return new URL(pathname, origin).toString();
|
|
19013
18997
|
}
|
|
19014
18998
|
}
|
|
18999
|
+
UrlHelper.isOnBrowser = () => {
|
|
19000
|
+
return typeof window !== 'undefined' && window.document;
|
|
19001
|
+
};
|
|
19015
19002
|
UrlHelper.isCompleteURLString = (urlString) => {
|
|
19016
19003
|
try {
|
|
19017
19004
|
const url = new URL(urlString);
|
|
@@ -20406,7 +20393,7 @@ class UserAuthorizationApi {
|
|
|
20406
20393
|
return;
|
|
20407
20394
|
const { mfa_token: mfaToken, factors, default_factor: defaultFactor, email } = errorResponse.data;
|
|
20408
20395
|
const result = { mfaToken, factors, defaultFactor, email };
|
|
20409
|
-
if (
|
|
20396
|
+
if (UrlHelper.isOnBrowser()) {
|
|
20410
20397
|
localStorage.setItem(MFA_DATA_STORAGE_KEY, JSON.stringify(result));
|
|
20411
20398
|
}
|
|
20412
20399
|
return result;
|
|
@@ -20415,7 +20402,7 @@ class UserAuthorizationApi {
|
|
|
20415
20402
|
* @internal
|
|
20416
20403
|
*/
|
|
20417
20404
|
this.getMfaDataFromStorage = () => {
|
|
20418
|
-
const storedMFAData =
|
|
20405
|
+
const storedMFAData = UrlHelper.isOnBrowser() && localStorage.getItem(MFA_DATA_STORAGE_KEY);
|
|
20419
20406
|
return storedMFAData ? JSON.parse(storedMFAData) : null;
|
|
20420
20407
|
};
|
|
20421
20408
|
/**
|
|
@@ -24725,7 +24712,13 @@ class EntitlementApi {
|
|
|
24725
24712
|
* This is licensed software from AccelByte Inc, for limitations
|
|
24726
24713
|
* and restrictions contact your company contract manager.
|
|
24727
24714
|
*/
|
|
24728
|
-
const CreditSummary = mod.object({
|
|
24715
|
+
const CreditSummary = mod.object({
|
|
24716
|
+
walletId: mod.string(),
|
|
24717
|
+
namespace: mod.string(),
|
|
24718
|
+
userId: mod.string(),
|
|
24719
|
+
amount: mod.number().int(),
|
|
24720
|
+
currencyCode: mod.string().nullish()
|
|
24721
|
+
});
|
|
24729
24722
|
|
|
24730
24723
|
/*
|
|
24731
24724
|
* Copyright (c) 2022-2023 AccelByte Inc. All Rights Reserved
|
|
@@ -24735,6 +24728,7 @@ const CreditSummary = mod.object({ walletId: mod.string(), namespace: mod.string
|
|
|
24735
24728
|
const EntitlementSummary = mod.object({
|
|
24736
24729
|
id: mod.string(),
|
|
24737
24730
|
namespace: mod.string(),
|
|
24731
|
+
name: mod.string().nullish(),
|
|
24738
24732
|
userId: mod.string(),
|
|
24739
24733
|
clazz: mod.enum(['APP', 'ENTITLEMENT', 'CODE', 'SUBSCRIPTION', 'MEDIA', 'OPTIONBOX', 'LOOTBOX']),
|
|
24740
24734
|
type: mod.enum(['DURABLE', 'CONSUMABLE']),
|
|
@@ -26910,7 +26904,63 @@ const injectErrorInterceptors = (baseUrl, onUserEligibilityChange, onError) => {
|
|
|
26910
26904
|
var version="x.y.z";var build$1="x.y.z";var timestamp="x.y.z";var buildInfo = {version:version,build:build$1,timestamp:timestamp};
|
|
26911
26905
|
|
|
26912
26906
|
/*
|
|
26913
|
-
* Copyright (c)
|
|
26907
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26908
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26909
|
+
* and restrictions contact your company contract manager.
|
|
26910
|
+
*/
|
|
26911
|
+
var BasicVersion = { name: 'justice-basic-service', version: '2.6.0', buildDate: '2023-02-21T19:51:38.655Z' };
|
|
26912
|
+
|
|
26913
|
+
/*
|
|
26914
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26915
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26916
|
+
* and restrictions contact your company contract manager.
|
|
26917
|
+
*/
|
|
26918
|
+
var BuildinfoVersion = { name: 'justice-buildinfo-service', version: '3.28.2', buildDate: '2023-02-21T19:51:38.678Z' };
|
|
26919
|
+
|
|
26920
|
+
/*
|
|
26921
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26922
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26923
|
+
* and restrictions contact your company contract manager.
|
|
26924
|
+
*/
|
|
26925
|
+
var EventVersion = { name: 'justice-event-log-service', version: undefined, buildDate: '2023-02-21T19:51:38.687Z' };
|
|
26926
|
+
|
|
26927
|
+
/*
|
|
26928
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26929
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26930
|
+
* and restrictions contact your company contract manager.
|
|
26931
|
+
*/
|
|
26932
|
+
var GdprVersion = { name: 'justice-gdpr-service', version: '1.19.1', buildDate: '2023-02-21T19:51:38.692Z' };
|
|
26933
|
+
|
|
26934
|
+
/*
|
|
26935
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26936
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26937
|
+
* and restrictions contact your company contract manager.
|
|
26938
|
+
*/
|
|
26939
|
+
var IamVersion = { name: 'justice-iam-service', version: '5.28.0', buildDate: '2023-02-21T19:51:38.699Z' };
|
|
26940
|
+
|
|
26941
|
+
/*
|
|
26942
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26943
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26944
|
+
* and restrictions contact your company contract manager.
|
|
26945
|
+
*/
|
|
26946
|
+
var LegalVersion = { name: 'justice-legal-service', version: '1.27.0', buildDate: '2023-02-21T19:51:38.669Z' };
|
|
26947
|
+
|
|
26948
|
+
/*
|
|
26949
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26950
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26951
|
+
* and restrictions contact your company contract manager.
|
|
26952
|
+
*/
|
|
26953
|
+
var OdinConfigVersion = { name: 'config-service-app', version: 'dev', buildDate: '2023-02-21T19:51:38.691Z' };
|
|
26954
|
+
|
|
26955
|
+
/*
|
|
26956
|
+
* Copyright (c) 2023 AccelByte Inc. All Rights Reserved
|
|
26957
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
26958
|
+
* and restrictions contact your company contract manager.
|
|
26959
|
+
*/
|
|
26960
|
+
var PlatformVersion = { name: 'justice-platform-service', version: '4.24.0', buildDate: '2023-02-21T19:51:38.742Z' };
|
|
26961
|
+
|
|
26962
|
+
/*
|
|
26963
|
+
* Copyright (c) 2022-2023 AccelByte Inc. All Rights Reserved
|
|
26914
26964
|
* This is licensed software from AccelByte Inc, for limitations
|
|
26915
26965
|
* and restrictions contact your company contract manager.
|
|
26916
26966
|
*/
|
|
@@ -26987,18 +27037,21 @@ class AccelbyteSDKFactory {
|
|
|
26987
27037
|
OAuth: (overrides) => ApiFactory.oauthApi(this.config, this.options, this.options.namespace, this.override(overrides)),
|
|
26988
27038
|
InputValidation: (overrides) => ApiFactory.inputValidationApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26989
27039
|
ThirdPartyCredential: (overrides) => ApiFactory.thirdPartyCredentialApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26990
|
-
TwoFA: (overrides) => ApiFactory.twoFA(this.config, this.options.namespace, this.override(overrides))
|
|
27040
|
+
TwoFA: (overrides) => ApiFactory.twoFA(this.config, this.options.namespace, this.override(overrides)),
|
|
27041
|
+
version: IamVersion
|
|
26991
27042
|
},
|
|
26992
27043
|
BuildInfo: {
|
|
26993
27044
|
Downloader: (overrides) => ApiFactory.downloaderApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26994
27045
|
Caching: (overrides) => ApiFactory.cachingApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26995
|
-
DLC: (overrides) => ApiFactory.dlcApi(this.config, this.options.namespace, this.override(overrides))
|
|
27046
|
+
DLC: (overrides) => ApiFactory.dlcApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27047
|
+
version: BuildinfoVersion
|
|
26996
27048
|
},
|
|
26997
27049
|
Basic: {
|
|
26998
27050
|
Misc: (overrides) => ApiFactory.miscApi(this.config, this.options.namespace, this.override(overrides)),
|
|
26999
27051
|
UserProfile: (overrides) => ApiFactory.userProfileApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27000
27052
|
FileUpload: (overrides) => ApiFactory.fileUploadApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27001
|
-
Namespace: (overrides) => ApiFactory.namespaceApi(this.config, this.options.namespace, this.override(overrides))
|
|
27053
|
+
Namespace: (overrides) => ApiFactory.namespaceApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27054
|
+
version: BasicVersion
|
|
27002
27055
|
},
|
|
27003
27056
|
Platform: {
|
|
27004
27057
|
Currency: (overrides) => ApiFactory.currencyApi(this.config, this.options.namespace, this.override(overrides)),
|
|
@@ -27008,23 +27061,37 @@ class AccelbyteSDKFactory {
|
|
|
27008
27061
|
Order: (overrides) => ApiFactory.orderApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27009
27062
|
Payment: (overrides) => ApiFactory.paymentApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27010
27063
|
Subscription: (overrides) => ApiFactory.subscriptionApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27011
|
-
Wallet: (overrides) => ApiFactory.walletApi(this.config, this.options.namespace, this.override(overrides))
|
|
27064
|
+
Wallet: (overrides) => ApiFactory.walletApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27065
|
+
version: PlatformVersion
|
|
27012
27066
|
},
|
|
27013
27067
|
Legal: {
|
|
27014
27068
|
Eligibilities: (overrides) => ApiFactory.eligibillitiesApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27015
27069
|
Agreement: (overrides) => ApiFactory.agreementApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27016
27070
|
Policies: (overrides) => ApiFactory.policiesApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27017
|
-
LocalizedPolicyVersions: (overrides) => ApiFactory.localizedPolicyVersionsApi(this.config, this.options.namespace, this.override(overrides))
|
|
27071
|
+
LocalizedPolicyVersions: (overrides) => ApiFactory.localizedPolicyVersionsApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27072
|
+
version: LegalVersion
|
|
27018
27073
|
},
|
|
27019
27074
|
GDPR: {
|
|
27020
27075
|
DataDeletion: (overrides) => ApiFactory.dataDeletionApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27021
|
-
DataRetrieval: (overrides) => ApiFactory.dataRetrievalApi(this.config, this.options.namespace, this.override(overrides))
|
|
27076
|
+
DataRetrieval: (overrides) => ApiFactory.dataRetrievalApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27077
|
+
version: GdprVersion
|
|
27022
27078
|
},
|
|
27023
27079
|
Event: {
|
|
27024
|
-
Event: (overrides) => ApiFactory.eventApi(this.config, this.options.namespace, this.override(overrides))
|
|
27080
|
+
Event: (overrides) => ApiFactory.eventApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27081
|
+
version: EventVersion
|
|
27025
27082
|
},
|
|
27026
27083
|
AccelbyteConfig: {
|
|
27027
|
-
PublicTemplate: (overrides) => ApiFactory.publicTemplateApi(this.config, this.options.namespace, this.override(overrides))
|
|
27084
|
+
PublicTemplate: (overrides) => ApiFactory.publicTemplateApi(this.config, this.options.namespace, this.override(overrides)),
|
|
27085
|
+
version: OdinConfigVersion
|
|
27086
|
+
},
|
|
27087
|
+
version: () => {
|
|
27088
|
+
console.log('IamVersion: ', IamVersion.version);
|
|
27089
|
+
console.log('BuildinfoVersion: ', BuildinfoVersion.version);
|
|
27090
|
+
console.log('BasicVersion: ', BasicVersion.version);
|
|
27091
|
+
console.log('PlatformVersion: ', PlatformVersion.version);
|
|
27092
|
+
console.log('LegalVersion: ', LegalVersion.version);
|
|
27093
|
+
console.log('GdprVersion: ', GdprVersion.version);
|
|
27094
|
+
console.log('EventVersion: ', EventVersion.version);
|
|
27028
27095
|
}
|
|
27029
27096
|
};
|
|
27030
27097
|
}
|
|
@@ -28175,7 +28242,7 @@ const InviteUserRequestV4 = mod.object({
|
|
|
28175
28242
|
assignedNamespaces: mod.array(mod.string()),
|
|
28176
28243
|
emailAddresses: mod.array(mod.string()),
|
|
28177
28244
|
isAdmin: mod.boolean(),
|
|
28178
|
-
namespace: mod.string(),
|
|
28245
|
+
namespace: mod.string().nullish(),
|
|
28179
28246
|
roleId: mod.string()
|
|
28180
28247
|
});
|
|
28181
28248
|
|
|
@@ -28703,7 +28770,7 @@ const ThirdPartyLoginPlatformCredentialRequest = mod.object({
|
|
|
28703
28770
|
ACSURL: mod.string(),
|
|
28704
28771
|
AWSCognitoRegion: mod.string(),
|
|
28705
28772
|
AWSCognitoUserPool: mod.string(),
|
|
28706
|
-
AllowedClients: mod.array(mod.string()),
|
|
28773
|
+
AllowedClients: mod.array(mod.string()).nullish(),
|
|
28707
28774
|
AppId: mod.string(),
|
|
28708
28775
|
AuthorizationEndpoint: mod.string(),
|
|
28709
28776
|
ClientId: mod.string(),
|
|
@@ -28722,7 +28789,7 @@ const ThirdPartyLoginPlatformCredentialRequest = mod.object({
|
|
|
28722
28789
|
Secret: mod.string(),
|
|
28723
28790
|
TeamID: mod.string(),
|
|
28724
28791
|
TokenAuthenticationType: mod.string(),
|
|
28725
|
-
TokenClaimsMapping: mod.record(mod.string()),
|
|
28792
|
+
TokenClaimsMapping: mod.record(mod.string()).nullish(),
|
|
28726
28793
|
TokenEndpoint: mod.string(),
|
|
28727
28794
|
UserInfoEndpoint: mod.string(),
|
|
28728
28795
|
UserInfoHTTPMethod: mod.string(),
|
|
@@ -40267,7 +40334,6 @@ exports.BlockDownloadUrls = BlockDownloadUrls;
|
|
|
40267
40334
|
exports.BlockDownloadUrlsRequest = BlockDownloadUrlsRequest;
|
|
40268
40335
|
exports.BlockManifest = BlockManifest;
|
|
40269
40336
|
exports.BoxItem = BoxItem;
|
|
40270
|
-
exports.BrowserHelper = BrowserHelper;
|
|
40271
40337
|
exports.BuildAvailability = BuildAvailability;
|
|
40272
40338
|
exports.BuildAvailabilityArray = BuildAvailabilityArray;
|
|
40273
40339
|
exports.BuildDeletionData = BuildDeletionData;
|
|
@@ -40384,6 +40450,7 @@ exports.DeletionData = DeletionData;
|
|
|
40384
40450
|
exports.DeletionStatus = DeletionStatus;
|
|
40385
40451
|
exports.DependencyObject = DependencyObject;
|
|
40386
40452
|
exports.Description = Description;
|
|
40453
|
+
exports.DesktopChecker = DesktopChecker;
|
|
40387
40454
|
exports.DetailedWalletTransactionInfo = DetailedWalletTransactionInfo;
|
|
40388
40455
|
exports.DetailedWalletTransactionPagingSlicedResult = DetailedWalletTransactionPagingSlicedResult;
|
|
40389
40456
|
exports.DeviceBanRequestV4 = DeviceBanRequestV4;
|