@arcgis/languages-api-utils 4.31.0-next.64 → 4.31.0-next.67

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.
@@ -1,3 +1,3 @@
1
- "use strict";var f=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var i in t)f(e,i,{get:t[i],enumerable:!0})},k=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of C(t))!x.call(e,r)&&r!==i&&f(e,r,{get:()=>t[r],enumerable:!(n=b(t,r))||n.enumerable});return e};var V=e=>k(f({},"__esModule",{value:!0}),e);var F={};S(F,{ApiService:()=>g,isDictionaryVariable:()=>I,isValueVariable:()=>P});module.exports=V(F);var s=require("vscode-languageserver-types");function D(e){return Array.isArray(e.testSdkCategories)}async function h(e,t){try{let i=await e,n=new Map,r=new Map,a=[],o=T(t);return i.forEach(c=>{let l=[];c.items.forEach(p=>v(l,r,n,o,p)),l.length&&a.push({...c,items:l})}),{categories:a,functionDefinitions:n,constantDefinitions:r}}catch{return{categories:[],functionDefinitions:new Map,constantDefinitions:new Map}}}var g=class{constructor(t){this._settings=t;this.sdkCategoriesCache=new Map}async getApiDatabase(t){let{locale:i="en"}=t,n=this.sdkCategoriesCache.get(i);if(!n){let{assetsPath:r}=this._settings;if(!r)return{categories:[],functionDefinitions:new Map,constantDefinitions:new Map};n=this.loadSdkApiLibrary(i,r),this.sdkCategoriesCache.set(i,n)}return await h(n,t)}async getApiLibrary(t){let{categories:i}=await this.getApiDatabase(t);return i}async loadSdkApiLibrary(t="en",i=""){if(D(this._settings))return this._settings.testSdkCategories;if(i=i.replace(/\/$/u,""),!i)return[];try{let n=this._settings.apiPathTemplate.replace("${assetsPath}",i).replace("${locale}",t),r=await fetch(n);return r.ok?await r.json():t==="en"?[]:await this.loadSdkApiLibrary("en",i)}catch{return[]}}};function T(e){let{profile:{apiVersion:t,bundles:i,hiddenApiItems:n=[]}={}}=e,r=y(t),a=Array.isArray(i)&&i.length>0?new Set(["core",...i]):void 0;return o=>M(r,o.sinceVersion)&&(!a||a.has(o.bundle))&&!n.includes(o.name)}function v(e,t,i,n,r){if(Array.isArray(r)){r.forEach(a=>A(e,i,n,a));return}r.type==="constant"?w(e,t,n,r):A(e,i,n,r)}function A(e,t,i,n){if(!i(n))return;n.disableDocumentation||e.push(n);let{completion:{label:r}}=n,a=r.toLowerCase(),o=t.get(a);o||(o={type:"functionDefinition",key:a,overloads:[]},t.set(a,o)),o.overloads.push(n)}function w(e,t,i,n){if(!i(n))return;e.push(n);let{completion:{label:r}}=n,a=r.toLowerCase();t.set(a,n);let[o,c]=n.completion.label.split(".");if(!c)return;let l=o.toLowerCase(),p=t.get(l);p||(p={type:"namespace",key:l,members:[],completion:{label:o,detail:o,insertText:o,insertTextMode:s.InsertTextMode.adjustIndentation,insertTextFormat:s.InsertTextFormat.PlainText,kind:s.CompletionItemKind.Enum}},t.set(l,p));let u=structuredClone(n);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((d,m)=>(d.value=`${d.value}${d.value?`
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:()=>d,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=g(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=>b(e,n,i,a));return}o.type==="constant"?F(e,t,i,o):b(e,n,i,o)}function b(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,y)=>(m.value=`${m.value}${m.value?`
2
2
 
3
- `:""}**${m.completion.label}**: ${m.description}`,d),{kind:s.MarkupKind.Markdown,value:""})}function y(e){if(!e||typeof e!="string")return null;let t=e.split(".").map(r=>Number.parseInt(r));if(t.some(Number.isNaN))return console.error("Invalid API version string",e),null;let[i,n]=t.slice(0,2);return{major:i,minor:n}}function M(e,t){if(!e)return!0;let i=y(t);return i?e.major>i.major?!1:e.minor===void 0||i.minor===void 0?!0:i.minor<=e.minor:!0}function P(e){return!!e&&e.type!=="dictionary"}function I(e){return e?.type==="dictionary"}0&&(module.exports={ApiService,isDictionaryVariable,isValueVariable});
3
+ `:""}**${y.completion.label}**: ${y.description}`,m),{kind:s.MarkupKind.Markdown,value:""})}function g(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=g(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 d=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});
@@ -145,6 +145,17 @@ interface SdkFunction extends SdkItemBase {
145
145
  */
146
146
  type SdkItem = SdkConstant | SdkFunction | SdkFunction[];
147
147
 
148
+ /**
149
+ * Represent items stored in the library
150
+ */
151
+ type ApiItem = SdkConstant | SdkFunction;
152
+ /**
153
+ * Represent a category of api items in the api library
154
+ */
155
+ interface ApiCategory extends SdkCategory {
156
+ items: ApiItem[];
157
+ }
158
+
148
159
  /**
149
160
  * The editor can be extended with custom snippets
150
161
  */
@@ -248,45 +259,11 @@ interface ApiValueVariable extends ApiVariableBase {
248
259
  * The profile variable type
249
260
  */
250
261
  type ApiVariable = ApiDictionaryVariable | ApiValueVariable;
251
- /**
252
- * Helper function to test if a variable is a value variable
253
- */
254
- declare function isValueVariable(variable: ApiVariable | null | undefined): variable is ApiValueVariable;
255
- /**
256
- * Helper function to test if a variable is a dictionary variable
257
- */
258
- declare function isDictionaryVariable(variable: ApiVariable | null | undefined): variable is ApiDictionaryVariable;
259
262
 
260
- /**
261
- * Represent items stored in the library
262
- */
263
- type ApiItem = SdkConstant | SdkFunction;
264
- /**
265
- * Represent a category of api items in the api library
266
- */
267
- interface ApiCategory extends SdkCategory {
268
- items: ApiItem[];
263
+ interface ApiVersion {
264
+ major: number;
265
+ minor?: number;
269
266
  }
270
-
271
- /**
272
- * Language service settings
273
- */
274
- interface LanguageServiceSettings {
275
- /**
276
- * The path to the assets folder where the api files are stored
277
- */
278
- assetsPath?: string;
279
- /**
280
- * A template string for constructing the path to the api definition
281
- * example: `${assetsPath}/api/arcade-api.t9n.${locale}.json`
282
- */
283
- apiPathTemplate: string;
284
- /**
285
- * The language id
286
- */
287
- languageId: string;
288
- }
289
-
290
267
  type ApiConstantNamespace = {
291
268
  type: "namespace";
292
269
  key: string;
@@ -307,9 +284,25 @@ interface ApiDatabase {
307
284
  functionDefinitions: Map<string, ApiFunctionDefinition>;
308
285
  constantDefinitions: Map<string, ApiConstantDefinition>;
309
286
  }
287
+ declare function filterApiLibraryForContext(apiLibraryPromise: Promise<SdkCategory[]>, context: ApiContext): Promise<ApiDatabase>;
288
+ /**
289
+ * Helper function to test if a variable is a value variable
290
+ */
291
+ declare function isValueVariable(variable: ApiVariable | null | undefined): variable is ApiValueVariable;
292
+ /**
293
+ * Helper function to test if a variable is a dictionary variable
294
+ */
295
+ declare function isDictionaryVariable(variable: ApiVariable | null | undefined): variable is ApiDictionaryVariable;
296
+
297
+ /**
298
+ * Language service settings
299
+ */
300
+ interface LanguageServiceSettings {
301
+ getApiLibrary: (locale: string) => Promise<ApiCategory[]>;
302
+ }
310
303
  declare class ApiService<TApiContext extends ApiContext = ApiContext> {
311
304
  private _settings;
312
- private sdkCategoriesCache;
305
+ private localeToApiLibraryPromiseMap;
313
306
  constructor(_settings: LanguageServiceSettings);
314
307
  /**
315
308
  * Returns the API definitions for the given settings: definitions, constant definitions, and function definitions
@@ -319,7 +312,6 @@ declare class ApiService<TApiContext extends ApiContext = ApiContext> {
319
312
  * Returns the API definitions
320
313
  */
321
314
  getApiLibrary(context: TApiContext): Promise<ApiCategory[]>;
322
- private loadSdkApiLibrary;
323
315
  }
324
316
 
325
- 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 BundleType, type LanguageServiceSettings, type ProfileId, type SdkPredefinedProfile, isDictionaryVariable, isValueVariable };
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 };
@@ -145,6 +145,17 @@ interface SdkFunction extends SdkItemBase {
145
145
  */
146
146
  type SdkItem = SdkConstant | SdkFunction | SdkFunction[];
147
147
 
148
+ /**
149
+ * Represent items stored in the library
150
+ */
151
+ type ApiItem = SdkConstant | SdkFunction;
152
+ /**
153
+ * Represent a category of api items in the api library
154
+ */
155
+ interface ApiCategory extends SdkCategory {
156
+ items: ApiItem[];
157
+ }
158
+
148
159
  /**
149
160
  * The editor can be extended with custom snippets
150
161
  */
@@ -248,45 +259,11 @@ interface ApiValueVariable extends ApiVariableBase {
248
259
  * The profile variable type
249
260
  */
250
261
  type ApiVariable = ApiDictionaryVariable | ApiValueVariable;
251
- /**
252
- * Helper function to test if a variable is a value variable
253
- */
254
- declare function isValueVariable(variable: ApiVariable | null | undefined): variable is ApiValueVariable;
255
- /**
256
- * Helper function to test if a variable is a dictionary variable
257
- */
258
- declare function isDictionaryVariable(variable: ApiVariable | null | undefined): variable is ApiDictionaryVariable;
259
262
 
260
- /**
261
- * Represent items stored in the library
262
- */
263
- type ApiItem = SdkConstant | SdkFunction;
264
- /**
265
- * Represent a category of api items in the api library
266
- */
267
- interface ApiCategory extends SdkCategory {
268
- items: ApiItem[];
263
+ interface ApiVersion {
264
+ major: number;
265
+ minor?: number;
269
266
  }
270
-
271
- /**
272
- * Language service settings
273
- */
274
- interface LanguageServiceSettings {
275
- /**
276
- * The path to the assets folder where the api files are stored
277
- */
278
- assetsPath?: string;
279
- /**
280
- * A template string for constructing the path to the api definition
281
- * example: `${assetsPath}/api/arcade-api.t9n.${locale}.json`
282
- */
283
- apiPathTemplate: string;
284
- /**
285
- * The language id
286
- */
287
- languageId: string;
288
- }
289
-
290
267
  type ApiConstantNamespace = {
291
268
  type: "namespace";
292
269
  key: string;
@@ -307,9 +284,25 @@ interface ApiDatabase {
307
284
  functionDefinitions: Map<string, ApiFunctionDefinition>;
308
285
  constantDefinitions: Map<string, ApiConstantDefinition>;
309
286
  }
287
+ declare function filterApiLibraryForContext(apiLibraryPromise: Promise<SdkCategory[]>, context: ApiContext): Promise<ApiDatabase>;
288
+ /**
289
+ * Helper function to test if a variable is a value variable
290
+ */
291
+ declare function isValueVariable(variable: ApiVariable | null | undefined): variable is ApiValueVariable;
292
+ /**
293
+ * Helper function to test if a variable is a dictionary variable
294
+ */
295
+ declare function isDictionaryVariable(variable: ApiVariable | null | undefined): variable is ApiDictionaryVariable;
296
+
297
+ /**
298
+ * Language service settings
299
+ */
300
+ interface LanguageServiceSettings {
301
+ getApiLibrary: (locale: string) => Promise<ApiCategory[]>;
302
+ }
310
303
  declare class ApiService<TApiContext extends ApiContext = ApiContext> {
311
304
  private _settings;
312
- private sdkCategoriesCache;
305
+ private localeToApiLibraryPromiseMap;
313
306
  constructor(_settings: LanguageServiceSettings);
314
307
  /**
315
308
  * Returns the API definitions for the given settings: definitions, constant definitions, and function definitions
@@ -319,7 +312,6 @@ declare class ApiService<TApiContext extends ApiContext = ApiContext> {
319
312
  * Returns the API definitions
320
313
  */
321
314
  getApiLibrary(context: TApiContext): Promise<ApiCategory[]>;
322
- private loadSdkApiLibrary;
323
315
  }
324
316
 
325
- 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 BundleType, type LanguageServiceSettings, type ProfileId, type SdkPredefinedProfile, isDictionaryVariable, isValueVariable };
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 };
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import{CompletionItemKind as f,InsertTextFormat as y,InsertTextMode as b,MarkupKind as C}from"vscode-languageserver-types";function x(i){return Array.isArray(i.testSdkCategories)}async function S(i,n){try{let e=await i,t=new Map,r=new Map,a=[],o=k(n);return e.forEach(p=>{let c=[];p.items.forEach(s=>V(c,r,t,o,s)),c.length&&a.push({...p,items:c})}),{categories:a,functionDefinitions:t,constantDefinitions:r}}catch{return{categories:[],functionDefinitions:new Map,constantDefinitions:new Map}}}var g=class{constructor(n){this._settings=n;this.sdkCategoriesCache=new Map}async getApiDatabase(n){let{locale:e="en"}=n,t=this.sdkCategoriesCache.get(e);if(!t){let{assetsPath:r}=this._settings;if(!r)return{categories:[],functionDefinitions:new Map,constantDefinitions:new Map};t=this.loadSdkApiLibrary(e,r),this.sdkCategoriesCache.set(e,t)}return await S(t,n)}async getApiLibrary(n){let{categories:e}=await this.getApiDatabase(n);return e}async loadSdkApiLibrary(n="en",e=""){if(x(this._settings))return this._settings.testSdkCategories;if(e=e.replace(/\/$/u,""),!e)return[];try{let t=this._settings.apiPathTemplate.replace("${assetsPath}",e).replace("${locale}",n),r=await fetch(t);return r.ok?await r.json():n==="en"?[]:await this.loadSdkApiLibrary("en",e)}catch{return[]}}};function k(i){let{profile:{apiVersion:n,bundles:e,hiddenApiItems:t=[]}={}}=i,r=A(n),a=Array.isArray(e)&&e.length>0?new Set(["core",...e]):void 0;return o=>h(r,o.sinceVersion)&&(!a||a.has(o.bundle))&&!t.includes(o.name)}function V(i,n,e,t,r){if(Array.isArray(r)){r.forEach(a=>m(i,e,t,a));return}r.type==="constant"?D(i,n,t,r):m(i,e,t,r)}function m(i,n,e,t){if(!e(t))return;t.disableDocumentation||i.push(t);let{completion:{label:r}}=t,a=r.toLowerCase(),o=n.get(a);o||(o={type:"functionDefinition",key:a,overloads:[]},n.set(a,o)),o.overloads.push(t)}function D(i,n,e,t){if(!e(t))return;i.push(t);let{completion:{label:r}}=t,a=r.toLowerCase();n.set(a,t);let[o,p]=t.completion.label.split(".");if(!p)return;let c=o.toLowerCase(),s=n.get(c);s||(s={type:"namespace",key:c,members:[],completion:{label:o,detail:o,insertText:o,insertTextMode:b.adjustIndentation,insertTextFormat:y.PlainText,kind:f.Enum}},n.set(c,s));let l=structuredClone(t);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,d)=>(u.value=`${u.value}${u.value?`
1
+ import{CompletionItemKind as f,InsertTextFormat as g,InsertTextMode as C,MarkupKind as x}from"vscode-languageserver-types";async function d(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=y(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:g.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
- `:""}**${d.completion.label}**: ${d.description}`,u),{kind:C.Markdown,value:""})}function A(i){if(!i||typeof i!="string")return null;let n=i.split(".").map(r=>Number.parseInt(r));if(n.some(Number.isNaN))return console.error("Invalid API version string",i),null;let[e,t]=n.slice(0,2);return{major:e,minor:t}}function h(i,n){if(!i)return!0;let e=A(n);return e?i.major>e.major?!1:i.minor===void 0||e.minor===void 0?!0:e.minor<=i.minor:!0}function w(i){return!!i&&i.type!=="dictionary"}function M(i){return i?.type==="dictionary"}export{g as ApiService,M as isDictionaryVariable,w as isValueVariable};
3
+ `:""}**${m.completion.label}**: ${m.description}`,u),{kind:x.Markdown,value:""})}function y(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=y(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 b=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 d(e,i)}async getApiLibrary(i){let{categories:n}=await this.getApiDatabase(i);return n}};export{b as ApiService,d as filterApiLibraryForContext,F as isDictionaryVariable,v as isValueVariable};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/languages-api-utils",
3
- "version": "4.31.0-next.64",
3
+ "version": "4.31.0-next.67",
4
4
  "description": "ArcGIS Languages API Utilities",
5
5
  "homepage": "https://developers.arcgis.com/javascript/latest/",
6
6
  "type": "module",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "license": "SEE LICENSE IN LICENSE.md",
18
18
  "scripts": {
19
- "build:dev": "yarn build:esm --sourcemap",
19
+ "build:dev": "yarn build:esm --sourcemap --no-minify",
20
20
  "build:cjs": "tsup --format cjs --outDir dist/cjs --silent --minify",
21
21
  "build:esm": "tsup --format esm --outDir dist/esm --silent --minify",
22
22
  "build": "npm run build:cjs && npm run build:esm",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@arcgis/arcade-sdk": "~1.26.5",
32
- "@arcgis/typescript-config": "4.31.0-next.64",
32
+ "@arcgis/typescript-config": "4.31.0-next.67",
33
33
  "@swc/core": "^1.7.11",
34
34
  "@swc/jest": "^0.2.36",
35
35
  "@types/jest": "^29.5.0",
@@ -40,5 +40,5 @@
40
40
  "tsup": "^8.1.0",
41
41
  "typescript": "~5.4.0"
42
42
  },
43
- "gitHead": "961594473ed9d43139bcb55ff43c6b3399147e64"
43
+ "gitHead": "d42716bf4b5fb039ad270bec4e4a44d60bd8770a"
44
44
  }