@rtsdk/topia 0.9.0 → 0.9.2

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 CHANGED
@@ -205,6 +205,15 @@ try {
205
205
 
206
206
  Once complete be sure to also call `await keyAsset.updateDataObject({ turnCount: turnCount + 1 });` so that the next player is free to take their turn!
207
207
 
208
+ **Custom analytics**
209
+ You can leverage the data object methods for all types to track analytics unique to your Public Key by passing `analytics` as an optional array to all calls that set, update, or increment data objects!
210
+
211
+ ```js
212
+ await droppedAsset.updateDataObject({ isResetInProgress: true }, { analytics: ["resetCount"], lock: { lockId } });
213
+ ```
214
+
215
+ Note: This does NOT impact the data objects themselves but rather allows you to track custom analytics (incremented by 1) across all instances of your application with a given Public Key.
216
+
208
217
  <br>
209
218
 
210
219
  <hr/>
@@ -237,6 +246,12 @@ We've added a Pull Request template to help make it easier for developers to cla
237
246
 
238
247
  ## Documentation
239
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
+
240
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!
241
256
 
242
257
  To update docs run `yarn docs`.
package/dist/index.cjs CHANGED
@@ -40655,7 +40655,7 @@ class World extends SDKController {
40655
40655
  try {
40656
40656
  if (!sceneDropId)
40657
40657
  throw this.errorHandler({ message: "A sceneDropId is required." });
40658
- const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}?${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
40658
+ const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
40659
40659
  // create temp map and then update private property only once
40660
40660
  const droppedAssets = [];
40661
40661
  for (const asset of response.data.assets) {
@@ -40906,10 +40906,15 @@ class World extends SDKController {
40906
40906
  switch (periodType) {
40907
40907
  case "week":
40908
40908
  query = `&week=W${dateValue}`;
40909
+ break;
40909
40910
  case "month":
40910
40911
  query = `&month=${dateValue}`;
40912
+ break;
40911
40913
  case "quarter":
40912
40914
  query = `&quarter=Q${dateValue}`;
40915
+ break;
40916
+ default:
40917
+ "";
40913
40918
  }
40914
40919
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/world-analytics?year=${year}${query}`, this.requestOptions);
40915
40920
  return response.data;
@@ -40973,6 +40978,26 @@ class User extends SDKController {
40973
40978
  get worlds() {
40974
40979
  return __classPrivateFieldGet(this, _User_worldsMap, "f");
40975
40980
  }
40981
+ /**
40982
+ * @summary
40983
+ * Verify user has valid interactive credentials
40984
+ *
40985
+ * @usage
40986
+ * ```ts
40987
+ * await user.checkInteractiveCredentials();
40988
+ * ```
40989
+ */
40990
+ checkInteractiveCredentials() {
40991
+ return __awaiter(this, void 0, void 0, function* () {
40992
+ try {
40993
+ const response = yield this.topiaPublicApi().get(`/auth/interactive-credentials`, this.requestOptions);
40994
+ return response.data;
40995
+ }
40996
+ catch (error) {
40997
+ throw this.errorHandler({ error, sdkMethod: "User.checkInteractiveCredentials" });
40998
+ }
40999
+ });
41000
+ }
40976
41001
  /**
40977
41002
  * @summary
40978
41003
  * Returns all assets owned by User when an email address is provided.
@@ -42066,7 +42091,7 @@ class WorldFactory extends SDKController {
42066
42091
  *
42067
42092
  * @usage
42068
42093
  * ```
42069
- * await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], { interactiveNonce, interactivePublicKey, visitorId });
42094
+ * await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], { interactivePublicKey, interactiveSecret });
42070
42095
  * ```
42071
42096
  */
42072
42097
  deleteDroppedAssets(urlSlug, droppedAssetIds, credentials) {
package/dist/index.d.ts CHANGED
@@ -784,6 +784,16 @@ declare class User extends SDKController implements UserInterface {
784
784
  get worlds(): {
785
785
  [key: string]: World;
786
786
  };
787
+ /**
788
+ * @summary
789
+ * Verify user has valid interactive credentials
790
+ *
791
+ * @usage
792
+ * ```ts
793
+ * await user.checkInteractiveCredentials();
794
+ * ```
795
+ */
796
+ checkInteractiveCredentials(): Promise<void | ResponseType$1>;
787
797
  /**
788
798
  * @summary
789
799
  * Returns all assets owned by User when an email address is provided.
@@ -1225,6 +1235,7 @@ interface DroppedAssetInterface extends AssetInterface {
1225
1235
  assetPrivateZoneChannelDisabled?: boolean | null;
1226
1236
  assetPrivateConversationCap?: number | null;
1227
1237
  audioSliderVolume?: number | null;
1238
+ bottomLayerURL?: string | null;
1228
1239
  broadcasterEmail?: string | null;
1229
1240
  clickType?: string | null;
1230
1241
  clickableLink?: string | null;
@@ -1270,6 +1281,7 @@ interface DroppedAssetInterface extends AssetInterface {
1270
1281
  textFontFamily?: string | null;
1271
1282
  teleportX?: number | null;
1272
1283
  teleportY?: number | null;
1284
+ topLayerURL?: string | null;
1273
1285
  tokenSymbol?: string | null;
1274
1286
  tokenName?: string | null;
1275
1287
  worldId?: string | null;
@@ -1934,7 +1946,7 @@ declare class WorldFactory extends SDKController {
1934
1946
  *
1935
1947
  * @usage
1936
1948
  * ```
1937
- * await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], { interactiveNonce, interactivePublicKey, visitorId });
1949
+ * await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], { interactivePublicKey, interactiveSecret });
1938
1950
  * ```
1939
1951
  */
1940
1952
  deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], credentials: {
package/dist/index.js CHANGED
@@ -40653,7 +40653,7 @@ class World extends SDKController {
40653
40653
  try {
40654
40654
  if (!sceneDropId)
40655
40655
  throw this.errorHandler({ message: "A sceneDropId is required." });
40656
- const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}?${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
40656
+ const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-scene-drop-id/${sceneDropId}${uniqueName ? `?uniqueName=${uniqueName}` : ""}`, this.requestOptions);
40657
40657
  // create temp map and then update private property only once
