@honua/react 0.1.7-beta.0 → 0.1.10-beta.0
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/control-plane/admin-client.d.ts +89 -0
- package/control-plane/admin-client.d.ts.map +1 -0
- package/control-plane/admin-client.js +200 -0
- package/control-plane/client.d.ts +1 -1
- package/control-plane/client.d.ts.map +1 -1
- package/control-plane/client.js +145 -11
- package/control-plane/commands/catalog.d.ts +133 -0
- package/control-plane/commands/catalog.d.ts.map +1 -0
- package/control-plane/commands/catalog.js +365 -0
- package/control-plane/commands/errors.d.ts +96 -0
- package/control-plane/commands/errors.d.ts.map +1 -0
- package/control-plane/commands/errors.js +130 -0
- package/control-plane/commands/identity.d.ts +71 -0
- package/control-plane/commands/identity.d.ts.map +1 -0
- package/control-plane/commands/identity.js +0 -0
- package/control-plane/commands/index.d.ts +39 -0
- package/control-plane/commands/index.d.ts.map +1 -0
- package/control-plane/commands/index.js +34 -0
- package/control-plane/commands/runtime.d.ts +146 -0
- package/control-plane/commands/runtime.d.ts.map +1 -0
- package/control-plane/commands/runtime.js +330 -0
- package/control-plane/commands/types.d.ts +228 -0
- package/control-plane/commands/types.d.ts.map +1 -0
- package/control-plane/commands/types.js +30 -0
- package/control-plane/commands/validate.d.ts +27 -0
- package/control-plane/commands/validate.d.ts.map +1 -0
- package/control-plane/commands/validate.js +132 -0
- package/control-plane/generated/admin-api.d.ts +30265 -0
- package/control-plane/generated/admin-api.d.ts.map +1 -0
- package/control-plane/generated/admin-api.js +5 -0
- package/control-plane/generated/admin-operations.d.ts +4053 -0
- package/control-plane/generated/admin-operations.d.ts.map +1 -0
- package/control-plane/generated/admin-operations.js +820 -0
- package/control-plane/index.d.ts +11 -0
- package/control-plane/index.d.ts.map +1 -1
- package/control-plane/index.js +8 -0
- package/control-plane/types.d.ts +14 -0
- package/control-plane/types.d.ts.map +1 -1
- package/core/client.d.ts.map +1 -1
- package/core/client.js +29 -31
- package/core/credential-redaction.d.ts +163 -0
- package/core/credential-redaction.d.ts.map +1 -0
- package/core/credential-redaction.js +389 -0
- package/core/error-classifications.d.ts +15 -0
- package/core/error-classifications.d.ts.map +1 -1
- package/core/error-classifications.js +15 -0
- package/core/error-code-registry.d.ts +15 -0
- package/core/error-code-registry.d.ts.map +1 -1
- package/core/error-code-registry.js +15 -0
- package/core/error-envelope.d.ts +31 -0
- package/core/error-envelope.d.ts.map +1 -1
- package/core/error-envelope.js +11 -0
- package/core/errors.d.ts +15 -3
- package/core/errors.d.ts.map +1 -1
- package/core/errors.js +254 -2
- package/core/geometry-input-sr.d.ts +3 -0
- package/core/geometry-input-sr.d.ts.map +1 -0
- package/core/geometry-input-sr.js +28 -0
- package/core/geoservices.d.ts.map +1 -1
- package/core/geoservices.js +33 -6
- package/core/grpc-adapter.d.ts +2 -2
- package/core/grpc-adapter.d.ts.map +1 -1
- package/core/grpc-adapter.js +41 -9
- package/core/job-run-errors.d.ts +10 -0
- package/core/job-run-errors.d.ts.map +1 -0
- package/core/job-run-errors.js +14 -0
- package/core/job-run-lifecycle.d.ts +34 -0
- package/core/job-run-lifecycle.d.ts.map +1 -0
- package/core/job-run-lifecycle.js +193 -0
- package/core/ogc-processes.d.ts +38 -31
- package/core/ogc-processes.d.ts.map +1 -1
- package/core/ogc-processes.js +123 -173
- package/core/pbf-decoder.d.ts.map +1 -1
- package/core/pbf-decoder.js +16 -4
- package/core/process-runner.js +15 -100
- package/core/protocol-transport.d.ts +6 -1
- package/core/protocol-transport.d.ts.map +1 -1
- package/core/request-pipeline.d.ts +6 -3
- package/core/request-pipeline.d.ts.map +1 -1
- package/core/request-pipeline.js +28 -11
- package/core/spatial-filter.d.ts +4 -4
- package/core/spatial-filter.d.ts.map +1 -1
- package/core/spatial-filter.js +7 -7
- package/core/surfaces.d.ts +2 -8
- package/core/surfaces.d.ts.map +1 -1
- package/core/surfaces.js +21 -112
- package/core/types.d.ts +21 -9
- package/core/types.d.ts.map +1 -1
- package/esri-compat/class-breaks-renderer.d.ts +2 -0
- package/esri-compat/class-breaks-renderer.d.ts.map +1 -1
- package/esri-compat/class-breaks-renderer.js +7 -0
- package/esri-compat/controls.d.ts +10 -1
- package/esri-compat/controls.d.ts.map +1 -1
- package/esri-compat/controls.js +86 -2
- package/esri-compat/directions.d.ts +35 -0
- package/esri-compat/directions.d.ts.map +1 -1
- package/esri-compat/directions.js +153 -2
- package/esri-compat/expand.d.ts +1 -0
- package/esri-compat/expand.d.ts.map +1 -1
- package/esri-compat/expand.js +61 -0
- package/esri-compat/feature-layer.d.ts +29 -4
- package/esri-compat/feature-layer.d.ts.map +1 -1
- package/esri-compat/feature-layer.js +335 -13
- package/esri-compat/geometry-engine.d.ts +4 -0
- package/esri-compat/geometry-engine.d.ts.map +1 -1
- package/esri-compat/geometry-engine.js +8 -1
- package/esri-compat/graphic.d.ts +7 -4
- package/esri-compat/graphic.d.ts.map +1 -1
- package/esri-compat/legend.d.ts +2 -1
- package/esri-compat/legend.d.ts.map +1 -1
- package/esri-compat/legend.js +15 -0
- package/esri-compat/map-view-mount.d.ts +48 -0
- package/esri-compat/map-view-mount.d.ts.map +1 -0
- package/esri-compat/map-view-mount.js +344 -0
- package/esri-compat/map-view.d.ts +38 -6
- package/esri-compat/map-view.d.ts.map +1 -1
- package/esri-compat/map-view.js +467 -33
- package/esri-compat/portal.d.ts +2 -0
- package/esri-compat/portal.d.ts.map +1 -1
- package/esri-compat/portal.js +7 -2
- package/esri-compat/renderer-objects.d.ts +7 -2
- package/esri-compat/renderer-objects.d.ts.map +1 -1
- package/esri-compat/renderer-objects.js +16 -5
- package/esri-compat/route-layer.d.ts +8 -0
- package/esri-compat/route-layer.d.ts.map +1 -1
- package/esri-compat/route-layer.js +24 -4
- package/esri-compat/route-task.d.ts +5 -1
- package/esri-compat/route-task.d.ts.map +1 -1
- package/esri-compat/route-task.js +119 -7
- package/esri-compat/scene-view.d.ts.map +1 -1
- package/esri-compat/scene-view.js +1 -0
- package/esri-compat/search.d.ts +2 -1
- package/esri-compat/search.d.ts.map +1 -1
- package/esri-compat/search.js +52 -2
- package/esri-compat/unique-value-renderer.d.ts +2 -0
- package/esri-compat/unique-value-renderer.d.ts.map +1 -1
- package/esri-compat/unique-value-renderer.js +7 -0
- package/esri-compat/web-map.d.ts +10 -0
- package/esri-compat/web-map.d.ts.map +1 -1
- package/esri-compat/web-map.js +102 -0
- package/gen/geospatial/v1/common_pb.d.ts +514 -0
- package/gen/geospatial/v1/common_pb.d.ts.map +1 -0
- package/gen/geospatial/v1/common_pb.js +335 -0
- package/gen/geospatial/v1/execution_types_pb.d.ts +1186 -0
- package/gen/geospatial/v1/execution_types_pb.d.ts.map +1 -0
- package/gen/geospatial/v1/execution_types_pb.js +396 -0
- package/gen/geospatial/v1/feature_service_pb.d.ts +403 -0
- package/gen/geospatial/v1/feature_service_pb.d.ts.map +1 -0
- package/gen/geospatial/v1/feature_service_pb.js +47 -0
- package/gen/geospatial/v1/index.d.ts +5 -0
- package/gen/geospatial/v1/index.d.ts.map +1 -0
- package/gen/geospatial/v1/index.js +9 -0
- package/gen/geospatial/v1/spatial_types_pb.d.ts +285 -0
- package/gen/geospatial/v1/spatial_types_pb.d.ts.map +1 -0
- package/gen/geospatial/v1/spatial_types_pb.js +58 -0
- package/gen/geospatial/v1/workspace_artifact_types_pb.d.ts +379 -0
- package/gen/geospatial/v1/workspace_artifact_types_pb.d.ts.map +1 -0
- package/gen/geospatial/v1/workspace_artifact_types_pb.js +151 -0
- package/generated-app/projection.d.ts.map +1 -1
- package/generated-app/projection.js +10 -1
- package/map/webmap-maplibre.d.ts +2 -1
- package/map/webmap-maplibre.d.ts.map +1 -1
- package/map/webmap-maplibre.js +3 -0
- package/package.json +3 -3
- package/query-planner/geoservices.d.ts.map +1 -1
- package/query-planner/geoservices.js +2 -0
- package/query-planner/grpc.d.ts +4 -4
- package/query-planner/grpc.d.ts.map +1 -1
- package/query-planner/grpc.js +11 -11
- package/query-planner/types.d.ts +6 -4
- package/query-planner/types.d.ts.map +1 -1
- package/realtime/honua-server.d.ts +4 -0
- package/realtime/honua-server.d.ts.map +1 -1
- package/realtime/honua-server.js +10 -0
- package/realtime/resumable.js +9 -0
- package/realtime/types.d.ts +8 -0
- package/realtime/types.d.ts.map +1 -1
- package/runtime/errors.d.ts +1 -1
- package/runtime/errors.d.ts.map +1 -1
- package/runtime/errors.js +2 -0
- package/runtime/generated/map-package-schema-meta.d.ts +11 -0
- package/runtime/generated/map-package-schema-meta.d.ts.map +1 -0
- package/runtime/generated/map-package-schema-meta.js +12 -0
- package/runtime/generated/map-package-schema-validator.d.ts +16 -0
- package/runtime/generated/map-package-schema-validator.d.ts.map +1 -0
- package/runtime/generated/map-package-schema-validator.js +1422 -0
- package/runtime/index.d.ts +5 -1
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +6 -0
- package/runtime/map-package-export.d.ts +151 -0
- package/runtime/map-package-export.d.ts.map +1 -0
- package/runtime/map-package-export.js +636 -0
- package/runtime/map-package-validation.d.ts +21 -1
- package/runtime/map-package-validation.d.ts.map +1 -1
- package/runtime/map-package-validation.js +132 -95
- package/runtime/map-package.d.ts +80 -0
- package/runtime/map-package.d.ts.map +1 -1
- package/studio/capability-manifest.d.ts +10 -0
- package/studio/capability-manifest.d.ts.map +1 -1
- package/studio/capability-manifest.js +38 -0
- package/studio/chart-spec.d.ts +6 -6
- package/studio/chart-spec.d.ts.map +1 -1
- package/studio/chart-spec.js +6 -6
- package/studio/command-adapter.d.ts +35 -0
- package/studio/command-adapter.d.ts.map +1 -0
- package/studio/command-adapter.js +36 -0
- package/studio/generated/studio-api.d.ts +1062 -0
- package/studio/generated/studio-api.d.ts.map +1 -0
- package/studio/generated/studio-api.js +4 -0
- package/studio/index.d.ts +25 -13
- package/studio/index.d.ts.map +1 -1
- package/studio/index.js +21 -10
- package/studio/lifecycle-client.d.ts +262 -22
- package/studio/lifecycle-client.d.ts.map +1 -1
- package/studio/lifecycle-client.js +543 -24
- package/studio/lifecycle-errors.d.ts +8 -2
- package/studio/lifecycle-errors.d.ts.map +1 -1
- package/studio/lifecycle-errors.js +6 -1
- package/studio/lifecycle-types.d.ts +237 -38
- package/studio/lifecycle-types.d.ts.map +1 -1
- package/studio/lifecycle-types.js +5 -12
- package/studio/publication-status.d.ts +55 -0
- package/studio/publication-status.d.ts.map +1 -0
- package/studio/publication-status.js +103 -0
- package/studio/types.d.ts +37 -7
- package/studio/types.d.ts.map +1 -1
- package/studio/types.js +5 -3
- package/studio/validate.d.ts.map +1 -1
- package/studio/validate.js +104 -7
- package/style/renderers.d.ts +6 -1
- package/style/renderers.d.ts.map +1 -1
- package/style/renderers.js +11 -6
- package/style/visual-variables.d.ts +43 -0
- package/style/visual-variables.d.ts.map +1 -0
- package/style/visual-variables.js +183 -0
- package/webmap/convert-layer.d.ts +2 -1
- package/webmap/convert-layer.d.ts.map +1 -1
- package/webmap/convert-layer.js +20 -3
- package/webmap/convert-renderer.d.ts +10 -3
- package/webmap/convert-renderer.d.ts.map +1 -1
- package/webmap/convert-renderer.js +190 -36
- package/webmap/index.d.ts +1 -0
- package/webmap/index.d.ts.map +1 -1
- package/webmap/parse.d.ts +2 -1
- package/webmap/parse.d.ts.map +1 -1
- package/webmap/parse.js +1 -1
- package/gen/honua/v1/feature_service_pb.d.ts +0 -918
- package/gen/honua/v1/feature_service_pb.d.ts.map +0 -1
- package/gen/honua/v1/feature_service_pb.js +0 -375
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural validation for command inputs.
|
|
3
|
+
*
|
|
4
|
+
* Commands describe their input with the JSON-Schema subset in `./types.js`,
|
|
5
|
+
* the same dialect `src/agent-tools/index.ts` uses for agent tool definitions.
|
|
6
|
+
* That one description drives CLI argument checking, MCP tool schemas, Studio
|
|
7
|
+
* forms, and this validator — so an input rejected by one transport is
|
|
8
|
+
* rejected identically by all of them.
|
|
9
|
+
*
|
|
10
|
+
* The validator covers exactly the keywords the dialect declares. It is not a
|
|
11
|
+
* general JSON-Schema implementation and deliberately adds no dependency;
|
|
12
|
+
* `src/` is zod-free.
|
|
13
|
+
*
|
|
14
|
+
* @experimental
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Validate `value` against `schema`, returning every finding.
|
|
19
|
+
*
|
|
20
|
+
* `additionalProperties: false` is the load-bearing rule for the security
|
|
21
|
+
* contract: a closed input schema is why no transport can smuggle an approval
|
|
22
|
+
* or authority field into a shared command.
|
|
23
|
+
*/
|
|
24
|
+
export function validateCommandInput(schema, value) {
|
|
25
|
+
const issues = [];
|
|
26
|
+
validateNode(schema, value, "", issues);
|
|
27
|
+
return issues;
|
|
28
|
+
}
|
|
29
|
+
function validateNode(schema, value, path, issues) {
|
|
30
|
+
if (schema.type !== undefined && !matchesType(schema.type, value)) {
|
|
31
|
+
issues.push({ path, message: `expected type ${formatType(schema.type)}, received ${describe(value)}` });
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (schema.enum !== undefined && !schema.enum.some((allowed) => Object.is(allowed, value))) {
|
|
35
|
+
issues.push({ path, message: `expected one of ${schema.enum.map((entry) => JSON.stringify(entry)).join(", ")}` });
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (typeof value === "string")
|
|
39
|
+
validateString(schema, value, path, issues);
|
|
40
|
+
if (typeof value === "number")
|
|
41
|
+
validateNumber(schema, value, path, issues);
|
|
42
|
+
if (Array.isArray(value)) {
|
|
43
|
+
if (schema.items) {
|
|
44
|
+
value.forEach((entry, index) => validateNode(schema.items, entry, `${path}[${index}]`, issues));
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (isPlainRecord(value))
|
|
49
|
+
validateObject(schema, value, path, issues);
|
|
50
|
+
}
|
|
51
|
+
function validateString(schema, value, path, issues) {
|
|
52
|
+
if (schema.minLength !== undefined && value.length < schema.minLength) {
|
|
53
|
+
issues.push({ path, message: `expected at least ${schema.minLength} character(s)` });
|
|
54
|
+
}
|
|
55
|
+
if (schema.maxLength !== undefined && value.length > schema.maxLength) {
|
|
56
|
+
issues.push({ path, message: `expected at most ${schema.maxLength} character(s)` });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function validateNumber(schema, value, path, issues) {
|
|
60
|
+
if (schema.minimum !== undefined && value < schema.minimum) {
|
|
61
|
+
issues.push({ path, message: `expected >= ${schema.minimum}` });
|
|
62
|
+
}
|
|
63
|
+
if (schema.maximum !== undefined && value > schema.maximum) {
|
|
64
|
+
issues.push({ path, message: `expected <= ${schema.maximum}` });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function validateObject(schema, value, path, issues) {
|
|
68
|
+
const properties = schema.properties ?? {};
|
|
69
|
+
for (const required of schema.required ?? []) {
|
|
70
|
+
if (value[required] === undefined) {
|
|
71
|
+
issues.push({ path: join(path, required), message: "is required" });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
for (const [key, child] of Object.entries(value)) {
|
|
75
|
+
if (child === undefined)
|
|
76
|
+
continue;
|
|
77
|
+
const propertySchema = properties[key];
|
|
78
|
+
if (propertySchema) {
|
|
79
|
+
validateNode(propertySchema, child, join(path, key), issues);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (schema.additionalProperties === false) {
|
|
83
|
+
issues.push({ path: join(path, key), message: "is not an accepted property of this command" });
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (typeof schema.additionalProperties === "object") {
|
|
87
|
+
validateNode(schema.additionalProperties, child, join(path, key), issues);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function matchesType(type, value) {
|
|
92
|
+
const types = typeof type === "string" ? [type] : type;
|
|
93
|
+
return types.some((entry) => matchesSingleType(entry, value));
|
|
94
|
+
}
|
|
95
|
+
function matchesSingleType(type, value) {
|
|
96
|
+
switch (type) {
|
|
97
|
+
case "string":
|
|
98
|
+
return typeof value === "string";
|
|
99
|
+
case "number":
|
|
100
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
101
|
+
case "integer":
|
|
102
|
+
return typeof value === "number" && Number.isInteger(value);
|
|
103
|
+
case "boolean":
|
|
104
|
+
return typeof value === "boolean";
|
|
105
|
+
case "array":
|
|
106
|
+
return Array.isArray(value);
|
|
107
|
+
case "object":
|
|
108
|
+
return isPlainRecord(value);
|
|
109
|
+
case "null":
|
|
110
|
+
return value === null;
|
|
111
|
+
default:
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function formatType(type) {
|
|
116
|
+
return typeof type === "string" ? type : type.join(" | ");
|
|
117
|
+
}
|
|
118
|
+
function describe(value) {
|
|
119
|
+
if (value === null)
|
|
120
|
+
return "null";
|
|
121
|
+
if (value === undefined)
|
|
122
|
+
return "undefined";
|
|
123
|
+
if (Array.isArray(value))
|
|
124
|
+
return "array";
|
|
125
|
+
return typeof value;
|
|
126
|
+
}
|
|
127
|
+
function isPlainRecord(value) {
|
|
128
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
129
|
+
}
|
|
130
|
+
function join(path, key) {
|
|
131
|
+
return path ? `${path}.${key}` : key;
|
|
132
|
+
}
|