@arcgis/languages-sdk-spec 4.33.0-next.98 → 4.34.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schema-types/arcade.d.ts +13 -3
- package/dist/schema-types/base.d.ts +17 -18
- package/dist/schema-types/common.d.ts +6 -2
- package/dist/schema-types/index.d.ts +5 -0
- package/dist/schema-types/sql.d.ts +39 -5
- package/dist/schemas/api-item.schema.json +158 -101
- package/dist/schemas/arcade-api-item.schema.json +32 -32
- package/dist/schemas/arcade-profiles.schema.json +1 -0
- package/dist/schemas/profiles.schema.json +6 -1
- package/dist/schemas/sql-api-item.schema.json +63 -160
- package/dist/schemas/sql-profiles.schema.json +5 -1
- package/dist/scripting/index.d.ts +1 -0
- package/dist/scripting/index.js +315 -0
- package/dist/scripting/utilities.d.ts +58 -0
- package/dist/types.d.ts +1 -1
- package/package.json +3 -2
|
@@ -3,31 +3,63 @@
|
|
|
3
3
|
"$ref": "#/definitions/SqlApiItem",
|
|
4
4
|
"definitions": {
|
|
5
5
|
"SqlApiItem": {
|
|
6
|
-
"$ref": "#/definitions/BaseSchemaApiItem<
|
|
7
|
-
"description": "Narrowed api item type for sql"
|
|
6
|
+
"$ref": "#/definitions/BaseSchemaApiItem<SqlApiFunction>",
|
|
7
|
+
"description": "Narrowed api item type for sql. Sql does not have constants so all sql items are \"functions\"."
|
|
8
8
|
},
|
|
9
|
-
"BaseSchemaApiItem<
|
|
9
|
+
"BaseSchemaApiItem<SqlApiFunction>": {
|
|
10
10
|
"anyOf": [
|
|
11
|
+
{
|
|
12
|
+
"$ref": "#/definitions/SqlApiFunction"
|
|
13
|
+
},
|
|
11
14
|
{
|
|
12
15
|
"type": "array",
|
|
13
16
|
"items": {
|
|
14
|
-
"$ref": "#/definitions/
|
|
17
|
+
"$ref": "#/definitions/SqlApiFunction"
|
|
15
18
|
}
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"$ref": "#/definitions/SchemaSimpleApiItem<SqlBundleType,SqlProfileType>"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"description": "Definition for a constant or a function. An Api Item can be either a constant, a function, or an array of functions"
|
|
22
22
|
},
|
|
23
|
-
"
|
|
23
|
+
"SqlApiFunction": {
|
|
24
24
|
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
25
26
|
"properties": {
|
|
26
27
|
"name": {
|
|
27
28
|
"type": "string",
|
|
28
29
|
"description": "The name of the function or constant. Must start with a capital letter.",
|
|
29
30
|
"pattern": "^[A-Z]+[a-zA-Z0-9.]*$"
|
|
30
31
|
},
|
|
32
|
+
"isSpecialRegister": {
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"description": "SQL functions may be \"special registers\" that are not called like regular functions. For example, CURRENT_DATE is a special register. These functions are not called with parentheses or arguments."
|
|
35
|
+
},
|
|
36
|
+
"keywords": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"properties": {
|
|
41
|
+
"name": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "The name of the keyword."
|
|
44
|
+
},
|
|
45
|
+
"description": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "The description for the keyword."
|
|
48
|
+
},
|
|
49
|
+
"position": {
|
|
50
|
+
"type": "number",
|
|
51
|
+
"description": "(optional) position of the keyword in the function signature, default is to interlace with parameters"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"required": [
|
|
55
|
+
"name",
|
|
56
|
+
"description"
|
|
57
|
+
],
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"description": "Describes a keyword used in a function"
|
|
60
|
+
},
|
|
61
|
+
"description": "The set of keywords that are used in the function."
|
|
62
|
+
},
|
|
31
63
|
"description": {
|
|
32
64
|
"anyOf": [
|
|
33
65
|
{
|
|
@@ -87,29 +119,27 @@
|
|
|
87
119
|
},
|
|
88
120
|
"isConstant": {
|
|
89
121
|
"type": "boolean",
|
|
90
|
-
"const": false,
|
|
91
122
|
"description": "For function this property is optional and always false."
|
|
92
123
|
},
|
|
93
124
|
"parameters": {
|
|
94
125
|
"type": "array",
|
|
95
126
|
"items": {
|
|
96
|
-
"$ref": "#/definitions/SchemaProperty"
|
|
127
|
+
"$ref": "#/definitions/SchemaProperty<SqlValueType>"
|
|
97
128
|
},
|
|
98
129
|
"description": "The set of function parameters."
|
|
99
130
|
},
|
|
100
131
|
"returnValue": {
|
|
101
|
-
"$ref": "#/definitions/SchemaReturnValue",
|
|
132
|
+
"$ref": "#/definitions/SchemaReturnValue<SqlValueType>",
|
|
102
133
|
"description": "The type of data returned by the function."
|
|
103
134
|
}
|
|
104
135
|
},
|
|
105
|
-
"additionalProperties": false,
|
|
106
136
|
"required": [
|
|
107
137
|
"bundle",
|
|
108
138
|
"description",
|
|
109
139
|
"name",
|
|
110
140
|
"snippet"
|
|
111
141
|
],
|
|
112
|
-
"description": "
|
|
142
|
+
"description": "Narrowed api function type for sql"
|
|
113
143
|
},
|
|
114
144
|
"SqlProfileType": {
|
|
115
145
|
"type": "string",
|
|
@@ -118,7 +148,11 @@
|
|
|
118
148
|
},
|
|
119
149
|
"SqlBundleType": {
|
|
120
150
|
"type": "string",
|
|
121
|
-
"
|
|
151
|
+
"enum": [
|
|
152
|
+
"date",
|
|
153
|
+
"numeric",
|
|
154
|
+
"string"
|
|
155
|
+
],
|
|
122
156
|
"description": "Supported function bundles"
|
|
123
157
|
},
|
|
124
158
|
"SchemaExample": {
|
|
@@ -178,7 +212,7 @@
|
|
|
178
212
|
"additionalProperties": false,
|
|
179
213
|
"description": "Describes a link to additional resources"
|
|
180
214
|
},
|
|
181
|
-
"SchemaProperty": {
|
|
215
|
+
"SchemaProperty<SqlValueType>": {
|
|
182
216
|
"type": "object",
|
|
183
217
|
"properties": {
|
|
184
218
|
"name": {
|
|
@@ -189,12 +223,12 @@
|
|
|
189
223
|
"type": {
|
|
190
224
|
"anyOf": [
|
|
191
225
|
{
|
|
192
|
-
"$ref": "#/definitions/
|
|
226
|
+
"$ref": "#/definitions/SqlValueType"
|
|
193
227
|
},
|
|
194
228
|
{
|
|
195
229
|
"type": "array",
|
|
196
230
|
"items": {
|
|
197
|
-
"$ref": "#/definitions/
|
|
231
|
+
"$ref": "#/definitions/SqlValueType"
|
|
198
232
|
}
|
|
199
233
|
}
|
|
200
234
|
],
|
|
@@ -221,7 +255,7 @@
|
|
|
221
255
|
"properties": {
|
|
222
256
|
"type": "array",
|
|
223
257
|
"items": {
|
|
224
|
-
"$ref": "#/definitions/SchemaProperty"
|
|
258
|
+
"$ref": "#/definitions/SchemaProperty<SqlValueType>"
|
|
225
259
|
},
|
|
226
260
|
"description": "The properties if the type is Dictionary."
|
|
227
261
|
}
|
|
@@ -234,74 +268,35 @@
|
|
|
234
268
|
"additionalProperties": false,
|
|
235
269
|
"description": "Describes the properties for the type Property"
|
|
236
270
|
},
|
|
237
|
-
"
|
|
271
|
+
"SqlValueType": {
|
|
238
272
|
"type": "string",
|
|
239
273
|
"enum": [
|
|
240
|
-
"
|
|
241
|
-
"Array<Any>",
|
|
242
|
-
"Array<Attachment>",
|
|
243
|
-
"Array<Boolean>",
|
|
244
|
-
"Array<Date>",
|
|
245
|
-
"Array<DateOnly>",
|
|
246
|
-
"Array<Dictionary>",
|
|
247
|
-
"Array<Extent>",
|
|
248
|
-
"Array<Feature>",
|
|
249
|
-
"Array<Geometry>",
|
|
250
|
-
"Array<KnowledgeGraph>",
|
|
251
|
-
"Array<Multipoint>",
|
|
252
|
-
"Array<Number>",
|
|
253
|
-
"Array<Number|Text>",
|
|
254
|
-
"Array<Point>",
|
|
255
|
-
"Array<Polygon>",
|
|
256
|
-
"Array<Polyline>",
|
|
257
|
-
"Array<Text>",
|
|
258
|
-
"Array<Time>",
|
|
259
|
-
"Attachment",
|
|
260
|
-
"Boolean",
|
|
261
|
-
"Date",
|
|
262
|
-
"DateOnly",
|
|
263
|
-
"Dictionary",
|
|
264
|
-
"Extent",
|
|
265
|
-
"Feature",
|
|
266
|
-
"FeatureSet",
|
|
267
|
-
"FeatureSetCollection",
|
|
268
|
-
"Function",
|
|
269
|
-
"Geometry",
|
|
270
|
-
"KnowledgeGraph",
|
|
271
|
-
"Multipoint",
|
|
272
|
-
"Null",
|
|
274
|
+
"Datetime",
|
|
273
275
|
"Number",
|
|
274
|
-
"
|
|
275
|
-
|
|
276
|
-
"Polyline",
|
|
277
|
-
"Portal",
|
|
278
|
-
"Text",
|
|
279
|
-
"Time",
|
|
280
|
-
"Voxel"
|
|
281
|
-
],
|
|
282
|
-
"description": "The collection of supported types."
|
|
276
|
+
"String"
|
|
277
|
+
]
|
|
283
278
|
},
|
|
284
|
-
"SchemaReturnValue": {
|
|
279
|
+
"SchemaReturnValue<SqlValueType>": {
|
|
285
280
|
"anyOf": [
|
|
286
281
|
{
|
|
287
|
-
"$ref": "#/definitions/SchemaReturnDefinition"
|
|
282
|
+
"$ref": "#/definitions/SchemaReturnDefinition<SqlValueType>"
|
|
288
283
|
},
|
|
289
284
|
{
|
|
290
|
-
"$ref": "#/definitions/
|
|
285
|
+
"$ref": "#/definitions/SqlValueType"
|
|
291
286
|
},
|
|
292
287
|
{
|
|
293
288
|
"type": "array",
|
|
294
289
|
"items": {
|
|
295
|
-
"$ref": "#/definitions/
|
|
290
|
+
"$ref": "#/definitions/SqlValueType"
|
|
296
291
|
}
|
|
297
292
|
}
|
|
298
293
|
]
|
|
299
294
|
},
|
|
300
|
-
"SchemaReturnDefinition": {
|
|
295
|
+
"SchemaReturnDefinition<SqlValueType>": {
|
|
301
296
|
"type": "object",
|
|
302
297
|
"properties": {
|
|
303
298
|
"type": {
|
|
304
|
-
"$ref": "#/definitions/
|
|
299
|
+
"$ref": "#/definitions/SqlValueType",
|
|
305
300
|
"description": "The data type of the value returned."
|
|
306
301
|
},
|
|
307
302
|
"description": {
|
|
@@ -321,7 +316,7 @@
|
|
|
321
316
|
"properties": {
|
|
322
317
|
"type": "array",
|
|
323
318
|
"items": {
|
|
324
|
-
"$ref": "#/definitions/SchemaProperty"
|
|
319
|
+
"$ref": "#/definitions/SchemaProperty<SqlValueType>"
|
|
325
320
|
},
|
|
326
321
|
"description": "The properties if the type returned is a Dictionary"
|
|
327
322
|
}
|
|
@@ -331,98 +326,6 @@
|
|
|
331
326
|
],
|
|
332
327
|
"additionalProperties": false,
|
|
333
328
|
"description": "Describes the type fo data returned by a function."
|
|
334
|
-
},
|
|
335
|
-
"SchemaSimpleApiItem<SqlBundleType,SqlProfileType>": {
|
|
336
|
-
"anyOf": [
|
|
337
|
-
{
|
|
338
|
-
"$ref": "#/definitions/BaseSchemaApiConstant<SqlBundleType,SqlProfileType>"
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
"$ref": "#/definitions/BaseSchemaApiFunction<SqlBundleType,SqlProfileType>"
|
|
342
|
-
}
|
|
343
|
-
],
|
|
344
|
-
"description": "Definition for simple item"
|
|
345
|
-
},
|
|
346
|
-
"BaseSchemaApiConstant<SqlBundleType,SqlProfileType>": {
|
|
347
|
-
"type": "object",
|
|
348
|
-
"properties": {
|
|
349
|
-
"name": {
|
|
350
|
-
"type": "string",
|
|
351
|
-
"description": "The name of the function or constant. Must start with a capital letter.",
|
|
352
|
-
"pattern": "^[A-Z]+[a-zA-Z0-9.]*$"
|
|
353
|
-
},
|
|
354
|
-
"description": {
|
|
355
|
-
"anyOf": [
|
|
356
|
-
{
|
|
357
|
-
"type": "array",
|
|
358
|
-
"items": {
|
|
359
|
-
"type": "string"
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
"type": "string"
|
|
364
|
-
}
|
|
365
|
-
],
|
|
366
|
-
"description": "A nice description for the constant or function. It can leverage Github Flavored Markdown formatting."
|
|
367
|
-
},
|
|
368
|
-
"sinceVersion": {
|
|
369
|
-
"type": "string",
|
|
370
|
-
"description": "Version string. Format x.y.",
|
|
371
|
-
"pattern": "^1\\.\\d+$"
|
|
372
|
-
},
|
|
373
|
-
"disableDocumentation": {
|
|
374
|
-
"type": "boolean",
|
|
375
|
-
"description": "Indicates if the item should not be documented."
|
|
376
|
-
},
|
|
377
|
-
"profiles": {
|
|
378
|
-
"type": "array",
|
|
379
|
-
"items": {
|
|
380
|
-
"$ref": "#/definitions/SqlProfileType"
|
|
381
|
-
},
|
|
382
|
-
"description": "The profiles the constant or the function belongs to."
|
|
383
|
-
},
|
|
384
|
-
"bundle": {
|
|
385
|
-
"$ref": "#/definitions/SqlBundleType",
|
|
386
|
-
"description": "The bundle the constant or the function belongs to."
|
|
387
|
-
},
|
|
388
|
-
"image": {
|
|
389
|
-
"type": "string",
|
|
390
|
-
"description": "The relative path to an image to illustate the constant or the function."
|
|
391
|
-
},
|
|
392
|
-
"snippet": {
|
|
393
|
-
"type": "string",
|
|
394
|
-
"description": "The code that will be injected in the classic editor. Must start with a capital letter and match the name of the funtion or constant.",
|
|
395
|
-
"pattern": "^[A-Z]+.*$"
|
|
396
|
-
},
|
|
397
|
-
"examples": {
|
|
398
|
-
"type": "array",
|
|
399
|
-
"items": {
|
|
400
|
-
"$ref": "#/definitions/SchemaExample"
|
|
401
|
-
},
|
|
402
|
-
"description": "The collection of examples"
|
|
403
|
-
},
|
|
404
|
-
"resourceLinks": {
|
|
405
|
-
"type": "array",
|
|
406
|
-
"items": {
|
|
407
|
-
"$ref": "#/definitions/SchemaResourceLink"
|
|
408
|
-
},
|
|
409
|
-
"description": "A collection of links to resources"
|
|
410
|
-
},
|
|
411
|
-
"isConstant": {
|
|
412
|
-
"type": "boolean",
|
|
413
|
-
"const": true,
|
|
414
|
-
"description": "For constant, the property is mandatory and always true"
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
"required": [
|
|
418
|
-
"bundle",
|
|
419
|
-
"description",
|
|
420
|
-
"isConstant",
|
|
421
|
-
"name",
|
|
422
|
-
"snippet"
|
|
423
|
-
],
|
|
424
|
-
"additionalProperties": false,
|
|
425
|
-
"description": "Describes an Api Constant"
|
|
426
329
|
}
|
|
427
330
|
}
|
|
428
331
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utilities';
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import b from "node:path";
|
|
2
|
+
import h from "node:fs/promises";
|
|
3
|
+
function V(e) {
|
|
4
|
+
return Array.isArray(e?.properties);
|
|
5
|
+
}
|
|
6
|
+
async function j(e) {
|
|
7
|
+
try {
|
|
8
|
+
return (await h.readdir(e, { withFileTypes: !0 })).filter((r) => r.isDirectory()).map((r) => r.name);
|
|
9
|
+
} catch {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
async function P(e) {
|
|
14
|
+
try {
|
|
15
|
+
return (await h.readdir(e, { withFileTypes: !0 })).filter((r) => r.isFile() && r.name !== ".DS_Store").map((r) => r.name);
|
|
16
|
+
} catch {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const R = {
|
|
21
|
+
parameter: "Parameter",
|
|
22
|
+
parameters: "Parameters",
|
|
23
|
+
sinceversion: "Since version",
|
|
24
|
+
returnvalue: "Return value",
|
|
25
|
+
example: "Example",
|
|
26
|
+
examples: "Examples",
|
|
27
|
+
additionalResources: "Additional resources"
|
|
28
|
+
};
|
|
29
|
+
function x(e) {
|
|
30
|
+
return !Array.isArray(e) && !e.isConstant;
|
|
31
|
+
}
|
|
32
|
+
function E(e) {
|
|
33
|
+
return !Array.isArray(e) && !!e.isConstant;
|
|
34
|
+
}
|
|
35
|
+
function N(e) {
|
|
36
|
+
return !Array.isArray(e) && typeof e == "object";
|
|
37
|
+
}
|
|
38
|
+
const m = "./src/api/libraries", k = "./src/t9n/libraries";
|
|
39
|
+
async function C() {
|
|
40
|
+
const e = {}, t = await j(m);
|
|
41
|
+
return await Promise.all(
|
|
42
|
+
t.map(async (r) => {
|
|
43
|
+
const n = `${m}/${r}`, s = `${n}/definition.json`, i = JSON.parse(await h.readFile(s, "utf-8")), a = /* @__PURE__ */ new Map(), o = `${n}/properties`, c = await P(o);
|
|
44
|
+
await Promise.all(
|
|
45
|
+
c.map(async (u) => {
|
|
46
|
+
const p = b.parse(u).name, l = `${o}/${u}`, d = JSON.parse(await h.readFile(l, "utf-8"));
|
|
47
|
+
a.set(p, d);
|
|
48
|
+
})
|
|
49
|
+
), e[r] = { definition: i, items: a };
|
|
50
|
+
})
|
|
51
|
+
), { categories: e, resources: { ...R } };
|
|
52
|
+
}
|
|
53
|
+
function L(e) {
|
|
54
|
+
return typeof e != "object" || e === null || Array.isArray(e) ? !1 : "description" in e || "examples" in e || "returnValue" in e || "parameters" in e;
|
|
55
|
+
}
|
|
56
|
+
async function B(e) {
|
|
57
|
+
const t = await C();
|
|
58
|
+
if (b.parse(e).name === "en")
|
|
59
|
+
return t;
|
|
60
|
+
const r = `${k}/${e}`, n = JSON.parse(await h.readFile(r, "utf-8"));
|
|
61
|
+
for (const s in t.categories) {
|
|
62
|
+
const i = n.categories[s];
|
|
63
|
+
if (!i)
|
|
64
|
+
continue;
|
|
65
|
+
const a = t.categories[s];
|
|
66
|
+
a.definition.title = i.title ?? a.definition.title, a.definition.description = f(i.description) ?? a.definition.description, a.items.forEach((o, c) => {
|
|
67
|
+
const u = i.items[c];
|
|
68
|
+
if (u) {
|
|
69
|
+
if (L(u))
|
|
70
|
+
E(o) ? F(o, u) : x(o) && S(o, u);
|
|
71
|
+
else if (Array.isArray(o)) {
|
|
72
|
+
const p = f(u);
|
|
73
|
+
o.length === p?.length && o.forEach((l, d) => {
|
|
74
|
+
S(l, p[d]);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
for (const s in t.resources)
|
|
81
|
+
t.resources[s] = n.resources[s] ?? t.resources[s];
|
|
82
|
+
return t;
|
|
83
|
+
}
|
|
84
|
+
function S(e, t) {
|
|
85
|
+
F(e, t), g(e.parameters, t.parameters), O(e.returnValue, t.returnValue);
|
|
86
|
+
}
|
|
87
|
+
function F(e, t) {
|
|
88
|
+
if (!t)
|
|
89
|
+
return;
|
|
90
|
+
e.description = f(t.description) ?? e.description;
|
|
91
|
+
const r = f(t.examples);
|
|
92
|
+
r && e.examples && e.examples.forEach((n, s) => {
|
|
93
|
+
n.description = f(r[s]) ?? n.description;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function O(e, t) {
|
|
97
|
+
!e || !t || !N(e) || (e.description = f(t.description) ?? e.description, g(e.properties, t.properties));
|
|
98
|
+
}
|
|
99
|
+
function g(e, t) {
|
|
100
|
+
!e || !t || e.forEach((r) => {
|
|
101
|
+
r.description = f(t[r.name]?.description) ?? "", g(r.properties, t[r.name]?.properties);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const T = {
|
|
105
|
+
minimumIntegerDigits: 2,
|
|
106
|
+
useGrouping: !1
|
|
107
|
+
};
|
|
108
|
+
function U(e) {
|
|
109
|
+
return (Array.isArray(e) ? e : [e]).reduce((r, n, s) => {
|
|
110
|
+
const i = `line${s.toLocaleString("en-US", T)}`;
|
|
111
|
+
return r[i] = n, r;
|
|
112
|
+
}, {});
|
|
113
|
+
}
|
|
114
|
+
function f(e) {
|
|
115
|
+
if (!e)
|
|
116
|
+
return;
|
|
117
|
+
const t = [], r = Object.keys(e).sort((n, s) => n.localeCompare(s));
|
|
118
|
+
for (const n of r)
|
|
119
|
+
t.push(e[n]);
|
|
120
|
+
return t;
|
|
121
|
+
}
|
|
122
|
+
function q(e) {
|
|
123
|
+
switch (e) {
|
|
124
|
+
case 3:
|
|
125
|
+
case 4:
|
|
126
|
+
return new Array(e + 2).join("#");
|
|
127
|
+
default:
|
|
128
|
+
return new Array(e + 1).join("#");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function W(e) {
|
|
132
|
+
return !e.isConstant;
|
|
133
|
+
}
|
|
134
|
+
function A(e) {
|
|
135
|
+
return e ? typeof e == "string" ? e : e.reduce((t, r) => {
|
|
136
|
+
if (r === "")
|
|
137
|
+
return `${t}
|
|
138
|
+
|
|
139
|
+
`;
|
|
140
|
+
let n = t;
|
|
141
|
+
return t && !t.endsWith(`
|
|
142
|
+
`) && !r.startsWith("|") && (n += " "), n += r, (r.endsWith(" ") || r.endsWith("\\") || r.endsWith("|")) && (n += `
|
|
143
|
+
`), n;
|
|
144
|
+
}, "") : "";
|
|
145
|
+
}
|
|
146
|
+
function G(e) {
|
|
147
|
+
return Array.isArray(e) ? e[0].name : e.name;
|
|
148
|
+
}
|
|
149
|
+
function z(e, t, r, n = !0) {
|
|
150
|
+
const s = [];
|
|
151
|
+
if (!t.sinceVersion)
|
|
152
|
+
return [];
|
|
153
|
+
const i = n ? r.relativePath : r.absolutePath;
|
|
154
|
+
return s.push(`**[${e.sinceversion} ${t.sinceVersion}](${i}guide/version-matrix)**`), s.push(""), s;
|
|
155
|
+
}
|
|
156
|
+
function K(e, t, { relative: r = !0, typeLink: n = !0, needsHtmlEntity: s = !1 } = {}) {
|
|
157
|
+
const { name: i } = e;
|
|
158
|
+
if (!W(e))
|
|
159
|
+
return i;
|
|
160
|
+
const a = Array.isArray(e.parameters) ? e.parameters : [], o = _(e.returnValue ?? "Null");
|
|
161
|
+
if ("isSpecialRegister" in e && e.isSpecialRegister)
|
|
162
|
+
return `${i} -> ${w(o, s).join(",")}`;
|
|
163
|
+
let c = `${i}(`;
|
|
164
|
+
return c += a.map((u) => `${u.name}${u.optional ? "?" : ""}`).join(", "), c += ") -> ", c += n ? y(o, t, r) : w(o, s).join(","), c;
|
|
165
|
+
}
|
|
166
|
+
function _(e) {
|
|
167
|
+
return Array.isArray(e) ? e.map((t) => t) : typeof e == "object" ? [e.type ?? "Null"] : e ? [e] : [];
|
|
168
|
+
}
|
|
169
|
+
function w(e, t) {
|
|
170
|
+
return e.map((r) => {
|
|
171
|
+
const n = r.match(/Array<(.*?)>/u);
|
|
172
|
+
return n && t ? `Array<${n[1]}>` : n ? `Array<${n[1]}>` : r;
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function y(e, t, r = !0) {
|
|
176
|
+
if (!e)
|
|
177
|
+
return "";
|
|
178
|
+
typeof e == "string" && (e = e.split("|").map((i) => i.trim()));
|
|
179
|
+
const n = r ? t.relativePath : t.absolutePath;
|
|
180
|
+
return e.map((i) => {
|
|
181
|
+
const a = i.trim(), o = a.toLowerCase().replace("[]", "");
|
|
182
|
+
switch (o) {
|
|
183
|
+
case "function":
|
|
184
|
+
return `[${a}](${n}guide/logic/#user-defined-functions)`;
|
|
185
|
+
case "any":
|
|
186
|
+
case "attachment":
|
|
187
|
+
case "boolean":
|
|
188
|
+
case "date":
|
|
189
|
+
case "dateonly":
|
|
190
|
+
case "dictionary":
|
|
191
|
+
case "feature":
|
|
192
|
+
case "featureset":
|
|
193
|
+
case "featuresetcollection":
|
|
194
|
+
case "geometry":
|
|
195
|
+
case "knowledgegraph":
|
|
196
|
+
case "point":
|
|
197
|
+
case "multipoint":
|
|
198
|
+
case "polyline":
|
|
199
|
+
case "polygon":
|
|
200
|
+
case "extent":
|
|
201
|
+
case "number":
|
|
202
|
+
case "portal":
|
|
203
|
+
case "text":
|
|
204
|
+
case "time":
|
|
205
|
+
case "voxel":
|
|
206
|
+
return `[${a}](${n}guide/types/#${o})`;
|
|
207
|
+
default: {
|
|
208
|
+
const c = i.match(/Array<(.*?)>/u);
|
|
209
|
+
return c ? `[Array](${n}guide/types/#array)<${y(c[1], t, r)}>` : i;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}).join(" \\| ");
|
|
213
|
+
}
|
|
214
|
+
function Q(e, t, r, n = !0, s = !0) {
|
|
215
|
+
const i = [];
|
|
216
|
+
return !Array.isArray(t) || !t.length || (i.push(""), i.push(`**${t.length > 1 ? e.parameters : e.parameter}**`), i.push(...$(t, r, { relative: n, useTypeLinks: s }))), i;
|
|
217
|
+
}
|
|
218
|
+
function D(e = 0) {
|
|
219
|
+
let t = "";
|
|
220
|
+
for (let r = 0; r < e; r++)
|
|
221
|
+
t += " ";
|
|
222
|
+
return t;
|
|
223
|
+
}
|
|
224
|
+
function $(e, t, {
|
|
225
|
+
relative: r = !0,
|
|
226
|
+
indentCount: n = 0,
|
|
227
|
+
useTypeLinks: s
|
|
228
|
+
} = { useTypeLinks: !0 }) {
|
|
229
|
+
const i = [];
|
|
230
|
+
if (!Array.isArray(e) || !e.length)
|
|
231
|
+
return i;
|
|
232
|
+
const a = D(n);
|
|
233
|
+
return i.push(""), e.forEach((o) => {
|
|
234
|
+
const { name: c, optional: u, type: p } = o, l = u ? " (_Optional_)" : "";
|
|
235
|
+
i.push(
|
|
236
|
+
`${a}- **${c ?? ""}**${l}: ${s ? `${y(p, t, r)} - ` : ""}${A(o.description)}`
|
|
237
|
+
), i.push(
|
|
238
|
+
...$(o.properties, t, {
|
|
239
|
+
relative: r,
|
|
240
|
+
indentCount: n + 1,
|
|
241
|
+
useTypeLinks: s
|
|
242
|
+
})
|
|
243
|
+
);
|
|
244
|
+
}), i;
|
|
245
|
+
}
|
|
246
|
+
function X(e, t, r, n = !0, s = !0) {
|
|
247
|
+
const i = [];
|
|
248
|
+
if (t == null)
|
|
249
|
+
return i;
|
|
250
|
+
i.push("");
|
|
251
|
+
const a = `**${e.returnvalue}**:`;
|
|
252
|
+
if (Array.isArray(t) || typeof t == "string")
|
|
253
|
+
s ? i.push(`${a} ${y(t, r, n)}`) : i.push(`${a} ${Array.isArray(t) ? t.join(",") : t}`);
|
|
254
|
+
else {
|
|
255
|
+
const { description: o, type: c } = t;
|
|
256
|
+
i.push(`${a}${s ? ` ${y(c, r, n)}` : ""} `), i.push(A(o)), i.push(...$(t.properties, r, { relative: n, useTypeLinks: s }));
|
|
257
|
+
}
|
|
258
|
+
return i;
|
|
259
|
+
}
|
|
260
|
+
function Y(e, t, r, n) {
|
|
261
|
+
const s = [];
|
|
262
|
+
return !t || !Array.isArray(t) || (s.push(""), r === "**" ? s.push(`${r}${t.length > 1 ? e.examples : e.example}${r}`) : s.push(`${r} ${t.length > 1 ? e.examples : e.example}`), s.push(""), t.forEach((i) => {
|
|
263
|
+
i.description && (s.push(A(i.description)), s.push("")), s.push(`\`\`\`${n}`), Array.isArray(i.code) ? s.push(...i.code) : typeof i.code == "string" && s.push(i.code), s.push("```"), s.push("");
|
|
264
|
+
}), s.push("")), s;
|
|
265
|
+
}
|
|
266
|
+
function Z(e, t, r) {
|
|
267
|
+
const n = [];
|
|
268
|
+
return !t || !Array.isArray(t) || (n.push(""), r === "**" ? n.push(`${r}${e.additionalResources}${r}`) : n.push(`${r} ${e.additionalResources}`), n.push(""), t.forEach(({ linkText: s, url: i }) => {
|
|
269
|
+
n.push(`* [${s}](${i})`);
|
|
270
|
+
}), n.push("")), n;
|
|
271
|
+
}
|
|
272
|
+
function H(e, t, r = !0) {
|
|
273
|
+
return e ? r ? e.replace(t.absolutePath, "/") : e.replace(t.relativePath, t.absolutePath) : "";
|
|
274
|
+
}
|
|
275
|
+
function v(e, t, r) {
|
|
276
|
+
const n = [];
|
|
277
|
+
let s = 0, i = 0, a = 0;
|
|
278
|
+
if (r)
|
|
279
|
+
for (; s < e.length || i < t.length; )
|
|
280
|
+
r[a] === n.length ? (i < t.length && n.push(t[i++]), a++) : s < e.length && n.push(e[s++]);
|
|
281
|
+
else
|
|
282
|
+
for (; s < e.length || i < t.length; )
|
|
283
|
+
s < e.length && n.push(e[s++]), i < t.length && n.push(t[i++]);
|
|
284
|
+
return n.filter(Boolean).join(" ");
|
|
285
|
+
}
|
|
286
|
+
function I(e) {
|
|
287
|
+
return "isSpecialRegister" in e;
|
|
288
|
+
}
|
|
289
|
+
export {
|
|
290
|
+
R as DefaultApiResources,
|
|
291
|
+
G as apiItemName,
|
|
292
|
+
A as assembleMarkdownString,
|
|
293
|
+
f as convertObjectToArray,
|
|
294
|
+
U as convertStringArrayToObject,
|
|
295
|
+
H as fixUrl,
|
|
296
|
+
Z as generateAdditionalResourcesSection,
|
|
297
|
+
Y as generateExamplesSection,
|
|
298
|
+
Q as generateParametersSection,
|
|
299
|
+
X as generateReturnSection,
|
|
300
|
+
K as generateSignature,
|
|
301
|
+
z as generateSinceVersionSection,
|
|
302
|
+
y as generateTypeLink,
|
|
303
|
+
j as getDirectoryNames,
|
|
304
|
+
P as getFileNames,
|
|
305
|
+
q as headingPattern,
|
|
306
|
+
v as interlaceArrays,
|
|
307
|
+
W as isFunction,
|
|
308
|
+
E as isSchemaConstant,
|
|
309
|
+
V as isSchemaDictionaryVariable,
|
|
310
|
+
x as isSchemaFunction,
|
|
311
|
+
N as isSchemaReturnDefinition,
|
|
312
|
+
I as isSqlApiFunction,
|
|
313
|
+
B as loadApiDatabase,
|
|
314
|
+
T as toLocalConfig
|
|
315
|
+
};
|