@newageerp/mp-types
Advanced tools
Comparing version 1.0.24 to 1.0.25
@@ -127,2 +127,22 @@ type MpAggregateFunction = 'max' | 'min' | 'sum' | 'count' | 'countDistinct' | 'sumPercent' | 'countPercent' | 'countDistinctPercent' | 'cr'; | ||
export type { MpAggregateColumn, MpAggregateFunction, MpChartSettings, MpFilterAllTypes, MpFilterCommonTypes, MpFilterDateTypes, MpFilterFactoryAdvancedFilterItem, MpFilterFactoryItem, MpFilterFactorySetItemsOnly, MpFilterFactorySetUniversalItem, MpFilterNumberTypes, MpFilterStorageListRequest, MpFilterStorageListResponse, MpFilterStorageListResponseData, MpFilterStorageRemoveRequest, MpFilterStorageSaveRequest, MpFilterStringTypes, MpInfoColumnAllDataType, MpInfoColumnDataTypeDate, MpInfoColumnDataTypeNumber, MpInfoColumnDataTypeText, MpInfoRequestResponse, MpInfoRequestResponseColumn, MpOrderColumn, MpPivotLocalSortItem, MpPivotLocalSortItemDirection, MpPivotSettings, MpSelectRequestResponse, MpSelectRequestResponseSql }; | ||
type AuthOptions = { | ||
baseUrl: string; | ||
authKey: string; | ||
}; | ||
type InsertRequestBody = { | ||
table: string; | ||
data: any; | ||
}; | ||
type InsertRequestParams = { | ||
database: string; | ||
options?: AuthOptions; | ||
} & InsertRequestBody; | ||
declare const _default: { | ||
insert: { | ||
do: (props: InsertRequestParams) => 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 }; |
@@ -6,2 +6,6 @@ "use strict"; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
@@ -16,6 +20,57 @@ if (from && typeof from === "object" || typeof from === "function") { | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var __async = (__this, __arguments, generator) => { | ||
return new Promise((resolve, reject) => { | ||
var fulfilled = (value) => { | ||
try { | ||
step(generator.next(value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
}; | ||
var rejected = (value) => { | ||
try { | ||
step(generator.throw(value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
}; | ||
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); | ||
step((generator = generator.apply(__this, __arguments)).next()); | ||
}); | ||
}; | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
requests: () => requests_default | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
// src/requests/insert-request.ts | ||
var doInsert = (props) => __async(void 0, null, function* () { | ||
const insertParams = { table: props.table, data: props.data }; | ||
const insertUrl = `${props.options ? props.options.baseUrl : process.env.MP_URL}/database/${props.database}/insert`; | ||
const res = yield fetch(insertUrl, { | ||
method: "POST", | ||
body: JSON.stringify(insertParams), | ||
headers: { | ||
"Authorization": `Bearer ${props.options ? props.options.authKey : process.env.MP_KEY}`, | ||
"Content-Type": "application/json" | ||
} | ||
}); | ||
const resJson = yield res.json(); | ||
return resJson; | ||
}); | ||
// src/requests/index.ts | ||
var insert = { | ||
do: doInsert | ||
}; | ||
var requests_default = { | ||
insert | ||
}; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
requests | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@newageerp/mp-types", | ||
"version": "1.0.24", | ||
"version": "1.0.25", | ||
"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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
20076
252
2