unnbound-events 2.0.19-staging.0 → 2.0.19

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.
@@ -53,9 +53,9 @@ const getWorkflowType = (url) => {
53
53
  const withoutProtocol = url.replace(/^https?:\/\//, '');
54
54
  const slashIndex = withoutProtocol.indexOf('/');
55
55
  const path = slashIndex === -1 ? '' : withoutProtocol.substring(slashIndex);
56
- if (path.startsWith('/sandbox'))
56
+ if (path.startsWith('/sandbox/') || path === '/sandbox')
57
57
  return 'sandbox';
58
- if (path.startsWith('/staging'))
58
+ if (path.startsWith('/staging/') || path === '/staging')
59
59
  return 'staging';
60
60
  return 'production';
61
61
  };
@@ -123,7 +123,7 @@ const createHttpEnqueuer = () => {
123
123
  unnbound_logger_sdk_1.logger.info({ event, metadata }, 'Enqueuing event via HTTP...');
124
124
  if (!event.path.startsWith('/'))
125
125
  throw new Error('Path must be relative.');
126
- const { traceId, messageId } = storage_1.storage.getStore() ?? {};
126
+ const { traceId, messageId } = storage_1.storage?.getStore() ?? {};
127
127
  const config = {
128
128
  headers: {
129
129
  ...event.headers,
@@ -37,7 +37,8 @@ const respondWith = (context, result) => {
37
37
  };
38
38
  exports.respondWith = respondWith;
39
39
  const attachTraceHeaders = (headers) => {
40
- const { traceId, messageId } = unnbound_logger_sdk_1.storage.getStore() ?? {};
40
+ // storage can be undefined when CJS/ESM interop breaks re-exports (e.g. tsx in dev mode)
41
+ const { traceId, messageId } = unnbound_logger_sdk_1.storage?.getStore() ?? {};
41
42
  if (!traceId || !messageId)
42
43
  return headers;
43
44
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unnbound-events",
3
3
  "description": "Unified events SDK to handle HTTP routes and queued messages with a single routing API.",
4
- "version": "2.0.19-staging.0",
4
+ "version": "2.0.19",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {