socketdev 3.0.2__tar.gz → 3.0.5__tar.gz

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.
Files changed (67) hide show
  1. {socketdev-3.0.2 → socketdev-3.0.5}/.gitignore +2 -0
  2. {socketdev-3.0.2 → socketdev-3.0.5}/PKG-INFO +372 -33
  3. {socketdev-3.0.2 → socketdev-3.0.5}/README.rst +371 -32
  4. {socketdev-3.0.2 → socketdev-3.0.5}/pyproject.toml +1 -1
  5. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/__init__.py +10 -0
  6. socketdev-3.0.5/socketdev/alerttypes/__init__.py +38 -0
  7. socketdev-3.0.5/socketdev/analytics/__init__.py +64 -0
  8. socketdev-3.0.5/socketdev/apitokens/__init__.py +126 -0
  9. socketdev-3.0.5/socketdev/auditlog/__init__.py +30 -0
  10. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/core/dedupe.py +28 -33
  11. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/dependencies/__init__.py +16 -11
  12. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/diffscans/__init__.py +3 -2
  13. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/fullscans/__init__.py +13 -4
  14. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/purl/__init__.py +1 -1
  15. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/report/__init__.py +19 -4
  16. socketdev-3.0.5/socketdev/threatfeed/__init__.py +37 -0
  17. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/utils/__init__.py +30 -8
  18. socketdev-3.0.5/socketdev/version.py +1 -0
  19. socketdev-3.0.5/tests/README.md +121 -0
  20. socketdev-3.0.5/tests/conftest.py +167 -0
  21. socketdev-3.0.5/tests/integration/test_all_endpoints.py +567 -0
  22. socketdev-3.0.5/tests/integration/test_comprehensive_integration.py +354 -0
  23. socketdev-3.0.5/tests/integration/test_new_endpoints.py +319 -0
  24. socketdev-3.0.5/tests/run_tests.py +378 -0
  25. socketdev-3.0.5/tests/unit/__init__.py +1 -0
  26. socketdev-3.0.5/tests/unit/test_all_endpoints_unit.py +658 -0
  27. socketdev-3.0.5/tests/unit/test_dedupe.py +192 -0
  28. socketdev-3.0.5/tests/unit/test_socket_sdk_unit.py +280 -0
  29. socketdev-3.0.5/tests/unit/test_working_endpoints_unit.py +464 -0
  30. socketdev-3.0.2/socketdev/apitokens/__init__.py +0 -0
  31. socketdev-3.0.2/socketdev/auditlog/__init__.py +0 -0
  32. socketdev-3.0.2/socketdev/threatfeed/__init__.py +0 -0
  33. socketdev-3.0.2/socketdev/version.py +0 -1
  34. {socketdev-3.0.2 → socketdev-3.0.5}/.github/CODEOWNERS +0 -0
  35. {socketdev-3.0.2 → socketdev-3.0.5}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
  36. {socketdev-3.0.2 → socketdev-3.0.5}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  37. {socketdev-3.0.2 → socketdev-3.0.5}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
  38. {socketdev-3.0.2 → socketdev-3.0.5}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  39. {socketdev-3.0.2 → socketdev-3.0.5}/.github/workflows/pr-preview.yml +0 -0
  40. {socketdev-3.0.2 → socketdev-3.0.5}/.github/workflows/release.yml +0 -0
  41. {socketdev-3.0.2 → socketdev-3.0.5}/.github/workflows/version-check.yml +0 -0
  42. {socketdev-3.0.2 → socketdev-3.0.5}/.hooks/sync_version.py +0 -0
  43. {socketdev-3.0.2 → socketdev-3.0.5}/.python-version +0 -0
  44. {socketdev-3.0.2 → socketdev-3.0.5}/LICENSE +0 -0
  45. {socketdev-3.0.2 → socketdev-3.0.5}/scripts/build.sh +0 -0
  46. {socketdev-3.0.2 → socketdev-3.0.5}/scripts/deploy-test-pypi.sh +0 -0
  47. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/core/api.py +0 -0
  48. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/core/classes.py +0 -0
  49. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/core/issues.py +0 -0
  50. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/exceptions.py +0 -0
  51. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/export/__init__.py +0 -0
  52. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/historical/__init__.py +0 -0
  53. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/labels/__init__.py +0 -0
  54. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/licensemetadata/__init__.py +0 -0
  55. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/log.py +0 -0
  56. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/npm/__init__.py +0 -0
  57. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/openapi/__init__.py +0 -0
  58. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/org/__init__.py +0 -0
  59. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/quota/__init__.py +0 -0
  60. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/repos/__init__.py +0 -0
  61. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/repositories/__init__.py +0 -0
  62. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/sbom/__init__.py +0 -0
  63. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/settings/__init__.py +0 -0
  64. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/tools/__init__.py +0 -0
  65. {socketdev-3.0.2 → socketdev-3.0.5}/socketdev/triage/__init__.py +0 -0
  66. {socketdev-3.0.2 → socketdev-3.0.5}/tests/integration/test_diffscans_integration.py +0 -0
  67. {socketdev-3.0.2 → socketdev-3.0.5}/uv.lock +0 -0
