nacwrap 0.2.2__tar.gz → 0.2.3__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.
- {nacwrap-0.2.2/nacwrap.egg-info → nacwrap-0.2.3}/PKG-INFO +14 -3
- {nacwrap-0.2.2 → nacwrap-0.2.3}/README.md +4 -2
- nacwrap-0.2.3/nacwrap/connections.py +31 -0
- nacwrap-0.2.3/nacwrap/datasources.py +61 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap/nacwrap.py +4 -2
- {nacwrap-0.2.2 → nacwrap-0.2.3/nacwrap.egg-info}/PKG-INFO +14 -3
- {nacwrap-0.2.2 → nacwrap-0.2.3}/setup.py +1 -1
- {nacwrap-0.2.2 → nacwrap-0.2.3}/tests/test.py +4 -4
- nacwrap-0.2.2/nacwrap/connections.py +0 -0
- nacwrap-0.2.2/nacwrap/datasources.py +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/LICENSE +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/MANIFEST.in +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap/__init__.py +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap/_auth.py +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap/_helpers.py +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap/data_model.py +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap/exceptions.py +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap/instances.py +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap/tasks.py +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap/users.py +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap/workflows.py +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap.egg-info/SOURCES.txt +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap.egg-info/dependency_links.txt +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap.egg-info/requires.txt +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/nacwrap.egg-info/top_level.txt +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/requirements.txt +0 -0
- {nacwrap-0.2.2 → nacwrap-0.2.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: nacwrap
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Python package that acts as a wrapper for the Nintex Automation Cloud system.
|
|
5
5
|
Home-page: https://github.com/pepsimidamerica/nacwrap
|
|
6
6
|
Author: Jordan Maynor
|
|
@@ -14,6 +14,15 @@ License-File: LICENSE
|
|
|
14
14
|
Requires-Dist: requests
|
|
15
15
|
Requires-Dist: tenacity
|
|
16
16
|
Requires-Dist: pydantic
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: requires-dist
|
|
24
|
+
Dynamic: requires-python
|
|
25
|
+
Dynamic: summary
|
|
17
26
|
|
|
18
27
|
# Overview
|
|
19
28
|
|
|
@@ -37,12 +46,12 @@ Several environment variables are required for nacwrap to function.
|
|
|
37
46
|
### Instances - Create Instance
|
|
38
47
|
|
|
39
48
|
Function to create a workflow instance. Takes in two parameters.
|
|
49
|
+
|
|
40
50
|
| Param | Description |
|
|
41
51
|
| ----------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
42
52
|
| workflow_id | The ID of the workflow you want to create an instance for. |
|
|
43
53
|
| start_data | Optional, any start data the worklfow requires. Should be provided in dictionary format. Returns JSON response if successful. |
|
|
44
54
|
|
|
45
|
-
|
|
46
55
|
### Instances - List Instances
|
|
47
56
|
|
|
48
57
|
Function to return instance data. Takes a number of parameters for filtering what instance data to get.
|
|
@@ -54,6 +63,7 @@ Make function to delegate tasks from one user to another.
|
|
|
54
63
|
### Tasks - Task Search
|
|
55
64
|
|
|
56
65
|
Returns Nintex Tasks as a list of NintexTask objects. Takes a number of parameters for filtering what tasks to retrieve.
|
|
66
|
+
|
|
57
67
|
| Param | Description |
|
|
58
68
|
| ------------- | ----------------------------------------------------- |
|
|
59
69
|
| workflow_name | Limit results to workflows matching this name. |
|
|
@@ -66,6 +76,7 @@ Returns Nintex Tasks as a list of NintexTask objects. Takes a number of paramete
|
|
|
66
76
|
### Users - List Users
|
|
67
77
|
|
|
68
78
|
Returns Nintex Users as a list of NintexUser objects. Takes a number of parameters for filtering what users to retrieve.
|
|
79
|
+
|
|
69
80
|
| Param | Description |
|
|
70
81
|
| ------ | ------------------------------------------------- |
|
|
71
82
|
| id | Limit results to user matching this guid |
|
|
@@ -20,12 +20,12 @@ Several environment variables are required for nacwrap to function.
|
|
|
20
20
|
### Instances - Create Instance
|
|
21
21
|
|
|
22
22
|
Function to create a workflow instance. Takes in two parameters.
|
|
23
|
+
|
|
23
24
|
| Param | Description |
|
|
24
25
|
| ----------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
25
26
|
| workflow_id | The ID of the workflow you want to create an instance for. |
|
|
26
27
|
| start_data | Optional, any start data the worklfow requires. Should be provided in dictionary format. Returns JSON response if successful. |
|
|
27
28
|
|
|
28
|
-
|
|
29
29
|
### Instances - List Instances
|
|
30
30
|
|
|
31
31
|
Function to return instance data. Takes a number of parameters for filtering what instance data to get.
|
|
@@ -37,6 +37,7 @@ Make function to delegate tasks from one user to another.
|
|
|
37
37
|
### Tasks - Task Search
|
|
38
38
|
|
|
39
39
|
Returns Nintex Tasks as a list of NintexTask objects. Takes a number of parameters for filtering what tasks to retrieve.
|
|
40
|
+
|
|
40
41
|
| Param | Description |
|
|
41
42
|
| ------------- | ----------------------------------------------------- |
|
|
42
43
|
| workflow_name | Limit results to workflows matching this name. |
|
|
@@ -49,9 +50,10 @@ Returns Nintex Tasks as a list of NintexTask objects. Takes a number of paramete
|
|
|
49
50
|
### Users - List Users
|
|
50
51
|
|
|
51
52
|
Returns Nintex Users as a list of NintexUser objects. Takes a number of parameters for filtering what users to retrieve.
|
|
53
|
+
|
|
52
54
|
| Param | Description |
|
|
53
55
|
| ------ | ------------------------------------------------- |
|
|
54
56
|
| id | Limit results to user matching this guid |
|
|
55
57
|
| email | Limit results to user matching this email |
|
|
56
58
|
| filter | Limit results to user matching this email or name |
|
|
57
|
-
| role | Limit results to users matching this role |
|
|
59
|
+
| role | Limit results to users matching this role |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import requests
|
|
4
|
+
|
|
5
|
+
from nacwrap._auth import Decorators
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@Decorators.refresh_token
|
|
9
|
+
def get_connections() -> list[dict]:
|
|
10
|
+
"""
|
|
11
|
+
Get all connections
|
|
12
|
+
"""
|
|
13
|
+
if "NINTEX_BASE_URL" not in os.environ:
|
|
14
|
+
raise Exception("NINTEX_BASE_URL not set")
|
|
15
|
+
try:
|
|
16
|
+
response = requests.get(
|
|
17
|
+
os.environ["NINTEX_BASE_URL"] + "/workflows/v1/connections",
|
|
18
|
+
headers={
|
|
19
|
+
"Authorization": f"Bearer {os.environ['NTX_BEARER_TOKEN']}",
|
|
20
|
+
},
|
|
21
|
+
timeout=30,
|
|
22
|
+
)
|
|
23
|
+
response.raise_for_status()
|
|
24
|
+
except requests.exceptions.HTTPError as e:
|
|
25
|
+
raise Exception(
|
|
26
|
+
f"Error getting connections: {e.response.status_code} - {e.response.content}"
|
|
27
|
+
)
|
|
28
|
+
except requests.exceptions.RequestException as e:
|
|
29
|
+
raise Exception(f"Error getting connections: {e}")
|
|
30
|
+
|
|
31
|
+
return response.json().get("connections", [])
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Also called data lookups in the Nintex interface.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
|
|
7
|
+
import requests
|
|
8
|
+
|
|
9
|
+
from nacwrap._auth import Decorators
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@Decorators.refresh_token
|
|
13
|
+
def get_datasources() -> dict:
|
|
14
|
+
"""
|
|
15
|
+
Get all data sources
|
|
16
|
+
"""
|
|
17
|
+
if "NINTEX_BASE_URL" not in os.environ:
|
|
18
|
+
raise Exception("NINTEX_BASE_URL not set")
|
|
19
|
+
try:
|
|
20
|
+
response = requests.get(
|
|
21
|
+
os.environ["NINTEX_BASE_URL"] + "/workflows/v1/datasources",
|
|
22
|
+
headers={
|
|
23
|
+
"Authorization": f"Bearer {os.environ['NTX_BEARER_TOKEN']}",
|
|
24
|
+
},
|
|
25
|
+
timeout=30,
|
|
26
|
+
)
|
|
27
|
+
response.raise_for_status()
|
|
28
|
+
except requests.exceptions.HTTPError as e:
|
|
29
|
+
raise Exception(
|
|
30
|
+
f"Error getting data sources: {e.response.status_code} - {e.response.content}"
|
|
31
|
+
)
|
|
32
|
+
except requests.exceptions.RequestException as e:
|
|
33
|
+
raise Exception(f"Error getting data sources: {e}")
|
|
34
|
+
|
|
35
|
+
return response.json().get("datasources", [])
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@Decorators.refresh_token
|
|
39
|
+
def get_datasource_connectors() -> dict:
|
|
40
|
+
"""
|
|
41
|
+
Get a list of connectors compatible with the xtensions data lookups
|
|
42
|
+
"""
|
|
43
|
+
if "NINTEX_BASE_URL" not in os.environ:
|
|
44
|
+
raise Exception("NINTEX_BASE_URL not set")
|
|
45
|
+
try:
|
|
46
|
+
response = requests.get(
|
|
47
|
+
os.environ["NINTEX_BASE_URL"] + "/workflows/v1/datasources/contracts",
|
|
48
|
+
headers={
|
|
49
|
+
"Authorization": f"Bearer {os.environ['NTX_BEARER_TOKEN']}",
|
|
50
|
+
},
|
|
51
|
+
timeout=30,
|
|
52
|
+
)
|
|
53
|
+
response.raise_for_status()
|
|
54
|
+
except requests.exceptions.HTTPError as e:
|
|
55
|
+
raise Exception(
|
|
56
|
+
f"Error getting data source connectors: {e.response.status_code} - {e.response.content}"
|
|
57
|
+
)
|
|
58
|
+
except requests.exceptions.RequestException as e:
|
|
59
|
+
raise Exception(f"Error getting data source connectors: {e}")
|
|
60
|
+
|
|
61
|
+
return response.json().get("contracts", [])
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
This module contains functions to interact with the Nintex Workflow Cloud API.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
+
from .connections import *
|
|
6
|
+
from .data_model import *
|
|
7
|
+
from .datasources import *
|
|
8
|
+
from .exceptions import *
|
|
5
9
|
from .instances import *
|
|
6
10
|
from .tasks import *
|
|
7
11
|
from .users import *
|
|
8
|
-
from .data_model import *
|
|
9
12
|
from .workflows import *
|
|
10
|
-
from .exceptions import *
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: nacwrap
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Python package that acts as a wrapper for the Nintex Automation Cloud system.
|
|
5
5
|
Home-page: https://github.com/pepsimidamerica/nacwrap
|
|
6
6
|
Author: Jordan Maynor
|
|
@@ -14,6 +14,15 @@ License-File: LICENSE
|
|
|
14
14
|
Requires-Dist: requests
|
|
15
15
|
Requires-Dist: tenacity
|
|
16
16
|
Requires-Dist: pydantic
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: requires-dist
|
|
24
|
+
Dynamic: requires-python
|
|
25
|
+
Dynamic: summary
|
|
17
26
|
|
|
18
27
|
# Overview
|
|
19
28
|
|
|
@@ -37,12 +46,12 @@ Several environment variables are required for nacwrap to function.
|
|
|
37
46
|
### Instances - Create Instance
|
|
38
47
|
|
|
39
48
|
Function to create a workflow instance. Takes in two parameters.
|
|
49
|
+
|
|
40
50
|
| Param | Description |
|
|
41
51
|
| ----------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
42
52
|
| workflow_id | The ID of the workflow you want to create an instance for. |
|
|
43
53
|
| start_data | Optional, any start data the worklfow requires. Should be provided in dictionary format. Returns JSON response if successful. |
|
|
44
54
|
|
|
45
|
-
|
|
46
55
|
### Instances - List Instances
|
|
47
56
|
|
|
48
57
|
Function to return instance data. Takes a number of parameters for filtering what instance data to get.
|
|
@@ -54,6 +63,7 @@ Make function to delegate tasks from one user to another.
|
|
|
54
63
|
### Tasks - Task Search
|
|
55
64
|
|
|
56
65
|
Returns Nintex Tasks as a list of NintexTask objects. Takes a number of parameters for filtering what tasks to retrieve.
|
|
66
|
+
|
|
57
67
|
| Param | Description |
|
|
58
68
|
| ------------- | ----------------------------------------------------- |
|
|
59
69
|
| workflow_name | Limit results to workflows matching this name. |
|
|
@@ -66,6 +76,7 @@ Returns Nintex Tasks as a list of NintexTask objects. Takes a number of paramete
|
|
|
66
76
|
### Users - List Users
|
|
67
77
|
|
|
68
78
|
Returns Nintex Users as a list of NintexUser objects. Takes a number of parameters for filtering what users to retrieve.
|
|
79
|
+
|
|
69
80
|
| Param | Description |
|
|
70
81
|
| ------ | ------------------------------------------------- |
|
|
71
82
|
| id | Limit results to user matching this guid |
|
|
@@ -8,7 +8,7 @@ with open("README.md", "r") as f:
|
|
|
8
8
|
|
|
9
9
|
setup(
|
|
10
10
|
name="nacwrap",
|
|
11
|
-
version="0.2.
|
|
11
|
+
version="0.2.3",
|
|
12
12
|
description="Python package that acts as a wrapper for the Nintex Automation Cloud system.",
|
|
13
13
|
long_description=long_description,
|
|
14
14
|
long_description_content_type="text/markdown",
|
|
@@ -10,10 +10,10 @@ load_dotenv()
|
|
|
10
10
|
|
|
11
11
|
sys.path.insert(0, "")
|
|
12
12
|
|
|
13
|
-
from nacwrap import
|
|
13
|
+
from nacwrap import nacwrap
|
|
14
14
|
|
|
15
|
-
res = nacwrap.
|
|
16
|
-
|
|
17
|
-
)
|
|
15
|
+
res = nacwrap.get_datasource_connectors()
|
|
16
|
+
|
|
17
|
+
pprint(res)
|
|
18
18
|
|
|
19
19
|
pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|