@contrail/flexplm 2.0.0-alpha.9af4b96 → 2.0.0-alpha.baca70f
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/lib/entity-processor/base-entity-processor.d.ts +0 -29
- package/lib/entity-processor/base-entity-processor.js +143 -238
- package/lib/entity-processor/base-entity-processor.spec.js +0 -212
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/lib/interfaces/interfaces.d.ts +1 -1
- package/lib/publish/base-process-publish-assortment-callback.js +0 -30
- package/lib/publish/base-process-publish-assortment.d.ts +0 -24
- package/lib/publish/base-process-publish-assortment.js +132 -243
- package/lib/publish/base-process-publish-assortment.spec.js +0 -188
- package/lib/util/config-defaults.js +0 -2
- package/lib/util/error-response-object.js +0 -2
- package/lib/util/flexplm-connect.d.ts +9 -4
- package/lib/util/flexplm-connect.js +172 -202
- package/lib/util/flexplm-connect.spec.js +166 -2
- package/lib/util/thumbnail-util.d.ts +1 -2
- package/lib/util/thumbnail-util.js +6 -34
- package/lib/util/thumbnail-util.spec.js +0 -42
- package/lib/util/type-utils.d.ts +3 -3
- package/package.json +10 -12
- package/lib/__tests__/telemetry-test-utils.d.ts +0 -8
- package/lib/__tests__/telemetry-test-utils.js +0 -30
- package/lib/flexplm-request.d.ts +0 -3
- package/lib/flexplm-request.js +0 -34
- package/lib/publish/base-process-publish-assortment-callback.spec.d.ts +0 -1
- package/lib/publish/base-process-publish-assortment-callback.spec.js +0 -62
- package/lib/util/flexplm-connect.telemetry.spec.d.ts +0 -1
- package/lib/util/flexplm-connect.telemetry.spec.js +0 -212
- package/lib/util/telemetry-attributes.d.ts +0 -68
- package/lib/util/telemetry-attributes.js +0 -73
- package/lib/util/telemetry-utils.d.ts +0 -3
- package/lib/util/telemetry-utils.js +0 -10
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.ThumbnailUtil = void 0;
|
|
13
4
|
const app_framework_1 = require("@contrail/app-framework");
|
|
14
5
|
const sdk_1 = require("@contrail/sdk");
|
|
15
6
|
const flexplm_connect_1 = require("./flexplm-connect");
|
|
16
|
-
const telemetry_1 = require("@contrail/telemetry");
|
|
17
|
-
const telemetry_attributes_1 = require("./telemetry-attributes");
|
|
18
7
|
;
|
|
19
8
|
class ThumbnailUtil {
|
|
20
9
|
constructor(config) {
|
|
@@ -142,17 +131,7 @@ class ThumbnailUtil {
|
|
|
142
131
|
* @param entityName - The entity type name (e.g. 'item', 'color') used for API calls.
|
|
143
132
|
* @returns The updated entity, or undefined if no thumbnail changes were needed.
|
|
144
133
|
*/
|
|
145
|
-
async syncThumbnailToVibeIQ(
|
|
146
|
-
return (0, telemetry_1.traceSection)('sync_thumbnail_to_vibeiq', {
|
|
147
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_ENTITY_TYPE]: params.entityName,
|
|
148
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_ENTITY_ID]: params.entityId,
|
|
149
|
-
}, async (span) => {
|
|
150
|
-
const { outcome, result } = await this.syncThumbnail(params);
|
|
151
|
-
span.setAttribute(telemetry_attributes_1.ATTR_FLEXPLM_THUMBNAIL_OUTCOME, outcome);
|
|
152
|
-
return result;
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
async syncThumbnail({ entityId, primaryViewableId, event, entityName }) {
|
|
134
|
+
async syncThumbnailToVibeIQ({ entityId, primaryViewableId, event, entityName }) {
|
|
156
135
|
console.debug(`syncThumbnailToVibeIQ: entityId=${entityId}, primaryViewableId=${primaryViewableId}, entityName=${entityName}`);
|
|
157
136
|
const eventData = event.data || {};
|
|
158
137
|
const newThumbnailId = eventData[ThumbnailUtil.NEW_THUMBNAIL_ID];
|
|
@@ -167,12 +146,12 @@ class ThumbnailUtil {
|
|
|
167
146
|
const clearUpdates = await this.getClearPrimaryViewableUpdates();
|
|
168
147
|
const updatedEntity = await this.entities.update({ entityName, id: entityId, object: clearUpdates });
|
|
169
148
|
console.debug(`syncThumbnailToVibeIQ: applied clear updates for entityId=${entityId}`);
|
|
170
|
-
return
|
|
149
|
+
return updatedEntity;
|
|
171
150
|
}
|
|
172
151
|
// Early return if no thumbnail URL
|
|
173
152
|
if (!thumbnailUrl) {
|
|
174
153
|
console.debug(`syncThumbnailToVibeIQ: no thumbnail URL for entityId=${entityId}`);
|
|
175
|
-
return
|
|
154
|
+
return undefined;
|
|
176
155
|
}
|
|
177
156
|
// Case 2: No existing primaryViewableId — create new content
|
|
178
157
|
if (!primaryViewableId) {
|
|
@@ -181,13 +160,13 @@ class ThumbnailUtil {
|
|
|
181
160
|
const primaryUpdates = await this.getPrimaryViewableUpdates(content);
|
|
182
161
|
const updatedEntity = await this.entities.update({ entityName, id: entityId, object: primaryUpdates });
|
|
183
162
|
console.debug(`syncThumbnailToVibeIQ: created new content ${content.id} for entityId=${entityId}`);
|
|
184
|
-
return
|
|
163
|
+
return updatedEntity;
|
|
185
164
|
}
|
|
186
165
|
// Case 3: Has primaryViewableId — check if thumbnail changed
|
|
187
166
|
const primaryViewable = await this.entities.get({ entityName: 'content', id: primaryViewableId });
|
|
188
167
|
if (primaryViewable?.flexplmThumbnailUrl === thumbnailUrl) {
|
|
189
168
|
console.debug(`syncThumbnailToVibeIQ: thumbnail already synced for entityId=${entityId}`);
|
|
190
|
-
return
|
|
169
|
+
return undefined; // Already synced
|
|
191
170
|
}
|
|
192
171
|
const content = await this.createContentFromFlexPLM(thumbnailUrl, entityId, entityName);
|
|
193
172
|
await this.entities.update({ entityName: 'content', id: content.id, object: { flexplmThumbnailUrl: thumbnailUrl } });
|
|
@@ -195,9 +174,8 @@ class ThumbnailUtil {
|
|
|
195
174
|
const updatedEntity = await this.entities.update({ entityName, id: entityId, object: primaryUpdates });
|
|
196
175
|
await this.entities.delete({ entityName: 'content', id: primaryViewableId });
|
|
197
176
|
console.debug(`syncThumbnailToVibeIQ: replaced content ${primaryViewableId} with ${content.id} for entityId=${entityId}`);
|
|
198
|
-
return
|
|
177
|
+
return updatedEntity;
|
|
199
178
|
}
|
|
200
|
-
// Downloads the image from FlexPLM and stores it as VibeIQ content.
|
|
201
179
|
async createContentFromFlexPLM(thumbnailUrl, entityId, entityName) {
|
|
202
180
|
const urlParts = thumbnailUrl.split('/');
|
|
203
181
|
const fileName = urlParts[urlParts.length - 1] || 'thumbnail';
|
|
@@ -284,9 +262,3 @@ ThumbnailUtil.NEW_THUMBNAIL_ID = 'NEW_THUMBNAIL_ID';
|
|
|
284
262
|
ThumbnailUtil.EXISTING_THUMBNAIL_ID = 'EXISTING_THUMBNAIL_ID';
|
|
285
263
|
ThumbnailUtil.REMOVE_THUMBNAIL = 'REMOVE_THUMBNAIL';
|
|
286
264
|
ThumbnailUtil.OOB_SIZES = [{ slug: 'largeViewable' }, { slug: 'mediumLargeViewable' }, { slug: 'mediumViewable' }, { slug: 'smallViewable' }, { slug: 'tinyViewable' }];
|
|
287
|
-
__decorate([
|
|
288
|
-
(0, telemetry_1.Traced)('copy_thumbnail_from_flexplm'),
|
|
289
|
-
__metadata("design:type", Function),
|
|
290
|
-
__metadata("design:paramtypes", [String, String, String]),
|
|
291
|
-
__metadata("design:returntype", Promise)
|
|
292
|
-
], ThumbnailUtil.prototype, "createContentFromFlexPLM", null);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const thumbnail_util_1 = require("./thumbnail-util");
|
|
4
|
-
const telemetry_test_utils_1 = require("../__tests__/telemetry-test-utils");
|
|
5
|
-
const telemetry_attributes_1 = require("./telemetry-attributes");
|
|
6
4
|
const mockData_1 = require("./mockData");
|
|
7
5
|
const mockEntitiesGet = jest.fn();
|
|
8
6
|
const mockEntitiesUpdate = jest.fn();
|
|
@@ -565,43 +563,3 @@ describe('ThumbnailUtil Tests', () => {
|
|
|
565
563
|
});
|
|
566
564
|
});
|
|
567
565
|
});
|
|
568
|
-
describe('syncThumbnailToVibeIQ telemetry', () => {
|
|
569
|
-
const exporter = (0, telemetry_test_utils_1.registerInMemoryTracing)();
|
|
570
|
-
const image = { arrayBuffer: jest.fn().mockResolvedValue(new ArrayBuffer(8)), headers: { get: jest.fn().mockReturnValue('image/png') } };
|
|
571
|
-
let tu;
|
|
572
|
-
const outcomeOf = async (params) => {
|
|
573
|
-
exporter.reset();
|
|
574
|
-
await tu.syncThumbnailToVibeIQ({ entityId: 'entity1', primaryViewableId: params.primaryViewableId, event: { data: params.data }, entityName: 'color' });
|
|
575
|
-
const [span] = (0, telemetry_test_utils_1.findSpans)(exporter, 'sync_thumbnail_to_vibeiq');
|
|
576
|
-
expect(span.attributes[telemetry_attributes_1.ATTR_FLEXPLM_ENTITY_ID]).toBe('entity1');
|
|
577
|
-
return span.attributes[telemetry_attributes_1.ATTR_FLEXPLM_THUMBNAIL_OUTCOME];
|
|
578
|
-
};
|
|
579
|
-
beforeEach(() => {
|
|
580
|
-
jest.clearAllMocks();
|
|
581
|
-
tu = new thumbnail_util_1.ThumbnailUtil({});
|
|
582
|
-
mockGetRequest.mockResolvedValue(image);
|
|
583
|
-
mockContentCreate.mockResolvedValue({ id: 'newContent' });
|
|
584
|
-
mockEntitiesUpdate.mockImplementation((opts) => Promise.resolve({ id: opts.id }));
|
|
585
|
-
mockEntitiesGet.mockImplementation((opts) => {
|
|
586
|
-
if (opts.entityName === 'content-custom-size')
|
|
587
|
-
return Promise.resolve([]);
|
|
588
|
-
if (opts.entityName === 'content')
|
|
589
|
-
return Promise.resolve({ id: opts.id, flexplmThumbnailUrl: '/rest/thumbnail/same.png' });
|
|
590
|
-
return Promise.resolve({});
|
|
591
|
-
});
|
|
592
|
-
});
|
|
593
|
-
it('should record each sync outcome on the span', async () => {
|
|
594
|
-
expect(await outcomeOf({ data: {} })).toBe('no_thumbnail');
|
|
595
|
-
expect(await outcomeOf({ primaryViewableId: 'pv1', data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: thumbnail_util_1.ThumbnailUtil.REMOVE_THUMBNAIL } })).toBe('removed');
|
|
596
|
-
expect(await outcomeOf({ data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/new.png' } })).toBe('created');
|
|
597
|
-
expect(await outcomeOf({ primaryViewableId: 'pv1', data: { [thumbnail_util_1.ThumbnailUtil.EXISTING_THUMBNAIL_ID]: '/rest/thumbnail/same.png' } })).toBe('already_synced');
|
|
598
|
-
expect(await outcomeOf({ primaryViewableId: 'pv1', data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/new.png' } })).toBe('replaced');
|
|
599
|
-
});
|
|
600
|
-
it('should nest the thumbnail download under the sync span', async () => {
|
|
601
|
-
exporter.reset();
|
|
602
|
-
await tu.syncThumbnailToVibeIQ({ entityId: 'entity1', event: { data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/new.png' } }, entityName: 'color' });
|
|
603
|
-
const [sync] = (0, telemetry_test_utils_1.findSpans)(exporter, 'sync_thumbnail_to_vibeiq');
|
|
604
|
-
const [copy] = (0, telemetry_test_utils_1.findSpans)(exporter, 'copy_thumbnail_from_flexplm');
|
|
605
|
-
expect(copy.parentSpanContext?.spanId).toBe(sync.spanContext().spanId);
|
|
606
|
-
});
|
|
607
|
-
});
|
package/lib/util/type-utils.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TypeClientOptions } from '@contrail/sdk';
|
|
2
|
-
import { TypeProperty } from '@contrail/types';
|
|
2
|
+
import { Type, TypeProperty } from '@contrail/types';
|
|
3
3
|
export declare class TypeUtils {
|
|
4
4
|
private typesObj;
|
|
5
5
|
constructor();
|
|
6
|
-
getTypeById(id: any): Promise<
|
|
7
|
-
getByRootAndPath(options: TypeClientOptions): Promise<
|
|
6
|
+
getTypeById(id: any): Promise<Type>;
|
|
7
|
+
getByRootAndPath(options: TypeClientOptions): Promise<Type>;
|
|
8
8
|
/** Deprecated: use TypeConversionUtils.getObjectTypePath() */
|
|
9
9
|
static getFlexPLMTypePath(entity: any): any;
|
|
10
10
|
/** Deprecated: use TypeConversionUtils.getObjectClass()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrail/flexplm",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.baca70f",
|
|
4
4
|
"description": "Library used for integration with flexplm.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -25,12 +25,9 @@
|
|
|
25
25
|
"author": "VibeIQ",
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@contrail/app-framework": "
|
|
29
|
-
"@contrail/telemetry": "^2.3.1",
|
|
30
|
-
"@opentelemetry/api": "^1.9.1",
|
|
31
|
-
"@opentelemetry/context-async-hooks": "^2.12.0",
|
|
32
|
-
"@opentelemetry/sdk-trace-base": "^2.12.0",
|
|
28
|
+
"@contrail/app-framework": "^3.0.0",
|
|
33
29
|
"@types/jest": "^29.5.2",
|
|
30
|
+
"@types/node": "^24.0.0",
|
|
34
31
|
"jest": "^29.5.0",
|
|
35
32
|
"prettier": "^1.19.1",
|
|
36
33
|
"ts-jest": "^29.1.1",
|
|
@@ -39,9 +36,7 @@
|
|
|
39
36
|
"typescript": "^5.9.3"
|
|
40
37
|
},
|
|
41
38
|
"peerDependencies": {
|
|
42
|
-
"@contrail/app-framework": "^
|
|
43
|
-
"@contrail/telemetry": "^2.3.1",
|
|
44
|
-
"@opentelemetry/api": "^1.9.0",
|
|
39
|
+
"@contrail/app-framework": "^3.0.0",
|
|
45
40
|
"typescript": ">=4.0.0"
|
|
46
41
|
},
|
|
47
42
|
"peerDependenciesMeta": {
|
|
@@ -65,9 +60,12 @@
|
|
|
65
60
|
},
|
|
66
61
|
"dependencies": {
|
|
67
62
|
"@contrail/sdk": "^1.6.1",
|
|
68
|
-
"@contrail/transform-data": "^
|
|
69
|
-
"@contrail/
|
|
70
|
-
"
|
|
63
|
+
"@contrail/transform-data": "^2.0.0",
|
|
64
|
+
"@contrail/types": "^4.0.1",
|
|
65
|
+
"@contrail/util": "^2.2.1",
|
|
71
66
|
"p-limit": "^3.1.0"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=24"
|
|
72
70
|
}
|
|
73
71
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { InMemorySpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
2
|
-
/** Registers an in-memory tracer provider, so spans created by traceSection/@Traced can be asserted on.
|
|
3
|
-
* Call once per spec file (in beforeAll); jest gives each spec file its own globals.
|
|
4
|
-
*/
|
|
5
|
-
export declare const registerInMemoryTracing: () => InMemorySpanExporter;
|
|
6
|
-
export declare const findSpans: (exporter: InMemorySpanExporter, name: string) => ReadableSpan[];
|
|
7
|
-
export declare const findSpan: (exporter: InMemorySpanExporter, name: string) => ReadableSpan;
|
|
8
|
-
export declare const isChildOf: (child: ReadableSpan, parent: ReadableSpan) => boolean;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isChildOf = exports.findSpan = exports.findSpans = exports.registerInMemoryTracing = void 0;
|
|
4
|
-
const api_1 = require("@opentelemetry/api");
|
|
5
|
-
const context_async_hooks_1 = require("@opentelemetry/context-async-hooks");
|
|
6
|
-
const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
|
|
7
|
-
/** Registers an in-memory tracer provider, so spans created by traceSection/@Traced can be asserted on.
|
|
8
|
-
* Call once per spec file (in beforeAll); jest gives each spec file its own globals.
|
|
9
|
-
*/
|
|
10
|
-
const registerInMemoryTracing = () => {
|
|
11
|
-
const exporter = new sdk_trace_base_1.InMemorySpanExporter();
|
|
12
|
-
const provider = new sdk_trace_base_1.BasicTracerProvider({ spanProcessors: [new sdk_trace_base_1.SimpleSpanProcessor(exporter)] });
|
|
13
|
-
// The context manager makes spans opened across awaits nest under their parent.
|
|
14
|
-
api_1.context.setGlobalContextManager(new context_async_hooks_1.AsyncLocalStorageContextManager().enable());
|
|
15
|
-
api_1.trace.setGlobalTracerProvider(provider);
|
|
16
|
-
return exporter;
|
|
17
|
-
};
|
|
18
|
-
exports.registerInMemoryTracing = registerInMemoryTracing;
|
|
19
|
-
const findSpans = (exporter, name) => exporter.getFinishedSpans().filter(span => span.name === name);
|
|
20
|
-
exports.findSpans = findSpans;
|
|
21
|
-
const findSpan = (exporter, name) => {
|
|
22
|
-
const spans = (0, exports.findSpans)(exporter, name);
|
|
23
|
-
if (spans.length !== 1)
|
|
24
|
-
throw new Error(`Expected one '${name}' span, found ${spans.length}`);
|
|
25
|
-
return spans[0];
|
|
26
|
-
};
|
|
27
|
-
exports.findSpan = findSpan;
|
|
28
|
-
const isChildOf = (child, parent) => child.parentSpanContext?.spanId === parent.spanContext().spanId
|
|
29
|
-
&& child.spanContext().traceId === parent.spanContext().traceId;
|
|
30
|
-
exports.isChildOf = isChildOf;
|
package/lib/flexplm-request.d.ts
DELETED
package/lib/flexplm-request.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FlexPLMRequest = void 0;
|
|
7
|
-
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
const BASE_URL = 'https://PP-2006031951wo.portal.ptc.io/Windchill/servlet/rest/cdee';
|
|
9
|
-
const BASE_CONFIG = {
|
|
10
|
-
method: 'POST',
|
|
11
|
-
headers: {
|
|
12
|
-
'Accept': 'application/json',
|
|
13
|
-
'Content-Type': 'application/json',
|
|
14
|
-
'CSRF_NONCE': '2OaLp+0dWNBtrkTwtdDC491zaacu6Hykvqi/lpl6bZgJ/QXBrK/B1J5FErMkmAmktr/I3thcbO1Xn3HJ7Ne/l9kpaedUmn7H75Xey4ZbNLsenW+anM3vxIZ7ELosk3k=',
|
|
15
|
-
'Authorization': 'Basic d2NhZG1pbjpSZXRhaWwyMDIwLQ==',
|
|
16
|
-
'Cookie': 'JSESSIONID=36D5B3C74C1F963C6C73E9AF5B6BDA78.tomcat1; JSESSIONID=B8090C802D8548EA773C97F5886FAB79.tomcat1',
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
class FlexPLMRequest {
|
|
20
|
-
static async request(path, data) {
|
|
21
|
-
const config = Object.assign({}, BASE_CONFIG);
|
|
22
|
-
config.url = BASE_URL + path;
|
|
23
|
-
config.data = data;
|
|
24
|
-
try {
|
|
25
|
-
const resp = await (0, axios_1.default)(config);
|
|
26
|
-
return Promise.resolve(resp.data);
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
console.error(`${FlexPLMRequest} error: ${error.message}`);
|
|
30
|
-
return Promise.resolve(null);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.FlexPLMRequest = FlexPLMRequest;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const telemetry_1 = require("@contrail/telemetry");
|
|
4
|
-
const base_process_publish_assortment_callback_1 = require("./base-process-publish-assortment-callback");
|
|
5
|
-
const telemetry_test_utils_1 = require("../__tests__/telemetry-test-utils");
|
|
6
|
-
const telemetry_attributes_1 = require("../util/telemetry-attributes");
|
|
7
|
-
const mockDispatch = jest.fn();
|
|
8
|
-
jest.mock('@contrail/sdk', () => ({
|
|
9
|
-
...jest.requireActual('@contrail/sdk'),
|
|
10
|
-
Notification: jest.fn().mockImplementation(() => ({ Dispatch: mockDispatch })),
|
|
11
|
-
}));
|
|
12
|
-
describe('BaseProcessPublishAssortmentCallback telemetry', () => {
|
|
13
|
-
let exporter;
|
|
14
|
-
let infoLog;
|
|
15
|
-
let warnLog;
|
|
16
|
-
const process = (statusCounts) => new base_process_publish_assortment_callback_1.BaseProcessPublishAssortmentCallback({ statusCounts: JSON.stringify(statusCounts) }).process({});
|
|
17
|
-
beforeAll(() => {
|
|
18
|
-
exporter = (0, telemetry_test_utils_1.registerInMemoryTracing)();
|
|
19
|
-
});
|
|
20
|
-
beforeEach(() => {
|
|
21
|
-
exporter.reset();
|
|
22
|
-
mockDispatch.mockReset().mockResolvedValue(undefined);
|
|
23
|
-
infoLog = jest.spyOn(telemetry_1.logger, 'info').mockImplementation(() => undefined);
|
|
24
|
-
warnLog = jest.spyOn(telemetry_1.logger, 'warn').mockImplementation(() => undefined);
|
|
25
|
-
});
|
|
26
|
-
afterEach(() => {
|
|
27
|
-
// Not restoreAllMocks: that would also clear the Notification mock implementation above.
|
|
28
|
-
infoLog.mockRestore();
|
|
29
|
-
warnLog.mockRestore();
|
|
30
|
-
});
|
|
31
|
-
it('should record the failure counts, warn and mark the notification sent', async () => {
|
|
32
|
-
const result = await process({ SUCCESS: 5, FAILURE: 2, INVALID: 1 });
|
|
33
|
-
expect(result.message).toContain('sent notification');
|
|
34
|
-
const span = (0, telemetry_test_utils_1.findSpan)(exporter, 'process_publish_callback');
|
|
35
|
-
expect(span.attributes).toEqual(expect.objectContaining({
|
|
36
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_PUBLISH_FAILURE_COUNT]: 2,
|
|
37
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_PUBLISH_INVALID_COUNT]: 1,
|
|
38
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_PUBLISH_NOTIFICATION_SENT]: true,
|
|
39
|
-
}));
|
|
40
|
-
expect(warnLog).toHaveBeenCalledWith({ flexplm: {
|
|
41
|
-
direction: 'publish', status_counts: { SUCCESS: 5, FAILURE: 2, INVALID: 1 }, failure_count: 2, invalid_count: 1,
|
|
42
|
-
} }, 'FlexPLM publish had failed items: %j', expect.any(Object));
|
|
43
|
-
expect(infoLog).not.toHaveBeenCalled();
|
|
44
|
-
});
|
|
45
|
-
it('should record zero counts and an info log when every item succeeded', async () => {
|
|
46
|
-
await process({ SUCCESS: 5 });
|
|
47
|
-
const span = (0, telemetry_test_utils_1.findSpan)(exporter, 'process_publish_callback');
|
|
48
|
-
expect(span.attributes).toEqual(expect.objectContaining({
|
|
49
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_PUBLISH_FAILURE_COUNT]: 0,
|
|
50
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_PUBLISH_INVALID_COUNT]: 0,
|
|
51
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_PUBLISH_NOTIFICATION_SENT]: false,
|
|
52
|
-
}));
|
|
53
|
-
expect(mockDispatch).not.toHaveBeenCalled();
|
|
54
|
-
expect(infoLog).toHaveBeenCalledWith({ flexplm: expect.objectContaining({ failure_count: 0 }) }, 'FlexPLM publish items processed: %j', expect.any(Object));
|
|
55
|
-
});
|
|
56
|
-
it('should not mark the notification sent when dispatching it fails', async () => {
|
|
57
|
-
mockDispatch.mockRejectedValue(new Error('notification service down'));
|
|
58
|
-
await expect(process({ FAILURE: 1 })).rejects.toThrow('notification service down');
|
|
59
|
-
const span = (0, telemetry_test_utils_1.findSpan)(exporter, 'process_publish_callback');
|
|
60
|
-
expect(span.attributes[telemetry_attributes_1.ATTR_FLEXPLM_PUBLISH_NOTIFICATION_SENT]).toBe(false);
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const api_1 = require("@opentelemetry/api");
|
|
4
|
-
const telemetry_1 = require("@contrail/telemetry");
|
|
5
|
-
const flexplm_connect_1 = require("./flexplm-connect");
|
|
6
|
-
const telemetry_test_utils_1 = require("../__tests__/telemetry-test-utils");
|
|
7
|
-
const telemetry_attributes_1 = require("./telemetry-attributes");
|
|
8
|
-
// Same mocks as flexplm-connect.spec.ts
|
|
9
|
-
const csrfBody = { items: [{ attributes: { nonce_key: 'CSRF_NONCE', nonce: 'secret-nonce-value' } }] };
|
|
10
|
-
const resp = (status, setCookie = [], json = csrfBody) => ({
|
|
11
|
-
status,
|
|
12
|
-
json: jest.fn().mockResolvedValue(json),
|
|
13
|
-
text: jest.fn().mockResolvedValue('error text'),
|
|
14
|
-
headers: { getSetCookie: () => setCookie, get: () => null },
|
|
15
|
-
});
|
|
16
|
-
const createConfig = (overrides) => ({
|
|
17
|
-
apiHost: 'https://flexplm.example.com',
|
|
18
|
-
urlContext: '/FlexPLM',
|
|
19
|
-
vibeEventEndpoint: '/api/events',
|
|
20
|
-
csrfEndpoint: '/csrf',
|
|
21
|
-
plmEnviornment: 'test',
|
|
22
|
-
userName: () => 'user',
|
|
23
|
-
password: () => 'super-secret-password',
|
|
24
|
-
itemPreDevelopmentLifecycleStages: [],
|
|
25
|
-
payloadDefaultAsArray: true,
|
|
26
|
-
useDistinctRestEndPointForImages: false,
|
|
27
|
-
...overrides,
|
|
28
|
-
});
|
|
29
|
-
// The session cache is module level, so each test uses its own user to start cold.
|
|
30
|
-
let userCounter = 0;
|
|
31
|
-
const sessionConfig = () => {
|
|
32
|
-
const user = 'telemetry-user-' + (++userCounter);
|
|
33
|
-
return createConfig({ userName: () => user, flexplmConnect: { sessionReuse: { enabled: true } } });
|
|
34
|
-
};
|
|
35
|
-
const fetchMock = () => global.fetch;
|
|
36
|
-
const payload = { eventType: 'PERSIST', objectClass: 'LCSProduct', data: {} };
|
|
37
|
-
const allRecordedValues = (spans) => spans.flatMap(span => [
|
|
38
|
-
...Object.values(span.attributes).map(String),
|
|
39
|
-
...span.events.flatMap(event => [event.name, ...Object.values(event.attributes || {}).map(String)]),
|
|
40
|
-
]);
|
|
41
|
-
describe('FlexPLMConnect telemetry', () => {
|
|
42
|
-
let exporter;
|
|
43
|
-
const globalFetch = global.fetch;
|
|
44
|
-
beforeAll(() => {
|
|
45
|
-
exporter = (0, telemetry_test_utils_1.registerInMemoryTracing)();
|
|
46
|
-
});
|
|
47
|
-
beforeEach(() => {
|
|
48
|
-
exporter.reset();
|
|
49
|
-
global.fetch = jest.fn();
|
|
50
|
-
});
|
|
51
|
-
afterEach(() => {
|
|
52
|
-
jest.restoreAllMocks();
|
|
53
|
-
});
|
|
54
|
-
afterAll(() => {
|
|
55
|
-
global.fetch = globalFetch;
|
|
56
|
-
});
|
|
57
|
-
it('should record a send_to_flexplm span with http.response.status_code 200', async () => {
|
|
58
|
-
fetchMock()
|
|
59
|
-
.mockResolvedValueOnce(resp(200))
|
|
60
|
-
.mockResolvedValueOnce(resp(200, [], { ok: true }));
|
|
61
|
-
await new flexplm_connect_1.FlexPLMConnect(createConfig()).sendToFlexPLM(payload);
|
|
62
|
-
const send = (0, telemetry_test_utils_1.findSpan)(exporter, 'send_to_flexplm');
|
|
63
|
-
expect(send.attributes).toEqual(expect.objectContaining({
|
|
64
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_REQUEST_KIND]: 'send',
|
|
65
|
-
[telemetry_attributes_1.ATTR_HTTP_REQUEST_METHOD]: 'POST',
|
|
66
|
-
[telemetry_attributes_1.ATTR_URL_PATH]: '/FlexPLM/servlet/rest/api/events',
|
|
67
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_PAYLOAD_COUNT]: 1,
|
|
68
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_REQUEST_RETRIED]: false,
|
|
69
|
-
[telemetry_attributes_1.ATTR_HTTP_RESPONSE_STATUS_CODE]: 200,
|
|
70
|
-
}));
|
|
71
|
-
expect(send.status.code).not.toBe(api_1.SpanStatusCode.ERROR);
|
|
72
|
-
const csrf = (0, telemetry_test_utils_1.findSpan)(exporter, 'fetch_flexplm_csrf');
|
|
73
|
-
expect(csrf.attributes).toEqual(expect.objectContaining({
|
|
74
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_REQUEST_KIND]: 'csrf',
|
|
75
|
-
[telemetry_attributes_1.ATTR_HTTP_REQUEST_METHOD]: 'GET',
|
|
76
|
-
[telemetry_attributes_1.ATTR_URL_PATH]: '/FlexPLM/csrf',
|
|
77
|
-
[telemetry_attributes_1.ATTR_HTTP_RESPONSE_STATUS_CODE]: 200,
|
|
78
|
-
}));
|
|
79
|
-
expect((0, telemetry_test_utils_1.isChildOf)(csrf, send)).toBe(true);
|
|
80
|
-
});
|
|
81
|
-
it('should set retried true when the cached session is rejected', async () => {
|
|
82
|
-
fetchMock()
|
|
83
|
-
.mockResolvedValueOnce(resp(200, ['JSESSIONID=first; Path=/']))
|
|
84
|
-
.mockResolvedValueOnce(resp(403))
|
|
85
|
-
.mockResolvedValueOnce(resp(200, ['JSESSIONID=second; Path=/']))
|
|
86
|
-
.mockResolvedValueOnce(resp(200, [], { ok: true }));
|
|
87
|
-
await new flexplm_connect_1.FlexPLMConnect(sessionConfig()).sendToFlexPLM(payload);
|
|
88
|
-
const send = (0, telemetry_test_utils_1.findSpan)(exporter, 'send_to_flexplm');
|
|
89
|
-
expect(send.attributes[telemetry_attributes_1.ATTR_FLEXPLM_REQUEST_RETRIED]).toBe(true);
|
|
90
|
-
expect(send.attributes[telemetry_attributes_1.ATTR_HTTP_RESPONSE_STATUS_CODE]).toBe(200);
|
|
91
|
-
expect(send.status.code).not.toBe(api_1.SpanStatusCode.ERROR);
|
|
92
|
-
});
|
|
93
|
-
it('should record a rejected cached session on the csrf call as an event, not an error', async () => {
|
|
94
|
-
const config = sessionConfig();
|
|
95
|
-
// Warm the cache with a cookie.
|
|
96
|
-
fetchMock()
|
|
97
|
-
.mockResolvedValueOnce(resp(200, ['JSESSIONID=cached; Path=/']))
|
|
98
|
-
.mockResolvedValueOnce(resp(200, [], { ok: true }));
|
|
99
|
-
await new flexplm_connect_1.FlexPLMConnect(config).sendToFlexPLM(payload);
|
|
100
|
-
exporter.reset();
|
|
101
|
-
fetchMock()
|
|
102
|
-
.mockResolvedValueOnce(resp(401))
|
|
103
|
-
.mockResolvedValueOnce(resp(200, ['JSESSIONID=fresh; Path=/']))
|
|
104
|
-
.mockResolvedValueOnce(resp(200, [], { ok: true }));
|
|
105
|
-
await new flexplm_connect_1.FlexPLMConnect(config).sendToFlexPLM(payload);
|
|
106
|
-
const [rejected, fresh] = (0, telemetry_test_utils_1.findSpans)(exporter, 'fetch_flexplm_csrf');
|
|
107
|
-
expect(rejected.events.map(event => event.name)).toEqual(['flexplm_session_rejected']);
|
|
108
|
-
expect(rejected.status.code).not.toBe(api_1.SpanStatusCode.ERROR);
|
|
109
|
-
expect(rejected.attributes[telemetry_attributes_1.ATTR_HTTP_RESPONSE_STATUS_CODE]).toBe(401);
|
|
110
|
-
expect(fresh.events).toEqual([]);
|
|
111
|
-
expect(fresh.attributes[telemetry_attributes_1.ATTR_HTTP_RESPONSE_STATUS_CODE]).toBe(200);
|
|
112
|
-
expect((0, telemetry_test_utils_1.findSpan)(exporter, 'send_to_flexplm').status.code).not.toBe(api_1.SpanStatusCode.ERROR);
|
|
113
|
-
});
|
|
114
|
-
it('should set the span status to ERROR when FlexPLM returns 500', async () => {
|
|
115
|
-
const errorLog = jest.spyOn(telemetry_1.logger, 'error').mockImplementation(() => undefined);
|
|
116
|
-
fetchMock()
|
|
117
|
-
.mockResolvedValueOnce(resp(200))
|
|
118
|
-
.mockResolvedValueOnce(resp(500));
|
|
119
|
-
await expect(new flexplm_connect_1.FlexPLMConnect(createConfig()).sendToFlexPLM(payload))
|
|
120
|
-
.rejects.toThrow('Error sending data to FlexPLM:status: 500');
|
|
121
|
-
const send = (0, telemetry_test_utils_1.findSpan)(exporter, 'send_to_flexplm');
|
|
122
|
-
expect(send.status.code).toBe(api_1.SpanStatusCode.ERROR);
|
|
123
|
-
expect(send.attributes[telemetry_attributes_1.ATTR_HTTP_RESPONSE_STATUS_CODE]).toBe(500);
|
|
124
|
-
expect(send.events.map(event => event.name)).toContain('exception');
|
|
125
|
-
expect(errorLog).toHaveBeenCalledWith({ flexplm: { status: 500, url_path: '/FlexPLM/servlet/rest/api/events', response_body: 'error text' } }, 'Error sending data to FlexPLM:status: 500');
|
|
126
|
-
});
|
|
127
|
-
it('should truncate the logged response body', async () => {
|
|
128
|
-
const errorLog = jest.spyOn(telemetry_1.logger, 'error').mockImplementation(() => undefined);
|
|
129
|
-
const failed = resp(500);
|
|
130
|
-
failed.text.mockResolvedValue('x'.repeat(5000));
|
|
131
|
-
fetchMock()
|
|
132
|
-
.mockResolvedValueOnce(resp(200))
|
|
133
|
-
.mockResolvedValueOnce(failed);
|
|
134
|
-
await expect(new flexplm_connect_1.FlexPLMConnect(createConfig()).sendToFlexPLM(payload)).rejects.toThrow();
|
|
135
|
-
const logged = errorLog.mock.calls[0][0].flexplm.response_body;
|
|
136
|
-
expect(logged.length).toBeLessThan(2100);
|
|
137
|
-
expect(logged.endsWith('...(truncated)')).toBe(true);
|
|
138
|
-
});
|
|
139
|
-
it('should record only the path of a getRequest, without the host or query string', async () => {
|
|
140
|
-
fetchMock().mockResolvedValueOnce(resp(200, [], { ok: true }));
|
|
141
|
-
await new flexplm_connect_1.FlexPLMConnect(createConfig()).getRequest({ urlPath: '/servlet/rest/rfa/vibeiq/image?path=%2Fsecret%2Ffile.png' });
|
|
142
|
-
const get = (0, telemetry_test_utils_1.findSpan)(exporter, 'get_from_flexplm');
|
|
143
|
-
expect(get.attributes).toEqual(expect.objectContaining({
|
|
144
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_REQUEST_KIND]: 'get',
|
|
145
|
-
[telemetry_attributes_1.ATTR_URL_PATH]: '/FlexPLM/servlet/rest/rfa/vibeiq/image',
|
|
146
|
-
[telemetry_attributes_1.ATTR_HTTP_RESPONSE_STATUS_CODE]: 200,
|
|
147
|
-
[telemetry_attributes_1.ATTR_FLEXPLM_REQUEST_RETRIED]: false,
|
|
148
|
-
}));
|
|
149
|
-
});
|
|
150
|
-
it('should record the session source: disabled, then new, then cached', async () => {
|
|
151
|
-
fetchMock().mockResolvedValueOnce(resp(200)).mockResolvedValueOnce(resp(200, [], { ok: true }));
|
|
152
|
-
await new flexplm_connect_1.FlexPLMConnect(createConfig()).sendToFlexPLM(payload);
|
|
153
|
-
expect((0, telemetry_test_utils_1.findSpan)(exporter, 'send_to_flexplm').attributes[telemetry_attributes_1.ATTR_FLEXPLM_SESSION_SOURCE]).toBe('disabled');
|
|
154
|
-
const config = sessionConfig();
|
|
155
|
-
for (let i = 0; i < 2; i++) {
|
|
156
|
-
fetchMock().mockResolvedValueOnce(resp(200, ['JSESSIONID=reused; Path=/'])).mockResolvedValueOnce(resp(200, [], { ok: true }));
|
|
157
|
-
}
|
|
158
|
-
exporter.reset();
|
|
159
|
-
await new flexplm_connect_1.FlexPLMConnect(config).sendToFlexPLM(payload);
|
|
160
|
-
await new flexplm_connect_1.FlexPLMConnect(config).sendToFlexPLM(payload);
|
|
161
|
-
const [first, second] = (0, telemetry_test_utils_1.findSpans)(exporter, 'send_to_flexplm');
|
|
162
|
-
expect(first.attributes[telemetry_attributes_1.ATTR_FLEXPLM_SESSION_SOURCE]).toBe('new');
|
|
163
|
-
expect(second.attributes[telemetry_attributes_1.ATTR_FLEXPLM_SESSION_SOURCE]).toBe('cached');
|
|
164
|
-
expect(first.attributes[telemetry_attributes_1.ATTR_FLEXPLM_SESSION_WAITED]).toBeUndefined();
|
|
165
|
-
});
|
|
166
|
-
it('should record session.source new after a rejected cached session is replaced', async () => {
|
|
167
|
-
const config = sessionConfig();
|
|
168
|
-
fetchMock().mockResolvedValueOnce(resp(200, ['JSESSIONID=cached; Path=/'])).mockResolvedValueOnce(resp(200, [], { ok: true }));
|
|
169
|
-
await new flexplm_connect_1.FlexPLMConnect(config).sendToFlexPLM(payload);
|
|
170
|
-
exporter.reset();
|
|
171
|
-
fetchMock()
|
|
172
|
-
.mockResolvedValueOnce(resp(401))
|
|
173
|
-
.mockResolvedValueOnce(resp(200, ['JSESSIONID=fresh; Path=/']))
|
|
174
|
-
.mockResolvedValueOnce(resp(200, [], { ok: true }));
|
|
175
|
-
await new flexplm_connect_1.FlexPLMConnect(config).sendToFlexPLM(payload);
|
|
176
|
-
expect((0, telemetry_test_utils_1.findSpan)(exporter, 'send_to_flexplm').attributes[telemetry_attributes_1.ATTR_FLEXPLM_SESSION_SOURCE]).toBe('new');
|
|
177
|
-
});
|
|
178
|
-
it('should record session.waited when a request waits for another request\'s session acquisition', async () => {
|
|
179
|
-
const config = sessionConfig();
|
|
180
|
-
let release;
|
|
181
|
-
const gate = new Promise(r => { release = r; });
|
|
182
|
-
fetchMock().mockImplementation(async (_url, opts) => {
|
|
183
|
-
if (opts.method === 'GET' && !opts.headers.Cookie) {
|
|
184
|
-
await gate;
|
|
185
|
-
return resp(200, ['JSESSIONID=shared; Path=/']);
|
|
186
|
-
}
|
|
187
|
-
return opts.method === 'GET' ? resp(200) : resp(200, [], { ok: true });
|
|
188
|
-
});
|
|
189
|
-
const all = Promise.all([1, 2].map(() => new flexplm_connect_1.FlexPLMConnect(config).sendToFlexPLM(payload)));
|
|
190
|
-
await new Promise(r => setImmediate(r));
|
|
191
|
-
release();
|
|
192
|
-
await all;
|
|
193
|
-
const spans = (0, telemetry_test_utils_1.findSpans)(exporter, 'send_to_flexplm');
|
|
194
|
-
expect(spans.map(span => span.attributes[telemetry_attributes_1.ATTR_FLEXPLM_SESSION_WAITED]).sort()).toEqual([true, undefined]);
|
|
195
|
-
expect(spans.map(span => span.attributes[telemetry_attributes_1.ATTR_FLEXPLM_SESSION_SOURCE]).sort()).toEqual(['cached', 'new']);
|
|
196
|
-
});
|
|
197
|
-
it('should not record Authorization, Cookie or nonce values on any span', async () => {
|
|
198
|
-
fetchMock()
|
|
199
|
-
.mockResolvedValueOnce(resp(200, ['JSESSIONID=cookie-value-1; Path=/']))
|
|
200
|
-
.mockResolvedValueOnce(resp(403))
|
|
201
|
-
.mockResolvedValueOnce(resp(200, ['JSESSIONID=cookie-value-2; Path=/']))
|
|
202
|
-
.mockResolvedValueOnce(resp(200, [], { ok: true }));
|
|
203
|
-
await new flexplm_connect_1.FlexPLMConnect(sessionConfig()).sendToFlexPLM(payload);
|
|
204
|
-
const spans = exporter.getFinishedSpans();
|
|
205
|
-
expect(spans.length).toBeGreaterThan(0);
|
|
206
|
-
const recorded = allRecordedValues(spans).join('\n');
|
|
207
|
-
const authorization = Buffer.from('telemetry-user-' + userCounter + ':super-secret-password').toString('base64');
|
|
208
|
-
for (const secret of ['super-secret-password', authorization, 'cookie-value-1', 'cookie-value-2', 'secret-nonce-value', 'CSRF_NONCE', 'flexplm.example.com']) {
|
|
209
|
-
expect(recorded).not.toContain(secret);
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/** Span and log attribute names emitted by this library. Connectors should reuse these instead of defining their own. */
|
|
2
|
-
/** Which FlexPLM call a span covers: 'csrf' | 'send' | 'get'. */
|
|
3
|
-
export declare const ATTR_FLEXPLM_REQUEST_KIND: "contrail.flexplm.request.kind";
|
|
4
|
-
/** True when the cached session was rejected and the request was retried with a new session. */
|
|
5
|
-
export declare const ATTR_FLEXPLM_REQUEST_RETRIED: "contrail.flexplm.request.retried";
|
|
6
|
-
/** Number of events in the payload sent to FlexPLM. */
|
|
7
|
-
export declare const ATTR_FLEXPLM_PAYLOAD_COUNT: "contrail.flexplm.payload.count";
|
|
8
|
-
export declare const ATTR_FLEXPLM_EVENT_OBJECT_CLASS: "contrail.flexplm.event.object_class";
|
|
9
|
-
/** The event type: inbound 'PERSIST' | 'DELETE'; outbound 'create' | 'update' | 'delete' | 'sendUpsertToFlexPLM'. */
|
|
10
|
-
export declare const ATTR_FLEXPLM_EVENT_TYPE: "contrail.flexplm.event.type";
|
|
11
|
-
/** Where the FlexPLM session for a request came from: 'cached' | 'new' | 'disabled' (session reuse off). */
|
|
12
|
-
export declare const ATTR_FLEXPLM_SESSION_SOURCE: "contrail.flexplm.session.source";
|
|
13
|
-
/** True when the request waited for another request's session acquisition before running. */
|
|
14
|
-
export declare const ATTR_FLEXPLM_SESSION_WAITED: "contrail.flexplm.session.waited";
|
|
15
|
-
/** Number of properties written to the VibeIQ entity by a create or update. */
|
|
16
|
-
export declare const ATTR_FLEXPLM_CHANGED_PROPERTY_COUNT: "contrail.flexplm.entity.changed_property_count";
|
|
17
|
-
/** Whether a lookup found the entity. */
|
|
18
|
-
export declare const ATTR_FLEXPLM_ENTITY_FOUND: "contrail.flexplm.entity.found";
|
|
19
|
-
/** Number of entities a criteria query returned. */
|
|
20
|
-
export declare const ATTR_FLEXPLM_ENTITY_RESULT_COUNT: "contrail.flexplm.entity.result_count";
|
|
21
|
-
/** Result of syncing a FlexPLM thumbnail: 'removed' | 'created' | 'replaced' | 'already_synced' | 'no_thumbnail'. */
|
|
22
|
-
export declare const ATTR_FLEXPLM_THUMBNAIL_OUTCOME: "contrail.flexplm.thumbnail.outcome";
|
|
23
|
-
/** FlexPLM's per-item result counts for a publish, reported to the publish callback. */
|
|
24
|
-
export declare const ATTR_FLEXPLM_PUBLISH_FAILURE_COUNT: "contrail.flexplm.publish.failure_count";
|
|
25
|
-
export declare const ATTR_FLEXPLM_PUBLISH_INVALID_COUNT: "contrail.flexplm.publish.invalid_count";
|
|
26
|
-
/** True when the publish callback dispatched a failure notification. */
|
|
27
|
-
export declare const ATTR_FLEXPLM_PUBLISH_NOTIFICATION_SENT: "contrail.flexplm.publish.notification_sent";
|
|
28
|
-
export declare const ATTR_FLEXPLM_ENTITY_TYPE: "contrail.flexplm.entity.type";
|
|
29
|
-
export declare const ATTR_FLEXPLM_PUBLISH_ADDED_COUNT: "contrail.flexplm.publish.added_count";
|
|
30
|
-
export declare const ATTR_FLEXPLM_PUBLISH_REMOVED_COUNT: "contrail.flexplm.publish.removed_count";
|
|
31
|
-
export declare const ATTR_FLEXPLM_PUBLISH_CHANGED_COUNT: "contrail.flexplm.publish.changed_count";
|
|
32
|
-
/** Result of processing one entity event: EventShortMessageStatus 'Success' | 'Failure'. */
|
|
33
|
-
export declare const ATTR_FLEXPLM_STATUS: "contrail.flexplm.status";
|
|
34
|
-
/** Short status message for one inbound entity event, e.g. 'Created', 'Updated', 'No_Changes'. */
|
|
35
|
-
export declare const ATTR_FLEXPLM_OUTCOME: "contrail.flexplm.outcome";
|
|
36
|
-
export declare const ATTR_FLEXPLM_ENTITY_ID: "contrail.flexplm.entity.id";
|
|
37
|
-
export declare const ATTR_FLEXPLM_FEDERATED_ID: "contrail.flexplm.federated_id";
|
|
38
|
-
export declare const ATTR_FLEXPLM_ASSORTMENT_ID: "contrail.flexplm.assortment.id";
|
|
39
|
-
export declare const ATTR_FLEXPLM_PUBLISH_CHANGE_ID: "contrail.flexplm.publish.change_id";
|
|
40
|
-
/** LCSProductSeasonLink events sent for one assortment publish. */
|
|
41
|
-
export declare const ATTR_FLEXPLM_PUBLISH_PRODUCT_SEASON_COUNT: "contrail.flexplm.publish.product_season_count";
|
|
42
|
-
/** LCSSKUSeasonLink events sent for one assortment publish. */
|
|
43
|
-
export declare const ATTR_FLEXPLM_PUBLISH_COLORWAY_SEASON_COUNT: "contrail.flexplm.publish.colorway_season_count";
|
|
44
|
-
/** True when FlexPLM's response produced updates that were applied back to the VibeIQ entity. */
|
|
45
|
-
export declare const ATTR_FLEXPLM_UPDATED_FROM_RESPONSE: "contrail.flexplm.outbound.updated_from_response";
|
|
46
|
-
/** FlexPLM's per-item status in a send response ('OK' | 'FAIL'); FlexPLM can answer HTTP 200 and still reject the item. */
|
|
47
|
-
export declare const ATTR_FLEXPLM_RESPONSE_ITEM_STATUS: "contrail.flexplm.response.item_status";
|
|
48
|
-
/** Which publish file a download span covers: 'hydrated_detail' | 'baseline'. */
|
|
49
|
-
export declare const ATTR_FLEXPLM_PUBLISH_FILE: "contrail.flexplm.publish.file";
|
|
50
|
-
/** Publish files that could not be downloaded; the publish continues without them. */
|
|
51
|
-
export declare const ATTR_FLEXPLM_PUBLISH_FAILED_DOWNLOADS: "contrail.flexplm.publish.failed_downloads";
|
|
52
|
-
/** Number of publish-change records in the assortment's history. */
|
|
53
|
-
export declare const ATTR_FLEXPLM_PUBLISH_HISTORY_COUNT: "contrail.flexplm.publish.history_count";
|
|
54
|
-
/** Number of delete changes being published, including ones carried over from earlier publishes. */
|
|
55
|
-
export declare const ATTR_FLEXPLM_PUBLISH_DELETE_CHANGE_COUNT: "contrail.flexplm.publish.delete_change_count";
|
|
56
|
-
/** Delete changes carried over from earlier publishes that had not been sent yet. */
|
|
57
|
-
export declare const ATTR_FLEXPLM_PUBLISH_HISTORICAL_DELETE_COUNT: "contrail.flexplm.publish.historical_delete_count";
|
|
58
|
-
/** Deleted items in scope that were skipped because their item entity was missing. */
|
|
59
|
-
export declare const ATTR_FLEXPLM_PUBLISH_SKIPPED_DELETE_COUNT: "contrail.flexplm.publish.skipped_delete_count";
|
|
60
|
-
/** Number of item families with changes in a publish. */
|
|
61
|
-
export declare const ATTR_FLEXPLM_PUBLISH_ITEM_FAMILY_COUNT: "contrail.flexplm.publish.item_family_count";
|
|
62
|
-
/** The configured sendMode for ASYNC_PUBLISH_SEASON, e.g. 'sendtoflexplm', 'vibeiqfile', 'localfile'. */
|
|
63
|
-
export declare const ATTR_FLEXPLM_PUBLISH_SEND_MODE: "contrail.flexplm.publish.send_mode";
|
|
64
|
-
/** True when FlexPLM accepted the publish but the external-event that records it could not be created. */
|
|
65
|
-
export declare const ATTR_FLEXPLM_PUBLISH_SENT_UNRECORDED: "contrail.flexplm.publish.sent_unrecorded";
|
|
66
|
-
export declare const ATTR_HTTP_REQUEST_METHOD = "http.request.method";
|
|
67
|
-
export declare const ATTR_HTTP_RESPONSE_STATUS_CODE = "http.response.status_code";
|
|
68
|
-
export declare const ATTR_URL_PATH = "url.path";
|