@arcgis/languages-api-utils 4.32.0-next.13 → 4.32.0-next.131
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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.d.cts +38 -8
- package/dist/esm/index.d.ts +38 -8
- package/dist/esm/index.js +2 -2
- package/package.json +1 -1
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ It is not intended to be used directly, but rather used as a dependency by other
|
|
|
9
9
|
|
|
10
10
|
## License
|
|
11
11
|
|
|
12
|
-
COPYRIGHT ©
|
|
12
|
+
COPYRIGHT © 2025 Esri
|
|
13
13
|
|
|
14
14
|
All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
|
|
15
15
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var f=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of x(t))!D.call(e,o)&&o!==n&&f(e,o,{get:()=>t[o],enumerable:!(i=C(t,o))||i.enumerable});return e};var M=e=>k(f({},"__esModule",{value:!0}),e);var w={};h(w,{ApiService:()=>
|
|
1
|
+
"use strict";var f=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of x(t))!D.call(e,o)&&o!==n&&f(e,o,{get:()=>t[o],enumerable:!(i=C(t,o))||i.enumerable});return e};var M=e=>k(f({},"__esModule",{value:!0}),e);var w={};h(w,{ApiService:()=>y,filterApiLibraryForContext:()=>A,isDictionaryVariable:()=>V,isValueVariable:()=>S});module.exports=M(w);var s=require("vscode-languageserver-types");async function A(e,t){try{let n=await e,i=new Map,o=new Map,a=[],r=T(t);return n.forEach(c=>{let l=[];c.items.forEach(p=>v(l,o,i,r,p)),l.length&&a.push({...c,items:l})}),{categories:a,functionDefinitions:i,constantDefinitions:o}}catch(n){return console.error(n),{categories:[],functionDefinitions:new Map,constantDefinitions:new Map}}}function T(e){let{profile:{apiVersion:t,bundles:n,hiddenApiItems:i=[]}={}}=e,o=b(t),a=Array.isArray(n)&&n.length>0?new Set(["core",...n]):void 0;return r=>L(o,r.sinceVersion)&&(!a||a.has(r.bundle))&&!i.includes(r.name)}function v(e,t,n,i,o){if(Array.isArray(o)){o.forEach(a=>g(e,n,i,a));return}o.type==="constant"?F(e,t,i,o):g(e,n,i,o)}function g(e,t,n,i){if(!n(i))return;i.disableDocumentation||e.push(i);let{completion:{label:o}}=i,a=o.toLowerCase(),r=t.get(a);r||(r={type:"functionDefinition",key:a,overloads:[]},t.set(a,r)),r.overloads.push(i)}function F(e,t,n,i){if(!n(i))return;e.push(i);let{completion:{label:o}}=i,a=o.toLowerCase();t.set(a,i);let[r,c]=i.completion.label.split(".");if(!c)return;let l=r.toLowerCase(),p=t.get(l);p||(p={type:"namespace",key:l,members:[],completion:{label:r,detail:r,insertText:r,insertTextMode:s.InsertTextMode.adjustIndentation,insertTextFormat:s.InsertTextFormat.PlainText,kind:s.CompletionItemKind.Enum}},t.set(l,p));let u=structuredClone(i);u.name=c,u.completion.label=c,u.completion.insertText=c,u.completion.kind=s.CompletionItemKind.Constant,p.members.push(u),p.completion.documentation=p.members.reduce((m,d)=>(m.value=`${m.value}${m.value?`
|
|
2
2
|
|
|
3
|
-
`:""}**${
|
|
3
|
+
`:""}**${d.completion.label}**: ${d.description}`,m),{kind:s.MarkupKind.Markdown,value:""})}function b(e){if(!e||typeof e!="string")return null;let t=e.split(".").map(o=>Number.parseInt(o));if(t.some(Number.isNaN))return console.error("Invalid API version string",e),null;let[n,i]=t.slice(0,2);return{major:n,minor:i}}function L(e,t){if(!e)return!0;let n=b(t);return n?e.major>n.major?!1:e.minor===void 0||n.minor===void 0?!0:n.minor<=e.minor:!0}function S(e){return!!e&&e.type!=="dictionary"}function V(e){return e?.type==="dictionary"}var y=class{constructor(t){this._settings=t;this.localeToApiLibraryPromiseMap=new Map}async getApiDatabase(t){let{locale:n="en"}=t,i=this.localeToApiLibraryPromiseMap.get(n);return i||(i=this._settings.getApiLibrary(n),this.localeToApiLibraryPromiseMap.set(n,i)),await A(i,t)}async getApiLibrary(t){let{categories:n}=await this.getApiDatabase(t);return n}};0&&(module.exports={ApiService,filterApiLibraryForContext,isDictionaryVariable,isValueVariable});
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -3,16 +3,22 @@ import { CompletionItem } from 'vscode-languageserver-types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Supported function bundles
|
|
5
5
|
*/
|
|
6
|
-
type
|
|
6
|
+
type SqlBundleType = "core";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Union of bundle types that can be used in any sdk schema
|
|
10
|
+
*/
|
|
11
|
+
type BundleType = ArcadeBundleType | SqlBundleType;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Supported function bundles
|
|
10
15
|
*/
|
|
11
|
-
type
|
|
16
|
+
type ArcadeBundleType = "core" | "data-access" | "database" | "geometry" | "knowledge-graph" | "portal-access" | "track";
|
|
17
|
+
|
|
12
18
|
/**
|
|
13
19
|
* Describes a profile
|
|
14
20
|
*/
|
|
15
|
-
interface
|
|
21
|
+
interface BaseSdkPredefinedProfile<ProfileId extends string, Bundle extends string> {
|
|
16
22
|
/**
|
|
17
23
|
* Profile name for UI
|
|
18
24
|
*/
|
|
@@ -24,7 +30,7 @@ interface SdkPredefinedProfile {
|
|
|
24
30
|
/**
|
|
25
31
|
* Function bundles enabled for this profile
|
|
26
32
|
*/
|
|
27
|
-
bundles:
|
|
33
|
+
bundles: Bundle[];
|
|
28
34
|
/**
|
|
29
35
|
* Variable describing name, type, and providing description
|
|
30
36
|
*/
|
|
@@ -33,7 +39,7 @@ interface SdkPredefinedProfile {
|
|
|
33
39
|
/**
|
|
34
40
|
* Supported profile variable types
|
|
35
41
|
*/
|
|
36
|
-
type SdkVariableType = "
|
|
42
|
+
type SdkVariableType = "array" | "boolean" | "date" | "dateOnly" | "dictionary" | "feature" | "featureSet" | "featureSetCollection" | "geometry" | "knowledgeGraph" | "number" | "text" | "time" | "voxel";
|
|
37
43
|
/**
|
|
38
44
|
* Describes variables
|
|
39
45
|
*/
|
|
@@ -67,7 +73,31 @@ interface SdkDictionaryVariable extends SdkVariableBase {
|
|
|
67
73
|
/**
|
|
68
74
|
* Profile variable
|
|
69
75
|
*/
|
|
70
|
-
type SdkVariable =
|
|
76
|
+
type SdkVariable = SdkDictionaryVariable | SdkValueVariable;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The list of supported profiles
|
|
80
|
+
*/
|
|
81
|
+
type ArcadeProfileId = "aggregate-field" | "alias" | "attribute-rule-calculation" | "attribute-rule-constraint" | "attribute-rule-validation" | "dashboard-data" | "dashboard-indicator-formatting" | "dashboard-list-formatting" | "dashboard-table-formatting" | "data-pipelines" | "dictionary-renderer" | "feature-display-title" | "feature-z" | "field-calculation" | "field-mapping" | "form-calculation" | "form-constraint" | "geoanalytics" | "geotrigger-notification" | "labeling" | "layout" | "location-update-constraint" | "measure-visualization" | "minimalist" | "model-builder" | "popup-element-feature-reduction" | "popup-element-voxel" | "popup-element" | "popup-feature-reduction" | "popup-voxel" | "popup" | "quick-capture" | "tasks" | "velocity" | "visualization";
|
|
82
|
+
/**
|
|
83
|
+
* The predefined profiles for the Arcade language
|
|
84
|
+
*/
|
|
85
|
+
type ArcadeSdkPredefinedProfile = BaseSdkPredefinedProfile<ArcadeProfileId, ArcadeBundleType>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The list of supported profiles
|
|
89
|
+
*/
|
|
90
|
+
type SqlProfileId = "field-calculation";
|
|
91
|
+
/**
|
|
92
|
+
* The predefined profiles for the SQL language
|
|
93
|
+
*/
|
|
94
|
+
type SqlSdkPredefinedProfile = BaseSdkPredefinedProfile<SqlProfileId, SqlBundleType>;
|
|
95
|
+
|
|
96
|
+
type SdkPredefinedProfile = ArcadeSdkPredefinedProfile | SqlSdkPredefinedProfile;
|
|
97
|
+
/**
|
|
98
|
+
* A union of all language profile ids
|
|
99
|
+
*/
|
|
100
|
+
type ProfileId = ArcadeProfileId | SqlProfileId;
|
|
71
101
|
|
|
72
102
|
/**
|
|
73
103
|
* Represents an api category and its items
|
|
@@ -314,4 +344,4 @@ declare class ApiService<TApiContext extends ApiContext = ApiContext> {
|
|
|
314
344
|
getApiLibrary(context: TApiContext): Promise<ApiCategory[]>;
|
|
315
345
|
}
|
|
316
346
|
|
|
317
|
-
export { type ApiCategory, type SdkConstant as ApiConstant, type ApiConstantDefinition, type ApiConstantNamespace, type ApiContext, type ApiDatabase, type ApiDictionaryVariable, type SdkFunction as ApiFunction, type ApiFunctionDefinition, type ApiItem, type ApiProfile, ApiService, type ApiSnippet, type ApiValueVariable, type ApiValueVariableType, type ApiVariable, type SdkVariableType as ApiVariableType, type ApiVersion, type BundleType, type LanguageServiceSettings, type ProfileId, type SdkPredefinedProfile, filterApiLibraryForContext, isDictionaryVariable, isValueVariable };
|
|
347
|
+
export { type ApiCategory, type SdkConstant as ApiConstant, type ApiConstantDefinition, type ApiConstantNamespace, type ApiContext, type ApiDatabase, type ApiDictionaryVariable, type SdkFunction as ApiFunction, type ApiFunctionDefinition, type ApiItem, type ApiProfile, ApiService, type ApiSnippet, type ApiValueVariable, type ApiValueVariableType, type ApiVariable, type SdkVariableType as ApiVariableType, type ApiVersion, type ArcadeSdkPredefinedProfile, type BundleType, type LanguageServiceSettings, type ProfileId, type SdkPredefinedProfile, type SqlSdkPredefinedProfile, filterApiLibraryForContext, isDictionaryVariable, isValueVariable };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -3,16 +3,22 @@ import { CompletionItem } from 'vscode-languageserver-types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Supported function bundles
|
|
5
5
|
*/
|
|
6
|
-
type
|
|
6
|
+
type SqlBundleType = "core";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Union of bundle types that can be used in any sdk schema
|
|
10
|
+
*/
|
|
11
|
+
type BundleType = ArcadeBundleType | SqlBundleType;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Supported function bundles
|
|
10
15
|
*/
|
|
11
|
-
type
|
|
16
|
+
type ArcadeBundleType = "core" | "data-access" | "database" | "geometry" | "knowledge-graph" | "portal-access" | "track";
|
|
17
|
+
|
|
12
18
|
/**
|
|
13
19
|
* Describes a profile
|
|
14
20
|
*/
|
|
15
|
-
interface
|
|
21
|
+
interface BaseSdkPredefinedProfile<ProfileId extends string, Bundle extends string> {
|
|
16
22
|
/**
|
|
17
23
|
* Profile name for UI
|
|
18
24
|
*/
|
|
@@ -24,7 +30,7 @@ interface SdkPredefinedProfile {
|
|
|
24
30
|
/**
|
|
25
31
|
* Function bundles enabled for this profile
|
|
26
32
|
*/
|
|
27
|
-
bundles:
|
|
33
|
+
bundles: Bundle[];
|
|
28
34
|
/**
|
|
29
35
|
* Variable describing name, type, and providing description
|
|
30
36
|
*/
|
|
@@ -33,7 +39,7 @@ interface SdkPredefinedProfile {
|
|
|
33
39
|
/**
|
|
34
40
|
* Supported profile variable types
|
|
35
41
|
*/
|
|
36
|
-
type SdkVariableType = "
|
|
42
|
+
type SdkVariableType = "array" | "boolean" | "date" | "dateOnly" | "dictionary" | "feature" | "featureSet" | "featureSetCollection" | "geometry" | "knowledgeGraph" | "number" | "text" | "time" | "voxel";
|
|
37
43
|
/**
|
|
38
44
|
* Describes variables
|
|
39
45
|
*/
|
|
@@ -67,7 +73,31 @@ interface SdkDictionaryVariable extends SdkVariableBase {
|
|
|
67
73
|
/**
|
|
68
74
|
* Profile variable
|
|
69
75
|
*/
|
|
70
|
-
type SdkVariable =
|
|
76
|
+
type SdkVariable = SdkDictionaryVariable | SdkValueVariable;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The list of supported profiles
|
|
80
|
+
*/
|
|
81
|
+
type ArcadeProfileId = "aggregate-field" | "alias" | "attribute-rule-calculation" | "attribute-rule-constraint" | "attribute-rule-validation" | "dashboard-data" | "dashboard-indicator-formatting" | "dashboard-list-formatting" | "dashboard-table-formatting" | "data-pipelines" | "dictionary-renderer" | "feature-display-title" | "feature-z" | "field-calculation" | "field-mapping" | "form-calculation" | "form-constraint" | "geoanalytics" | "geotrigger-notification" | "labeling" | "layout" | "location-update-constraint" | "measure-visualization" | "minimalist" | "model-builder" | "popup-element-feature-reduction" | "popup-element-voxel" | "popup-element" | "popup-feature-reduction" | "popup-voxel" | "popup" | "quick-capture" | "tasks" | "velocity" | "visualization";
|
|
82
|
+
/**
|
|
83
|
+
* The predefined profiles for the Arcade language
|
|
84
|
+
*/
|
|
85
|
+
type ArcadeSdkPredefinedProfile = BaseSdkPredefinedProfile<ArcadeProfileId, ArcadeBundleType>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The list of supported profiles
|
|
89
|
+
*/
|
|
90
|
+
type SqlProfileId = "field-calculation";
|
|
91
|
+
/**
|
|
92
|
+
* The predefined profiles for the SQL language
|
|
93
|
+
*/
|
|
94
|
+
type SqlSdkPredefinedProfile = BaseSdkPredefinedProfile<SqlProfileId, SqlBundleType>;
|
|
95
|
+
|
|
96
|
+
type SdkPredefinedProfile = ArcadeSdkPredefinedProfile | SqlSdkPredefinedProfile;
|
|
97
|
+
/**
|
|
98
|
+
* A union of all language profile ids
|
|
99
|
+
*/
|
|
100
|
+
type ProfileId = ArcadeProfileId | SqlProfileId;
|
|
71
101
|
|
|
72
102
|
/**
|
|
73
103
|
* Represents an api category and its items
|
|
@@ -314,4 +344,4 @@ declare class ApiService<TApiContext extends ApiContext = ApiContext> {
|
|
|
314
344
|
getApiLibrary(context: TApiContext): Promise<ApiCategory[]>;
|
|
315
345
|
}
|
|
316
346
|
|
|
317
|
-
export { type ApiCategory, type SdkConstant as ApiConstant, type ApiConstantDefinition, type ApiConstantNamespace, type ApiContext, type ApiDatabase, type ApiDictionaryVariable, type SdkFunction as ApiFunction, type ApiFunctionDefinition, type ApiItem, type ApiProfile, ApiService, type ApiSnippet, type ApiValueVariable, type ApiValueVariableType, type ApiVariable, type SdkVariableType as ApiVariableType, type ApiVersion, type BundleType, type LanguageServiceSettings, type ProfileId, type SdkPredefinedProfile, filterApiLibraryForContext, isDictionaryVariable, isValueVariable };
|
|
347
|
+
export { type ApiCategory, type SdkConstant as ApiConstant, type ApiConstantDefinition, type ApiConstantNamespace, type ApiContext, type ApiDatabase, type ApiDictionaryVariable, type SdkFunction as ApiFunction, type ApiFunctionDefinition, type ApiItem, type ApiProfile, ApiService, type ApiSnippet, type ApiValueVariable, type ApiValueVariableType, type ApiVariable, type SdkVariableType as ApiVariableType, type ApiVersion, type ArcadeSdkPredefinedProfile, type BundleType, type LanguageServiceSettings, type ProfileId, type SdkPredefinedProfile, type SqlSdkPredefinedProfile, filterApiLibraryForContext, isDictionaryVariable, isValueVariable };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{CompletionItemKind as f,InsertTextFormat as
|
|
1
|
+
import{CompletionItemKind as f,InsertTextFormat as b,InsertTextMode as C,MarkupKind as x}from"vscode-languageserver-types";async function y(t,i){try{let n=await t,e=new Map,o=new Map,a=[],r=D(i);return n.forEach(p=>{let c=[];p.items.forEach(s=>h(c,o,e,r,s)),c.length&&a.push({...p,items:c})}),{categories:a,functionDefinitions:e,constantDefinitions:o}}catch(n){return console.error(n),{categories:[],functionDefinitions:new Map,constantDefinitions:new Map}}}function D(t){let{profile:{apiVersion:i,bundles:n,hiddenApiItems:e=[]}={}}=t,o=d(i),a=Array.isArray(n)&&n.length>0?new Set(["core",...n]):void 0;return r=>M(o,r.sinceVersion)&&(!a||a.has(r.bundle))&&!e.includes(r.name)}function h(t,i,n,e,o){if(Array.isArray(o)){o.forEach(a=>A(t,n,e,a));return}o.type==="constant"?k(t,i,e,o):A(t,n,e,o)}function A(t,i,n,e){if(!n(e))return;e.disableDocumentation||t.push(e);let{completion:{label:o}}=e,a=o.toLowerCase(),r=i.get(a);r||(r={type:"functionDefinition",key:a,overloads:[]},i.set(a,r)),r.overloads.push(e)}function k(t,i,n,e){if(!n(e))return;t.push(e);let{completion:{label:o}}=e,a=o.toLowerCase();i.set(a,e);let[r,p]=e.completion.label.split(".");if(!p)return;let c=r.toLowerCase(),s=i.get(c);s||(s={type:"namespace",key:c,members:[],completion:{label:r,detail:r,insertText:r,insertTextMode:C.adjustIndentation,insertTextFormat:b.PlainText,kind:f.Enum}},i.set(c,s));let l=structuredClone(e);l.name=p,l.completion.label=p,l.completion.insertText=p,l.completion.kind=f.Constant,s.members.push(l),s.completion.documentation=s.members.reduce((u,m)=>(u.value=`${u.value}${u.value?`
|
|
2
2
|
|
|
3
|
-
`:""}**${m.completion.label}**: ${m.description}`,u),{kind:x.Markdown,value:""})}function
|
|
3
|
+
`:""}**${m.completion.label}**: ${m.description}`,u),{kind:x.Markdown,value:""})}function d(t){if(!t||typeof t!="string")return null;let i=t.split(".").map(o=>Number.parseInt(o));if(i.some(Number.isNaN))return console.error("Invalid API version string",t),null;let[n,e]=i.slice(0,2);return{major:n,minor:e}}function M(t,i){if(!t)return!0;let n=d(i);return n?t.major>n.major?!1:t.minor===void 0||n.minor===void 0?!0:n.minor<=t.minor:!0}function v(t){return!!t&&t.type!=="dictionary"}function F(t){return t?.type==="dictionary"}var g=class{constructor(i){this._settings=i;this.localeToApiLibraryPromiseMap=new Map}async getApiDatabase(i){let{locale:n="en"}=i,e=this.localeToApiLibraryPromiseMap.get(n);return e||(e=this._settings.getApiLibrary(n),this.localeToApiLibraryPromiseMap.set(n,e)),await y(e,i)}async getApiLibrary(i){let{categories:n}=await this.getApiDatabase(i);return n}};export{g as ApiService,y as filterApiLibraryForContext,F as isDictionaryVariable,v as isValueVariable};
|
package/package.json
CHANGED