@overmap-ai/core 1.0.60-forms-removal.6 → 1.0.60-forms-removal.7

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.
@@ -4187,6 +4187,9 @@ var __publicField = (obj, key, value) => {
4187
4187
  class AssetService extends BaseApiService {
4188
4188
  // Basic CRUD functions
4189
4189
  add(asset, workspaceId) {
4190
+ if (!asset.canvas_marker && !asset.geo_marker) {
4191
+ throw new Error("Asset must have either a canvas_marker or geo_marker");
4192
+ }
4190
4193
  const offlineAsset = offline(asset);
4191
4194
  this.dispatch(addAsset(offlineAsset));
4192
4195
  const promise = this.enqueueRequest({
@@ -4203,6 +4206,9 @@ var __publicField = (obj, key, value) => {
4203
4206
  return [offlineAsset, promise];
4204
4207
  }
4205
4208
  update(asset, workspaceId) {
4209
+ if (!asset.canvas_marker && !asset.geo_marker) {
4210
+ throw new Error("Asset must have either a canvas_marker or geo_marker");
4211
+ }
4206
4212
  this.client.store.dispatch(updateAsset(asset));
4207
4213
  const promise = this.enqueueRequest({
4208
4214
  description: "Edit asset",
@@ -5327,6 +5333,9 @@ var __publicField = (obj, key, value) => {
5327
5333
  if (!activeProjectFile) {
5328
5334
  throw new Error("No active project file");
5329
5335
  }
5336
+ if (!activeProjectFile.bounds && !activeProjectFile.canvas_bounds) {
5337
+ throw new Error("Project file must either have bounds or canvas_bounds set");
5338
+ }
5330
5339
  let requestDetails;
5331
5340
  const existing = typeof activeProjectFile.file === "string" && !activeProjectFile.file.startsWith("blob:");
5332
5341
  if (existing) {
@@ -5347,7 +5356,6 @@ var __publicField = (obj, key, value) => {
5347
5356
  url: `/projects/${activeProjectId}/files/`,
5348
5357
  payload: {
5349
5358
  ...activeProjectFile,
5350
- bounds: JSON.stringify(activeProjectFile.bounds),
5351
5359
  ...fileProps
5352
5360
  },
5353
5361
  blockers: [activeProjectFileId],
@@ -5419,6 +5427,9 @@ var __publicField = (obj, key, value) => {
5419
5427
  if (!project.owner_organization && !project.owner_user) {
5420
5428
  throw new Error("Project type was not chosen when trying to create a project");
5421
5429
  }
5430
+ if (!project.bounds && !project.canvas_bounds) {
5431
+ throw new Error("Project must either have bounds or canvas_bounds set");
5432
+ }
5422
5433
  const isOrganizationProject = !!project.owner_organization;
5423
5434
  const url = isOrganizationProject ? `/organizations/${project.owner_organization}/projects/` : "/projects/";
5424
5435
  const projectType = isOrganizationProject ? { organization_owner: project.owner_organization } : { user_owner: project.owner_user };
@@ -5437,6 +5448,9 @@ var __publicField = (obj, key, value) => {
5437
5448
  return result;
5438
5449
  }
5439
5450
  async update(project) {
5451
+ if (!project.bounds || !project.canvas_bounds) {
5452
+ throw new Error("Project must either have bounds or canvas_bounds set");
5453
+ }
5440
5454
  this.dispatch(updateOrCreateProject(project));
5441
5455
  return await this.enqueueRequest({
5442
5456
  description: "Update project",