@honua/react 0.1.2-beta.0 → 0.1.4-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/contract/discovery.d.ts +34 -0
- package/contract/discovery.d.ts.map +1 -1
- package/contract/index.d.ts +7 -5
- package/contract/index.d.ts.map +1 -1
- package/contract/index.js +3 -2
- package/contract/pmtiles.d.ts +10 -1
- package/contract/pmtiles.d.ts.map +1 -1
- package/contract/pmtiles.js +10 -2
- package/contract/protocol-module.d.ts +84 -9
- package/contract/protocol-module.d.ts.map +1 -1
- package/contract/query-filter-fes.d.ts +18 -0
- package/contract/query-filter-fes.d.ts.map +1 -0
- package/contract/query-filter-fes.js +122 -0
- package/contract/query-filter.d.ts +300 -0
- package/contract/query-filter.d.ts.map +1 -0
- package/contract/query-filter.js +883 -0
- package/contract/schema.d.ts +12 -0
- package/contract/schema.d.ts.map +1 -1
- package/contract/schema.js +34 -0
- package/contract/source-capability-support.d.ts.map +1 -1
- package/contract/source-capability-support.js +15 -3
- package/contract/source.d.ts +45 -25
- package/contract/source.d.ts.map +1 -1
- package/contract/source.js +719 -479
- package/contract/types.d.ts +87 -18
- package/contract/types.d.ts.map +1 -1
- package/contract/widget-source.d.ts.map +1 -1
- package/core/client.d.ts +45 -21
- package/core/client.d.ts.map +1 -1
- package/core/client.js +224 -46
- package/core/error-classifications.d.ts +6 -0
- package/core/error-classifications.d.ts.map +1 -1
- package/core/error-classifications.js +6 -0
- package/core/error-code-registry.d.ts +6 -0
- package/core/error-code-registry.d.ts.map +1 -1
- package/core/error-code-registry.js +6 -0
- package/core/error-envelope.js +2 -0
- package/core/errors.d.ts +1 -1
- package/core/errors.js +1 -1
- package/core/geoparquet-sql.d.ts +68 -4
- package/core/geoparquet-sql.d.ts.map +1 -1
- package/core/geoparquet-sql.js +325 -8
- package/core/odata-write-codec.d.ts.map +1 -1
- package/core/odata-write-codec.js +0 -1
- package/core/odata.d.ts +6 -0
- package/core/odata.d.ts.map +1 -1
- package/core/odata.js +6 -1
- package/core/ogc-processes.d.ts +182 -25
- package/core/ogc-processes.d.ts.map +1 -1
- package/core/ogc-processes.js +602 -30
- package/core/process-runner.d.ts +8 -1
- package/core/process-runner.d.ts.map +1 -1
- package/core/process-runner.js +1 -0
- package/core/protocol-transport.d.ts +2 -0
- package/core/protocol-transport.d.ts.map +1 -1
- package/core/stac.d.ts +31 -0
- package/core/stac.d.ts.map +1 -1
- package/core/stac.js +136 -19
- package/core/surfaces.d.ts.map +1 -1
- package/core/surfaces.js +273 -68
- package/core/types.d.ts +123 -9
- package/core/types.d.ts.map +1 -1
- package/core/wfs-axis-order.d.ts +18 -0
- package/core/wfs-axis-order.d.ts.map +1 -0
- package/core/wfs-axis-order.js +108 -0
- package/core/wfs-capabilities.d.ts +65 -24
- package/core/wfs-capabilities.d.ts.map +1 -1
- package/core/wfs-capabilities.js +237 -27
- package/core/wfs-filter.d.ts +26 -3
- package/core/wfs-filter.d.ts.map +1 -1
- package/core/wfs-filter.js +48 -53
- package/core/wfs-protocol-error.d.ts +12 -0
- package/core/wfs-protocol-error.d.ts.map +1 -0
- package/core/wfs-protocol-error.js +13 -0
- package/core/wfs.d.ts +53 -1
- package/core/wfs.d.ts.map +1 -1
- package/core/wfs.js +251 -29
- package/core/wms-feature-info.d.ts +92 -0
- package/core/wms-feature-info.d.ts.map +1 -0
- package/core/wms-feature-info.js +285 -0
- package/core/wms.d.ts +9 -0
- package/core/wms.d.ts.map +1 -1
- package/core/wms.js +17 -5
- package/esri-compat/event-bus.d.ts +20 -0
- package/esri-compat/event-bus.d.ts.map +1 -1
- package/esri-compat/feature-filter.d.ts +46 -1
- package/esri-compat/feature-filter.d.ts.map +1 -1
- package/esri-compat/feature-filter.js +49 -0
- package/esri-compat/geojson-layer.d.ts +4 -2
- package/esri-compat/geojson-layer.d.ts.map +1 -1
- package/esri-compat/geojson-layer.js +4 -2
- package/esri-compat/identity-manager.js +2 -2
- package/esri-compat/imagery-layer.d.ts +2 -1
- package/esri-compat/imagery-layer.d.ts.map +1 -1
- package/esri-compat/imagery-layer.js +2 -1
- package/esri-compat/layer-list.d.ts +8 -1
- package/esri-compat/layer-list.d.ts.map +1 -1
- package/esri-compat/layer-list.js +11 -4
- package/esri-compat/legend.d.ts.map +1 -1
- package/esri-compat/legend.js +1 -1
- package/esri-compat/locator.d.ts +297 -0
- package/esri-compat/locator.d.ts.map +1 -0
- package/esri-compat/locator.js +579 -0
- package/esri-compat/map-image-layer.d.ts.map +1 -1
- package/esri-compat/map-view.d.ts.map +1 -1
- package/esri-compat/map-view.js +1 -1
- package/esri-compat/scene-view.d.ts.map +1 -1
- package/esri-compat/time-slider.d.ts +29 -0
- package/esri-compat/time-slider.d.ts.map +1 -1
- package/esri-compat/time-slider.js +117 -0
- package/esri-compat/wfs-layer.d.ts +2 -1
- package/esri-compat/wfs-layer.d.ts.map +1 -1
- package/esri-compat/wfs-layer.js +2 -1
- package/esri-compat/widget-host.d.ts +42 -6
- package/esri-compat/widget-host.d.ts.map +1 -1
- package/esri-compat/widget-host.js +99 -10
- package/generated-app/projection.d.ts.map +1 -1
- package/generated-app/runtime.d.ts.map +1 -1
- package/map/data-to-map-bridge.d.ts +1 -1
- package/map/data-to-map-bridge.d.ts.map +1 -1
- package/map/data-to-map-bridge.js +1 -2
- package/map/honua-map.d.ts.map +1 -1
- package/map/honua-map.js +1 -1
- package/map/index.d.ts +2 -0
- package/map/index.d.ts.map +1 -1
- package/map/index.js +2 -0
- package/map/realtime-reconciliation-adapter.d.ts +98 -0
- package/map/realtime-reconciliation-adapter.d.ts.map +1 -0
- package/map/realtime-reconciliation-adapter.js +84 -0
- package/map/temporal-playback.d.ts +25 -0
- package/map/temporal-playback.d.ts.map +1 -1
- package/map/temporal-playback.js +29 -1
- package/package.json +4 -3
- package/query-planner/canonical-filter.d.ts +30 -0
- package/query-planner/canonical-filter.d.ts.map +1 -0
- package/query-planner/canonical-filter.js +30 -0
- package/query-planner/columnar-plan.d.ts +63 -0
- package/query-planner/columnar-plan.d.ts.map +1 -0
- package/query-planner/columnar-plan.js +94 -0
- package/query-planner/diagnostics.d.ts +3 -3
- package/query-planner/diagnostics.d.ts.map +1 -1
- package/query-planner/diagnostics.js +17 -4
- package/query-planner/duckdb.d.ts.map +1 -1
- package/query-planner/duckdb.js +16 -2
- package/query-planner/execution-context.d.ts.map +1 -1
- package/query-planner/execution-context.js +3 -1
- package/query-planner/executor.d.ts.map +1 -1
- package/query-planner/executor.js +7 -1
- package/query-planner/geoservices.d.ts.map +1 -1
- package/query-planner/geoservices.js +24 -5
- package/query-planner/grpc.d.ts.map +1 -1
- package/query-planner/grpc.js +29 -5
- package/query-planner/index.d.ts +20 -5
- package/query-planner/index.d.ts.map +1 -1
- package/query-planner/index.js +16 -3
- package/query-planner/ir.d.ts +6 -1
- package/query-planner/ir.d.ts.map +1 -1
- package/query-planner/ir.js +63 -1
- package/query-planner/odata-protocol-module.d.ts +54 -0
- package/query-planner/odata-protocol-module.d.ts.map +1 -0
- package/query-planner/odata-protocol-module.js +199 -0
- package/query-planner/odata-v1.d.ts +23 -0
- package/query-planner/odata-v1.d.ts.map +1 -0
- package/query-planner/odata-v1.js +202 -0
- package/query-planner/odata.d.ts +0 -3
- package/query-planner/odata.d.ts.map +1 -1
- package/query-planner/odata.js +0 -143
- package/query-planner/ogc-features.d.ts.map +1 -1
- package/query-planner/ogc-features.js +23 -1
- package/query-planner/planner.d.ts +2 -2
- package/query-planner/planner.d.ts.map +1 -1
- package/query-planner/planner.js +146 -27
- package/query-planner/representation.d.ts +59 -0
- package/query-planner/representation.d.ts.map +1 -0
- package/query-planner/representation.js +140 -0
- package/query-planner/types.d.ts +153 -3
- package/query-planner/types.d.ts.map +1 -1
- package/query-planner/wfs-protocol-module.d.ts +57 -0
- package/query-planner/wfs-protocol-module.d.ts.map +1 -0
- package/query-planner/wfs-protocol-module.js +731 -0
- package/query-planner/wfs-v1.d.ts +41 -0
- package/query-planner/wfs-v1.d.ts.map +1 -0
- package/query-planner/wfs-v1.js +366 -0
- package/query-planner/wfs.d.ts +1 -3
- package/query-planner/wfs.d.ts.map +1 -1
- package/query-planner/wfs.js +1 -70
- package/react/honua-map.d.ts +3 -1
- package/react/honua-map.d.ts.map +1 -1
- package/react/honua-map.js +11 -1
- package/react/hooks.d.ts +1 -1
- package/react/hooks.js +1 -1
- package/react/selection.d.ts.map +1 -1
- package/react/selection.js +0 -0
- package/react/use-mounted-source.d.ts +1 -1
- package/react/use-mounted-source.js +1 -1
- package/realtime/checkpoint-store.d.ts +206 -0
- package/realtime/checkpoint-store.d.ts.map +1 -0
- package/realtime/checkpoint-store.js +504 -0
- package/realtime/contract.d.ts +142 -0
- package/realtime/contract.d.ts.map +1 -0
- package/realtime/contract.js +154 -0
- package/realtime/exploration.d.ts +16 -0
- package/realtime/exploration.d.ts.map +1 -0
- package/realtime/exploration.js +32 -0
- package/realtime/honua-server.d.ts +131 -0
- package/realtime/honua-server.d.ts.map +1 -0
- package/realtime/honua-server.js +302 -0
- package/realtime/index.d.ts +39 -0
- package/realtime/index.d.ts.map +1 -0
- package/realtime/index.js +26 -0
- package/realtime/odata-delta.d.ts +114 -0
- package/realtime/odata-delta.d.ts.map +1 -0
- package/realtime/odata-delta.js +483 -0
- package/realtime/projections.d.ts +30 -0
- package/realtime/projections.d.ts.map +1 -0
- package/realtime/projections.js +51 -0
- package/realtime/reconciliation.d.ts +245 -0
- package/realtime/reconciliation.d.ts.map +1 -0
- package/realtime/reconciliation.js +377 -0
- package/realtime/reducer.d.ts +14 -0
- package/realtime/reducer.d.ts.map +1 -0
- package/realtime/reducer.js +351 -0
- package/realtime/resumable-transport.d.ts +111 -0
- package/realtime/resumable-transport.d.ts.map +1 -0
- package/realtime/resumable-transport.js +406 -0
- package/realtime/resumable.d.ts +104 -0
- package/realtime/resumable.d.ts.map +1 -0
- package/realtime/resumable.js +632 -0
- package/realtime/sse.d.ts +23 -0
- package/realtime/sse.d.ts.map +1 -0
- package/realtime/sse.js +147 -0
- package/realtime/store.d.ts +18 -0
- package/realtime/store.d.ts.map +1 -0
- package/realtime/store.js +63 -0
- package/realtime/types.d.ts +190 -0
- package/realtime/types.d.ts.map +1 -0
- package/realtime/types.js +10 -0
- package/realtime/websocket.d.ts +60 -0
- package/realtime/websocket.d.ts.map +1 -0
- package/realtime/websocket.js +157 -0
- package/realtime/wire.d.ts +28 -0
- package/realtime/wire.d.ts.map +1 -0
- package/realtime/wire.js +73 -0
- package/runtime/index.d.ts +6 -2
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +3 -1
- package/runtime/load-package.d.ts +24 -0
- package/runtime/load-package.d.ts.map +1 -1
- package/runtime/load-package.js +45 -1
- package/runtime/maplibre-renderer.d.ts +11 -0
- package/runtime/maplibre-renderer.d.ts.map +1 -1
- package/runtime/maplibre-renderer.js +32 -7
- package/runtime/offline-region-protocol.d.ts +73 -0
- package/runtime/offline-region-protocol.d.ts.map +1 -0
- package/runtime/offline-region-protocol.js +63 -0
- package/runtime/offline-region-style.d.ts +78 -0
- package/runtime/offline-region-style.d.ts.map +1 -0
- package/runtime/offline-region-style.js +147 -0
- package/runtime/pmtiles-protocol.d.ts +7 -8
- package/runtime/pmtiles-protocol.d.ts.map +1 -1
- package/runtime/pmtiles-protocol.js +19 -66
- package/runtime/protocol-registry.d.ts +55 -0
- package/runtime/protocol-registry.d.ts.map +1 -0
- package/runtime/protocol-registry.js +103 -0
- package/runtime/runtime.d.ts +2 -0
- package/runtime/runtime.d.ts.map +1 -1
- package/runtime/runtime.js +6 -1
- package/studio/index.d.ts +24 -7
- package/studio/index.d.ts.map +1 -1
- package/studio/index.js +21 -7
- package/studio/lifecycle-client.d.ts +164 -0
- package/studio/lifecycle-client.d.ts.map +1 -0
- package/studio/lifecycle-client.js +299 -0
- package/studio/lifecycle-errors.d.ts +91 -0
- package/studio/lifecycle-errors.d.ts.map +1 -0
- package/studio/lifecycle-errors.js +77 -0
- package/studio/lifecycle-types.d.ts +321 -0
- package/studio/lifecycle-types.d.ts.map +1 -0
- package/studio/lifecycle-types.js +22 -0
- package/webmap/convert-label.js +0 -1
- package/webmap/convert-symbol.d.ts.map +1 -1
package/runtime/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,OAAO,EAA8B,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,yBAAyB,EAAE,qCAAqC,EAAE,MAAM,yBAAyB,CAAC;AAGhH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEtH,OAAO,KAAK,EAEV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EAElB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAAgB,MAAM,WAAW,CAAC;AAE9D,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/runtime/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,OAAO,EAA8B,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,yBAAyB,EAAE,qCAAqC,EAAE,MAAM,yBAAyB,CAAC;AAGhH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE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,IAAI,CAAA;KAAE;IASlE,6DAA6D;IACtD,KAAK,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAI5C;;;;;;;;;;;;;OAaG;IACI,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAiBzD,OAAO,IAAI,IAAI;CAwRvB;AAiMD,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnF,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
package/runtime/runtime.js
CHANGED
|
@@ -613,6 +613,7 @@ export class HonuaMapRuntime {
|
|
|
613
613
|
}
|
|
614
614
|
setViewState(view) {
|
|
615
615
|
this.#assertLive();
|
|
616
|
+
const reducedMotion = this.prefersReducedMotion();
|
|
616
617
|
const bbox = view.bbox ?? this.#packageRef.current.initialView?.bbox;
|
|
617
618
|
if (view.bbox && this.map.fitBounds) {
|
|
618
619
|
const [west, south, east, north] = view.bbox;
|
|
@@ -620,7 +621,7 @@ export class HonuaMapRuntime {
|
|
|
620
621
|
[west, south],
|
|
621
622
|
[east, north],
|
|
622
623
|
], {
|
|
623
|
-
animate: view.animate ?? false,
|
|
624
|
+
animate: reducedMotion ? false : (view.animate ?? false),
|
|
624
625
|
...(view.padding !== undefined ? { padding: view.padding } : {}),
|
|
625
626
|
});
|
|
626
627
|
return;
|
|
@@ -642,6 +643,10 @@ export class HonuaMapRuntime {
|
|
|
642
643
|
], { animate: false });
|
|
643
644
|
}
|
|
644
645
|
}
|
|
646
|
+
prefersReducedMotion() {
|
|
647
|
+
const view = this.map.getContainer?.().ownerDocument.defaultView;
|
|
648
|
+
return view?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
|
|
649
|
+
}
|
|
645
650
|
/**
|
|
646
651
|
* Diff the current package against `next`. Applies the change
|
|
647
652
|
* incrementally when safe; falls back to `map.setStyle` for structural
|
package/studio/index.d.ts
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@honua/sdk-js/studio` — browser-safe TypeScript projections, validation and
|
|
3
|
-
* preview envelopes, capability-manifest types,
|
|
4
|
-
* contracts for the Studio
|
|
3
|
+
* preview envelopes, capability-manifest types, publish/share/embed
|
|
4
|
+
* contracts, and a full typed package-lifecycle client for the Studio
|
|
5
|
+
* package families.
|
|
5
6
|
*
|
|
6
|
-
* This barrel is intentionally MCP/QGIS-safe: it exports only types
|
|
7
|
-
* functions and
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* This barrel is intentionally MCP/QGIS-safe: it exports only types, pure
|
|
8
|
+
* functions, and one typed HTTP client built on the SDK's standard
|
|
9
|
+
* {@link HonuaClient} transport, and never imports from `operator`,
|
|
10
|
+
* `esri-compat`, `web-components`, `interactions`, or `realtime` (which pull
|
|
11
|
+
* in MapLibre / DOM code). The established `map` and `dashboard`/`app` shapes
|
|
12
|
+
* are re-exported from their leaf modules so consumers reach every family
|
|
13
|
+
* from one import path.
|
|
14
|
+
*
|
|
15
|
+
* {@link HonuaStudioLifecycleClient} (`./lifecycle-client.js`) covers every
|
|
16
|
+
* endpoint in `honua-server`'s Studio package lifecycle API
|
|
17
|
+
* (`/api/v{version}/studio`): package-family discovery, draft CRUD with
|
|
18
|
+
* optimistic-generation checking, validate, preview-plan, immutable content
|
|
19
|
+
* versions and comparisons, publish requests, reopen, and rollback requests.
|
|
20
|
+
* See that module's doc comment for the documented enumeration-endpoint gap
|
|
21
|
+
* (`honua-server#3003`) and how the client absorbs it without a breaking
|
|
22
|
+
* change.
|
|
11
23
|
*
|
|
12
24
|
* @experimental This entrypoint is not yet covered by the SDK's semver contract
|
|
13
25
|
* — the surface may change in any minor release prior to `1.0.0`, and the
|
|
@@ -31,4 +43,9 @@ export { HONUA_MAP_PACKAGE_FORMAT_V1 } from "../runtime/map-package.js";
|
|
|
31
43
|
export type { HonuaMapPackage, HonuaMapPackageFormat } from "../runtime/map-package.js";
|
|
32
44
|
export { HONUA_GENERATED_APP_MANIFEST_FORMAT_V1 } from "../generated-app/manifest.js";
|
|
33
45
|
export type { HonuaGeneratedAppManifest, HonuaGeneratedAppPackage } from "../generated-app/manifest.js";
|
|
46
|
+
export { HONUA_STUDIO_PROBLEM_TYPE, HonuaStudioError, classifyStudioProblemStatus, isHonuaStudioError, isHonuaStudioGenerationConflict, } from "./lifecycle-errors.js";
|
|
47
|
+
export type { HonuaStudioProblemDetails, HonuaStudioProblemKind } from "./lifecycle-errors.js";
|
|
48
|
+
export type { StudioApiResponse, StudioBindingRef, StudioContentItemPointers, StudioContentVersion, StudioContentVersionListResponse, StudioDependencyRef, StudioPackageDraft, StudioPackageDraftCreateRequest, StudioPackageDraftReplaceRequest, StudioPackageEnvelope, StudioPackageFamilyCapabilities, StudioPackageFamilyCapability, StudioPackageFamilyOperation, StudioPackageFamilySupportLevel, StudioPersistenceMode, StudioPreviewPlan, StudioProvenanceRef, StudioPublicationIntent, StudioPublicationRequest, StudioPublicationRequestInput, StudioPublicationRequestStatus, StudioReopenVersionRequest, StudioRollbackPointer, StudioRollbackRequest, StudioRollbackRequestInput, StudioValidationDepth, StudioValidationStatus, StudioValidationSummary, StudioVersionComparison, StudioVersionComparisonDiff, StudioVersionComparisonRequest, } from "./lifecycle-types.js";
|
|
49
|
+
export { HONUA_STUDIO_LIFECYCLE_BASE_PATH, HonuaStudioContentVersionsClient, HonuaStudioDraftsClient, HonuaStudioLifecycleClient, HonuaStudioPackageFamiliesClient, HonuaStudioPublicationRequestsClient, HonuaStudioRollbackRequestsClient, createHonuaStudioLifecycleClient, } from "./lifecycle-client.js";
|
|
50
|
+
export type { HonuaStudioLifecycleClientOptions, HonuaStudioRawRequest, HonuaStudioRequestOptions, } from "./lifecycle-client.js";
|
|
34
51
|
//# sourceMappingURL=index.d.ts.map
|
package/studio/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/studio/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/studio/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,6BAA6B,EAC7B,8BAA8B,EAC9B,gCAAgC,EAChC,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AACvF,YAAY,EACV,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,EAC5B,+BAA+B,EAC/B,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACjF,YAAY,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EAAE,kCAAkC,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,E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E,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,oBAAoB,EACpB,gCAAgC,EAChC,mBAAmB,EACnB,kBAAkB,EAClB,+BAA+B,EAC/B,gCAAgC,EAChC,qBAAqB,EACrB,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,+BAA+B,EAC/B,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,gCAAgC,EAChC,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC1B,gCAAgC,EAChC,oCAAoC,EACpC,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,iCAAiC,EACjC,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC"}
|
package/studio/index.js
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@honua/sdk-js/studio` — browser-safe TypeScript projections, validation and
|
|
3
|
-
* preview envelopes, capability-manifest types,
|
|
4
|
-
* contracts for the Studio
|
|
3
|
+
* preview envelopes, capability-manifest types, publish/share/embed
|
|
4
|
+
* contracts, and a full typed package-lifecycle client for the Studio
|
|
5
|
+
* package families.
|
|
5
6
|
*
|
|
6
|
-
* This barrel is intentionally MCP/QGIS-safe: it exports only types
|
|
7
|
-
* functions and
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* This barrel is intentionally MCP/QGIS-safe: it exports only types, pure
|
|
8
|
+
* functions, and one typed HTTP client built on the SDK's standard
|
|
9
|
+
* {@link HonuaClient} transport, and never imports from `operator`,
|
|
10
|
+
* `esri-compat`, `web-components`, `interactions`, or `realtime` (which pull
|
|
11
|
+
* in MapLibre / DOM code). The established `map` and `dashboard`/`app` shapes
|
|
12
|
+
* are re-exported from their leaf modules so consumers reach every family
|
|
13
|
+
* from one import path.
|
|
14
|
+
*
|
|
15
|
+
* {@link HonuaStudioLifecycleClient} (`./lifecycle-client.js`) covers every
|
|
16
|
+
* endpoint in `honua-server`'s Studio package lifecycle API
|
|
17
|
+
* (`/api/v{version}/studio`): package-family discovery, draft CRUD with
|
|
18
|
+
* optimistic-generation checking, validate, preview-plan, immutable content
|
|
19
|
+
* versions and comparisons, publish requests, reopen, and rollback requests.
|
|
20
|
+
* See that module's doc comment for the documented enumeration-endpoint gap
|
|
21
|
+
* (`honua-server#3003`) and how the client absorbs it without a breaking
|
|
22
|
+
* change.
|
|
11
23
|
*
|
|
12
24
|
* @experimental This entrypoint is not yet covered by the SDK's semver contract
|
|
13
25
|
* — the surface may change in any minor release prior to `1.0.0`, and the
|
|
@@ -25,3 +37,5 @@ export { getCapability, getCapabilityReasonCode, hasCapability, hasPackageFamily
|
|
|
25
37
|
// no MapLibre/DOM runtime imports (their cross-module imports are type-only).
|
|
26
38
|
export { HONUA_MAP_PACKAGE_FORMAT_V1 } from "../runtime/map-package.js";
|
|
27
39
|
export { HONUA_GENERATED_APP_MANIFEST_FORMAT_V1 } from "../generated-app/manifest.js";
|
|
40
|
+
export { HONUA_STUDIO_PROBLEM_TYPE, HonuaStudioError, classifyStudioProblemStatus, isHonuaStudioError, isHonuaStudioGenerationConflict, } from "./lifecycle-errors.js";
|
|
41
|
+
export { HONUA_STUDIO_LIFECYCLE_BASE_PATH, HonuaStudioContentVersionsClient, HonuaStudioDraftsClient, HonuaStudioLifecycleClient, HonuaStudioPackageFamiliesClient, HonuaStudioPublicationRequestsClient, HonuaStudioRollbackRequestsClient, createHonuaStudioLifecycleClient, } from "./lifecycle-client.js";
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed client for the Studio package lifecycle API
|
|
3
|
+
* (`/api/v{version}/studio` in `honua-server`): package-family capability
|
|
4
|
+
* discovery, draft CRUD with optimistic-generation checking, validate,
|
|
5
|
+
* preview-plan, immutable content versions, version comparisons, publication
|
|
6
|
+
* requests, reopen, and rollback requests.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors {@link HonuaControlPlaneClient}'s ergonomics
|
|
9
|
+
* (`src/control-plane/client.ts`): construct with the SDK's standard
|
|
10
|
+
* {@link HonuaClient} (transport, auth, retry, and timeout are inherited from
|
|
11
|
+
* it), reach resource groups off the client instance
|
|
12
|
+
* (`.drafts`, `.contentVersions`, `.publicationRequests`, `.rollbackRequests`,
|
|
13
|
+
* `.packageFamilies`), and use `.raw()` for any endpoint that does not yet
|
|
14
|
+
* have a dedicated method.
|
|
15
|
+
*
|
|
16
|
+
* Every method throws {@link HonuaStudioError} on a non-2xx response — see
|
|
17
|
+
* `./lifecycle-errors.js` for the RFC 7807 problem-detail taxonomy and the
|
|
18
|
+
* `generation-conflict` discriminant.
|
|
19
|
+
*
|
|
20
|
+
* ## Enumeration gap
|
|
21
|
+
*
|
|
22
|
+
* The lifecycle API doc is explicit that **there is no endpoint to enumerate
|
|
23
|
+
* drafts or content items** — only single-resource reads
|
|
24
|
+
* (`GET /package-drafts/{draftId}`, `GET /content-items/{itemId}/versions`,
|
|
25
|
+
* `GET /content-items/{itemId}/versions/{versionId}`) and the
|
|
26
|
+
* family-discovery list (`GET /package-families`, which already returns every
|
|
27
|
+
* family in one response and does need no list method of its own).
|
|
28
|
+
* `honua-server#3003` tracks adding a draft/content-item enumeration
|
|
29
|
+
* endpoint. Until it ships:
|
|
30
|
+
*
|
|
31
|
+
* - `contentVersions.list(itemId)` already covers version enumeration *for a
|
|
32
|
+
* known item* — the gap is discovering `itemId`/`draftId` values in the
|
|
33
|
+
* first place, not paging a known collection.
|
|
34
|
+
* - `.raw()` reaches any endpoint honua-server adds before this client grows
|
|
35
|
+
* a dedicated method for it, without a breaking-change window.
|
|
36
|
+
* - When the enumeration endpoint ships, it is additive: a new
|
|
37
|
+
* `drafts.list(options)` (or a new resource group) can be added without
|
|
38
|
+
* touching any existing method signature.
|
|
39
|
+
*
|
|
40
|
+
* @module
|
|
41
|
+
*/
|
|
42
|
+
import type { HonuaClient } from "../core/client.js";
|
|
43
|
+
import type { QueryMethod } from "../core/types.js";
|
|
44
|
+
import type { StudioContentVersion, StudioContentVersionListResponse, StudioPackageDraft, StudioPackageDraftCreateRequest, StudioPackageDraftReplaceRequest, StudioPackageFamilyCapabilities, StudioPreviewPlan, StudioPublicationRequest, StudioPublicationRequestInput, StudioReopenVersionRequest, StudioRollbackRequest, StudioRollbackRequestInput, StudioValidationSummary, StudioVersionComparison, StudioVersionComparisonRequest } from "./lifecycle-types.js";
|
|
45
|
+
/** Default base path for the Studio package lifecycle API. */
|
|
46
|
+
export declare const HONUA_STUDIO_LIFECYCLE_BASE_PATH: "/api/v1/studio";
|
|
47
|
+
/** Constructor options for {@link HonuaStudioLifecycleClient}. */
|
|
48
|
+
export interface HonuaStudioLifecycleClientOptions {
|
|
49
|
+
readonly client: HonuaClient;
|
|
50
|
+
readonly basePath?: string;
|
|
51
|
+
}
|
|
52
|
+
/** Per-call options accepted by every {@link HonuaStudioLifecycleClient} method. */
|
|
53
|
+
export interface HonuaStudioRequestOptions {
|
|
54
|
+
readonly signal?: AbortSignal;
|
|
55
|
+
readonly headers?: HeadersInit;
|
|
56
|
+
}
|
|
57
|
+
/** Escape-hatch request for {@link HonuaStudioLifecycleClient.raw}. */
|
|
58
|
+
export interface HonuaStudioRawRequest extends HonuaStudioRequestOptions {
|
|
59
|
+
readonly method?: QueryMethod;
|
|
60
|
+
readonly path: string;
|
|
61
|
+
readonly body?: unknown;
|
|
62
|
+
}
|
|
63
|
+
/** Construct a {@link HonuaStudioLifecycleClient} from an existing {@link HonuaClient}. */
|
|
64
|
+
export declare function createHonuaStudioLifecycleClient(options: HonuaStudioLifecycleClientOptions): HonuaStudioLifecycleClient;
|
|
65
|
+
/**
|
|
66
|
+
* Typed client for every endpoint in the Studio package lifecycle API.
|
|
67
|
+
*
|
|
68
|
+
* @experimental Not yet covered by the SDK's semver contract.
|
|
69
|
+
*/
|
|
70
|
+
export declare class HonuaStudioLifecycleClient {
|
|
71
|
+
#private;
|
|
72
|
+
readonly packageFamilies: HonuaStudioPackageFamiliesClient;
|
|
73
|
+
readonly drafts: HonuaStudioDraftsClient;
|
|
74
|
+
readonly contentVersions: HonuaStudioContentVersionsClient;
|
|
75
|
+
readonly publicationRequests: HonuaStudioPublicationRequestsClient;
|
|
76
|
+
readonly rollbackRequests: HonuaStudioRollbackRequestsClient;
|
|
77
|
+
constructor(options: HonuaStudioLifecycleClientOptions);
|
|
78
|
+
get basePath(): string;
|
|
79
|
+
/** Escape hatch for endpoints without a dedicated method yet (see the module doc's "Enumeration gap"). */
|
|
80
|
+
raw<T = unknown>(request: HonuaStudioRawRequest): Promise<T>;
|
|
81
|
+
/** @internal */
|
|
82
|
+
request<T>(method: QueryMethod, path: string, body: unknown, options?: HonuaStudioRequestOptions): Promise<T>;
|
|
83
|
+
/** @internal */
|
|
84
|
+
resolvePath(path: string): string;
|
|
85
|
+
}
|
|
86
|
+
/** `GET /package-families` — discover every package family's capabilities. */
|
|
87
|
+
export declare class HonuaStudioPackageFamiliesClient {
|
|
88
|
+
#private;
|
|
89
|
+
constructor(lifecycle: HonuaStudioLifecycleClient);
|
|
90
|
+
/** Discover every package family, schema version, format, support level, and limitations. */
|
|
91
|
+
list(options?: HonuaStudioRequestOptions): Promise<StudioPackageFamilyCapabilities>;
|
|
92
|
+
}
|
|
93
|
+
/** `/package-drafts*` — mutable draft CRUD, validation, preview, and save-as-version. */
|
|
94
|
+
export declare class HonuaStudioDraftsClient {
|
|
95
|
+
#private;
|
|
96
|
+
constructor(lifecycle: HonuaStudioLifecycleClient);
|
|
97
|
+
/** `POST /package-drafts` — create a mutable package draft. */
|
|
98
|
+
create(request: StudioPackageDraftCreateRequest, options?: HonuaStudioRequestOptions): Promise<StudioPackageDraft>;
|
|
99
|
+
/** `GET /package-drafts/{draftId}` — retrieve a mutable draft. */
|
|
100
|
+
get(draftId: string, options?: HonuaStudioRequestOptions): Promise<StudioPackageDraft>;
|
|
101
|
+
/**
|
|
102
|
+
* `PUT /package-drafts/{draftId}` — replace a mutable draft with optional
|
|
103
|
+
* optimistic `generation` checking. A stale `generation` throws
|
|
104
|
+
* {@link HonuaStudioError} with `code: "generation-conflict"`.
|
|
105
|
+
*/
|
|
106
|
+
replace(draftId: string, request: StudioPackageDraftReplaceRequest, options?: HonuaStudioRequestOptions): Promise<StudioPackageDraft>;
|
|
107
|
+
/** `DELETE /package-drafts/{draftId}` — delete a draft. */
|
|
108
|
+
delete(draftId: string, options?: HonuaStudioRequestOptions): Promise<void>;
|
|
109
|
+
/** `POST /package-drafts/{draftId}/validate` — re-run validation, persisting the summary on the draft. */
|
|
110
|
+
validate(draftId: string, options?: HonuaStudioRequestOptions): Promise<StudioValidationSummary>;
|
|
111
|
+
/**
|
|
112
|
+
* `POST /package-drafts/{draftId}/preview-plan` — return a stable preview
|
|
113
|
+
* plan. `gp`/`etl`/`workflow` drafts advertise job-backed previews.
|
|
114
|
+
*/
|
|
115
|
+
previewPlan(draftId: string, options?: HonuaStudioRequestOptions): Promise<StudioPreviewPlan>;
|
|
116
|
+
/**
|
|
117
|
+
* `POST /package-drafts/{draftId}/content-versions` — save a draft as an
|
|
118
|
+
* immutable content version and move the item's current pointer.
|
|
119
|
+
*/
|
|
120
|
+
createContentVersion(draftId: string, options?: HonuaStudioRequestOptions): Promise<StudioContentVersion>;
|
|
121
|
+
}
|
|
122
|
+
/** `/content-items/{itemId}/versions*` and `/version-comparisons` — immutable content versions. */
|
|
123
|
+
export declare class HonuaStudioContentVersionsClient {
|
|
124
|
+
#private;
|
|
125
|
+
constructor(lifecycle: HonuaStudioLifecycleClient);
|
|
126
|
+
/** `GET /content-items/{itemId}/versions` — list immutable versions ordered by `versionNumber`. */
|
|
127
|
+
list(itemId: string, options?: HonuaStudioRequestOptions): Promise<StudioContentVersionListResponse>;
|
|
128
|
+
/** `GET /content-items/{itemId}/versions/{versionId}` — retrieve one immutable version. */
|
|
129
|
+
get(itemId: string, versionId: string, options?: HonuaStudioRequestOptions): Promise<StudioContentVersion>;
|
|
130
|
+
/**
|
|
131
|
+
* `POST /content-items/{itemId}/version-comparisons` — compare two
|
|
132
|
+
* immutable versions by content hash, dependencies, validation, and
|
|
133
|
+
* provenance.
|
|
134
|
+
*/
|
|
135
|
+
compare(itemId: string, request: StudioVersionComparisonRequest, options?: HonuaStudioRequestOptions): Promise<StudioVersionComparison>;
|
|
136
|
+
/**
|
|
137
|
+
* `POST /content-items/{itemId}/versions/{versionId}/reopen` — copy an
|
|
138
|
+
* immutable version into a new mutable draft with `baseVersionId` set.
|
|
139
|
+
*/
|
|
140
|
+
reopen(itemId: string, versionId: string, request?: StudioReopenVersionRequest, options?: HonuaStudioRequestOptions): Promise<StudioPackageDraft>;
|
|
141
|
+
}
|
|
142
|
+
/** `/content-items/{itemId}/versions/{versionId}/publish-requests`. */
|
|
143
|
+
export declare class HonuaStudioPublicationRequestsClient {
|
|
144
|
+
#private;
|
|
145
|
+
constructor(lifecycle: HonuaStudioLifecycleClient);
|
|
146
|
+
/**
|
|
147
|
+
* `POST /content-items/{itemId}/versions/{versionId}/publish-requests` —
|
|
148
|
+
* persist a publication request and move the published pointer when
|
|
149
|
+
* validation permits.
|
|
150
|
+
*/
|
|
151
|
+
create(itemId: string, versionId: string, request?: StudioPublicationRequestInput, options?: HonuaStudioRequestOptions): Promise<StudioPublicationRequest>;
|
|
152
|
+
}
|
|
153
|
+
/** `/content-items/{itemId}/rollback-requests`. */
|
|
154
|
+
export declare class HonuaStudioRollbackRequestsClient {
|
|
155
|
+
#private;
|
|
156
|
+
constructor(lifecycle: HonuaStudioLifecycleClient);
|
|
157
|
+
/**
|
|
158
|
+
* `POST /content-items/{itemId}/rollback-requests` — persist a rollback
|
|
159
|
+
* request and move the current, published, or both pointers to an earlier
|
|
160
|
+
* immutable version.
|
|
161
|
+
*/
|
|
162
|
+
create(itemId: string, request: StudioRollbackRequestInput, options?: HonuaStudioRequestOptions): Promise<StudioRollbackRequest>;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=lifecycle-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-client.d.ts","sourceRoot":"","sources":["../../../src/studio/lifecycle-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAEV,oBAAoB,EACpB,gCAAgC,EAChC,kBAAkB,EAClB,+BAA+B,EAC/B,gCAAgC,EAChC,+BAA+B,EAC/B,iBAAiB,EACjB,wBAAwB,EACxB,6BAA6B,EAC7B,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC/B,MAAM,sBAAsB,CAAC;AAE9B,8DAA8D;AAC9D,eAAO,MAAM,gCAAgC,EAAG,gBAAyB,CAAC;AAE1E,kEAAkE;AAClE,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,oFAAoF;AACpF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;CAChC;AAED,uEAAuE;AACvE,MAAM,WAAW,qBA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O,GAAE,0BAA+B,EACxC,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,kBAAkB,CAAC;CAQ/B;AAED,uEAAuE;AACvE,qBAAa,oCAAoC;;gBAG5B,SAAS,EAAE,0BAA0B;IAIxD;;;;OAIG;IACI,MAAM,CACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,6BAAkC,EAC3C,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,wBAAwB,CAAC;CAQrC;AAED,mDAAmD;AACnD,qBAAa,iCAAiC;;gBAGzB,SAAS,EAAE,0BAA0B;IAIxD;;;;OAIG;IACI,MAAM,CACX,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,0BAA0B,EACnC,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,qBAAqB,CAAC;CAQlC"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed client for the Studio package lifecycle API
|
|
3
|
+
* (`/api/v{version}/studio` in `honua-server`): package-family capability
|
|
4
|
+
* discovery, draft CRUD with optimistic-generation checking, validate,
|
|
5
|
+
* preview-plan, immutable content versions, version comparisons, publication
|
|
6
|
+
* requests, reopen, and rollback requests.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors {@link HonuaControlPlaneClient}'s ergonomics
|
|
9
|
+
* (`src/control-plane/client.ts`): construct with the SDK's standard
|
|
10
|
+
* {@link HonuaClient} (transport, auth, retry, and timeout are inherited from
|
|
11
|
+
* it), reach resource groups off the client instance
|
|
12
|
+
* (`.drafts`, `.contentVersions`, `.publicationRequests`, `.rollbackRequests`,
|
|
13
|
+
* `.packageFamilies`), and use `.raw()` for any endpoint that does not yet
|
|
14
|
+
* have a dedicated method.
|
|
15
|
+
*
|
|
16
|
+
* Every method throws {@link HonuaStudioError} on a non-2xx response — see
|
|
17
|
+
* `./lifecycle-errors.js` for the RFC 7807 problem-detail taxonomy and the
|
|
18
|
+
* `generation-conflict` discriminant.
|
|
19
|
+
*
|
|
20
|
+
* ## Enumeration gap
|
|
21
|
+
*
|
|
22
|
+
* The lifecycle API doc is explicit that **there is no endpoint to enumerate
|
|
23
|
+
* drafts or content items** — only single-resource reads
|
|
24
|
+
* (`GET /package-drafts/{draftId}`, `GET /content-items/{itemId}/versions`,
|
|
25
|
+
* `GET /content-items/{itemId}/versions/{versionId}`) and the
|
|
26
|
+
* family-discovery list (`GET /package-families`, which already returns every
|
|
27
|
+
* family in one response and does need no list method of its own).
|
|
28
|
+
* `honua-server#3003` tracks adding a draft/content-item enumeration
|
|
29
|
+
* endpoint. Until it ships:
|
|
30
|
+
*
|
|
31
|
+
* - `contentVersions.list(itemId)` already covers version enumeration *for a
|
|
32
|
+
* known item* — the gap is discovering `itemId`/`draftId` values in the
|
|
33
|
+
* first place, not paging a known collection.
|
|
34
|
+
* - `.raw()` reaches any endpoint honua-server adds before this client grows
|
|
35
|
+
* a dedicated method for it, without a breaking-change window.
|
|
36
|
+
* - When the enumeration endpoint ships, it is additive: a new
|
|
37
|
+
* `drafts.list(options)` (or a new resource group) can be added without
|
|
38
|
+
* touching any existing method signature.
|
|
39
|
+
*
|
|
40
|
+
* @module
|
|
41
|
+
*/
|
|
42
|
+
import { isHonuaError } from "../core/errors.js";
|
|
43
|
+
import { HonuaStudioError, classifyStudioProblemStatus } from "./lifecycle-errors.js";
|
|
44
|
+
/** Default base path for the Studio package lifecycle API. */
|
|
45
|
+
export const HONUA_STUDIO_LIFECYCLE_BASE_PATH = "/api/v1/studio";
|
|
46
|
+
/** Construct a {@link HonuaStudioLifecycleClient} from an existing {@link HonuaClient}. */
|
|
47
|
+
export function createHonuaStudioLifecycleClient(options) {
|
|
48
|
+
return new HonuaStudioLifecycleClient(options);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Typed client for every endpoint in the Studio package lifecycle API.
|
|
52
|
+
*
|
|
53
|
+
* @experimental Not yet covered by the SDK's semver contract.
|
|
54
|
+
*/
|
|
55
|
+
export class HonuaStudioLifecycleClient {
|
|
56
|
+
#client;
|
|
57
|
+
#basePath;
|
|
58
|
+
packageFamilies;
|
|
59
|
+
drafts;
|
|
60
|
+
contentVersions;
|
|
61
|
+
publicationRequests;
|
|
62
|
+
rollbackRequests;
|
|
63
|
+
constructor(options) {
|
|
64
|
+
this.#client = options.client;
|
|
65
|
+
this.#basePath = normalizeBasePath(options.basePath ?? HONUA_STUDIO_LIFECYCLE_BASE_PATH);
|
|
66
|
+
this.packageFamilies = new HonuaStudioPackageFamiliesClient(this);
|
|
67
|
+
this.drafts = new HonuaStudioDraftsClient(this);
|
|
68
|
+
this.contentVersions = new HonuaStudioContentVersionsClient(this);
|
|
69
|
+
this.publicationRequests = new HonuaStudioPublicationRequestsClient(this);
|
|
70
|
+
this.rollbackRequests = new HonuaStudioRollbackRequestsClient(this);
|
|
71
|
+
}
|
|
72
|
+
get basePath() {
|
|
73
|
+
return this.#basePath;
|
|
74
|
+
}
|
|
75
|
+
/** Escape hatch for endpoints without a dedicated method yet (see the module doc's "Enumeration gap"). */
|
|
76
|
+
raw(request) {
|
|
77
|
+
return this.request(request.method ?? "GET", request.path, request.body, {
|
|
78
|
+
signal: request.signal,
|
|
79
|
+
headers: request.headers,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/** @internal */
|
|
83
|
+
async request(method, path, body, options = {}) {
|
|
84
|
+
try {
|
|
85
|
+
const response = await this.#client.pipelineFetch(method, this.resolvePath(path), { headers: jsonHeaders(options.headers), body: body === undefined ? null : JSON.stringify(body) }, options.signal);
|
|
86
|
+
if (response.status === 204)
|
|
87
|
+
return undefined;
|
|
88
|
+
return unwrapApiResponse(await readJson(response));
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
throw toStudioError(error);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** @internal */
|
|
95
|
+
resolvePath(path) {
|
|
96
|
+
if (path.startsWith("http://") || path.startsWith("https://"))
|
|
97
|
+
return path;
|
|
98
|
+
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
99
|
+
if (normalized === this.#basePath || normalized.startsWith(`${this.#basePath}/`))
|
|
100
|
+
return normalized;
|
|
101
|
+
return `${this.#basePath}${normalized}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/** `GET /package-families` — discover every package family's capabilities. */
|
|
105
|
+
export class HonuaStudioPackageFamiliesClient {
|
|
106
|
+
#lifecycle;
|
|
107
|
+
constructor(lifecycle) {
|
|
108
|
+
this.#lifecycle = lifecycle;
|
|
109
|
+
}
|
|
110
|
+
/** Discover every package family, schema version, format, support level, and limitations. */
|
|
111
|
+
list(options = {}) {
|
|
112
|
+
return this.#lifecycle.request("GET", "/package-families", undefined, options);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** `/package-drafts*` — mutable draft CRUD, validation, preview, and save-as-version. */
|
|
116
|
+
export class HonuaStudioDraftsClient {
|
|
117
|
+
#lifecycle;
|
|
118
|
+
constructor(lifecycle) {
|
|
119
|
+
this.#lifecycle = lifecycle;
|
|
120
|
+
}
|
|
121
|
+
/** `POST /package-drafts` — create a mutable package draft. */
|
|
122
|
+
create(request, options = {}) {
|
|
123
|
+
return this.#lifecycle.request("POST", "/package-drafts", request, options);
|
|
124
|
+
}
|
|
125
|
+
/** `GET /package-drafts/{draftId}` — retrieve a mutable draft. */
|
|
126
|
+
get(draftId, options = {}) {
|
|
127
|
+
return this.#lifecycle.request("GET", `/package-drafts/${encodeURIComponent(draftId)}`, undefined, options);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* `PUT /package-drafts/{draftId}` — replace a mutable draft with optional
|
|
131
|
+
* optimistic `generation` checking. A stale `generation` throws
|
|
132
|
+
* {@link HonuaStudioError} with `code: "generation-conflict"`.
|
|
133
|
+
*/
|
|
134
|
+
replace(draftId, request, options = {}) {
|
|
135
|
+
return this.#lifecycle.request("PUT", `/package-drafts/${encodeURIComponent(draftId)}`, request, options);
|
|
136
|
+
}
|
|
137
|
+
/** `DELETE /package-drafts/{draftId}` — delete a draft. */
|
|
138
|
+
async delete(draftId, options = {}) {
|
|
139
|
+
await this.#lifecycle.request("DELETE", `/package-drafts/${encodeURIComponent(draftId)}`, undefined, options);
|
|
140
|
+
}
|
|
141
|
+
/** `POST /package-drafts/{draftId}/validate` — re-run validation, persisting the summary on the draft. */
|
|
142
|
+
validate(draftId, options = {}) {
|
|
143
|
+
return this.#lifecycle.request("POST", `/package-drafts/${encodeURIComponent(draftId)}/validate`, undefined, options);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* `POST /package-drafts/{draftId}/preview-plan` — return a stable preview
|
|
147
|
+
* plan. `gp`/`etl`/`workflow` drafts advertise job-backed previews.
|
|
148
|
+
*/
|
|
149
|
+
previewPlan(draftId, options = {}) {
|
|
150
|
+
return this.#lifecycle.request("POST", `/package-drafts/${encodeURIComponent(draftId)}/preview-plan`, undefined, options);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* `POST /package-drafts/{draftId}/content-versions` — save a draft as an
|
|
154
|
+
* immutable content version and move the item's current pointer.
|
|
155
|
+
*/
|
|
156
|
+
createContentVersion(draftId, options = {}) {
|
|
157
|
+
return this.#lifecycle.request("POST", `/package-drafts/${encodeURIComponent(draftId)}/content-versions`, undefined, options);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/** `/content-items/{itemId}/versions*` and `/version-comparisons` — immutable content versions. */
|
|
161
|
+
export class HonuaStudioContentVersionsClient {
|
|
162
|
+
#lifecycle;
|
|
163
|
+
constructor(lifecycle) {
|
|
164
|
+
this.#lifecycle = lifecycle;
|
|
165
|
+
}
|
|
166
|
+
/** `GET /content-items/{itemId}/versions` — list immutable versions ordered by `versionNumber`. */
|
|
167
|
+
list(itemId, options = {}) {
|
|
168
|
+
return this.#lifecycle.request("GET", `/content-items/${encodeURIComponent(itemId)}/versions`, undefined, options);
|
|
169
|
+
}
|
|
170
|
+
/** `GET /content-items/{itemId}/versions/{versionId}` — retrieve one immutable version. */
|
|
171
|
+
get(itemId, versionId, options = {}) {
|
|
172
|
+
return this.#lifecycle.request("GET", `/content-items/${encodeURIComponent(itemId)}/versions/${encodeURIComponent(versionId)}`, undefined, options);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* `POST /content-items/{itemId}/version-comparisons` — compare two
|
|
176
|
+
* immutable versions by content hash, dependencies, validation, and
|
|
177
|
+
* provenance.
|
|
178
|
+
*/
|
|
179
|
+
compare(itemId, request, options = {}) {
|
|
180
|
+
return this.#lifecycle.request("POST", `/content-items/${encodeURIComponent(itemId)}/version-comparisons`, request, options);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* `POST /content-items/{itemId}/versions/{versionId}/reopen` — copy an
|
|
184
|
+
* immutable version into a new mutable draft with `baseVersionId` set.
|
|
185
|
+
*/
|
|
186
|
+
reopen(itemId, versionId, request = {}, options = {}) {
|
|
187
|
+
return this.#lifecycle.request("POST", `/content-items/${encodeURIComponent(itemId)}/versions/${encodeURIComponent(versionId)}/reopen`, request, options);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/** `/content-items/{itemId}/versions/{versionId}/publish-requests`. */
|
|
191
|
+
export class HonuaStudioPublicationRequestsClient {
|
|
192
|
+
#lifecycle;
|
|
193
|
+
constructor(lifecycle) {
|
|
194
|
+
this.#lifecycle = lifecycle;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* `POST /content-items/{itemId}/versions/{versionId}/publish-requests` —
|
|
198
|
+
* persist a publication request and move the published pointer when
|
|
199
|
+
* validation permits.
|
|
200
|
+
*/
|
|
201
|
+
create(itemId, versionId, request = {}, options = {}) {
|
|
202
|
+
return this.#lifecycle.request("POST", `/content-items/${encodeURIComponent(itemId)}/versions/${encodeURIComponent(versionId)}/publish-requests`, request, options);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/** `/content-items/{itemId}/rollback-requests`. */
|
|
206
|
+
export class HonuaStudioRollbackRequestsClient {
|
|
207
|
+
#lifecycle;
|
|
208
|
+
constructor(lifecycle) {
|
|
209
|
+
this.#lifecycle = lifecycle;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* `POST /content-items/{itemId}/rollback-requests` — persist a rollback
|
|
213
|
+
* request and move the current, published, or both pointers to an earlier
|
|
214
|
+
* immutable version.
|
|
215
|
+
*/
|
|
216
|
+
create(itemId, request, options = {}) {
|
|
217
|
+
return this.#lifecycle.request("POST", `/content-items/${encodeURIComponent(itemId)}/rollback-requests`, request, options);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function normalizeBasePath(path) {
|
|
221
|
+
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
222
|
+
let end = normalized.length;
|
|
223
|
+
while (end > 1 && normalized[end - 1] === "/")
|
|
224
|
+
end -= 1;
|
|
225
|
+
return normalized.slice(0, end);
|
|
226
|
+
}
|
|
227
|
+
function jsonHeaders(headers) {
|
|
228
|
+
return { Accept: "application/json", "Content-Type": "application/json", ...headersToRecord(headers) };
|
|
229
|
+
}
|
|
230
|
+
function headersToRecord(headers) {
|
|
231
|
+
if (!headers)
|
|
232
|
+
return {};
|
|
233
|
+
if (headers instanceof Headers)
|
|
234
|
+
return Object.fromEntries(headers.entries());
|
|
235
|
+
if (Array.isArray(headers))
|
|
236
|
+
return Object.fromEntries(headers);
|
|
237
|
+
return { ...headers };
|
|
238
|
+
}
|
|
239
|
+
async function readJson(response) {
|
|
240
|
+
const text = await response.text();
|
|
241
|
+
if (!text)
|
|
242
|
+
return undefined;
|
|
243
|
+
return JSON.parse(text);
|
|
244
|
+
}
|
|
245
|
+
/** Unwrap `ApiResponse<T>` (`{ success, data, timestamp }`) into `T`, tolerating an already-unwrapped body. */
|
|
246
|
+
function unwrapApiResponse(body) {
|
|
247
|
+
if (isRecord(body) && "data" in body && "success" in body) {
|
|
248
|
+
return body.data;
|
|
249
|
+
}
|
|
250
|
+
return body;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* True when `error` has the exact shape a `HonuaHttpError` carries —
|
|
254
|
+
* deliberately **not** `error instanceof HonuaHttpError`.
|
|
255
|
+
*
|
|
256
|
+
* This module ships as part of the generated `@honua/app-platform/studio`
|
|
257
|
+
* split package (see `src/studio/index.ts`'s module doc and
|
|
258
|
+
* `scripts/prepare-split-packages.mjs`, which copies `core/` — including
|
|
259
|
+
* `core/errors.js` — into every split package rather than importing it from
|
|
260
|
+
* the `@honua/sdk` peer). A caller that wires this client to a `HonuaClient`
|
|
261
|
+
* constructed from that peer's own copy of `@honua/sdk-js` therefore has
|
|
262
|
+
* *two* separate `HonuaHttpError` classes in play — one per package copy of
|
|
263
|
+
* the identical source file. `error instanceof HonuaHttpError` silently
|
|
264
|
+
* returns `false` across that boundary even though `error` is exactly a
|
|
265
|
+
* `HonuaHttpError`, a classic dual-package hazard.
|
|
266
|
+
*
|
|
267
|
+
* Detection instead follows the SDK's own established cross-realm error
|
|
268
|
+
* guard, {@link isHonuaError} (`isHonuaSdkError`, `src/core/error-envelope.js`
|
|
269
|
+
* — "Cross-realm type guard backed by the public tag and registered code"):
|
|
270
|
+
* match on the frozen `sdkCode` tag every `HonuaHttpError` carries
|
|
271
|
+
* (`"core.http.transient"` / `"core.http.rejected"` — byte-identical string
|
|
272
|
+
* constants in every copy of the module, unlike the class's identity) plus a
|
|
273
|
+
* direct, non-`instanceof` read of the HTTP-specific `statusCode` own
|
|
274
|
+
* property. `HonuaStudioError` is built from these primitive values alone, so
|
|
275
|
+
* its construction never depends on receiving a specific class instance
|
|
276
|
+
* either.
|
|
277
|
+
*/
|
|
278
|
+
function isHonuaHttpErrorLike(error) {
|
|
279
|
+
if (!isHonuaError(error))
|
|
280
|
+
return false;
|
|
281
|
+
if (error.sdkCode !== "core.http.transient" && error.sdkCode !== "core.http.rejected")
|
|
282
|
+
return false;
|
|
283
|
+
return typeof error.statusCode === "number";
|
|
284
|
+
}
|
|
285
|
+
/** Convert a thrown `HonuaHttpError`-shaped rejection into a typed {@link HonuaStudioError}; pass through anything else. */
|
|
286
|
+
function toStudioError(error) {
|
|
287
|
+
if (!isHonuaHttpErrorLike(error))
|
|
288
|
+
return error;
|
|
289
|
+
const problem = toProblemDetails(error.body);
|
|
290
|
+
const code = classifyStudioProblemStatus(error.statusCode);
|
|
291
|
+
const message = problem?.detail ?? problem?.title ?? error.message;
|
|
292
|
+
return new HonuaStudioError(code, error.statusCode, message, problem, { cause: error });
|
|
293
|
+
}
|
|
294
|
+
function toProblemDetails(body) {
|
|
295
|
+
return isRecord(body) ? body : undefined;
|
|
296
|
+
}
|
|
297
|
+
function isRecord(value) {
|
|
298
|
+
return typeof value === "object" && value !== null;
|
|
299
|
+
}
|