40658
40658
  const droppedAssets = [];
40659
40659
  for (const asset of response.data.assets) {
@@ -40904,10 +40904,15 @@ class World extends SDKController {
40904
40904
  switch (periodType) {
40905
40905
  case "week":
40906
40906
  query = `&week=W${dateValue}`;
40907
+ break;
40907
40908
  case "month":
40908
40909
  query = `&month=${dateValue}`;
40910
+ break;
40909
40911
  case "quarter":
40910
40912
  query = `&quarter=Q${dateValue}`;
40913
+ break;
40914
+ default:
40915
+ "";
40911
40916
  }
40912
40917
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/world-analytics?year=${year}${query}`, this.requestOptions);
40913
40918
  return response.data;
@@ -40971,6 +40976,26 @@ class User extends SDKController {
40971
40976
  get worlds() {
40972
40977
  return __classPrivateFieldGet(this, _User_worldsMap, "f");
40973
40978
  }
40979
+ /**
40980
+ * @summary
40981
+ * Verify user has valid interactive credentials
40982
+ *
40983
+ * @usage
40984
+ * ```ts
40985
+ * await user.checkInteractiveCredentials();
40986
+ * ```
40987
+ */
40988
+ checkInteractiveCredentials() {
40989
+ return __awaiter(this, void 0, void 0, function* () {
40990
+ try {
40991
+ const response = yield this.topiaPublicApi().get(`/auth/interactive-credentials`, this.requestOptions);
40992
+ return response.data;
40993
+ }
40994
+ catch (error) {
40995
+ throw this.errorHandler({ error, sdkMethod: "User.checkInteractiveCredentials" });
40996
+ }
40997
+ });
40998
+ }
40974
40999
  /**
40975
41000
  * @summary
40976
41001
  * Returns all assets owned by User when an email address is provided.
@@ -42064,7 +42089,7 @@ class WorldFactory extends SDKController {
42064
42089
  *
42065
42090
  * @usage
42066
42091
  * ```
42067
- * await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], { interactiveNonce, interactivePublicKey, visitorId });
42092
+ * await World.deleteDroppedAssets(urlSlug, ["exampleDroppedAssetId1", "exampleDroppedAssetId2"], { interactivePublicKey, interactiveSecret });
42068
42093
  * ```
42069
42094
  */
42070
42095
  deleteDroppedAssets(urlSlug, droppedAssetIds, credentials) {
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.9.0"
62
+ "version": "0.9.2"
63
63
  }