@contrail/flexplm 1.1.46 → 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.
@@ -166,4 +166,30 @@ export class FlexPLMConnect {
166
166
  async sendMultipleToFlexPLM(payload: PayloadType[]){
167
167
  return await this.processRequest(payload);
168
168
  }
169
+
170
+ /** Runs a get request to FlexPLM using the endpoint provided in the constructor
171
+ *
172
+ */
173
+ async getRequest(){
174
+ const urlContext = this.config.urlContext;
175
+ const vibeEventsURL: string = this.config.apiHost + urlContext + '/servlet/rest' + this.vibeEventEndpoint;
176
+ const csrfOptions = this.getRequestOptions('GET');
177
+ const response = await fetch(vibeEventsURL, csrfOptions);
178
+
179
+ if(response.status >= 300){
180
+ const message = 'Error connecting to FlexPLM:status: ' + response.status;
181
+ console.error(message);
182
+ console.error(await response.text());
183
+ throw new Error(message);
184
+ }
185
+ try {
186
+ const data = await response.json();
187
+ return data;
188
+ } catch(e){
189
+ const message = 'Error getting json data from FlexPLM: ' + e.message;
190
+ console.error(message);
191
+ console.error(await response.text());
192
+ throw new Error(message);
193
+ }
194
+ }
169
195
  }
@@ -23,11 +23,12 @@ export class TypeUtils {
23
23
  return type;
24
24
  }
25
25
 
26
+ /** Deprecated: use TypeConversionUtils.getObjectTypePath() */
26
27
  static getFlexPLMTypePath(entity) {
27
28
  return entity['flexPLMTypePath'] || entity['flexTypePath'] || '';
28
29
  }
29
30
 
30
- /** Gets the FlexPLM class for the entity data
31
+ /** Deprecated: use TypeConversionUtils.getObjectClass()
31
32
  *
32
33
  * @param entityType
33
34
  * @param newData