@arcgis/coding-components 5.1.0-next.55 → 5.1.0-next.57
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/dist/cdn/2XTHR2WZ.js +2 -0
- package/dist/cdn/3QKEF7NL.js +2 -0
- package/dist/cdn/{RJRCBNNO.js → 57WNN7NN.js} +1 -1
- package/dist/cdn/6E4U2MLJ.js +7 -0
- package/dist/cdn/{PKG2K3V2.js → A2OAI373.js} +1 -1
- package/dist/cdn/AAMHIVYL.js +2 -0
- package/dist/cdn/AHDVGYFC.js +2 -0
- package/dist/cdn/CZ2DJPO4.js +2 -0
- package/dist/cdn/D6BJOZGQ.js +2 -0
- package/dist/cdn/DGFH2WPL.js +2 -0
- package/dist/cdn/FLNLMLTL.js +2 -0
- package/dist/cdn/{UZJHWA6T.js → FUBRHCFC.js} +1 -1
- package/dist/cdn/{PVL67WGX.js → FYW5NKEJ.js} +1 -1
- package/dist/cdn/LSBKL6MO.js +6 -0
- package/dist/cdn/MVAB75O7.js +2 -0
- package/dist/cdn/QGCNEBN6.js +4 -0
- package/dist/cdn/SV4IPD4A.js +2 -0
- package/dist/cdn/T6RFLFX3.js +2 -0
- package/dist/cdn/TBTVVU6V.js +2 -0
- package/dist/cdn/V63C7RKJ.js +2 -0
- package/dist/cdn/{6YD47X7H.js → VILW5AVK.js} +1 -1
- package/dist/cdn/VPP77CFW.js +2 -0
- package/dist/cdn/W2PBO44R.js +12 -0
- package/dist/cdn/{4A2CLADY.js → WNKEPEXN.js} +1 -1
- package/dist/cdn/{54ZOADNQ.js → XU4GWM7C.js} +1 -1
- package/dist/cdn/YPMKBMXS.js +2 -0
- package/dist/cdn/ZCXZTSQU.js +2 -0
- package/dist/cdn/ZHZFKZA7.js +2 -0
- package/dist/cdn/assets/arcade-editor/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +119 -116
- package/dist/cdn/assets/code-editor/sql-layer.worker.js +10087 -0
- package/dist/cdn/assets/editor-variables/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/sql-expression-editor/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/sql-layer-editor/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/arcade-defaults.js +98 -96
- package/dist/chunks/arcade-service-accessors.js +40 -28
- package/dist/chunks/bigquery.js +186 -0
- package/dist/chunks/colorize.js +1 -1
- package/dist/chunks/fields.js +2 -2
- package/dist/chunks/language-defaults-base.js +733 -464
- package/dist/chunks/postgres.js +209 -0
- package/dist/chunks/setup-monaco-theme.js +28 -20
- package/dist/chunks/sql-expr-defaults.js +11 -10
- package/dist/chunks/sql-layer-defaults.js +231 -0
- package/dist/chunks/sql-layer-mode.js +301 -0
- package/dist/chunks/sqlServer.js +288 -0
- package/dist/chunks/utils.js +184 -0
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +134 -123
- package/dist/components/arcgis-arcade-editor/customElement.d.ts +17 -0
- package/dist/components/arcgis-arcade-editor/customElement.js +22 -22
- package/dist/components/arcgis-code-editor/customElement.d.ts +2 -1
- package/dist/components/arcgis-code-editor/customElement.js +91 -71
- package/dist/components/arcgis-editor-variables/customElement.js +50 -47
- package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +12 -0
- package/dist/components/arcgis-sql-expression-editor/customElement.js +17 -17
- package/dist/components/arcgis-sql-layer-editor/customElement.d.ts +50 -0
- package/dist/components/arcgis-sql-layer-editor/customElement.js +92 -0
- package/dist/components/arcgis-sql-layer-editor/index.d.ts +1 -0
- package/dist/components/arcgis-sql-layer-editor/index.js +7 -0
- package/dist/components/types.d.ts +79 -2
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/loader.js +6 -5
- package/dist/types/lumina.d.ts +9 -2
- package/dist/types/preact.d.ts +10 -2
- package/dist/types/react.d.ts +11 -2
- package/dist/types/stencil.d.ts +9 -2
- package/dist/utils/data-catalog-datastore.d.ts +170 -0
- package/package.json +5 -5
- package/dist/cdn/5CO7XWOT.js +0 -2
- package/dist/cdn/5FXY5U3T.js +0 -2
- package/dist/cdn/CYC4AWZE.js +0 -2
- package/dist/cdn/GVO3LEFV.js +0 -2
- package/dist/cdn/J5X2KSYD.js +0 -2
- package/dist/cdn/QHJAF7L3.js +0 -6
- package/dist/cdn/T7GEIGWF.js +0 -2
- package/dist/cdn/TAXRVBJC.js +0 -2
- package/dist/cdn/VR5CATAW.js +0 -2
- package/dist/cdn/WTNM2NCZ.js +0 -2
- package/dist/cdn/XEUG3X2W.js +0 -2
- package/dist/cdn/ZJCI6LP6.js +0 -12
- package/dist/cdn/ZSVJAJND.js +0 -4
|
@@ -1,269 +1,382 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getDeclaredVoxelMembers as
|
|
9
|
-
import { isNotNull as
|
|
10
|
-
import { addLtrMark as
|
|
11
|
-
import { s as
|
|
12
|
-
import { CompletionItemKind as
|
|
2
|
+
import { l as D, j as ie, o as re, p as se, q as ae, r as oe, s as ne, t as Q, u as d, v as j, w as le, x as ue, y as G, z as ce, A as pe, B as he, C as w, D as U, E as T, F as de, G as v, H as O, I as fe, n as _e } from "./utils.js";
|
|
3
|
+
import { p as me } from "./utilities.js";
|
|
4
|
+
import ye from "@arcgis/core/portal/PortalItem.js";
|
|
5
|
+
import be from "@arcgis/core/WebMap.js";
|
|
6
|
+
import ge from "@arcgis/core/WebScene.js";
|
|
7
|
+
import P from "@arcgis/core/layers/FeatureLayer.js";
|
|
8
|
+
import { getDeclaredVoxelMembers as De, getDeclaredPixelMembers as we } from "@arcgis/core/applications/Components/arcadeEditorUtils.js";
|
|
9
|
+
import { isNotNull as m, isNotUndefined as I } from "@arcgis/toolkit/predicate";
|
|
10
|
+
import { addLtrMark as Se, setValuesInString as R } from "@arcgis/toolkit/string";
|
|
11
|
+
import { s as C, f as J, a as Z, b as S, m as Ie } from "./fields.js";
|
|
12
|
+
import { CompletionItemKind as x, InsertTextFormat as V, InsertTextMode as M } from "vscode-languageserver-types";
|
|
13
13
|
import { log as h } from "@arcgis/toolkit/log";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
function S(t) {
|
|
62
|
-
return !!t && typeof t == "object" && "declaredClass" in t && t.declaredClass === "esri.layers.support.CodedValueDomain";
|
|
63
|
-
}
|
|
64
|
-
function me(t) {
|
|
65
|
-
return !!t && typeof t == "object" && "declaredClass" in t && t.declaredClass === "esri.layers.support.InheritedDomain";
|
|
66
|
-
}
|
|
67
|
-
function st(t) {
|
|
68
|
-
return !!t && typeof t == "object" && "id" in t && typeof t.id == "string" && "definitions" in t && typeof t.definitions == "object" && !Array.isArray(t.definitions);
|
|
69
|
-
}
|
|
70
|
-
function f(t) {
|
|
71
|
-
return !!t && typeof t == "object" && "title" in t && typeof t.title == "string";
|
|
72
|
-
}
|
|
73
|
-
function ge(t) {
|
|
74
|
-
return !!t && typeof t == "object" && "url" in t && typeof t.url == "string";
|
|
75
|
-
}
|
|
76
|
-
function Q(t) {
|
|
77
|
-
return !!t && typeof t == "object" && "layerId" in t && typeof t.layerId == "number";
|
|
14
|
+
import Ce from "@arcgis/core/core/Error.js";
|
|
15
|
+
import ve from "@arcgis/core/portal/Portal.js";
|
|
16
|
+
import { i as Fe } from "./monaco-importer.js";
|
|
17
|
+
import { g as Te } from "./runtime.js";
|
|
18
|
+
import { normalizeLocale as Pe } from "@arcgis/toolkit/intl";
|
|
19
|
+
import { filterApiLibraryForContext as xe } from "@arcgis/languages-api-utils";
|
|
20
|
+
import { Emitter as N, Uri as B } from "monaco-editor";
|
|
21
|
+
function Ve(s) {
|
|
22
|
+
switch (s) {
|
|
23
|
+
case "esriFieldTypeOID":
|
|
24
|
+
return "oid";
|
|
25
|
+
case "esriFieldTypeSmallInteger":
|
|
26
|
+
return "small-integer";
|
|
27
|
+
case "esriFieldTypeInteger":
|
|
28
|
+
return "integer";
|
|
29
|
+
case "esriFieldTypeBigInteger":
|
|
30
|
+
return "big-integer";
|
|
31
|
+
case "esriFieldTypeSingle":
|
|
32
|
+
return "single";
|
|
33
|
+
case "esriFieldTypeDouble":
|
|
34
|
+
return "double";
|
|
35
|
+
case "esriFieldTypeDate":
|
|
36
|
+
return "date";
|
|
37
|
+
case "esriFieldTypeDateOnly":
|
|
38
|
+
return "date-only";
|
|
39
|
+
case "esriFieldTypeTimeOnly":
|
|
40
|
+
return "time-only";
|
|
41
|
+
case "esriFieldTypeTimestampOffset":
|
|
42
|
+
return "timestamp-offset";
|
|
43
|
+
case "esriFieldTypeGUID":
|
|
44
|
+
return "guid";
|
|
45
|
+
case "esriFieldTypeGlobalID":
|
|
46
|
+
return "global-id";
|
|
47
|
+
case "esriFieldTypeString":
|
|
48
|
+
return "string";
|
|
49
|
+
case "esriFieldTypeGeometry":
|
|
50
|
+
return "geometry";
|
|
51
|
+
case "esriFieldTypeBlob":
|
|
52
|
+
return "blob";
|
|
53
|
+
case "esriFieldTypeRaster":
|
|
54
|
+
return "raster";
|
|
55
|
+
case "esriFieldTypeXML":
|
|
56
|
+
return "xml";
|
|
57
|
+
default:
|
|
58
|
+
return "string";
|
|
59
|
+
}
|
|
78
60
|
}
|
|
79
|
-
function
|
|
80
|
-
return
|
|
61
|
+
function Me(s) {
|
|
62
|
+
return {
|
|
63
|
+
fields: s.fields.map((e) => ({
|
|
64
|
+
name: e.name,
|
|
65
|
+
type: Ve(e.type),
|
|
66
|
+
serverType: e.type,
|
|
67
|
+
nullable: e.nullable
|
|
68
|
+
}))
|
|
69
|
+
};
|
|
81
70
|
}
|
|
82
|
-
function
|
|
83
|
-
return
|
|
71
|
+
function k(s) {
|
|
72
|
+
return typeof s?.query == "object" && s.query ? s.query : {};
|
|
84
73
|
}
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
class Le {
|
|
75
|
+
constructor(e) {
|
|
76
|
+
this.itemId = e.itemId, this.portal = e.portal, this.serviceUrl = e.serviceUrl, this._requestOptions = e.requestOptions;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Fetches information about the datastore.
|
|
80
|
+
*
|
|
81
|
+
* @public
|
|
82
|
+
* @since 5.1
|
|
83
|
+
* @param options - Additional options used for the request.
|
|
84
|
+
* @returns Resolves to datastore information.
|
|
85
|
+
*/
|
|
86
|
+
fetchInfo(e) {
|
|
87
|
+
return this.portal.request(this._datastoreUrl, this._createRequestOptions(e));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Fetches datasets for the datastore.
|
|
91
|
+
*
|
|
92
|
+
* @public
|
|
93
|
+
* @since 5.1
|
|
94
|
+
* @param options - Additional options used for the request.
|
|
95
|
+
* @returns Resolves to an array of dataset information.
|
|
96
|
+
*/
|
|
97
|
+
async fetchDatasets(e) {
|
|
98
|
+
return (await this.portal.request(
|
|
99
|
+
F(this._datastoreUrl, "datasets"),
|
|
100
|
+
this._createRequestOptions(e)
|
|
101
|
+
)).datasets;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Fetches the table description for the provided table name.
|
|
105
|
+
*
|
|
106
|
+
* @public
|
|
107
|
+
* @since 5.1
|
|
108
|
+
* @param tableName - The table name.
|
|
109
|
+
* @param options - Additional options used for the request.
|
|
110
|
+
* @returns Resolves to the table description.
|
|
111
|
+
*/
|
|
112
|
+
async fetchTableDescription(e, t) {
|
|
113
|
+
if (!e)
|
|
114
|
+
throw new Ce("portal:invalid-parameter", 'The "tableName" parameter must be provided.');
|
|
115
|
+
const i = await this.portal.request(
|
|
116
|
+
F(this._datastoreUrl, "tableDescription"),
|
|
117
|
+
{
|
|
118
|
+
...this._createRequestOptions(t),
|
|
119
|
+
query: {
|
|
120
|
+
...k(this._requestOptions),
|
|
121
|
+
...k(t),
|
|
122
|
+
tableName: e
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
return Me(i);
|
|
127
|
+
}
|
|
128
|
+
get _datastoreUrl() {
|
|
129
|
+
return F(this.serviceUrl, "datastores", encodeURIComponent(this.itemId));
|
|
130
|
+
}
|
|
131
|
+
_createRequestOptions(e) {
|
|
132
|
+
return {
|
|
133
|
+
...this._requestOptions,
|
|
134
|
+
...e
|
|
135
|
+
};
|
|
136
|
+
}
|
|
87
137
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
138
|
+
function F(s, ...e) {
|
|
139
|
+
const t = s.replaceAll(/\/+$/gu, ""), i = e.filter((r) => !!r).map((r) => r.replaceAll(/^\/+|\/+$/gu, ""));
|
|
140
|
+
return [t, ...i].join("/");
|
|
90
141
|
}
|
|
91
|
-
|
|
92
|
-
|
|
142
|
+
const $e = {
|
|
143
|
+
id: "ansi",
|
|
144
|
+
keywords: [],
|
|
145
|
+
functions: [],
|
|
146
|
+
operators: [],
|
|
147
|
+
specialChars: {
|
|
148
|
+
likeWildcardAny: "%",
|
|
149
|
+
likeWildcardOne: "_",
|
|
150
|
+
identifierQuote: { start: '"', end: '"' },
|
|
151
|
+
escapeKey: { start: null, end: null },
|
|
152
|
+
escapeClause: { keyword: "ESCAPE", suffix: null }
|
|
153
|
+
}
|
|
154
|
+
}, z = /* @__PURE__ */ new Map(), Ee = {
|
|
155
|
+
ansi: async () => await Promise.resolve($e),
|
|
156
|
+
bigquery: async () => (await import("./bigquery.js")).bigqueryDialect,
|
|
157
|
+
postgres: async () => (await import("./postgres.js")).postgresDialect,
|
|
158
|
+
sqlServer: async () => (await import("./sqlServer.js")).sqlServerDialect
|
|
159
|
+
};
|
|
160
|
+
async function Ae(s) {
|
|
161
|
+
const e = z.get(s);
|
|
162
|
+
if (e)
|
|
163
|
+
return await e;
|
|
164
|
+
const t = Ee[s]();
|
|
165
|
+
return z.set(s, t), await t;
|
|
93
166
|
}
|
|
94
|
-
|
|
95
|
-
|
|
167
|
+
const qe = [
|
|
168
|
+
"SELECT",
|
|
169
|
+
"FROM",
|
|
170
|
+
"WHERE",
|
|
171
|
+
"GROUP",
|
|
172
|
+
"BY",
|
|
173
|
+
"HAVING",
|
|
174
|
+
"ORDER",
|
|
175
|
+
"LIMIT",
|
|
176
|
+
"DISTINCT",
|
|
177
|
+
"AS",
|
|
178
|
+
"JOIN",
|
|
179
|
+
"LEFT",
|
|
180
|
+
"RIGHT",
|
|
181
|
+
"FULL",
|
|
182
|
+
"INNER",
|
|
183
|
+
"OUTER",
|
|
184
|
+
"CROSS",
|
|
185
|
+
"ON",
|
|
186
|
+
"USING",
|
|
187
|
+
"AND",
|
|
188
|
+
"OR",
|
|
189
|
+
"NOT",
|
|
190
|
+
"IN",
|
|
191
|
+
"IS",
|
|
192
|
+
"LIKE",
|
|
193
|
+
"BETWEEN",
|
|
194
|
+
"NULL",
|
|
195
|
+
"TRUE",
|
|
196
|
+
"FALSE",
|
|
197
|
+
"ASC",
|
|
198
|
+
"DESC"
|
|
199
|
+
], Ge = ["<=", ">=", "<>", "!=", "=", "<", ">", "+", "-", "*", "/", "%", "||"], Ue = (s, e = {}) => {
|
|
200
|
+
const t = new Set(e.baseKeywords ?? qe);
|
|
201
|
+
for (const r of s.keywords)
|
|
202
|
+
t.add(r.toUpperCase());
|
|
203
|
+
const i = new Set(e.baseOperators ?? Ge);
|
|
204
|
+
for (const r of s.operators)
|
|
205
|
+
i.add(r);
|
|
206
|
+
return {
|
|
207
|
+
keywords: Array.from(t),
|
|
208
|
+
functions: s.functions,
|
|
209
|
+
operators: Array.from(i),
|
|
210
|
+
specialChars: s.specialChars
|
|
211
|
+
};
|
|
212
|
+
}, _ = {
|
|
213
|
+
sqlServer: "sql-layer-sql-server",
|
|
214
|
+
postgres: "sql-layer-postgres",
|
|
215
|
+
bigquery: "sql-layer-bigquery"
|
|
216
|
+
}, W = _.postgres, Oe = {
|
|
217
|
+
[_.sqlServer]: "sqlServer",
|
|
218
|
+
[_.postgres]: "postgres",
|
|
219
|
+
[_.bigquery]: "bigquery"
|
|
220
|
+
// snowflake and oracle should be prioritized next
|
|
221
|
+
};
|
|
222
|
+
function Re(s) {
|
|
223
|
+
return Oe[s];
|
|
96
224
|
}
|
|
97
|
-
function
|
|
98
|
-
return
|
|
225
|
+
async function Ne(s) {
|
|
226
|
+
return Ue(await Ae(Re(s)));
|
|
99
227
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return t.isTable || "type" in t && t.type === "table";
|
|
104
|
-
if ("geometryType" in t)
|
|
105
|
-
return t.geometryType === "" || t.geometryType === "esriGeometryNull" || t.geometryType === null;
|
|
106
|
-
}
|
|
107
|
-
return !1;
|
|
228
|
+
const Be = /^[A-Za-z_][A-Za-z0-9_$]*$/u;
|
|
229
|
+
function ke(s) {
|
|
230
|
+
return s === "esriDBMS_PostgreSQL" ? W : s === "esriDBMS_SQLServer" ? _.sqlServer : W;
|
|
108
231
|
}
|
|
109
|
-
function
|
|
110
|
-
return
|
|
232
|
+
function It(s) {
|
|
233
|
+
return s.trim().toLowerCase();
|
|
111
234
|
}
|
|
112
|
-
function
|
|
113
|
-
return
|
|
235
|
+
function ze(s) {
|
|
236
|
+
return s.specialChars.identifierQuote;
|
|
114
237
|
}
|
|
115
|
-
function
|
|
116
|
-
|
|
238
|
+
function We(s, e) {
|
|
239
|
+
const t = s.trim();
|
|
240
|
+
return t ? Be.test(t) ? e.keywords.includes(t.toUpperCase()) : !0 : !1;
|
|
117
241
|
}
|
|
118
|
-
function
|
|
119
|
-
|
|
242
|
+
function X(s, e) {
|
|
243
|
+
const t = s.trim();
|
|
244
|
+
if (!t || !We(t, e))
|
|
245
|
+
return t;
|
|
246
|
+
const i = ze(e), r = t.replaceAll(i.end, `${i.end}${i.end}`);
|
|
247
|
+
return `${i.start}${r}${i.end}`;
|
|
120
248
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return null;
|
|
124
|
-
let e;
|
|
125
|
-
return D(t) ? e = t : e = new g(t), xe(e) && await e.load(), e;
|
|
249
|
+
function He(s, e) {
|
|
250
|
+
return s.split(".").map((t) => X(t, e)).join(".");
|
|
126
251
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const e = await te(t, { responseType: "json", query: { f: "json" } }), i = t.endsWith("MapServer/layers") ? "data" : "query", r = W(e.data?.layers, i), s = W(e.data?.tables, i);
|
|
130
|
-
return { layers: r, tables: s };
|
|
252
|
+
function Ct(s) {
|
|
253
|
+
return s.split(".").at(-1) ?? s;
|
|
131
254
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
134
|
-
switch (i.type) {
|
|
135
|
-
case "Feature Layer":
|
|
136
|
-
case "Oriented Imagery Layer":
|
|
137
|
-
case "Catalog Layer":
|
|
138
|
-
case "Table":
|
|
139
|
-
return (i.capabilities ? i.capabilities.toLowerCase().split(",").map((s) => s.trim()) : []).includes(e);
|
|
140
|
-
default:
|
|
141
|
-
return !1;
|
|
142
|
-
}
|
|
143
|
-
}) : [];
|
|
255
|
+
function Ke(s) {
|
|
256
|
+
return Ne(ke(s));
|
|
144
257
|
}
|
|
145
|
-
async function
|
|
146
|
-
const
|
|
147
|
-
return await
|
|
258
|
+
async function Qe(s, e) {
|
|
259
|
+
const t = new P({ url: `${s.url}/${e.relatedTableId}` });
|
|
260
|
+
return await t.load(), t;
|
|
148
261
|
}
|
|
149
|
-
function
|
|
150
|
-
return (e,
|
|
262
|
+
function L(s) {
|
|
263
|
+
return (e, t) => {
|
|
151
264
|
if (e.type === "oid")
|
|
152
265
|
return -1;
|
|
153
|
-
if (
|
|
266
|
+
if (t.type === "oid")
|
|
154
267
|
return 1;
|
|
155
|
-
if (
|
|
156
|
-
if (e.name ===
|
|
268
|
+
if (w(s)) {
|
|
269
|
+
if (e.name === s.subtypeField)
|
|
157
270
|
return -1;
|
|
158
|
-
if (
|
|
271
|
+
if (t.name === s.subtypeField)
|
|
159
272
|
return 1;
|
|
160
273
|
}
|
|
161
|
-
if (
|
|
162
|
-
if (e.name ===
|
|
274
|
+
if (T(s)) {
|
|
275
|
+
if (e.name === s.typeIdField)
|
|
163
276
|
return -1;
|
|
164
|
-
if (
|
|
277
|
+
if (t.name === s.typeIdField)
|
|
165
278
|
return 1;
|
|
166
279
|
}
|
|
167
|
-
return e.name.localeCompare(
|
|
280
|
+
return e.name.localeCompare(t.name, "en", { sensitivity: "base" });
|
|
168
281
|
};
|
|
169
282
|
}
|
|
170
|
-
function
|
|
171
|
-
return
|
|
283
|
+
function H(s, e) {
|
|
284
|
+
return s?.every((t) => t.domains?.[e.name]?.type === "inherited") ?? !1;
|
|
172
285
|
}
|
|
173
|
-
const
|
|
174
|
-
function
|
|
175
|
-
return
|
|
286
|
+
const je = /^[a-z_$][a-z0-9_$]*$/giu;
|
|
287
|
+
function $(s, e = !0) {
|
|
288
|
+
return s.match(je) ? `${e ? "." : ""}${s}` : `["${s}"]`;
|
|
176
289
|
}
|
|
177
|
-
function Y(
|
|
178
|
-
return
|
|
290
|
+
function Y(s, e) {
|
|
291
|
+
return s ? `${s}${$(e)}` : e;
|
|
179
292
|
}
|
|
180
|
-
function
|
|
181
|
-
return
|
|
293
|
+
function K(s) {
|
|
294
|
+
return ce(s) ? s.portalItem : null;
|
|
182
295
|
}
|
|
183
|
-
function
|
|
184
|
-
let
|
|
185
|
-
const
|
|
186
|
-
return
|
|
187
|
-
|
|
296
|
+
function vt(s, e, t = !1) {
|
|
297
|
+
let i = e;
|
|
298
|
+
const r = [], a = [];
|
|
299
|
+
return C(s).forEach((o) => {
|
|
300
|
+
i && (i += `
|
|
188
301
|
|
|
189
|
-
`),
|
|
190
|
-
${o.type}`, o.description && (
|
|
302
|
+
`), i += `**${o.name}** (${o.alias})
|
|
303
|
+
${o.type}`, o.description && (i += `
|
|
191
304
|
'${o.description}`);
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
305
|
+
const p = Z(o), c = $(o.name, !1), g = S(o);
|
|
306
|
+
if (r.push({
|
|
194
307
|
name: o.name,
|
|
195
|
-
description:
|
|
196
|
-
type:
|
|
308
|
+
description: g,
|
|
309
|
+
type: p,
|
|
197
310
|
completion: {
|
|
198
311
|
label: o.name,
|
|
199
|
-
detail:
|
|
200
|
-
insertText:
|
|
201
|
-
insertTextMode:
|
|
202
|
-
insertTextFormat:
|
|
203
|
-
kind:
|
|
312
|
+
detail: g,
|
|
313
|
+
insertText: c,
|
|
314
|
+
insertTextMode: M.asIs,
|
|
315
|
+
insertTextFormat: V.PlainText,
|
|
316
|
+
kind: x.Field
|
|
204
317
|
}
|
|
205
|
-
}),
|
|
318
|
+
}), t) {
|
|
206
319
|
if (!o.alias || o.alias.toLowerCase() === o.name.toLowerCase())
|
|
207
320
|
return;
|
|
208
|
-
let
|
|
321
|
+
let f = `**${o.alias}**
|
|
209
322
|
${o.type}`;
|
|
210
|
-
o.description && (
|
|
211
|
-
'${o.description}`),
|
|
323
|
+
o.description && (f += `
|
|
324
|
+
'${o.description}`), a.push({
|
|
212
325
|
name: o.alias,
|
|
213
326
|
description: o.name,
|
|
214
|
-
type:
|
|
327
|
+
type: p,
|
|
215
328
|
completion: {
|
|
216
329
|
label: o.alias,
|
|
217
330
|
detail: o.name,
|
|
218
|
-
insertText:
|
|
219
|
-
insertTextMode:
|
|
220
|
-
insertTextFormat:
|
|
221
|
-
kind:
|
|
222
|
-
documentation: { kind: "markdown", value:
|
|
331
|
+
insertText: c,
|
|
332
|
+
insertTextMode: M.asIs,
|
|
333
|
+
insertTextFormat: V.PlainText,
|
|
334
|
+
kind: x.Field,
|
|
335
|
+
documentation: { kind: "markdown", value: f }
|
|
223
336
|
}
|
|
224
337
|
});
|
|
225
338
|
}
|
|
226
|
-
}), [[...
|
|
339
|
+
}), [[...r, ...a], i];
|
|
227
340
|
}
|
|
228
|
-
function
|
|
229
|
-
let
|
|
230
|
-
const
|
|
231
|
-
return
|
|
232
|
-
|
|
341
|
+
function Ft(s, e) {
|
|
342
|
+
let t = e;
|
|
343
|
+
const i = [];
|
|
344
|
+
return s.forEach((r) => {
|
|
345
|
+
t && (t += `
|
|
233
346
|
|
|
234
|
-
`),
|
|
235
|
-
${
|
|
236
|
-
'${
|
|
237
|
-
name:
|
|
238
|
-
description:
|
|
347
|
+
`), t += `**${r.name}**
|
|
348
|
+
${r.type}`, r.name && (t += `
|
|
349
|
+
'${r.name}`), i.push({
|
|
350
|
+
name: r.name,
|
|
351
|
+
description: r.name,
|
|
239
352
|
// pixel members are always arrays
|
|
240
353
|
type: "array",
|
|
241
354
|
completion: {
|
|
242
|
-
label:
|
|
243
|
-
detail:
|
|
244
|
-
insertText:
|
|
245
|
-
insertTextMode:
|
|
246
|
-
insertTextFormat:
|
|
247
|
-
kind:
|
|
355
|
+
label: r.name,
|
|
356
|
+
detail: r.name,
|
|
357
|
+
insertText: $(r.name, !1),
|
|
358
|
+
insertTextMode: M.asIs,
|
|
359
|
+
insertTextFormat: V.PlainText,
|
|
360
|
+
kind: x.Field
|
|
248
361
|
}
|
|
249
362
|
});
|
|
250
|
-
}), [
|
|
363
|
+
}), [i, t];
|
|
251
364
|
}
|
|
252
|
-
class
|
|
253
|
-
constructor(e,
|
|
254
|
-
this._profile = e, this._label =
|
|
365
|
+
class ee {
|
|
366
|
+
constructor(e, t, i) {
|
|
367
|
+
this._profile = e, this._label = t, this.description = i, this.filterDescription = !1;
|
|
255
368
|
}
|
|
256
369
|
/**
|
|
257
370
|
* Returns the label string.
|
|
258
371
|
*/
|
|
259
372
|
getLabel() {
|
|
260
|
-
return this._label == null ? "" : typeof this._label == "string" ?
|
|
373
|
+
return this._label == null ? "" : typeof this._label == "string" ? Se(this._label) : R(this._profile?.intlStrings[this._label.code], this._label.formatValues);
|
|
261
374
|
}
|
|
262
375
|
/**
|
|
263
376
|
* Returns the description string.
|
|
264
377
|
*/
|
|
265
378
|
getDescription() {
|
|
266
|
-
return this.description == null ? "" : typeof this.description == "string" ? this.description :
|
|
379
|
+
return this.description == null ? "" : typeof this.description == "string" ? this.description : R(this._profile?.intlStrings[this.description.code], this.description.formatValues);
|
|
267
380
|
}
|
|
268
381
|
/**
|
|
269
382
|
* Returns true if the item pass the filter test
|
|
@@ -272,12 +385,12 @@ class Z {
|
|
|
272
385
|
return !e || e.test(this.getLabel()) ? !0 : this.filterDescription && e.test(this.getDescription());
|
|
273
386
|
}
|
|
274
387
|
}
|
|
275
|
-
class
|
|
388
|
+
class E extends ee {
|
|
276
389
|
constructor(e) {
|
|
277
390
|
super(e.profile, e.label, e.description ?? e.declaration?.description), this.declaration = e.declaration ?? {}, this.name = e.declaration?.name ?? "", this.snippet = e.snippet ?? "", this.nonInteractive = e.nonInteractive ?? !1, this.filterDescription = e.filterDescription ?? !1, this.icon = e.icon;
|
|
278
391
|
}
|
|
279
392
|
}
|
|
280
|
-
class l extends
|
|
393
|
+
class l extends E {
|
|
281
394
|
constructor(e) {
|
|
282
395
|
super(e), this.type = "text", this.isCollection = !1, this.type = e.declaration?.type ?? "text";
|
|
283
396
|
}
|
|
@@ -288,7 +401,7 @@ class l extends M {
|
|
|
288
401
|
return { type: this.type, name: "", ...this.declaration };
|
|
289
402
|
}
|
|
290
403
|
}
|
|
291
|
-
class
|
|
404
|
+
class Je extends E {
|
|
292
405
|
constructor(e) {
|
|
293
406
|
super(e), this.type = "array", this.isCollection = !1, this.elementType = e.declaration?.elementType ?? { type: "number", name: "number" };
|
|
294
407
|
}
|
|
@@ -299,9 +412,9 @@ class Me extends M {
|
|
|
299
412
|
return { type: this.type, elementType: this.elementType, name: "", ...this.declaration };
|
|
300
413
|
}
|
|
301
414
|
}
|
|
302
|
-
class
|
|
303
|
-
constructor(e,
|
|
304
|
-
super(
|
|
415
|
+
class b extends E {
|
|
416
|
+
constructor(e, t) {
|
|
417
|
+
super(t), this.owner = e, this.isCollection = !0, this._loaded = !0, this.variables = [];
|
|
305
418
|
}
|
|
306
419
|
get breadcrumb() {
|
|
307
420
|
if (this.owner) {
|
|
@@ -326,17 +439,17 @@ class $ extends M {
|
|
|
326
439
|
return "";
|
|
327
440
|
}
|
|
328
441
|
}
|
|
329
|
-
class u extends
|
|
330
|
-
constructor(e,
|
|
331
|
-
super(e,
|
|
442
|
+
class u extends ee {
|
|
443
|
+
constructor(e, t, i = [], r = !1) {
|
|
444
|
+
super(e, t), this.variables = i, this.isHeader = r, this.type = "group", this.isCollection = !0;
|
|
332
445
|
}
|
|
333
446
|
passFilter() {
|
|
334
447
|
return !0;
|
|
335
448
|
}
|
|
336
449
|
}
|
|
337
|
-
class
|
|
338
|
-
constructor(e,
|
|
339
|
-
super(e,
|
|
450
|
+
class y extends b {
|
|
451
|
+
constructor(e, t) {
|
|
452
|
+
super(e, t), this.type = "dictionary", this.dictionaryVariables = [], this.loadPropertyDeclarations(t.declaration?.properties), this.snippet && this.dictionaryVariables.length && (this.variables = [new u(this._profile, this.snippet, this.dictionaryVariables)]);
|
|
340
453
|
}
|
|
341
454
|
async loadSource() {
|
|
342
455
|
}
|
|
@@ -346,14 +459,14 @@ class _ extends $ {
|
|
|
346
459
|
createVariableInstances(e) {
|
|
347
460
|
if (!Array.isArray(e))
|
|
348
461
|
return [];
|
|
349
|
-
const
|
|
350
|
-
return e.forEach((
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
}),
|
|
462
|
+
const t = [];
|
|
463
|
+
return e.forEach((i) => {
|
|
464
|
+
const r = this.createVariableInstance(i);
|
|
465
|
+
r && t.push(r);
|
|
466
|
+
}), t;
|
|
354
467
|
}
|
|
355
468
|
createVariableInstance(e) {
|
|
356
|
-
const
|
|
469
|
+
const t = Y(this.snippet, e.name);
|
|
357
470
|
switch (e.type) {
|
|
358
471
|
case "number":
|
|
359
472
|
case "text":
|
|
@@ -363,38 +476,40 @@ class _ extends $ {
|
|
|
363
476
|
case "time":
|
|
364
477
|
case "geometry":
|
|
365
478
|
case "knowledgeGraph":
|
|
366
|
-
return new l({ profile: this._profile, declaration: e, label:
|
|
479
|
+
return new l({ profile: this._profile, declaration: e, label: t, snippet: t });
|
|
367
480
|
case "pixel":
|
|
368
|
-
return new
|
|
481
|
+
return new Ye(this, { profile: this._profile, declaration: e, label: t, snippet: t });
|
|
369
482
|
case "voxel":
|
|
370
|
-
return new
|
|
483
|
+
return new Xe(this, { profile: this._profile, declaration: e, label: t, snippet: t });
|
|
371
484
|
case "feature":
|
|
372
|
-
return new
|
|
485
|
+
return new Ze(this, { profile: this._profile, declaration: e, label: t, snippet: t });
|
|
373
486
|
case "featureSet":
|
|
374
|
-
return new
|
|
375
|
-
new l({ profile: this._profile, label:
|
|
487
|
+
return new q(this, { profile: this._profile, declaration: e, label: t, snippet: t }, [
|
|
488
|
+
new l({ profile: this._profile, label: t, description: "", snippet: t })
|
|
376
489
|
]);
|
|
377
490
|
case "featureSetCollection":
|
|
378
|
-
return new
|
|
491
|
+
return new et(this, {
|
|
379
492
|
profile: this._profile,
|
|
380
493
|
declaration: e,
|
|
381
|
-
label:
|
|
382
|
-
snippet:
|
|
494
|
+
label: t,
|
|
495
|
+
snippet: t
|
|
383
496
|
});
|
|
384
497
|
case "dictionary":
|
|
385
|
-
return new
|
|
498
|
+
return new y(this, {
|
|
386
499
|
profile: this._profile,
|
|
387
500
|
declaration: e,
|
|
388
|
-
label:
|
|
389
|
-
snippet:
|
|
501
|
+
label: t,
|
|
502
|
+
snippet: t
|
|
390
503
|
});
|
|
391
504
|
case "array":
|
|
392
|
-
return new
|
|
505
|
+
return new Je({
|
|
393
506
|
profile: this._profile,
|
|
394
507
|
declaration: e,
|
|
395
|
-
label:
|
|
396
|
-
snippet:
|
|
508
|
+
label: t,
|
|
509
|
+
snippet: t
|
|
397
510
|
});
|
|
511
|
+
case "dataCatalogDatastore":
|
|
512
|
+
return new tt(this, { profile: this._profile, declaration: e, label: t, snippet: t });
|
|
398
513
|
default:
|
|
399
514
|
return h("error", "Editor profile", "Invalid profile variable", { detail: { declaration: e } }), null;
|
|
400
515
|
}
|
|
@@ -408,228 +523,228 @@ class _ extends $ {
|
|
|
408
523
|
};
|
|
409
524
|
}
|
|
410
525
|
}
|
|
411
|
-
class
|
|
412
|
-
constructor(e,
|
|
413
|
-
super(e,
|
|
526
|
+
class te extends b {
|
|
527
|
+
constructor(e, t, i) {
|
|
528
|
+
super(e, t), this.relationshipsProperties = i, this._source = null, this._loaded = !1, this._definition = t.declaration?.definition;
|
|
414
529
|
}
|
|
415
530
|
get title() {
|
|
416
|
-
return
|
|
531
|
+
return d(this._source) ? this._source.title ?? "" : "";
|
|
417
532
|
}
|
|
418
533
|
get url() {
|
|
419
|
-
return
|
|
534
|
+
return pe(this._source) ? this._source.url ?? "" : "";
|
|
420
535
|
}
|
|
421
536
|
get informationUrl() {
|
|
422
|
-
return !this.loaded || !this.url ? null :
|
|
537
|
+
return !this.loaded || !this.url ? null : he(this._source) ? `${this.url}/${this._source.layerId}` : this.url;
|
|
423
538
|
}
|
|
424
539
|
get informationType() {
|
|
425
540
|
return this._profile?.intlStrings.layer ?? "layer";
|
|
426
541
|
}
|
|
427
542
|
async loadSource() {
|
|
428
|
-
return
|
|
543
|
+
return m(this._loadPromise) && I(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadSource(), await this._loadPromise);
|
|
429
544
|
}
|
|
430
545
|
_getValueSnippet(e) {
|
|
431
546
|
return ["feature", "voxel", "pixel"].includes(this.type) ? Y(this.snippet, e.name) : e.name;
|
|
432
547
|
}
|
|
433
548
|
_getSubtypeOrDomainNameSnippet(e) {
|
|
434
|
-
return this.type !== "feature" ? null :
|
|
549
|
+
return this.type !== "feature" ? null : w(this._source) && e.name === this._source.subtypeField ? `SubtypeName(${this.snippet})` : `DomainName(${this.snippet}, "${e.name}")`;
|
|
435
550
|
}
|
|
436
|
-
_getFieldProperty(e,
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
return
|
|
440
|
-
const
|
|
551
|
+
_getFieldProperty(e, t) {
|
|
552
|
+
const i = this._getDomainDictionary(e);
|
|
553
|
+
if (i)
|
|
554
|
+
return i;
|
|
555
|
+
const r = this._getValueSnippet(e);
|
|
441
556
|
return new l({
|
|
442
557
|
profile: this._profile,
|
|
443
|
-
label:
|
|
444
|
-
description:
|
|
445
|
-
snippet:
|
|
446
|
-
icon:
|
|
558
|
+
label: r,
|
|
559
|
+
description: S(e),
|
|
560
|
+
snippet: r,
|
|
561
|
+
icon: J(e, t),
|
|
447
562
|
filterDescription: !0
|
|
448
563
|
});
|
|
449
564
|
}
|
|
450
565
|
_getMemberProperty(e) {
|
|
451
|
-
const
|
|
566
|
+
const t = this._getValueSnippet(e);
|
|
452
567
|
return new l({
|
|
453
568
|
profile: this._profile,
|
|
454
|
-
label:
|
|
569
|
+
label: t,
|
|
455
570
|
description: e.name,
|
|
456
|
-
snippet:
|
|
457
|
-
icon:
|
|
571
|
+
snippet: t,
|
|
572
|
+
icon: Ie(e),
|
|
458
573
|
filterDescription: !0
|
|
459
574
|
});
|
|
460
575
|
}
|
|
461
576
|
_getDomainDictionary(e) {
|
|
462
|
-
return U(this._source) ?
|
|
577
|
+
return U(this._source) ? w(this._source) && this._source.subtypeField ? this._getSubtypeDomainDictionary(e) : T(this._source) && this._source.typeIdField ? this._getFeatureTypeDomainDictionary(e) : this._getFieldDomainDictionary(e) : null;
|
|
463
578
|
}
|
|
464
579
|
_getSubtypeDomainDictionary(e) {
|
|
465
|
-
if (!
|
|
580
|
+
if (!w(this._source))
|
|
466
581
|
return null;
|
|
467
|
-
if (!
|
|
582
|
+
if (!de(this._source))
|
|
468
583
|
return e.name === this._source.subtypeField ? null : this._getFieldDomainDictionary(e);
|
|
469
584
|
if (e.name === this._source.subtypeField) {
|
|
470
|
-
const
|
|
471
|
-
return
|
|
585
|
+
const r = this._createDomainDictionary(e);
|
|
586
|
+
return r.icon = "subtype", r.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes, e)), r;
|
|
472
587
|
}
|
|
473
|
-
if (
|
|
588
|
+
if (H(this._source.subtypes, e))
|
|
474
589
|
return this._getFieldDomainDictionary(e);
|
|
475
|
-
const
|
|
476
|
-
if (!
|
|
590
|
+
const t = this._getDomainValuesGroup(this._source.subtypes, e);
|
|
591
|
+
if (!t)
|
|
477
592
|
return null;
|
|
478
|
-
const
|
|
479
|
-
return
|
|
593
|
+
const i = this._createDomainDictionary(e);
|
|
594
|
+
return i.variables.push(t), i;
|
|
480
595
|
}
|
|
481
596
|
_getFeatureTypeDomainDictionary(e) {
|
|
482
|
-
if (!
|
|
597
|
+
if (!T(this._source))
|
|
483
598
|
return null;
|
|
484
599
|
if (e.name === this._source.typeIdField) {
|
|
485
|
-
const
|
|
486
|
-
return
|
|
600
|
+
const r = this._createDomainDictionary(e);
|
|
601
|
+
return r.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types, e)), r;
|
|
487
602
|
}
|
|
488
|
-
if (
|
|
603
|
+
if (H(this._source.types, e))
|
|
489
604
|
return this._getFieldDomainDictionary(e);
|
|
490
|
-
const
|
|
491
|
-
if (!
|
|
605
|
+
const t = this._getDomainValuesGroup(this._source.types, e);
|
|
606
|
+
if (!t)
|
|
492
607
|
return null;
|
|
493
|
-
const
|
|
494
|
-
return
|
|
608
|
+
const i = this._createDomainDictionary(e);
|
|
609
|
+
return i.variables.push(t), i;
|
|
495
610
|
}
|
|
496
611
|
_getFieldDomainDictionary(e) {
|
|
497
612
|
if (!U(this._source))
|
|
498
613
|
return null;
|
|
499
|
-
const
|
|
500
|
-
if (!
|
|
614
|
+
const t = this._source.getFieldDomain(e.name);
|
|
615
|
+
if (!v(t))
|
|
501
616
|
return null;
|
|
502
|
-
const
|
|
617
|
+
const i = this._getCodedValueDomainGroup(t, {
|
|
503
618
|
code: "domainvalues"
|
|
504
|
-
}),
|
|
505
|
-
return
|
|
506
|
-
}
|
|
507
|
-
_getTypeOrSubtypeDomainGroup(e,
|
|
508
|
-
if (
|
|
509
|
-
return this._getCodedValueDomainGroup(
|
|
510
|
-
const
|
|
511
|
-
const
|
|
619
|
+
}), r = this._createDomainDictionary(e);
|
|
620
|
+
return r.variables.push(i), r;
|
|
621
|
+
}
|
|
622
|
+
_getTypeOrSubtypeDomainGroup(e, t) {
|
|
623
|
+
if (v(t.domain))
|
|
624
|
+
return this._getCodedValueDomainGroup(t.domain, { code: "subtypes" });
|
|
625
|
+
const i = e?.map((r) => {
|
|
626
|
+
const a = O(r) ? r.code : r.id;
|
|
512
627
|
return new l({
|
|
513
628
|
profile: this._profile,
|
|
514
|
-
label: `${
|
|
515
|
-
description:
|
|
516
|
-
snippet: `"${
|
|
629
|
+
label: `${a}`,
|
|
630
|
+
description: r.name,
|
|
631
|
+
snippet: `"${a}"`
|
|
517
632
|
});
|
|
518
633
|
}) ?? [];
|
|
519
|
-
return new u(this._profile, { code: "subtypes" },
|
|
634
|
+
return new u(this._profile, { code: "subtypes" }, i);
|
|
520
635
|
}
|
|
521
|
-
_getCodedValueDomainGroup(e,
|
|
522
|
-
const
|
|
523
|
-
(
|
|
636
|
+
_getCodedValueDomainGroup(e, t) {
|
|
637
|
+
const i = e.codedValues.map(
|
|
638
|
+
(r) => new l({
|
|
524
639
|
profile: this._profile,
|
|
525
|
-
label: `${
|
|
526
|
-
description:
|
|
527
|
-
snippet: `"${
|
|
640
|
+
label: `${r.code}`,
|
|
641
|
+
description: r.name,
|
|
642
|
+
snippet: `"${r.code}"`,
|
|
528
643
|
filterDescription: !0
|
|
529
644
|
})
|
|
530
645
|
);
|
|
531
|
-
return new u(this._profile,
|
|
646
|
+
return new u(this._profile, t, i);
|
|
532
647
|
}
|
|
533
|
-
_getDomainValuesGroup(e,
|
|
534
|
-
const
|
|
535
|
-
return !e || e.length === 0 || (e.forEach((
|
|
536
|
-
const
|
|
537
|
-
if (!
|
|
648
|
+
_getDomainValuesGroup(e, t) {
|
|
649
|
+
const i = [];
|
|
650
|
+
return !e || e.length === 0 || (e.forEach((r) => {
|
|
651
|
+
const a = r.domains?.[t.name];
|
|
652
|
+
if (!a || fe(a) || !v(a))
|
|
538
653
|
return;
|
|
539
|
-
const
|
|
654
|
+
const n = S(t), o = this._getCodedValueDomainGroup(a, {
|
|
540
655
|
code: "domainvaluesfortypeformat",
|
|
541
656
|
formatValues: {
|
|
542
|
-
fieldName:
|
|
543
|
-
typeName:
|
|
657
|
+
fieldName: n,
|
|
658
|
+
typeName: r.name
|
|
544
659
|
}
|
|
545
|
-
}),
|
|
660
|
+
}), p = O(r) ? r.code : r.id, c = `${p}`, g = `"${p}""`, f = new y(this, {
|
|
546
661
|
profile: this._profile,
|
|
547
|
-
label:
|
|
548
|
-
snippet:
|
|
549
|
-
description:
|
|
550
|
-
declaration: { name:
|
|
662
|
+
label: c,
|
|
663
|
+
snippet: g,
|
|
664
|
+
description: r.name,
|
|
665
|
+
declaration: { name: n }
|
|
551
666
|
});
|
|
552
|
-
|
|
553
|
-
}), !
|
|
667
|
+
f.variables = [o], i.push(f);
|
|
668
|
+
}), !i.length) ? null : new u(this._profile, { code: "domainvaluesbysubtypes" }, i);
|
|
554
669
|
}
|
|
555
670
|
_createDomainDictionary(e) {
|
|
556
|
-
const
|
|
671
|
+
const t = this._getValueSnippet(e), i = S(e), r = new y(this, {
|
|
557
672
|
profile: this._profile,
|
|
558
|
-
label:
|
|
559
|
-
description:
|
|
560
|
-
snippet:
|
|
673
|
+
label: t,
|
|
674
|
+
description: i,
|
|
675
|
+
snippet: t,
|
|
561
676
|
icon: "form-dropdown",
|
|
562
677
|
declaration: { name: e.name }
|
|
563
|
-
}),
|
|
678
|
+
}), a = new u(this._profile, i, [
|
|
564
679
|
new l({
|
|
565
680
|
profile: this._profile,
|
|
566
|
-
label:
|
|
681
|
+
label: t,
|
|
567
682
|
description: "",
|
|
568
|
-
snippet:
|
|
683
|
+
snippet: t
|
|
569
684
|
})
|
|
570
685
|
]);
|
|
571
|
-
|
|
572
|
-
const
|
|
573
|
-
return
|
|
686
|
+
r.variables = [a];
|
|
687
|
+
const n = this._getSubtypeOrDomainNameSnippet(e);
|
|
688
|
+
return n && a.variables.push(
|
|
574
689
|
new l({
|
|
575
690
|
profile: this._profile,
|
|
576
|
-
label:
|
|
691
|
+
label: n,
|
|
577
692
|
description: "",
|
|
578
|
-
snippet:
|
|
693
|
+
snippet: n
|
|
579
694
|
})
|
|
580
|
-
),
|
|
695
|
+
), r;
|
|
581
696
|
}
|
|
582
697
|
async _getRelationshipsProperty() {
|
|
583
698
|
if (!this.relationshipsProperties?.exposeRelationships || !this._profile?.supportFeatureSetFunctions)
|
|
584
699
|
return null;
|
|
585
700
|
const e = this._source;
|
|
586
|
-
if (!
|
|
701
|
+
if (!_e(e))
|
|
587
702
|
return null;
|
|
588
|
-
const
|
|
589
|
-
e.relationships?.map(async (
|
|
590
|
-
const
|
|
591
|
-
if (!
|
|
703
|
+
const t = new u(this._profile, { code: "relationships" }), i = await Promise.all(
|
|
704
|
+
e.relationships?.map(async (r) => {
|
|
705
|
+
const a = await Qe(e, r);
|
|
706
|
+
if (!Q(a) || r.relatedTableId === this.relationshipsProperties?.sourceTableId)
|
|
592
707
|
return null;
|
|
593
|
-
const
|
|
594
|
-
return new
|
|
708
|
+
const n = `FeatureSetByRelationshipName(${this.snippet}, "${r.name}")`;
|
|
709
|
+
return new q(
|
|
595
710
|
this,
|
|
596
711
|
{
|
|
597
712
|
profile: this._profile,
|
|
598
|
-
declaration: { definition:
|
|
599
|
-
label:
|
|
713
|
+
declaration: { definition: a },
|
|
714
|
+
label: a.title,
|
|
600
715
|
description: "",
|
|
601
716
|
nonInteractive: !0
|
|
602
717
|
},
|
|
603
|
-
[new l({ profile: this._profile, label:
|
|
718
|
+
[new l({ profile: this._profile, label: n, description: "", snippet: n })],
|
|
604
719
|
{ exposeRelationships: !0, sourceTableId: e.layerId }
|
|
605
720
|
);
|
|
606
721
|
}) ?? []
|
|
607
722
|
);
|
|
608
|
-
return
|
|
723
|
+
return t.variables = i.filter(m), t.variables.length ? t : null;
|
|
609
724
|
}
|
|
610
725
|
}
|
|
611
|
-
class
|
|
612
|
-
constructor(e, i, r
|
|
613
|
-
super(e,
|
|
726
|
+
class A extends te {
|
|
727
|
+
constructor(e, t, i, r = { exposeRelationships: !0 }) {
|
|
728
|
+
super(e, t, r), this.type = i;
|
|
614
729
|
}
|
|
615
730
|
get title() {
|
|
616
|
-
return
|
|
731
|
+
return d(this._source) ? this._source.title ?? "" : { code: this.type };
|
|
617
732
|
}
|
|
618
733
|
toProfileVariableDefinition() {
|
|
619
734
|
return { type: this.type, name: "", ...this.declaration };
|
|
620
735
|
}
|
|
621
736
|
}
|
|
622
|
-
class
|
|
623
|
-
constructor(e,
|
|
624
|
-
super(e,
|
|
737
|
+
class Ze extends A {
|
|
738
|
+
constructor(e, t) {
|
|
739
|
+
super(e, t, "feature", { exposeRelationships: !0 }), this.type = "feature";
|
|
625
740
|
}
|
|
626
741
|
async _loadSource() {
|
|
627
742
|
if (this.loaded)
|
|
628
743
|
return this._source;
|
|
629
744
|
try {
|
|
630
|
-
if (this._source = await
|
|
745
|
+
if (this._source = await j(this._definition), !this._source)
|
|
631
746
|
throw new Error("Invalid definition");
|
|
632
|
-
const e =
|
|
747
|
+
const e = d(this._source) ? this._source.title ?? "" : "";
|
|
633
748
|
this.variables.push(
|
|
634
749
|
new u(this._profile, e, [
|
|
635
750
|
new l({
|
|
@@ -640,25 +755,25 @@ class $e extends L {
|
|
|
640
755
|
})
|
|
641
756
|
])
|
|
642
757
|
);
|
|
643
|
-
const
|
|
644
|
-
if (this.variables.push(
|
|
645
|
-
const
|
|
758
|
+
const t = new u(this._profile, { code: "values" });
|
|
759
|
+
if (this.variables.push(t), le(this._source)) {
|
|
760
|
+
const a = `Geometry(${this.snippet})`, n = new l({
|
|
646
761
|
profile: this._profile,
|
|
647
|
-
declaration: { name:
|
|
648
|
-
label:
|
|
762
|
+
declaration: { name: a },
|
|
763
|
+
label: a,
|
|
649
764
|
description: "Geometry",
|
|
650
|
-
snippet:
|
|
765
|
+
snippet: a,
|
|
651
766
|
icon: "shapes",
|
|
652
767
|
filterDescription: !0
|
|
653
768
|
});
|
|
654
|
-
|
|
769
|
+
t.variables.push(n);
|
|
655
770
|
}
|
|
656
|
-
const
|
|
657
|
-
|
|
658
|
-
|
|
771
|
+
const i = this._source;
|
|
772
|
+
C(this._source.fields).map((a) => i.fields.find((n) => n.name === a.name)).sort(L(i)).forEach((a) => {
|
|
773
|
+
t.variables.push(this._getFieldProperty(a));
|
|
659
774
|
});
|
|
660
|
-
const
|
|
661
|
-
|
|
775
|
+
const r = await this._getRelationshipsProperty();
|
|
776
|
+
r && this.variables.push(r);
|
|
662
777
|
} catch (e) {
|
|
663
778
|
h("error", "FeatureVariable", "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
|
|
664
779
|
} finally {
|
|
@@ -667,19 +782,19 @@ class $e extends L {
|
|
|
667
782
|
return this._source;
|
|
668
783
|
}
|
|
669
784
|
}
|
|
670
|
-
class
|
|
671
|
-
constructor(e,
|
|
672
|
-
super(e,
|
|
785
|
+
class Xe extends A {
|
|
786
|
+
constructor(e, t) {
|
|
787
|
+
super(e, t, "voxel", { exposeRelationships: !1 }), this.type = "voxel", this._source = null;
|
|
673
788
|
}
|
|
674
789
|
async _loadSource() {
|
|
675
790
|
if (this.loaded)
|
|
676
791
|
return this._source;
|
|
677
792
|
try {
|
|
678
|
-
if (!
|
|
793
|
+
if (!ue(this._definition))
|
|
679
794
|
throw new Error("Invalid definition - not a VoxelLayer");
|
|
680
795
|
if (await this._definition.load(), this._source = this._definition, !this._source)
|
|
681
796
|
throw new Error("Invalid definition");
|
|
682
|
-
const e =
|
|
797
|
+
const e = d(this._source) ? this._source.title ?? "" : "";
|
|
683
798
|
this.variables.push(
|
|
684
799
|
new u(this._profile, e, [
|
|
685
800
|
new l({
|
|
@@ -690,11 +805,11 @@ class Le extends L {
|
|
|
690
805
|
})
|
|
691
806
|
])
|
|
692
807
|
);
|
|
693
|
-
const
|
|
694
|
-
this.variables.push(
|
|
695
|
-
const
|
|
696
|
-
|
|
697
|
-
|
|
808
|
+
const t = new u(this._profile, { code: "values" });
|
|
809
|
+
this.variables.push(t);
|
|
810
|
+
const i = await De(this._source), r = this._source;
|
|
811
|
+
C(this._source.fields).map((a) => r.fields.find((n) => n.name === a.name)).sort(L(r)).forEach((a) => {
|
|
812
|
+
t.variables.push(this._getFieldProperty(a, i));
|
|
698
813
|
});
|
|
699
814
|
} catch (e) {
|
|
700
815
|
h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
|
|
@@ -704,19 +819,19 @@ class Le extends L {
|
|
|
704
819
|
return this._source;
|
|
705
820
|
}
|
|
706
821
|
}
|
|
707
|
-
class
|
|
708
|
-
constructor(e,
|
|
709
|
-
super(e,
|
|
822
|
+
class Ye extends A {
|
|
823
|
+
constructor(e, t) {
|
|
824
|
+
super(e, t, "pixel", { exposeRelationships: !1 }), this.type = "pixel", this._source = null;
|
|
710
825
|
}
|
|
711
826
|
async _loadSource() {
|
|
712
827
|
if (this.loaded)
|
|
713
828
|
return this._source;
|
|
714
829
|
try {
|
|
715
|
-
if (!
|
|
830
|
+
if (!G(this._definition))
|
|
716
831
|
throw new Error("Invalid definition - not an ImageryLayer");
|
|
717
832
|
if (await this._definition.load(), this._source = this._definition, !this._source)
|
|
718
833
|
throw new Error("Invalid definition");
|
|
719
|
-
const e =
|
|
834
|
+
const e = d(this._source) ? this._source.title ?? "" : "";
|
|
720
835
|
this.variables.push(
|
|
721
836
|
new u(this._profile, e, [
|
|
722
837
|
new l({
|
|
@@ -727,11 +842,11 @@ class Ae extends L {
|
|
|
727
842
|
})
|
|
728
843
|
])
|
|
729
844
|
);
|
|
730
|
-
const
|
|
731
|
-
if (this.variables.push(
|
|
845
|
+
const t = new u(this._profile, { code: "values" });
|
|
846
|
+
if (this.variables.push(t), !G(this._source))
|
|
732
847
|
throw new Error("Invalid definition - not an ImageryLayer");
|
|
733
|
-
(await
|
|
734
|
-
|
|
848
|
+
(await we(this._source)).forEach((r) => {
|
|
849
|
+
t.variables.push(this._getMemberProperty(r));
|
|
735
850
|
});
|
|
736
851
|
} catch (e) {
|
|
737
852
|
h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
|
|
@@ -741,24 +856,24 @@ class Ae extends L {
|
|
|
741
856
|
return this._source;
|
|
742
857
|
}
|
|
743
858
|
}
|
|
744
|
-
class
|
|
745
|
-
constructor(e,
|
|
746
|
-
super(e,
|
|
859
|
+
class q extends te {
|
|
860
|
+
constructor(e, t, i = [], r) {
|
|
861
|
+
super(e, t, r), this.featureSetSnippets = i, this.type = "featureSet";
|
|
747
862
|
}
|
|
748
863
|
get title() {
|
|
749
|
-
return
|
|
864
|
+
return d(this._source) ? this._source.title ?? "" : { code: "featureset" };
|
|
750
865
|
}
|
|
751
866
|
async _loadSource() {
|
|
752
867
|
if (this.loaded)
|
|
753
868
|
return this._source;
|
|
754
869
|
try {
|
|
755
|
-
if (this._source = await
|
|
870
|
+
if (this._source = await j(this._definition), !this._source)
|
|
756
871
|
throw new Error("Invalid definition");
|
|
757
872
|
this.variables.push(new u(this._profile, this.title, this.featureSetSnippets, !0));
|
|
758
873
|
const e = new u(this._profile, { code: "fields" });
|
|
759
|
-
this.variables.push(e), e.variables =
|
|
760
|
-
const
|
|
761
|
-
|
|
874
|
+
this.variables.push(e), e.variables = C(this._source.fields).sort(L(this._source)).map((i) => this._getFieldProperty(i));
|
|
875
|
+
const t = await this._getRelationshipsProperty();
|
|
876
|
+
t && this.variables.push(t);
|
|
762
877
|
} catch (e) {
|
|
763
878
|
h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._source = null;
|
|
764
879
|
} finally {
|
|
@@ -770,12 +885,12 @@ class A extends ee {
|
|
|
770
885
|
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
771
886
|
}
|
|
772
887
|
}
|
|
773
|
-
class
|
|
774
|
-
constructor(e,
|
|
775
|
-
super(e,
|
|
888
|
+
class et extends b {
|
|
889
|
+
constructor(e, t) {
|
|
890
|
+
super(e, t), this.type = "featureSetCollection", this._featureSetCollections = null, this._loaded = !1, this._definition = t.declaration?.definition;
|
|
776
891
|
}
|
|
777
892
|
get informationUrl() {
|
|
778
|
-
return !this.loaded || !this._featureSetCollections ? null : typeof this._featureSetCollections.source != "string" ?
|
|
893
|
+
return !this.loaded || !this._featureSetCollections ? null : typeof this._featureSetCollections.source != "string" ? me(K(this._featureSetCollections.source)) : null;
|
|
779
894
|
}
|
|
780
895
|
get informationType() {
|
|
781
896
|
if (!this.loaded || !this._featureSetCollections)
|
|
@@ -792,7 +907,7 @@ class Ge extends $ {
|
|
|
792
907
|
}
|
|
793
908
|
}
|
|
794
909
|
async loadSource() {
|
|
795
|
-
return
|
|
910
|
+
return m(this._loadPromise) && I(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadSource(), await this._loadPromise);
|
|
796
911
|
}
|
|
797
912
|
async _loadSource() {
|
|
798
913
|
if (this.loaded)
|
|
@@ -803,17 +918,17 @@ class Ge extends $ {
|
|
|
803
918
|
const e = typeof this._featureSetCollections.source == "string" ? { code: this._featureSetCollections.source.endsWith("FeatureServer") ? "featureservice" : "mapservice" } : {
|
|
804
919
|
code: "webmapformat",
|
|
805
920
|
formatValues: {
|
|
806
|
-
webMapTitle:
|
|
921
|
+
webMapTitle: K(this._featureSetCollections.source)?.title || "Untitled map"
|
|
807
922
|
}
|
|
808
|
-
},
|
|
923
|
+
}, t = new u(this._profile, e, [
|
|
809
924
|
new l({
|
|
810
925
|
profile: this._profile,
|
|
811
926
|
label: this.snippet,
|
|
812
927
|
description: "",
|
|
813
928
|
snippet: this.snippet
|
|
814
929
|
})
|
|
815
|
-
]),
|
|
816
|
-
this.variables.push(i, r
|
|
930
|
+
]), i = new u(this._profile, { code: "layers" }, this._featureSetCollections.layers), r = new u(this._profile, { code: "tables" }, this._featureSetCollections.tables);
|
|
931
|
+
this.variables.push(t, i, r);
|
|
817
932
|
} catch (e) {
|
|
818
933
|
h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._featureSetCollections = null;
|
|
819
934
|
} finally {
|
|
@@ -822,97 +937,236 @@ class Ge extends $ {
|
|
|
822
937
|
return this._featureSetCollections;
|
|
823
938
|
}
|
|
824
939
|
async _featureSetCollectionsFromDefinition() {
|
|
825
|
-
return this._definition ?
|
|
940
|
+
return this._definition ? re(this._definition) ? await this._featureSetCollectionFromMap(this._definition) : se(this._definition) ? await this._featureSetCollectionFromUrl(this._definition.url) : ae(this._definition) ? await this._featureSetCollectionFromPortalItem(this._definition.portalItem) : null : null;
|
|
826
941
|
}
|
|
827
942
|
async _featureSetCollectionFromMap(e) {
|
|
828
|
-
|
|
829
|
-
const
|
|
943
|
+
oe(e) && await e.loadAll(), await Promise.all(e.allTables.map(async (i) => await i.load()));
|
|
944
|
+
const t = this._profile?.policy?.filterFsCollectionLayersFromMap ?? (() => !0);
|
|
830
945
|
return {
|
|
831
|
-
layers: this._convertWebMapLayersToVariables(e.allLayers.filter(
|
|
946
|
+
layers: this._convertWebMapLayersToVariables(e.allLayers.filter(t)),
|
|
832
947
|
tables: this._convertWebMapLayersToVariables(e.allTables),
|
|
833
948
|
source: e
|
|
834
949
|
};
|
|
835
950
|
}
|
|
836
951
|
async _featureSetCollectionFromPortalItem(e) {
|
|
837
|
-
const
|
|
838
|
-
switch (await
|
|
952
|
+
const t = new ye(e);
|
|
953
|
+
switch (await t.load(), t.type) {
|
|
839
954
|
case "Web Map": {
|
|
840
|
-
const
|
|
841
|
-
return await this._featureSetCollectionFromMap(
|
|
955
|
+
const i = new be({ portalItem: t });
|
|
956
|
+
return await this._featureSetCollectionFromMap(i);
|
|
842
957
|
}
|
|
843
958
|
case "Web Scene": {
|
|
844
|
-
const
|
|
845
|
-
return await this._featureSetCollectionFromMap(
|
|
959
|
+
const i = new ge({ portalItem: t });
|
|
960
|
+
return await this._featureSetCollectionFromMap(i);
|
|
846
961
|
}
|
|
847
962
|
case "Feature Service":
|
|
848
|
-
return await this._featureSetCollectionFromUrl(
|
|
963
|
+
return await this._featureSetCollectionFromUrl(t.url);
|
|
849
964
|
default:
|
|
850
965
|
return h("error", this.type, "Unsupported portal item", { detail: { definition: e } }), null;
|
|
851
966
|
}
|
|
852
967
|
}
|
|
853
968
|
async _featureSetCollectionFromUrl(e) {
|
|
854
|
-
let
|
|
855
|
-
if (
|
|
969
|
+
let t = e?.replace(/\/featureserver\/[0-9]*/iu, "/FeatureServer");
|
|
970
|
+
if (t = t?.replace(/\/mapserver\/[0-9]*/iu, "/MapServer"), t = t?.split("?")[0], !t)
|
|
856
971
|
return null;
|
|
857
|
-
const
|
|
858
|
-
|
|
859
|
-
const
|
|
860
|
-
return await
|
|
972
|
+
const i = await ne(t), r = Promise.all(
|
|
973
|
+
i.layers.map(async (p) => {
|
|
974
|
+
const c = new P({ url: `${t}/${p.id}` });
|
|
975
|
+
return await c.load(), this._createFeatureSetVariable(c);
|
|
861
976
|
})
|
|
862
|
-
),
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
return await
|
|
977
|
+
), a = Promise.all(
|
|
978
|
+
i.tables.map(async (p) => {
|
|
979
|
+
const c = new P({ url: `${t}/${p.id}` });
|
|
980
|
+
return await c.load(), this._createFeatureSetVariable(c);
|
|
866
981
|
})
|
|
867
|
-
), [
|
|
868
|
-
return { layers:
|
|
982
|
+
), [n, o] = await Promise.all([r, a]);
|
|
983
|
+
return { layers: n, tables: o, source: t };
|
|
869
984
|
}
|
|
870
985
|
_convertWebMapLayersToVariables(e) {
|
|
871
|
-
const
|
|
872
|
-
return e.toArray().reverse().forEach((
|
|
873
|
-
if (
|
|
874
|
-
|
|
986
|
+
const t = [];
|
|
987
|
+
return e.toArray().reverse().forEach((i) => {
|
|
988
|
+
if (Q(i)) {
|
|
989
|
+
t.push(this._createFeatureSetVariable(i, !0));
|
|
875
990
|
return;
|
|
876
991
|
}
|
|
877
|
-
}),
|
|
992
|
+
}), t;
|
|
878
993
|
}
|
|
879
|
-
_createFeatureSetVariable(e,
|
|
880
|
-
return new
|
|
994
|
+
_createFeatureSetVariable(e, t = !1) {
|
|
995
|
+
return new q(
|
|
881
996
|
this,
|
|
882
997
|
{
|
|
883
998
|
profile: this._profile,
|
|
884
999
|
declaration: { name: e.title ?? "", definition: e },
|
|
885
|
-
label:
|
|
1000
|
+
label: t ? e.title : e.sourceJSON.name ?? e.title,
|
|
886
1001
|
description: "",
|
|
887
1002
|
nonInteractive: !0
|
|
888
1003
|
},
|
|
889
|
-
this._makeFeatureSetSnippets(e,
|
|
1004
|
+
this._makeFeatureSetSnippets(e, t)
|
|
890
1005
|
);
|
|
891
1006
|
}
|
|
892
|
-
_makeFeatureSetSnippets(e,
|
|
1007
|
+
_makeFeatureSetSnippets(e, t = !1) {
|
|
893
1008
|
if (!this._profile?.supportFeatureSetFunctions)
|
|
894
1009
|
return [];
|
|
895
|
-
if (
|
|
896
|
-
const
|
|
1010
|
+
if (t) {
|
|
1011
|
+
const i = `FeatureSetById(${this.snippet}, "${e.id}")`, r = `FeatureSetByName(${this.snippet}, "${e.title}")`;
|
|
897
1012
|
return [
|
|
898
|
-
new l({ profile: this._profile, label:
|
|
899
|
-
new l({ profile: this._profile, label:
|
|
1013
|
+
new l({ profile: this._profile, label: i, description: "", snippet: i }),
|
|
1014
|
+
new l({ profile: this._profile, label: r, description: "", snippet: r })
|
|
900
1015
|
];
|
|
901
1016
|
} else {
|
|
902
|
-
const
|
|
903
|
-
return [new l({ profile: this._profile, label:
|
|
1017
|
+
const i = `FeatureSetById(${this.snippet}, "${e.layerId}")`;
|
|
1018
|
+
return [new l({ profile: this._profile, label: i, description: "", snippet: i })];
|
|
904
1019
|
}
|
|
905
1020
|
}
|
|
906
1021
|
toProfileVariableDefinition() {
|
|
907
1022
|
return { type: this.type, name: "", ...this.declaration, definition: this._definition };
|
|
908
1023
|
}
|
|
909
1024
|
}
|
|
910
|
-
class
|
|
911
|
-
constructor(e,
|
|
1025
|
+
class tt extends b {
|
|
1026
|
+
constructor(e, t) {
|
|
1027
|
+
super(e, t), this.type = "dataCatalogDatastore", this._catalogDatastore = null, this._datastore = null, this._loaded = !1, this._definition = t.declaration?.definition;
|
|
1028
|
+
}
|
|
1029
|
+
_serializeDefinitionFromInstance(e) {
|
|
1030
|
+
return {
|
|
1031
|
+
id: e.itemId ?? "",
|
|
1032
|
+
serviceUrl: e.serviceUrl ?? "",
|
|
1033
|
+
portal: { url: e.portal?.url ?? "" }
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
_getSerializedDefinition() {
|
|
1037
|
+
const e = this.declaration.definition;
|
|
1038
|
+
if (e)
|
|
1039
|
+
return D(e) ? e : this._serializeDefinitionFromInstance(e);
|
|
1040
|
+
if (D(this._definition))
|
|
1041
|
+
return this._definition;
|
|
1042
|
+
if (this._catalogDatastore)
|
|
1043
|
+
return this._serializeDefinitionFromInstance(this._catalogDatastore);
|
|
1044
|
+
if (this._definition)
|
|
1045
|
+
return this._serializeDefinitionFromInstance(this._definition);
|
|
1046
|
+
}
|
|
1047
|
+
async loadSource() {
|
|
1048
|
+
return m(this._loadPromise) && I(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadSource(), await this._loadPromise);
|
|
1049
|
+
}
|
|
1050
|
+
async _loadSource() {
|
|
1051
|
+
if (this.loaded)
|
|
1052
|
+
return this._datastore;
|
|
1053
|
+
try {
|
|
1054
|
+
if (!this._definition)
|
|
1055
|
+
throw new Error("No definition provided");
|
|
1056
|
+
D(this._definition) ? this._catalogDatastore = await this._dataCatalogDatastoreFromDefinition(this._definition) : this._catalogDatastore = this._definition;
|
|
1057
|
+
const e = this._catalogDatastore;
|
|
1058
|
+
if (!e)
|
|
1059
|
+
throw new Error("Invalid definition");
|
|
1060
|
+
const t = await e.fetchInfo();
|
|
1061
|
+
this._datastoreInfo = t;
|
|
1062
|
+
const i = await e.fetchDatasets(), r = await Ke(t.databasePlatform), a = i.map(
|
|
1063
|
+
(n) => new it(
|
|
1064
|
+
this,
|
|
1065
|
+
{
|
|
1066
|
+
profile: this._profile,
|
|
1067
|
+
declaration: { name: n.name },
|
|
1068
|
+
label: n.name,
|
|
1069
|
+
description: n.type,
|
|
1070
|
+
snippet: He(n.name, r)
|
|
1071
|
+
},
|
|
1072
|
+
e,
|
|
1073
|
+
n,
|
|
1074
|
+
r
|
|
1075
|
+
)
|
|
1076
|
+
);
|
|
1077
|
+
this.variables = a, this._datastore = {
|
|
1078
|
+
tables: a,
|
|
1079
|
+
source: D(this._definition) ? this._definition : e,
|
|
1080
|
+
info: t
|
|
1081
|
+
};
|
|
1082
|
+
} catch (e) {
|
|
1083
|
+
h("error", this.type, "Error with definition", { detail: { error: e, definition: this._definition } }), this._datastore = null;
|
|
1084
|
+
} finally {
|
|
1085
|
+
this._loaded = !0;
|
|
1086
|
+
}
|
|
1087
|
+
return this._datastore;
|
|
1088
|
+
}
|
|
1089
|
+
get datastoreInfo() {
|
|
1090
|
+
return this._datastoreInfo;
|
|
1091
|
+
}
|
|
1092
|
+
get tableVariables() {
|
|
1093
|
+
return this.variables.filter(ie);
|
|
1094
|
+
}
|
|
1095
|
+
async _dataCatalogDatastoreFromDefinition(e) {
|
|
1096
|
+
const t = new ve({ url: e.portal.url });
|
|
1097
|
+
return await t.load(), new Le({
|
|
1098
|
+
itemId: e.id,
|
|
1099
|
+
serviceUrl: e.serviceUrl,
|
|
1100
|
+
portal: t
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
toProfileVariableDefinition() {
|
|
1104
|
+
const e = this.declaration, t = this._getSerializedDefinition();
|
|
1105
|
+
return {
|
|
1106
|
+
type: this.type,
|
|
1107
|
+
name: "",
|
|
1108
|
+
...e,
|
|
1109
|
+
...t ? { definition: t } : {}
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
class it extends b {
|
|
1114
|
+
constructor(e, t, i, r, a) {
|
|
1115
|
+
super(e, t), this._catalogDatastore = i, this.datasetInfo = r, this._dialectSpec = a, this.type = "dictionary", this._fieldInfos = [], this._loaded = !1;
|
|
1116
|
+
}
|
|
1117
|
+
get fieldInfos() {
|
|
1118
|
+
return this._fieldInfos;
|
|
1119
|
+
}
|
|
1120
|
+
async loadSource() {
|
|
1121
|
+
return m(this._loadPromise) && I(this._loadPromise) ? await this._loadPromise : (this._loadPromise = this._loadFields(), await this._loadPromise);
|
|
1122
|
+
}
|
|
1123
|
+
async _loadFields() {
|
|
1124
|
+
if (this.loaded)
|
|
1125
|
+
return this._fieldInfos;
|
|
1126
|
+
try {
|
|
1127
|
+
const e = await this._catalogDatastore.fetchTableDescription(this.datasetInfo.name);
|
|
1128
|
+
this._fieldInfos = e.fields, this.variables = this._fieldInfos.map((t) => {
|
|
1129
|
+
const i = {
|
|
1130
|
+
name: t.name,
|
|
1131
|
+
alias: t.name,
|
|
1132
|
+
type: t.type
|
|
1133
|
+
};
|
|
1134
|
+
return new l({
|
|
1135
|
+
profile: this._profile,
|
|
1136
|
+
declaration: { type: Z(i) },
|
|
1137
|
+
label: t.name,
|
|
1138
|
+
// TODO: review with QL team / designer
|
|
1139
|
+
description: [t.serverType, t.nullable ? "nullable" : "not null"].filter(Boolean).join(" | "),
|
|
1140
|
+
snippet: X(t.name, this._dialectSpec),
|
|
1141
|
+
icon: J(i),
|
|
1142
|
+
filterDescription: !0
|
|
1143
|
+
});
|
|
1144
|
+
});
|
|
1145
|
+
} catch (e) {
|
|
1146
|
+
h("error", "DataCatalogDatastoreTableVariable", "Error loading dataset", {
|
|
1147
|
+
detail: { error: e, dataset: this.datasetInfo }
|
|
1148
|
+
}), this._fieldInfos = [];
|
|
1149
|
+
} finally {
|
|
1150
|
+
this._loaded = !0;
|
|
1151
|
+
}
|
|
1152
|
+
return this._fieldInfos;
|
|
1153
|
+
}
|
|
1154
|
+
toProfileVariableDefinition() {
|
|
1155
|
+
return {
|
|
1156
|
+
// TODO(editor-profile): this is a type dictionary for now, but should get its own type after
|
|
1157
|
+
// https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/1473
|
|
1158
|
+
type: "dictionary",
|
|
1159
|
+
name: this.datasetInfo.name,
|
|
1160
|
+
description: this.datasetInfo.type
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
class Tt extends y {
|
|
1165
|
+
constructor(e, t, i = "en", r = {}) {
|
|
912
1166
|
super(void 0, {
|
|
913
1167
|
profile: null,
|
|
914
1168
|
declaration: { properties: [] }
|
|
915
|
-
}), this.definition = e, this.intlStrings =
|
|
1169
|
+
}), this.definition = e, this.intlStrings = t, this.locale = i, this.policy = r, this.variables = [], this._profile = this, this.loadPropertyDeclarations(e?.variables);
|
|
916
1170
|
}
|
|
917
1171
|
/**
|
|
918
1172
|
* Returns true if the profile supports feature set functions for snippets.
|
|
@@ -931,18 +1185,15 @@ class at extends _ {
|
|
|
931
1185
|
};
|
|
932
1186
|
}
|
|
933
1187
|
}
|
|
934
|
-
const
|
|
1188
|
+
const rt = {
|
|
935
1189
|
locale: "en"
|
|
936
1190
|
};
|
|
937
|
-
class
|
|
1191
|
+
class Pt {
|
|
938
1192
|
// #endregion
|
|
939
|
-
constructor(e,
|
|
940
|
-
this.languageId = e, this._apiConfig =
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
}, he().then((r) => {
|
|
944
|
-
r.onWillDisposeModel((s) => {
|
|
945
|
-
this.disposeForModel(s.uri);
|
|
1193
|
+
constructor(e, t) {
|
|
1194
|
+
this.languageId = e, this._apiConfig = t, this._onDidChange = new N(), this._modelToProfileMap = /* @__PURE__ */ new Map(), this._modelToApiContextMap = /* @__PURE__ */ new Map(), this._localeToApiLibraryPromiseMap = /* @__PURE__ */ new Map(), this._onModelContextDidChange = new N(), this._onDidModelContextChangeTimeout = -1, Fe().then((i) => {
|
|
1195
|
+
i.onWillDisposeModel((r) => {
|
|
1196
|
+
this.disposeForModel(r.uri);
|
|
946
1197
|
});
|
|
947
1198
|
});
|
|
948
1199
|
}
|
|
@@ -953,7 +1204,9 @@ class lt {
|
|
|
953
1204
|
}, 0));
|
|
954
1205
|
}
|
|
955
1206
|
_getApiKey(e) {
|
|
956
|
-
return
|
|
1207
|
+
return B.isUri(e) || (e = B.parse(e)), e.toString();
|
|
1208
|
+
}
|
|
1209
|
+
getWorkerHostExtension() {
|
|
957
1210
|
}
|
|
958
1211
|
// #endregion
|
|
959
1212
|
// #region Public methods
|
|
@@ -964,8 +1217,8 @@ class lt {
|
|
|
964
1217
|
* Dispose any cached resources for the model
|
|
965
1218
|
*/
|
|
966
1219
|
disposeForModel(e) {
|
|
967
|
-
const
|
|
968
|
-
this._modelToProfileMap.delete(
|
|
1220
|
+
const t = this._getApiKey(e);
|
|
1221
|
+
this._modelToProfileMap.delete(t), this._modelToApiContextMap.delete(t) && this._fireModelContextDidChange(t);
|
|
969
1222
|
}
|
|
970
1223
|
/**
|
|
971
1224
|
* Returns the editor profile for the given model id.
|
|
@@ -982,16 +1235,16 @@ class lt {
|
|
|
982
1235
|
* @returns The API context for the model.
|
|
983
1236
|
*/
|
|
984
1237
|
getApiContextForModel(e) {
|
|
985
|
-
return this._modelToApiContextMap.get(this._getApiKey(e)) ??
|
|
1238
|
+
return this._modelToApiContextMap.get(this._getApiKey(e)) ?? rt;
|
|
986
1239
|
}
|
|
987
1240
|
/**
|
|
988
1241
|
* Set or update api context for the given model id.
|
|
989
1242
|
* @param modelId The model id for which to set the context.
|
|
990
1243
|
* @param apiContext The api context to set.
|
|
991
1244
|
*/
|
|
992
|
-
updateApiContextForModel(e,
|
|
993
|
-
const
|
|
994
|
-
this._modelToApiContextMap.set(
|
|
1245
|
+
updateApiContextForModel(e, t) {
|
|
1246
|
+
const i = this._getApiKey(e), r = this._modelToApiContextMap.get(i) ?? {};
|
|
1247
|
+
this._modelToApiContextMap.set(i, { ...r, ...t }), this._fireModelContextDidChange(i);
|
|
995
1248
|
}
|
|
996
1249
|
get onModelContextDidChange() {
|
|
997
1250
|
return this._onModelContextDidChange.event;
|
|
@@ -1002,37 +1255,53 @@ class lt {
|
|
|
1002
1255
|
* @returns The API library for the model.
|
|
1003
1256
|
*/
|
|
1004
1257
|
async getApiLibraryForModel(e) {
|
|
1005
|
-
const
|
|
1006
|
-
return (await
|
|
1258
|
+
const t = this.getApiContextForModel(e), i = this.getApiLibrary(t.locale ?? "en");
|
|
1259
|
+
return (await xe(i, t)).categories;
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* The worker host is used by the worker to invoke methods on the main thread.
|
|
1263
|
+
*/
|
|
1264
|
+
get workerHost() {
|
|
1265
|
+
if (!this._workerHost) {
|
|
1266
|
+
const t = Object.assign({
|
|
1267
|
+
getApiLibrary: async (i) => await this.getApiLibrary(i),
|
|
1268
|
+
getLanguageId: () => this.languageId
|
|
1269
|
+
}, this.getWorkerHostExtension());
|
|
1270
|
+
this._workerHost = t;
|
|
1271
|
+
}
|
|
1272
|
+
return this._workerHost;
|
|
1007
1273
|
}
|
|
1008
1274
|
// #endregion
|
|
1009
1275
|
//#region Private methods
|
|
1010
1276
|
async fetchApiLibrary(e) {
|
|
1011
1277
|
try {
|
|
1012
|
-
const { apiPath:
|
|
1013
|
-
return
|
|
1278
|
+
const { apiPath: t, apiPrefix: i } = this._apiConfig, r = Te(`${t}/${i}${e}.json`), a = await fetch(r);
|
|
1279
|
+
return a.ok ? await a.json() : [];
|
|
1014
1280
|
} catch {
|
|
1015
1281
|
return [];
|
|
1016
1282
|
}
|
|
1017
1283
|
}
|
|
1018
1284
|
async getApiLibrary(e) {
|
|
1019
|
-
const
|
|
1020
|
-
return this._localeToApiLibraryPromiseMap.has(
|
|
1285
|
+
const t = Pe(e);
|
|
1286
|
+
return this._localeToApiLibraryPromiseMap.has(t) || this._localeToApiLibraryPromiseMap.set(t, this.fetchApiLibrary(t)), await this._localeToApiLibraryPromiseMap.get(t) ?? [];
|
|
1021
1287
|
}
|
|
1022
1288
|
// #endregion
|
|
1023
1289
|
}
|
|
1024
1290
|
export {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1291
|
+
Le as D,
|
|
1292
|
+
Tt as E,
|
|
1293
|
+
Pt as L,
|
|
1294
|
+
ke as a,
|
|
1295
|
+
tt as b,
|
|
1296
|
+
He as c,
|
|
1297
|
+
W as d,
|
|
1298
|
+
Ct as e,
|
|
1299
|
+
vt as f,
|
|
1300
|
+
$ as g,
|
|
1301
|
+
Ne as h,
|
|
1302
|
+
Re as i,
|
|
1303
|
+
Ft as m,
|
|
1304
|
+
It as n,
|
|
1305
|
+
X as q,
|
|
1306
|
+
_ as s
|
|
1038
1307
|
};
|