@newageerp/mp-types
Advanced tools
Comparing version 1.0.25 to 1.0.26
@@ -132,2 +132,9 @@ type MpAggregateFunction = 'max' | 'min' | 'sum' | 'count' | 'countDistinct' | 'sumPercent' | 'countPercent' | 'countDistinctPercent' | 'cr'; | ||
type GetRequestParams = { | ||
dataSource: string; | ||
fields?: string[]; | ||
dataFilter?: MpFilterFactorySetUniversalItem[]; | ||
options?: AuthOptions; | ||
}; | ||
type InsertRequestBody = { | ||
@@ -146,4 +153,7 @@ table: string; | ||
}; | ||
results: { | ||
get: (props: GetRequestParams) => Promise<any>; | ||
}; | ||
}; | ||
export { type MpAggregateColumn, type MpAggregateFunction, type MpChartSettings, type MpFilterAllTypes, type MpFilterCommonTypes, type MpFilterDateTypes, type MpFilterFactoryAdvancedFilterItem, type MpFilterFactoryItem, type MpFilterFactorySetItemsOnly, type MpFilterFactorySetUniversalItem, type MpFilterNumberTypes, type MpFilterStorageListRequest, type MpFilterStorageListResponse, type MpFilterStorageListResponseData, type MpFilterStorageRemoveRequest, type MpFilterStorageSaveRequest, type MpFilterStringTypes, type MpInfoColumnAllDataType, type MpInfoColumnDataTypeDate, type MpInfoColumnDataTypeNumber, type MpInfoColumnDataTypeText, type MpInfoRequestResponse, type MpInfoRequestResponseColumn, type MpOrderColumn, type MpPivotLocalSortItem, type MpPivotLocalSortItemDirection, type MpPivotSettings, type MpSelectRequestResponse, type MpSelectRequestResponseSql, _default as requests }; |
@@ -63,2 +63,16 @@ "use strict"; | ||
// src/requests/get-request.ts | ||
var getResults = (props) => __async(void 0, null, function* () { | ||
let requestUrl = `${props.options ? props.options.baseUrl : process.env.MP_URL}/data-source/${props.dataSource}/results?_t=${(/* @__PURE__ */ new Date()).getTime()}`; | ||
if (props.fields) { | ||
requestUrl += `&fields=${encodeURIComponent(JSON.stringify(props.fields))}`; | ||
} | ||
if (props.dataFilter) { | ||
requestUrl += `&dataFilter=${encodeURIComponent(JSON.stringify(props.dataFilter))}`; | ||
} | ||
const res = yield fetch(requestUrl, { headers: { "Authorization": `Bearer ${process.env.MP_KEY}` } }); | ||
const resJson = yield res.json(); | ||
return resJson; | ||
}); | ||
// src/requests/index.ts | ||
@@ -68,4 +82,8 @@ var insert = { | ||
}; | ||
var results = { | ||
get: getResults | ||
}; | ||
var requests_default = { | ||
insert | ||
insert, | ||
results | ||
}; | ||
@@ -72,0 +90,0 @@ // Annotate the CommonJS export names for ESM import in node: |
{ | ||
"name": "@newageerp/mp-types", | ||
"version": "1.0.25", | ||
"version": "1.0.26", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25071
295
4