@rtsdk/topia 0.6.3 → 0.7.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
@@ -40184,9 +40184,18 @@ class DroppedAsset extends Asset {
40184
40184
  * });
40185
40185
  * ```
40186
40186
  */
40187
- addWebhook({ dataObject, description, isUniqueOnly, title, type, url, }) {
40187
+ addWebhook({ dataObject, description, isUniqueOnly, shouldSetClickType, shouldSetIsInteractive, title, type, url, }) {
40188
40188
  return __awaiter(this, void 0, void 0, function* () {
40189
- const params = { dataObject, description, isUniqueOnly, title, type, url };
40189
+ const params = {
40190
+ dataObject,
40191
+ description,
40192
+ isUniqueOnly,
40193
+ shouldSetClickType,
40194
+ shouldSetIsInteractive,
40195
+ title,
40196
+ type,
40197
+ url,
40198
+ };
40190
40199
  try {
40191
40200
  const response = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/webhooks`, Object.assign(Object.assign({}, params), { active: true, assetId: this.id, enteredBy: "", urlSlug: this.urlSlug }), this.requestOptions);
40192
40201
  return response.data.webhookId;
@@ -40863,7 +40872,7 @@ class User extends SDKController {
40863
40872
  super(topia, {
40864
40873
  apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
40865
40874
  interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
40866
- profileId: options.profileId,
40875
+ profileId: options === null || options === void 0 ? void 0 : options.profileId,
40867
40876
  urlSlug: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug,
40868
40877
  visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
40869
40878
  });
@@ -40871,7 +40880,7 @@ class User extends SDKController {
40871
40880
  _User_assetsMap.set(this, void 0);
40872
40881
  _User_scenesMap.set(this, void 0);
40873
40882
  _User_worldsMap.set(this, void 0);
40874
- this.profileId = options.profileId;
40883
+ this.profileId = options === null || options === void 0 ? void 0 : options.profileId;
40875
40884
  this.dataObject = {};
40876
40885
  this.profile = {};
40877
40886
  __classPrivateFieldSet(this, _User_adminWorldsMap, {}, "f");
@@ -41674,13 +41683,21 @@ class DroppedAssetFactory extends SDKController {
41674
41683
  }
41675
41684
  });
41676
41685
  }
