@rtsdk/topia 0.7.0 → 0.7.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 +1 -1
- package/dist/index.cjs +19 -10
- package/dist/index.d.ts +6 -2
- package/dist/index.js +19 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Javascript RTSDK - Topia Client Library
|
|
2
2
|
|
|
3
|
-
The Topia Client Library leverages the Topia Public API and allows users to interact with the topia systems and modify their world programmatically. With the SDK you can now build new features to be used in Topia! Check out a list of examples [here](https://github.com/metaversecloud-com/sdk-examples).
|
|
3
|
+
The Topia Client Library leverages the Topia Public API and allows users to interact with the topia systems and modify their world programmatically. With the SDK you can now build new features to be used in Topia! Check out a list of examples [here](https://github.com/metaversecloud-com/sdk-examples). Questions, comments, or have something exciting to share with the Topia team? Reach out to [developers@topia.io](mailto:developers@topia.io)!
|
|
4
4
|
|
|
5
5
|
<br>
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -39758,7 +39758,7 @@ var _DroppedAsset_updateDroppedAsset;
|
|
|
39758
39758
|
class DroppedAsset extends Asset {
|
|
39759
39759
|
constructor(topia, id, urlSlug, options = { attributes: { text: "" }, credentials: {} }) {
|
|
39760
39760
|
var _a;
|
|
39761
|
-
super(topia, id, { attributes: options.attributes, credentials: Object.assign(
|
|
39761
|
+
super(topia, id, { attributes: options.attributes, credentials: Object.assign({ assetId: id, urlSlug }, options.credentials) });
|
|
39762
39762
|
// private methods
|
|
39763
39763
|
_DroppedAsset_updateDroppedAsset.set(this, (payload, updateType) => __awaiter(this, void 0, void 0, function* () {
|
|
39764
39764
|
try {
|
|
@@ -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 = {
|
|
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;
|
|
@@ -40344,12 +40353,12 @@ var _World_droppedAssetsMap;
|
|
|
40344
40353
|
*/
|
|
40345
40354
|
class World extends SDKController {
|
|
40346
40355
|
constructor(topia, urlSlug, options = { attributes: {}, credentials: {} }) {
|
|
40347
|
-
var _a, _b, _c;
|
|
40356
|
+
var _a, _b, _c, _d;
|
|
40348
40357
|
super(topia, {
|
|
40349
40358
|
apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
|
|
40350
40359
|
interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
|
|
40351
|
-
urlSlug,
|
|
40352
|
-
visitorId: (
|
|
40360
|
+
urlSlug: ((_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug) || urlSlug,
|
|
40361
|
+
visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
|
|
40353
40362
|
});
|
|
40354
40363
|
_World_droppedAssetsMap.set(this, void 0);
|
|
40355
40364
|
////////// data objects
|
|
@@ -41140,7 +41149,7 @@ _User_adminWorldsMap = new WeakMap(), _User_assetsMap = new WeakMap(), _User_sce
|
|
|
41140
41149
|
*/
|
|
41141
41150
|
class Visitor extends User {
|
|
41142
41151
|
constructor(topia, id, urlSlug, options = { attributes: {}, credentials: {} }) {
|
|
41143
|
-
super(topia, { credentials: Object.assign(
|
|
41152
|
+
super(topia, { credentials: Object.assign({ urlSlug }, options.credentials) });
|
|
41144
41153
|
Object.assign(this, options.attributes);
|
|
41145
41154
|
this.id = id;
|
|
41146
41155
|
this.urlSlug = urlSlug;
|
|
@@ -41471,12 +41480,12 @@ var _WorldActivity_visitorsMap;
|
|
|
41471
41480
|
*/
|
|
41472
41481
|
class WorldActivity extends SDKController {
|
|
41473
41482
|
constructor(topia, urlSlug, options = { credentials: {} }) {
|
|
41474
|
-
var _a, _b, _c;
|
|
41483
|
+
var _a, _b, _c, _d;
|
|
41475
41484
|
super(topia, {
|
|
41476
41485
|
apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
|
|
41477
41486
|
interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
|
|
41478
|
-
urlSlug,
|
|
41479
|
-
visitorId: (
|
|
41487
|
+
urlSlug: ((_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug) || urlSlug,
|
|
41488
|
+
visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
|
|
41480
41489
|
});
|
|
41481
41490
|
_WorldActivity_visitorsMap.set(this, void 0);
|
|
41482
41491
|
this.urlSlug = urlSlug;
|
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;
|
package/dist/index.js
CHANGED
|
@@ -39756,7 +39756,7 @@ var _DroppedAsset_updateDroppedAsset;
|
|
|
39756
39756
|
class DroppedAsset extends Asset {
|
|
39757
39757
|
constructor(topia, id, urlSlug, options = { attributes: { text: "" }, credentials: {} }) {
|
|
39758
39758
|
var _a;
|
|
39759
|
-
super(topia, id, { attributes: options.attributes, credentials: Object.assign(
|
|
39759
|
+
super(topia, id, { attributes: options.attributes, credentials: Object.assign({ assetId: id, urlSlug }, options.credentials) });
|
|
39760
39760
|
// private methods
|
|
39761
39761
|
_DroppedAsset_updateDroppedAsset.set(this, (payload, updateType) => __awaiter(this, void 0, void 0, function* () {
|
|
39762
39762
|
try {
|
|
@@ -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 = {
|
|
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;
|
|
@@ -40342,12 +40351,12 @@ var _World_droppedAssetsMap;
|
|
|
40342
40351
|
*/
|
|
40343
40352
|
class World extends SDKController {
|
|
40344
40353
|
constructor(topia, urlSlug, options = { attributes: {}, credentials: {} }) {
|
|
40345
|
-
var _a, _b, _c;
|
|
40354
|
+
var _a, _b, _c, _d;
|
|
40346
40355
|
super(topia, {
|
|
40347
40356
|
apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
|
|
40348
40357
|
interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
|
|
40349
|
-
urlSlug,
|
|
40350
|
-
visitorId: (
|
|
40358
|
+
urlSlug: ((_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug) || urlSlug,
|
|
40359
|
+
visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
|
|
40351
40360
|
});
|
|
40352
40361
|
_World_droppedAssetsMap.set(this, void 0);
|
|
40353
40362
|
////////// data objects
|
|
@@ -41138,7 +41147,7 @@ _User_adminWorldsMap = new WeakMap(), _User_assetsMap = new WeakMap(), _User_sce
|
|
|
41138
41147
|
*/
|
|
41139
41148
|
class Visitor extends User {
|
|
41140
41149
|
constructor(topia, id, urlSlug, options = { attributes: {}, credentials: {} }) {
|
|
41141
|
-
super(topia, { credentials: Object.assign(
|
|
41150
|
+
super(topia, { credentials: Object.assign({ urlSlug }, options.credentials) });
|
|
41142
41151
|
Object.assign(this, options.attributes);
|
|
41143
41152
|
this.id = id;
|
|
41144
41153
|
this.urlSlug = urlSlug;
|
|
@@ -41469,12 +41478,12 @@ var _WorldActivity_visitorsMap;
|
|
|
41469
41478
|
*/
|
|
41470
41479
|
class WorldActivity extends SDKController {
|
|
41471
41480
|
constructor(topia, urlSlug, options = { credentials: {} }) {
|
|
41472
|
-
var _a, _b, _c;
|
|
41481
|
+
var _a, _b, _c, _d;
|
|
41473
41482
|
super(topia, {
|
|
41474
41483
|
apiKey: (_a = options === null || options === void 0 ? void 0 : options.credentials) === null || _a === void 0 ? void 0 : _a.apiKey,
|
|
41475
41484
|
interactiveNonce: (_b = options === null || options === void 0 ? void 0 : options.credentials) === null || _b === void 0 ? void 0 : _b.interactiveNonce,
|
|
41476
|
-
urlSlug,
|
|
41477
|
-
visitorId: (
|
|
41485
|
+
urlSlug: ((_c = options === null || options === void 0 ? void 0 : options.credentials) === null || _c === void 0 ? void 0 : _c.urlSlug) || urlSlug,
|
|
41486
|
+
visitorId: (_d = options === null || options === void 0 ? void 0 : options.credentials) === null || _d === void 0 ? void 0 : _d.visitorId,
|
|
41478
41487
|
});
|
|
41479
41488
|
_WorldActivity_visitorsMap.set(this, void 0);
|
|
41480
41489
|
this.urlSlug = urlSlug;
|
package/package.json
CHANGED