Skip to content

Commit

Permalink
Add inviterUserId to invitation (#1040)
Browse files Browse the repository at this point in the history
## Description

Exposes the `inviterUserId` field on the `invitation` object.

## Documentation

Does this require changes to the WorkOS Docs? E.g. the [API
Reference](https://workos.com/docs/reference) or code snippets need
updates.

```
[ ] Yes
```

If yes, link a related docs PR and add a docs maintainer as a reviewer.
Their approval is required.
  • Loading branch information
blairworkos authored May 9, 2024
1 parent 727e037 commit 26e0d36
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/user-management/fixtures/invitation.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"revoked_at": "2023-07-18T02:07:19.911Z",
"expires_at": "2023-07-18T02:07:19.911Z",
"organization_id": "org_01H5JQDV7R7ATEYZDEG0W5PRYS",
"inviter_user_id": null,
"token": "Z1uX3RbwcIl5fIGJJJCXXisdI",
"accept_invitation_url": "https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI",
"created_at": "2023-07-18T02:07:19.911Z",
Expand Down
1 change: 1 addition & 0 deletions src/user-management/fixtures/list-invitations.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"revoked_at": "2023-07-18T02:07:19.911Z",
"expires_at": "2023-07-18T02:07:19.911Z",
"organization_id": "org_01H5JQDV7R7ATEYZDEG0W5PRYS",
"inviter_user_id": null,
"token": "Z1uX3RbwcIl5fIGJJJCXXisdI",
"accept_invitation_url": "https://myauthkit.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI",
"created_at": "2023-07-18T02:07:19.911Z",
Expand Down
4 changes: 4 additions & 0 deletions src/user-management/interfaces/invitation.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface Invitation {
revokedAt: string | null;
expiresAt: string;
organizationId: string | null;
inviterUserId: string | null;
token: string;
acceptInvitationUrl: string;
createdAt: string;
Expand All @@ -22,6 +23,7 @@ export interface InvitationEvent {
revokedAt: string | null;
expiresAt: string;
organizationId: string | null;
inviterUserId: string | null;
createdAt: string;
updatedAt: string;
}
Expand All @@ -35,6 +37,7 @@ export interface InvitationResponse {
revoked_at: string | null;
expires_at: string;
organization_id: string | null;
inviter_user_id: string | null;
token: string;
accept_invitation_url: string;
created_at: string;
Expand All @@ -50,6 +53,7 @@ export interface InvitationEventResponse {
revoked_at: string | null;
expires_at: string;
organization_id: string | null;
inviter_user_id: string | null;
created_at: string;
updated_at: string;
}
2 changes: 2 additions & 0 deletions src/user-management/serializers/invitation.serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const deserializeInvitation = (
revokedAt: invitation.revoked_at,
expiresAt: invitation.expires_at,
organizationId: invitation.organization_id,
inviterUserId: invitation.inviter_user_id,
token: invitation.token,
acceptInvitationUrl: invitation.accept_invitation_url,
createdAt: invitation.created_at,
Expand All @@ -33,6 +34,7 @@ export const deserializeInvitationEvent = (
revokedAt: invitation.revoked_at,
expiresAt: invitation.expires_at,
organizationId: invitation.organization_id,
inviterUserId: invitation.inviter_user_id,
createdAt: invitation.created_at,
updatedAt: invitation.updated_at,
});

0 comments on commit 26e0d36

Please sign in to comment.