@contrail/flexplm 2.0.0-alpha.fe82e73 → 2.0.1-alpha.85a2e63

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 (32) hide show
  1. package/lib/entity-processor/base-entity-processor.d.ts +0 -29
  2. package/lib/entity-processor/base-entity-processor.js +143 -238
  3. package/lib/entity-processor/base-entity-processor.spec.js +0 -210
  4. package/lib/index.d.ts +0 -2
  5. package/lib/index.js +0 -2
  6. package/lib/interfaces/interfaces.d.ts +1 -1
  7. package/lib/publish/base-process-publish-assortment-callback.js +0 -30
  8. package/lib/publish/base-process-publish-assortment.d.ts +0 -24
  9. package/lib/publish/base-process-publish-assortment.js +132 -238
  10. package/lib/publish/base-process-publish-assortment.spec.js +0 -188
  11. package/lib/util/config-defaults.js +0 -2
  12. package/lib/util/error-response-object.js +0 -2
  13. package/lib/util/flexplm-connect.d.ts +9 -4
  14. package/lib/util/flexplm-connect.js +172 -202
  15. package/lib/util/flexplm-connect.spec.js +166 -2
  16. package/lib/util/thumbnail-util.d.ts +1 -2
  17. package/lib/util/thumbnail-util.js +6 -34
  18. package/lib/util/thumbnail-util.spec.js +0 -42
  19. package/lib/util/type-utils.d.ts +3 -3
  20. package/package.json +10 -12
  21. package/lib/__tests__/telemetry-test-utils.d.ts +0 -8
  22. package/lib/__tests__/telemetry-test-utils.js +0 -30
  23. package/lib/flexplm-request.d.ts +0 -3
  24. package/lib/flexplm-request.js +0 -34
  25. package/lib/publish/base-process-publish-assortment-callback.spec.d.ts +0 -1
  26. package/lib/publish/base-process-publish-assortment-callback.spec.js +0 -62
  27. package/lib/util/flexplm-connect.telemetry.spec.d.ts +0 -1
  28. package/lib/util/flexplm-connect.telemetry.spec.js +0 -212
  29. package/lib/util/telemetry-attributes.d.ts +0 -68
  30. package/lib/util/telemetry-attributes.js +0 -73
  31. package/lib/util/telemetry-utils.d.ts +0 -3
  32. package/lib/util/telemetry-utils.js +0 -10
