@rtsdk/topia 0.9.1 → 0.10.0
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 +6 -0
- package/dist/index.cjs +105 -1
- package/dist/index.d.ts +51 -0
- package/dist/index.js +105 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -246,6 +246,12 @@ We've added a Pull Request template to help make it easier for developers to cla
|
|
|
246
246
|
|
|
247
247
|
## Documentation
|
|
248
248
|
|
|
249
|
+
### Styles
|
|
250
|
+
|
|
251
|
+
The SDK Stylesheet is already added to every boilerplate. To view documentation and examples please [click here](https://sdk-style.s3.amazonaws.com/example.html).
|
|
252
|
+
|
|
253
|
+
### Developer Documentation
|
|
254
|
+
|
|
249
255
|
We use [TypeDoc](https://typedoc.org/guides/overview) to convert comments in TypeScript source code into rendered HTML documentation. Comments should be simple and concise and include examples where applicable. Please be sure to add or update comments accordingly!
|
|
250
256
|
|
|
251
257
|
To update docs run `yarn docs`.
|
package/dist/index.cjs
CHANGED
|
@@ -40280,10 +40280,15 @@ class DroppedAsset extends Asset {
|
|
|
40280
40280
|
switch (periodType) {
|
|
40281
40281
|
case "week":
|
|
40282
40282
|
query = `&week=W${dateValue}`;
|
|
40283
|
+
break;
|
|
40283
40284
|
case "month":
|
|
40284
40285
|
query = `&month=${dateValue}`;
|
|
40286
|
+
break;
|
|
40285
40287
|
case "quarter":
|
|
40286
40288
|
query = `&quarter=Q${dateValue}`;
|
|
40289
|
+
break;
|
|
40290
|
+
default:
|
|
40291
|
+
"";
|
|
40287
40292
|
}
|
|
40288
40293
|
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/dropped-asset-analytics/${this.id}?year=${year}${query}`, this.requestOptions);
|
|
40289
40294
|
return response.data;
|
|
@@ -40655,7 +40660,7 @@ class World extends SDKController {
|
|
|
40655
40660
|
try {
|
|
40656
40661
|
if (!sceneDropId)
|
|
40657
40662
|
throw this.errorHandler({ message: "A sceneDropId is required." });
|
|
40658
|
-
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}
|
|
40663
|
+
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
|
|
40659
40664
|
// create temp map and then update private property only once
|
|
40660
40665
|
const droppedAssets = [];
|
|
40661
40666
|
for (const asset of response.data.assets) {
|
|
@@ -40834,6 +40839,53 @@ class World extends SDKController {
|
|
|
40834
40839
|
}
|
|
40835
40840
|
});
|
|
40836
40841
|
}
|
|
40842
|
+
/**
|
|
40843
|
+
* @summary
|
|
40844
|
+
* Get all particles available
|
|
40845
|
+
*
|
|
40846
|
+
* @usage
|
|
40847
|
+
* ```ts
|
|
40848
|
+
* await world.getAllParticles();
|
|
40849
|
+
* ```
|
|
40850
|
+
*/
|
|
40851
|
+
getAllParticles() {
|
|
40852
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40853
|
+
try {
|
|
40854
|
+
const result = yield this.topiaPublicApi().get(`/particles`, this.requestOptions);
|
|
40855
|
+
return result.data;
|
|
40856
|
+
}
|
|
40857
|
+
catch (error) {
|
|
40858
|
+
throw this.errorHandler({ error, params: {}, sdkMethod: "World.getAllParticles" });
|
|
40859
|
+
}
|
|
40860
|
+
});
|
|
40861
|
+
}
|
|
40862
|
+
/**
|
|
40863
|
+
* @summary
|
|
40864
|
+
* Trigger a particle effect at a position in the world
|
|
40865
|
+
*
|
|
40866
|
+
* @usage
|
|
40867
|
+
* ```ts
|
|
40868
|
+
* await world.triggerParticle({ name: "Flame" });
|
|
40869
|
+
* ```
|
|
40870
|
+
*/
|
|
40871
|
+
triggerParticle({ id, name, duration = 10, position = { x: 1, y: 1 }, }) {
|
|
40872
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40873
|
+
if (!id && !name)
|
|
40874
|
+
throw "An particle name is required.";
|
|
40875
|
+
try {
|
|
40876
|
+
let particleId = id;
|
|
40877
|
+
if (name) {
|
|
40878
|
+
const response = yield this.topiaPublicApi().get(`/particles?name=${name}`, this.requestOptions);
|
|
40879
|
+
particleId = response.data[0].id;
|
|
40880
|
+
}
|
|
40881
|
+
const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position, duration }, this.requestOptions);
|
|
40882
|
+
return result;
|
|
40883
|
+
}
|
|
40884
|
+
catch (error) {
|
|
40885
|
+
throw this.errorHandler({ error, params: { id, name }, sdkMethod: "World.triggerParticle" });
|
|
40886
|
+
}
|
|
40887
|
+
});
|
|
40888
|
+
}
|
|
40837
40889
|
/**
|
|
40838
40890
|
* @summary
|
|
40839
40891
|
* Increments a specific value in the data object for a world by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
@@ -40906,10 +40958,15 @@ class World extends SDKController {
|
|
|
40906
40958
|
switch (periodType) {
|
|
40907
40959
|
case "week":
|
|
40908
40960
|
query = `&week=W${dateValue}`;
|
|
40961
|
+
break;
|
|
40909
40962
|
case "month":
|
|
40910
40963
|
query = `&month=${dateValue}`;
|
|
40964
|
+
break;
|
|
40911
40965
|
case "quarter":
|
|
40912
40966
|
query = `&quarter=Q${dateValue}`;
|
|
40967
|
+
break;
|
|
40968
|
+
default:
|
|
40969
|
+
"";
|
|
40913
40970
|
}
|
|
40914
40971
|
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/world-analytics?year=${year}${query}`, this.requestOptions);
|
|
40915
40972
|
return response.data;
|
|
@@ -41487,6 +41544,53 @@ class Visitor extends User {
|
|
|
41487
41544
|
}
|
|
41488
41545
|
});
|
|
41489
41546
|
}
|
|
41547
|
+
/**
|
|
41548
|
+
* @summary
|
|
41549
|
+
* Get all particles available
|
|
41550
|
+
*
|
|
41551
|
+
* @usage
|
|
41552
|
+
* ```ts
|
|
41553
|
+
* await visitor.getAllParticles();
|
|
41554
|
+
* ```
|
|
41555
|
+
*/
|
|
41556
|
+
getAllParticles() {
|
|
41557
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41558
|
+
try {
|
|
41559
|
+
const result = yield this.topiaPublicApi().get(`/particles`, this.requestOptions);
|
|
41560
|
+
return result.data;
|
|
41561
|
+
}
|
|
41562
|
+
catch (error) {
|
|
41563
|
+
throw this.errorHandler({ error, params: {}, sdkMethod: "Visitor.getAllParticles" });
|
|
41564
|
+
}
|
|
41565
|
+
});
|
|
41566
|
+
}
|
|
41567
|
+
/**
|
|
41568
|
+
* @summary
|
|
41569
|
+
* Trigger a particle effect on a visitor
|
|
41570
|
+
*
|
|
41571
|
+
* @usage
|
|
41572
|
+
* ```ts
|
|
41573
|
+
* await visitor.triggerParticle({ name: "Flame" });
|
|
41574
|
+
* ```
|
|
41575
|
+
*/
|
|
41576
|
+
triggerParticle({ id, name, duration = 10, }) {
|
|
41577
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41578
|
+
if (!id && !name)
|
|
41579
|
+
throw "An particle name is required.";
|
|
41580
|
+
try {
|
|
41581
|
+
let particleId = id;
|
|
41582
|
+
if (name) {
|
|
41583
|
+
const response = yield this.topiaPublicApi().get(`/particles?name=${name}`, this.requestOptions);
|
|
41584
|
+
particleId = response.data[0].id;
|
|
41585
|
+
}
|
|
41586
|
+
const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position: { x: 1, y: 1 }, duration, followPlayerId: this.id }, this.requestOptions);
|
|
41587
|
+
return result;
|
|
41588
|
+
}
|
|
41589
|
+
catch (error) {
|
|
41590
|
+
throw this.errorHandler({ error, params: { id, name }, sdkMethod: "Visitor.triggerParticle" });
|
|
41591
|
+
}
|
|
41592
|
+
});
|
|
41593
|
+
}
|
|
41490
41594
|
/**
|
|
41491
41595
|
* @summary
|
|
41492
41596
|
* Retrieves the data object for a visitor.
|
package/dist/index.d.ts
CHANGED
|
@@ -649,6 +649,31 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
649
649
|
* ```
|
|
650
650
|
*/
|
|
651
651
|
replaceScene(sceneId: string): Promise<void | ResponseType$1>;
|
|
652
|
+
/**
|
|
653
|
+
* @summary
|
|
654
|
+
* Get all particles available
|
|
655
|
+
*
|
|
656
|
+
* @usage
|
|
657
|
+
* ```ts
|
|
658
|
+
* await world.getAllParticles();
|
|
659
|
+
* ```
|
|
660
|
+
*/
|
|
661
|
+
getAllParticles(): Promise<object | ResponseType$1>;
|
|
662
|
+
/**
|
|
663
|
+
* @summary
|
|
664
|
+
* Trigger a particle effect at a position in the world
|
|
665
|
+
*
|
|
666
|
+
* @usage
|
|
667
|
+
* ```ts
|
|
668
|
+
* await world.triggerParticle({ name: "Flame" });
|
|
669
|
+
* ```
|
|
670
|
+
*/
|
|
671
|
+
triggerParticle({ id, name, duration, position, }: {
|
|
672
|
+
id?: string;
|
|
673
|
+
name?: string;
|
|
674
|
+
duration?: number;
|
|
675
|
+
position?: object;
|
|
676
|
+
}): Promise<object | ResponseType$1>;
|
|
652
677
|
/**
|
|
653
678
|
* @summary
|
|
654
679
|
* Retrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
|
|
@@ -1057,6 +1082,30 @@ declare class Visitor extends User implements VisitorInterface {
|
|
|
1057
1082
|
id?: string;
|
|
1058
1083
|
name?: string;
|
|
1059
1084
|
}): Promise<object | ResponseType$1>;
|
|
1085
|
+
/**
|
|
1086
|
+
* @summary
|
|
1087
|
+
* Get all particles available
|
|
1088
|
+
*
|
|
1089
|
+
* @usage
|
|
1090
|
+
* ```ts
|
|
1091
|
+
* await visitor.getAllParticles();
|
|
1092
|
+
* ```
|
|
1093
|
+
*/
|
|
1094
|
+
getAllParticles(): Promise<object | ResponseType$1>;
|
|
1095
|
+
/**
|
|
1096
|
+
* @summary
|
|
1097
|
+
* Trigger a particle effect on a visitor
|
|
1098
|
+
*
|
|
1099
|
+
* @usage
|
|
1100
|
+
* ```ts
|
|
1101
|
+
* await visitor.triggerParticle({ name: "Flame" });
|
|
1102
|
+
* ```
|
|
1103
|
+
*/
|
|
1104
|
+
triggerParticle({ id, name, duration, }: {
|
|
1105
|
+
id?: string;
|
|
1106
|
+
name?: string;
|
|
1107
|
+
duration?: number;
|
|
1108
|
+
}): Promise<object | ResponseType$1>;
|
|
1060
1109
|
/**
|
|
1061
1110
|
* @summary
|
|
1062
1111
|
* Retrieves the data object for a visitor.
|
|
@@ -1235,6 +1284,7 @@ interface DroppedAssetInterface extends AssetInterface {
|
|
|
1235
1284
|
assetPrivateZoneChannelDisabled?: boolean | null;
|
|
1236
1285
|
assetPrivateConversationCap?: number | null;
|
|
1237
1286
|
audioSliderVolume?: number | null;
|
|
1287
|
+
bottomLayerURL?: string | null;
|
|
1238
1288
|
broadcasterEmail?: string | null;
|
|
1239
1289
|
clickType?: string | null;
|
|
1240
1290
|
clickableLink?: string | null;
|
|
@@ -1280,6 +1330,7 @@ interface DroppedAssetInterface extends AssetInterface {
|
|
|
1280
1330
|
textFontFamily?: string | null;
|
|
1281
1331
|
teleportX?: number | null;
|
|
1282
1332
|
teleportY?: number | null;
|
|
1333
|
+
topLayerURL?: string | null;
|
|
1283
1334
|
tokenSymbol?: string | null;
|
|
1284
1335
|
tokenName?: string | null;
|
|
1285
1336
|
worldId?: string | null;
|
package/dist/index.js
CHANGED
|
@@ -40278,10 +40278,15 @@ class DroppedAsset extends Asset {
|
|
|
40278
40278
|
switch (periodType) {
|
|
40279
40279
|
case "week":
|
|
40280
40280
|
query = `&week=W${dateValue}`;
|
|
40281
|
+
break;
|
|
40281
40282
|
case "month":
|
|
40282
40283
|
query = `&month=${dateValue}`;
|
|
40284
|
+
break;
|
|
40283
40285
|
case "quarter":
|
|
40284
40286
|
query = `&quarter=Q${dateValue}`;
|
|
40287
|
+
break;
|
|
40288
|
+
default:
|
|
40289
|
+
"";
|
|
40285
40290
|
}
|
|
40286
40291
|
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/dropped-asset-analytics/${this.id}?year=${year}${query}`, this.requestOptions);
|
|
40287
40292
|
return response.data;
|
|
@@ -40653,7 +40658,7 @@ class World extends SDKController {
|
|
|
40653
40658
|
try {
|
|
40654
40659
|
if (!sceneDropId)
|
|
40655
40660
|
throw this.errorHandler({ message: "A sceneDropId is required." });
|
|
40656
|
-
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}
|
|
40661
|
+
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
|
|
40657
40662
|
// create temp map and then update private property only once
|
|
40658
40663
|
const droppedAssets = [];
|
|
40659
40664
|
for (const asset of response.data.assets) {
|
|
@@ -40832,6 +40837,53 @@ class World extends SDKController {
|
|
|
40832
40837
|
}
|
|
40833
40838
|
});
|
|
40834
40839
|
}
|
|
40840
|
+
/**
|
|
40841
|
+
* @summary
|
|
40842
|
+
* Get all particles available
|
|
40843
|
+
*
|
|
40844
|
+
* @usage
|
|
40845
|
+
* ```ts
|
|
40846
|
+
* await world.getAllParticles();
|
|
40847
|
+
* ```
|
|
40848
|
+
*/
|
|
40849
|
+
getAllParticles() {
|
|
40850
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40851
|
+
try {
|
|
40852
|
+
const result = yield this.topiaPublicApi().get(`/particles`, this.requestOptions);
|
|
40853
|
+
return result.data;
|
|
40854
|
+
}
|
|
40855
|
+
catch (error) {
|
|
40856
|
+
throw this.errorHandler({ error, params: {}, sdkMethod: "World.getAllParticles" });
|
|
40857
|
+
}
|
|
40858
|
+
});
|
|
40859
|
+
}
|
|
40860
|
+
/**
|
|
40861
|
+
* @summary
|
|
40862
|
+
* Trigger a particle effect at a position in the world
|
|
40863
|
+
*
|
|
40864
|
+
* @usage
|
|
40865
|
+
* ```ts
|
|
40866
|
+
* await world.triggerParticle({ name: "Flame" });
|
|
40867
|
+
* ```
|
|
40868
|
+
*/
|
|
40869
|
+
triggerParticle({ id, name, duration = 10, position = { x: 1, y: 1 }, }) {
|
|
40870
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40871
|
+
if (!id && !name)
|
|
40872
|
+
throw "An particle name is required.";
|
|
40873
|
+
try {
|
|
40874
|
+
let particleId = id;
|
|
40875
|
+
if (name) {
|
|
40876
|
+
const response = yield this.topiaPublicApi().get(`/particles?name=${name}`, this.requestOptions);
|
|
40877
|
+
particleId = response.data[0].id;
|
|
40878
|
+
}
|
|
40879
|
+
const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position, duration }, this.requestOptions);
|
|
40880
|
+
return result;
|
|
40881
|
+
}
|
|
40882
|
+
catch (error) {
|
|
40883
|
+
throw this.errorHandler({ error, params: { id, name }, sdkMethod: "World.triggerParticle" });
|
|
40884
|
+
}
|
|
40885
|
+
});
|
|
40886
|
+
}
|
|
40835
40887
|
/**
|
|
40836
40888
|
* @summary
|
|
40837
40889
|
* Increments a specific value in the data object for a world by the amount specified. Must have valid interactive credentials from a visitor in the world.
|
|
@@ -40904,10 +40956,15 @@ class World extends SDKController {
|
|
|
40904
40956
|
switch (periodType) {
|
|
40905
40957
|
case "week":
|
|
40906
40958
|
query = `&week=W${dateValue}`;
|
|
40959
|
+
break;
|
|
40907
40960
|
case "month":
|
|
40908
40961
|
query = `&month=${dateValue}`;
|
|
40962
|
+
break;
|
|
40909
40963
|
case "quarter":
|
|
40910
40964
|
query = `&quarter=Q${dateValue}`;
|
|
40965
|
+
break;
|
|
40966
|
+
default:
|
|
40967
|
+
"";
|
|
40911
40968
|
}
|
|
40912
40969
|
const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/world-analytics?year=${year}${query}`, this.requestOptions);
|
|
40913
40970
|
return response.data;
|
|
@@ -41485,6 +41542,53 @@ class Visitor extends User {
|
|
|
41485
41542
|
}
|
|
41486
41543
|
});
|
|
41487
41544
|
}
|
|
41545
|
+
/**
|
|
41546
|
+
* @summary
|
|
41547
|
+
* Get all particles available
|
|
41548
|
+
*
|
|
41549
|
+
* @usage
|
|
41550
|
+
* ```ts
|
|
41551
|
+
* await visitor.getAllParticles();
|
|
41552
|
+
* ```
|
|
41553
|
+
*/
|
|
41554
|
+
getAllParticles() {
|
|
41555
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41556
|
+
try {
|
|
41557
|
+
const result = yield this.topiaPublicApi().get(`/particles`, this.requestOptions);
|
|
41558
|
+
return result.data;
|
|
41559
|
+
}
|
|
41560
|
+
catch (error) {
|
|
41561
|
+
throw this.errorHandler({ error, params: {}, sdkMethod: "Visitor.getAllParticles" });
|
|
41562
|
+
}
|
|
41563
|
+
});
|
|
41564
|
+
}
|
|
41565
|
+
/**
|
|
41566
|
+
* @summary
|
|
41567
|
+
* Trigger a particle effect on a visitor
|
|
41568
|
+
*
|
|
41569
|
+
* @usage
|
|
41570
|
+
* ```ts
|
|
41571
|
+
* await visitor.triggerParticle({ name: "Flame" });
|
|
41572
|
+
* ```
|
|
41573
|
+
*/
|
|
41574
|
+
triggerParticle({ id, name, duration = 10, }) {
|
|
41575
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41576
|
+
if (!id && !name)
|
|
41577
|
+
throw "An particle name is required.";
|
|
41578
|
+
try {
|
|
41579
|
+
let particleId = id;
|
|
41580
|
+
if (name) {
|
|
41581
|
+
const response = yield this.topiaPublicApi().get(`/particles?name=${name}`, this.requestOptions);
|
|
41582
|
+
particleId = response.data[0].id;
|
|
41583
|
+
}
|
|
41584
|
+
const result = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/particles`, { particleId, position: { x: 1, y: 1 }, duration, followPlayerId: this.id }, this.requestOptions);
|
|
41585
|
+
return result;
|
|
41586
|
+
}
|
|
41587
|
+
catch (error) {
|
|
41588
|
+
throw this.errorHandler({ error, params: { id, name }, sdkMethod: "Visitor.triggerParticle" });
|
|
41589
|
+
}
|
|
41590
|
+
});
|
|
41591
|
+
}
|
|
41488
41592
|
/**
|
|
41489
41593
|
* @summary
|
|
41490
41594
|
* Retrieves the data object for a visitor.
|
package/package.json
CHANGED