@arcgis/languages-sdk-spec 4.33.0-next.15 → 4.33.0-next.151
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/index.d.ts +4 -415
- package/dist/index.js +1 -0
- package/dist/profile-types/arcade-profiles-types.d.ts +11 -0
- package/dist/profile-types/base.d.ts +59 -0
- package/dist/profile-types/index.d.ts +11 -0
- package/dist/profile-types/sql-profile-types.d.ts +11 -0
- package/dist/schema-types/arcade.d.ts +23 -0
- package/dist/schema-types/base.d.ts +163 -0
- package/dist/schema-types/common.d.ts +14 -0
- package/dist/schema-types/index.d.ts +21 -0
- package/dist/schema-types/sql.d.ts +55 -0
- 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/t9n-types.d.ts +28 -0
- package/dist/types.d.ts +79 -0
- package/package.json +3 -2
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { ArcadeApiConstant, SchemaApiFunction } from '.';
|
|
2
|
+
import { BundleType, ProfileType, SchemaValueType } from './common';
|
|
3
|
+
import { SqlApiFunction } from './sql';
|
|
4
|
+
import { ArcadeApiFunction } from './arcade';
|
|
5
|
+
/**
|
|
6
|
+
* Definition for a schema category
|
|
7
|
+
*/
|
|
8
|
+
export interface SchemaCategory {
|
|
9
|
+
title: string;
|
|
10
|
+
description: string[] | string;
|
|
11
|
+
page: string;
|
|
12
|
+
hideSummaryList?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface GenericSchemaItemBase<Bundle extends BundleType, Profile extends ProfileType> {
|
|
15
|
+
/**
|
|
16
|
+
* The name of the function or constant. Must start with a capital letter.
|
|
17
|
+
* @pattern ^[A-Z]+[a-zA-Z0-9.]*$
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* A nice description for the constant or function. It can leverage Github Flavored Markdown formatting.
|
|
22
|
+
*/
|
|
23
|
+
description: string[] | string;
|
|
24
|
+
/**
|
|
25
|
+
* Version string. Format x.y.
|
|
26
|
+
* @pattern ^1\.\d+$
|
|
27
|
+
*/
|
|
28
|
+
sinceVersion?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Indicates if the item should not be documented.
|
|
31
|
+
*/
|
|
32
|
+
disableDocumentation?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The profiles the constant or the function belongs to.
|
|
35
|
+
*/
|
|
36
|
+
profiles?: Profile[];
|
|
37
|
+
/**
|
|
38
|
+
* The bundle the constant or the function belongs to.
|
|
39
|
+
*/
|
|
40
|
+
bundle: Bundle;
|
|
41
|
+
/**
|
|
42
|
+
* The relative path to an image to illustate the constant or the function.
|
|
43
|
+
*/
|
|
44
|
+
image?: string;
|
|
45
|
+
/**
|
|
46
|
+
* 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.
|
|
47
|
+
* @pattern ^[A-Z]+.*$
|
|
48
|
+
*/
|
|
49
|
+
snippet: string;
|
|
50
|
+
/**
|
|
51
|
+
* The collection of examples
|
|
52
|
+
*/
|
|
53
|
+
examples?: SchemaExample[];
|
|
54
|
+
/**
|
|
55
|
+
* A collection of links to resources
|
|
56
|
+
*/
|
|
57
|
+
resourceLinks?: SchemaResourceLink[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Describes an Api Constant
|
|
61
|
+
*/
|
|
62
|
+
export interface BaseSchemaApiConstant<Bundle extends BundleType = BundleType, Profile extends ProfileType = ProfileType> extends GenericSchemaItemBase<Bundle, Profile> {
|
|
63
|
+
/**
|
|
64
|
+
* For constant, the property is mandatory and always true
|
|
65
|
+
*/
|
|
66
|
+
isConstant: true;
|
|
67
|
+
}
|
|
68
|
+
export type SchemaReturnValue<ValueType extends SchemaValueType = SchemaValueType> = SchemaReturnDefinition<ValueType> | ValueType | ValueType[];
|
|
69
|
+
/**
|
|
70
|
+
* Describes an Api Function.
|
|
71
|
+
*/
|
|
72
|
+
export interface BaseSchemaApiFunction<Bundle extends BundleType, Profile extends ProfileType, ValueType extends SchemaValueType> extends GenericSchemaItemBase<Bundle, Profile> {
|
|
73
|
+
/**
|
|
74
|
+
* For function this property is optional and always false.
|
|
75
|
+
*/
|
|
76
|
+
isConstant?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The set of function parameters.
|
|
79
|
+
*/
|
|
80
|
+
parameters?: SchemaProperty<ValueType>[];
|
|
81
|
+
/**
|
|
82
|
+
* The type of data returned by the function.
|
|
83
|
+
*/
|
|
84
|
+
returnValue?: SchemaReturnValue<ValueType>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Describes the properties for the type Property
|
|
88
|
+
*/
|
|
89
|
+
export interface SchemaProperty<ValueType extends SchemaValueType = SchemaValueType> {
|
|
90
|
+
/**
|
|
91
|
+
* The name of the property.
|
|
92
|
+
* @pattern ^([a-z]+[a-zA-Z0-9_]*|\[.*\])$
|
|
93
|
+
*/
|
|
94
|
+
name: string;
|
|
95
|
+
/**
|
|
96
|
+
* The data type of the property value. If the property supports more than one type then use an array.
|
|
97
|
+
*/
|
|
98
|
+
type: ValueType | ValueType[];
|
|
99
|
+
/**
|
|
100
|
+
* The description for the property.
|
|
101
|
+
*/
|
|
102
|
+
description: string[] | string;
|
|
103
|
+
/**
|
|
104
|
+
* Indicates if the property is optional.
|
|
105
|
+
*/
|
|
106
|
+
optional?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* The properties if the type is Dictionary.
|
|
109
|
+
*/
|
|
110
|
+
properties?: SchemaProperty<ValueType>[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Describes the type fo data returned by a function.
|
|
114
|
+
*/
|
|
115
|
+
export interface SchemaReturnDefinition<T extends SchemaValueType = SchemaValueType> {
|
|
116
|
+
/**
|
|
117
|
+
* The data type of the value returned.
|
|
118
|
+
*/
|
|
119
|
+
type: T;
|
|
120
|
+
/**
|
|
121
|
+
* A description for for the value returned.
|
|
122
|
+
*/
|
|
123
|
+
description?: string[] | string;
|
|
124
|
+
/**
|
|
125
|
+
* The properties if the type returned is a Dictionary
|
|
126
|
+
*/
|
|
127
|
+
properties?: SchemaProperty<T>[];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Describes an example
|
|
131
|
+
*/
|
|
132
|
+
export interface SchemaExample {
|
|
133
|
+
/**
|
|
134
|
+
* A description for the example.
|
|
135
|
+
*/
|
|
136
|
+
description?: string[] | string;
|
|
137
|
+
/**
|
|
138
|
+
* Either a single line string or an array of strings.
|
|
139
|
+
*/
|
|
140
|
+
code: string[] | string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Describes a link to additional resources
|
|
144
|
+
*/
|
|
145
|
+
export interface SchemaResourceLink {
|
|
146
|
+
/**
|
|
147
|
+
* The text used to describe the resource link.
|
|
148
|
+
*/
|
|
149
|
+
linkText: string;
|
|
150
|
+
/**
|
|
151
|
+
* The url to the resource.
|
|
152
|
+
*/
|
|
153
|
+
url: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Definition for simple item
|
|
157
|
+
*/
|
|
158
|
+
export type SingularApiItem = ArcadeApiConstant | ArcadeApiFunction | SqlApiFunction;
|
|
159
|
+
/**
|
|
160
|
+
* Definition for a constant or a function.
|
|
161
|
+
* An Api Item can be either a constant, a function, or an array of functions
|
|
162
|
+
*/
|
|
163
|
+
export type BaseSchemaApiItem<LanguageApiFunction extends SchemaApiFunction, LanguageApiConstant extends BaseSchemaApiConstant | undefined = undefined> = LanguageApiFunction | LanguageApiFunction[] | (LanguageApiConstant extends undefined ? never : LanguageApiConstant);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ArcadeBundleType, ArcadeProfileType, ArcadeValueType } from './arcade';
|
|
2
|
+
import { SqlBundleType, SqlProfileType, SqlValueType } from './sql';
|
|
3
|
+
/**
|
|
4
|
+
* Union of bundle types that can be used in any sdk schema
|
|
5
|
+
*/
|
|
6
|
+
export type BundleType = ArcadeBundleType | SqlBundleType;
|
|
7
|
+
/**
|
|
8
|
+
* Union of profile types that can be used in any sdk schema
|
|
9
|
+
*/
|
|
10
|
+
export type ProfileType = ArcadeProfileType | SqlProfileType;
|
|
11
|
+
/**
|
|
12
|
+
* The collection of supported return types.
|
|
13
|
+
*/
|
|
14
|
+
export type SchemaValueType = ArcadeValueType | SqlValueType;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ArcadeApiFunction, ArcadeApiItem, ArcadeSchemaItemBase } from './arcade';
|
|
2
|
+
import { SqlApiFunction, SqlApiItem, SqlSchemaItemBase } from './sql';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export type { ArcadeApiItem, ArcadeApiConstant } from './arcade';
|
|
7
|
+
export type { SqlApiItem } from './sql';
|
|
8
|
+
/**
|
|
9
|
+
* Union of API items that can be used in any sdk schema
|
|
10
|
+
*/
|
|
11
|
+
export type SchemaApiItem = ArcadeApiItem | SqlApiItem;
|
|
12
|
+
/**
|
|
13
|
+
* Union of API functions that can be used in any sdk schema
|
|
14
|
+
*/
|
|
15
|
+
export type SchemaApiFunction = ArcadeApiFunction | SqlApiFunction;
|
|
16
|
+
/**
|
|
17
|
+
* Union of schema items that can be used in any sdk schema
|
|
18
|
+
*/
|
|
19
|
+
export type SchemaItemBase = ArcadeSchemaItemBase | SqlSchemaItemBase;
|
|
20
|
+
export type * from './base';
|
|
21
|
+
export type * from './common';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BaseSchemaApiFunction, BaseSchemaApiItem, GenericSchemaItemBase } from './base';
|
|
2
|
+
/**
|
|
3
|
+
* Supported function bundles
|
|
4
|
+
*/
|
|
5
|
+
export type SqlBundleType = "date" | "numeric" | "string";
|
|
6
|
+
/**
|
|
7
|
+
* Supported sql profile names
|
|
8
|
+
*/
|
|
9
|
+
export type SqlProfileType = "Field Calculation";
|
|
10
|
+
export type SqlValueType = "Datetime" | "Number" | "String";
|
|
11
|
+
/**
|
|
12
|
+
* Narrowed schema item type for sql
|
|
13
|
+
*/
|
|
14
|
+
export type SqlSchemaItemBase = GenericSchemaItemBase<SqlBundleType, SqlProfileType>;
|
|
15
|
+
/**
|
|
16
|
+
* Narrowed api function type for sql
|
|
17
|
+
*/
|
|
18
|
+
export type SqlApiFunction = BaseSchemaApiFunction<SqlBundleType, SqlProfileType, SqlValueType> & {
|
|
19
|
+
/**
|
|
20
|
+
* The name of the function.
|
|
21
|
+
*/
|
|
22
|
+
name: string;
|
|
23
|
+
/**
|
|
24
|
+
* SQL functions may be "special registers" that are not called like regular functions.
|
|
25
|
+
* For example, CURRENT_DATE is a special register.
|
|
26
|
+
* These functions are not called with parentheses or arguments.
|
|
27
|
+
*/
|
|
28
|
+
isSpecialRegister?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The set of keywords that are used in the function.
|
|
31
|
+
*/
|
|
32
|
+
keywords?: SchemaKeyword[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Narrowed api item type for sql. Sql does not have constants so all sql items are "functions".
|
|
36
|
+
*/
|
|
37
|
+
export type SqlApiItem = BaseSchemaApiItem<SqlApiFunction>;
|
|
38
|
+
/**
|
|
39
|
+
* Describes a keyword used in a function
|
|
40
|
+
*/
|
|
41
|
+
interface SchemaKeyword {
|
|
42
|
+
/**
|
|
43
|
+
* The name of the keyword.
|
|
44
|
+
*/
|
|
45
|
+
name: string;
|
|
46
|
+
/**
|
|
47
|
+
* The description for the keyword.
|
|
48
|
+
*/
|
|
49
|
+
description: string;
|
|
50
|
+
/**
|
|
51
|
+
* (optional) position of the keyword in the function signature, default is to interlace with parameters
|
|
52
|
+
*/
|
|
53
|
+
position?: number;
|
|
54
|
+
}
|
|
55
|
+
export {};
|