@rtsdk/topia 0.8.0 → 0.8.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
@@ -41689,8 +41689,8 @@ class DroppedAssetFactory extends SDKController {
41689
41689
  getWithUniqueName(uniqueName, urlSlug, interactivePublicKey, interactiveSecret) {
41690
41690
  return __awaiter(this, void 0, void 0, function* () {
41691
41691
  const params = { uniqueName, urlSlug, interactivePublicKey, interactiveSecret };
41692
- const interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41693
41692
  try {
41693
+ const interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41694
41694
  const response = yield this.topiaPublicApi().get(`/world/${urlSlug}/asset-by-unique-name/${uniqueName}`, { headers: { interactiveJWT, publickey: interactivePublicKey } });
41695
41695
  const { id } = response.data;
41696
41696
  return new DroppedAsset(this.topia, id, urlSlug, { attributes: response.data });
@@ -41700,7 +41700,7 @@ class DroppedAssetFactory extends SDKController {
41700
41700
  }
41701
41701
  });
41702
41702
  }
41703
- drop(asset, { assetScale, flipped, interactivePublicKey, isInteractive, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
41703
+ drop(asset, { assetScale = 1, flipped, interactivePublicKey, isInteractive, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
41704
41704
  return __awaiter(this, void 0, void 0, function* () {
41705
41705
  let specialType;
41706
41706
  if (layer0 || layer1)
@@ -41795,13 +41795,33 @@ class WorldActivityFactory {
41795
41795
  }
41796
41796
  }
41797
41797
 
41798
- class WorldFactory {
41798
+ class WorldFactory extends SDKController {
41799
41799
  constructor(topia) {
41800
- this.topia = topia;
41800
+ super(topia);
41801
41801
  }
41802
41802
  create(urlSlug, options) {
41803
41803
  return new World(this.topia, urlSlug, options);
41804
41804
  }
41805
+ deleteDroppedAssets(urlSlug, droppedAssetIds, interactivePublicKey, interactiveSecret) {
41806
+ return __awaiter(this, void 0, void 0, function* () {
41807
+ const params = { droppedAssetIds, urlSlug, interactivePublicKey, interactiveSecret };
41808
+ try {
41809
+ const interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41810
+ const promiseArray = [];
41811
+ for (const id of droppedAssetIds) {
41812
+ promiseArray.push(this.topiaPublicApi().delete(`/world/${urlSlug}/assets/${id}`, {
41813
+ headers: { interactiveJWT, publickey: interactivePublicKey },
41814
+ }));
41815
+ }
41816
+ const result = yield Promise.all(promiseArray);
41817
+ console.log(result);
41818
+ return { success: true };
41819
+ }
41820
+ catch (error) {
41821
+ throw this.errorHandler({ error, params, sdkMethod: "DroppedAssetFactory.getWithUniqueName" });
41822
+ }
41823
+ });
41824
+ }
41805
41825
  }
41806
41826
 
41807
41827
  Error.stackTraceLimit = 20;
package/dist/index.d.ts CHANGED
@@ -1676,10 +1676,12 @@ declare class WorldActivityFactory {
1676
1676
  create(urlSlug: string, options?: WorldOptionalInterface): WorldActivity;
1677
1677
  }
1678
1678
 
1679
- declare class WorldFactory {
1680
- topia: Topia;
1679
+ declare class WorldFactory extends SDKController {
1681
1680
  constructor(topia: Topia);
1682
1681
  create(urlSlug: string, options?: WorldOptionalInterface): World;
1682
+ deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], interactivePublicKey: string, interactiveSecret: string): Promise<{
1683
+ success: boolean;
1684
+ }>;
1683
1685
  }
1684
1686
 
1685
1687
  export { Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetMediaType, DroppedAssetOptionalInterface, DroppedAssetOptions, FireToastInterface, InteractiveCredentials, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, UserOptionalInterface, UserOptions, Visitor, VisitorFactory, VisitorInterface, VisitorOptionalInterface, VisitorOptions, VisitorType, VisitorsToMoveArrayType, VisitorsToMoveType, WebhookInterface, World, WorldActivity, WorldActivityFactory, WorldActivityOptionalInterface, WorldDetailsInterface, WorldFactory, WorldInterface, WorldOptionalInterface, WorldOptions, WorldWebhooksInterface };
package/dist/index.js CHANGED
@@ -41687,8 +41687,8 @@ class DroppedAssetFactory extends SDKController {
41687
41687
  getWithUniqueName(uniqueName, urlSlug, interactivePublicKey, interactiveSecret) {
41688
41688
  return __awaiter(this, void 0, void 0, function* () {
41689
41689
  const params = { uniqueName, urlSlug, interactivePublicKey, interactiveSecret };
41690
- const interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41691
41690
  try {
41691
+ const interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41692
41692
  const response = yield this.topiaPublicApi().get(`/world/${urlSlug}/asset-by-unique-name/${uniqueName}`, { headers: { interactiveJWT, publickey: interactivePublicKey } });
41693
41693
  const { id } = response.data;
41694
41694
  return new DroppedAsset(this.topia, id, urlSlug, { attributes: response.data });
@@ -41698,7 +41698,7 @@ class DroppedAssetFactory extends SDKController {
41698
41698
  }
41699
41699
  });
41700
41700
  }
41701
- drop(asset, { assetScale, flipped, interactivePublicKey, isInteractive, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
41701
+ drop(asset, { assetScale = 1, flipped, interactivePublicKey, isInteractive, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
41702
41702
  return __awaiter(this, void 0, void 0, function* () {
41703
41703
  let specialType;
41704
41704
  if (layer0 || layer1)
@@ -41793,13 +41793,33 @@ class WorldActivityFactory {
41793
41793
  }
41794
41794
  }
41795
41795
 
41796
- class WorldFactory {
41796
+ class WorldFactory extends SDKController {
41797
41797
  constructor(topia) {
41798
- this.topia = topia;
41798
+ super(topia);
41799
41799
  }
41800
41800
  create(urlSlug, options) {
41801
41801
  return new World(this.topia, urlSlug, options);
41802
41802
  }
41803
+ deleteDroppedAssets(urlSlug, droppedAssetIds, interactivePublicKey, interactiveSecret) {
41804
+ return __awaiter(this, void 0, void 0, function* () {
41805
+ const params = { droppedAssetIds, urlSlug, interactivePublicKey, interactiveSecret };
41806
+ try {
41807
+ const interactiveJWT = jwt.sign(interactivePublicKey, interactiveSecret);
41808
+ const promiseArray = [];
41809
+ for (const id of droppedAssetIds) {
41810
+ promiseArray.push(this.topiaPublicApi().delete(`/world/${urlSlug}/assets/${id}`, {
41811
+ headers: { interactiveJWT, publickey: interactivePublicKey },
41812
+ }));
41813
+ }
41814
+ const result = yield Promise.all(promiseArray);
41815
+ console.log(result);
41816
+ return { success: true };
41817
+ }
41818
+ catch (error) {
41819
+ throw this.errorHandler({ error, params, sdkMethod: "DroppedAssetFactory.getWithUniqueName" });
41820
+ }
41821
+ });
41822
+ }
41803
41823
  }
41804
41824
 
41805
41825
  Error.stackTraceLimit = 20;
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.8.0"
62
+ "version": "0.8.1"
63
63
  }