@contrail/flexplm 1.8.0-alpha.7427c41 → 1.8.0-alpha.8d94feb

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.
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
- Core model for contrail, which establishes the base peristence services (without dependency on a persistence implementaiton) and core NestJS elements such as the InvocationContext.
1
+ Core model for contrail, which establishes the base persistence services (without dependency on a persistence implementaiton) and core NestJS elements such as the InvocationContext.
2
2
 
3
3
  ## LCSCountry defaults
4
4
  `LCSCountry` <-> VibeIQ `custom-entity:country` works with built-in defaults for the type mapping. The built-in conventions are:
5
5
 
6
6
  | Item | Default |
7
7
  |---|---|
8
- | VibeIQ type path | `custom-entity:country` (case-insensitive) |
8
+ | VibeIQ type path | `custom-entity:country` (exact, lowercase; matched case-sensitively in both directions) |
9
9
  | FlexPLM class / type path | `LCSCountry` / `Country` |
10
10
  | Identifier property | `vibeIQIdentifier` (same key in both systems; no rekey runs without a mapping) |
11
11
  | Informational property | `name` |
@@ -20,7 +20,7 @@ export declare class TypeDefaults {
20
20
  static applyConfig(config: any): void;
21
21
  static isPropertyTrue(value: any): boolean;
22
22
  /** True when the VibeIQ entity is a Country: a custom-entity whose typePath is
23
- * 'custom-entity:country' (compared case-insensitively).
23
+ * exactly 'custom-entity:country' (compared case-sensitively, as on inbound).
24
24
  *
25
25
  * @param entity VibeIQ entity
26
26
  * @returns boolean
@@ -19,14 +19,14 @@ class TypeDefaults {
19
19
  return value === true || (typeof value === 'string' && value.toLowerCase() === 'true');
20
20
  }
21
21
  /** True when the VibeIQ entity is a Country: a custom-entity whose typePath is
22
- * 'custom-entity:country' (compared case-insensitively).
22
+ * exactly 'custom-entity:country' (compared case-sensitively, as on inbound).
23
23
  *
24
24
  * @param entity VibeIQ entity
25
25
  * @returns boolean
26
26
  */
27
27
  static isCountryEntity(entity) {
28
28
  const typePath = entity?.['typePath'];
29
- return typeof typePath === 'string' && typePath.toLowerCase() === TypeDefaults.COUNTRY_VIBE_TYPE_PATH;
29
+ return typeof typePath === 'string' && typePath === TypeDefaults.COUNTRY_VIBE_TYPE_PATH;
30
30
  }
31
31
  /**Takes in full entity and returs the default FlexPLM
32
32
  * object class.
@@ -50,12 +50,12 @@ describe('Type Defaults', () => {
50
50
  const objectClass = type_defaults_1.TypeDefaults.getDefaultObjectClass(newData);
51
51
  expect(objectClass).toEqual('LCSCountry');
52
52
  });
53
- it('should return LCSCountry when the Country typePath uses different casing', () => {
53
+ it('should return LCSRevisableEntity when the Country typePath uses different casing', () => {
54
54
  const newData = {
55
55
  entityType: 'custom-entity',
56
56
  typePath: 'custom-entity:Country'
57
57
  };
58
- expect(type_defaults_1.TypeDefaults.getDefaultObjectClass(newData)).toEqual('LCSCountry');
58
+ expect(type_defaults_1.TypeDefaults.getDefaultObjectClass(newData)).toEqual('LCSRevisableEntity');
59
59
  });
60
60
  it('should return LCSRevisableEntity for a custom entity that is not a Country', () => {
61
61
  const newData = {
@@ -347,6 +347,9 @@ describe('Type Defaults', () => {
347
347
  it('should return true for the custom-entity:country type path', () => {
348
348
  expect(type_defaults_1.TypeDefaults.isCountryEntity({ typePath: 'custom-entity:country' })).toBe(true);
349
349
  });
350
+ it('should return false when the typePath differs only in casing', () => {
351
+ expect(type_defaults_1.TypeDefaults.isCountryEntity({ typePath: 'custom-entity:Country' })).toBe(false);
352
+ });
350
353
  it('should return false for another subtype, a missing typePath, or an undefined entity', () => {
351
354
  expect(type_defaults_1.TypeDefaults.isCountryEntity({ typePath: 'custom-entity:other' })).toBe(false);
352
355
  expect(type_defaults_1.TypeDefaults.isCountryEntity({})).toBe(false);
@@ -53,9 +53,9 @@ describe('TypeUtils.getEventObjectClass() tests', () => {
53
53
  const objectClass = tu.getEventObjectClass(entityType, newData);
54
54
  expect(objectClass).toEqual('LCSCountry');
55
55
  });
56
- it('should return LCSCountry when the Country typePath uses different casing', () => {
56
+ it('should return LCSRevisableEntity when the Country typePath uses different casing', () => {
57
57
  const objectClass = tu.getEventObjectClass('custom-entity', { typePath: 'custom-entity:Country' });
58
- expect(objectClass).toEqual('LCSCountry');
58
+ expect(objectClass).toEqual('LCSRevisableEntity');
59
59
  });
60
60
  it('should return LCSRevisableEntity for a custom entity that is not a Country', () => {
61
61
  const objectClass = tu.getEventObjectClass('custom-entity', { typePath: 'custom-entity:exchangeRate' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/flexplm",
3
- "version": "1.8.0-alpha.7427c41",
3
+ "version": "1.8.0-alpha.8d94feb",
4
4
  "description": "Library used for integration with flexplm.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",