@rixl/sdk 0.22.0 → 0.23.2

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.d.ts CHANGED
@@ -4086,6 +4086,10 @@ type AuthV1UpdateActiveMembershipRequest = {
4086
4086
  * membership_id
4087
4087
  */
4088
4088
  membership_id?: string;
4089
+ /**
4090
+ * org_id
4091
+ */
4092
+ org_id?: string;
4089
4093
  };
4090
4094
  /**
4091
4095
  * UpdateMemberRoleRequest
@@ -14741,7 +14745,17 @@ declare const respondToInvitation: (orgId: string, state: MembershipState.ACCEPT
14741
14745
  declare const publicRespondToInvitation: (token: string, state: MembershipState.ACCEPT | MembershipState.DECLINE) => Promise<void>;
14742
14746
  //#endregion
14743
14747
  //#region src/auth/membership/manage.d.ts
14744
- declare const updateActiveMembership: (membershipId: string) => Promise<void>;
14748
+ /**
14749
+ * Switches the caller's active organization.
14750
+ *
14751
+ * Identified by org id, not by `Membership.id`. The API models a membership as
14752
+ * the pair (user_id, org_id): every sibling endpoint takes `user.org_id` as a
14753
+ * path param, and this call's own `MembershipMutation` response is keyed by that
14754
+ * pair. `Membership.id` is a `user_id:org_id` concatenation that no endpoint
14755
+ * accepts — passing it here is rejected with "invalid membership ID". The
14756
+ * backend takes user_id from the bearer token.
14757
+ */
14758
+ declare const updateActiveMembership: (orgId: string) => Promise<void>;
14745
14759
  declare const updateMemberRole: (orgId: string, userId: string, role: AssignableRole) => Promise<void>;
14746
14760
  declare const deleteMember: (orgId: string, userId: string) => Promise<void>;
14747
14761
  declare const leaveOrganization: (orgId: string) => Promise<void>;
package/dist/index.js CHANGED
@@ -4204,10 +4204,20 @@ const ROLE_TO_PROTO = {
4204
4204
  admin: "MEMBERSHIP_ROLE_ADMIN",
4205
4205
  member: "MEMBERSHIP_ROLE_MEMBER"
4206
4206
  };
4207
- const updateActiveMembership = async (membershipId) => {
4207
+ /**
4208
+ * Switches the caller's active organization.
4209
+ *
4210
+ * Identified by org id, not by `Membership.id`. The API models a membership as
4211
+ * the pair (user_id, org_id): every sibling endpoint takes `user.org_id` as a
4212
+ * path param, and this call's own `MembershipMutation` response is keyed by that
4213
+ * pair. `Membership.id` is a `user_id:org_id` concatenation that no endpoint
4214
+ * accepts — passing it here is rejected with "invalid membership ID". The
4215
+ * backend takes user_id from the bearer token.
4216
+ */
4217
+ const updateActiveMembership = async (orgId) => {
4208
4218
  return apiCall(async () => {
4209
4219
  await authV1MembershipServiceUpdateActiveMembership({
4210
- body: { membership_id: membershipId },
4220
+ body: { user: { org_id: orgId } },
4211
4221
  throwOnError: true
4212
4222
  });
4213
4223
  accessToken.set(void 0);