@adobe/spacecat-shared-utils 1.86.0 → 1.87.1

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
@@ -1,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-utils-v1.87.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.87.0...@adobe/spacecat-shared-utils-v1.87.1) (2026-01-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * wrong temporalCondition when traversing year boundary ([#1267](https://github.com/adobe/spacecat-shared/issues/1267)) ([a44003e](https://github.com/adobe/spacecat-shared/commit/a44003ef683ca4477748532a1b84a4c947b7b9eb))
7
+
8
+ # [@adobe/spacecat-shared-utils-v1.87.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.86.0...@adobe/spacecat-shared-utils-v1.87.0) (2026-01-08)
9
+
10
+
11
+ ### Features
12
+
13
+ * propagate traceId across workers for cross-worker tracing ([#1247](https://github.com/adobe/spacecat-shared/issues/1247)) ([f7d194d](https://github.com/adobe/spacecat-shared/commit/f7d194d2a8d23426c9dd66aae33f1118d226e827))
14
+
1
15
  # [@adobe/spacecat-shared-utils-v1.86.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.85.2...@adobe/spacecat-shared-utils-v1.86.0) (2025-12-12)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-utils",
3
- "version": "1.86.0",
3
+ "version": "1.87.1",
4
4
  "description": "Shared modules of the Spacecat Services - utils",
5
5
  "type": "module",
6
6
  "exports": {
@@ -224,8 +224,8 @@ export function getTemporalCondition({
224
224
  let currentWeek = week - i;
225
225
  let currentYear = year;
226
226
  if (currentWeek < 1) {
227
- currentWeek = has53CalendarWeeks(currentYear) ? 53 : 52;
228
227
  currentYear -= 1;
228
+ currentWeek = has53CalendarWeeks(currentYear) ? 53 : 52;
229
229
  }
230
230
  log?.info(`[getTemporalCondition] currentWeek: ${currentWeek}, currentYear: ${currentYear}`);
231
231
  conditions.push(getWeekInfo(currentWeek, currentYear).temporalCondition);
@@ -152,6 +152,17 @@ const CDN_TRANSFORMATIONS = {
152
152
  'Compress logs': 'Yes',
153
153
  HelpUrl: 'https://docs-cybersec.thalesgroup.com/bundle/cloud-application-security/page/siem-log-configuration.htm',
154
154
  }),
155
+ 'byocdn-other': (payload) => ({
156
+ 'Bucket name': payload.bucketName,
157
+ Region: payload.region,
158
+ Path: `${payload.allowedPaths?.[0] || ''}<year>/<month>/<day>`,
159
+ 'Access Key': payload.accessKey,
160
+ 'Secret Key': payload.secretKey,
161
+ 'Timestamp format': 'RFC3339',
162
+ 'Log format': 'JSON lines (one log per line)',
163
+ Compression: 'Optional, but prefered. Please use Gzip compression if you decide to compress the log files.',
164
+ 'Example of valid log line': '{"timestamp":"2025-12-01T13:00:05Z","host":"www.example.com","url":"/docs/getting-started","request_method":"GET","request_user_agent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.0; +https://openai.com/gptbot)","response_status":200,"request_referer":"https://www.chatgpt.com/","response_content_type":"text/html; charset=utf-8","time_to_first_byte":123}',
165
+ }),
155
166
  };
156
167
 
157
168
  /**
@@ -164,7 +175,8 @@ const CDN_TRANSFORMATIONS = {
164
175
  *
165
176
  * @param {Object} payload - The result from CDN-Logs-Infrastructure-Provisioning API
166
177
  * @param {string} payload.logSource - The CDN type ('byocdn-fastly' | 'byocdn-akamai'
167
- * | 'byocdn-cloudflare' | 'byocdn-cloudfront' | 'ams-cloudfront' | 'byocdn-imperva')
178
+ * | 'byocdn-cloudflare' | 'byocdn-cloudfront' | 'ams-cloudfront' | 'byocdn-imperva'
179
+ * | 'byocdn-other')
168
180
  * @returns {Object} - The prepared log forwarding configuration parameters
169
181
  * @throws {Error} - If logSource is not supported or missing
170
182
  */
@@ -193,7 +205,7 @@ const prettifyLogForwardingConfig = (payload) => {
193
205
  throw new Error('allowedPaths is required in payload');
194
206
  }
195
207
 
196
- if (payload.logSource === 'byocdn-fastly' || payload.logSource === 'byocdn-akamai') {
208
+ if (payload.logSource === 'byocdn-fastly' || payload.logSource === 'byocdn-akamai' || payload.logSource === 'byocdn-other') {
197
209
  if (!payload.accessKey) {
198
210
  throw new Error('accessKey is required in payload');
199
211
  }
@@ -43,8 +43,9 @@ export function logWrapper(fn) {
43
43
  markers.push(`[jobId=${jobId}]`);
44
44
  }
45
45
 
46
- // Extract traceId from AWS X-Ray
47
- const traceId = getTraceId();
46
+ // Extract traceId: prioritize context.traceId (from SQS message propagation)
47
+ // over X-Ray segment (which is new for each Lambda invocation)
48
+ const traceId = context.traceId || getTraceId();
48
49
  if (traceId) {
49
50
  markers.push(`[traceId=${traceId}]`);
50
51
  }