@rtsdk/topia 0.12.0 → 0.12.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/dist/index.cjs CHANGED
@@ -42398,9 +42398,15 @@ class DroppedAssetFactory extends SDKController {
42398
42398
  return __awaiter(this, void 0, void 0, function* () {
42399
42399
  const params = { credentials, interactiveSecret, uniqueName, urlSlug };
42400
42400
  try {
42401
+ const { apiKey, interactivePublicKey } = credentials;
42401
42402
  const headers = {};
42402
- headers.interactiveJWT = jwt.sign(credentials, interactiveSecret);
42403
- headers.publickey = credentials.interactivePublicKey;
42403
+ headers.publickey = interactivePublicKey;
42404
+ if (interactiveSecret)
42405
+ headers.interactiveJWT = jwt.sign(credentials, interactiveSecret);
42406
+ else if (apiKey)
42407
+ headers.Authorization = apiKey;
42408
+ else
42409
+ throw "An apiKey or interactive credentials are required.";
42404
42410
  const response = yield this.topiaPublicApi().get(`/world/${urlSlug}/asset-by-unique-name/${uniqueName}`, { headers });
42405
42411
  const { id } = response.data;
42406
42412
  return new DroppedAsset(this.topia, id, urlSlug, { attributes: response.data });
@@ -42430,7 +42436,7 @@ class DroppedAssetFactory extends SDKController {
42430
42436
  });
42431
42437
  * ```
42432
42438
  */
42433
- drop(asset, { assetScale = 1, flipped, interactivePublicKey, isInteractive, layer0 = "", layer1 = "", position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
42439
+ drop(asset, { assetScale = 1, clickType, clickableDisplayTextDescription, clickableDisplayTextHeadline, clickableLink, clickableLinkTitle, flipped, interactivePublicKey, isInteractive, isForceLinkInIframe, isOpenLinkInDrawer, layer0 = "", layer1 = "", position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
42434
42440
  return __awaiter(this, void 0, void 0, function* () {
42435
42441
  let specialType = null;
42436
42442
  if (layer0 || layer1)
@@ -42439,11 +42445,18 @@ class DroppedAssetFactory extends SDKController {
42439
42445
  specialType = "text";
42440
42446
  const params = {
42441
42447
  assetScale,
42448
+ clickType,
42449
+ clickableDisplayTextDescription,
42450
+ clickableDisplayTextHeadline,
42451
+ clickableLink,
42452
+ clickableLinkTitle,
42442
42453
  flipped,
42443
- layer0,
42444
- layer1,
42445
42454
  interactivePublicKey,
42446
42455
  isInteractive,
42456
+ isForceLinkInIframe,
42457
+ isOpenLinkInDrawer,
42458
+ layer0,
42459
+ layer1,
42447
42460
  sceneDropId,
42448
42461
  specialType,
42449
42462
  text,
@@ -42452,7 +42465,6 @@ class DroppedAssetFactory extends SDKController {
42452
42465
  textWeight,
42453
42466
  textWidth,
42454
42467
  uniqueName,
42455
- urlSlug,
42456
42468
  yOrderAdjust,
42457
42469
  };
42458
42470
  if (isInteractive && !interactivePublicKey) {
@@ -42662,9 +42674,15 @@ class WorldFactory extends SDKController {
42662
42674
  return __awaiter(this, void 0, void 0, function* () {
42663
42675
  const params = { credentials, droppedAssetIds, urlSlug };
42664
42676
  try {
42677
+ const { apiKey, interactivePublicKey } = credentials;
42665
42678
  const headers = {};
42666
- headers.interactiveJWT = jwt.sign(credentials, interactiveSecret);
42667
- headers.publickey = credentials.interactivePublicKey;
42679
+ headers.publickey = interactivePublicKey;
42680
+ if (interactiveSecret)
42681
+ headers.interactiveJWT = jwt.sign(credentials, interactiveSecret);
42682
+ else if (apiKey)
42683
+ headers.Authorization = apiKey;
42684
+ else
42685
+ throw "An apiKey or interactive credentials are required.";
42668
42686
  const promiseArray = [];
42669
42687
  for (const id of droppedAssetIds) {
42670
42688
  promiseArray.push(this.topiaPublicApi().delete(`/world/${urlSlug}/assets/${id}`, {
package/dist/index.d.ts CHANGED
@@ -1580,8 +1580,8 @@ interface UpdateClickTypeInterface {
1580
1580
  clickableDisplayTextHeadline: string;
1581
1581
  isForceLinkInIframe?: boolean;
1582
1582
  isOpenLinkInDrawer?: boolean;
1583
- portalName: string;
1584
- position: {
1583
+ portalName?: string;
1584
+ position?: {
1585
1585
  x: number;
1586
1586
  y: number;
1587
1587
  };
@@ -2138,9 +2138,10 @@ declare class DroppedAssetFactory extends SDKController {
2138
2138
  * ```
2139
2139
  */
2140
2140
  getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: {
2141
- interactiveNonce: string;
2141
+ apiKey?: string;
2142
+ interactiveNonce?: string;
2142
2143
  interactivePublicKey: string;
2143
- visitorId: number;
2144
+ visitorId?: number;
2144
2145
  }): Promise<DroppedAsset>;
2145
2146
  /**
2146
2147
  * @summary
@@ -2162,11 +2163,18 @@ declare class DroppedAssetFactory extends SDKController {
2162
2163
  });
2163
2164
  * ```
2164
2165
  */
2165
- drop(asset: Asset, { assetScale, flipped, interactivePublicKey, isInteractive, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }: {
2166
+ drop(asset: Asset, { assetScale, clickType, clickableDisplayTextDescription, clickableDisplayTextHeadline, clickableLink, clickableLinkTitle, flipped, interactivePublicKey, isInteractive, isForceLinkInIframe, isOpenLinkInDrawer, layer0, layer1, position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }: {
2166
2167
  assetScale?: number;
2167
2168
  flipped?: boolean;
2169
+ clickType?: string;
2170
+ clickableDisplayTextDescription?: string;
2171
+ clickableDisplayTextHeadline?: string;
2172
+ clickableLink?: string;
2173
+ clickableLinkTitle?: string;
2168
2174
  interactivePublicKey?: string;
2169
2175
  isInteractive?: boolean;
2176
+ isForceLinkInIframe?: boolean;
2177
+ isOpenLinkInDrawer?: boolean;
2170
2178
  layer0?: string;
2171
2179
  layer1?: string;
2172
2180
  position: {
@@ -2338,9 +2346,10 @@ declare class WorldFactory extends SDKController {
2338
2346
  * ```
2339
2347
  */
2340
2348
  deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], interactiveSecret: string, credentials: {
2341
- interactiveNonce: string;
2349
+ apiKey?: string;
2350
+ interactiveNonce?: string;
2342
2351
  interactivePublicKey: string;
2343
- visitorId: number;
2352
+ visitorId?: number;
2344
2353
  }): Promise<{
2345
2354
  success: boolean;
2346
2355
  }>;
package/dist/index.js CHANGED
@@ -42396,9 +42396,15 @@ class DroppedAssetFactory extends SDKController {
42396
42396
  return __awaiter(this, void 0, void 0, function* () {
42397
42397
  const params = { credentials, interactiveSecret, uniqueName, urlSlug };
42398
42398
  try {
42399
+ const { apiKey, interactivePublicKey } = credentials;
42399
42400
  const headers = {};
42400
- headers.interactiveJWT = jwt.sign(credentials, interactiveSecret);
42401
- headers.publickey = credentials.interactivePublicKey;
42401
+ headers.publickey = interactivePublicKey;
42402
+ if (interactiveSecret)
42403
+ headers.interactiveJWT = jwt.sign(credentials, interactiveSecret);
42404
+ else if (apiKey)
42405
+ headers.Authorization = apiKey;
42406
+ else
42407
+ throw "An apiKey or interactive credentials are required.";
42402
42408
  const response = yield this.topiaPublicApi().get(`/world/${urlSlug}/asset-by-unique-name/${uniqueName}`, { headers });
42403
42409
  const { id } = response.data;
42404
42410
  return new DroppedAsset(this.topia, id, urlSlug, { attributes: response.data });
@@ -42428,7 +42434,7 @@ class DroppedAssetFactory extends SDKController {
42428
42434
  });
42429
42435
  * ```
42430
42436
  */
42431
- drop(asset, { assetScale = 1, flipped, interactivePublicKey, isInteractive, layer0 = "", layer1 = "", position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
42437
+ drop(asset, { assetScale = 1, clickType, clickableDisplayTextDescription, clickableDisplayTextHeadline, clickableLink, clickableLinkTitle, flipped, interactivePublicKey, isInteractive, isForceLinkInIframe, isOpenLinkInDrawer, layer0 = "", layer1 = "", position: { x, y }, sceneDropId, text, textColor, textSize, textWeight, textWidth, uniqueName, urlSlug, yOrderAdjust, }) {
42432
42438
  return __awaiter(this, void 0, void 0, function* () {
42433
42439
  let specialType = null;
42434
42440
  if (layer0 || layer1)
@@ -42437,11 +42443,18 @@ class DroppedAssetFactory extends SDKController {
42437
42443
  specialType = "text";
42438
42444
  const params = {
42439
42445
  assetScale,
42446
+ clickType,
42447
+ clickableDisplayTextDescription,
42448
+ clickableDisplayTextHeadline,
42449
+ clickableLink,
42450
+ clickableLinkTitle,
42440
42451
  flipped,
42441
- layer0,
42442
- layer1,
42443
42452
  interactivePublicKey,
42444
42453
  isInteractive,
42454
+ isForceLinkInIframe,
42455
+ isOpenLinkInDrawer,
42456
+ layer0,
42457
+ layer1,
42445
42458
  sceneDropId,
42446
42459
  specialType,
42447
42460
  text,
@@ -42450,7 +42463,6 @@ class DroppedAssetFactory extends SDKController {
42450
42463
  textWeight,
42451
42464
  textWidth,
42452
42465
  uniqueName,
42453
- urlSlug,
42454
42466
  yOrderAdjust,
42455
42467
  };
42456
42468
  if (isInteractive && !interactivePublicKey) {
@@ -42660,9 +42672,15 @@ class WorldFactory extends SDKController {
42660
42672
  return __awaiter(this, void 0, void 0, function* () {
42661
42673
  const params = { credentials, droppedAssetIds, urlSlug };
42662
42674
  try {
42675
+ const { apiKey, interactivePublicKey } = credentials;
42663
42676
  const headers = {};
42664
- headers.interactiveJWT = jwt.sign(credentials, interactiveSecret);
42665
- headers.publickey = credentials.interactivePublicKey;
42677
+ headers.publickey = interactivePublicKey;
42678
+ if (interactiveSecret)
42679
+ headers.interactiveJWT = jwt.sign(credentials, interactiveSecret);
42680
+ else if (apiKey)
42681
+ headers.Authorization = apiKey;
42682
+ else
42683
+ throw "An apiKey or interactive credentials are required.";
42666
42684
  const promiseArray = [];
42667
42685
  for (const id of droppedAssetIds) {
42668
42686
  promiseArray.push(this.topiaPublicApi().delete(`/world/${urlSlug}/assets/${id}`, {
package/package.json CHANGED
@@ -60,5 +60,5 @@
60
60
  "yalc-push": "yarn build && yalc publish --push --dev --no-scripts"
61
61
  },
62
62
  "type": "module",
63
- "version": "0.12.00"
63
+ "version": "0.12.02"
64
64
  }