@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.
@@ -4199,6 +4199,9 @@ function chunkArray(arr, chunkSize) {
4199
4199
  class AssetService extends BaseApiService {
4200
4200
  // Basic CRUD functions
4201
4201
  add(asset, workspaceId) {
4202
+ if (!asset.canvas_marker && !asset.geo_marker) {
4203
+ throw new Error("Asset must have either a canvas_marker or geo_marker");
4204
+ }
4202
4205
  const offlineAsset = offline(asset);
4203
4206
  this.dispatch(addAsset(offlineAsset));
4204
4207
  const promise = this.enqueueRequest({
@@ -4215,6 +4218,9 @@ class AssetService extends BaseApiService {
4215
4218
  return [offlineAsset, promise];
4216
4219
  }
4217
4220
  update(asset, workspaceId) {
4221
+ if (!asset.canvas_marker && !asset.geo_marker) {
4222
+ throw new Error("Asset must have either a canvas_marker or geo_marker");
4223
+ }
4218
4224
  this.client.store.dispatch(updateAsset(asset));
4219
4225
  const promise = this.enqueueRequest({
4220
4226
  description: "Edit asset",
@@ -5339,6 +5345,9 @@ class ProjectFileService extends BaseApiService {
5339
5345
  if (!activeProjectFile) {
5340
5346
  throw new Error("No active project file");
5341
5347
  }
5348
+ if (!activeProjectFile.bounds && !activeProjectFile.canvas_bounds) {
5349
+ throw new Error("Project file must either have bounds or canvas_bounds set");
5350
+ }
5342
5351
  let requestDetails;
5343
5352
  const existing = typeof activeProjectFile.file === "string" && !activeProjectFile.file.startsWith("blob:");
5344
5353
  if (existing) {
@@ -5359,7 +5368,6 @@ class ProjectFileService extends BaseApiService {
5359
5368
  url: `/projects/${activeProjectId}/files/`,
5360
5369
  payload: {
5361
5370
  ...activeProjectFile,
5362
- bounds: JSON.stringify(activeProjectFile.bounds),
5363
5371
  ...fileProps
5364
5372
  },
5365
5373
  blockers: [activeProjectFileId],
@@ -5431,6 +5439,9 @@ class ProjectService extends BaseApiService {
5431
5439
  if (!project.owner_organization && !project.owner_user) {
5432
5440
  throw new Error("Project type was not chosen when trying to create a project");
5433
5441
  }
5442
+ if (!project.bounds && !project.canvas_bounds) {
5443
+ throw new Error("Project must either have bounds or canvas_bounds set");
5444
+ }
5434
5445
  const isOrganizationProject = !!project.owner_organization;
5435
5446
  const url = isOrganizationProject ? `/organizations/${project.owner_organization}/projects/` : "/projects/";
5436
5447
  const projectType = isOrganizationProject ? { organization_owner: project.owner_organization } : { user_owner: project.owner_user };
@@ -5449,6 +5460,9 @@ class ProjectService extends BaseApiService {
5449
5460
  return result;
5450
5461
  }
5451
5462
  async update(project) {
5463
+ if (!project.bounds || !project.canvas_bounds) {
5464
+ throw new Error("Project must either have bounds or canvas_bounds set");
5465
+ }
5452
5466
  this.dispatch(updateOrCreateProject(project));
5453
5467
  return await this.enqueueRequest({
5454
5468
  description: "Update project",