Jelajahi Sumber

[frontend] Fix API related types

Johan Ahlen 5 tahun lalu
induk
melakukan
04681e40ea

+ 4 - 4
desktop/core/src/desktop/js/api/apiHelper.js

@@ -1916,11 +1916,11 @@ class ApiHelper {
    * @param {Object} options
    * @param {string} options.identity - The identifier for the Navigator entity to update
    * @param {Object} [options.properties]
-   * @param {Object} [options.modifiedCustomMetadata]
-   * @param {string[]} [options.deletedCustomMetadataKeys]
+   * @param {Object.<string|string>|undefined} [options.modifiedCustomMetadata]
+   * @param {string[]|undefined} [options.deletedCustomMetadataKeys]
    * @param {boolean} [options.silenceErrors]
    *
-   * @return {Promise}
+   * @return {JQueryPromise}
    */
   updateNavigatorProperties(options) {
     const data = { id: ko.mapping.toJSON(options.identity) };
@@ -1941,7 +1941,7 @@ class ApiHelper {
    * Lists all available navigator tags
    *
    * @param {Object} options
-   * @param {boolean} [options.silenceErrors]
+   * @param {boolean|undefined} [options.silenceErrors]
    *
    * @return {CancellableJqPromise}
    */

+ 1 - 1
desktop/core/src/desktop/js/api/apiUtils.js

@@ -116,7 +116,7 @@ export const simpleGet = (url, data, options) => {
  * @param {boolean} [options.silenceErrors]
  * @param {string} [options.dataType] - Default: Intelligent Guess (xml, json, script, text, html)
  *
- * @return {Promise}
+ * @return {JQueryPromise}
  */
 export const simplePost = (url, data, options) => {
   const deferred = $.Deferred();

+ 1 - 0
desktop/core/src/desktop/js/types/config.ts

@@ -100,6 +100,7 @@ export interface Connector extends IdentifiableInterpreter {
   dialect_properties?: {
     sql_identifier_quote?: string;
   };
+  optimizer?: string;
 }
 
 export interface EditorInterpreter extends IdentifiableInterpreter {

+ 3 - 0
desktop/core/src/desktop/js/types/types.ts

@@ -31,11 +31,14 @@ declare global {
 }
 
 export interface hueWindow {
+  CACHEABLE_TTL?: { default?: number; optimizer?: number };
+  HAS_CATALOG?: boolean;
   HAS_OPTIMIZER?: boolean;
   AUTOCOMPLETE_TIMEOUT?: number;
   ENABLE_SQL_SYNTAX_CHECK?: boolean;
   HUE_BASE_URL?: string;
   LOGGED_USERNAME?: string;
+  OPTIMIZER_MODE?: string;
   WEB_SOCKETS_ENABLED?: boolean;
   WS_CHANNEL?: string;
   hueDebug?: HueDebug;