@@ -3,6 +3,8 @@ main.py
3
3
  venv
4
4
  .idea
5
5
  .DS_Store
6
+ .env
7
+ *.swp
6
8
  *.zip
7
9
  *.pyc
8
10
  test.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: socketdev
3
- Version: 3.0.2
3
+ Version: 3.0.5
4
4
  Summary: Socket Security Python SDK
5
5
  Project-URL: Homepage, https://github.com/socketdev/socketdev
6
6
  Author-email: Douglas Coburn <douglas@socket.dev>
@@ -161,9 +161,9 @@ Export a Socket SBOM as an SPDX SBOM
161
161
  - **project_version (str)** - Filter by project version
162
162
  - **project_id (str)** - Filter by project ID
163
163
 
164
- fullscans.get(org_slug)
165
- """""""""""""""""""""""
166
- Retrieve the Fullscans information for an Organization
164
+ fullscans.get(org_slug, params)
165
+ """""""""""""""""""""""""""""""
166
+ Retrieve the Fullscans information for an Organization with query parameters
167
167
 
168
168
  **Usage:**
169
169
 
@@ -171,11 +171,20 @@ Retrieve the Fullscans information for an Organization
171
171
 
172
172
  from socketdev import socketdev
173
173
  socket = socketdev(token="REPLACE_ME")
174
- print(socket.fullscans.get("org_slug"))
174
+
175
+ # Query parameters for filtering full scans
176
+ params = {
177
+ "repo": "my-repo",
178
+ "branch": "main",
179
+ "limit": 10,
180
+ "offset": 0
181
+ }
182
+ print(socket.fullscans.get("org_slug", params))
175
183
 
176
184
  **PARAMETERS:**
177
185
 
178
186
  - **org_slug (str)** - The organization name
187
+ - **params (dict)** - Query parameters for filtering results (required)
179
188
 
180
189
  fullscans.post(files, params)
181
190
  """""""""""""""""""""""""""""
@@ -186,29 +195,30 @@ Create a full scan from a set of package manifest files. Returns a full scan inc
186
195
  .. code-block:: python
187
196
 
188
197
  from socketdev import socketdev
198
+ from socketdev.fullscans import FullScanParams
199
+
189
200
  socket = socketdev(token="REPLACE_ME")
190
201
  files = [
191
202
  "/path/to/manifest/package.json"
192
203
  ]
