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
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SYNCED_FROM shift-labs-ai/cloud@42c9f13
|
|
3
|
+
* packages/business-world-model-service/src/models.ts
|
|
4
|
+
*
|
|
5
|
+
* Verbatim copy; only the import paths are rewritten. Do not edit here.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Public API shape: record envelopes, definitions, write inputs, queries.
|
|
9
|
+
* Browser-safe (Zod only).
|
|
10
|
+
*/
|
|
11
|
+
import { BWM_CARDINALITIES, BWM_HISTORY_DEFAULT_LIMIT, BWM_HISTORY_MAX_LIMIT, BWM_LIST_DEFAULT_LIMIT, BWM_LIST_MAX_LIMIT, BWM_SOCIAL_HANDLE_SERVICES, BWM_VALUE_TYPES, BWM_VISIBILITY_MODES, } from "./contracts.js";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
export const BwmValueType = z.enum(BWM_VALUE_TYPES);
|
|
14
|
+
export const BwmCardinality = z.enum(BWM_CARDINALITIES);
|
|
15
|
+
export const BwmVisibilityMode = z.enum(BWM_VISIBILITY_MODES);
|
|
16
|
+
export const BwmSocialHandleService = z.enum(BWM_SOCIAL_HANDLE_SERVICES);
|
|
17
|
+
export const BwmPrincipalType = z.enum(["user", "service"]);
|
|
18
|
+
export const BwmPrincipalRef = z.object({
|
|
19
|
+
type: BwmPrincipalType,
|
|
20
|
+
id: z.string().min(1),
|
|
21
|
+
});
|
|
22
|
+
const slug = z
|
|
23
|
+
.string()
|
|
24
|
+
.regex(/^[a-z][a-z0-9_]*$/)
|
|
25
|
+
.max(100);
|
|
26
|
+
/** `$system` or bare custom slug. */
|
|
27
|
+
const fieldKey = z.string().regex(/^\$?[a-zA-Z][a-zA-Z0-9_-]*$/);
|
|
28
|
+
export const BwmSelectOption = z.object({
|
|
29
|
+
id: z.string(),
|
|
30
|
+
label: z.string(),
|
|
31
|
+
description: z.string().nullable(),
|
|
32
|
+
parentId: z.string().optional(),
|
|
33
|
+
});
|
|
34
|
+
export const BwmTypeConfiguration = z.object({
|
|
35
|
+
currency: z.string().optional(),
|
|
36
|
+
handleService: BwmSocialHandleService.optional(),
|
|
37
|
+
multipleValues: z.boolean().optional(),
|
|
38
|
+
unique: z.boolean().optional(),
|
|
39
|
+
options: z.array(BwmSelectOption).optional(),
|
|
40
|
+
parentFieldKey: z.string().optional(),
|
|
41
|
+
});
|
|
42
|
+
export const BwmFieldDefinition = z.object({
|
|
43
|
+
id: z.string().nullable(),
|
|
44
|
+
slug: z.string(),
|
|
45
|
+
label: z.string(),
|
|
46
|
+
description: z.string().nullable(),
|
|
47
|
+
valueType: BwmValueType,
|
|
48
|
+
system: z.boolean(),
|
|
49
|
+
readOnly: z.boolean(),
|
|
50
|
+
required: z.boolean(),
|
|
51
|
+
typeConfiguration: BwmTypeConfiguration,
|
|
52
|
+
});
|
|
53
|
+
export const BwmRelationshipDefinition = z.object({
|
|
54
|
+
id: z.string().nullable(),
|
|
55
|
+
slug: z.string(),
|
|
56
|
+
label: z.string(),
|
|
57
|
+
description: z.string().nullable(),
|
|
58
|
+
system: z.boolean(),
|
|
59
|
+
readOnly: z.boolean(),
|
|
60
|
+
cardinality: BwmCardinality,
|
|
61
|
+
objectType: z.string(),
|
|
62
|
+
inverseKey: z.string().nullable(),
|
|
63
|
+
});
|
|
64
|
+
export const BwmDefinitions = z.object({
|
|
65
|
+
objectType: z.string(),
|
|
66
|
+
fieldDefinitions: z.record(z.string(), BwmFieldDefinition),
|
|
67
|
+
relationshipDefinitions: z.record(z.string(), BwmRelationshipDefinition),
|
|
68
|
+
});
|
|
69
|
+
export const BwmObjectType = z.object({
|
|
70
|
+
slug: z.string(),
|
|
71
|
+
label: z.string(),
|
|
72
|
+
pluralLabel: z.string(),
|
|
73
|
+
description: z.string().nullable(),
|
|
74
|
+
system: z.boolean(),
|
|
75
|
+
path: z.string(),
|
|
76
|
+
});
|
|
77
|
+
export const BwmVisibility = z.object({
|
|
78
|
+
mode: BwmVisibilityMode,
|
|
79
|
+
groups: z.array(z.string()),
|
|
80
|
+
principals: z.array(BwmPrincipalRef),
|
|
81
|
+
});
|
|
82
|
+
export const BwmFieldValue = z.object({
|
|
83
|
+
value: z.unknown(),
|
|
84
|
+
valueType: BwmValueType,
|
|
85
|
+
});
|
|
86
|
+
export const BwmRelationshipValue = z.object({
|
|
87
|
+
cardinality: BwmCardinality,
|
|
88
|
+
objectType: z.string(),
|
|
89
|
+
values: z.array(z.string()),
|
|
90
|
+
});
|
|
91
|
+
export const BwmRecord = z.object({
|
|
92
|
+
id: z.string(),
|
|
93
|
+
objectType: z.string(),
|
|
94
|
+
createdAt: z.string().datetime(),
|
|
95
|
+
updatedAt: z.string().datetime(),
|
|
96
|
+
archivedAt: z.string().datetime().nullable(),
|
|
97
|
+
mergedIntoId: z.string().nullable(),
|
|
98
|
+
externalId: z.string().nullable(),
|
|
99
|
+
visibility: BwmVisibility,
|
|
100
|
+
fields: z.record(z.string(), BwmFieldValue),
|
|
101
|
+
relationships: z.record(z.string(), BwmRelationshipValue),
|
|
102
|
+
});
|
|
103
|
+
export const BwmRecordPage = z.object({
|
|
104
|
+
data: z.array(BwmRecord),
|
|
105
|
+
object: z.literal("list"),
|
|
106
|
+
totalCount: z.number().int().nonnegative(),
|
|
107
|
+
});
|
|
108
|
+
// ─── writes ──────────────────────────────────────────────────────
|
|
109
|
+
const idOrIds = z.union([z.string().min(1), z.array(z.string().min(1))]);
|
|
110
|
+
export const BwmRelationshipOps = z
|
|
111
|
+
.object({
|
|
112
|
+
add: idOrIds.optional(),
|
|
113
|
+
remove: idOrIds.optional(),
|
|
114
|
+
replace: idOrIds.nullable().optional(),
|
|
115
|
+
})
|
|
116
|
+
.strict();
|
|
117
|
+
export const BwmVisibilityInput = z.object({
|
|
118
|
+
mode: BwmVisibilityMode,
|
|
119
|
+
groups: z.array(z.string().min(1)).default([]),
|
|
120
|
+
principals: z.array(BwmPrincipalRef).default([]),
|
|
121
|
+
});
|
|
122
|
+
export const BwmCreateRecordInput = z.object({
|
|
123
|
+
fields: z.record(fieldKey, z.unknown()).default({}),
|
|
124
|
+
relationships: z.record(fieldKey, idOrIds).default({}),
|
|
125
|
+
externalId: z.string().trim().min(1).max(500).optional(),
|
|
126
|
+
visibility: BwmVisibilityInput.optional(),
|
|
127
|
+
});
|
|
128
|
+
export const BwmUpdateRecordInput = z.object({
|
|
129
|
+
fields: z.record(fieldKey, z.unknown()).optional(),
|
|
130
|
+
relationships: z
|
|
131
|
+
.record(fieldKey, z.union([idOrIds, z.null(), BwmRelationshipOps]))
|
|
132
|
+
.optional(),
|
|
133
|
+
externalId: z.string().trim().max(500).nullish(),
|
|
134
|
+
visibility: BwmVisibilityInput.optional(),
|
|
135
|
+
archived: z.boolean().optional(),
|
|
136
|
+
});
|
|
137
|
+
export const BwmCreateObjectTypeInput = z.object({
|
|
138
|
+
slug,
|
|
139
|
+
label: z.string().trim().min(1).max(200),
|
|
140
|
+
pluralLabel: z.string().trim().min(1).max(200).optional(),
|
|
141
|
+
description: z.string().trim().min(1).max(2_000).optional(),
|
|
142
|
+
});
|
|
143
|
+
export const BwmCreateFieldInput = z
|
|
144
|
+
.object({
|
|
145
|
+
key: slug,
|
|
146
|
+
label: z.string().trim().min(1).max(200),
|
|
147
|
+
description: z.string().trim().min(1).max(2_000).optional(),
|
|
148
|
+
valueType: BwmValueType,
|
|
149
|
+
options: z
|
|
150
|
+
.array(z.object({
|
|
151
|
+
id: z.string().trim().min(1).max(200).optional(),
|
|
152
|
+
label: z.string().trim().min(1).max(500),
|
|
153
|
+
description: z.string().trim().max(2_000).optional(),
|
|
154
|
+
}))
|
|
155
|
+
.default([]),
|
|
156
|
+
validation: z
|
|
157
|
+
.object({
|
|
158
|
+
minLength: z.number().int().nonnegative().optional(),
|
|
159
|
+
maxLength: z.number().int().nonnegative().optional(),
|
|
160
|
+
minimum: z.number().finite().optional(),
|
|
161
|
+
maximum: z.number().finite().optional(),
|
|
162
|
+
pattern: z.string().max(1_000).optional(),
|
|
163
|
+
})
|
|
164
|
+
.strict()
|
|
165
|
+
.default({}),
|
|
166
|
+
typeConfiguration: z
|
|
167
|
+
.object({
|
|
168
|
+
currency: z.string().trim().length(3).optional(),
|
|
169
|
+
handleService: BwmSocialHandleService.optional(),
|
|
170
|
+
multipleValues: z.boolean().optional(),
|
|
171
|
+
unique: z.boolean().optional(),
|
|
172
|
+
})
|
|
173
|
+
.strict()
|
|
174
|
+
.default({}),
|
|
175
|
+
filterable: z.boolean().default(true),
|
|
176
|
+
})
|
|
177
|
+
.superRefine((input, context) => {
|
|
178
|
+
const isSelect = input.valueType === "SINGLE_SELECT" || input.valueType === "MULTI_SELECT";
|
|
179
|
+
if (isSelect && input.options.length === 0) {
|
|
180
|
+
context.addIssue({ code: "custom", message: "select_options_required" });
|
|
181
|
+
}
|
|
182
|
+
if (!isSelect && input.options.length > 0) {
|
|
183
|
+
context.addIssue({
|
|
184
|
+
code: "custom",
|
|
185
|
+
message: "select_options_not_allowed",
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
const labels = input.options.map((option) => option.label);
|
|
189
|
+
if (new Set(labels).size !== labels.length) {
|
|
190
|
+
context.addIssue({ code: "custom", message: "duplicate_select_option" });
|
|
191
|
+
}
|
|
192
|
+
if (input.validation.pattern !== undefined) {
|
|
193
|
+
try {
|
|
194
|
+
new RegExp(input.validation.pattern);
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
context.addIssue({ code: "custom", message: "pattern_invalid" });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const { minLength: minL, maxLength: maxL, minimum, maximum, } = input.validation;
|
|
201
|
+
if (minL !== undefined && maxL !== undefined && minL > maxL) {
|
|
202
|
+
context.addIssue({ code: "custom", message: "length_range_invalid" });
|
|
203
|
+
}
|
|
204
|
+
if (minimum !== undefined && maximum !== undefined && minimum > maximum) {
|
|
205
|
+
context.addIssue({ code: "custom", message: "number_range_invalid" });
|
|
206
|
+
}
|
|
207
|
+
const textual = input.valueType === "TEXT" || input.valueType === "MARKDOWN";
|
|
208
|
+
if (!textual &&
|
|
209
|
+
(minL !== undefined || maxL !== undefined || input.validation.pattern)) {
|
|
210
|
+
context.addIssue({
|
|
211
|
+
code: "custom",
|
|
212
|
+
message: "string_validation_not_allowed",
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
const numeric = input.valueType === "NUMBER" || input.valueType === "CURRENCY";
|
|
216
|
+
if (!numeric && (minimum !== undefined || maximum !== undefined)) {
|
|
217
|
+
context.addIssue({
|
|
218
|
+
code: "custom",
|
|
219
|
+
message: "number_validation_not_allowed",
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
if (input.valueType === "SOCIAL_HANDLE" &&
|
|
223
|
+
!input.typeConfiguration.handleService) {
|
|
224
|
+
context.addIssue({ code: "custom", message: "handle_service_required" });
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
export const BwmCreateRelationshipDefinitionInput = z.object({
|
|
228
|
+
key: slug,
|
|
229
|
+
label: z.string().trim().min(1).max(200),
|
|
230
|
+
description: z.string().trim().min(1).max(2_000).optional(),
|
|
231
|
+
objectType: slug,
|
|
232
|
+
cardinality: BwmCardinality.default("HAS_MANY"),
|
|
233
|
+
/** Read-only `HAS_MANY` key exposed on the target type. */
|
|
234
|
+
inverseKey: slug.optional(),
|
|
235
|
+
});
|
|
236
|
+
export const BwmCreatePipelineInput = z
|
|
237
|
+
.object({
|
|
238
|
+
name: z.string().trim().min(1).max(200),
|
|
239
|
+
isDefault: z.boolean().default(false),
|
|
240
|
+
stages: z
|
|
241
|
+
.array(z.object({
|
|
242
|
+
key: slug,
|
|
243
|
+
name: z.string().trim().min(1).max(200),
|
|
244
|
+
position: z.number().int().nonnegative(),
|
|
245
|
+
outcome: z.enum(["open", "won", "lost"]).default("open"),
|
|
246
|
+
defaultProbability: z.number().int().min(0).max(100).optional(),
|
|
247
|
+
}))
|
|
248
|
+
.min(1),
|
|
249
|
+
})
|
|
250
|
+
.superRefine((input, context) => {
|
|
251
|
+
const keys = input.stages.map((stage) => stage.key);
|
|
252
|
+
if (new Set(keys).size !== keys.length) {
|
|
253
|
+
context.addIssue({ code: "custom", message: "duplicate_stage_key" });
|
|
254
|
+
}
|
|
255
|
+
const positions = input.stages.map((stage) => stage.position);
|
|
256
|
+
if (new Set(positions).size !== positions.length) {
|
|
257
|
+
context.addIssue({ code: "custom", message: "duplicate_stage_position" });
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
export const BwmPipeline = z.object({
|
|
261
|
+
id: z.string(),
|
|
262
|
+
name: z.string(),
|
|
263
|
+
isDefault: z.boolean(),
|
|
264
|
+
stages: z.array(z.object({
|
|
265
|
+
id: z.string(),
|
|
266
|
+
key: z.string(),
|
|
267
|
+
name: z.string(),
|
|
268
|
+
position: z.number().int(),
|
|
269
|
+
outcome: z.enum(["open", "won", "lost"]),
|
|
270
|
+
defaultProbability: z.number().int().nullable(),
|
|
271
|
+
})),
|
|
272
|
+
createdAt: z.string().datetime(),
|
|
273
|
+
updatedAt: z.string().datetime(),
|
|
274
|
+
});
|
|
275
|
+
// ─── queries ─────────────────────────────────────────────────────
|
|
276
|
+
export const BwmFilterOperator = z.enum([
|
|
277
|
+
"equal",
|
|
278
|
+
"startsWith",
|
|
279
|
+
"contains",
|
|
280
|
+
"greaterThan",
|
|
281
|
+
"greaterThanOrEqual",
|
|
282
|
+
"lessThan",
|
|
283
|
+
"lessThanOrEqual",
|
|
284
|
+
]);
|
|
285
|
+
export const BwmFilter = z.object({
|
|
286
|
+
key: z.string().min(1),
|
|
287
|
+
operator: BwmFilterOperator.optional(),
|
|
288
|
+
negate: z.boolean().default(false),
|
|
289
|
+
value: z.string(),
|
|
290
|
+
});
|
|
291
|
+
export const BwmListQuery = z.object({
|
|
292
|
+
limit: z.coerce
|
|
293
|
+
.number()
|
|
294
|
+
.int()
|
|
295
|
+
.min(1)
|
|
296
|
+
.max(BWM_LIST_MAX_LIMIT)
|
|
297
|
+
.default(BWM_LIST_DEFAULT_LIMIT),
|
|
298
|
+
offset: z.coerce.number().int().nonnegative().default(0),
|
|
299
|
+
includeArchived: z.boolean().default(false),
|
|
300
|
+
filters: z.array(BwmFilter).default([]),
|
|
301
|
+
});
|
|
302
|
+
export const BwmHistoryQuery = z.object({
|
|
303
|
+
limit: z.coerce
|
|
304
|
+
.number()
|
|
305
|
+
.int()
|
|
306
|
+
.min(1)
|
|
307
|
+
.max(BWM_HISTORY_MAX_LIMIT)
|
|
308
|
+
.default(BWM_HISTORY_DEFAULT_LIMIT),
|
|
309
|
+
after: z.string().min(1).optional(),
|
|
310
|
+
});
|
|
311
|
+
export const BwmFieldHistoryEntry = z.object({
|
|
312
|
+
value: z.unknown(),
|
|
313
|
+
valueType: BwmValueType,
|
|
314
|
+
displayValue: z.string(),
|
|
315
|
+
recordedAt: z.string().datetime(),
|
|
316
|
+
isCreate: z.boolean(),
|
|
317
|
+
});
|
|
318
|
+
export const BwmFieldHistory = z.object({
|
|
319
|
+
data: z.array(BwmFieldHistoryEntry),
|
|
320
|
+
hasMore: z.boolean(),
|
|
321
|
+
nextCursor: z.string().nullable(),
|
|
322
|
+
});
|
|
323
|
+
export const BwmLinkDirection = z.enum(["in", "out", "both"]);
|
|
324
|
+
// ─── lists, groups, merges, members ──────────────────────────────
|
|
325
|
+
export const BwmList = z.object({
|
|
326
|
+
id: z.string(),
|
|
327
|
+
createdAt: z.string().datetime(),
|
|
328
|
+
updatedAt: z.string().datetime(),
|
|
329
|
+
archivedAt: z.string().datetime().nullable(),
|
|
330
|
+
fields: z.object({
|
|
331
|
+
$name: BwmFieldValue,
|
|
332
|
+
$objectType: BwmFieldValue,
|
|
333
|
+
$description: BwmFieldValue,
|
|
334
|
+
}),
|
|
335
|
+
relationships: z.object({ $records: BwmRelationshipValue }),
|
|
336
|
+
});
|
|
337
|
+
export const BwmCreateListInput = z.object({
|
|
338
|
+
fields: z.object({
|
|
339
|
+
$name: z.string().trim().min(1).max(200),
|
|
340
|
+
$objectType: z.string().min(1),
|
|
341
|
+
$description: z.string().trim().max(2_000).nullish(),
|
|
342
|
+
}),
|
|
343
|
+
relationships: z.object({ $records: idOrIds.optional() }).default({}),
|
|
344
|
+
});
|
|
345
|
+
export const BwmUpdateListInput = z.object({
|
|
346
|
+
fields: z
|
|
347
|
+
.object({
|
|
348
|
+
$name: z.string().trim().min(1).max(200).optional(),
|
|
349
|
+
$description: z.string().trim().max(2_000).nullish(),
|
|
350
|
+
})
|
|
351
|
+
.optional(),
|
|
352
|
+
relationships: z
|
|
353
|
+
.object({ $records: z.union([idOrIds, BwmRelationshipOps]).optional() })
|
|
354
|
+
.optional(),
|
|
355
|
+
archived: z.boolean().optional(),
|
|
356
|
+
});
|
|
357
|
+
export const BwmGroup = z.object({
|
|
358
|
+
id: z.string(),
|
|
359
|
+
slug: z.string(),
|
|
360
|
+
name: z.string(),
|
|
361
|
+
description: z.string().nullable(),
|
|
362
|
+
members: z.array(BwmPrincipalRef),
|
|
363
|
+
createdAt: z.string().datetime(),
|
|
364
|
+
updatedAt: z.string().datetime(),
|
|
365
|
+
});
|
|
366
|
+
export const BwmCreateGroupInput = z.object({
|
|
367
|
+
slug,
|
|
368
|
+
name: z.string().trim().min(1).max(200),
|
|
369
|
+
description: z.string().trim().min(1).max(2_000).optional(),
|
|
370
|
+
members: z.array(BwmPrincipalRef).default([]),
|
|
371
|
+
});
|
|
372
|
+
export const BwmUpdateGroupInput = z.object({
|
|
373
|
+
name: z.string().trim().min(1).max(200).optional(),
|
|
374
|
+
description: z.string().trim().max(2_000).nullish(),
|
|
375
|
+
});
|
|
376
|
+
export const BwmGroupMembersInput = z
|
|
377
|
+
.object({
|
|
378
|
+
add: z.array(BwmPrincipalRef).default([]),
|
|
379
|
+
remove: z.array(BwmPrincipalRef).default([]),
|
|
380
|
+
})
|
|
381
|
+
.refine((input) => input.add.length > 0 || input.remove.length > 0, "group_members_empty");
|
|
382
|
+
export const BwmMergeInput = z.object({
|
|
383
|
+
primaryId: z.string().min(1),
|
|
384
|
+
duplicateId: z.string().min(1),
|
|
385
|
+
fieldResolutions: z
|
|
386
|
+
.record(fieldKey, z.union([
|
|
387
|
+
z.literal("primary"),
|
|
388
|
+
z.literal("duplicate"),
|
|
389
|
+
z.object({ value: z.unknown() }),
|
|
390
|
+
]))
|
|
391
|
+
.default({}),
|
|
392
|
+
options: z.object({ multiSelectUnion: z.boolean().default(true) }).default({
|
|
393
|
+
multiSelectUnion: true,
|
|
394
|
+
}),
|
|
395
|
+
});
|
|
396
|
+
export const BwmMerge = z.object({
|
|
397
|
+
id: z.string(),
|
|
398
|
+
createdAt: z.string().datetime(),
|
|
399
|
+
objectType: z.string(),
|
|
400
|
+
primaryId: z.string(),
|
|
401
|
+
duplicateId: z.string(),
|
|
402
|
+
status: z.enum(["done", "failed"]),
|
|
403
|
+
summary: z.object({
|
|
404
|
+
fieldWriteCount: z.number().int(),
|
|
405
|
+
repointedCount: z.number().int(),
|
|
406
|
+
warnings: z.array(z.string()),
|
|
407
|
+
}),
|
|
408
|
+
});
|
|
409
|
+
export const BwmMergeResult = z.object({
|
|
410
|
+
merge: BwmMerge,
|
|
411
|
+
primary: BwmRecord,
|
|
412
|
+
summary: BwmMerge.shape.summary,
|
|
413
|
+
});
|
|
414
|
+
export const BwmMember = z.object({
|
|
415
|
+
id: z.string(),
|
|
416
|
+
createdAt: z.string().datetime(),
|
|
417
|
+
fields: z.object({
|
|
418
|
+
$name: BwmFieldValue,
|
|
419
|
+
$email: BwmFieldValue,
|
|
420
|
+
$role: BwmFieldValue,
|
|
421
|
+
}),
|
|
422
|
+
});
|
|
423
|
+
export const BwmMemberPage = z.object({
|
|
424
|
+
data: z.array(BwmMember),
|
|
425
|
+
object: z.literal("list"),
|
|
426
|
+
totalCount: z.number().int(),
|
|
427
|
+
});
|
|
428
|
+
export const BwmChangeEvent = z.object({
|
|
429
|
+
id: z.string(),
|
|
430
|
+
recordId: z.string(),
|
|
431
|
+
actor: BwmPrincipalRef,
|
|
432
|
+
action: z.enum(["created", "updated"]),
|
|
433
|
+
before: z.unknown().optional(),
|
|
434
|
+
after: z.unknown(),
|
|
435
|
+
importRunId: z.string().nullable(),
|
|
436
|
+
createdAt: z.string().datetime(),
|
|
437
|
+
});
|
|
438
|
+
export const BwmLink = z.object({
|
|
439
|
+
id: z.string(),
|
|
440
|
+
fromRecordId: z.string(),
|
|
441
|
+
toRecordId: z.string(),
|
|
442
|
+
fromObjectType: z.string(),
|
|
443
|
+
toObjectType: z.string(),
|
|
444
|
+
key: z.string(),
|
|
445
|
+
role: z.string().nullable(),
|
|
446
|
+
attributes: z.record(z.string(), z.unknown()),
|
|
447
|
+
declared: z.boolean(),
|
|
448
|
+
createdAt: z.string().datetime(),
|
|
449
|
+
});
|
|
450
|
+
export const BwmLinks = z.object({
|
|
451
|
+
outbound: z.array(BwmLink),
|
|
452
|
+
inbound: z.array(BwmLink),
|
|
453
|
+
});
|
|
454
|
+
export const BwmFileUploadInput = z.object({
|
|
455
|
+
filename: z.string().trim().min(1).max(500),
|
|
456
|
+
mimeType: z.string().trim().min(1).max(200),
|
|
457
|
+
sizeBytes: z.number().int().positive(),
|
|
458
|
+
});
|
|
459
|
+
export const BwmFile = z.object({
|
|
460
|
+
id: z.string(),
|
|
461
|
+
filename: z.string().nullable(),
|
|
462
|
+
mimeType: z.string(),
|
|
463
|
+
sizeBytes: z.number().int(),
|
|
464
|
+
status: z.enum(["PENDING", "COMPLETED", "ARCHIVED"]),
|
|
465
|
+
createdAt: z.string().datetime(),
|
|
466
|
+
completedAt: z.string().datetime().nullable(),
|
|
467
|
+
});
|
|
468
|
+
/** A file plus its one-time upload grant; `expiresAt` is the grant's. */
|
|
469
|
+
export const BwmFileUpload = BwmFile.extend({
|
|
470
|
+
uploadUrl: z.string(),
|
|
471
|
+
uploadMethod: z.string(),
|
|
472
|
+
uploadHeaders: z.record(z.string(), z.string()),
|
|
473
|
+
expiresAt: z.string().datetime(),
|
|
474
|
+
});
|
|
475
|
+
export const BwmFileUrl = z.object({
|
|
476
|
+
url: z.string(),
|
|
477
|
+
expiresAt: z.string().datetime(),
|
|
478
|
+
});
|
|
479
|
+
// ─── imports (Shift protocol, unchanged) ─────────────────────────
|
|
480
|
+
export const BwmCreateImportRunInput = z.object({
|
|
481
|
+
sourceSystem: z.string().trim().min(1).max(100),
|
|
482
|
+
});
|
|
483
|
+
export const BwmStageImportRowsInput = z.object({
|
|
484
|
+
rows: z
|
|
485
|
+
.array(z.object({
|
|
486
|
+
sourceId: z.string().trim().min(1).max(500),
|
|
487
|
+
objectType: slug,
|
|
488
|
+
rawPayload: z.json(),
|
|
489
|
+
}))
|
|
490
|
+
.min(1)
|
|
491
|
+
.max(500),
|
|
492
|
+
});
|
|
493
|
+
export const BwmCommitImportRowInput = z.object({
|
|
494
|
+
transformedPayload: z.json(),
|
|
495
|
+
});
|
|
496
|
+
/**
|
|
497
|
+
* Parses `key[op]=value` / `key[-op]=value` / `key=value` query pairs into
|
|
498
|
+
* filters. Reserved pagination keys are skipped.
|
|
499
|
+
*/
|
|
500
|
+
export function parseFilterQuery(entries) {
|
|
501
|
+
const reserved = new Set(["limit", "offset", "includeArchived"]);
|
|
502
|
+
const filters = [];
|
|
503
|
+
for (const [rawKey, value] of entries) {
|
|
504
|
+
if (reserved.has(rawKey))
|
|
505
|
+
continue;
|
|
506
|
+
const match = /^(.+?)(?:\[(-?)([a-zA-Z]+)\])?$/.exec(rawKey);
|
|
507
|
+
if (!match)
|
|
508
|
+
continue;
|
|
509
|
+
const [, key, minus, operator] = match;
|
|
510
|
+
if (!key)
|
|
511
|
+
continue;
|
|
512
|
+
const parsedOperator = operator
|
|
513
|
+
? BwmFilterOperator.safeParse(operator)
|
|
514
|
+
: undefined;
|
|
515
|
+
if (parsedOperator && !parsedOperator.success)
|
|
516
|
+
continue;
|
|
517
|
+
filters.push({
|
|
518
|
+
key,
|
|
519
|
+
operator: parsedOperator?.data,
|
|
520
|
+
negate: minus === "-",
|
|
521
|
+
value,
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
return filters;
|
|
525
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "typebox";
|
|
2
|
-
import { CRM_ACCESS_ROLE, CRM_BASE, enumSchema, idSchema,
|
|
2
|
+
import { CRM_ACCESS_ROLE, CRM_BASE, enumSchema, idSchema, pathSegment, request, STRICT_OBJECT, } from "./shared.js";
|
|
3
3
|
export function registerAccessActions(rl) {
|
|
4
4
|
rl.registerAction("access.me", {
|
|
5
5
|
access: "read",
|
|
@@ -14,7 +14,7 @@ export function registerAccessActions(rl) {
|
|
|
14
14
|
description: "List CRM access grants. Requires a CRM admin grant or admin:* permission.",
|
|
15
15
|
inputSchema: t.Object({ includeRevoked: t.Optional(t.Boolean()) }, STRICT_OBJECT),
|
|
16
16
|
async execute(input, ctx) {
|
|
17
|
-
const body = await request(ctx,
|
|
17
|
+
const body = await request(ctx, `${CRM_BASE}/access`, { query: input });
|
|
18
18
|
return body.grants;
|
|
19
19
|
},
|
|
20
20
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "typebox";
|
|
2
|
-
import { CRM_BASE, createRecordFields, idSchema,
|
|
2
|
+
import { CRM_BASE, createRecordFields, idSchema, paginationFields, pathSegment, request, STRICT_OBJECT, STRICT_UPDATE_OBJECT, updateRecordFields, } from "./shared.js";
|
|
3
3
|
const accountListFields = {
|
|
4
4
|
search: t.Optional(t.String({ minLength: 1, pattern: "\\S", description: "Name search" })),
|
|
5
5
|
accountType: t.Optional(t.String({ minLength: 1, description: "Account type filter" })),
|
|
@@ -19,7 +19,7 @@ export function registerAccountActions(rl) {
|
|
|
19
19
|
description: "List the first page of CRM accounts.",
|
|
20
20
|
inputSchema: t.Object(accountListFields, STRICT_OBJECT),
|
|
21
21
|
async execute(input, ctx) {
|
|
22
|
-
const body = await request(ctx,
|
|
22
|
+
const body = await request(ctx, `${CRM_BASE}/accounts`, { query: input });
|
|
23
23
|
return body.accounts;
|
|
24
24
|
},
|
|
25
25
|
});
|
|
@@ -28,7 +28,7 @@ export function registerAccountActions(rl) {
|
|
|
28
28
|
description: "List a cursor-paginated page of CRM accounts.",
|
|
29
29
|
inputSchema: t.Object(accountListFields, STRICT_OBJECT),
|
|
30
30
|
async execute(input, ctx) {
|
|
31
|
-
return request(ctx,
|
|
31
|
+
return request(ctx, `${CRM_BASE}/accounts`, { query: input });
|
|
32
32
|
},
|
|
33
33
|
});
|
|
34
34
|
rl.registerAction("account.get", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "typebox";
|
|
2
|
-
import { assertTimeOrder, CRM_ACTIVITY_DIRECTION, CRM_ACTIVITY_STATUS, CRM_BASE, createRecordFields, enumSchema, idSchema,
|
|
2
|
+
import { assertTimeOrder, CRM_ACTIVITY_DIRECTION, CRM_ACTIVITY_STATUS, CRM_BASE, createRecordFields, enumSchema, idSchema, paginationFields, request, STRICT_OBJECT, timestampSchema, } from "./shared.js";
|
|
3
3
|
const activityListFields = {
|
|
4
4
|
linkedRecordId: t.Optional(idSchema("Filter by linked CRM record ID")),
|
|
5
5
|
status: t.Optional(enumSchema("Activity status", CRM_ACTIVITY_STATUS)),
|
|
@@ -11,7 +11,7 @@ export function registerActivityActions(rl) {
|
|
|
11
11
|
description: "List the first page of CRM activities.",
|
|
12
12
|
inputSchema: t.Object(activityListFields, STRICT_OBJECT),
|
|
13
13
|
async execute(input, ctx) {
|
|
14
|
-
const body = await request(ctx,
|
|
14
|
+
const body = await request(ctx, `${CRM_BASE}/activities`, { query: input });
|
|
15
15
|
return body.activities;
|
|
16
16
|
},
|
|
17
17
|
});
|
|
@@ -20,7 +20,7 @@ export function registerActivityActions(rl) {
|
|
|
20
20
|
description: "List a cursor-paginated page of CRM activities.",
|
|
21
21
|
inputSchema: t.Object(activityListFields, STRICT_OBJECT),
|
|
22
22
|
async execute(input, ctx) {
|
|
23
|
-
return request(ctx,
|
|
23
|
+
return request(ctx, `${CRM_BASE}/activities`, { query: input });
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
26
|
rl.registerAction("activity.log", {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { shiftClient } from "../../_shared/shiftCredentials.js";
|
|
2
|
+
/**
|
|
3
|
+
* A user-subject Shift CRM API key, signed like every Shift key. The probe
|
|
4
|
+
* reads the key's own CRM access: a key without a grant is rejected there.
|
|
5
|
+
*/
|
|
6
|
+
export const { credential: shiftCrmCredential, request } = shiftClient("shiftCrm", { probe: "crm/access/me" });
|
|
@@ -2,6 +2,7 @@ import * as t from "typebox";
|
|
|
2
2
|
import { registerAccessActions } from "./access.js";
|
|
3
3
|
import { registerAccountActions } from "./accounts.js";
|
|
4
4
|
import { registerActivityActions } from "./activities.js";
|
|
5
|
+
import { shiftCrmCredential } from "./credentials.js";
|
|
5
6
|
import { registerImportActions } from "./imports.js";
|
|
6
7
|
import { registerOpportunityActions, registerPipelineActions, } from "./opportunities.js";
|
|
7
8
|
import { registerPersonActions } from "./people.js";
|
|
@@ -10,6 +11,7 @@ import { registerTaskActions } from "./tasks.js";
|
|
|
10
11
|
export default function shiftCrm(rl) {
|
|
11
12
|
rl.setName("shiftCrm");
|
|
12
13
|
rl.setVersion("0.1.0");
|
|
14
|
+
rl.setCredential(shiftCrmCredential);
|
|
13
15
|
rl.setConnectionSchema(t.Object({
|
|
14
16
|
apiKey: t.String({
|
|
15
17
|
description: "User-subject Shift CRM API key minted by an operator via `bun run crm:access key`. It authenticates as its bound user, whose active CRM access grant authorizes data access. Regular Shift cloud service API keys (SHIFT_LABS_API_KEY) cannot reach CRM data.",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "typebox";
|
|
2
|
-
import { CRM_BASE, CRM_PIPELINE_OUTCOME, createRecordFields, enumSchema, idSchema,
|
|
2
|
+
import { CRM_BASE, CRM_PIPELINE_OUTCOME, createRecordFields, enumSchema, idSchema, nullableTimestamp, paginationFields, pathSegment, request, STRICT_OBJECT, STRICT_UPDATE_OBJECT, timestampSchema, updateRecordFields, } from "./shared.js";
|
|
3
3
|
const opportunityListFields = {
|
|
4
4
|
accountId: t.Optional(idSchema("Filter by account record ID")),
|
|
5
5
|
pipelineId: t.Optional(idSchema("Filter by pipeline ID")),
|
|
@@ -70,7 +70,7 @@ export function registerOpportunityActions(rl) {
|
|
|
70
70
|
description: "List the first page of CRM opportunities.",
|
|
71
71
|
inputSchema: t.Object(opportunityListFields, STRICT_OBJECT),
|
|
72
72
|
async execute(input, ctx) {
|
|
73
|
-
const body = await request(ctx,
|
|
73
|
+
const body = await request(ctx, `${CRM_BASE}/opportunities`, { query: input });
|
|
74
74
|
return body.opportunities;
|
|
75
75
|
},
|
|
76
76
|
});
|
|
@@ -79,7 +79,7 @@ export function registerOpportunityActions(rl) {
|
|
|
79
79
|
description: "List a cursor-paginated page of CRM opportunities.",
|
|
80
80
|
inputSchema: t.Object(opportunityListFields, STRICT_OBJECT),
|
|
81
81
|
async execute(input, ctx) {
|
|
82
|
-
return request(ctx,
|
|
82
|
+
return request(ctx, `${CRM_BASE}/opportunities`, { query: input });
|
|
83
83
|
},
|
|
84
84
|
});
|
|
85
85
|
rl.registerAction("opportunity.get", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "typebox";
|
|
2
|
-
import { assertTimeOrder, CRM_BASE, CRM_IDENTITY_KIND, createRecordFields, enumSchema, idSchema,
|
|
2
|
+
import { assertTimeOrder, CRM_BASE, CRM_IDENTITY_KIND, createRecordFields, enumSchema, idSchema, paginationFields, pathSegment, request, STRICT_OBJECT, STRICT_UPDATE_OBJECT, timestampSchema, updateRecordFields, } from "./shared.js";
|
|
3
3
|
const personListFields = {
|
|
4
4
|
search: t.Optional(t.String({ minLength: 1, pattern: "\\S", description: "Name search" })),
|
|
5
5
|
accountId: t.Optional(idSchema("Filter by affiliated account record ID")),
|
|
@@ -55,7 +55,7 @@ export function registerPersonActions(rl) {
|
|
|
55
55
|
description: "List the first page of CRM people.",
|
|
56
56
|
inputSchema: t.Object(personListFields, STRICT_OBJECT),
|
|
57
57
|
async execute(input, ctx) {
|
|
58
|
-
const body = await request(ctx,
|
|
58
|
+
const body = await request(ctx, `${CRM_BASE}/people`, { query: input });
|
|
59
59
|
return body.people;
|
|
60
60
|
},
|
|
61
61
|
});
|
|
@@ -64,7 +64,7 @@ export function registerPersonActions(rl) {
|
|
|
64
64
|
description: "List a cursor-paginated page of CRM people.",
|
|
65
65
|
inputSchema: t.Object(personListFields, STRICT_OBJECT),
|
|
66
66
|
async execute(input, ctx) {
|
|
67
|
-
return request(ctx,
|
|
67
|
+
return request(ctx, `${CRM_BASE}/people`, { query: input });
|
|
68
68
|
},
|
|
69
69
|
});
|
|
70
70
|
rl.registerAction("person.get", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "typebox";
|
|
2
|
-
import { CRM_BASE, CRM_PROPERTY_DATA_TYPE, enumSchema, idSchema,
|
|
2
|
+
import { CRM_BASE, CRM_PROPERTY_DATA_TYPE, enumSchema, idSchema, pathSegment, recordTypeSchema, request, STRICT_OBJECT, } from "./shared.js";
|
|
3
3
|
export function registerRecordActions(rl) {
|
|
4
4
|
rl.registerAction("record.changeEvents", {
|
|
5
5
|
access: "read",
|
|
@@ -16,7 +16,7 @@ export function registerRecordActions(rl) {
|
|
|
16
16
|
description: "List governed custom-property definitions, optionally for one record type.",
|
|
17
17
|
inputSchema: t.Object({ recordType: t.Optional(recordTypeSchema()) }, STRICT_OBJECT),
|
|
18
18
|
async execute(input, ctx) {
|
|
19
|
-
const body = await request(ctx,
|
|
19
|
+
const body = await request(ctx, `${CRM_BASE}/property-definitions`, { query: input });
|
|
20
20
|
return body.propertyDefinitions;
|
|
21
21
|
},
|
|
22
22
|
});
|