Class DroppedAsset

Summary

Create an instance of Dropped Asset class with a given dropped asset id, url slug, and optional attributes and session credentials.

Usage

await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
attributes: { text: "My Asset" },
credentials: { apiKey: "exampleKey", interactiveNonce: "exampleNonce", visitorId: 1 }
});

Hierarchy

Implements

Constructors

Properties

credentials: undefined | InteractiveCredentials
dataObject?: null | object
id?: string
interactivePublicKey?: null | string
isInteractive?: null | boolean
jwt?: string
position: {
    x: number;
    y: number;
}

Type declaration

  • x: number
  • y: number
requestOptions: object
text?: null | string
topia: Topia
urlSlug: string

Methods

  • Summary

    Add a webhook to a dropped asset

    Usage

    await droppedAsset.addWebhook({
    dataObject: {},
    description: "Webhook desc",
    enteredBy: "you",
    isUniqueOnly: false,
    title: "title",
    type: "type",
    url: "https://url.com",
    });

    Parameters

    • __namedParameters: {
          dataObject: object;
          description: string;
          isUniqueOnly: boolean;
          shouldSetClickType?: boolean;
          shouldSetIsInteractive?: boolean;
          title: string;
          type: string;
          url: string;
      }
      • dataObject: object
      • description: string
      • isUniqueOnly: boolean
      • Optional shouldSetClickType?: boolean
      • Optional shouldSetIsInteractive?: boolean
      • title: string
      • type: string
      • url: string

    Returns Promise<void | AxiosResponse<any, any>>

  • Parameters

    • __namedParameters: {
          error?: unknown;
          message?: string;
          params?: object;
          sdkMethod?: string;
      }
      • Optional error?: unknown
      • Optional message?: string
      • Optional params?: object
      • Optional sdkMethod?: string

    Returns {
        data: {};
        message: string;
        method: string;
        params: object;
        sdkMethod: undefined | string;
        stack: string;
        stackTrace: Error;
        status: number;
        success: boolean;
        url: string;
    }

    • data: {}
      • message: string
      • method: string
      • params: object
      • sdkMethod: undefined | string
      • stack: string
      • stackTrace: Error
      • status: number
      • success: boolean
      • url: string
    • Summary

      Retrieves the data object for a dropped asset.

      Usage

      const dataObject = await droppedAsset.fetchDataObject();
      

      Returns Promise<void | ResponseType>

    • Summary

      Retrieve analytics for a dropped asset by day, week, month, quarter, or year

      Usage

      const analytics = await droppedAsset.fetchDroppedAssetAnalytics({
      periodType: "quarter",
      dateValue: 3,
      year: 2023,
      });

      Parameters

      • __namedParameters: {
            dateValue: number;
            periodType: "week" | "month" | "quarter" | "year";
            year: number;
        }
        • dateValue: number
        • periodType: "week" | "month" | "quarter" | "year"
        • year: number

      Returns Promise<void | ResponseType>

    • Summary

      Flip an dropped asset.

      Usage

      await droppedAsset.flip(.5);
      

      Returns Promise<void | ResponseType>

    • Summary

      Increments a specific value in the data object for a dropped asset by the amount specified. Must have valid interactive credentials from a visitor in the world.

      Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id

      Usage

      await droppedAsset.incrementDataObjectValue("key", 1);
      

      Parameters

      • path: string
      • amount: number
      • options: {
            analytics?: AnalyticType[];
            lock?: {
                lockId: string;
                releaseLock?: boolean;
            };
        } = {}
        • Optional analytics?: AnalyticType[]
        • Optional lock?: {
              lockId: string;
              releaseLock?: boolean;
          }
          • lockId: string
          • Optional releaseLock?: boolean

      Returns Promise<void | ResponseType>

    • Summary

      Sets the data object for a dropped asset.

      Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id

      Usage

      await droppedAsset.setDataObject({
      "exampleKey": "exampleValue",
      });

      Parameters

      • dataObject: object
      • options: {
            analytics?: AnalyticType[];
            lock?: {
                lockId: string;
                releaseLock?: boolean;
            };
        } = {}
        • Optional analytics?: AnalyticType[]
        • Optional lock?: {
              lockId: string;
              releaseLock?: boolean;
          }
          • lockId: string
          • Optional releaseLock?: boolean

      Returns Promise<void | ResponseType>

    • Summary

      Set the interactive settings on a dropped asset

      Usage

      await droppedAsset.setInteractiveSettings({
      isInteractive: true,
      interactivePublicKey: "xyz"
      });

      Parameters

      • __namedParameters: {
            interactivePublicKey: string;
            isInteractive?: boolean;
        }
        • interactivePublicKey: string
        • Optional isInteractive?: boolean

      Returns Promise<void | ResponseType>

    • Returns AxiosInstance

    • Summary

      Updates platform asset details.

      Usage

      await asset.updateAsset({
      assetName: "exampleAsset",
      bottomLayerURL: null,
      creatorTags: { "decorations": true },
      isPublic: true,
      shouldUploadImages: true,
      tagJson: "[{"label":"decorations","value":"decorations"}]",
      topLayerURL: "https://example.topLayerURL"
      });
      const { assetName } = asset;

      Parameters

      • __namedParameters: {
            assetName: string;
            bottomLayerURL?: string;
            creatorTags: object;
            isPublic: boolean;
            shouldUploadImages?: boolean;
            tagJson: string;
            topLayerURL?: string;
        }
        • assetName: string
        • Optional bottomLayerURL?: string
        • creatorTags: object
        • isPublic: boolean
        • Optional shouldUploadImages?: boolean
        • tagJson: string
        • Optional topLayerURL?: string

      Returns Promise<void | ResponseType>

    • Summary

      Updates click options for a dropped asset.

      Usage

      await droppedAsset.updateClickType({
      "clickType": "portal",
      "clickableLink": "https://topia.io",
      "clickableLinkTitle": "My awesome link!",
      "clickableDisplayTextDescription": "Description",
      "clickableDisplayTextHeadline": "Title",
      "position": {
      "x": 0,
      "y": 0
      },
      "portalName": "community"
      });

      Parameters

      Returns Promise<void | ResponseType>

    • Summary

      Updates text and style of a dropped asset.

      Usage

      const style = {
      "textColor": "#abc123",
      "textFontFamily": "Arial",
      "textSize": 40,
      "textWeight": "normal",
      "textWidth": 200
      };
      await droppedAsset.updateCustomTextAsset(style, "hello world");

      Parameters

      • style: undefined | null | object
      • text: undefined | null | string

      Returns Promise<void | ResponseType>

    • Summary

      Updates the data object for a dropped asset.

      Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id

      Usage

      await droppedAsset.updateDataObject({
      "exampleKey": "exampleValue",
      });

      Parameters

      • dataObject: object
      • options: {
            analytics?: AnalyticType[];
            lock?: {
                lockId: string;
                releaseLock?: boolean;
            };
        } = {}
        • Optional analytics?: AnalyticType[]
        • Optional lock?: {
              lockId: string;
              releaseLock?: boolean;
          }
          • lockId: string
          • Optional releaseLock?: boolean

      Returns Promise<void | ResponseType>

    • Summary

      Updates landmark zone options for a dropped asset.

      Usage

      await droppedAsset.updateLandmarkZone({
      isLandmarkZoneEnabled: true,
      landmarkZoneName: "Example",
      landmarkZoneIsVisible: true,
      });

      Parameters

      • __namedParameters: {
            isLandmarkZoneEnabled: boolean;
            landmarkZoneIsVisible?: boolean;
            landmarkZoneName?: string;
        }
        • isLandmarkZoneEnabled: boolean
        • Optional landmarkZoneIsVisible?: boolean
        • Optional landmarkZoneName?: string

      Returns Promise<void | ResponseType>

    • Summary

      Updates media options for a dropped asset.

      Usage

      await droppedAsset.updateMediaType({
      "mediaType": "link",
      "mediaLink": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "isVideo": true,
      "syncUserMedia": true,
      "audioSliderVolume: 30"
      "portalName": "community",
      "audioRadius": 0,
      "mediaName": "string"
      });

      Parameters

      Returns Promise<void | ResponseType>

    • Summary

      Updates mute zone options for a dropped asset.

      Usage

      await droppedAsset.updateMuteZone(true);
      

      Parameters

      • isMutezone: boolean

      Returns Promise<void | ResponseType>

    • Summary

      Moves a dropped asset to specified coordinates.

      Usage

      await droppedAsset.updatePosition(100,200);
      

      Parameters

      • x: number
      • y: number
      • Optional yOrderAdjust: number

      Returns Promise<void | ResponseType>

    • Summary

      Updates the size of a dropped asset.

      Usage

      await droppedAsset.assetScale(.5);
      

      Parameters

      • assetScale: number

      Returns Promise<void | ResponseType>

    • Summary

      Change or remove media embedded in a dropped asset.

      Usage

      await droppedAsset.updateUploadedMediaSelected("LVWyxwNxI96eLjnXWwYO");
      

      Parameters

      • mediaId: string

      Returns Promise<void | ResponseType>

    • Summary

      Change or remove top and bottom layers of a dropped asset.

      Usage

      await droppedAsset.updateWebImageLayers("","https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg");
      

      Parameters

      • bottom: string
      • top: string

      Returns Promise<void | ResponseType>

    • Summary

      Updates webhook zone options for a dropped asset.

      Usage

      await droppedAsset.updateWebhookZone(true);
      

      Parameters

      • isWebhookZoneEnabled: boolean

      Returns Promise<void | ResponseType>