@rtsdk/topia 0.6.1 → 0.6.3
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 +31 -10
- package/dist/index.d.ts +24 -6
- package/dist/index.js +31 -10
- 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,16 +39709,22 @@ 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 {
|
|
39716
39719
|
constructor(topia, id, options = { attributes: {}, credentials: {} }) {
|
|
39717
|
-
var _a, _b, _c;
|
|
39720
|
+
var _a, _b, _c, _d, _e;
|
|
39721
|
+
// assetId and urlSlug should only be used when Asset is extended by DroppedAsset
|
|
39718
39722
|
super(topia, {
|
|
39719
39723
|
apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
|
|
39720
|
-
|
|
39721
|
-
|
|
39724
|
+
assetId: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.assetId,
|
|
39725
|
+
interactiveNonce: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.interactiveNonce,
|
|
39726
|
+
urlSlug: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.urlSlug,
|
|
39727
|
+
visitorId: (_e = options === null || options === void 0 ? void 0 : options.credentials) === null || _e === void 0 ? void 0 : _e.visitorId,
|
|
39722
39728
|
});
|
|
39723
39729
|
this.id = id;
|
|
39724
39730
|
Object.assign(this, options.attributes);
|
|
@@ -39743,7 +39749,10 @@ var _DroppedAsset_updateDroppedAsset;
|
|
|
39743
39749
|
*
|
|
39744
39750
|
* @usage
|
|
39745
39751
|
* ```ts
|
|
39746
|
-
* 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
|
+
* });
|
|
39747
39756
|
* ```
|
|
39748
39757
|
*/
|
|
39749
39758
|
class DroppedAsset extends Asset {
|
|
@@ -40262,7 +40271,10 @@ _DroppedAsset_updateDroppedAsset = new WeakMap();
|
|
|
40262
40271
|
*
|
|
40263
40272
|
* @usage
|
|
40264
40273
|
* ```ts
|
|
40265
|
-
* 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
|
+
* });
|
|
40266
40278
|
* ```
|
|
40267
40279
|
*/
|
|
40268
40280
|
class Scene extends SDKController {
|
|
@@ -40324,7 +40336,10 @@ var _World_droppedAssetsMap;
|
|
|
40324
40336
|
*
|
|
40325
40337
|
* @usage
|
|
40326
40338
|
* ```ts
|
|
40327
|
-
* 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
|
+
* });
|
|
40328
40343
|
* ```
|
|
40329
40344
|
*/
|
|
40330
40345
|
class World extends SDKController {
|
|
@@ -40836,7 +40851,10 @@ var _User_adminWorldsMap, _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
|
40836
40851
|
*
|
|
40837
40852
|
* @usage
|
|
40838
40853
|
* ```ts
|
|
40839
|
-
* await new User(topia, {
|
|
40854
|
+
* await new User(topia, {
|
|
40855
|
+
* profileId: 1,
|
|
40856
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
40857
|
+
* });
|
|
40840
40858
|
* ```
|
|
40841
40859
|
*/
|
|
40842
40860
|
class User extends SDKController {
|
|
@@ -41445,7 +41463,10 @@ var _WorldActivity_visitorsMap;
|
|
|
41445
41463
|
*
|
|
41446
41464
|
* @usage
|
|
41447
41465
|
* ```ts
|
|
41448
|
-
* 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
|
+
* });
|
|
41449
41470
|
* ```
|
|
41450
41471
|
*/
|
|
41451
41472
|
class WorldActivity extends SDKController {
|
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 {
|
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,16 +39707,22 @@ 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 {
|
|
39714
39717
|
constructor(topia, id, options = { attributes: {}, credentials: {} }) {
|
|
39715
|
-
var _a, _b, _c;
|
|
39718
|
+
var _a, _b, _c, _d, _e;
|
|
39719
|
+
// assetId and urlSlug should only be used when Asset is extended by DroppedAsset
|
|
39716
39720
|
super(topia, {
|
|
39717
39721
|
apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
|
|
39718
|
-
|
|
39719
|
-
|
|
39722
|
+
assetId: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.assetId,
|
|
39723
|
+
interactiveNonce: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.interactiveNonce,
|
|
39724
|
+
urlSlug: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.urlSlug,
|
|
39725
|
+
visitorId: (_e = options === null || options === void 0 ? void 0 : options.credentials) === null || _e === void 0 ? void 0 : _e.visitorId,
|
|
39720
39726
|
});
|
|
39721
39727
|
this.id = id;
|
|
39722
39728
|
Object.assign(this, options.attributes);
|
|
@@ -39741,7 +39747,10 @@ var _DroppedAsset_updateDroppedAsset;
|
|
|
39741
39747
|
*
|
|
39742
39748
|
* @usage
|
|
39743
39749
|
* ```ts
|
|
39744
|
-
* 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
|
+
* });
|
|
39745
39754
|
* ```
|
|
39746
39755
|
*/
|
|
39747
39756
|
class DroppedAsset extends Asset {
|
|
@@ -40260,7 +40269,10 @@ _DroppedAsset_updateDroppedAsset = new WeakMap();
|
|
|
40260
40269
|
*
|
|
40261
40270
|
* @usage
|
|
40262
40271
|
* ```ts
|
|
40263
|
-
* 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
|
+
* });
|
|
40264
40276
|
* ```
|
|
40265
40277
|
*/
|
|
40266
40278
|
class Scene extends SDKController {
|
|
@@ -40322,7 +40334,10 @@ var _World_droppedAssetsMap;
|
|
|
40322
40334
|
*
|
|
40323
40335
|
* @usage
|
|
40324
40336
|
* ```ts
|
|
40325
|
-
* 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
|
+
* });
|
|
40326
40341
|
* ```
|
|
40327
40342
|
*/
|
|
40328
40343
|
class World extends SDKController {
|
|
@@ -40834,7 +40849,10 @@ var _User_adminWorldsMap, _User_assetsMap, _User_scenesMap, _User_worldsMap;
|
|
|
40834
40849
|
*
|
|
40835
40850
|
* @usage
|
|
40836
40851
|
* ```ts
|
|
40837
|
-
* await new User(topia, {
|
|
40852
|
+
* await new User(topia, {
|
|
40853
|
+
* profileId: 1,
|
|
40854
|
+
* credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", urlSlug: "exampleWorld", visitorId: 1 }
|
|
40855
|
+
* });
|
|
40838
40856
|
* ```
|
|
40839
40857
|
*/
|
|
40840
40858
|
class User extends SDKController {
|
|
@@ -41443,7 +41461,10 @@ var _WorldActivity_visitorsMap;
|
|
|
41443
41461
|
*
|
|
41444
41462
|
* @usage
|
|
41445
41463
|
* ```ts
|
|
41446
|
-
* 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
|
+
* });
|
|
41447
41468
|
* ```
|
|
41448
41469
|
*/
|
|
41449
41470
|
class WorldActivity extends SDKController {
|
package/package.json
CHANGED