@rendobar/sdk 5.5.0 → 5.6.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.cjs CHANGED
@@ -702,7 +702,46 @@ function createOrgsResource(request) {
702
702
  body,
703
703
  signal: options?.signal
704
704
  });
705
- }
705
+ },
706
+ /**
707
+ * Organization membership. Replaces `client.team.*`, which named a
708
+ * resource the API does not have: there is no team, only an organization
709
+ * with members and invitations.
710
+ */
711
+ members: {
712
+ /** Invite someone to the current organization. Owner or admin only. */
713
+ async invite(params, options) {
714
+ return request("/orgs/current/members", {
715
+ method: "POST",
716
+ body: params,
717
+ signal: options?.signal
718
+ });
719
+ },
720
+ /** Change a member's role. Owner or admin only. */
721
+ async changeRole(params, options) {
722
+ return request(`/orgs/current/members/${params.memberId}`, {
723
+ method: "PATCH",
724
+ body: { role: params.role },
725
+ signal: options?.signal
726
+ });
727
+ },
728
+ /** Remove a member, or pass your own member id to leave. */
729
+ async remove(params, options) {
730
+ return request(`/orgs/current/members/${params.memberId}`, {
731
+ method: "DELETE",
732
+ signal: options?.signal
733
+ });
734
+ }
735
+ },
736
+ /** Pending invitations to the current organization. */
737
+ invitations: {
738
+ /** Cancel a pending invitation. Owner or admin only. */
739
+ async revoke(params, options) {
740
+ return request(`/orgs/current/invitations/${params.invitationId}`, {
741
+ method: "DELETE",
742
+ signal: options?.signal
743
+ });
744
+ } }
706
745
  };
707
746
  }
708
747
  //#endregion
@@ -737,8 +776,16 @@ function createAssetsResource(request) {
737
776
  }
738
777
  //#endregion
739
778
  //#region src/resources/team.ts
