fancy-zoom 0.1.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.
- fancy_zoom-0.1.0/.gitignore +24 -0
- fancy_zoom-0.1.0/CHANGELOG.md +23 -0
- fancy_zoom-0.1.0/LICENSE +21 -0
- fancy_zoom-0.1.0/PKG-INFO +140 -0
- fancy_zoom-0.1.0/README.md +118 -0
- fancy_zoom-0.1.0/art/fancified.svg +26 -0
- fancy_zoom-0.1.0/pyproject.toml +87 -0
- fancy_zoom-0.1.0/src/fancy_zoom/__init__.py +39 -0
- fancy_zoom-0.1.0/src/fancy_zoom/_fake.py +170 -0
- fancy_zoom-0.1.0/src/fancy_zoom/_runtime.py +524 -0
- fancy_zoom-0.1.0/src/fancy_zoom/actions/__init__.py +16 -0
- fancy_zoom-0.1.0/src/fancy_zoom/actions/meeting_get.py +78 -0
- fancy_zoom-0.1.0/src/fancy_zoom/actions/obf_token_create.py +73 -0
- fancy_zoom-0.1.0/src/fancy_zoom/faker.py +89 -0
- fancy_zoom-0.1.0/src/fancy_zoom/py.typed +0 -0
- fancy_zoom-0.1.0/src/fancy_zoom/service.py +71 -0
- fancy_zoom-0.1.0/tests/test_faker.py +66 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
dist/
|
|
3
|
+
vendor/
|
|
4
|
+
.venv/
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.egg-info/
|
|
7
|
+
.pytest_cache/
|
|
8
|
+
.ruff_cache/
|
|
9
|
+
.mypy_cache/
|
|
10
|
+
|
|
11
|
+
# Lockfiles are NOT source of a generated repo.
|
|
12
|
+
#
|
|
13
|
+
# The generator cannot emit one -- a lockfile is the result of a network
|
|
14
|
+
# resolve -- and "a provider repo must be generated and re-generatable" is the
|
|
15
|
+
# constraint the whole estate rests on. At a few hundred repos, a committed
|
|
16
|
+
# lockfile each is a few hundred files nothing can regenerate and a few hundred
|
|
17
|
+
# Dependabot surfaces.
|
|
18
|
+
#
|
|
19
|
+
# The trade is real and worth stating: CI resolves fresh on every run, so an
|
|
20
|
+
# upstream release inside the declared range can break a build with no change
|
|
21
|
+
# here. That is early warning rather than a surprise at publish time, and the
|
|
22
|
+
# ranges are deliberately narrow (>=X <2.0, never a caret on a 0.x).
|
|
23
|
+
composer.lock
|
|
24
|
+
package-lock.json
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog — Zoom
|
|
2
|
+
|
|
3
|
+
All four packages — `@particle-academy/zoom-ui`, `@particle-academy/zoom-js`,
|
|
4
|
+
`particle-academy/zoom-php` and `fancy-zoom` — are released together under one
|
|
5
|
+
version. They are generated from one `provider/` definition, so a change to it
|
|
6
|
+
changes all four, and separate version lines would only record which of the
|
|
7
|
+
four somebody remembered to bump.
|
|
8
|
+
|
|
9
|
+
**Write entries HERE**, in the weaver envelope at `providers/zoom/CHANGELOG.md`,
|
|
10
|
+
then regenerate. This file is the one thing in a release that cannot be derived
|
|
11
|
+
— somebody has to write what changed — but writing it in the provider repo
|
|
12
|
+
would be a hand-edit that `.weaver.json` flags and the next sync destroys.
|
|
13
|
+
|
|
14
|
+
## [0.1.0] — 2026-09-16
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`meeting_get`** — read a meeting's join link and settings (`GET /meetings/{meetingId}`, scope `meeting:read:meeting`).
|
|
19
|
+
- **`obf_token_create`** — mint the on-behalf-of token a Meeting SDK bot needs to join a meeting it did not create (`GET /users/me/token?type=onbehalf`, scope `user:read:token`), required since Zoom's own 2026-02-23 enforcement date. Meeting-scoped and single-use, so it is minted fresh before every join rather than cached.
|
|
20
|
+
- OAuth2 authorization-code, with `refreshTokenRotates: true` — Zoom issues a new refresh token on every refresh and treats reuse of an old one as an error, the same shape this vocabulary already refuses to retry or run concurrently.
|
|
21
|
+
- Sandbox is `unverified`: Zoom documents no test estate distinct from a real account, but nobody has confirmed there is truly nothing rather than simply not having found it.
|
|
22
|
+
|
|
23
|
+
Tynn #10 (MOIC U15) — the OAuth flow, both endpoints and the sandbox note were checked against Zoom's own docs, its developer forum and its migration blog on 2026-09-15; `meeting_get`'s field list is the long-stable v2 shape rather than a page transcription (Zoom's detail page did not render for review) and is flagged for a live spot-check before an account depends on it.
|
fancy_zoom-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Particle Academy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: fancy-zoom
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Zoom for Python — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP; no vendor SDK.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Fancy-Friends/zoom
|
|
6
|
+
Project-URL: Issues, https://github.com/Fancy-Friends/zoom/issues
|
|
7
|
+
Project-URL: Source, https://github.com/Fancy-Friends/zoom
|
|
8
|
+
Author: Particle Academy
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: api,connector,fancy-flow,messaging,particle-academy,zoom
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# Zoom
|
|
24
|
+
|
|
25
|
+
[](https://particle.academy)
|
|
26
|
+
|
|
27
|
+
Zoom for [fancy-flow][flow] — as **four imported, versioned packages**, one
|
|
28
|
+
per runtime. Not vendored source: a copy cannot be upgraded, and third-party APIs
|
|
29
|
+
change.
|
|
30
|
+
|
|
31
|
+
[flow]: https://github.com/Particle-Academy/fancy-flow
|
|
32
|
+
|
|
33
|
+
| Runtime | Package | Install |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| Authoring surface (every host) | `@particle-academy/zoom-ui` | `npm install @particle-academy/zoom-ui` |
|
|
36
|
+
| Node | `@particle-academy/zoom-js` | `npm install @particle-academy/zoom-js` |
|
|
37
|
+
| PHP 8.4+ | `particle-academy/zoom-php` | `composer require particle-academy/zoom-php` |
|
|
38
|
+
| Python 3.11+ | `fancy-zoom` | `pip install fancy-zoom` |
|
|
39
|
+
|
|
40
|
+
The `ui` package is the editor surface and is React on every host — a PHP or
|
|
41
|
+
Python project installs it *and* its own runtime package, and never the `js` one.
|
|
42
|
+
|
|
43
|
+
## What it costs you
|
|
44
|
+
|
|
45
|
+
One dependency: `@particle-academy/fancy-connector-core` (or
|
|
46
|
+
`particle-academy/fancy-connector-core` on Composer), which the `js` and `php`
|
|
47
|
+
packages pull in themselves. The Python package has **zero** runtime
|
|
48
|
+
dependencies.
|
|
49
|
+
|
|
50
|
+
**No Zoom SDK.** Plain HTTP, deliberately: a vendor SDK is third-party code
|
|
51
|
+
subject to the kit's full approval bar, and one per provider is hundreds of
|
|
52
|
+
dependencies nobody is tracking.
|
|
53
|
+
|
|
54
|
+
## Setting it up
|
|
55
|
+
|
|
56
|
+
Everything below is generated from `provider/manifest.json`, so it cannot disagree with what the packages do.
|
|
57
|
+
|
|
58
|
+
### Credentials
|
|
59
|
+
|
|
60
|
+
A Zoom connection holds 4 values.
|
|
61
|
+
|
|
62
|
+
**Two kinds of value, and mixing them up matters.** A `provider` credential is ONE value for the whole installation — an OAuth app's client secret serves every connected account. An `account` credential is one per connected account. A host that stores the second where it stores the first lets one account's credentials reach another's.
|
|
63
|
+
|
|
64
|
+
| Field | Scope | Secret | Where it comes from |
|
|
65
|
+
|---|---|---|---|
|
|
66
|
+
| **OAuth client ID** | per installation | not secret | From the Zoom app you registered at marketplace.zoom.us. One value for the whole installation -- the same app serves every connected Zoom account. |
|
|
67
|
+
| **OAuth client secret** | per installation | **secret** | From the same app. Used to exchange the code and to refresh; never sent with an API request. |
|
|
68
|
+
| **Access token** | per connected account | **secret** | Obtained by the host's OAuth exchange, PER CONNECTED ZOOM ACCOUNT. Expires after one hour -- a host that does not refresh will work for a while and then fail with no warning. |
|
|
69
|
+
| **Refresh token** | per connected account | **secret** | Also per account. A NEW one is issued on every refresh -- persist the replacement atomically, and never retry a refresh that may have already succeeded: replaying an old refresh token is Zoom's own reported failure mode for a rotating grant. |
|
|
70
|
+
|
|
71
|
+
### Authorising
|
|
72
|
+
|
|
73
|
+
Zoom uses OAuth2 (authorization_code). The package DECLARES the exchange; the HOST performs it — a consent screen needs a browser, a redirect URI and somewhere to persist the result, and all three belong to the host.
|
|
74
|
+
|
|
75
|
+
- **Authorize URL** — https://zoom.us/oauth/authorize
|
|
76
|
+
- **Token URL** — https://zoom.us/oauth/token
|
|
77
|
+
- **Scopes** — `meeting:read:meeting`, `user:read:token`
|
|
78
|
+
- **Access token lifetime** — 3600 seconds (1 hours). A host that never refreshes works all afternoon and is broken by morning.
|
|
79
|
+
|
|
80
|
+
**The refresh tokens ROTATE, and they are single use.** Every refresh returns a new one and spends the one submitted, so replaying a spent token revokes the ENTIRE grant — the user is signed out, with nothing in the failure that says why.
|
|
81
|
+
|
|
82
|
+
Two consequences, both of which a host gets wrong by default:
|
|
83
|
+
|
|
84
|
+
1. **Do not RETRY a failed refresh with the same token.** A response that arrived but was not persisted — a crash between the reply and the write — turns the reflexive retry into a replay.
|
|
85
|
+
2. **Do not refresh CONCURRENTLY.** Two workers refreshing at once means one of them replays.
|
|
86
|
+
|
|
87
|
+
Persist the returned token before using the access token it came with.
|
|
88
|
+
|
|
89
|
+
### The estate
|
|
90
|
+
|
|
91
|
+
**Nobody has checked whether Zoom has a test estate.** Treat every call as real.
|
|
92
|
+
|
|
93
|
+
> Zoom has no test estate distinct from a real account, as far as this review found (2026-09-15) -- but it is UNVERIFIED, not confirmed. Every call authorizes against the caller's own Zoom account and can read real meeting data. Use fake mode while building.
|
|
94
|
+
|
|
95
|
+
## What it can do
|
|
96
|
+
|
|
97
|
+
### Actions
|
|
98
|
+
|
|
99
|
+
#### `meeting_get` — Get meeting
|
|
100
|
+
|
|
101
|
+
Read a Zoom meeting's join details and settings.
|
|
102
|
+
|
|
103
|
+
`GET /meetings/{meetingId}` · reads only — safe to replay
|
|
104
|
+
|
|
105
|
+
| Input | Required | What it is |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| `meetingId` | yes | The meeting's numeric id, from its join URL or from Zoom's own meeting list. |
|
|
108
|
+
|
|
109
|
+
#### `obf_token_create` — Mint on-behalf-of token
|
|
110
|
+
|
|
111
|
+
Mint a short-lived token so a bot can join a Zoom meeting on the authorising user's behalf.
|
|
112
|
+
|
|
113
|
+
`GET /users/me/token` · **unsafe to replay** — a retried durable run does it TWICE
|
|
114
|
+
|
|
115
|
+
| Input | Required | What it is |
|
|
116
|
+
|---|---|---|
|
|
117
|
+
| `meetingId` | yes | The meeting the bot is about to join. The minted token works for this meeting only. |
|
|
118
|
+
|
|
119
|
+
## Run it before you have credentials
|
|
120
|
+
|
|
121
|
+
Every operation ships a **faker**, whether or not Zoom has a sandbox. Set a
|
|
122
|
+
node's mode to `fake` and it returns the shape Zoom actually publishes — the
|
|
123
|
+
same field names, deterministically — so you can wire the downstream nodes before
|
|
124
|
+
touching an account, a key, or a network.
|
|
125
|
+
|
|
126
|
+
## This repository is generated
|
|
127
|
+
|
|
128
|
+
`provider/` is the source. Everything under `packages/` is emitted from it and
|
|
129
|
+
**must not be hand-edited** — CI regenerates and diffs on every push, and the
|
|
130
|
+
next protocol sync destroys anything it finds. See [`AGENTS.md`](AGENTS.md).
|
|
131
|
+
|
|
132
|
+
## Two namespaces, which do not match on purpose
|
|
133
|
+
|
|
134
|
+
The repo is `github.com/Fancy-Friends/zoom`; the packages publish under
|
|
135
|
+
`particle-academy`. Nothing derives one from the other — the names come from
|
|
136
|
+
weaver's `friends.json` and nowhere else.
|
|
137
|
+
|
|
138
|
+
## Licence
|
|
139
|
+
|
|
140
|
+
MIT.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Zoom
|
|
2
|
+
|
|
3
|
+
[](https://particle.academy)
|
|
4
|
+
|
|
5
|
+
Zoom for [fancy-flow][flow] — as **four imported, versioned packages**, one
|
|
6
|
+
per runtime. Not vendored source: a copy cannot be upgraded, and third-party APIs
|
|
7
|
+
change.
|
|
8
|
+
|
|
9
|
+
[flow]: https://github.com/Particle-Academy/fancy-flow
|
|
10
|
+
|
|
11
|
+
| Runtime | Package | Install |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| Authoring surface (every host) | `@particle-academy/zoom-ui` | `npm install @particle-academy/zoom-ui` |
|
|
14
|
+
| Node | `@particle-academy/zoom-js` | `npm install @particle-academy/zoom-js` |
|
|
15
|
+
| PHP 8.4+ | `particle-academy/zoom-php` | `composer require particle-academy/zoom-php` |
|
|
16
|
+
| Python 3.11+ | `fancy-zoom` | `pip install fancy-zoom` |
|
|
17
|
+
|
|
18
|
+
The `ui` package is the editor surface and is React on every host — a PHP or
|
|
19
|
+
Python project installs it *and* its own runtime package, and never the `js` one.
|
|
20
|
+
|
|
21
|
+
## What it costs you
|
|
22
|
+
|
|
23
|
+
One dependency: `@particle-academy/fancy-connector-core` (or
|
|
24
|
+
`particle-academy/fancy-connector-core` on Composer), which the `js` and `php`
|
|
25
|
+
packages pull in themselves. The Python package has **zero** runtime
|
|
26
|
+
dependencies.
|
|
27
|
+
|
|
28
|
+
**No Zoom SDK.** Plain HTTP, deliberately: a vendor SDK is third-party code
|
|
29
|
+
subject to the kit's full approval bar, and one per provider is hundreds of
|
|
30
|
+
dependencies nobody is tracking.
|
|
31
|
+
|
|
32
|
+
## Setting it up
|
|
33
|
+
|
|
34
|
+
Everything below is generated from `provider/manifest.json`, so it cannot disagree with what the packages do.
|
|
35
|
+
|
|
36
|
+
### Credentials
|
|
37
|
+
|
|
38
|
+
A Zoom connection holds 4 values.
|
|
39
|
+
|
|
40
|
+
**Two kinds of value, and mixing them up matters.** A `provider` credential is ONE value for the whole installation — an OAuth app's client secret serves every connected account. An `account` credential is one per connected account. A host that stores the second where it stores the first lets one account's credentials reach another's.
|
|
41
|
+
|
|
42
|
+
| Field | Scope | Secret | Where it comes from |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
| **OAuth client ID** | per installation | not secret | From the Zoom app you registered at marketplace.zoom.us. One value for the whole installation -- the same app serves every connected Zoom account. |
|
|
45
|
+
| **OAuth client secret** | per installation | **secret** | From the same app. Used to exchange the code and to refresh; never sent with an API request. |
|
|
46
|
+
| **Access token** | per connected account | **secret** | Obtained by the host's OAuth exchange, PER CONNECTED ZOOM ACCOUNT. Expires after one hour -- a host that does not refresh will work for a while and then fail with no warning. |
|
|
47
|
+
| **Refresh token** | per connected account | **secret** | Also per account. A NEW one is issued on every refresh -- persist the replacement atomically, and never retry a refresh that may have already succeeded: replaying an old refresh token is Zoom's own reported failure mode for a rotating grant. |
|
|
48
|
+
|
|
49
|
+
### Authorising
|
|
50
|
+
|
|
51
|
+
Zoom uses OAuth2 (authorization_code). The package DECLARES the exchange; the HOST performs it — a consent screen needs a browser, a redirect URI and somewhere to persist the result, and all three belong to the host.
|
|
52
|
+
|
|
53
|
+
- **Authorize URL** — https://zoom.us/oauth/authorize
|
|
54
|
+
- **Token URL** — https://zoom.us/oauth/token
|
|
55
|
+
- **Scopes** — `meeting:read:meeting`, `user:read:token`
|
|
56
|
+
- **Access token lifetime** — 3600 seconds (1 hours). A host that never refreshes works all afternoon and is broken by morning.
|
|
57
|
+
|
|
58
|
+
**The refresh tokens ROTATE, and they are single use.** Every refresh returns a new one and spends the one submitted, so replaying a spent token revokes the ENTIRE grant — the user is signed out, with nothing in the failure that says why.
|
|
59
|
+
|
|
60
|
+
Two consequences, both of which a host gets wrong by default:
|
|
61
|
+
|
|
62
|
+
1. **Do not RETRY a failed refresh with the same token.** A response that arrived but was not persisted — a crash between the reply and the write — turns the reflexive retry into a replay.
|
|
63
|
+
2. **Do not refresh CONCURRENTLY.** Two workers refreshing at once means one of them replays.
|
|
64
|
+
|
|
65
|
+
Persist the returned token before using the access token it came with.
|
|
66
|
+
|
|
67
|
+
### The estate
|
|
68
|
+
|
|
69
|
+
**Nobody has checked whether Zoom has a test estate.** Treat every call as real.
|
|
70
|
+
|
|
71
|
+
> Zoom has no test estate distinct from a real account, as far as this review found (2026-09-15) -- but it is UNVERIFIED, not confirmed. Every call authorizes against the caller's own Zoom account and can read real meeting data. Use fake mode while building.
|
|
72
|
+
|
|
73
|
+
## What it can do
|
|
74
|
+
|
|
75
|
+
### Actions
|
|
76
|
+
|
|
77
|
+
#### `meeting_get` — Get meeting
|
|
78
|
+
|
|
79
|
+
Read a Zoom meeting's join details and settings.
|
|
80
|
+
|
|
81
|
+
`GET /meetings/{meetingId}` · reads only — safe to replay
|
|
82
|
+
|
|
83
|
+
| Input | Required | What it is |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `meetingId` | yes | The meeting's numeric id, from its join URL or from Zoom's own meeting list. |
|
|
86
|
+
|
|
87
|
+
#### `obf_token_create` — Mint on-behalf-of token
|
|
88
|
+
|
|
89
|
+
Mint a short-lived token so a bot can join a Zoom meeting on the authorising user's behalf.
|
|
90
|
+
|
|
91
|
+
`GET /users/me/token` · **unsafe to replay** — a retried durable run does it TWICE
|
|
92
|
+
|
|
93
|
+
| Input | Required | What it is |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| `meetingId` | yes | The meeting the bot is about to join. The minted token works for this meeting only. |
|
|
96
|
+
|
|
97
|
+
## Run it before you have credentials
|
|
98
|
+
|
|
99
|
+
Every operation ships a **faker**, whether or not Zoom has a sandbox. Set a
|
|
100
|
+
node's mode to `fake` and it returns the shape Zoom actually publishes — the
|
|
101
|
+
same field names, deterministically — so you can wire the downstream nodes before
|
|
102
|
+
touching an account, a key, or a network.
|
|
103
|
+
|
|
104
|
+
## This repository is generated
|
|
105
|
+
|
|
106
|
+
`provider/` is the source. Everything under `packages/` is emitted from it and
|
|
107
|
+
**must not be hand-edited** — CI regenerates and diffs on every push, and the
|
|
108
|
+
next protocol sync destroys anything it finds. See [`AGENTS.md`](AGENTS.md).
|
|
109
|
+
|
|
110
|
+
## Two namespaces, which do not match on purpose
|
|
111
|
+
|
|
112
|
+
The repo is `github.com/Fancy-Friends/zoom`; the packages publish under
|
|
113
|
+
`particle-academy`. Nothing derives one from the other — the names come from
|
|
114
|
+
weaver's `friends.json` and nowhere else.
|
|
115
|
+
|
|
116
|
+
## Licence
|
|
117
|
+
|
|
118
|
+
MIT.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="28" role="img" aria-label="Fancified — built with Fancy UI">
|
|
2
|
+
<title>Fancified · built with Fancy UI</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="fcdBg" x1="0" y1="0" x2="1" y2="1">
|
|
5
|
+
<stop offset="0" stop-color="#6d28d9"/>
|
|
6
|
+
<stop offset=".5" stop-color="#9333ea"/>
|
|
7
|
+
<stop offset="1" stop-color="#d946ef"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="fcdGloss" x1="0" y1="0" x2="0" y2="1">
|
|
10
|
+
<stop offset="0" stop-color="#ffffff" stop-opacity=".30"/>
|
|
11
|
+
<stop offset=".55" stop-color="#ffffff" stop-opacity="0"/>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
<clipPath id="fcdClip"><rect width="128" height="28" rx="7"/></clipPath>
|
|
14
|
+
</defs>
|
|
15
|
+
<g clip-path="url(#fcdClip)">
|
|
16
|
+
<rect width="128" height="28" fill="url(#fcdBg)"/>
|
|
17
|
+
<rect width="34" height="28" fill="#3b0764" fill-opacity=".5"/>
|
|
18
|
+
<rect width="128" height="13" fill="url(#fcdGloss)"/>
|
|
19
|
+
<g fill="#fff">
|
|
20
|
+
<path transform="translate(17 14)" d="M0 -7 C.6 -2.2 2.2 -.6 7 0 C2.2 .6 .6 2.2 0 7 C-.6 2.2 -2.2 .6 -7 0 C-2.2 -.6 -.6 -2.2 0 -7 Z"/>
|
|
21
|
+
<path transform="translate(25.5 7.5) scale(.34)" fill-opacity=".85" d="M0 -7 C.6 -2.2 2.2 -.6 7 0 C2.2 .6 .6 2.2 0 7 C-.6 2.2 -2.2 .6 -7 0 C-2.2 -.6 -.6 -2.2 0 -7 Z"/>
|
|
22
|
+
</g>
|
|
23
|
+
<text x="81" y="18.5" fill="#ffffff" text-anchor="middle" font-family="'Segoe UI',Verdana,'DejaVu Sans',sans-serif" font-size="12" font-weight="700" letter-spacing=".3">Fancified</text>
|
|
24
|
+
</g>
|
|
25
|
+
<rect x=".5" y=".5" width="127" height="27" rx="6.5" fill="none" stroke="#ffffff" stroke-opacity=".22"/>
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.27"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "fancy-zoom"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Zoom for Python — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP; no vendor SDK."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
# 3.11 matches fancy-flow-py's floor: 3.10 reaches end of life on 2026-10-31,
|
|
11
|
+
# and a floor that dies before the package's second release is not a floor.
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
license = "MIT"
|
|
14
|
+
license-files = ["LICENSE"]
|
|
15
|
+
authors = [{ name = "Particle Academy" }]
|
|
16
|
+
keywords = ["zoom", "messaging", "connector", "api", "fancy-flow", "particle-academy"]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 3 - Alpha",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Software Development :: Libraries",
|
|
25
|
+
"Typing :: Typed",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
# ZERO runtime dependencies, and that is a design constraint rather than an
|
|
29
|
+
# accident. There is no Python twin of fancy-connector-core to depend on, and a
|
|
30
|
+
# vendor SDK is third-party code subject to the kit's full approval bar — one
|
|
31
|
+
# SDK per provider is hundreds of dependencies nobody is tracking. The HTTP is
|
|
32
|
+
# stdlib `urllib`; the HMAC is stdlib `hmac`.
|
|
33
|
+
dependencies = []
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/Fancy-Friends/zoom"
|
|
37
|
+
Issues = "https://github.com/Fancy-Friends/zoom/issues"
|
|
38
|
+
Source = "https://github.com/Fancy-Friends/zoom"
|
|
39
|
+
|
|
40
|
+
[dependency-groups]
|
|
41
|
+
# Not optional. A package with no way to run its tests reports green by doing
|
|
42
|
+
# nothing, which is the one defect that hides itself.
|
|
43
|
+
test = ["pytest>=8.0"]
|
|
44
|
+
lint = ["ruff>=0.16"]
|
|
45
|
+
typecheck = ["mypy>=1.11"]
|
|
46
|
+
dev = [{ include-group = "test" }, { include-group = "lint" }, { include-group = "typecheck" }]
|
|
47
|
+
|
|
48
|
+
[tool.hatch.build.targets.wheel]
|
|
49
|
+
packages = ["src/fancy_zoom"]
|
|
50
|
+
|
|
51
|
+
[tool.hatch.build.targets.sdist]
|
|
52
|
+
include = ["/src", "/tests", "/art", "/README.md", "/CHANGELOG.md", "/LICENSE"]
|
|
53
|
+
|
|
54
|
+
[tool.pytest.ini_options]
|
|
55
|
+
testpaths = ["tests"]
|
|
56
|
+
# importlib mode pairs with src-layout: the working tree is never on sys.path,
|
|
57
|
+
# so the tests exercise the INSTALLED package. Under the default mode a missing
|
|
58
|
+
# py.typed or an unshipped file passes locally and breaks for every user.
|
|
59
|
+
addopts = "--import-mode=importlib -ra"
|
|
60
|
+
|
|
61
|
+
[tool.ruff]
|
|
62
|
+
line-length = 100
|
|
63
|
+
src = ["src", "tests"]
|
|
64
|
+
target-version = "py311"
|
|
65
|
+
|
|
66
|
+
[tool.ruff.lint]
|
|
67
|
+
# `S` — flake8-bandit — is ON, and it is the one addition worth arguing for: this
|
|
68
|
+
# package handles a credential, builds an HMAC, and opens a URL. Security lint
|
|
69
|
+
# belongs on exactly this code.
|
|
70
|
+
#
|
|
71
|
+
# It also makes the two `# noqa: S310` in _runtime.py MEANINGFUL. Without `S`
|
|
72
|
+
# selected, ruff reports them as unused directives (RUF100) and the obvious fix
|
|
73
|
+
# is to delete them — which quietly removes a security annotation because a
|
|
74
|
+
# linter was not looking for it.
|
|
75
|
+
select = ["E", "F", "I", "UP", "B", "SIM", "RUF", "N", "C4", "PT", "S"]
|
|
76
|
+
|
|
77
|
+
[tool.ruff.lint.per-file-ignores]
|
|
78
|
+
# pytest's whole idiom is bare `assert`. S101 would fail every test file.
|
|
79
|
+
"tests/*" = ["S101"]
|
|
80
|
+
|
|
81
|
+
[tool.mypy]
|
|
82
|
+
python_version = "3.11"
|
|
83
|
+
packages = ["fancy_zoom"]
|
|
84
|
+
mypy_path = "src"
|
|
85
|
+
strict = true
|
|
86
|
+
disallow_any_expr = false
|
|
87
|
+
disallow_any_explicit = false
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# GENERATED FILE — do not edit.
|
|
2
|
+
#
|
|
3
|
+
# Emitted from provider/manifest.json by weaver's generator.
|
|
4
|
+
# A hand-edit here is destroyed by the next protocol sync, which is worse than
|
|
5
|
+
# being rejected, because it works until it silently does not. Fix
|
|
6
|
+
# provider/manifest.json (or weaver's template/) and regenerate:
|
|
7
|
+
#
|
|
8
|
+
# npm run provider -- zoom
|
|
9
|
+
|
|
10
|
+
"""Zoom for Python.
|
|
11
|
+
|
|
12
|
+
The service descriptor, its faker, its delivery contract, and one function
|
|
13
|
+
per operation — plain HTTP on the stdlib, no vendor SDK and no runtime
|
|
14
|
+
dependency.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
from ._fake import FakeValues
|
|
20
|
+
from .actions.meeting_get import meeting_get
|
|
21
|
+
from .actions.obf_token_create import obf_token_create
|
|
22
|
+
from .faker import respond
|
|
23
|
+
from .service import BASE_URLS, CONNECTOR_API_VERSION, REQUIRES, SANDBOX, SERVICE, TITLE, descriptor
|
|
24
|
+
|
|
25
|
+
__version__ = "0.1.0"
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"BASE_URLS",
|
|
29
|
+
"CONNECTOR_API_VERSION",
|
|
30
|
+
"REQUIRES",
|
|
31
|
+
"SANDBOX",
|
|
32
|
+
"SERVICE",
|
|
33
|
+
"TITLE",
|
|
34
|
+
"FakeValues",
|
|
35
|
+
"descriptor",
|
|
36
|
+
"meeting_get",
|
|
37
|
+
"obf_token_create",
|
|
38
|
+
"respond",
|
|
39
|
+
]
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# GENERATED FILE — do not edit.
|
|
2
|
+
#
|
|
3
|
+
# Emitted from provider/manifest.json (via weaver's
|
|
4
|
+
# template/embed/py/_fake.py) by weaver's generator.
|
|
5
|
+
# A hand-edit here is destroyed by the next protocol sync, which is worse than
|
|
6
|
+
# being rejected, because it works until it silently does not. Fix
|
|
7
|
+
# provider/manifest.json (via weaver's template/embed/py/_fake.py) (or
|
|
8
|
+
# weaver's template/) and regenerate:
|
|
9
|
+
#
|
|
10
|
+
# npm run provider -- zoom
|
|
11
|
+
|
|
12
|
+
"""Deterministic faker values — bit-for-bit with TypeScript and PHP.
|
|
13
|
+
|
|
14
|
+
PROVENANCE — read before editing.
|
|
15
|
+
|
|
16
|
+
This is the SINGLE SOURCE for the Python faker helpers. It exists because
|
|
17
|
+
``fancy-connector-core`` has a TypeScript implementation and a PHP twin and
|
|
18
|
+
**no Python twin at all**, so a generated ``fancy-<provider>`` package has no
|
|
19
|
+
shared runtime to import. Every generated package carries a copy emitted from
|
|
20
|
+
this file, and ``new-provider.mjs --check`` fails CI when a copy differs.
|
|
21
|
+
|
|
22
|
+
The permanent fix is a Python ``fancy-connector-core``. When it exists, this
|
|
23
|
+
file becomes a re-export and every provider picks it up on the next protocol
|
|
24
|
+
sync.
|
|
25
|
+
|
|
26
|
+
## Bit-for-bit identical is the whole point
|
|
27
|
+
|
|
28
|
+
Not "similar": the same FNV-1a seed and the same xorshift32 sequence, so a
|
|
29
|
+
golden fixture asserts the exact faked payload and ALL THREE runtimes have to
|
|
30
|
+
produce it. That turns the faker into a parity test rather than a convenience —
|
|
31
|
+
which matters, because cross-runtime drift does not fail loudly. It completes,
|
|
32
|
+
down one path, with no error.
|
|
33
|
+
|
|
34
|
+
Python integers are unbounded, so every 32-bit operation is masked back into
|
|
35
|
+
range. Dropping one of those masks does not break anything visibly; it just
|
|
36
|
+
makes the runtimes diverge after a few hundred calls, which is the worst
|
|
37
|
+
possible way for this to fail.
|
|
38
|
+
|
|
39
|
+
## Deterministic, and obviously fake
|
|
40
|
+
|
|
41
|
+
Same inputs, same output — always. A faker returning a fresh uuid every call
|
|
42
|
+
cannot be asserted on, so its fixtures degrade to "it did not throw", which is
|
|
43
|
+
the assertion that catches nothing. And the values are obviously synthetic ON
|
|
44
|
+
PURPOSE — ``fake_``-prefixed ids, ``example.test`` hosts, round numbers. Nobody
|
|
45
|
+
should ever look at a faked result and wonder whether it moved real money.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
from __future__ import annotations
|
|
49
|
+
|
|
50
|
+
import json
|
|
51
|
+
from datetime import UTC, datetime, timedelta
|
|
52
|
+
from typing import Any
|
|
53
|
+
|
|
54
|
+
MASK = 0xFFFFFFFF
|
|
55
|
+
|
|
56
|
+
# `FakeValues.int` is part of the cross-runtime faker API — `fake.int(min, max)`
|
|
57
|
+
# in TypeScript, PHP and here — so the method keeps that name. Inside the class
|
|
58
|
+
# body it then shadows the builtin, and every LATER annotation reading `int`
|
|
59
|
+
# resolves to the method instead of the type. This alias is what the annotations
|
|
60
|
+
# after it use.
|
|
61
|
+
_Int = int
|
|
62
|
+
|
|
63
|
+
#: The instant every faker counts from. A constant rather than the clock,
|
|
64
|
+
#: because a fixture asserting on ``created`` must not start failing tomorrow.
|
|
65
|
+
FAKE_EPOCH = "2026-01-01T00:00:00.000Z"
|
|
66
|
+
|
|
67
|
+
_FNV_OFFSET = 0x811C9DC5
|
|
68
|
+
_FNV_PRIME = 0x01000193
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _stable_json(value: Any) -> str:
|
|
72
|
+
"""Render a value the way ``JSON.stringify`` would, with sorted object keys.
|
|
73
|
+
|
|
74
|
+
Key order must not change a seed. ``json.dumps`` preserves insertion order,
|
|
75
|
+
so ``{a, b}`` and ``{b, a}`` would hash differently and "same inputs, same
|
|
76
|
+
output" would hold only for dicts that happened to be built in the same
|
|
77
|
+
order — the kind of almost-true that survives review and fails in a fixture
|
|
78
|
+
months later.
|
|
79
|
+
"""
|
|
80
|
+
if isinstance(value, dict):
|
|
81
|
+
parts = [
|
|
82
|
+
f"{json.dumps(str(key))}:{_stable_json(item)}"
|
|
83
|
+
for key, item in sorted(value.items(), key=lambda pair: str(pair[0]))
|
|
84
|
+
if item is not ...
|
|
85
|
+
]
|
|
86
|
+
return "{" + ",".join(parts) + "}"
|
|
87
|
+
|
|
88
|
+
if isinstance(value, (list, tuple)):
|
|
89
|
+
return "[" + ",".join(_stable_json(item) for item in value) + "]"
|
|
90
|
+
|
|
91
|
+
# `separators` matters: JavaScript emits no spaces, and a space here would
|
|
92
|
+
# change every seed.
|
|
93
|
+
return json.dumps(value, separators=(",", ":"), ensure_ascii=False)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def seed_from(*parts: Any) -> int:
|
|
97
|
+
"""FNV-1a over the stable rendering of the parts. Twin of ``seedFrom``."""
|
|
98
|
+
text = "|".join(part if isinstance(part, str) else _stable_json(part) for part in parts)
|
|
99
|
+
|
|
100
|
+
hash_ = _FNV_OFFSET
|
|
101
|
+
# JavaScript hashes UTF-16 code units, so a character outside the BMP
|
|
102
|
+
# contributes two of them. Encoding to UTF-16-LE and reading pairs is what
|
|
103
|
+
# keeps a provider name with an emoji in it seeding identically.
|
|
104
|
+
for unit in _utf16_units(text):
|
|
105
|
+
hash_ ^= unit
|
|
106
|
+
hash_ = (hash_ * _FNV_PRIME) & MASK
|
|
107
|
+
|
|
108
|
+
return hash_
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _utf16_units(text: str) -> list[int]:
|
|
112
|
+
raw = text.encode("utf-16-le")
|
|
113
|
+
|
|
114
|
+
return [raw[i] | (raw[i + 1] << 8) for i in range(0, len(raw), 2)]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def seed_for_call(service: str, operation: str, config: dict[str, Any] | None) -> int:
|
|
118
|
+
"""The seed for one faked call: service, operation, and the caller's config."""
|
|
119
|
+
return seed_from(service, operation, config or {})
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class FakeValues:
|
|
123
|
+
"""Deterministic value helpers handed to a faker.
|
|
124
|
+
|
|
125
|
+
Small on purpose. A faker's job is to return the SHAPE the provider returns
|
|
126
|
+
— the field names a downstream node will reference — not to simulate the
|
|
127
|
+
provider's business logic.
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
def __init__(self, seed: int) -> None:
|
|
131
|
+
masked = seed & MASK
|
|
132
|
+
self._state = masked if masked != 0 else 0x9E3779B9
|
|
133
|
+
|
|
134
|
+
def _next(self) -> int:
|
|
135
|
+
"""xorshift32, matching the JS generator step for step."""
|
|
136
|
+
state = self._state
|
|
137
|
+
state ^= (state << 13) & MASK
|
|
138
|
+
state &= MASK
|
|
139
|
+
state ^= state >> 17
|
|
140
|
+
state ^= (state << 5) & MASK
|
|
141
|
+
state &= MASK
|
|
142
|
+
self._state = state
|
|
143
|
+
|
|
144
|
+
return state
|
|
145
|
+
|
|
146
|
+
def hex(self, length: _Int) -> str:
|
|
147
|
+
"""A stable lowercase hex string of ``length`` characters."""
|
|
148
|
+
out = ""
|
|
149
|
+
while len(out) < length:
|
|
150
|
+
out += format(self._next(), "08x")
|
|
151
|
+
|
|
152
|
+
return out[:length]
|
|
153
|
+
|
|
154
|
+
def id(self, prefix: str) -> str:
|
|
155
|
+
"""A stable id with the provider's usual prefix: ``id("ch")`` -> ``ch_fake_1a2b3c``."""
|
|
156
|
+
return f"{prefix}_fake_{self.hex(12)}"
|
|
157
|
+
|
|
158
|
+
def int(self, minimum: int, maximum: int) -> int:
|
|
159
|
+
"""A stable integer in ``[minimum, maximum]``."""
|
|
160
|
+
return minimum + (self._next() % max(1, maximum - minimum + 1))
|
|
161
|
+
|
|
162
|
+
def pick(self, options: list[Any]) -> Any:
|
|
163
|
+
"""Pick a stable element of a list."""
|
|
164
|
+
return options[self._next() % len(options)]
|
|
165
|
+
|
|
166
|
+
def timestamp(self, offset_seconds: _Int = 0) -> str:
|
|
167
|
+
"""A fixed ISO-8601 instant, offset by whole seconds. Never ``now()``."""
|
|
168
|
+
base = datetime(2026, 1, 1, tzinfo=UTC) + timedelta(seconds=offset_seconds)
|
|
169
|
+
|
|
170
|
+
return base.strftime("%Y-%m-%dT%H:%M:%S") + ".000Z"
|