@overmap-ai/core 1.0.65-asset-stage-completion-plan.2 → 1.0.65-asset-stage-completion-plan.4
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 +11 -23
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +11 -23
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/AssetService.d.ts +3 -3
- package/dist/sdk/services/AssetStageService.d.ts +1 -1
- package/dist/store/slices/assetStageCompletionPlanSlice.d.ts +2 -2
- package/package.json +1 -1
package/dist/overmap-core.js
CHANGED
|
@@ -1115,7 +1115,7 @@ const assetStageComepltionPlanSlice = createSlice({
|
|
|
1115
1115
|
initialState: initialState$x,
|
|
1116
1116
|
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$x)),
|
|
1117
1117
|
reducers: {
|
|
1118
|
-
|
|
1118
|
+
initializeAssetStageCompletionPlans: assetStageCompletionPlanAdapter.initialize,
|
|
1119
1119
|
addAssetStageCompletionPlan: assetStageCompletionPlanAdapter.addOne,
|
|
1120
1120
|
addAssetStageCompletionPlans: assetStageCompletionPlanAdapter.addMany,
|
|
1121
1121
|
setAssetStageCompletionPlan: assetStageCompletionPlanAdapter.setOne,
|
|
@@ -1127,7 +1127,7 @@ const assetStageComepltionPlanSlice = createSlice({
|
|
|
1127
1127
|
}
|
|
1128
1128
|
});
|
|
1129
1129
|
const {
|
|
1130
|
-
|
|
1130
|
+
initializeAssetStageCompletionPlans,
|
|
1131
1131
|
addAssetStageCompletionPlan,
|
|
1132
1132
|
addAssetStageCompletionPlans,
|
|
1133
1133
|
updateAssetStageCompletionPlan,
|
|
@@ -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
|
}
|
|
@@ -7664,10 +7652,10 @@ class AssetStageCompletionPlanService extends BaseApiService {
|
|
|
7664
7652
|
if (!assetStageCompletionPlan) {
|
|
7665
7653
|
throw new Error(`AssetStageCompletionPlan with offline_id ${payload.offline_id} not found`);
|
|
7666
7654
|
}
|
|
7667
|
-
const updatedAssetStageCompletionPlan =
|
|
7655
|
+
const updatedAssetStageCompletionPlan = {
|
|
7668
7656
|
...assetStageCompletionPlan,
|
|
7669
7657
|
...payload
|
|
7670
|
-
}
|
|
7658
|
+
};
|
|
7671
7659
|
this.dispatch(updateAssetStageCompletionPlan(updatedAssetStageCompletionPlan));
|
|
7672
7660
|
const promise = this.enqueueRequest({
|
|
7673
7661
|
description: "Update asset stage completion plan",
|
|
@@ -7712,7 +7700,7 @@ class AssetStageCompletionPlanService extends BaseApiService {
|
|
|
7712
7700
|
blockers: [],
|
|
7713
7701
|
blocks: []
|
|
7714
7702
|
});
|
|
7715
|
-
this.dispatch(
|
|
7703
|
+
this.dispatch(initializeAssetStageCompletionPlans(result));
|
|
7716
7704
|
}
|
|
7717
7705
|
}
|
|
7718
7706
|
export {
|
|
@@ -7954,7 +7942,7 @@ export {
|
|
|
7954
7942
|
hashFile,
|
|
7955
7943
|
initSDK,
|
|
7956
7944
|
initializeAssetAttachments,
|
|
7957
|
-
|
|
7945
|
+
initializeAssetStageCompletionPlans,
|
|
7958
7946
|
initializeAssetTypeAttachments,
|
|
7959
7947
|
initializeAssetTypes,
|
|
7960
7948
|
initializeAssets,
|