xsoar-cli 0.0.3__py3-none-any.whl → 1.0.1__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.

Potentially problematic release.


This version of xsoar-cli might be problematic. Click here for more details.

xsoar_cli/__about__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2025-present Torbjørn Lium <torben@lium.org>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.0.3"
4
+ __version__ = "1.0.1"
@@ -63,17 +63,20 @@ def clone(ctx: click.Context, casenumber: int, source: str, dest: str) -> None:
63
63
 
64
64
 
65
65
  @click.option("--environment", default="dev", show_default=True, help="Environment as defined in config file")
66
+ @click.option("--casetype", default="", show_default=True, help="Create case of specified type. Default type set in config file.")
66
67
  @click.argument("details", type=str, default="Placeholder case details")
67
68
  @click.argument("name", type=str, default="Test case created from xsoar-cli")
68
- @click.command(help="Creates a single new case in XSOAR")
69
69
  @click.pass_context
70
70
  @load_config
71
- def create(ctx: click.Context, environment: str, name: str, details: str) -> None:
71
+ def create(ctx: click.Context, environment: str, casetype: str, name: str, details: str) -> None:
72
+ """Creates a new case in XSOAR. If invalid case type is specified as a command option, XSOAR will default to using Unclassified."""
72
73
  xsoar_client: Client = ctx.obj["server_envs"][environment]
74
+ if not casetype:
75
+ casetype = ctx.obj["default_new_case_type"]
73
76
  data = {
74
77
  "createInvestigation": True,
75
78
  "name": name,
76
- "type": "MyCaseType", # grab this from config maybe?
79
+ "type": casetype,
77
80
  "details": details,
78
81
  }
79
82
  case_data = xsoar_client.create_case(data=data)
xsoar_cli/utilities.py CHANGED
@@ -80,6 +80,7 @@ def parse_config(config: dict, ctx: click.Context) -> None:
80
80
  ctx.obj = {}
81
81
  ctx.obj["default_environment"] = config["default_environment"]
82
82
  ctx.obj["custom_pack_authors"] = config["custom_pack_authors"]
83
+ ctx.obj["default_new_case_type"] = config["default_new_case_type"]
83
84
  ctx.obj["server_envs"] = {}
84
85
  for key in config["server_config"]:
85
86
  ctx.obj["server_envs"][key] = Client(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xsoar-cli
3
- Version: 0.0.3
3
+ Version: 1.0.1
4
4
  Project-URL: Documentation, https://github.com/tlium/xsoar-cli#readme
5
5
  Project-URL: Issues, https://github.com/tliumb/xsoar-cli/issues
6
6
  Project-URL: Source, https://github.com/tlium/xsoar-cli
@@ -1,10 +1,10 @@
1
- xsoar_cli/__about__.py,sha256=PoiGgrfyfU1ozayN6GC8FLvwV9BYI1Jnh0eokMjDDyI,127
1
+ xsoar_cli/__about__.py,sha256=EnyObXjOsSHh9N_hsdx1-9VMqI_ILG0B440UDYf17yo,127
2
2
  xsoar_cli/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
3
  xsoar_cli/cli.py,sha256=iAlSeZe2iR6ciTVrJYLt-CDZk7b5I-hzHFXbYoXhupA,1342
4
- xsoar_cli/utilities.py,sha256=_gfgwBV5p1_QwNl6qw1fluO6kP7jGW_oItAEJnaR3rA,3860
4
+ xsoar_cli/utilities.py,sha256=nmvb7aclp1Uil6gVtSBTy6wa-GfRLAWOsV_0a8Nc3Vk,3931
5
5
  xsoar_cli/case/README.md,sha256=MTfgVeW3qJXRPNFo8CkZvulm2vwbN8sgiW86V-qXRFw,1342
6
6
  xsoar_cli/case/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- xsoar_cli/case/commands.py,sha256=q1rHb8UQ0NvN6kLh6NRWla5s6qG35PV0xhIOIR325Eg,3233
7
+ xsoar_cli/case/commands.py,sha256=sohR1HOZ2vIYzkkdVURQhwPztjkTf744Gopy7wmn1OQ,3494
8
8
  xsoar_cli/config/README.md,sha256=pcO858PDL9c0qtwj3_a6B8q2CGvcka3dwclVnwi2vlA,516
9
9
  xsoar_cli/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  xsoar_cli/config/commands.py,sha256=SJqIBUBq4tHmnXusycXuIOkmHhyc-vKvQwFMjIHh3Cc,3884
@@ -24,8 +24,8 @@ xsoar_cli/plugins/README.md,sha256=qQ_shzxcJcJKHuWfuN_cTVhtaew4BEGBEjn9wxaZG5c,1
24
24
  xsoar_cli/plugins/__init__.py,sha256=81IZsMbZsqrLdB6TjA9t6s3yS8FkuihliBFX4xZUpTo,1753
25
25
  xsoar_cli/plugins/commands.py,sha256=HC0sWu149uQG9Ztag4t2CNPKXTM4WJbEdLSvFMEjw80,10660
26
26
  xsoar_cli/plugins/manager.py,sha256=7RPk3lAYDifGMLOU-hFOqyPxTVk8ibBVzBqH7R8wy4g,13012
27
- xsoar_cli-0.0.3.dist-info/METADATA,sha256=OC2qqM6pvUZgS0cx_5sbqvFA2IxIh0e3tVky0_5SLXA,4375
28
- xsoar_cli-0.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
- xsoar_cli-0.0.3.dist-info/entry_points.txt,sha256=s6Klu4QRekXsmZaBxMyFlE4Q-4_jIA9uijk4qIYUPvE,48
30
- xsoar_cli-0.0.3.dist-info/licenses/LICENSE.txt,sha256=l6xnqWKshqwwTXt6ayO6MX8Uvygq0YnkUuFTNnR3ba4,1097
31
- xsoar_cli-0.0.3.dist-info/RECORD,,
27
+ xsoar_cli-1.0.1.dist-info/METADATA,sha256=OwrY_VirJQw71-3DSsBh8FXbmfUdyXPK5DkJEJ_cpmo,4375
28
+ xsoar_cli-1.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
29
+ xsoar_cli-1.0.1.dist-info/entry_points.txt,sha256=s6Klu4QRekXsmZaBxMyFlE4Q-4_jIA9uijk4qIYUPvE,48
30
+ xsoar_cli-1.0.1.dist-info/licenses/LICENSE.txt,sha256=l6xnqWKshqwwTXt6ayO6MX8Uvygq0YnkUuFTNnR3ba4,1097
31
+ xsoar_cli-1.0.1.dist-info/RECORD,,