@contrail/flexplm 1.1.20 → 1.1.21

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.
@@ -110,7 +110,7 @@ class BaseEntityProcessor {
110
110
  entityName: entityName,
111
111
  object: changes,
112
112
  };
113
- console.log("options: " + JSON.stringify(options));
113
+ console.log("createEntity: " + JSON.stringify(options));
114
114
  return await new sdk_1.Entities().create(options);
115
115
  }
116
116
  async updateEntity(entityName, entity, diffs) {
@@ -119,7 +119,7 @@ class BaseEntityProcessor {
119
119
  id: entity['id'],
120
120
  object: diffs
121
121
  };
122
- console.log('options: ' + JSON.stringify(options));
122
+ console.log('updateEntity: ' + JSON.stringify(options));
123
123
  return await new sdk_1.Entities().update(options);
124
124
  }
125
125
  async outbound(event) {
@@ -344,6 +344,7 @@ class DataConverter {
344
344
  let userOrg = undefined;
345
345
  let count = 0;
346
346
  let size = 0;
347
+ let emailInput = nd?.email.toLowerCase();
347
348
  const entities = new sdk_1.Entities();
348
349
  const getOptionsCriteria = {
349
350
  entityName: 'user-org',
@@ -351,7 +352,7 @@ class DataConverter {
351
352
  };
352
353
  do {
353
354
  const userBatch = await entities.get(getOptionsCriteria);
354
- userOrg = userBatch.find(uo => uo?.userEmail === nd?.email);
355
+ userOrg = userBatch.find(uo => uo?.userEmail.toLowerCase() === emailInput);
355
356
  } while (!userOrg && size == getOptionsCriteria.take && count < 15);
356
357
  return userOrg?.user;
357
358
  }
@@ -1,5 +1,7 @@
1
1
  export declare class TypeDefaults {
2
2
  static NO_ENTITY_TYPE: string;
3
+ static NO_OBJECT_CLASS: string;
4
+ static NO_TYPE_PATH: string;
3
5
  constructor();
4
6
  static getDefaultObjectClass(entity: any): string;
5
7
  static getDefaultObjectTypePath(entity: any): string;
@@ -142,6 +142,8 @@ class TypeDefaults {
142
142
  else if (['LCSRevisableEntity', 'LCSLifecycleManaged', 'LCSLast', 'LCSMaterial'].includes(objectClass)) {
143
143
  entityClass = 'custom-entity';
144
144
  }
145
+ if (entityClass === '')
146
+ throw Error(TypeDefaults.NO_OBJECT_CLASS);
145
147
  return entityClass;
146
148
  }
147
149
  static getDefaultEntityTypePath(object) {
@@ -158,6 +160,8 @@ class TypeDefaults {
158
160
  typePath = 'color';
159
161
  break;
160
162
  }
163
+ if (typePath === '')
164
+ throw Error(TypeDefaults.NO_TYPE_PATH);
161
165
  return typePath;
162
166
  }
163
167
  static getDefaultIdentifierPropertiesFromObject(object) {
@@ -204,3 +208,5 @@ class TypeDefaults {
204
208
  }
205
209
  exports.TypeDefaults = TypeDefaults;
206
210
  TypeDefaults.NO_ENTITY_TYPE = 'Not able to determine the entity type of the entity object';
211
+ TypeDefaults.NO_OBJECT_CLASS = 'Please ensure that the flexPLMObjectClass property is provided.';
212
+ TypeDefaults.NO_TYPE_PATH = 'Please ensure that the flexPLMTypePath property is provided.';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/flexplm",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "description": "Library used for integration with flexplm.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -142,7 +142,7 @@ export abstract class BaseEntityProcessor {
142
142
  entityName: entityName,
143
143
  object: changes,
144
144
  };
145
- console.log("options: " + JSON.stringify(options));
145
+ console.log("createEntity: " + JSON.stringify(options));
146
146
 
147
147
  return await new Entities().create(options);
148
148
  }
@@ -153,7 +153,7 @@ export abstract class BaseEntityProcessor {
153
153
  id: entity['id'],
154
154
  object: diffs
155
155
  };
156
- console.log('options: ' + JSON.stringify(options));
156
+ console.log('updateEntity: ' + JSON.stringify(options));
157
157
 
158
158
  return await new Entities().update(options);
159
159
  }
@@ -437,6 +437,8 @@ export class DataConverter {
437
437
  let userOrg = undefined;
438
438
  let count =0;
439
439
  let size = 0;
440
+ let emailInput = nd?.email.toLowerCase();
441
+
440
442
  const entities = new Entities();
441
443
  const getOptionsCriteria = {
442
444
  entityName: 'user-org',
@@ -445,7 +447,7 @@ export class DataConverter {
445
447
 
446
448
  do {
447
449
  const userBatch: [any] = await entities.get(getOptionsCriteria);
448
- userOrg = userBatch.find(uo => uo?.userEmail === nd?.email);
450
+ userOrg = userBatch.find(uo => uo?.userEmail.toLowerCase() === emailInput);
449
451
 
450
452
  }while( !userOrg && size == getOptionsCriteria.take && count < 15);
451
453
  return userOrg?.user
@@ -1,8 +1,7 @@
1
- import { MapFileUtil } from "@contrail/transform-data";
2
-
3
-
4
1
  export class TypeDefaults {
5
2
  static NO_ENTITY_TYPE = 'Not able to determine the entity type of the entity object';
3
+ static NO_OBJECT_CLASS = 'Please ensure that the flexPLMObjectClass property is provided.';
4
+ static NO_TYPE_PATH = 'Please ensure that the flexPLMTypePath property is provided.';
6
5
  constructor() {
7
6
  }
8
7
  /**Takes in full entity and returs the default FlexPLM
@@ -179,6 +178,9 @@ export class TypeDefaults {
179
178
  entityClass = 'custom-entity';
180
179
  }
181
180
 
181
+ if(entityClass === '')
182
+ throw Error(TypeDefaults.NO_OBJECT_CLASS);
183
+
182
184
  return entityClass;
183
185
  }
184
186
 
@@ -203,6 +205,10 @@ export class TypeDefaults {
203
205
  typePath = 'color';
204
206
  break;
205
207
  }
208
+
209
+ if(typePath === '')
210
+ throw Error(TypeDefaults.NO_TYPE_PATH);
211
+
206
212
  return typePath;
207
213
  }
208
214