eservices-core 1.0.590 → 1.0.592
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.
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { MetadataResponse } from "./../index";
|
|
2
2
|
export default class metadataService {
|
|
3
|
-
private static url;
|
|
3
|
+
private static get url();
|
|
4
4
|
static get(entity: string, criteria?: string, id?: any): Promise<MetadataResponse>;
|
|
5
5
|
static getById(entity: string, id: any): Promise<MetadataResponse>;
|
|
6
|
+
static getByMaster(entity: string, masterEntities: {
|
|
7
|
+
entity: string;
|
|
8
|
+
id: number;
|
|
9
|
+
}[]): Promise<unknown>;
|
|
6
10
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* eservices-core v1.0.
|
|
2
|
+
* eservices-core v1.0.592
|
|
3
3
|
* (c) 2023 ESERVICES
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -5084,8 +5084,8 @@ class processWizardService {
|
|
|
5084
5084
|
processWizardService.url = '/close-api/views/process-wizard';
|
|
5085
5085
|
|
|
5086
5086
|
class metadataService {
|
|
5087
|
-
static url() {
|
|
5088
|
-
return `/close-api/metadata
|
|
5087
|
+
static get url() {
|
|
5088
|
+
return `/close-api/metadata`;
|
|
5089
5089
|
}
|
|
5090
5090
|
static get(entity, criteria, id) {
|
|
5091
5091
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -5094,13 +5094,17 @@ class metadataService {
|
|
|
5094
5094
|
query.append('criteria', criteria);
|
|
5095
5095
|
if (id)
|
|
5096
5096
|
query.append('id', String(id));
|
|
5097
|
-
return yield fetch(this.url
|
|
5097
|
+
return yield fetch(this.url + `/${entity}?${query.toString()}`, {
|
|
5098
5098
|
method: "GET",
|
|
5099
5099
|
}).then(res => res.json());
|
|
5100
5100
|
});
|
|
5101
5101
|
}
|
|
5102
5102
|
static getById(entity, id) {
|
|
5103
|
-
return Request(this.url
|
|
5103
|
+
return Request([this.url, entity, id].join('/'));
|
|
5104
|
+
}
|
|
5105
|
+
static getByMaster(entity, masterEntities) {
|
|
5106
|
+
const query = new URLSearchParams(masterEntities.map(config => [config.entity, String(config.id)]));
|
|
5107
|
+
return Request([this.url, 'by-master', entity].join('/') + `?${query.toString()}`);
|
|
5104
5108
|
}
|
|
5105
5109
|
}
|
|
5106
5110
|
|