Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

3.1 KB
Raw Blame
import type { ActivityEventFieldsFragment } from '@service-storage/graphql/generated/graphql';

const BASE = {
  __typename: 'GraphqlActivityEvent' as const,
  id: 'evt-1',
  actorId: 'macro|[email protected]',
  subjectId: 'macro|[email protected]',
  entityType: 'DOCUMENT' as const,
  entityId: 'doc-1',
  occurredAt: '2026-08-21T12:00:00.000Z',
};

export const createdEvent: ActivityEventFieldsFragment = {
  ...BASE,
  action: { __typename: 'GraphqlActivityCreated' },
};

export const editedEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-2',
  action: { __typename: 'GraphqlActivityEdited' },
};

export const openedEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-3',
  action: { __typename: 'GraphqlActivityOpened' },
};

export const deletedEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-4',
  action: { __typename: 'GraphqlActivityDeleted' },
};

export const messagedEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-5',
  entityType: 'CHANNEL',
  entityId: 'channel-1',
  action: { __typename: 'GraphqlActivityMessaged' },
};

export const sentEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-6',
  entityType: 'EMAIL_THREAD',
  entityId: 'thread-1',
  action: { __typename: 'GraphqlActivitySent' },
};

export const propertyChangedEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-7',
  action: {
    __typename: 'GraphqlActivityPropertyChanged',
    property: 'prop-1',
    from: null,
    to: 'Done',
  },
};

export const participantAddedEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-8',
  entityType: 'CHANNEL',
  entityId: 'channel-1',
  action: {
    __typename: 'GraphqlActivityParticipantAdded',
    participant: 'macro|[email protected]',
  },
};

export const participantRemovedEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-9',
  entityType: 'CHANNEL',
  entityId: 'channel-1',
  action: {
    __typename: 'GraphqlActivityParticipantRemoved',
    participant: 'macro|[email protected]',
  },
};

export const callStartedEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-10',
  entityType: 'CHANNEL',
  entityId: 'channel-1',
  action: {
    __typename: 'GraphqlActivityCallStarted',
    callId: 'call-1',
  },
};

export const unknownActionEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-11',
  action: {
    __typename: 'GraphqlActivityUnknownAction',
    tag: 'transmogrified_thoroughly',
    payload: null,
  },
};

export const unsupportedEntityEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-12',
  entityType: 'TEAM',
  entityId: 'team-1',
  action: { __typename: 'GraphqlActivityCreated' },
};

/** Someone answered a form (needs the regenerated GraphQL union). */
export const formRespondedEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-14',
  entityType: 'FORM',
  entityId: 'form-1',
  action: { __typename: 'GraphqlActivityResponded' },
};

export const databaseCreatedEvent: ActivityEventFieldsFragment = {
  ...BASE,
  id: 'evt-13',
  entityType: 'DATABASE',
  entityId: 'database-1',
  action: { __typename: 'GraphqlActivityCreated' },
};