@particle-academy/youtube-js 0.1.0 → 0.2.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/CHANGELOG.md +35 -0
- package/README.md +49 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,40 @@ All notable changes to `@particle-academy/youtube-ui`,
|
|
|
4
4
|
`@particle-academy/youtube-js`, `particle-academy/youtube-php` and
|
|
5
5
|
`fancy-youtube`.
|
|
6
6
|
|
|
7
|
+
## [0.2.0] — 2026-08-24
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **The README now says how to SET THIS CONNECTOR UP**, in the package itself.
|
|
12
|
+
|
|
13
|
+
Until now it explained what the four packages are, what they cost and why the
|
|
14
|
+
repo is generated — and said nothing about credentials, scopes, sandboxes or
|
|
15
|
+
operations. Somebody who installed it could not learn from it which credentials
|
|
16
|
+
a connection needs, where a human GETS them, which scopes to request, or what
|
|
17
|
+
the connector can actually do. All of that was already in the definition; the
|
|
18
|
+
one document a consumer reads was the one that omitted everything actionable.
|
|
19
|
+
|
|
20
|
+
The new **Setting it up** section carries:
|
|
21
|
+
|
|
22
|
+
- every credential, with the text saying where the value comes from, whether it
|
|
23
|
+
is **per installation** or **per connected account**, and whether it is secret;
|
|
24
|
+
- the OAuth authorize and token URLs and the exact scopes, verbatim;
|
|
25
|
+
- the access-token lifetime, and where refresh tokens ROTATE, the two things a
|
|
26
|
+
host must not do — retry a failed refresh, or refresh concurrently — because a
|
|
27
|
+
replay revokes the entire grant and nothing in the failure says why;
|
|
28
|
+
- the estate in this provider's own terms, including the cases where a
|
|
29
|
+
successful-looking run reaches nobody, or reaches the real one;
|
|
30
|
+
- every action and trigger with its method, path, inputs, and whether it is safe
|
|
31
|
+
to replay;
|
|
32
|
+
- a trigger's provider-side setup, which nobody can derive from anything else.
|
|
33
|
+
|
|
34
|
+
It is **generated from `provider/manifest.json`**, so it cannot drift from what
|
|
35
|
+
the packages do — which is the point at a few hundred providers, where a
|
|
36
|
+
hand-written setup section is a few hundred documents going quietly stale.
|
|
37
|
+
|
|
38
|
+
No code changed. This release exists because a registry and an installing agent
|
|
39
|
+
read the PUBLISHED artifact, and the artifact carried the old README.
|
|
40
|
+
|
|
7
41
|
## [0.1.0] — 2026-08-23
|
|
8
42
|
|
|
9
43
|
First release.
|
|
@@ -27,3 +61,4 @@ accepts for modifying playlist contents. YouTube has no test estate, and
|
|
|
27
61
|
`playlistItems.insert` has no idempotency key; a retry can add the video twice.
|
|
28
62
|
|
|
29
63
|
[0.1.0]: https://github.com/Fancy-Friends/youtube/releases/tag/v0.1.0
|
|
64
|
+
[0.2.0]: https://github.com/Fancy-Friends/youtube/releases/tag/v0.2.0
|
package/README.md
CHANGED
|
@@ -27,6 +27,55 @@ dependencies.
|
|
|
27
27
|
subject to the kit's full approval bar, and one per provider is hundreds of
|
|
28
28
|
dependencies nobody is tracking.
|
|
29
29
|
|
|
30
|
+
## Setting it up
|
|
31
|
+
|
|
32
|
+
Everything below is generated from `provider/manifest.json`, so it cannot disagree with what the packages do.
|
|
33
|
+
|
|
34
|
+
### Credentials
|
|
35
|
+
|
|
36
|
+
A YouTube connection holds 4 values.
|
|
37
|
+
|
|
38
|
+
**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.
|
|
39
|
+
|
|
40
|
+
| Field | Scope | Secret | Where it comes from |
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
| **OAuth client ID** | per installation | not secret | From Google Cloud Console. One value for the whole installation. |
|
|
43
|
+
| **OAuth client secret** | per installation | **secret** | The client secret for the same OAuth app. |
|
|
44
|
+
| **Access token** | per connected account | **secret** | Per connected YouTube account; expires after one hour. |
|
|
45
|
+
| **Refresh token** | per connected account | **secret** | Per connected YouTube account; the host uses it to refresh the access token. |
|
|
46
|
+
|
|
47
|
+
### Authorising
|
|
48
|
+
|
|
49
|
+
YouTube 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.
|
|
50
|
+
|
|
51
|
+
- **Authorize URL** — https://accounts.google.com/o/oauth2/v2/auth
|
|
52
|
+
- **Token URL** — https://oauth2.googleapis.com/token
|
|
53
|
+
- **Scopes** — `https://www.googleapis.com/auth/youtube.force-ssl`
|
|
54
|
+
- **Access token lifetime** — 3600 seconds (1 hours). A host that never refreshes works all afternoon and is broken by morning.
|
|
55
|
+
|
|
56
|
+
The refresh tokens do **not** rotate: the same one is reusable, so a refresh may safely be retried and may run concurrently. Stated rather than assumed, because the opposite — a provider that spends the token and revokes the grant on a replay — looks identical until it happens.
|
|
57
|
+
|
|
58
|
+
### The estate
|
|
59
|
+
|
|
60
|
+
**YouTube has no test estate, and somebody checked.** Everything this connector does is real. Use the faker to build against it.
|
|
61
|
+
|
|
62
|
+
> YouTube has no sandbox. Every live-mode add changes a real playlist; use the faker during development and remove live test items afterward.
|
|
63
|
+
|
|
64
|
+
## What it can do
|
|
65
|
+
|
|
66
|
+
### Actions
|
|
67
|
+
|
|
68
|
+
#### `playlist_item_insert` — YouTube playlist item
|
|
69
|
+
|
|
70
|
+
Add a video to a YouTube playlist.
|
|
71
|
+
|
|
72
|
+
`POST /youtube/v3/playlistItems` · **unsafe to replay** — a retried durable run does it TWICE
|
|
73
|
+
|
|
74
|
+
| Input | Required | What it is |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `playlistId` | yes | The YouTube id of the playlist to add the video to. |
|
|
77
|
+
| `videoId` | yes | The YouTube id of the video to add. |
|
|
78
|
+
|
|
30
79
|
## Run it before you have credentials
|
|
31
80
|
|
|
32
81
|
Every operation ships a **faker**, whether or not YouTube has a sandbox. Set a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-academy/youtube-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "YouTube for Node — the service descriptor, its faker, its webhook verification, and one function per operation. Plain HTTP on @particle-academy/fancy-connector-core; no vendor SDK.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@particle-academy/fancy-flow": ">=0.47.1 <2.0",
|
|
55
|
-
"@particle-academy/youtube-ui": "0.
|
|
55
|
+
"@particle-academy/youtube-ui": "0.2.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
58
58
|
"@particle-academy/fancy-flow": {
|