@devtable/dashboard 6.47.0 → 7.1.0

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.
@@ -393,12 +393,14 @@ export declare const tokens: {
393
393
  type: import("../model/queries/types").DataSourceType;
394
394
  key: string;
395
395
  sql: string;
396
+ pre_process: string;
397
+ post_process: string;
396
398
  run_by: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
397
399
  state: "idle" | "loading" | "error";
398
400
  data: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IType<string[] | number[], string[] | number[], string[] | number[]>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<string[] | number[], string[] | number[], string[] | number[]>>, [undefined]>>;
399
401
  error: any;
400
402
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
401
- readonly valid: string;
403
+ readonly valid: boolean;
402
404
  readonly json: {
403
405
  id: string;
404
406
  name: string;
@@ -406,6 +408,8 @@ export declare const tokens: {
406
408
  key: string;
407
409
  sql: string;
408
410
  run_by: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
411
+ pre_process: string;
412
+ post_process: string;
409
413
  };
410
414
  readonly conditionOptions: {
411
415
  label: string;
@@ -419,18 +423,27 @@ export declare const tokens: {
419
423
  context: string[];
420
424
  filters: any[];
421
425
  };
426
+ } & {
427
+ setName(name: string): void;
428
+ setKey(key: string): void;
429
+ setType(type: import("../model/queries/types").DataSourceType): void;
430
+ setSQL(sql: string): void;
431
+ setRunBy(v: string[]): void;
432
+ setPreProcess(v: string): void;
433
+ setPostProcess(v: string): void;
422
434
  } & {
423
435
  readonly formattedSQL: any;
436
+ readonly typedAsSQL: boolean;
437
+ readonly typedAsHTTP: boolean;
438
+ readonly datasource: any;
424
439
  } & {
425
440
  readonly stateMessage: string;
426
441
  } & {
427
442
  controller: AbortController;
428
443
  } & {
429
- setName(name: string): void;
430
- setKey(key: string): void;
431
- setType(type: import("../model/queries/types").DataSourceType): void;
432
- setSQL(sql: string): void;
433
- setRunBy(v: string[]): void;
444
+ runSQL: () => Promise<void>;
445
+ runHTTP: () => Promise<void>;
446
+ } & {
434
447
  fetchData: () => Promise<void>;
435
448
  beforeDestroy(): void;
436
449
  } & {
@@ -441,13 +454,15 @@ export declare const tokens: {
441
454
  type: import("mobx-state-tree").ISimpleType<import("../model/queries/types").DataSourceType>;
442
455
  key: import("mobx-state-tree").ISimpleType<string>;
443
456
  sql: import("mobx-state-tree").ISimpleType<string>;
457
+ pre_process: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
458
+ post_process: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
444
459
  run_by: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
445
460
  } & {
446
461
  state: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"idle" | "loading" | "error">, [undefined]>;
447
462
  data: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<string[] | number[], string[] | number[], string[] | number[]>>, [undefined]>;
448
463
  error: import("mobx-state-tree").IType<any, any, any>;
449
464
  }, {
450
- readonly valid: string;
465
+ readonly valid: boolean;
451
466
  readonly json: {
452
467
  id: string;
453
468
  name: string;
@@ -455,6 +470,8 @@ export declare const tokens: {
455
470
  key: string;
456
471
  sql: string;
457
472
  run_by: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
473
+ pre_process: string;
474
+ post_process: string;
458
475
  };
459
476
  readonly conditionOptions: {
460
477
  label: string;
@@ -468,18 +485,27 @@ export declare const tokens: {
468
485
  context: string[];
469
486
  filters: any[];
470
487
  };
488
+ } & {
489
+ setName(name: string): void;
490
+ setKey(key: string): void;
491
+ setType(type: import("../model/queries/types").DataSourceType): void;
492
+ setSQL(sql: string): void;
493
+ setRunBy(v: string[]): void;
494
+ setPreProcess(v: string): void;
495
+ setPostProcess(v: string): void;
471
496
  } & {
472
497
  readonly formattedSQL: any;
498
+ readonly typedAsSQL: boolean;
499
+ readonly typedAsHTTP: boolean;
500
+ readonly datasource: any;
473
501
  } & {
474
502
  readonly stateMessage: string;
475
503
  } & {
476
504
  controller: AbortController;
477
505
  } & {
478
- setName(name: string): void;
479
- setKey(key: string): void;
480
- setType(type: import("../model/queries/types").DataSourceType): void;
481
- setSQL(sql: string): void;
482
- setRunBy(v: string[]): void;
506
+ runSQL: () => Promise<void>;
507
+ runHTTP: () => Promise<void>;
508
+ } & {
483
509
  fetchData: () => Promise<void>;
484
510
  beforeDestroy(): void;
485
511
  } & {
@@ -1197,12 +1223,14 @@ export declare const tokens: {
1197
1223
  type: import("../model/queries/types").DataSourceType;
1198
1224
  key: string;
1199
1225
  sql: string;
1226
+ pre_process: string;
1227
+ post_process: string;
1200
1228
  run_by: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
1201
1229
  state: "idle" | "loading" | "error";
1202
1230
  data: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IType<string[] | number[], string[] | number[], string[] | number[]>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<string[] | number[], string[] | number[], string[] | number[]>>, [undefined]>>;
1203
1231
  error: any;
1204
1232
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
1205
- readonly valid: string;
1233
+ readonly valid: boolean;
1206
1234
  readonly json: {
1207
1235
  id: string;
1208
1236
  name: string;
@@ -1210,6 +1238,8 @@ export declare const tokens: {
1210
1238
  key: string;
1211
1239
  sql: string;
1212
1240
  run_by: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
1241
+ pre_process: string;
1242
+ post_process: string;
1213
1243
  };
1214
1244
  readonly conditionOptions: {
1215
1245
  label: string;
@@ -1223,18 +1253,27 @@ export declare const tokens: {
1223
1253
  context: string[];
1224
1254
  filters: any[];
1225
1255
  };
1256
+ } & {
1257
+ setName(name: string): void;
1258
+ setKey(key: string): void;
1259
+ setType(type: import("../model/queries/types").DataSourceType): void;
1260
+ setSQL(sql: string): void;
1261
+ setRunBy(v: string[]): void;
1262
+ setPreProcess(v: string): void;
1263
+ setPostProcess(v: string): void;
1226
1264
  } & {
1227
1265
  readonly formattedSQL: any;
1266
+ readonly typedAsSQL: boolean;
1267
+ readonly typedAsHTTP: boolean;
1268
+ readonly datasource: any;
1228
1269
  } & {
1229
1270
  readonly stateMessage: string;
1230
1271
  } & {
1231
1272
  controller: AbortController;
1232
1273
  } & {
1233
- setName(name: string): void;
1234
- setKey(key: string): void;
1235
- setType(type: import("../model/queries/types").DataSourceType): void;
1236
- setSQL(sql: string): void;
1237
- setRunBy(v: string[]): void;
1274
+ runSQL: () => Promise<void>;
1275
+ runHTTP: () => Promise<void>;
1276
+ } & {
1238
1277
  fetchData: () => Promise<void>;
1239
1278
  beforeDestroy(): void;
1240
1279
  } & {
@@ -1245,13 +1284,15 @@ export declare const tokens: {
1245
1284
  type: import("mobx-state-tree").ISimpleType<import("../model/queries/types").DataSourceType>;
1246
1285
  key: import("mobx-state-tree").ISimpleType<string>;
1247
1286
  sql: import("mobx-state-tree").ISimpleType<string>;
1287
+ pre_process: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1288
+ post_process: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
1248
1289
  run_by: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
1249
1290
  } & {
1250
1291
  state: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<"idle" | "loading" | "error">, [undefined]>;
1251
1292
  data: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<string[] | number[], string[] | number[], string[] | number[]>>, [undefined]>;
1252
1293
  error: import("mobx-state-tree").IType<any, any, any>;
1253
1294
  }, {
1254
- readonly valid: string;
1295
+ readonly valid: boolean;
1255
1296
  readonly json: {
1256
1297
  id: string;
1257
1298
  name: string;
@@ -1259,6 +1300,8 @@ export declare const tokens: {
1259
1300
  key: string;
1260
1301
  sql: string;
1261
1302
  run_by: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").ISimpleType<string>> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>>;
1303
+ pre_process: string;
1304
+ post_process: string;
1262
1305
  };
1263
1306
  readonly conditionOptions: {
1264
1307
  label: string;
@@ -1272,18 +1315,27 @@ export declare const tokens: {
1272
1315
  context: string[];
1273
1316
  filters: any[];
1274
1317
  };
1318
+ } & {
1319
+ setName(name: string): void;
1320
+ setKey(key: string): void;
1321
+ setType(type: import("../model/queries/types").DataSourceType): void;
1322
+ setSQL(sql: string): void;
1323
+ setRunBy(v: string[]): void;
1324
+ setPreProcess(v: string): void;
1325
+ setPostProcess(v: string): void;
1275
1326
  } & {
1276
1327
  readonly formattedSQL: any;
1328
+ readonly typedAsSQL: boolean;
1329
+ readonly typedAsHTTP: boolean;
1330
+ readonly datasource: any;
1277
1331
  } & {
1278
1332
  readonly stateMessage: string;
1279
1333
  } & {
1280
1334
  controller: AbortController;
1281
1335
  } & {
1282
- setName(name: string): void;
1283
- setKey(key: string): void;
1284
- setType(type: import("../model/queries/types").DataSourceType): void;
1285
- setSQL(sql: string): void;
1286
- setRunBy(v: string[]): void;
1336
+ runSQL: () => Promise<void>;
1337
+ runHTTP: () => Promise<void>;
1338
+ } & {
1287
1339
  fetchData: () => Promise<void>;
1288
1340
  beforeDestroy(): void;
1289
1341
  } & {
@@ -0,0 +1,27 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import dayjs from 'dayjs';
3
+ import lodash from 'lodash';
4
+ import numbro from 'numbro';
5
+ import { IDataSource } from '~/api-caller/types';
6
+ import { ContextInfoType, FilterValuesType } from '..';
7
+ import CryptoJS from 'crypto-js';
8
+ export declare const functionUtils: {
9
+ CryptoJS: typeof CryptoJS;
10
+ dayjs: typeof dayjs;
11
+ lodash: lodash.LoDashStatic;
12
+ numbro: typeof numbro;
13
+ };
14
+ export declare function buildHTTPRequest(pre_process: string, params: {
15
+ context: Record<string, any>;
16
+ filters: Record<string, any>;
17
+ }): AxiosRequestConfig<any>;
18
+ export declare function getHTTPReqeustBuilderParams(real_context: ContextInfoType, mock_context: Record<string, $TSFixMe>, filterValues: FilterValuesType): {
19
+ context: {
20
+ [x: string]: any;
21
+ };
22
+ filters: FilterValuesType;
23
+ };
24
+ export declare function explainHTTPRequest(pre_process: string, context: ContextInfoType, mock_context: Record<string, $TSFixMe>, filterValues: FilterValuesType): AxiosRequestConfig<any>;
25
+ export declare function preProcessWithDataSource(datasource: IDataSource, config: AxiosRequestConfig): any;
26
+ export declare function postProcessWithDataSource(datasource: IDataSource, res: any): any;
27
+ export declare function postProcessWithQuery(post_process: TFunctionString, res: any): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtable/dashboard",
3
- "version": "6.47.0",
3
+ "version": "7.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public",