@overmap-ai/core 1.0.65-asset-stage-completion-plan.2 → 1.0.65-asset-stage-completion-plan.3
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/overmap-core.js
CHANGED
|
@@ -4223,7 +4223,7 @@ function chunkArray(arr, chunkSize) {
|
|
|
4223
4223
|
}
|
|
4224
4224
|
class AssetService extends BaseApiService {
|
|
4225
4225
|
// Basic CRUD functions
|
|
4226
|
-
add(asset
|
|
4226
|
+
add(asset) {
|
|
4227
4227
|
if (!asset.canvas_marker && !asset.geo_marker) {
|
|
4228
4228
|
throw new Error("Asset must have either a canvas_marker or geo_marker");
|
|
4229
4229
|
}
|
|
@@ -4233,16 +4233,13 @@ class AssetService extends BaseApiService {
|
|
|
4233
4233
|
description: "Create asset",
|
|
4234
4234
|
method: HttpMethod.POST,
|
|
4235
4235
|
url: `/assets/types/${offlineAsset.asset_type}/add-assets/`,
|
|
4236
|
-
queryParams: {
|
|
4237
|
-
workspace_id: workspaceId.toString()
|
|
4238
|
-
},
|
|
4239
4236
|
payload: { assets: [offlineAsset] },
|
|
4240
4237
|
blockers: [],
|
|
4241
4238
|
blocks: [offlineAsset.offline_id]
|
|
4242
4239
|
});
|
|
4243
4240
|
return [offlineAsset, promise];
|
|
4244
4241
|
}
|
|
4245
|
-
update(asset
|
|
4242
|
+
update(asset) {
|
|
4246
4243
|
if (!asset.canvas_marker && !asset.geo_marker) {
|
|
4247
4244
|
throw new Error("Asset must have either a canvas_marker or geo_marker");
|
|
4248
4245
|
}
|
|
@@ -4251,9 +4248,6 @@ class AssetService extends BaseApiService {
|
|
|
4251
4248
|
description: "Edit asset",
|
|
4252
4249
|
method: HttpMethod.PATCH,
|
|
4253
4250
|
url: `/assets/${asset.offline_id}/`,
|
|
4254
|
-
queryParams: {
|
|
4255
|
-
workspace_id: workspaceId.toString()
|
|
4256
|
-
},
|
|
4257
4251
|
payload: asset,
|
|
4258
4252
|
blockers: [asset.offline_id],
|
|
4259
4253
|
blocks: [asset.offline_id]
|
|
@@ -4315,7 +4309,7 @@ class AssetService extends BaseApiService {
|
|
|
4315
4309
|
});
|
|
4316
4310
|
}
|
|
4317
4311
|
// TODO: payload does not require asset_type
|
|
4318
|
-
bulkAdd(assetsToCreate,
|
|
4312
|
+
bulkAdd(assetsToCreate, assetTypeId, batchSize) {
|
|
4319
4313
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4320
4314
|
const transactionId = v4();
|
|
4321
4315
|
const assetBatches = chunkArray(assetsToCreate, batchSize).map((assetBatch) => {
|
|
@@ -4347,9 +4341,6 @@ class AssetService extends BaseApiService {
|
|
|
4347
4341
|
description: "Batch create assets",
|
|
4348
4342
|
method: HttpMethod.POST,
|
|
4349
4343
|
url: `/assets/types/${assetTypeId}/add-assets/`,
|
|
4350
|
-
queryParams: {
|
|
4351
|
-
workspace_id: workspaceId.toString()
|
|
4352
|
-
},
|
|
4353
4344
|
payload,
|
|
4354
4345
|
blockers,
|
|
4355
4346
|
blocks
|
|
@@ -4459,7 +4450,7 @@ class AssetStageCompletionService extends BaseApiService {
|
|
|
4459
4450
|
}
|
|
4460
4451
|
}
|
|
4461
4452
|
class AssetStageService extends BaseApiService {
|
|
4462
|
-
async bulkCreateStages(stagesToSubmit, assetTypeId
|
|
4453
|
+
async bulkCreateStages(stagesToSubmit, assetTypeId) {
|
|
4463
4454
|
const payload = stagesToSubmit.map((stage) => {
|
|
4464
4455
|
return offline(stage);
|
|
4465
4456
|
});
|
|
@@ -4474,10 +4465,7 @@ class AssetStageService extends BaseApiService {
|
|
|
4474
4465
|
payload: {
|
|
4475
4466
|
stages: payload
|
|
4476
4467
|
},
|
|
4477
|
-
|
|
4478
|
-
workspace_id: workspaceId.toString()
|
|
4479
|
-
},
|
|
4480
|
-
blockers: [assetTypeId, workspaceId],
|
|
4468
|
+
blockers: [assetTypeId],
|
|
4481
4469
|
blocks: payload.map(({ offline_id }) => offline_id)
|
|
4482
4470
|
});
|
|
4483
4471
|
}
|