@particle-academy/google-drive-ui 0.4.0 → 0.6.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 +46 -0
- package/README.md +7 -0
- package/dist/index.cjs +22 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,52 @@ All notable changes to `@particle-academy/google-drive-ui`,
|
|
|
4
4
|
`@particle-academy/google-drive-js`, `particle-academy/google-drive-php` and
|
|
5
5
|
`fancy-google-drive`.
|
|
6
6
|
|
|
7
|
+
## [0.6.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.5.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/google-drive.php` under
|
|
40
|
+
`connectors.google-drive` (credentials from the environment, or per call for a
|
|
41
|
+
multi-account app);
|
|
42
|
+
- the `GoogleDrive` facade: `GoogleDrive::call('<operation>', [...])` runs any action;
|
|
43
|
+
- `GoogleDrive::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.4.0] — 2026-09-30
|
|
8
54
|
|
|
9
55
|
### Added
|
package/README.md
CHANGED
|
@@ -55,6 +55,13 @@ Google Drive uses OAuth2 (authorization_code). The package DECLARES the exchange
|
|
|
55
55
|
- **Scopes** — `https://www.googleapis.com/auth/drive.file`
|
|
56
56
|
- **Access token lifetime** — 3600 seconds (1 hours). A host that never refreshes works all afternoon and is broken by morning.
|
|
57
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
|
+
|
|
58
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.
|
|
59
66
|
|
|
60
67
|
### The estate
|
package/dist/index.cjs
CHANGED
|
@@ -50,7 +50,28 @@ var GOOGLE_DRIVE_OAUTH = {
|
|
|
50
50
|
"accessTokenCredential": "accessToken",
|
|
51
51
|
"refreshTokenCredential": "refreshToken",
|
|
52
52
|
"refreshTokenRotates": false,
|
|
53
|
-
"accessTokenTtlSeconds": 3600
|
|
53
|
+
"accessTokenTtlSeconds": 3600,
|
|
54
|
+
"grant": "google",
|
|
55
|
+
"authorizeParams": {
|
|
56
|
+
"access_type": "offline",
|
|
57
|
+
"include_granted_scopes": "true"
|
|
58
|
+
},
|
|
59
|
+
"revoke": {
|
|
60
|
+
"url": "https://oauth2.googleapis.com/revoke",
|
|
61
|
+
"param": "token",
|
|
62
|
+
"scope": "grant"
|
|
63
|
+
},
|
|
64
|
+
"identity": {
|
|
65
|
+
"scope": "openid",
|
|
66
|
+
"claim": "sub",
|
|
67
|
+
"issuers": [
|
|
68
|
+
"https://accounts.google.com",
|
|
69
|
+
"accounts.google.com"
|
|
70
|
+
],
|
|
71
|
+
"jwksUrl": "https://www.googleapis.com/oauth2/v3/certs",
|
|
72
|
+
"audienceCredential": "clientId"
|
|
73
|
+
},
|
|
74
|
+
"restrictedScopes": []
|
|
54
75
|
};
|
|
55
76
|
function googleDriveMeta(role, operation, docs) {
|
|
56
77
|
return { ...GOOGLE_DRIVE_SERVICE, role, operation, docs };
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/service.ts","../src/kinds/file-get.ts","../src/kinds/file-list.ts","../src/kinds/folder-create.ts","../src/kinds/permission-create.ts","../src/index.ts"],"names":["defineConnectorKind","summarize"],"mappings":";;;;;AAiCO,IAAM,qBAAA,GAAwB;AAG9B,IAAM,oBAAA,GAAuB;AAAA,EAClC,OAAA,EAAS,cAAA;AAAA,EACT,YAAA,EAAc,cAAA;AAAA,EACd,MAAA,EAAQ,cAAA;AAAA,EACR,OAAA,EAAS;AACX;AA+BO,IAAM,wBAAA,GAA2B;AAAA,EACtC;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;AAAA,IACT,OAAA,EAAS,SAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA;AAAA,IACE,KAAA,EAAO,cAAA;AAAA,IACP,OAAA,EAAS,eAAA;AAAA,IACT,OAAA,EAAS,SAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,MAAA,EAAQ;AAAA;AAEZ;AAoBO,IAAM,kBAAA,GAAqB;AAAA,EAChC,MAAA,EAAQ,oBAAA;AAAA,EACR,cAAA,EAAgB,8CAAA;AAAA,EAChB,UAAA,EAAY,qCAAA;AAAA,EAC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A,KACjB;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,cAAA;AAAA,MACP,OAAA,EAAS,eAAA;AAAA,MACT,aAAA,EAAe;AAAA,KACjB;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,QAAA;AAAA,MACP,OAAA,EAAS,QAAA;AAAA,MACT,aAAA,EAAe;AAAA;AACjB,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,CAAC,EAAE,MAAA,OACbC,oBAAAA,CAAU,mCAAA,EAAqC,QAAmC,cAAc;AACpG,CAAC;;;AClHM,IAAM,kBAAA,GAA2C;AAAA,EACtD,sBAAA;AAAA,EACA,uBAAA;AAAA,EACA,qBAAA;AAAA,EACA;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 -- google_drive\n */\n\n/**\n * Google Drive's identity on the authoring surface, shared by every Google\n * Drive 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 * Google Drive has no sandbox. Every folder created in live mode is real; use\n * the faker during development and delete live test folders 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 GOOGLE_DRIVE_SERVICE = {\n service: \"google_drive\",\n serviceTitle: \"Google Drive\",\n domain: \"productivity\",\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 Google Drive connection holds. */\nexport const GOOGLE_DRIVE_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 Google account; expires after one hour.\"\n },\n {\n \"key\": \"refreshToken\",\n \"label\": \"Refresh token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected Google account; the host uses it to refresh the access token.\"\n }\n] as const;\n\n/**\n * The OAuth2 exchange Google Drive requires — DECLARED here, performed by the\n * 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 GOOGLE_DRIVE_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/drive.file\"\n ],\n \"accessTokenCredential\": \"accessToken\",\n \"refreshTokenCredential\": \"refreshToken\",\n \"refreshTokenRotates\": false,\n \"accessTokenTtlSeconds\": 3600\n} as const;\n\n/** Build a Google Drive node's connector metadata from the operation it performs. */\nexport function googleDriveMeta(\n role: ConnectorMeta[\"role\"],\n operation: string,\n docs: string,\n): ConnectorMeta {\n return { ...GOOGLE_DRIVE_SERVICE, role, operation, docs };\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/file-get.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/file-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Google Drive file — Read one file's metadata and its download/view links.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FILE_GET_KIND = \"@particle-academy/google_drive_file_get\";\nexport const GOOGLE_DRIVE_FILE_GET_OPERATION = \"file_get\";\n\nexport const GOOGLE_DRIVE_FILE_GET_META = googleDriveMeta(\"action\", \"read a file\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get\");\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 GOOGLE_DRIVE_FILE_GET_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The file id.\"\n },\n {\n \"path\": \"data.name\",\n \"type\": \"string\",\n \"description\": \"The file name.\"\n },\n {\n \"path\": \"data.mimeType\",\n \"type\": \"string\",\n \"description\": \"The file's MIME type.\"\n },\n {\n \"path\": \"data.size\",\n \"type\": \"string\",\n \"description\": \"Bytes, as a decimal STRING -- Drive's own int64 convention. Absent for Google Workspace editor files (Docs, Sheets, Slides) and for folders.\"\n },\n {\n \"path\": \"data.parents\",\n \"type\": \"array\",\n \"description\": \"Parent folder ids. A file has at most one today even though the field stays an array.\"\n },\n {\n \"path\": \"data.modifiedTime\",\n \"type\": \"string\",\n \"description\": \"RFC 3339.\"\n },\n {\n \"path\": \"data.webViewLink\",\n \"type\": \"string\",\n \"description\": \"Opens the file in its Drive/editor viewer. Requires the viewer to already have access.\"\n },\n {\n \"path\": \"data.webContentLink\",\n \"type\": \"string\",\n \"description\": \"A direct download URL for files with binary content. Absent for Google Workspace editor files and folders -- those export instead, which this connector does not yet offer.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDriveFileGetKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FILE_GET_META, {\n name: GOOGLE_DRIVE_FILE_GET_KIND,\n aliases: [\"google_drive_file_get\"],\n label: \"Google Drive file\",\n description: \"Read one file's metadata and its download/view links.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GOOGLE_DRIVE_FILE_GET_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"fileId\",\n \"label\": \"File ID\",\n \"required\": true,\n \"description\": \"From file_list, or another node's output.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FILE_GET_META, config as Record<string, unknown>, \"read a file\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/file-list.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/file-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * List Google Drive files — List files this app created (or the user\n * explicitly opened) in Google Drive. Under the drive.file scope this\n * connector uses, a file created by any other app or picked up in the Drive UI\n * directly never appears here.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FILE_LIST_KIND = \"@particle-academy/google_drive_file_list\";\nexport const GOOGLE_DRIVE_FILE_LIST_OPERATION = \"file_list\";\n\nexport const GOOGLE_DRIVE_FILE_LIST_META = googleDriveMeta(\"action\", \"list files\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list\");\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 GOOGLE_DRIVE_FILE_LIST_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.files\",\n \"type\": \"array\",\n \"description\": \"id, name, mimeType, size, modifiedTime, webViewLink per file -- leaner than file_get's projection. Read one file directly with file_get for parents and webContentLink.\"\n },\n {\n \"path\": \"data.nextPageToken\",\n \"type\": \"string\",\n \"description\": \"Present when there is another page.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDriveFileListKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FILE_LIST_META, {\n name: GOOGLE_DRIVE_FILE_LIST_KIND,\n aliases: [\"google_drive_file_list\"],\n label: \"List Google Drive files\",\n description: \"List files this app created (or the user explicitly opened) in Google Drive. Under the drive.file scope this connector uses, a file created by any other app or picked up in the Drive UI directly never appears here.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GOOGLE_DRIVE_FILE_LIST_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"q\",\n \"label\": \"Search query\",\n \"description\": \"Drive's query syntax, e.g. \\\"mimeType='application/pdf' and trashed=false\\\". Leave blank to list everything this app can see.\"\n },\n {\n \"type\": \"number\",\n \"key\": \"pageSize\",\n \"label\": \"Page size\",\n \"min\": 1,\n \"max\": 1000,\n \"default\": 100,\n \"description\": \"Files per page. Drive's maximum is 1000.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"pageToken\",\n \"label\": \"Page token\",\n \"description\": \"From a previous page's nextPageToken.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"orderBy\",\n \"label\": \"Order by\",\n \"description\": \"A comma-separated list of Drive sort keys, e.g. \\\"modifiedTime desc\\\". Leave blank for Drive's default order.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FILE_LIST_META, config as Record<string, unknown>, \"list files\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/folder-create.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/folder-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Google Drive folder — Create a folder in Google Drive.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create\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 { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FOLDER_KIND = \"@particle-academy/google_drive_folder\";\nexport const GOOGLE_DRIVE_FOLDER_OPERATION = \"folder_create\";\n\nexport const GOOGLE_DRIVE_FOLDER_META = googleDriveMeta(\"action\", \"create a folder\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create\");\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 GOOGLE_DRIVE_FOLDER_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The created folder's id.\"\n },\n {\n \"path\": \"data.name\",\n \"type\": \"string\",\n \"description\": \"The folder name Google stored.\"\n },\n {\n \"path\": \"data.mimeType\",\n \"type\": \"string\",\n \"description\": \"The fixed Google Drive folder MIME type.\"\n },\n {\n \"path\": \"data.parents\",\n \"type\": \"array\",\n \"description\": \"The parent folder id array returned by Drive.\"\n }\n];\n\nexport const googleDriveFolderKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FOLDER_META, {\n name: GOOGLE_DRIVE_FOLDER_KIND,\n aliases: [\"google_drive_folder\"],\n label: \"Google Drive folder\",\n description: \"Create a folder in Google Drive.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: GOOGLE_DRIVE_FOLDER_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"name\",\n \"label\": \"Folder name\",\n \"required\": true,\n \"description\": \"The folder name. Drive does not require names to be unique within a parent.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"parents\",\n \"label\": \"Parent folder IDs\",\n \"description\": \"Parent folder ids, comma separated. Leave empty to create the folder in My Drive.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FOLDER_META, config as Record<string, unknown>, \"create a folder\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/permission-create.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/permission-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Share a Google Drive file — Grant a user, group, domain, or anyone with the\n * link access to a file.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/create\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 { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_KIND = \"@particle-academy/google_drive_permission_create\";\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_OPERATION = \"permission_create\";\n\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_META = googleDriveMeta(\"action\", \"share a file\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/create\");\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 GOOGLE_DRIVE_PERMISSION_CREATE_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The new permission's id.\"\n },\n {\n \"path\": \"data.type\",\n \"type\": \"string\",\n \"description\": \"Echoes what was sent.\"\n },\n {\n \"path\": \"data.role\",\n \"type\": \"string\",\n \"description\": \"Echoes what was sent.\"\n },\n {\n \"path\": \"data.emailAddress\",\n \"type\": \"string\",\n \"description\": \"Present for a user or group grant.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDrivePermissionCreateKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_PERMISSION_CREATE_META, {\n name: GOOGLE_DRIVE_PERMISSION_CREATE_KIND,\n aliases: [\"google_drive_permission_create\"],\n label: \"Share a Google Drive file\",\n description: \"Grant a user, group, domain, or anyone with the link access to a file.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: GOOGLE_DRIVE_PERMISSION_CREATE_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"fileId\",\n \"label\": \"File ID\",\n \"required\": true\n },\n {\n \"type\": \"select\",\n \"key\": \"type\",\n \"label\": \"Grantee type\",\n \"required\": true,\n \"default\": \"user\",\n \"options\": [\n {\n \"value\": \"user\",\n \"label\": \"A specific person\"\n },\n {\n \"value\": \"group\",\n \"label\": \"A Google Group\"\n },\n {\n \"value\": \"domain\",\n \"label\": \"Everyone in a domain\"\n },\n {\n \"value\": \"anyone\",\n \"label\": \"Anyone with the link\"\n }\n ]\n },\n {\n \"type\": \"select\",\n \"key\": \"role\",\n \"label\": \"Role\",\n \"required\": true,\n \"default\": \"reader\",\n \"options\": [\n {\n \"value\": \"reader\",\n \"label\": \"Reader\"\n },\n {\n \"value\": \"commenter\",\n \"label\": \"Commenter\"\n },\n {\n \"value\": \"writer\",\n \"label\": \"Writer\"\n }\n ],\n \"description\": \"organizer, fileOrganizer and owner exist in Drive's API but only apply inside a shared drive, which this action does not target.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"emailAddress\",\n \"label\": \"Email address\",\n \"description\": \"Required when the grantee type is a person or a Google Group. Ignored for domain and anyone.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"domain\",\n \"label\": \"Domain\",\n \"description\": \"Required when the grantee type is domain, e.g. example.com. Ignored otherwise.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_PERMISSION_CREATE_META, config as Record<string, unknown>, \"share a file\"),\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 -- google_drive\n */\n\n/**\n * Google Drive'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/file-get.js\";\nexport * from \"./kinds/file-list.js\";\nexport * from \"./kinds/folder-create.js\";\nexport * from \"./kinds/permission-create.js\";\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { googleDriveFileGetKind } from \"./kinds/file-get.js\";\nimport { googleDriveFileListKind } from \"./kinds/file-list.js\";\nimport { googleDriveFolderKind } from \"./kinds/folder-create.js\";\nimport { googleDrivePermissionCreateKind } from \"./kinds/permission-create.js\";\n\n/** Every Google Drive kind, for a host that registers the lot. */\nexport const GOOGLE_DRIVE_KINDS: NodeKindDefinition[] = [\n googleDriveFileGetKind,\n googleDriveFileListKind,\n googleDriveFolderKind,\n googleDrivePermissionCreateKind,\n];\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/service.ts","../src/kinds/file-get.ts","../src/kinds/file-list.ts","../src/kinds/folder-create.ts","../src/kinds/permission-create.ts","../src/index.ts"],"names":["defineConnectorKind","summarize"],"mappings":";;;;;AAiCO,IAAM,qBAAA,GAAwB;AAG9B,IAAM,oBAAA,GAAuB;AAAA,EAClC,OAAA,EAAS,cAAA;AAAA,EACT,YAAA,EAAc,cAAA;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SACX;AAAA,QACA;AAAA,UACE,OAAA,EAAS,QAAA;AAAA,UACT,OAAA,EAAS;AAAA;AACX,OACF;AAAA,MACA,aAAA,EAAe;AAAA,KACjB;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,cAAA;AAAA,MACP,OAAA,EAAS,eAAA;AAAA,MACT,aAAA,EAAe;AAAA,KACjB;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,QAAA;AAAA,MACP,OAAA,EAAS,QAAA;AAAA,MACT,aAAA,EAAe;AAAA;AACjB,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,CAAC,EAAE,MAAA,OACbC,oBAAAA,CAAU,mCAAA,EAAqC,QAAmC,cAAc;AACpG,CAAC;;;AClHM,IAAM,kBAAA,GAA2C;AAAA,EACtD,sBAAA;AAAA,EACA,uBAAA;AAAA,EACA,qBAAA;AAAA,EACA;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 -- google_drive\n */\n\n/**\n * Google Drive's identity on the authoring surface, shared by every Google\n * Drive 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 * Google Drive has no sandbox. Every folder created in live mode is real; use\n * the faker during development and delete live test folders 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 GOOGLE_DRIVE_SERVICE = {\n service: \"google_drive\",\n serviceTitle: \"Google Drive\",\n domain: \"productivity\",\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 Google Drive connection holds. */\nexport const GOOGLE_DRIVE_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 Google account; expires after one hour.\"\n },\n {\n \"key\": \"refreshToken\",\n \"label\": \"Refresh token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected Google account; the host uses it to refresh the access token.\"\n }\n] as const;\n\n/**\n * The OAuth2 exchange Google Drive requires — DECLARED here, performed by the\n * 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 *\n * Its consent grant is SHARED with every connector declaring grant \"google\":\n * one OAuth client, one consent and one refresh token per person, scopes added\n * as features are first used (authorizeParams). Revoking removes the WHOLE\n * grant, so only a full disconnect revokes; a per-feature disconnect stops\n * using the scope locally. Identify the account by the id_token's sub, never\n * by email.\n */\nexport const GOOGLE_DRIVE_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/drive.file\"\n ],\n \"accessTokenCredential\": \"accessToken\",\n \"refreshTokenCredential\": \"refreshToken\",\n \"refreshTokenRotates\": false,\n \"accessTokenTtlSeconds\": 3600,\n \"grant\": \"google\",\n \"authorizeParams\": {\n \"access_type\": \"offline\",\n \"include_granted_scopes\": \"true\"\n },\n \"revoke\": {\n \"url\": \"https://oauth2.googleapis.com/revoke\",\n \"param\": \"token\",\n \"scope\": \"grant\"\n },\n \"identity\": {\n \"scope\": \"openid\",\n \"claim\": \"sub\",\n \"issuers\": [\n \"https://accounts.google.com\",\n \"accounts.google.com\"\n ],\n \"jwksUrl\": \"https://www.googleapis.com/oauth2/v3/certs\",\n \"audienceCredential\": \"clientId\"\n },\n \"restrictedScopes\": []\n} as const;\n\n/** Build a Google Drive node's connector metadata from the operation it performs. */\nexport function googleDriveMeta(\n role: ConnectorMeta[\"role\"],\n operation: string,\n docs: string,\n): ConnectorMeta {\n return { ...GOOGLE_DRIVE_SERVICE, role, operation, docs };\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/file-get.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/file-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Google Drive file — Read one file's metadata and its download/view links.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FILE_GET_KIND = \"@particle-academy/google_drive_file_get\";\nexport const GOOGLE_DRIVE_FILE_GET_OPERATION = \"file_get\";\n\nexport const GOOGLE_DRIVE_FILE_GET_META = googleDriveMeta(\"action\", \"read a file\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get\");\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 GOOGLE_DRIVE_FILE_GET_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The file id.\"\n },\n {\n \"path\": \"data.name\",\n \"type\": \"string\",\n \"description\": \"The file name.\"\n },\n {\n \"path\": \"data.mimeType\",\n \"type\": \"string\",\n \"description\": \"The file's MIME type.\"\n },\n {\n \"path\": \"data.size\",\n \"type\": \"string\",\n \"description\": \"Bytes, as a decimal STRING -- Drive's own int64 convention. Absent for Google Workspace editor files (Docs, Sheets, Slides) and for folders.\"\n },\n {\n \"path\": \"data.parents\",\n \"type\": \"array\",\n \"description\": \"Parent folder ids. A file has at most one today even though the field stays an array.\"\n },\n {\n \"path\": \"data.modifiedTime\",\n \"type\": \"string\",\n \"description\": \"RFC 3339.\"\n },\n {\n \"path\": \"data.webViewLink\",\n \"type\": \"string\",\n \"description\": \"Opens the file in its Drive/editor viewer. Requires the viewer to already have access.\"\n },\n {\n \"path\": \"data.webContentLink\",\n \"type\": \"string\",\n \"description\": \"A direct download URL for files with binary content. Absent for Google Workspace editor files and folders -- those export instead, which this connector does not yet offer.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDriveFileGetKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FILE_GET_META, {\n name: GOOGLE_DRIVE_FILE_GET_KIND,\n aliases: [\"google_drive_file_get\"],\n label: \"Google Drive file\",\n description: \"Read one file's metadata and its download/view links.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GOOGLE_DRIVE_FILE_GET_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"fileId\",\n \"label\": \"File ID\",\n \"required\": true,\n \"description\": \"From file_list, or another node's output.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FILE_GET_META, config as Record<string, unknown>, \"read a file\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/file-list.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/file-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * List Google Drive files — List files this app created (or the user\n * explicitly opened) in Google Drive. Under the drive.file scope this\n * connector uses, a file created by any other app or picked up in the Drive UI\n * directly never appears here.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FILE_LIST_KIND = \"@particle-academy/google_drive_file_list\";\nexport const GOOGLE_DRIVE_FILE_LIST_OPERATION = \"file_list\";\n\nexport const GOOGLE_DRIVE_FILE_LIST_META = googleDriveMeta(\"action\", \"list files\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list\");\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 GOOGLE_DRIVE_FILE_LIST_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.files\",\n \"type\": \"array\",\n \"description\": \"id, name, mimeType, size, modifiedTime, webViewLink per file -- leaner than file_get's projection. Read one file directly with file_get for parents and webContentLink.\"\n },\n {\n \"path\": \"data.nextPageToken\",\n \"type\": \"string\",\n \"description\": \"Present when there is another page.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDriveFileListKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FILE_LIST_META, {\n name: GOOGLE_DRIVE_FILE_LIST_KIND,\n aliases: [\"google_drive_file_list\"],\n label: \"List Google Drive files\",\n description: \"List files this app created (or the user explicitly opened) in Google Drive. Under the drive.file scope this connector uses, a file created by any other app or picked up in the Drive UI directly never appears here.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GOOGLE_DRIVE_FILE_LIST_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"q\",\n \"label\": \"Search query\",\n \"description\": \"Drive's query syntax, e.g. \\\"mimeType='application/pdf' and trashed=false\\\". Leave blank to list everything this app can see.\"\n },\n {\n \"type\": \"number\",\n \"key\": \"pageSize\",\n \"label\": \"Page size\",\n \"min\": 1,\n \"max\": 1000,\n \"default\": 100,\n \"description\": \"Files per page. Drive's maximum is 1000.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"pageToken\",\n \"label\": \"Page token\",\n \"description\": \"From a previous page's nextPageToken.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"orderBy\",\n \"label\": \"Order by\",\n \"description\": \"A comma-separated list of Drive sort keys, e.g. \\\"modifiedTime desc\\\". Leave blank for Drive's default order.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FILE_LIST_META, config as Record<string, unknown>, \"list files\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/folder-create.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/folder-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Google Drive folder — Create a folder in Google Drive.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create\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 { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FOLDER_KIND = \"@particle-academy/google_drive_folder\";\nexport const GOOGLE_DRIVE_FOLDER_OPERATION = \"folder_create\";\n\nexport const GOOGLE_DRIVE_FOLDER_META = googleDriveMeta(\"action\", \"create a folder\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create\");\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 GOOGLE_DRIVE_FOLDER_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The created folder's id.\"\n },\n {\n \"path\": \"data.name\",\n \"type\": \"string\",\n \"description\": \"The folder name Google stored.\"\n },\n {\n \"path\": \"data.mimeType\",\n \"type\": \"string\",\n \"description\": \"The fixed Google Drive folder MIME type.\"\n },\n {\n \"path\": \"data.parents\",\n \"type\": \"array\",\n \"description\": \"The parent folder id array returned by Drive.\"\n }\n];\n\nexport const googleDriveFolderKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FOLDER_META, {\n name: GOOGLE_DRIVE_FOLDER_KIND,\n aliases: [\"google_drive_folder\"],\n label: \"Google Drive folder\",\n description: \"Create a folder in Google Drive.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: GOOGLE_DRIVE_FOLDER_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"name\",\n \"label\": \"Folder name\",\n \"required\": true,\n \"description\": \"The folder name. Drive does not require names to be unique within a parent.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"parents\",\n \"label\": \"Parent folder IDs\",\n \"description\": \"Parent folder ids, comma separated. Leave empty to create the folder in My Drive.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FOLDER_META, config as Record<string, unknown>, \"create a folder\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/permission-create.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/permission-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Share a Google Drive file — Grant a user, group, domain, or anyone with the\n * link access to a file.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/create\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 { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_KIND = \"@particle-academy/google_drive_permission_create\";\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_OPERATION = \"permission_create\";\n\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_META = googleDriveMeta(\"action\", \"share a file\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/create\");\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 GOOGLE_DRIVE_PERMISSION_CREATE_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The new permission's id.\"\n },\n {\n \"path\": \"data.type\",\n \"type\": \"string\",\n \"description\": \"Echoes what was sent.\"\n },\n {\n \"path\": \"data.role\",\n \"type\": \"string\",\n \"description\": \"Echoes what was sent.\"\n },\n {\n \"path\": \"data.emailAddress\",\n \"type\": \"string\",\n \"description\": \"Present for a user or group grant.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDrivePermissionCreateKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_PERMISSION_CREATE_META, {\n name: GOOGLE_DRIVE_PERMISSION_CREATE_KIND,\n aliases: [\"google_drive_permission_create\"],\n label: \"Share a Google Drive file\",\n description: \"Grant a user, group, domain, or anyone with the link access to a file.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: GOOGLE_DRIVE_PERMISSION_CREATE_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"fileId\",\n \"label\": \"File ID\",\n \"required\": true\n },\n {\n \"type\": \"select\",\n \"key\": \"type\",\n \"label\": \"Grantee type\",\n \"required\": true,\n \"default\": \"user\",\n \"options\": [\n {\n \"value\": \"user\",\n \"label\": \"A specific person\"\n },\n {\n \"value\": \"group\",\n \"label\": \"A Google Group\"\n },\n {\n \"value\": \"domain\",\n \"label\": \"Everyone in a domain\"\n },\n {\n \"value\": \"anyone\",\n \"label\": \"Anyone with the link\"\n }\n ]\n },\n {\n \"type\": \"select\",\n \"key\": \"role\",\n \"label\": \"Role\",\n \"required\": true,\n \"default\": \"reader\",\n \"options\": [\n {\n \"value\": \"reader\",\n \"label\": \"Reader\"\n },\n {\n \"value\": \"commenter\",\n \"label\": \"Commenter\"\n },\n {\n \"value\": \"writer\",\n \"label\": \"Writer\"\n }\n ],\n \"description\": \"organizer, fileOrganizer and owner exist in Drive's API but only apply inside a shared drive, which this action does not target.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"emailAddress\",\n \"label\": \"Email address\",\n \"description\": \"Required when the grantee type is a person or a Google Group. Ignored for domain and anyone.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"domain\",\n \"label\": \"Domain\",\n \"description\": \"Required when the grantee type is domain, e.g. example.com. Ignored otherwise.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_PERMISSION_CREATE_META, config as Record<string, unknown>, \"share a file\"),\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 -- google_drive\n */\n\n/**\n * Google Drive'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/file-get.js\";\nexport * from \"./kinds/file-list.js\";\nexport * from \"./kinds/folder-create.js\";\nexport * from \"./kinds/permission-create.js\";\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { googleDriveFileGetKind } from \"./kinds/file-get.js\";\nimport { googleDriveFileListKind } from \"./kinds/file-list.js\";\nimport { googleDriveFolderKind } from \"./kinds/folder-create.js\";\nimport { googleDrivePermissionCreateKind } from \"./kinds/permission-create.js\";\n\n/** Every Google Drive kind, for a host that registers the lot. */\nexport const GOOGLE_DRIVE_KINDS: NodeKindDefinition[] = [\n googleDriveFileGetKind,\n googleDriveFileListKind,\n googleDriveFolderKind,\n googleDrivePermissionCreateKind,\n];\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -83,6 +83,13 @@ declare const GOOGLE_DRIVE_CREDENTIALS: readonly [{
|
|
|
83
83
|
* safely be retried and may run concurrently. That is stated rather than
|
|
84
84
|
* assumed because the opposite — a provider that spends the token and revokes
|
|
85
85
|
* the grant on a replay — looks identical until it happens.
|
|
86
|
+
*
|
|
87
|
+
* Its consent grant is SHARED with every connector declaring grant "google":
|
|
88
|
+
* one OAuth client, one consent and one refresh token per person, scopes added
|
|
89
|
+
* as features are first used (authorizeParams). Revoking removes the WHOLE
|
|
90
|
+
* grant, so only a full disconnect revokes; a per-feature disconnect stops
|
|
91
|
+
* using the scope locally. Identify the account by the id_token's sub, never
|
|
92
|
+
* by email.
|
|
86
93
|
*/
|
|
87
94
|
declare const GOOGLE_DRIVE_OAUTH: {
|
|
88
95
|
readonly flow: "authorization_code";
|
|
@@ -93,6 +100,24 @@ declare const GOOGLE_DRIVE_OAUTH: {
|
|
|
93
100
|
readonly refreshTokenCredential: "refreshToken";
|
|
94
101
|
readonly refreshTokenRotates: false;
|
|
95
102
|
readonly accessTokenTtlSeconds: 3600;
|
|
103
|
+
readonly grant: "google";
|
|
104
|
+
readonly authorizeParams: {
|
|
105
|
+
readonly access_type: "offline";
|
|
106
|
+
readonly include_granted_scopes: "true";
|
|
107
|
+
};
|
|
108
|
+
readonly revoke: {
|
|
109
|
+
readonly url: "https://oauth2.googleapis.com/revoke";
|
|
110
|
+
readonly param: "token";
|
|
111
|
+
readonly scope: "grant";
|
|
112
|
+
};
|
|
113
|
+
readonly identity: {
|
|
114
|
+
readonly scope: "openid";
|
|
115
|
+
readonly claim: "sub";
|
|
116
|
+
readonly issuers: readonly ["https://accounts.google.com", "accounts.google.com"];
|
|
117
|
+
readonly jwksUrl: "https://www.googleapis.com/oauth2/v3/certs";
|
|
118
|
+
readonly audienceCredential: "clientId";
|
|
119
|
+
};
|
|
120
|
+
readonly restrictedScopes: readonly [];
|
|
96
121
|
};
|
|
97
122
|
/** Build a Google Drive node's connector metadata from the operation it performs. */
|
|
98
123
|
declare function googleDriveMeta(role: ConnectorMeta["role"], operation: string, docs: string): ConnectorMeta;
|
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,13 @@ declare const GOOGLE_DRIVE_CREDENTIALS: readonly [{
|
|
|
83
83
|
* safely be retried and may run concurrently. That is stated rather than
|
|
84
84
|
* assumed because the opposite — a provider that spends the token and revokes
|
|
85
85
|
* the grant on a replay — looks identical until it happens.
|
|
86
|
+
*
|
|
87
|
+
* Its consent grant is SHARED with every connector declaring grant "google":
|
|
88
|
+
* one OAuth client, one consent and one refresh token per person, scopes added
|
|
89
|
+
* as features are first used (authorizeParams). Revoking removes the WHOLE
|
|
90
|
+
* grant, so only a full disconnect revokes; a per-feature disconnect stops
|
|
91
|
+
* using the scope locally. Identify the account by the id_token's sub, never
|
|
92
|
+
* by email.
|
|
86
93
|
*/
|
|
87
94
|
declare const GOOGLE_DRIVE_OAUTH: {
|
|
88
95
|
readonly flow: "authorization_code";
|
|
@@ -93,6 +100,24 @@ declare const GOOGLE_DRIVE_OAUTH: {
|
|
|
93
100
|
readonly refreshTokenCredential: "refreshToken";
|
|
94
101
|
readonly refreshTokenRotates: false;
|
|
95
102
|
readonly accessTokenTtlSeconds: 3600;
|
|
103
|
+
readonly grant: "google";
|
|
104
|
+
readonly authorizeParams: {
|
|
105
|
+
readonly access_type: "offline";
|
|
106
|
+
readonly include_granted_scopes: "true";
|
|
107
|
+
};
|
|
108
|
+
readonly revoke: {
|
|
109
|
+
readonly url: "https://oauth2.googleapis.com/revoke";
|
|
110
|
+
readonly param: "token";
|
|
111
|
+
readonly scope: "grant";
|
|
112
|
+
};
|
|
113
|
+
readonly identity: {
|
|
114
|
+
readonly scope: "openid";
|
|
115
|
+
readonly claim: "sub";
|
|
116
|
+
readonly issuers: readonly ["https://accounts.google.com", "accounts.google.com"];
|
|
117
|
+
readonly jwksUrl: "https://www.googleapis.com/oauth2/v3/certs";
|
|
118
|
+
readonly audienceCredential: "clientId";
|
|
119
|
+
};
|
|
120
|
+
readonly restrictedScopes: readonly [];
|
|
96
121
|
};
|
|
97
122
|
/** Build a Google Drive node's connector metadata from the operation it performs. */
|
|
98
123
|
declare function googleDriveMeta(role: ConnectorMeta["role"], operation: string, docs: string): ConnectorMeta;
|
package/dist/index.js
CHANGED
|
@@ -48,7 +48,28 @@ var GOOGLE_DRIVE_OAUTH = {
|
|
|
48
48
|
"accessTokenCredential": "accessToken",
|
|
49
49
|
"refreshTokenCredential": "refreshToken",
|
|
50
50
|
"refreshTokenRotates": false,
|
|
51
|
-
"accessTokenTtlSeconds": 3600
|
|
51
|
+
"accessTokenTtlSeconds": 3600,
|
|
52
|
+
"grant": "google",
|
|
53
|
+
"authorizeParams": {
|
|
54
|
+
"access_type": "offline",
|
|
55
|
+
"include_granted_scopes": "true"
|
|
56
|
+
},
|
|
57
|
+
"revoke": {
|
|
58
|
+
"url": "https://oauth2.googleapis.com/revoke",
|
|
59
|
+
"param": "token",
|
|
60
|
+
"scope": "grant"
|
|
61
|
+
},
|
|
62
|
+
"identity": {
|
|
63
|
+
"scope": "openid",
|
|
64
|
+
"claim": "sub",
|
|
65
|
+
"issuers": [
|
|
66
|
+
"https://accounts.google.com",
|
|
67
|
+
"accounts.google.com"
|
|
68
|
+
],
|
|
69
|
+
"jwksUrl": "https://www.googleapis.com/oauth2/v3/certs",
|
|
70
|
+
"audienceCredential": "clientId"
|
|
71
|
+
},
|
|
72
|
+
"restrictedScopes": []
|
|
52
73
|
};
|
|
53
74
|
function googleDriveMeta(role, operation, docs) {
|
|
54
75
|
return { ...GOOGLE_DRIVE_SERVICE, role, operation, docs };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/service.ts","../src/kinds/file-get.ts","../src/kinds/file-list.ts","../src/kinds/folder-create.ts","../src/kinds/permission-create.ts","../src/index.ts"],"names":["defineConnectorKind","summarize"],"mappings":";;;AAiCO,IAAM,qBAAA,GAAwB;AAG9B,IAAM,oBAAA,GAAuB;AAAA,EAClC,OAAA,EAAS,cAAA;AAAA,EACT,YAAA,EAAc,cAAA;AAAA,EACd,MAAA,EAAQ,cAAA;AAAA,EACR,OAAA,EAAS;AACX;AA+BO,IAAM,wBAAA,GAA2B;AAAA,EACtC;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;AAAA,IACT,OAAA,EAAS,SAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,MAAA,EAAQ;AAAA,GACV;AAAA,EACA;AAAA,IACE,KAAA,EAAO,cAAA;AAAA,IACP,OAAA,EAAS,eAAA;AAAA,IACT,OAAA,EAAS,SAAA;AAAA,IACT,QAAA,EAAU,IAAA;AAAA,IACV,MAAA,EAAQ;AAAA;AAEZ;AAoBO,IAAM,kBAAA,GAAqB;AAAA,EAChC,M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,OAAA,EAAS,QAAA;AAAA,UACT,OAAA,EAAS;AAAA;AACX,OACF;AAAA,MACA,aAAA,EAAe;AAAA,KACjB;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,cAAA;AAAA,MACP,OAAA,EAAS,eAAA;AAAA,MACT,aAAA,EAAe;AAAA,KACjB;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,QAAA;AAAA,MACP,OAAA,EAAS,QAAA;AAAA,MACT,aAAA,EAAe;AAAA;AACjB,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,CAAC,EAAE,MAAA,OACbC,SAAAA,CAAU,mCAAA,EAAqC,QAAmC,cAAc;AACpG,CAAC;;;AClHM,IAAM,kBAAA,GAA2C;AAAA,EACtD,sBAAA;AAAA,EACA,uBAAA;AAAA,EACA,qBAAA;AAAA,EACA;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 -- google_drive\n */\n\n/**\n * Google Drive's identity on the authoring surface, shared by every Google\n * Drive 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 * Google Drive has no sandbox. Every folder created in live mode is real; use\n * the faker during development and delete live test folders 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 GOOGLE_DRIVE_SERVICE = {\n service: \"google_drive\",\n serviceTitle: \"Google Drive\",\n domain: \"productivity\",\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 Google Drive connection holds. */\nexport const GOOGLE_DRIVE_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 Google account; expires after one hour.\"\n },\n {\n \"key\": \"refreshToken\",\n \"label\": \"Refresh token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected Google account; the host uses it to refresh the access token.\"\n }\n] as const;\n\n/**\n * The OAuth2 exchange Google Drive requires — DECLARED here, performed by the\n * 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 GOOGLE_DRIVE_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/drive.file\"\n ],\n \"accessTokenCredential\": \"accessToken\",\n \"refreshTokenCredential\": \"refreshToken\",\n \"refreshTokenRotates\": false,\n \"accessTokenTtlSeconds\": 3600\n} as const;\n\n/** Build a Google Drive node's connector metadata from the operation it performs. */\nexport function googleDriveMeta(\n role: ConnectorMeta[\"role\"],\n operation: string,\n docs: string,\n): ConnectorMeta {\n return { ...GOOGLE_DRIVE_SERVICE, role, operation, docs };\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/file-get.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/file-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Google Drive file — Read one file's metadata and its download/view links.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FILE_GET_KIND = \"@particle-academy/google_drive_file_get\";\nexport const GOOGLE_DRIVE_FILE_GET_OPERATION = \"file_get\";\n\nexport const GOOGLE_DRIVE_FILE_GET_META = googleDriveMeta(\"action\", \"read a file\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get\");\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 GOOGLE_DRIVE_FILE_GET_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The file id.\"\n },\n {\n \"path\": \"data.name\",\n \"type\": \"string\",\n \"description\": \"The file name.\"\n },\n {\n \"path\": \"data.mimeType\",\n \"type\": \"string\",\n \"description\": \"The file's MIME type.\"\n },\n {\n \"path\": \"data.size\",\n \"type\": \"string\",\n \"description\": \"Bytes, as a decimal STRING -- Drive's own int64 convention. Absent for Google Workspace editor files (Docs, Sheets, Slides) and for folders.\"\n },\n {\n \"path\": \"data.parents\",\n \"type\": \"array\",\n \"description\": \"Parent folder ids. A file has at most one today even though the field stays an array.\"\n },\n {\n \"path\": \"data.modifiedTime\",\n \"type\": \"string\",\n \"description\": \"RFC 3339.\"\n },\n {\n \"path\": \"data.webViewLink\",\n \"type\": \"string\",\n \"description\": \"Opens the file in its Drive/editor viewer. Requires the viewer to already have access.\"\n },\n {\n \"path\": \"data.webContentLink\",\n \"type\": \"string\",\n \"description\": \"A direct download URL for files with binary content. Absent for Google Workspace editor files and folders -- those export instead, which this connector does not yet offer.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDriveFileGetKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FILE_GET_META, {\n name: GOOGLE_DRIVE_FILE_GET_KIND,\n aliases: [\"google_drive_file_get\"],\n label: \"Google Drive file\",\n description: \"Read one file's metadata and its download/view links.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GOOGLE_DRIVE_FILE_GET_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"fileId\",\n \"label\": \"File ID\",\n \"required\": true,\n \"description\": \"From file_list, or another node's output.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FILE_GET_META, config as Record<string, unknown>, \"read a file\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/file-list.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/file-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * List Google Drive files — List files this app created (or the user\n * explicitly opened) in Google Drive. Under the drive.file scope this\n * connector uses, a file created by any other app or picked up in the Drive UI\n * directly never appears here.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FILE_LIST_KIND = \"@particle-academy/google_drive_file_list\";\nexport const GOOGLE_DRIVE_FILE_LIST_OPERATION = \"file_list\";\n\nexport const GOOGLE_DRIVE_FILE_LIST_META = googleDriveMeta(\"action\", \"list files\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list\");\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 GOOGLE_DRIVE_FILE_LIST_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.files\",\n \"type\": \"array\",\n \"description\": \"id, name, mimeType, size, modifiedTime, webViewLink per file -- leaner than file_get's projection. Read one file directly with file_get for parents and webContentLink.\"\n },\n {\n \"path\": \"data.nextPageToken\",\n \"type\": \"string\",\n \"description\": \"Present when there is another page.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDriveFileListKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FILE_LIST_META, {\n name: GOOGLE_DRIVE_FILE_LIST_KIND,\n aliases: [\"google_drive_file_list\"],\n label: \"List Google Drive files\",\n description: \"List files this app created (or the user explicitly opened) in Google Drive. Under the drive.file scope this connector uses, a file created by any other app or picked up in the Drive UI directly never appears here.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GOOGLE_DRIVE_FILE_LIST_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"q\",\n \"label\": \"Search query\",\n \"description\": \"Drive's query syntax, e.g. \\\"mimeType='application/pdf' and trashed=false\\\". Leave blank to list everything this app can see.\"\n },\n {\n \"type\": \"number\",\n \"key\": \"pageSize\",\n \"label\": \"Page size\",\n \"min\": 1,\n \"max\": 1000,\n \"default\": 100,\n \"description\": \"Files per page. Drive's maximum is 1000.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"pageToken\",\n \"label\": \"Page token\",\n \"description\": \"From a previous page's nextPageToken.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"orderBy\",\n \"label\": \"Order by\",\n \"description\": \"A comma-separated list of Drive sort keys, e.g. \\\"modifiedTime desc\\\". Leave blank for Drive's default order.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FILE_LIST_META, config as Record<string, unknown>, \"list files\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/folder-create.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/folder-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Google Drive folder — Create a folder in Google Drive.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create\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 { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FOLDER_KIND = \"@particle-academy/google_drive_folder\";\nexport const GOOGLE_DRIVE_FOLDER_OPERATION = \"folder_create\";\n\nexport const GOOGLE_DRIVE_FOLDER_META = googleDriveMeta(\"action\", \"create a folder\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create\");\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 GOOGLE_DRIVE_FOLDER_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The created folder's id.\"\n },\n {\n \"path\": \"data.name\",\n \"type\": \"string\",\n \"description\": \"The folder name Google stored.\"\n },\n {\n \"path\": \"data.mimeType\",\n \"type\": \"string\",\n \"description\": \"The fixed Google Drive folder MIME type.\"\n },\n {\n \"path\": \"data.parents\",\n \"type\": \"array\",\n \"description\": \"The parent folder id array returned by Drive.\"\n }\n];\n\nexport const googleDriveFolderKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FOLDER_META, {\n name: GOOGLE_DRIVE_FOLDER_KIND,\n aliases: [\"google_drive_folder\"],\n label: \"Google Drive folder\",\n description: \"Create a folder in Google Drive.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: GOOGLE_DRIVE_FOLDER_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"name\",\n \"label\": \"Folder name\",\n \"required\": true,\n \"description\": \"The folder name. Drive does not require names to be unique within a parent.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"parents\",\n \"label\": \"Parent folder IDs\",\n \"description\": \"Parent folder ids, comma separated. Leave empty to create the folder in My Drive.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FOLDER_META, config as Record<string, unknown>, \"create a folder\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/permission-create.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/permission-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Share a Google Drive file — Grant a user, group, domain, or anyone with the\n * link access to a file.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/create\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 { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_KIND = \"@particle-academy/google_drive_permission_create\";\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_OPERATION = \"permission_create\";\n\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_META = googleDriveMeta(\"action\", \"share a file\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/create\");\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 GOOGLE_DRIVE_PERMISSION_CREATE_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The new permission's id.\"\n },\n {\n \"path\": \"data.type\",\n \"type\": \"string\",\n \"description\": \"Echoes what was sent.\"\n },\n {\n \"path\": \"data.role\",\n \"type\": \"string\",\n \"description\": \"Echoes what was sent.\"\n },\n {\n \"path\": \"data.emailAddress\",\n \"type\": \"string\",\n \"description\": \"Present for a user or group grant.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDrivePermissionCreateKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_PERMISSION_CREATE_META, {\n name: GOOGLE_DRIVE_PERMISSION_CREATE_KIND,\n aliases: [\"google_drive_permission_create\"],\n label: \"Share a Google Drive file\",\n description: \"Grant a user, group, domain, or anyone with the link access to a file.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: GOOGLE_DRIVE_PERMISSION_CREATE_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"fileId\",\n \"label\": \"File ID\",\n \"required\": true\n },\n {\n \"type\": \"select\",\n \"key\": \"type\",\n \"label\": \"Grantee type\",\n \"required\": true,\n \"default\": \"user\",\n \"options\": [\n {\n \"value\": \"user\",\n \"label\": \"A specific person\"\n },\n {\n \"value\": \"group\",\n \"label\": \"A Google Group\"\n },\n {\n \"value\": \"domain\",\n \"label\": \"Everyone in a domain\"\n },\n {\n \"value\": \"anyone\",\n \"label\": \"Anyone with the link\"\n }\n ]\n },\n {\n \"type\": \"select\",\n \"key\": \"role\",\n \"label\": \"Role\",\n \"required\": true,\n \"default\": \"reader\",\n \"options\": [\n {\n \"value\": \"reader\",\n \"label\": \"Reader\"\n },\n {\n \"value\": \"commenter\",\n \"label\": \"Commenter\"\n },\n {\n \"value\": \"writer\",\n \"label\": \"Writer\"\n }\n ],\n \"description\": \"organizer, fileOrganizer and owner exist in Drive's API but only apply inside a shared drive, which this action does not target.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"emailAddress\",\n \"label\": \"Email address\",\n \"description\": \"Required when the grantee type is a person or a Google Group. Ignored for domain and anyone.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"domain\",\n \"label\": \"Domain\",\n \"description\": \"Required when the grantee type is domain, e.g. example.com. Ignored otherwise.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_PERMISSION_CREATE_META, config as Record<string, unknown>, \"share a file\"),\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 -- google_drive\n */\n\n/**\n * Google Drive'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/file-get.js\";\nexport * from \"./kinds/file-list.js\";\nexport * from \"./kinds/folder-create.js\";\nexport * from \"./kinds/permission-create.js\";\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { googleDriveFileGetKind } from \"./kinds/file-get.js\";\nimport { googleDriveFileListKind } from \"./kinds/file-list.js\";\nimport { googleDriveFolderKind } from \"./kinds/folder-create.js\";\nimport { googleDrivePermissionCreateKind } from \"./kinds/permission-create.js\";\n\n/** Every Google Drive kind, for a host that registers the lot. */\nexport const GOOGLE_DRIVE_KINDS: NodeKindDefinition[] = [\n googleDriveFileGetKind,\n googleDriveFileListKind,\n googleDriveFolderKind,\n googleDrivePermissionCreateKind,\n];\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/service.ts","../src/kinds/file-get.ts","../src/kinds/file-list.ts","../src/kinds/folder-create.ts","../src/kinds/permission-create.ts","../src/index.ts"],"names":["defineConnectorKind","summarize"],"mappings":";;;AAiCO,IAAM,qBAAA,GAAwB;AAG9B,I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ACX;AAAA,QACA;AAAA,UACE,OAAA,EAAS,WAAA;AAAA,UACT,OAAA,EAAS;AAAA,SACX;AAAA,QACA;AAAA,UACE,OAAA,EAAS,QAAA;AAAA,UACT,OAAA,EAAS;AAAA;AACX,OACF;AAAA,MACA,aAAA,EAAe;AAAA,KACjB;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,cAAA;AAAA,MACP,OAAA,EAAS,eAAA;AAAA,MACT,aAAA,EAAe;AAAA,KACjB;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAO,QAAA;AAAA,MACP,OAAA,EAAS,QAAA;AAAA,MACT,aAAA,EAAe;AAAA;AACjB,GACF;AAAA,EACA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,UAAA,EAAY,CAAC,EAAE,MAAA,OACbC,SAAAA,CAAU,mCAAA,EAAqC,QAAmC,cAAc;AACpG,CAAC;;;AClHM,IAAM,kBAAA,GAA2C;AAAA,EACtD,sBAAA;AAAA,EACA,uBAAA;AAAA,EACA,qBAAA;AAAA,EACA;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 -- google_drive\n */\n\n/**\n * Google Drive's identity on the authoring surface, shared by every Google\n * Drive 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 * Google Drive has no sandbox. Every folder created in live mode is real; use\n * the faker during development and delete live test folders 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 GOOGLE_DRIVE_SERVICE = {\n service: \"google_drive\",\n serviceTitle: \"Google Drive\",\n domain: \"productivity\",\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 Google Drive connection holds. */\nexport const GOOGLE_DRIVE_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 Google account; expires after one hour.\"\n },\n {\n \"key\": \"refreshToken\",\n \"label\": \"Refresh token\",\n \"scope\": \"account\",\n \"secret\": true,\n \"help\": \"Per connected Google account; the host uses it to refresh the access token.\"\n }\n] as const;\n\n/**\n * The OAuth2 exchange Google Drive requires — DECLARED here, performed by the\n * 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 *\n * Its consent grant is SHARED with every connector declaring grant \"google\":\n * one OAuth client, one consent and one refresh token per person, scopes added\n * as features are first used (authorizeParams). Revoking removes the WHOLE\n * grant, so only a full disconnect revokes; a per-feature disconnect stops\n * using the scope locally. Identify the account by the id_token's sub, never\n * by email.\n */\nexport const GOOGLE_DRIVE_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/drive.file\"\n ],\n \"accessTokenCredential\": \"accessToken\",\n \"refreshTokenCredential\": \"refreshToken\",\n \"refreshTokenRotates\": false,\n \"accessTokenTtlSeconds\": 3600,\n \"grant\": \"google\",\n \"authorizeParams\": {\n \"access_type\": \"offline\",\n \"include_granted_scopes\": \"true\"\n },\n \"revoke\": {\n \"url\": \"https://oauth2.googleapis.com/revoke\",\n \"param\": \"token\",\n \"scope\": \"grant\"\n },\n \"identity\": {\n \"scope\": \"openid\",\n \"claim\": \"sub\",\n \"issuers\": [\n \"https://accounts.google.com\",\n \"accounts.google.com\"\n ],\n \"jwksUrl\": \"https://www.googleapis.com/oauth2/v3/certs\",\n \"audienceCredential\": \"clientId\"\n },\n \"restrictedScopes\": []\n} as const;\n\n/** Build a Google Drive node's connector metadata from the operation it performs. */\nexport function googleDriveMeta(\n role: ConnectorMeta[\"role\"],\n operation: string,\n docs: string,\n): ConnectorMeta {\n return { ...GOOGLE_DRIVE_SERVICE, role, operation, docs };\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/file-get.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/file-get.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Google Drive file — Read one file's metadata and its download/view links.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FILE_GET_KIND = \"@particle-academy/google_drive_file_get\";\nexport const GOOGLE_DRIVE_FILE_GET_OPERATION = \"file_get\";\n\nexport const GOOGLE_DRIVE_FILE_GET_META = googleDriveMeta(\"action\", \"read a file\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/get\");\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 GOOGLE_DRIVE_FILE_GET_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The file id.\"\n },\n {\n \"path\": \"data.name\",\n \"type\": \"string\",\n \"description\": \"The file name.\"\n },\n {\n \"path\": \"data.mimeType\",\n \"type\": \"string\",\n \"description\": \"The file's MIME type.\"\n },\n {\n \"path\": \"data.size\",\n \"type\": \"string\",\n \"description\": \"Bytes, as a decimal STRING -- Drive's own int64 convention. Absent for Google Workspace editor files (Docs, Sheets, Slides) and for folders.\"\n },\n {\n \"path\": \"data.parents\",\n \"type\": \"array\",\n \"description\": \"Parent folder ids. A file has at most one today even though the field stays an array.\"\n },\n {\n \"path\": \"data.modifiedTime\",\n \"type\": \"string\",\n \"description\": \"RFC 3339.\"\n },\n {\n \"path\": \"data.webViewLink\",\n \"type\": \"string\",\n \"description\": \"Opens the file in its Drive/editor viewer. Requires the viewer to already have access.\"\n },\n {\n \"path\": \"data.webContentLink\",\n \"type\": \"string\",\n \"description\": \"A direct download URL for files with binary content. Absent for Google Workspace editor files and folders -- those export instead, which this connector does not yet offer.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDriveFileGetKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FILE_GET_META, {\n name: GOOGLE_DRIVE_FILE_GET_KIND,\n aliases: [\"google_drive_file_get\"],\n label: \"Google Drive file\",\n description: \"Read one file's metadata and its download/view links.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GOOGLE_DRIVE_FILE_GET_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"fileId\",\n \"label\": \"File ID\",\n \"required\": true,\n \"description\": \"From file_list, or another node's output.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FILE_GET_META, config as Record<string, unknown>, \"read a file\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/file-list.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/file-list.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * List Google Drive files — List files this app created (or the user\n * explicitly opened) in Google Drive. Under the drive.file scope this\n * connector uses, a file created by any other app or picked up in the Drive UI\n * directly never appears here.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list\n */\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { defineConnectorKind, summarize, type OutputField } from \"@particle-academy/fancy-flow/connectors\";\nimport { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FILE_LIST_KIND = \"@particle-academy/google_drive_file_list\";\nexport const GOOGLE_DRIVE_FILE_LIST_OPERATION = \"file_list\";\n\nexport const GOOGLE_DRIVE_FILE_LIST_META = googleDriveMeta(\"action\", \"list files\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/list\");\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 GOOGLE_DRIVE_FILE_LIST_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.files\",\n \"type\": \"array\",\n \"description\": \"id, name, mimeType, size, modifiedTime, webViewLink per file -- leaner than file_get's projection. Read one file directly with file_get for parents and webContentLink.\"\n },\n {\n \"path\": \"data.nextPageToken\",\n \"type\": \"string\",\n \"description\": \"Present when there is another page.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDriveFileListKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FILE_LIST_META, {\n name: GOOGLE_DRIVE_FILE_LIST_KIND,\n aliases: [\"google_drive_file_list\"],\n label: \"List Google Drive files\",\n description: \"List files this app created (or the user explicitly opened) in Google Drive. Under the drive.file scope this connector uses, a file created by any other app or picked up in the Drive UI directly never appears here.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"none\",\n outputShape: GOOGLE_DRIVE_FILE_LIST_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"q\",\n \"label\": \"Search query\",\n \"description\": \"Drive's query syntax, e.g. \\\"mimeType='application/pdf' and trashed=false\\\". Leave blank to list everything this app can see.\"\n },\n {\n \"type\": \"number\",\n \"key\": \"pageSize\",\n \"label\": \"Page size\",\n \"min\": 1,\n \"max\": 1000,\n \"default\": 100,\n \"description\": \"Files per page. Drive's maximum is 1000.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"pageToken\",\n \"label\": \"Page token\",\n \"description\": \"From a previous page's nextPageToken.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"orderBy\",\n \"label\": \"Order by\",\n \"description\": \"A comma-separated list of Drive sort keys, e.g. \\\"modifiedTime desc\\\". Leave blank for Drive's default order.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FILE_LIST_META, config as Record<string, unknown>, \"list files\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/folder-create.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/folder-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Google Drive folder — Create a folder in Google Drive.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create\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 { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_FOLDER_KIND = \"@particle-academy/google_drive_folder\";\nexport const GOOGLE_DRIVE_FOLDER_OPERATION = \"folder_create\";\n\nexport const GOOGLE_DRIVE_FOLDER_META = googleDriveMeta(\"action\", \"create a folder\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/files/create\");\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 GOOGLE_DRIVE_FOLDER_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The created folder's id.\"\n },\n {\n \"path\": \"data.name\",\n \"type\": \"string\",\n \"description\": \"The folder name Google stored.\"\n },\n {\n \"path\": \"data.mimeType\",\n \"type\": \"string\",\n \"description\": \"The fixed Google Drive folder MIME type.\"\n },\n {\n \"path\": \"data.parents\",\n \"type\": \"array\",\n \"description\": \"The parent folder id array returned by Drive.\"\n }\n];\n\nexport const googleDriveFolderKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_FOLDER_META, {\n name: GOOGLE_DRIVE_FOLDER_KIND,\n aliases: [\"google_drive_folder\"],\n label: \"Google Drive folder\",\n description: \"Create a folder in Google Drive.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: GOOGLE_DRIVE_FOLDER_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"name\",\n \"label\": \"Folder name\",\n \"required\": true,\n \"description\": \"The folder name. Drive does not require names to be unique within a parent.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"parents\",\n \"label\": \"Parent folder IDs\",\n \"description\": \"Parent folder ids, comma separated. Leave empty to create the folder in My Drive.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_FOLDER_META, config as Record<string, unknown>, \"create a folder\"),\n});\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/permission-create.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/permission-create.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- google_drive\n */\n\n/**\n * Share a Google Drive file — Grant a user, group, domain, or anyone with the\n * link access to a file.\n *\n * https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/create\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 { googleDriveMeta } from \"../service.js\";\n\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_KIND = \"@particle-academy/google_drive_permission_create\";\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_OPERATION = \"permission_create\";\n\nexport const GOOGLE_DRIVE_PERMISSION_CREATE_META = googleDriveMeta(\"action\", \"share a file\", \"https://developers.google.com/workspace/drive/api/reference/rest/v3/permissions/create\");\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 GOOGLE_DRIVE_PERMISSION_CREATE_OUTPUT: OutputField[] = [\n {\n \"path\": \"data.id\",\n \"type\": \"string\",\n \"description\": \"The new permission's id.\"\n },\n {\n \"path\": \"data.type\",\n \"type\": \"string\",\n \"description\": \"Echoes what was sent.\"\n },\n {\n \"path\": \"data.role\",\n \"type\": \"string\",\n \"description\": \"Echoes what was sent.\"\n },\n {\n \"path\": \"data.emailAddress\",\n \"type\": \"string\",\n \"description\": \"Present for a user or group grant.\"\n },\n {\n \"path\": \"mode\",\n \"type\": \"string\",\n \"description\": \"Which estate this ran against. Google has no sandbox, so: fake or live.\"\n }\n];\n\nexport const googleDrivePermissionCreateKind: NodeKindDefinition = defineConnectorKind(GOOGLE_DRIVE_PERMISSION_CREATE_META, {\n name: GOOGLE_DRIVE_PERMISSION_CREATE_KIND,\n aliases: [\"google_drive_permission_create\"],\n label: \"Share a Google Drive file\",\n description: \"Grant a user, group, domain, or anyone with the link access to a file.\",\n inputs: [{ id: \"in\" }],\n outputs: [{ id: \"out\" }],\n sideEffects: \"unsafe-to-replay\",\n outputShape: GOOGLE_DRIVE_PERMISSION_CREATE_OUTPUT,\n configSchema: [\n {\n \"type\": \"text\",\n \"key\": \"fileId\",\n \"label\": \"File ID\",\n \"required\": true\n },\n {\n \"type\": \"select\",\n \"key\": \"type\",\n \"label\": \"Grantee type\",\n \"required\": true,\n \"default\": \"user\",\n \"options\": [\n {\n \"value\": \"user\",\n \"label\": \"A specific person\"\n },\n {\n \"value\": \"group\",\n \"label\": \"A Google Group\"\n },\n {\n \"value\": \"domain\",\n \"label\": \"Everyone in a domain\"\n },\n {\n \"value\": \"anyone\",\n \"label\": \"Anyone with the link\"\n }\n ]\n },\n {\n \"type\": \"select\",\n \"key\": \"role\",\n \"label\": \"Role\",\n \"required\": true,\n \"default\": \"reader\",\n \"options\": [\n {\n \"value\": \"reader\",\n \"label\": \"Reader\"\n },\n {\n \"value\": \"commenter\",\n \"label\": \"Commenter\"\n },\n {\n \"value\": \"writer\",\n \"label\": \"Writer\"\n }\n ],\n \"description\": \"organizer, fileOrganizer and owner exist in Drive's API but only apply inside a shared drive, which this action does not target.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"emailAddress\",\n \"label\": \"Email address\",\n \"description\": \"Required when the grantee type is a person or a Google Group. Ignored for domain and anyone.\"\n },\n {\n \"type\": \"text\",\n \"key\": \"domain\",\n \"label\": \"Domain\",\n \"description\": \"Required when the grantee type is domain, e.g. example.com. Ignored otherwise.\"\n }\n ],\n defaultConfig: {\n \"mode\": \"auto\"\n },\n renderBody: ({ config }) =>\n summarize(GOOGLE_DRIVE_PERMISSION_CREATE_META, config as Record<string, unknown>, \"share a file\"),\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 -- google_drive\n */\n\n/**\n * Google Drive'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/file-get.js\";\nexport * from \"./kinds/file-list.js\";\nexport * from \"./kinds/folder-create.js\";\nexport * from \"./kinds/permission-create.js\";\n\nimport type { NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport { googleDriveFileGetKind } from \"./kinds/file-get.js\";\nimport { googleDriveFileListKind } from \"./kinds/file-list.js\";\nimport { googleDriveFolderKind } from \"./kinds/folder-create.js\";\nimport { googleDrivePermissionCreateKind } from \"./kinds/permission-create.js\";\n\n/** Every Google Drive kind, for a host that registers the lot. */\nexport const GOOGLE_DRIVE_KINDS: NodeKindDefinition[] = [\n googleDriveFileGetKind,\n googleDriveFileListKind,\n googleDriveFolderKind,\n googleDrivePermissionCreateKind,\n];\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-academy/google-drive-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Google Drive'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",
|