@rtsdk/topia 0.8.5 → 0.9.1
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/README.md +115 -11
- package/dist/index.cjs +256 -28
- package/dist/index.d.ts +232 -2
- package/dist/index.js +256 -28
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39717,7 +39717,7 @@ class SDKController {
|
|
|
39717
39717
|
*/
|
|
39718
39718
|
class Asset extends SDKController {
|
|
39719
39719
|
constructor(topia, id, options = { attributes: {}, credentials: {} }) {
|
|
39720
|
-
var _a, _b, _c, _d, _e;
|
|
39720
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39721
39721
|
// assetId and urlSlug should only be used when Asset is extended by DroppedAsset
|
|
39722
39722
|
super(topia, {
|
|
39723
39723
|
apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
|
|
@@ -39727,12 +39727,23 @@ class Asset extends SDKController {
|
|
|
39727
39727
|
visitorId: (_e = options === null || options === void 0 ? void 0 : options.credentials) === null || _e === void 0 ? void 0 : _e.visitorId,
|
|
39728
39728
|
});
|
|
39729
39729
|
this.id = id;
|
|
39730
|
+
this.urlSlug = (_f = options === null || options === void 0 ? void 0 : options.credentials) === null || _f === void 0 ? void 0 : _f.urlSlug;
|
|
39730
39731
|
Object.assign(this, options.attributes);
|
|
39731
39732
|
}
|
|
39733
|
+
/**
|
|
39734
|
+
* @summary
|
|
39735
|
+
* Retrieves platform asset details.
|
|
39736
|
+
*
|
|
39737
|
+
* @usage
|
|
39738
|
+
* ```ts
|
|
39739
|
+
* await asset.fetchAssetById();
|
|
39740
|
+
* const { assetName } = asset;
|
|
39741
|
+
* ```
|
|
39742
|
+
*/
|
|
39732
39743
|
fetchAssetById() {
|
|
39733
39744
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39734
39745
|
try {
|
|
39735
|
-
const response = yield this.topiaPublicApi().get(`/assets/${this.id}`, this.requestOptions);
|
|
39746
|
+
const response = yield this.topiaPublicApi().get(`/assets/${this.urlSlug}/${this.id}`, this.requestOptions);
|
|
39736
39747
|
return response.data;
|
|
39737
39748
|
}
|
|
39738
39749
|
catch (error) {
|
|
@@ -39852,8 +39863,8 @@ class DroppedAsset extends Asset {
|
|
|
39852
39863
|
setDataObject(dataObject, options = {}) {
|
|
39853
39864
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39854
39865
|
try {
|
|
39855
|
-
const { lock = {} } = options;
|
|
39856
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
39866
|
+
const { analytics = [], lock = {} } = options;
|
|
39867
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
39857
39868
|
this.dataObject = dataObject || this.dataObject;
|
|
39858
39869
|
}
|
|
39859
39870
|
catch (error) {
|
|
@@ -39878,8 +39889,8 @@ class DroppedAsset extends Asset {
|
|
|
39878
39889
|
updateDataObject(dataObject, options = {}) {
|
|
39879
39890
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39880
39891
|
try {
|
|
39881
|
-
const { lock = {} } = options;
|
|
39882
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
39892
|
+
const { analytics = [], lock = {} } = options;
|
|
39893
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
39883
39894
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
39884
39895
|
}
|
|
39885
39896
|
catch (error) {
|
|
@@ -39904,8 +39915,8 @@ class DroppedAsset extends Asset {
|
|
|
39904
39915
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
39905
39916
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39906
39917
|
try {
|
|
39907
|
-
const { lock = {} } = options;
|
|
39908
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/increment-data-object-value`, { path, amount, lock }, this.requestOptions);
|
|
39918
|
+
const { analytics = [], lock = {} } = options;
|
|
39919
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
39909
39920
|
}
|
|
39910
39921
|
catch (error) {
|
|
39911
39922
|
throw this.errorHandler({
|
|
@@ -40313,6 +40324,16 @@ class Scene extends SDKController {
|
|
|
40313
40324
|
this.id = id;
|
|
40314
40325
|
Object.assign(this, options.attributes);
|
|
40315
40326
|
}
|
|
40327
|
+
/**
|
|
40328
|
+
* @summary
|
|
40329
|
+
* Retrieves scene details.
|
|
40330
|
+
*
|
|
40331
|
+
* @usage
|
|
40332
|
+
* ```ts
|
|
40333
|
+
* await scene.fetchSceneById();
|
|
40334
|
+
* const { name } = scene;
|
|
40335
|
+
* ```
|
|
40336
|
+
*/
|
|
40316
40337
|
fetchSceneById() {
|
|
40317
40338
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40318
40339
|
try {
|
|
@@ -40413,8 +40434,8 @@ class World extends SDKController {
|
|
|
40413
40434
|
*/
|
|
40414
40435
|
this.setDataObject = (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40415
40436
|
try {
|
|
40416
|
-
const { lock = {} } = options;
|
|
40417
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/set-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40437
|
+
const { analytics = [], lock = {} } = options;
|
|
40438
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40418
40439
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
40419
40440
|
}
|
|
40420
40441
|
catch (error) {
|
|
@@ -40437,8 +40458,8 @@ class World extends SDKController {
|
|
|
40437
40458
|
*/
|
|
40438
40459
|
this.updateDataObject = (dataObject, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
40439
40460
|
try {
|
|
40440
|
-
const { lock = {} } = options;
|
|
40441
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/update-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40461
|
+
const { analytics = [], lock = {} } = options;
|
|
40462
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
40442
40463
|
this.dataObject = dataObject || this.dataObject;
|
|
40443
40464
|
}
|
|
40444
40465
|
catch (error) {
|
|
@@ -40830,8 +40851,8 @@ class World extends SDKController {
|
|
|
40830
40851
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
40831
40852
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40832
40853
|
try {
|
|
40833
|
-
const { lock = {} } = options;
|
|
40834
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/increment-data-object-value`, { path, amount, lock }, this.requestOptions);
|
|
40854
|
+
const { analytics, lock = {} } = options;
|
|
40855
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
40835
40856
|
}
|
|
40836
40857
|
catch (error) {
|
|
40837
40858
|
throw this.errorHandler({
|
|
@@ -40952,9 +40973,35 @@ class User extends SDKController {
|
|
|
40952
40973
|
get worlds() {
|
|
40953
40974
|
return __classPrivateFieldGet(this, _User_worldsMap, "f");
|
|
40954
40975
|
}
|
|
40976
|
+
/**
|
|
40977
|
+
* @summary
|
|
40978
|
+
* Verify user has valid interactive credentials
|
|
40979
|
+
*
|
|
40980
|
+
* @usage
|
|
40981
|
+
* ```ts
|
|
40982
|
+
* await user.checkInteractiveCredentials();
|
|
40983
|
+
* ```
|
|
40984
|
+
*/
|
|
40985
|
+
checkInteractiveCredentials() {
|
|
40986
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40987
|
+
try {
|
|
40988
|
+
const response = yield this.topiaPublicApi().get(`/auth/interactive-credentials`, this.requestOptions);
|
|
40989
|
+
return response.data;
|
|
40990
|
+
}
|
|
40991
|
+
catch (error) {
|
|
40992
|
+
throw this.errorHandler({ error, sdkMethod: "User.checkInteractiveCredentials" });
|
|
40993
|
+
}
|
|
40994
|
+
});
|
|
40995
|
+
}
|
|
40955
40996
|
/**
|
|
40956
40997
|
* @summary
|
|
40957
40998
|
* Returns all assets owned by User when an email address is provided.
|
|
40999
|
+
*
|
|
41000
|
+
* @usage
|
|
41001
|
+
* ```ts
|
|
41002
|
+
* await user.fetchAssets();
|
|
41003
|
+
* const userAssets = user.assets;
|
|
41004
|
+
* ```
|
|
40958
41005
|
*/
|
|
40959
41006
|
fetchAssets() {
|
|
40960
41007
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -40977,7 +41024,12 @@ class User extends SDKController {
|
|
|
40977
41024
|
}
|
|
40978
41025
|
/**
|
|
40979
41026
|
* @summary
|
|
40980
|
-
* Returns all platform assets
|
|
41027
|
+
* Returns all platform assets.
|
|
41028
|
+
*
|
|
41029
|
+
* @usage
|
|
41030
|
+
* ```ts
|
|
41031
|
+
* const assets = await user.fetchPlatformAssets();
|
|
41032
|
+
* ```
|
|
40981
41033
|
*/
|
|
40982
41034
|
fetchPlatformAssets() {
|
|
40983
41035
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -40992,7 +41044,13 @@ class User extends SDKController {
|
|
|
40992
41044
|
}
|
|
40993
41045
|
/**
|
|
40994
41046
|
* @summary
|
|
40995
|
-
* Returns all scenes owned by User
|
|
41047
|
+
* Returns all scenes owned by User.
|
|
41048
|
+
*
|
|
41049
|
+
* @usage
|
|
41050
|
+
* ```ts
|
|
41051
|
+
* await user.fetchScenes();
|
|
41052
|
+
* const userScenes = user.scenes;
|
|
41053
|
+
* ```
|
|
40996
41054
|
*/
|
|
40997
41055
|
fetchScenes() {
|
|
40998
41056
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -41141,8 +41199,8 @@ class User extends SDKController {
|
|
|
41141
41199
|
try {
|
|
41142
41200
|
if (!this.profileId)
|
|
41143
41201
|
throw "This method requires the use of a profileId";
|
|
41144
|
-
const { lock = {} } = options;
|
|
41145
|
-
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/set-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41202
|
+
const { analytics = [], lock = {} } = options;
|
|
41203
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41146
41204
|
this.dataObject = dataObject || this.dataObject;
|
|
41147
41205
|
}
|
|
41148
41206
|
catch (error) {
|
|
@@ -41168,8 +41226,8 @@ class User extends SDKController {
|
|
|
41168
41226
|
try {
|
|
41169
41227
|
if (!this.profileId)
|
|
41170
41228
|
throw "This method requires the use of a profileId";
|
|
41171
|
-
const { lock = {} } = options;
|
|
41172
|
-
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/update-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41229
|
+
const { analytics = [], lock = {} } = options;
|
|
41230
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41173
41231
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
41174
41232
|
}
|
|
41175
41233
|
catch (error) {
|
|
@@ -41194,8 +41252,8 @@ class User extends SDKController {
|
|
|
41194
41252
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
41195
41253
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41196
41254
|
try {
|
|
41197
|
-
const { lock = {} } = options;
|
|
41198
|
-
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/increment-data-object-value`, { path, amount, lock }, this.requestOptions);
|
|
41255
|
+
const { analytics = [], lock = {} } = options;
|
|
41256
|
+
yield this.topiaPublicApi().put(`/user/dataObjects/${this.profileId}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
41199
41257
|
}
|
|
41200
41258
|
catch (error) {
|
|
41201
41259
|
throw this.errorHandler({ error, params: { path, amount, options }, sdkMethod: "User.incrementDataObjectValue" });
|
|
@@ -41466,8 +41524,8 @@ class Visitor extends User {
|
|
|
41466
41524
|
setDataObject(dataObject, options = {}) {
|
|
41467
41525
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41468
41526
|
try {
|
|
41469
|
-
const { lock = {} } = options;
|
|
41470
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/set-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41527
|
+
const { analytics = [], lock = {} } = options;
|
|
41528
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/set-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41471
41529
|
this.dataObject = Object.assign(Object.assign({}, (this.dataObject || {})), (dataObject || {}));
|
|
41472
41530
|
}
|
|
41473
41531
|
catch (error) {
|
|
@@ -41491,8 +41549,8 @@ class Visitor extends User {
|
|
|
41491
41549
|
updateDataObject(dataObject, options = {}) {
|
|
41492
41550
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41493
41551
|
try {
|
|
41494
|
-
const { lock = {} } = options;
|
|
41495
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/update-data-object`, { dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41552
|
+
const { analytics = [], lock = {} } = options;
|
|
41553
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/update-data-object`, { analytics, dataObject: dataObject || this.dataObject, lock }, this.requestOptions);
|
|
41496
41554
|
this.dataObject = dataObject || this.dataObject;
|
|
41497
41555
|
}
|
|
41498
41556
|
catch (error) {
|
|
@@ -41517,8 +41575,8 @@ class Visitor extends User {
|
|
|
41517
41575
|
incrementDataObjectValue(path, amount, options = {}) {
|
|
41518
41576
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41519
41577
|
try {
|
|
41520
|
-
const { lock = {} } = options;
|
|
41521
|
-
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/increment-data-object-value`, { path, amount, lock }, this.requestOptions);
|
|
41578
|
+
const { analytics = [], lock = {} } = options;
|
|
41579
|
+
yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/increment-data-object-value`, { path, amount, analytics, lock }, this.requestOptions);
|
|
41522
41580
|
}
|
|
41523
41581
|
catch (error) {
|
|
41524
41582
|
throw this.errorHandler({
|
|
@@ -41713,23 +41771,62 @@ class Topia {
|
|
|
41713
41771
|
}
|
|
41714
41772
|
}
|
|
41715
41773
|
|
|
41774
|
+
/**
|
|
41775
|
+
* @usage
|
|
41776
|
+
* ```ts
|
|
41777
|
+
* const Asset = new AssetFactory(myTopiaInstance);
|
|
41778
|
+
* ```
|
|
41779
|
+
*/
|
|
41716
41780
|
class AssetFactory {
|
|
41717
41781
|
constructor(topia) {
|
|
41718
41782
|
this.topia = topia;
|
|
41719
41783
|
this.create;
|
|
41720
41784
|
}
|
|
41785
|
+
/**
|
|
41786
|
+
* @summary
|
|
41787
|
+
* Instantiate a new instance of Asset class.
|
|
41788
|
+
*
|
|
41789
|
+
* @usage
|
|
41790
|
+
* ```
|
|
41791
|
+
* const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
41792
|
+
* ```
|
|
41793
|
+
*/
|
|
41721
41794
|
create(id, options) {
|
|
41722
41795
|
return new Asset(this.topia, id, options);
|
|
41723
41796
|
}
|
|
41724
41797
|
}
|
|
41725
41798
|
|
|
41799
|
+
/**
|
|
41800
|
+
* @usage
|
|
41801
|
+
* ```ts
|
|
41802
|
+
* const DroppedAsset = new DroppedAssetFactory(myTopiaInstance);
|
|
41803
|
+
* ```
|
|
41804
|
+
*/
|
|
41726
41805
|
class DroppedAssetFactory extends SDKController {
|
|
41727
41806
|
constructor(topia) {
|
|
41728
41807
|
super(topia);
|
|
41729
41808
|
}
|
|
41809
|
+
/**
|
|
41810
|
+
* @summary
|
|
41811
|
+
* Instantiate a new instance of DroppedAsset class.
|
|
41812
|
+
*
|
|
41813
|
+
* @usage
|
|
41814
|
+
* ```
|
|
41815
|
+
* const droppedAssetInstance = await DroppedAsset.create(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
41816
|
+
* ```
|
|
41817
|
+
*/
|
|
41730
41818
|
create(id, urlSlug, options) {
|
|
41731
41819
|
return new DroppedAsset(this.topia, id, urlSlug, options);
|
|
41732
41820
|
}
|
|
41821
|
+
/**
|
|
41822
|
+
* @summary
|
|
41823
|
+
* Instantiate a new instance of DroppedAsset class and retrieve all properties.
|
|
41824
|
+
*
|
|
41825
|
+
* @usage
|
|
41826
|
+
* ```
|
|
41827
|
+
* const droppedAssetInstance = await DroppedAsset.get(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
41828
|
+
* ```
|
|
41829
|
+
*/
|
|
41733
41830
|
get(id, urlSlug, options) {
|
|
41734
41831
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41735
41832
|
const droppedAsset = new DroppedAsset(this.topia, id, urlSlug, options);
|
|
@@ -41737,6 +41834,15 @@ class DroppedAssetFactory extends SDKController {
|
|
|
41737
41834
|
return droppedAsset;
|
|
41738
41835
|
});
|
|
41739
41836
|
}
|
|
41837
|
+
/**
|
|
41838
|
+
* @summary
|
|
41839
|
+
* Searches dropped assets within a world by a provide `uniqueName`. If a single match is found, a new instance of DroppedAsset class is returned all properties.
|
|
41840
|
+
*
|
|
41841
|
+
* @usage
|
|
41842
|
+
* ```
|
|
41843
|
+
* const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug, { interactivePublicKey, interactiveSecret });
|
|
41844
|
+
* ```
|
|
41845
|
+
*/
|
|
41740
41846
|
getWithUniqueName(uniqueName, urlSlug, credentials) {
|
|
41741
41847
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41742
41848
|
const { apiKey, interactivePublicKey, interactiveSecret } = credentials;
|
|
@@ -41759,6 +41865,26 @@ class DroppedAssetFactory extends SDKController {
|
|
|
41759
41865
|
}
|
|
41760
41866
|
});
|
|
41761
41867
|
}
|
|
41868
|
+
/**
|
|
41869
|
+
* @summary
|
|
41870
|
+
* Drops an asset in a world and returns a new instance of DroppedAsset class with all properties.
|
|
41871
|
+
*
|
|
41872
|
+
* @usage
|
|
41873
|
+
* ```
|
|
41874
|
+
* const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
41875
|
+
* const droppedAssetInstance = await DroppedAsset.get(assetInstance, {
|
|
41876
|
+
assetScale: 1.5,
|
|
41877
|
+
flipped: true,
|
|
41878
|
+
layer0: "",
|
|
41879
|
+
layer1: "https://pathtoimage.png",
|
|
41880
|
+
interactivePublicKey,
|
|
41881
|
+
isInteractive: true,
|
|
41882
|
+
position: { x: 0, y: 0 },
|
|
41883
|
+
uniqueName: "exampleUniqueName",
|
|
41884
|
+
urlSlug,
|
|
41885
|
+
});
|
|
41886
|
+
* ```
|
|
41887
|
+
*/
|
|
41762
41888
|
drop(asset, { assetScale = 1, flipped, interactivePublicKey, isInteractive, layer0 = "", layer1 = "", position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
|
|
41763
41889
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41764
41890
|
let specialType = null;
|
|
@@ -41803,14 +41929,38 @@ class DroppedAssetFactory extends SDKController {
|
|
|
41803
41929
|
}
|
|
41804
41930
|
}
|
|
41805
41931
|
|
|
41932
|
+
/**
|
|
41933
|
+
* @usage
|
|
41934
|
+
* ```ts
|
|
41935
|
+
* const Scene = new SceneFactory(myTopiaInstance);
|
|
41936
|
+
* ```
|
|
41937
|
+
*/
|
|
41806
41938
|
class SceneFactory {
|
|
41807
41939
|
constructor(topia) {
|
|
41808
41940
|
this.topia = topia;
|
|
41809
41941
|
this.create;
|
|
41810
41942
|
}
|
|
41943
|
+
/**
|
|
41944
|
+
* @summary
|
|
41945
|
+
* Instantiate a new instance of Scene class.
|
|
41946
|
+
*
|
|
41947
|
+
* @usage
|
|
41948
|
+
* ```
|
|
41949
|
+
* const sceneInstance = await Scene.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
41950
|
+
* ```
|
|
41951
|
+
*/
|
|
41811
41952
|
create(id, options) {
|
|
41812
41953
|
return new Scene(this.topia, id, options);
|
|
41813
41954
|
}
|
|
41955
|
+
/**
|
|
41956
|
+
* @summary
|
|
41957
|
+
* Instantiate a new instance of Scene class and retrieve all properties.
|
|
41958
|
+
*
|
|
41959
|
+
* @usage
|
|
41960
|
+
* ```
|
|
41961
|
+
* const sceneInstance = await Scene.get(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
41962
|
+
* ```
|
|
41963
|
+
*/
|
|
41814
41964
|
get(id, options) {
|
|
41815
41965
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41816
41966
|
const scene = yield new Scene(this.topia, id, options);
|
|
@@ -41820,22 +41970,61 @@ class SceneFactory {
|
|
|
41820
41970
|
}
|
|
41821
41971
|
}
|
|
41822
41972
|
|
|
41973
|
+
/**
|
|
41974
|
+
* @usage
|
|
41975
|
+
* ```ts
|
|
41976
|
+
* const User = new UserFactory(myTopiaInstance);
|
|
41977
|
+
* ```
|
|
41978
|
+
*/
|
|
41823
41979
|
class UserFactory {
|
|
41824
41980
|
constructor(topia) {
|
|
41825
41981
|
this.topia = topia;
|
|
41826
41982
|
}
|
|
41983
|
+
/**
|
|
41984
|
+
* @summary
|
|
41985
|
+
* Instantiate a new instance of User class.
|
|
41986
|
+
*
|
|
41987
|
+
* @usage
|
|
41988
|
+
* ```
|
|
41989
|
+
* const userInstance = await User.create({ credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
41990
|
+
* ```
|
|
41991
|
+
*/
|
|
41827
41992
|
create(options) {
|
|
41828
41993
|
return new User(this.topia, options);
|
|
41829
41994
|
}
|
|
41830
41995
|
}
|
|
41831
41996
|
|
|
41997
|
+
/**
|
|
41998
|
+
* @usage
|
|
41999
|
+
* ```ts
|
|
42000
|
+
* const Visitor = new VisitorFactory(myTopiaInstance);
|
|
42001
|
+
* ```
|
|
42002
|
+
*/
|
|
41832
42003
|
class VisitorFactory {
|
|
41833
42004
|
constructor(topia) {
|
|
41834
42005
|
this.topia = topia;
|
|
41835
42006
|
}
|
|
42007
|
+
/**
|
|
42008
|
+
* @summary
|
|
42009
|
+
* Instantiate a new instance of Visitor class.
|
|
42010
|
+
*
|
|
42011
|
+
* @usage
|
|
42012
|
+
* ```
|
|
42013
|
+
* const visitorInstance = await Visitor.create(id, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
42014
|
+
* ```
|
|
42015
|
+
*/
|
|
41836
42016
|
create(id, urlSlug, options) {
|
|
41837
42017
|
return new Visitor(this.topia, id, urlSlug, options);
|
|
41838
42018
|
}
|
|
42019
|
+
/**
|
|
42020
|
+
* @summary
|
|
42021
|
+
* Instantiate a new instance of Visitor class and retrieve all properties.
|
|
42022
|
+
*
|
|
42023
|
+
* @usage
|
|
42024
|
+
* ```
|
|
42025
|
+
* const visitorInstance = await Visitor.get(id, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
42026
|
+
* ```
|
|
42027
|
+
*/
|
|
41839
42028
|
get(id, urlSlug, options) {
|
|
41840
42029
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41841
42030
|
const visitor = new Visitor(this.topia, id, urlSlug, options);
|
|
@@ -41845,22 +42034,61 @@ class VisitorFactory {
|
|
|
41845
42034
|
}
|
|
41846
42035
|
}
|
|
41847
42036
|
|
|
42037
|
+
/**
|
|
42038
|
+
* @usage
|
|
42039
|
+
* ```ts
|
|
42040
|
+
* const WorldActivity = new WorldActivityFactory(myTopiaInstance);
|
|
42041
|
+
* ```
|
|
42042
|
+
*/
|
|
41848
42043
|
class WorldActivityFactory {
|
|
41849
42044
|
constructor(topia) {
|
|
41850
42045
|
this.topia = topia;
|
|
41851
42046
|
}
|
|
42047
|
+
/**
|
|
42048
|
+
* @summary
|
|
42049
|
+
* Instantiate a new instance of WorldActivity class.
|
|
42050
|
+
*
|
|
42051
|
+
* @usage
|
|
42052
|
+
* ```
|
|
42053
|
+
* const worldActivityInstance = await WorldActivity.create(urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
42054
|
+
* ```
|
|
42055
|
+
*/
|
|
41852
42056
|
create(urlSlug, options) {
|
|
41853
42057
|
return new WorldActivity(this.topia, urlSlug, options);
|
|
41854
42058
|
}
|
|
41855
42059
|
}
|
|
41856
42060
|
|
|
42061
|
+
/**
|
|
42062
|
+
* @usage
|
|
42063
|
+
* ```ts
|
|
42064
|
+
* const World = new WorldFactory(myTopiaInstance);
|
|
42065
|
+
* ```
|
|
42066
|
+
*/
|
|
41857
42067
|
class WorldFactory extends SDKController {
|
|
41858
42068
|
constructor(topia) {
|
|
41859
42069
|
super(topia);
|
|
41860
42070
|
}
|
|
42071
|
+
/**
|
|
42072
|
+
* @summary
|
|
42073
|
+
* Instantiate a new instance of World class.
|
|
42074
|
+
*
|
|
42075
|
+
* @usage
|
|
42076
|
+
* ```
|
|
42077
|
+
* const worldInstance = await World.create(urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
|
|
42078
|
+
* ```
|
|
42079
|
+
*/
|
|
41861
42080
|
create(urlSlug, options) {
|
|
41862
42081
|
return new World(this.topia, urlSlug, options);
|
|
41863
42082
|
}
|
|
42083
|
+
/**
|
|
42084
|
+
* @summary
|
|
42085
|
+
* Deletes an array of Dropped Assets from within a world and returns success: true
|
|
42086
|
+
*
|
|
42087
|
+
* @usage
|
|
42088
|
+
* ```
|
|
42089
|
+
* await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], { interactivePublicKey, interactiveSecret });
|
|
42090
|
+
* ```
|
|
42091
|
+
*/
|
|
41864
42092
|
deleteDroppedAssets(urlSlug, droppedAssetIds, credentials) {
|
|
41865
42093
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41866
42094
|
const { apiKey, interactivePublicKey, interactiveSecret } = credentials;
|