blueink-client-python 1.0.1__tar.gz → 1.3.0__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.
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/PKG-INFO +86 -8
- blueink_client_python-1.0.1/src/blueink_client_python.egg-info/PKG-INFO → blueink_client_python-1.3.0/README.md +79 -29
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/setup.cfg +7 -11
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/bundle_helper.py +56 -4
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/client.py +2 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/constants.py +2 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/endpoints.py +10 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/model/bundles.py +146 -96
- blueink_client_python-1.3.0/src/blueink/model/persons.py +18 -0
- blueink_client_python-1.3.0/src/blueink/model/webhook.py +36 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/person_helper.py +1 -1
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/subclients/bundle.py +73 -1
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/subclients/packet.py +1 -1
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/subclients/template.py +41 -0
- blueink_client_python-1.3.0/src/blueink/subclients/verify.py +20 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/subclients/webhook.py +6 -12
- blueink_client_python-1.3.0/src/blueink/tests/test_bundle_helper.py +634 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/tests/test_client.py +52 -0
- blueink_client_python-1.0.1/README.md → blueink_client_python-1.3.0/src/blueink_client_python.egg-info/PKG-INFO +107 -2
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink_client_python.egg-info/SOURCES.txt +1 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink_client_python.egg-info/requires.txt +4 -4
- blueink_client_python-1.0.1/src/blueink/model/persons.py +0 -20
- blueink_client_python-1.0.1/src/blueink/model/webhook.py +0 -30
- blueink_client_python-1.0.1/src/blueink/tests/test_bundle_helper.py +0 -318
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/LICENSE +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/pyproject.toml +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/__init__.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/model/__init__.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/paginator.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/request_helper.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/subclients/__init__.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/subclients/envelope_template.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/subclients/person.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/subclients/subclient.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/tests/__init__.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/tests/test_person_helper.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/utils/__init__.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink/utils/testcase.py +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink_client_python.egg-info/dependency_links.txt +0 -0
- {blueink_client_python-1.0.1 → blueink_client_python-1.3.0}/src/blueink_client_python.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: blueink-client-python
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: Python Client for Blueink eSignature API
|
|
5
5
|
Home-page: https://github.com/blueinkhq/blueink-client-python
|
|
6
6
|
Author: Blueink
|
|
@@ -14,16 +14,17 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: munch
|
|
16
16
|
Requires-Dist: requests
|
|
17
|
-
Requires-Dist: pydantic
|
|
18
|
-
Requires-Dist: email-validator
|
|
17
|
+
Requires-Dist: pydantic<3.0,>=2.0
|
|
18
|
+
Requires-Dist: email-validator<3.0,>=2.0
|
|
19
19
|
Provides-Extra: munch
|
|
20
20
|
Requires-Dist: munch>=2.5; extra == "munch"
|
|
21
21
|
Provides-Extra: requests
|
|
22
22
|
Requires-Dist: requests>=2.31; extra == "requests"
|
|
23
23
|
Provides-Extra: pydantic
|
|
24
|
-
Requires-Dist: pydantic
|
|
24
|
+
Requires-Dist: pydantic<3.0,>=2.0; extra == "pydantic"
|
|
25
25
|
Provides-Extra: email-validator
|
|
26
|
-
Requires-Dist: email-validator
|
|
26
|
+
Requires-Dist: email-validator<3.0,>=2.0; extra == "email-validator"
|
|
27
|
+
Dynamic: license-file
|
|
27
28
|
|
|
28
29
|
# blueink-client-python
|
|
29
30
|