41677
- drop(asset, { interactivePublicKey, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }) {
41686
+ drop(asset, { interactivePublicKey, isInteractive, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }) {
41678
41687
  return __awaiter(this, void 0, void 0, function* () {
41679
- const params = { interactivePublicKey, sceneDropId, uniqueName, urlSlug, yOrderAdjust };
41688
+ const params = { interactivePublicKey, isInteractive, sceneDropId, uniqueName, urlSlug, yOrderAdjust };
41689
+ if (isInteractive && !interactivePublicKey) {
41690
+ throw this.errorHandler({
41691
+ message: "interactivePublicKey is required",
41692
+ params,
41693
+ sdkMethod: "DroppedAssetFactory.drop",
41694
+ });
41695
+ }
41680
41696
  try {
41681
41697
  const response = yield this.topiaPublicApi().post(`/world/${urlSlug}/assets`, {
41682
41698
  assetId: asset.id,
41683
41699
  interactivePublicKey,
41700
+ isInteractive,
41684
41701
  position: { x, y },
41685
41702
  sceneDropId,
41686
41703
  uniqueName,
package/dist/index.d.ts CHANGED
@@ -6,7 +6,8 @@ declare enum DroppedAssetClickType {
6
6
  NONE = "none",
7
7
  LINK = "link",
8
8
  PORTAL = "portal",
9
- TELEPORT = "teleport"
9
+ TELEPORT = "teleport",
10
+ WEBHOOK = "webhook"
10
11
  }
11
12
  declare enum DroppedAssetMediaType {
12
13
  NONE = "none",
@@ -340,10 +341,12 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
340
341
  * });
341
342
  * ```
342
343
  */
343
- addWebhook({ dataObject, description, isUniqueOnly, title, type, url, }: {
344
+ addWebhook({ dataObject, description, isUniqueOnly, shouldSetClickType, shouldSetIsInteractive, title, type, url, }: {
344
345
  dataObject: object;
345
346
  description: string;
346
347
  isUniqueOnly: boolean;
348
+ shouldSetClickType?: boolean;
349
+ shouldSetIsInteractive?: boolean;
347
350
  title: string;
348
351
  type: string;
349
352
  url: string;
@@ -1414,6 +1417,7 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
1414
1417
  setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType>;
1415
1418
  updateDataObject(dataObject: object, options: object): Promise<void | ResponseType>;
1416
1419
  incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType>;
1420
+ dataObject?: object | null;
1417
1421
  }
1418
1422
  interface WorldOptionalInterface {
1419
1423
  attributes?: WorldDetailsInterface | object;
@@ -1613,8 +1617,9 @@ declare class DroppedAssetFactory extends SDKController {
1613
1617
  create(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): DroppedAsset;
1614
1618
  get(id: string, urlSlug: string, options?: DroppedAssetOptionalInterface): Promise<DroppedAsset>;
1615
1619
  getWithUniqueName(uniqueName: string, urlSlug: string, interactivePublicKey: string, interactiveSecret: string): Promise<DroppedAsset>;
1616
- drop(asset: Asset, { interactivePublicKey, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }: {
1620
+ drop(asset: Asset, { interactivePublicKey, isInteractive, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }: {
1617
1621
  interactivePublicKey?: string;
1622
+ isInteractive?: boolean;
1618
1623
  position: {
1619
1624
  x: number;
1620
1625
  y: number;
package/dist/index.js CHANGED
@@ -40182,9 +40182,18 @@ class DroppedAsset extends Asset {
40182
40182
  * });
40183
40183
  * ```
40184
40184
  */
40185
- addWebhook({ dataObject, description, isUniqueOnly, title, type, url, }) {
40185
+ addWebhook({ dataObject, description, isUniqueOnly, shouldSetClickType, shouldSetIsInteractive, title, type, url, }) {
40186
40186
  return __awaiter(this, void 0, void 0, function* () {
40187
- const params = { dataObject, description, isUniqueOnly, title, type, url };
40187
+ const params = {
40188
+ dataObject,
40189
+ description,
40190
+ isUniqueOnly,
40191
+ shouldSetClickType,
40192
+ shouldSetIsInteractive,
40193
+ title,
40194
+ type,
40195
+ url,
40196
+ };
40188
40197
  try {
40189
40198
  const response = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/webhooks`, Object.assign(Object.assign({}, params), { active: true, assetId: this.id, enteredBy: "", urlSlug: this.urlSlug }), this.requestOptions);
40190
40199
  return response.data.webhookId;
@@ -40861,7 +40870,7 @@ class User extends SDKController {
40861
40870
  super(topia, {
40862
40871
  apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
40863
40872
  interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
40864
- profileId: options.profileId,
40873
+ profileId: options === null || options === void 0 ? void 0 : options.profileId,
40865
40874
  urlSlug: (_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug,
40866
40875
  visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
40867
40876
  });
@@ -40869,7 +40878,7 @@ class User extends SDKController {
40869
40878
  _User_assetsMap.set(this, void 0);
40870
40879
  _User_scenesMap.set(this, void 0);
40871
40880
  _User_worldsMap.set(this, void 0);
40872
- this.profileId = options.profileId;
40881
+ this.profileId = options === null || options === void 0 ? void 0 : options.profileId;
40873
40882
  this.dataObject = {};
40874
40883
  this.profile = {};
40875
40884
  __classPrivateFieldSet(this, _User_adminWorldsMap, {}, "f");
@@ -41672,13 +41681,21 @@ class DroppedAssetFactory extends SDKController {
41672
41681
  }
41673
41682
  });
41674
41683
  }
41675
- drop(asset, { interactivePublicKey, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }) {
41684
+ drop(asset, { interactivePublicKey, isInteractive, position: { x, y }, sceneDropId, uniqueName, urlSlug, yOrderAdjust, }) {
41676
41685
  return __awaiter(this, void 0, void 0, function* () {
41677
- const params = { interactivePublicKey, sceneDropId, uniqueName, urlSlug, yOrderAdjust };
41686
+ const params = { interactivePublicKey, isInteractive, sceneDropId, uniqueName, urlSlug, yOrderAdjust };
41687
+ if (isInteractive && !interactivePublicKey) {
41688
+ throw this.errorHandler({
41689
+ message: "interactivePublicKey is required",
41690
+ params,
41691
+ sdkMethod: "DroppedAssetFactory.drop",
41692
+ });
41693
+ }
41678
41694
  try {
41679
41695
  const response = yield this.topiaPublicApi().post(`/world/${urlSlug}/assets`, {
41680
41696
  assetId: asset.id,
41681
41697
  interactivePublicKey,
41698
+ isInteractive,
41682
41699
  position: { x, y },
41683
41700
  sceneDropId,
41684
41701
  uniqueName,
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.6.3"
62
+ "version": "0.7.1"
63
63
  }