@particle-academy/youtube-ui 0.2.0 → 0.2.2

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,55 @@ 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.2] — 2026-09-06
8
+
9
+ ### Changed
10
+
11
+ - **Published through npm Trusted Publishing, so these packages now carry PROVENANCE.**
12
+
13
+ Every earlier release went out under a scope-wide npm token. This one is
14
+ published by an OIDC exchange from the release workflow itself, and npm records
15
+ which workflow in which repository built it.
16
+ `npm view @particle-academy/youtube-ui@0.2.2` shows the attestation; releases before
17
+ this one have none.
18
+
19
+ What it buys a consumer: the tarball on the registry can be tied to a public
20
+ commit and a public workflow run, rather than to whoever held a token. What it
21
+ does not buy: nothing about the code changed, and the runtime behaviour of all
22
+ four packages is identical to 0.2.1.
23
+
24
+ - **`repository.directory` in the npm packages.**
25
+
26
+ `@particle-academy/youtube-ui` and `@particle-academy/youtube-js` live at
27
+ `packages/ui` and `packages/js` inside the provider repo. npm's `repository`
28
+ field now says so, which makes the "Repository" link on each package page point
29
+ at the package rather than at the repository root.
30
+
31
+ ## [0.2.1] — 2026-08-24
32
+
33
+ ### Fixed
34
+
35
+ - **`@particle-academy/youtube-js` now accepts a RANGE of `@particle-academy/youtube-ui`, not one exact version.**
36
+
37
+ It peer-depended on `@particle-academy/youtube-ui` at exactly the release it shipped with. That is the
38
+ strict form of the thing the kit's own rule forbids — a first-party sibling gets
39
+ a range — and the same block applied the rule correctly to its other two
40
+ dependencies. It was this one pair that slipped.
41
+
42
+ What it cost: ship `@particle-academy/youtube-ui` with a fixed help string and every consumer on the
43
+ previous `@particle-academy/youtube-js` had an **unmet peer**, which npm 7+ errors on. A documentation
44
+ patch could not be delivered without a matching runtime release, and a routine
45
+ `npm update` that moved the ui package alone broke the install.
46
+
47
+ The coupling is real and is not being loosened away. The ui package emits the
48
+ config schema and the js package implements against it, so a ui that adds a
49
+ field to a js that ignores it is silently wrong. But a PATCH is non-additive by
50
+ definition and a MINOR is where a field can appear — so `>=0.2.1 <0.3.0` is the
51
+ coupling that actually exists rather than the strictest one expressible.
52
+
53
+ Nothing else changed. `particle-academy/youtube-php` and `fancy-youtube` are unaffected; neither has an
54
+ equivalent edge.
55
+
7
56
  ## [0.2.0] — 2026-08-24
8
57
 
9
58
  ### Added
@@ -62,3 +111,4 @@ accepts for modifying playlist contents. YouTube has no test estate, and
62
111
 
63
112
  [0.1.0]: https://github.com/Fancy-Friends/youtube/releases/tag/v0.1.0
64
113
  [0.2.0]: https://github.com/Fancy-Friends/youtube/releases/tag/v0.2.0
