@particle-academy/youtube-js 0.2.4 → 0.4.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 CHANGED
@@ -4,6 +4,52 @@ 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.4.0] — 2026-11-08
8
+
9
+ ### Added
10
+
11
+ - **One Google consent grant, shared by every Google connector** (`oauth.grant:
12
+ "google"`), for an org-level Google connection: one OAuth client, one consent
13
+ and one refresh token per person, with each feature's scopes asked for when it
14
+ is first used. Declared in the manifest, the `-ui` package's OAuth constant,
15
+ the README and the registry index:
16
+ - `authorizeParams`: `access_type=offline` and `include_granted_scopes=true`.
17
+ A refresh token comes back only on the FIRST code exchange, so keep the stored
18
+ one when an exchange returns none.
19
+ - `revoke`: POST `https://oauth2.googleapis.com/revoke` with `token`, and
20
+ `scope: "grant"`. **Revoking removes the person's WHOLE Google grant, every
21
+ Google connector**, so a per-feature disconnect stops using that feature's
22
+ scopes locally and only a full Google disconnect revokes.
23
+ - `identity`: identify the account by the id_token's `sub` (request `openid`;
24
+ issuer `https://accounts.google.com` or `accounts.google.com`; audience is
25
+ the `clientId`), never by email, which Google says is neither unique nor
26
+ permanent.
27
+ `restrictedScopes` is empty: none of this connector's scopes is restricted.
28
+
29
+ Nothing a request sends has changed; this is what a host needs to run the
30
+ connection.
31
+
32
+ ## [0.3.0] — 2026-11-08
33
+
34
+ ### Added
35
+
36
+ - **Laravel integration, in this package** (`src/Laravel/`), auto-discovered
37
+ through composer's `extra.laravel`. Laravel is SUGGESTED, never required:
38
+ outside a Laravel app none of it loads.
39
+ - a service provider that merges `config/youtube.php` under
40
+ `connectors.youtube` (credentials from the environment, or per call for a
41
+ multi-account app);
42
+ - the `Youtube` facade: `Youtube::call('<operation>', [...])` runs any action;
43
+ - `Youtube::fake()`, answered from the connector's faker, with
44
+ `assertSent` / `assertNotSent` / `assertNothingSent` / `assertSentCount`;
45
+ - its own Pest test of all of it against a booted Laravel app.
46
+
47
+ ### Changed
48
+
49
+ - **Tests: Pest `^5`**, and `laravel/framework` `^13` as a DEV-ONLY test
50
+ dependency (the framework this package integrates with; nothing ships in
51
+ `require`).
52
+
7
53
  ## [0.2.4] — 2026-09-12
8
54
 
9
55
  ### Changed
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # YouTube
2
2
 
3
+ [![Fancified](art/fancified.svg)](https://particle.academy)
4
+
3
5
  YouTube for [fancy-flow][flow] — as **four imported, versioned packages**, one
4
6
  per runtime. Not vendored source: a copy cannot be upgraded, and third-party APIs
5
7
  change.
@@ -53,6 +55,13 @@ YouTube uses OAuth2 (authorization_code). The package DECLARES the exchange; the
53
55
  - **Scopes** — `https://www.googleapis.com/auth/youtube.force-ssl`
54
56
  - **Access token lifetime** — 3600 seconds (1 hours). A host that never refreshes works all afternoon and is broken by morning.
55
57
 
58
+ **One consent grant, shared** (`grant: "google"`). Every connector declaring the same grant can run on ONE OAuth client, with one consent and one refresh token per person.
59
+
60
+ - **Authorize with** `access_type=offline`, `include_granted_scopes=true`. Ask for a feature's scopes when it is first used; the new token covers every scope granted before. A refresh token comes back only on the FIRST exchange, so keep the stored one when an exchange returns none.
61
+ - **Revoke** — POST https://oauth2.googleapis.com/revoke with `token`. **It removes the WHOLE grant**: every connector sharing it, not only this one. A per-feature disconnect stops using that feature's scopes locally; only a full disconnect revokes.
62
+ - **Identify the account by `sub`**: request `openid`, then verify the token response's id_token (issuer `https://accounts.google.com` or `accounts.google.com`, keys at https://www.googleapis.com/oauth2/v3/certs, audience = `clientId`). Never key a connection by email.
63
+ - **No restricted scopes** in this connector.
64
+
56
65
  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
66
 
58
67
  ### The estate
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-academy/youtube-js",
3
- "version": "0.2.4",
3
+ "version": "0.4.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",
@@ -38,6 +38,7 @@
38
38
  },
39
39
  "files": [
40
40
  "dist",
41
+ "art",
41
42
  "README.md",
42
43
  "CHANGELOG.md",
43
44
  "LICENSE"
@@ -53,7 +54,7 @@
53
54
  },
54
55
  "peerDependencies": {
55
56
  "@particle-academy/fancy-flow": ">=0.47.1 <2.0",
56
- "@particle-academy/youtube-ui": ">=0.2.0 <0.3.0"
57
+ "@particle-academy/youtube-ui": ">=0.4.0 <0.5.0"
57
58
  },
58
59
  "peerDependenciesMeta": {
59
60
  "@particle-academy/fancy-flow": {