@rtsdk/topia 0.13.1 → 0.14.0
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 +92 -27
- package/dist/index.d.ts +57 -1
- package/dist/index.js +92 -27
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39811,6 +39811,33 @@ var DroppedAssetMediaType;
|
|
|
39811
39811
|
DroppedAssetMediaType["LINK"] = "link";
|
|
39812
39812
|
})(DroppedAssetMediaType || (DroppedAssetMediaType = {}));
|
|
39813
39813
|
|
|
39814
|
+
const getBrowserWarning = () => {
|
|
39815
|
+
if (typeof window !== "undefined") {
|
|
39816
|
+
console.warn("Please use extreme caution when passing sensitive information such as API keys from a client side application.");
|
|
39817
|
+
}
|
|
39818
|
+
};
|
|
39819
|
+
|
|
39820
|
+
/**
|
|
39821
|
+
* Parses object, removes keys with undefined value, and returns clean object.
|
|
39822
|
+
*/
|
|
39823
|
+
const removeUndefined = (obj) => {
|
|
39824
|
+
Object.keys(obj).forEach((key) => {
|
|
39825
|
+
if (obj[key] === undefined) {
|
|
39826
|
+
delete obj[key];
|
|
39827
|
+
}
|
|
39828
|
+
});
|
|
39829
|
+
return obj;
|
|
39830
|
+
};
|
|
39831
|
+
|
|
39832
|
+
/**
|
|
39833
|
+
* Returns a random whole number within range of (original number - scatterBy) to (original number + scatterBy)
|
|
39834
|
+
*/
|
|
39835
|
+
const scatterVisitors = (original, scatterBy) => {
|
|
39836
|
+
const min = original - scatterBy;
|
|
39837
|
+
const max = original + scatterBy;
|
|
39838
|
+
return Math.floor(Math.random() * (max - min) + min);
|
|
39839
|
+
};
|
|
39840
|
+
|
|
39814
39841
|
var _DroppedAsset_updateDroppedAsset;
|
|
39815
39842
|
/**
|
|
39816
39843
|
* @summary
|
|
@@ -39866,6 +39893,71 @@ class DroppedAsset extends Asset {
|
|
|
39866
39893
|
}
|
|
39867
39894
|
});
|
|
39868
39895
|
}
|
|
39896
|
+
/**
|
|
39897
|
+
* @summary
|
|
39898
|
+
* Updates dropped asset details.
|
|
39899
|
+
*
|
|
39900
|
+
* @usage
|
|
39901
|
+
* ```ts
|
|
39902
|
+
* const payload = {
|
|
39903
|
+
* assetScale: 1,
|
|
39904
|
+
* clickType: "link",
|
|
39905
|
+
* clickableDisplayTextDescription: "Description",
|
|
39906
|
+
* clickableDisplayTextHeadline: "Headline",
|
|
39907
|
+
* clickableLink: "https://topia.io",
|
|
39908
|
+
* clickableLinkTitle: "Topia",
|
|
39909
|
+
* flipped: false,
|
|
39910
|
+
* isTextTopLayer: false,
|
|
39911
|
+
* layer0: "https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg",
|
|
39912
|
+
* layer1: "https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg",
|
|
39913
|
+
* position: { x: 0, y: 0 },
|
|
39914
|
+
* specialType: "webImage",
|
|
39915
|
+
* text: "My Asset",
|
|
39916
|
+
* textColor: "#000000",
|
|
39917
|
+
* textSize: 20,
|
|
39918
|
+
* textWeight: "normal",
|
|
39919
|
+
* textWidth: 200,
|
|
39920
|
+
* uniqueName: "example",
|
|
39921
|
+
* yOrderAdjust: 0,
|
|
39922
|
+
* }
|
|
39923
|
+
* await droppedAsset.updateDroppedAsset();
|
|
39924
|
+
* const { assetName } = droppedAsset;
|
|
39925
|
+
* ```
|
|
39926
|
+
*/
|
|
39927
|
+
updateDroppedAsset({ assetScale, clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, flipped, isTextTopLayer, layer0, layer1, position, specialType, text, textColor, textSize, textWeight, textWidth, uniqueName, yOrderAdjust, }) {
|
|
39928
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39929
|
+
const params = {
|
|
39930
|
+
assetScale,
|
|
39931
|
+
clickType,
|
|
39932
|
+
clickableLink,
|
|
39933
|
+
clickableLinkTitle,
|
|
39934
|
+
clickableDisplayTextDescription,
|
|
39935
|
+
clickableDisplayTextHeadline,
|
|
39936
|
+
flipped,
|
|
39937
|
+
isTextTopLayer,
|
|
39938
|
+
layer0,
|
|
39939
|
+
layer1,
|
|
39940
|
+
position,
|
|
39941
|
+
specialType,
|
|
39942
|
+
text,
|
|
39943
|
+
textColor,
|
|
39944
|
+
textSize,
|
|
39945
|
+
textWeight,
|
|
39946
|
+
textWidth,
|
|
39947
|
+
uniqueName,
|
|
39948
|
+
yOrderAdjust,
|
|
39949
|
+
};
|
|
39950
|
+
const filteredParams = removeUndefined(params);
|
|
39951
|
+
try {
|
|
39952
|
+
const response = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}`, filteredParams, this.requestOptions);
|
|
39953
|
+
const droppedAssetDetails = response.data;
|
|
39954
|
+
Object.assign(this, droppedAssetDetails);
|
|
39955
|
+
}
|
|
39956
|
+
catch (error) {
|
|
39957
|
+
throw this.errorHandler({ error, params, sdkMethod: "DroppedAsset.updateDroppedAsset" });
|
|
39958
|
+
}
|
|
39959
|
+
});
|
|
39960
|
+
}
|
|
39869
39961
|
/**
|
|
39870
39962
|
* @summary
|
|
39871
39963
|
* Delete dropped asset.
|
|
@@ -40427,33 +40519,6 @@ class Scene extends SDKController {
|
|
|
40427
40519
|
}
|
|
40428
40520
|
}
|
|
40429
40521
|
|
|
40430
|
-
const getBrowserWarning = () => {
|
|
40431
|
-
if (typeof window !== "undefined") {
|
|
40432
|
-
console.warn("Please use extreme caution when passing sensitive information such as API keys from a client side application.");
|
|
40433
|
-
}
|
|
40434
|
-
};
|
|
40435
|
-
|
|
40436
|
-
/**
|
|
40437
|
-
* Parses object, removes keys with undefined value, and returns clean object.
|
|
40438
|
-
*/
|
|
40439
|
-
const removeUndefined = (obj) => {
|
|
40440
|
-
Object.keys(obj).forEach((key) => {
|
|
40441
|
-
if (obj[key] === undefined) {
|
|
40442
|
-
delete obj[key];
|
|
40443
|
-
}
|
|
40444
|
-
});
|
|
40445
|
-
return obj;
|
|
40446
|
-
};
|
|
40447
|
-
|
|
40448
|
-
/**
|
|
40449
|
-
* Returns a random whole number within range of (original number - scatterBy) to (original number + scatterBy)
|
|
40450
|
-
*/
|
|
40451
|
-
const scatterVisitors = (original, scatterBy) => {
|
|
40452
|
-
const min = original - scatterBy;
|
|
40453
|
-
const max = original + scatterBy;
|
|
40454
|
-
return Math.floor(Math.random() * (max - min) + min);
|
|
40455
|
-
};
|
|
40456
|
-
|
|
40457
40522
|
/**
|
|
40458
40523
|
* @summary
|
|
40459
40524
|
* Create a single instance of Topia axios used for all calls to the public API in all classes
|
package/dist/index.d.ts
CHANGED
|
@@ -135,6 +135,38 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
|
|
|
135
135
|
* ```
|
|
136
136
|
*/
|
|
137
137
|
fetchDroppedAssetById(): Promise<void | ResponseType$1>;
|
|
138
|
+
/**
|
|
139
|
+
* @summary
|
|
140
|
+
* Updates dropped asset details.
|
|
141
|
+
*
|
|
142
|
+
* @usage
|
|
143
|
+
* ```ts
|
|
144
|
+
* const payload = {
|
|
145
|
+
* assetScale: 1,
|
|
146
|
+
* clickType: "link",
|
|
147
|
+
* clickableDisplayTextDescription: "Description",
|
|
148
|
+
* clickableDisplayTextHeadline: "Headline",
|
|
149
|
+
* clickableLink: "https://topia.io",
|
|
150
|
+
* clickableLinkTitle: "Topia",
|
|
151
|
+
* flipped: false,
|
|
152
|
+
* isTextTopLayer: false,
|
|
153
|
+
* layer0: "https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg",
|
|
154
|
+
* layer1: "https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg",
|
|
155
|
+
* position: { x: 0, y: 0 },
|
|
156
|
+
* specialType: "webImage",
|
|
157
|
+
* text: "My Asset",
|
|
158
|
+
* textColor: "#000000",
|
|
159
|
+
* textSize: 20,
|
|
160
|
+
* textWeight: "normal",
|
|
161
|
+
* textWidth: 200,
|
|
162
|
+
* uniqueName: "example",
|
|
163
|
+
* yOrderAdjust: 0,
|
|
164
|
+
* }
|
|
165
|
+
* await droppedAsset.updateDroppedAsset();
|
|
166
|
+
* const { assetName } = droppedAsset;
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
updateDroppedAsset({ assetScale, clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, flipped, isTextTopLayer, layer0, layer1, position, specialType, text, textColor, textSize, textWeight, textWidth, uniqueName, yOrderAdjust, }: UpdateDroppedAssetInterface): Promise<void | ResponseType$1>;
|
|
138
170
|
/**
|
|
139
171
|
* @summary
|
|
140
172
|
* Delete dropped asset.
|
|
@@ -1592,6 +1624,30 @@ interface UpdateBroadcastInterface {
|
|
|
1592
1624
|
assetBroadcastAll?: boolean;
|
|
1593
1625
|
broadcasterEmail?: string;
|
|
1594
1626
|
}
|
|
1627
|
+
interface UpdateDroppedAssetInterface {
|
|
1628
|
+
assetScale?: number;
|
|
1629
|
+
clickType?: DroppedAssetClickType;
|
|
1630
|
+
clickableLink?: string;
|
|
1631
|
+
clickableLinkTitle?: string;
|
|
1632
|
+
clickableDisplayTextDescription?: string;
|
|
1633
|
+
clickableDisplayTextHeadline?: string;
|
|
1634
|
+
flipped?: boolean;
|
|
1635
|
+
isTextTopLayer?: boolean;
|
|
1636
|
+
layer0?: string;
|
|
1637
|
+
layer1?: string;
|
|
1638
|
+
position?: {
|
|
1639
|
+
x: number;
|
|
1640
|
+
y: number;
|
|
1641
|
+
};
|
|
1642
|
+
specialType?: string;
|
|
1643
|
+
text?: string | null;
|
|
1644
|
+
textColor?: string | null;
|
|
1645
|
+
textSize?: number | null;
|
|
1646
|
+
textWidth?: number | null;
|
|
1647
|
+
textWeight?: string | null;
|
|
1648
|
+
uniqueName?: string;
|
|
1649
|
+
yOrderAdjust?: number;
|
|
1650
|
+
}
|
|
1595
1651
|
interface UpdateClickTypeInterface {
|
|
1596
1652
|
clickType?: DroppedAssetClickType;
|
|
1597
1653
|
clickableLink?: string;
|
|
@@ -2376,4 +2432,4 @@ declare class WorldFactory extends SDKController {
|
|
|
2376
2432
|
}>;
|
|
2377
2433
|
}
|
|
2378
2434
|
|
|
2379
|
-
export { Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, AssetType, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetMediaType, DroppedAssetOptionalInterface, DroppedAssetOptions, FireToastInterface, InteractiveCredentials, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, ResponseType$1 as 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, WebRTCConnector, WebRTCConnectorFactory, WebRTCConnectorInterface, WebRTCConnectorOptionalInterface, WebhookInterface, World, WorldActivity, WorldActivityFactory, WorldActivityOptionalInterface, WorldDetailsInterface, WorldFactory, WorldInterface, WorldOptionalInterface, WorldOptions, WorldWebhooksInterface };
|
|
2435
|
+
export { Asset, AssetFactory, AssetInterface, AssetOptionalInterface, AssetOptions, AssetType, DroppedAsset, DroppedAssetClickType, DroppedAssetFactory, DroppedAssetInterface, DroppedAssetMediaType, DroppedAssetOptionalInterface, DroppedAssetOptions, FireToastInterface, InteractiveCredentials, MoveAllVisitorsInterface, MoveVisitorInterface, OpenIframeInterface, ResponseType$1 as ResponseType, SDKController, SDKInterface, Scene, SceneFactory, SceneInterface, SceneOptionalInterface, Topia, TopiaInterface, UpdateBroadcastInterface, UpdateClickTypeInterface, UpdateDroppedAssetInterface, UpdateMediaTypeInterface, UpdatePrivateZoneInterface, User, UserFactory, UserInterface, UserOptionalInterface, UserOptions, Visitor, VisitorFactory, VisitorInterface, VisitorOptionalInterface, VisitorOptions, VisitorType, VisitorsToMoveArrayType, VisitorsToMoveType, WebRTCConnector, WebRTCConnectorFactory, WebRTCConnectorInterface, WebRTCConnectorOptionalInterface, WebhookInterface, World, WorldActivity, WorldActivityFactory, WorldActivityOptionalInterface, WorldDetailsInterface, WorldFactory, WorldInterface, WorldOptionalInterface, WorldOptions, WorldWebhooksInterface };
|
package/dist/index.js
CHANGED
|
@@ -39809,6 +39809,33 @@ var DroppedAssetMediaType;
|
|
|
39809
39809
|
DroppedAssetMediaType["LINK"] = "link";
|
|
39810
39810
|
})(DroppedAssetMediaType || (DroppedAssetMediaType = {}));
|
|
39811
39811
|
|
|
39812
|
+
const getBrowserWarning = () => {
|
|
39813
|
+
if (typeof window !== "undefined") {
|
|
39814
|
+
console.warn("Please use extreme caution when passing sensitive information such as API keys from a client side application.");
|
|
39815
|
+
}
|
|
39816
|
+
};
|
|
39817
|
+
|
|
39818
|
+
/**
|
|
39819
|
+
* Parses object, removes keys with undefined value, and returns clean object.
|
|
39820
|
+
*/
|
|
39821
|
+
const removeUndefined = (obj) => {
|
|
39822
|
+
Object.keys(obj).forEach((key) => {
|
|
39823
|
+
if (obj[key] === undefined) {
|
|
39824
|
+
delete obj[key];
|
|
39825
|
+
}
|
|
39826
|
+
});
|
|
39827
|
+
return obj;
|
|
39828
|
+
};
|
|
39829
|
+
|
|
39830
|
+
/**
|
|
39831
|
+
* Returns a random whole number within range of (original number - scatterBy) to (original number + scatterBy)
|
|
39832
|
+
*/
|
|
39833
|
+
const scatterVisitors = (original, scatterBy) => {
|
|
39834
|
+
const min = original - scatterBy;
|
|
39835
|
+
const max = original + scatterBy;
|
|
39836
|
+
return Math.floor(Math.random() * (max - min) + min);
|
|
39837
|
+
};
|
|
39838
|
+
|
|
39812
39839
|
var _DroppedAsset_updateDroppedAsset;
|
|
39813
39840
|
/**
|
|
39814
39841
|
* @summary
|
|
@@ -39864,6 +39891,71 @@ class DroppedAsset extends Asset {
|
|
|
39864
39891
|
}
|
|
39865
39892
|
});
|
|
39866
39893
|
}
|
|
39894
|
+
/**
|
|
39895
|
+
* @summary
|
|
39896
|
+
* Updates dropped asset details.
|
|
39897
|
+
*
|
|
39898
|
+
* @usage
|
|
39899
|
+
* ```ts
|
|
39900
|
+
* const payload = {
|
|
39901
|
+
* assetScale: 1,
|
|
39902
|
+
* clickType: "link",
|
|
39903
|
+
* clickableDisplayTextDescription: "Description",
|
|
39904
|
+
* clickableDisplayTextHeadline: "Headline",
|
|
39905
|
+
* clickableLink: "https://topia.io",
|
|
39906
|
+
* clickableLinkTitle: "Topia",
|
|
39907
|
+
* flipped: false,
|
|
39908
|
+
* isTextTopLayer: false,
|
|
39909
|
+
* layer0: "https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg",
|
|
39910
|
+
* layer1: "https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg",
|
|
39911
|
+
* position: { x: 0, y: 0 },
|
|
39912
|
+
* specialType: "webImage",
|
|
39913
|
+
* text: "My Asset",
|
|
39914
|
+
* textColor: "#000000",
|
|
39915
|
+
* textSize: 20,
|
|
39916
|
+
* textWeight: "normal",
|
|
39917
|
+
* textWidth: 200,
|
|
39918
|
+
* uniqueName: "example",
|
|
39919
|
+
* yOrderAdjust: 0,
|
|
39920
|
+
* }
|
|
39921
|
+
* await droppedAsset.updateDroppedAsset();
|
|
39922
|
+
* const { assetName } = droppedAsset;
|
|
39923
|
+
* ```
|
|
39924
|
+
*/
|
|
39925
|
+
updateDroppedAsset({ assetScale, clickType, clickableLink, clickableLinkTitle, clickableDisplayTextDescription, clickableDisplayTextHeadline, flipped, isTextTopLayer, layer0, layer1, position, specialType, text, textColor, textSize, textWeight, textWidth, uniqueName, yOrderAdjust, }) {
|
|
39926
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39927
|
+
const params = {
|
|
39928
|
+
assetScale,
|
|
39929
|
+
clickType,
|
|
39930
|
+
clickableLink,
|
|
39931
|
+
clickableLinkTitle,
|
|
39932
|
+
clickableDisplayTextDescription,
|
|
39933
|
+
clickableDisplayTextHeadline,
|
|
39934
|
+
flipped,
|
|
39935
|
+
isTextTopLayer,
|
|
39936
|
+
layer0,
|
|
39937
|
+
layer1,
|
|
39938
|
+
position,
|
|
39939
|
+
specialType,
|
|
39940
|
+
text,
|
|
39941
|
+
textColor,
|
|
39942
|
+
textSize,
|
|
39943
|
+
textWeight,
|
|
39944
|
+
textWidth,
|
|
39945
|
+
uniqueName,
|
|
39946
|
+
yOrderAdjust,
|
|
39947
|
+
};
|
|
39948
|
+
const filteredParams = removeUndefined(params);
|
|
39949
|
+
try {
|
|
39950
|
+
const response = yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}`, filteredParams, this.requestOptions);
|
|
39951
|
+
const droppedAssetDetails = response.data;
|
|
39952
|
+
Object.assign(this, droppedAssetDetails);
|
|
39953
|
+
}
|
|
39954
|
+
catch (error) {
|
|
39955
|
+
throw this.errorHandler({ error, params, sdkMethod: "DroppedAsset.updateDroppedAsset" });
|
|
39956
|
+
}
|
|
39957
|
+
});
|
|
39958
|
+
}
|
|
39867
39959
|
/**
|
|
39868
39960
|
* @summary
|
|
39869
39961
|
* Delete dropped asset.
|
|
@@ -40425,33 +40517,6 @@ class Scene extends SDKController {
|
|
|
40425
40517
|
}
|
|
40426
40518
|
}
|
|
40427
40519
|
|
|
40428
|
-
const getBrowserWarning = () => {
|
|
40429
|
-
if (typeof window !== "undefined") {
|
|
40430
|
-
console.warn("Please use extreme caution when passing sensitive information such as API keys from a client side application.");
|
|
40431
|
-
}
|
|
40432
|
-
};
|
|
40433
|
-
|
|
40434
|
-
/**
|
|
40435
|
-
* Parses object, removes keys with undefined value, and returns clean object.
|
|
40436
|
-
*/
|
|
40437
|
-
const removeUndefined = (obj) => {
|
|
40438
|
-
Object.keys(obj).forEach((key) => {
|
|
40439
|
-
if (obj[key] === undefined) {
|
|
40440
|
-
delete obj[key];
|
|
40441
|
-
}
|
|
40442
|
-
});
|
|
40443
|
-
return obj;
|
|
40444
|
-
};
|
|
40445
|
-
|
|
40446
|
-
/**
|
|
40447
|
-
* Returns a random whole number within range of (original number - scatterBy) to (original number + scatterBy)
|
|
40448
|
-
*/
|
|
40449
|
-
const scatterVisitors = (original, scatterBy) => {
|
|
40450
|
-
const min = original - scatterBy;
|
|
40451
|
-
const max = original + scatterBy;
|
|
40452
|
-
return Math.floor(Math.random() * (max - min) + min);
|
|
40453
|
-
};
|
|
40454
|
-
|
|
40455
40520
|
/**
|
|
40456
40521
|
* @summary
|
|
40457
40522
|
* Create a single instance of Topia axios used for all calls to the public API in all classes
|
package/package.json
CHANGED