@@ -1,73 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ATTR_URL_PATH = exports.ATTR_HTTP_RESPONSE_STATUS_CODE = exports.ATTR_HTTP_REQUEST_METHOD = exports.ATTR_FLEXPLM_PUBLISH_SENT_UNRECORDED = exports.ATTR_FLEXPLM_PUBLISH_SEND_MODE = exports.ATTR_FLEXPLM_PUBLISH_ITEM_FAMILY_COUNT = exports.ATTR_FLEXPLM_PUBLISH_SKIPPED_DELETE_COUNT = exports.ATTR_FLEXPLM_PUBLISH_HISTORICAL_DELETE_COUNT = exports.ATTR_FLEXPLM_PUBLISH_DELETE_CHANGE_COUNT = exports.ATTR_FLEXPLM_PUBLISH_HISTORY_COUNT = exports.ATTR_FLEXPLM_PUBLISH_FAILED_DOWNLOADS = exports.ATTR_FLEXPLM_PUBLISH_FILE = exports.ATTR_FLEXPLM_RESPONSE_ITEM_STATUS = exports.ATTR_FLEXPLM_UPDATED_FROM_RESPONSE = exports.ATTR_FLEXPLM_PUBLISH_COLORWAY_SEASON_COUNT = exports.ATTR_FLEXPLM_PUBLISH_PRODUCT_SEASON_COUNT = exports.ATTR_FLEXPLM_PUBLISH_CHANGE_ID = exports.ATTR_FLEXPLM_ASSORTMENT_ID = exports.ATTR_FLEXPLM_FEDERATED_ID = exports.ATTR_FLEXPLM_ENTITY_ID = exports.ATTR_FLEXPLM_OUTCOME = exports.ATTR_FLEXPLM_STATUS = exports.ATTR_FLEXPLM_PUBLISH_CHANGED_COUNT = exports.ATTR_FLEXPLM_PUBLISH_REMOVED_COUNT = exports.ATTR_FLEXPLM_PUBLISH_ADDED_COUNT = exports.ATTR_FLEXPLM_ENTITY_TYPE = exports.ATTR_FLEXPLM_PUBLISH_NOTIFICATION_SENT = exports.ATTR_FLEXPLM_PUBLISH_INVALID_COUNT = exports.ATTR_FLEXPLM_PUBLISH_FAILURE_COUNT = exports.ATTR_FLEXPLM_THUMBNAIL_OUTCOME = exports.ATTR_FLEXPLM_ENTITY_RESULT_COUNT = exports.ATTR_FLEXPLM_ENTITY_FOUND = exports.ATTR_FLEXPLM_CHANGED_PROPERTY_COUNT = exports.ATTR_FLEXPLM_SESSION_WAITED = exports.ATTR_FLEXPLM_SESSION_SOURCE = exports.ATTR_FLEXPLM_EVENT_TYPE = exports.ATTR_FLEXPLM_EVENT_OBJECT_CLASS = exports.ATTR_FLEXPLM_PAYLOAD_COUNT = exports.ATTR_FLEXPLM_REQUEST_RETRIED = exports.ATTR_FLEXPLM_REQUEST_KIND = void 0;
4
- const telemetry_1 = require("@contrail/telemetry");
5
- /** Span and log attribute names emitted by this library. Connectors should reuse these instead of defining their own. */
6
- /** Which FlexPLM call a span covers: 'csrf' | 'send' | 'get'. */
7
- exports.ATTR_FLEXPLM_REQUEST_KIND = (0, telemetry_1.buildContrailAttributeName)('flexplm.request.kind');
8
- /** True when the cached session was rejected and the request was retried with a new session. */
9
- exports.ATTR_FLEXPLM_REQUEST_RETRIED = (0, telemetry_1.buildContrailAttributeName)('flexplm.request.retried');
10
- /** Number of events in the payload sent to FlexPLM. */
11
- exports.ATTR_FLEXPLM_PAYLOAD_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.payload.count');
12
- exports.ATTR_FLEXPLM_EVENT_OBJECT_CLASS = (0, telemetry_1.buildContrailAttributeName)('flexplm.event.object_class');
13
- /** The event type: inbound 'PERSIST' | 'DELETE'; outbound 'create' | 'update' | 'delete' | 'sendUpsertToFlexPLM'. */
14
- exports.ATTR_FLEXPLM_EVENT_TYPE = (0, telemetry_1.buildContrailAttributeName)('flexplm.event.type');
15
- /** Where the FlexPLM session for a request came from: 'cached' | 'new' | 'disabled' (session reuse off). */
16
- exports.ATTR_FLEXPLM_SESSION_SOURCE = (0, telemetry_1.buildContrailAttributeName)('flexplm.session.source');
17
- /** True when the request waited for another request's session acquisition before running. */
18
- exports.ATTR_FLEXPLM_SESSION_WAITED = (0, telemetry_1.buildContrailAttributeName)('flexplm.session.waited');
19
- /** Number of properties written to the VibeIQ entity by a create or update. */
20
- exports.ATTR_FLEXPLM_CHANGED_PROPERTY_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.entity.changed_property_count');
21
- /** Whether a lookup found the entity. */
22
- exports.ATTR_FLEXPLM_ENTITY_FOUND = (0, telemetry_1.buildContrailAttributeName)('flexplm.entity.found');
23
- /** Number of entities a criteria query returned. */
24
- exports.ATTR_FLEXPLM_ENTITY_RESULT_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.entity.result_count');
25
- /** Result of syncing a FlexPLM thumbnail: 'removed' | 'created' | 'replaced' | 'already_synced' | 'no_thumbnail'. */
26
- exports.ATTR_FLEXPLM_THUMBNAIL_OUTCOME = (0, telemetry_1.buildContrailAttributeName)('flexplm.thumbnail.outcome');
27
- /** FlexPLM's per-item result counts for a publish, reported to the publish callback. */
28
- exports.ATTR_FLEXPLM_PUBLISH_FAILURE_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.failure_count');
29
- exports.ATTR_FLEXPLM_PUBLISH_INVALID_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.invalid_count');
30
- /** True when the publish callback dispatched a failure notification. */
31
- exports.ATTR_FLEXPLM_PUBLISH_NOTIFICATION_SENT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.notification_sent');
32
- exports.ATTR_FLEXPLM_ENTITY_TYPE = (0, telemetry_1.buildContrailAttributeName)('flexplm.entity.type');
33
- exports.ATTR_FLEXPLM_PUBLISH_ADDED_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.added_count');
34
- exports.ATTR_FLEXPLM_PUBLISH_REMOVED_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.removed_count');
35
- exports.ATTR_FLEXPLM_PUBLISH_CHANGED_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.changed_count');
36
- /** Result of processing one entity event: EventShortMessageStatus 'Success' | 'Failure'. */
37
- exports.ATTR_FLEXPLM_STATUS = (0, telemetry_1.buildContrailAttributeName)('flexplm.status');
38
- /** Short status message for one inbound entity event, e.g. 'Created', 'Updated', 'No_Changes'. */
39
- exports.ATTR_FLEXPLM_OUTCOME = (0, telemetry_1.buildContrailAttributeName)('flexplm.outcome');
40
- exports.ATTR_FLEXPLM_ENTITY_ID = (0, telemetry_1.buildContrailAttributeName)('flexplm.entity.id');
41
- exports.ATTR_FLEXPLM_FEDERATED_ID = (0, telemetry_1.buildContrailAttributeName)('flexplm.federated_id');
42
- exports.ATTR_FLEXPLM_ASSORTMENT_ID = (0, telemetry_1.buildContrailAttributeName)('flexplm.assortment.id');
43
- exports.ATTR_FLEXPLM_PUBLISH_CHANGE_ID = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.change_id');
44
- /** LCSProductSeasonLink events sent for one assortment publish. */
45
- exports.ATTR_FLEXPLM_PUBLISH_PRODUCT_SEASON_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.product_season_count');
46
- /** LCSSKUSeasonLink events sent for one assortment publish. */
47
- exports.ATTR_FLEXPLM_PUBLISH_COLORWAY_SEASON_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.colorway_season_count');
48
- /** True when FlexPLM's response produced updates that were applied back to the VibeIQ entity. */
49
- exports.ATTR_FLEXPLM_UPDATED_FROM_RESPONSE = (0, telemetry_1.buildContrailAttributeName)('flexplm.outbound.updated_from_response');
50
- /** FlexPLM's per-item status in a send response ('OK' | 'FAIL'); FlexPLM can answer HTTP 200 and still reject the item. */
51
- exports.ATTR_FLEXPLM_RESPONSE_ITEM_STATUS = (0, telemetry_1.buildContrailAttributeName)('flexplm.response.item_status');
52
- /** Which publish file a download span covers: 'hydrated_detail' | 'baseline'. */
53
- exports.ATTR_FLEXPLM_PUBLISH_FILE = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.file');
54
- /** Publish files that could not be downloaded; the publish continues without them. */
55
- exports.ATTR_FLEXPLM_PUBLISH_FAILED_DOWNLOADS = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.failed_downloads');
56
- /** Number of publish-change records in the assortment's history. */
57
- exports.ATTR_FLEXPLM_PUBLISH_HISTORY_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.history_count');
58
- /** Number of delete changes being published, including ones carried over from earlier publishes. */
59
- exports.ATTR_FLEXPLM_PUBLISH_DELETE_CHANGE_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.delete_change_count');
60
- /** Delete changes carried over from earlier publishes that had not been sent yet. */
61
- exports.ATTR_FLEXPLM_PUBLISH_HISTORICAL_DELETE_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.historical_delete_count');
62
- /** Deleted items in scope that were skipped because their item entity was missing. */
63
- exports.ATTR_FLEXPLM_PUBLISH_SKIPPED_DELETE_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.skipped_delete_count');
64
- /** Number of item families with changes in a publish. */
65
- exports.ATTR_FLEXPLM_PUBLISH_ITEM_FAMILY_COUNT = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.item_family_count');
66
- /** The configured sendMode for ASYNC_PUBLISH_SEASON, e.g. 'sendtoflexplm', 'vibeiqfile', 'localfile'. */
67
- exports.ATTR_FLEXPLM_PUBLISH_SEND_MODE = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.send_mode');
68
- /** True when FlexPLM accepted the publish but the external-event that records it could not be created. */
69
- exports.ATTR_FLEXPLM_PUBLISH_SENT_UNRECORDED = (0, telemetry_1.buildContrailAttributeName)('flexplm.publish.sent_unrecorded');
70
- // Standard OpenTelemetry HTTP attributes. Only the path is recorded, never the host, headers or body.
71
- exports.ATTR_HTTP_REQUEST_METHOD = 'http.request.method';
72
- exports.ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code';
73
- exports.ATTR_URL_PATH = 'url.path';
@@ -1,3 +0,0 @@
1
- import { Attributes } from '@opentelemetry/api';
2
- /** Sets the defined values on the active span; a no-op when no span is active. */
3
- export declare const setActiveSpanAttributes: (attributes: Attributes) => void;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setActiveSpanAttributes = void 0;
4
- const api_1 = require("@opentelemetry/api");
5
- /** Sets the defined values on the active span; a no-op when no span is active. */
6
- const setActiveSpanAttributes = (attributes) => {
7
- const defined = Object.fromEntries(Object.entries(attributes).filter(([, value]) => value !== undefined && value !== null));
8
- api_1.trace.getActiveSpan()?.setAttributes(defined);
9
- };
10
- exports.setActiveSpanAttributes = setActiveSpanAttributes;