workwire 0.5.0__tar.gz → 0.6.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.
- {workwire-0.5.0 → workwire-0.6.0}/CHANGELOG.md +7 -0
- {workwire-0.5.0 → workwire-0.6.0}/PKG-INFO +2 -2
- {workwire-0.5.0 → workwire-0.6.0}/README.md +1 -1
- {workwire-0.5.0 → workwire-0.6.0}/pyproject.toml +1 -1
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/_coverage.py +1 -1
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/_models.py +35 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/resources/partnerships.py +28 -10
- {workwire-0.5.0 → workwire-0.6.0}/.gitignore +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/LICENSE +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/SECURITY.md +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/__init__.py +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/_client.py +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/_version.py +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/errors.py +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/py.typed +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/resources/__init__.py +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/resources/jobs.py +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/resources/locations.py +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/resources/projects.py +0 -0
- {workwire-0.5.0 → workwire-0.6.0}/src/workwire/resources/wires.py +0 -0
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.0](https://github.com/workwire/workwire-python/compare/v0.5.0...v0.6.0) (2026-10-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **WOR-547:** backend v1.71.1's spec — partnerships name the counterparty, the wire list carries viewer_party_id ([#26](https://github.com/workwire/workwire-python/issues/26)) ([e5199ba](https://github.com/workwire/workwire-python/commit/e5199ba1e6c2bf95136815e475698fc0a93da02c))
|
|
9
|
+
|
|
3
10
|
## [0.5.0](https://github.com/workwire/workwire-python/compare/v0.4.0...v0.5.0) (2026-10-24)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: workwire
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Official Python SDK for the Workwire API
|
|
5
5
|
Project-URL: Homepage, https://github.com/workwire/workwire-python
|
|
6
6
|
Project-URL: Changelog, https://github.com/workwire/workwire-python/blob/main/CHANGELOG.md
|
|
@@ -54,7 +54,7 @@ project = client.projects.create(name="Elm St. Townhomes")
|
|
|
54
54
|
|
|
55
55
|
# The partnership with your sub — create one (see below) or pick an
|
|
56
56
|
# established one from client.partnerships.list().
|
|
57
|
-
partnership = client.partnerships.create(
|
|
57
|
+
partnership = client.partnerships.create(org_id="...")
|
|
58
58
|
|
|
59
59
|
wire = client.wires.create(
|
|
60
60
|
project_id=project.id,
|
|
@@ -31,7 +31,7 @@ project = client.projects.create(name="Elm St. Townhomes")
|
|
|
31
31
|
|
|
32
32
|
# The partnership with your sub — create one (see below) or pick an
|
|
33
33
|
# established one from client.partnerships.list().
|
|
34
|
-
partnership = client.partnerships.create(
|
|
34
|
+
partnership = client.partnerships.create(org_id="...")
|
|
35
35
|
|
|
36
36
|
wire = client.wires.create(
|
|
37
37
|
project_id=project.id,
|
|
@@ -116,7 +116,7 @@ OPERATIONS: dict[str, dict[str, object]] = {
|
|
|
116
116
|
"createPartnership": {
|
|
117
117
|
"method": "POST",
|
|
118
118
|
"path": "/v1/partnerships",
|
|
119
|
-
"request_fields": {"sub_org_id", "cold_invite"},
|
|
119
|
+
"request_fields": {"org_id", "sub_org_id", "cold_invite"},
|
|
120
120
|
"query_params": set(),
|
|
121
121
|
"response_model": _models.Partnership,
|
|
122
122
|
},
|
|
@@ -266,21 +266,36 @@ class Wire(WorkwireObject):
|
|
|
266
266
|
|
|
267
267
|
|
|
268
268
|
class WireListItem(WorkwireObject):
|
|
269
|
+
"""One row of :meth:`Wires.list`. ``viewer_party_id`` is your org's one
|
|
270
|
+
party on the wire when your org is its sub — ``None`` when your org is
|
|
271
|
+
the wire's origin or holds more than one party on it."""
|
|
272
|
+
|
|
269
273
|
id: str
|
|
270
274
|
display_id: str
|
|
271
275
|
project_id: str
|
|
272
276
|
title: str
|
|
273
277
|
state: str
|
|
274
278
|
party_count: int
|
|
279
|
+
viewer_party_id: str | None
|
|
275
280
|
created_at: str
|
|
276
281
|
sent_at: str | None
|
|
277
282
|
closed_at: str | None
|
|
278
283
|
|
|
279
284
|
|
|
280
285
|
class Partnership(WorkwireObject):
|
|
286
|
+
"""A partnership as created, read from your org's side:
|
|
287
|
+
``counterparty_org_id`` is the other org and ``initiated_by_org_id`` is
|
|
288
|
+
the org that asked for the partnership — equal to ``counterparty_org_id``
|
|
289
|
+
when the other org asked, your org's id otherwise. ``gc_org_id`` and
|
|
290
|
+
``sub_org_id`` are deprecated — still served, replaced by
|
|
291
|
+
``counterparty_org_id`` and ``initiated_by_org_id``. ``invitation_id`` is
|
|
292
|
+
set on the cold-invite path only."""
|
|
293
|
+
|
|
281
294
|
id: str
|
|
282
295
|
gc_org_id: str
|
|
283
296
|
sub_org_id: str
|
|
297
|
+
counterparty_org_id: str
|
|
298
|
+
initiated_by_org_id: str
|
|
284
299
|
status: str
|
|
285
300
|
initiation_path: str
|
|
286
301
|
created_at: str
|
|
@@ -290,9 +305,21 @@ class Partnership(WorkwireObject):
|
|
|
290
305
|
|
|
291
306
|
|
|
292
307
|
class PartnershipDetail(WorkwireObject):
|
|
308
|
+
"""One partnership read from your org's side: ``counterparty_org_id`` and
|
|
309
|
+
``counterparty_name`` (``None`` while the other org has no name yet) are
|
|
310
|
+
the other org; ``initiated_by_org_id`` is the org that asked for the
|
|
311
|
+
partnership — equal to ``counterparty_org_id`` when the other org asked,
|
|
312
|
+
your org's id otherwise. Deprecated — still served: ``gc_org_id`` and
|
|
313
|
+
``sub_org_id`` (replaced by ``counterparty_org_id`` and
|
|
314
|
+
``initiated_by_org_id``), ``gc_org_name`` and ``sub_org_name`` (replaced
|
|
315
|
+
by ``counterparty_name``)."""
|
|
316
|
+
|
|
293
317
|
id: str
|
|
294
318
|
gc_org_id: str
|
|
295
319
|
sub_org_id: str
|
|
320
|
+
counterparty_org_id: str
|
|
321
|
+
counterparty_name: str | None
|
|
322
|
+
initiated_by_org_id: str
|
|
296
323
|
status: str
|
|
297
324
|
initiation_path: str
|
|
298
325
|
created_at: str
|
|
@@ -303,10 +330,18 @@ class PartnershipDetail(WorkwireObject):
|
|
|
303
330
|
|
|
304
331
|
|
|
305
332
|
class PartnershipListItem(WorkwireObject):
|
|
333
|
+
"""One row of :meth:`Partnerships.list`, read from your org's side:
|
|
334
|
+
``counterparty_org_id`` and ``counterparty_name`` are the other org;
|
|
335
|
+
``initiated_by_org_id`` is the org that asked for the partnership — equal
|
|
336
|
+
to ``counterparty_org_id`` when the other org asked, your org's id
|
|
337
|
+
otherwise. ``role`` is deprecated — still served, replaced by
|
|
338
|
+
``initiated_by_org_id``."""
|
|
339
|
+
|
|
306
340
|
id: str
|
|
307
341
|
role: str
|
|
308
342
|
counterparty_org_id: str
|
|
309
343
|
counterparty_name: str | None
|
|
344
|
+
initiated_by_org_id: str
|
|
310
345
|
status: str
|
|
311
346
|
initiation_path: str
|
|
312
347
|
created_at: str
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"""Partnerships — the GC↔sub relationship Wires require.
|
|
2
2
|
|
|
3
|
-
Create one against a known Workwire org (``
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Create one against a known Workwire org (``org_id=``; the deprecated
|
|
4
|
+
``sub_org_id=`` is still accepted in its place) or cold-invite a sub by email
|
|
5
|
+
(``cold_invite=ColdInvite(...)`` — the partnership, the invitation, and the
|
|
6
|
+
email are created atomically). Exactly one of them; the invitation email
|
|
7
|
+
greets the recipient **as your organization**.
|
|
8
|
+
|
|
9
|
+
A partnership reads from your organization's side: ``counterparty_org_id``
|
|
10
|
+
is the other organization and ``initiated_by_org_id`` is the organization
|
|
11
|
+
that asked for the partnership — equal to ``counterparty_org_id`` when the
|
|
12
|
+
other organization asked, yours otherwise.
|
|
7
13
|
"""
|
|
8
14
|
|
|
9
15
|
from __future__ import annotations
|
|
@@ -29,13 +35,20 @@ class Partnerships:
|
|
|
29
35
|
def create(
|
|
30
36
|
self,
|
|
31
37
|
*,
|
|
38
|
+
org_id: str | None = None,
|
|
32
39
|
sub_org_id: str | None = None,
|
|
33
40
|
cold_invite: ColdInvite | None = None,
|
|
34
41
|
idempotency_key: str | None = None,
|
|
35
42
|
timeout: float | None = None,
|
|
36
43
|
) -> Partnership:
|
|
37
44
|
"""Create a partnership. Requires ``partnerships:write``. Pass
|
|
38
|
-
exactly one of ``
|
|
45
|
+
exactly one of ``org_id`` (an organization already on Workwire) or
|
|
46
|
+
``cold_invite``. ``sub_org_id`` is deprecated — still accepted in
|
|
47
|
+
place of ``org_id`` and sent as ``sub_org_id``.
|
|
48
|
+
|
|
49
|
+
The partnership comes back read from your side:
|
|
50
|
+
``initiated_by_org_id`` is the organization that asked — yours, on a
|
|
51
|
+
create.
|
|
39
52
|
|
|
40
53
|
The cold-invite path **emails a real person**, counts against the
|
|
41
54
|
100/org/rolling-24h machine invitation quota (breach raises
|
|
@@ -43,10 +56,12 @@ class Partnerships:
|
|
|
43
56
|
``partnership_invites_per_org_per_day``), and returns the
|
|
44
57
|
partnership with ``invitation_id`` set.
|
|
45
58
|
"""
|
|
46
|
-
if (
|
|
47
|
-
raise ValueError("pass exactly one of sub_org_id or cold_invite")
|
|
59
|
+
if sum(arg is not None for arg in (org_id, sub_org_id, cold_invite)) != 1:
|
|
60
|
+
raise ValueError("pass exactly one of org_id, sub_org_id or cold_invite")
|
|
48
61
|
body: dict[str, Any]
|
|
49
|
-
if
|
|
62
|
+
if org_id is not None:
|
|
63
|
+
body = {"org_id": org_id}
|
|
64
|
+
elif sub_org_id is not None:
|
|
50
65
|
body = {"sub_org_id": sub_org_id}
|
|
51
66
|
else:
|
|
52
67
|
assert cold_invite is not None
|
|
@@ -65,8 +80,11 @@ class Partnerships:
|
|
|
65
80
|
def retrieve(
|
|
66
81
|
self, partnership_id: str, *, timeout: float | None = None
|
|
67
82
|
) -> PartnershipDetail:
|
|
68
|
-
"""Fetch one partnership your org is a side of,
|
|
69
|
-
|
|
83
|
+
"""Fetch one partnership your org is a side of, read from your
|
|
84
|
+
side: ``counterparty_org_id`` and ``counterparty_name`` are the other
|
|
85
|
+
organization, and ``initiated_by_org_id`` is the organization that
|
|
86
|
+
asked. The deprecated ``gc_org_id`` / ``sub_org_id`` and both org
|
|
87
|
+
names are still served. Requires ``partnerships:read``."""
|
|
70
88
|
data, request_id = self._client._request(
|
|
71
89
|
"GET", f"/v1/partnerships/{partnership_id}", timeout=timeout
|
|
72
90
|
)
|
|
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
|