pycupra 0.1.11__py3-2ndver-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pycupra/const.py ADDED
@@ -0,0 +1,195 @@
1
+ """Constants for pycupra library."""
2
+
3
+ BASE_SESSION = 'https://ola.prod.code.seat.cloud.vwgroup.com'
4
+ BASE_AUTH = 'https://identity.vwgroup.io'
5
+
6
+ # Data used in communication
7
+ CLIENT_LIST = {
8
+ 'seat': {
9
+ 'CLIENT_ID': '99a5b77d-bd88-4d53-b4e5-a539c60694a3@apps_vw-dilab_com',
10
+ 'SCOPE': 'openid profile nickname birthdate phone',
11
+ 'REDIRECT_URL': 'seat://oauth-callback',
12
+ 'TOKEN_TYPES': 'code id_token token'
13
+ },
14
+ 'cupra': {
15
+ 'CLIENT_ID': '3c756d46-f1ba-4d78-9f9a-cff0d5292d51@apps_vw-dilab_com',
16
+ 'CLIENT_SECRET': 'eb8814e641c81a2640ad62eeccec11c98effc9bccd4269ab7af338b50a94b3a2',
17
+ 'SCOPE': 'openid profile nickname birthdate phone',
18
+ 'REDIRECT_URL': 'cupra://oauth-callback',
19
+ 'TOKEN_TYPES': 'code id_token token'
20
+ }
21
+ }
22
+
23
+
24
+ XCLIENT_ID = '3c756d46-f1ba-4d78-9f9a-cff0d5292d51@apps_vw-dilab.com'
25
+ XAPPVERSION = '2.5.0'
26
+ XAPPNAME = 'com.cupra.mycupra'
27
+ USER_AGENT_CUPRA = 'OLACupra/2.5.0 (Android 12; sdk_gphone64_x86_64; Google) Mobile'
28
+ USER_AGENT_SEAT = 'OLASeat/2.5.0 (Android 12; sdk_gphone64_x86_64; Google) Mobile'
29
+ APP_URI = 'https://ola.prod.code.seat.cloud.vwgroup.com'
30
+
31
+ HEADERS_SESSION = {
32
+ 'seat': {
33
+ 'Connection': 'keep-alive',
34
+ 'Content-Type': 'application/json',
35
+ 'Accept-charset': 'UTF-8',
36
+ 'Accept': 'application/json',
37
+ #'X-Client-Id': XCLIENT_ID,
38
+ #'X-App-Version': XAPPVERSION,
39
+ #'X-App-Name': XAPPNAME,
40
+ 'User-Agent': USER_AGENT_SEAT
41
+ #'User-ID': '?????', # to be set later
42
+ },
43
+ 'cupra': {
44
+ 'Connection': 'keep-alive',
45
+ 'Content-Type': 'application/json',
46
+ 'Accept-charset': 'UTF-8',
47
+ 'Accept': 'application/json',
48
+ #'X-Client-Id': XCLIENT_ID,
49
+ #'X-App-Version': XAPPVERSION,
50
+ #'X-App-Name': XAPPNAME,
51
+ 'User-Agent': USER_AGENT_CUPRA
52
+ #'User-ID': '?????', # to be set later
53
+ }
54
+ }
55
+
56
+ HEADERS_AUTH = {
57
+ 'seat': {
58
+ 'Content-Type': 'application/x-www-form-urlencoded',
59
+ 'User-Agent': USER_AGENT_SEAT,
60
+ 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
61
+ 'x-requested-with': XAPPNAME,
62
+ 'Accept-Encoding': 'gzip, deflate',
63
+ 'Connection': 'keep-alive',
64
+ #'X-App-Name': XAPPNAME
65
+ },
66
+ 'cupra':{
67
+ 'Content-Type': 'application/x-www-form-urlencoded',
68
+ 'User-Agent': USER_AGENT_CUPRA,
69
+ 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
70
+ 'x-requested-with': XAPPNAME,
71
+ 'Accept-Encoding': 'gzip, deflate',
72
+ 'Connection': 'keep-alive',
73
+ #'X-App-Name': XAPPNAME
74
+ }
75
+ }
76
+
77
+ TOKEN_HEADERS = {
78
+ 'seat': {
79
+ 'Accept': 'application/json',
80
+ 'X-Platform': 'Android',
81
+ #'X-Language-Id': 'XX',
82
+ #'X-Country-Id': 'XX',
83
+ #'Accept-Language': 'XX',
84
+ 'Accept-Charset': 'UTF-8',
85
+ 'Content-Type': 'application/x-www-form-urlencoded',
86
+ 'Connection': 'keep-alive',
87
+ 'Accept-Encoding': 'gzip',
88
+ 'User-Agent': USER_AGENT_SEAT,
89
+ 'app-version': '2.5.0',
90
+ 'app-brand': 'seat',
91
+ 'app-market': 'android',
92
+ #'User-ID': '?????', # to be set later
93
+ 'Authorization': 'Bearer'
94
+ },
95
+ 'cupra': {
96
+ 'Accept': 'application/json',
97
+ 'X-Platform': 'Android',
98
+ #'X-Language-Id': 'XX',
99
+ #'X-Country-Id': 'XX',
100
+ #'Accept-Language': 'XX',
101
+ 'Accept-Charset': 'UTF-8',
102
+ 'Content-Type': 'application/x-www-form-urlencoded',
103
+ 'Connection': 'keep-alive',
104
+ 'Accept-Encoding': 'gzip',
105
+ 'User-Agent': USER_AGENT_CUPRA,
106
+ 'app-version': '2.5.0',
107
+ 'app-brand': 'cupra',
108
+ 'app-market': 'android',
109
+ #'User-ID': '?????', # to be set later
110
+ 'Authorization': 'Bearer'
111
+ }
112
+ }
113
+
114
+ #ERROR_CODES = {
115
+ # '11': 'Charger not connected'
116
+ #}
117
+
118
+ ### API Endpoints below, not yet in use ###
119
+ # API AUTH endpoints
120
+ AUTH_OIDCONFIG = 'https://identity.vwgroup.io/.well-known/openid-configuration' # OpenID configuration
121
+ AUTH_TOKEN = 'https://identity.vwgroup.io/oidc/v1/token' # Endpoint for exchanging code for token
122
+ AUTH_REFRESH = 'https://ola.prod.code.seat.cloud.vwgroup.com/authorization/api/v1/token' # Endpoint for token refresh (also used for exchanging code for token for Seat)
123
+ AUTH_TOKENKEYS = 'https://identity.vwgroup.io/oidc/v1/keys' # Signing keys for tokens
124
+
125
+ # API endpoints
126
+ API_MBB_STATUSDATA = 'https://customer-profile.vwgroup.io/v3/customers/{self._user_id}/mbbStatusData'
127
+ API_PERSONAL_DATA= 'https://customer-profile.vwgroup.io/v3/customers/{self._user_id}/personalData'
128
+ #Other option for personal data is '{baseurl}/v1/users/{self._user_id}'
129
+
130
+ API_VEHICLES = '{APP_URI}/v2/users/{self._user_id}/garage/vehicles' # Garage info
131
+ API_MYCAR = '{baseurl}/v5/users/{self._user_id}/vehicles/{vin}/mycar' # Vehicle status report
132
+ API_CHARGING = '{baseurl}/v1/vehicles/{vin}/charging' # Vehicle charging information
133
+ #API_OPERLIST = '{homeregion}/api/rolesrights/operationlist/v3/vehicles/{vin}' # API Endpoint for supported operations
134
+ #API_CHARGER = 'fs-car/bs/batterycharge/v1/{BRAND}/{COUNTRY}/vehicles/{vin}/charger' # Charger data
135
+ API_CLIMATER_STATUS = '{baseurl}/v1/vehicles/{vin}/climatisation/status' # Climatisation data
136
+ API_CLIMATER = '{baseurl}/v2/vehicles/{vin}/climatisation' # Climatisation data
137
+ API_DEPARTURE_TIMERS = '{baseurl}/v1/vehicles/{vin}/departure-timers' # Departure timers
138
+ API_DEPARTURE_PROFILES = '{baseurl}/v1/vehicles/{vin}/departure/profiles' # Departure profiles
139
+ API_POSITION = '{baseurl}/v1/vehicles/{vin}/parkingposition' # Position data
140
+ API_POS_TO_ADDRESS= 'https://maps.googleapis.com/maps/api/directions/json?origin={lat},{lon}&destination={lat},{lon}&traffic_model=best_guess&departure_time=now&language=de&key={apiKeyForGoogle}&mode=driving'
141
+ API_TRIP = '{baseurl}/v1/vehicles/{vin}/driving-data/{dataType}?from={startDate}T00:00:00Z&to=2099-12-31T09:59:01Z' # Trip statistics (whole history) SHORT/LONG/CYCLIC (WEEK only with from)
142
+ API_MILEAGE = '{baseurl}/v1/vehicles/{vin}/mileage' # Total km etc
143
+ API_MAINTENANCE = '{baseurl}/v1/vehicles/{vin}/maintenance' # Inspection information
144
+ API_MEASUREMENTS = '{baseurl}/v1/vehicles/{vin}/measurements/engines' # ???
145
+ API_STATUS = '{baseurl}/v2/vehicles/{vin}/status' # Status information like locks and windows
146
+ API_WARNINGLIGHTS = '{baseurl}/v3/vehicles/{vin}/warninglights' # ???
147
+ API_SHOP = '{baseurl}/v1/shop/vehicles/{vin}/articles' # ???
148
+ #API_ACTION = '{baseurl}/v1/vehicles/{vin}/{action}/requests/{command}' # Actions (e.g. ActionCharge="charging", ActionChargeStart="start",ActionChargeStop="stop")
149
+ API_RELATION_STATUS = '{baseurl}/v1/users/{self._user_id}/vehicles/{vin}/relation-status' # ???
150
+ API_INVITATIONS = '{baseurl}/v1/user/{self._user_id}/invitations' # ???
151
+ API_CAPABILITIES = '{APP_URI}/v1/user/{self._user_id}/vehicle/{vin}/capabilities' # ???
152
+ #API_CAPABILITIES_MANAGEMENT = '{API_CAPABILITIES}/management' # ???
153
+ API_IMAGE = '{baseurl}/v1/vehicles/{vin}/renders'
154
+ API_HONK_AND_FLASH = '{baseurl}//v1/vehicles/{vin}/honk-and-flash'
155
+ API_ACCESS = '{baseurl}//v1/vehicles/{vin}/access/{action}' # to lock or unlock vehicle
156
+ API_REQUESTS = '{baseurl}/vehicles/{vin}/{capability}/requests'
157
+ API_REFRESH = '{baseurl}/v1/vehicles/{vin}/vehicle-wakeup/request'
158
+ API_SECTOKEN = '{baseurl}/v2/users/{self._user_id}/spin/verify'
159
+ API_DESTINATION = '{baseurl}/v1/users/vehicles/{vin}/destination'
160
+ API_LITERALS= '{APP_URI}/v1/content/apps/my-cupra/literals/{language}' # Message texts in different langauages, e.g. 'en_GB'
161
+
162
+ # Still to analyse if needed
163
+ #'{baseurl}/settings/api/v1?vin={vin}&vehicle-model=LeonST&region=US&enrolment-country=DE&platform=MOD3'
164
+ #'{baseurl}/v1/users/{self._user_id}/vin/{vin}/terms-and-conditions'
165
+ #'{baseurl}/v2/subscriptions'
166
+ #'{baseurl}/v1/users/{self._user_id}/vehicles/{vin}/leads/history'
167
+ #'{baseurl}/v1/users/{self._user-id}/vehicles/{vin}/consents/xxcryptickeyxxx?locale=en_DE' #{"userId":"xxxxxxx","locale":"en_DE","error":{"title":"Consent failed to load.","detail":"CUPRAApp_ME3_Vehicle_VehiclePermissions_MainViewAccepted_Low_Type1_Wrong"}}
168
+
169
+ API_CONNECTION= '{APP_URI}/vehicles/{vin}/connection'
170
+ #API_CONSENTS='{APP_URI}/v1/users/{self._user_id}/consents'
171
+ API_PSP='{baseurl}/v2/users/{self._user_id}/vehicles/{vin}/psp' # primary service provider (Werkstatt)
172
+ API_USER_INFO= 'https://identity-userinfo.vwgroup.io/oidc/userinfo' #{"sub":"xxx","name":"xxx","given_name":"xxx","family_name":"xxx","nickname":"xxx","email":"###","email_verified":true,"birthdate":"###","updated_at":123456789,"picture":"https://customer-pictures.vwgroup.io/v1/###/profile-picture"}
173
+
174
+ PUBLIC_MODEL_IMAGES_SERVER = 'prod-ola-public-bucket.s3.eu-central-1.amazonaws.com' # non-indivdual model images are on this server
175
+
176
+ # API endpoints for status
177
+ REQ_STATUS = {
178
+ 'climatisation': 'fs-car/bs/climatisation/v1/{BRAND}/{COUNTRY}/vehicles/{vin}/climater/actions/{id}',
179
+ 'batterycharge': 'fs-car/bs/batterycharge/v1/{BRAND}/{COUNTRY}/vehicles/{vin}/charger/actions/{id}',
180
+ 'departuretimer': 'fs-car/bs/departuretimer/v1/{BRAND}/{COUNTRY}/vehicles/{vin}/timer/actions/{id}',
181
+ 'vsr': 'fs-car/bs/vsr/v1/{BRAND}/{COUNTRY}/vehicles/{vin}/requests/{id}/jobstatus',
182
+ 'default': 'fs-car/bs/{section}/v1/{BRAND}/{COUNTRY}/vehicles/{vin}/requests/{id}/status'
183
+ }
184
+
185
+ FCM_PROJECT_ID='ola-apps-prod'
186
+ FCM_APP_ID={
187
+ 'cupra': '1:530284123617:android:9b9ba5a87c7ffd37fbeea0',
188
+ 'seat': '1:530284123617:android:d6187613ac3d7b08fbeea0'
189
+ }
190
+ FCM_API_KEY='AIzaSyCoSp1zitklb1EDj5yQumN0VNhDizJQHLk'
191
+ FIREBASE_STATUS_NOT_INITIALISED= 0
192
+ FIREBASE_STATUS_ACTIVATED= 1
193
+ FIREBASE_STATUS_NOT_WANTED= -2
194
+ FIREBASE_STATUS_ACTIVATION_FAILED= -1
195
+ FIREBASE_STATUS_ACTIVATION_STOPPED= -3