-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FAI-13888 - Start creating sync message table and add warning when no…
… records emitted for stream (#1861)
- Loading branch information
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {SyncMessage} from './protocol'; | ||
|
||
// TODO: more entries | ||
export const SYNC_MESSAGE_TABLE = { | ||
FEATURE_NOT_ENABLED: ( | ||
featureName: string, | ||
sourceType: string | ||
): SyncMessage => ({ | ||
code: 1000, | ||
summary: `${featureName} not enabled`, | ||
details: `It seems this functionality, ${featureName}, is not enabled for the ${sourceType} source.`, | ||
action: 'Contact support to enable this feature', | ||
type: 'ERROR', | ||
}), | ||
CONNECTION_UNAVAILABLE: (sourceType: string): SyncMessage => ({ | ||
code: 1001, | ||
summary: 'Connection unavailable', | ||
details: `Unable to establish a connection with your ${sourceType} source.`, | ||
action: | ||
'Check if your source is configured to accept requests from our system.', | ||
type: 'ERROR', | ||
}), | ||
INVALID_CREDENTIALS: (sourceType: string): SyncMessage => ({ | ||
code: 1002, | ||
summary: 'Invalid credentials', | ||
details: `We are unable to retrieve data from your ${sourceType} source.`, | ||
action: `Check your ${sourceType} credentials. Ensure they are correct and up-to-date.`, | ||
type: 'ERROR', | ||
}), | ||
NO_RECORDS_FOR_STREAM: ( | ||
streamName: string, | ||
sourceType: string | ||
): SyncMessage => ({ | ||
code: 1003, | ||
summary: `No records emitted for ${streamName} stream`, | ||
entity: streamName, | ||
action: `Check your ${sourceType} credentials. Ensure they have the required permissions.`, | ||
type: 'WARNING', | ||
}), | ||
}; |