@contrail/flexplm 1.1.47 → 1.1.48
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.
|
@@ -14,4 +14,5 @@ export declare class FlexPLMConnect {
|
|
|
14
14
|
protected processRequest(payload: any): Promise<FlexPLMResponseData>;
|
|
15
15
|
sendToFlexPLM(payload: PayloadType): Promise<FlexPLMResponseData>;
|
|
16
16
|
sendMultipleToFlexPLM(payload: PayloadType[]): Promise<FlexPLMResponseData>;
|
|
17
|
+
getRequest(): Promise<any>;
|
|
17
18
|
}
|
|
@@ -141,5 +141,27 @@ class FlexPLMConnect {
|
|
|
141
141
|
async sendMultipleToFlexPLM(payload) {
|
|
142
142
|
return await this.processRequest(payload);
|
|
143
143
|
}
|
|
144
|
+
async getRequest() {
|
|
145
|
+
const urlContext = this.config.urlContext;
|
|
146
|
+
const vibeEventsURL = this.config.apiHost + urlContext + '/servlet/rest' + this.vibeEventEndpoint;
|
|
147
|
+
const csrfOptions = this.getRequestOptions('GET');
|
|
148
|
+
const response = await fetch(vibeEventsURL, csrfOptions);
|
|
149
|
+
if (response.status >= 300) {
|
|
150
|
+
const message = 'Error connecting to FlexPLM:status: ' + response.status;
|
|
151
|
+
console.error(message);
|
|
152
|
+
console.error(await response.text());
|
|
153
|
+
throw new Error(message);
|
|
154
|
+
}
|
|
155
|
+
try {
|
|
156
|
+
const data = await response.json();
|
|
157
|
+
return data;
|
|
158
|
+
}
|
|
159
|
+
catch (e) {
|
|
160
|
+
const message = 'Error getting json data from FlexPLM: ' + e.message;
|
|
161
|
+
console.error(message);
|
|
162
|
+
console.error(await response.text());
|
|
163
|
+
throw new Error(message);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
144
166
|
}
|
|
145
167
|
exports.FlexPLMConnect = FlexPLMConnect;
|