@rtsdk/topia 0.0.31 → 0.1.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 +43 -13
- package/dist/index.js +43 -13
- package/dist/types/example.d.ts +6 -0
- package/dist/types/src/__mocks__/assets.d.ts +99 -0
- package/dist/{src/__mocks__/index.js → types/src/__mocks__/index.d.ts} +4 -4
- package/dist/types/src/__mocks__/scenes.d.ts +79 -0
- package/dist/types/src/__mocks__/visitors.d.ts +83 -0
- package/dist/types/src/__mocks__/worlds.d.ts +73 -0
- package/dist/types/src/controllers/Asset.d.ts +20 -0
- package/dist/types/src/controllers/DroppedAsset.d.ts +285 -0
- package/dist/types/src/controllers/SDKController.d.ts +48 -0
- package/dist/types/src/controllers/Scene.d.ts +19 -0
- package/dist/types/src/controllers/Topia.d.ts +33 -0
- package/dist/types/src/controllers/User.d.ts +58 -0
- package/dist/types/src/controllers/Visitor.d.ts +50 -0
- package/dist/types/src/controllers/World.d.ts +143 -0
- package/dist/types/src/controllers/WorldActivity.d.ts +83 -0
- package/dist/{src/interfaces/AssetInterfaces.js → types/src/controllers/__tests__/asset.test.d.ts} +1 -1
- package/dist/{src/interfaces/DroppedAssetInterfaces.js → types/src/controllers/__tests__/droppedAsset.test.d.ts} +1 -1
- package/dist/{src/interfaces/SDKInterfaces.js → types/src/controllers/__tests__/scene.test.d.ts} +1 -1
- package/dist/{src/interfaces/SceneInterfaces.js → types/src/controllers/__tests__/user.test.d.ts} +1 -1
- package/dist/types/src/controllers/__tests__/visitor.test.d.ts +1 -0
- package/dist/types/src/controllers/__tests__/world.test.d.ts +1 -0
- package/dist/types/src/controllers/__tests__/worldActivity.test.d.ts +1 -0
- package/dist/{src/controllers/index.js → types/src/controllers/index.d.ts} +9 -9
- package/dist/types/src/factories/AssetFactory.d.ts +8 -0
- package/dist/types/src/factories/DroppedAssetFactory.d.ts +16 -0
- package/dist/types/src/factories/SceneFactory.d.ts +9 -0
- package/dist/types/src/factories/UserFactory.d.ts +8 -0
- package/dist/types/src/factories/VisitorFactory.d.ts +9 -0
- package/dist/types/src/factories/WorldActivityFactory.d.ts +8 -0
- package/dist/types/src/factories/WorldFactory.d.ts +8 -0
- package/dist/{src/factories/index.js → types/src/factories/index.d.ts} +7 -7
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/interfaces/AssetInterfaces.d.ts +26 -0
- package/dist/types/src/interfaces/DroppedAssetInterfaces.d.ts +102 -0
- package/dist/types/src/interfaces/SDKInterfaces.d.ts +8 -0
- package/dist/types/src/interfaces/SceneInterfaces.d.ts +27 -0
- package/dist/types/src/interfaces/TopiaInterfaces.d.ts +10 -0
- package/dist/types/src/interfaces/UserInterfaces.d.ts +6 -0
- package/dist/types/src/interfaces/VisitorInterfaces.d.ts +37 -0
- package/dist/types/src/interfaces/WorldActivityInterfaces.d.ts +11 -0
- package/dist/types/src/interfaces/WorldInterfaces.d.ts +32 -0
- package/dist/{src/interfaces/index.js → types/src/interfaces/index.d.ts} +9 -9
- package/dist/types/src/types/DroppedAssetTypes.d.ts +10 -0
- package/dist/types/src/types/InteractiveCredentialsTypes.d.ts +8 -0
- package/dist/types/src/types/OptionsTypes.d.ts +21 -0
- package/dist/types/src/types/ResponseTypes.d.ts +4 -0
- package/dist/types/src/types/VisitorTypes.d.ts +33 -0
- package/dist/{src/types/index.js → types/src/types/index.d.ts} +5 -4
- package/dist/types/src/utils/__tests__/removeUndefined.test.d.ts +1 -0
- package/dist/types/src/utils/__tests__/scatterVisitors.test.d.ts +1 -0
- package/dist/types/src/utils/getBrowserWarning.d.ts +1 -0
- package/dist/{src/utils/index.js → types/src/utils/index.d.ts} +3 -3
- package/dist/types/src/utils/removeUndefined.d.ts +8 -0
- package/dist/types/src/utils/scatterVisitors.d.ts +4 -0
- package/package.json +3 -2
- package/dist/example.js +0 -32
- package/dist/src/__mocks__/assets.js +0 -249
- package/dist/src/__mocks__/scenes.js +0 -104
- package/dist/src/__mocks__/visitors.js +0 -83
- package/dist/src/__mocks__/worlds.js +0 -52
- package/dist/src/controllers/Asset.js +0 -39
- package/dist/src/controllers/DroppedAsset.js +0 -443
- package/dist/src/controllers/SDKController.js +0 -76
- package/dist/src/controllers/Scene.js +0 -39
- package/dist/src/controllers/Topia.js +0 -39
- package/dist/src/controllers/User.js +0 -139
- package/dist/src/controllers/Visitor.js +0 -92
- package/dist/src/controllers/World.js +0 -257
- package/dist/src/controllers/WorldActivity.js +0 -162
- package/dist/src/controllers/__tests__/asset.test.js +0 -37
- package/dist/src/controllers/__tests__/droppedAsset.test.js +0 -98
- package/dist/src/controllers/__tests__/scene.test.js +0 -38
- package/dist/src/controllers/__tests__/user.test.js +0 -49
- package/dist/src/controllers/__tests__/visitor.test.js +0 -47
- package/dist/src/controllers/__tests__/world.test.js +0 -51
- package/dist/src/controllers/__tests__/worldActivity.test.js +0 -63
- package/dist/src/factories/AssetFactory.js +0 -11
- package/dist/src/factories/DroppedAssetFactory.js +0 -42
- package/dist/src/factories/SceneFactory.js +0 -27
- package/dist/src/factories/UserFactory.js +0 -10
- package/dist/src/factories/VisitorFactory.js +0 -26
- package/dist/src/factories/WorldActivityFactory.js +0 -10
- package/dist/src/factories/WorldFactory.js +0 -10
- package/dist/src/index.js +0 -23
- package/dist/src/interfaces/TopiaInterfaces.js +0 -1
- package/dist/src/interfaces/UserInterfaces.js +0 -1
- package/dist/src/interfaces/VisitorInterfaces.js +0 -1
- package/dist/src/interfaces/WorldActivityInterfaces.js +0 -1
- package/dist/src/interfaces/WorldInterfaces.js +0 -1
- package/dist/src/types/DroppedAssetTypes.js +0 -12
- package/dist/src/types/InteractiveCredentialsTypes.js +0 -1
- package/dist/src/types/OptionsTypes.js +0 -1
- package/dist/src/types/ResponseTypes.js +0 -1
- package/dist/src/types/VisitorTypes.js +0 -1
- package/dist/src/utils/__tests__/removeUndefined.test.js +0 -10
- package/dist/src/utils/__tests__/scatterVisitors.test.js +0 -11
- package/dist/src/utils/getBrowserWarning.js +0 -5
- package/dist/src/utils/removeUndefined.js +0 -11
- package/dist/src/utils/scatterVisitors.js +0 -8
package/dist/index.cjs
CHANGED
|
@@ -39772,31 +39772,40 @@ class SDKController {
|
|
|
39772
39772
|
this.requestOptions = { headers };
|
|
39773
39773
|
}
|
|
39774
39774
|
topiaPublicApi() {
|
|
39775
|
-
this.stackTrace = new Error("Thrown here:");
|
|
39776
39775
|
return this.topia.axios;
|
|
39777
39776
|
}
|
|
39778
39777
|
errorHandler({ error, message = "Something went wrong. Please try again or contact support.", }) {
|
|
39779
|
-
var _a, _b
|
|
39780
|
-
|
|
39778
|
+
var _a, _b;
|
|
39779
|
+
const stackTrace = new Error("Thrown here:");
|
|
39780
|
+
let data = {}, errorMessage = message, method = "unknown", stack = "empty", status = 500, url = "unknown";
|
|
39781
39781
|
if (error instanceof AxiosError) {
|
|
39782
39782
|
errorMessage = (error === null || error === void 0 ? void 0 : error.message) || message;
|
|
39783
39783
|
if (error.response) {
|
|
39784
39784
|
status = error.response.status;
|
|
39785
39785
|
data = error.response.data;
|
|
39786
|
+
if (error.response.data.errors)
|
|
39787
|
+
errorMessage = error.response.data.errors[0].message;
|
|
39786
39788
|
}
|
|
39787
39789
|
if ((_a = error === null || error === void 0 ? void 0 : error.config) === null || _a === void 0 ? void 0 : _a.url)
|
|
39788
39790
|
url = error.config.url;
|
|
39789
39791
|
if ((_b = error === null || error === void 0 ? void 0 : error.config) === null || _b === void 0 ? void 0 : _b.method)
|
|
39790
39792
|
method = error.config.method;
|
|
39791
|
-
|
|
39792
|
-
stack = `${error.stack}\n${this.stackTrace.stack}`;
|
|
39793
|
+
stack = `${error.stack}\n${stackTrace.stack}`;
|
|
39793
39794
|
}
|
|
39794
39795
|
else if (error instanceof Error) {
|
|
39795
39796
|
errorMessage = (error === null || error === void 0 ? void 0 : error.message) || message;
|
|
39796
|
-
|
|
39797
|
-
stack = `${error.stack}\n${this.stackTrace.stack}`;
|
|
39797
|
+
stack = `${error.stack}\n${stackTrace.stack}`;
|
|
39798
39798
|
}
|
|
39799
|
-
return {
|
|
39799
|
+
return {
|
|
39800
|
+
data,
|
|
39801
|
+
message: errorMessage,
|
|
39802
|
+
method,
|
|
39803
|
+
stack,
|
|
39804
|
+
stackTrace,
|
|
39805
|
+
status,
|
|
39806
|
+
success: false,
|
|
39807
|
+
url,
|
|
39808
|
+
};
|
|
39800
39809
|
}
|
|
39801
39810
|
}
|
|
39802
39811
|
|
|
@@ -40096,6 +40105,23 @@ class DroppedAsset extends Asset {
|
|
|
40096
40105
|
throw this.errorHandler({ error });
|
|
40097
40106
|
}
|
|
40098
40107
|
}
|
|
40108
|
+
/**
|
|
40109
|
+
* @summary
|
|
40110
|
+
* Updates webhook zone options for a dropped asset.
|
|
40111
|
+
*
|
|
40112
|
+
* @usage
|
|
40113
|
+
* ```ts
|
|
40114
|
+
* await droppedAsset.updateWebhookZone(true);
|
|
40115
|
+
* ```
|
|
40116
|
+
*/
|
|
40117
|
+
updateWebhookZone(isWebhookZoneEnabled) {
|
|
40118
|
+
try {
|
|
40119
|
+
return __classPrivateFieldGet(this, _DroppedAsset_updateDroppedAsset, "f").call(this, { isWebhookZoneEnabled }, "set-webhook-zone");
|
|
40120
|
+
}
|
|
40121
|
+
catch (error) {
|
|
40122
|
+
throw this.errorHandler({ error });
|
|
40123
|
+
}
|
|
40124
|
+
}
|
|
40099
40125
|
/**
|
|
40100
40126
|
* @summary
|
|
40101
40127
|
* Moves a dropped asset to specified coordinates.
|
|
@@ -40119,7 +40145,7 @@ class DroppedAsset extends Asset {
|
|
|
40119
40145
|
*
|
|
40120
40146
|
* @usage
|
|
40121
40147
|
* ```ts
|
|
40122
|
-
* await droppedAsset.
|
|
40148
|
+
* await droppedAsset.updatePrivateZone({
|
|
40123
40149
|
* "isPrivateZone": false,
|
|
40124
40150
|
* "isPrivateZoneChatDisabled": true,
|
|
40125
40151
|
* "privateZoneUserCap": 10
|
|
@@ -40207,7 +40233,7 @@ class DroppedAsset extends Asset {
|
|
|
40207
40233
|
addWebhook({ dataObject, description, isUniqueOnly, title, type, url, }) {
|
|
40208
40234
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40209
40235
|
try {
|
|
40210
|
-
yield this.topiaPublicApi().post(`/world/${this.urlSlug}/webhooks`, {
|
|
40236
|
+
const response = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/webhooks`, {
|
|
40211
40237
|
active: true,
|
|
40212
40238
|
assetId: this.id,
|
|
40213
40239
|
dataObject,
|
|
@@ -40219,6 +40245,7 @@ class DroppedAsset extends Asset {
|
|
|
40219
40245
|
url,
|
|
40220
40246
|
urlSlug: this.urlSlug,
|
|
40221
40247
|
}, this.requestOptions);
|
|
40248
|
+
return response.data.webhookId;
|
|
40222
40249
|
}
|
|
40223
40250
|
catch (error) {
|
|
40224
40251
|
throw this.errorHandler({ error });
|
|
@@ -40414,7 +40441,6 @@ class World extends SDKController {
|
|
|
40414
40441
|
// create temp map and then update private property only once
|
|
40415
40442
|
const tempDroppedAssetsMap = {};
|
|
40416
40443
|
for (const index in response.data) {
|
|
40417
|
-
// tempDroppedAssetsMap[id] = createDroppedAsset(this.apiKey, response.data[id], this.urlSlug);
|
|
40418
40444
|
tempDroppedAssetsMap[index] = new DroppedAsset(this.topia, response.data[index].id, this.urlSlug, {
|
|
40419
40445
|
attributes: response.data[index],
|
|
40420
40446
|
credentials: this.credentials,
|
|
@@ -41015,7 +41041,7 @@ class WorldFactory {
|
|
|
41015
41041
|
|
|
41016
41042
|
Error.stackTraceLimit = 20;
|
|
41017
41043
|
process.on("unhandledRejection", (reason) => {
|
|
41018
|
-
if (reason.data) {
|
|
41044
|
+
if (reason && reason.data) {
|
|
41019
41045
|
const { errors } = reason.data;
|
|
41020
41046
|
if (Array.isArray(errors)) {
|
|
41021
41047
|
for (const error of errors) {
|
|
@@ -41023,8 +41049,12 @@ process.on("unhandledRejection", (reason) => {
|
|
|
41023
41049
|
}
|
|
41024
41050
|
}
|
|
41025
41051
|
}
|
|
41052
|
+
else {
|
|
41053
|
+
console.error("Unhandled rejection failed with no defined reason.");
|
|
41054
|
+
}
|
|
41026
41055
|
console.error((reason === null || reason === void 0 ? void 0 : reason.stack) || "no stack");
|
|
41027
|
-
|
|
41056
|
+
if (reason && reason.stack)
|
|
41057
|
+
delete reason.stack;
|
|
41028
41058
|
console.error(reason);
|
|
41029
41059
|
console.error(`Please surround your use of the RTSDK with a try/catch block.`);
|
|
41030
41060
|
process.exit(1);
|
package/dist/index.js
CHANGED
|
@@ -39770,31 +39770,40 @@ class SDKController {
|
|
|
39770
39770
|
this.requestOptions = { headers };
|
|
39771
39771
|
}
|
|
39772
39772
|
topiaPublicApi() {
|
|
39773
|
-
this.stackTrace = new Error("Thrown here:");
|
|
39774
39773
|
return this.topia.axios;
|
|
39775
39774
|
}
|
|
39776
39775
|
errorHandler({ error, message = "Something went wrong. Please try again or contact support.", }) {
|
|
39777
|
-
var _a, _b
|
|
39778
|
-
|
|
39776
|
+
var _a, _b;
|
|
39777
|
+
const stackTrace = new Error("Thrown here:");
|
|
39778
|
+
let data = {}, errorMessage = message, method = "unknown", stack = "empty", status = 500, url = "unknown";
|
|
39779
39779
|
if (error instanceof AxiosError) {
|
|
39780
39780
|
errorMessage = (error === null || error === void 0 ? void 0 : error.message) || message;
|
|
39781
39781
|
if (error.response) {
|
|
39782
39782
|
status = error.response.status;
|
|
39783
39783
|
data = error.response.data;
|
|
39784
|
+
if (error.response.data.errors)
|
|
39785
|
+
errorMessage = error.response.data.errors[0].message;
|
|
39784
39786
|
}
|
|
39785
39787
|
if ((_a = error === null || error === void 0 ? void 0 : error.config) === null || _a === void 0 ? void 0 : _a.url)
|
|
39786
39788
|
url = error.config.url;
|
|
39787
39789
|
if ((_b = error === null || error === void 0 ? void 0 : error.config) === null || _b === void 0 ? void 0 : _b.method)
|
|
39788
39790
|
method = error.config.method;
|
|
39789
|
-
|
|
39790
|
-
stack = `${error.stack}\n${this.stackTrace.stack}`;
|
|
39791
|
+
stack = `${error.stack}\n${stackTrace.stack}`;
|
|
39791
39792
|
}
|
|
39792
39793
|
else if (error instanceof Error) {
|
|
39793
39794
|
errorMessage = (error === null || error === void 0 ? void 0 : error.message) || message;
|
|
39794
|
-
|
|
39795
|
-
stack = `${error.stack}\n${this.stackTrace.stack}`;
|
|
39795
|
+
stack = `${error.stack}\n${stackTrace.stack}`;
|
|
39796
39796
|
}
|
|
39797
|
-
return {
|
|
39797
|
+
return {
|
|
39798
|
+
data,
|
|
39799
|
+
message: errorMessage,
|
|
39800
|
+
method,
|
|
39801
|
+
stack,
|
|
39802
|
+
stackTrace,
|
|
39803
|
+
status,
|
|
39804
|
+
success: false,
|
|
39805
|
+
url,
|
|
39806
|
+
};
|
|
39798
39807
|
}
|
|
39799
39808
|
}
|
|
39800
39809
|
|
|
@@ -40094,6 +40103,23 @@ class DroppedAsset extends Asset {
|
|
|
40094
40103
|
throw this.errorHandler({ error });
|
|
40095
40104
|
}
|
|
40096
40105
|
}
|
|
40106
|
+
/**
|
|
40107
|
+
* @summary
|
|
40108
|
+
* Updates webhook zone options for a dropped asset.
|
|
40109
|
+
*
|
|
40110
|
+
* @usage
|
|
40111
|
+
* ```ts
|
|
40112
|
+
* await droppedAsset.updateWebhookZone(true);
|
|
40113
|
+
* ```
|
|
40114
|
+
*/
|
|
40115
|
+
updateWebhookZone(isWebhookZoneEnabled) {
|
|
40116
|
+
try {
|
|
40117
|
+
return __classPrivateFieldGet(this, _DroppedAsset_updateDroppedAsset, "f").call(this, { isWebhookZoneEnabled }, "set-webhook-zone");
|
|
40118
|
+
}
|
|
40119
|
+
catch (error) {
|
|
40120
|
+
throw this.errorHandler({ error });
|
|
40121
|
+
}
|
|
40122
|
+
}
|
|
40097
40123
|
/**
|
|
40098
40124
|
* @summary
|
|
40099
40125
|
* Moves a dropped asset to specified coordinates.
|
|
@@ -40117,7 +40143,7 @@ class DroppedAsset extends Asset {
|
|
|
40117
40143
|
*
|
|
40118
40144
|
* @usage
|
|
40119
40145
|
* ```ts
|
|
40120
|
-
* await droppedAsset.
|
|
40146
|
+
* await droppedAsset.updatePrivateZone({
|
|
40121
40147
|
* "isPrivateZone": false,
|
|
40122
40148
|
* "isPrivateZoneChatDisabled": true,
|
|
40123
40149
|
* "privateZoneUserCap": 10
|
|
@@ -40205,7 +40231,7 @@ class DroppedAsset extends Asset {
|
|
|
40205
40231
|
addWebhook({ dataObject, description, isUniqueOnly, title, type, url, }) {
|
|
40206
40232
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40207
40233
|
try {
|
|
40208
|
-
yield this.topiaPublicApi().post(`/world/${this.urlSlug}/webhooks`, {
|
|
40234
|
+
const response = yield this.topiaPublicApi().post(`/world/${this.urlSlug}/webhooks`, {
|
|
40209
40235
|
active: true,
|
|
40210
40236
|
assetId: this.id,
|
|
40211
40237
|
dataObject,
|
|
@@ -40217,6 +40243,7 @@ class DroppedAsset extends Asset {
|
|
|
40217
40243
|
url,
|
|
40218
40244
|
urlSlug: this.urlSlug,
|
|
40219
40245
|
}, this.requestOptions);
|
|
40246
|
+
return response.data.webhookId;
|
|
40220
40247
|
}
|
|
40221
40248
|
catch (error) {
|
|
40222
40249
|
throw this.errorHandler({ error });
|
|
@@ -40412,7 +40439,6 @@ class World extends SDKController {
|
|
|
40412
40439
|
// create temp map and then update private property only once
|
|
40413
40440
|
const tempDroppedAssetsMap = {};
|
|
40414
40441
|
for (const index in response.data) {
|
|
40415
|
-
// tempDroppedAssetsMap[id] = createDroppedAsset(this.apiKey, response.data[id], this.urlSlug);
|
|
40416
40442
|
tempDroppedAssetsMap[index] = new DroppedAsset(this.topia, response.data[index].id, this.urlSlug, {
|
|
40417
40443
|
attributes: response.data[index],
|
|
40418
40444
|
credentials: this.credentials,
|
|
@@ -41013,7 +41039,7 @@ class WorldFactory {
|
|
|
41013
41039
|
|
|
41014
41040
|
Error.stackTraceLimit = 20;
|
|
41015
41041
|
process.on("unhandledRejection", (reason) => {
|
|
41016
|
-
if (reason.data) {
|
|
41042
|
+
if (reason && reason.data) {
|
|
41017
41043
|
const { errors } = reason.data;
|
|
41018
41044
|
if (Array.isArray(errors)) {
|
|
41019
41045
|
for (const error of errors) {
|
|
@@ -41021,8 +41047,12 @@ process.on("unhandledRejection", (reason) => {
|
|
|
41021
41047
|
}
|
|
41022
41048
|
}
|
|
41023
41049
|
}
|
|
41050
|
+
else {
|
|
41051
|
+
console.error("Unhandled rejection failed with no defined reason.");
|
|
41052
|
+
}
|
|
41024
41053
|
console.error((reason === null || reason === void 0 ? void 0 : reason.stack) || "no stack");
|
|
41025
|
-
|
|
41054
|
+
if (reason && reason.stack)
|
|
41055
|
+
delete reason.stack;
|
|
41026
41056
|
console.error(reason);
|
|
41027
41057
|
console.error(`Please surround your use of the RTSDK with a try/catch block.`);
|
|
41028
41058
|
process.exit(1);
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export declare const assets: ({
|
|
2
|
+
id: string;
|
|
3
|
+
addedOn: string;
|
|
4
|
+
assetName: string;
|
|
5
|
+
specialType: null;
|
|
6
|
+
topLayerURL: string;
|
|
7
|
+
bottomLayerURL: string;
|
|
8
|
+
creatorTags?: undefined;
|
|
9
|
+
isPublic?: undefined;
|
|
10
|
+
kitId?: undefined;
|
|
11
|
+
layer0?: undefined;
|
|
12
|
+
layer1?: undefined;
|
|
13
|
+
library?: undefined;
|
|
14
|
+
originalAssetId?: undefined;
|
|
15
|
+
originalKit?: undefined;
|
|
16
|
+
ownerId?: undefined;
|
|
17
|
+
ownerName?: undefined;
|
|
18
|
+
purchased?: undefined;
|
|
19
|
+
purchasedDate?: undefined;
|
|
20
|
+
purchasedFrom?: undefined;
|
|
21
|
+
tagJson?: undefined;
|
|
22
|
+
transactionId?: undefined;
|
|
23
|
+
type?: undefined;
|
|
24
|
+
urlSlug?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
addedOn: string;
|
|
27
|
+
assetName: string;
|
|
28
|
+
creatorTags: {};
|
|
29
|
+
isPublic: boolean;
|
|
30
|
+
kitId: string;
|
|
31
|
+
layer0: null;
|
|
32
|
+
layer1: string;
|
|
33
|
+
library: string;
|
|
34
|
+
originalAssetId: string;
|
|
35
|
+
originalKit: string;
|
|
36
|
+
ownerId: string;
|
|
37
|
+
ownerName: string;
|
|
38
|
+
purchased: boolean;
|
|
39
|
+
purchasedDate: string;
|
|
40
|
+
purchasedFrom: string;
|
|
41
|
+
tagJson: string;
|
|
42
|
+
transactionId: string;
|
|
43
|
+
type: string;
|
|
44
|
+
urlSlug: string;
|
|
45
|
+
id?: undefined;
|
|
46
|
+
specialType?: undefined;
|
|
47
|
+
topLayerURL?: undefined;
|
|
48
|
+
bottomLayerURL?: undefined;
|
|
49
|
+
})[];
|
|
50
|
+
export declare const droppedAssets: {
|
|
51
|
+
id: string;
|
|
52
|
+
assetId: string;
|
|
53
|
+
assetName: string;
|
|
54
|
+
assetScale: number;
|
|
55
|
+
assetBroadcastAll: boolean;
|
|
56
|
+
assetBroadcast: boolean;
|
|
57
|
+
audioRadius: null;
|
|
58
|
+
audioSliderVolume: null;
|
|
59
|
+
isPrivateZone: boolean;
|
|
60
|
+
isPrivateZoneChatDisabled: boolean;
|
|
61
|
+
privateZoneUserCap: null;
|
|
62
|
+
broadcasterEmail: null;
|
|
63
|
+
clickType: null;
|
|
64
|
+
clickableLink: null;
|
|
65
|
+
clickableLinkTitle: null;
|
|
66
|
+
clickablePortal: null;
|
|
67
|
+
creationDatetime: number;
|
|
68
|
+
clickableDisplayTextDescription: null;
|
|
69
|
+
clickableDisplayTextHeadline: null;
|
|
70
|
+
position: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
};
|
|
74
|
+
portalCoordsX: null;
|
|
75
|
+
portalCoordsY: null;
|
|
76
|
+
specialType: null;
|
|
77
|
+
topLayerURL: string;
|
|
78
|
+
bottomLayerURL: string;
|
|
79
|
+
text: null;
|
|
80
|
+
textStyle: {
|
|
81
|
+
textColor: string;
|
|
82
|
+
textSize: number;
|
|
83
|
+
textWidth: number;
|
|
84
|
+
textWeight: string;
|
|
85
|
+
textFont: string;
|
|
86
|
+
textFontFamily: string;
|
|
87
|
+
};
|
|
88
|
+
teleportX: null;
|
|
89
|
+
teleportY: null;
|
|
90
|
+
syncUserMedia: null;
|
|
91
|
+
mediaLink: null;
|
|
92
|
+
mediaType: null;
|
|
93
|
+
mediaUploadedId: null;
|
|
94
|
+
mediaName: null;
|
|
95
|
+
isMutezone: null;
|
|
96
|
+
isVideo: null;
|
|
97
|
+
isVideoPlayer: null;
|
|
98
|
+
uniqueName: null;
|
|
99
|
+
}[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./assets";
|
|
2
|
-
export * from "./scenes";
|
|
3
|
-
export * from "./visitors";
|
|
4
|
-
export * from "./worlds";
|
|
1
|
+
export * from "./assets";
|
|
2
|
+
export * from "./scenes";
|
|
3
|
+
export * from "./visitors";
|
|
4
|
+
export * from "./worlds";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export declare const scenes: ({
|
|
2
|
+
description: string;
|
|
3
|
+
height: number;
|
|
4
|
+
name: string;
|
|
5
|
+
urlSlug: string;
|
|
6
|
+
purchasedDate: {
|
|
7
|
+
_seconds: number;
|
|
8
|
+
_nanoseconds: number;
|
|
9
|
+
};
|
|
10
|
+
background: string;
|
|
11
|
+
spawnPosition: {
|
|
12
|
+
radius: number;
|
|
13
|
+
y: number;
|
|
14
|
+
x: number;
|
|
15
|
+
};
|
|
16
|
+
worldCenteredAtZero: boolean;
|
|
17
|
+
width: number;
|
|
18
|
+
price: string;
|
|
19
|
+
originalKit: string;
|
|
20
|
+
isPublic: boolean;
|
|
21
|
+
created: {
|
|
22
|
+
_seconds: number;
|
|
23
|
+
_nanoseconds: number;
|
|
24
|
+
};
|
|
25
|
+
id: string;
|
|
26
|
+
timesGetFree?: undefined;
|
|
27
|
+
timesUsed?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
background: null;
|
|
30
|
+
description: string;
|
|
31
|
+
price: number;
|
|
32
|
+
height: number;
|
|
33
|
+
urlSlug: string;
|
|
34
|
+
originalKit: string;
|
|
35
|
+
worldCenteredAtZero: boolean;
|
|
36
|
+
spawnPosition: {
|
|
37
|
+
x: number;
|
|
38
|
+
radius: number;
|
|
39
|
+
y: number;
|
|
40
|
+
};
|
|
41
|
+
timesGetFree: number;
|
|
42
|
+
isPublic: boolean;
|
|
43
|
+
timesUsed: number;
|
|
44
|
+
created: {
|
|
45
|
+
_seconds: number;
|
|
46
|
+
_nanoseconds: number;
|
|
47
|
+
};
|
|
48
|
+
purchasedDate: {
|
|
49
|
+
_seconds: number;
|
|
50
|
+
_nanoseconds: number;
|
|
51
|
+
};
|
|
52
|
+
name: string;
|
|
53
|
+
width: number;
|
|
54
|
+
id: string;
|
|
55
|
+
} | {
|
|
56
|
+
background: string;
|
|
57
|
+
name: string;
|
|
58
|
+
timesUsed: number;
|
|
59
|
+
height: number;
|
|
60
|
+
spawnPosition: {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
radius: number;
|
|
64
|
+
};
|
|
65
|
+
price: number;
|
|
66
|
+
urlSlug: string;
|
|
67
|
+
created: {
|
|
68
|
+
_seconds: number;
|
|
69
|
+
_nanoseconds: number;
|
|
70
|
+
};
|
|
71
|
+
description: string;
|
|
72
|
+
width: number;
|
|
73
|
+
id: string;
|
|
74
|
+
purchasedDate?: undefined;
|
|
75
|
+
worldCenteredAtZero?: undefined;
|
|
76
|
+
originalKit?: undefined;
|
|
77
|
+
isPublic?: undefined;
|
|
78
|
+
timesGetFree?: undefined;
|
|
79
|
+
})[];
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export declare const visitor: {
|
|
2
|
+
visitorId: number;
|
|
3
|
+
color: string;
|
|
4
|
+
moveTo: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
moveFrom: {};
|
|
9
|
+
username: string;
|
|
10
|
+
sitting: boolean;
|
|
11
|
+
gestureType: number;
|
|
12
|
+
performer: boolean;
|
|
13
|
+
performerNear: boolean;
|
|
14
|
+
shareScreen: boolean;
|
|
15
|
+
isBackground: boolean;
|
|
16
|
+
muted: boolean;
|
|
17
|
+
hidden: boolean;
|
|
18
|
+
newId: string;
|
|
19
|
+
displayName: string;
|
|
20
|
+
movedOn: number;
|
|
21
|
+
lastUpdate: number;
|
|
22
|
+
isMobile: boolean;
|
|
23
|
+
token: string;
|
|
24
|
+
isAdmin: boolean;
|
|
25
|
+
isRecording: boolean;
|
|
26
|
+
isRecordingBot: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare const visitors: {
|
|
29
|
+
"1": {
|
|
30
|
+
visitorId: number;
|
|
31
|
+
color: string;
|
|
32
|
+
moveTo: {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
};
|
|
36
|
+
moveFrom: {};
|
|
37
|
+
username: string;
|
|
38
|
+
sitting: boolean;
|
|
39
|
+
gestureType: number;
|
|
40
|
+
performer: boolean;
|
|
41
|
+
performerNear: boolean;
|
|
42
|
+
shareScreen: boolean;
|
|
43
|
+
isBackground: boolean;
|
|
44
|
+
muted: boolean;
|
|
45
|
+
hidden: boolean;
|
|
46
|
+
newId: string;
|
|
47
|
+
displayName: string;
|
|
48
|
+
movedOn: number;
|
|
49
|
+
lastUpdate: number;
|
|
50
|
+
isMobile: boolean;
|
|
51
|
+
token: string;
|
|
52
|
+
isAdmin: boolean;
|
|
53
|
+
isRecording: boolean;
|
|
54
|
+
isRecordingBot: boolean;
|
|
55
|
+
};
|
|
56
|
+
"2": {
|
|
57
|
+
visitorId: number;
|
|
58
|
+
color: string;
|
|
59
|
+
moveTo: {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
};
|
|
63
|
+
moveFrom: {};
|
|
64
|
+
username: string;
|
|
65
|
+
sitting: boolean;
|
|
66
|
+
gestureType: number;
|
|
67
|
+
performer: boolean;
|
|
68
|
+
performerNear: boolean;
|
|
69
|
+
shareScreen: boolean;
|
|
70
|
+
isBackground: boolean;
|
|
71
|
+
muted: boolean;
|
|
72
|
+
hidden: boolean;
|
|
73
|
+
newId: string;
|
|
74
|
+
displayName: string;
|
|
75
|
+
movedOn: number;
|
|
76
|
+
lastUpdate: number;
|
|
77
|
+
isMobile: boolean;
|
|
78
|
+
token: string;
|
|
79
|
+
isAdmin: boolean;
|
|
80
|
+
isRecording: boolean;
|
|
81
|
+
isRecordingBot: boolean;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const worlds: ({
|
|
2
|
+
description: string;
|
|
3
|
+
name: string;
|
|
4
|
+
heroImage: string;
|
|
5
|
+
urlSlug: string;
|
|
6
|
+
background?: undefined;
|
|
7
|
+
created?: undefined;
|
|
8
|
+
controls?: undefined;
|
|
9
|
+
enforceWhitelistOnLogin?: undefined;
|
|
10
|
+
forceAuthOnLogin?: undefined;
|
|
11
|
+
height?: undefined;
|
|
12
|
+
mapExists?: undefined;
|
|
13
|
+
redirectTo?: undefined;
|
|
14
|
+
spawnPosition?: undefined;
|
|
15
|
+
tileBackgroundEverywhere?: undefined;
|
|
16
|
+
useTopiaPassword?: undefined;
|
|
17
|
+
width?: undefined;
|
|
18
|
+
alt?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
background: null;
|
|
21
|
+
created: {
|
|
22
|
+
_seconds: number;
|
|
23
|
+
_nanoseconds: number;
|
|
24
|
+
};
|
|
25
|
+
controls: {
|
|
26
|
+
isShowingCurrentGuests: boolean;
|
|
27
|
+
hideShareScreen: boolean;
|
|
28
|
+
isZoneConversationHidden: boolean;
|
|
29
|
+
allowUserToTurnOnNotifications: boolean;
|
|
30
|
+
isPeerConversationHidden: boolean;
|
|
31
|
+
disableHideVideo: boolean;
|
|
32
|
+
isWorldConversationHidden: boolean;
|
|
33
|
+
allowUsersToTurnOnNotifications: boolean;
|
|
34
|
+
allowMuteAll: boolean;
|
|
35
|
+
isMobileDisabled: boolean;
|
|
36
|
+
};
|
|
37
|
+
description: string;
|
|
38
|
+
enforceWhitelistOnLogin: boolean;
|
|
39
|
+
forceAuthOnLogin: boolean;
|
|
40
|
+
height: number;
|
|
41
|
+
heroImage: string;
|
|
42
|
+
mapExists: boolean;
|
|
43
|
+
name: string;
|
|
44
|
+
redirectTo: null;
|
|
45
|
+
spawnPosition: {
|
|
46
|
+
radius: number;
|
|
47
|
+
y: number;
|
|
48
|
+
x: number;
|
|
49
|
+
};
|
|
50
|
+
tileBackgroundEverywhere: null;
|
|
51
|
+
useTopiaPassword: boolean;
|
|
52
|
+
urlSlug: string;
|
|
53
|
+
width: number;
|
|
54
|
+
alt?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
alt: string;
|
|
57
|
+
description: string;
|
|
58
|
+
name: string;
|
|
59
|
+
heroImage: string;
|
|
60
|
+
urlSlug: string;
|
|
61
|
+
background?: undefined;
|
|
62
|
+
created?: undefined;
|
|
63
|
+
controls?: undefined;
|
|
64
|
+
enforceWhitelistOnLogin?: undefined;
|
|
65
|
+
forceAuthOnLogin?: undefined;
|
|
66
|
+
height?: undefined;
|
|
67
|
+
mapExists?: undefined;
|
|
68
|
+
redirectTo?: undefined;
|
|
69
|
+
spawnPosition?: undefined;
|
|
70
|
+
tileBackgroundEverywhere?: undefined;
|
|
71
|
+
useTopiaPassword?: undefined;
|
|
72
|
+
width?: undefined;
|
|
73
|
+
})[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SDKController } from "controllers/SDKController";
|
|
2
|
+
import { Topia } from "controllers/Topia";
|
|
3
|
+
import { AssetInterface, AssetOptionalInterface } from "interfaces";
|
|
4
|
+
import { ResponseType } from "types";
|
|
5
|
+
/**
|
|
6
|
+
* @summary
|
|
7
|
+
* Create an instance of Asset class with a given asset id and optional attributes and session credentials.
|
|
8
|
+
*
|
|
9
|
+
* @usage
|
|
10
|
+
* ```ts
|
|
11
|
+
* await new Asset(topia, "assetId", { attributes: { assetName: "My Asset", isPublic: false } });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare class Asset extends SDKController implements AssetInterface {
|
|
15
|
+
readonly id?: string;
|
|
16
|
+
jwt?: string;
|
|
17
|
+
constructor(topia: Topia, id: string, options?: AssetOptionalInterface);
|
|
18
|
+
fetchPlatformAssets(): Promise<object | ResponseType>;
|
|
19
|
+
}
|
|
20
|
+
export default Asset;
|