@arcgis/coding-components 5.0.0-next.136 → 5.0.0-next.138
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/addons/arcade-coding-assistant/useArcadeAssistant.d.ts +7 -17
- package/dist/addons/index.d.ts +2 -2
- package/dist/addons.js +1 -1
- package/dist/cdn/{UCG4NPRP.js → 2263YYN4.js} +2 -2
- package/dist/cdn/{FV6JUYSW.js → 2BB3QRVG.js} +2 -2
- package/dist/cdn/{Q4UHUY3T.js → 2E4AQ7LP.js} +2 -2
- package/dist/cdn/{EZGAUSIF.js → 46IOYPYQ.js} +2 -2
- package/dist/cdn/{DSHANUYF.js → 4FUSZCAD.js} +2 -2
- package/dist/cdn/{22DCBJ5F.js → 7EGGU2CS.js} +2 -2
- package/dist/cdn/{J2DLUEJO.js → 7F5ICS2R.js} +2 -2
- package/dist/cdn/{UI5EVXFU.js → 7YIS622N.js} +2 -2
- package/dist/cdn/{36Y75YKB.js → AU6VAVFX.js} +2 -2
- package/dist/cdn/{TZYBHRPS.js → B6MSWJY2.js} +2 -2
- package/dist/cdn/{U77BQSD4.js → BMKVGGGT.js} +2 -2
- package/dist/cdn/{MEXDPC7D.js → BTLRRKDQ.js} +1 -1
- package/dist/cdn/{HSBLYEZV.js → CP4WW3L6.js} +2 -2
- package/dist/cdn/{RIEACZTY.js → DQ2MOHDK.js} +2 -2
- package/dist/cdn/{UMHPBSPW.js → EFNX7T2R.js} +1 -1
- package/dist/cdn/{TV544T2R.js → EQV3M2CA.js} +2 -2
- package/dist/cdn/{PP7BAX5L.js → EZ5XJTDZ.js} +2 -2
- package/dist/cdn/{TGBYUAUR.js → GAJRGYGF.js} +2 -2
- package/dist/cdn/{XLQLW2QL.js → HHKNAKMH.js} +2 -2
- package/dist/cdn/{H3N4UPAY.js → IAOEXBRW.js} +3 -3
- package/dist/cdn/{UZMYMIUN.js → ICT2QXVB.js} +2 -2
- package/dist/cdn/{PWTWO4LQ.js → IL3ODH4Q.js} +2 -2
- package/dist/cdn/{RFPCEKOB.js → J5BB2DTX.js} +2 -2
- package/dist/cdn/{ZWJAHBIF.js → JGRG3RTL.js} +2 -2
- package/dist/cdn/{YTFTM7FZ.js → KCG4J2TQ.js} +1 -1
- package/dist/cdn/{5N7BLQUC.js → KY2A6GJX.js} +1 -1
- package/dist/cdn/{CUWBQ6DE.js → LZEK7RTW.js} +2 -2
- package/dist/cdn/M2XE3C7T.js +6 -0
- package/dist/cdn/{VDMEGRHB.js → MBTVAM7I.js} +2 -2
- package/dist/cdn/N3P4PLZT.js +4 -0
- package/dist/cdn/{JYHLAFWX.js → NB4EJVRJ.js} +2 -2
- package/dist/cdn/{ZBKMCGR7.js → NGXPOKHF.js} +2 -2
- package/dist/cdn/{PR666JT5.js → NM7YCIBL.js} +2 -2
- package/dist/cdn/{A7BGWNLB.js → OAY75OXY.js} +2 -2
- package/dist/cdn/{MMSAWKPK.js → OHULNXEE.js} +2 -2
- package/dist/cdn/{OZZYHIPM.js → QN4HJ3GS.js} +1 -1
- package/dist/cdn/{ZB3AQDM2.js → RVGC5EOD.js} +2 -2
- package/dist/cdn/{Q6ERATMA.js → TBZNDJPR.js} +2 -2
- package/dist/cdn/{OCXFKC66.js → TFP62745.js} +1 -1
- package/dist/cdn/{ZLUCSP73.js → TXSPPN6R.js} +2 -2
- package/dist/cdn/{4RJPAWSA.js → UV5OY4GJ.js} +2 -2
- package/dist/cdn/W5PHIIDU.js +4 -0
- package/dist/cdn/{Q54H2UGW.js → X6STFO7U.js} +2 -2
- package/dist/cdn/{MGX5UEEJ.js → Y3CNVWXF.js} +3 -3
- package/dist/cdn/{HEOVDTIB.js → YOZZJZW5.js} +2 -2
- package/dist/cdn/{OAJKP3TF.js → Z2EROYP7.js} +1 -1
- package/dist/cdn/{224QUA5Z.js → Z45QIMDD.js} +2 -2
- package/dist/cdn/{OCZIBXWV.js → ZEXTPWCM.js} +1 -1
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/arcade-defaults.js +2 -2
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +1 -1
- package/dist/chunks/arcade-service-accessors.js +1 -1
- package/dist/chunks/colorize.js +1 -1
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/language-defaults-base.js +3 -3
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +1 -1
- package/dist/chunks/monaco-theme.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/{arcade-contribution.js → setup-monaco-theme.js} +40 -40
- package/dist/chunks/sql-expr-defaults.js +2 -2
- package/dist/chunks/sql-expr-mode.js +1 -1
- package/dist/chunks/sql-expr-service-accessors.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utilities.js +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/types.d.ts +3 -48
- package/dist/components/arcgis-arcade-editor/customElement.d.ts +123 -112
- package/dist/components/arcgis-arcade-editor/customElement.js +2 -2
- package/dist/components/arcgis-arcade-editor/index.d.ts +0 -13
- package/dist/components/arcgis-arcade-results/customElement.js +7 -7
- package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
- package/dist/components/arcgis-code-editor/customElement.d.ts +74 -81
- package/dist/components/arcgis-code-editor/customElement.js +3 -3
- package/dist/components/arcgis-code-editor-shell/customElement.d.ts +9 -5
- package/dist/components/arcgis-code-editor-shell/customElement.js +1 -1
- package/dist/components/arcgis-code-viewer/customElement.d.ts +23 -37
- package/dist/components/arcgis-code-viewer/customElement.js +2 -2
- package/dist/components/arcgis-editor-variables/customElement.js +1 -1
- package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +53 -49
- package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-editor/index.d.ts +0 -7
- package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
- package/dist/docs/api.json +1 -1470
- package/dist/docs/docs.json +1 -1381
- package/dist/docs/vscode.css-custom-data.json +1 -35
- package/dist/docs/vscode.html-custom-data.json +1 -119
- package/dist/docs/web-types.json +1 -385
- package/dist/index.d.ts +34 -21
- package/dist/index.js +1 -1
- package/dist/loader.js +7 -7
- package/dist/types/lumina.d.ts +11 -11
- package/dist/types/preact.d.ts +11 -11
- package/dist/types/react.d.ts +11 -11
- package/dist/types/stencil.d.ts +11 -11
- package/dist/utils/arcade-assistant/types.d.ts +8 -72
- package/dist/utils/arcade-executor.d.ts +158 -126
- package/dist/utils/arcade-monaco/arcade-defaults.d.ts +9 -49
- package/dist/utils/custom-panel.d.ts +35 -30
- package/dist/utils/editor-suggestions.d.ts +17 -28
- package/dist/utils/index.d.ts +4 -6
- package/dist/utils/profile/types.d.ts +273 -345
- package/dist/utils/sql-expr-monaco/sql-expr-defaults.d.ts +8 -22
- package/package.json +6 -6
- package/dist/addons/arcade-coding-assistant/chat-helper.d.ts +0 -78
- package/dist/addons/arcade-coding-assistant/index.d.ts +0 -2
- package/dist/addons/arcade-coding-assistant/temporary-strings.d.ts +0 -47
- package/dist/cdn/2WNWZ6AD.js +0 -4
- package/dist/cdn/EGURZWSY.js +0 -4
- package/dist/cdn/TIR4RXVC.js +0 -6
- package/dist/components/arcgis-arcade-coding-assistant/customElement.d.ts +0 -45
- package/dist/components/arcgis-arcade-coding-assistant/functional.d.ts +0 -235
- package/dist/components/arcgis-arcade-coding-assistant/index.d.ts +0 -27
- package/dist/components/arcgis-arcade-results/customElement.d.ts +0 -32
- package/dist/components/arcgis-arcade-results/functional.d.ts +0 -73
- package/dist/components/arcgis-arcade-results/index.d.ts +0 -10
- package/dist/components/arcgis-arcade-suggestions/customElement.d.ts +0 -24
- package/dist/components/arcgis-arcade-suggestions/index.d.ts +0 -10
- package/dist/components/arcgis-editor-variables/customElement.d.ts +0 -40
- package/dist/components/arcgis-editor-variables/index.d.ts +0 -10
- package/dist/components/arcgis-language-api-panel/customElement.d.ts +0 -42
- package/dist/components/arcgis-language-api-panel/index.d.ts +0 -11
- package/dist/components/arcgis-sql-expression-fields/customElement.d.ts +0 -23
- package/dist/components/arcgis-sql-expression-fields/index.d.ts +0 -7
- package/dist/controllers/useT9n.d.ts +0 -1
- package/dist/runtime.d.ts +0 -6
- package/dist/utils/arcade-assistant/aiContext.d.ts +0 -6
- package/dist/utils/arcade-assistant/constants.d.ts +0 -2
- package/dist/utils/arcade-assistant/utils.d.ts +0 -9
- package/dist/utils/arcade-monaco/arcade-contribution.d.ts +0 -1
- package/dist/utils/arcade-monaco/arcade-language-features.d.ts +0 -35
- package/dist/utils/arcade-monaco/arcade-language-syntax.d.ts +0 -3
- package/dist/utils/arcade-monaco/arcade-mode.d.ts +0 -29
- package/dist/utils/arcade-monaco/arcade-profile-strategy.d.ts +0 -12
- package/dist/utils/arcade-monaco/arcade-service-accessors.d.ts +0 -31
- package/dist/utils/arcade-monaco/arcade-worker-manager.d.ts +0 -22
- package/dist/utils/arcade-monaco/arcade.worker.d.ts +0 -23
- package/dist/utils/arcade-monaco/types.d.ts +0 -9
- package/dist/utils/colorize.d.ts +0 -5
- package/dist/utils/constants.d.ts +0 -3
- package/dist/utils/css-vars.d.ts +0 -7
- package/dist/utils/fields.d.ts +0 -20
- package/dist/utils/internal-monaco-apis.d.ts +0 -67
- package/dist/utils/language-defaults-base.d.ts +0 -76
- package/dist/utils/markdown.d.ts +0 -6
- package/dist/utils/monaco-importer.d.ts +0 -28
- package/dist/utils/monaco-languages.d.ts +0 -17
- package/dist/utils/monaco-theme.json.d.ts +0 -27
- package/dist/utils/monaco-typings.d.ts +0 -8
- package/dist/utils/patch-monaco.d.ts +0 -16
- package/dist/utils/profile/editor-profile.d.ts +0 -278
- package/dist/utils/profile/utils.d.ts +0 -49
- package/dist/utils/setup-monaco-theme.d.ts +0 -1
- package/dist/utils/setup-monaco.d.ts +0 -31
- package/dist/utils/sql-expr-monaco/sql-expr-completion.d.ts +0 -74
- package/dist/utils/sql-expr-monaco/sql-expr-constants.d.ts +0 -67
- package/dist/utils/sql-expr-monaco/sql-expr-contribution.d.ts +0 -1
- package/dist/utils/sql-expr-monaco/sql-expr-language-features.d.ts +0 -23
- package/dist/utils/sql-expr-monaco/sql-expr-language-syntax.d.ts +0 -3
- package/dist/utils/sql-expr-monaco/sql-expr-mode.d.ts +0 -43
- package/dist/utils/sql-expr-monaco/sql-expr-parser-utils.d.ts +0 -36
- package/dist/utils/sql-expr-monaco/sql-expr-profile-utils.d.ts +0 -5
- package/dist/utils/sql-expr-monaco/sql-expr-service-accessors.d.ts +0 -19
- package/dist/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +0 -33
- package/dist/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +0 -82
- package/dist/utils/sql-expr-monaco/sql-expr-validation.d.ts +0 -41
- package/dist/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +0 -22
- package/dist/utils/sql-expr-monaco/sql-expr.worker.d.ts +0 -22
- package/dist/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +0 -13
- package/dist/utils/sql-expr-monaco/types.d.ts +0 -96
- package/dist/utils/utilities.d.ts +0 -16
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { DataTypeNode } from '@arcgis/core/core/sql/types';
|
|
2
|
-
import { MarkerSeverity, languages } from 'monaco-editor';
|
|
3
|
-
export declare enum ChildBearingProperties {
|
|
4
|
-
ARGS = "args",
|
|
5
|
-
CLAUSES = "clauses",
|
|
6
|
-
ELSE = "else",
|
|
7
|
-
END = "end",
|
|
8
|
-
EXPR = "expr",
|
|
9
|
-
LEFT = "left",
|
|
10
|
-
OPERAND = "operand",
|
|
11
|
-
QUALIFIER = "qualifier",
|
|
12
|
-
RIGHT = "right",
|
|
13
|
-
START = "start",
|
|
14
|
-
VALUE = "value"
|
|
15
|
-
}
|
|
16
|
-
export declare const ChildBearingNodeTypes: {
|
|
17
|
-
readonly CASE_EXPRESSION: "case-expression";
|
|
18
|
-
readonly EXPRESSION_LIST: "expression-list";
|
|
19
|
-
readonly FUNCTION: "function";
|
|
20
|
-
readonly INTERVAL: "interval";
|
|
21
|
-
readonly INTERVAL_QUALIFIER: "interval-qualifier";
|
|
22
|
-
readonly WHEN_CLAUSE: "when-clause";
|
|
23
|
-
readonly UNARY_EXPRESSION: "unary-expression";
|
|
24
|
-
readonly BINARY_EXPRESSION: "binary-expression";
|
|
25
|
-
};
|
|
26
|
-
export type ChildBearingNodeType = (typeof ChildBearingNodeTypes)[keyof typeof ChildBearingNodeTypes];
|
|
27
|
-
export declare const CHILD_BEARING_PROPERTIES: {
|
|
28
|
-
readonly "case-expression": readonly [ChildBearingProperties.CLAUSES, ChildBearingProperties.OPERAND, ChildBearingProperties.ELSE];
|
|
29
|
-
readonly "when-clause": readonly [ChildBearingProperties.OPERAND, ChildBearingProperties.VALUE];
|
|
30
|
-
readonly "expression-list": readonly [ChildBearingProperties.VALUE];
|
|
31
|
-
readonly "unary-expression": readonly [ChildBearingProperties.EXPR];
|
|
32
|
-
readonly "binary-expression": readonly [ChildBearingProperties.LEFT, ChildBearingProperties.RIGHT];
|
|
33
|
-
readonly function: readonly [ChildBearingProperties.ARGS];
|
|
34
|
-
readonly interval: readonly [ChildBearingProperties.VALUE, ChildBearingProperties.QUALIFIER];
|
|
35
|
-
readonly "interval-qualifier": readonly [ChildBearingProperties.START, ChildBearingProperties.END];
|
|
36
|
-
};
|
|
37
|
-
export declare const MarkerType: {
|
|
38
|
-
Hint: MarkerSeverity.Hint;
|
|
39
|
-
Info: MarkerSeverity.Info;
|
|
40
|
-
Warning: MarkerSeverity.Warning;
|
|
41
|
-
Error: MarkerSeverity.Error;
|
|
42
|
-
};
|
|
43
|
-
export declare const InsertTextRules: {
|
|
44
|
-
InsertAsSnippet: languages.CompletionItemInsertTextRule.InsertAsSnippet;
|
|
45
|
-
};
|
|
46
|
-
export declare const CompletionItemKind: {
|
|
47
|
-
Function: languages.CompletionItemKind.Function;
|
|
48
|
-
Keyword: languages.CompletionItemKind.Keyword;
|
|
49
|
-
Operator: languages.CompletionItemKind.Operator;
|
|
50
|
-
Variable: languages.CompletionItemKind.Variable;
|
|
51
|
-
Field: languages.CompletionItemKind.Field;
|
|
52
|
-
Reference: languages.CompletionItemKind.Reference;
|
|
53
|
-
};
|
|
54
|
-
type UppercaseUnion<T extends string> = T extends `${infer First}${infer Rest}` ? `${Uppercase<First>}${UppercaseUnion<Rest>}` : T;
|
|
55
|
-
export declare const castDataTypesDict: Record<DataTypeNode["value"]["type"], UppercaseUnion<DataTypeNode["value"]["type"]>>;
|
|
56
|
-
export declare const castDataTypes: UppercaseUnion<DataTypeNode["value"]["type"]>[];
|
|
57
|
-
export declare const datePeriods: string[];
|
|
58
|
-
export declare const extractDateParts: string[];
|
|
59
|
-
export declare const dateLiterals: string[];
|
|
60
|
-
export declare const trimKeywords: string[];
|
|
61
|
-
/** This constant is used to constrain values returned in the peggy parser errors.
|
|
62
|
-
* If a new keyword is introduced, be sure to update this constant.
|
|
63
|
-
*/
|
|
64
|
-
export declare const sqlExprKeywords: string[];
|
|
65
|
-
export declare const sqlExprOperators: string[];
|
|
66
|
-
export declare const sqlExprFunctions: readonly ["CAST", "EXTRACT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", "ABS", "ACOS", "ASIN", "ATAN", "CEILING", "COS", "FLOOR", "LOG", "LOG10", "MOD", "NULLIF", "POWER", "ROUND", "SIGN", "SIN", "TAN", "TRUNCATE", "CHAR_LENGTH", "COALESCE", "CONCAT", "LOWER", "POSITION", "SUBSTRING", "TRIM", "UPPER"];
|
|
67
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { editor as Editor, Position, languages } from 'monaco-editor';
|
|
2
|
-
import { SqlExprDefaults } from './sql-expr-defaults';
|
|
3
|
-
import { ISqlExprWorkerAccessor } from './types';
|
|
4
|
-
import { SqlExprDiagnosticService } from './sql-expr-mode';
|
|
5
|
-
export declare class SqlExprCompletionProvider implements languages.CompletionItemProvider {
|
|
6
|
-
private _worker;
|
|
7
|
-
private _defaults;
|
|
8
|
-
constructor(_worker: ISqlExprWorkerAccessor, _defaults: SqlExprDefaults);
|
|
9
|
-
provideCompletionItems(model: Editor.ITextModel, position: Position): Promise<languages.CompletionList | undefined>;
|
|
10
|
-
}
|
|
11
|
-
export declare class SqlExprDiagnosticsAdapter {
|
|
12
|
-
private _languageId;
|
|
13
|
-
private _worker;
|
|
14
|
-
private _disposables;
|
|
15
|
-
private _modelListeners;
|
|
16
|
-
private _diagnosticsService;
|
|
17
|
-
private _defaults;
|
|
18
|
-
constructor(_languageId: string, _worker: ISqlExprWorkerAccessor, { defaults, diagnosticService, }: {
|
|
19
|
-
defaults: SqlExprDefaults;
|
|
20
|
-
diagnosticService: SqlExprDiagnosticService;
|
|
21
|
-
});
|
|
22
|
-
private _doValidate;
|
|
23
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { IEvent, Uri, editor } from 'monaco-editor';
|
|
2
|
-
import { ISqlExprWorker } from './types';
|
|
3
|
-
import { SqlExprDefaults } from './sql-expr-defaults';
|
|
4
|
-
/**
|
|
5
|
-
* Returns the sql-expression worker for the model uris.
|
|
6
|
-
* @param uris The model uris for which to get the worker.
|
|
7
|
-
* @returns The sql-expression worker.
|
|
8
|
-
*/
|
|
9
|
-
export declare function getSqlExprWorker(...uris: Uri[]): Promise<ISqlExprWorker>;
|
|
10
|
-
export interface ISqlExprDiagnosticEvent {
|
|
11
|
-
/**
|
|
12
|
-
* The uri of the model for which the diagnostics changed.
|
|
13
|
-
*/
|
|
14
|
-
uri: Uri;
|
|
15
|
-
/**
|
|
16
|
-
* The diagnostics for the model.
|
|
17
|
-
*/
|
|
18
|
-
diagnostics: editor.IMarkerData[];
|
|
19
|
-
}
|
|
20
|
-
export interface ISqlExprDiagnosticService {
|
|
21
|
-
onDiagnosticsChange: IEvent<ISqlExprDiagnosticEvent>;
|
|
22
|
-
}
|
|
23
|
-
declare class SqlExprDiagnosticService implements ISqlExprDiagnosticService {
|
|
24
|
-
private _onDiagnosticsChange;
|
|
25
|
-
/**
|
|
26
|
-
* An event to signal changes to the diagnostics.
|
|
27
|
-
* The event value is the uri string and the diagnostics.
|
|
28
|
-
*/
|
|
29
|
-
get onDiagnosticsChange(): IEvent<ISqlExprDiagnosticEvent>;
|
|
30
|
-
/**
|
|
31
|
-
* Fires the diagnostics change event.
|
|
32
|
-
* @param uri The uri of the model for which the diagnostics changed.
|
|
33
|
-
* @param diagnostics The diagnostics for the model.
|
|
34
|
-
*/
|
|
35
|
-
fireDiagnosticsChange(uri: Uri, diagnostics: editor.IMarkerData[]): void;
|
|
36
|
-
}
|
|
37
|
-
export type { SqlExprDiagnosticService };
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @returns The Sql Expression Diagnostic Service.
|
|
41
|
-
*/
|
|
42
|
-
export declare function getSqlExprDiagnosticService(): Promise<ISqlExprDiagnosticService>;
|
|
43
|
-
export declare function setupMode(defaults: SqlExprDefaults): void;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { SQLSyntaxError, SQLNode } from '@arcgis/core/core/sql/types';
|
|
2
|
-
import { ChildBearingProperties } from './sql-expr-constants';
|
|
3
|
-
export declare function isSqlSyntaxError(err: unknown): err is SQLSyntaxError;
|
|
4
|
-
export declare function isUnexpectedTokenError(error: SQLSyntaxError): boolean;
|
|
5
|
-
export declare function getExpectedTokens(error: SQLSyntaxError): string[] | undefined;
|
|
6
|
-
export declare function formatSyntaxError(error: SQLSyntaxError): string;
|
|
7
|
-
type ExpectedLiteral = {
|
|
8
|
-
category: "functions" | "keywords" | "operators";
|
|
9
|
-
text: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* parses the error from the parser and returns the expected literals, used to provide suggestions.
|
|
13
|
-
* it will only return literals that do not contain special characters or numbers.
|
|
14
|
-
*/
|
|
15
|
-
export declare function getExpectedLiterals(error: SQLSyntaxError): ExpectedLiteral[];
|
|
16
|
-
export declare const callerIndexAt = -2;
|
|
17
|
-
/**
|
|
18
|
-
* returns the slot position of the node in the context root
|
|
19
|
-
* @param node the node we want to find the slot position for
|
|
20
|
-
* @param contextRoot the context root of the node, see {@link identifyContextRoot}
|
|
21
|
-
*/
|
|
22
|
-
export declare function getSlotPosition(node: SQLNode, contextRoot: SQLNode): ChildBearingProperties | number;
|
|
23
|
-
/**
|
|
24
|
-
* Identifies the context root of the searchNode in the searchTree. The context root is the first "non-terminal" node within the node's parent context (searchTree).
|
|
25
|
-
* see {@link terminalTypes} for the list of terminal types.
|
|
26
|
-
* @param searchNode the node we want to find the context root for
|
|
27
|
-
* @param searchTree all the nodes contained in the searchNode's parent context
|
|
28
|
-
* @returns The context root of the searchNode
|
|
29
|
-
*/
|
|
30
|
-
export declare function identifyContextRoot(searchNode: SQLNode, searchTree: SQLNode[]): SQLNode;
|
|
31
|
-
/**
|
|
32
|
-
* Appends the required number of closing parentheses to the model content.
|
|
33
|
-
* This helps when the parsing fails. We try closing the unclosed parentheses, and resubmit the content for parsing.
|
|
34
|
-
*/
|
|
35
|
-
export declare function closeUnclosedDelimiters(modelContent: string): string;
|
|
36
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ISqlExprWorker } from './types';
|
|
2
|
-
import { Uri } from 'monaco-editor';
|
|
3
|
-
import type * as sqlExprModeModule from "./sql-expr-mode";
|
|
4
|
-
type SqlExprModeType = typeof sqlExprModeModule;
|
|
5
|
-
/**
|
|
6
|
-
* Returns the sql-expression worker for the model.
|
|
7
|
-
* Example:
|
|
8
|
-
* ```ts
|
|
9
|
-
* const sqlExpressionWorker = await getSqlExpressionWorker(model.uri);
|
|
10
|
-
* ```
|
|
11
|
-
* @returns sql-expression worker
|
|
12
|
-
*/
|
|
13
|
-
export declare function getSqlExprWorker(uri: Uri): Promise<ISqlExprWorker>;
|
|
14
|
-
/**
|
|
15
|
-
* Request the sql-expression mode
|
|
16
|
-
* @returns sql-expression mode module
|
|
17
|
-
*/
|
|
18
|
-
export declare function getMode(): Promise<SqlExprModeType>;
|
|
19
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export declare enum ValidationDiagnosticCodes {
|
|
2
|
-
ExpectedDateTimeValue = "ExpectedDateTimeValue",
|
|
3
|
-
ExpectedNumericalLiteral = "ExpectedNumericalLiteral",
|
|
4
|
-
ExpectedToken = "ExpectedToken",
|
|
5
|
-
FunctionNotSupported = "FunctionNotSupported",
|
|
6
|
-
IncompatibleListDataType = "IncompatibleListDataType",
|
|
7
|
-
IncorrectArgumentLength = "IncorrectArgumentLength",
|
|
8
|
-
IncorrectCastParameters = "IncorrectCastParameters",
|
|
9
|
-
InvalidDateArithmetic = "InvalidDateArithmetic",
|
|
10
|
-
IncorrectExtractParameters = "IncorrectExtractParameters",
|
|
11
|
-
IncorrectSubstringParameters = "IncorrectSubstringParameters",
|
|
12
|
-
IncorrectTrimParameters = "IncorrectTrimParameters",
|
|
13
|
-
InvalidElseClause = "InvalidElseClause",
|
|
14
|
-
InvalidThenClause = "InvalidThenClause",
|
|
15
|
-
InvalidEndOnWhen = "InvalidEndOnWhen",
|
|
16
|
-
InvalidTrimCharacter = "InvalidTrimCharacter",
|
|
17
|
-
MismatchedTypes = "MismatchedTypes",
|
|
18
|
-
MissingValueInCaseClause = "MissingValueInCaseClause",
|
|
19
|
-
NotCallable = "NotCallable",
|
|
20
|
-
TypeNotAssignable = "TypeNotAssignable",
|
|
21
|
-
UnexpectedEnd = "UnexpectedEnd.",
|
|
22
|
-
UnexpectedIdentifier = "UnexpectedIdentifier",
|
|
23
|
-
UnexpectedNumber = "UnexpectedNumber",
|
|
24
|
-
UnexpectedTextLiteral = "UnexpectedTextLiteral",
|
|
25
|
-
UnexpectedToken = "UnexpectedToken",
|
|
26
|
-
UnknownField = "UnknownField",
|
|
27
|
-
UnsupportedOperator = "UnsupportedOperator",
|
|
28
|
-
UnsupportedSyntax = "UnsupportedSyntax",
|
|
29
|
-
InvalidIntervalQualifier = "InvalidIntervalQualifier",
|
|
30
|
-
EmptyCaseExpression = "EmptyCaseExpression"
|
|
31
|
-
}
|
|
32
|
-
export declare const DiagnosticMessages: Record<ValidationDiagnosticCodes, string>;
|
|
33
|
-
export declare const getDiagnosticMessage: (diagnosticCode: ValidationDiagnosticCodes, replacements?: Record<string, number | string>) => string;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { IRange, editor } from 'monaco-editor';
|
|
2
|
-
import { ArcGISFieldType, SqlExpressionLiteral } from './types';
|
|
3
|
-
import { ApiVariable } from '@arcgis/languages-api-utils';
|
|
4
|
-
import { SQLSourceLocation, SQLNode } from '@arcgis/core/core/sql/types';
|
|
5
|
-
export interface ValidationSyntaxContext {
|
|
6
|
-
token: string;
|
|
7
|
-
range: IRange;
|
|
8
|
-
startDelimiter?: boolean;
|
|
9
|
-
content?: ValidationSyntaxContext[];
|
|
10
|
-
}
|
|
11
|
-
export declare enum TokenType {
|
|
12
|
-
SINGLE = "SINGLE",
|
|
13
|
-
EMPTY_FIELD = "EMPTY_FIELD",
|
|
14
|
-
ERROR = "ERROR",
|
|
15
|
-
FIELD = "FIELD",
|
|
16
|
-
KEYWORD_IN = "IN",
|
|
17
|
-
KEYWORD_NOT_IN = "NOT IN",
|
|
18
|
-
KEYWORD_BETWEEN = "BETWEEN",
|
|
19
|
-
KEYWORD_NOT_BETWEEN = "NOT BETWEEN",
|
|
20
|
-
LIST = "LIST",
|
|
21
|
-
NEGATION = "NOT",
|
|
22
|
-
NUMBER = "NUMBER",
|
|
23
|
-
OPERATOR = "OPERATOR",
|
|
24
|
-
PARENTHESES = "PARENTHESES",
|
|
25
|
-
STRING = "STRING",
|
|
26
|
-
UNKNOWN = "UNKNOWN"
|
|
27
|
-
}
|
|
28
|
-
export declare enum Token {
|
|
29
|
-
CASE = "CASE",
|
|
30
|
-
CASE_ELSE = "ELSE",
|
|
31
|
-
CASE_THEN = "THEN",
|
|
32
|
-
CASE_WHEN = "WHEN",
|
|
33
|
-
COMMA = ",",
|
|
34
|
-
DOUBLE_QUOTE = "\"",
|
|
35
|
-
EMPTY = "",
|
|
36
|
-
END = "END",
|
|
37
|
-
INTERVAL = "INTERVAL",
|
|
38
|
-
LEFT_PARENTHESES = "(",
|
|
39
|
-
NEW_LINE = "\n",
|
|
40
|
-
RIGHT_PARENTHESES = ")",
|
|
41
|
-
SINGLE_QUOTE = "'",
|
|
42
|
-
WHITE_SPACE = " "
|
|
43
|
-
}
|
|
44
|
-
export declare enum NodeReturnType {
|
|
45
|
-
BOOLEAN = "BOOLEAN",
|
|
46
|
-
DOUBLE = "DOUBLE",
|
|
47
|
-
EXPRESSION_LIST = "EXPRESSION-LIST",
|
|
48
|
-
FLOAT = "FLOAT",
|
|
49
|
-
INTEGER = "INTEGER",
|
|
50
|
-
NULL = "NULL",
|
|
51
|
-
NUMBER = "NUMBER",
|
|
52
|
-
REAL = "REAL",
|
|
53
|
-
STRING = "STRING",
|
|
54
|
-
SMALL_INT = "SMALLINT",
|
|
55
|
-
UNKNOWN_FUNCTION = "UNKNOWN_FUNCTION"
|
|
56
|
-
}
|
|
57
|
-
export declare enum CallableExpressionResponse {
|
|
58
|
-
FUNCTION = "FUNCTION",
|
|
59
|
-
EXPRESSION_LIST = "EXPRESSION_LIST",
|
|
60
|
-
SUCCESS = "SUCCESS",
|
|
61
|
-
NON_CALLABLE = "NON_CALLABLE"
|
|
62
|
-
}
|
|
63
|
-
export declare const isValidIntervalValue: RegExp;
|
|
64
|
-
export declare const relationalTypes: ReturnType<typeof identifyNodeReturnType>[];
|
|
65
|
-
export declare const qualifiers: TokenType[];
|
|
66
|
-
export declare function convertArcgisTypeToSqlReturnType(arcgisType: ArcGISFieldType): SqlExpressionLiteral;
|
|
67
|
-
export declare const identifyNodeReturnType: (node: SQLNode, fields: ApiVariable[]) => SqlExpressionLiteral | "time-only" | "unknown_function";
|
|
68
|
-
/**
|
|
69
|
-
* Helper function to identify if the given type is able to be used in arithmetic operations
|
|
70
|
-
*/
|
|
71
|
-
export declare const isArithmeticType: (type: SqlExpressionLiteral | "time-only" | "unknown_function") => boolean;
|
|
72
|
-
export declare const isNumericType: (type: SqlExpressionLiteral) => boolean;
|
|
73
|
-
/**
|
|
74
|
-
* SQL allows arithmetic operations on intervals combined with dates or numbers.
|
|
75
|
-
*/
|
|
76
|
-
export declare const isValidIntervalArithmetic: (leftNode: SQLNode, rightNode: SQLNode, fields: ApiVariable[]) => boolean;
|
|
77
|
-
export declare const isValidNumericArithmetic: (leftNode: SQLNode, rightNode: SQLNode, fields: ApiVariable[]) => boolean;
|
|
78
|
-
export declare const formatListToString: (types: ReturnType<typeof identifyNodeReturnType>[], delimiter: string) => string;
|
|
79
|
-
export declare const formatType: (type: string) => string;
|
|
80
|
-
export declare const getValueFromNode: (node: SQLNode) => number | string;
|
|
81
|
-
export declare const addNewMarker: (message: string, range: IRange | SQLSourceLocation, markers: editor.IMarkerData[], isNodeFormat?: boolean) => void;
|
|
82
|
-
export declare const validateTypeMatch: (node: SQLNode, expectedType: NodeReturnType, markers: editor.IMarkerData[], fields: ApiVariable[]) => void;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { editor } from 'monaco-editor';
|
|
2
|
-
import { ApiCategory, ApiContext } from '@arcgis/languages-api-utils';
|
|
3
|
-
import { SQLNode } from '@arcgis/core/core/sql/types.js';
|
|
4
|
-
export declare class SQLExpressionValidation {
|
|
5
|
-
private callStack;
|
|
6
|
-
private _sdkFunctions;
|
|
7
|
-
private _fields;
|
|
8
|
-
markers: editor.IMarkerData[];
|
|
9
|
-
constructor(sdkLibrary: ApiCategory[], _apiContext: ApiContext);
|
|
10
|
-
/**
|
|
11
|
-
* validates the SQL Expression by generating an AST and traversing it
|
|
12
|
-
* @param modelContent The SQL Expression to validate
|
|
13
|
-
*/
|
|
14
|
-
validateModel(modelContent: string): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* a DFS traversal of the SQL Expression AST
|
|
17
|
-
* @param node The node to traverse, start with the root node
|
|
18
|
-
*/
|
|
19
|
-
traverse(node: SQLNode): void;
|
|
20
|
-
/**
|
|
21
|
-
* Validates a nodes syntax and types
|
|
22
|
-
* @param node The node to validate
|
|
23
|
-
*/
|
|
24
|
-
private _validateNode;
|
|
25
|
-
private _handleParserFailure;
|
|
26
|
-
/**
|
|
27
|
-
* Formats a node's range into a Monaco IRange object.
|
|
28
|
-
* @param node
|
|
29
|
-
*/
|
|
30
|
-
private _getRange;
|
|
31
|
-
/**
|
|
32
|
-
* finds the function in the SDK library.
|
|
33
|
-
* @param name name of the function
|
|
34
|
-
*/
|
|
35
|
-
private _getFunction;
|
|
36
|
-
/**
|
|
37
|
-
* looks at the node and finds any children attached to it. If there are children, it will traverse them.
|
|
38
|
-
* @param node The current node to traverse
|
|
39
|
-
*/
|
|
40
|
-
private _traverseChildren;
|
|
41
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Uri, editor as Editor } from 'monaco-editor';
|
|
2
|
-
import { ISqlExprWorker } from './types';
|
|
3
|
-
import { SqlExprDefaults } from './sql-expr-defaults';
|
|
4
|
-
/**
|
|
5
|
-
* Manager to create our sql-expression worker and client proxy
|
|
6
|
-
*/
|
|
7
|
-
export declare class SqlExprWorkerManager {
|
|
8
|
-
private _defaults;
|
|
9
|
-
private _worker;
|
|
10
|
-
private _client;
|
|
11
|
-
private _configChangeListener;
|
|
12
|
-
constructor(_defaults: SqlExprDefaults);
|
|
13
|
-
dispose(): void;
|
|
14
|
-
stopWorker(): void;
|
|
15
|
-
/**
|
|
16
|
-
* Wait for the worker to be ready.
|
|
17
|
-
* @returns A promise that resolves when the worker is ready.
|
|
18
|
-
*/
|
|
19
|
-
static waitForWorker(): Promise<Editor.MonacoWebWorker<ISqlExprWorker>>;
|
|
20
|
-
private _getClientProxy;
|
|
21
|
-
getLanguageServiceWorker(...resources: Uri[]): Promise<ISqlExprWorker>;
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { languages, worker, editor, Position, IRange } from 'monaco-editor';
|
|
2
|
-
import { ISqlExprWorker } from './types';
|
|
3
|
-
import { ApiCategory, ApiContext, ApiDatabase } from '@arcgis/languages-api-utils';
|
|
4
|
-
import { WorkerHost } from '../language-defaults-base';
|
|
5
|
-
interface IWorkerData {
|
|
6
|
-
languageId: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* The ArcGIS SQL Expression Web Worker is proxied by the Monaco worker server.
|
|
10
|
-
*/
|
|
11
|
-
export declare class SqlExprWorker implements ISqlExprWorker {
|
|
12
|
-
private _ctx;
|
|
13
|
-
private _languageId;
|
|
14
|
-
private _apiService;
|
|
15
|
-
constructor(_ctx: worker.IWorkerContext<WorkerHost>, { languageId }: IWorkerData);
|
|
16
|
-
doValidation(modelId: string, context: ApiContext): Promise<editor.IMarkerData[]>;
|
|
17
|
-
doComplete(modelId: string, range: IRange, position: Position, context: ApiContext): Promise<languages.CompletionList>;
|
|
18
|
-
getApiLibrary(context: ApiContext): Promise<ApiCategory[]>;
|
|
19
|
-
getApiDatabase(context: ApiContext): Promise<ApiDatabase>;
|
|
20
|
-
private _getTextDocument;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EditorProfile } from '../profile/editor-profile';
|
|
2
|
-
import { ApiProfile } from '@arcgis/languages-api-utils';
|
|
3
|
-
import { IPredefinedProfile, IEditorProfileDefinition } from '../profile/types';
|
|
4
|
-
/**
|
|
5
|
-
* Converts an editor profile to an api profile.
|
|
6
|
-
* The api profile is an optimized version of the editor profile designed for minimal data transfer between the main thread and the worker.
|
|
7
|
-
*/
|
|
8
|
-
export declare const sqlExprEditorToApiProfile: (editorProfile: EditorProfile) => ApiProfile;
|
|
9
|
-
/**
|
|
10
|
-
* converts a predefined editor profile to a IEditorProfileDefinition.
|
|
11
|
-
* This is used to hydrate a profile definition from a predefined profile.
|
|
12
|
-
*/
|
|
13
|
-
export declare function convertToEditorProfileDefinition(predefinedProfile: IPredefinedProfile): IEditorProfileDefinition | undefined;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Thenable, Uri, languages, editor, IRange, Position as MonacoPosition, Position } from 'monaco-editor';
|
|
2
|
-
import { ApiCategory, ApiContext } from '@arcgis/languages-api-utils';
|
|
3
|
-
import { SQLNode, DataTypeNode, BinaryNode } from '@arcgis/core/core/sql/types';
|
|
4
|
-
import { default as Field } from '@arcgis/core/layers/support/Field';
|
|
5
|
-
export interface ISqlExprWorker {
|
|
6
|
-
doValidation: (modelId: string, context: ApiContext) => Thenable<editor.IMarkerData[]>;
|
|
7
|
-
doComplete: (modelId: string, range: IRange, position: Position, context: ApiContext) => Thenable<languages.CompletionList>;
|
|
8
|
-
getApiLibrary: (context: ApiContext) => Thenable<ApiCategory[]>;
|
|
9
|
-
}
|
|
10
|
-
export type ISqlExprWorkerAccessor = (...more: Uri[]) => Thenable<ISqlExprWorker>;
|
|
11
|
-
export interface ApiContextType {
|
|
12
|
-
description: string;
|
|
13
|
-
parameters: {
|
|
14
|
-
name: string;
|
|
15
|
-
type: string[] | string;
|
|
16
|
-
description: string;
|
|
17
|
-
}[];
|
|
18
|
-
returnValue: string[] | string;
|
|
19
|
-
examples: {
|
|
20
|
-
code: string;
|
|
21
|
-
description: string;
|
|
22
|
-
}[];
|
|
23
|
-
snippet: string[] | string;
|
|
24
|
-
name: string;
|
|
25
|
-
bundle: string;
|
|
26
|
-
}
|
|
27
|
-
export interface ICompletionContext {
|
|
28
|
-
range: IRange;
|
|
29
|
-
modelContent: string;
|
|
30
|
-
position: MonacoPosition;
|
|
31
|
-
lowestNode: SQLNode | undefined;
|
|
32
|
-
subTree: SQLNode[];
|
|
33
|
-
completionItems: languages.CompletionItem[];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* SQL Expression Literal. These are the types that occur within nodes of the AST generated by the peggy parser.
|
|
37
|
-
**/
|
|
38
|
-
export type SqlExpressionLiteral =
|
|
39
|
-
/**
|
|
40
|
-
* "date"
|
|
41
|
-
* "float"
|
|
42
|
-
* "integer"
|
|
43
|
-
* "real"
|
|
44
|
-
* "smallint"
|
|
45
|
-
* "time"
|
|
46
|
-
* "timestamp"
|
|
47
|
-
* "varchar"
|
|
48
|
-
*/
|
|
49
|
-
DataTypeNode["value"]["type"]
|
|
50
|
-
/**
|
|
51
|
-
* "binary-expression"
|
|
52
|
-
* "boolean"
|
|
53
|
-
* "case-expression"
|
|
54
|
-
* "column-reference"
|
|
55
|
-
* "current-time"
|
|
56
|
-
* "data-type"
|
|
57
|
-
* "date"
|
|
58
|
-
* "expression-list"
|
|
59
|
-
* "function"
|
|
60
|
-
* "interval"
|
|
61
|
-
* "interval-period"
|
|
62
|
-
* "interval-qualifier"
|
|
63
|
-
* "null"
|
|
64
|
-
* "number"
|
|
65
|
-
* "parameter"
|
|
66
|
-
* "string"
|
|
67
|
-
* "time"
|
|
68
|
-
* "timestamp"
|
|
69
|
-
* "unary-expression"
|
|
70
|
-
* "when-clause"
|
|
71
|
-
*/
|
|
72
|
-
| SQLNode["type"];
|
|
73
|
-
export type NodeReturnType = SqlExpressionLiteral | "time-only" | "unknown_function";
|
|
74
|
-
export type ArcGISFieldType =
|
|
75
|
-
/**
|
|
76
|
-
* "string"
|
|
77
|
-
* "date"
|
|
78
|
-
* "integer"
|
|
79
|
-
* "small-integer"
|
|
80
|
-
* "big-integer"
|
|
81
|
-
* "single"
|
|
82
|
-
* "double"
|
|
83
|
-
* "long"
|
|
84
|
-
* "date-only"
|
|
85
|
-
* "time-only"
|
|
86
|
-
* "timestamp-offset"
|
|
87
|
-
* "oid"
|
|
88
|
-
* "geometry"
|
|
89
|
-
* "blob"
|
|
90
|
-
* "raster"
|
|
91
|
-
* "guid"
|
|
92
|
-
* "global-id"
|
|
93
|
-
* "xml"
|
|
94
|
-
*/
|
|
95
|
-
Field["type"];
|
|
96
|
-
export type SqlExpOperator = BinaryNode["operator"];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { editor } from 'monaco-editor';
|
|
2
|
-
import { default as PortalItem } from '@arcgis/core/portal/PortalItem';
|
|
3
|
-
type KeysOfType<T, U> = {
|
|
4
|
-
[P in keyof T]: T[P] extends U ? P : never;
|
|
5
|
-
}[keyof T];
|
|
6
|
-
/**
|
|
7
|
-
* Filters a collection of items by the given keys and filter word.
|
|
8
|
-
*/
|
|
9
|
-
export declare function filterCollection<T, U extends KeysOfType<T, string | undefined>>(collection: T[], keys: U | U[], filterWord: string, beforeFilteringFn?: (item: T) => boolean | undefined): T[];
|
|
10
|
-
/**
|
|
11
|
-
* Returns the url to the portal item.
|
|
12
|
-
*/
|
|
13
|
-
export declare function portalItemPageUrl(portalItem: PortalItem | null | undefined): string;
|
|
14
|
-
export declare function editModel(editorInstance: editor.IStandaloneCodeEditor | undefined, script: string, insertMode?: "add" | "replace", disclaimer?: string): void;
|
|
15
|
-
export declare function formatResult(script: string): string;
|
|
16
|
-
export {};
|