This repository was archived by the owner on Feb 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 278
/
Copy pathconst.h
139 lines (124 loc) · 6.69 KB
/
const.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// Copyright 2014 Toggl Desktop developers.
#ifndef SRC_CONST_H_
#define SRC_CONST_H_
// used later in the file
#ifndef TOGGL_BUILD_TYPE
#define TOGGL_BUILD_TYPE ""
#endif
#define kOneSecondInMicros 1000000
#define kMaxTimeEntryDurationSeconds 3596400
#define kHTTPClientTimeoutSeconds 30
#define kSyncIntervalRangeSeconds 900
#define kWebsocketRestartRangeSeconds 45
#define kCheckUpdateIntervalSeconds 86400
#define kCheckInAppMessageIntervalSeconds 14400
#define kRequestThrottleSeconds 2
#define kTimerStartInterval 10
#define kTimelineSecondsToKeep 604800
#define kWindowFocusThresholdSeconds 10
#define kAutotrackerThresholdSeconds 5
#define kBetaChannelPercentage 25
#define kTimelineChunkSeconds 900
#define kEnterpriseInstall false
#define kDebianPackage (TOGGL_BUILD_TYPE == std::string("deb"))
#define kTimelineUploadIntervalSeconds 60
#define kTimelineUploadMaxBackoffSeconds (kTimelineUploadIntervalSeconds * 10) // NOLINT
#define kMaxFileSize 5242880 // 5MB
#define kMaxDurationSeconds (999 * 3600)
#define kMaxTagsPerTimeEntry 50
#define kMinimumAllowedYear 2006
#define kMaximumAllowedYear 2030
#define kMaximumDescriptionLength 3000
#define kTimeComparisonEpsilonMicroSeconds 100000 // 100 ms
#define kLostPasswordURL "https://toggl.com/forgot-password?desktop=true"
#define kGeneralSupportURL "https://support.toggl.com/toggl-on-my-desktop/"
#define kLinuxSupportURL "https://support.toggl.com/toggl-desktop-for-linux/"
#define kMacSupportURL "https://support.toggl.com/toggl-desktop-for-mac-osx/"
#define kTOSURL "https://toggl.com/legal/terms/"
#define kPrivacyPolicyURL "https://toggl.com/legal/privacy/"
#define kContentTypeMultipartFormData "multipart/form-data"
#define kContentTypeApplicationJSON "application/json"
// Data validation errors
#define kOverMaxDurationError "Max allowed duration per 1 time entry is 999 hours"
#define kMaxTagsPerTimeEntryError "Tags are limited to 50 per task"
#define kInvalidStartTimeError "Start time year must be between 2006 and 2030"
#define kInvalidStopTimeError "Stop time year must be between 2006 and 2030"
#define kInvalidDateError "Date year must be between 2006 and 2030"
#define kStartNotBeforeStopError "Stop time must be after start time"
#define kMaximumDescriptionLengthError "Maximum length for description (3000 chars) exceeded"
#define kCheckYourSignupError "Signup failed - please check your details. The e-mail might be already taken." // NOLINT
#define kEndpointGoneError "The API endpoint used by this app is gone. Please contact Toggl support!" // NOLINT
#define kForbiddenError "Invalid e-mail or password!"
#define kUnsupportedAppError "This version of the app is not supported any more. Please visit Toggl website to download a supported app." // NOLINT
#define kUnauthorizedError "Unauthorized! Please login again."
#define kCannotConnectError "Cannot connect to Toggl"
#define kCannotSyncInTestEnv "Cannot sync in test env"
#define kBackendIsDownError "Backend is down"
#define kBackendIsSendingInvalidData "Backend is sending invalid data"
#define kBadRequestError "Data that you are sending is not valid/acceptable"
#define kRequestIsNotPossible "Request is not possible"
#define kPaymentRequiredError "Requested action allowed only for Non-Free workspaces. Please upgrade!" // NOLINT
#define kCannotAccessWorkspaceError "cannot access workspace"
#define kEmailNotFoundCannotLogInOffline "Login failed. Are you online?" // NOLINT
#define kInvalidPassword "Invalid password"
#define kCannotEstablishProxyConnection "Cannot establish proxy connection"
#define kCertificateVerifyFailed "certificate verify failed"
#define kCheckYourProxySetup "Check your proxy setup"
#define kCheckYourFirewall "Check your firewall"
#define kProxyAuthenticationRequired "Proxy Authentication Required"
#define kCertificateValidationError "Certificate validation error"
#define kUnacceptableCertificate "Unacceptable certificate from www.toggl.com"
#define kCannotUpgradeToWebSocketConnection "Cannot upgrade to WebSocket connection" // NOLINT
#define kSSLException "SSL Exception"
#define kRateLimit "Too many requests, sync delayed by 1 minute"
#define kCannotWriteFile "Cannot write file"
#define kIsSuspended "is suspended"
#define kRequestToServerFailedWithStatusCode403 "Request to server failed with status code: 403" // NOLINT
#define kMissingWorkspaceID "Missing workspace ID"
#define kCannotContinueDeletedTimeEntry "Cannot continue deleted time entry"
#define kCannotDeleteDeletedTimeEntry "Cannot delete deleted time entry"
#define kErrorRuleAlreadyExists "rule already exists"
#define kPleaseSelectAWorkspace "Please select a workspace"
#define kClientNameMustNotBeEmpty "Client name must not be empty"
#define kProjectNameMustNotBeEmpty "Project name must not be empty"
#define kProjectNameAlready "Project name already"
#define kProjectNameAlreadyExists "Project name already exists"
#define kClientNameAlreadyExists "Client name already exists"
#define kDatabaseDiskMalformed "The database disk image is malformed"
#define kOutOfDatePleaseUpgrade "Your version of Toggl Track is out of date, please upgrade!"
#define kThisEntryCantBeSavedPleaseAdd "This entry can't be saved - please add"
#define kOneLoginAttemptLeft "Incorrect email or password. One more try before account gets locked for 5 minutes."
#define kAccountIsLocked "Incorrect email or password. Account is locked for 5 minutes. Account owner has been notified."
#define kIncorrectEmailOrPassword "Incorrect email or password. Please try again."
#define kSSONotConfigure "SSO is not configured for this email address"
#define kBetterSSONotConfigure "Single Sign On is not configured for your email address. Please try a different login method or contact your administrator."
#define kModelAutotrackerRule "autotracker_rule"
#define kModelClient "client"
#define kModelProject "project"
#define kModelSettings "settings"
#define kModelTag "tag"
#define kModelTask "task"
#define kModelTimeEntry "time_entry"
#define kModelTimelineEvent "timeline_event"
#define kModelUser "user"
#define kModelWorkspace "workspace"
#define kChangeTypeInsert "insert"
#define kChangeTypeUpdate "update"
#define kChangeTypeDelete "delete"
#define kAutocompleteItemTE 0
#define kAutocompleteItemTask 1
#define kAutocompleteItemProject 2
#define kAutocompleteItemWorkspace 3
#define kTogglDesktopClientID_MacOS "toggldesktop.TogglDesktop"
#define kAPIV8 "v8"
#define kAPIV9 "v9"
#define kGoogleProvider "google"
#define kAppleProvider "apple"
#define kGoogleAccessToken "google_access_token"
#define kAppleAccessToken "apple_token"
// there was a typo in the initial set of flags, use both variants
#define kSyncStrategyLegacy1 "dekstop_sync_client"
#define kSyncStrategyLegacy2 "desktop_sync_client"
#define kTimelineUi "desktop_timeline_ui"
#define kDesktopClient "desktop"
#endif // SRC_CONST_H_