@rtsdk/topia 0.5.4 → 0.6.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/dist/index.cjs CHANGED
@@ -39714,7 +39714,12 @@ class SDKController {
39714
39714
  */
39715
39715
  class Asset extends SDKController {
39716
39716
  constructor(topia, id, options = { attributes: {}, credentials: {} }) {
39717
- super(topia, options.credentials);
39717
+ var _a, _b, _c;
39718
+ super(topia, {
39719
+ apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
39720
+ interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
39721
+ visitorId: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.visitorId,
39722
+ });
39718
39723
  this.id = id;
39719
39724
  Object.assign(this, options.attributes);
39720
39725
  }
@@ -39744,7 +39749,7 @@ var _DroppedAsset_updateDroppedAsset;
39744
39749
  class DroppedAsset extends Asset {
39745
39750
  constructor(topia, id, urlSlug, options = { attributes: { text: "" }, credentials: {} }) {
39746
39751
  var _a;
39747
- super(topia, id, { attributes: options.attributes, credentials: Object.assign(Object.assign({}, options.credentials), { urlSlug }) });
39752
+ super(topia, id, { attributes: options.attributes, credentials: Object.assign(Object.assign({}, options.credentials), { assetId: id, urlSlug }) });
39748
39753
  // private methods
39749
39754
  _DroppedAsset_updateDroppedAsset.set(this, (payload, updateType) => __awaiter(this, void 0, void 0, function* () {
39750
39755
  try {
@@ -40262,7 +40267,13 @@ _DroppedAsset_updateDroppedAsset = new WeakMap();
40262
40267
  */
40263
40268
  class Scene extends SDKController {
40264
40269
  constructor(topia, id, options = { attributes: {}, credentials: {} }) {
40265
- super(topia, options.credentials);
40270
+ var _a, _b, _c, _d;
40271
+ super(topia, {
40272
+ apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
40273
+ interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
40274
+ urlSlug: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug,
40275
+ visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
40276
+ });
40266
40277
  this.id = id;
40267
40278
  Object.assign(this, options.attributes);
40268
40279
  }
@@ -40318,7 +40329,13 @@ var _World_droppedAssetsMap;
40318
40329
  */
40319
40330
  class World extends SDKController {
40320
40331
  constructor(topia, urlSlug, options = { attributes: {}, credentials: {} }) {
40321
- super(topia, Object.assign({ urlSlug }, options.credentials));
40332
+ var _a, _b, _c;
40333
+ super(topia, {
40334
+ apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
40335
+ interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
40336
+ urlSlug,
40337
+ visitorId: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.visitorId,
40338
+ });
40322
40339
  _World_droppedAssetsMap.set(this, void 0);
40323
40340
  ////////// data objects
40324
40341
  /**
@@ -40824,7 +40841,14 @@ var _User_adminWorldsMap, _User_assetsMap, _User_scenesMap, _User_worldsMap;
40824
40841
  */
40825
40842
  class User extends SDKController {
40826
40843
  constructor(topia, options = { profileId: null, credentials: {} }) {
40827
- super(topia, Object.assign({ profileId: options.profileId }, options.credentials));
40844
+ var _a, _b, _c, _d;
40845
+ super(topia, {
40846
+ apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
40847
+ interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
40848
+ profileId: options.profileId,
40849
+ urlSlug: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug,
40850
+ visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
40851
+ });
40828
40852
  _User_adminWorldsMap.set(this, void 0);
40829
40853
  _User_assetsMap.set(this, void 0);
40830
40854
  _User_scenesMap.set(this, void 0);
@@ -41204,15 +41228,17 @@ class Visitor extends User {
41204
41228
  * @usage
41205
41229
  * ```ts
41206
41230
  * await visitor.openIframe({
41231
+ * droppedAssetId: "droppedAssetId",
41207
41232
  * link: "https://topia.io",
41208
41233
  * shouldOpenInDrawer: true,
41209
41234
  * title: "Hello World",
41210
41235
  * });
41211
41236
  * ```
41212
41237
  */
41213
- openIframe({ link, shouldOpenInDrawer, title }) {
41238
+ openIframe({ droppedAssetId, link, shouldOpenInDrawer, title, }) {
41214
41239
  return __awaiter(this, void 0, void 0, function* () {
41215
41240
  const params = {
41241
+ droppedAssetId,
41216
41242
  link,
41217
41243
  shouldOpenInDrawer,
41218
41244
  title,
@@ -41225,6 +41251,44 @@ class Visitor extends User {
41225
41251
  }
41226
41252
  });
41227
41253
  }
41254
+ /**
41255
+ * @summary
41256
+ * Reload an iframe for a visitor currently in a world.
41257
+ *
41258
+ * @usage
41259
+ * ```ts
41260
+ * await visitor.reloadIframe("droppedAssetId");
41261
+ * ```
41262
+ */
41263
+ reloadIframe(droppedAssetId) {
41264
+ return __awaiter(this, void 0, void 0, function* () {
41265
+ try {
41266
+ yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/reload-iframe`, { droppedAssetId }, this.requestOptions);
41267
+ }
41268
+ catch (error) {
41269
+ throw this.errorHandler({ error, params: { droppedAssetId }, sdkMethod: "Visitor.reloadIframe" });
41270
+ }
41271
+ });
41272
+ }
41273
+ /**
41274
+ * @summary
41275
+ * Close an iframe for a visitor currently in a world.
41276
+ *
41277
+ * @usage
41278
+ * ```ts
41279
+ * await visitor.closeIframe("droppedAssetId");
41280
+ * ```
41281
+ */
41282
+ closeIframe(droppedAssetId) {
41283
+ return __awaiter(this, void 0, void 0, function* () {
41284
+ try {
41285
+ yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/close-iframe`, { droppedAssetId }, this.requestOptions);
41286
+ }
41287
+ catch (error) {
41288
+ throw this.errorHandler({ error, params: { droppedAssetId }, sdkMethod: "Visitor.closeIframe" });
41289
+ }
41290
+ });
41291
+ }
41228
41292
  /**
41229
41293
  * @summary
41230
41294
  * Mute and turn video off for a visitor currently in a world.
@@ -41386,7 +41450,13 @@ var _WorldActivity_visitorsMap;
41386
41450
  */
41387
41451
  class WorldActivity extends SDKController {
41388
41452
  constructor(topia, urlSlug, options = { credentials: {} }) {
41389
- super(topia, options.credentials);
41453
+ var _a, _b, _c;
41454
+ super(topia, {
41455
+ apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
41456
+ interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
41457
+ urlSlug,
41458
+ visitorId: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.visitorId,
41459
+ });
41390
41460
  _WorldActivity_visitorsMap.set(this, void 0);
41391
41461
  this.urlSlug = urlSlug;
41392
41462
  __classPrivateFieldSet(this, _WorldActivity_visitorsMap, {}, "f");
package/dist/index.d.ts CHANGED
@@ -902,13 +902,34 @@ declare class Visitor extends User implements VisitorInterface {
902
902
  * @usage
903
903
  * ```ts
904
904
  * await visitor.openIframe({
905
+ * droppedAssetId: "droppedAssetId",
905
906
  * link: "https://topia.io",
906
907
  * shouldOpenInDrawer: true,
907
908
  * title: "Hello World",
908
909
  * });
909
910
  * ```
910
911
  */
911
- openIframe({ link, shouldOpenInDrawer, title }: OpenIframeInterface): Promise<void | ResponseType>;
912
+ openIframe({ droppedAssetId, link, shouldOpenInDrawer, title, }: OpenIframeInterface): Promise<void | ResponseType>;
913
+ /**
914
+ * @summary
915
+ * Reload an iframe for a visitor currently in a world.
916
+ *
917
+ * @usage
918
+ * ```ts
919
+ * await visitor.reloadIframe("droppedAssetId");
920
+ * ```
921
+ */
922
+ reloadIframe(droppedAssetId: string): Promise<void | ResponseType>;
923
+ /**
924
+ * @summary
925
+ * Close an iframe for a visitor currently in a world.
926
+ *
927
+ * @usage
928
+ * ```ts
929
+ * await visitor.closeIframe("droppedAssetId");
930
+ * ```
931
+ */
932
+ closeIframe(droppedAssetId: string): Promise<void | ResponseType>;
912
933
  /**
913
934
  * @summary
914
935
  * Mute and turn video off for a visitor currently in a world.
@@ -1064,7 +1085,7 @@ interface AssetInterface extends SDKInterface {
1064
1085
  }
1065
1086
  type AssetOptionalInterface = {
1066
1087
  attributes?: AssetInterface | object;
1067
- credentials?: InteractiveCredentials | object;
1088
+ credentials?: InteractiveCredentials;
1068
1089
  };
1069
1090
 
1070
1091
  interface DroppedAssetInterface extends AssetInterface {
@@ -1225,7 +1246,7 @@ interface SceneInterface {
1225
1246
  }
1226
1247
  type SceneOptionalInterface = {
1227
1248
  attributes?: SceneInterface | object;
1228
- credentials?: InteractiveCredentials | object;
1249
+ credentials?: InteractiveCredentials;
1229
1250
  };
1230
1251
 
1231
1252
  interface TopiaInterface {
@@ -1247,7 +1268,7 @@ interface UserInterface {
1247
1268
  dataObject?: object | null;
1248
1269
  }
1249
1270
  interface UserOptionalInterface {
1250
- credentials?: InteractiveCredentials | object;
1271
+ credentials?: InteractiveCredentials;
1251
1272
  profileId?: string | null;
1252
1273
  visitorId?: number | null;
1253
1274
  urlSlug?: string;
@@ -1290,7 +1311,7 @@ interface VisitorInterface extends SDKInterface {
1290
1311
  }
1291
1312
  interface VisitorOptionalInterface {
1292
1313
  attributes?: VisitorInterface | object;
1293
- credentials?: InteractiveCredentials | object;
1314
+ credentials?: InteractiveCredentials;
1294
1315
  }
1295
1316
  interface MoveVisitorInterface {
1296
1317
  shouldTeleportVisitor: boolean;
@@ -1303,6 +1324,7 @@ interface FireToastInterface {
1303
1324
  text?: string;
1304
1325
  }
1305
1326
  interface OpenIframeInterface {
1327
+ droppedAssetId: string;
1306
1328
  link: string;
1307
1329
  shouldOpenInDrawer?: boolean;
1308
1330
  title?: string;
@@ -1324,7 +1346,7 @@ interface WebhookInterface {
1324
1346
  }
1325
1347
 
1326
1348
  interface WorldActivityOptionalInterface {
1327
- credentials?: InteractiveCredentials | object;
1349
+ credentials?: InteractiveCredentials;
1328
1350
  }
1329
1351
  interface MoveAllVisitorsInterface {
1330
1352
  shouldFetchVisitors?: boolean;
@@ -1383,7 +1405,7 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
1383
1405
  }
1384
1406
  interface WorldOptionalInterface {
1385
1407
  attributes?: WorldDetailsInterface | object;
1386
- credentials?: InteractiveCredentials | object;
1408
+ credentials?: InteractiveCredentials;
1387
1409
  }
1388
1410
  interface WorldWebhooksInterface {
1389
1411
  webhooks: Array<WebhookInterface>;
package/dist/index.js CHANGED
@@ -39712,7 +39712,12 @@ class SDKController {
39712
39712
  */
39713
39713
  class Asset extends SDKController {
39714
39714
  constructor(topia, id, options = { attributes: {}, credentials: {} }) {
39715
- super(topia, options.credentials);
39715
+ var _a, _b, _c;
39716
+ super(topia, {
39717
+ apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
39718
+ interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
39719
+ visitorId: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.visitorId,
39720
+ });
39716
39721
  this.id = id;
39717
39722
  Object.assign(this, options.attributes);
39718
39723
  }
@@ -39742,7 +39747,7 @@ var _DroppedAsset_updateDroppedAsset;
39742
39747
  class DroppedAsset extends Asset {
39743
39748
  constructor(topia, id, urlSlug, options = { attributes: { text: "" }, credentials: {} }) {
39744
39749
  var _a;
39745
- super(topia, id, { attributes: options.attributes, credentials: Object.assign(Object.assign({}, options.credentials), { urlSlug }) });
39750
+ super(topia, id, { attributes: options.attributes, credentials: Object.assign(Object.assign({}, options.credentials), { assetId: id, urlSlug }) });
39746
39751
  // private methods
39747
39752
  _DroppedAsset_updateDroppedAsset.set(this, (payload, updateType) => __awaiter(this, void 0, void 0, function* () {
39748
39753
  try {
@@ -40260,7 +40265,13 @@ _DroppedAsset_updateDroppedAsset = new WeakMap();
40260
40265
  */
40261
40266
  class Scene extends SDKController {
40262
40267
  constructor(topia, id, options = { attributes: {}, credentials: {} }) {
40263
- super(topia, options.credentials);
40268
+ var _a, _b, _c, _d;
40269
+ super(topia, {
40270
+ apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
40271
+ interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
40272
+ urlSlug: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug,
40273
+ visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
40274
+ });
40264
40275
  this.id = id;
40265
40276
  Object.assign(this, options.attributes);
40266
40277
  }
@@ -40316,7 +40327,13 @@ var _World_droppedAssetsMap;
40316
40327
  */
40317
40328
  class World extends SDKController {
40318
40329
  constructor(topia, urlSlug, options = { attributes: {}, credentials: {} }) {
40319
- super(topia, Object.assign({ urlSlug }, options.credentials));
40330
+ var _a, _b, _c;
40331
+ super(topia, {
40332
+ apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
40333
+ interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
40334
+ urlSlug,
40335
+ visitorId: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.visitorId,
40336
+ });
40320
40337
  _World_droppedAssetsMap.set(this, void 0);
40321
40338
  ////////// data objects
40322
40339
  /**
@@ -40822,7 +40839,14 @@ var _User_adminWorldsMap, _User_assetsMap, _User_scenesMap, _User_worldsMap;
40822
40839
  */
40823
40840
  class User extends SDKController {
40824
40841
  constructor(topia, options = { profileId: null, credentials: {} }) {
40825
- super(topia, Object.assign({ profileId: options.profileId }, options.credentials));
40842
+ var _a, _b, _c, _d;
40843
+ super(topia, {
40844
+ apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
40845
+ interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
40846
+ profileId: options.profileId,
40847
+ urlSlug: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug,
40848
+ visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
40849
+ });
40826
40850
  _User_adminWorldsMap.set(this, void 0);
40827
40851
  _User_assetsMap.set(this, void 0);
40828
40852
  _User_scenesMap.set(this, void 0);
@@ -41202,15 +41226,17 @@ class Visitor extends User {
41202
41226
  * @usage
41203
41227
  * ```ts
41204
41228
  * await visitor.openIframe({
41229
+ * droppedAssetId: "droppedAssetId",
41205
41230
  * link: "https://topia.io",
41206
41231
  * shouldOpenInDrawer: true,
41207
41232
  * title: "Hello World",
41208
41233
  * });
41209
41234
  * ```
41210
41235
  */
41211
- openIframe({ link, shouldOpenInDrawer, title }) {
41236
+ openIframe({ droppedAssetId, link, shouldOpenInDrawer, title, }) {
41212
41237
  return __awaiter(this, void 0, void 0, function* () {
41213
41238
  const params = {
41239
+ droppedAssetId,
41214
41240
  link,
41215
41241
  shouldOpenInDrawer,
41216
41242
  title,
@@ -41223,6 +41249,44 @@ class Visitor extends User {
41223
41249
  }
41224
41250
  });
41225
41251
  }
41252
+ /**
41253
+ * @summary
41254
+ * Reload an iframe for a visitor currently in a world.
41255
+ *
41256
+ * @usage
41257
+ * ```ts
41258
+ * await visitor.reloadIframe("droppedAssetId");
41259
+ * ```
41260
+ */
41261
+ reloadIframe(droppedAssetId) {
41262
+ return __awaiter(this, void 0, void 0, function* () {
41263
+ try {
41264
+ yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/reload-iframe`, { droppedAssetId }, this.requestOptions);
41265
+ }
41266
+ catch (error) {
41267
+ throw this.errorHandler({ error, params: { droppedAssetId }, sdkMethod: "Visitor.reloadIframe" });
41268
+ }
41269
+ });
41270
+ }
41271
+ /**
41272
+ * @summary
41273
+ * Close an iframe for a visitor currently in a world.
41274
+ *
41275
+ * @usage
41276
+ * ```ts
41277
+ * await visitor.closeIframe("droppedAssetId");
41278
+ * ```
41279
+ */
41280
+ closeIframe(droppedAssetId) {
41281
+ return __awaiter(this, void 0, void 0, function* () {
41282
+ try {
41283
+ yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/close-iframe`, { droppedAssetId }, this.requestOptions);
41284
+ }
41285
+ catch (error) {
41286
+ throw this.errorHandler({ error, params: { droppedAssetId }, sdkMethod: "Visitor.closeIframe" });
41287
+ }
41288
+ });
41289
+ }
41226
41290
  /**
41227
41291
  * @summary
41228
41292
  * Mute and turn video off for a visitor currently in a world.
@@ -41384,7 +41448,13 @@ var _WorldActivity_visitorsMap;
41384
41448
  */
41385
41449
  class WorldActivity extends SDKController {
41386
41450
  constructor(topia, urlSlug, options = { credentials: {} }) {
41387
- super(topia, options.credentials);
41451
+ var _a, _b, _c;
41452
+ super(topia, {
41453
+ apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
41454
+ interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
41455
+ urlSlug,
41456
+ visitorId: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.visitorId,
41457
+ });
41388
41458
  _WorldActivity_visitorsMap.set(this, void 0);
41389
41459
  this.urlSlug = urlSlug;
41390
41460
  __classPrivateFieldSet(this, _WorldActivity_visitorsMap, {}, "f");
package/package.json CHANGED
@@ -59,5 +59,5 @@
59
59
  "local-publish": "yarn build && yalc publish --push --no-scripts"
60
60
  },
61
61
  "type": "module",
62
- "version": "0.5.4"
62
+ "version": "0.6.1"
63
63
  }