diff --git a/src/XrmDefinitelyTyped/.eslintignore b/src/XrmDefinitelyTyped/.eslintignore
new file mode 100644
index 0000000000..7b50d54054
--- /dev/null
+++ b/src/XrmDefinitelyTyped/.eslintignore
@@ -0,0 +1,2 @@
+**/Dist/**/*.ts
+**/node_modules/**
\ No newline at end of file
diff --git a/src/XrmDefinitelyTyped/.eslintrc b/src/XrmDefinitelyTyped/.eslintrc
new file mode 100644
index 0000000000..26e828d749
--- /dev/null
+++ b/src/XrmDefinitelyTyped/.eslintrc
@@ -0,0 +1,12 @@
+{
+ "root": true,
+ "parser": "@typescript-eslint/parser",
+ "plugins": [
+ "@typescript-eslint"
+ ],
+ "extends": [
+ "eslint:recommended",
+ "plugin:@typescript-eslint/eslint-recommended",
+ "plugin:@typescript-eslint/recommended"
+ ]
+}
\ No newline at end of file
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/dg.xrmquery.web_ext_9-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/dg.xrmquery.web_ext_9-.d.ts
index 1d3f45996a..e0e77bd0c5 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/dg.xrmquery.web_ext_9-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/dg.xrmquery.web_ext_9-.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Filter {
function $in(val: T, listVal: T[]): WebFilter;
function notIn(val: T, listVal: T[]): WebFilter;
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/dg.xrmquery.web_ext_9-.ts b/src/XrmDefinitelyTyped/Resources/Extensions/dg.xrmquery.web_ext_9-.ts
index b51c886f9a..b96643fc7b 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/dg.xrmquery.web_ext_9-.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/dg.xrmquery.web_ext_9-.ts
@@ -1,4 +1,4 @@
-///
+// eslint-disable-next-line @typescript-eslint/no-namespace, @typescript-eslint/no-unused-vars
namespace Filter {
const GUID_ENDING = "_value";
const GUID_START = "_";
@@ -39,14 +39,16 @@ namespace Filter {
*/
function queryFunc(funcName: string, val1: T): WebFilter;
function queryFunc(funcName: string, val1: T, val2: V): WebFilter;
+ // eslint-disable-next-line no-inner-declarations
function queryFunc(funcName: string, val1: T, val2?: V): WebFilter {
if (val2 !== undefined) {
- return (`Microsoft.Dynamics.CRM.${funcName}(PropertyName='${parsePropertyName(getVal(val1))}',PropertyValues=${getVal(val2)})`);
+ return (`Microsoft.Dynamics.CRM.${funcName}(PropertyName='${parsePropertyName(getVal(val1))}',PropertyValues=${getVal(val2)})`); // eslint-disable-line @typescript-eslint/no-explicit-any
} else {
- return (`Microsoft.Dynamics.CRM.${funcName}(PropertyName='${parsePropertyName(getVal(val1))}')`);
+ return (`Microsoft.Dynamics.CRM.${funcName}(PropertyName='${parsePropertyName(getVal(val1))}')`); // eslint-disable-line @typescript-eslint/no-explicit-any
}
}
+ // eslint-disable-next-line no-inner-declarations
function parsePropertyName(name: string) {
const idxStart = name.indexOf(GUID_START);
const idxEnd = name.indexOf(GUID_ENDING);
@@ -54,6 +56,7 @@ namespace Filter {
return `${name.substr(idxStart + 1, idxEnd - 1)}`;
}
+ // eslint-disable-next-line no-inner-declarations, @typescript-eslint/no-explicit-any
function getVal(v: any): string {
if (v === null) return "null";
if (typeof v === "string") return `'${encodeSpecialCharacters(v)}'`;
@@ -65,6 +68,7 @@ namespace Filter {
/**
* @internal
*/
+ // eslint-disable-next-line no-inner-declarations
function encodeSpecialCharacters(queryString: string) {
return encodeURI(queryString)
.replace(/'/g, "''")
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-6.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-6.d.ts
index 7cac51c6a0..ac433f0b07 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-6.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-6.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
interface context {
/**
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-8.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-8.d.ts
index 46e9e7dc3c..ef6ed5ad9b 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-8.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-8.d.ts
@@ -1,11 +1,13 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
+ //eslint-disable-next-line @typescript-eslint/no-unused-vars
interface PageTab {
/**
* Add an event handler on tab state change.
*
* @param reference Event handler for tab state change.
*/
- add_tabStateChange(reference: Function): void;
+ add_tabStateChange(reference: Function): void; //eslint-disable-line @typescript-eslint/ban-types
}
}
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-9-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-9-.d.ts
index 4232dfccc2..1ecf8a4666 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-9-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-9-.d.ts
@@ -1,9 +1,11 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
- var Page: Xrm.PageBase;
+ let Page: Xrm.PageBase;
/**
* Interface for the base of an Xrm.Page
*/
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface PageBase {
/**
* The context of the page.
@@ -25,7 +27,7 @@ declare namespace Xrm {
/**
* Returns a dictionary object of key value pairs that represent the query string arguments that were passed to the page.
*/
- getQueryStringParameters(): any;
+ getQueryStringParameters(): any; // eslint-disable-line @typescript-eslint/no-explicit-any
/**
* Returns the GUID of the SystemUser.Id value for the current user.
@@ -46,6 +48,7 @@ declare namespace Xrm {
/**
* Interface for the entity on a form.
*/
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface PageEntity {
/**
* This is the equivalent of using the "Save and Close" command.
@@ -80,6 +83,7 @@ declare namespace Xrm {
* @param parameters A dictionary object that passes extra query string parameters to the form. Invalid query string parameters will cause an error.
* @param windowOptions You can choose to open a form in a new window by passing a dictionary object with a boolean openInNewWindow property set to true.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
openEntityForm(name: string, id?: string, parameters?: any, windowOptions?: WindowOptions): void;
/**
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-9.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-9.d.ts
index c80922123f..e84b124b39 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-9.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_-9.d.ts
@@ -1,5 +1,7 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface DataModule {
/**
* Asynchronously refreshes and optionally saves all the data of the form without reloading the page.
@@ -16,6 +18,7 @@ declare namespace Xrm {
save(saveOptions?: SaveOptions): Then;
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface SubGridControl extends BaseControl {
/**
* Use this method to get the logical name of the relationship used for the data displayed in the grid.
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_6-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_6-.d.ts
index 0cba50ebda..2e8c2b0d4c 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_6-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_6-.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
interface BaseControl {
/**
@@ -29,11 +30,13 @@ declare namespace Xrm {
/**
* Use this method to apply changes to lookups based on values current just as the user is about to view results for the lookup.
*/
+ // eslint-disable-next-line @typescript-eslint/ban-types
addPreSearch(handler: Function): void;
/**
* Use this method to remove event handler functions that have previously been set for the PreSearch event.
*/
+ // eslint-disable-next-line @typescript-eslint/ban-types
removePreSearch(handler: Function): void;
}
@@ -44,6 +47,7 @@ declare namespace Xrm {
setShowTime(doShow: boolean): void;
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface PageEntity {
/**
* Gets a string for the value of the primary attribute of the entity.
@@ -51,6 +55,7 @@ declare namespace Xrm {
getPrimaryAttributeValue(): string;
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface BaseAttribute {
/**
* Determine whether a lookup attribute represents a partylist lookup.
@@ -58,6 +63,7 @@ declare namespace Xrm {
getIsPartyList(): boolean;
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface UiModule {
/**
* Use this method to remove form level notifications.
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_6-9-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_6-9-.d.ts
index 4c1eb27b18..2a8195ec46 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_6-9-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_6-9-.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
interface Utility {
/**
@@ -7,6 +8,7 @@ declare namespace Xrm {
* @param message The text of the message to display in the dialog.
* @param onCloseCallback A function to execute when the OK button is clicked.
*/
+ // eslint-disable-next-line @typescript-eslint/ban-types
alertDialog(message: string, onCloseCallback?: Function): void;
/**
@@ -16,6 +18,7 @@ declare namespace Xrm {
* @param yesCloseCallback A function to execute when the OK button is clicked.
* @param noCloseCallback A function to execute when the Cancel button is clicked.
*/
+ // eslint-disable-next-line @typescript-eslint/ban-types
confirmDialog(message: string, yesCloseCallback?: Function, noCloseCallback?: Function): void;
/**
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7-.d.ts
index fbdc8dcfde..d137bb3fae 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7-.d.ts
@@ -1,8 +1,10 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
/**
* Interface for the ui of a form.
*/
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface UiModule {
/**
* Access UI controls for the business process flow on the form.
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7-9-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7-9-.d.ts
index 3fc38accaf..09ce93bb21 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7-9-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7-9-.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
interface context {
/**
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-.d.ts
index 190a4c0011..2fc6dbd505 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-.d.ts
@@ -1,10 +1,12 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
interface SubGridControl extends BaseControl {
/**
* Add event handlers to this event to run every time the subgrid refreshes.
* This includes when users sort the values by clicking the column headings.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnLoad(functionRef: (context?: ExecutionContext) => any): void;
/**
@@ -25,6 +27,7 @@ declare namespace Xrm {
/**
* Use this method to remove event handlers from the GridControl.OnLoad event.
*/
+ // eslint-disable-next-line @typescript-eslint/ban-types
removeOnLoad(reference: Function): void;
/**
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-8.2.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-8.2.d.ts
index 26e5d4f41e..7286333eb9 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-8.2.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-8.2.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
interface Utility {
@@ -10,6 +11,7 @@ declare namespace Xrm {
* @param createFromEntity Designates a record that will provide default values based on mapped attribute values.
* @param parameters A dictionary object that passes extra query string parameters to the form. Invalid query string parameters will cause an error.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
openQuickCreate(callback: (lookup: Lookup) => any, entityLogicalName: string, createFromEntity?: Lookup, parameters?: any): void;
}
}
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-9-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-9-.d.ts
index cddc7f445e..3d77d67945 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-9-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_7.1-9-.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
interface context {
/**
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8-.d.ts
index 34dede0670..effb4d1ce5 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8-.d.ts
@@ -1,11 +1,14 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface PageTab {
/**
* Add an event handler on tab state change.
*
* @param reference Event handler for tab state change.
*/
+ // eslint-disable-next-line @typescript-eslint/ban-types
addTabStateChange(reference: Function): void;
}
@@ -69,6 +72,7 @@ declare namespace Xrm {
/**
* Interface for the data of a form.
*/
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface DataModule {
/**
* Access various functionality for a business process flow.
@@ -88,8 +92,10 @@ declare namespace Xrm {
getDirection(): ProcessStageChangeDirection;
}
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
interface StageSelectedContext extends ExecutionContext { }
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
interface StageChangeContext extends ExecutionContext { }
/**
@@ -123,6 +129,7 @@ declare namespace Xrm {
* OR
* - The record hasn’t been saved yet.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
setActiveStage(stageId: string, callback?: (stringVal: ProcessStageSetAnswer) => any): void;
/**
@@ -139,6 +146,7 @@ declare namespace Xrm {
* The enabled processes are filtered according to the user’s privileges. The list of enabled processes is the same ones a user can see in the UI
* if they want to change the process manually.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
getEnabledProcesses(callback: (enabledProcesses: ProcessContainer) => any): void;
/**
@@ -152,6 +160,7 @@ declare namespace Xrm {
*
* @param handler The function will be added to the bottom of the event handler pipeline.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnStageChange(handler: (context?: StageChangeContext) => any): void;
/**
@@ -159,6 +168,7 @@ declare namespace Xrm {
*
* @param handler If an anonymous function is set using the addOnStageChange method it cannot be removed using this method.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
removeOnStageChange(handler: (context?: StageChangeContext) => any): void;
/**
@@ -167,6 +177,7 @@ declare namespace Xrm {
*
* @param handler The function will be added to the bottom of the event handler pipeline.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnStageSelected(handler: (context?: StageSelectedContext) => any): void;
/**
@@ -174,6 +185,7 @@ declare namespace Xrm {
*
* @param handler If an anonymous function is set using the addOnStageSelected method it cannot be removed using this method.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
removeOnStageSelected(handler: (context?: StageSelectedContext) => any): void;
/**
@@ -188,6 +200,7 @@ declare namespace Xrm {
* "invalid": The operation failed because the selected stage isn’t the same as the active stage.
* "dirtyForm": This value will be returned if the data in the page is not saved.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
moveNext(callback?: (stringVal: ProcessStageMoveAnswer) => any): void;
/**
@@ -202,6 +215,7 @@ declare namespace Xrm {
* "invalid": The operation failed because the selected stage isn’t the same as the active stage.
* "dirtyForm": This value will be returned if the data in the page is not saved.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
movePrevious(callback?: (stringVal: ProcessStageMoveAnswer) => any): void;
}
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8-9.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8-9.d.ts
index 2a1666317a..b027d3124f 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8-9.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8-9.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
/**
* Interface for the business process flow on a form.
@@ -11,6 +12,7 @@ declare namespace Xrm {
* @param callback A function to call when the operation is complete. This callback function is passed one of the following string
* values to indicate whether the operation succeeded. Is "success" or "invalid".
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
setActiveProcess(processId: string, callback: (successOrInvalid: "success" | "invalid") => any): void;
}
}
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-.d.ts
index 9be6d49789..05933d3c4e 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
//Function helper type for a function that can be set to be called by a view column to show an image with a tooltip instead of the ordinary data
type TooltipFunc = (rowData: string, lcid: LCID) => [WebResourceImage, string];
@@ -47,6 +48,7 @@ declare namespace Xrm {
/**
* Command action
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
action: () => any;
}
@@ -77,6 +79,7 @@ declare namespace Xrm {
fireOnKeyPress(): void;
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface GridEntity {
/**
* Returns the GUID of the record.
@@ -89,11 +92,13 @@ declare namespace Xrm {
* Returns a collection of the related entities for this record.
* TODO: Unsure as to what type of elements are returned in the collection.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
getRelatedEntities(): GridCollection;
isInHierarchy(): boolean;
}
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-interface
interface ProcessStatusChangeContext extends ExecutionContext { }
interface ProcessModule {
@@ -107,6 +112,7 @@ declare namespace Xrm {
* anonymous function if you may later want to remove the
* event handler.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnProcessStatusChange(handler: (context?: ProcessStatusChangeContext) => any): void;
/**
@@ -114,6 +120,7 @@ declare namespace Xrm {
* @param handler If an anonymous function is set using the addOnProcessStatusChange method it
* cannot be removed using this method.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
removeOnProcessStatusChange(handler: (context?: ProcessStatusChangeContext) => any): void;
/**
@@ -136,6 +143,7 @@ declare namespace Xrm {
* @param status The new status. The values can be active, aborted, or finished.
* @param callbackFunction A function to call when the operation is complete. This callback function is passed the new status as a string value.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
setStatus(status: ProcessStatus, callbackFunction?: (status: ProcessStatus) => any): ProcessStatus;
}
}
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-9-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-9-.d.ts
index 2b111d9df8..e54dbe5c1d 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-9-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-9-.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
interface StringControl extends Control> {
/**
@@ -7,6 +8,7 @@ declare namespace Xrm {
*
* @param functionRef The event handler for the OnKeyPressed event.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnKeyPress(functionRef: (context?: ExecutionContext) => any): void;
/**
@@ -14,6 +16,7 @@ declare namespace Xrm {
*
* @param functionRef The event handler for the OnKeyPressed event.
*/
+ // eslint-disable-next-line @typescript-eslint/ban-types
removeOnKeyPress(functionRef: Function): void;
/**
@@ -50,6 +53,7 @@ declare namespace Xrm {
* @param createFromEntity Designates a record that will provide default values based on mapped attribute values.
* @param parameters A dictionary object that passes extra query string parameters to the form. Invalid query string parameters will cause an error.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
openQuickCreate(entityLogicalName: string, createFromEntity?: Lookup, parameters?: any): Promise;
}
}
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-9.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-9.d.ts
index 703dadf261..63e0724d8e 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-9.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_8.2-9.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
interface Process {
/**
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-.d.ts
index e7ad185f96..55786cda5c 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-.d.ts
@@ -1,11 +1,11 @@
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
///
declare namespace Xrm {
- var Device: Device;
- var Encoding: Encoding;
- var Navigation: Navigation;
- //var UI: UI;
- var WebApi: WebApi;
+ let Device: Device;
+ let Encoding: Encoding;
+ let Navigation: Navigation;
+ let WebApi: WebApi;
interface ImageOptions {
/**
@@ -81,8 +81,8 @@ declare namespace Xrm {
/**
* Interface for geo location object acquired through Xrm.Device.getCurrentPosition
*/
- interface GeoObject {
- coords: any;
+ interface GeoObject {
+ coords: any; // eslint-disable-line @typescript-eslint/no-explicit-any
timestamp: number;
}
@@ -620,6 +620,7 @@ declare namespace Xrm {
* @param formParameters A dictionary object that passes extra parameters to the form.
* See examples at: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/set-field-values-using-parameters-passed-form
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
openForm(entityFormOptions: EntityFormOptions, formParameters?: any): Then;
/**
@@ -642,12 +643,8 @@ declare namespace Xrm {
/**
* Contains methods for displaying and hiding app-level global notifications.
*/
- interface UI {
- /**
- * addGlobalNotification();
- * clearGlobalNotification();
- */
- }
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface UI { }
interface WebApiBase {
/**
@@ -675,6 +672,7 @@ declare namespace Xrm {
* @param options OData system query options, $select and $expand, to retrieve your data.
* See examples at: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-webapi/retrieverecord
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
retrieveRecord(entityLogicalName: string, id: string, options?: string): Promise;
/**
@@ -686,6 +684,7 @@ declare namespace Xrm {
* @param maxPageSize Specify a positive number that indicates the number of entity records to be returned per page. If you do not specify this parameter, the default value is passed as 5000.
* If the number of records being retrieved is more than the specified maxPageSize value, nextLink attribute in the returned promise object will contain a link to retrieve the next set of entities.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
retrieveMultipleRecords(entityLogicalName: string, options?: string, maxPageSize?: number): Promise;
/**
@@ -708,6 +707,7 @@ declare namespace Xrm {
isAvailableOffline(entityLogicalName: string): boolean;
}
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
interface WebApiResponse extends Response { }
interface WebApiOnline extends WebApiBase {
@@ -717,6 +717,7 @@ declare namespace Xrm {
* @param request Object that will be passed to the Web API endpoint to execute an action, function, or CRUD request.
* The object exposes a getMetadata method that lets you define the metadata for the action, function or CRUD request you want to execute.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
execute(request: any): Promise;
/**
@@ -727,6 +728,7 @@ declare namespace Xrm {
* We recommend using XrmQuery instead of this interface.
* @param requests An array of requests and changesets. Requests are the same as for execute. Changesets are arrays of requests that will be executed in transaction.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
executeMultiple(requests: any): Promise;
}
@@ -822,6 +824,7 @@ declare namespace Xrm {
* @param entityName The logical name of the entity.
* @param attributes The attributes to get metadata for.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
getEntityMetadata(entityName: string, attributes?: string[]): Promise;
/**
@@ -847,6 +850,7 @@ declare namespace Xrm {
* @param name of the process action to invoke.
* @param parameters An object containing input parameters for the action. You define an object using key:value pairs of items, where key is of String type.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
invokeProcessAction(name: string, parameters?: any): Promise;
/**
@@ -869,8 +873,10 @@ declare namespace Xrm {
showProgressIndicator(message: string): void;
}
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-explicit-any
interface PreProcessStatusChangeContext extends ExecutionContext { }
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
interface PreStageChangeContext extends ExecutionContext { }
interface ProcessInstanceContext {
@@ -894,12 +900,14 @@ declare namespace Xrm {
* event handler.
* This client API is only supported on the Unified Client. The legacy web client does not support this client API.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnPreProcessStatusChange(handler: (context?: PreProcessStatusChangeContext) => any): void;
/**
* Removes an event handler from the OnPreProcessStatusChange event.
* @param handler The function to be removed from the OnPreProcessStatusChange event.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
removeOnPreProcessStatusChange(handler: (context?: PreProcessStatusChangeContext) => any): void;
/**
@@ -913,12 +921,14 @@ declare namespace Xrm {
* event handler.
* This client API is only supported on the Unified Client. The legacy web client does not support this client API.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnPreStageChange(handler: (context?: PreStageChangeContext) => any): void;
/**
* Removes an event handler from the OnPreStageChange event.
* @param handler The function to be removed from the OnPreStageChange event.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
removeOnPreStageChange(handler: (context?: PreStageChangeContext) => any): void;
/**
@@ -926,6 +936,7 @@ declare namespace Xrm {
* @param handler The callback function is passed an object with the following attributes
* and their corresponding values as the key: value pair.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
getProcessInstances(callbackFunction: (context?: ProcessInstanceContext) => any): void;
/**
@@ -933,6 +944,7 @@ declare namespace Xrm {
* @param processInstanceid The Id of the process instance to set as the active instance.
* @param callbackFunction A function to call when the operation is complete. This callback function is passed either string "succes" or "invalid" to indicate whether the operation succeeded:
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
setActiveProcessInstance(processInstanceId: string, callbackFunction?: (succesOrInvalid: "success" | "invalid") => any): void;
/**
@@ -942,12 +954,14 @@ declare namespace Xrm {
* @param callback A function to call when the operation is complete. This callback function is passed one of the following string
* values to indicate whether the operation succeeded. Is "success" or "invalid".
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
setActiveProcess(processId: string, callback?: (successOrInvalid: "success" | "invalid") => any): void;
}
/**
* Form executionContext
*/
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface ExecutionContext {
getFormContext(): Xrm.PageBase;
}
@@ -972,6 +986,7 @@ declare namespace Xrm {
/**
* Adds a function to be called when form data is loaded.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnLoad(myFunction: (context?: OnLoadEventContext) => any): void;
/**
@@ -987,6 +1002,7 @@ declare namespace Xrm {
/**
* Removes a function to be called when form data is loaded.
*/
+ // eslint-disable-next-line @typescript-eslint/ban-types
removeOnLoad(myFunction: Function): void;
/**
@@ -1015,6 +1031,7 @@ declare namespace Xrm {
/**
* Interface for the entity on a form.
*/
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface PageEntity {
/**
* Returns a lookup value that references the record.
@@ -1035,6 +1052,7 @@ declare namespace Xrm {
/**
* Interface for an standard entity attribute.
*/
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Attribute {
/**
@@ -1046,18 +1064,21 @@ declare namespace Xrm {
/**
* Interface for the ui of a form.
*/
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface UiModule {
/**
* Adds a function to be called on the form OnLoad event.
* @param myFunction The function to be executed on the form OnLoad event. The function will be added to the bottom of the event handler pipeline.
* The execution context is automatically passed as the first parameter to the function. See Execution context for more information.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnLoad(myFunction: (context?: OnLoadEventContext) => any): void;
/**
* Removes a function from the form OnLoad event.
* @param myFunction The function to be removed from the form OnLoad event.
*/
+ // eslint-disable-next-line @typescript-eslint/ban-types
removeOnLoad(myFunction: Function): void;
}
@@ -1305,6 +1326,7 @@ declare namespace Xrm {
MobileApplication = 1,
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface SubGridControl extends BaseControl {
/**
* Gets the FetchXML query that represents the current data, including filtered and sorted data, in the grid control.
@@ -1359,9 +1381,11 @@ declare namespace Xrm {
attributes: GridCollection>;
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-interface
interface GridCollection {
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-interface
interface GridEntityAttribute {
}
@@ -1369,7 +1393,7 @@ declare namespace Xrm {
interface actionsObject {
message?: string;
- actions?: Function[];
+ actions?: Function[]; // eslint-disable-line @typescript-eslint/ban-types
}
interface AddNotificationObject {
@@ -1414,7 +1438,7 @@ declare namespace Xrm {
}
}
-
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Xrm> extends BaseXrm {
Device: Xrm.Device;
Encoding: Xrm.Encoding;
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-9.1-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-9.1-.d.ts
index b36b8cd81d..d25f0b2ced 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-9.1-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9-9.1-.d.ts
@@ -1,4 +1,5 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
interface userSettings {
@@ -8,5 +9,6 @@ declare namespace Xrm {
securityRoles: string[];
}
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-explicit-any
interface OnLoadEventContext extends ExecutionContext, any> { }
}
diff --git a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9.1-.d.ts b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9.1-.d.ts
index f4ccd75a6c..5f4dcfaead 100644
--- a/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9.1-.d.ts
+++ b/src/XrmDefinitelyTyped/Resources/Extensions/xrm_ext_9.1-.d.ts
@@ -1,10 +1,11 @@
-///
+// eslint-disable-next-line @typescript-eslint/triple-slash-reference
+///
declare namespace Xrm {
- var App: App;
- var Panel: Panel;
+ let App: App;
+ let Panel: Panel;
interface App {
// --------------------------------------------------------------------------------------
// TODO: app app.appSidePane
@@ -53,7 +54,7 @@ declare namespace Xrm {
* Defines the type of notification. Currently, only a value of 2 is supported,
* which displays a message bar at the top of the app.
*/
- type: Number;
+ type: number;
}
interface AppAction {
@@ -65,7 +66,7 @@ declare namespace Xrm {
/**
* Function reference. The function to execute when the action label is clicked.
*/
- eventHandler?: Function;
+ eventHandler?: Function; // eslint-disable-line @typescript-eslint/ban-types
}
const enum LevelValue {
Succes = 1,
@@ -214,6 +215,7 @@ declare namespace Xrm {
/**
* Interface for an standard entity attribute.
*/
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Attribute {
/**
@@ -235,8 +237,8 @@ declare namespace Xrm {
getDataLoadState(): LoadState;
}
- interface OnLoadEventContext extends ExecutionContext, LoadEventArgs> {
- }
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface OnLoadEventContext extends ExecutionContext, LoadEventArgs> {}
interface LookupTagValue extends Lookup {
/**
@@ -264,18 +266,20 @@ declare namespace Xrm {
preventDefault(): void;
}
- interface OnLookupTagClickContext extends ExecutionContext {
- }
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-explicit-any
+ interface OnLookupTagClickContext extends ExecutionContext { }
interface LookupControl extends Control> {
/**
* Adds an event handler to the OnLookupTagClick event.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnLookupTagClick(myFunction: (context?: OnLookupTagClickContext) => any): void;
/**
* Removes an event handler from the OnLookupTagClick event.
*/
+ // eslint-disable-next-line @typescript-eslint/ban-types
removeOnLookupTagClick(functionRef: Function): void;
}
@@ -294,6 +298,7 @@ declare namespace Xrm {
/**
* Interface for the ui of a form.
*/
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface UiModule {
/**
* Method to cause the ribbon to re-evaluate data that controls what is displayed in it.
@@ -366,12 +371,12 @@ declare namespace Xrm {
* The execution context is automatically passed as the first parameter to the function.
* See Execution context for more information.
*/
- addOnLoad(onLoadFunction: (context?: OnLoadEventContext) => any): void;
+ addOnLoad(onLoadFunction: (context?: OnLoadEventContext) => any): void; // eslint-disable-line @typescript-eslint/no-explicit-any
/**
* Removes a function from the form OnLoad event.
* @param onLoadFunction The function to be removed from the form OnLoad event.
*/
- removeOnLoad(onLoadFunction: Function): void;
+ removeOnLoad(onLoadFunction: Function): void; // eslint-disable-line @typescript-eslint/ban-types
}
interface HeaderSection {
@@ -467,7 +472,7 @@ declare namespace Xrm {
* For example: quickViewControl.getControl("firstname") or quickViewControl.getControl(0)
* Returns an Object or Object collection
*/
- getControl(arg?: string) : any // TODO figure out return type. Maybe: Xrm.AnyControl | undefined;
+ getControl(arg?: string): any // eslint-disable-line @typescript-eslint/no-explicit-any
/**
* Returns a string value that categorizes quick view controls.
* For a quick view control, the method returns "quickform".
@@ -494,7 +499,7 @@ declare namespace Xrm {
/**
* Returns a reference to the section object that contains the control.
*/
- getParent(): any;
+ getParent(): any; // eslint-disable-line @typescript-eslint/no-explicit-any
// TODO figure out return type, could be something like (PageSection>));
/**
* Returns a value that indicates whether the quick view control is currently visible.
@@ -620,18 +625,21 @@ declare namespace Xrm {
* Add an event handler to the PostSearch event.
* @param functionRef The function to add.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnPostSearch(functionRef: (context?: ExecutionContext) => any): void;
/**
* Add an event handler to the OnResultOpened event.
* @param functionRef The function to add.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnResultOpened(functionRef: (context?: ExecutionContext) => any): void;
/**
* Add an event handler to the OnSelection event.
* @param functionRef The function to add.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnSelection(functionRef: (context?: ExecutionContext) => any): void;
/**
@@ -663,19 +671,19 @@ declare namespace Xrm {
* Use this method to remove an event handler from the PostSearch event.
* @param functionRef The function to remove.
*/
- removeOnPostSearch(functionRef: Function): void;
+ removeOnPostSearch(functionRef: Function): void; // eslint-disable-line @typescript-eslint/ban-types
/**
* Remove an event handler from the OnResultOpened event.
* @param functionRef The function to remove.
*/
- removeOnResultOpened(functionRef: Function): void;
+ removeOnResultOpened(functionRef: Function): void; // eslint-disable-line @typescript-eslint/ban-types
/**
* Remove an event handler from the OnSelection event.
* @param functionRef The function to remove.
*/
- removeOnSelection(functionRef: Function): void;
+ removeOnSelection(functionRef: Function): void; // eslint-disable-line @typescript-eslint/ban-types
/**
* Set the text used as the search criteria for the knowledge base management control.
@@ -684,12 +692,14 @@ declare namespace Xrm {
setSearchQuery(text: string): void;
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface PageEntity {
/**
* Adds a function to be called when save event has completed; either successfully or with a failure.
* @param functionRef The function to add to the PostSave event.
* The execution context is automatically passed as the first parameter to this function.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addOnPostSave(functionRef: (context?: SaveEventContext) => any): void;
}
@@ -710,6 +720,7 @@ declare namespace Xrm {
* The execution context is automatically passed as the first parameter to the function.
* See Execution context for more information.
*/
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addTabStateChange(tabStateChangeFunction: (context?: ExecutionContext) => any): void;
/**
@@ -722,7 +733,7 @@ declare namespace Xrm {
* Removes a function to be called when the TabStateChange event occurs.
* @param tabStateChangeFunction The function to be removed from the TabStateChange event.
*/
- removeTabStateChange(tabStateChangeFunction: Function): void;
+ removeTabStateChange(tabStateChangeFunction: Function): void; // eslint-disable-line @typescript-eslint/ban-types
/**
* Sets the content type.
* only supported on unified interface
@@ -733,6 +744,7 @@ declare namespace Xrm {
setContentType(contentType: TabsContentType): void;
}
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
interface OnRecordSelectEventContext extends ExecutionContext, undefined> {
}
}
diff --git a/src/XrmDefinitelyTyped/Resources/dg.xrmquery.rest.ts b/src/XrmDefinitelyTyped/Resources/dg.xrmquery.rest.ts
index 2a759b0c21..5e9d4758cd 100644
--- a/src/XrmDefinitelyTyped/Resources/dg.xrmquery.rest.ts
+++ b/src/XrmDefinitelyTyped/Resources/dg.xrmquery.rest.ts
@@ -1,18 +1,20 @@
-interface RestEntities {}
+// eslint-disable-next-line @typescript-eslint/no-empty-interface
+interface RestEntities { }
/**
* @internal
*/
-declare namespace SDK {
- namespace REST {
- function createRecord(object: any, type: string, successCallback: (result: any) => any, errorCallback: (err: Error) => any): void;
- function deleteRecord(id: string, type: string, successCallBack: () => any, errorCallback: (err: Error) => any): void;
- function retrieveRecord(id: string, type: string, select: string | null, expand: string | null, successCallback: (result: any) => any, errorCallback: (err: Error) => any): void;
- function updateRecord(id: string, object: any, type: string, successCallBack: () => any, errorCallback: (err: Error) => any): void;
- function retrieveMultipleRecords(type: string, options: string | null, successCallback: (result: any[]) => any, errorCallback: (err: Error) => any, onComplete: any): void;
+declare namespace SDK { //eslint-disable-line @typescript-eslint/no-namespace
+ namespace REST { //eslint-disable-line @typescript-eslint/no-namespace
+ function createRecord(object: any, type: string, successCallback: (result: any) => any, errorCallback: (err: Error) => any): void; //eslint-disable-line @typescript-eslint/no-explicit-any
+ function deleteRecord(id: string, type: string, successCallBack: () => any, errorCallback: (err: Error) => any): void; //eslint-disable-line @typescript-eslint/no-explicit-any
+ function retrieveRecord(id: string, type: string, select: string | null, expand: string | null, successCallback: (result: any) => any, errorCallback: (err: Error) => any): void; //eslint-disable-line @typescript-eslint/no-explicit-any
+ function updateRecord(id: string, object: any, type: string, successCallBack: () => any, errorCallback: (err: Error) => any): void; //eslint-disable-line @typescript-eslint/no-explicit-any
+ function retrieveMultipleRecords(type: string, options: string | null, successCallback: (result: any[]) => any, errorCallback: (err: Error) => any, onComplete: any): void; //eslint-disable-line @typescript-eslint/no-explicit-any
}
}
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface RestMapping {
__RestMapping: O;
}
@@ -26,10 +28,10 @@ interface RestExpand extends RestAttribute {
}
interface RestFilter {
- __RestFilter: any;
+ __RestFilter: any; //eslint-disable-line @typescript-eslint/no-explicit-any
}
-namespace Filter.REST {
+namespace Filter.REST { // eslint-disable-line @typescript-eslint/no-namespace
export function equals(v1: T, v2: T): RestFilter {
return Comp(v1, "eq", v2);
}
@@ -37,16 +39,16 @@ namespace Filter.REST {
return Comp(v1, "ne", v2);
}
- export function greaterThan(v1: T, v2: T): RestFilter {
+ export function greaterThan(v1: T, v2: T): RestFilter {
return Comp(v1, "gt", v2);
}
- export function greaterThanOrEqual(v1: T, v2: T): RestFilter {
+ export function greaterThanOrEqual(v1: T, v2: T): RestFilter {
return Comp(v1, "ge", v2);
}
- export function lessThan(v1: T, v2: T): RestFilter {
+ export function lessThan(v1: T, v2: T): RestFilter {
return Comp(v1, "lt", v2);
}
- export function lessThanOrEqual(v1: T, v2: T): RestFilter {
+ export function lessThanOrEqual(v1: T, v2: T): RestFilter {
return Comp(v1, "le", v2);
}
@@ -57,7 +59,7 @@ namespace Filter.REST {
return BiFilter(f1, "or", f2);
}
export function not(f1: RestFilter): RestFilter {
- return ("not " + f1);
+ return ("not " + f1); //eslint-disable-line @typescript-eslint/no-explicit-any
}
export function ands(fs: RestFilter[]): RestFilter {
@@ -81,12 +83,13 @@ namespace Filter.REST {
* Makes a string into a GUID that can be sent to the OData source
*/
export function makeGuid(id: string): XQR.Guid {
- return XQR.makeTag(`(guid'${id}')`);
+ return XQR.makeTag(`(guid'${id}')`); //eslint-disable-line @typescript-eslint/no-explicit-any
}
/**
* @internal
*/
+ //eslint-disable-next-line @typescript-eslint/no-explicit-any, no-inner-declarations
function getVal(v: any) {
if (v == null) return "null";
if (typeof v === "string") return `'${v}'`;
@@ -97,62 +100,67 @@ namespace Filter.REST {
/**
* @internal
*/
+ //eslint-disable-next-line no-inner-declarations
function Comp(val1: T, op: string, val2: T): RestFilter {
- return (`${getVal(val1)} ${op} ${getVal(val2)}`);
+ return (`${getVal(val1)} ${op} ${getVal(val2)}`); //eslint-disable-line @typescript-eslint/no-explicit-any
}
/**
* @internal
*/
+ //eslint-disable-next-line no-inner-declarations
function DataFunc(funcName: string, val1: T, val2: T): RestFilter {
- return (`${funcName}(${getVal(val1)}, ${getVal(val2)})`);
+ return (`${funcName}(${getVal(val1)}, ${getVal(val2)})`); //eslint-disable-line @typescript-eslint/no-explicit-any
}
/**
* @internal
*/
+ //eslint-disable-next-line no-inner-declarations
function BiFilter(f1: RestFilter, conj: string, f2: RestFilter): RestFilter {
- return (`(${f1} ${conj} ${f2})`);
+ return (`(${f1} ${conj} ${f2})`); //eslint-disable-line @typescript-eslint/no-explicit-any
}
/**
* @internal
*/
+ //eslint-disable-next-line no-inner-declarations
function NestedFilter(fs: RestFilter[], conj: string): RestFilter {
- var last = fs.pop();
+ const last = fs.pop();
if (last === undefined) {
- return ("");
+ return (""); //eslint-disable-line @typescript-eslint/no-explicit-any
}
return fs.reduceRight((acc, c) => BiFilter(c, conj, acc), last);
}
}
-namespace XrmQuery.REST {
+
+namespace XrmQuery.REST { //eslint-disable-line @typescript-eslint/no-namespace, @typescript-eslint/no-unused-vars
export function stripGUID(guid: string) {
if (guid.startsWith("{") && guid.endsWith("}")) return guid.substring(1, guid.length - 1);
else return guid;
}
- export function retrieveRecord(entityPicker: (x: RestEntities) => RestMapping, id: string) {
+ export function retrieveRecord(entityPicker: (x: RestEntities) => RestMapping, id: string) { //eslint-disable-line @typescript-eslint/no-explicit-any
return new XQR.RetrieveRecord(entityPicker, stripGUID(id));
}
export function retrieveMultipleRecords(entityPicker: (x: RestEntities) => RestMapping) {
return new XQR.RetrieveMultipleRecords(entityPicker);
}
- export function createRecord(entityPicker: (x: RestEntities) => RestMapping, record: O) {
+ export function createRecord(entityPicker: (x: RestEntities) => RestMapping, record: O) { //eslint-disable-line @typescript-eslint/no-explicit-any
return new XQR.CreateRecord(entityPicker, record);
}
- export function updateRecord(entityPicker: (x: RestEntities) => RestMapping, id: string, record: O) {
+ export function updateRecord(entityPicker: (x: RestEntities) => RestMapping, id: string, record: O) { //eslint-disable-line @typescript-eslint/no-explicit-any
return new XQR.UpdateRecord(entityPicker, stripGUID(id), record);
}
- export function deleteRecord(entityPicker: (x: RestEntities) => RestMapping, id: string) {
+ export function deleteRecord(entityPicker: (x: RestEntities) => RestMapping, id: string) { //eslint-disable-line @typescript-eslint/no-explicit-any
return new XQR.DeleteRecord(entityPicker, stripGUID(id));
}
}
-namespace XQR {
+namespace XQR { //eslint-disable-line @typescript-eslint/no-namespace
export interface Guid {
- __XqrGuid: any;
+ __XqrGuid: any; //eslint-disable-line @typescript-eslint/no-explicit-any
}
export interface ValueContainerFilter {
@@ -175,28 +183,29 @@ namespace XQR {
/**
* @internal
*/
+ //eslint-disable-next-line no-inner-declarations, @typescript-eslint/no-explicit-any
function taggedExec(f: (x: any) => T): T {
- var tagged = tagMatches(f);
+ const tagged = tagMatches(f);
return f(tagged);
}
/**
* @internal
*/
- var fPatt = /function[^\(]*\(([a-zA-Z0-9_]+)[^\{]*\{([\s\S]*)\}$/m;
+ const fPatt = /function[^\(]*\(([a-zA-Z0-9_]+)[^\{]*\{([\s\S]*)\}$/m; //eslint-disable-line no-useless-escape
/**
* @internal
*/
- function objRegex(oName: string) {
+ function objRegex(oName: string) { //eslint-disable-line no-inner-declarations
return new RegExp("\\b" + oName + "\\.([a-zA-Z_$][0-9a-zA-Z_$]*)(\\.([a-zA-Z_$][0-9a-zA-Z_$]*))?", "g");
}
/**
* @internal
*/
- function analyzeFunc(f: (x: any) => any) {
- var m = f.toString().match(fPatt);
+ function analyzeFunc(f: (x: any) => any) { //eslint-disable-line no-inner-declarations, @typescript-eslint/no-explicit-any
+ const m = f.toString().match(fPatt);
if (!m) throw new Error(`XrmQuery: Unable to properly parse function: ${f.toString()}`);
return { arg: m[1], body: m[2] };
}
@@ -204,12 +213,12 @@ namespace XQR {
/**
* @internal
*/
- function tagMatches(f: (x: any) => any) {
- var funcInfo = analyzeFunc(f);
- var regex = objRegex(funcInfo.arg);
+ function tagMatches(f: (x: any) => any) { //eslint-disable-line no-inner-declarations, @typescript-eslint/no-explicit-any
+ const funcInfo = analyzeFunc(f);
+ const regex = objRegex(funcInfo.arg);
- var obj: { [k: string]: any } = {};
- var match: any;
+ const obj: { [k: string]: any } = {}; //eslint-disable-line @typescript-eslint/no-explicit-any
+ let match: any; //eslint-disable-line @typescript-eslint/no-explicit-any
while ((match = regex.exec(funcInfo.body)) != null) {
if (!obj[match[1]]) {
obj[match[1]] = makeTag(match[1]);
@@ -224,7 +233,9 @@ namespace XQR {
/**
* @internal
*/
- var NoOp = () => {};
+ const NoOp = () => {
+ // do nothing
+ };
/**
* Contains information about a Retrieve query
@@ -247,24 +258,24 @@ namespace XQR {
*/
private id: string;
- constructor(entityPicker: (x: RestEntities) => RestMapping, id: string) {
+ constructor(entityPicker: (x: RestEntities) => RestMapping, id: string) { //eslint-disable-line @typescript-eslint/no-explicit-any
this.logicalName = taggedExec(entityPicker).toString();
this.id = id;
}
select(vars: (x: S) => RestAttribute[]) {
- this.selects = this.selects.concat(taggedExec(vars));
+ this.selects = this.selects.concat(taggedExec(vars)); //eslint-disable-line @typescript-eslint/no-explicit-any
return this;
}
expand(exps: (x: E) => RestExpand, vars?: (x: S2) => RestAttribute[]) {
- var expName = taggedExec(exps).toString();
+ const expName = taggedExec(exps).toString();
this.expands.push(expName);
if (vars) this.selects = this.selects.concat(taggedExec(vars).map(a => expName + "." + a));
return this;
}
- execute(successCallback: (record: R) => any, errorCallback?: (err: Error) => any) {
+ execute(successCallback: (record: R) => any, errorCallback?: (err: Error) => any) { //eslint-disable-line @typescript-eslint/no-explicit-any
SDK.REST.retrieveRecord(
this.id,
this.logicalName,
@@ -308,17 +319,17 @@ namespace XQR {
*/
private topAmount: number | null = null;
- constructor(entityPicker: (x: RestEntities) => RestMapping) {
+ constructor(entityPicker: (x: RestEntities) => RestMapping) { //eslint-disable-line @typescript-eslint/no-explicit-any
this.logicalName = taggedExec(entityPicker).toString();
}
select(vars: (x: S) => RestAttribute[]) {
- this.selects = this.selects.concat(taggedExec(vars));
+ this.selects = this.selects.concat(taggedExec(vars)); //eslint-disable-line @typescript-eslint/no-explicit-any
return this;
}
expand(exps: (x: E) => RestExpand, vars?: (x: T2) => RestAttribute[]) {
- var expName = taggedExec(exps).toString();
+ const expName = taggedExec(exps).toString();
this.expands.push(expName);
if (vars) this.selects = this.selects.concat(taggedExec(vars).map(a => `${expName}/${a}`));
return this;
@@ -373,7 +384,7 @@ namespace XQR {
* @param errorCallback Called if an error occurs during the retrieval
* @param onComplete Called when all pages have been successfully retrieved from CRM
*/
- execute(pageSuccessCallback: (records: R[]) => any, errorCallback: (err: Error) => any, onComplete: () => any) {
+ execute(pageSuccessCallback: (records: R[]) => any, errorCallback: (err: Error) => any, onComplete: () => any) { //eslint-disable-line @typescript-eslint/no-explicit-any
SDK.REST.retrieveMultipleRecords(
this.logicalName,
this.getOptionString(),
@@ -387,8 +398,8 @@ namespace XQR {
* @param successCallback Called with all records returned from the query
* @param errorCallback Called if an error occures during the retrieval
*/
- getAll(successCallback: (records: R[]) => any, errorCallback?: (err: Error) => any) {
- let pages: any[][] = [];
+ getAll(successCallback: (records: R[]) => any, errorCallback?: (err: Error) => any) { //eslint-disable-line @typescript-eslint/no-explicit-any
+ const pages: any[][] = []; //eslint-disable-line @typescript-eslint/no-explicit-any
SDK.REST.retrieveMultipleRecords(
this.logicalName,
this.getOptionString(),
@@ -397,7 +408,7 @@ namespace XQR {
},
errorCallback ? errorCallback : NoOp,
() => {
- successCallback([].concat.apply([], pages));
+ successCallback(Array.prototype.concat(...pages));
});
}
@@ -406,13 +417,13 @@ namespace XQR {
* @param successCallback Called with the first result of the query (or null, if no record was found)
* @param errorCallback Called if an error occures during the retrieval
*/
- getFirst(successCallback: (record: R | null) => any, errorCallback?: (err: Error) => any) {
+ getFirst(successCallback: (record: R | null) => any, errorCallback?: (err: Error) => any) { //eslint-disable-line @typescript-eslint/no-explicit-any
this.top(1);
this.execute(recs => successCallback((recs.length > 0) ? recs[0] : null), errorCallback ? errorCallback : NoOp, NoOp);
}
getOptionString(): string {
- var options: string[] = [];
+ const options: string[] = [];
if (this.selects.length > 0) {
options.push("$select=" + this.selects.join(","));
}
@@ -448,12 +459,12 @@ namespace XQR {
*/
private record: O;
- constructor(entityPicker: (x: RestEntities) => RestMapping, record: O) {
+ constructor(entityPicker: (x: RestEntities) => RestMapping, record: O) { //eslint-disable-line @typescript-eslint/no-explicit-any
this.logicalName = taggedExec(entityPicker).toString();
this.record = record;
}
- execute(successCallback?: (record: R) => any, errorCallback?: (err: Error) => any) {
+ execute(successCallback?: (record: R) => any, errorCallback?: (err: Error) => any) { //eslint-disable-line @typescript-eslint/no-explicit-any
SDK.REST.createRecord(
this.record,
this.logicalName,
@@ -479,13 +490,13 @@ namespace XQR {
*/
private record: O;
- constructor(entityPicker: (x: RestEntities) => RestMapping, id: string, record: O) {
+ constructor(entityPicker: (x: RestEntities) => RestMapping, id: string, record: O) { //eslint-disable-line @typescript-eslint/no-explicit-any
this.logicalName = taggedExec(entityPicker).toString();
this.id = id;
this.record = record;
}
- execute(successCallback?: () => any, errorCallback?: (err: Error) => any) {
+ execute(successCallback?: () => any, errorCallback?: (err: Error) => any) { //eslint-disable-line @typescript-eslint/no-explicit-any
SDK.REST.updateRecord(
this.id,
this.record,
@@ -508,12 +519,12 @@ namespace XQR {
*/
private id: string;
- constructor(entityPicker: (x: RestEntities) => RestMapping, id: string) {
+ constructor(entityPicker: (x: RestEntities) => RestMapping, id: string) { //eslint-disable-line @typescript-eslint/no-explicit-any
this.logicalName = taggedExec(entityPicker).toString();
this.id = id;
}
- execute(successCallback?: () => any, errorCallback?: (err: Error) => any) {
+ execute(successCallback?: () => any, errorCallback?: (err: Error) => any) { //eslint-disable-line @typescript-eslint/no-explicit-any
SDK.REST.deleteRecord(
this.id,
this.logicalName,
diff --git a/src/XrmDefinitelyTyped/Resources/dg.xrmquery.web.ts b/src/XrmDefinitelyTyped/Resources/dg.xrmquery.web.ts
index 3143dc638a..982c38ac36 100644
--- a/src/XrmDefinitelyTyped/Resources/dg.xrmquery.web.ts
+++ b/src/XrmDefinitelyTyped/Resources/dg.xrmquery.web.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-namespace */
namespace XrmQuery {
/**
* Instantiates specification of a query that can retrieve a specific record.
@@ -5,7 +6,7 @@ namespace XrmQuery {
* @param id GUID of the wanted record.
*/
export function retrieve(
- entityPicker: (x: WebEntitiesRetrieve) => WebMappingRetrieve,
+ entityPicker: (x: WebEntitiesRetrieve) => WebMappingRetrieve, //eslint-disable-line @typescript-eslint/no-explicit-any
id: string) {
return XQW.RetrieveRecord.Get(entityPicker, id);
}
@@ -32,9 +33,9 @@ namespace XrmQuery {
* @param relatedPicker Function to select which navigation property points to the related record.
*/
export function retrieveRelated(
- entityPicker: (x: WebEntitiesRelated) => WebMappingRelated,
+ entityPicker: (x: WebEntitiesRelated) => WebMappingRelated, //eslint-disable-line @typescript-eslint/no-explicit-any
id: string,
- relatedPicker: (x: ISingle) => WebMappingRetrieve) {
+ relatedPicker: (x: ISingle) => WebMappingRetrieve) { //eslint-disable-line @typescript-eslint/no-explicit-any
return XQW.RetrieveRecord.Related(entityPicker, id, relatedPicker);
}
@@ -45,7 +46,7 @@ namespace XrmQuery {
* @param relatedPicker Function to select which navigation property points to the related records.
*/
export function retrieveRelatedMultiple(
- entityPicker: (x: WebEntitiesRelated) => WebMappingRelated,
+ entityPicker: (x: WebEntitiesRelated) => WebMappingRelated, //eslint-disable-line @typescript-eslint/no-explicit-any
id: string,
relatedPicker: (x: IMultiple) => WebMappingRetrieve) {
return XQW.RetrieveMultipleRecords.Related(entityPicker, id, relatedPicker);
@@ -57,7 +58,7 @@ namespace XrmQuery {
* @param record Object of the record to be created.
*/
export function create(
- entityPicker: (x: WebEntitiesCUDA) => WebMappingCUDA,
+ entityPicker: (x: WebEntitiesCUDA) => WebMappingCUDA, //eslint-disable-line @typescript-eslint/no-explicit-any
record?: ICreate) {
return new XQW.CreateRecord(entityPicker, record);
}
@@ -69,7 +70,7 @@ namespace XrmQuery {
* @param record Object containing the attributes to be updated.
*/
export function update(
- entityPicker: (x: WebEntitiesCUDA) => WebMappingCUDA,
+ entityPicker: (x: WebEntitiesCUDA) => WebMappingCUDA, //eslint-disable-line @typescript-eslint/no-explicit-any
id?: string,
record?: IUpdate) {
return new XQW.UpdateRecord(entityPicker, id, record);
@@ -84,11 +85,11 @@ namespace XrmQuery {
* @param relationPicker Function to select which N:1 relation (lookup-field) should be used to associate.
*/
export function associateSingle(
- entityPicker: (x: WebEntitiesRelated) => WebMappingRelated,
+ entityPicker: (x: WebEntitiesRelated) => WebMappingRelated, //eslint-disable-line @typescript-eslint/no-explicit-any
id: string,
- entityTargetPicker: (x: WebEntitiesCUDA) => WebMappingCUDA,
+ entityTargetPicker: (x: WebEntitiesCUDA) => WebMappingCUDA, //eslint-disable-line @typescript-eslint/no-explicit-any
targetId: string,
- relationPicker: (x: ISingle) => WebMappingRetrieve) {
+ relationPicker: (x: ISingle) => WebMappingRetrieve) { //eslint-disable-line @typescript-eslint/no-explicit-any
return new XQW.AssociateRecordSingle(entityPicker, id, entityTargetPicker, targetId, relationPicker);
}
@@ -101,11 +102,11 @@ namespace XrmQuery {
* @param relationPicker Function to select which N:N or 1:N relation should be used to associate.
*/
export function associateCollection(
- entityPicker: (x: WebEntitiesRelated) => WebMappingRelated,
+ entityPicker: (x: WebEntitiesRelated) => WebMappingRelated, //eslint-disable-line @typescript-eslint/no-explicit-any
id: string,
- entityTargetPicker: (x: WebEntitiesCUDA) => WebMappingCUDA,
+ entityTargetPicker: (x: WebEntitiesCUDA) => WebMappingCUDA, //eslint-disable-line @typescript-eslint/no-explicit-any
targetId: string,
- relationPicker: (x: IMultiple) => WebMappingRetrieve) {
+ relationPicker: (x: IMultiple) => WebMappingRetrieve) { //eslint-disable-line @typescript-eslint/no-explicit-any
return new XQW.AssociateRecordCollection(entityPicker, id, entityTargetPicker, targetId, relationPicker);
}
@@ -117,9 +118,9 @@ namespace XrmQuery {
*/
export function disassociateSingle(
- entityPicker: (x: WebEntitiesRelated) => WebMappingRelated,
+ entityPicker: (x: WebEntitiesRelated) => WebMappingRelated, //eslint-disable-line @typescript-eslint/no-explicit-any
id: string,
- relationPicker: (x: ISingle) => WebMappingRetrieve) {
+ relationPicker: (x: ISingle) => WebMappingRetrieve) { //eslint-disable-line @typescript-eslint/no-explicit-any
return XQW.DisassociateRecord.Single(entityPicker, id, relationPicker);
}
@@ -132,9 +133,9 @@ namespace XrmQuery {
*/
export function disassociateCollection(
- entityPicker: (x: WebEntitiesRelated) => WebMappingRelated,
+ entityPicker: (x: WebEntitiesRelated) => WebMappingRelated, //eslint-disable-line @typescript-eslint/no-explicit-any
id: string,
- relationPicker: (x: IMultiple) => WebMappingRetrieve,
+ relationPicker: (x: IMultiple) => WebMappingRetrieve, //eslint-disable-line @typescript-eslint/no-explicit-any
targetId: string) {
return XQW.DisassociateRecord.Collection(entityPicker, id, relationPicker, targetId);
}
@@ -145,7 +146,7 @@ namespace XrmQuery {
* @param id GUID of the record to be updated.
*/
export function deleteRecord(
- entityPicker: (x: WebEntitiesCUDA) => WebMappingCUDA,
+ entityPicker: (x: WebEntitiesCUDA) => WebMappingCUDA, //eslint-disable-line @typescript-eslint/no-explicit-any
id?: string) {
return new XQW.DeleteRecord(entityPicker, id);
}
@@ -168,8 +169,9 @@ namespace XrmQuery {
/**
* @internal
*/
- export function request(type: XQW.HttpRequestType, url: string, data: any, successCb: (x: XMLHttpRequest) => any, errorCb: (err: Error) => any = () => { }, preSend?: (req: XMLHttpRequest) => void, sync: boolean = false) {
- let req = new XMLHttpRequest();
+ //eslint-disable-next-line @typescript-eslint/no-explicit-any
+ export function request(type: XQW.HttpRequestType, url: string, data: any, successCb: (x: XMLHttpRequest) => any, errorCb: (err: Error) => any = () => { /* */ }, preSend?: (req: XMLHttpRequest) => void, sync = false) {
+ const req = new XMLHttpRequest();
req.open(type, url, !sync);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
@@ -179,7 +181,7 @@ namespace XrmQuery {
req.onreadystatechange = function (this) {
if (this.readyState == 4) {
- req.onreadystatechange = null;
+ req.onreadystatechange = null; //eslint-disable-line @typescript-eslint/no-explicit-any
if (this.status == 200 || this.status == 204) successCb(this);
else errorCb(new Error(this.response));
}
@@ -196,6 +198,7 @@ namespace XrmQuery {
* @param errorCb Error callback handler function
* @param configure Modify the request before it it sent to the endpoint - like adding headers.
*/
+ //eslint-disable-next-line @typescript-eslint/no-explicit-any
export function sendRequest(type: XQW.HttpRequestType, queryString: string, data: any, successCb: (x: XMLHttpRequest) => any, errorCb?: (err: Error) => any, configure?: (req: XMLHttpRequest) => void, sync?: boolean): void {
request(type, encodeSpaces(XQW.getApiUrl() + queryString), data, successCb, errorCb, configure, sync);
}
@@ -207,10 +210,12 @@ namespace XrmQuery {
* @param data Object to send with request
* @param configure Modify the request before it it sent to the endpoint - like adding headers.
*/
+ //eslint-disable-next-line @typescript-eslint/no-explicit-any
export function promiseRequest(type: XQW.HttpRequestType, queryString: string, data: any, configure?: (req: XMLHttpRequest) => void): Promise {
return XQW.promisifyCallback((success, error?) => sendRequest(type, queryString, data, success, error, configure));
}
+ // eslint-disable-next-line no-inner-declarations
function encodeSpaces(str: string): string {
return str.replace(/ /g, "%20");
}
@@ -244,7 +249,7 @@ namespace Filter {
return biFilter(f1, "or", f2);
}
export function not(f1: WebFilter): WebFilter {
- return ("not " + f1);
+ return ("not " + f1); //eslint-disable-line @typescript-eslint/no-explicit-any
}
export function ands(fs: WebFilter[]): WebFilter {
@@ -268,12 +273,13 @@ namespace Filter {
* Makes a string into a GUID that can be sent to the OData source
*/
export function makeGuid(id: string): XQW.Guid {
- return XQW.makeTag(XQW.stripGUID(id));
+ return XQW.makeTag(XQW.stripGUID(id)); //eslint-disable-line @typescript-eslint/no-explicit-any
}
/**
* @internal
*/
+ //eslint-disable-next-line no-inner-declarations, @typescript-eslint/no-explicit-any
function getVal(v: any) {
if (v == null) return "null";
if (typeof v === "string") return `'${encodeSpecialCharacters(v)}'`;
@@ -284,31 +290,35 @@ namespace Filter {
/**
* @internal
*/
+ //eslint-disable-next-line no-inner-declarations
function comp(val1: T, op: string, val2: T): WebFilter {
- return (`${getVal(val1)} ${op} ${getVal(val2)}`);
+ return (`${getVal(val1)} ${op} ${getVal(val2)}`); //eslint-disable-line @typescript-eslint/no-explicit-any
}
/**
* @internal
*/
+ //eslint-disable-next-line no-inner-declarations
function dataFunc(funcName: string, val1: T, val2: T): WebFilter {
- return (`${funcName}(${getVal(val1)}, ${getVal(val2)})`);
+ return (`${funcName}(${getVal(val1)}, ${getVal(val2)})`); //eslint-disable-line @typescript-eslint/no-explicit-any
}
/**
* @internal
*/
+ //eslint-disable-next-line no-inner-declarations
function biFilter(f1: WebFilter, conj: string, f2: WebFilter): WebFilter {
- return (`(${f1} ${conj} ${f2})`);
+ return (`(${f1} ${conj} ${f2})`); //eslint-disable-line @typescript-eslint/no-explicit-any
}
/**
* @internal
*/
+ //eslint-disable-next-line no-inner-declarations
function nestedFilter(fs: WebFilter[], conj: string): WebFilter {
const last = fs.pop();
if (last === undefined) {
- return ("");
+ return (""); //eslint-disable-line @typescript-eslint/no-explicit-any
}
return fs.reduceRight((acc, c) => biFilter(c, conj, acc), last);
}
@@ -317,6 +327,7 @@ namespace Filter {
* @internal
* // TODO could this be fix to password problem by adding &qout instead of "''" below?
*/
+ //eslint-disable-next-line no-inner-declarations
function encodeSpecialCharacters(queryString: string) {
return encodeURI(queryString)
.replace(/'/g, "''")
@@ -328,13 +339,13 @@ namespace Filter {
}
}
-interface WebEntitiesRetrieve {}
-interface WebEntitiesRelated {}
-interface WebEntitiesCUDA {}
+interface WebEntitiesRetrieve {} //eslint-disable-line @typescript-eslint/no-empty-interface
+interface WebEntitiesRelated {} //eslint-disable-line @typescript-eslint/no-empty-interface
+interface WebEntitiesCUDA {} //eslint-disable-line @typescript-eslint/no-empty-interface
-declare var GetGlobalContext: any;
+declare let GetGlobalContext: any; //eslint-disable-line @typescript-eslint/no-explicit-any
-interface WebMappingRetrieve {
+interface WebMappingRetrieve { //eslint-disable-line @typescript-eslint/no-unused-vars
__WebMappingRetrieve: ISelect;
}
@@ -346,16 +357,16 @@ interface WebMappingRelated {
__WebMappingRelated: ISingle & IMultiple;
}
-interface WebAttribute {
+interface WebAttribute { //eslint-disable-line @typescript-eslint/no-unused-vars
__WebAttribute: ISelect;
}
-interface WebExpand {
+interface WebExpand { //eslint-disable-line @typescript-eslint/no-unused-vars
__WebExpandable: IExpand;
}
interface WebFilter {
- __WebFilter: any;
+ __WebFilter: any; //eslint-disable-line @typescript-eslint/no-explicit-any
}
interface ExplicitQuery {
@@ -376,7 +387,7 @@ const enum SortOrder {
interface ExpandOptions {
filter?: (f: IFilter) => WebFilter;
top?: number;
- orderBy?: (s: ISelect) => WebAttribute;
+ orderBy?: (s: ISelect) => WebAttribute; //eslint-disable-line @typescript-eslint/no-explicit-any
sortOrder?: SortOrder;
}
@@ -407,22 +418,26 @@ namespace XQW {
}
export interface Guid {
- __XqwGuid: any;
+ __XqwGuid: any; //eslint-disable-line @typescript-eslint/no-explicit-any
}
export function makeTag(name: string) {
return { __str: name, toString: function () { return this.__str; } };
}
+ //eslint-disable-next-line no-inner-declarations
function endsWith(str: string, suffix: string) {
return str.substr(-suffix.length) == suffix;
}
+ //eslint-disable-next-line no-inner-declarations
function beginsWith(str: string, prefix: string) {
return str.substr(0, prefix.length) == prefix;
}
const datePattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;
+
+ //eslint-disable-next-line no-inner-declarations, @typescript-eslint/no-explicit-any
function reviver(name: string, value: any) {
if (datePattern.test(value)) return new Date(value);
let newName = name;
@@ -466,14 +481,17 @@ namespace XQW {
else return guid;
}
+ //eslint-disable-next-line no-inner-declarations
function parseRetrievedData(req: XMLHttpRequest): T {
return JSON.parse(req.response, reviver);
}
+ //eslint-disable-next-line no-inner-declarations, @typescript-eslint/no-explicit-any
function isStringArray(arr: any[] | string[]): arr is string[] {
return arr.length > 0 && typeof arr[0] === "string";
}
+ //eslint-disable-next-line @typescript-eslint/no-explicit-any
export function promisifyCallback(callbackFunc: (success: (t: T) => any, errorCb?: (e: Error) => any) => any): Promise {
if (!Promise) throw new Error("Promises are not natively supported in this browser. Add a polyfill to use it.");
return new Promise((resolve, reject) => {
@@ -482,7 +500,7 @@ namespace XQW {
}
interface MultiResult {
- value: any[];
+ value: any[]; //eslint-disable-line @typescript-eslint/no-explicit-any
"@odata.nextLink": string;
}
@@ -500,12 +518,14 @@ namespace XQW {
private isDoneSending = false;
private isDoingWork = false;
- constructor(protected toReturn: any, private successCallback: Function, protected errorCallback: (e: Error) => any) { }
+ //eslint-disable-next-line @typescript-eslint/no-explicit-any
+ constructor(protected toReturn: any, private successCallback: (param: any) => any, protected errorCallback: (e: Error) => any) { }
+ //eslint-disable-next-line @typescript-eslint/no-explicit-any
protected followLink(linkUrl: string, expandKeys: ExpandKey[], additionalHeaders: RequestHeader[], valPlacer: (vs: any[]) => void) {
this.performingCallback();
XrmQuery.request("GET", linkUrl, null, (req) => {
- let resp = parseRetrievedData(req);
+ const resp = parseRetrievedData