193
- params = {
194
- "org_slug": "org_name",
195
- "repo": "TestRepo",
196
- "branch": "main",
197
- "commit_message": "Test Commit Message",
198
- "commit_hash": "",
199
- "pull_request": "",
200
- "committers": "commiter",
201
- "make_default_branch": False,
202
- "set_as_pending_head": False,
203
- "tmp": ""
204
- }
204
+ params = FullScanParams(
205
+ org_slug="org_name",
206
+ repo="TestRepo",
207
+ branch="main",
208
+ commit_message="Test Commit Message",
209
+ commit_hash="abc123def456",
210
+ pull_request=123,
211
+ committers=["committer1", "committer2"],
212
+ make_default_branch=False,
213
+ set_as_pending_head=False
214
+ )
205
215
 
206
216
  print(socket.fullscans.post(files, params))
207
217
 
208
218
  **PARAMETERS:**
209
219
 
210
220
  - **files (list)** - List of file paths of manifest files
211
- - **params (dict)** - List of parameters to create a fullscan
221
+ - **params (FullScanParams)** - FullScanParams object containing scan configuration
212
222
 
213
223
  +------------------------+------------+-------------------------------------------------------------------------------+
214
224
  | Parameter | Required | Description |
@@ -219,20 +229,23 @@ Create a full scan from a set of package manifest files. Returns a full scan inc
219
229
  +------------------------+------------+-------------------------------------------------------------------------------+
220
230
  | branch | False | The string name in a git approved name for branches. |
221
231
  +------------------------+------------+-------------------------------------------------------------------------------+
222
- | committers | False | The string name of the person doing the commit or running the CLI. |
223
- | | | Can be specified multiple times to have more than one committer. |
232
+ | committers | False | List of committer names (List[str]). |
224
233
  +------------------------+------------+-------------------------------------------------------------------------------+
225
234
  | pull_request | False | The integer for the PR or MR number. |
226
235
  +------------------------+------------+-------------------------------------------------------------------------------+
227
236
  | commit_message | False | The string for a commit message if there is one. |
228
237
  +------------------------+------------+-------------------------------------------------------------------------------+
229
- | make_default_branch | False | If the flag is specified this will signal that this is the default branch. |
238
+ | make_default_branch | False | Boolean to signal that this is the default branch. |
230
239
  +------------------------+------------+-------------------------------------------------------------------------------+
231
240
  | commit_hash | False | Optional git commit hash |
232
241
  +------------------------+------------+-------------------------------------------------------------------------------+
233
- | set_as_pending_head | False | |
242
+ | set_as_pending_head | False | Boolean to set as pending head |
234
243
  +------------------------+------------+-------------------------------------------------------------------------------+
235
- | tmp | False | |
244
+ | tmp | False | Boolean temporary flag |
245
+ +------------------------+------------+-------------------------------------------------------------------------------+
246
+ | integration_type | False | IntegrationType enum value (e.g., "api", "github") |
247
+ +------------------------+------------+-------------------------------------------------------------------------------+
248
+ | integration_org_slug | False | Organization slug for integration |
236
249
  +------------------------+------------+-------------------------------------------------------------------------------+
237
250
 
238
251
  fullscans.delete(org_slug, full_scan_id)
@@ -245,15 +258,15 @@ Delete an existing full scan.
245
258
 
246
259
  from socketdev import socketdev
247
260
  socket = socketdev(token="REPLACE_ME")
248
- print(socket.fullscans.delete(org_slug, full_scan_id))
261
+ print(socket.fullscans.delete("org_slug", "full_scan_id"))
249
262
 
250
263
  **PARAMETERS:**
251
264
 
252
265
  - **org_slug (str)** - The organization name
253
266
  - **full_scan_id (str)** - The ID of the full scan
254
267
 
255
- fullscans.stream_diff(org_slug, before, after, preview, include_license_details)
256
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
268
+ fullscans.stream_diff(org_slug, before, after, use_types=True, include_license_details="true", \*\*kwargs)
269
+ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
257
270
  Stream a diff between two full scans. Returns a scan diff.
258
271
 
259
272
  **Usage:**
