@contrail/flexplm 1.3.0-alpha.0 → 1.3.0-alpha.3

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.
Files changed (123) hide show
  1. package/.github/pull_request_template.md +31 -31
  2. package/.github/workflows/flexplm-lib.yml +27 -27
  3. package/CHANGELOG.md +1 -1
  4. package/lib/entity-processor/base-entity-processor.d.ts +42 -0
  5. package/lib/entity-processor/base-entity-processor.js +377 -0
  6. package/lib/entity-processor/base-entity-processor.spec.d.ts +1 -0
  7. package/lib/entity-processor/base-entity-processor.spec.js +426 -0
  8. package/lib/flexplm-request.d.ts +3 -0
  9. package/lib/flexplm-request.js +34 -0
  10. package/lib/flexplm-utils.d.ts +5 -0
  11. package/lib/flexplm-utils.js +33 -0
  12. package/lib/flexplm-utils.spec.d.ts +1 -0
  13. package/lib/flexplm-utils.spec.js +26 -0
  14. package/lib/index.d.ts +22 -0
  15. package/lib/index.js +38 -0
  16. package/lib/interfaces/interfaces.d.ts +105 -0
  17. package/lib/interfaces/interfaces.js +2 -0
  18. package/lib/interfaces/item-family-changes.d.ts +20 -0
  19. package/lib/interfaces/item-family-changes.js +56 -0
  20. package/lib/interfaces/publish-change-data.d.ts +19 -0
  21. package/lib/interfaces/publish-change-data.js +32 -0
  22. package/lib/publish/base-process-publish-assortment-callback.d.ts +9 -0
  23. package/lib/publish/base-process-publish-assortment-callback.js +38 -0
  24. package/lib/publish/base-process-publish-assortment.d.ts +93 -0
  25. package/lib/publish/base-process-publish-assortment.js +944 -0
  26. package/lib/publish/base-process-publish-assortment.spec.d.ts +1 -0
  27. package/lib/publish/base-process-publish-assortment.spec.js +1670 -0
  28. package/lib/publish/mockData.d.ts +1389 -0
  29. package/lib/publish/mockData.js +4519 -0
  30. package/lib/transform/identifier-conversion-spec-mockData.d.ts +0 -0
  31. package/lib/transform/identifier-conversion-spec-mockData.js +444 -0
  32. package/lib/transform/identifier-conversion.d.ts +15 -0
  33. package/lib/transform/identifier-conversion.js +212 -0
  34. package/lib/transform/identifier-conversion.spec.d.ts +1 -0
  35. package/lib/transform/identifier-conversion.spec.js +339 -0
  36. package/lib/util/config-defaults.d.ts +8 -0
  37. package/lib/util/config-defaults.js +85 -0
  38. package/lib/util/config-defaults.spec.d.ts +1 -0
  39. package/lib/util/config-defaults.spec.js +293 -0
  40. package/lib/util/data-converter-spec-mockData.d.ts +0 -0
  41. package/lib/util/data-converter-spec-mockData.js +205 -0
  42. package/lib/util/data-converter.d.ts +39 -0
  43. package/lib/util/data-converter.js +592 -0
  44. package/lib/util/data-converter.spec.d.ts +1 -0
  45. package/lib/util/data-converter.spec.js +904 -0
  46. package/lib/util/error-response-object.d.ts +4 -0
  47. package/lib/util/error-response-object.js +47 -0
  48. package/lib/util/error-response-object.spec.d.ts +1 -0
  49. package/lib/util/error-response-object.spec.js +99 -0
  50. package/lib/util/event-short-message-status.d.ts +18 -0
  51. package/lib/util/event-short-message-status.js +22 -0
  52. package/lib/util/federation.d.ts +15 -0
  53. package/lib/util/federation.js +149 -0
  54. package/lib/util/flexplm-connect.d.ts +22 -0
  55. package/lib/util/flexplm-connect.js +176 -0
  56. package/lib/util/flexplm-connect.spec.d.ts +1 -0
  57. package/lib/util/flexplm-connect.spec.js +88 -0
  58. package/lib/util/logger-config.d.ts +1 -0
  59. package/lib/util/logger-config.js +26 -0
  60. package/lib/util/map-util-spec-mockData.d.ts +0 -0
  61. package/lib/util/map-util-spec-mockData.js +205 -0
  62. package/lib/util/map-utils.d.ts +6 -0
  63. package/lib/util/map-utils.js +15 -0
  64. package/lib/util/map-utils.spec.d.ts +1 -0
  65. package/lib/util/map-utils.spec.js +89 -0
  66. package/lib/util/mockData.d.ts +79 -0
  67. package/lib/util/mockData.js +99 -0
  68. package/lib/util/thumbnail-util.d.ts +28 -0
  69. package/lib/util/thumbnail-util.js +202 -0
  70. package/lib/util/thumbnail-util.spec.d.ts +1 -0
  71. package/lib/util/thumbnail-util.spec.js +398 -0
  72. package/lib/util/type-conversion-utils-spec-mockData.d.ts +0 -0
  73. package/lib/util/type-conversion-utils-spec-mockData.js +259 -0
  74. package/lib/util/type-conversion-utils.d.ts +23 -0
  75. package/lib/util/type-conversion-utils.js +266 -0
  76. package/lib/util/type-conversion-utils.spec.d.ts +1 -0
  77. package/lib/util/type-conversion-utils.spec.js +868 -0
  78. package/lib/util/type-defaults.d.ts +16 -0
  79. package/lib/util/type-defaults.js +221 -0
  80. package/lib/util/type-defaults.spec.d.ts +1 -0
  81. package/lib/util/type-defaults.spec.js +516 -0
  82. package/lib/util/type-utils.d.ts +13 -0
  83. package/lib/util/type-utils.js +114 -0
  84. package/lib/util/type-utils.spec.d.ts +1 -0
  85. package/lib/util/type-utils.spec.js +190 -0
  86. package/package.json +1 -1
  87. package/publish.bat +4 -4
  88. package/publish.sh +4 -4
  89. package/src/entity-processor/base-entity-processor.spec.ts +157 -0
  90. package/src/entity-processor/base-entity-processor.ts +21 -2
  91. package/src/flexplm-request.ts +28 -28
  92. package/src/flexplm-utils.spec.ts +27 -27
  93. package/src/flexplm-utils.ts +29 -29
  94. package/src/index.ts +21 -21
  95. package/src/interfaces/item-family-changes.ts +66 -66
  96. package/src/interfaces/publish-change-data.ts +42 -42
  97. package/src/publish/base-process-publish-assortment-callback.ts +50 -50
  98. package/src/transform/identifier-conversion-spec-mockData.ts +495 -495
  99. package/src/transform/identifier-conversion.spec.ts +353 -353
  100. package/src/transform/identifier-conversion.ts +281 -281
  101. package/src/util/config-defaults.spec.ts +350 -350
  102. package/src/util/config-defaults.ts +92 -92
  103. package/src/util/data-converter-spec-mockData.ts +230 -230
  104. package/src/util/error-response-object.spec.ts +115 -115
  105. package/src/util/error-response-object.ts +49 -49
  106. package/src/util/federation.ts +172 -172
  107. package/src/util/logger-config.ts +19 -19
  108. package/src/util/map-util-spec-mockData.ts +230 -230
  109. package/src/util/map-utils.spec.ts +102 -102
  110. package/src/util/map-utils.ts +40 -40
  111. package/src/util/mockData.ts +97 -97
  112. package/src/util/thumbnail-util.spec.ts +190 -0
  113. package/src/util/thumbnail-util.ts +109 -1
  114. package/src/util/type-conversion-utils.spec.ts +25 -25
  115. package/src/util/type-conversion-utils.ts +10 -9
  116. package/src/util/type-defaults.spec.ts +668 -668
  117. package/src/util/type-defaults.ts +280 -280
  118. package/src/util/type-utils.spec.ts +227 -227
  119. package/src/util/type-utils.ts +144 -144
  120. package/tsconfig.json +28 -26
  121. package/tslint.json +57 -57
  122. package/scripts/output.png +0 -0
  123. package/scripts/test-get-request.ts +0 -35
