trismik 0.9.9__py3-none-any.whl → 0.9.12__py3-none-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.
trismik/_mapper.py CHANGED
@@ -352,7 +352,7 @@ class TrismikResponseMapper:
352
352
  id=json["id"],
353
353
  name=json["name"],
354
354
  description=json.get("description"),
355
- organizationId=json["organizationId"],
355
+ accountId=json["accountId"],
356
356
  createdAt=json["createdAt"],
357
357
  updatedAt=json["updatedAt"],
358
358
  )
trismik/_utils.py CHANGED
@@ -27,8 +27,11 @@ class TrismikUtils:
27
27
  """
28
28
  try:
29
29
  json_data = response.json()
30
- message = json_data.get("message", "Unknown error")
31
- return str(message) # Ensure we return a string
30
+ title = str(json_data.get("title", "Unknown error"))
31
+ message = str(json_data.get("detail", ""))
32
+ if len(message):
33
+ return title + ": " + message
34
+ return title
32
35
  except (httpx.RequestError, ValueError):
33
36
  error_message: str = response.content.decode(
34
37
  "utf-8", errors="ignore"
trismik/adaptive_test.py CHANGED
@@ -144,7 +144,7 @@ class AdaptiveTest:
144
144
  def create_project(
145
145
  self,
146
146
  name: str,
147
- organization_id: str,
147
+ team_id: Optional[str] = None,
148
148
  description: Optional[str] = None,
149
149
  ) -> TrismikProject:
150
150
  """
@@ -152,7 +152,7 @@ class AdaptiveTest:
152
152
 
153
153
  Args:
154
154
  name (str): Name of the project.
155
- organization_id (str): ID of the organization to create the
155
+ team_id (str): ID of the team to create the
156
156
  project in.
157
157
  description (Optional[str]): Optional description of the project.
158
158
 
@@ -165,13 +165,13 @@ class AdaptiveTest:
165
165
  """
166
166
  loop = self._get_loop()
167
167
  return loop.run_until_complete(
168
- self.create_project_async(name, organization_id, description)
168
+ self.create_project_async(name, team_id, description)
169
169
  )
170
170
 
171
171
  async def create_project_async(
172
172
  self,
173
173
  name: str,
174
- organization_id: str,
174
+ team_id: Optional[str] = None,
175
175
  description: Optional[str] = None,
176
176
  ) -> TrismikProject:
177
177
  """
@@ -179,7 +179,7 @@ class AdaptiveTest:
179
179
 
180
180
  Args:
181
181
  name (str): Name of the project.
182
- organization_id (str): ID of the organization to create the
182
+ team_id (str): ID of the team to create the
183
183
  project in.
184
184
  description (Optional[str]): Optional description of the project.
185
185
 
@@ -190,9 +190,7 @@ class AdaptiveTest:
190
190
  TrismikValidationError: If the request fails validation.
191
191
  TrismikApiError: If API request fails.
192
192
  """
193
- return await self._client.create_project(
194
- name, organization_id, description
195
- )
193
+ return await self._client.create_project(name, team_id, description)
196
194
 
197
195
  @overload
198
196
  def run( # noqa: E704
trismik/client_async.py CHANGED
@@ -365,7 +365,7 @@ class TrismikAsyncClient:
365
365
  async def create_project(
366
366
  self,
367
367
  name: str,
368
- organization_id: str,
368
+ team_id: Optional[str] = None,
369
369
  description: Optional[str] = None,
370
370
  ) -> TrismikProject:
371
371
  """
@@ -373,7 +373,7 @@ class TrismikAsyncClient:
373
373
 
374
374
  Args:
375
375
  name (str): Name of the project.
376
- organization_id (str): ID of the organization to create the
376
+ team_id (Optional[str]): ID of the team to create the
377
377
  project in.
378
378
  description (Optional[str]): Optional description of the project.
379
379
 
@@ -387,14 +387,15 @@ class TrismikAsyncClient:
387
387
  try:
388
388
  url = "../admin/public/projects"
389
389
 
390
- body = {"name": name}
390
+ body = {
391
+ "name": name,
392
+ }
393
+ if team_id is not None:
394
+ body["teamId"] = team_id
391
395
  if description is not None:
392
396
  body["description"] = description
393
397
 
394
- headers = {"x-organization-id": organization_id}
395
- response = await self._http_client.post(
396
- url, json=body, headers=headers
397
- )
398
+ response = await self._http_client.post(url, json=body)
398
399
  response.raise_for_status()
