@inneropen/marvin-sdk 1.10.0 → 1.10.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/dist/platform.cjs CHANGED
@@ -655,10 +655,23 @@ var InvitesModule = class {
655
655
  return this.http.post("/api/groups/invitations", data);
656
656
  }
657
657
  /**
658
- * Send an email invitation
658
+ * Send an email invitation with an existing token
659
659
  */
660
660
  async sendEmail(data) {
661
- await this.http.post("/api/groups/invitations/email", data);
661
+ return this.http.post("/api/groups/invitations/email", data);
662
+ }
663
+ /**
664
+ * Delete/revoke an invite token
665
+ */
666
+ async delete(tokenId) {
667
+ await this.http.delete(`/api/groups/invitations/${tokenId}`);
668
+ }
669
+ /**
670
+ * Generate invitation URL from a token
671
+ */
672
+ getInvitationUrl(token, baseUrl) {
673
+ const base = baseUrl || process.env.MARVIN_API_URL || "http://localhost:8080";
674
+ return `${base}/register?token=${token}`;
662
675
  }
663
676
  };
664
677
 
@@ -2867,7 +2867,11 @@ type InviteTokenSummary = components['schemas']['InviteTokenSummary'];
2867
2867
  type InviteTokenPagination = components['schemas']['InviteTokenPagination'];
2868
2868
  interface EmailInvitationRequest {
2869
2869
  email: string;
2870
- usesLeft?: number;
2870
+ token: string;
2871
+ }
2872
+ interface EmailInvitationResponse {
2873
+ success: boolean;
2874
+ error?: string;
2871
2875
  }
2872
2876
  declare class InvitesModule {
2873
2877
  private http;
@@ -2881,9 +2885,17 @@ declare class InvitesModule {
2881
2885
  */
2882
2886
  create(data: InviteTokenCreate): Promise<InviteTokenSummary>;
2883
2887
  /**
2884
- * Send an email invitation
2888
+ * Send an email invitation with an existing token
2889
+ */
2890
+ sendEmail(data: EmailInvitationRequest): Promise<EmailInvitationResponse>;
2891
+ /**
2892
+ * Delete/revoke an invite token
2893
+ */
2894
+ delete(tokenId: string): Promise<void>;
2895
+ /**
2896
+ * Generate invitation URL from a token
2885
2897
  */
2886
- sendEmail(data: EmailInvitationRequest): Promise<void>;
2898
+ getInvitationUrl(token: string, baseUrl?: string): string;
2887
2899
  }
2888
2900
 
2889
2901
  /**
@@ -2867,7 +2867,11 @@ type InviteTokenSummary = components['schemas']['InviteTokenSummary'];
2867
2867
  type InviteTokenPagination = components['schemas']['InviteTokenPagination'];
2868
2868
  interface EmailInvitationRequest {
2869
2869
  email: string;
2870
- usesLeft?: number;
2870
+ token: string;
2871
+ }
2872
+ interface EmailInvitationResponse {
2873
+ success: boolean;
2874
+ error?: string;
2871
2875
  }
2872
2876
  declare class InvitesModule {
2873
2877
  private http;
@@ -2881,9 +2885,17 @@ declare class InvitesModule {
2881
2885
  */
2882
2886
  create(data: InviteTokenCreate): Promise<InviteTokenSummary>;
2883
2887
  /**
2884
- * Send an email invitation
2888
+ * Send an email invitation with an existing token
2889
+ */
2890
+ sendEmail(data: EmailInvitationRequest): Promise<EmailInvitationResponse>;
2891
+ /**
2892
+ * Delete/revoke an invite token
2893
+ */
2894
+ delete(tokenId: string): Promise<void>;
2895
+ /**
2896
+ * Generate invitation URL from a token
2885
2897
  */
2886
- sendEmail(data: EmailInvitationRequest): Promise<void>;
2898
+ getInvitationUrl(token: string, baseUrl?: string): string;
2887
2899
  }
2888
2900
 
2889
2901
  /**
package/dist/platform.js CHANGED
@@ -435,10 +435,23 @@ var InvitesModule = class {
435
435
  return this.http.post("/api/groups/invitations", data);
436
436
  }
437
437
  /**
438
- * Send an email invitation
438
+ * Send an email invitation with an existing token
439
439
  */
440
440
  async sendEmail(data) {
441
- await this.http.post("/api/groups/invitations/email", data);
441
+ return this.http.post("/api/groups/invitations/email", data);
442
+ }
443
+ /**
444
+ * Delete/revoke an invite token
445
+ */
446
+ async delete(tokenId) {
447
+ await this.http.delete(`/api/groups/invitations/${tokenId}`);
448
+ }
449
+ /**
450
+ * Generate invitation URL from a token
451
+ */
452
+ getInvitationUrl(token, baseUrl) {
453
+ const base = baseUrl || process.env.MARVIN_API_URL || "http://localhost:8080";
454
+ return `${base}/register?token=${token}`;
442
455
  }
443
456
  };
444
457
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",