@rtsdk/topia 0.6.2 → 0.7.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/dist/index.cjs +37 -11
- package/dist/index.d.ts +26 -7
- package/dist/index.js +37 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39644,7 +39644,7 @@ class SDKController {
|
|
|
39644
39644
|
let payload = {};
|
|
39645
39645
|
const headers = {};
|
|
39646
39646
|
try {
|
|
39647
|
-
if (topia.interactiveSecret && (profileId || assetId || urlSlug)) {
|
|
39647
|
+
if (topia.interactiveSecret && (profileId || assetId || urlSlug || visitorId)) {
|
|
39648
39648
|
payload = {
|
|
39649
39649
|
interactiveNonce,
|
|
39650
39650
|
visitorId,
|
|
@@ -39709,7 +39709,10 @@ class SDKController {
|
|
|
39709
39709
|
*
|
|
39710
39710
|
* @usage
|
|
39711
39711
|
* ```ts
|
|
39712
|
-
* await new Asset(topia, "assetId", {
|
|
39712
|
+
* await new Asset(topia, "assetId", {
|
|
39713
|
+
* attributes: { assetName: "My Asset", isPublic: false },
|
|
39714
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
39715
|
+
* });
|
|
39713
39716
|
* ```
|
|
39714
39717
|
*/
|
|
39715
39718
|
class Asset extends SDKController {
|
|
@@ -39746,7 +39749,10 @@ var _DroppedAsset_updateDroppedAsset;
|
|
|
39746
39749
|
*
|
|
39747
39750
|
* @usage
|
|
39748
39751
|
* ```ts
|
|
39749
|
-
* await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
|
|
39752
|
+
* await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
|
|
39753
|
+
* attributes: { text: "My Asset" },
|
|
39754
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", visitorId: 1 }
|
|
39755
|
+
* });
|
|
39750
39756
|
* ```
|
|
39751
39757
|
*/
|
|
39752
39758
|
class DroppedAsset extends Asset {
|
|
@@ -40265,7 +40271,10 @@ _DroppedAsset_updateDroppedAsset = new WeakMap();
|
|
|
40265
40271
|
*
|
|
40266
40272
|
* @usage
|
|
40267
40273
|
* ```ts
|
|
40268
|
-
* await new Scene(topia, "sceneId", {
|
|
40274
|
+
* await new Scene(topia, "sceneId", {
|
|
40275
|
+
* attributes: { name: "My Scene" },
|
|
40276
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
40277
|
+
* });
|
|
40269
40278
|
* ```
|
|
40270
40279
|
*/
|
|
40271
40280
|
class Scene extends SDKController {
|
|
@@ -40327,7 +40336,10 @@ var _World_droppedAssetsMap;
|
|
|
40327
40336
|
*
|
|
40328
40337
|
* @usage
|
|
40329
40338
|
* ```ts
|
|
40330
|
-
* await new World(topia, "exampleWorld", {
|
|
40339
|
+
* await new World(topia, "exampleWorld", {
|
|
40340
|
+
* attributes: { name: "Example World" },
|
|
40341
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
40342
|
+
* });
|
|
40331
40343
|
* ```
|
|
40332
40344
|
*/
|
|
40333
40345
|
class World extends SDKController {
|
|
@@ -40839,7 +40851,10 @@ var _User_adminWorldsMap, _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
|
40839
40851
|
*
|
|
40840
40852
|
* @usage
|
|
40841
40853
|
* ```ts
|
|
40842
|
-
* await new User(topia, {
|
|
40854
|
+
* await new User(topia, {
|
|
40855
|
+
* profileId: 1,
|
|
40856
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
40857
|
+
* });
|
|
40843
40858
|
* ```
|
|
40844
40859
|
*/
|
|
40845
40860
|
class User extends SDKController {
|
|
@@ -40848,7 +40863,7 @@ class User extends SDKController {
|
|
|
40848
40863
|
super(topia, {
|
|
40849
40864
|
apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
|
|
40850
40865
|
interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
|
|
40851
|
-
profileId: options.profileId,
|
|
40866
|
+
profileId: options === null || options === void 0 ? void 0 : options.profileId,
|
|
40852
40867
|
urlSlug: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug,
|
|
40853
40868
|
visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
|
|
40854
40869
|
});
|
|
@@ -40856,7 +40871,7 @@ class User extends SDKController {
|
|
|
40856
40871
|
_User_assetsMap.set(this, void 0);
|
|
40857
40872
|
_User_scenesMap.set(this, void 0);
|
|
40858
40873
|
_User_worldsMap.set(this, void 0);
|
|
40859
|
-
this.profileId = options.profileId;
|
|
40874
|
+
this.profileId = options === null || options === void 0 ? void 0 : options.profileId;
|
|
40860
40875
|
this.dataObject = {};
|
|
40861
40876
|
this.profile = {};
|
|
40862
40877
|
__classPrivateFieldSet(this, _User_adminWorldsMap, {}, "f");
|
|
@@ -41448,7 +41463,10 @@ var _WorldActivity_visitorsMap;
|
|
|
41448
41463
|
*
|
|
41449
41464
|
* @usage
|
|
41450
41465
|
* ```ts
|
|
41451
|
-
* await new WorldActivity(topia, "exampleWorld", {
|
|
41466
|
+
* await new WorldActivity(topia, "exampleWorld", {
|
|
41467
|
+
* attributes: { name: "Example World" },
|
|
41468
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
41469
|
+
* });
|
|
41452
41470
|
* ```
|
|
41453
41471
|
*/
|
|
41454
41472
|
class WorldActivity extends SDKController {
|
|
@@ -41656,13 +41674,21 @@ class DroppedAssetFactory extends SDKController {
|
|
|
41656
41674
|
}
|
|
41657
41675
|
});
|
|
41658
41676
|
}
|
|
41659
|
-
drop(asset, { interactivePublicKey, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }) {
|
|
41677
|
+
drop(asset, { interactivePublicKey, isInteractive, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }) {
|
|
41660
41678
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41661
|
-
const params = { interactivePublicKey, sceneDropId, uniqueName, urlSlug, yOrderAdjust };
|
|
41679
|
+
const params = { interactivePublicKey, isInteractive, sceneDropId, uniqueName, urlSlug, yOrderAdjust };
|
|
41680
|
+
if (isInteractive && !interactivePublicKey) {
|
|
41681
|
+
throw this.errorHandler({
|
|
41682
|
+
message: "interactivePublicKey is required",
|
|
41683
|
+
params,
|
|
41684
|
+
sdkMethod: "DroppedAssetFactory.drop",
|
|
41685
|
+
});
|
|
41686
|
+
}
|
|
41662
41687
|
try {
|
|
41663
41688
|
const response = yield this.topiaPublicApi().post(`/world/${urlSlug}/assets`, {
|
|
41664
41689
|
assetId: asset.id,
|
|
41665
41690
|
interactivePublicKey,
|
|
41691
|
+
isInteractive,
|
|
41666
41692
|
position: { x, y },
|
|
41667
41693
|
sceneDropId,
|
|
41668
41694
|
uniqueName,
|
package/dist/index.d.ts
CHANGED
|
@@ -54,7 +54,10 @@ type ResponseType = {
|
|
|
54
54
|
*
|
|
55
55
|
* @usage
|
|
56
56
|
* ```ts
|
|
57
|
-
* await new Scene(topia, "sceneId", {
|
|
57
|
+
* await new Scene(topia, "sceneId", {
|
|
58
|
+
* attributes: { name: "My Scene" },
|
|
59
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
60
|
+
* });
|
|
58
61
|
* ```
|
|
59
62
|
*/
|
|
60
63
|
declare class Scene extends SDKController implements SceneInterface {
|
|
@@ -69,7 +72,10 @@ declare class Scene extends SDKController implements SceneInterface {
|
|
|
69
72
|
*
|
|
70
73
|
* @usage
|
|
71
74
|
* ```ts
|
|
72
|
-
* await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
|
|
75
|
+
* await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
|
|
76
|
+
* attributes: { text: "My Asset" },
|
|
77
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", visitorId: 1 }
|
|
78
|
+
* });
|
|
73
79
|
* ```
|
|
74
80
|
*/
|
|
75
81
|
declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
@@ -384,7 +390,10 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
384
390
|
*
|
|
385
391
|
* @usage
|
|
386
392
|
* ```ts
|
|
387
|
-
* await new World(topia, "exampleWorld", {
|
|
393
|
+
* await new World(topia, "exampleWorld", {
|
|
394
|
+
* attributes: { name: "Example World" },
|
|
395
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
396
|
+
* });
|
|
388
397
|
* ```
|
|
389
398
|
*/
|
|
390
399
|
declare class World extends SDKController implements WorldInterface {
|
|
@@ -694,7 +703,10 @@ declare class World extends SDKController implements WorldInterface {
|
|
|
694
703
|
*
|
|
695
704
|
* @usage
|
|
696
705
|
* ```ts
|
|
697
|
-
* await new User(topia, {
|
|
706
|
+
* await new User(topia, {
|
|
707
|
+
* profileId: 1,
|
|
708
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
709
|
+
* });
|
|
698
710
|
* ```
|
|
699
711
|
*/
|
|
700
712
|
declare class User extends SDKController implements UserInterface {
|
|
@@ -1495,7 +1507,10 @@ declare class SDKController implements SDKInterface {
|
|
|
1495
1507
|
*
|
|
1496
1508
|
* @usage
|
|
1497
1509
|
* ```ts
|
|
1498
|
-
* await new Asset(topia, "assetId", {
|
|
1510
|
+
* await new Asset(topia, "assetId", {
|
|
1511
|
+
* attributes: { assetName: "My Asset", isPublic: false },
|
|
1512
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
1513
|
+
* });
|
|
1499
1514
|
* ```
|
|
1500
1515
|
*/
|
|
1501
1516
|
declare class Asset extends SDKController implements AssetInterface {
|
|
@@ -1512,7 +1527,10 @@ declare class Asset extends SDKController implements AssetInterface {
|
|
|
1512
1527
|
*
|
|
1513
1528
|
* @usage
|
|
1514
1529
|
* ```ts
|
|
1515
|
-
* await new WorldActivity(topia, "exampleWorld", {
|
|
1530
|
+
* await new WorldActivity(topia, "exampleWorld", {
|
|
1531
|
+
* attributes: { name: "Example World" },
|
|
1532
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
1533
|
+
* });
|
|
1516
1534
|
* ```
|
|
1517
1535
|
*/
|
|
1518
1536
|
declare class WorldActivity extends SDKController {
|
|
@@ -1595,8 +1613,9 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
1595
1613
|
create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
|
|
1596
1614
|
get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
|
|
1597
1615
|
getWithUniqueName(uniqueName: string, urlSlug: string, interactivePublicKey: string, interactiveSecret: string): Promise<DroppedAsset>;
|
|
1598
|
-
drop(asset: Asset, { interactivePublicKey, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }: {
|
|
1616
|
+
drop(asset: Asset, { interactivePublicKey, isInteractive, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }: {
|
|
1599
1617
|
interactivePublicKey?: string;
|
|
1618
|
+
isInteractive?: boolean;
|
|
1600
1619
|
position: {
|
|
1601
1620
|
x: number;
|
|
1602
1621
|
y: number;
|
package/dist/index.js
CHANGED
|
@@ -39642,7 +39642,7 @@ class SDKController {
|
|
|
39642
39642
|
let payload = {};
|
|
39643
39643
|
const headers = {};
|
|
39644
39644
|
try {
|
|
39645
|
-
if (topia.interactiveSecret && (profileId || assetId || urlSlug)) {
|
|
39645
|
+
if (topia.interactiveSecret && (profileId || assetId || urlSlug || visitorId)) {
|
|
39646
39646
|
payload = {
|
|
39647
39647
|
interactiveNonce,
|
|
39648
39648
|
visitorId,
|
|
@@ -39707,7 +39707,10 @@ class SDKController {
|
|
|
39707
39707
|
*
|
|
39708
39708
|
* @usage
|
|
39709
39709
|
* ```ts
|
|
39710
|
-
* await new Asset(topia, "assetId", {
|
|
39710
|
+
* await new Asset(topia, "assetId", {
|
|
39711
|
+
* attributes: { assetName: "My Asset", isPublic: false },
|
|
39712
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
39713
|
+
* });
|
|
39711
39714
|
* ```
|
|
39712
39715
|
*/
|
|
39713
39716
|
class Asset extends SDKController {
|
|
@@ -39744,7 +39747,10 @@ var _DroppedAsset_updateDroppedAsset;
|
|
|
39744
39747
|
*
|
|
39745
39748
|
* @usage
|
|
39746
39749
|
* ```ts
|
|
39747
|
-
* await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
|
|
39750
|
+
* await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
|
|
39751
|
+
* attributes: { text: "My Asset" },
|
|
39752
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", visitorId: 1 }
|
|
39753
|
+
* });
|
|
39748
39754
|
* ```
|
|
39749
39755
|
*/
|
|
39750
39756
|
class DroppedAsset extends Asset {
|
|
@@ -40263,7 +40269,10 @@ _DroppedAsset_updateDroppedAsset = new WeakMap();
|
|
|
40263
40269
|
*
|
|
40264
40270
|
* @usage
|
|
40265
40271
|
* ```ts
|
|
40266
|
-
* await new Scene(topia, "sceneId", {
|
|
40272
|
+
* await new Scene(topia, "sceneId", {
|
|
40273
|
+
* attributes: { name: "My Scene" },
|
|
40274
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
40275
|
+
* });
|
|
40267
40276
|
* ```
|
|
40268
40277
|
*/
|
|
40269
40278
|
class Scene extends SDKController {
|
|
@@ -40325,7 +40334,10 @@ var _World_droppedAssetsMap;
|
|
|
40325
40334
|
*
|
|
40326
40335
|
* @usage
|
|
40327
40336
|
* ```ts
|
|
40328
|
-
* await new World(topia, "exampleWorld", {
|
|
40337
|
+
* await new World(topia, "exampleWorld", {
|
|
40338
|
+
* attributes: { name: "Example World" },
|
|
40339
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
40340
|
+
* });
|
|
40329
40341
|
* ```
|
|
40330
40342
|
*/
|
|
40331
40343
|
class World extends SDKController {
|
|
@@ -40837,7 +40849,10 @@ var _User_adminWorldsMap, _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
|
40837
40849
|
*
|
|
40838
40850
|
* @usage
|
|
40839
40851
|
* ```ts
|
|
40840
|
-
* await new User(topia, {
|
|
40852
|
+
* await new User(topia, {
|
|
40853
|
+
* profileId: 1,
|
|
40854
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
40855
|
+
* });
|
|
40841
40856
|
* ```
|
|
40842
40857
|
*/
|
|
40843
40858
|
class User extends SDKController {
|
|
@@ -40846,7 +40861,7 @@ class User extends SDKController {
|
|
|
40846
40861
|
super(topia, {
|
|
40847
40862
|
apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
|
|
40848
40863
|
interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
|
|
40849
|
-
profileId: options.profileId,
|
|
40864
|
+
profileId: options === null || options === void 0 ? void 0 : options.profileId,
|
|
40850
40865
|
urlSlug: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug,
|
|
40851
40866
|
visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
|
|
40852
40867
|
});
|
|
@@ -40854,7 +40869,7 @@ class User extends SDKController {
|
|
|
40854
40869
|
_User_assetsMap.set(this, void 0);
|
|
40855
40870
|
_User_scenesMap.set(this, void 0);
|
|
40856
40871
|
_User_worldsMap.set(this, void 0);
|
|
40857
|
-
this.profileId = options.profileId;
|
|
40872
|
+
this.profileId = options === null || options === void 0 ? void 0 : options.profileId;
|
|
40858
40873
|
this.dataObject = {};
|
|
40859
40874
|
this.profile = {};
|
|
40860
40875
|
__classPrivateFieldSet(this, _User_adminWorldsMap, {}, "f");
|
|
@@ -41446,7 +41461,10 @@ var _WorldActivity_visitorsMap;
|
|
|
41446
41461
|
*
|
|
41447
41462
|
* @usage
|
|
41448
41463
|
* ```ts
|
|
41449
|
-
* await new WorldActivity(topia, "exampleWorld", {
|
|
41464
|
+
* await new WorldActivity(topia, "exampleWorld", {
|
|
41465
|
+
* attributes: { name: "Example World" },
|
|
41466
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
41467
|
+
* });
|
|
41450
41468
|
* ```
|
|
41451
41469
|
*/
|
|
41452
41470
|
class WorldActivity extends SDKController {
|
|
@@ -41654,13 +41672,21 @@ class DroppedAssetFactory extends SDKController {
|
|
|
41654
41672
|
}
|
|
41655
41673
|
});
|
|
41656
41674
|
}
|
|
41657
|
-
drop(asset, { interactivePublicKey, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }) {
|
|
41675
|
+
drop(asset, { interactivePublicKey, isInteractive, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }) {
|
|
41658
41676
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41659
|
-
const params = { interactivePublicKey, sceneDropId, uniqueName, urlSlug, yOrderAdjust };
|
|
41677
|
+
const params = { interactivePublicKey, isInteractive, sceneDropId, uniqueName, urlSlug, yOrderAdjust };
|
|
41678
|
+
if (isInteractive && !interactivePublicKey) {
|
|
41679
|
+
throw this.errorHandler({
|
|
41680
|
+
message: "interactivePublicKey is required",
|
|
41681
|
+
params,
|
|
41682
|
+
sdkMethod: "DroppedAssetFactory.drop",
|
|
41683
|
+
});
|
|
41684
|
+
}
|
|
41660
41685
|
try {
|
|
41661
41686
|
const response = yield this.topiaPublicApi().post(`/world/${urlSlug}/assets`, {
|
|
41662
41687
|
assetId: asset.id,
|
|
41663
41688
|
interactivePublicKey,
|
|
41689
|
+
isInteractive,
|
|
41664
41690
|
position: { x, y },
|
|
41665
41691
|
sceneDropId,
|
|
41666
41692
|
uniqueName,
|
package/package.json
CHANGED