@@ -1,227 +1,227 @@
1
- import { TypeUtils } from './type-utils';
2
-
3
- describe('TypeUtils.getEventObjectClass() tests', () =>{
4
-
5
- const tu = new TypeUtils();
6
-
7
- it('LCSProduct', () =>{
8
- const entityType = 'item';
9
- const newData = {
10
- roles: ['family']
11
- };
12
-
13
- const objectClass = tu.getEventObjectClass(entityType, newData);
14
-
15
- expect(objectClass).toEqual('LCSProduct');
16
- });
17
-
18
- it('LCSSKU', () =>{
19
- const entityType = 'item';
20
- const newData = {
21
- roles: ['color']
22
- };
23
-
24
- const objectClass = tu.getEventObjectClass(entityType, newData);
25
-
26
- expect(objectClass).toEqual('LCSSKU');
27
- });
28
-
29
- it('LCSProductSeasonLink', () =>{
30
- const entityType = 'project-item';
31
- const newData = {
32
- roles: ['family']
33
- };
34
-
35
- const objectClass = tu.getEventObjectClass(entityType, newData);
36
-
37
- expect(objectClass).toEqual('LCSProductSeasonLink');
38
- });
39
-
40
- it('LCSSKUSeasonLink', () =>{
41
- const entityType = 'project-item';
42
- const newData = {
43
- roles: ['color']
44
- };
45
-
46
- const objectClass = tu.getEventObjectClass(entityType, newData);
47
-
48
- expect(objectClass).toEqual('LCSSKUSeasonLink');
49
- });
50
- it('LCSColor', () =>{
51
- const entityType = 'color';
52
- const newData = {};
53
-
54
- const objectClass = tu.getEventObjectClass(entityType, newData);
55
-
56
- expect(objectClass).toEqual('LCSColor');
57
- });
58
-
59
- it('LCSRevisableEntity', () =>{
60
- const entityType = 'custom-entity';
61
- const newData = {};
62
-
63
- const objectClass = tu.getEventObjectClass(entityType, newData);
64
-
65
- expect(objectClass).toEqual('LCSRevisableEntity');
66
- });
67
-
68
- });
69
- describe('filterProperties-item', () => {
70
-
71
- const itemType = {
72
- typePath: 'item'
73
- };
74
- itemType['typeProperties'] = [
75
- {
76
- id: 'H4NazLloHdUVhc71',
77
- slug: 'null',
78
- propertyLevel: null
79
- },
80
- {
81
- id: 'H4NazLloHdUVhc71',
82
- slug: 'family',
83
- propertyLevel: 'family'
84
- },
85
- {
86
- id: 'H4NazLloHdUVhc71',
87
- slug: 'option',
88
- propertyLevel: 'option'
89
- },
90
- {
91
- id: 'H4NazLloHdUVhc71',
92
- slug: 'overridable',
93
- propertyLevel: 'overridable'
94
- },
95
- {
96
- id: 'H4NazLloHdUVhc71',
97
- slug: 'all',
98
- propertyLevel: 'all'
99
- },
100
- ];
101
- const tu = new TypeUtils();
102
-
103
- it('item-family', () =>{
104
- const len = 4;
105
- const newData = {
106
- roles: ['family']
107
- };
108
-
109
- const filteredProps = tu.filterTypeProperties(itemType, newData);
110
- expect(filteredProps.length).toEqual(len);
111
- });
112
-
113
- it('item-option', () =>{
114
- const len = 4;
115
- const newData = {
116
- roles: ['option']
117
- };
118
-
119
- const filteredProps = tu.filterTypeProperties(itemType, newData);
120
- expect(filteredProps.length).toEqual(len);
121
- });
122
-
123
- it('item-no-roles', () =>{
124
- const len = 5;
125
- const newData = {
126
- };
127
-
128
- const filteredProps = tu.filterTypeProperties(itemType, newData);
129
- expect(filteredProps.length).toEqual(len);
130
- });
131
- });
132
-
133
- //project-item
134
- describe('filterProperties-project-item', () => {
135
-
136
- const projectItemType = {
137
- typePath: 'project-item'
138
- };
139
- projectItemType['typeProperties'] = [
140
- {
141
- id: 'H4NazLloHdUVhc71',
142
- slug: 'null',
143
- propertyLevel: null
144
- },
145
- {
146
- id: 'H4NazLloHdUVhc71',
147
- slug: 'family',
148
- propertyLevel: 'family'
149
- },
150
- {
151
- id: 'H4NazLloHdUVhc71',
152
- slug: 'option',
153
- propertyLevel: 'option'
154
- },
155
- {
156
- id: 'H4NazLloHdUVhc71',
157
- slug: 'overridable',
158
- propertyLevel: 'overridable'
159
- },
160
- {
161
- id: 'H4NazLloHdUVhc71',
162
- slug: 'all',
163
- propertyLevel: 'all'
164
- },
165
- ];
166
- const tu = new TypeUtils();
167
-
168
- it('item-family', () =>{
169
- const len = 4;
170
- const newData = {
171
- roles: ['family']
172
- };
173
-
174
- const filteredProps = tu.filterTypeProperties(projectItemType, newData);
175
- expect(filteredProps.length).toEqual(len);
176
- });
177
-
178
- it('item-option', () =>{
179
- const len = 4;
180
- const newData = {
181
- roles: ['option']
182
- };
183
-
184
- const filteredProps = tu.filterTypeProperties(projectItemType, newData);
185
- expect(filteredProps.length).toEqual(len);
186
- });
187
- });
188
-
189
- //color
190
- describe('filterProperties-color', () => {
191
- const colorType = {
192
- typePath: 'color'
193
- };
194
- colorType['typeProperties'] = [
195
- {
196
- id: 'H4NazLloHdUVhc71',
197
- slug: 'null',
198
- },
199
- {
200
- id: 'H4NazLloHdUVhc71',
201
- slug: 'family',
202
- },
203
- {
204
- id: 'H4NazLloHdUVhc71',
205
- slug: 'option',
206
- },
207
- {
208
- id: 'H4NazLloHdUVhc71',
209
- slug: 'overridable',
210
- },
211
- {
212
- id: 'H4NazLloHdUVhc71',
213
- slug: 'all',
214
- },
215
- ];
216
- const tu = new TypeUtils();
217
-
218
- it('color', () =>{
219
- const len = 5;
220
- const newData = {
221
- roles: ['family']
222
- };
223
-
224
- const filteredProps = tu.filterTypeProperties(colorType, newData);
225
- expect(filteredProps.length).toEqual(len);
226
- });
227
- });
1
+ import { TypeUtils } from './type-utils';
2
+
3
+ describe('TypeUtils.getEventObjectClass() tests', () =>{
4
+
5
+ const tu = new TypeUtils();
6
+
7
+ it('LCSProduct', () =>{
8
+ const entityType = 'item';
9
+ const newData = {
10
+ roles: ['family']
11
+ };
12
+
13
+ const objectClass = tu.getEventObjectClass(entityType, newData);
14
+
15
+ expect(objectClass).toEqual('LCSProduct');
16
+ });
17
+
18
+ it('LCSSKU', () =>{
19
+ const entityType = 'item';
20
+ const newData = {
21
+ roles: ['color']
22
+ };
23
+
24
+ const objectClass = tu.getEventObjectClass(entityType, newData);
25
+
26
+ expect(objectClass).toEqual('LCSSKU');
27
+ });
28
+
29
+ it('LCSProductSeasonLink', () =>{
30
+ const entityType = 'project-item';
31
+ const newData = {
32
+ roles: ['family']
33
+ };
34
+
35
+ const objectClass = tu.getEventObjectClass(entityType, newData);
36
+
37
+ expect(objectClass).toEqual('LCSProductSeasonLink');
38
+ });
39
+
40
+ it('LCSSKUSeasonLink', () =>{
41
+ const entityType = 'project-item';
42
+ const newData = {
43
+ roles: ['color']
44
+ };
45
+
46
+ const objectClass = tu.getEventObjectClass(entityType, newData);
47
+
48
+ expect(objectClass).toEqual('LCSSKUSeasonLink');
49
+ });
50
+ it('LCSColor', () =>{
51
+ const entityType = 'color';
52
+ const newData = {};
53
+
54
+ const objectClass = tu.getEventObjectClass(entityType, newData);
55
+
56
+ expect(objectClass).toEqual('LCSColor');
57
+ });
58
+
59
+ it('LCSRevisableEntity', () =>{
60
+ const entityType = 'custom-entity';
61
+ const newData = {};
62
+
63
+ const objectClass = tu.getEventObjectClass(entityType, newData);
64
+
65
+ expect(objectClass).toEqual('LCSRevisableEntity');
66
+ });
67
+
68
+ });
69
+ describe('filterProperties-item', () => {
70
+
71
+ const itemType = {
72
+ typePath: 'item'
73
+ };
74
+ itemType['typeProperties'] = [
75
+ {
76
+ id: 'H4NazLloHdUVhc71',
77
+ slug: 'null',
78
+ propertyLevel: null
79
+ },
80
+ {
81
+ id: 'H4NazLloHdUVhc71',
82
+ slug: 'family',
83
+ propertyLevel: 'family'
84
+ },
85
+ {
86
+ id: 'H4NazLloHdUVhc71',
87
+ slug: 'option',
88
+ propertyLevel: 'option'
89
+ },
90
+ {
91
+ id: 'H4NazLloHdUVhc71',
92
+ slug: 'overridable',
93
+ propertyLevel: 'overridable'
94
+ },
95
+ {
96
+ id: 'H4NazLloHdUVhc71',
97
+ slug: 'all',
98
+ propertyLevel: 'all'
99
+ },
100
+ ];
101
+ const tu = new TypeUtils();
102
+
103
+ it('item-family', () =>{
104
+ const len = 4;
105
+ const newData = {
106
+ roles: ['family']
107
+ };
108
+
109
+ const filteredProps = tu.filterTypeProperties(itemType, newData);
110
+ expect(filteredProps.length).toEqual(len);
111
+ });
112
+
113
+ it('item-option', () =>{
114
+ const len = 4;
115
+ const newData = {
116
+ roles: ['option']
117
+ };
118
+
119
+ const filteredProps = tu.filterTypeProperties(itemType, newData);
120
+ expect(filteredProps.length).toEqual(len);
121
+ });
122
+
123
+ it('item-no-roles', () =>{
124
+ const len = 5;
125
+ const newData = {
126
+ };
127
+
128
+ const filteredProps = tu.filterTypeProperties(itemType, newData);
129
+ expect(filteredProps.length).toEqual(len);
130
+ });
131
+ });
132
+
133
+ //project-item
134
+ describe('filterProperties-project-item', () => {
135
+
136
+ const projectItemType = {
137
+ typePath: 'project-item'
138
+ };
139
+ projectItemType['typeProperties'] = [
140
+ {
141
+ id: 'H4NazLloHdUVhc71',
142
+ slug: 'null',
143
+ propertyLevel: null
144
+ },
145
+ {
146
+ id: 'H4NazLloHdUVhc71',
147
+ slug: 'family',
148
+ propertyLevel: 'family'
149
+ },
150
+ {
151
+ id: 'H4NazLloHdUVhc71',
152
+ slug: 'option',
153
+ propertyLevel: 'option'
154
+ },
155
+ {
156
+ id: 'H4NazLloHdUVhc71',
157
+ slug: 'overridable',
158
+ propertyLevel: 'overridable'
159
+ },
160
+ {
161
+ id: 'H4NazLloHdUVhc71',
162
+ slug: 'all',
163
+ propertyLevel: 'all'
164
+ },
165
+ ];
166
+ const tu = new TypeUtils();
167
+
168
+ it('item-family', () =>{
169
+ const len = 4;
170
+ const newData = {
171
+ roles: ['family']
172
+ };
173
+
174
+ const filteredProps = tu.filterTypeProperties(projectItemType, newData);
175
+ expect(filteredProps.length).toEqual(len);
176
+ });
177
+
178
+ it('item-option', () =>{
179
+ const len = 4;
180
+ const newData = {
181
+ roles: ['option']
182
+ };
183
+
184
+ const filteredProps = tu.filterTypeProperties(projectItemType, newData);
185
+ expect(filteredProps.length).toEqual(len);
186
+ });
187
+ });
188
+
189
+ //color
190
+ describe('filterProperties-color', () => {
191
+ const colorType = {
192
+ typePath: 'color'
193
+ };
194
+ colorType['typeProperties'] = [
195
+ {
196
+ id: 'H4NazLloHdUVhc71',
197
+ slug: 'null',
198
+ },
199
+ {
200
+ id: 'H4NazLloHdUVhc71',
201
+ slug: 'family',
202
+ },
203
+ {
204
+ id: 'H4NazLloHdUVhc71',
205
+ slug: 'option',
206
+ },
207
+ {
208
+ id: 'H4NazLloHdUVhc71',
209
+ slug: 'overridable',
210
+ },
211
+ {
212
+ id: 'H4NazLloHdUVhc71',
213
+ slug: 'all',
214
+ },
215
+ ];
216
+ const tu = new TypeUtils();
217
+
218
+ it('color', () =>{
219
+ const len = 5;
220
+ const newData = {
221
+ roles: ['family']
222
+ };
223
+
224
+ const filteredProps = tu.filterTypeProperties(colorType, newData);
225
+ expect(filteredProps.length).toEqual(len);
226
+ });
227
+ });