@waron97/prbot 2.6.1 → 3.0.0
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.
- package/README.md +24 -21
- package/agrippa_typings/__builtins__.pyi +99 -0
- package/agrippa_typings/b2w_entities.pyi +68 -0
- package/agrippa_typings/odoo_environment.pyi +1945 -0
- package/agrippa_typings/odoo_records.pyi +34176 -0
- package/agrippa_typings/recordset.pyi +38 -0
- package/package.json +10 -3
- package/src/agrippa/commands/clone.js +134 -0
- package/src/agrippa/commands/diff.js +96 -0
- package/src/agrippa/commands/init.js +116 -0
- package/src/agrippa/commands/initPhase.js +162 -0
- package/src/agrippa/commands/pull.js +221 -0
- package/src/agrippa/commands/push.js +126 -0
- package/src/agrippa/commands/repair.js +24 -0
- package/src/agrippa/index.js +61 -0
- package/src/agrippa/lib/api.js +106 -0
- package/src/agrippa/lib/checksum.js +7 -0
- package/src/agrippa/lib/config.js +35 -0
- package/src/agrippa/lib/workspace.js +42 -0
- package/src/commands/autopr.js +5 -0
- package/src/commands/export.js +2 -1
- package/src/commands/exportWorkflow.js +49 -0
- package/src/commands/init.js +3 -17
- package/src/commands/pr.js +8 -2
- package/src/config.js +1 -2
- package/src/index.js +11 -66
- package/.claude/settings.local.json +0 -11
- package/.prettierrc.mjs +0 -11
- package/CLAUDE.md +0 -0
- package/eslint.config.mjs +0 -16
- package/example.xml +0 -3903
- package/index.js +0 -376
package/README.md
CHANGED
|
@@ -14,13 +14,7 @@ npm install -g .
|
|
|
14
14
|
prbot init
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Prompts for all required config values
|
|
18
|
-
|
|
19
|
-
After first run:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
source ~/.bashrc
|
|
23
|
-
```
|
|
17
|
+
Prompts for all required config values and writes them to `~/.config/prbot/config`. Run once, re-run anytime to update config.
|
|
24
18
|
|
|
25
19
|
### Config keys
|
|
26
20
|
|
|
@@ -124,19 +118,20 @@ Interactive commit builder. Prompts for operation type (`[IMP]`, `[FIX]`, etc.),
|
|
|
124
118
|
prbot commit
|
|
125
119
|
```
|
|
126
120
|
|
|
127
|
-
### `prbot export workflow
|
|
121
|
+
### `prbot export workflow`
|
|
128
122
|
|
|
129
|
-
|
|
123
|
+
Fetches workflow XML for an interactively selected module from RIP and commits. Prompts to select the module (from `ADDONS_PATH/config/` directories) via fuzzy search.
|
|
130
124
|
|
|
131
125
|
```bash
|
|
132
|
-
prbot export workflow
|
|
126
|
+
prbot export workflow
|
|
127
|
+
prbot export workflow --no-commit
|
|
133
128
|
```
|
|
134
129
|
|
|
135
130
|
Options:
|
|
136
131
|
|
|
137
|
-
| Flag
|
|
138
|
-
|
|
|
139
|
-
|
|
|
132
|
+
| Flag | Description |
|
|
133
|
+
| ------------- | ------------------------ |
|
|
134
|
+
| `--no-commit` | Skip the git commit step |
|
|
140
135
|
|
|
141
136
|
### `prbot export pb`
|
|
142
137
|
|
|
@@ -168,9 +163,24 @@ Options:
|
|
|
168
163
|
| ------------- | ------------------------ |
|
|
169
164
|
| `--no-commit` | Skip the git commit step |
|
|
170
165
|
|
|
166
|
+
### `prbot export email-templates`
|
|
167
|
+
|
|
168
|
+
Fetches email templates for an interactively selected workflow from RIP and writes them as `ADDONS_PATH/config/<module>/data/mail_templates.xml`. Prompts first for the module (from `ADDONS_PATH/config/` directories), then for the workflow. Both prompts support fuzzy search.
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
prbot export email-templates
|
|
172
|
+
prbot export email-templates --no-commit
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Options:
|
|
176
|
+
|
|
177
|
+
| Flag | Description |
|
|
178
|
+
| ------------- | ------------------------ |
|
|
179
|
+
| `--no-commit` | Skip the git commit step |
|
|
180
|
+
|
|
171
181
|
### `prbot init`
|
|
172
182
|
|
|
173
|
-
Interactive setup: writes `~/.config/prbot/config
|
|
183
|
+
Interactive setup: writes `~/.config/prbot/config`.
|
|
174
184
|
|
|
175
185
|
### `prbot update`
|
|
176
186
|
|
|
@@ -180,10 +190,3 @@ Reinstalls the latest published version from npm.
|
|
|
180
190
|
prbot update
|
|
181
191
|
```
|
|
182
192
|
|
|
183
|
-
## Tab completion
|
|
184
|
-
|
|
185
|
-
After `prbot init` and sourcing `~/.bashrc`, `<module>` arguments autocomplete from directories in `ADDONS_PATH/config/`.
|
|
186
|
-
|
|
187
|
-
```
|
|
188
|
-
prbot pr config_wf_<TAB> # lists all workflow modules
|
|
189
|
-
```
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
from typing import (
|
|
2
|
+
Any,
|
|
3
|
+
Dict,
|
|
4
|
+
List,
|
|
5
|
+
Literal,
|
|
6
|
+
Optional,
|
|
7
|
+
Tuple,
|
|
8
|
+
Type,
|
|
9
|
+
TypeVar,
|
|
10
|
+
Union,
|
|
11
|
+
)
|
|
12
|
+
import logging
|
|
13
|
+
import datetime as _dt
|
|
14
|
+
|
|
15
|
+
from recordset import Recordset
|
|
16
|
+
from odoo_environment import OdooEnvironment
|
|
17
|
+
from odoo_records import _HelpdeskTicket
|
|
18
|
+
from b2w_entities import Asset, Contract, Order, OrderItem, Task
|
|
19
|
+
|
|
20
|
+
class Cursor:
|
|
21
|
+
def execute(self, query: str, params: Any = None) -> None: ...
|
|
22
|
+
def fetchone(self) -> Optional[Tuple[Any, ...]]: ...
|
|
23
|
+
def fetchall(self) -> List[Tuple[Any, ...]]: ...
|
|
24
|
+
def rollback(self) -> None: ...
|
|
25
|
+
def commit(self) -> None: ...
|
|
26
|
+
|
|
27
|
+
class Response:
|
|
28
|
+
status_code: int
|
|
29
|
+
text: str
|
|
30
|
+
content: bytes
|
|
31
|
+
headers: Dict[str, str]
|
|
32
|
+
ok: bool
|
|
33
|
+
def json(self) -> Any: ...
|
|
34
|
+
def raise_for_status(self) -> None: ...
|
|
35
|
+
|
|
36
|
+
# --- Globals ---
|
|
37
|
+
|
|
38
|
+
case_id: _HelpdeskTicket
|
|
39
|
+
env: OdooEnvironment
|
|
40
|
+
body: Dict[str, Any]
|
|
41
|
+
args: List[Any]
|
|
42
|
+
model: Recordset
|
|
43
|
+
logger: logging.Logger
|
|
44
|
+
|
|
45
|
+
# --- Functions ---
|
|
46
|
+
|
|
47
|
+
def log(
|
|
48
|
+
message: Any, level: Literal["debug", "info", "warning", "error"] = ...
|
|
49
|
+
) -> None: ...
|
|
50
|
+
def json_dumps(
|
|
51
|
+
obj: Any,
|
|
52
|
+
*,
|
|
53
|
+
indent: Optional[int] = None,
|
|
54
|
+
sort_keys: bool = False,
|
|
55
|
+
default: Any = None,
|
|
56
|
+
ensure_ascii: bool = True,
|
|
57
|
+
) -> str: ...
|
|
58
|
+
def json_loads(s: str) -> Any: ...
|
|
59
|
+
def make_response(
|
|
60
|
+
status: Tuple[int, int],
|
|
61
|
+
message: Union[str, Dict[str, Any]],
|
|
62
|
+
) -> Any: ...
|
|
63
|
+
def request(
|
|
64
|
+
method: str,
|
|
65
|
+
url: str,
|
|
66
|
+
*,
|
|
67
|
+
headers: Optional[Dict[str, str]] = None,
|
|
68
|
+
data: Optional[Union[str, bytes]] = None,
|
|
69
|
+
json: Optional[Any] = None,
|
|
70
|
+
params: Optional[Dict[str, Any]] = None,
|
|
71
|
+
timeout: Optional[float] = None,
|
|
72
|
+
) -> Response: ...
|
|
73
|
+
|
|
74
|
+
FirstArg = TypeVar("FirstArg")
|
|
75
|
+
|
|
76
|
+
def first(recordset: FirstArg) -> FirstArg: ...
|
|
77
|
+
def format_exc() -> str: ...
|
|
78
|
+
|
|
79
|
+
# --- Exceptions ---
|
|
80
|
+
|
|
81
|
+
class ValidationError(Exception): ...
|
|
82
|
+
|
|
83
|
+
# --- Datetime types (injected as the datetime module, not bare classes) ---
|
|
84
|
+
|
|
85
|
+
class _DatetimeModule:
|
|
86
|
+
datetime: Type[_dt.datetime]
|
|
87
|
+
date: Type[_dt.date]
|
|
88
|
+
time: Type[_dt.time]
|
|
89
|
+
timezone: Type[_dt.timezone]
|
|
90
|
+
timedelta: Type[_dt.timedelta]
|
|
91
|
+
MINYEAR: int
|
|
92
|
+
MAXYEAR: int
|
|
93
|
+
|
|
94
|
+
datetime: _DatetimeModule
|
|
95
|
+
date: Type[_dt.date]
|
|
96
|
+
time: Type[_dt.time]
|
|
97
|
+
timezone: Type[_dt.timezone]
|
|
98
|
+
pytz: Any
|
|
99
|
+
dateutil: Any
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from typing import Any, Dict, List, Optional
|
|
2
|
+
from odoo_environment import OdooEnvironment
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Bit2winEntity:
|
|
6
|
+
env: OdooEnvironment
|
|
7
|
+
_id: str
|
|
8
|
+
data: Dict[str, Any]
|
|
9
|
+
|
|
10
|
+
def __init__(self, env: OdooEnvironment, _id: str, data: Optional[Dict[str, Any]] = None) -> None: ...
|
|
11
|
+
def patch(self, new_data: Any, method: str = "PATCH") -> Any: ...
|
|
12
|
+
def download(self) -> Dict[str, Any]: ...
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Asset(Bit2winEntity):
|
|
16
|
+
def children(self) -> "List[Asset]": ...
|
|
17
|
+
def order(self) -> "Order": ...
|
|
18
|
+
def order_item(self) -> "OrderItem": ...
|
|
19
|
+
def contract(self) -> "Contract": ...
|
|
20
|
+
def offer_codes(self) -> List[Dict[str, Any]]: ...
|
|
21
|
+
def offer_code(self, at: Any = None) -> Optional[str]: ...
|
|
22
|
+
def update_b2w_statemodel(
|
|
23
|
+
self,
|
|
24
|
+
destination_state: str,
|
|
25
|
+
sm_reason: str = "",
|
|
26
|
+
expected_date: Any = False,
|
|
27
|
+
) -> Any: ...
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class Order(Bit2winEntity):
|
|
31
|
+
def order_items(self) -> "List[OrderItem]": ...
|
|
32
|
+
def update_b2w_statemodel(
|
|
33
|
+
self,
|
|
34
|
+
destination_state: str,
|
|
35
|
+
sm_reason: str = "",
|
|
36
|
+
expected_date: Any = False,
|
|
37
|
+
) -> Any: ...
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class OrderItem(Bit2winEntity):
|
|
41
|
+
order_id: Optional[str]
|
|
42
|
+
|
|
43
|
+
def __init__(
|
|
44
|
+
self,
|
|
45
|
+
env: OdooEnvironment,
|
|
46
|
+
_id: str,
|
|
47
|
+
order_id: Optional[str] = None,
|
|
48
|
+
data: Optional[Dict[str, Any]] = None,
|
|
49
|
+
) -> None: ...
|
|
50
|
+
def task_mdp(self) -> "Optional[Task]": ...
|
|
51
|
+
def update_b2w_statemodel(
|
|
52
|
+
self,
|
|
53
|
+
destination_state: str,
|
|
54
|
+
sm_reason: str = "",
|
|
55
|
+
expected_date: Any = False,
|
|
56
|
+
) -> Any: ...
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class Contract(Bit2winEntity):
|
|
60
|
+
def update_b2w_statemodel(
|
|
61
|
+
self,
|
|
62
|
+
destination_state: str,
|
|
63
|
+
sm_reason: str = "",
|
|
64
|
+
expected_date: Any = False,
|
|
65
|
+
) -> Any: ...
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class Task(Bit2winEntity): ...
|