4702 rename calendareventattendee to calendareventparticipant (#4761)
Closes #4702
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -34,6 +34,23 @@ export type ApiKeyToken = {
|
|||||||
token: Scalars['String'];
|
token: Scalars['String'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type AppToken = {
|
||||||
|
__typename?: 'AppToken';
|
||||||
|
createdAt: Scalars['DateTime'];
|
||||||
|
expiresAt: Scalars['DateTime'];
|
||||||
|
id: Scalars['ID'];
|
||||||
|
type: Scalars['String'];
|
||||||
|
updatedAt: Scalars['DateTime'];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type AppTokenEdge = {
|
||||||
|
__typename?: 'AppTokenEdge';
|
||||||
|
/** Cursor for this node. */
|
||||||
|
cursor: Scalars['ConnectionCursor'];
|
||||||
|
/** The node containing the AppToken */
|
||||||
|
node: AppToken;
|
||||||
|
};
|
||||||
|
|
||||||
export type AuthProviders = {
|
export type AuthProviders = {
|
||||||
__typename?: 'AuthProviders';
|
__typename?: 'AuthProviders';
|
||||||
google: Scalars['Boolean'];
|
google: Scalars['Boolean'];
|
||||||
@ -110,12 +127,6 @@ export type ClientConfig = {
|
|||||||
telemetry: Telemetry;
|
telemetry: Telemetry;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CreateRemoteServerInput = {
|
|
||||||
foreignDataWrapperOptions: Scalars['JSON'];
|
|
||||||
foreignDataWrapperType: Scalars['String'];
|
|
||||||
userMappingOptions?: InputMaybe<Scalars['JSON']>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type CursorPaging = {
|
export type CursorPaging = {
|
||||||
/** Paginate after opaque cursor */
|
/** Paginate after opaque cursor */
|
||||||
after?: InputMaybe<Scalars['ConnectionCursor']>;
|
after?: InputMaybe<Scalars['ConnectionCursor']>;
|
||||||
@ -271,12 +282,10 @@ export type Mutation = {
|
|||||||
authorizeApp: AuthorizeApp;
|
authorizeApp: AuthorizeApp;
|
||||||
challenge: LoginToken;
|
challenge: LoginToken;
|
||||||
checkoutSession: SessionEntity;
|
checkoutSession: SessionEntity;
|
||||||
|
createOneAppToken: AppToken;
|
||||||
createOneObject: Object;
|
createOneObject: Object;
|
||||||
createOneRefreshToken: RefreshToken;
|
|
||||||
createOneRemoteServer: RemoteServer;
|
|
||||||
deleteCurrentWorkspace: Workspace;
|
deleteCurrentWorkspace: Workspace;
|
||||||
deleteOneObject: Object;
|
deleteOneObject: Object;
|
||||||
deleteOneRemoteServer: RemoteServer;
|
|
||||||
deleteUser: User;
|
deleteUser: User;
|
||||||
emailPasswordResetLink: EmailPasswordResetLink;
|
emailPasswordResetLink: EmailPasswordResetLink;
|
||||||
generateApiKeyToken: ApiKeyToken;
|
generateApiKeyToken: ApiKeyToken;
|
||||||
@ -321,21 +330,11 @@ export type MutationCheckoutSessionArgs = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type MutationCreateOneRemoteServerArgs = {
|
|
||||||
input: CreateRemoteServerInput;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export type MutationDeleteOneObjectArgs = {
|
export type MutationDeleteOneObjectArgs = {
|
||||||
input: DeleteOneObjectInput;
|
input: DeleteOneObjectInput;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type MutationDeleteOneRemoteServerArgs = {
|
|
||||||
input: RemoteServerIdInput;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export type MutationEmailPasswordResetLinkArgs = {
|
export type MutationEmailPasswordResetLinkArgs = {
|
||||||
email: Scalars['String'];
|
email: Scalars['String'];
|
||||||
};
|
};
|
||||||
@ -358,7 +357,7 @@ export type MutationImpersonateArgs = {
|
|||||||
|
|
||||||
|
|
||||||
export type MutationRenewTokenArgs = {
|
export type MutationRenewTokenArgs = {
|
||||||
refreshToken: Scalars['String'];
|
appToken: Scalars['String'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -463,8 +462,6 @@ export type Query = {
|
|||||||
currentUser: User;
|
currentUser: User;
|
||||||
currentWorkspace: Workspace;
|
currentWorkspace: Workspace;
|
||||||
exchangeAuthorizationCode: ExchangeAuthCode;
|
exchangeAuthorizationCode: ExchangeAuthCode;
|
||||||
findManyRemoteServersByType: Array<RemoteServer>;
|
|
||||||
findOneRemoteServerById: RemoteServer;
|
|
||||||
findWorkspaceFromInviteHash: Workspace;
|
findWorkspaceFromInviteHash: Workspace;
|
||||||
getProductPrices: ProductPricesEntity;
|
getProductPrices: ProductPricesEntity;
|
||||||
getTimelineCalendarEventsFromCompanyId: TimelineCalendarEventsWithTotal;
|
getTimelineCalendarEventsFromCompanyId: TimelineCalendarEventsWithTotal;
|
||||||
@ -498,16 +495,6 @@ export type QueryExchangeAuthorizationCodeArgs = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type QueryFindManyRemoteServersByTypeArgs = {
|
|
||||||
input: RemoteServerTypeInput;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export type QueryFindOneRemoteServerByIdArgs = {
|
|
||||||
input: RemoteServerIdInput;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export type QueryFindWorkspaceFromInviteHashArgs = {
|
export type QueryFindWorkspaceFromInviteHashArgs = {
|
||||||
inviteHash: Scalars['String'];
|
inviteHash: Scalars['String'];
|
||||||
};
|
};
|
||||||
@ -550,22 +537,6 @@ export type QueryValidatePasswordResetTokenArgs = {
|
|||||||
passwordResetToken: Scalars['String'];
|
passwordResetToken: Scalars['String'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RefreshToken = {
|
|
||||||
__typename?: 'RefreshToken';
|
|
||||||
createdAt: Scalars['DateTime'];
|
|
||||||
expiresAt: Scalars['DateTime'];
|
|
||||||
id: Scalars['ID'];
|
|
||||||
updatedAt: Scalars['DateTime'];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type RefreshTokenEdge = {
|
|
||||||
__typename?: 'RefreshTokenEdge';
|
|
||||||
/** Cursor for this node. */
|
|
||||||
cursor: Scalars['ConnectionCursor'];
|
|
||||||
/** The node containing the RefreshToken */
|
|
||||||
node: RefreshToken;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type RelationConnection = {
|
export type RelationConnection = {
|
||||||
__typename?: 'RelationConnection';
|
__typename?: 'RelationConnection';
|
||||||
/** Array of edges. */
|
/** Array of edges. */
|
||||||
@ -620,14 +591,6 @@ export type RemoteServer = {
|
|||||||
updatedAt: Scalars['DateTime'];
|
updatedAt: Scalars['DateTime'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RemoteServerIdInput = {
|
|
||||||
/** The id of the record. */
|
|
||||||
id: Scalars['ID'];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type RemoteServerTypeInput = {
|
|
||||||
foreignDataWrapperType: Scalars['String'];
|
|
||||||
};
|
|
||||||
export type RemoteTable = {
|
export type RemoteTable = {
|
||||||
__typename?: 'RemoteTable';
|
__typename?: 'RemoteTable';
|
||||||
name: Scalars['String'];
|
name: Scalars['String'];
|
||||||
@ -677,7 +640,6 @@ export type Telemetry = {
|
|||||||
|
|
||||||
export type TimelineCalendarEvent = {
|
export type TimelineCalendarEvent = {
|
||||||
__typename?: 'TimelineCalendarEvent';
|
__typename?: 'TimelineCalendarEvent';
|
||||||
attendees: Array<TimelineCalendarEventAttendee>;
|
|
||||||
conferenceLink: LinkMetadata;
|
conferenceLink: LinkMetadata;
|
||||||
conferenceSolution: Scalars['String'];
|
conferenceSolution: Scalars['String'];
|
||||||
description: Scalars['String'];
|
description: Scalars['String'];
|
||||||
@ -686,13 +648,14 @@ export type TimelineCalendarEvent = {
|
|||||||
isCanceled: Scalars['Boolean'];
|
isCanceled: Scalars['Boolean'];
|
||||||
isFullDay: Scalars['Boolean'];
|
isFullDay: Scalars['Boolean'];
|
||||||
location: Scalars['String'];
|
location: Scalars['String'];
|
||||||
|
participants: Array<TimelineCalendarEventParticipant>;
|
||||||
startsAt: Scalars['DateTime'];
|
startsAt: Scalars['DateTime'];
|
||||||
title: Scalars['String'];
|
title: Scalars['String'];
|
||||||
visibility: TimelineCalendarEventVisibility;
|
visibility: TimelineCalendarEventVisibility;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TimelineCalendarEventAttendee = {
|
export type TimelineCalendarEventParticipant = {
|
||||||
__typename?: 'TimelineCalendarEventAttendee';
|
__typename?: 'TimelineCalendarEventParticipant';
|
||||||
avatarUrl: Scalars['String'];
|
avatarUrl: Scalars['String'];
|
||||||
displayName: Scalars['String'];
|
displayName: Scalars['String'];
|
||||||
firstName: Scalars['String'];
|
firstName: Scalars['String'];
|
||||||
@ -972,11 +935,11 @@ export type RelationEdge = {
|
|||||||
node: Relation;
|
node: Relation;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TimelineCalendarEventAttendeeFragmentFragment = { __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
|
export type TimelineCalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
|
||||||
|
|
||||||
export type TimelineCalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
|
export type TimelineCalendarEventParticipantFragmentFragment = { __typename?: 'TimelineCalendarEventParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
|
||||||
|
|
||||||
export type TimelineCalendarEventsWithTotalFragmentFragment = { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> };
|
export type TimelineCalendarEventsWithTotalFragmentFragment = { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> };
|
||||||
|
|
||||||
export type GetTimelineCalendarEventsFromCompanyIdQueryVariables = Exact<{
|
export type GetTimelineCalendarEventsFromCompanyIdQueryVariables = Exact<{
|
||||||
companyId: Scalars['ID'];
|
companyId: Scalars['ID'];
|
||||||
@ -985,7 +948,7 @@ export type GetTimelineCalendarEventsFromCompanyIdQueryVariables = Exact<{
|
|||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type GetTimelineCalendarEventsFromCompanyIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromCompanyId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
|
export type GetTimelineCalendarEventsFromCompanyIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromCompanyId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
|
||||||
|
|
||||||
export type GetTimelineCalendarEventsFromPersonIdQueryVariables = Exact<{
|
export type GetTimelineCalendarEventsFromPersonIdQueryVariables = Exact<{
|
||||||
personId: Scalars['ID'];
|
personId: Scalars['ID'];
|
||||||
@ -994,7 +957,7 @@ export type GetTimelineCalendarEventsFromPersonIdQueryVariables = Exact<{
|
|||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type GetTimelineCalendarEventsFromPersonIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromPersonId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
|
export type GetTimelineCalendarEventsFromPersonIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromPersonId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
|
||||||
|
|
||||||
export type ParticipantFragmentFragment = { __typename?: 'TimelineThreadParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
|
export type ParticipantFragmentFragment = { __typename?: 'TimelineThreadParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
|
||||||
|
|
||||||
@ -1085,7 +1048,7 @@ export type ImpersonateMutationVariables = Exact<{
|
|||||||
export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'Verify', user: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale: string, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, defaultWorkspace: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, domainName?: string | null, inviteHash?: string | null, allowImpersonation: boolean, subscriptionStatus: string, activationStatus: string, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: string, key: string, value: boolean, workspaceId: string }> | null }, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: string, logo?: string | null, displayName?: string | null, domainName?: string | null } | null }> }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
|
export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'Verify', user: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale: string, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, defaultWorkspace: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, domainName?: string | null, inviteHash?: string | null, allowImpersonation: boolean, subscriptionStatus: string, activationStatus: string, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: string, key: string, value: boolean, workspaceId: string }> | null }, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: string, logo?: string | null, displayName?: string | null, domainName?: string | null } | null }> }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
|
||||||
|
|
||||||
export type RenewTokenMutationVariables = Exact<{
|
export type RenewTokenMutationVariables = Exact<{
|
||||||
refreshToken: Scalars['String'];
|
appToken: Scalars['String'];
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
@ -1229,8 +1192,8 @@ export type GetWorkspaceFromInviteHashQueryVariables = Exact<{
|
|||||||
|
|
||||||
export type GetWorkspaceFromInviteHashQuery = { __typename?: 'Query', findWorkspaceFromInviteHash: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, allowImpersonation: boolean } };
|
export type GetWorkspaceFromInviteHashQuery = { __typename?: 'Query', findWorkspaceFromInviteHash: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, allowImpersonation: boolean } };
|
||||||
|
|
||||||
export const TimelineCalendarEventAttendeeFragmentFragmentDoc = gql`
|
export const TimelineCalendarEventParticipantFragmentFragmentDoc = gql`
|
||||||
fragment TimelineCalendarEventAttendeeFragment on TimelineCalendarEventAttendee {
|
fragment TimelineCalendarEventParticipantFragment on TimelineCalendarEventParticipant {
|
||||||
personId
|
personId
|
||||||
workspaceMemberId
|
workspaceMemberId
|
||||||
firstName
|
firstName
|
||||||
@ -1250,11 +1213,11 @@ export const TimelineCalendarEventFragmentFragmentDoc = gql`
|
|||||||
endsAt
|
endsAt
|
||||||
isFullDay
|
isFullDay
|
||||||
visibility
|
visibility
|
||||||
attendees {
|
participants {
|
||||||
...TimelineCalendarEventAttendeeFragment
|
...TimelineCalendarEventParticipantFragment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
${TimelineCalendarEventAttendeeFragmentFragmentDoc}`;
|
${TimelineCalendarEventParticipantFragmentFragmentDoc}`;
|
||||||
export const TimelineCalendarEventsWithTotalFragmentFragmentDoc = gql`
|
export const TimelineCalendarEventsWithTotalFragmentFragmentDoc = gql`
|
||||||
fragment TimelineCalendarEventsWithTotalFragment on TimelineCalendarEventsWithTotal {
|
fragment TimelineCalendarEventsWithTotalFragment on TimelineCalendarEventsWithTotal {
|
||||||
totalNumberOfCalendarEvents
|
totalNumberOfCalendarEvents
|
||||||
@ -1811,8 +1774,8 @@ export type ImpersonateMutationHookResult = ReturnType<typeof useImpersonateMuta
|
|||||||
export type ImpersonateMutationResult = Apollo.MutationResult<ImpersonateMutation>;
|
export type ImpersonateMutationResult = Apollo.MutationResult<ImpersonateMutation>;
|
||||||
export type ImpersonateMutationOptions = Apollo.BaseMutationOptions<ImpersonateMutation, ImpersonateMutationVariables>;
|
export type ImpersonateMutationOptions = Apollo.BaseMutationOptions<ImpersonateMutation, ImpersonateMutationVariables>;
|
||||||
export const RenewTokenDocument = gql`
|
export const RenewTokenDocument = gql`
|
||||||
mutation RenewToken($refreshToken: String!) {
|
mutation RenewToken($appToken: String!) {
|
||||||
renewToken(refreshToken: $refreshToken) {
|
renewToken(appToken: $appToken) {
|
||||||
tokens {
|
tokens {
|
||||||
...AuthTokensFragment
|
...AuthTokensFragment
|
||||||
}
|
}
|
||||||
@ -1834,7 +1797,7 @@ export type RenewTokenMutationFn = Apollo.MutationFunction<RenewTokenMutation, R
|
|||||||
* @example
|
* @example
|
||||||
* const [renewTokenMutation, { data, loading, error }] = useRenewTokenMutation({
|
* const [renewTokenMutation, { data, loading, error }] = useRenewTokenMutation({
|
||||||
* variables: {
|
* variables: {
|
||||||
* refreshToken: // value for 'refreshToken'
|
* appToken: // value for 'appToken'
|
||||||
* },
|
* },
|
||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -115,7 +115,7 @@ export const CalendarEventRow = ({
|
|||||||
: format(startsAt, 'HH:mm');
|
: format(startsAt, 'HH:mm');
|
||||||
const endTimeLabel = calendarEvent.isFullDay ? '' : format(endsAt, 'HH:mm');
|
const endTimeLabel = calendarEvent.isFullDay ? '' : format(endsAt, 'HH:mm');
|
||||||
|
|
||||||
const isCurrentWorkspaceMemberAttending = calendarEvent.attendees?.some(
|
const isCurrentWorkspaceMemberAttending = calendarEvent.participants?.some(
|
||||||
({ workspaceMemberId }) => workspaceMemberId === currentWorkspaceMember?.id,
|
({ workspaceMemberId }) => workspaceMemberId === currentWorkspaceMember?.id,
|
||||||
);
|
);
|
||||||
const showTitle = calendarEvent.visibility === 'SHARE_EVERYTHING';
|
const showTitle = calendarEvent.visibility === 'SHARE_EVERYTHING';
|
||||||
@ -154,19 +154,19 @@ export const CalendarEventRow = ({
|
|||||||
</StyledVisibilityCard>
|
</StyledVisibilityCard>
|
||||||
)}
|
)}
|
||||||
</StyledLabels>
|
</StyledLabels>
|
||||||
{!!calendarEvent.attendees?.length && (
|
{!!calendarEvent.participants?.length && (
|
||||||
<AvatarGroup
|
<AvatarGroup
|
||||||
avatars={calendarEvent.attendees.map((attendee) => (
|
avatars={calendarEvent.participants.map((participant) => (
|
||||||
<Avatar
|
<Avatar
|
||||||
key={[attendee.workspaceMemberId, attendee.displayName]
|
key={[participant.workspaceMemberId, participant.displayName]
|
||||||
.filter(isDefined)
|
.filter(isDefined)
|
||||||
.join('-')}
|
.join('-')}
|
||||||
avatarUrl={
|
avatarUrl={
|
||||||
attendee.workspaceMemberId === currentWorkspaceMember?.id
|
participant.workspaceMemberId === currentWorkspaceMember?.id
|
||||||
? currentWorkspaceMember?.avatarUrl
|
? currentWorkspaceMember?.avatarUrl
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
placeholder={attendee.displayName}
|
placeholder={participant.displayName}
|
||||||
type="rounded"
|
type="rounded"
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { sortDesc } from '~/utils/sort';
|
|||||||
|
|
||||||
type CalendarEventGeneric = Omit<
|
type CalendarEventGeneric = Omit<
|
||||||
CalendarEvent,
|
CalendarEvent,
|
||||||
'attendees' | 'externalCreatedAt'
|
'participants' | 'externalCreatedAt'
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export const useCalendarEvents = <T extends CalendarEventGeneric>(
|
export const useCalendarEvents = <T extends CalendarEventGeneric>(
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
import { gql } from '@apollo/client';
|
|
||||||
|
|
||||||
export const timelineCalendarEventAttendeeFragment = gql`
|
|
||||||
fragment TimelineCalendarEventAttendeeFragment on TimelineCalendarEventAttendee {
|
|
||||||
personId
|
|
||||||
workspaceMemberId
|
|
||||||
firstName
|
|
||||||
lastName
|
|
||||||
displayName
|
|
||||||
avatarUrl
|
|
||||||
handle
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import { gql } from '@apollo/client';
|
import { gql } from '@apollo/client';
|
||||||
|
|
||||||
import { timelineCalendarEventAttendeeFragment } from '@/activities/calendar/queries/fragments/timelineCalendarEventAttendeeFragment';
|
import { timelineCalendarEventParticipantFragment } from '@/activities/calendar/queries/fragments/timelineCalendarEventParticipantFragment';
|
||||||
|
|
||||||
export const timelineCalendarEventFragment = gql`
|
export const timelineCalendarEventFragment = gql`
|
||||||
fragment TimelineCalendarEventFragment on TimelineCalendarEvent {
|
fragment TimelineCalendarEventFragment on TimelineCalendarEvent {
|
||||||
@ -12,9 +12,9 @@ export const timelineCalendarEventFragment = gql`
|
|||||||
endsAt
|
endsAt
|
||||||
isFullDay
|
isFullDay
|
||||||
visibility
|
visibility
|
||||||
attendees {
|
participants {
|
||||||
...TimelineCalendarEventAttendeeFragment
|
...TimelineCalendarEventParticipantFragment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
${timelineCalendarEventAttendeeFragment}
|
${timelineCalendarEventParticipantFragment}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
import { gql } from '@apollo/client';
|
||||||
|
|
||||||
|
export const timelineCalendarEventParticipantFragment = gql`
|
||||||
|
fragment TimelineCalendarEventParticipantFragment on TimelineCalendarEventParticipant {
|
||||||
|
personId
|
||||||
|
workspaceMemberId
|
||||||
|
firstName
|
||||||
|
lastName
|
||||||
|
displayName
|
||||||
|
avatarUrl
|
||||||
|
handle
|
||||||
|
}
|
||||||
|
`;
|
||||||
@ -14,7 +14,7 @@ export type CalendarEvent = {
|
|||||||
startsAt: string;
|
startsAt: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
visibility: 'METADATA' | 'SHARE_EVERYTHING';
|
visibility: 'METADATA' | 'SHARE_EVERYTHING';
|
||||||
attendees?: {
|
participants?: {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
workspaceMemberId?: string;
|
workspaceMemberId?: string;
|
||||||
}[];
|
}[];
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { gql } from '@apollo/client';
|
import { gql } from '@apollo/client';
|
||||||
|
|
||||||
export const RENEW_TOKEN = gql`
|
export const RENEW_TOKEN = gql`
|
||||||
mutation RenewToken($refreshToken: String!) {
|
mutation RenewToken($appToken: String!) {
|
||||||
renewToken(refreshToken: $refreshToken) {
|
renewToken(appToken: $appToken) {
|
||||||
tokens {
|
tokens {
|
||||||
...AuthTokensFragment
|
...AuthTokensFragment
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ const renewTokenMutation = async (
|
|||||||
>({
|
>({
|
||||||
mutation: RenewTokenDocument,
|
mutation: RenewTokenDocument,
|
||||||
variables: {
|
variables: {
|
||||||
refreshToken: refreshToken,
|
appToken: refreshToken,
|
||||||
},
|
},
|
||||||
fetchPolicy: 'network-only',
|
fetchPolicy: 'network-only',
|
||||||
});
|
});
|
||||||
|
|||||||
@ -51,7 +51,7 @@ export const SettingsAccountsCalendars = () => {
|
|||||||
const exampleDayTime = startOfDay(exampleStartDate).getTime();
|
const exampleDayTime = startOfDay(exampleStartDate).getTime();
|
||||||
const exampleCalendarEvent: TimelineCalendarEvent = {
|
const exampleCalendarEvent: TimelineCalendarEvent = {
|
||||||
id: '',
|
id: '',
|
||||||
attendees: [
|
participants: [
|
||||||
{
|
{
|
||||||
firstName: currentWorkspaceMember?.name.firstName || '',
|
firstName: currentWorkspaceMember?.name.firstName || '',
|
||||||
lastName: currentWorkspaceMember?.name.lastName || '',
|
lastName: currentWorkspaceMember?.name.lastName || '',
|
||||||
|
|||||||
@ -10,7 +10,7 @@ export const mockedCalendarEvents: CalendarEvent[] = [
|
|||||||
isFullDay: false,
|
isFullDay: false,
|
||||||
startsAt: addDays(new Date().setHours(10, 0), 1).toISOString(),
|
startsAt: addDays(new Date().setHours(10, 0), 1).toISOString(),
|
||||||
visibility: 'METADATA',
|
visibility: 'METADATA',
|
||||||
attendees: [
|
participants: [
|
||||||
{ displayName: 'John Doe', workspaceMemberId: 'john-doe' },
|
{ displayName: 'John Doe', workspaceMemberId: 'john-doe' },
|
||||||
{ displayName: 'Jane Doe', workspaceMemberId: 'jane-doe' },
|
{ displayName: 'Jane Doe', workspaceMemberId: 'jane-doe' },
|
||||||
{ displayName: 'Tim Apple', workspaceMemberId: 'tim-apple' },
|
{ displayName: 'Tim Apple', workspaceMemberId: 'tim-apple' },
|
||||||
|
|||||||
@ -1443,9 +1443,9 @@ const mockedCalendarEventsMetadata = {
|
|||||||
__typename: 'field',
|
__typename: 'field',
|
||||||
id: '07880d2d-4f08-458f-be0b-876402d2a769',
|
id: '07880d2d-4f08-458f-be0b-876402d2a769',
|
||||||
type: 'RELATION',
|
type: 'RELATION',
|
||||||
name: 'eventAttendees',
|
name: 'eventParticipants',
|
||||||
label: 'Event Attendees',
|
label: 'Event Participants',
|
||||||
description: 'Event Attendees',
|
description: 'Event Participants',
|
||||||
icon: 'IconUserCircle',
|
icon: 'IconUserCircle',
|
||||||
isCustom: false,
|
isCustom: false,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
@ -1465,8 +1465,8 @@ const mockedCalendarEventsMetadata = {
|
|||||||
__typename: 'object',
|
__typename: 'object',
|
||||||
id: '4adb1b1a-9643-4d1c-a2a0-b1b02ae192ad',
|
id: '4adb1b1a-9643-4d1c-a2a0-b1b02ae192ad',
|
||||||
dataSourceId: 'fa94b810-e848-490c-a5f7-24a1ee5bfaa6',
|
dataSourceId: 'fa94b810-e848-490c-a5f7-24a1ee5bfaa6',
|
||||||
nameSingular: 'calendarEventAttendee',
|
nameSingular: 'calendarEventParticipant',
|
||||||
namePlural: 'calendarEventAttendees',
|
namePlural: 'calendarEventParticipants',
|
||||||
isSystem: true,
|
isSystem: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { ObjectType, Field, ID } from '@nestjs/graphql';
|
import { ObjectType, Field, ID } from '@nestjs/graphql';
|
||||||
|
|
||||||
@ObjectType('TimelineCalendarEventAttendee')
|
@ObjectType('TimelineCalendarEventParticipant')
|
||||||
export class TimelineCalendarEventAttendee {
|
export class TimelineCalendarEventParticipant {
|
||||||
@Field(() => ID, { nullable: true })
|
@Field(() => ID, { nullable: true })
|
||||||
personId: string;
|
personId: string;
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import { ObjectType, ID, Field, registerEnumType } from '@nestjs/graphql';
|
import { ObjectType, ID, Field, registerEnumType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { TimelineCalendarEventAttendee } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event-attendee.dto';
|
import { TimelineCalendarEventParticipant } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto';
|
||||||
|
|
||||||
export enum TimelineCalendarEventVisibility {
|
export enum TimelineCalendarEventVisibility {
|
||||||
METADATA = 'METADATA',
|
METADATA = 'METADATA',
|
||||||
@ -53,8 +53,8 @@ export class TimelineCalendarEvent {
|
|||||||
@Field(() => LinkMetadata)
|
@Field(() => LinkMetadata)
|
||||||
conferenceLink: LinkMetadata;
|
conferenceLink: LinkMetadata;
|
||||||
|
|
||||||
@Field(() => [TimelineCalendarEventAttendee])
|
@Field(() => [TimelineCalendarEventParticipant])
|
||||||
attendees: TimelineCalendarEventAttendee[];
|
participants: TimelineCalendarEventParticipant[];
|
||||||
|
|
||||||
@Field(() => TimelineCalendarEventVisibility)
|
@Field(() => TimelineCalendarEventVisibility)
|
||||||
visibility: TimelineCalendarEventVisibility;
|
visibility: TimelineCalendarEventVisibility;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { Injectable } from '@nestjs/common';
|
|||||||
import groupBy from 'lodash.groupby';
|
import groupBy from 'lodash.groupby';
|
||||||
|
|
||||||
import { TIMELINE_CALENDAR_EVENTS_DEFAULT_PAGE_SIZE } from 'src/engine/core-modules/calendar/constants/calendar.constants';
|
import { TIMELINE_CALENDAR_EVENTS_DEFAULT_PAGE_SIZE } from 'src/engine/core-modules/calendar/constants/calendar.constants';
|
||||||
import { TimelineCalendarEventAttendee } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event-attendee.dto';
|
import { TimelineCalendarEventParticipant } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto';
|
||||||
import {
|
import {
|
||||||
TimelineCalendarEvent,
|
TimelineCalendarEvent,
|
||||||
TimelineCalendarEventVisibility,
|
TimelineCalendarEventVisibility,
|
||||||
@ -11,10 +11,10 @@ import {
|
|||||||
import { TimelineCalendarEventsWithTotal } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-events-with-total.dto';
|
import { TimelineCalendarEventsWithTotal } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-events-with-total.dto';
|
||||||
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
||||||
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
|
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
|
|
||||||
type TimelineCalendarEventAttendeeWithPersonInformation =
|
type TimelineCalendarEventParticipantWithPersonInformation =
|
||||||
ObjectRecord<CalendarEventAttendeeObjectMetadata> & {
|
ObjectRecord<CalendarEventParticipantObjectMetadata> & {
|
||||||
personFirstName: string;
|
personFirstName: string;
|
||||||
personLastName: string;
|
personLastName: string;
|
||||||
personAvatarUrl: string;
|
personAvatarUrl: string;
|
||||||
@ -40,18 +40,18 @@ export class TimelineCalendarEventService {
|
|||||||
const dataSourceSchema =
|
const dataSourceSchema =
|
||||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||||
|
|
||||||
const calendarEvents: Omit<TimelineCalendarEvent, 'attendees'>[] =
|
const calendarEvents: Omit<TimelineCalendarEvent, 'participants'>[] =
|
||||||
await this.workspaceDataSourceService.executeRawQuery(
|
await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`SELECT
|
`SELECT
|
||||||
"calendarEvent".*
|
"calendarEvent".*
|
||||||
FROM
|
FROM
|
||||||
${dataSourceSchema}."calendarEvent" "calendarEvent"
|
${dataSourceSchema}."calendarEvent" "calendarEvent"
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
${dataSourceSchema}."calendarEventAttendee" "calendarEventAttendee" ON "calendarEvent".id = "calendarEventAttendee"."calendarEventId"
|
${dataSourceSchema}."calendarEventParticipant" "calendarEventParticipant" ON "calendarEvent".id = "calendarEventParticipant"."calendarEventId"
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
${dataSourceSchema}."person" "person" ON "calendarEventAttendee"."personId" = "person".id
|
${dataSourceSchema}."person" "person" ON "calendarEventParticipant"."personId" = "person".id
|
||||||
WHERE
|
WHERE
|
||||||
"calendarEventAttendee"."personId" = ANY($1)
|
"calendarEventParticipant"."personId" = ANY($1)
|
||||||
GROUP BY
|
GROUP BY
|
||||||
"calendarEvent".id
|
"calendarEvent".id
|
||||||
ORDER BY
|
ORDER BY
|
||||||
@ -69,10 +69,10 @@ export class TimelineCalendarEventService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const calendarEventAttendees: TimelineCalendarEventAttendeeWithPersonInformation[] =
|
const calendarEventParticipants: TimelineCalendarEventParticipantWithPersonInformation[] =
|
||||||
await this.workspaceDataSourceService.executeRawQuery(
|
await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`SELECT
|
`SELECT
|
||||||
"calendarEventAttendee".*,
|
"calendarEventParticipant".*,
|
||||||
"person"."nameFirstName" as "personFirstName",
|
"person"."nameFirstName" as "personFirstName",
|
||||||
"person"."nameLastName" as "personLastName",
|
"person"."nameLastName" as "personLastName",
|
||||||
"person"."avatarUrl" as "personAvatarUrl",
|
"person"."avatarUrl" as "personAvatarUrl",
|
||||||
@ -80,46 +80,52 @@ export class TimelineCalendarEventService {
|
|||||||
"workspaceMember"."nameLastName" as "workspaceMemberLastName",
|
"workspaceMember"."nameLastName" as "workspaceMemberLastName",
|
||||||
"workspaceMember"."avatarUrl" as "workspaceMemberAvatarUrl"
|
"workspaceMember"."avatarUrl" as "workspaceMemberAvatarUrl"
|
||||||
FROM
|
FROM
|
||||||
${dataSourceSchema}."calendarEventAttendee" "calendarEventAttendee"
|
${dataSourceSchema}."calendarEventParticipant" "calendarEventParticipant"
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
${dataSourceSchema}."person" "person" ON "calendarEventAttendee"."personId" = "person".id
|
${dataSourceSchema}."person" "person" ON "calendarEventParticipant"."personId" = "person".id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
${dataSourceSchema}."workspaceMember" "workspaceMember" ON "calendarEventAttendee"."workspaceMemberId" = "workspaceMember".id
|
${dataSourceSchema}."workspaceMember" "workspaceMember" ON "calendarEventParticipant"."workspaceMemberId" = "workspaceMember".id
|
||||||
WHERE
|
WHERE
|
||||||
"calendarEventAttendee"."calendarEventId" = ANY($1)`,
|
"calendarEventParticipant"."calendarEventId" = ANY($1)`,
|
||||||
[calendarEvents.map((event) => event.id)],
|
[calendarEvents.map((event) => event.id)],
|
||||||
workspaceId,
|
workspaceId,
|
||||||
);
|
);
|
||||||
|
|
||||||
const formattedCalendarEventAttendees: TimelineCalendarEventAttendee[] =
|
const formattedCalendarEventParticipants: TimelineCalendarEventParticipant[] =
|
||||||
calendarEventAttendees.map((attendee) => {
|
calendarEventParticipants.map((participant) => {
|
||||||
const firstName =
|
const firstName =
|
||||||
attendee.personFirstName || attendee.workspaceMemberFirstName || '';
|
participant.personFirstName ||
|
||||||
|
participant.workspaceMemberFirstName ||
|
||||||
|
'';
|
||||||
|
|
||||||
const lastName =
|
const lastName =
|
||||||
attendee.personLastName || attendee.workspaceMemberLastName || '';
|
participant.personLastName ||
|
||||||
|
participant.workspaceMemberLastName ||
|
||||||
|
'';
|
||||||
|
|
||||||
const displayName =
|
const displayName =
|
||||||
firstName || attendee.displayName || attendee.handle;
|
firstName || participant.displayName || participant.handle;
|
||||||
|
|
||||||
const avatarUrl =
|
const avatarUrl =
|
||||||
attendee.personAvatarUrl || attendee.workspaceMemberAvatarUrl || '';
|
participant.personAvatarUrl ||
|
||||||
|
participant.workspaceMemberAvatarUrl ||
|
||||||
|
'';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
calendarEventId: attendee.calendarEventId,
|
calendarEventId: participant.calendarEventId,
|
||||||
personId: attendee.personId,
|
personId: participant.personId,
|
||||||
workspaceMemberId: attendee.workspaceMemberId,
|
workspaceMemberId: participant.workspaceMemberId,
|
||||||
firstName,
|
firstName,
|
||||||
lastName,
|
lastName,
|
||||||
displayName,
|
displayName,
|
||||||
avatarUrl,
|
avatarUrl,
|
||||||
handle: attendee.handle,
|
handle: participant.handle,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const calendarEventAttendeesByEventId: {
|
const calendarEventParticipantsByEventId: {
|
||||||
[calendarEventId: string]: TimelineCalendarEventAttendee[];
|
[calendarEventId: string]: TimelineCalendarEventParticipant[];
|
||||||
} = groupBy(formattedCalendarEventAttendees, 'calendarEventId');
|
} = groupBy(formattedCalendarEventParticipants, 'calendarEventId');
|
||||||
|
|
||||||
const totalNumberOfCalendarEvents: { count: number }[] =
|
const totalNumberOfCalendarEvents: { count: number }[] =
|
||||||
await this.workspaceDataSourceService.executeRawQuery(
|
await this.workspaceDataSourceService.executeRawQuery(
|
||||||
@ -127,46 +133,46 @@ export class TimelineCalendarEventService {
|
|||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT "calendarEventId")
|
COUNT(DISTINCT "calendarEventId")
|
||||||
FROM
|
FROM
|
||||||
${dataSourceSchema}."calendarEventAttendee" "calendarEventAttendee"
|
${dataSourceSchema}."calendarEventParticipant" "calendarEventParticipant"
|
||||||
WHERE
|
WHERE
|
||||||
"calendarEventAttendee"."personId" = ANY($1)
|
"calendarEventParticipant"."personId" = ANY($1)
|
||||||
`,
|
`,
|
||||||
[personIds],
|
[personIds],
|
||||||
workspaceId,
|
workspaceId,
|
||||||
);
|
);
|
||||||
|
|
||||||
const timelineCalendarEvents = calendarEvents.map((event) => {
|
const timelineCalendarEvents = calendarEvents.map((event) => {
|
||||||
const attendees = calendarEventAttendeesByEventId[event.id] || [];
|
const participants = calendarEventParticipantsByEventId[event.id] || [];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...event,
|
...event,
|
||||||
attendees,
|
participants,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const calendarEventIdsWithWorkspaceMemberInAttendees =
|
const calendarEventIdsWithWorkspaceMemberInParticipants =
|
||||||
await this.workspaceDataSourceService.executeRawQuery(
|
await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`
|
`
|
||||||
SELECT
|
SELECT
|
||||||
"calendarEventId"
|
"calendarEventId"
|
||||||
FROM
|
FROM
|
||||||
${dataSourceSchema}."calendarEventAttendee" "calendarEventAttendee"
|
${dataSourceSchema}."calendarEventParticipant" "calendarEventParticipant"
|
||||||
WHERE
|
WHERE
|
||||||
"calendarEventAttendee"."workspaceMemberId" = $1
|
"calendarEventParticipant"."workspaceMemberId" = $1
|
||||||
`,
|
`,
|
||||||
[workspaceMemberId],
|
[workspaceMemberId],
|
||||||
workspaceId,
|
workspaceId,
|
||||||
);
|
);
|
||||||
|
|
||||||
const calendarEventIdsWithWorkspaceMemberInAttendeesFormatted =
|
const calendarEventIdsWithWorkspaceMemberInParticipantsFormatted =
|
||||||
calendarEventIdsWithWorkspaceMemberInAttendees.map(
|
calendarEventIdsWithWorkspaceMemberInParticipants.map(
|
||||||
(event: { calendarEventId: string }) => event.calendarEventId,
|
(event: { calendarEventId: string }) => event.calendarEventId,
|
||||||
);
|
);
|
||||||
|
|
||||||
const calendarEventIdsToFetchVisibilityFor = timelineCalendarEvents
|
const calendarEventIdsToFetchVisibilityFor = timelineCalendarEvents
|
||||||
.filter(
|
.filter(
|
||||||
(event) =>
|
(event) =>
|
||||||
!calendarEventIdsWithWorkspaceMemberInAttendeesFormatted.includes(
|
!calendarEventIdsWithWorkspaceMemberInParticipantsFormatted.includes(
|
||||||
event.id,
|
event.id,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@ -37,7 +37,6 @@ export enum FieldMetadataType {
|
|||||||
RELATION = 'RELATION',
|
RELATION = 'RELATION',
|
||||||
POSITION = 'POSITION',
|
POSITION = 'POSITION',
|
||||||
ADDRESS = 'ADDRESS',
|
ADDRESS = 'ADDRESS',
|
||||||
JSON = 'JSON',
|
|
||||||
RAW_JSON = 'RAW_JSON',
|
RAW_JSON = 'RAW_JSON',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { CalendarChannelEventAssociationRepository } from 'src/modules/calendar/repositories/calendar-channel-event-association.repository';
|
import { CalendarChannelEventAssociationRepository } from 'src/modules/calendar/repositories/calendar-channel-event-association.repository';
|
||||||
import { CalendarChannelRepository } from 'src/modules/calendar/repositories/calendar-channel.repository';
|
import { CalendarChannelRepository } from 'src/modules/calendar/repositories/calendar-channel.repository';
|
||||||
import { CalendarEventAttendeeRepository } from 'src/modules/calendar/repositories/calendar-event-attendee.repository';
|
import { CalendarEventParticipantRepository } from 'src/modules/calendar/repositories/calendar-event-participant.repository';
|
||||||
import { CalendarEventRepository } from 'src/modules/calendar/repositories/calendar-event.repository';
|
import { CalendarEventRepository } from 'src/modules/calendar/repositories/calendar-event.repository';
|
||||||
import { CompanyRepository } from 'src/modules/company/repositories/company.repository';
|
import { CompanyRepository } from 'src/modules/company/repositories/company.repository';
|
||||||
import { BlocklistRepository } from 'src/modules/connected-account/repositories/blocklist.repository';
|
import { BlocklistRepository } from 'src/modules/connected-account/repositories/blocklist.repository';
|
||||||
@ -19,7 +19,7 @@ export const metadataToRepositoryMapping = {
|
|||||||
CalendarChannelEventAssociationObjectMetadata:
|
CalendarChannelEventAssociationObjectMetadata:
|
||||||
CalendarChannelEventAssociationRepository,
|
CalendarChannelEventAssociationRepository,
|
||||||
CalendarChannelObjectMetadata: CalendarChannelRepository,
|
CalendarChannelObjectMetadata: CalendarChannelRepository,
|
||||||
CalendarEventAttendeeObjectMetadata: CalendarEventAttendeeRepository,
|
CalendarEventParticipantObjectMetadata: CalendarEventParticipantRepository,
|
||||||
CalendarEventObjectMetadata: CalendarEventRepository,
|
CalendarEventObjectMetadata: CalendarEventRepository,
|
||||||
CompanyObjectMetadata: CompanyRepository,
|
CompanyObjectMetadata: CompanyRepository,
|
||||||
ConnectedAccountObjectMetadata: ConnectedAccountRepository,
|
ConnectedAccountObjectMetadata: ConnectedAccountRepository,
|
||||||
|
|||||||
@ -72,7 +72,7 @@ export const calendarChannelStandardFieldIds = {
|
|||||||
calendarChannelEventAssociations: '20202020-afb0-4a9f-979f-2d5087d71d09',
|
calendarChannelEventAssociations: '20202020-afb0-4a9f-979f-2d5087d71d09',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const calendarEventAttendeeStandardFieldIds = {
|
export const calendarEventParticipantStandardFieldIds = {
|
||||||
calendarEvent: '20202020-fe3a-401c-b889-af4f4657a861',
|
calendarEvent: '20202020-fe3a-401c-b889-af4f4657a861',
|
||||||
handle: '20202020-8692-4580-8210-9e09cbd031a7',
|
handle: '20202020-8692-4580-8210-9e09cbd031a7',
|
||||||
displayName: '20202020-ee1e-4f9f-8ac1-5c0b2f69691e',
|
displayName: '20202020-ee1e-4f9f-8ac1-5c0b2f69691e',
|
||||||
@ -97,7 +97,7 @@ export const calendarEventStandardFieldIds = {
|
|||||||
conferenceLink: '20202020-35da-43ef-9ca0-e936e9dc237b',
|
conferenceLink: '20202020-35da-43ef-9ca0-e936e9dc237b',
|
||||||
recurringEventExternalId: '20202020-4b96-43d0-8156-4c7a9717635c',
|
recurringEventExternalId: '20202020-4b96-43d0-8156-4c7a9717635c',
|
||||||
calendarChannelEventAssociations: '20202020-bdf8-4572-a2cc-ecbb6bcc3a02',
|
calendarChannelEventAssociations: '20202020-bdf8-4572-a2cc-ecbb6bcc3a02',
|
||||||
eventAttendees: '20202020-e07e-4ccb-88f5-6f3d00458eec',
|
eventParticipants: '20202020-e07e-4ccb-88f5-6f3d00458eec',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const commentStandardFieldIds = {
|
export const commentStandardFieldIds = {
|
||||||
@ -232,7 +232,7 @@ export const personStandardFieldIds = {
|
|||||||
favorites: '20202020-4073-4117-9cf1-203bcdc91cbd',
|
favorites: '20202020-4073-4117-9cf1-203bcdc91cbd',
|
||||||
attachments: '20202020-cd97-451f-87fa-bcb789bdbf3a',
|
attachments: '20202020-cd97-451f-87fa-bcb789bdbf3a',
|
||||||
messageParticipants: '20202020-498e-4c61-8158-fa04f0638334',
|
messageParticipants: '20202020-498e-4c61-8158-fa04f0638334',
|
||||||
calendarEventAttendees: '20202020-52ee-45e9-a702-b64b3753e3a9',
|
calendarEventParticipants: '20202020-52ee-45e9-a702-b64b3753e3a9',
|
||||||
events: '20202020-a43e-4873-9c23-e522de906ce5',
|
events: '20202020-a43e-4873-9c23-e522de906ce5',
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ export const workspaceMemberStandardFieldIds = {
|
|||||||
connectedAccounts: '20202020-e322-4bde-a525-727079b4a100',
|
connectedAccounts: '20202020-e322-4bde-a525-727079b4a100',
|
||||||
messageParticipants: '20202020-8f99-48bc-a5eb-edd33dd54188',
|
messageParticipants: '20202020-8f99-48bc-a5eb-edd33dd54188',
|
||||||
blocklist: '20202020-6cb2-4161-9f29-a4b7f1283859',
|
blocklist: '20202020-6cb2-4161-9f29-a4b7f1283859',
|
||||||
calendarEventAttendees: '20202020-0dbc-4841-9ce1-3e793b5b3512',
|
calendarEventParticipants: '20202020-0dbc-4841-9ce1-3e793b5b3512',
|
||||||
events: '20202020-e15b-47b8-94fe-8200e3c66615',
|
events: '20202020-e15b-47b8-94fe-8200e3c66615',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export const standardObjectIds = {
|
|||||||
blocklist: '20202020-0408-4f38-b8a8-4d5e3e26e24d',
|
blocklist: '20202020-0408-4f38-b8a8-4d5e3e26e24d',
|
||||||
calendarChannelEventAssociation: '20202020-491b-4aaa-9825-afd1bae6ae00',
|
calendarChannelEventAssociation: '20202020-491b-4aaa-9825-afd1bae6ae00',
|
||||||
calendarChannel: '20202020-e8f2-40e1-a39c-c0e0039c5034',
|
calendarChannel: '20202020-e8f2-40e1-a39c-c0e0039c5034',
|
||||||
calendarEventAttendee: '20202020-a1c3-47a6-9732-27e5b1e8436d',
|
calendarEventParticipant: '20202020-a1c3-47a6-9732-27e5b1e8436d',
|
||||||
calendarEvent: '20202020-8f1d-4eef-9f85-0d1965e27221',
|
calendarEvent: '20202020-8f1d-4eef-9f85-0d1965e27221',
|
||||||
comment: '20202020-435f-4de9-89b5-97e32233bf5f',
|
comment: '20202020-435f-4de9-89b5-97e32233bf5f',
|
||||||
company: '20202020-b374-4779-a561-80086cb2e17f',
|
company: '20202020-b374-4779-a561-80086cb2e17f',
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { AttachmentObjectMetadata } from 'src/modules/attachment/standard-object
|
|||||||
import { BlocklistObjectMetadata } from 'src/modules/connected-account/standard-objects/blocklist.object-metadata';
|
import { BlocklistObjectMetadata } from 'src/modules/connected-account/standard-objects/blocklist.object-metadata';
|
||||||
import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event.object-metadata';
|
import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event.object-metadata';
|
||||||
import { CalendarChannelObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel.object-metadata';
|
import { CalendarChannelObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel.object-metadata';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { CommentObjectMetadata } from 'src/modules/activity/standard-objects/comment.object-metadata';
|
import { CommentObjectMetadata } from 'src/modules/activity/standard-objects/comment.object-metadata';
|
||||||
import { CompanyObjectMetadata } from 'src/modules/company/standard-objects/company.object-metadata';
|
import { CompanyObjectMetadata } from 'src/modules/company/standard-objects/company.object-metadata';
|
||||||
import { ConnectedAccountObjectMetadata } from 'src/modules/connected-account/standard-objects/connected-account.object-metadata';
|
import { ConnectedAccountObjectMetadata } from 'src/modules/connected-account/standard-objects/connected-account.object-metadata';
|
||||||
@ -53,5 +53,5 @@ export const standardObjectMetadataDefinitions = [
|
|||||||
CalendarEventObjectMetadata,
|
CalendarEventObjectMetadata,
|
||||||
CalendarChannelObjectMetadata,
|
CalendarChannelObjectMetadata,
|
||||||
CalendarChannelEventAssociationObjectMetadata,
|
CalendarChannelEventAssociationObjectMetadata,
|
||||||
CalendarEventAttendeeObjectMetadata,
|
CalendarEventParticipantObjectMetadata,
|
||||||
];
|
];
|
||||||
|
|||||||
@ -5,25 +5,25 @@ import differenceWith from 'lodash.differencewith';
|
|||||||
|
|
||||||
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
||||||
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
|
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/modules/calendar/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
|
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/modules/calendar/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
|
||||||
import {
|
import {
|
||||||
CalendarEventAttendee,
|
CalendarEventParticipant,
|
||||||
CalendarEventAttendeeWithId,
|
CalendarEventParticipantWithId,
|
||||||
} from 'src/modules/calendar/types/calendar-event';
|
} from 'src/modules/calendar/types/calendar-event';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CalendarEventAttendeeRepository {
|
export class CalendarEventParticipantRepository {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public async getByIds(
|
public async getByIds(
|
||||||
calendarEventAttendeeIds: string[],
|
calendarEventParticipantIds: string[],
|
||||||
workspaceId: string,
|
workspaceId: string,
|
||||||
transactionManager?: EntityManager,
|
transactionManager?: EntityManager,
|
||||||
): Promise<ObjectRecord<CalendarEventAttendeeObjectMetadata>[]> {
|
): Promise<ObjectRecord<CalendarEventParticipantObjectMetadata>[]> {
|
||||||
if (calendarEventAttendeeIds.length === 0) {
|
if (calendarEventParticipantIds.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,8 +31,8 @@ export class CalendarEventAttendeeRepository {
|
|||||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||||
|
|
||||||
return await this.workspaceDataSourceService.executeRawQuery(
|
return await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`SELECT * FROM ${dataSourceSchema}."calendarEventAttendee" WHERE "id" = ANY($1)`,
|
`SELECT * FROM ${dataSourceSchema}."calendarEventParticipant" WHERE "id" = ANY($1)`,
|
||||||
[calendarEventAttendeeIds],
|
[calendarEventParticipantIds],
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
@ -42,7 +42,7 @@ export class CalendarEventAttendeeRepository {
|
|||||||
calendarEventIds: string[],
|
calendarEventIds: string[],
|
||||||
workspaceId: string,
|
workspaceId: string,
|
||||||
transactionManager?: EntityManager,
|
transactionManager?: EntityManager,
|
||||||
): Promise<ObjectRecord<CalendarEventAttendeeObjectMetadata>[]> {
|
): Promise<ObjectRecord<CalendarEventParticipantObjectMetadata>[]> {
|
||||||
if (calendarEventIds.length === 0) {
|
if (calendarEventIds.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ export class CalendarEventAttendeeRepository {
|
|||||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||||
|
|
||||||
return await this.workspaceDataSourceService.executeRawQuery(
|
return await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`SELECT * FROM ${dataSourceSchema}."calendarEventAttendee" WHERE "calendarEventId" = ANY($1)`,
|
`SELECT * FROM ${dataSourceSchema}."calendarEventParticipant" WHERE "calendarEventId" = ANY($1)`,
|
||||||
[calendarEventIds],
|
[calendarEventIds],
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
@ -59,11 +59,11 @@ export class CalendarEventAttendeeRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async deleteByIds(
|
public async deleteByIds(
|
||||||
calendarEventAttendeeIds: string[],
|
calendarEventParticipantIds: string[],
|
||||||
workspaceId: string,
|
workspaceId: string,
|
||||||
transactionManager?: EntityManager,
|
transactionManager?: EntityManager,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (calendarEventAttendeeIds.length === 0) {
|
if (calendarEventParticipantIds.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,20 +71,20 @@ export class CalendarEventAttendeeRepository {
|
|||||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||||
|
|
||||||
await this.workspaceDataSourceService.executeRawQuery(
|
await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`DELETE FROM ${dataSourceSchema}."calendarEventAttendee" WHERE "id" = ANY($1)`,
|
`DELETE FROM ${dataSourceSchema}."calendarEventParticipant" WHERE "id" = ANY($1)`,
|
||||||
[calendarEventAttendeeIds],
|
[calendarEventParticipantIds],
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async updateCalendarEventAttendees(
|
public async updateCalendarEventParticipants(
|
||||||
calendarEventAttendees: CalendarEventAttendee[],
|
calendarEventParticipants: CalendarEventParticipant[],
|
||||||
iCalUIDCalendarEventIdMap: Map<string, string>,
|
iCalUIDCalendarEventIdMap: Map<string, string>,
|
||||||
workspaceId: string,
|
workspaceId: string,
|
||||||
transactionManager?: EntityManager,
|
transactionManager?: EntityManager,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (calendarEventAttendees.length === 0) {
|
if (calendarEventParticipants.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,33 +93,36 @@ export class CalendarEventAttendeeRepository {
|
|||||||
|
|
||||||
const calendarEventIds = Array.from(iCalUIDCalendarEventIdMap.values());
|
const calendarEventIds = Array.from(iCalUIDCalendarEventIdMap.values());
|
||||||
|
|
||||||
const existingCalendarEventAttendees = await this.getByCalendarEventIds(
|
const existingCalendarEventParticipants = await this.getByCalendarEventIds(
|
||||||
calendarEventIds,
|
calendarEventIds,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
|
|
||||||
const calendarEventAttendeesToDelete = differenceWith(
|
const calendarEventParticipantsToDelete = differenceWith(
|
||||||
existingCalendarEventAttendees,
|
existingCalendarEventParticipants,
|
||||||
calendarEventAttendees,
|
calendarEventParticipants,
|
||||||
(existingCalendarEventAttendee, calendarEventAttendee) =>
|
(existingCalendarEventParticipant, calendarEventParticipant) =>
|
||||||
existingCalendarEventAttendee.handle === calendarEventAttendee.handle,
|
existingCalendarEventParticipant.handle ===
|
||||||
|
calendarEventParticipant.handle,
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.deleteByIds(
|
await this.deleteByIds(
|
||||||
calendarEventAttendeesToDelete.map(
|
calendarEventParticipantsToDelete.map(
|
||||||
(calendarEventAttendee) => calendarEventAttendee.id,
|
(calendarEventParticipant) => calendarEventParticipant.id,
|
||||||
),
|
),
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
|
|
||||||
const values = calendarEventAttendees.map((calendarEventAttendee) => ({
|
const values = calendarEventParticipants.map(
|
||||||
...calendarEventAttendee,
|
(calendarEventParticipant) => ({
|
||||||
calendarEventId: iCalUIDCalendarEventIdMap.get(
|
...calendarEventParticipant,
|
||||||
calendarEventAttendee.iCalUID,
|
calendarEventId: iCalUIDCalendarEventIdMap.get(
|
||||||
),
|
calendarEventParticipant.iCalUID,
|
||||||
}));
|
),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
const { flattenedValues, valuesString } =
|
const { flattenedValues, valuesString } =
|
||||||
getFlattenedValuesAndValuesStringForBatchRawQuery(values, {
|
getFlattenedValuesAndValuesStringForBatchRawQuery(values, {
|
||||||
@ -127,17 +130,17 @@ export class CalendarEventAttendeeRepository {
|
|||||||
handle: 'text',
|
handle: 'text',
|
||||||
displayName: 'text',
|
displayName: 'text',
|
||||||
isOrganizer: 'boolean',
|
isOrganizer: 'boolean',
|
||||||
responseStatus: `${dataSourceSchema}."calendarEventAttendee_responsestatus_enum"`,
|
responseStatus: `${dataSourceSchema}."calendarEventParticipant_responsestatus_enum"`,
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.workspaceDataSourceService.executeRawQuery(
|
await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`UPDATE ${dataSourceSchema}."calendarEventAttendee" AS "calendarEventAttendee"
|
`UPDATE ${dataSourceSchema}."calendarEventParticipant" AS "calendarEventParticipant"
|
||||||
SET "displayName" = "newValues"."displayName",
|
SET "displayName" = "newValues"."displayName",
|
||||||
"isOrganizer" = "newValues"."isOrganizer",
|
"isOrganizer" = "newValues"."isOrganizer",
|
||||||
"responseStatus" = "newValues"."responseStatus"
|
"responseStatus" = "newValues"."responseStatus"
|
||||||
FROM (VALUES ${valuesString}) AS "newValues"("calendarEventId", "handle", "displayName", "isOrganizer", "responseStatus")
|
FROM (VALUES ${valuesString}) AS "newValues"("calendarEventId", "handle", "displayName", "isOrganizer", "responseStatus")
|
||||||
WHERE "calendarEventAttendee"."handle" = "newValues"."handle"
|
WHERE "calendarEventParticipant"."handle" = "newValues"."handle"
|
||||||
AND "calendarEventAttendee"."calendarEventId" = "newValues"."calendarEventId"`,
|
AND "calendarEventParticipant"."calendarEventId" = "newValues"."calendarEventId"`,
|
||||||
flattenedValues,
|
flattenedValues,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
@ -147,7 +150,7 @@ export class CalendarEventAttendeeRepository {
|
|||||||
public async getWithoutPersonIdAndWorkspaceMemberId(
|
public async getWithoutPersonIdAndWorkspaceMemberId(
|
||||||
workspaceId: string,
|
workspaceId: string,
|
||||||
transactionManager?: EntityManager,
|
transactionManager?: EntityManager,
|
||||||
): Promise<CalendarEventAttendeeWithId[]> {
|
): Promise<CalendarEventParticipantWithId[]> {
|
||||||
if (!workspaceId) {
|
if (!workspaceId) {
|
||||||
throw new Error('WorkspaceId is required');
|
throw new Error('WorkspaceId is required');
|
||||||
}
|
}
|
||||||
@ -155,17 +158,17 @@ export class CalendarEventAttendeeRepository {
|
|||||||
const dataSourceSchema =
|
const dataSourceSchema =
|
||||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||||
|
|
||||||
const calendarEventAttendees: CalendarEventAttendeeWithId[] =
|
const calendarEventParticipants: CalendarEventParticipantWithId[] =
|
||||||
await this.workspaceDataSourceService.executeRawQuery(
|
await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`SELECT "calendarEventAttendee".*
|
`SELECT "calendarEventParticipant".*
|
||||||
FROM ${dataSourceSchema}."calendarEventAttendee" AS "calendarEventAttendee"
|
FROM ${dataSourceSchema}."calendarEventParticipant" AS "calendarEventParticipant"
|
||||||
WHERE "calendarEventAttendee"."personId" IS NULL
|
WHERE "calendarEventParticipant"."personId" IS NULL
|
||||||
AND "calendarEventAttendee"."workspaceMemberId" IS NULL`,
|
AND "calendarEventParticipant"."workspaceMemberId" IS NULL`,
|
||||||
[],
|
[],
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
|
|
||||||
return calendarEventAttendees;
|
return calendarEventParticipants;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7,7 +7,7 @@ import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metada
|
|||||||
import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event.object-metadata';
|
import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event.object-metadata';
|
||||||
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/modules/calendar/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
|
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/modules/calendar/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
|
||||||
import { CalendarEvent } from 'src/modules/calendar/types/calendar-event';
|
import { CalendarEvent } from 'src/modules/calendar/types/calendar-event';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CalendarEventRepository {
|
export class CalendarEventRepository {
|
||||||
@ -60,7 +60,7 @@ export class CalendarEventRepository {
|
|||||||
offset: number,
|
offset: number,
|
||||||
workspaceId: string,
|
workspaceId: string,
|
||||||
transactionManager?: EntityManager,
|
transactionManager?: EntityManager,
|
||||||
): Promise<ObjectRecord<CalendarEventAttendeeObjectMetadata>[]> {
|
): Promise<ObjectRecord<CalendarEventParticipantObjectMetadata>[]> {
|
||||||
const dataSourceSchema =
|
const dataSourceSchema =
|
||||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
|
|||||||
|
|
||||||
import { ObjectMetadataRepositoryModule } from 'src/engine/object-metadata-repository/object-metadata-repository.module';
|
import { ObjectMetadataRepositoryModule } from 'src/engine/object-metadata-repository/object-metadata-repository.module';
|
||||||
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
||||||
import { CalendarEventAttendeeService } from 'src/modules/calendar/services/calendar-event-attendee/calendar-event-attendee.service';
|
import { CalendarEventParticipantService } from 'src/modules/calendar/services/calendar-event-participant/calendar-event-participant.service';
|
||||||
import { AddPersonIdAndWorkspaceMemberIdModule } from 'src/modules/connected-account/services/add-person-id-and-workspace-member-id/add-person-id-and-workspace-member-id.module';
|
import { AddPersonIdAndWorkspaceMemberIdModule } from 'src/modules/connected-account/services/add-person-id-and-workspace-member-id/add-person-id-and-workspace-member-id.module';
|
||||||
import { PersonObjectMetadata } from 'src/modules/person/standard-objects/person.object-metadata';
|
import { PersonObjectMetadata } from 'src/modules/person/standard-objects/person.object-metadata';
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ import { PersonObjectMetadata } from 'src/modules/person/standard-objects/person
|
|||||||
ObjectMetadataRepositoryModule.forFeature([PersonObjectMetadata]),
|
ObjectMetadataRepositoryModule.forFeature([PersonObjectMetadata]),
|
||||||
AddPersonIdAndWorkspaceMemberIdModule,
|
AddPersonIdAndWorkspaceMemberIdModule,
|
||||||
],
|
],
|
||||||
providers: [CalendarEventAttendeeService],
|
providers: [CalendarEventParticipantService],
|
||||||
exports: [CalendarEventAttendeeService],
|
exports: [CalendarEventParticipantService],
|
||||||
})
|
})
|
||||||
export class CalendarEventAttendeeModule {}
|
export class CalendarEventParticipantModule {}
|
||||||
@ -8,13 +8,13 @@ import { PersonObjectMetadata } from 'src/modules/person/standard-objects/person
|
|||||||
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
||||||
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/modules/calendar/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
|
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/modules/calendar/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
|
||||||
import {
|
import {
|
||||||
CalendarEventAttendee,
|
CalendarEventParticipant,
|
||||||
CalendarEventAttendeeWithId,
|
CalendarEventParticipantWithId,
|
||||||
} from 'src/modules/calendar/types/calendar-event';
|
} from 'src/modules/calendar/types/calendar-event';
|
||||||
import { AddPersonIdAndWorkspaceMemberIdService } from 'src/modules/connected-account/services/add-person-id-and-workspace-member-id/add-person-id-and-workspace-member-id.service';
|
import { AddPersonIdAndWorkspaceMemberIdService } from 'src/modules/connected-account/services/add-person-id-and-workspace-member-id/add-person-id-and-workspace-member-id.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CalendarEventAttendeeService {
|
export class CalendarEventParticipantService {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
||||||
@InjectObjectMetadataRepository(PersonObjectMetadata)
|
@InjectObjectMetadataRepository(PersonObjectMetadata)
|
||||||
@ -22,36 +22,38 @@ export class CalendarEventAttendeeService {
|
|||||||
private readonly addPersonIdAndWorkspaceMemberIdService: AddPersonIdAndWorkspaceMemberIdService,
|
private readonly addPersonIdAndWorkspaceMemberIdService: AddPersonIdAndWorkspaceMemberIdService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public async updateCalendarEventAttendeesAfterContactCreation(
|
public async updateCalendarEventParticipantsAfterContactCreation(
|
||||||
attendees: CalendarEventAttendeeWithId[],
|
participants: CalendarEventParticipantWithId[],
|
||||||
workspaceId: string,
|
workspaceId: string,
|
||||||
transactionManager?: EntityManager,
|
transactionManager?: EntityManager,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (!attendees) return;
|
if (!participants) return;
|
||||||
|
|
||||||
const dataSourceSchema =
|
const dataSourceSchema =
|
||||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||||
|
|
||||||
const handles = attendees.map((attendee) => attendee.handle);
|
const handles = participants.map((participant) => participant.handle);
|
||||||
|
|
||||||
const attendeePersonIds = await this.personRepository.getByEmails(
|
const participantPersonIds = await this.personRepository.getByEmails(
|
||||||
handles,
|
handles,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
|
|
||||||
const calendarEventAttendeesToUpdate = attendees.map((attendee) => ({
|
const calendarEventParticipantsToUpdate = participants.map(
|
||||||
id: attendee.id,
|
(participant) => ({
|
||||||
personId: attendeePersonIds.find(
|
id: participant.id,
|
||||||
(e: { id: string; email: string }) => e.email === attendee.handle,
|
personId: participantPersonIds.find(
|
||||||
)?.id,
|
(e: { id: string; email: string }) => e.email === participant.handle,
|
||||||
}));
|
)?.id,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
if (calendarEventAttendeesToUpdate.length === 0) return;
|
if (calendarEventParticipantsToUpdate.length === 0) return;
|
||||||
|
|
||||||
const { flattenedValues, valuesString } =
|
const { flattenedValues, valuesString } =
|
||||||
getFlattenedValuesAndValuesStringForBatchRawQuery(
|
getFlattenedValuesAndValuesStringForBatchRawQuery(
|
||||||
calendarEventAttendeesToUpdate,
|
calendarEventParticipantsToUpdate,
|
||||||
{
|
{
|
||||||
id: 'uuid',
|
id: 'uuid',
|
||||||
personId: 'uuid',
|
personId: 'uuid',
|
||||||
@ -59,50 +61,50 @@ export class CalendarEventAttendeeService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await this.workspaceDataSourceService.executeRawQuery(
|
await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`UPDATE ${dataSourceSchema}."calendarEventAttendee" AS "calendarEventAttendee" SET "personId" = "data"."personId"
|
`UPDATE ${dataSourceSchema}."calendarEventParticipant" AS "calendarEventParticipant" SET "personId" = "data"."personId"
|
||||||
FROM (VALUES ${valuesString}) AS "data"("id", "personId")
|
FROM (VALUES ${valuesString}) AS "data"("id", "personId")
|
||||||
WHERE "calendarEventAttendee"."id" = "data"."id"`,
|
WHERE "calendarEventParticipant"."id" = "data"."id"`,
|
||||||
flattenedValues,
|
flattenedValues,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async saveCalendarEventAttendees(
|
public async saveCalendarEventParticipants(
|
||||||
calendarEventAttendees: CalendarEventAttendee[],
|
calendarEventParticipants: CalendarEventParticipant[],
|
||||||
workspaceId: string,
|
workspaceId: string,
|
||||||
transactionManager?: EntityManager,
|
transactionManager?: EntityManager,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (calendarEventAttendees.length === 0) {
|
if (calendarEventParticipants.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataSourceSchema =
|
const dataSourceSchema =
|
||||||
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
this.workspaceDataSourceService.getSchemaName(workspaceId);
|
||||||
|
|
||||||
const calendarEventAttendeesToSave =
|
const calendarEventParticipantsToSave =
|
||||||
await this.addPersonIdAndWorkspaceMemberIdService.addPersonIdAndWorkspaceMemberId(
|
await this.addPersonIdAndWorkspaceMemberIdService.addPersonIdAndWorkspaceMemberId(
|
||||||
calendarEventAttendees,
|
calendarEventParticipants,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
|
|
||||||
const { flattenedValues, valuesString } =
|
const { flattenedValues, valuesString } =
|
||||||
getFlattenedValuesAndValuesStringForBatchRawQuery(
|
getFlattenedValuesAndValuesStringForBatchRawQuery(
|
||||||
calendarEventAttendeesToSave,
|
calendarEventParticipantsToSave,
|
||||||
{
|
{
|
||||||
calendarEventId: 'uuid',
|
calendarEventId: 'uuid',
|
||||||
handle: 'text',
|
handle: 'text',
|
||||||
displayName: 'text',
|
displayName: 'text',
|
||||||
isOrganizer: 'boolean',
|
isOrganizer: 'boolean',
|
||||||
responseStatus: `${dataSourceSchema}."calendarEventAttendee_responsestatus_enum"`,
|
responseStatus: `${dataSourceSchema}."calendarEventParticipant_responsestatus_enum"`,
|
||||||
personId: 'uuid',
|
personId: 'uuid',
|
||||||
workspaceMemberId: 'uuid',
|
workspaceMemberId: 'uuid',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.workspaceDataSourceService.executeRawQuery(
|
await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`INSERT INTO ${dataSourceSchema}."calendarEventAttendee" ("calendarEventId", "handle", "displayName", "isOrganizer", "responseStatus", "personId", "workspaceMemberId") VALUES ${valuesString}`,
|
`INSERT INTO ${dataSourceSchema}."calendarEventParticipant" ("calendarEventId", "handle", "displayName", "isOrganizer", "responseStatus", "personId", "workspaceMemberId") VALUES ${valuesString}`,
|
||||||
flattenedValues,
|
flattenedValues,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
@ -4,12 +4,12 @@ import { TypeOrmModule } from '@nestjs/typeorm';
|
|||||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||||
import { ObjectMetadataRepositoryModule } from 'src/engine/object-metadata-repository/object-metadata-repository.module';
|
import { ObjectMetadataRepositoryModule } from 'src/engine/object-metadata-repository/object-metadata-repository.module';
|
||||||
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
||||||
import { CalendarEventAttendeeModule } from 'src/modules/calendar/services/calendar-event-attendee/calendar-event-attendee.module';
|
import { CalendarEventParticipantModule } from 'src/modules/calendar/services/calendar-event-participant/calendar-event-participant.module';
|
||||||
import { GoogleCalendarFullSyncService } from 'src/modules/calendar/services/google-calendar-full-sync.service';
|
import { GoogleCalendarFullSyncService } from 'src/modules/calendar/services/google-calendar-full-sync.service';
|
||||||
import { CalendarProvidersModule } from 'src/modules/calendar/services/providers/calendar-providers.module';
|
import { CalendarProvidersModule } from 'src/modules/calendar/services/providers/calendar-providers.module';
|
||||||
import { CalendarChannelEventAssociationObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata';
|
import { CalendarChannelEventAssociationObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata';
|
||||||
import { CalendarChannelObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel.object-metadata';
|
import { CalendarChannelObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel.object-metadata';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event.object-metadata';
|
import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event.object-metadata';
|
||||||
import { BlocklistObjectMetadata } from 'src/modules/connected-account/standard-objects/blocklist.object-metadata';
|
import { BlocklistObjectMetadata } from 'src/modules/connected-account/standard-objects/blocklist.object-metadata';
|
||||||
import { ConnectedAccountObjectMetadata } from 'src/modules/connected-account/standard-objects/connected-account.object-metadata';
|
import { ConnectedAccountObjectMetadata } from 'src/modules/connected-account/standard-objects/connected-account.object-metadata';
|
||||||
@ -24,12 +24,12 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan
|
|||||||
CalendarEventObjectMetadata,
|
CalendarEventObjectMetadata,
|
||||||
CalendarChannelObjectMetadata,
|
CalendarChannelObjectMetadata,
|
||||||
CalendarChannelEventAssociationObjectMetadata,
|
CalendarChannelEventAssociationObjectMetadata,
|
||||||
CalendarEventAttendeeObjectMetadata,
|
CalendarEventParticipantObjectMetadata,
|
||||||
BlocklistObjectMetadata,
|
BlocklistObjectMetadata,
|
||||||
PersonObjectMetadata,
|
PersonObjectMetadata,
|
||||||
WorkspaceMemberObjectMetadata,
|
WorkspaceMemberObjectMetadata,
|
||||||
]),
|
]),
|
||||||
CalendarEventAttendeeModule,
|
CalendarEventParticipantModule,
|
||||||
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
TypeOrmModule.forFeature([FeatureFlagEntity], 'core'),
|
||||||
WorkspaceDataSourceModule,
|
WorkspaceDataSourceModule,
|
||||||
],
|
],
|
||||||
|
|||||||
@ -20,15 +20,15 @@ import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/work
|
|||||||
import { CalendarEventRepository } from 'src/modules/calendar/repositories/calendar-event.repository';
|
import { CalendarEventRepository } from 'src/modules/calendar/repositories/calendar-event.repository';
|
||||||
import { formatGoogleCalendarEvent } from 'src/modules/calendar/utils/format-google-calendar-event.util';
|
import { formatGoogleCalendarEvent } from 'src/modules/calendar/utils/format-google-calendar-event.util';
|
||||||
import { GoogleCalendarFullSyncJobData } from 'src/modules/calendar/jobs/google-calendar-full-sync.job';
|
import { GoogleCalendarFullSyncJobData } from 'src/modules/calendar/jobs/google-calendar-full-sync.job';
|
||||||
import { CalendarEventAttendeeRepository } from 'src/modules/calendar/repositories/calendar-event-attendee.repository';
|
import { CalendarEventParticipantRepository } from 'src/modules/calendar/repositories/calendar-event-participant.repository';
|
||||||
import { ConnectedAccountObjectMetadata } from 'src/modules/connected-account/standard-objects/connected-account.object-metadata';
|
import { ConnectedAccountObjectMetadata } from 'src/modules/connected-account/standard-objects/connected-account.object-metadata';
|
||||||
import { InjectObjectMetadataRepository } from 'src/engine/object-metadata-repository/object-metadata-repository.decorator';
|
import { InjectObjectMetadataRepository } from 'src/engine/object-metadata-repository/object-metadata-repository.decorator';
|
||||||
import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event.object-metadata';
|
import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event.object-metadata';
|
||||||
import { CalendarChannelObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel.object-metadata';
|
import { CalendarChannelObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel.object-metadata';
|
||||||
import { CalendarChannelEventAssociationObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata';
|
import { CalendarChannelEventAssociationObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { BlocklistObjectMetadata } from 'src/modules/connected-account/standard-objects/blocklist.object-metadata';
|
import { BlocklistObjectMetadata } from 'src/modules/connected-account/standard-objects/blocklist.object-metadata';
|
||||||
import { CalendarEventAttendeeService } from 'src/modules/calendar/services/calendar-event-attendee/calendar-event-attendee.service';
|
import { CalendarEventParticipantService } from 'src/modules/calendar/services/calendar-event-participant/calendar-event-participant.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GoogleCalendarFullSyncService {
|
export class GoogleCalendarFullSyncService {
|
||||||
@ -48,15 +48,15 @@ export class GoogleCalendarFullSyncService {
|
|||||||
CalendarChannelEventAssociationObjectMetadata,
|
CalendarChannelEventAssociationObjectMetadata,
|
||||||
)
|
)
|
||||||
private readonly calendarChannelEventAssociationRepository: CalendarChannelEventAssociationRepository,
|
private readonly calendarChannelEventAssociationRepository: CalendarChannelEventAssociationRepository,
|
||||||
@InjectObjectMetadataRepository(CalendarEventAttendeeObjectMetadata)
|
@InjectObjectMetadataRepository(CalendarEventParticipantObjectMetadata)
|
||||||
private readonly calendarEventAttendeesRepository: CalendarEventAttendeeRepository,
|
private readonly calendarEventParticipantsRepository: CalendarEventParticipantRepository,
|
||||||
@InjectObjectMetadataRepository(BlocklistObjectMetadata)
|
@InjectObjectMetadataRepository(BlocklistObjectMetadata)
|
||||||
private readonly blocklistRepository: BlocklistRepository,
|
private readonly blocklistRepository: BlocklistRepository,
|
||||||
@InjectRepository(FeatureFlagEntity, 'core')
|
@InjectRepository(FeatureFlagEntity, 'core')
|
||||||
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
|
||||||
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
||||||
private readonly eventEmitter: EventEmitter2,
|
private readonly eventEmitter: EventEmitter2,
|
||||||
private readonly calendarEventAttendeesService: CalendarEventAttendeeService,
|
private readonly calendarEventParticipantsService: CalendarEventParticipantService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public async startGoogleCalendarFullSync(
|
public async startGoogleCalendarFullSync(
|
||||||
@ -197,10 +197,12 @@ export class GoogleCalendarFullSyncService {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const attendeesToSave = eventsToSave.flatMap((event) => event.attendees);
|
const participantsToSave = eventsToSave.flatMap(
|
||||||
|
(event) => event.participants,
|
||||||
|
);
|
||||||
|
|
||||||
const attendeesToUpdate = eventsToUpdate.flatMap(
|
const participantsToUpdate = eventsToUpdate.flatMap(
|
||||||
(event) => event.attendees,
|
(event) => event.participants,
|
||||||
);
|
);
|
||||||
|
|
||||||
const iCalUIDCalendarEventIdMap =
|
const iCalUIDCalendarEventIdMap =
|
||||||
@ -267,8 +269,8 @@ export class GoogleCalendarFullSyncService {
|
|||||||
|
|
||||||
startTime = Date.now();
|
startTime = Date.now();
|
||||||
|
|
||||||
await this.calendarEventAttendeesService.saveCalendarEventAttendees(
|
await this.calendarEventParticipantsService.saveCalendarEventParticipants(
|
||||||
attendeesToSave,
|
participantsToSave,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
@ -276,15 +278,15 @@ export class GoogleCalendarFullSyncService {
|
|||||||
endTime = Date.now();
|
endTime = Date.now();
|
||||||
|
|
||||||
this.logger.log(
|
this.logger.log(
|
||||||
`google calendar full-sync for workspace ${workspaceId} and account ${connectedAccountId}: saving attendees in ${
|
`google calendar full-sync for workspace ${workspaceId} and account ${connectedAccountId}: saving participants in ${
|
||||||
endTime - startTime
|
endTime - startTime
|
||||||
}ms.`,
|
}ms.`,
|
||||||
);
|
);
|
||||||
|
|
||||||
startTime = Date.now();
|
startTime = Date.now();
|
||||||
|
|
||||||
await this.calendarEventAttendeesRepository.updateCalendarEventAttendees(
|
await this.calendarEventParticipantsRepository.updateCalendarEventParticipants(
|
||||||
attendeesToUpdate,
|
participantsToUpdate,
|
||||||
iCalUIDCalendarEventIdMap,
|
iCalUIDCalendarEventIdMap,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
@ -293,14 +295,14 @@ export class GoogleCalendarFullSyncService {
|
|||||||
endTime = Date.now();
|
endTime = Date.now();
|
||||||
|
|
||||||
this.logger.log(
|
this.logger.log(
|
||||||
`google calendar full-sync for workspace ${workspaceId} and account ${connectedAccountId}: updating attendees in ${
|
`google calendar full-sync for workspace ${workspaceId} and account ${connectedAccountId}: updating participants in ${
|
||||||
endTime - startTime
|
endTime - startTime
|
||||||
}ms.`,
|
}ms.`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (calendarChannel.isContactAutoCreationEnabled) {
|
if (calendarChannel.isContactAutoCreationEnabled) {
|
||||||
const contactsToCreate = attendeesToSave;
|
const contactsToCreate = participantsToSave;
|
||||||
|
|
||||||
this.eventEmitter.emit(`createContacts`, {
|
this.eventEmitter.emit(`createContacts`, {
|
||||||
workspaceId,
|
workspaceId,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||||
import { calendarEventAttendeeStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
|
import { calendarEventParticipantStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
|
||||||
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
|
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
|
||||||
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
|
import { FieldMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/field-metadata.decorator';
|
||||||
import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator';
|
import { Gate } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/gate.decorator';
|
||||||
@ -11,7 +11,7 @@ import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objec
|
|||||||
import { PersonObjectMetadata } from 'src/modules/person/standard-objects/person.object-metadata';
|
import { PersonObjectMetadata } from 'src/modules/person/standard-objects/person.object-metadata';
|
||||||
import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/standard-objects/workspace-member.object-metadata';
|
import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/standard-objects/workspace-member.object-metadata';
|
||||||
|
|
||||||
export enum CalendarEventAttendeeResponseStatus {
|
export enum CalendarEventParticipantResponseStatus {
|
||||||
NEEDS_ACTION = 'NEEDS_ACTION',
|
NEEDS_ACTION = 'NEEDS_ACTION',
|
||||||
DECLINED = 'DECLINED',
|
DECLINED = 'DECLINED',
|
||||||
TENTATIVE = 'TENTATIVE',
|
TENTATIVE = 'TENTATIVE',
|
||||||
@ -19,20 +19,20 @@ export enum CalendarEventAttendeeResponseStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ObjectMetadata({
|
@ObjectMetadata({
|
||||||
standardId: standardObjectIds.calendarEventAttendee,
|
standardId: standardObjectIds.calendarEventParticipant,
|
||||||
namePlural: 'calendarEventAttendees',
|
namePlural: 'calendarEventParticipants',
|
||||||
labelSingular: 'Calendar event attendee',
|
labelSingular: 'Calendar event participant',
|
||||||
labelPlural: 'Calendar event attendees',
|
labelPlural: 'Calendar event participants',
|
||||||
description: 'Calendar event attendees',
|
description: 'Calendar event participants',
|
||||||
icon: 'IconCalendar',
|
icon: 'IconCalendar',
|
||||||
})
|
})
|
||||||
@IsSystem()
|
@IsSystem()
|
||||||
@Gate({
|
@Gate({
|
||||||
featureFlag: 'IS_CALENDAR_ENABLED',
|
featureFlag: 'IS_CALENDAR_ENABLED',
|
||||||
})
|
})
|
||||||
export class CalendarEventAttendeeObjectMetadata extends BaseObjectMetadata {
|
export class CalendarEventParticipantObjectMetadata extends BaseObjectMetadata {
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: calendarEventAttendeeStandardFieldIds.calendarEvent,
|
standardId: calendarEventParticipantStandardFieldIds.calendarEvent,
|
||||||
type: FieldMetadataType.RELATION,
|
type: FieldMetadataType.RELATION,
|
||||||
label: 'Event ID',
|
label: 'Event ID',
|
||||||
description: 'Event ID',
|
description: 'Event ID',
|
||||||
@ -42,7 +42,7 @@ export class CalendarEventAttendeeObjectMetadata extends BaseObjectMetadata {
|
|||||||
calendarEvent: CalendarEventObjectMetadata;
|
calendarEvent: CalendarEventObjectMetadata;
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: calendarEventAttendeeStandardFieldIds.handle,
|
standardId: calendarEventParticipantStandardFieldIds.handle,
|
||||||
type: FieldMetadataType.TEXT,
|
type: FieldMetadataType.TEXT,
|
||||||
label: 'Handle',
|
label: 'Handle',
|
||||||
description: 'Handle',
|
description: 'Handle',
|
||||||
@ -51,7 +51,7 @@ export class CalendarEventAttendeeObjectMetadata extends BaseObjectMetadata {
|
|||||||
handle: string;
|
handle: string;
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: calendarEventAttendeeStandardFieldIds.displayName,
|
standardId: calendarEventParticipantStandardFieldIds.displayName,
|
||||||
type: FieldMetadataType.TEXT,
|
type: FieldMetadataType.TEXT,
|
||||||
label: 'Display Name',
|
label: 'Display Name',
|
||||||
description: 'Display Name',
|
description: 'Display Name',
|
||||||
@ -60,7 +60,7 @@ export class CalendarEventAttendeeObjectMetadata extends BaseObjectMetadata {
|
|||||||
displayName: string;
|
displayName: string;
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: calendarEventAttendeeStandardFieldIds.isOrganizer,
|
standardId: calendarEventParticipantStandardFieldIds.isOrganizer,
|
||||||
type: FieldMetadataType.BOOLEAN,
|
type: FieldMetadataType.BOOLEAN,
|
||||||
label: 'Is Organizer',
|
label: 'Is Organizer',
|
||||||
description: 'Is Organizer',
|
description: 'Is Organizer',
|
||||||
@ -70,43 +70,43 @@ export class CalendarEventAttendeeObjectMetadata extends BaseObjectMetadata {
|
|||||||
isOrganizer: boolean;
|
isOrganizer: boolean;
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: calendarEventAttendeeStandardFieldIds.responseStatus,
|
standardId: calendarEventParticipantStandardFieldIds.responseStatus,
|
||||||
type: FieldMetadataType.SELECT,
|
type: FieldMetadataType.SELECT,
|
||||||
label: 'Response Status',
|
label: 'Response Status',
|
||||||
description: 'Response Status',
|
description: 'Response Status',
|
||||||
icon: 'IconUser',
|
icon: 'IconUser',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
value: CalendarEventAttendeeResponseStatus.NEEDS_ACTION,
|
value: CalendarEventParticipantResponseStatus.NEEDS_ACTION,
|
||||||
label: 'Needs Action',
|
label: 'Needs Action',
|
||||||
position: 0,
|
position: 0,
|
||||||
color: 'orange',
|
color: 'orange',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: CalendarEventAttendeeResponseStatus.DECLINED,
|
value: CalendarEventParticipantResponseStatus.DECLINED,
|
||||||
label: 'Declined',
|
label: 'Declined',
|
||||||
position: 1,
|
position: 1,
|
||||||
color: 'red',
|
color: 'red',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: CalendarEventAttendeeResponseStatus.TENTATIVE,
|
value: CalendarEventParticipantResponseStatus.TENTATIVE,
|
||||||
label: 'Tentative',
|
label: 'Tentative',
|
||||||
position: 2,
|
position: 2,
|
||||||
color: 'yellow',
|
color: 'yellow',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: CalendarEventAttendeeResponseStatus.ACCEPTED,
|
value: CalendarEventParticipantResponseStatus.ACCEPTED,
|
||||||
label: 'Accepted',
|
label: 'Accepted',
|
||||||
position: 3,
|
position: 3,
|
||||||
color: 'green',
|
color: 'green',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
defaultValue: `'${CalendarEventAttendeeResponseStatus.NEEDS_ACTION}'`,
|
defaultValue: `'${CalendarEventParticipantResponseStatus.NEEDS_ACTION}'`,
|
||||||
})
|
})
|
||||||
responseStatus: string;
|
responseStatus: string;
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: calendarEventAttendeeStandardFieldIds.person,
|
standardId: calendarEventParticipantStandardFieldIds.person,
|
||||||
type: FieldMetadataType.RELATION,
|
type: FieldMetadataType.RELATION,
|
||||||
label: 'Person',
|
label: 'Person',
|
||||||
description: 'Person',
|
description: 'Person',
|
||||||
@ -117,7 +117,7 @@ export class CalendarEventAttendeeObjectMetadata extends BaseObjectMetadata {
|
|||||||
person: PersonObjectMetadata;
|
person: PersonObjectMetadata;
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: calendarEventAttendeeStandardFieldIds.workspaceMember,
|
standardId: calendarEventParticipantStandardFieldIds.workspaceMember,
|
||||||
type: FieldMetadataType.RELATION,
|
type: FieldMetadataType.RELATION,
|
||||||
label: 'Workspace Member',
|
label: 'Workspace Member',
|
||||||
description: 'Workspace Member',
|
description: 'Workspace Member',
|
||||||
@ -11,7 +11,7 @@ import { IsSystem } from 'src/engine/workspace-manager/workspace-sync-metadata/d
|
|||||||
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
|
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator';
|
||||||
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
|
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||||
import { CalendarChannelEventAssociationObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata';
|
import { CalendarChannelEventAssociationObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-channel-event-association.object-metadata';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
|
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
|
||||||
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
|
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
|
||||||
import { calendarEventStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
|
import { calendarEventStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
|
||||||
@ -171,16 +171,16 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata {
|
|||||||
calendarChannelEventAssociations: CalendarChannelEventAssociationObjectMetadata[];
|
calendarChannelEventAssociations: CalendarChannelEventAssociationObjectMetadata[];
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: calendarEventStandardFieldIds.eventAttendees,
|
standardId: calendarEventStandardFieldIds.eventParticipants,
|
||||||
type: FieldMetadataType.RELATION,
|
type: FieldMetadataType.RELATION,
|
||||||
label: 'Event Attendees',
|
label: 'Event Participants',
|
||||||
description: 'Event Attendees',
|
description: 'Event Participants',
|
||||||
icon: 'IconUserCircle',
|
icon: 'IconUserCircle',
|
||||||
})
|
})
|
||||||
@RelationMetadata({
|
@RelationMetadata({
|
||||||
type: RelationMetadataType.ONE_TO_MANY,
|
type: RelationMetadataType.ONE_TO_MANY,
|
||||||
inverseSideTarget: () => CalendarEventAttendeeObjectMetadata,
|
inverseSideTarget: () => CalendarEventParticipantObjectMetadata,
|
||||||
onDelete: RelationOnDeleteAction.CASCADE,
|
onDelete: RelationOnDeleteAction.CASCADE,
|
||||||
})
|
})
|
||||||
eventAttendees: CalendarEventAttendeeObjectMetadata[];
|
eventParticipants: CalendarEventParticipantObjectMetadata[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event.object-metadata';
|
import { CalendarEventObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event.object-metadata';
|
||||||
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
|
import { ObjectRecord } from 'src/engine/workspace-manager/workspace-sync-metadata/types/object-record';
|
||||||
|
|
||||||
@ -7,16 +7,16 @@ export type CalendarEvent = Omit<
|
|||||||
| 'createdAt'
|
| 'createdAt'
|
||||||
| 'updatedAt'
|
| 'updatedAt'
|
||||||
| 'calendarChannelEventAssociations'
|
| 'calendarChannelEventAssociations'
|
||||||
| 'calendarEventAttendees'
|
| 'calendarEventParticipants'
|
||||||
| 'eventAttendees'
|
| 'eventParticipants'
|
||||||
| 'conferenceLink'
|
| 'conferenceLink'
|
||||||
> & {
|
> & {
|
||||||
conferenceLinkLabel: string;
|
conferenceLinkLabel: string;
|
||||||
conferenceLinkUrl: string;
|
conferenceLinkUrl: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CalendarEventAttendee = Omit<
|
export type CalendarEventParticipant = Omit<
|
||||||
ObjectRecord<CalendarEventAttendeeObjectMetadata>,
|
ObjectRecord<CalendarEventParticipantObjectMetadata>,
|
||||||
| 'id'
|
| 'id'
|
||||||
| 'createdAt'
|
| 'createdAt'
|
||||||
| 'updatedAt'
|
| 'updatedAt'
|
||||||
@ -29,11 +29,11 @@ export type CalendarEventAttendee = Omit<
|
|||||||
iCalUID: string;
|
iCalUID: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CalendarEventWithAttendees = CalendarEvent & {
|
export type CalendarEventWithParticipants = CalendarEvent & {
|
||||||
externalId: string;
|
externalId: string;
|
||||||
attendees: CalendarEventAttendee[];
|
participants: CalendarEventParticipant[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CalendarEventAttendeeWithId = CalendarEventAttendee & {
|
export type CalendarEventParticipantWithId = CalendarEventParticipant & {
|
||||||
id: string;
|
id: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,24 +1,24 @@
|
|||||||
import { calendar_v3 } from 'googleapis';
|
import { calendar_v3 } from 'googleapis';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
|
|
||||||
import { CalendarEventWithAttendees } from 'src/modules/calendar/types/calendar-event';
|
import { CalendarEventParticipantResponseStatus } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { CalendarEventAttendeeResponseStatus } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventWithParticipants } from 'src/modules/calendar/types/calendar-event';
|
||||||
|
|
||||||
export const formatGoogleCalendarEvent = (
|
export const formatGoogleCalendarEvent = (
|
||||||
event: calendar_v3.Schema$Event,
|
event: calendar_v3.Schema$Event,
|
||||||
): CalendarEventWithAttendees => {
|
): CalendarEventWithParticipants => {
|
||||||
const id = v4();
|
const id = v4();
|
||||||
|
|
||||||
const formatResponseStatus = (status: string | null | undefined) => {
|
const formatResponseStatus = (status: string | null | undefined) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'accepted':
|
case 'accepted':
|
||||||
return CalendarEventAttendeeResponseStatus.ACCEPTED;
|
return CalendarEventParticipantResponseStatus.ACCEPTED;
|
||||||
case 'declined':
|
case 'declined':
|
||||||
return CalendarEventAttendeeResponseStatus.DECLINED;
|
return CalendarEventParticipantResponseStatus.DECLINED;
|
||||||
case 'tentative':
|
case 'tentative':
|
||||||
return CalendarEventAttendeeResponseStatus.TENTATIVE;
|
return CalendarEventParticipantResponseStatus.TENTATIVE;
|
||||||
default:
|
default:
|
||||||
return CalendarEventAttendeeResponseStatus.NEEDS_ACTION;
|
return CalendarEventParticipantResponseStatus.NEEDS_ACTION;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ export const formatGoogleCalendarEvent = (
|
|||||||
conferenceLinkLabel: event.conferenceData?.entryPoints?.[0]?.uri ?? '',
|
conferenceLinkLabel: event.conferenceData?.entryPoints?.[0]?.uri ?? '',
|
||||||
conferenceLinkUrl: event.conferenceData?.entryPoints?.[0]?.uri ?? '',
|
conferenceLinkUrl: event.conferenceData?.entryPoints?.[0]?.uri ?? '',
|
||||||
recurringEventExternalId: event.recurringEventId ?? '',
|
recurringEventExternalId: event.recurringEventId ?? '',
|
||||||
attendees:
|
participants:
|
||||||
event.attendees?.map((attendee) => ({
|
event.attendees?.map((attendee) => ({
|
||||||
calendarEventId: id,
|
calendarEventId: id,
|
||||||
iCalUID: event.iCalUID ?? '',
|
iCalUID: event.iCalUID ?? '',
|
||||||
|
|||||||
@ -9,8 +9,8 @@ import { WorkspaceMemberObjectMetadata } from 'src/modules/workspace-member/stan
|
|||||||
import { MessageParticipantModule } from 'src/modules/messaging/services/message-participant/message-participant.module';
|
import { MessageParticipantModule } from 'src/modules/messaging/services/message-participant/message-participant.module';
|
||||||
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';
|
||||||
import { CreateCompanyAndContactListener } from 'src/modules/connected-account/auto-companies-and-contacts-creation/listeners/create-company-and-contact.listener';
|
import { CreateCompanyAndContactListener } from 'src/modules/connected-account/auto-companies-and-contacts-creation/listeners/create-company-and-contact.listener';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { CalendarEventAttendeeModule } from 'src/modules/calendar/services/calendar-event-attendee/calendar-event-attendee.module';
|
import { CalendarEventParticipantModule } from 'src/modules/calendar/services/calendar-event-participant/calendar-event-participant.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@ -19,11 +19,11 @@ import { CalendarEventAttendeeModule } from 'src/modules/calendar/services/calen
|
|||||||
ObjectMetadataRepositoryModule.forFeature([
|
ObjectMetadataRepositoryModule.forFeature([
|
||||||
PersonObjectMetadata,
|
PersonObjectMetadata,
|
||||||
WorkspaceMemberObjectMetadata,
|
WorkspaceMemberObjectMetadata,
|
||||||
CalendarEventAttendeeObjectMetadata,
|
CalendarEventParticipantObjectMetadata,
|
||||||
]),
|
]),
|
||||||
MessageParticipantModule,
|
MessageParticipantModule,
|
||||||
WorkspaceDataSourceModule,
|
WorkspaceDataSourceModule,
|
||||||
CalendarEventAttendeeModule,
|
CalendarEventParticipantModule,
|
||||||
],
|
],
|
||||||
providers: [CreateCompanyAndContactService, CreateCompanyAndContactListener],
|
providers: [CreateCompanyAndContactService, CreateCompanyAndContactListener],
|
||||||
exports: [CreateCompanyAndContactService],
|
exports: [CreateCompanyAndContactService],
|
||||||
|
|||||||
@ -18,9 +18,9 @@ import { MessageParticipantRepository } from 'src/modules/messaging/repositories
|
|||||||
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
|
||||||
import { MessageParticipantService } from 'src/modules/messaging/services/message-participant/message-participant.service';
|
import { MessageParticipantService } from 'src/modules/messaging/services/message-participant/message-participant.service';
|
||||||
import { MessageParticipantObjectMetadata } from 'src/modules/messaging/standard-objects/message-participant.object-metadata';
|
import { MessageParticipantObjectMetadata } from 'src/modules/messaging/standard-objects/message-participant.object-metadata';
|
||||||
import { CalendarEventAttendeeService } from 'src/modules/calendar/services/calendar-event-attendee/calendar-event-attendee.service';
|
import { CalendarEventParticipantService } from 'src/modules/calendar/services/calendar-event-participant/calendar-event-participant.service';
|
||||||
import { CalendarEventAttendeeRepository } from 'src/modules/calendar/repositories/calendar-event-attendee.repository';
|
import { CalendarEventParticipantRepository } from 'src/modules/calendar/repositories/calendar-event-participant.repository';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { filterOutContactsFromCompanyOrWorkspace } from 'src/modules/connected-account/auto-companies-and-contacts-creation/utils/filter-out-contacts-from-company-or-workspace.util';
|
import { filterOutContactsFromCompanyOrWorkspace } from 'src/modules/connected-account/auto-companies-and-contacts-creation/utils/filter-out-contacts-from-company-or-workspace.util';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -36,9 +36,9 @@ export class CreateCompanyAndContactService {
|
|||||||
private readonly messageParticipantRepository: MessageParticipantRepository,
|
private readonly messageParticipantRepository: MessageParticipantRepository,
|
||||||
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
private readonly workspaceDataSourceService: WorkspaceDataSourceService,
|
||||||
private readonly messageParticipantService: MessageParticipantService,
|
private readonly messageParticipantService: MessageParticipantService,
|
||||||
@InjectObjectMetadataRepository(CalendarEventAttendeeObjectMetadata)
|
@InjectObjectMetadataRepository(CalendarEventParticipantObjectMetadata)
|
||||||
private readonly calendarEventAttendeeRepository: CalendarEventAttendeeRepository,
|
private readonly calendarEventParticipantRepository: CalendarEventParticipantRepository,
|
||||||
private readonly calendarEventAttendeeService: CalendarEventAttendeeService,
|
private readonly calendarEventParticipantService: CalendarEventParticipantService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async createCompaniesAndContacts(
|
async createCompaniesAndContacts(
|
||||||
@ -162,14 +162,14 @@ export class CreateCompanyAndContactService {
|
|||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
|
|
||||||
const calendarEventAttendeesWithoutPersonIdAndWorkspaceMemberId =
|
const calendarEventParticipantsWithoutPersonIdAndWorkspaceMemberId =
|
||||||
await this.calendarEventAttendeeRepository.getWithoutPersonIdAndWorkspaceMemberId(
|
await this.calendarEventParticipantRepository.getWithoutPersonIdAndWorkspaceMemberId(
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.calendarEventAttendeeService.updateCalendarEventAttendeesAfterContactCreation(
|
await this.calendarEventParticipantService.updateCalendarEventParticipantsAfterContactCreation(
|
||||||
calendarEventAttendeesWithoutPersonIdAndWorkspaceMemberId,
|
calendarEventParticipantsWithoutPersonIdAndWorkspaceMemberId,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import { RelationMetadata } from 'src/engine/workspace-manager/workspace-sync-me
|
|||||||
import { ActivityTargetObjectMetadata } from 'src/modules/activity/standard-objects/activity-target.object-metadata';
|
import { ActivityTargetObjectMetadata } from 'src/modules/activity/standard-objects/activity-target.object-metadata';
|
||||||
import { AttachmentObjectMetadata } from 'src/modules/attachment/standard-objects/attachment.object-metadata';
|
import { AttachmentObjectMetadata } from 'src/modules/attachment/standard-objects/attachment.object-metadata';
|
||||||
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
|
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { CompanyObjectMetadata } from 'src/modules/company/standard-objects/company.object-metadata';
|
import { CompanyObjectMetadata } from 'src/modules/company/standard-objects/company.object-metadata';
|
||||||
import { FavoriteObjectMetadata } from 'src/modules/favorite/standard-objects/favorite.object-metadata';
|
import { FavoriteObjectMetadata } from 'src/modules/favorite/standard-objects/favorite.object-metadata';
|
||||||
import { MessageParticipantObjectMetadata } from 'src/modules/messaging/standard-objects/message-participant.object-metadata';
|
import { MessageParticipantObjectMetadata } from 'src/modules/messaging/standard-objects/message-participant.object-metadata';
|
||||||
@ -206,22 +206,22 @@ export class PersonObjectMetadata extends BaseObjectMetadata {
|
|||||||
messageParticipants: MessageParticipantObjectMetadata[];
|
messageParticipants: MessageParticipantObjectMetadata[];
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: personStandardFieldIds.calendarEventAttendees,
|
standardId: personStandardFieldIds.calendarEventParticipants,
|
||||||
type: FieldMetadataType.RELATION,
|
type: FieldMetadataType.RELATION,
|
||||||
label: 'Calendar Event Attendees',
|
label: 'Calendar Event Participants',
|
||||||
description: 'Calendar Event Attendees',
|
description: 'Calendar Event Participants',
|
||||||
icon: 'IconCalendar',
|
icon: 'IconCalendar',
|
||||||
})
|
})
|
||||||
@RelationMetadata({
|
@RelationMetadata({
|
||||||
type: RelationMetadataType.ONE_TO_MANY,
|
type: RelationMetadataType.ONE_TO_MANY,
|
||||||
inverseSideTarget: () => CalendarEventAttendeeObjectMetadata,
|
inverseSideTarget: () => CalendarEventParticipantObjectMetadata,
|
||||||
onDelete: RelationOnDeleteAction.SET_NULL,
|
onDelete: RelationOnDeleteAction.SET_NULL,
|
||||||
})
|
})
|
||||||
@Gate({
|
@Gate({
|
||||||
featureFlag: 'IS_CALENDAR_ENABLED',
|
featureFlag: 'IS_CALENDAR_ENABLED',
|
||||||
})
|
})
|
||||||
@IsSystem()
|
@IsSystem()
|
||||||
calendarEventAttendees: CalendarEventAttendeeObjectMetadata[];
|
calendarEventParticipants: CalendarEventParticipantObjectMetadata[];
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: personStandardFieldIds.events,
|
standardId: personStandardFieldIds.events,
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import { ActivityObjectMetadata } from 'src/modules/activity/standard-objects/ac
|
|||||||
import { AttachmentObjectMetadata } from 'src/modules/attachment/standard-objects/attachment.object-metadata';
|
import { AttachmentObjectMetadata } from 'src/modules/attachment/standard-objects/attachment.object-metadata';
|
||||||
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
|
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||||
import { BlocklistObjectMetadata } from 'src/modules/connected-account/standard-objects/blocklist.object-metadata';
|
import { BlocklistObjectMetadata } from 'src/modules/connected-account/standard-objects/blocklist.object-metadata';
|
||||||
import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-attendee.object-metadata';
|
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
|
||||||
import { CommentObjectMetadata } from 'src/modules/activity/standard-objects/comment.object-metadata';
|
import { CommentObjectMetadata } from 'src/modules/activity/standard-objects/comment.object-metadata';
|
||||||
import { CompanyObjectMetadata } from 'src/modules/company/standard-objects/company.object-metadata';
|
import { CompanyObjectMetadata } from 'src/modules/company/standard-objects/company.object-metadata';
|
||||||
import { ConnectedAccountObjectMetadata } from 'src/modules/connected-account/standard-objects/connected-account.object-metadata';
|
import { ConnectedAccountObjectMetadata } from 'src/modules/connected-account/standard-objects/connected-account.object-metadata';
|
||||||
@ -226,22 +226,22 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata {
|
|||||||
blocklist: BlocklistObjectMetadata[];
|
blocklist: BlocklistObjectMetadata[];
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: workspaceMemberStandardFieldIds.calendarEventAttendees,
|
standardId: workspaceMemberStandardFieldIds.calendarEventParticipants,
|
||||||
type: FieldMetadataType.RELATION,
|
type: FieldMetadataType.RELATION,
|
||||||
label: 'Calendar Event Attendees',
|
label: 'Calendar Event Participants',
|
||||||
description: 'Calendar Event Attendees',
|
description: 'Calendar Event Participants',
|
||||||
icon: 'IconCalendar',
|
icon: 'IconCalendar',
|
||||||
})
|
})
|
||||||
@RelationMetadata({
|
@RelationMetadata({
|
||||||
type: RelationMetadataType.ONE_TO_MANY,
|
type: RelationMetadataType.ONE_TO_MANY,
|
||||||
inverseSideTarget: () => CalendarEventAttendeeObjectMetadata,
|
inverseSideTarget: () => CalendarEventParticipantObjectMetadata,
|
||||||
inverseSideFieldKey: 'workspaceMember',
|
inverseSideFieldKey: 'workspaceMember',
|
||||||
onDelete: RelationOnDeleteAction.SET_NULL,
|
onDelete: RelationOnDeleteAction.SET_NULL,
|
||||||
})
|
})
|
||||||
@Gate({
|
@Gate({
|
||||||
featureFlag: 'IS_CALENDAR_ENABLED',
|
featureFlag: 'IS_CALENDAR_ENABLED',
|
||||||
})
|
})
|
||||||
calendarEventAttendees: CalendarEventAttendeeObjectMetadata[];
|
calendarEventParticipants: CalendarEventParticipantObjectMetadata[];
|
||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
standardId: workspaceMemberStandardFieldIds.events,
|
standardId: workspaceMemberStandardFieldIds.events,
|
||||||
|
|||||||
Reference in New Issue
Block a user