arvo-core 2.1.12 → 2.1.14
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/CHANGELOG.md
    CHANGED
    
    | @@ -80,7 +80,7 @@ | |
| 80 80 |  | 
| 81 81 | 
             
            - Refactored code implementation architecture for better maintainability
         | 
| 82 82 |  | 
| 83 | 
            -
            ## [2.1. | 
| 83 | 
            +
            ## [2.1.14] - 2024-12-19
         | 
| 84 84 |  | 
| 85 85 | 
             
            - Tested Snyk upgrade, added more test coverage and added support for redirectto in orchestrator subject generation in init factory function
         | 
| 86 86 |  | 
| @@ -77,7 +77,7 @@ var ArvoOrchestratorEventFactory = /** @class */ (function (_super) { | |
| 77 77 | 
             
                        name: "".concat(this._name, ".init"),
         | 
| 78 78 | 
             
                        spanOptions: (0, utils_2.createSpanOptions)(this.contract),
         | 
| 79 79 | 
             
                        fn: function (span) {
         | 
| 80 | 
            -
                            var _a, _b, _c, _d;
         | 
| 80 | 
            +
                            var _a, _b, _c, _d, _e;
         | 
| 81 81 | 
             
                            var otelHeaders = (0, OpenTelemetry_1.currentOpenTelemetryHeaders)();
         | 
| 82 82 | 
             
                            var validationResult = _this.contract.accepts.schema.safeParse(event.data);
         | 
| 83 83 | 
             
                            if (!validationResult.success) {
         | 
| @@ -89,6 +89,9 @@ var ArvoOrchestratorEventFactory = /** @class */ (function (_super) { | |
| 89 89 | 
             
                                    orchestator: _this.contract.accepts.type,
         | 
| 90 90 | 
             
                                    subject: parentSubject,
         | 
| 91 91 | 
             
                                    version: _this.contract.version,
         | 
| 92 | 
            +
                                    meta: Object.fromEntries(Object.entries({
         | 
| 93 | 
            +
                                        redirectto: (_a = event.redirectto) !== null && _a !== void 0 ? _a : ArvoOrchestrationSubject_1.default.parse(parentSubject).execution.initiator
         | 
| 94 | 
            +
                                    }).filter(function (item) { return Boolean(item[1]); }))
         | 
| 92 95 | 
             
                                })
         | 
| 93 96 | 
             
                                : ArvoOrchestrationSubject_1.default.new({
         | 
| 94 97 | 
             
                                    orchestator: _this.contract.accepts.type,
         | 
| @@ -98,7 +101,7 @@ var ArvoOrchestratorEventFactory = /** @class */ (function (_super) { | |
| 98 101 | 
             
                                        redirectto: event.redirectto
         | 
| 99 102 | 
             
                                    } : undefined
         | 
| 100 103 | 
             
                                });
         | 
| 101 | 
            -
                            var generatedEvent = (0, helpers_1.createArvoEvent)(__assign(__assign({}, event), { subject: newSubject, traceparent: ( | 
| 104 | 
            +
                            var generatedEvent = (0, helpers_1.createArvoEvent)(__assign(__assign({}, event), { subject: newSubject, traceparent: (_c = (_b = event.traceparent) !== null && _b !== void 0 ? _b : otelHeaders.traceparent) !== null && _c !== void 0 ? _c : undefined, tracestate: (_e = (_d = event.tracestate) !== null && _d !== void 0 ? _d : otelHeaders.tracestate) !== null && _e !== void 0 ? _e : undefined, type: _this.contract.accepts.type, datacontenttype: schema_1.ArvoDataContentType, dataschema: utils_1.EventDataschemaUtil.create(_this.contract), data: validationResult.data }), extensions, { disable: true });
         | 
| 102 105 | 
             
                            span.setAttributes(generatedEvent.otelAttributes);
         | 
| 103 106 | 
             
                            return generatedEvent;
         | 
| 104 107 | 
             
                        },
         |