@rtsdk/topia 0.12.0 → 0.12.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 +16 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +16 -4
- package/package.json +1 -1
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.
|
|
42403
|
-
|
|
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 });
|
|
@@ -42662,9 +42668,15 @@ class WorldFactory extends SDKController {
|
|
|
42662
42668
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42663
42669
|
const params = { credentials, droppedAssetIds, urlSlug };
|
|
42664
42670
|
try {
|
|
42671
|
+
const { apiKey, interactivePublicKey } = credentials;
|
|
42665
42672
|
const headers = {};
|
|
42666
|
-
headers.
|
|
42667
|
-
|
|
42673
|
+
headers.publickey = interactivePublicKey;
|
|
42674
|
+
if (interactiveSecret)
|
|
42675
|
+
headers.interactiveJWT = jwt.sign(credentials, interactiveSecret);
|
|
42676
|
+
else if (apiKey)
|
|
42677
|
+
headers.Authorization = apiKey;
|
|
42678
|
+
else
|
|
42679
|
+
throw "An apiKey or interactive credentials are required.";
|
|
42668
42680
|
const promiseArray = [];
|
|
42669
42681
|
for (const id of droppedAssetIds) {
|
|
42670
42682
|
promiseArray.push(this.topiaPublicApi().delete(`/world/${urlSlug}/assets/${id}`, {
|
package/dist/index.d.ts
CHANGED
|
@@ -2138,9 +2138,10 @@ declare class DroppedAssetFactory extends SDKController {
|
|
|
2138
2138
|
* ```
|
|
2139
2139
|
*/
|
|
2140
2140
|
getWithUniqueName(uniqueName: string, urlSlug: string, interactiveSecret: string, credentials: {
|
|
2141
|
-
|
|
2141
|
+
apiKey?: string;
|
|
2142
|
+
interactiveNonce?: string;
|
|
2142
2143
|
interactivePublicKey: string;
|
|
2143
|
-
visitorId
|
|
2144
|
+
visitorId?: number;
|
|
2144
2145
|
}): Promise<DroppedAsset>;
|
|
2145
2146
|
/**
|
|
2146
2147
|
* @summary
|
|
@@ -2338,9 +2339,10 @@ declare class WorldFactory extends SDKController {
|
|
|
2338
2339
|
* ```
|
|
2339
2340
|
*/
|
|
2340
2341
|
deleteDroppedAssets(urlSlug: string, droppedAssetIds: string[], interactiveSecret: string, credentials: {
|
|
2341
|
-
|
|
2342
|
+
apiKey?: string;
|
|
2343
|
+
interactiveNonce?: string;
|
|
2342
2344
|
interactivePublicKey: string;
|
|
2343
|
-
visitorId
|
|
2345
|
+
visitorId?: number;
|
|
2344
2346
|
}): Promise<{
|
|
2345
2347
|
success: boolean;
|
|
2346
2348
|
}>;
|
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.
|
|
42401
|
-
|
|
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 });
|
|
@@ -42660,9 +42666,15 @@ class WorldFactory extends SDKController {
|
|
|
42660
42666
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42661
42667
|
const params = { credentials, droppedAssetIds, urlSlug };
|
|
42662
42668
|
try {
|
|
42669
|
+
const { apiKey, interactivePublicKey } = credentials;
|
|
42663
42670
|
const headers = {};
|
|
42664
|
-
headers.
|
|
42665
|
-
|
|
42671
|
+
headers.publickey = interactivePublicKey;
|
|
42672
|
+
if (interactiveSecret)
|
|
42673
|
+
headers.interactiveJWT = jwt.sign(credentials, interactiveSecret);
|
|
42674
|
+
else if (apiKey)
|
|
42675
|
+
headers.Authorization = apiKey;
|
|
42676
|
+
else
|
|
42677
|
+
throw "An apiKey or interactive credentials are required.";
|
|
42666
42678
|
const promiseArray = [];
|
|
42667
42679
|
for (const id of droppedAssetIds) {
|
|
42668
42680
|
promiseArray.push(this.topiaPublicApi().delete(`/world/${urlSlug}/assets/${id}`, {
|
package/package.json
CHANGED