@honua/sdk-esri-compat 0.1.16 → 0.1.17

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.
@@ -162,7 +162,7 @@ export class EditWorkflowSession {
162
162
  const value = values[field.name];
163
163
  const serverAssignedOnCreate = this.kind === "create" && field.editable === false;
164
164
  const required = (field.required === true || field.nullable === false) && !serverAssignedOnCreate;
165
- if (required && isEmptyValue(value) && field.defaultValue === undefined) {
165
+ if (required && isEmptyValue(value) && (value !== undefined || isEmptyValue(field.defaultValue))) {
166
166
  errors.push({
167
167
  fieldName: field.name,
168
168
  code: "required",
@@ -1 +1 @@
1
- {"version":3,"file":"esri-geojson.d.ts","sourceRoot":"","sources":["../../../src/core/esri-geojson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,YAAY,EAKZ,cAAc,EACd,YAAY,EACZ,qBAAqB,EACtB,MAAM,YAAY,CAAC;AA2MpB;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAClE,eAAe,GAAG,IAAI,CA0ExB;AAkBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,cAAc,CAQ1E;AAyBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAC5C,gBAAgB,CAAC,EAAE,qBAAqB,GACvC,YAAY,GAAG,IAAI,CAyCrB"}
1
+ {"version":3,"file":"esri-geojson.d.ts","sourceRoot":"","sources":["../../../src/core/esri-geojson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EACV,eAAe,EAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,YAAY,EAKZ,cAAc,EACd,YAAY,EACZ,qBAAqB,EACtB,MAAM,YAAY,CAAC;AA2MpB;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAClE,eAAe,GAAG,IAAI,CAiFxB;AAkBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,cAAc,CAQ1E;AAyBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAC5C,gBAAgB,CAAC,EAAE,qBAAqB,GACvC,YAAY,GAAG,IAAI,CA6CrB"}
@@ -196,9 +196,16 @@ export function esriGeometryToGeoJSON(geometry) {
196
196
  }
197
197
  const candidate = geometry;
198
198
  if (hasNumber(candidate, "x") && hasNumber(candidate, "y")) {
199
+ if (candidate.z !== undefined && !hasNumber(candidate, "z")) {
200
+ return null;
201
+ }
199
202
  return {
200
203
  type: "Point",
201
- coordinates: [candidate.x, candidate.y],
204
+ coordinates: [
205
+ candidate.x,
206
+ candidate.y,
207
+ ...(candidate.z === undefined ? [] : [candidate.z]),
208
+ ],
202
209
  };
203
210
  }
204
211
  if (Array.isArray(candidate.points)) {
@@ -334,7 +341,9 @@ export function geoJsonToEsriGeometry(geometry, spatialReference) {
334
341
  switch (geometry.type) {
335
342
  case "Point": {
336
343
  const [x, y, z] = geometry.coordinates;
337
- if (typeof x !== "number" || typeof y !== "number") {
344
+ if (typeof x !== "number" ||
345
+ typeof y !== "number" ||
346
+ (z !== undefined && (typeof z !== "number" || !Number.isFinite(z)))) {
338
347
  return null;
339
348
  }
340
349
  // Keep the altitude of a 3D position: dropping it would hand back a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honua/sdk-esri-compat",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "ArcGIS JS API compatibility layer for ArcGIS migration from Esri apps to the open Honua + MapLibre stack",
5
5
  "keywords": [
6
6
  "gis",
@@ -46,7 +46,7 @@
46
46
  "proj4": "^2.20.9"
47
47
  },
48
48
  "peerDependencies": {
49
- "@honua/sdk": "0.1.16",
49
+ "@honua/sdk": "0.1.17",
50
50
  "@bufbuild/protobuf": "^2.0.0",
51
51
  "@connectrpc/connect": "^2.0.0",
52
52
  "@connectrpc/connect-web": "^2.0.0",