|
|
@@ -123,6 +124,7 @@ The supported "resources" are:
|
|
|
123
124
|
* `persons`
|
|
124
125
|
* `packets`
|
|
125
126
|
* `templates`
|
|
127
|
+
* `envelope_templates`
|
|
126
128
|
* `webhooks`
|
|
127
129
|
|
|
128
130
|
The methods correspond to common REST operations:
|
|
@@ -265,6 +267,8 @@ as kwargs.
|
|
|
265
267
|
|
|
266
268
|
### Bundle Related
|
|
267
269
|
* Create via ```client.bundles.create(...)``` or ```client.bundles.create_from_bundle_helper(...)```
|
|
270
|
+
* Create from Envelope Template via ```client.bundles.create_from_envelope_template_helper(...)``` or ```client.bundles.create_from_envelope_template(...)```
|
|
271
|
+
* Create Preparation Session via ```client.bundles.create_preparation_session(...)```
|
|
268
272
|
* List via ```client.bundles.list(...)``` or ```client.bundles.paged_list(...)```
|
|
269
273
|
* Retrieve via ```client.bundles.retrieve(...)```
|
|
270
274
|
* Cancel via ```client.bundles.cancel(...)```
|
|
@@ -288,6 +292,12 @@ as kwargs.
|
|
|
288
292
|
### Template Related
|
|
289
293
|
* List via ```client.templates.list(...)``` or ```client.templates.paged_list(...)```
|
|
290
294
|
* Retrieve via ```client.templates.retrieve(...)```
|
|
295
|
+
* Update via ```client.templates.update(...)```
|
|
296
|
+
* Create Preparation Session via ```client.templates.create_preparation_session(...)```
|
|
297
|
+
|
|
298
|
+
### Envelope Template Related
|
|
299
|
+
* List via ```client.envelope_templates.list(...)``` or ```client.envelope_templates.paged_list(...)```
|
|
300
|
+
* Retrieve via ```client.envelope_templates.retrieve(...)```
|
|
291
301
|
|
|
292
302
|
### Webhook Related
|
|
293
303
|
|
|
@@ -451,6 +461,19 @@ response = client.bundles.create_from_bundle_helper(bh)
|
|
|
451
461
|
- Automatically adjusts to text position in the document
|
|
452
462
|
- Can be combined with regular manually-positioned fields
|
|
453
463
|
|
|
464
|
+
#### Bundle Tag Values
|
|
465
|
+
|
|
466
|
+
Bundle-level `tag_values` can be set on the `BundleHelper` constructor to attach
|
|
467
|
+
arbitrary key/value metadata to a Bundle at creation time:
|
|
468
|
+
|
|
469
|
+
```python
|
|
470
|
+
bh = BundleHelper(
|
|
471
|
+
label="Tagged Agreement",
|
|
472
|
+
is_test=True,
|
|
473
|
+
tag_values={"contract_type": "nda"},
|
|
474
|
+
)
|
|
475
|
+
```
|
|
476
|
+
|
|
454
477
|
#### Retrieval
|
|
455
478
|
|
|
456
479
|
Getting a single bundle is fairly easy. They can be accessed with a single call. To get
|
|
@@ -687,9 +710,64 @@ for page in client.templates.paged_list():
|
|
|
687
710
|
page.data # templates in page
|
|
688
711
|
# single
|
|
689
712
|
template_response = client.templates.retrieve(template_id)
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
Templates can also be partially updated (for example, to write template metadata):
|
|
716
|
+
|
|
717
|
+
```python
|
|
718
|
+
client.templates.update(template_id, {"metadata": {"key": "value"}})
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
#### Template Preparation Sessions
|
|
722
|
+
|
|
723
|
+
A preparation session creates a secure, time-limited URL that can be embedded in an
|
|
724
|
+
iframe to let an end user prepare a template through your application:
|
|
725
|
+
|
|
726
|
+
```python
|
|
727
|
+
response = client.templates.create_preparation_session({
|
|
728
|
+
"template_id": template_id, # optional: slug of an existing template to edit
|
|
729
|
+
"redirect_url": "https://your-app.example.com/done", # optional
|
|
730
|
+
})
|
|
731
|
+
prep_url = response.data.url # URL to embed in an iframe
|
|
732
|
+
expires = response.data.expires # ISO 8601 timestamp when the URL expires
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
A similar session can be created for bundle/document preparation via
|
|
736
|
+
`client.bundles.create_preparation_session(...)`.
|
|
737
|
+
|
|
738
|
+
### Envelope Templates
|
|
739
|
+
|
|
740
|
+
Envelope Templates are reusable document workflows that contain predefined documents,
|
|
741
|
+
field layouts, signer roles, and configuration settings. They can be listed (non-paged),
|
|
742
|
+
listed (paged) or retrieved singly:
|
|
743
|
+
|
|
744
|
+
```python
|
|
745
|
+
# non paged
|
|
746
|
+
envelope_templates_response = client.envelope_templates.list()
|
|
747
|
+
# paged
|
|
748
|
+
for page in client.envelope_templates.paged_list():
|
|
749
|
+
page.data # envelope templates in page
|
|
750
|
+
# single
|
|
751
|
+
envelope_template_response = client.envelope_templates.retrieve(envelope_template_id)
|
|
752
|
+
```
|
|
690
753
|
|
|
754
|
+
To create a Bundle from an envelope template, configure a `BundleHelper` with the
|
|
755
|
+
template and its signers, then create the Bundle:
|
|
691
756
|
|
|
757
|
+
```python
|
|
758
|
+
from blueink import BundleHelper, Client
|
|
759
|
+
|
|
760
|
+
bh = BundleHelper(label="Contract", is_test=True)
|
|
761
|
+
bh.add_signer(name="John Doe", email="john@example.com", key="signer-1")
|
|
762
|
+
bh.set_envelope_template(
|
|
763
|
+
template_id="T-abc123",
|
|
764
|
+
field_values={"company_name": "ACME Corp"},
|
|
765
|
+
)
|
|
766
|
+
|
|
767
|
+
client = Client()
|
|
768
|
+
response = client.bundles.create_from_envelope_template_helper(bh)
|
|
692
769
|
```
|
|
770
|
+
|
|
693
771
|
### Webhooks
|
|
694
772
|
|
|
695
773
|
Webhooks can be interacted with via several methods. Webhooks also have related objects, such as
|
|
@@ -700,8 +778,8 @@ methods to interact with.
|
|
|
700
778
|
from copy import deepcopy
|
|
701
779
|
|
|
702
780
|
from requests import HTTPError
|
|
703
|
-
from
|
|
704
|
-
from
|
|
781
|
+
from blueink import Client
|
|
782
|
+
from blueink.constants import EVENT_TYPE
|
|
705
783
|
|
|
706
784
|
WEBHOOK_01 = {
|
|
707
785
|
"url": "https://www.example.com/01/",
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: blueink-client-python
|
|
3
|
-
Version: 1.0.1
|
|
4
|
-
Summary: Python Client for Blueink eSignature API
|
|
5
|
-
Home-page: https://github.com/blueinkhq/blueink-client-python
|
|
6
|
-
Author: Blueink
|
|
7
|
-
Author-email: pypi@blueink.com
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/blueinkhq/blueink-client-python/issues
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Requires-Python: >=3.8
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
Requires-Dist: munch
|
|
16
|
-
Requires-Dist: requests
|
|
17
|
-
Requires-Dist: pydantic
|
|
18
|
-
Requires-Dist: email-validator
|
|
19
|
-
Provides-Extra: munch
|
|
20
|
-
Requires-Dist: munch>=2.5; extra == "munch"
|
|
21
|
-
Provides-Extra: requests
|
|
22
|
-
Requires-Dist: requests>=2.31; extra == "requests"
|
|
23
|
-
Provides-Extra: pydantic
|
|
24
|
-
Requires-Dist: pydantic>=1.9; extra == "pydantic"
|
|
25
|
-
Provides-Extra: email-validator
|
|
26
|
-
Requires-Dist: email-validator>=1.2; extra == "email-validator"
|
|
27
|
-
|
|
28
1
|
# blueink-client-python
|
|
29
2
|

|
|
30
3
|

|
|
@@ -123,6 +96,7 @@ The supported "resources" are:
|
|
|
123
96
|
* `persons`
|
|
124
97
|
* `packets`
|
|
125
98
|
* `templates`
|
|
99
|
+
* `envelope_templates`
|
|
126
100
|
* `webhooks`
|
|
127
101
|
|
|
128
102
|
The methods correspond to common REST operations:
|
|
@@ -265,6 +239,8 @@ as kwargs.
|
|
|
265
239
|
|
|
266
240
|
### Bundle Related
|
|
267
241
|
* Create via ```client.bundles.create(...)``` or ```client.bundles.create_from_bundle_helper(...)```
|
|
242
|
+
* Create from Envelope Template via ```client.bundles.create_from_envelope_template_helper(...)``` or ```client.bundles.create_from_envelope_template(...)```
|
|
243
|
+
* Create Preparation Session via ```client.bundles.create_preparation_session(...)```
|
|
268
244
|
* List via ```client.bundles.list(...)``` or ```client.bundles.paged_list(...)```
|
|
269
245
|
* Retrieve via ```client.bundles.retrieve(...)```
|
|
270
246
|
* Cancel via ```client.bundles.cancel(...)```
|
|
@@ -288,6 +264,12 @@ as kwargs.
|
|
|
288
264
|
### Template Related
|
|
289
265
|
* List via ```client.templates.list(...)``` or ```client.templates.paged_list(...)```
|
|
290
266
|
* Retrieve via ```client.templates.retrieve(...)```
|
|
267
|
+
* Update via ```client.templates.update(...)```
|
|
268
|
+
* Create Preparation Session via ```client.templates.create_preparation_session(...)```
|
|
269
|
+
|
|
270
|
+
### Envelope Template Related
|
|
271
|
+
* List via ```client.envelope_templates.list(...)``` or ```client.envelope_templates.paged_list(...)```
|
|
272
|
+
* Retrieve via ```client.envelope_templates.retrieve(...)```
|
|
291
273
|
|
|
292
274
|
### Webhook Related
|
|
293
275
|
|
|
@@ -451,6 +433,19 @@ response = client.bundles.create_from_bundle_helper(bh)
|
|
|
451
433
|
- Automatically adjusts to text position in the document
|
|
452
434
|
- Can be combined with regular manually-positioned fields
|
|
453
435
|
|
|
436
|
+
#### Bundle Tag Values
|
|
437
|
+
|
|
438
|
+
Bundle-level `tag_values` can be set on the `BundleHelper` constructor to attach
|
|
439
|
+
arbitrary key/value metadata to a Bundle at creation time:
|
|
440
|
+
|
|
441
|
+
```python
|
|
442
|
+
bh = BundleHelper(
|
|
443
|
+
label="Tagged Agreement",
|
|
444
|
+
is_test=True,
|
|
445
|
+
tag_values={"contract_type": "nda"},
|
|
446
|
+
)
|
|
447
|
+
```
|
|
448
|
+
|
|
454
449
|
#### Retrieval
|
|
455
450
|
|
|
456
451
|
Getting a single bundle is fairly easy. They can be accessed with a single call. To get
|
|
@@ -687,9 +682,64 @@ for page in client.templates.paged_list():
|
|
|
687
682
|
page.data # templates in page
|
|
688
683
|
# single
|
|
689
684
|
template_response = client.templates.retrieve(template_id)
|
|
685
|
+
```
|
|
690
686
|
|
|
687
|
+
Templates can also be partially updated (for example, to write template metadata):
|
|
691
688
|
|
|
689
|
+
```python
|
|
690
|
+
client.templates.update(template_id, {"metadata": {"key": "value"}})
|
|
692
691
|
```
|
|
692
|
+
|
|
693
|
+
#### Template Preparation Sessions
|
|
694
|
+
|
|
695
|
+
A preparation session creates a secure, time-limited URL that can be embedded in an
|
|
696
|
+
iframe to let an end user prepare a template through your application:
|
|
697
|
+
|
|
698
|
+
```python
|
|
699
|
+
response = client.templates.create_preparation_session({
|
|
700
|
+
"template_id": template_id, # optional: slug of an existing template to edit
|
|
701
|
+
"redirect_url": "https://your-app.example.com/done", # optional
|
|
702
|
+
})
|
|
703
|
+
prep_url = response.data.url # URL to embed in an iframe
|
|
704
|
+
expires = response.data.expires # ISO 8601 timestamp when the URL expires
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
A similar session can be created for bundle/document preparation via
|
|
708
|
+
`client.bundles.create_preparation_session(...)`.
|
|
709
|
+
|
|
710
|
+
### Envelope Templates
|
|
711
|
+
|
|
712
|
+
Envelope Templates are reusable document workflows that contain predefined documents,
|
|
713
|
+
field layouts, signer roles, and configuration settings. They can be listed (non-paged),
|
|
714
|
+
listed (paged) or retrieved singly:
|
|
715
|
+
|
|
716
|
+
```python
|
|
717
|
+
# non paged
|
|
718
|
+
envelope_templates_response = client.envelope_templates.list()
|
|
719
|
+
# paged
|
|
720
|
+
for page in client.envelope_templates.paged_list():
|
|
721
|
+
page.data # envelope templates in page
|
|
722
|
+
# single
|
|
723
|
+
envelope_template_response = client.envelope_templates.retrieve(envelope_template_id)
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
To create a Bundle from an envelope template, configure a `BundleHelper` with the
|
|
727
|
+
template and its signers, then create the Bundle:
|
|
728
|
+
|
|
729
|
+
```python
|
|
730
|
+
from blueink import BundleHelper, Client
|
|
731
|
+
|
|
732
|
+
bh = BundleHelper(label="Contract", is_test=True)
|
|
733
|
+
bh.add_signer(name="John Doe", email="john@example.com", key="signer-1")
|
|
734
|
+
bh.set_envelope_template(
|
|
735
|
+
template_id="T-abc123",
|
|
736
|
+
field_values={"company_name": "ACME Corp"},
|
|
737
|
+
)
|
|
738
|
+
|
|
739
|
+
client = Client()
|
|
740
|
+
response = client.bundles.create_from_envelope_template_helper(bh)
|
|
741
|
+
```
|
|
742
|
+
|
|
693
743
|
### Webhooks
|
|
694
744
|
|
|
695
745
|
Webhooks can be interacted with via several methods. Webhooks also have related objects, such as
|
|
@@ -700,8 +750,8 @@ methods to interact with.
|
|
|
700
750
|
from copy import deepcopy
|
|
701
751
|
|
|
702
752
|
from requests import HTTPError
|
|
703
|
-
from
|
|
704
|
-
from
|
|
753
|
+
from blueink import Client
|
|
754
|
+
from blueink.constants import EVENT_TYPE
|
|
705
755
|
|
|
706
756
|
WEBHOOK_01 = {
|
|
707
757
|
"url": "https://www.example.com/01/",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = blueink-client-python
|
|
3
|
-
version = 1.0
|
|
3
|
+
version = 1.3.0
|
|
4
4
|
author = Blueink
|
|
5
5
|
author_email = pypi@blueink.com
|
|
6
6
|
description = Python Client for Blueink eSignature API
|
|
@@ -22,18 +22,14 @@ python_requires = >=3.8
|
|
|
22
22
|
install_requires =
|
|
23
23
|
munch
|
|
24
24
|
requests
|
|
25
|
-
pydantic
|
|
26
|
-
email-validator
|
|
25
|
+
pydantic>=2.0,<3.0
|
|
26
|
+
email-validator>=2.0,<3.0
|
|
27
27
|
|
|
28
28
|
[options.extras_require]
|
|
29
|
-
munch =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
pydantic =
|
|
34
|
-
pydantic>=1.9
|
|
35
|
-
email-validator =
|
|
36
|
-
email-validator>=1.2
|
|
29
|
+
munch = munch>=2.5;
|
|
30
|
+
requests = requests>=2.31;
|
|
31
|
+
pydantic = pydantic>=2.0,<3.0
|
|
32
|
+
email-validator = email-validator>=2.0,<3.0
|
|
37
33
|
|
|
38
34
|
[options.packages.find]
|
|
39
35
|
where = src
|
|
@@ -10,6 +10,7 @@ from blueink.model.bundles import (
|
|
|
10
10
|
EnvelopeTemplate,
|
|
11
11
|
EnvelopeTemplateFieldValue,
|
|
12
12
|
Field,
|
|
13
|
+
ImportedDocument,
|
|
13
14
|
Packet,
|
|
14
15
|
TemplateRef,
|
|
15
16
|
TemplateRefAssignment,
|
|
@@ -28,6 +29,9 @@ class BundleHelper:
|
|
|
28
29
|
is_test: bool = False,
|
|
29
30
|
custom_key: str = None,
|
|
30
31
|
team: str = None,
|
|
32
|
+
signing_brand: str = None,
|
|
33
|
+
expires: str = None,
|
|
34
|
+
tag_values: dict = None,
|
|
31
35
|
):
|
|
32
36
|
"""Helper class to aid building a Bundle.
|
|
33
37
|
|
|
@@ -41,6 +45,9 @@ class BundleHelper:
|
|
|
41
45
|
is_test:
|
|
42
46
|
custom_key:
|
|
43
47
|
team:
|
|
48
|
+
signing_brand:
|
|
49
|
+
expires:
|
|
50
|
+
tag_values: Optional dict mapping data flow tags to pre-filled values
|
|
44
51
|
"""
|
|
45
52
|
self._label = label
|
|
46
53
|
self._in_order = in_order
|
|
@@ -52,6 +59,9 @@ class BundleHelper:
|
|
|
52
59
|
self._packets = {}
|
|
53
60
|
self._custom_key = custom_key
|
|
54
61
|
self._team = team
|
|
62
|
+
self._signing_brand = signing_brand
|
|
63
|
+
self._expires = expires
|
|
64
|
+
self._tag_values = tag_values
|
|
55
65
|
self._envelope_template = None
|
|
56
66
|
|
|
57
67
|
# for file uploads, index should match those in the document "file_index" field
|
|
@@ -111,6 +121,20 @@ class BundleHelper:
|
|
|
111
121
|
|
|
112
122
|
return self.add_document_by_b64(filename, b64str, **additional_data)
|
|
113
123
|
|
|
124
|
+
def add_document_by_html(self, html_content: str, **additional_data) -> str:
|
|
125
|
+
"""Add a document using an HTML string for HTML-to-PDF conversion.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
html_content: HTML content string
|
|
129
|
+
additional_data: Optional additional kwargs (e.g., filename, html_fields_mode)
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
Document Key
|
|
133
|
+
"""
|
|
134
|
+
document = Document.create(file_html=html_content, **additional_data)
|
|
135
|
+
self._documents[document.key] = document
|
|
136
|
+
return document.key
|
|
137
|
+
|
|
114
138
|
def add_document_by_b64(self, filename: str, b64str: str, **additional_data):
|
|
115
139
|
"""Add a file using a b64 string; utf-8 encoded
|
|
116
140
|
|
|
@@ -209,6 +233,10 @@ class BundleHelper:
|
|
|
209
233
|
v_pattern: str = None,
|
|
210
234
|
v_min: int = None,
|
|
211
235
|
v_max: int = None,
|
|
236
|
+
v_regex: str = None,
|
|
237
|
+
v_regex_msg: str = None,
|
|
238
|
+
v_attachment_types: List[str] = None,
|
|
239
|
+
data_flow_tag: str = None,
|
|
212
240
|
key=None,
|
|
213
241
|
**additional_data,
|
|
214
242
|
):
|
|
@@ -226,6 +254,10 @@ class BundleHelper:
|
|
|
226
254
|
v_pattern: Optional
|
|
227
255
|
v_min: Optional
|
|
228
256
|
v_max: Optional
|
|
257
|
+
v_regex: Optional regular expression for field validation
|
|
258
|
+
v_regex_msg: Optional error message shown when v_regex validation fails
|
|
259
|
+
v_attachment_types: Optional list of allowed attachment file extensions (only for kind='att')
|
|
260
|
+
data_flow_tag: Optional data flow tag to associate with the field
|
|
229
261
|
editors: Optional
|
|
230
262
|
key: Optional
|
|
231
263
|
additional_data: Optional and will append any additional kwargs to the json of the field
|
|
@@ -247,6 +279,10 @@ class BundleHelper:
|
|
|
247
279
|
v_pattern=v_pattern,
|
|
248
280
|
v_min=v_min,
|
|
249
281
|
v_max=v_max,
|
|
282
|
+
v_regex=v_regex,
|
|
283
|
+
v_regex_msg=v_regex_msg,
|
|
284
|
+
v_attachment_types=v_attachment_types,
|
|
285
|
+
data_flow_tag=data_flow_tag,
|
|
250
286
|
key=key,
|
|
251
287
|
**additional_data,
|
|
252
288
|
)
|
|
@@ -267,6 +303,7 @@ class BundleHelper:
|
|
|
267
303
|
offset_y: int = 0,
|
|
268
304
|
editors: List[str] = None,
|
|
269
305
|
page: int = None,
|
|
306
|
+
v_attachment_types: List[str] = None,
|
|
270
307
|
**additional_data,
|
|
271
308
|
):
|
|
272
309
|
"""Add an auto-placement field to a document.
|
|
@@ -284,6 +321,7 @@ class BundleHelper:
|
|
|
284
321
|
offset_y: Vertical offset from the search text (default: 0)
|
|
285
322
|
editors: List of signer keys who can edit this field
|
|
286
323
|
page: Optional page number to limit search to
|
|
324
|
+
v_attachment_types: Optional list of allowed attachment file extensions (only for kind='att')
|
|
287
325
|
additional_data: Optional additional kwargs to append to the auto-placement
|
|
288
326
|
|
|
289
327
|
Returns:
|
|
@@ -313,6 +351,7 @@ class BundleHelper:
|
|
|
313
351
|
offset_x=offset_x,
|
|
314
352
|
offset_y=offset_y,
|
|
315
353
|
page=page,
|
|
354
|
+
v_attachment_types=v_attachment_types,
|
|
316
355
|
**additional_data,
|
|
317
356
|
)
|
|
318
357
|
|
|
@@ -334,6 +373,8 @@ class BundleHelper:
|
|
|
334
373
|
auth_id: bool = False,
|
|
335
374
|
order: int = None,
|
|
336
375
|
key=None,
|
|
376
|
+
requires_witness: bool = None,
|
|
377
|
+
witness_nominated_by: str = None,
|
|
337
378
|
**additional_data,
|
|
338
379
|
):
|
|
339
380
|
"""Create and add a signer. With at least an email xor phone number.
|
|
@@ -349,6 +390,8 @@ class BundleHelper:
|
|
|
349
390
|
auth_id: Optional
|
|
350
391
|
deliver_via: Optional
|
|
351
392
|
order: Optional
|
|
393
|
+
requires_witness: Optional
|
|
394
|
+
witness_nominated_by: Optional
|
|
352
395
|
additional_data: Optional and will append any additional kwargs to the json of the signer
|
|
353
396
|
|
|
354
397
|
Returns:
|
|
@@ -368,6 +411,8 @@ class BundleHelper:
|
|
|
368
411
|
deliver_via=deliver_via,
|
|
369
412
|
order=order,
|
|
370
413
|
key=key,
|
|
414
|
+
requires_witness=requires_witness,
|
|
415
|
+
witness_nominated_by=witness_nominated_by,
|
|
371
416
|
**additional_data,
|
|
372
417
|
)
|
|
373
418
|
self._packets[packet.key] = packet
|
|
@@ -496,6 +541,9 @@ class BundleHelper:
|
|
|
496
541
|
cc_emails=self._cc_emails,
|
|
497
542
|
custom_key=self._custom_key,
|
|
498
543
|
team=self._team,
|
|
544
|
+
signing_brand=self._signing_brand,
|
|
545
|
+
expires=self._expires,
|
|
546
|
+
tag_values=self._tag_values,
|
|
499
547
|
**additional_data,
|
|
500
548
|
)
|
|
501
549
|
return bundle_out
|
|
@@ -510,7 +558,7 @@ class BundleHelper:
|
|
|
510
558
|
Bundle as dictionary
|
|
511
559
|
"""
|
|
512
560
|
bundle = self._compile_bundle(**additional_data)
|
|
513
|
-
return bundle.
|
|
561
|
+
return bundle.model_dump(exclude_unset=True, exclude_none=True)
|
|
514
562
|
|
|
515
563
|
def as_data_for_envelope_template(self, **additional_data):
|
|
516
564
|
"""Return data for creating a bundle from an envelope template.
|
|
@@ -540,8 +588,10 @@ class BundleHelper:
|
|
|
540
588
|
|
|
541
589
|
packets = list(self._packets.values())
|
|
542
590
|
result = {
|
|
543
|
-
"packets": [
|
|
544
|
-
|
|
591
|
+
"packets": [
|
|
592
|
+
p.model_dump(exclude_unset=True, exclude_none=True) for p in packets
|
|
593
|
+
],
|
|
594
|
+
"envelope_template": self._envelope_template.model_dump(
|
|
545
595
|
exclude_unset=True, exclude_none=True
|
|
546
596
|
),
|
|
547
597
|
}
|
|
@@ -561,6 +611,8 @@ class BundleHelper:
|
|
|
561
611
|
result["custom_key"] = self._custom_key
|
|
562
612
|
if self._team:
|
|
563
613
|
result["team"] = self._team
|
|
614
|
+
if self._signing_brand:
|
|
615
|
+
result["signing_brand"] = self._signing_brand
|
|
564
616
|
|
|
565
617
|
# Add any additional data
|
|
566
618
|
result.update(additional_data)
|
|
@@ -577,4 +629,4 @@ class BundleHelper:
|
|
|
577
629
|
Bundle as json
|
|
578
630
|
"""
|
|
579
631
|
bundle = self._compile_bundle(**additional_data)
|
|
580
|
-
return bundle.
|
|
632
|
+
return bundle.model_dump_json(exclude_unset=True, exclude_none=True)
|
|
@@ -11,6 +11,7 @@ from blueink.subclients.envelope_template import EnvelopeTemplateSubClient
|
|
|
11
11
|
from blueink.subclients.packet import PacketSubClient
|
|
12
12
|
from blueink.subclients.person import PersonSubClient
|
|
13
13
|
from blueink.subclients.template import TemplateSubClient
|
|
14
|
+
from blueink.subclients.verify import VerifySubClient
|
|
14
15
|
from blueink.subclients.webhook import WebhookSubClient
|
|
15
16
|
|
|
16
17
|
|
|
@@ -74,3 +75,4 @@ class Client:
|
|
|
74
75
|
self._base_url, self._request_helper
|
|
75
76
|
)
|
|
76
77
|
self.webhooks = WebhookSubClient(self._base_url, self._request_helper)
|
|
78
|
+
self.verify = VerifySubClient(self._base_url, self._request_helper)
|
|
@@ -94,6 +94,8 @@ EVENT_TYPE = Munch(
|
|
|
94
94
|
EVENT_BUNDLE_DOCS_READY="bundle_docs_ready",
|
|
95
95
|
EVENT_BUNDLE_ERROR="bundle_error",
|
|
96
96
|
EVENT_BUNDLE_CANCELLED="bundle_cancelled",
|
|
97
|
+
EVENT_BUNDLE_SIGNER_REASSIGNED="bundle_signer_reassigned",
|
|
97
98
|
EVENT_PACKET_VIEWED="packet_viewed",
|
|
98
99
|
EVENT_PACKET_COMPLETE="packet_complete",
|
|
100
|
+
EVENT_PACKET_DECLINED="packet_declined",
|
|
99
101
|
)
|
|
@@ -9,8 +9,12 @@ from string import Template
|
|
|
9
9
|
class BUNDLES:
|
|
10
10
|
CREATE = "/bundles/"
|
|
11
11
|
CREATE_FROM_ENVELOPE_TEMPLATE = "/bundles/create_from_envelope_template/"
|
|
12
|
+
CREATE_PREPARATION_SESSION = "/bundles/preparation_session/"
|
|
12
13
|
LIST = "/bundles/"
|
|
13
14
|
RETRIEVE = "/bundles/${bundle_id}/"
|
|
15
|
+
UPDATE = "/bundles/${bundle_id}/"
|
|
16
|
+
SEND = "/bundles/${bundle_id}/send/"
|
|
17
|
+
VALIDATE = "/bundles/${bundle_id}/validate/"
|
|
14
18
|
CANCEL = "/bundles/${bundle_id}/cancel/"
|
|
15
19
|
LIST_EVENTS = "/bundles/${bundle_id}/events/"
|
|
16
20
|
LIST_FILES = "/bundles/${bundle_id}/files/"
|
|
@@ -35,6 +39,8 @@ class PACKETS:
|
|
|
35
39
|
class TEMPLATES:
|
|
36
40
|
LIST = "/templates/"
|
|
37
41
|
RETRIEVE = "/templates/${template_id}/"
|
|
42
|
+
UPDATE = "/templates/${template_id}/"
|
|
43
|
+
CREATE_PREPARATION_SESSION = "/templates/preparation_session/"
|
|
38
44
|
|
|
39
45
|
|
|
40
46
|
class ENVELOPE_TEMPLATES:
|
|
@@ -42,6 +48,10 @@ class ENVELOPE_TEMPLATES:
|
|
|
42
48
|
RETRIEVE = "/envelope-templates/${envelope_template_id}/"
|
|
43
49
|
|
|
44
50
|
|
|
51
|
+
class VERIFY:
|
|
52
|
+
CREATE = "/verify/"
|
|
53
|
+
|
|
54
|
+
|
|
45
55
|
class WEBHOOKS:
|
|
46
56
|
CREATE = "/webhooks/"
|
|
47
57
|
LIST = "/webhooks/"
|