Skip to content

Commit

Permalink
SWC-6621: use messages types from @sage-bionetworks/synapse-types
Browse files Browse the repository at this point in the history
  • Loading branch information
hallieswan committed Jan 6, 2024
1 parent 91c81a0 commit c55db09
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 40 deletions.
7 changes: 5 additions & 2 deletions e2e/helpers/messages.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Page } from '@playwright/test'
import { PaginatedResults } from '@sage-bionetworks/synapse-types'
import {
MessageBundle,
MessageToUser,
PaginatedResults,
} from '@sage-bionetworks/synapse-types'
import { deleteFileHandle } from './entities'
import { BackendDestinationEnum, doDelete, doGet } from './http'
import { MessageBundle, MessageToUser } from './types'

// Retrieves the current authenticated user's outbox.
export async function getUserOutbox(
Expand Down
33 changes: 0 additions & 33 deletions e2e/helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,6 @@ export type JwtPayload = {
sub: string
}

/* MESSAGES */
export type MessageToUser = {
id: string // The unique identifier of the message or comment
createdBy: string // The unique identifier of the sender of this message
fileHandleId: string // The S3 file handle storing the body of this message. Note: The file's mime type should be 'text/plain' or 'text/html'. If no character encoding is specified, then UTF-8 is assumed.
createdOn: string // When this message was created
recipients: string[] // The unique identifiers of the intended recipients of a message
subject: string // Topic of this message. Optional
inReplyTo: string // The unique identifier of the message being replied to. Can be null
inReplyToRoot: string // The unique identifier of the root message being replied to
notificationUnsubscribeEndpoint: string // the portal prefix for one-click email unsubscription. A signed, serialized token is appended to create the complete URL. If omitted, the default endpoint will be used.
userProfileSettingEndpoint: string // the portal link to user profile setting page. If omitted, the default endpoint will be used.
withUnsubscribeLink: boolean // should the unsubscribe link be included in the email?
withProfileSettingLink: boolean // should the user profile setting link be included in the email?
isNotificationMessage: boolean // A notification message is sent from a noreply email address, delivery failures are not sent back to the sender
to: string // The email addresses in the 'to' field of the email message
cc: string // The email addresses in the 'cc' field of the email message
bcc: string // The email addresses in the 'bcc' field of the email message
}

type MessageStatusType = 'READ' | 'UNREAD' | 'ARCHIVED'

type MessageStatus = {
messageId: string // The unique identifier of the message.
recipientId: string // The unique identifier of the recipient of this message.
status: MessageStatusType // The status of the message, from the RECIPIENT'S standpoint
}

export type MessageBundle = {
message: MessageToUser // JSON schema for a message to another user
status: MessageStatus // JSON schema for message status from the RECIPIENT'S standpoint
}

/* ENTITIES */
export type Project = {
name: string
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"devDependencies": {
"@playwright/test": "^1.40.1",
"@prettier/plugin-xml": "^3.1.0",
"@sage-bionetworks/synapse-types": "^0.0.1",
"@sage-bionetworks/synapse-types": "^0.0.2",
"@types/node": "18.6.5",
"@types/uuid": "^9.0.7",
"@typescript-eslint/eslint-plugin": "^6.4.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -895,10 +895,10 @@
react-virtualized-auto-sizer "^1.0.20"
react-window "^1.8.9"

"@sage-bionetworks/synapse-types@^0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@sage-bionetworks/synapse-types/-/synapse-types-0.0.1.tgz#725792366731aff93b6c4341ad818dcf4d47a524"
integrity sha512-XsfOg06eKi8fMmgDtMX2BS+3e1lt4Ruq3BCEs6AKzbfCyMONDotO96e1k2KknEfPSwAKhosLTC/cZQj2aTCmbg==
"@sage-bionetworks/synapse-types@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@sage-bionetworks/synapse-types/-/synapse-types-0.0.2.tgz#4190a908a10f10d0cc51e304d6d1d23da41ad64e"
integrity sha512-31MxrIOnJiAUYeXsDsf2J+q9A6nVZt9pWGfG+pYoKC2vZIgUo7L3ToelYEqoufvdgHht+aWq83bnk/+Y4UNoUA==

"@tanstack/react-table@^8.9.3":
version "8.9.3"
Expand Down

0 comments on commit c55db09

Please sign in to comment.