@mastra/slack 1.5.0-alpha.0 → 1.5.0

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/index.js CHANGED
@@ -14900,6 +14900,13 @@ var SlackConfigDataSchema = external_exports.object({
14900
14900
 
14901
14901
  // src/provider.ts
14902
14902
  var PLATFORM = "slack";
14903
+ function stripTrailingSlash(url2) {
14904
+ let end = url2.length;
14905
+ while (end > 0 && url2.charCodeAt(end - 1) === 47) {
14906
+ end--;
14907
+ }
14908
+ return end === url2.length ? url2 : url2.slice(0, end);
14909
+ }
14903
14910
  function hashConfig(opts, baseUrl, resolvedAppName, resolvedDescription) {
14904
14911
  const normalized = JSON.stringify({
14905
14912
  name: resolvedAppName,
@@ -15311,7 +15318,7 @@ var SlackProvider = class {
15311
15318
  */
15312
15319
  #getBaseUrl() {
15313
15320
  if (this.#baseUrl) {
15314
- return this.#baseUrl;
15321
+ return stripTrailingSlash(this.#baseUrl);
15315
15322
  }
15316
15323
  const server = this.#mastra?.getServer();
15317
15324
  const protocol = server?.studioProtocol ?? "http";
@@ -15325,7 +15332,7 @@ var SlackProvider = class {
15325
15332
  * Only needed if not using Mastra server config.
15326
15333
  */
15327
15334
  setBaseUrl(baseUrl) {
15328
- this.#baseUrl = baseUrl;
15335
+ this.#baseUrl = stripTrailingSlash(baseUrl);
15329
15336
  }
15330
15337
  /**
15331
15338
  * Restore active Slack installations from storage.