@honua/sdk-esri-compat 0.0.9-alpha.0 → 0.0.10-alpha.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.
@@ -0,0 +1,149 @@
1
+ /**
2
+ * Provider-neutral analytics source primitives for warehouse and indexed data.
3
+ *
4
+ * These descriptors are serializable contract objects. They describe table,
5
+ * SQL query, tileset, and indexed spatial sources without embedding
6
+ * credentials or binding callers to a warehouse vendor SDK.
7
+ *
8
+ * @module
9
+ */
10
+ import type { HonuaExtent } from "../core/types.js";
11
+ import type { Capability, DegradedReason, SourceFreshnessContract, SourceId } from "./types.js";
12
+ export declare const ANALYTICS_SOURCE_SCHEMA_VERSION: "honua.analytics-source.v1";
13
+ export type AnalyticsSourceSchemaVersion = typeof ANALYTICS_SOURCE_SCHEMA_VERSION;
14
+ export type AnalyticsSourceKind = "warehouse-table" | "warehouse-query" | "warehouse-tileset" | "indexed-spatial" | "h3-index" | "quadbin-index";
15
+ export type AnalyticsWarehouseProvider = "bigquery" | "snowflake" | "redshift" | "postgres" | "duckdb" | "carto" | "honua" | "custom";
16
+ export type AnalyticsSourcePushdownCapability = "sql" | "tiles" | "widgets" | "spatialAggregate" | "crossfilter" | "metadata";
17
+ export type AnalyticsSourceFallbackMode = "disabled" | "server-degraded" | "client-bounded";
18
+ export type AnalyticsIndexHierarchy = "parent-child" | "flat" | "unknown";
19
+ export type AnalyticsIndexCoverageKind = "global" | "bounded" | "sparse" | "viewport";
20
+ export interface AnalyticsSourceRelationDescriptor {
21
+ readonly project?: string;
22
+ readonly dataset?: string;
23
+ readonly schema?: string;
24
+ readonly table: string;
25
+ readonly catalog?: string;
26
+ }
27
+ export interface AnalyticsSourceSqlDescriptor {
28
+ /** SQL text or a stable server-side query id. Never put secrets here. */
29
+ readonly text: string;
30
+ readonly dialect?: string;
31
+ readonly parameters?: Readonly<Record<string, string | number | boolean | null>>;
32
+ }
33
+ export interface AnalyticsSourceTilesetDescriptor {
34
+ readonly id: string;
35
+ readonly url?: string;
36
+ readonly tileMatrixSet?: string;
37
+ readonly minzoom?: number;
38
+ readonly maxzoom?: number;
39
+ readonly sourceLayer?: string;
40
+ }
41
+ export interface AnalyticsIndexCoverageDescriptor {
42
+ readonly kind: AnalyticsIndexCoverageKind;
43
+ readonly extent?: HonuaExtent;
44
+ readonly cellCount?: number;
45
+ readonly complete?: boolean;
46
+ }
47
+ export interface AnalyticsIndexDescriptor {
48
+ readonly modelId: "h3" | "quadbin" | string;
49
+ readonly cellIdField: string;
50
+ readonly resolution?: number;
51
+ readonly minResolution?: number;
52
+ readonly maxResolution?: number;
53
+ readonly hierarchy?: AnalyticsIndexHierarchy;
54
+ readonly coverage?: AnalyticsIndexCoverageDescriptor;
55
+ readonly parentField?: string;
56
+ readonly geometryField?: string;
57
+ }
58
+ export interface AnalyticsSourceCapabilityMetadata {
59
+ readonly pushdown: readonly AnalyticsSourcePushdownCapability[];
60
+ readonly unsupported?: readonly AnalyticsSourcePushdownCapability[];
61
+ readonly maxClientRows?: number;
62
+ readonly realtime?: boolean;
63
+ readonly freshness?: SourceFreshnessContract;
64
+ }
65
+ export interface AnalyticsSourceCacheIdentity {
66
+ readonly sourceVersion?: string;
67
+ readonly authorizationScope?: string;
68
+ readonly filters?: unknown;
69
+ readonly indexResolution?: number;
70
+ readonly projection?: unknown;
71
+ readonly widgetProjection?: unknown;
72
+ readonly styleProjection?: unknown;
73
+ readonly extra?: Readonly<Record<string, unknown>>;
74
+ }
75
+ export interface AnalyticsSourceCachePolicy {
76
+ readonly metadataCacheable?: boolean;
77
+ readonly resultCacheable?: boolean;
78
+ readonly ttlMs?: number;
79
+ readonly key?: AnalyticsSourceCacheIdentity;
80
+ }
81
+ export interface AnalyticsSourceFallbackPolicy {
82
+ readonly mode: AnalyticsSourceFallbackMode;
83
+ readonly reason?: string;
84
+ }
85
+ export interface AnalyticsSourceProtocolEscapeHatch {
86
+ readonly provider: string;
87
+ readonly protocol: string;
88
+ readonly options?: Readonly<Record<string, unknown>>;
89
+ }
90
+ export interface AnalyticsSourceDescriptorBase {
91
+ readonly schemaVersion?: AnalyticsSourceSchemaVersion;
92
+ readonly kind: AnalyticsSourceKind;
93
+ readonly id: SourceId;
94
+ readonly title?: string;
95
+ readonly description?: string;
96
+ readonly provider?: AnalyticsWarehouseProvider | string;
97
+ readonly sourceId?: SourceId;
98
+ readonly capabilities?: AnalyticsSourceCapabilityMetadata;
99
+ readonly cache?: AnalyticsSourceCachePolicy;
100
+ readonly fallback?: AnalyticsSourceFallbackPolicy;
101
+ readonly protocol?: AnalyticsSourceProtocolEscapeHatch;
102
+ readonly metadata?: Readonly<Record<string, unknown>>;
103
+ }
104
+ export interface WarehouseTableSourceDescriptor extends AnalyticsSourceDescriptorBase {
105
+ readonly kind: "warehouse-table";
106
+ readonly relation: AnalyticsSourceRelationDescriptor;
107
+ }
108
+ export interface WarehouseQuerySourceDescriptor extends AnalyticsSourceDescriptorBase {
109
+ readonly kind: "warehouse-query";
110
+ readonly sql: AnalyticsSourceSqlDescriptor;
111
+ }
112
+ export interface WarehouseTilesetSourceDescriptor extends AnalyticsSourceDescriptorBase {
113
+ readonly kind: "warehouse-tileset";
114
+ readonly tileset: AnalyticsSourceTilesetDescriptor;
115
+ readonly relation?: AnalyticsSourceRelationDescriptor;
116
+ readonly sql?: AnalyticsSourceSqlDescriptor;
117
+ }
118
+ export interface IndexedSpatialSourceDescriptor extends AnalyticsSourceDescriptorBase {
119
+ readonly kind: "indexed-spatial" | "h3-index" | "quadbin-index";
120
+ readonly relation?: AnalyticsSourceRelationDescriptor;
121
+ readonly sql?: AnalyticsSourceSqlDescriptor;
122
+ readonly index: AnalyticsIndexDescriptor;
123
+ }
124
+ export type AnalyticsSourceDescriptor = WarehouseTableSourceDescriptor | WarehouseQuerySourceDescriptor | WarehouseTilesetSourceDescriptor | IndexedSpatialSourceDescriptor;
125
+ export interface AnalyticsSourceCacheKeyOptions {
126
+ readonly cache?: AnalyticsSourceCacheIdentity;
127
+ readonly prefix?: string;
128
+ readonly operation?: "tiles" | "widget" | "spatialAggregate" | "sql" | string;
129
+ }
130
+ export interface AnalyticsSourcePushdownAssessment {
131
+ readonly sourceId: SourceId;
132
+ readonly capability: AnalyticsSourcePushdownCapability;
133
+ readonly supported: boolean;
134
+ readonly cacheKey: string;
135
+ readonly degraded?: readonly DegradedReason[];
136
+ }
137
+ export declare function defineWarehouseTableSource(descriptor: Omit<WarehouseTableSourceDescriptor, "kind">): WarehouseTableSourceDescriptor;
138
+ export declare function defineWarehouseQuerySource(descriptor: Omit<WarehouseQuerySourceDescriptor, "kind">): WarehouseQuerySourceDescriptor;
139
+ export declare function defineWarehouseTilesetSource(descriptor: Omit<WarehouseTilesetSourceDescriptor, "kind">): WarehouseTilesetSourceDescriptor;
140
+ export declare function defineIndexedSpatialSource(descriptor: Omit<IndexedSpatialSourceDescriptor, "kind"> & {
141
+ readonly kind?: IndexedSpatialSourceDescriptor["kind"];
142
+ }): IndexedSpatialSourceDescriptor;
143
+ export declare function normalizeAnalyticsSourceDescriptor<T extends AnalyticsSourceDescriptor>(descriptor: T): T;
144
+ export declare function analyticsSourceId(descriptor: AnalyticsSourceDescriptor): SourceId;
145
+ export declare function isAnalyticsSourceDescriptor(value: unknown): value is AnalyticsSourceDescriptor;
146
+ export declare function buildAnalyticsSourceCacheKey(descriptor: AnalyticsSourceDescriptor, options?: AnalyticsSourceCacheKeyOptions): string;
147
+ export declare function assessAnalyticsSourcePushdown(descriptor: AnalyticsSourceDescriptor, capability: AnalyticsSourcePushdownCapability, options?: AnalyticsSourceCacheKeyOptions): AnalyticsSourcePushdownAssessment;
148
+ export declare function analyticsSourceDegradedReason(descriptor: AnalyticsSourceDescriptor, capability: Capability, reason?: string): DegradedReason;
149
+ //# sourceMappingURL=analytics-sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics-sources.d.ts","sourceRoot":"","sources":["../../../src/contract/analytics-sources.ts"],"names":[],"mappings":"AAAA;;;;;;;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AAI,CAAC,gCAAgC,EAAE,MAAM,CAAC,GACzD,gCAAgC,CAElC;AAED,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,IAAI,CAAC,8BAA8B,EAAE,MAAM,CAAC,GAAG;IACzD,QAAQ,CAAC,IAAI,CAAC,EAAE,8BAA8B,CAAC,MAAM,CAAC,CAAC;CACxD,GACA,8BAA8B,CAKhC;AAED,wBAAgB,kCAAkC,CAAC,CAAC,SAAS,yBAAyB,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAwCxG;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,yBAAyB,GAAG,QAAQ,CAEjF;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,yBAAyB,CAe9F;AAED,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,yBAAyB,EACrC,OAAO,GAAE,8BAAmC,GAC3C,MAAM,CAuBR;AAED,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,yBAAyB,EACrC,UAAU,EAAE,iCAAiC,EAC7C,OAAO,GAAE,8BAAmC,GAC3C,iCAAiC,CAmBnC;AAED,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,yBAAyB,EACrC,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,MAAM,GACd,cAAc,CAOhB"}
@@ -0,0 +1,235 @@
1
+ /**
2
+ * Provider-neutral analytics source primitives for warehouse and indexed data.
3
+ *
4
+ * These descriptors are serializable contract objects. They describe table,
5
+ * SQL query, tileset, and indexed spatial sources without embedding
6
+ * credentials or binding callers to a warehouse vendor SDK.
7
+ *
8
+ * @module
9
+ */
10
+ export const ANALYTICS_SOURCE_SCHEMA_VERSION = "honua.analytics-source.v1";
11
+ export function defineWarehouseTableSource(descriptor) {
12
+ return normalizeAnalyticsSourceDescriptor({ ...descriptor, kind: "warehouse-table" });
13
+ }
14
+ export function defineWarehouseQuerySource(descriptor) {
15
+ return normalizeAnalyticsSourceDescriptor({ ...descriptor, kind: "warehouse-query" });
16
+ }
17
+ export function defineWarehouseTilesetSource(descriptor) {
18
+ return normalizeAnalyticsSourceDescriptor({ ...descriptor, kind: "warehouse-tileset" });
19
+ }
20
+ export function defineIndexedSpatialSource(descriptor) {
21
+ const modelId = descriptor.index?.modelId;
22
+ const kind = descriptor.kind ?? (modelId === "h3" ? "h3-index" : modelId === "quadbin" ? "quadbin-index" : "indexed-spatial");
23
+ return normalizeAnalyticsSourceDescriptor({ ...descriptor, kind });
24
+ }
25
+ export function normalizeAnalyticsSourceDescriptor(descriptor) {
26
+ if (!isRecord(descriptor)) {
27
+ throw new Error("AnalyticsSourceDescriptor must be an object");
28
+ }
29
+ if (!descriptor.id || typeof descriptor.id !== "string") {
30
+ throw new Error("AnalyticsSourceDescriptor.id is required");
31
+ }
32
+ if (!isAnalyticsSourceKind(descriptor.kind)) {
33
+ throw new Error("AnalyticsSourceDescriptor.kind is required");
34
+ }
35
+ if (descriptor.kind === "warehouse-table" && !isRelationDescriptor(descriptor.relation)) {
36
+ throw new Error("warehouse table sources require relation.table");
37
+ }
38
+ if (descriptor.kind === "warehouse-query" && !isSqlDescriptor(descriptor.sql)) {
39
+ throw new Error("warehouse query sources require sql.text");
40
+ }
41
+ if (descriptor.kind === "warehouse-tileset" && !isTilesetDescriptor(descriptor.tileset)) {
42
+ throw new Error("warehouse tileset sources require tileset.id");
43
+ }
44
+ if ((descriptor.kind === "indexed-spatial" || descriptor.kind === "h3-index" || descriptor.kind === "quadbin-index") &&
45
+ !isIndexDescriptor(descriptor.index)) {
46
+ throw new Error("indexed spatial sources require index.modelId and index.cellIdField");
47
+ }
48
+ const capabilities = isCapabilitiesMetadata(descriptor.capabilities) ? descriptor.capabilities : undefined;
49
+ const fallback = isFallbackPolicy(descriptor.fallback) ? descriptor.fallback : undefined;
50
+ return {
51
+ ...descriptor,
52
+ schemaVersion: descriptor.schemaVersion ?? ANALYTICS_SOURCE_SCHEMA_VERSION,
53
+ sourceId: descriptor.sourceId ?? descriptor.id,
54
+ capabilities: {
55
+ pushdown: capabilities?.pushdown ?? defaultPushdown(descriptor),
56
+ ...(capabilities?.unsupported ? { unsupported: capabilities.unsupported } : {}),
57
+ ...(capabilities?.maxClientRows !== undefined ? { maxClientRows: capabilities.maxClientRows } : {}),
58
+ ...(capabilities?.realtime !== undefined ? { realtime: capabilities.realtime } : {}),
59
+ ...(capabilities?.freshness ? { freshness: capabilities.freshness } : {}),
60
+ },
61
+ fallback: fallback ?? { mode: "disabled" },
62
+ };
63
+ }
64
+ export function analyticsSourceId(descriptor) {
65
+ return normalizeAnalyticsSourceDescriptor(descriptor).sourceId ?? descriptor.id;
66
+ }
67
+ export function isAnalyticsSourceDescriptor(value) {
68
+ if (!isRecord(value))
69
+ return false;
70
+ if (typeof value.id !== "string" || value.id.length === 0 || !isAnalyticsSourceKind(value.kind))
71
+ return false;
72
+ switch (value.kind) {
73
+ case "warehouse-table":
74
+ return isRelationDescriptor(value.relation);
75
+ case "warehouse-query":
76
+ return isSqlDescriptor(value.sql);
77
+ case "warehouse-tileset":
78
+ return isTilesetDescriptor(value.tileset);
79
+ case "indexed-spatial":
80
+ case "h3-index":
81
+ case "quadbin-index":
82
+ return isIndexDescriptor(value.index);
83
+ }
84
+ }
85
+ export function buildAnalyticsSourceCacheKey(descriptor, options = {}) {
86
+ const normalized = normalizeAnalyticsSourceDescriptor(descriptor);
87
+ const cache = { ...(normalized.cache?.key ?? {}), ...(options.cache ?? {}) };
88
+ return `${options.prefix ?? "honua-analytics-source"}:${stableStringify({
89
+ v: 1,
90
+ schemaVersion: normalized.schemaVersion,
91
+ operation: options.operation,
92
+ kind: normalized.kind,
93
+ id: normalized.id,
94
+ sourceId: normalized.sourceId,
95
+ provider: normalized.provider,
96
+ relation: relationForCache(normalized),
97
+ sql: sqlForCache(normalized),
98
+ tileset: tilesetForCache(normalized),
99
+ index: indexForCache(normalized, cache.indexResolution),
100
+ sourceVersion: cache.sourceVersion,
101
+ authorizationScope: cache.authorizationScope,
102
+ filters: cache.filters,
103
+ projection: cache.projection,
104
+ widgetProjection: cache.widgetProjection,
105
+ styleProjection: cache.styleProjection,
106
+ extra: cache.extra,
107
+ })}`;
108
+ }
109
+ export function assessAnalyticsSourcePushdown(descriptor, capability, options = {}) {
110
+ const normalized = normalizeAnalyticsSourceDescriptor(descriptor);
111
+ const supported = normalized.capabilities?.pushdown.includes(capability) === true;
112
+ const degraded = supported
113
+ ? undefined
114
+ : [
115
+ analyticsSourceDegradedReason(normalized, capabilityToContractCapability(capability), `Analytics source "${normalized.id}" does not advertise ${capability} server pushdown.`),
116
+ ];
117
+ return {
118
+ sourceId: analyticsSourceId(normalized),
119
+ capability,
120
+ supported,
121
+ cacheKey: buildAnalyticsSourceCacheKey(normalized, { ...options, operation: options.operation ?? capability }),
122
+ ...(degraded ? { degraded } : {}),
123
+ };
124
+ }
125
+ export function analyticsSourceDegradedReason(descriptor, capability, reason) {
126
+ const normalized = normalizeAnalyticsSourceDescriptor(descriptor);
127
+ return {
128
+ capability,
129
+ reason: reason ?? normalized.fallback?.reason ?? `Analytics source "${normalized.id}" requires degraded execution.`,
130
+ sourceId: analyticsSourceId(normalized),
131
+ };
132
+ }
133
+ function defaultPushdown(descriptor) {
134
+ switch (descriptor.kind) {
135
+ case "warehouse-table":
136
+ case "warehouse-query":
137
+ return ["sql", "widgets", "spatialAggregate", "metadata"];
138
+ case "warehouse-tileset":
139
+ return ["tiles", "metadata"];
140
+ case "h3-index":
141
+ case "quadbin-index":
142
+ case "indexed-spatial":
143
+ return ["tiles", "widgets", "spatialAggregate", "crossfilter", "metadata"];
144
+ }
145
+ }
146
+ function capabilityToContractCapability(capability) {
147
+ if (capability === "tiles")
148
+ return "tiles";
149
+ if (capability === "sql")
150
+ return "sql";
151
+ if (capability === "spatialAggregate")
152
+ return "spatialAggregate";
153
+ return "queryAggregate";
154
+ }
155
+ function isAnalyticsSourceKind(value) {
156
+ return (value === "warehouse-table" ||
157
+ value === "warehouse-query" ||
158
+ value === "warehouse-tileset" ||
159
+ value === "indexed-spatial" ||
160
+ value === "h3-index" ||
161
+ value === "quadbin-index");
162
+ }
163
+ function isRelationDescriptor(value) {
164
+ return isRecord(value) && typeof value.table === "string" && value.table.length > 0;
165
+ }
166
+ function isSqlDescriptor(value) {
167
+ return isRecord(value) && typeof value.text === "string" && value.text.length > 0;
168
+ }
169
+ function isTilesetDescriptor(value) {
170
+ return isRecord(value) && typeof value.id === "string" && value.id.length > 0;
171
+ }
172
+ function isIndexDescriptor(value) {
173
+ return (isRecord(value) &&
174
+ typeof value.modelId === "string" &&
175
+ value.modelId.length > 0 &&
176
+ typeof value.cellIdField === "string" &&
177
+ value.cellIdField.length > 0);
178
+ }
179
+ function isCapabilitiesMetadata(value) {
180
+ if (!isRecord(value))
181
+ return false;
182
+ return ((!("pushdown" in value) || isPushdownCapabilityArray(value.pushdown)) &&
183
+ (!("unsupported" in value) || isPushdownCapabilityArray(value.unsupported)) &&
184
+ (!("maxClientRows" in value) || typeof value.maxClientRows === "number") &&
185
+ (!("realtime" in value) || typeof value.realtime === "boolean"));
186
+ }
187
+ function isPushdownCapabilityArray(value) {
188
+ return Array.isArray(value) && value.every(isPushdownCapability);
189
+ }
190
+ function isPushdownCapability(value) {
191
+ return (value === "sql" ||
192
+ value === "tiles" ||
193
+ value === "widgets" ||
194
+ value === "spatialAggregate" ||
195
+ value === "crossfilter" ||
196
+ value === "metadata");
197
+ }
198
+ function isFallbackPolicy(value) {
199
+ return (isRecord(value) &&
200
+ (value.mode === "disabled" || value.mode === "server-degraded" || value.mode === "client-bounded"));
201
+ }
202
+ function relationForCache(descriptor) {
203
+ return "relation" in descriptor ? descriptor.relation : undefined;
204
+ }
205
+ function sqlForCache(descriptor) {
206
+ return "sql" in descriptor ? descriptor.sql : undefined;
207
+ }
208
+ function tilesetForCache(descriptor) {
209
+ return "tileset" in descriptor ? descriptor.tileset : undefined;
210
+ }
211
+ function indexForCache(descriptor, overrideResolution) {
212
+ if (!("index" in descriptor))
213
+ return undefined;
214
+ return {
215
+ ...descriptor.index,
216
+ resolution: overrideResolution ?? descriptor.index.resolution,
217
+ };
218
+ }
219
+ function stableStringify(value) {
220
+ if (value === null || typeof value !== "object")
221
+ return JSON.stringify(value);
222
+ if (value instanceof Date)
223
+ return JSON.stringify(value.toISOString());
224
+ if (Array.isArray(value))
225
+ return `[${value.map(stableStringify).join(",")}]`;
226
+ const obj = value;
227
+ return `{${Object.keys(obj)
228
+ .sort()
229
+ .filter((key) => obj[key] !== undefined)
230
+ .map((key) => `${JSON.stringify(key)}:${stableStringify(obj[key])}`)
231
+ .join(",")}}`;
232
+ }
233
+ function isRecord(value) {
234
+ return typeof value === "object" && value !== null && !Array.isArray(value);
235
+ }
@@ -693,7 +693,7 @@ function attachmentOperationToWorkflowOperation(operation) {
693
693
  function cloneCanonicalFeature(feature) {
694
694
  return {
695
695
  ...(feature.id !== undefined ? { id: feature.id } : {}),
696
- attributes: { ...feature.attributes },
696
+ attributes: cloneJsonLike(feature.attributes),
697
697
  ...(feature.geometry !== undefined ? { geometry: cloneRecord(feature.geometry) } : {}),
698
698
  };
699
699
  }
@@ -707,11 +707,54 @@ function cloneAttachmentMutation(mutation) {
707
707
  function cloneRecord(value) {
708
708
  if (value === null || value === undefined)
709
709
  return null;
710
- return { ...value };
710
+ return cloneJsonLike(value);
711
711
  }
712
712
  function isEmptyValue(value) {
713
713
  return value === undefined || value === null || value === "";
714
714
  }
715
715
  function sameValue(left, right) {
716
- return Object.is(left, right);
716
+ return deepEqual(left, right);
717
+ }
718
+ function cloneJsonLike(value) {
719
+ if (value === null || typeof value !== "object")
720
+ return value;
721
+ if (value instanceof Date)
722
+ return new Date(value.getTime());
723
+ if (Array.isArray(value))
724
+ return value.map(cloneJsonLike);
725
+ if (isCloneOpaque(value))
726
+ return value;
727
+ const out = {};
728
+ for (const [key, entry] of Object.entries(value)) {
729
+ out[key] = cloneJsonLike(entry);
730
+ }
731
+ return out;
732
+ }
733
+ function deepEqual(left, right) {
734
+ if (Object.is(left, right))
735
+ return true;
736
+ if (left instanceof Date || right instanceof Date) {
737
+ return left instanceof Date && right instanceof Date && left.getTime() === right.getTime();
738
+ }
739
+ if (Array.isArray(left) || Array.isArray(right)) {
740
+ if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length)
741
+ return false;
742
+ return left.every((value, index) => deepEqual(value, right[index]));
743
+ }
744
+ if (!isPlainRecord(left) || !isPlainRecord(right))
745
+ return false;
746
+ const leftKeys = Object.keys(left);
747
+ const rightKeys = Object.keys(right);
748
+ if (leftKeys.length !== rightKeys.length)
749
+ return false;
750
+ return leftKeys.every((key) => Object.hasOwn(right, key) && deepEqual(left[key], right[key]));
751
+ }
752
+ function isPlainRecord(value) {
753
+ if (value === null || typeof value !== "object" || Array.isArray(value))
754
+ return false;
755
+ const prototype = Object.getPrototypeOf(value);
756
+ return prototype === Object.prototype || prototype === null;
757
+ }
758
+ function isCloneOpaque(value) {
759
+ return !isPlainRecord(value);
717
760
  }
@@ -0,0 +1,91 @@
1
+ import { type CreateEditSessionOptions, type EditAttachmentMutation, type EditWorkflowKind, type EditWorkflowMetadata, type EditWorkflowSnapshot, type EditWorkflowSubmitResult, type EditWorkflowValidationResult } from "./edit-session.js";
2
+ import type { CanonicalFeature, FeatureId, Protocol, Source, SourceId } from "./types.js";
3
+ export type EditSketchTool = "point" | "line" | "polygon" | "rectangle" | "circle" | "buffer";
4
+ export type EditSketchCapabilityState = "supported" | "unsupported";
5
+ export type EditSketchStatus = "idle" | "sketching" | "ready" | "unsupported";
6
+ export type EditAnnotationPersistenceState = "not-configured" | "supported" | "failed";
7
+ export interface EditSketchToolCapability {
8
+ tool: EditSketchTool;
9
+ state: EditSketchCapabilityState;
10
+ reason?: string;
11
+ }
12
+ export type EditSketchToolCapabilityInput = EditSketchCapabilityState | {
13
+ state: EditSketchCapabilityState;
14
+ reason?: string;
15
+ };
16
+ export interface EditSketchWorkflowOptions<T = Record<string, unknown>> extends Omit<CreateEditSessionOptions<T>, "optimistic"> {
17
+ sketchTools?: Partial<Record<EditSketchTool, EditSketchToolCapabilityInput>>;
18
+ optimistic?: CreateEditSessionOptions<T>["optimistic"];
19
+ annotationPersistence?: EditAnnotationPersistenceHook<T>;
20
+ }
21
+ export interface EditAnnotationPersistenceHook<T = Record<string, unknown>> {
22
+ persist(snapshot: EditWorkflowSnapshot<T>, result: EditWorkflowSubmitResult<T>): void | Promise<void>;
23
+ }
24
+ export interface EditAnnotationPersistenceSnapshot {
25
+ state: EditAnnotationPersistenceState;
26
+ reason?: string;
27
+ }
28
+ export interface EditSketchUndoSnapshot {
29
+ canUndo: boolean;
30
+ canRedo: boolean;
31
+ undoDepth: number;
32
+ redoDepth: number;
33
+ }
34
+ export interface EditSketchWorkflowSnapshot<T = Record<string, unknown>> {
35
+ sourceId: SourceId;
36
+ protocol: Protocol;
37
+ kind: EditWorkflowKind;
38
+ feature: CanonicalFeature<T>;
39
+ attachments: readonly EditAttachmentMutation[];
40
+ metadata: EditWorkflowMetadata;
41
+ sketch: {
42
+ status: EditSketchStatus;
43
+ activeTool?: EditSketchTool;
44
+ tool?: EditSketchTool;
45
+ tools: readonly EditSketchToolCapability[];
46
+ geometry: Record<string, unknown> | null | undefined;
47
+ };
48
+ dirty: boolean;
49
+ validation: EditWorkflowValidationResult;
50
+ undo: EditSketchUndoSnapshot;
51
+ annotations: EditAnnotationPersistenceSnapshot;
52
+ }
53
+ export declare class EditSketchWorkflowModel<T = Record<string, unknown>> {
54
+ #private;
55
+ readonly source: Source<T>;
56
+ readonly kind: EditWorkflowKind;
57
+ constructor(options: EditSketchWorkflowOptions<T>);
58
+ snapshot(): EditSketchWorkflowSnapshot<T>;
59
+ tools(): readonly EditSketchToolCapability[];
60
+ toolCapability(tool: EditSketchTool): EditSketchToolCapability;
61
+ startSketch(tool: EditSketchTool): EditSketchToolCapability;
62
+ setSketchGeometry(tool: EditSketchTool, geometry: Record<string, unknown> | null): this;
63
+ setValue(fieldName: string, value: unknown): this;
64
+ setValues(values: Partial<T>): this;
65
+ setId(id: FeatureId): this;
66
+ stageAttachmentAdd(attachment: Blob | File | string, options?: {
67
+ parentId?: FeatureId;
68
+ name?: string;
69
+ contentType?: string;
70
+ }): this;
71
+ stageAttachmentUpdate(attachmentId: FeatureId, attachment: Blob | File | string, options?: {
72
+ parentId?: FeatureId;
73
+ name?: string;
74
+ contentType?: string;
75
+ }): this;
76
+ stageAttachmentDelete(attachmentIds: readonly FeatureId[], options?: {
77
+ parentId?: FeatureId;
78
+ }): this;
79
+ undo(): boolean;
80
+ redo(): boolean;
81
+ discard(): void;
82
+ dirty(): boolean;
83
+ validate(): EditWorkflowValidationResult;
84
+ submit(overrides?: Partial<T>): Promise<EditWorkflowSubmitResult<T>>;
85
+ private undoState;
86
+ private sketchStatus;
87
+ private recordUndo;
88
+ private restore;
89
+ }
90
+ export declare function createEditSketchWorkflow<T = Record<string, unknown>>(options: EditSketchWorkflowOptions<T>): EditSketchWorkflowModel<T>;
91
+ //# sourceMappingURL=edit-sketch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-sketch.d.ts","sourceRoot":"","sources":["../../../src/contract/edit-sketch.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EAElC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE1F,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC9F,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,aAAa,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAA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