779
+ /**
780
+ * DEPRECATED. Use `client.orgs.members` and `client.orgs.invitations`.
781
+ *
782
+ * These wrap `/team/*`, which names a resource the API does not have: there is
783
+ * no team, only an organization with members and invitations. The endpoints
784
+ * still work and will keep working until the next major.
785
+ */
740
786
  function createTeamResource(request) {
741
787
  return {
788
+ /** @deprecated Use `client.orgs.members.invite()`. */
742
789
  async invite(params, options) {
743
790
  return request("/team/invite", {
744
791
  method: "POST",
@@ -746,13 +793,15 @@ function createTeamResource(request) {
746
793
  signal: options?.signal
747
794
  });
748
795
  },
796
+ /** @deprecated Use `client.orgs.members.changeRole()`. */
749
797
  async changeRole(params, options) {
750
798
  await request("/team/role", {
751
- method: "POST",
799
+ method: "PATCH",
752
800
  body: params,
753
801
  signal: options?.signal
754
802
  });
755
803
  },
804
+ /** @deprecated Use `client.orgs.members.remove()`. */
756
805
  async remove(params, options) {
757
806
  await request("/team/remove", {
758
807
  method: "POST",
@@ -760,6 +809,7 @@ function createTeamResource(request) {
760
809
  signal: options?.signal
761
810
  });
762
811
  },
812
+ /** @deprecated Use `client.orgs.invitations.revoke()`. */
763
813
  async revokeInvitation(params, options) {
764
814
  await request("/team/revoke-invitation", {
765
815
  method: "POST",
package/dist/index.d.cts CHANGED
@@ -3548,6 +3548,44 @@ declare function createClient(config?: ClientConfig): {
3548
3548
  updateSettings(body: Partial<Pick<OrgSettings, "billingEmailsEnabled" | "defaultRegion" | "regionPinned">>, options?: {
3549
3549
  signal?: AbortSignal;
3550
3550
  }): Promise<OrgSettings>;
3551
+ members: {
3552
+ invite(params: {
3553
+ email: string;
3554
+ role: "admin" | "member";
3555
+ }, options?: {
3556
+ signal?: AbortSignal;
3557
+ }): Promise<{
3558
+ id: string;
3559
+ email: string;
3560
+ role: string;
3561
+ expiresAt: number;
3562
+ }>;
3563
+ changeRole(params: {
3564
+ memberId: string;
3565
+ role: "admin" | "member";
3566
+ }, options?: {
3567
+ signal?: AbortSignal;
3568
+ }): Promise<{
3569
+ memberId: string;
3570
+ role: string;
3571
+ }>;
3572
+ remove(params: {
3573
+ memberId: string;
3574
+ }, options?: {
3575
+ signal?: AbortSignal;
3576
+ }): Promise<{
3577
+ removed: boolean;
3578
+ }>;
3579
+ };
3580
+ invitations: {
3581
+ revoke(params: {
3582
+ invitationId: string;
3583
+ }, options?: {
3584
+ signal?: AbortSignal;
3585
+ }): Promise<{
3586
+ revoked: boolean;
3587
+ }>;
3588
+ };
3551
3589
  };
3552
3590
  assets: {
3553
3591
  list(params?: ListAssetsParams, options?: {
package/dist/index.d.mts CHANGED
@@ -3548,6 +3548,44 @@ declare function createClient(config?: ClientConfig): {
3548
3548
  updateSettings(body: Partial<Pick<OrgSettings, "billingEmailsEnabled" | "defaultRegion" | "regionPinned">>, options?: {
3549
3549
  signal?: AbortSignal;
3550
3550
  }): Promise<OrgSettings>;
3551
+ members: {
3552
+ invite(params: {
3553
+ email: string;
3554
+ role: "admin" | "member";
3555
+ }, options?: {
3556
+ signal?: AbortSignal;
3557
+ }): Promise<{
3558
+ id: string;
3559
+ email: string;
3560
+ role: string;
3561
+ expiresAt: number;
3562
+ }>;
3563
+ changeRole(params: {
3564
+ memberId: string;
3565
+ role: "admin" | "member";
3566
+ }, options?: {
3567
+ signal?: AbortSignal;
3568
+ }): Promise<{
3569
+ memberId: string;
3570
+ role: string;
3571
+ }>;
3572
+ remove(params: {
3573
+ memberId: string;
3574
+ }, options?: {
3575
+ signal?: AbortSignal;
3576
+ }): Promise<{
3577
+ removed: boolean;
3578
+ }>;
3579
+ };
3580
+ invitations: {
3581
+ revoke(params: {
3582
+ invitationId: string;
3583
+ }, options?: {
3584
+ signal?: AbortSignal;
3585
+ }): Promise<{
3586
+ revoked: boolean;
3587
+ }>;
3588
+ };
3551
3589
  };
3552
3590
  assets: {
3553
3591
  list(params?: ListAssetsParams, options?: {
package/dist/index.mjs CHANGED
@@ -701,7 +701,46 @@ function createOrgsResource(request) {
701
701
  body,
702
702
  signal: options?.signal
703
703
  });
704
- }
704
+ },
705
+ /**
706
+ * Organization membership. Replaces `client.team.*`, which named a
707
+ * resource the API does not have: there is no team, only an organization
708
+ * with members and invitations.
709
+ */
710
+ members: {
711
+ /** Invite someone to the current organization. Owner or admin only. */
712
+ async invite(params, options) {
713
+ return request("/orgs/current/members", {
714
+ method: "POST",
715
+ body: params,
716
+ signal: options?.signal
717
+ });
718
+ },
719
+ /** Change a member's role. Owner or admin only. */
720
+ async changeRole(params, options) {
721
+ return request(`/orgs/current/members/${params.memberId}`, {
722
+ method: "PATCH",
723
+ body: { role: params.role },
724
+ signal: options?.signal
725
+ });
726
+ },
727
+ /** Remove a member, or pass your own member id to leave. */
728
+ async remove(params, options) {
729
+ return request(`/orgs/current/members/${params.memberId}`, {
730
+ method: "DELETE",
731
+ signal: options?.signal
732
+ });
733
+ }
734
+ },
735
+ /** Pending invitations to the current organization. */
736
+ invitations: {
737
+ /** Cancel a pending invitation. Owner or admin only. */
738
+ async revoke(params, options) {
739
+ return request(`/orgs/current/invitations/${params.invitationId}`, {
740
+ method: "DELETE",
741
+ signal: options?.signal
742
+ });
743
+ } }
705
744
  };
706
745
  }
707
746
  //#endregion
@@ -736,8 +775,16 @@ function createAssetsResource(request) {
736
775
  }
737
776
  //#endregion
738
777
  //#region src/resources/team.ts
778
+ /**
779
+ * DEPRECATED. Use `client.orgs.members` and `client.orgs.invitations`.
780
+ *
781
+ * These wrap `/team/*`, which names a resource the API does not have: there is
782
+ * no team, only an organization with members and invitations. The endpoints
783
+ * still work and will keep working until the next major.
784
+ */
739
785
  function createTeamResource(request) {
740
786
  return {
787
+ /** @deprecated Use `client.orgs.members.invite()`. */
741
788
  async invite(params, options) {
742
789
  return request("/team/invite", {
743
790
  method: "POST",
@@ -745,13 +792,15 @@ function createTeamResource(request) {
745
792
  signal: options?.signal
746
793
  });
747
794
  },
795
+ /** @deprecated Use `client.orgs.members.changeRole()`. */
748
796
  async changeRole(params, options) {
749
797
  await request("/team/role", {
750
- method: "POST",
798
+ method: "PATCH",
751
799
  body: params,
752
800
  signal: options?.signal
753
801
  });
754
802
  },
803
+ /** @deprecated Use `client.orgs.members.remove()`. */
755
804
  async remove(params, options) {
756
805
  await request("/team/remove", {
757
806
  method: "POST",
@@ -759,6 +808,7 @@ function createTeamResource(request) {
759
808
  signal: options?.signal
760
809
  });
761
810
  },
811
+ /** @deprecated Use `client.orgs.invitations.revoke()`. */
762
812
  async revokeInvitation(params, options) {
763
813
  await request("/team/revoke-invitation", {
764
814
  method: "POST",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rendobar/sdk",
3
- "version": "5.5.0",
3
+ "version": "5.6.0",
4
4
  "type": "module",
5
5
  "description": "Rendobar SDK: TypeScript client for the media processing and AI generation API.",
6
6
  "license": "MIT",