skedyul 0.2.71 → 0.2.73

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/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- 1769638280655
1
+ 1769639336474
package/dist/server.js CHANGED
@@ -742,10 +742,18 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
742
742
  // (same pattern as tool handler)
743
743
  const originalEnv = { ...process.env };
744
744
  Object.assign(process.env, requestEnv);
745
- // Invoke the handler
745
+ // Build request-scoped config for the skedyul client
746
+ // This uses AsyncLocalStorage to override the global config (same pattern as tools)
747
+ const requestConfig = {
748
+ baseUrl: requestEnv.SKEDYUL_API_URL ?? process.env.SKEDYUL_API_URL ?? '',
749
+ apiToken: requestEnv.SKEDYUL_API_TOKEN ?? process.env.SKEDYUL_API_TOKEN ?? '',
750
+ };
751
+ // Invoke the handler with request-scoped config
746
752
  let webhookResponse;
747
753
  try {
748
- webhookResponse = await webhookDef.handler(webhookRequest, webhookContext);
754
+ webhookResponse = await (0, client_1.runWithConfig)(requestConfig, async () => {
755
+ return await webhookDef.handler(webhookRequest, webhookContext);
756
+ });
749
757
  }
750
758
  catch (err) {
751
759
  console.error(`Webhook handler '${handle}' error:`, err);
@@ -1071,10 +1079,18 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
1071
1079
  // (same pattern as tool handler)
1072
1080
  const originalEnv = { ...process.env };
1073
1081
  Object.assign(process.env, requestEnv);
1074
- // Invoke the handler
1082
+ // Build request-scoped config for the skedyul client
1083
+ // This uses AsyncLocalStorage to override the global config (same pattern as tools)
1084
+ const requestConfig = {
1085
+ baseUrl: requestEnv.SKEDYUL_API_URL ?? process.env.SKEDYUL_API_URL ?? '',
1086
+ apiToken: requestEnv.SKEDYUL_API_TOKEN ?? process.env.SKEDYUL_API_TOKEN ?? '',
1087
+ };
1088
+ // Invoke the handler with request-scoped config
1075
1089
  let webhookResponse;
1076
1090
  try {
1077
- webhookResponse = await webhookDef.handler(webhookRequest, webhookContext);
1091
+ webhookResponse = await (0, client_1.runWithConfig)(requestConfig, async () => {
1092
+ return await webhookDef.handler(webhookRequest, webhookContext);
1093
+ });
1078
1094
  }
1079
1095
  catch (err) {
1080
1096
  console.error(`Webhook handler '${handle}' error:`, err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "0.2.71",
3
+ "version": "0.2.73",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",