runline 0.32.0 → 0.34.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/dist/auth/oauth2.d.ts +7 -1
- package/dist/auth/oauth2.js +10 -0
- package/dist/auth/token.d.ts +1 -0
- package/dist/auth/token.js +19 -1
- package/dist/auth/types.d.ts +22 -1
- package/dist/core/engine.d.ts +7 -0
- package/dist/core/engine.js +9 -0
- package/dist/credentials/policy.d.ts +53 -1
- package/dist/credentials/policy.js +146 -6
- package/dist/credentials/registry.d.ts +9 -0
- package/dist/credentials/registry.js +179 -22
- package/dist/credentials/transport.d.ts +48 -2
- package/dist/credentials/transport.js +248 -70
- package/dist/credentials/types.d.ts +167 -10
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/dist/plugin/api.d.ts +7 -0
- package/dist/plugin/api.js +7 -0
- package/dist/plugin/types.d.ts +12 -0
- package/dist/plugins/_shared/credentialAdapter.js +79 -15
- package/dist/plugins/_shared/credentials.js +389 -0
- package/dist/plugins/_shared/googleAuth.js +9 -40
- package/dist/plugins/_shared/googleCredentials.js +28 -7
- package/dist/plugins/_shared/microsoftAuth.js +13 -44
- package/dist/plugins/_shared/microsoftCredentials.js +30 -8
- package/dist/plugins/_shared/provider.js +2 -14
- package/dist/plugins/_shared/shiftCloud.js +22 -34
- package/dist/plugins/_shared/shiftCredentials.js +83 -0
- package/dist/plugins/_shared/shiftUpload.js +1 -1
- package/dist/plugins/actionNetwork/src/credentials.js +14 -0
- package/dist/plugins/actionNetwork/src/index.js +39 -50
- package/dist/plugins/activeCampaign/src/credentials.js +22 -0
- package/dist/plugins/activeCampaign/src/index.js +61 -132
- package/dist/plugins/adalo/src/credentials.js +16 -0
- package/dist/plugins/adalo/src/index.js +19 -43
- package/dist/plugins/affinity/src/credentials.js +19 -0
- package/dist/plugins/affinity/src/index.js +29 -54
- package/dist/plugins/agileCrm/src/credentials.js +16 -0
- package/dist/plugins/agileCrm/src/index.js +46 -112
- package/dist/plugins/airtable/src/credentials.js +19 -0
- package/dist/plugins/airtable/src/index.js +37 -50
- package/dist/plugins/airtop/src/credentials.js +20 -0
- package/dist/plugins/airtop/src/index.js +51 -75
- package/dist/plugins/apiTemplateIo/src/credentials.js +19 -0
- package/dist/plugins/apiTemplateIo/src/index.js +14 -31
- package/dist/plugins/asana/src/credentials.js +19 -0
- package/dist/plugins/asana/src/index.js +51 -72
- package/dist/plugins/autopilot/src/credentials.js +19 -0
- package/dist/plugins/autopilot/src/index.js +38 -45
- package/dist/plugins/bambooHr/src/credentials.js +16 -0
- package/dist/plugins/bambooHr/src/index.js +41 -67
- package/dist/plugins/bannerbear/src/credentials.js +19 -0
- package/dist/plugins/bannerbear/src/index.js +15 -27
- package/dist/plugins/baserow/src/credentials.js +17 -0
- package/dist/plugins/baserow/src/index.js +23 -49
- package/dist/plugins/beeminder/src/credentials.js +19 -0
- package/dist/plugins/beeminder/src/index.js +32 -54
- package/dist/plugins/bitly/src/credentials.js +19 -0
- package/dist/plugins/bitly/src/index.js +12 -26
- package/dist/plugins/bitwarden/src/credentials.js +62 -0
- package/dist/plugins/bitwarden/src/index.js +34 -80
- package/dist/plugins/box/src/credentials.js +19 -0
- package/dist/plugins/box/src/index.js +24 -49
- package/dist/plugins/brandfetch/src/credentials.js +13 -0
- package/dist/plugins/brandfetch/src/index.js +12 -17
- package/dist/plugins/brevo/src/credentials.js +19 -0
- package/dist/plugins/brevo/src/index.js +30 -51
- package/dist/plugins/bubble/src/credentials.js +28 -0
- package/dist/plugins/bubble/src/index.js +29 -65
- package/dist/plugins/chargebee/src/credentials.js +16 -0
- package/dist/plugins/chargebee/src/index.js +15 -45
- package/dist/plugins/circleci/src/credentials.js +19 -0
- package/dist/plugins/circleci/src/index.js +19 -39
- package/dist/plugins/ciscoWebex/src/credentials.js +19 -0
- package/dist/plugins/ciscoWebex/src/index.js +43 -61
- package/dist/plugins/clearbit/src/credentials.js +22 -0
- package/dist/plugins/clearbit/src/index.js +11 -21
- package/dist/plugins/clickup/src/credentials.js +19 -0
- package/dist/plugins/clickup/src/index.js +85 -117
- package/dist/plugins/clockify/src/credentials.js +19 -0
- package/dist/plugins/clockify/src/index.js +46 -61
- package/dist/plugins/cloudflare/src/credentials.js +19 -0
- package/dist/plugins/cloudflare/src/index.js +19 -34
- package/dist/plugins/cockpit/src/credentials.js +17 -0
- package/dist/plugins/cockpit/src/index.js +18 -31
- package/dist/plugins/coda/src/credentials.js +19 -0
- package/dist/plugins/coda/src/index.js +33 -50
- package/dist/plugins/coingecko/src/credentials.js +20 -0
- package/dist/plugins/coingecko/src/index.js +24 -34
- package/dist/plugins/contentful/src/credentials.js +26 -0
- package/dist/plugins/contentful/src/index.js +19 -40
- package/dist/plugins/convertkit/src/credentials.js +26 -0
- package/dist/plugins/convertkit/src/index.js +27 -45
- package/dist/plugins/copper/src/credentials.js +17 -0
- package/dist/plugins/copper/src/index.js +25 -47
- package/dist/plugins/cortex/src/credentials.js +28 -0
- package/dist/plugins/cortex/src/index.js +26 -49
- package/dist/plugins/currents/src/credentials.js +19 -0
- package/dist/plugins/currents/src/index.js +46 -59
- package/dist/plugins/customerIo/src/credentials.js +52 -0
- package/dist/plugins/customerIo/src/index.js +30 -58
- package/dist/plugins/databricks/src/credentials.js +13 -0
- package/dist/plugins/databricks/src/index.js +51 -103
- package/dist/plugins/deepl/src/credentials.js +19 -0
- package/dist/plugins/deepl/src/index.js +13 -39
- package/dist/plugins/demio/src/credentials.js +26 -0
- package/dist/plugins/demio/src/index.js +17 -41
- package/dist/plugins/dhl/src/credentials.js +13 -0
- package/dist/plugins/dhl/src/index.js +8 -19
- package/dist/plugins/discord/src/credentials.js +19 -0
- package/dist/plugins/discord/src/index.js +30 -58
- package/dist/plugins/discourse/src/credentials.js +18 -0
- package/dist/plugins/discourse/src/index.js +36 -53
- package/dist/plugins/disqus/src/credentials.js +13 -0
- package/dist/plugins/disqus/src/index.js +14 -32
- package/dist/plugins/drift/src/credentials.js +13 -0
- package/dist/plugins/drift/src/index.js +16 -26
- package/dist/plugins/dropbox/src/credentials.js +13 -0
- package/dist/plugins/dropbox/src/index.js +23 -30
- package/dist/plugins/dropcontact/src/credentials.js +13 -0
- package/dist/plugins/dropcontact/src/index.js +13 -18
- package/dist/plugins/egoi/src/credentials.js +19 -0
- package/dist/plugins/egoi/src/index.js +23 -38
- package/dist/plugins/elasticsearch/src/credentials.js +18 -0
- package/dist/plugins/elasticsearch/src/index.js +27 -48
- package/dist/plugins/elevenlabs/src/credentials.js +30 -0
- package/dist/plugins/elevenlabs/src/index.js +4 -1
- package/dist/plugins/elevenlabs/src/schemas.js +2 -1
- package/dist/plugins/elevenlabs/src/shared.js +74 -35
- package/dist/plugins/elevenlabs/src/workflows.js +2 -2
- package/dist/plugins/emelia/src/credentials.js +14 -0
- package/dist/plugins/emelia/src/index.js +19 -23
- package/dist/plugins/erpnext/src/credentials.js +27 -0
- package/dist/plugins/erpnext/src/index.js +21 -42
- package/dist/plugins/facebookGraph/src/credentials.js +20 -0
- package/dist/plugins/facebookGraph/src/index.js +39 -37
- package/dist/plugins/fal/src/credentials.js +14 -0
- package/dist/plugins/fal/src/index.js +4 -2
- package/dist/plugins/fal/src/shared.js +58 -63
- package/dist/plugins/freshdesk/src/credentials.js +20 -0
- package/dist/plugins/freshdesk/src/index.js +25 -46
- package/dist/plugins/freshservice/src/credentials.js +16 -0
- package/dist/plugins/freshservice/src/index.js +37 -58
- package/dist/plugins/freshworksCrm/src/credentials.js +16 -0
- package/dist/plugins/freshworksCrm/src/index.js +20 -39
- package/dist/plugins/getresponse/src/credentials.js +22 -0
- package/dist/plugins/getresponse/src/index.js +20 -32
- package/dist/plugins/gett/src/credentials.js +64 -0
- package/dist/plugins/gett/src/index.js +11 -6
- package/dist/plugins/gett/src/login.js +24 -0
- package/dist/plugins/gett/src/session.js +15 -38
- package/dist/plugins/gett/src/shared.js +41 -84
- package/dist/plugins/ghost/src/credentials.js +36 -0
- package/dist/plugins/ghost/src/index.js +18 -59
- package/dist/plugins/github/src/credentials.js +18 -0
- package/dist/plugins/github/src/index.js +55 -78
- package/dist/plugins/gitlab/src/credentials.js +24 -0
- package/dist/plugins/gitlab/src/index.js +29 -48
- package/dist/plugins/gmail/src/index.js +26 -24
- package/dist/plugins/gong/src/credentials.js +16 -0
- package/dist/plugins/gong/src/index.js +16 -32
- package/dist/plugins/googleAppsScript/src/index.js +108 -42
- package/dist/plugins/googleCalendar/src/index.js +15 -13
- package/dist/plugins/googleContacts/src/index.js +12 -9
- package/dist/plugins/googleDocs/src/index.js +2 -0
- package/dist/plugins/googleDocs/src/shared.js +2 -1
- package/dist/plugins/googleDrive/src/index.js +50 -53
- package/dist/plugins/googleImage/src/credentials.js +14 -0
- package/dist/plugins/googleImage/src/index.js +14 -25
- package/dist/plugins/googleSheets/src/index.js +26 -27
- package/dist/plugins/googleSlides/src/index.js +6 -4
- package/dist/plugins/googleTasks/src/index.js +13 -11
- package/dist/plugins/gotify/src/credentials.js +32 -0
- package/dist/plugins/gotify/src/index.js +14 -36
- package/dist/plugins/gotowebinar/src/credentials.js +13 -0
- package/dist/plugins/gotowebinar/src/index.js +52 -69
- package/dist/plugins/grafana/src/credentials.js +16 -0
- package/dist/plugins/grafana/src/index.js +34 -53
- package/dist/plugins/graphql/src/credentials.js +42 -0
- package/dist/plugins/graphql/src/index.js +21 -46
- package/dist/plugins/grist/src/credentials.js +30 -0
- package/dist/plugins/grist/src/index.js +14 -43
- package/dist/plugins/halopsa/src/credentials.js +56 -0
- package/dist/plugins/halopsa/src/index.js +20 -47
- package/dist/plugins/harvest/src/credentials.js +20 -0
- package/dist/plugins/harvest/src/index.js +24 -43
- package/dist/plugins/helpscout/src/credentials.js +13 -0
- package/dist/plugins/helpscout/src/index.js +26 -38
- package/dist/plugins/highlevel/src/credentials.js +19 -0
- package/dist/plugins/highlevel/src/index.js +34 -63
- package/dist/plugins/homeAssistant/src/credentials.js +27 -0
- package/dist/plugins/homeAssistant/src/index.js +34 -52
- package/dist/plugins/hubspot/src/credentials.js +16 -0
- package/dist/plugins/hubspot/src/index.js +29 -41
- package/dist/plugins/humanticAi/src/credentials.js +13 -0
- package/dist/plugins/humanticAi/src/index.js +15 -22
- package/dist/plugins/hunter/src/credentials.js +13 -0
- package/dist/plugins/hunter/src/index.js +18 -17
- package/dist/plugins/intercom/src/credentials.js +19 -0
- package/dist/plugins/intercom/src/index.js +25 -38
- package/dist/plugins/iterable/src/credentials.js +17 -0
- package/dist/plugins/iterable/src/index.js +26 -40
- package/dist/plugins/jenkins/src/credentials.js +16 -0
- package/dist/plugins/jenkins/src/index.js +22 -36
- package/dist/plugins/jira/src/credentials.js +16 -0
- package/dist/plugins/jira/src/index.js +35 -61
- package/dist/plugins/keap/src/credentials.js +19 -0
- package/dist/plugins/keap/src/index.js +43 -71
- package/dist/plugins/kobotoolbox/src/credentials.js +13 -0
- package/dist/plugins/kobotoolbox/src/index.js +46 -84
- package/dist/plugins/lemlist/src/credentials.js +19 -0
- package/dist/plugins/lemlist/src/index.js +35 -47
- package/dist/plugins/linear/src/attachments.js +7 -7
- package/dist/plugins/linear/src/comments.js +7 -7
- package/dist/plugins/linear/src/credentials.js +17 -0
- package/dist/plugins/linear/src/cycles.js +5 -5
- package/dist/plugins/linear/src/index.js +2 -0
- package/dist/plugins/linear/src/initiatives.js +6 -6
- package/dist/plugins/linear/src/issues.js +14 -14
- package/dist/plugins/linear/src/labels.js +6 -6
- package/dist/plugins/linear/src/organization.js +2 -2
- package/dist/plugins/linear/src/projects.js +12 -12
- package/dist/plugins/linear/src/shared.js +34 -32
- package/dist/plugins/linear/src/states.js +3 -3
- package/dist/plugins/linear/src/teams.js +4 -4
- package/dist/plugins/linear/src/users.js +3 -3
- package/dist/plugins/linear/src/views.js +5 -5
- package/dist/plugins/linear/src/webhooks.js +5 -5
- package/dist/plugins/lingvanex/src/credentials.js +13 -0
- package/dist/plugins/lingvanex/src/index.js +7 -9
- package/dist/plugins/linkedin/src/credentials.js +17 -0
- package/dist/plugins/linkedin/src/index.js +13 -17
- package/dist/plugins/lonescale/src/credentials.js +13 -0
- package/dist/plugins/lonescale/src/index.js +16 -26
- package/dist/plugins/magento/src/credentials.js +16 -0
- package/dist/plugins/magento/src/index.js +67 -84
- package/dist/plugins/mailcheck/src/credentials.js +17 -0
- package/dist/plugins/mailcheck/src/index.js +7 -9
- package/dist/plugins/mailchimp/src/credentials.js +32 -0
- package/dist/plugins/mailchimp/src/index.js +36 -44
- package/dist/plugins/mailerlite/src/credentials.js +13 -0
- package/dist/plugins/mailerlite/src/index.js +19 -32
- package/dist/plugins/mailgun/src/credentials.js +21 -0
- package/dist/plugins/mailgun/src/index.js +15 -21
- package/dist/plugins/mailjet/src/credentials.js +38 -0
- package/dist/plugins/mailjet/src/index.js +60 -115
- package/dist/plugins/mandrill/src/credentials.js +17 -0
- package/dist/plugins/mandrill/src/index.js +11 -12
- package/dist/plugins/marketstack/src/credentials.js +16 -0
- package/dist/plugins/marketstack/src/index.js +18 -28
- package/dist/plugins/matrix/src/credentials.js +19 -0
- package/dist/plugins/matrix/src/index.js +23 -52
- package/dist/plugins/mattermost/src/credentials.js +19 -0
- package/dist/plugins/mattermost/src/index.js +41 -73
- package/dist/plugins/mautic/src/credentials.js +16 -0
- package/dist/plugins/mautic/src/index.js +46 -62
- package/dist/plugins/medium/src/credentials.js +20 -0
- package/dist/plugins/medium/src/index.js +18 -23
- package/dist/plugins/messagebird/src/credentials.js +22 -0
- package/dist/plugins/messagebird/src/index.js +13 -18
- package/dist/plugins/metabase/src/credentials.js +19 -0
- package/dist/plugins/metabase/src/index.js +24 -40
- package/dist/plugins/microsoftCalendar/src/index.js +48 -12
- package/dist/plugins/microsoftFiles/src/index.js +90 -25
- package/dist/plugins/microsoftMail/src/index.js +62 -15
- package/dist/plugins/misp/src/credentials.js +16 -0
- package/dist/plugins/misp/src/index.js +60 -71
- package/dist/plugins/mocean/src/credentials.js +17 -0
- package/dist/plugins/mocean/src/index.js +11 -23
- package/dist/plugins/monday/src/credentials.js +14 -0
- package/dist/plugins/monday/src/index.js +31 -44
- package/dist/plugins/monicaCrm/src/credentials.js +19 -0
- package/dist/plugins/monicaCrm/src/index.js +25 -42
- package/dist/plugins/msg91/src/credentials.js +10 -0
- package/dist/plugins/msg91/src/index.js +15 -11
- package/dist/plugins/nasa/src/credentials.js +22 -0
- package/dist/plugins/nasa/src/index.js +24 -28
- package/dist/plugins/netlify/src/credentials.js +19 -0
- package/dist/plugins/netlify/src/index.js +27 -51
- package/dist/plugins/netscalerAdc/src/credentials.js +18 -0
- package/dist/plugins/netscalerAdc/src/index.js +16 -31
- package/dist/plugins/nextcloud/src/credentials.js +27 -0
- package/dist/plugins/nextcloud/src/index.js +55 -109
- package/dist/plugins/nocodb/src/credentials.js +16 -0
- package/dist/plugins/nocodb/src/index.js +19 -37
- package/dist/plugins/notion/src/credentials.js +21 -0
- package/dist/plugins/notion/src/index.js +25 -38
- package/dist/plugins/npm/src/credentials.js +19 -0
- package/dist/plugins/npm/src/index.js +22 -32
- package/dist/plugins/odoo/src/credentials.js +21 -0
- package/dist/plugins/odoo/src/index.js +53 -69
- package/dist/plugins/okta/src/credentials.js +23 -0
- package/dist/plugins/okta/src/index.js +30 -35
- package/dist/plugins/oneSimpleApi/src/credentials.js +16 -0
- package/dist/plugins/oneSimpleApi/src/index.js +19 -24
- package/dist/plugins/onfleet/src/credentials.js +23 -0
- package/dist/plugins/onfleet/src/index.js +42 -53
- package/dist/plugins/openai/src/credentials.js +13 -0
- package/dist/plugins/openai/src/index.js +15 -23
- package/dist/plugins/openweathermap/src/credentials.js +16 -0
- package/dist/plugins/openweathermap/src/index.js +22 -22
- package/dist/plugins/oura/src/credentials.js +19 -0
- package/dist/plugins/oura/src/index.js +13 -18
- package/dist/plugins/paddle/src/credentials.js +27 -0
- package/dist/plugins/paddle/src/index.js +20 -36
- package/dist/plugins/pagerduty/src/credentials.js +24 -0
- package/dist/plugins/pagerduty/src/index.js +30 -39
- package/dist/plugins/parallel/src/credentials.js +18 -0
- package/dist/plugins/parallel/src/index.js +16 -22
- package/dist/plugins/paypal/src/credentials.js +44 -0
- package/dist/plugins/paypal/src/index.js +14 -40
- package/dist/plugins/peekalink/src/credentials.js +16 -0
- package/dist/plugins/peekalink/src/index.js +10 -11
- package/dist/plugins/phantombuster/src/credentials.js +19 -0
- package/dist/plugins/phantombuster/src/index.js +19 -32
- package/dist/plugins/philipsHue/src/credentials.js +17 -0
- package/dist/plugins/philipsHue/src/index.js +15 -27
- package/dist/plugins/pipedrive/src/credentials.js +26 -0
- package/dist/plugins/pipedrive/src/index.js +43 -73
- package/dist/plugins/plaud/src/index.js +2 -1
- package/dist/plugins/plaud/src/shared.js +23 -19
- package/dist/plugins/plivo/src/credentials.js +20 -0
- package/dist/plugins/plivo/src/index.js +13 -19
- package/dist/plugins/posthog/src/credentials.js +18 -0
- package/dist/plugins/posthog/src/index.js +14 -20
- package/dist/plugins/profitwell/src/credentials.js +22 -0
- package/dist/plugins/profitwell/src/index.js +10 -17
- package/dist/plugins/pushbullet/src/credentials.js +19 -0
- package/dist/plugins/pushbullet/src/index.js +19 -27
- package/dist/plugins/pushcut/src/credentials.js +19 -0
- package/dist/plugins/pushcut/src/index.js +7 -8
- package/dist/plugins/pushover/src/credentials.js +14 -0
- package/dist/plugins/pushover/src/index.js +7 -12
- package/dist/plugins/quickbase/src/credentials.js +15 -0
- package/dist/plugins/quickbase/src/index.js +24 -34
- package/dist/plugins/quickbooks/src/credentials.js +22 -0
- package/dist/plugins/quickbooks/src/index.js +17 -46
- package/dist/plugins/raindrop/src/credentials.js +19 -0
- package/dist/plugins/raindrop/src/index.js +30 -32
- package/dist/plugins/recraft/src/credentials.js +13 -0
- package/dist/plugins/recraft/src/index.js +38 -27
- package/dist/plugins/reddit/src/credentials.js +26 -0
- package/dist/plugins/reddit/src/index.js +30 -34
- package/dist/plugins/replicate/src/credentials.js +23 -0
- package/dist/plugins/replicate/src/index.js +17 -27
- package/dist/plugins/rocketchat/src/credentials.js +17 -0
- package/dist/plugins/rocketchat/src/index.js +8 -19
- package/dist/plugins/rundeck/src/credentials.js +16 -0
- package/dist/plugins/rundeck/src/index.js +12 -28
- package/dist/plugins/salesforce/src/credentials.js +73 -0
- package/dist/plugins/salesforce/src/index.js +6 -0
- package/dist/plugins/salesforce/src/metadata.js +3 -16
- package/dist/plugins/salesforce/src/shared.js +25 -100
- package/dist/plugins/salesforce/src/sobjects.js +10 -9
- package/dist/plugins/salesmate/src/credentials.js +17 -0
- package/dist/plugins/salesmate/src/index.js +20 -37
- package/dist/plugins/securityScorecard/src/credentials.js +22 -0
- package/dist/plugins/securityScorecard/src/index.js +24 -37
- package/dist/plugins/segment/src/credentials.js +16 -0
- package/dist/plugins/segment/src/index.js +12 -16
- package/dist/plugins/sendgrid/src/credentials.js +13 -0
- package/dist/plugins/sendgrid/src/index.js +31 -35
- package/dist/plugins/sendy/src/credentials.js +18 -0
- package/dist/plugins/sendy/src/index.js +18 -24
- package/dist/plugins/sentry/src/credentials.js +16 -0
- package/dist/plugins/sentry/src/index.js +30 -98
- package/dist/plugins/servicenow/src/credentials.js +13 -0
- package/dist/plugins/servicenow/src/index.js +22 -41
- package/dist/plugins/shiftAtlas/src/graph.js +2 -2
- package/dist/plugins/shiftAtlas/src/index.js +2 -0
- package/dist/plugins/shiftAtlas/src/shared.js +3 -1
- package/dist/plugins/shiftBwm/src/collections.js +201 -0
- package/dist/plugins/shiftBwm/src/index.js +35 -0
- package/dist/plugins/shiftBwm/src/records.js +180 -0
- package/dist/plugins/shiftBwm/src/shared.js +168 -0
- package/dist/plugins/shiftBwm/src/vendor/client.js +227 -0
- package/dist/plugins/shiftBwm/src/vendor/contracts.js +59 -0
- package/dist/plugins/shiftBwm/src/vendor/models.js +525 -0
- package/dist/plugins/shiftCrm/src/access.js +2 -2
- package/dist/plugins/shiftCrm/src/accounts.js +3 -3
- package/dist/plugins/shiftCrm/src/activities.js +3 -3
- package/dist/plugins/shiftCrm/src/credentials.js +6 -0
- package/dist/plugins/shiftCrm/src/index.js +2 -0
- package/dist/plugins/shiftCrm/src/opportunities.js +3 -3
- package/dist/plugins/shiftCrm/src/people.js +3 -3
- package/dist/plugins/shiftCrm/src/records.js +2 -2
- package/dist/plugins/shiftCrm/src/shared.js +2 -1
- package/dist/plugins/shiftCrm/src/tasks.js +3 -3
- package/dist/plugins/shiftObjects/src/credentials.js +2 -0
- package/dist/plugins/shiftObjects/src/index.js +2 -0
- package/dist/plugins/shiftObjects/src/objects.js +3 -3
- package/dist/plugins/shiftOcr/src/credentials.js +8 -0
- package/dist/plugins/shiftOcr/src/index.js +5 -2
- package/dist/plugins/shiftPages/src/index.js +2 -0
- package/dist/plugins/shiftPages/src/pages.js +5 -3
- package/dist/plugins/shiftPages/src/shared.js +3 -1
- package/dist/plugins/shiftTranscription/src/index.js +2 -0
- package/dist/plugins/shiftTranscription/src/shared.js +11 -1
- package/dist/plugins/shiftTranscription/src/transcription.js +3 -2
- package/dist/plugins/shiftWork/src/index.js +2 -0
- package/dist/plugins/shiftWork/src/issue-views.js +5 -5
- package/dist/plugins/shiftWork/src/issues.js +11 -7
- package/dist/plugins/shiftWork/src/projects.js +3 -3
- package/dist/plugins/shiftWork/src/shared.js +3 -1
- package/dist/plugins/shopify/src/credentials.js +16 -0
- package/dist/plugins/shopify/src/index.js +32 -59
- package/dist/plugins/signl4/src/credentials.js +17 -0
- package/dist/plugins/signl4/src/index.js +28 -29
- package/dist/plugins/slack/src/credentials.js +19 -0
- package/dist/plugins/slack/src/index.js +51 -60
- package/dist/plugins/sms77/src/credentials.js +17 -0
- package/dist/plugins/sms77/src/index.js +11 -16
- package/dist/plugins/splunk/src/credentials.js +19 -0
- package/dist/plugins/splunk/src/index.js +32 -74
- package/dist/plugins/spotify/src/credentials.js +19 -0
- package/dist/plugins/spotify/src/index.js +40 -55
- package/dist/plugins/stackby/src/credentials.js +13 -0
- package/dist/plugins/stackby/src/index.js +14 -23
- package/dist/plugins/steel/src/auth.js +27 -0
- package/dist/plugins/steel/src/browser.js +4 -3
- package/dist/plugins/steel/src/captchas.js +4 -3
- package/dist/plugins/steel/src/extensions.js +3 -2
- package/dist/plugins/steel/src/files.js +9 -10
- package/dist/plugins/steel/src/index.js +2 -0
- package/dist/plugins/steel/src/page/tools.js +3 -3
- package/dist/plugins/steel/src/profiles.js +4 -3
- package/dist/plugins/steel/src/sessions.js +13 -13
- package/dist/plugins/steel/src/shared.js +21 -51
- package/dist/plugins/storyblok/src/credentials.js +37 -0
- package/dist/plugins/storyblok/src/index.js +22 -66
- package/dist/plugins/strapi/src/credentials.js +71 -0
- package/dist/plugins/strapi/src/index.js +36 -70
- package/dist/plugins/strava/src/credentials.js +19 -0
- package/dist/plugins/strava/src/index.js +16 -33
- package/dist/plugins/stripe/src/credentials.js +19 -0
- package/dist/plugins/stripe/src/index.js +44 -58
- package/dist/plugins/supabase/src/credentials.js +30 -0
- package/dist/plugins/supabase/src/index.js +18 -40
- package/dist/plugins/syncromsp/src/credentials.js +16 -0
- package/dist/plugins/syncromsp/src/index.js +37 -70
- package/dist/plugins/tapfiliate/src/credentials.js +13 -0
- package/dist/plugins/tapfiliate/src/index.js +21 -31
- package/dist/plugins/telegram/src/credentials.js +20 -0
- package/dist/plugins/telegram/src/index.js +31 -39
- package/dist/plugins/thehive/src/credentials.js +14 -0
- package/dist/plugins/thehive/src/index.js +33 -50
- package/dist/plugins/thehiveProject/src/credentials.js +16 -0
- package/dist/plugins/thehiveProject/src/index.js +53 -122
- package/dist/plugins/todoist/src/credentials.js +26 -0
- package/dist/plugins/todoist/src/index.js +49 -79
- package/dist/plugins/together/src/credentials.js +16 -0
- package/dist/plugins/together/src/index.js +30 -32
- package/dist/plugins/travisci/src/credentials.js +24 -0
- package/dist/plugins/travisci/src/index.js +16 -30
- package/dist/plugins/trello/src/credentials.js +29 -0
- package/dist/plugins/trello/src/index.js +49 -64
- package/dist/plugins/twake/src/credentials.js +16 -0
- package/dist/plugins/twake/src/index.js +8 -10
- package/dist/plugins/twilio/src/credentials.js +23 -0
- package/dist/plugins/twilio/src/index.js +12 -26
- package/dist/plugins/twist/src/credentials.js +13 -0
- package/dist/plugins/twist/src/index.js +32 -44
- package/dist/plugins/twitter/src/credentials.js +16 -0
- package/dist/plugins/twitter/src/index.js +25 -37
- package/dist/plugins/typesafe/src/credentials.js +28 -0
- package/dist/plugins/typesafe/src/index.js +3 -1
- package/dist/plugins/typesafe/src/shared.js +23 -35
- package/dist/plugins/unleashedSoftware/src/credentials.js +21 -0
- package/dist/plugins/unleashedSoftware/src/index.js +13 -37
- package/dist/plugins/uplead/src/credentials.js +16 -0
- package/dist/plugins/uplead/src/index.js +11 -16
- package/dist/plugins/uproc/src/credentials.js +14 -0
- package/dist/plugins/uproc/src/index.js +7 -10
- package/dist/plugins/uptimerobot/src/credentials.js +14 -0
- package/dist/plugins/uptimerobot/src/index.js +28 -39
- package/dist/plugins/urlscanio/src/credentials.js +13 -0
- package/dist/plugins/urlscanio/src/index.js +13 -22
- package/dist/plugins/vercel/src/credentials.js +19 -0
- package/dist/plugins/vercel/src/deployments.js +27 -11
- package/dist/plugins/vercel/src/env.js +31 -12
- package/dist/plugins/vercel/src/index.js +2 -0
- package/dist/plugins/vercel/src/projects.js +6 -3
- package/dist/plugins/vercel/src/shared.js +32 -37
- package/dist/plugins/vero/src/credentials.js +17 -0
- package/dist/plugins/vero/src/index.js +18 -21
- package/dist/plugins/vonage/src/credentials.js +17 -0
- package/dist/plugins/vonage/src/index.js +14 -18
- package/dist/plugins/wekan/src/credentials.js +16 -0
- package/dist/plugins/wekan/src/index.js +33 -46
- package/dist/plugins/wolt/src/account.js +6 -0
- package/dist/plugins/wolt/src/catalog.js +2 -2
- package/dist/plugins/wolt/src/credentials.js +64 -0
- package/dist/plugins/wolt/src/index.js +8 -3
- package/dist/plugins/wolt/src/orders.js +2 -2
- package/dist/plugins/wolt/src/public.js +91 -0
- package/dist/plugins/wolt/src/shared.js +49 -158
- package/dist/plugins/woocommerce/src/credentials.js +16 -0
- package/dist/plugins/woocommerce/src/index.js +19 -37
- package/dist/plugins/wordpress/src/credentials.js +16 -0
- package/dist/plugins/wordpress/src/index.js +23 -42
- package/dist/plugins/xai/src/credentials.js +13 -0
- package/dist/plugins/xai/src/index.js +31 -30
- package/dist/plugins/xero/src/credentials.js +17 -0
- package/dist/plugins/xero/src/index.js +19 -36
- package/dist/plugins/yourls/src/credentials.js +17 -0
- package/dist/plugins/yourls/src/index.js +13 -23
- package/dist/plugins/zammad/src/credentials.js +15 -0
- package/dist/plugins/zammad/src/index.js +27 -47
- package/dist/plugins/zendesk/src/credentials.js +26 -0
- package/dist/plugins/zendesk/src/index.js +29 -48
- package/dist/plugins/zoho/src/credentials.js +17 -0
- package/dist/plugins/zoho/src/index.js +18 -38
- package/dist/plugins/zoom/src/credentials.js +19 -0
- package/dist/plugins/zoom/src/index.js +15 -30
- package/dist/plugins/zulip/src/credentials.js +16 -0
- package/dist/plugins/zulip/src/index.js +36 -42
- package/dist/sdk.d.ts +8 -0
- package/dist/sdk.js +3 -0
- package/package.json +3 -2
- package/dist/plugins/_shared/authedFetch.js +0 -33
- package/dist/plugins/_shared/tokenRefresh.js +0 -41
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import rrulePkg from "rrule";
|
|
31
31
|
import * as t from "typebox";
|
|
32
|
-
import {
|
|
32
|
+
import { pathSegment } from "../../_shared/credentials.js";
|
|
33
|
+
import { googleCredential, googleJsonRequest } from "../../_shared/googleAuth.js";
|
|
33
34
|
import { Id, NonEmptyString, NonEmptyStringArray, PositiveInteger, StringOrStringArray, stringEnum, } from "../../_shared/googleSchemas.js";
|
|
34
35
|
// `rrule` ships as CJS; named imports fail under Node ESM.
|
|
35
36
|
const { RRule } = rrulePkg;
|
|
@@ -51,9 +52,9 @@ async function paginateAll(ctx, path, key, qs) {
|
|
|
51
52
|
}
|
|
52
53
|
// ─── Helpers ─────────────────────────────────────────────────────
|
|
53
54
|
function encodeCalendarId(id) {
|
|
54
|
-
// Calendar IDs are email-shaped.
|
|
55
|
-
//
|
|
56
|
-
return
|
|
55
|
+
// Calendar IDs are email-shaped. Decoding first tolerates
|
|
56
|
+
// already-encoded input from upstream callers.
|
|
57
|
+
return pathSegment(decodeURIComponent(id));
|
|
57
58
|
}
|
|
58
59
|
function splitAttendees(input) {
|
|
59
60
|
if (input === undefined || input === null)
|
|
@@ -501,6 +502,7 @@ const settingsSchemas = {
|
|
|
501
502
|
export default function googleCalendar(rl) {
|
|
502
503
|
rl.setName("googleCalendar");
|
|
503
504
|
rl.setVersion("0.1.0");
|
|
505
|
+
rl.setCredential(googleCredential("googleCalendar", SCOPES));
|
|
504
506
|
rl.setOAuth({
|
|
505
507
|
authUrl: "https://accounts.google.com/o/oauth2/v2/auth",
|
|
506
508
|
tokenUrl: "https://oauth2.googleapis.com/token",
|
|
@@ -712,7 +714,7 @@ export default function googleCalendar(rl) {
|
|
|
712
714
|
qs.timeZone = p.timeZone;
|
|
713
715
|
if (p.maxAttendees)
|
|
714
716
|
qs.maxAttendees = p.maxAttendees;
|
|
715
|
-
const res = (await calRequest(ctx, "GET", `/calendars/${encodeCalendarId(p.calendarId)}/events/${p.eventId}`, undefined, qs));
|
|
717
|
+
const res = (await calRequest(ctx, "GET", `/calendars/${encodeCalendarId(p.calendarId)}/events/${pathSegment(p.eventId)}`, undefined, qs));
|
|
716
718
|
if (p.nextOccurrence !== false)
|
|
717
719
|
addNextOccurrence([res]);
|
|
718
720
|
return res;
|
|
@@ -779,7 +781,7 @@ export default function googleCalendar(rl) {
|
|
|
779
781
|
qs.showDeleted = p.showDeleted;
|
|
780
782
|
if (p.pageToken)
|
|
781
783
|
qs.pageToken = p.pageToken;
|
|
782
|
-
const path = `/calendars/${encodeCalendarId(p.calendarId)}/events/${p.eventId}/instances`;
|
|
784
|
+
const path = `/calendars/${encodeCalendarId(p.calendarId)}/events/${pathSegment(p.eventId)}/instances`;
|
|
783
785
|
if (p.returnAll)
|
|
784
786
|
return paginateAll(ctx, path, "items", qs);
|
|
785
787
|
if (p.maxResults)
|
|
@@ -797,7 +799,7 @@ export default function googleCalendar(rl) {
|
|
|
797
799
|
const calendarId = encodeCalendarId(p.calendarId);
|
|
798
800
|
// Series edit: resolve the instance's recurringEventId and patch that instead.
|
|
799
801
|
if (p.modifyTarget === "series") {
|
|
800
|
-
const instance = (await calRequest(ctx, "GET", `/calendars/${calendarId}/events/${eventId}`));
|
|
802
|
+
const instance = (await calRequest(ctx, "GET", `/calendars/${calendarId}/events/${pathSegment(eventId)}`));
|
|
801
803
|
if (!instance.recurringEventId) {
|
|
802
804
|
throw new Error(`googleCalendar: event ${eventId} is not part of a recurrence series`);
|
|
803
805
|
}
|
|
@@ -823,7 +825,7 @@ export default function googleCalendar(rl) {
|
|
|
823
825
|
qs.sendNotifications = p.sendNotifications;
|
|
824
826
|
if (p.maxAttendees)
|
|
825
827
|
qs.maxAttendees = p.maxAttendees;
|
|
826
|
-
return calRequest(ctx, "PATCH", `/calendars/${calendarId}/events/${eventId}`, body, qs);
|
|
828
|
+
return calRequest(ctx, "PATCH", `/calendars/${calendarId}/events/${pathSegment(eventId)}`, body, qs);
|
|
827
829
|
},
|
|
828
830
|
});
|
|
829
831
|
rl.registerAction("event.delete", {
|
|
@@ -835,7 +837,7 @@ export default function googleCalendar(rl) {
|
|
|
835
837
|
const qs = {};
|
|
836
838
|
if (p.sendUpdates)
|
|
837
839
|
qs.sendUpdates = p.sendUpdates;
|
|
838
|
-
return calRequest(ctx, "DELETE", `/calendars/${encodeCalendarId(p.calendarId)}/events/${p.eventId}`, undefined, qs);
|
|
840
|
+
return calRequest(ctx, "DELETE", `/calendars/${encodeCalendarId(p.calendarId)}/events/${pathSegment(p.eventId)}`, undefined, qs);
|
|
839
841
|
},
|
|
840
842
|
});
|
|
841
843
|
rl.registerAction("event.move", {
|
|
@@ -849,7 +851,7 @@ export default function googleCalendar(rl) {
|
|
|
849
851
|
};
|
|
850
852
|
if (p.sendUpdates)
|
|
851
853
|
qs.sendUpdates = p.sendUpdates;
|
|
852
|
-
return calRequest(ctx, "POST", `/calendars/${encodeCalendarId(p.calendarId)}/events/${p.eventId}/move`, undefined, qs);
|
|
854
|
+
return calRequest(ctx, "POST", `/calendars/${encodeCalendarId(p.calendarId)}/events/${pathSegment(p.eventId)}/move`, undefined, qs);
|
|
853
855
|
},
|
|
854
856
|
});
|
|
855
857
|
// ─── FreeBusy ────────────────────────────────────────────────────
|
|
@@ -957,7 +959,7 @@ export default function googleCalendar(rl) {
|
|
|
957
959
|
inputSchema: aclSchemas.update,
|
|
958
960
|
async execute(input, ctx) {
|
|
959
961
|
const p = (input ?? {});
|
|
960
|
-
return calRequest(ctx, "PATCH", `/calendars/${encodeCalendarId(p.calendarId)}/acl/${
|
|
962
|
+
return calRequest(ctx, "PATCH", `/calendars/${encodeCalendarId(p.calendarId)}/acl/${pathSegment(p.ruleId)}`, { role: p.role });
|
|
961
963
|
},
|
|
962
964
|
});
|
|
963
965
|
rl.registerAction("acl.delete", {
|
|
@@ -966,7 +968,7 @@ export default function googleCalendar(rl) {
|
|
|
966
968
|
inputSchema: aclSchemas.delete,
|
|
967
969
|
async execute(input, ctx) {
|
|
968
970
|
const p = (input ?? {});
|
|
969
|
-
await calRequest(ctx, "DELETE", `/calendars/${encodeCalendarId(p.calendarId)}/acl/${
|
|
971
|
+
await calRequest(ctx, "DELETE", `/calendars/${encodeCalendarId(p.calendarId)}/acl/${pathSegment(p.ruleId)}`);
|
|
970
972
|
return { success: true };
|
|
971
973
|
},
|
|
972
974
|
});
|
|
@@ -985,7 +987,7 @@ export default function googleCalendar(rl) {
|
|
|
985
987
|
inputSchema: settingsSchemas.get,
|
|
986
988
|
async execute(input, ctx) {
|
|
987
989
|
const p = (input ?? {});
|
|
988
|
-
return calRequest(ctx, "GET", `/users/me/settings/${
|
|
990
|
+
return calRequest(ctx, "GET", `/users/me/settings/${pathSegment(p.setting)}`);
|
|
989
991
|
},
|
|
990
992
|
});
|
|
991
993
|
}
|
|
@@ -19,11 +19,13 @@
|
|
|
19
19
|
*
|
|
20
20
|
* The People API uses `resourceName` ("people/c1234…") as the
|
|
21
21
|
* canonical identifier; we accept either the full `resourceName` or
|
|
22
|
-
* the bare ID and normalize
|
|
23
|
-
*
|
|
22
|
+
* the bare ID and normalize, and either way the ID is one path
|
|
23
|
+
* segment. The response always includes a convenience `contactId`
|
|
24
|
+
* field stripped from `resourceName`.
|
|
24
25
|
*/
|
|
25
26
|
import * as t from "typebox";
|
|
26
|
-
import {
|
|
27
|
+
import { pathSegment } from "../../_shared/credentials.js";
|
|
28
|
+
import { googleCredential, googleJsonRequest } from "../../_shared/googleAuth.js";
|
|
27
29
|
import { Id, NonEmptyString, PositiveInteger, stringEnum, } from "../../_shared/googleSchemas.js";
|
|
28
30
|
// ─── Fields ─────────────────────────────────────────────────────
|
|
29
31
|
/**
|
|
@@ -103,14 +105,14 @@ async function paginateAll(ctx, path, key, qs) {
|
|
|
103
105
|
* Accepts either the raw ID (`c1234…`) or the full prefixed form.
|
|
104
106
|
*/
|
|
105
107
|
function normalizeContactResource(input) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return input.startsWith("people/") ? input : `people/${input}`;
|
|
108
|
+
const id = input.startsWith("people/") ? input.slice("people/".length) : input;
|
|
109
|
+
return `people/${pathSegment(id)}`;
|
|
109
110
|
}
|
|
110
111
|
function normalizeGroupResource(input) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
const id = input.startsWith("contactGroups/")
|
|
113
|
+
? input.slice("contactGroups/".length)
|
|
114
|
+
: input;
|
|
115
|
+
return `contactGroups/${pathSegment(id)}`;
|
|
114
116
|
}
|
|
115
117
|
function contactIdFromResource(resourceName) {
|
|
116
118
|
if (!resourceName)
|
|
@@ -372,6 +374,7 @@ const groupSchemas = {
|
|
|
372
374
|
export default function googleContacts(rl) {
|
|
373
375
|
rl.setName("googleContacts");
|
|
374
376
|
rl.setVersion("0.1.0");
|
|
377
|
+
rl.setCredential(googleCredential("googleContacts", SCOPES));
|
|
375
378
|
rl.setOAuth({
|
|
376
379
|
authUrl: "https://accounts.google.com/o/oauth2/v2/auth",
|
|
377
380
|
tokenUrl: "https://oauth2.googleapis.com/token",
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* — the Docs API itself only creates blank documents without a
|
|
8
8
|
* target folder.
|
|
9
9
|
*/
|
|
10
|
+
import { googleCredential } from "../../_shared/googleAuth.js";
|
|
10
11
|
import { registerDocumentsActions } from "./documents.js";
|
|
11
12
|
import { registerFormattingActions } from "./formatting.js";
|
|
12
13
|
import { registerImagesActions } from "./images.js";
|
|
@@ -18,6 +19,7 @@ import { registerTextActions } from "./text.js";
|
|
|
18
19
|
export default function googleDocs(rl) {
|
|
19
20
|
rl.setName("googleDocs");
|
|
20
21
|
rl.setVersion("0.1.0");
|
|
22
|
+
rl.setCredential(googleCredential("googleDocs", SCOPES));
|
|
21
23
|
rl.setOAuth({
|
|
22
24
|
authUrl: "https://accounts.google.com/o/oauth2/v2/auth",
|
|
23
25
|
tokenUrl: "https://oauth2.googleapis.com/token",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as t from "typebox";
|
|
2
|
+
import { pathSegment } from "../../_shared/credentials.js";
|
|
2
3
|
import { googleJsonRequest } from "../../_shared/googleAuth.js";
|
|
3
4
|
import { RawGoogleObject } from "../../_shared/googleSchemas.js";
|
|
4
5
|
export const SCOPES = [
|
|
@@ -68,7 +69,7 @@ export function extractDocumentId(input) {
|
|
|
68
69
|
if (!input)
|
|
69
70
|
throw new Error("googleDocs: documentId or URL is required");
|
|
70
71
|
const m = input.match(DOC_URL_REGEX);
|
|
71
|
-
return m ? m[1] : input;
|
|
72
|
+
return pathSegment(m ? m[1] : input);
|
|
72
73
|
}
|
|
73
74
|
export function buildLocation(kind, segmentId, index, tabId) {
|
|
74
75
|
const seg = segmentId && segmentId !== "body" ? segmentId : "";
|
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
*/
|
|
56
56
|
import { createReadStream, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
57
57
|
import * as t from "typebox";
|
|
58
|
-
import {
|
|
58
|
+
import { jsonAnswer, pathSegment } from "../../_shared/credentials.js";
|
|
59
|
+
import { googleCredential, googleJsonRequest, googleResponse, } from "../../_shared/googleAuth.js";
|
|
59
60
|
import { Id, NonEmptyString, RawGoogleObject, StringMap, StringOrStringArray, stringEnum, } from "../../_shared/googleSchemas.js";
|
|
60
61
|
const PermissionRole = stringEnum([
|
|
61
62
|
"owner",
|
|
@@ -110,11 +111,6 @@ function driveResponse(ctx, url, init = {}) {
|
|
|
110
111
|
}
|
|
111
112
|
// ─── Request ─────────────────────────────────────────────────────
|
|
112
113
|
const API_BASE = "https://www.googleapis.com";
|
|
113
|
-
function filePathId(id) {
|
|
114
|
-
if (!/^[a-zA-Z0-9_-]+$/.test(id))
|
|
115
|
-
throw new Error("googleDrive: invalid file ID");
|
|
116
|
-
return id;
|
|
117
|
-
}
|
|
118
114
|
function uploadSession(value) {
|
|
119
115
|
if (!value || !/^https:\/\/www\.googleapis\.com\/upload\/drive\/v3\/files(?:\/[a-zA-Z0-9_-]+)?\?/.test(value))
|
|
120
116
|
throw new Error("googleDrive: invalid resumable session Location");
|
|
@@ -354,6 +350,7 @@ const SCOPES = ["https://www.googleapis.com/auth/drive"];
|
|
|
354
350
|
export default function googleDrive(rl) {
|
|
355
351
|
rl.setName("googleDrive");
|
|
356
352
|
rl.setVersion("0.1.0");
|
|
353
|
+
rl.setCredential(googleCredential("googleDrive", SCOPES));
|
|
357
354
|
rl.setOAuth({
|
|
358
355
|
authUrl: "https://accounts.google.com/o/oauth2/v2/auth",
|
|
359
356
|
tokenUrl: "https://oauth2.googleapis.com/token",
|
|
@@ -487,7 +484,7 @@ export default function googleDrive(rl) {
|
|
|
487
484
|
qs.ocrLanguage = p.ocrLanguage;
|
|
488
485
|
if (p.useContentAsIndexableText)
|
|
489
486
|
qs.useContentAsIndexableText = p.useContentAsIndexableText;
|
|
490
|
-
return driveRequest(ctx, "PATCH", `/drive/v3/files/${uploaded.id}`, {}, qs);
|
|
487
|
+
return driveRequest(ctx, "PATCH", `/drive/v3/files/${pathSegment(uploaded.id)}`, {}, qs);
|
|
491
488
|
},
|
|
492
489
|
});
|
|
493
490
|
rl.registerAction("file.createFromText", {
|
|
@@ -523,7 +520,7 @@ export default function googleDrive(rl) {
|
|
|
523
520
|
const doc = (await driveRequest(ctx, "POST", "/drive/v3/files", metadata, {
|
|
524
521
|
supportsAllDrives: true,
|
|
525
522
|
}));
|
|
526
|
-
const res = await driveResponse(ctx, `https://docs.googleapis.com/v1/documents/${
|
|
523
|
+
const res = await driveResponse(ctx, `https://docs.googleapis.com/v1/documents/${pathSegment(doc.id)}:batchUpdate`, {
|
|
527
524
|
method: "POST",
|
|
528
525
|
headers: {
|
|
529
526
|
"Content-Type": "application/json",
|
|
@@ -573,7 +570,7 @@ export default function googleDrive(rl) {
|
|
|
573
570
|
async execute(input, ctx) {
|
|
574
571
|
const p = (input ?? {});
|
|
575
572
|
const fileId = p.fileId;
|
|
576
|
-
const meta = (await driveRequest(ctx, "GET", `/drive/v3/files/${fileId}`, undefined, { fields: "mimeType,name", supportsAllDrives: true }));
|
|
573
|
+
const meta = (await driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(fileId)}`, undefined, { fields: "mimeType,name", supportsAllDrives: true }));
|
|
577
574
|
const isGoogleNative = meta.mimeType?.includes("vnd.google-apps");
|
|
578
575
|
let url;
|
|
579
576
|
let contentType = meta.mimeType;
|
|
@@ -587,13 +584,13 @@ export default function googleDrive(rl) {
|
|
|
587
584
|
};
|
|
588
585
|
const mime = p.googleDocFormat ?? defaults[type] ?? "application/pdf";
|
|
589
586
|
contentType = mime;
|
|
590
|
-
const u = new URL(`${API_BASE}/drive/v3/files/${
|
|
587
|
+
const u = new URL(`${API_BASE}/drive/v3/files/${pathSegment(fileId)}/export`);
|
|
591
588
|
u.searchParams.set("mimeType", mime);
|
|
592
589
|
u.searchParams.set("supportsAllDrives", "true");
|
|
593
590
|
url = u.toString();
|
|
594
591
|
}
|
|
595
592
|
else {
|
|
596
|
-
const u = new URL(`${API_BASE}/drive/v3/files/${
|
|
593
|
+
const u = new URL(`${API_BASE}/drive/v3/files/${pathSegment(fileId)}`);
|
|
597
594
|
u.searchParams.set("alt", "media");
|
|
598
595
|
u.searchParams.set("supportsAllDrives", "true");
|
|
599
596
|
url = u.toString();
|
|
@@ -640,7 +637,7 @@ export default function googleDrive(rl) {
|
|
|
640
637
|
if (p.folderId || p.driveId) {
|
|
641
638
|
body.parents = [resolveParent(p.folderId, p.driveId)];
|
|
642
639
|
}
|
|
643
|
-
return driveRequest(ctx, "POST", `/drive/v3/files/${p.fileId}/copy`, body, { supportsAllDrives: true });
|
|
640
|
+
return driveRequest(ctx, "POST", `/drive/v3/files/${pathSegment(p.fileId)}/copy`, body, { supportsAllDrives: true });
|
|
644
641
|
},
|
|
645
642
|
});
|
|
646
643
|
rl.registerAction("file.move", {
|
|
@@ -653,10 +650,10 @@ export default function googleDrive(rl) {
|
|
|
653
650
|
}, { additionalProperties: false }),
|
|
654
651
|
async execute(input, ctx) {
|
|
655
652
|
const p = (input ?? {});
|
|
656
|
-
const current = (await driveRequest(ctx, "GET", `/drive/v3/files/${p.fileId}`, undefined, { fields: "parents", supportsAllDrives: true }));
|
|
653
|
+
const current = (await driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(p.fileId)}`, undefined, { fields: "parents", supportsAllDrives: true }));
|
|
657
654
|
const removeParents = (current.parents ?? []).join(",");
|
|
658
655
|
const addParents = resolveParent(p.folderId, p.driveId);
|
|
659
|
-
return driveRequest(ctx, "PATCH", `/drive/v3/files/${p.fileId}`, undefined, {
|
|
656
|
+
return driveRequest(ctx, "PATCH", `/drive/v3/files/${pathSegment(p.fileId)}`, undefined, {
|
|
660
657
|
supportsAllDrives: true,
|
|
661
658
|
addParents,
|
|
662
659
|
removeParents,
|
|
@@ -719,7 +716,7 @@ export default function googleDrive(rl) {
|
|
|
719
716
|
const c = resolveContent(p);
|
|
720
717
|
const mimeType = c.mimeType ?? p.mimeType ?? "application/octet-stream";
|
|
721
718
|
if (c.buffer) {
|
|
722
|
-
const url = new URL(`${API_BASE}/upload/drive/v3/files/${
|
|
719
|
+
const url = new URL(`${API_BASE}/upload/drive/v3/files/${pathSegment(fileId)}`);
|
|
723
720
|
url.searchParams.set("uploadType", "media");
|
|
724
721
|
url.searchParams.set("supportsAllDrives", "true");
|
|
725
722
|
for (const key of [
|
|
@@ -744,7 +741,7 @@ export default function googleDrive(rl) {
|
|
|
744
741
|
}
|
|
745
742
|
else if (c.path) {
|
|
746
743
|
// Resumable PATCH
|
|
747
|
-
const initUrl = new URL(`${API_BASE}/upload/drive/v3/files/${
|
|
744
|
+
const initUrl = new URL(`${API_BASE}/upload/drive/v3/files/${pathSegment(fileId)}`);
|
|
748
745
|
initUrl.searchParams.set("uploadType", "resumable");
|
|
749
746
|
initUrl.searchParams.set("supportsAllDrives", "true");
|
|
750
747
|
for (const key of [
|
|
@@ -814,11 +811,11 @@ export default function googleDrive(rl) {
|
|
|
814
811
|
body.appProperties = p.appProperties;
|
|
815
812
|
if (Object.keys(body).length === 0) {
|
|
816
813
|
if (hasBytes && p.fields) {
|
|
817
|
-
return driveRequest(ctx, "GET", `/drive/v3/files/${fileId}`, undefined, { supportsAllDrives: true, fields: p.fields });
|
|
814
|
+
return driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(fileId)}`, undefined, { supportsAllDrives: true, fields: p.fields });
|
|
818
815
|
}
|
|
819
816
|
return { id: fileId, success: true };
|
|
820
817
|
}
|
|
821
|
-
return driveRequest(ctx, "PATCH", `/drive/v3/files/${fileId}`, body, {
|
|
818
|
+
return driveRequest(ctx, "PATCH", `/drive/v3/files/${pathSegment(fileId)}`, body, {
|
|
822
819
|
supportsAllDrives: true,
|
|
823
820
|
fields: p.fields,
|
|
824
821
|
});
|
|
@@ -831,12 +828,12 @@ export default function googleDrive(rl) {
|
|
|
831
828
|
async execute(input, ctx) {
|
|
832
829
|
const p = (input ?? {});
|
|
833
830
|
if (p.deletePermanently) {
|
|
834
|
-
await driveRequest(ctx, "DELETE", `/drive/v3/files/${p.fileId}`, undefined, {
|
|
831
|
+
await driveRequest(ctx, "DELETE", `/drive/v3/files/${pathSegment(p.fileId)}`, undefined, {
|
|
835
832
|
supportsAllDrives: true,
|
|
836
833
|
});
|
|
837
834
|
}
|
|
838
835
|
else {
|
|
839
|
-
await driveRequest(ctx, "PATCH", `/drive/v3/files/${p.fileId}`, { trashed: true }, { supportsAllDrives: true });
|
|
836
|
+
await driveRequest(ctx, "PATCH", `/drive/v3/files/${pathSegment(p.fileId)}`, { trashed: true }, { supportsAllDrives: true });
|
|
840
837
|
}
|
|
841
838
|
return { id: p.fileId, success: true };
|
|
842
839
|
},
|
|
@@ -847,7 +844,7 @@ export default function googleDrive(rl) {
|
|
|
847
844
|
inputSchema: t.Object({ fileId: Id, fields: t.Optional(NonEmptyString) }, { additionalProperties: false }),
|
|
848
845
|
async execute(input, ctx) {
|
|
849
846
|
const p = (input ?? {});
|
|
850
|
-
return driveRequest(ctx, "GET", `/drive/v3/files/${p.fileId}`, undefined, { supportsAllDrives: true, fields: p.fields ?? "*" });
|
|
847
|
+
return driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(p.fileId)}`, undefined, { supportsAllDrives: true, fields: p.fields ?? "*" });
|
|
851
848
|
},
|
|
852
849
|
});
|
|
853
850
|
rl.registerAction("file.share", {
|
|
@@ -914,7 +911,7 @@ export default function googleDrive(rl) {
|
|
|
914
911
|
qs.moveToNewOwnersRoot = p.moveToNewOwnersRoot;
|
|
915
912
|
if (p.useDomainAdminAccess !== undefined)
|
|
916
913
|
qs.useDomainAdminAccess = p.useDomainAdminAccess;
|
|
917
|
-
return driveRequest(ctx, "POST", `/drive/v3/files/${p.fileId}/permissions`, body, qs);
|
|
914
|
+
return driveRequest(ctx, "POST", `/drive/v3/files/${pathSegment(p.fileId)}/permissions`, body, qs);
|
|
918
915
|
},
|
|
919
916
|
});
|
|
920
917
|
rl.registerAction("file.listPermissions", {
|
|
@@ -923,7 +920,7 @@ export default function googleDrive(rl) {
|
|
|
923
920
|
inputSchema: t.Object({ fileId: Id, useDomainAdminAccess: t.Optional(t.Boolean()) }, { additionalProperties: false }),
|
|
924
921
|
async execute(input, ctx) {
|
|
925
922
|
const p = (input ?? {});
|
|
926
|
-
return driveRequest(ctx, "GET", `/drive/v3/files/${p.fileId}/permissions`, undefined, {
|
|
923
|
+
return driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(p.fileId)}/permissions`, undefined, {
|
|
927
924
|
supportsAllDrives: true,
|
|
928
925
|
useDomainAdminAccess: p.useDomainAdminAccess,
|
|
929
926
|
fields: "*",
|
|
@@ -936,7 +933,7 @@ export default function googleDrive(rl) {
|
|
|
936
933
|
inputSchema: t.Object({ fileId: Id, permissionId: Id }, { additionalProperties: false }),
|
|
937
934
|
async execute(input, ctx) {
|
|
938
935
|
const p = (input ?? {});
|
|
939
|
-
await driveRequest(ctx, "DELETE", `/drive/v3/files/${p.fileId}/permissions/${p.permissionId}`, undefined, { supportsAllDrives: true });
|
|
936
|
+
await driveRequest(ctx, "DELETE", `/drive/v3/files/${pathSegment(p.fileId)}/permissions/${pathSegment(p.permissionId)}`, undefined, { supportsAllDrives: true });
|
|
940
937
|
return { success: true };
|
|
941
938
|
},
|
|
942
939
|
});
|
|
@@ -974,12 +971,12 @@ export default function googleDrive(rl) {
|
|
|
974
971
|
async execute(input, ctx) {
|
|
975
972
|
const p = (input ?? {});
|
|
976
973
|
if (p.deletePermanently) {
|
|
977
|
-
await driveRequest(ctx, "DELETE", `/drive/v3/files/${p.folderId}`, undefined, {
|
|
974
|
+
await driveRequest(ctx, "DELETE", `/drive/v3/files/${pathSegment(p.folderId)}`, undefined, {
|
|
978
975
|
supportsAllDrives: true,
|
|
979
976
|
});
|
|
980
977
|
}
|
|
981
978
|
else {
|
|
982
|
-
await driveRequest(ctx, "PATCH", `/drive/v3/files/${p.folderId}`, { trashed: true }, { supportsAllDrives: true });
|
|
979
|
+
await driveRequest(ctx, "PATCH", `/drive/v3/files/${pathSegment(p.folderId)}`, { trashed: true }, { supportsAllDrives: true });
|
|
983
980
|
}
|
|
984
981
|
return { id: p.folderId, success: true };
|
|
985
982
|
},
|
|
@@ -1045,7 +1042,7 @@ export default function googleDrive(rl) {
|
|
|
1045
1042
|
if (p[k] !== undefined)
|
|
1046
1043
|
qs[k] = p[k];
|
|
1047
1044
|
}
|
|
1048
|
-
return driveRequest(ctx, "POST", `/drive/v3/files/${p.folderId}/permissions`, body, qs);
|
|
1045
|
+
return driveRequest(ctx, "POST", `/drive/v3/files/${pathSegment(p.folderId)}/permissions`, body, qs);
|
|
1049
1046
|
},
|
|
1050
1047
|
});
|
|
1051
1048
|
// ── File / folder search ──────────────────────────────
|
|
@@ -1147,7 +1144,7 @@ export default function googleDrive(rl) {
|
|
|
1147
1144
|
const qs = {};
|
|
1148
1145
|
if (p.useDomainAdminAccess !== undefined)
|
|
1149
1146
|
qs.useDomainAdminAccess = p.useDomainAdminAccess;
|
|
1150
|
-
return driveRequest(ctx, "GET", `/drive/v3/drives/${p.driveId}`, undefined, qs);
|
|
1147
|
+
return driveRequest(ctx, "GET", `/drive/v3/drives/${pathSegment(p.driveId)}`, undefined, qs);
|
|
1151
1148
|
},
|
|
1152
1149
|
});
|
|
1153
1150
|
rl.registerAction("drive.list", {
|
|
@@ -1200,7 +1197,7 @@ export default function googleDrive(rl) {
|
|
|
1200
1197
|
if (p[k] !== undefined)
|
|
1201
1198
|
body[k] = p[k];
|
|
1202
1199
|
}
|
|
1203
|
-
return driveRequest(ctx, "PATCH", `/drive/v3/drives/${p.driveId}`, body);
|
|
1200
|
+
return driveRequest(ctx, "PATCH", `/drive/v3/drives/${pathSegment(p.driveId)}`, body);
|
|
1204
1201
|
},
|
|
1205
1202
|
});
|
|
1206
1203
|
rl.registerAction("drive.delete", {
|
|
@@ -1209,7 +1206,7 @@ export default function googleDrive(rl) {
|
|
|
1209
1206
|
inputSchema: t.Object({ driveId: Id }, { additionalProperties: false }),
|
|
1210
1207
|
async execute(input, ctx) {
|
|
1211
1208
|
const p = (input ?? {});
|
|
1212
|
-
await driveRequest(ctx, "DELETE", `/drive/v3/drives/${p.driveId}`);
|
|
1209
|
+
await driveRequest(ctx, "DELETE", `/drive/v3/drives/${pathSegment(p.driveId)}`);
|
|
1213
1210
|
return { success: true };
|
|
1214
1211
|
},
|
|
1215
1212
|
});
|
|
@@ -1251,7 +1248,7 @@ export default function googleDrive(rl) {
|
|
|
1251
1248
|
do {
|
|
1252
1249
|
if (pageToken)
|
|
1253
1250
|
query.pageToken = pageToken;
|
|
1254
|
-
const page = (await driveRequest(ctx, "GET", `/drive/v3/files/${fileId}/comments`, undefined, query));
|
|
1251
|
+
const page = (await driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(fileId)}/comments`, undefined, query));
|
|
1255
1252
|
if (Array.isArray(page.comments))
|
|
1256
1253
|
out.push(...page.comments);
|
|
1257
1254
|
pageToken = page.nextPageToken;
|
|
@@ -1265,7 +1262,7 @@ export default function googleDrive(rl) {
|
|
|
1265
1262
|
inputSchema: t.Object({ fileId: Id, commentId: Id, includeDeleted: t.Optional(t.Boolean()) }, { additionalProperties: false }),
|
|
1266
1263
|
async execute(input, ctx) {
|
|
1267
1264
|
const p = (input ?? {});
|
|
1268
|
-
return driveRequest(ctx, "GET", `/drive/v3/files/${p.fileId}/comments/${p.commentId}`, undefined, { fields: COMMENT_FIELDS, includeDeleted: p.includeDeleted ?? false });
|
|
1265
|
+
return driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(p.fileId)}/comments/${pathSegment(p.commentId)}`, undefined, { fields: COMMENT_FIELDS, includeDeleted: p.includeDeleted ?? false });
|
|
1269
1266
|
},
|
|
1270
1267
|
});
|
|
1271
1268
|
rl.registerAction("comment.create", {
|
|
@@ -1281,7 +1278,7 @@ export default function googleDrive(rl) {
|
|
|
1281
1278
|
const body = { content: p.content };
|
|
1282
1279
|
if (p.quotedFileContent)
|
|
1283
1280
|
body.quotedFileContent = p.quotedFileContent;
|
|
1284
|
-
return driveRequest(ctx, "POST", `/drive/v3/files/${p.fileId}/comments`, body, { fields: COMMENT_FIELDS });
|
|
1281
|
+
return driveRequest(ctx, "POST", `/drive/v3/files/${pathSegment(p.fileId)}/comments`, body, { fields: COMMENT_FIELDS });
|
|
1285
1282
|
},
|
|
1286
1283
|
});
|
|
1287
1284
|
rl.registerAction("comment.update", {
|
|
@@ -1290,7 +1287,7 @@ export default function googleDrive(rl) {
|
|
|
1290
1287
|
inputSchema: t.Object({ fileId: Id, commentId: Id, content: NonEmptyString }, { additionalProperties: false }),
|
|
1291
1288
|
async execute(input, ctx) {
|
|
1292
1289
|
const p = (input ?? {});
|
|
1293
|
-
return driveRequest(ctx, "PATCH", `/drive/v3/files/${p.fileId}/comments/${p.commentId}`, { content: p.content }, { fields: COMMENT_FIELDS });
|
|
1290
|
+
return driveRequest(ctx, "PATCH", `/drive/v3/files/${pathSegment(p.fileId)}/comments/${pathSegment(p.commentId)}`, { content: p.content }, { fields: COMMENT_FIELDS });
|
|
1294
1291
|
},
|
|
1295
1292
|
});
|
|
1296
1293
|
rl.registerAction("comment.delete", {
|
|
@@ -1299,7 +1296,7 @@ export default function googleDrive(rl) {
|
|
|
1299
1296
|
inputSchema: t.Object({ fileId: Id, commentId: Id }, { additionalProperties: false }),
|
|
1300
1297
|
async execute(input, ctx) {
|
|
1301
1298
|
const p = (input ?? {});
|
|
1302
|
-
await driveRequest(ctx, "DELETE", `/drive/v3/files/${p.fileId}/comments/${p.commentId}`);
|
|
1299
|
+
await driveRequest(ctx, "DELETE", `/drive/v3/files/${pathSegment(p.fileId)}/comments/${pathSegment(p.commentId)}`);
|
|
1303
1300
|
return { success: true };
|
|
1304
1301
|
},
|
|
1305
1302
|
});
|
|
@@ -1309,7 +1306,7 @@ export default function googleDrive(rl) {
|
|
|
1309
1306
|
inputSchema: t.Object({ fileId: Id, commentId: Id, content: t.Optional(NonEmptyString) }, { additionalProperties: false }),
|
|
1310
1307
|
async execute(input, ctx) {
|
|
1311
1308
|
const p = (input ?? {});
|
|
1312
|
-
return driveRequest(ctx, "POST", `/drive/v3/files/${p.fileId}/comments/${p.commentId}/replies`, { action: "resolve", content: p.content ?? "Resolved." }, { fields: REPLY_FIELDS });
|
|
1309
|
+
return driveRequest(ctx, "POST", `/drive/v3/files/${pathSegment(p.fileId)}/comments/${pathSegment(p.commentId)}/replies`, { action: "resolve", content: p.content ?? "Resolved." }, { fields: REPLY_FIELDS });
|
|
1313
1310
|
},
|
|
1314
1311
|
});
|
|
1315
1312
|
rl.registerAction("comment.reopen", {
|
|
@@ -1318,7 +1315,7 @@ export default function googleDrive(rl) {
|
|
|
1318
1315
|
inputSchema: t.Object({ fileId: Id, commentId: Id, content: t.Optional(NonEmptyString) }, { additionalProperties: false }),
|
|
1319
1316
|
async execute(input, ctx) {
|
|
1320
1317
|
const p = (input ?? {});
|
|
1321
|
-
return driveRequest(ctx, "POST", `/drive/v3/files/${p.fileId}/comments/${p.commentId}/replies`, { action: "reopen", content: p.content ?? "Reopened." }, { fields: REPLY_FIELDS });
|
|
1318
|
+
return driveRequest(ctx, "POST", `/drive/v3/files/${pathSegment(p.fileId)}/comments/${pathSegment(p.commentId)}/replies`, { action: "reopen", content: p.content ?? "Reopened." }, { fields: REPLY_FIELDS });
|
|
1322
1319
|
},
|
|
1323
1320
|
});
|
|
1324
1321
|
rl.registerAction("reply.list", {
|
|
@@ -1342,7 +1339,7 @@ export default function googleDrive(rl) {
|
|
|
1342
1339
|
do {
|
|
1343
1340
|
if (pageToken)
|
|
1344
1341
|
query.pageToken = pageToken;
|
|
1345
|
-
const page = (await driveRequest(ctx, "GET", `/drive/v3/files/${p.fileId}/comments/${p.commentId}/replies`, undefined, query));
|
|
1342
|
+
const page = (await driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(p.fileId)}/comments/${pathSegment(p.commentId)}/replies`, undefined, query));
|
|
1346
1343
|
if (Array.isArray(page.replies))
|
|
1347
1344
|
out.push(...page.replies);
|
|
1348
1345
|
pageToken = page.nextPageToken;
|
|
@@ -1364,7 +1361,7 @@ export default function googleDrive(rl) {
|
|
|
1364
1361
|
const body = { content: p.content };
|
|
1365
1362
|
if (p.action === "resolve" || p.action === "reopen")
|
|
1366
1363
|
body.action = p.action;
|
|
1367
|
-
return driveRequest(ctx, "POST", `/drive/v3/files/${p.fileId}/comments/${p.commentId}/replies`, body, { fields: REPLY_FIELDS });
|
|
1364
|
+
return driveRequest(ctx, "POST", `/drive/v3/files/${pathSegment(p.fileId)}/comments/${pathSegment(p.commentId)}/replies`, body, { fields: REPLY_FIELDS });
|
|
1368
1365
|
},
|
|
1369
1366
|
});
|
|
1370
1367
|
rl.registerAction("reply.update", {
|
|
@@ -1373,7 +1370,7 @@ export default function googleDrive(rl) {
|
|
|
1373
1370
|
inputSchema: t.Object({ fileId: Id, commentId: Id, replyId: Id, content: NonEmptyString }, { additionalProperties: false }),
|
|
1374
1371
|
async execute(input, ctx) {
|
|
1375
1372
|
const p = (input ?? {});
|
|
1376
|
-
return driveRequest(ctx, "PATCH", `/drive/v3/files/${p.fileId}/comments/${p.commentId}/replies/${p.replyId}`, { content: p.content }, { fields: REPLY_FIELDS });
|
|
1373
|
+
return driveRequest(ctx, "PATCH", `/drive/v3/files/${pathSegment(p.fileId)}/comments/${pathSegment(p.commentId)}/replies/${pathSegment(p.replyId)}`, { content: p.content }, { fields: REPLY_FIELDS });
|
|
1377
1374
|
},
|
|
1378
1375
|
});
|
|
1379
1376
|
rl.registerAction("reply.delete", {
|
|
@@ -1382,7 +1379,7 @@ export default function googleDrive(rl) {
|
|
|
1382
1379
|
inputSchema: t.Object({ fileId: Id, commentId: Id, replyId: Id }, { additionalProperties: false }),
|
|
1383
1380
|
async execute(input, ctx) {
|
|
1384
1381
|
const p = (input ?? {});
|
|
1385
|
-
await driveRequest(ctx, "DELETE", `/drive/v3/files/${p.fileId}/comments/${p.commentId}/replies/${p.replyId}`);
|
|
1382
|
+
await driveRequest(ctx, "DELETE", `/drive/v3/files/${pathSegment(p.fileId)}/comments/${pathSegment(p.commentId)}/replies/${pathSegment(p.replyId)}`);
|
|
1386
1383
|
return { success: true };
|
|
1387
1384
|
},
|
|
1388
1385
|
});
|
|
@@ -1420,7 +1417,7 @@ export default function googleDrive(rl) {
|
|
|
1420
1417
|
do {
|
|
1421
1418
|
if (pageToken)
|
|
1422
1419
|
query.pageToken = pageToken;
|
|
1423
|
-
const page = (await driveRequest(ctx, "GET", `/drive/v3/files/${fileId}/revisions`, undefined, query));
|
|
1420
|
+
const page = (await driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(fileId)}/revisions`, undefined, query));
|
|
1424
1421
|
if (Array.isArray(page.revisions))
|
|
1425
1422
|
out.push(...page.revisions);
|
|
1426
1423
|
pageToken = page.nextPageToken;
|
|
@@ -1434,7 +1431,7 @@ export default function googleDrive(rl) {
|
|
|
1434
1431
|
inputSchema: t.Object({ fileId: Id, revisionId: Id }, { additionalProperties: false }),
|
|
1435
1432
|
async execute(input, ctx) {
|
|
1436
1433
|
const p = (input ?? {});
|
|
1437
|
-
return driveRequest(ctx, "GET", `/drive/v3/files/${p.fileId}/revisions/${p.revisionId}`, undefined, { fields: REVISION_FIELDS });
|
|
1434
|
+
return driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(p.fileId)}/revisions/${pathSegment(p.revisionId)}`, undefined, { fields: REVISION_FIELDS });
|
|
1438
1435
|
},
|
|
1439
1436
|
});
|
|
1440
1437
|
rl.registerAction("revision.download", {
|
|
@@ -1445,7 +1442,7 @@ export default function googleDrive(rl) {
|
|
|
1445
1442
|
const p = (input ?? {});
|
|
1446
1443
|
const fileId = p.fileId;
|
|
1447
1444
|
const revisionId = p.revisionId;
|
|
1448
|
-
const url = new URL(`${API_BASE}/drive/v3/files/${
|
|
1445
|
+
const url = new URL(`${API_BASE}/drive/v3/files/${pathSegment(fileId)}/revisions/${pathSegment(revisionId)}`);
|
|
1449
1446
|
url.searchParams.set("alt", "media");
|
|
1450
1447
|
const res = await driveResponse(ctx, url.toString());
|
|
1451
1448
|
if (!res.ok) {
|
|
@@ -1500,7 +1497,7 @@ export default function googleDrive(rl) {
|
|
|
1500
1497
|
if (Object.keys(body).length === 0) {
|
|
1501
1498
|
throw new Error("googleDrive.revision.update: pass at least one of keepForever / published / publishAuto / publishedOutsideDomain.");
|
|
1502
1499
|
}
|
|
1503
|
-
return driveRequest(ctx, "PATCH", `/drive/v3/files/${p.fileId}/revisions/${p.revisionId}`, body, { fields: REVISION_FIELDS });
|
|
1500
|
+
return driveRequest(ctx, "PATCH", `/drive/v3/files/${pathSegment(p.fileId)}/revisions/${pathSegment(p.revisionId)}`, body, { fields: REVISION_FIELDS });
|
|
1504
1501
|
},
|
|
1505
1502
|
});
|
|
1506
1503
|
rl.registerAction("revision.delete", {
|
|
@@ -1509,7 +1506,7 @@ export default function googleDrive(rl) {
|
|
|
1509
1506
|
inputSchema: t.Object({ fileId: Id, revisionId: Id }, { additionalProperties: false }),
|
|
1510
1507
|
async execute(input, ctx) {
|
|
1511
1508
|
const p = (input ?? {});
|
|
1512
|
-
await driveRequest(ctx, "DELETE", `/drive/v3/files/${p.fileId}/revisions/${p.revisionId}`);
|
|
1509
|
+
await driveRequest(ctx, "DELETE", `/drive/v3/files/${pathSegment(p.fileId)}/revisions/${pathSegment(p.revisionId)}`);
|
|
1513
1510
|
return { success: true };
|
|
1514
1511
|
},
|
|
1515
1512
|
});
|
|
@@ -1522,7 +1519,7 @@ export default function googleDrive(rl) {
|
|
|
1522
1519
|
const fileId = p.fileId;
|
|
1523
1520
|
const revisionId = p.revisionId;
|
|
1524
1521
|
// 1. Pull the chosen revision's bytes.
|
|
1525
|
-
const dl = await driveResponse(ctx, `${API_BASE}/drive/v3/files/${
|
|
1522
|
+
const dl = await driveResponse(ctx, `${API_BASE}/drive/v3/files/${pathSegment(fileId)}/revisions/${pathSegment(revisionId)}?alt=media`);
|
|
1526
1523
|
if (!dl.ok) {
|
|
1527
1524
|
throw new Error(`googleDrive: revision restore download failed (HTTP ${dl.status})`);
|
|
1528
1525
|
}
|
|
@@ -1531,7 +1528,7 @@ export default function googleDrive(rl) {
|
|
|
1531
1528
|
dl.headers.get("content-type") ??
|
|
1532
1529
|
"application/octet-stream";
|
|
1533
1530
|
// 2. Multipart-PATCH them as the new head of the same file.
|
|
1534
|
-
const url = new URL(`${API_BASE}/upload/drive/v3/files/${
|
|
1531
|
+
const url = new URL(`${API_BASE}/upload/drive/v3/files/${pathSegment(fileId)}`);
|
|
1535
1532
|
url.searchParams.set("uploadType", "multipart");
|
|
1536
1533
|
url.searchParams.set("supportsAllDrives", "true");
|
|
1537
1534
|
url.searchParams.set("fields", "id,name,mimeType,modifiedTime,size,headRevisionId,webViewLink");
|
|
@@ -1546,7 +1543,7 @@ export default function googleDrive(rl) {
|
|
|
1546
1543
|
if (!res.ok) {
|
|
1547
1544
|
throw new Error(`googleDrive: revision restore upload failed (HTTP ${res.status})`);
|
|
1548
1545
|
}
|
|
1549
|
-
const head = (await res
|
|
1546
|
+
const head = (await jsonAnswer(res));
|
|
1550
1547
|
return { fileId, restoredFromRevisionId: revisionId, head };
|
|
1551
1548
|
},
|
|
1552
1549
|
});
|
|
@@ -1688,7 +1685,7 @@ export default function googleDrive(rl) {
|
|
|
1688
1685
|
if (Object.keys(body).length === 0 && !qs.removeExpiration) {
|
|
1689
1686
|
throw new Error("googleDrive.permission.update: pass at least one of role / expirationTime / removeExpiration.");
|
|
1690
1687
|
}
|
|
1691
|
-
return driveRequest(ctx, "PATCH", `/drive/v3/files/${p.fileId}/permissions/${p.permissionId}`, body, qs);
|
|
1688
|
+
return driveRequest(ctx, "PATCH", `/drive/v3/files/${pathSegment(p.fileId)}/permissions/${pathSegment(p.permissionId)}`, body, qs);
|
|
1692
1689
|
},
|
|
1693
1690
|
});
|
|
1694
1691
|
// ─── Access proposals ───────────────────────────────────────────
|
|
@@ -1706,7 +1703,7 @@ export default function googleDrive(rl) {
|
|
|
1706
1703
|
const out = [];
|
|
1707
1704
|
let pageToken;
|
|
1708
1705
|
do {
|
|
1709
|
-
const page = (await driveRequest(ctx, "GET", `/drive/v3/files/${p.fileId}/accessproposals`, undefined, { pageSize: p.pageSize ?? 100, pageToken }));
|
|
1706
|
+
const page = (await driveRequest(ctx, "GET", `/drive/v3/files/${pathSegment(p.fileId)}/accessproposals`, undefined, { pageSize: p.pageSize ?? 100, pageToken }));
|
|
1710
1707
|
if (Array.isArray(page.accessProposals))
|
|
1711
1708
|
out.push(...page.accessProposals);
|
|
1712
1709
|
pageToken = page.nextPageToken;
|
|
@@ -1744,7 +1741,7 @@ export default function googleDrive(rl) {
|
|
|
1744
1741
|
}
|
|
1745
1742
|
if (p.sendNotification !== undefined)
|
|
1746
1743
|
body.sendNotification = p.sendNotification;
|
|
1747
|
-
return driveRequest(ctx, "POST", `/drive/v3/files/${p.fileId}/accessproposals/${p.proposalId}:resolve`, body);
|
|
1744
|
+
return driveRequest(ctx, "POST", `/drive/v3/files/${pathSegment(p.fileId)}/accessproposals/${pathSegment(p.proposalId)}:resolve`, body);
|
|
1748
1745
|
},
|
|
1749
1746
|
});
|
|
1750
1747
|
// ─── About ───────────────────────────────────────────────────────
|
|
@@ -1771,7 +1768,7 @@ export default function googleDrive(rl) {
|
|
|
1771
1768
|
}, { additionalProperties: false }),
|
|
1772
1769
|
async execute(input, ctx) {
|
|
1773
1770
|
const p = (input ?? {});
|
|
1774
|
-
const u = new URL(`${API_BASE}/drive/v3/files/${
|
|
1771
|
+
const u = new URL(`${API_BASE}/drive/v3/files/${pathSegment(p.fileId)}/export`);
|
|
1775
1772
|
u.searchParams.set("mimeType", p.mimeType);
|
|
1776
1773
|
const res = await driveResponse(ctx, u.toString());
|
|
1777
1774
|
if (!res.ok) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { staticCredential } from "../../_shared/credentials.js";
|
|
2
|
+
/** A Google AI API key, appended by the transport as the `key` query
|
|
3
|
+
* parameter on the Generative Language API. */
|
|
4
|
+
export const googleImageCredential = staticCredential({
|
|
5
|
+
id: "googleImage",
|
|
6
|
+
auth: { kind: "queryKey", param: "key" },
|
|
7
|
+
local: { secret: "apiKey" },
|
|
8
|
+
targets: {
|
|
9
|
+
api: {
|
|
10
|
+
baseUrl: "https://generativelanguage.googleapis.com/v1beta/",
|
|
11
|
+
methods: ["POST"],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|