114
+ [0.2.1]: https://github.com/Fancy-Friends/youtube/releases/tag/v0.2.1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/service.ts","../src/kinds/playlist-item-insert.ts","../src/index.ts"],"names":["defineConnectorKind","summarize"],"mappings":";;;;;AAgCO,IAAM,qBAAA,GAAwB;AAG9B,IAAM,eAAA,GAAkB;AAAA,EAC7B,OAAA,EAAS,SAAA;AAAA,EACT,YAAA,EAAc,SAAA;AAAA,EACd,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS;AACX;AAGO,IAAM,mBAAA,GAAsB;AAAA,EACjC;AAAA,IACE,KAAA,EAAO,UAAA;AAAA,IACP,OAAA,EAAS,iBAAA;AAAA,IACT,OAAA,EAAS,UAAA;AAAA,IACT,QAAA,EAAU,KAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA;AAAA,IACE,KAAA,EAAO,cAAA;AAAA,IACP,OAAA,EAAS,qBAAA;AAAA,IACT,OAAA,EAAS,UAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA;AAAA,IACE,KAAA,EAAO,aAAA;AAAA,IACP,OAAA,EAAS,cAA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,QAAA;AAAA,IACR,aAAA,EAAe;AAAA,GACjB;AAAA,EACA;AAAA,IACE,MAAA,EAAQ,uBAAA;AAAA,IACR,MAAA,EAAQ,QAAA;AAAA,IACR,aAAA,EAAe;AAAA;AAEnB;AAEO,IAAM,uBAAA,GAA8CA,+BAAoB,0BAAA,EAA4B;AAAA,EACzG,IAAA,EAAM,0BAAA;AAAA,EACN,OAAA,EAAS,CAAC,uBAAuB,CAAA;AAAA,EACjC,KAAA,EAAO,uBAAA;AAAA,EACP,WAAA,EAAa,oCAAA;AAAA,EACb,MAAA,EAAQ,CAAC,EAAE,EAAA,EAAI,MAAM,CAAA;AAAA,EACrB,OAAA,EAAS,CAAC,EAAE,EAAA,EAAI,OAAO,CAAA;AAAA,EACvB,WAAA,EAAa,kBAAA;AAAA,EACb,WAAA,EAAa,4BAAA;AAAA,EACb,YAAA,EAAc;AAAA,IACZ;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,YAAA;AAAA,MACP,OAAA,EAAS,aAAA;AAAA,MACT,UAAA,EAAY,IAAA;AAAA,MACZ,aAAA,EAAe;AAAA,KACjB;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,SAAA;AAAA,MACP,OAAA,EAAS,UAAA;AAAA,MACT,UAAA,EAAY,IAAA;AAAA,MACZ,aAAA,EAAe;AAAA;AACjB,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,CAAC,EAAE,MAAA,OACbC,oBAAA,CAAU,0BAAA,EAA4B,QAAmC,2BAA2B;AACxG,CAAC;;;ACpEM,IAAM,aAAA,GAAsC;AAAA,EACjD;AACF","file":"index.cjs","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube's identity on the authoring surface, shared by every YouTube node.\n *\n * This file must import nothing from the js package: a PHP or Python project\n * installs the ui package and never that one, and the import would be a\n * dangling module the moment it did.\n *\n * ## The sandbox trap\n *\n * YouTube has no sandbox. Every live-mode add changes a real playlist; use the\n * faker during development and remove live test items afterward.\n */\n\nimport type { ConnectorMeta } from \"@particle-academy/fancy-flow/connectors\";\n\n/**\n * The connector API version this package was GENERATED against.\n *\n * A literal, never imported — an imported constant lets an upgrade rewrite the\n * very claim it exists to detect.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\n/** The parts of a connector's identity that belong to the SERVICE, not the node. */\nexport const YOUTUBE_SERVICE = {\n service: \"youtube\",\n serviceTitle: \"YouTube\",\n domain: \"marketing\",\n sandbox: \"none\",\n} as const satisfies Pick<ConnectorMeta, \"service\" | \"serviceTitle\" | \"domain\" | \"sandbox\">;\n\n/** The credentials a YouTube connection holds. */\nexport const YOUTUBE_CREDENTIALS = [\n {\n \"key\": \"clientId\",\n \"label\": \"OAuth client ID\",\n \"scope\": \"provider\",\n \"secret\": false,\n \"help\": \"From Google Cloud Console. One value for the whole installation.\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"OAuth client secret\",\n \"scope\": \"provider\",\n \"secret\": true,\n \"help\": \"The client secret for the same OAuth app.\"\n },\n {\n \"key\": \"accessToken\",\n \"label\": \"Access token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected YouTube account; expires after one hour.\"\n },\n {\n \"key\": \"refreshToken\",\n \"label\": \"Refresh token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected YouTube account; the host uses it to refresh the access token.\"\n }\n] as const;\n\n/**\n * The OAuth2 exchange YouTube requires — DECLARED here, performed by the host.\n *\n * A consent screen needs a browser, a redirect URI and somewhere to persist\n * the result, and all three belong to the host; a package that ran the dance\n * itself would have to own a web server. So this says precisely enough for a\n * host to do it.\n *\n * The access token lasts 3600 seconds. A host that never refreshes will work\n * all afternoon and be broken by morning, which is why the lifetime is stated\n * rather than left to be discovered.\n *\n * Its refresh tokens do NOT rotate: the same one is reusable, so a refresh may\n * safely be retried and may run concurrently. That is stated rather than\n * assumed because the opposite — a provider that spends the token and revokes\n * the grant on a replay — looks identical until it happens.\n */\nexport const YOUTUBE_OAUTH = {\n \"flow\": \"authorization_code\",\n \"authorizeUrl\": \"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenUrl\": \"https://oauth2.googleapis.com/token\",\n \"scopes\": [\n \"https://www.googleapis.com/auth/youtube.force-ssl\"\n ],\n \"accessTokenCredential\": \"accessToken\",\n \"refreshTokenCredential\": \"refreshToken\",\n \"refreshTokenRotates\": false,\n \"accessTokenTtlSeconds\": 3600\n} as const;\n\n/** Build a YouTube node's connector metadata from the operation it performs. */\nexport function youtubeMeta(\n role: ConnectorMeta[\"role\"],\n operation: string,\n docs: string,\n): ConnectorMeta {\n return { ...YOUTUBE_SERVICE, role, operation, docs };\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/playlist-item-insert.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/playlist-item-insert.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube playlist item — Add a video to a YouTube playlist.\n *\n * https://developers.google.com/youtube/v3/docs/playlistItems/insert\n *\n * `unsafe-to-replay`.\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { youtubeMeta } from \"../service.js\";\n\nexport const YOUTUBE_PLAYLIST_ITEM_KIND = \"@particle-academy/youtube_playlist_item\";\nexport const YOUTUBE_PLAYLIST_ITEM_OPERATION = \"playlist_item_insert\";\n\nexport const YOUTUBE_PLAYLIST_ITEM_META = youtubeMeta(\"action\", \"add a video to a playlist\", \"https://developers.google.com/youtube/v3/docs/playlistItems/insert\");\n\n/**\n * What this node emits — the \"ingredients\" a downstream node can reference.\n *\n * fancy-flow reads `outputShape` off the kind and offers it in the variable\n * picker, so declaring it is the whole of the work: an author configuring the\n * next node picks `{{ $json.data.id }}` off a list instead of typing a path\n * and hoping.\n */\nexport const YOUTUBE_PLAYLIST_ITEM_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"YouTube's unique id for the new playlist item.\"\n },\n {\n \"path\": \"data.kind\",\n \"type\": \"string\",\n \"description\": \"The fixed resource kind `youtube#playlistItem`.\"\n },\n {\n \"path\": \"data.snippet.playlistId\",\n \"type\": \"string\",\n \"description\": \"The playlist containing the item.\"\n },\n {\n \"path\": \"data.snippet.resourceId.videoId\",\n \"type\": \"string\",\n \"description\": \"The video added to the playlist.\"\n },\n {\n \"path\": \"data.snippet.position\",\n \"type\": \"number\",\n \"description\": \"The item's zero-based position in the playlist.\"\n }\n];\n\nexport const youtubePlaylistItemKind: NodeKindDefinition = defineConnectorKind(YOUTUBE_PLAYLIST_ITEM_META, {\n name: YOUTUBE_PLAYLIST_ITEM_KIND,\n aliases: [\"youtube_playlist_item\"],\n label: \"YouTube playlist item\",\n description: \"Add a video to a YouTube playlist.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: YOUTUBE_PLAYLIST_ITEM_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"playlistId\",\n \"label\": \"Playlist ID\",\n \"required\": true,\n \"description\": \"The YouTube id of the playlist to add the video to.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"videoId\",\n \"label\": \"Video ID\",\n \"required\": true,\n \"description\": \"The YouTube id of the video to add.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(YOUTUBE_PLAYLIST_ITEM_META, config as Record<string, unknown>, \"add a video to a playlist\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube's node kinds for fancy-flow.\n *\n * Install this on every host. The TypeScript executors live in the js\n * package's `./flow` subpath; PHP and Python hosts run their own and need only\n * this.\n */\n\nexport * from \"./service.js\";\nexport * from \"./kinds/playlist-item-insert.js\";\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { youtubePlaylistItemKind } from \"./kinds/playlist-item-insert.js\";\n\n/** Every YouTube kind, for a host that registers the lot. */\nexport const YOUTUBE_KINDS: NodeKindDefinition[] = [\n youtubePlaylistItemKind,\n];\n"]}
1
+ {"version":3,"sources":["../src/service.ts","../src/kinds/playlist-item-insert.ts","../src/index.ts"],"names":["defineConnectorKind","summarize"],"mappings":";;;;;AAgCO,IAAM,qBAAA,GAAwB;AAG9B,IAAM,eAAA,GAAkB;AAAA,EAC7B,OAAA,EAAS,SAAA;AAAA,EACT,YAAA,EAAc,SAAA;AAAA,EACd,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS;AACX;AA+BO,IAAM,mBAAA,GAAsB;AAAA,EACjC;AAAA,IACE,KAAA,EAAO,UAAA;AAAA,IACP,OAAA,EAAS,iBAAA;AAAA,IACT,OAAA,EAAS,UAAA;AAAA,IACT,QAAA,EAAU,KAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA;AAAA,IACE,KAAA,EAAO,cAAA;AAAA,IACP,OAAA,EAAS,qBAAA;AAAA,IACT,OAAA,EAAS,UAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA;AAAA,IACE,KAAA,EAAO,aAAA;AAAA,IACP,OAAA,EAAS,cAAA;A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AA;AAAA,IACR,aAAA,EAAe;AAAA,GACjB;AAAA,EACA;AAAA,IACE,MAAA,EAAQ,uBAAA;AAAA,IACR,MAAA,EAAQ,QAAA;AAAA,IACR,aAAA,EAAe;AAAA;AAEnB;AAEO,IAAM,uBAAA,GAA8CA,+BAAoB,0BAAA,EAA4B;AAAA,EACzG,IAAA,EAAM,0BAAA;AAAA,EACN,OAAA,EAAS,CAAC,uBAAuB,CAAA;AAAA,EACjC,KAAA,EAAO,uBAAA;AAAA,EACP,WAAA,EAAa,oCAAA;AAAA,EACb,MAAA,EAAQ,CAAC,EAAE,EAAA,EAAI,MAAM,CAAA;AAAA,EACrB,OAAA,EAAS,CAAC,EAAE,EAAA,EAAI,OAAO,CAAA;AAAA,EACvB,WAAA,EAAa,kBAAA;AAAA,EACb,WAAA,EAAa,4BAAA;AAAA,EACb,YAAA,EAAc;AAAA,IACZ;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,YAAA;AAAA,MACP,OAAA,EAAS,aAAA;AAAA,MACT,UAAA,EAAY,IAAA;AAAA,MACZ,aAAA,EAAe;AAAA,KACjB;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,SAAA;AAAA,MACP,OAAA,EAAS,UAAA;AAAA,MACT,UAAA,EAAY,IAAA;AAAA,MACZ,aAAA,EAAe;AAAA;AACjB,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,CAAC,EAAE,MAAA,OACbC,oBAAA,CAAU,0BAAA,EAA4B,QAAmC,2BAA2B;AACxG,CAAC;;;ACpEM,IAAM,aAAA,GAAsC;AAAA,EACjD;AACF","file":"index.cjs","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube's identity on the authoring surface, shared by every YouTube node.\n *\n * This file must import nothing from the js package: a PHP or Python project\n * installs the ui package and never that one, and the import would be a\n * dangling module the moment it did.\n *\n * ## The sandbox trap\n *\n * YouTube has no sandbox. Every live-mode add changes a real playlist; use the\n * faker during development and remove live test items afterward.\n */\n\nimport type { ConnectorDomain, ConnectorMeta } from \"@particle-academy/fancy-flow/connectors\";\n\n/**\n * The connector API version this package was GENERATED against.\n *\n * A literal, never imported — an imported constant lets an upgrade rewrite the\n * very claim it exists to detect.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\n/** The parts of a connector's identity that belong to the SERVICE, not the node. */\nexport const YOUTUBE_SERVICE = {\n service: \"youtube\",\n serviceTitle: \"YouTube\",\n domain: \"marketing\",\n sandbox: \"none\",\n} as const satisfies Pick<ConnectorMeta, \"service\" | \"serviceTitle\" | \"domain\" | \"sandbox\">;\n\n/**\n * Every connector domain weaver knows, pinned against fancy-flow's union.\n *\n * A closed set copied into three codebases stays correct only while something\n * MAKES it: this line fails to compile the moment weaver carries a value\n * fancy-flow does not, including the values no provider uses yet.\n */\nconst WEAVER_DOMAINS: readonly ConnectorDomain[] = [\n \"payments\",\n \"commerce\",\n \"messaging\",\n \"email\",\n \"crm\",\n \"support\",\n \"storage\",\n \"calendar\",\n \"productivity\",\n \"database\",\n \"devtools\",\n \"analytics\",\n \"marketing\",\n \"ai\",\n \"forms\",\n \"hr\",\n \"geo\"\n];\nvoid WEAVER_DOMAINS;\n\n/** The credentials a YouTube connection holds. */\nexport const YOUTUBE_CREDENTIALS = [\n {\n \"key\": \"clientId\",\n \"label\": \"OAuth client ID\",\n \"scope\": \"provider\",\n \"secret\": false,\n \"help\": \"From Google Cloud Console. One value for the whole installation.\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"OAuth client secret\",\n \"scope\": \"provider\",\n \"secret\": true,\n \"help\": \"The client secret for the same OAuth app.\"\n },\n {\n \"key\": \"accessToken\",\n \"label\": \"Access token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected YouTube account; expires after one hour.\"\n },\n {\n \"key\": \"refreshToken\",\n \"label\": \"Refresh token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected YouTube account; the host uses it to refresh the access token.\"\n }\n] as const;\n\n/**\n * The OAuth2 exchange YouTube requires — DECLARED here, performed by the host.\n *\n * A consent screen needs a browser, a redirect URI and somewhere to persist\n * the result, and all three belong to the host; a package that ran the dance\n * itself would have to own a web server. So this says precisely enough for a\n * host to do it.\n *\n * The access token lasts 3600 seconds. A host that never refreshes will work\n * all afternoon and be broken by morning, which is why the lifetime is stated\n * rather than left to be discovered.\n *\n * Its refresh tokens do NOT rotate: the same one is reusable, so a refresh may\n * safely be retried and may run concurrently. That is stated rather than\n * assumed because the opposite — a provider that spends the token and revokes\n * the grant on a replay — looks identical until it happens.\n */\nexport const YOUTUBE_OAUTH = {\n \"flow\": \"authorization_code\",\n \"authorizeUrl\": \"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenUrl\": \"https://oauth2.googleapis.com/token\",\n \"scopes\": [\n \"https://www.googleapis.com/auth/youtube.force-ssl\"\n ],\n \"accessTokenCredential\": \"accessToken\",\n \"refreshTokenCredential\": \"refreshToken\",\n \"refreshTokenRotates\": false,\n \"accessTokenTtlSeconds\": 3600\n} as const;\n\n/** Build a YouTube node's connector metadata from the operation it performs. */\nexport function youtubeMeta(\n role: ConnectorMeta[\"role\"],\n operation: string,\n docs: string,\n): ConnectorMeta {\n return { ...YOUTUBE_SERVICE, role, operation, docs };\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/playlist-item-insert.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/playlist-item-insert.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube playlist item — Add a video to a YouTube playlist.\n *\n * https://developers.google.com/youtube/v3/docs/playlistItems/insert\n *\n * `unsafe-to-replay`.\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { youtubeMeta } from \"../service.js\";\n\nexport const YOUTUBE_PLAYLIST_ITEM_KIND = \"@particle-academy/youtube_playlist_item\";\nexport const YOUTUBE_PLAYLIST_ITEM_OPERATION = \"playlist_item_insert\";\n\nexport const YOUTUBE_PLAYLIST_ITEM_META = youtubeMeta(\"action\", \"add a video to a playlist\", \"https://developers.google.com/youtube/v3/docs/playlistItems/insert\");\n\n/**\n * What this node emits — the \"ingredients\" a downstream node can reference.\n *\n * fancy-flow reads `outputShape` off the kind and offers it in the variable\n * picker, so declaring it is the whole of the work: an author configuring the\n * next node picks `{{ $json.data.id }}` off a list instead of typing a path\n * and hoping.\n */\nexport const YOUTUBE_PLAYLIST_ITEM_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"YouTube's unique id for the new playlist item.\"\n },\n {\n \"path\": \"data.kind\",\n \"type\": \"string\",\n \"description\": \"The fixed resource kind `youtube#playlistItem`.\"\n },\n {\n \"path\": \"data.snippet.playlistId\",\n \"type\": \"string\",\n \"description\": \"The playlist containing the item.\"\n },\n {\n \"path\": \"data.snippet.resourceId.videoId\",\n \"type\": \"string\",\n \"description\": \"The video added to the playlist.\"\n },\n {\n \"path\": \"data.snippet.position\",\n \"type\": \"number\",\n \"description\": \"The item's zero-based position in the playlist.\"\n }\n];\n\nexport const youtubePlaylistItemKind: NodeKindDefinition = defineConnectorKind(YOUTUBE_PLAYLIST_ITEM_META, {\n name: YOUTUBE_PLAYLIST_ITEM_KIND,\n aliases: [\"youtube_playlist_item\"],\n label: \"YouTube playlist item\",\n description: \"Add a video to a YouTube playlist.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: YOUTUBE_PLAYLIST_ITEM_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"playlistId\",\n \"label\": \"Playlist ID\",\n \"required\": true,\n \"description\": \"The YouTube id of the playlist to add the video to.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"videoId\",\n \"label\": \"Video ID\",\n \"required\": true,\n \"description\": \"The YouTube id of the video to add.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(YOUTUBE_PLAYLIST_ITEM_META, config as Record<string, unknown>, \"add a video to a playlist\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube's node kinds for fancy-flow.\n *\n * Install this on every host. The TypeScript executors live in the js\n * package's `./flow` subpath; PHP and Python hosts run their own and need only\n * this.\n */\n\nexport * from \"./service.js\";\nexport * from \"./kinds/playlist-item-insert.js\";\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { youtubePlaylistItemKind } from \"./kinds/playlist-item-insert.js\";\n\n/** Every YouTube kind, for a host that registers the lot. */\nexport const YOUTUBE_KINDS: NodeKindDefinition[] = [\n youtubePlaylistItemKind,\n];\n"]}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/service.ts","../src/kinds/playlist-item-insert.ts","../src/index.ts"],"names":[],"mappings":";;;AAgCO,IAAM,qBAAA,GAAwB;AAG9B,IAAM,eAAA,GAAkB;AAAA,EAC7B,OAAA,EAAS,SAAA;AAAA,EACT,YAAA,EAAc,SAAA;AAAA,EACd,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS;AACX;AAGO,IAAM,mBAAA,GAAsB;AAAA,EACjC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EAAe;AAAA;AACjB,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,CAAC,EAAE,MAAA,OACb,SAAA,CAAU,0BAAA,EAA4B,QAAmC,2BAA2B;AACxG,CAAC;;;ACpEM,IAAM,aAAA,GAAsC;AAAA,EACjD;AACF","file":"index.js","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube's identity on the authoring surface, shared by every YouTube node.\n *\n * This file must import nothing from the js package: a PHP or Python project\n * installs the ui package and never that one, and the import would be a\n * dangling module the moment it did.\n *\n * ## The sandbox trap\n *\n * YouTube has no sandbox. Every live-mode add changes a real playlist; use the\n * faker during development and remove live test items afterward.\n */\n\nimport type { ConnectorMeta } from \"@particle-academy/fancy-flow/connectors\";\n\n/**\n * The connector API version this package was GENERATED against.\n *\n * A literal, never imported — an imported constant lets an upgrade rewrite the\n * very claim it exists to detect.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\n/** The parts of a connector's identity that belong to the SERVICE, not the node. */\nexport const YOUTUBE_SERVICE = {\n service: \"youtube\",\n serviceTitle: \"YouTube\",\n domain: \"marketing\",\n sandbox: \"none\",\n} as const satisfies Pick<ConnectorMeta, \"service\" | \"serviceTitle\" | \"domain\" | \"sandbox\">;\n\n/** The credentials a YouTube connection holds. */\nexport const YOUTUBE_CREDENTIALS = [\n {\n \"key\": \"clientId\",\n \"label\": \"OAuth client ID\",\n \"scope\": \"provider\",\n \"secret\": false,\n \"help\": \"From Google Cloud Console. One value for the whole installation.\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"OAuth client secret\",\n \"scope\": \"provider\",\n \"secret\": true,\n \"help\": \"The client secret for the same OAuth app.\"\n },\n {\n \"key\": \"accessToken\",\n \"label\": \"Access token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected YouTube account; expires after one hour.\"\n },\n {\n \"key\": \"refreshToken\",\n \"label\": \"Refresh token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected YouTube account; the host uses it to refresh the access token.\"\n }\n] as const;\n\n/**\n * The OAuth2 exchange YouTube requires — DECLARED here, performed by the host.\n *\n * A consent screen needs a browser, a redirect URI and somewhere to persist\n * the result, and all three belong to the host; a package that ran the dance\n * itself would have to own a web server. So this says precisely enough for a\n * host to do it.\n *\n * The access token lasts 3600 seconds. A host that never refreshes will work\n * all afternoon and be broken by morning, which is why the lifetime is stated\n * rather than left to be discovered.\n *\n * Its refresh tokens do NOT rotate: the same one is reusable, so a refresh may\n * safely be retried and may run concurrently. That is stated rather than\n * assumed because the opposite — a provider that spends the token and revokes\n * the grant on a replay — looks identical until it happens.\n */\nexport const YOUTUBE_OAUTH = {\n \"flow\": \"authorization_code\",\n \"authorizeUrl\": \"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenUrl\": \"https://oauth2.googleapis.com/token\",\n \"scopes\": [\n \"https://www.googleapis.com/auth/youtube.force-ssl\"\n ],\n \"accessTokenCredential\": \"accessToken\",\n \"refreshTokenCredential\": \"refreshToken\",\n \"refreshTokenRotates\": false,\n \"accessTokenTtlSeconds\": 3600\n} as const;\n\n/** Build a YouTube node's connector metadata from the operation it performs. */\nexport function youtubeMeta(\n role: ConnectorMeta[\"role\"],\n operation: string,\n docs: string,\n): ConnectorMeta {\n return { ...YOUTUBE_SERVICE, role, operation, docs };\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/playlist-item-insert.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/playlist-item-insert.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube playlist item — Add a video to a YouTube playlist.\n *\n * https://developers.google.com/youtube/v3/docs/playlistItems/insert\n *\n * `unsafe-to-replay`.\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { youtubeMeta } from \"../service.js\";\n\nexport const YOUTUBE_PLAYLIST_ITEM_KIND = \"@particle-academy/youtube_playlist_item\";\nexport const YOUTUBE_PLAYLIST_ITEM_OPERATION = \"playlist_item_insert\";\n\nexport const YOUTUBE_PLAYLIST_ITEM_META = youtubeMeta(\"action\", \"add a video to a playlist\", \"https://developers.google.com/youtube/v3/docs/playlistItems/insert\");\n\n/**\n * What this node emits — the \"ingredients\" a downstream node can reference.\n *\n * fancy-flow reads `outputShape` off the kind and offers it in the variable\n * picker, so declaring it is the whole of the work: an author configuring the\n * next node picks `{{ $json.data.id }}` off a list instead of typing a path\n * and hoping.\n */\nexport const YOUTUBE_PLAYLIST_ITEM_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"YouTube's unique id for the new playlist item.\"\n },\n {\n \"path\": \"data.kind\",\n \"type\": \"string\",\n \"description\": \"The fixed resource kind `youtube#playlistItem`.\"\n },\n {\n \"path\": \"data.snippet.playlistId\",\n \"type\": \"string\",\n \"description\": \"The playlist containing the item.\"\n },\n {\n \"path\": \"data.snippet.resourceId.videoId\",\n \"type\": \"string\",\n \"description\": \"The video added to the playlist.\"\n },\n {\n \"path\": \"data.snippet.position\",\n \"type\": \"number\",\n \"description\": \"The item's zero-based position in the playlist.\"\n }\n];\n\nexport const youtubePlaylistItemKind: NodeKindDefinition = defineConnectorKind(YOUTUBE_PLAYLIST_ITEM_META, {\n name: YOUTUBE_PLAYLIST_ITEM_KIND,\n aliases: [\"youtube_playlist_item\"],\n label: \"YouTube playlist item\",\n description: \"Add a video to a YouTube playlist.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: YOUTUBE_PLAYLIST_ITEM_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"playlistId\",\n \"label\": \"Playlist ID\",\n \"required\": true,\n \"description\": \"The YouTube id of the playlist to add the video to.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"videoId\",\n \"label\": \"Video ID\",\n \"required\": true,\n \"description\": \"The YouTube id of the video to add.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(YOUTUBE_PLAYLIST_ITEM_META, config as Record<string, unknown>, \"add a video to a playlist\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube's node kinds for fancy-flow.\n *\n * Install this on every host. The TypeScript executors live in the js\n * package's `./flow` subpath; PHP and Python hosts run their own and need only\n * this.\n */\n\nexport * from \"./service.js\";\nexport * from \"./kinds/playlist-item-insert.js\";\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { youtubePlaylistItemKind } from \"./kinds/playlist-item-insert.js\";\n\n/** Every YouTube kind, for a host that registers the lot. */\nexport const YOUTUBE_KINDS: NodeKindDefinition[] = [\n youtubePlaylistItemKind,\n];\n"]}
1
+ {"version":3,"sources":["../src/service.ts","../src/kinds/playlist-item-insert.ts","../src/index.ts"],"names":[],"mappings":";;;AAgCO,IAAM,qBAAA,GAAwB;AAG9B,IAAM,eAAA,GAAkB;AAAA,EAC7B,OAAA,EAAS,SAAA;AAAA,EACT,YAAA,EAAc,SAAA;AAAA,EACd,MAAA,EAAQ,WAAA;AAAA,EACR,OAAA,EAAS;AACX;AA+BO,IAAM,mBAAA,GAAsB;AAAA,EACjC;AAAA,IACE,KAAA,EAAO,UAA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,EACA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,CAAC,EAAE,MAAA,OACb,SAAA,CAAU,0BAAA,EAA4B,QAAmC,2BAA2B;AACxG,CAAC;;;ACpEM,IAAM,aAAA,GAAsC;AAAA,EACjD;AACF","file":"index.js","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube's identity on the authoring surface, shared by every YouTube node.\n *\n * This file must import nothing from the js package: a PHP or Python project\n * installs the ui package and never that one, and the import would be a\n * dangling module the moment it did.\n *\n * ## The sandbox trap\n *\n * YouTube has no sandbox. Every live-mode add changes a real playlist; use the\n * faker during development and remove live test items afterward.\n */\n\nimport type { ConnectorDomain, ConnectorMeta } from \"@particle-academy/fancy-flow/connectors\";\n\n/**\n * The connector API version this package was GENERATED against.\n *\n * A literal, never imported — an imported constant lets an upgrade rewrite the\n * very claim it exists to detect.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\n/** The parts of a connector's identity that belong to the SERVICE, not the node. */\nexport const YOUTUBE_SERVICE = {\n service: \"youtube\",\n serviceTitle: \"YouTube\",\n domain: \"marketing\",\n sandbox: \"none\",\n} as const satisfies Pick<ConnectorMeta, \"service\" | \"serviceTitle\" | \"domain\" | \"sandbox\">;\n\n/**\n * Every connector domain weaver knows, pinned against fancy-flow's union.\n *\n * A closed set copied into three codebases stays correct only while something\n * MAKES it: this line fails to compile the moment weaver carries a value\n * fancy-flow does not, including the values no provider uses yet.\n */\nconst WEAVER_DOMAINS: readonly ConnectorDomain[] = [\n \"payments\",\n \"commerce\",\n \"messaging\",\n \"email\",\n \"crm\",\n \"support\",\n \"storage\",\n \"calendar\",\n \"productivity\",\n \"database\",\n \"devtools\",\n \"analytics\",\n \"marketing\",\n \"ai\",\n \"forms\",\n \"hr\",\n \"geo\"\n];\nvoid WEAVER_DOMAINS;\n\n/** The credentials a YouTube connection holds. */\nexport const YOUTUBE_CREDENTIALS = [\n {\n \"key\": \"clientId\",\n \"label\": \"OAuth client ID\",\n \"scope\": \"provider\",\n \"secret\": false,\n \"help\": \"From Google Cloud Console. One value for the whole installation.\"\n },\n {\n \"key\": \"clientSecret\",\n \"label\": \"OAuth client secret\",\n \"scope\": \"provider\",\n \"secret\": true,\n \"help\": \"The client secret for the same OAuth app.\"\n },\n {\n \"key\": \"accessToken\",\n \"label\": \"Access token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected YouTube account; expires after one hour.\"\n },\n {\n \"key\": \"refreshToken\",\n \"label\": \"Refresh token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected YouTube account; the host uses it to refresh the access token.\"\n }\n] as const;\n\n/**\n * The OAuth2 exchange YouTube requires — DECLARED here, performed by the host.\n *\n * A consent screen needs a browser, a redirect URI and somewhere to persist\n * the result, and all three belong to the host; a package that ran the dance\n * itself would have to own a web server. So this says precisely enough for a\n * host to do it.\n *\n * The access token lasts 3600 seconds. A host that never refreshes will work\n * all afternoon and be broken by morning, which is why the lifetime is stated\n * rather than left to be discovered.\n *\n * Its refresh tokens do NOT rotate: the same one is reusable, so a refresh may\n * safely be retried and may run concurrently. That is stated rather than\n * assumed because the opposite — a provider that spends the token and revokes\n * the grant on a replay — looks identical until it happens.\n */\nexport const YOUTUBE_OAUTH = {\n \"flow\": \"authorization_code\",\n \"authorizeUrl\": \"https://accounts.google.com/o/oauth2/v2/auth\",\n \"tokenUrl\": \"https://oauth2.googleapis.com/token\",\n \"scopes\": [\n \"https://www.googleapis.com/auth/youtube.force-ssl\"\n ],\n \"accessTokenCredential\": \"accessToken\",\n \"refreshTokenCredential\": \"refreshToken\",\n \"refreshTokenRotates\": false,\n \"accessTokenTtlSeconds\": 3600\n} as const;\n\n/** Build a YouTube node's connector metadata from the operation it performs. */\nexport function youtubeMeta(\n role: ConnectorMeta[\"role\"],\n operation: string,\n docs: string,\n): ConnectorMeta {\n return { ...YOUTUBE_SERVICE, role, operation, docs };\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/playlist-item-insert.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/playlist-item-insert.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube playlist item — Add a video to a YouTube playlist.\n *\n * https://developers.google.com/youtube/v3/docs/playlistItems/insert\n *\n * `unsafe-to-replay`.\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { youtubeMeta } from \"../service.js\";\n\nexport const YOUTUBE_PLAYLIST_ITEM_KIND = \"@particle-academy/youtube_playlist_item\";\nexport const YOUTUBE_PLAYLIST_ITEM_OPERATION = \"playlist_item_insert\";\n\nexport const YOUTUBE_PLAYLIST_ITEM_META = youtubeMeta(\"action\", \"add a video to a playlist\", \"https://developers.google.com/youtube/v3/docs/playlistItems/insert\");\n\n/**\n * What this node emits — the \"ingredients\" a downstream node can reference.\n *\n * fancy-flow reads `outputShape` off the kind and offers it in the variable\n * picker, so declaring it is the whole of the work: an author configuring the\n * next node picks `{{ $json.data.id }}` off a list instead of typing a path\n * and hoping.\n */\nexport const YOUTUBE_PLAYLIST_ITEM_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"YouTube's unique id for the new playlist item.\"\n },\n {\n \"path\": \"data.kind\",\n \"type\": \"string\",\n \"description\": \"The fixed resource kind `youtube#playlistItem`.\"\n },\n {\n \"path\": \"data.snippet.playlistId\",\n \"type\": \"string\",\n \"description\": \"The playlist containing the item.\"\n },\n {\n \"path\": \"data.snippet.resourceId.videoId\",\n \"type\": \"string\",\n \"description\": \"The video added to the playlist.\"\n },\n {\n \"path\": \"data.snippet.position\",\n \"type\": \"number\",\n \"description\": \"The item's zero-based position in the playlist.\"\n }\n];\n\nexport const youtubePlaylistItemKind: NodeKindDefinition = defineConnectorKind(YOUTUBE_PLAYLIST_ITEM_META, {\n name: YOUTUBE_PLAYLIST_ITEM_KIND,\n aliases: [\"youtube_playlist_item\"],\n label: \"YouTube playlist item\",\n description: \"Add a video to a YouTube playlist.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: YOUTUBE_PLAYLIST_ITEM_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"playlistId\",\n \"label\": \"Playlist ID\",\n \"required\": true,\n \"description\": \"The YouTube id of the playlist to add the video to.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"videoId\",\n \"label\": \"Video ID\",\n \"required\": true,\n \"description\": \"The YouTube id of the video to add.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(YOUTUBE_PLAYLIST_ITEM_META, config as Record<string, unknown>, \"add a video to a playlist\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- youtube\n */\n\n/**\n * YouTube's node kinds for fancy-flow.\n *\n * Install this on every host. The TypeScript executors live in the js\n * package's `./flow` subpath; PHP and Python hosts run their own and need only\n * this.\n */\n\nexport * from \"./service.js\";\nexport * from \"./kinds/playlist-item-insert.js\";\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { youtubePlaylistItemKind } from \"./kinds/playlist-item-insert.js\";\n\n/** Every YouTube kind, for a host that registers the lot. */\nexport const YOUTUBE_KINDS: NodeKindDefinition[] = [\n youtubePlaylistItemKind,\n];\n"]}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@particle-academy/youtube-ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "YouTube's authoring surface for fancy-flow — the node kinds, their config schemas and their declared output shapes. React on every host; carries no executor.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/Fancy-Friends/youtube.git"
7
+ "url": "git+https://github.com/Fancy-Friends/youtube.git",
8
+ "directory": "packages/ui"
8
9
  },
9
10
  "homepage": "https://github.com/Fancy-Friends/youtube#readme",
10
11
  "bugs": "https://github.com/Fancy-Friends/youtube/issues",