@inneropen/marvin-sdk 1.10.1 → 1.10.3

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/platform.cjs CHANGED
@@ -668,9 +668,26 @@ var InvitesModule = class {
668
668
  }
669
669
  /**
670
670
  * Generate invitation URL from a token
671
+ * Uses MARVIN_FRONTEND_URL for the base URL, falls back to MARVIN_API_URL with common port mappings
671
672
  */
672
673
  getInvitationUrl(token, baseUrl) {
673
- const base = baseUrl || process.env.MARVIN_API_URL || "http://localhost:8080";
674
+ let base = baseUrl;
675
+ if (!base) {
676
+ base = process.env.MARVIN_FRONTEND_URL;
677
+ if (!base && process.env.MARVIN_API_URL) {
678
+ const apiUrl = process.env.MARVIN_API_URL;
679
+ if (apiUrl.includes(":8080")) {
680
+ base = apiUrl.replace(":8080", ":4321");
681
+ } else if (apiUrl.includes(":3000")) {
682
+ base = apiUrl.replace(":3000", ":4321");
683
+ } else {
684
+ base = apiUrl;
685
+ }
686
+ }
687
+ if (!base) {
688
+ base = "http://localhost:4321";
689
+ }
690
+ }
674
691
  return `${base}/register?token=${token}`;
675
692
  }
676
693
  };
@@ -2894,6 +2894,7 @@ declare class InvitesModule {
2894
2894
  delete(tokenId: string): Promise<void>;
2895
2895
  /**
2896
2896
  * Generate invitation URL from a token
2897
+ * Uses MARVIN_FRONTEND_URL for the base URL, falls back to MARVIN_API_URL with common port mappings
2897
2898
  */
2898
2899
  getInvitationUrl(token: string, baseUrl?: string): string;
2899
2900
  }
@@ -2894,6 +2894,7 @@ declare class InvitesModule {
2894
2894
  delete(tokenId: string): Promise<void>;
2895
2895
  /**
2896
2896
  * Generate invitation URL from a token
2897
+ * Uses MARVIN_FRONTEND_URL for the base URL, falls back to MARVIN_API_URL with common port mappings
2897
2898
  */
2898
2899
  getInvitationUrl(token: string, baseUrl?: string): string;
2899
2900
  }
package/dist/platform.js CHANGED
@@ -448,9 +448,26 @@ var InvitesModule = class {
448
448
  }
449
449
  /**
450
450
  * Generate invitation URL from a token
451
+ * Uses MARVIN_FRONTEND_URL for the base URL, falls back to MARVIN_API_URL with common port mappings
451
452
  */
452
453
  getInvitationUrl(token, baseUrl) {
453
- const base = baseUrl || process.env.MARVIN_API_URL || "http://localhost:8080";
454
+ let base = baseUrl;
455
+ if (!base) {
456
+ base = process.env.MARVIN_FRONTEND_URL;
457
+ if (!base && process.env.MARVIN_API_URL) {
458
+ const apiUrl = process.env.MARVIN_API_URL;
459
+ if (apiUrl.includes(":8080")) {
460
+ base = apiUrl.replace(":8080", ":4321");
461
+ } else if (apiUrl.includes(":3000")) {
462
+ base = apiUrl.replace(":3000", ":4321");
463
+ } else {
464
+ base = apiUrl;
465
+ }
466
+ }
467
+ if (!base) {
468
+ base = "http://localhost:4321";
469
+ }
470
+ }
454
471
  return `${base}/register?token=${token}`;
455
472
  }
456
473
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "1.10.1",
3
+ "version": "1.10.3",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",