399
400
  json = response.json()
400
401
  return TrismikResponseMapper.to_project(json)
trismik/settings.py CHANGED
@@ -4,7 +4,7 @@ evaluation_settings = {
4
4
  "max_iterations": 150,
5
5
  }
6
6
 
7
- client_settings = {"endpoint": "https://dashboard.trismik.com/api"}
7
+ client_settings = {"endpoint": "https://api.trismik.com/adaptive-testing"}
8
8
 
9
9
  # Environment variable names used by the Trismik client
10
10
  environment_settings = {
trismik/types.py CHANGED
@@ -317,6 +317,6 @@ class TrismikProject:
317
317
  id: str
318
318
  name: str
319
319
  description: Optional[str]
320
- organizationId: str
320
+ accountId: str
321
321
  createdAt: str
322
322
  updatedAt: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trismik
3
- Version: 0.9.9
3
+ Version: 0.9.12
4
4
  Summary:
5
5
  License-File: LICENSE
6
6
  Author: Bartosz Kielczewski
@@ -0,0 +1,12 @@
1
+ trismik/__init__.py,sha256=20SwXrda9YsgykaoPohwz6foj2FkraniPA-GTQS9m00,197
2
+ trismik/_mapper.py,sha256=BFryJLwYYKDlX_vhEPKarDbdX8FkSYfHFtVQOnAK67o,10994
3
+ trismik/_utils.py,sha256=4dVRTWapyOQn8suGhzxD0-5Vn5m8_Uuc7gB434n0SdM,3848
4
+ trismik/adaptive_test.py,sha256=vG8OfL02IeQfuPpj3SdotxZRWKuMZGZiuPBhOU-PBpw,21594
5
+ trismik/client_async.py,sha256=VXMxdIFHmIUP0zcHO1Kq7-uHWXYSqWbUqASPm8MSQjU,13909
6
+ trismik/exceptions.py,sha256=2wb4_K7GdDf00s3xUaiSfw6718ZV3Eaa4M2lYbiEZl4,1945
7
+ trismik/settings.py,sha256=ErXj3f9Uw1AgewytjxmIY7TmM5jB7RE_LJMp3T7szBY,419
8
+ trismik/types.py,sha256=zo6QcXpo7ZfdEntvJDzftBPq_8_g0fS-XDfNTtKVg8k,6555
9
+ trismik-0.9.12.dist-info/METADATA,sha256=sHnT177cyW8nQQ_Av9oXjrnMWFHR3KetBdUJ3i9cdmM,6815
10
+ trismik-0.9.12.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
11
+ trismik-0.9.12.dist-info/licenses/LICENSE,sha256=tgetRhapGLh7ZxfknW6Mm-WobfziPd64nAK52X5XKaw,1077
12
+ trismik-0.9.12.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- trismik/__init__.py,sha256=20SwXrda9YsgykaoPohwz6foj2FkraniPA-GTQS9m00,197
2
- trismik/_mapper.py,sha256=wHrwmoTx8Z5B1BQH2_NUPaX3xCpBLKkidp245I4feno,11004
3
- trismik/_utils.py,sha256=WZ7x0EaG7PdXdFZMIs1wzgwqiPQm59QDDmQzBKYGCEg,3753
4
- trismik/adaptive_test.py,sha256=Fmc6PJZg_SKQjV_xQF29ZJQwPxpGwfKuvi2VznAmOB0,21646
5
- trismik/client_async.py,sha256=7NYcYomIfETjL5BLGQnJWhL249GBS67otGLH9Rue0sI,13906
6
- trismik/exceptions.py,sha256=2wb4_K7GdDf00s3xUaiSfw6718ZV3Eaa4M2lYbiEZl4,1945
7
- trismik/settings.py,sha256=FCP-d8ZEiYWUTWoa9nOVzSwTOLvg8y0pU08dAseiOwY,412
8
- trismik/types.py,sha256=-HHnOTzMeXfryKJCuZ7LHAPyS0G6uzsOJFUtIU0VB3k,6560
9
- trismik-0.9.9.dist-info/METADATA,sha256=gZtOCSIn4VaEIsKo-MugwvEjatgpAYRkwl3gWf8Y2Ic,6814
10
- trismik-0.9.9.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
11
- trismik-0.9.9.dist-info/licenses/LICENSE,sha256=tgetRhapGLh7ZxfknW6Mm-WobfziPd64nAK52X5XKaw,1077
12
- trismik-0.9.9.dist-info/RECORD,,