@vived/app 2.37.1 → 2.38.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.
|
@@ -44,8 +44,9 @@ export declare abstract class AppDispatcher {
|
|
|
44
44
|
abstract submitMultiHitResult: (hits: number, misses: number, unanswered: number, description: string) => void;
|
|
45
45
|
abstract submitQualityResult: (stars: number, maxStars: number, description: string) => void;
|
|
46
46
|
abstract submitScoreResult: (score: number, maxScore: number, description: string) => void;
|
|
47
|
-
abstract
|
|
47
|
+
abstract getAssetBlobURL: (assetID: string) => Promise<string>;
|
|
48
48
|
abstract getAssetMeta: (assetID: string) => Promise<AssetMetaDTO>;
|
|
49
|
+
abstract getLinkedAssets: (assetID: string, type: string) => Promise<AssetMetaDTO[]>;
|
|
49
50
|
abstract getAssetsForOwner: (ownerID: string) => Promise<AssetMetaDTO[]>;
|
|
50
51
|
abstract submitNewActivityAsset: (file: File) => Promise<string>;
|
|
51
52
|
abstract stopZSpace: () => void;
|
|
@@ -155,7 +155,7 @@ class AppDistpatcherImp extends AppDispatcher {
|
|
|
155
155
|
};
|
|
156
156
|
this.formRequestAndDispatch("SUBMIT_RESULTS", 3, payload);
|
|
157
157
|
};
|
|
158
|
-
this.
|
|
158
|
+
this.getAssetBlobURL = (assetID) => {
|
|
159
159
|
return new Promise((resolve, reject) => {
|
|
160
160
|
const callback = (blobURL) => {
|
|
161
161
|
if (blobURL === undefined) {
|
|
@@ -199,6 +199,29 @@ class AppDistpatcherImp extends AppDispatcher {
|
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
201
|
};
|
|
202
|
+
this.getLinkedAssets = (assetID, type) => {
|
|
203
|
+
return new Promise((resolve, reject) => {
|
|
204
|
+
const callback = (linkedAssets) => {
|
|
205
|
+
if (linkedAssets === undefined) {
|
|
206
|
+
reject(new Error("Linked asset list is missing"));
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
resolve(linkedAssets);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const payload = {
|
|
213
|
+
assetID,
|
|
214
|
+
type,
|
|
215
|
+
callback,
|
|
216
|
+
};
|
|
217
|
+
if (!this.hostHandler) {
|
|
218
|
+
reject(new Error("No host handler has been registered"));
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
this.formRequestAndDispatch("GET_LINKED_ASSETS", 1, payload);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
};
|
|
202
225
|
this.getAssetsForOwner = (ownerID) => {
|
|
203
226
|
return new Promise((resolve, reject) => {
|
|
204
227
|
const callback = (assetMetas) => {
|