@@ -263,16 +276,27 @@ Stream a diff between two full scans. Returns a scan diff.
263
276
  from socketdev import socketdev
264
277
  socket = socketdev(token="REPLACE_ME")
265
278
  print(socket.fullscans.stream_diff("org_slug", "before_scan_id", "after_scan_id"))
279
+
280
+ # With additional parameters
281
+ print(socket.fullscans.stream_diff(
282
+ "org_slug",
283
+ "before_scan_id",
284
+ "after_scan_id",
285
+ use_types=False,
286
+ include_license_details="false"
287
+ ))
266
288
 
267
289
  **PARAMETERS:**
268
290
 
269
291
  - **org_slug (str)** - The organization name
270
292
  - **before (str)** - The base full scan ID
271
293
  - **after (str)** - The comparison full scan ID
272
- - **include_license_details (bool)** - Include license details. Can greatly increase response size. Defaults to False.
294
+ - **use_types (bool)** - Whether to return typed response objects (default: True)
295
+ - **include_license_details (str)** - Include license details ("true"/"false"). Can greatly increase response size. Defaults to "true".
296
+ - **kwargs** - Additional query parameters
273
297
 
274
- fullscans.stream(org_slug, full_scan_id)
275
- """"""""""""""""""""""""""""""""""""""""
298
+ fullscans.stream(org_slug, full_scan_id, use_types=False)
299
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""
276
300
  Stream all SBOM artifacts for a full scan.
277
301
 
278
302
  **Usage:**
@@ -281,15 +305,19 @@ Stream all SBOM artifacts for a full scan.
281
305
 
282
306
  from socketdev import socketdev
283
307
  socket = socketdev(token="REPLACE_ME")
284
- print(socket.fullscans.stream(org_slug, full_scan_id))
308
+ print(socket.fullscans.stream("org_slug", "full_scan_id"))
309
+
310
+ # With typed response
311
+ print(socket.fullscans.stream("org_slug", "full_scan_id", use_types=True))
285
312
 
286
313
  **PARAMETERS:**
287
314
 
288
315
  - **org_slug (str)** - The organization name
289
316
  - **full_scan_id (str)** - The ID of the full scan
317
+ - **use_types (bool)** - Whether to return typed response objects (default: False)
290
318
 
291
- fullscans.metadata(org_slug, full_scan_id)
292
- """"""""""""""""""""""""""""""""""""""""""
319
+ fullscans.metadata(org_slug, full_scan_id, use_types=False)
320
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
293
321
  Get metadata for a single full scan
294
322
 
295
323
  **Usage:**
@@ -298,12 +326,34 @@ Get metadata for a single full scan
298
326
 
299
327
  from socketdev import socketdev
300
328
  socket = socketdev(token="REPLACE_ME")
301
- print(socket.fullscans.metadata(org_slug, full_scan_id))
329
+ print(socket.fullscans.metadata("org_slug", "full_scan_id"))
330
+
331
+ # With typed response
332
+ print(socket.fullscans.metadata("org_slug", "full_scan_id", use_types=True))
302
333
 
303
334
  **PARAMETERS:**
304
335
 
305
336
  - **org_slug (str)** - The organization name
306
337
  - **full_scan_id (str)** - The ID of the full scan
338
+ - **use_types (bool)** - Whether to return typed response objects (default: False)
339
+
340
+ fullscans.gfm(org_slug, before, after)
341
+ """"""""""""""""""""""""""""""""""""""
342
+ Get GitHub Flavored Markdown diff between two full scans.
343
+
344
+ **Usage:**
345
+
346
+ .. code-block:: python
347
+
348
+ from socketdev import socketdev
349
+ socket = socketdev(token="REPLACE_ME")
350
+ print(socket.fullscans.gfm("org_slug", "before_scan_id", "after_scan_id"))
351
+
352
+ **PARAMETERS:**
353
+
354
+ - **org_slug (str)** - The organization name
355
+ - **before (str)** - The base full scan ID
356
+ - **after (str)** - The comparison full scan ID
307
357
 
308
358
  dependencies.get(limit, offset)
309
359
  """""""""""""""""""""""""""""""
@@ -828,3 +878,292 @@ List all historical snapshots for an organization.
828
878
 
829
879
  - **org_slug (str)** – The organization name
830
880
  - **query_params (dict, optional)** – Optional query parameters
881
+
882
+ diffscans.list(org_slug, params=None)
883
+ """""""""""""""""""""""""""""""""""""
884
+ List all diff scans for an organization.
885
+
886
+ **Usage:**
887
+
888
+ .. code-block:: python
889
+
890
+ from socketdev import socketdev
891
+ socket = socketdev(token="REPLACE_ME")
892
+ print(socket.diffscans.list("org_slug", {"limit": 10, "offset": 0}))
893
+
894
+ **PARAMETERS:**
895
+
896
+ - **org_slug (str)** – The organization name
897
+ - **params (dict, optional)** – Optional query parameters for filtering
898
+
899
+ diffscans.get(org_slug, diff_scan_id)
900
+ """""""""""""""""""""""""""""""""""""
901
+ Fetch a specific diff scan by ID.
902
+
903
+ **Usage:**
904
+
905
+ .. code-block:: python
906
+
907
+ from socketdev import socketdev
908
+ socket = socketdev(token="REPLACE_ME")
909
+ print(socket.diffscans.get("org_slug", "diff_scan_id"))
910
+
911
+ **PARAMETERS:**
912
+
913
+ - **org_slug (str)** – The organization name
914
+ - **diff_scan_id (str)** – The ID of the diff scan to retrieve
915
+
916
+ diffscans.create_from_ids(org_slug, params)
917
+ """""""""""""""""""""""""""""""""""""""""""
918
+ Create a diff scan from two full scan IDs.
919
+
920
+ **Usage:**
921
+
922
+ .. code-block:: python
923
+
924
+ from socketdev import socketdev
925
+ socket = socketdev(token="REPLACE_ME")
926
+ params = {
927
+ "before": "full_scan_id_1",
928
+ "after": "full_scan_id_2",
929
+ "description": "Compare two scans"
930
+ }
931
+ print(socket.diffscans.create_from_ids("org_slug", params))
932
+
933
+ **PARAMETERS:**
934
+
935
+ - **org_slug (str)** – The organization name
936
+ - **params (dict)** – Parameters including before and after scan IDs
937
+
938
+ diffscans.create_from_repo(org_slug, repo_slug, files, params=None)
939
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
940
+ Create a diff scan from repository files.
941
+
942
+ **Usage:**
943
+
944
+ .. code-block:: python
945
+
946
+ from socketdev import socketdev
947
+ socket = socketdev(token="REPLACE_ME")
948
+ files = ["/path/to/package.json"]
949
+ params = {"branch": "main", "commit": "abc123"}
950
+ print(socket.diffscans.create_from_repo("org_slug", "repo_slug", files, params))
951
+
952
+ **PARAMETERS:**
953
+
954
+ - **org_slug (str)** – The organization name
955
+ - **repo_slug (str)** – The repository name
956
+ - **files (list)** – List of file paths to scan
957
+ - **params (dict, optional)** – Optional parameters for the scan
958
+
959
+ diffscans.gfm(org_slug, diff_scan_id)
960
+ """""""""""""""""""""""""""""""""""""
961
+ Get GitHub Flavored Markdown comments for a diff scan.
962
+
963
+ **Usage:**
964
+
965
+ .. code-block:: python
966
+
967
+ from socketdev import socketdev
968
+ socket = socketdev(token="REPLACE_ME")
969
+ print(socket.diffscans.gfm("org_slug", "diff_scan_id"))
970
+
971
+ **PARAMETERS:**
972
+
973
+ - **org_slug (str)** – The organization name
974
+ - **diff_scan_id (str)** – The ID of the diff scan
975
+
976
+ diffscans.delete(org_slug, diff_scan_id)
977
+ """"""""""""""""""""""""""""""""""""""""
978
+ Delete a specific diff scan.
979
+
980
+ **Usage:**
981
+
982
+ .. code-block:: python
983
+
984
+ from socketdev import socketdev
985
+ socket = socketdev(token="REPLACE_ME")
986
+ print(socket.diffscans.delete("org_slug", "diff_scan_id"))
987
+
988
+ **PARAMETERS:**
989
+
990
+ - **org_slug (str)** – The organization name
991
+ - **diff_scan_id (str)** – The ID of the diff scan to delete
992
+
993
+ threatfeed.get(org_slug=None, \*\*kwargs)
994
+ """""""""""""""""""""""""""""""""""""""""""
995
+ Get threat feed items for an organization or globally.
996
+
997
+ **Usage:**
998
+
999
+ .. code-block:: python
1000
+
1001
+ from socketdev import socketdev
1002
+ socket = socketdev(token="REPLACE_ME")
1003
+
1004
+ # Get org-specific threat feed
1005
+ print(socket.threatfeed.get("org_slug", per_page=50, sort="created_at"))
1006
+
1007
+ # Get global threat feed (deprecated)
1008
+ print(socket.threatfeed.get())
1009
+
1010
+ **PARAMETERS:**
1011
+
1012
+ - **org_slug (str, optional)** – The organization name (recommended for new implementations)
1013
+ - **kwargs** – Query parameters like per_page, page_cursor, sort, etc.
1014
+
1015
+ apitokens.create(org_slug, \*\*kwargs)
1016
+ """"""""""""""""""""""""""""""""""""""
1017
+ Create a new API token for an organization.
1018
+
1019
+ **Usage:**
1020
+
1021
+ .. code-block:: python
1022
+
1023
+ from socketdev import socketdev
1024
+ socket = socketdev(token="REPLACE_ME")
1025
+ token_config = {
1026
+ "name": "My API Token",
1027
+ "permissions": ["read", "write"],
1028
+ "expires_at": "2024-12-31T23:59:59Z"
1029
+ }
1030
+ print(socket.apitokens.create("org_slug", **token_config))
1031
+
1032
+ **PARAMETERS:**
1033
+
1034
+ - **org_slug (str)** – The organization name
1035
+ - **kwargs** – Token configuration parameters
1036
+
1037
+ apitokens.update(org_slug, \*\*kwargs)
1038
+ """"""""""""""""""""""""""""""""""""""
1039
+ Update an existing API token.
1040
+
1041
+ **Usage:**
1042
+
1043
+ .. code-block:: python
1044
+
1045
+ from socketdev import socketdev
1046
+ socket = socketdev(token="REPLACE_ME")
1047
+ update_params = {
1048
+ "token_id": "token_123",
1049
+ "name": "Updated Token Name",
1050
+ "permissions": ["read"]
1051
+ }
1052
+ print(socket.apitokens.update("org_slug", **update_params))
1053
+
1054
+ **PARAMETERS:**
1055
+
1056
+ - **org_slug (str)** – The organization name
1057
+ - **kwargs** – Token update parameters
1058
+
1059
+ auditlog.get(org_slug, \*\*kwargs)
1060
+ """"""""""""""""""""""""""""""""""""
1061
+ Get audit log entries for an organization.
1062
+
1063
+ **Usage:**
1064
+
1065
+ .. code-block:: python
1066
+
1067
+ from socketdev import socketdev
1068
+ socket = socketdev(token="REPLACE_ME")
1069
+ print(socket.auditlog.get("org_slug", limit=100, cursor="abc123"))
1070
+
1071
+ **PARAMETERS:**
1072
+
1073
+ - **org_slug (str)** – The organization name
1074
+ - **kwargs** – Query parameters like limit, cursor, etc.
1075
+
1076
+ analytics.get_org(filter, \*\*kwargs)
1077
+ """""""""""""""""""""""""""""""""""""""
1078
+ Get organization analytics (deprecated - use Historical module instead).
1079
+
1080
+ **Usage:**
1081
+
1082
+ .. code-block:: python
1083
+
1084
+ from socketdev import socketdev
1085
+ socket = socketdev(token="REPLACE_ME")
1086
+ # DEPRECATED: Use socket.historical.list() or socket.historical.trend() instead
1087
+ print(socket.analytics.get_org("alerts", start_date="2024-01-01"))
1088
+
1089
+ **PARAMETERS:**
1090
+
1091
+ - **filter (str)** – Analytics filter type
1092
+ - **kwargs** – Additional query parameters
1093
+
1094
+ analytics.get_repo(name, filter, \*\*kwargs)
1095
+ """"""""""""""""""""""""""""""""""""""""""""""
1096
+ Get repository analytics (deprecated - use Historical module instead).
1097
+
1098
+ **Usage:**
1099
+
1100
+ .. code-block:: python
1101
+
1102
+ from socketdev import socketdev
1103
+ socket = socketdev(token="REPLACE_ME")
1104
+ # DEPRECATED: Use socket.historical.list() or socket.historical.trend() instead
1105
+ print(socket.analytics.get_repo("repo_name", "alerts", start_date="2024-01-01"))
1106
+
1107
+ **PARAMETERS:**
1108
+
1109
+ - **name (str)** – Repository name
1110
+ - **filter (str)** – Analytics filter type
1111
+ - **kwargs** – Additional query parameters
1112
+
1113
+ alerttypes.get(alert_types=None, language="en-US", \*\*kwargs)
1114
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1115
+ Get alert types metadata.
1116
+
1117
+ **Usage:**
1118
+
1119
+ .. code-block:: python
1120
+
1121
+ from socketdev import socketdev
1122
+ socket = socketdev(token="REPLACE_ME")
1123
+
1124
+ # Get metadata for specific alert types
1125
+ alert_list = ["supply_chain_risk", "license_risk"]
1126
+ print(socket.alerttypes.get(alert_list, language="en-US"))
1127
+
1128
+ # Get all alert types metadata
1129
+ print(socket.alerttypes.get())
1130
+
1131
+ **PARAMETERS:**
1132
+
1133
+ - **alert_types (list, optional)** – List of alert type strings to get metadata for
1134
+ - **language (str)** – Language for alert metadata (default: en-US)
1135
+ - **kwargs** – Additional query parameters
1136
+
1137
+ triage.list_alert_triage(org_slug, query_params=None)
1138
+ """""""""""""""""""""""""""""""""""""""""""""""""""""
1139
+ Get list of triaged alerts for an organization.
1140
+
1141
+ **Usage:**
1142
+
1143
+ .. code-block:: python
1144
+
1145
+ from socketdev import socketdev
1146
+ socket = socketdev(token="REPLACE_ME")
1147
+ query_params = {"status": "triaged", "limit": 50}
1148
+ print(socket.triage.list_alert_triage("org_slug", query_params))
1149
+
1150
+ **PARAMETERS:**
1151
+
1152
+ - **org_slug (str)** – The organization name
1153
+ - **query_params (dict, optional)** – Optional query parameters for filtering
1154
+
1155
+ openapi.get()
1156
+ """""""""""""
1157
+ Retrieve the OpenAPI specification for the Socket API.
1158
+
1159
+ **Usage:**
1160
+
1161
+ .. code-block:: python
1162
+
1163
+ from socketdev import socketdev
1164
+ socket = socketdev(token="REPLACE_ME")
1165
+ print(socket.openapi.get())
1166
+
1167
+ **PARAMETERS:**
1168
+
1169
+ None required.