@withgateway/sdk 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -6
- package/dist/cli.js +8950 -3291
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +8753 -3094
- package/dist/cli.mjs.map +1 -1
- package/dist/files/index.d.mts +2 -0
- package/dist/files/index.d.ts +2 -0
- package/dist/files/index.js +446 -0
- package/dist/files/index.js.map +1 -0
- package/dist/files/index.mjs +395 -0
- package/dist/files/index.mjs.map +1 -0
- package/dist/index-BgvvQ3BC.d.ts +170 -0
- package/dist/index-CLkMr6VG.d.ts +171 -0
- package/dist/index-CdbmO4aX.d.mts +171 -0
- package/dist/index-CiKWoroJ.d.mts +170 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2288 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2260 -116
- package/dist/index.mjs.map +1 -1
- package/dist/traces/index.d.mts +2 -0
- package/dist/traces/index.d.ts +2 -0
- package/dist/traces/index.js +320 -0
- package/dist/traces/index.js.map +1 -0
- package/dist/traces/index.mjs +278 -0
- package/dist/traces/index.mjs.map +1 -0
- package/dist/tracing/index.js +16 -1
- package/dist/tracing/index.js.map +1 -1
- package/dist/tracing/index.mjs +16 -1
- package/dist/tracing/index.mjs.map +1 -1
- package/dist/worlds/index.d.mts +685 -1
- package/dist/worlds/index.d.ts +685 -1
- package/dist/worlds/index.js +1881 -32
- package/dist/worlds/index.js.map +1 -1
- package/dist/worlds/index.mjs +1880 -32
- package/dist/worlds/index.mjs.map +1 -1
- package/package.json +16 -1
- package/runtime/gatewaysdk/environment/_world.py +14 -1
- package/runtime/gatewaysdk/environment/schema/__init__.py +8 -0
- package/runtime/gatewaysdk/environment/schema/__main__.py +154 -19
- package/runtime/gatewaysdk/environment/schema/api.py +294 -40
- package/runtime/gatewaysdk/environment/schema/batch.py +43 -9
- package/runtime/gatewaysdk/environment/schema/compiler.py +89 -11
- package/runtime/gatewaysdk/environment/schema/conform.py +105 -13
- package/runtime/gatewaysdk/environment/schema/connector.py +453 -103
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/api/handlers.py +778 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/connector.toml +671 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/handlers.py +3 -2
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/parity.json +11 -5
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/provenance.json +1635 -100
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/instruction.md +7 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_activities.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_activity_devices.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_applecare_coverages.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_apps.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_audit_events.json +139 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_apps.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_configurations.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_devices.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_packages.json +8 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_user_groups.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_users.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprints.json +39 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_configurations.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_device_assignments.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_mdm_device_details.json +55 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_mdm_devices.json +33 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_mdm_servers.json +56 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_org_devices.json +178 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_organizational_unit_memberships.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_organizational_units.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_packages.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_user_group_memberships.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_user_groups.json +30 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_users.json +115 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scope.toml +49 -22
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/tests/tools.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/world.json +1180 -194
- package/runtime/gatewaysdk/environment/schema/connectors/asana/api/handlers.py +1026 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/connector.toml +511 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/fidelity.json +89 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/handlers.py +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/provenance.json +101 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/account_settings.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/custom_field_settings.json +60 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/custom_fields.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/enum_options.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/notifications.json +103 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/project_favorites.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/project_memberships.json +144 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/projects.json +120 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/recent_projects.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/sections.json +102 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/stories.json +852 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/task_custom_fields.json +508 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/task_followers.json +368 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/task_memberships.json +184 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/tasks.json +1921 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/teams.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/user_task_list_sections.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/user_task_lists.json +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/users.json +60 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/workspace_memberships.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/workspaces.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scope.toml +156 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/tests/routes.json +298 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/tests/tools.json +152 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/ui/static/assets/index-DTTTJ6a4.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/ui/static/assets/index-WS8dLEjv.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/ui/static/index.html +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/world.json +1911 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/api/handlers.py +847 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/connector.toml +457 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/handlers.py +176 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/provenance.json +187 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/instruction.md +39 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/scenario.toml +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_favourites.json +29 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_footer_comments.json +984 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_inline_comments.json +355 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_labels.json +99 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_notifications.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_page_labels.json +209 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_page_versions.json +828 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_pages.json +949 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_recently_viewed_pages.json +59 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_sites.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_spaces.json +128 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_users.json +100 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_watches.json +96 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/tests/routes.json +212 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/tests/tools.json +140 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/tests/writes.json +201 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/assets/index-BWaOVdpn.js +70 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/assets/index-CKyfi3i5.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-01.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-02.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-03.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-04.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-05.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-06.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-DES.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-ENG.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-OPS.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-ORB.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-PN.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/fonts/AtlassianMono-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/fonts/AtlassianSans-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/fonts/AtlassianSansItalic-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/index.html +47 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/world.json +1346 -0
- package/runtime/gatewaysdk/environment/schema/connectors/custom/provenance.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/custom/tests/tools.json +123 -0
- package/runtime/gatewaysdk/environment/schema/connectors/custom/world.json +112 -24
- package/runtime/gatewaysdk/environment/schema/connectors/github/api/handlers.py +2923 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/connector.toml +2091 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/provenance.json +109 -81
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/instruction.md +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_apps.json +49 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_artifacts.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_branches.json +443 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_check_runs.json +220 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_check_suites.json +404 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_code_scanning_alerts.json +126 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_collaborators.json +100 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_commit_comments.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_commit_statuses.json +80 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_commits.json +461 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_dependabot_alerts.json +168 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_deployment_statuses.json +86 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_deployments.json +94 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_environments.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_gist_comments.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_gists.json +118 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_git_refs.json +59 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_installations.json +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issue_comments.json +151 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issue_events.json +606 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issue_types.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issues.json +758 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_labels.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_licenses.json +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_milestones.json +130 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_organization_memberships.json +139 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_organizations.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_pull_requests.json +874 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_release_assets.json +45 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_releases.json +92 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_repositories.json +797 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_repository_invitations.json +184 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_review_comments.json +66 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_reviews.json +138 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_secret_scanning_alerts.json +50 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_stargazers.json +88 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_tags.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_team_memberships.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_team_repositories.json +258 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_teams.json +130 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_users.json +174 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_webhooks.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_workflow_jobs.json +115 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_workflow_runs.json +1021 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_workflows.json +30 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scope.toml +501 -62
- package/runtime/gatewaysdk/environment/schema/connectors/github/tests/tools.json +79 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/vendor-openapi.json +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/world.json +14340 -4447
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/api/handlers.py +1413 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/connector.toml +630 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/handlers.py +136 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/scenario.toml +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/10-gmail_profiles.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/20-gmail_labels.json +205 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/30-gmail_contacts.json +234 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/40-gmail_threads.json +374 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/50-gmail_messages.json +1015 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/60-gmail_message_parts.json +3039 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/70-gmail_attachments.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/80-gmail_drafts.json +39 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/90-gmail_client_settings.json +103 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/world.json +784 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/api/handlers.py +454 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/connector.toml +519 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/provenance.json +229 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/instruction.md +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/scenario.toml +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/10-calendar_calendars.json +75 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/20-calendar_calendar_list_entries.json +115 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/30-calendar_acl_rules.json +124 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/40-calendar_events.json +810 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/50-calendar_settings.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/60-calendar_channels.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/70-calendar_colors.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scope.toml +105 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/tests/tools.json +53 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/vendor-openapi.json +4185 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/world.json +1255 -80
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/api/handlers.py +782 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/connector.toml +373 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/google-docs-types.json +4939 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/handlers.py +197 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/provenance.json +191 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/instruction.md +29 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_comments.json +50 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_documents.json +8096 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_files.json +1187 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_permissions.json +543 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_replies.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_revisions.json +643 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_users.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scope.toml +148 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/tests/api.json +319 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/tests/tools.json +262 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/assets/index-BH9fmZSS.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/assets/index-CU4Fk9dX.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/README.md +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/google-sans-variable.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/roboto-italic-variable-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/roboto-variable-latin-ext.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/roboto-variable-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/icons/material_common_sprite1038_gm3_grey_medium.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/index.html +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/world.json +4489 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/api/handlers.py +466 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/connector.toml +626 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/handlers.py +42 -5
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/provenance.json +342 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/instruction.md +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_access_proposals.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_approvals.json +145 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_apps.json +81 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_comments.json +70 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_drives.json +71 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_files.json +700 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_labels.json +75 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_permissions.json +93 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_replies.json +66 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_revisions.json +82 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scope.toml +126 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/tests/tools.json +101 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/vendor-openapi.json +6193 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/world.json +1972 -108
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/api/handlers.py +1645 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/connector.toml +414 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/handlers.py +200 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_cells.json +10252 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_charts.json +103 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_conditional_formats.json +138 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_dimensions.json +256 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_named_ranges.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_permissions.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_sheets.json +95 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_spreadsheets.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_view_states.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/tests/page.json +311 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/tests/vendor.json +843 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/assets/index-CUpfKgm_.js +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/assets/index-D3VhwBIC.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSans-400.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSans-500.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSans-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSansText-400.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSansText-500.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSansText-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/Roboto-400.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/Roboto-500.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/Roboto-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/index.html +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/world.json +4029 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/api/handlers.py +800 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/connector.toml +776 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/handlers.py +226 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/instruction.md +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_accounts.json +17 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_associations.json +1478 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_calls.json +147 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_companies.json +144 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_contacts.json +284 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_deals.json +204 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_emails.json +160 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_meetings.json +147 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_nav_items.json +204 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_notes.json +160 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_notifications.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_object_views.json +334 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_owners.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_pipeline_stages.json +109 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_pipelines.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_properties.json +1220 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_tasks.json +394 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_tickets.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/assets/index-hdb5vB78.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/assets/index-xhg5ASqE.js +68 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-300.ttf +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-400.ttf +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-500.ttf +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-600.ttf +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-700.ttf +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/add.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/avatar.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/bell.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/breeze.svg +4 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/call.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/chevron-up.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/companies.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/contact.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/contacts.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/date.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/deals.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/duplicate.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/export.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/external-link.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/filter-lines.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/frame-expand.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/funnel.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/help.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/hierarchy.svg +4 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/home.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/hubspot-logo.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/info.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/kanban.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/marketing-email.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/marketplace.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/meetings.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/more.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/pencil.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/pin.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/prospecting.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/refresh.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/search.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/settings.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/sidebar-collapse.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/sort.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/table.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/tasks.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/thumbs-down.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/thumbs-up.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/undo.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/upgrade-arrow.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/vertical-dots.svg +5 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/workflows.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/index.html +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/world.json +1347 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/api/handlers.py +987 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/connector.toml +3057 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/provenance.json +9443 -129
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/scenario.toml +4 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_account_groups.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_accounts.json +58 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_computer_searches.json +139 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_mobile_device_searches.json +61 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_user_content_searches.json +61 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_user_searches.json +124 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_api_integrations.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_api_roles.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_app_request_form_input_fields.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_buildings.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_byo_profiles.json +46 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_categories.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_classes.json +217 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_cloud_idps.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_group_members.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_groups.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_invitations.json +82 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_prestages.json +274 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computers.json +1537 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_configuration_profiles.json +649 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_departments.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_device_enrollment_devices.json +70 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_device_enrollments.json +46 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_directory_bindings.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_disk_encryption_configurations.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_distribution_points.json +91 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_dock_items.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ebooks.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_enrollment_customizations.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_extension_attributes.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ibeacons.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_inventory_preload_records.json +100 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ios_branding_configurations.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ldap_servers.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_licensed_software_records.json +244 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mac_applications.json +610 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_macos_branding_configurations.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_managed_software_update_plans.json +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mdm_commands.json +58 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_applications.json +700 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_configuration_profiles.json +652 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_enrollment_profiles.json +160 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_extension_attributes.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_group_members.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_groups.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_prestages.json +280 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_provisioning_profiles.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_devices.json +1558 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_network_segments.json +46 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_packages.json +118 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_patch_software_title_configurations.json +88 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_policies.json +1054 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_printers.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_removable_mac_addresses.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_restricted_software_titles.json +289 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_return_to_service_configurations.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_scripts.json +61 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_sites.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_software_update_servers.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_supervision_identities.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_user_extension_attributes.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_user_groups.json +112 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_users.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_volume_purchasing_locations.json +106 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_volume_purchasing_subscriptions.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_webhooks.json +70 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scope.toml +839 -67
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/tests/tools.json +95 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/vendor-openapi.json +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/world.json +10835 -1494
- package/runtime/gatewaysdk/environment/schema/connectors/jira/api/handlers.py +1056 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/connector.toml +955 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/handlers.py +73 -14
- package/runtime/gatewaysdk/environment/schema/connectors/jira/parity.json +27 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/provenance.json +166 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/instruction.md +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/scenario.toml +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_boards.json +61 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_changelogs.json +136 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_comments.json +205 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_components.json +78 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_fields.json +498 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issue_link_types.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issue_links.json +190 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issue_types.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issues.json +1448 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_priorities.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_project_categories.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_projects.json +111 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_resolutions.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_sprint_issues.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_sprints.json +39 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_status_categories.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_statuses.json +60 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_transitions.json +179 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_users.json +83 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_versions.json +30 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_worklogs.json +96 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scope.toml +255 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/tests/tools.json +151 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/vendor-openapi.json +13562 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/world.json +3381 -183
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/api/handlers.py +406 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/connector.toml +531 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/provenance.json +229 -46
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprint_items.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprint_template_categories.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprint_templates.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprints.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_custom_apps.json +45 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_custom_profiles.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_custom_scripts.json +27 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_activities.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_apps.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_commands.json +41 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_notes.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_parameters.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_tags.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_devices.json +122 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_in_house_apps.json +33 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_library_item_activities.json +33 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_library_item_statuses.json +98 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_library_items.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_self_service_categories.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_tags.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_users.json +61 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scope.toml +118 -39
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/tests/tools.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/vendor-openapi.json +5463 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/world.json +1257 -205
- package/runtime/gatewaysdk/environment/schema/connectors/linear/api/handlers.py +139 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/connector.toml +1574 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/handlers.py +8 -5
- package/runtime/gatewaysdk/environment/schema/connectors/linear/provenance.json +142 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/attachments.json +21 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/comments.json +79 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customer_needs.json +21 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customer_statuses.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customer_tiers.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customers.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/cycles.json +86 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/documents.json +27 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/initiative_projects.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/initiative_updates.json +23 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/initiatives.json +41 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/issue_labels.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/issue_relations.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/issues.json +264 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/labels.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/organizations.json +53 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_labels.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_members.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_milestones.json +30 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_relations.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_statuses.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_updates.json +42 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/projects.json +110 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/reactions.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/roadmap_projects.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/roadmaps.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/team_memberships.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/teams.json +114 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/templates.json +27 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/users.json +106 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/webhooks.json +21 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/workflow_states.json +108 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scope.toml +87 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/tests/tools.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/world.json +5957 -172
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/api/handlers.py +1218 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/connector.toml +1246 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/fidelity.json +49 -19
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/provenance.json +785 -4
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/instruction.md +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_async_operations.json +47 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_hosted_contents.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_members.json +88 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_messages.json +313 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_replies.json +128 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channels.json +319 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_hosted_contents.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_members.json +155 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_messages.json +265 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_views.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chats.json +167 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_incoming_channels.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_pinned_messages.json +9 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_reply_hosted_contents.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_shared_channel_teams.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_tag_members.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_tags.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_team_members.json +117 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_teams.json +193 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scope.md +76 -4
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/teams-types.json +29 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/tests/routes.json +101 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/vendor-openapi.json +11280 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/world.json +74 -6
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/api/handlers.py +571 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/connector.toml +1484 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/parity.json +28 -1
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/provenance.json +215 -49
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/instruction.md +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_accounting_periods.json +107 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_accounts.json +514 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_classifications.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_contacts.json +90 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_credit_memos.json +112 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_currencies.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_customer_payments.json +108 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_customers.json +232 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_departments.json +80 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_employees.json +124 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_invoices.json +229 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_item_fulfillments.json +85 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_items.json +237 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_journal_entries.json +217 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_locations.json +62 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_price_levels.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_purchase_orders.json +152 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_sales_order_lines.json +235 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_sales_orders.json +219 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_subsidiaries.json +85 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_terms.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_vendor_bills.json +170 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_vendors.json +140 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scope.toml +251 -33
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/tests/tools.json +82 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/world.json +31065 -8232
- package/runtime/gatewaysdk/environment/schema/connectors/notion/api/handlers.py +1330 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/connector.toml +386 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/handlers.py +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/blocks.json +4197 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/calendar_events.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/collection_views.json +175 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/comments.json +109 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/databases.json +417 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/favorites.json +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/notifications.json +49 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/pages.json +3758 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/spaces.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/teamspaces.json +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/users.json +92 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/tests/01-reads.json +165 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/assets/index-DQ36W7RG.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/assets/index-DythuuUy.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000002.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000003.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000004.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000005.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000006.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000007.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000008.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/covers/dusk-harbor.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/covers/ember-coast.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/covers/green-ridge.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f30a.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f331.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f373.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3a7.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3a8.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3ac.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3af.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3c4.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3d6.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3e0.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f44b.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4a1.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4b0.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4bc.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4c5.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4c8.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4cb.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4ce.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4d1.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4d3.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4d6.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4da.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4dd.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4ec.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4f7.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f527.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f55b.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f5c2.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f5d3.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f680.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f6a2.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9ca.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9e0.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9ea.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9ed.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9f0.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1fab6.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2600.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2693.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2705.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2708.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/270f.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2b50.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/favicon.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/fonts/SourceSerif4-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/index.html +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/content-blocks.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/databases.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/sharing.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/style-content.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/photos/home-icon.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/photos/viewer.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/photos/workspace.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/world.json +2796 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_admin_role_assignments.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_app_assignments.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_app_group_assignments.json +59 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_applications.json +265 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_console_dashboards.json +91 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_device_users.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_devices.json +89 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_group_memberships.json +156 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_groups.json +100 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_orgs.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_policies.json +84 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_system_log_events.json +9656 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_users.json +744 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/api/handlers.py +624 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/connector.toml +381 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/handlers.py +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/provenance.json +408 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/instruction.md +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_attachments.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_calendars.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_contacts.json +326 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_events.json +3050 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_mail_folders.json +84 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_mailbox_settings.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_mailboxes.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_messages.json +1400 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_system_senders.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_users.json +256 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/tests/routes.json +333 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/assets/index-DRVA5ahH.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/assets/index-kOnvVBhA.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/FluentSystemIcons-Filled.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/FluentSystemIcons-Regular.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/FluentSystemIcons-Resizable.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/controlIcons.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-bold.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-light.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-regular.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-semibold.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-semilight.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/bookings.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/calendar.svg +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/copilot.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/excel.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/mail.svg +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/my-day.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/newsletters.svg +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/no-mail-selected-dark.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/no-mail-selected.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/onedrive.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/onenote.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/org-explorer.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/outlook.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/people.svg +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/powerpoint.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/ribbon-layout.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/sharepoint.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/teams-chat.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/teams.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/to-do.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/viva.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/word.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/index.html +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/world.json +686 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/api/handlers.py +447 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/connector.toml +3478 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/handlers.py +695 -616
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/provenance.json +4254 -111
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/instruction.md +8 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_contact_relations.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_contact_roles.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_partners.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_team_members.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_accounts.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_assets.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_attachments.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_business_hours.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_campaign_member_statuses.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_campaign_members.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_campaigns.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_comments.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_histories.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_milestones.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_statuses.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_team_members.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_team_roles.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_cases.json +42 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_collaboration_group_members.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_collaboration_groups.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contact_point_addresses.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contact_point_emails.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contact_point_phones.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contacts.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_document_links.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_documents.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_folders.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_notes.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_versions.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_workspaces.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contract_contact_roles.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contract_line_items.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contracts.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_dashboards.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_documents.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_email_message_relations.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_email_messages.json +21 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_email_templates.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_entitlements.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_events.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_feed_comments.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_feed_items.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_fiscal_year_settings.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_folders.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_group_members.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_groups.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_holidays.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_individuals.json +21 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_lead_statuses.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_leads.json +45 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_list_views.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_login_histories.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_milestone_types.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_notes.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_object_territory_associations.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunities.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_competitors.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_contact_roles.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_field_histories.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_histories.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_line_items.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_partners.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_stages.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_team_members.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_order_items.json +33 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_orders.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_organizations.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_partners.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_periods.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_permission_set_assignments.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_permission_sets.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_pricebook_entries.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_pricebooks.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_products.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_profiles.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_queue_sobjects.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_quote_line_items.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_quotes.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_record_actions.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_record_types.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_reports.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_service_contracts.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_sla_processes.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_solutions.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_task_priorities.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_task_relations.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_task_statuses.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_tasks.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_territories.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_territory_models.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_territory_types.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_topic_assignments.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_topics.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_user_roles.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_user_territory_associations.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_users.json +57 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_web_links.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_work_order_line_items.json +42 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_work_orders.json +46 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scope.toml +624 -104
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/tests/tools.json +69 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/world.json +19222 -2654
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/api/handlers.py +630 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/connector.toml +266 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/handlers.py +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/provenance.json +245 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/instruction.md +15 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/scenario.toml +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/10-snow_users.json +268 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/11-snow_user_groups.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/20-snow_configuration_items.json +684 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/30-snow_catalog_categories.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/31-snow_catalog_items.json +334 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/40-snow_incidents.json +3086 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/41-snow_incident_tasks.json +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/42-snow_task_slas.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/43-snow_problems.json +148 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/44-snow_change_requests.json +364 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/45-snow_knowledge_articles.json +214 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/46-snow_journal_entries.json +1612 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/60-snow_ui_current_users.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/61-snow_ui_navigation_applications.json +187 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/62-snow_ui_home_widgets.json +91 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/63-snow_ui_notifications.json +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/64-snow_ui_employee_center_pages.json +74 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/65-snow_ui_list_layouts.json +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/66-snow_ui_search_facets.json +29 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/67-snow_ui_activity_entries.json +1076 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/68-snow_ui_instances.json +9 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scope.toml +166 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/tests/routes.json +272 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/assets/index-5QHcQLCI.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/assets/index-BzeVnzFt.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/cabin-400-700-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/cabin-400-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-0-lato-v17-latin-ext_latin-100.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-1-lato-v17-latin-ext_latin-100.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-10-lato-v17-latin-ext_latin-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-11-lato-v17-latin-ext_latin-italic.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-12-lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-13-lato-v17-latin-ext_latin-700.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-14-lato-v17-latin-ext_latin-700italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-15-lato-v17-latin-ext_latin-700italic.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-16-source-sans-pro-v11-latin-300.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-17-source-sans-pro-v11-latin-300.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-18-source-sans-pro-v11-latin-regular.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-19-source-sans-pro-v11-latin-regular.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-2-lato-v17-latin-ext_latin-100italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-20-source-sans-pro-v11-latin-600.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-21-source-sans-pro-v11-latin-600.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-22-source-sans-pro-v11-latin-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-23-source-sans-pro-v11-latin-700.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-3-lato-v17-latin-ext_latin-100italic.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-4-lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-5-lato-v17-latin-ext_latin-300.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-6-lato-v17-latin-ext_latin-300italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-7-lato-v17-latin-ext_latin-300italic.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-8-lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-9-lato-v17-latin-ext_latin-regular.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/index.json +122 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-300.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-600-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-600.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-bold-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-bold.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-normal-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-normal.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/appsee-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/arrow-up-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/available.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/bell-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/caret-down-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/check-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/chevron-right-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circle-close-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circle-info-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circle-question-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circleinfooutline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/ellipsis-v-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/eye-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-bell-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-caret-down-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-check-square.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-chevron-right.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-clock-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-comment-chat.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-external-link.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-facebook.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-heart-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-heart-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-home-fill-teal.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-home-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-linkedin.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-list-alt-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-pencil-square.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-question-circle-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-times.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-twitter.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/filter-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/gear-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/globe-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/home-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon-2.svg +17 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon-3.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon-4.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon.svg +45 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/keyboard-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/link-icon-associated-to-view-all-adoption-blueprints.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/link-icon-associated-to-view-all-applications.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/list-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/loading-2.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/loading.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/magnifying-glass-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/ongoing-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/open-link-right-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/open-link-right-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/pencil-page-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/plus-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/serverbox-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/servicenow-wordmark.svg +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/signal-live-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/square-arrow-left-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/star-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/sync-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/task-slas-related-list.svg +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/thumbtack-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/trending-downward.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/trending-neutral.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/unpinned-all-menu.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/unpinned-favorites-menu.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/unpinned-history-menu.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/user-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/adoption-blueprints.svg +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/avatar-admin.jpg +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/now-assist-admin.svg +17 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/quick-link-desk.jpg +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/quick-link-password.jpg +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/quick-link-status.jpg +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-accessories.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-computers.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-developer.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-email.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-phone.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-software-catalog.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-software.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-technology.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/index.html +36 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/world.json +2004 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/MODEL.md +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/api/handlers.py +1880 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/capabilities.json +19 -2
- package/runtime/gatewaysdk/environment/schema/connectors/slack/connector.toml +892 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/provenance.json +65 -10
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/scenario.toml +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_apps.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_bookmarks.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_bots.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_channels.json +206 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_conversation_states.json +50 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_emojis.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_ephemeral_message_files.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_ephemeral_message_threads.json +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_ephemeral_messages.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_channel_observations.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_reaction_summaries.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_reaction_users.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_shares.json +29 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_user_states.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_files.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_memberships.json +79 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_message_files.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_message_threads.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_message_user_states.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_messages.json +127 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_pins.json +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_presence.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_reaction_summaries.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_reaction_users.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_scheduled_message_threads.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_scheduled_messages.json +15 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_unavailable_message_files.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_user_profile_fields.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_usergroup_channels.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_usergroup_memberships.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_usergroups.json +33 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_users.json +228 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_view_state_entries.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_views.json +53 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_workspaces.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scope.toml +6 -2
- package/runtime/gatewaysdk/environment/schema/connectors/slack/tests/api.json +177 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/tests/test_threads.py +49 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/tests/tools.json +92 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/assets/index-BSqGskph.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/assets/index-CKQh1igo.js +81 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/README.md +15 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-black.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-bold.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic-black.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic-bold.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic-light.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-light.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-regular.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/slack-icons-v2.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/index.html +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/vendor-openapi.json +12515 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/world.json +396 -8
- package/runtime/gatewaysdk/environment/schema/connectors/workday/api/handlers.py +175 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/connector.toml +610 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/parity.json +39 -6
- package/runtime/gatewaysdk/environment/schema/connectors/workday/provenance.json +253 -25
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/instruction.md +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_compensations.json +219 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_job_profiles.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_locations.json +142 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_organizations.json +124 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_positions.json +280 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_absence_leaves.json +66 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_business_title_changes.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_check_in_topics.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_check_ins.json +46 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_countries.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_currencies.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_job_change_reasons.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_job_families.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_job_profiles.json +202 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_jobs.json +120 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_organization_types.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_organizations.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_persons.json +100 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_scorecard_results.json +57 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_scorecards.json +68 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_supervisory_organizations.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_time_off_details.json +112 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_time_off_entries.json +91 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_worker_history_events.json +58 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_workers.json +90 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_time_off_requests.json +181 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_workers.json +492 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scope.toml +178 -14
- package/runtime/gatewaysdk/environment/schema/connectors/workday/tests/tools.json +81 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/vendor-openapi.json +10646 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/world.json +3787 -407
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/api/handlers.py +1183 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/connector.toml +645 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/handlers.py +377 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/instruction.md +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/scenario.toml +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_brands.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_group_memberships.json +49 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_groups.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_macros.json +154 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_organizations.json +65 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_ticket_audits.json +3328 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_ticket_comments.json +2642 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_tickets.json +1439 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_users.json +624 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_views.json +510 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_workspace_tabs.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/ui/static/assets/index-JWq7XNO5.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/ui/static/assets/index-bn8ezNTi.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/ui/static/index.html +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/world.json +1707 -0
- package/runtime/gatewaysdk/environment/schema/data.py +424 -36
- package/runtime/gatewaysdk/environment/schema/dependencies.py +245 -0
- package/runtime/gatewaysdk/environment/schema/extract.py +6 -6
- package/runtime/gatewaysdk/environment/schema/host.py +234 -79
- package/runtime/gatewaysdk/environment/schema/host_surfaces.py +62 -17
- package/runtime/gatewaysdk/environment/schema/ingest.py +528 -0
- package/runtime/gatewaysdk/environment/schema/local.py +622 -0
- package/runtime/gatewaysdk/environment/schema/mapping.py +956 -0
- package/runtime/gatewaysdk/environment/schema/platform.py +708 -205
- package/runtime/gatewaysdk/environment/schema/reconcile.py +202 -0
- package/runtime/gatewaysdk/environment/schema/redaction.py +378 -0
- package/runtime/gatewaysdk/environment/schema/scaffold.py +68 -7
- package/runtime/gatewaysdk/environment/schema/skill.py +1 -0
- package/runtime/gatewaysdk/environment/schema/skills/benchmarks-getting-started/SKILL.md +394 -0
- package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/CONNECTORS.md +64 -31
- package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +86 -36
- package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/ROWS.md +20 -0
- package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +178 -11
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +184 -74
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +49 -0
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/ui-map.md +18 -0
- package/runtime/gatewaysdk/environment/schema/store.py +103 -3
- package/runtime/gatewaysdk/environment/schema/tasks.py +8 -3
- package/runtime/gatewaysdk/environment/schema/tools_world.py +429 -58
- package/runtime/gatewaysdk/environment/schema/transform.py +200 -0
- package/runtime/gatewaysdk/environment/schema/transforms.py +103 -0
- package/runtime/gatewaysdk/environment/schema/ui.py +455 -0
- package/runtime/gatewaysdk/environment/schema/ui_static/app.js +581 -0
- package/runtime/gatewaysdk/environment/schema/ui_static/index.html +72 -0
- package/runtime/gatewaysdk/environment/schema/validation.py +63 -15
- package/runtime/gatewaysdk/environment/schema/world_tests.py +245 -51
- package/skills/benchmarks-getting-started/SKILL.md +394 -0
- package/skills/connector-schema-authoring/CONNECTORS.md +64 -31
- package/skills/connector-schema-authoring/SKILL.md +86 -36
- package/skills/connector-schema-authoring/connector-worlds.md +355 -0
- package/skills/connector-schema-authoring/world-schema.md +620 -0
- package/skills/world-data-ingestion/ROWS.md +20 -0
- package/skills/world-data-ingestion/SKILL.md +178 -11
- package/skills/worlds-getting-started/SKILL.md +184 -74
- package/skills/worlds-getting-started/references/cli-mcp-map.md +49 -0
- package/skills/worlds-getting-started/references/ui-map.md +18 -0
|
@@ -0,0 +1,1880 @@
|
|
|
1
|
+
"""Slack Web API routes served from the slack schema world.
|
|
2
|
+
|
|
3
|
+
Every route answers Slack's envelope: ``{"ok": true, ...}`` on success and
|
|
4
|
+
``{"ok": false, "error": "<slack_error>"}`` with HTTP 200 on a method-level error,
|
|
5
|
+
which is how Slack answers (its HTTP status is 200 for ``channel_not_found`` and
|
|
6
|
+
the like; only transport failures carry other statuses). Rows are rendered from
|
|
7
|
+
the normalized entities: thread identity from ``slack_message_threads``,
|
|
8
|
+
reactions from ``slack_reaction_summaries`` + ``slack_reaction_users``, file
|
|
9
|
+
attachments from ``slack_message_files``, custom profile fields from
|
|
10
|
+
``slack_user_profile_fields``, user group members from
|
|
11
|
+
``slack_usergroup_memberships``. World-internal columns (``workspace_id``,
|
|
12
|
+
``channel_id`` on message-scoped rows) never leave the store.
|
|
13
|
+
|
|
14
|
+
A Slack token names its workspace and who holds it; this world reads both from
|
|
15
|
+
its rows. Routes take the workspace from ``team_id`` / ``team`` when sent, else
|
|
16
|
+
the first ``slack_workspaces`` row. Who the token is comes from the workspace's
|
|
17
|
+
first ``slack_apps`` row, the way Slack mints tokens at install: an app that
|
|
18
|
+
asked for ``user_scopes`` acts as its ``installer_user_id`` (a user token, what
|
|
19
|
+
a client page holds), any other as the workspace's first ``slack_bots`` row (a
|
|
20
|
+
bot token). Every write records what changed with ``ctx.emit`` in Slack's event
|
|
21
|
+
shape, and ``/events`` renders that log for a page that polls.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
|
|
26
|
+
import hashlib
|
|
27
|
+
import json
|
|
28
|
+
import re
|
|
29
|
+
import struct
|
|
30
|
+
import uuid
|
|
31
|
+
import zlib
|
|
32
|
+
from fractions import Fraction
|
|
33
|
+
from typing import Any
|
|
34
|
+
|
|
35
|
+
INTERNAL = ("workspace_id", "channel_id")
|
|
36
|
+
MESSAGE_TS_FIELDS = ("reply_count", "reply_users_count", "reply_users", "latest_reply")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class SlackError(Exception):
|
|
40
|
+
"""A Slack method-level error name (``channel_not_found``)."""
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _error(error: str) -> tuple[int, dict]:
|
|
44
|
+
return 200, {"ok": False, "error": error}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _ok(**body: Any) -> dict:
|
|
48
|
+
return {"ok": True, **body}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def route(fn):
|
|
52
|
+
"""A handler's contract: raise ``SlackError`` for a vendor error, return the body."""
|
|
53
|
+
|
|
54
|
+
def invoke(ctx, args, query, body):
|
|
55
|
+
params = _params(query, body)
|
|
56
|
+
try:
|
|
57
|
+
return fn(ctx, params)
|
|
58
|
+
except SlackError as error:
|
|
59
|
+
return _error(str(error))
|
|
60
|
+
|
|
61
|
+
invoke.__name__ = fn.__name__
|
|
62
|
+
return invoke
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _params(query: dict[str, str], body: Any) -> dict[str, Any]:
|
|
66
|
+
"""Slack reads arguments from the query string or the request body alike."""
|
|
67
|
+
params: dict[str, Any] = dict(query)
|
|
68
|
+
if isinstance(body, dict):
|
|
69
|
+
params.update(body)
|
|
70
|
+
return params
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _flag(params: dict, name: str, default: bool = False) -> bool:
|
|
74
|
+
value = params.get(name, default)
|
|
75
|
+
if isinstance(value, bool):
|
|
76
|
+
return value
|
|
77
|
+
return str(value).lower() in ("1", "true", "yes")
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _int(params: dict, name: str, default: int) -> int:
|
|
81
|
+
value = params.get(name)
|
|
82
|
+
if value is None or value == "":
|
|
83
|
+
return default
|
|
84
|
+
try:
|
|
85
|
+
return int(value)
|
|
86
|
+
except (TypeError, ValueError):
|
|
87
|
+
raise SlackError("invalid_arguments") from None
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _list(params: dict, name: str) -> list[str]:
|
|
91
|
+
value = params.get(name)
|
|
92
|
+
if value is None or value == "":
|
|
93
|
+
return []
|
|
94
|
+
if isinstance(value, list):
|
|
95
|
+
return [str(v) for v in value]
|
|
96
|
+
return [part.strip() for part in str(value).split(",") if part.strip()]
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _json_arg(params: dict, name: str) -> Any:
|
|
100
|
+
"""``blocks`` / ``attachments`` arrive as JSON text on a form post, as JSON in a JSON body."""
|
|
101
|
+
value = params.get(name)
|
|
102
|
+
if isinstance(value, str) and value:
|
|
103
|
+
try:
|
|
104
|
+
return json.loads(value)
|
|
105
|
+
except json.JSONDecodeError:
|
|
106
|
+
raise SlackError("invalid_blocks_format" if name == "blocks" else "invalid_attachments") from None
|
|
107
|
+
return value
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def _required(params: dict, *names: str) -> None:
|
|
111
|
+
for name in names:
|
|
112
|
+
if params.get(name) in (None, ""):
|
|
113
|
+
raise SlackError("invalid_arguments")
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def _public(row: dict, *extra: str) -> dict:
|
|
117
|
+
return {k: v for k, v in row.items() if k not in INTERNAL and k not in extra}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def _ts_number(ts: Any, error: str) -> Fraction:
|
|
121
|
+
try:
|
|
122
|
+
if not isinstance(ts, str) or not ts:
|
|
123
|
+
raise ValueError
|
|
124
|
+
return Fraction(ts)
|
|
125
|
+
except (ValueError, ZeroDivisionError):
|
|
126
|
+
raise SlackError(error) from None
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def _ts_key(row: dict, field: str = "ts") -> Fraction:
|
|
130
|
+
return Fraction(row[field])
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def _slack_id(prefix: str) -> str:
|
|
134
|
+
return prefix + uuid.uuid4().hex[:10].upper()
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# ---------------------------------------------------------------- workspace scope
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _workspace(ctx, params: dict) -> str:
|
|
141
|
+
wanted = params.get("team_id") or params.get("team")
|
|
142
|
+
workspaces = ctx.rows("slack_workspaces")
|
|
143
|
+
if wanted:
|
|
144
|
+
if not any(row["id"] == wanted for row in workspaces):
|
|
145
|
+
raise SlackError("team_not_found")
|
|
146
|
+
return wanted
|
|
147
|
+
if not workspaces:
|
|
148
|
+
raise SlackError("team_not_found")
|
|
149
|
+
return workspaces[0]["id"]
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def _scoped(ctx, entity: str, workspace: str, **where: Any) -> list[dict]:
|
|
153
|
+
return [
|
|
154
|
+
row
|
|
155
|
+
for row in ctx.rows(entity)
|
|
156
|
+
if row.get("workspace_id") == workspace and all(row.get(k) == v for k, v in where.items())
|
|
157
|
+
]
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def _channel(ctx, workspace: str, channel: Any, *, write: bool = False) -> dict:
|
|
161
|
+
if not channel:
|
|
162
|
+
raise SlackError("channel_not_found")
|
|
163
|
+
row = ctx.get("slack_channels", {"workspace_id": workspace, "id": channel})
|
|
164
|
+
if row is None:
|
|
165
|
+
raise SlackError("channel_not_found")
|
|
166
|
+
if write and row.get("is_archived"):
|
|
167
|
+
raise SlackError("is_archived")
|
|
168
|
+
if write and row.get("is_frozen"):
|
|
169
|
+
raise SlackError("restricted_action")
|
|
170
|
+
return row
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def _user(ctx, workspace: str, user: Any) -> dict:
|
|
174
|
+
if not user:
|
|
175
|
+
raise SlackError("user_not_found")
|
|
176
|
+
row = ctx.get("slack_users", {"workspace_id": workspace, "id": user})
|
|
177
|
+
if row is None:
|
|
178
|
+
raise SlackError("user_not_found")
|
|
179
|
+
return row
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def _message(ctx, workspace: str, channel: str, ts: Any, error: str = "message_not_found") -> dict:
|
|
183
|
+
_ts_number(ts, "invalid_timestamp" if error == "message_not_found" else "bad_timestamp")
|
|
184
|
+
row = ctx.get("slack_messages", {"workspace_id": workspace, "channel_id": channel, "ts": ts})
|
|
185
|
+
if row is None:
|
|
186
|
+
raise SlackError(error)
|
|
187
|
+
return row
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _file(ctx, workspace: str, file: Any) -> dict:
|
|
191
|
+
if not file:
|
|
192
|
+
raise SlackError("file_not_found")
|
|
193
|
+
row = ctx.get("slack_files", {"workspace_id": workspace, "id": file})
|
|
194
|
+
if row is None or row.get("is_deleted"):
|
|
195
|
+
raise SlackError("file_not_found")
|
|
196
|
+
return row
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def _usergroup(ctx, workspace: str, usergroup: Any) -> dict:
|
|
200
|
+
if not usergroup:
|
|
201
|
+
raise SlackError("subteam_not_found")
|
|
202
|
+
row = ctx.get("slack_usergroups", {"workspace_id": workspace, "id": usergroup})
|
|
203
|
+
if row is None:
|
|
204
|
+
raise SlackError("subteam_not_found")
|
|
205
|
+
return row
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def _writer(ctx, workspace: str) -> dict:
|
|
209
|
+
"""Who the token is: ``{"user"}`` for a user token, ``{"bot_id", "user"}`` for a
|
|
210
|
+
bot's. Slack mints a user token for the installer of an app that asked for user
|
|
211
|
+
scopes and a bot token for one that asked for bot scopes; the workspace's first
|
|
212
|
+
``slack_apps`` row decides which this world answers as, and its first
|
|
213
|
+
``slack_bots`` row is the bot."""
|
|
214
|
+
apps = _scoped(ctx, "slack_apps", workspace)
|
|
215
|
+
if apps and apps[0].get("user_scopes") and apps[0].get("installer_user_id"):
|
|
216
|
+
return {"user": apps[0]["installer_user_id"]}
|
|
217
|
+
bots = _scoped(ctx, "slack_bots", workspace)
|
|
218
|
+
if not bots:
|
|
219
|
+
return {}
|
|
220
|
+
bot = bots[0]
|
|
221
|
+
identity = {"bot_id": bot["id"]}
|
|
222
|
+
if bot.get("user_id"):
|
|
223
|
+
identity["user"] = bot["user_id"]
|
|
224
|
+
return identity
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def _emit(ctx, event: str, **fields: Any) -> None:
|
|
228
|
+
"""Record what a write changed, in the Events API shape for ``event``, for the
|
|
229
|
+
``/events`` route a page polls. A ``message`` event carries the message's own
|
|
230
|
+
fields, ``type`` included, beside ``channel`` and ``channel_type``."""
|
|
231
|
+
ctx.emit({"type": event, "event_ts": f"{ctx.clock():.6f}", **fields})
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def _writer_user(ctx, workspace: str) -> str:
|
|
235
|
+
user = _writer(ctx, workspace).get("user")
|
|
236
|
+
if not user:
|
|
237
|
+
raise SlackError("not_authed")
|
|
238
|
+
return user
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def _next_ts(ctx, workspace: str) -> str:
|
|
242
|
+
"""A logical clock: one second past the newest message, never wall time."""
|
|
243
|
+
latest = max((int(_ts_key(row)) for row in _scoped(ctx, "slack_messages", workspace)), default=1700000000)
|
|
244
|
+
return f"{latest + 1}.000001"
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def _now_seconds(ctx) -> int:
|
|
248
|
+
return int(ctx.clock())
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
# ---------------------------------------------------------------- rendering
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def _paged(ctx, rows: list[dict], key: str, params: dict, **extra: Any) -> dict:
|
|
255
|
+
"""Slack's cursor page: ``{ok, <key>: [...], response_metadata: {next_cursor}}``."""
|
|
256
|
+
page = ctx.envelope(rows, {k: str(v) for k, v in params.items()}, envelope=key)
|
|
257
|
+
cursor = page.pop("next_cursor", "")
|
|
258
|
+
return _ok(**page, response_metadata={"next_cursor": cursor or ""}, **extra)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
def _classic_page(rows: list[dict], params: dict) -> tuple[list[dict], dict]:
|
|
262
|
+
"""``count``/``page`` paging with an ``objs_paging`` block (files.list, reactions.list)."""
|
|
263
|
+
count = max(1, _int(params, "count", 100))
|
|
264
|
+
page = max(1, _int(params, "page", 1))
|
|
265
|
+
pages = max(1, -(-len(rows) // count))
|
|
266
|
+
start = (page - 1) * count
|
|
267
|
+
return rows[start : start + count], {"count": count, "total": len(rows), "page": page, "pages": pages}
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
VIEWER_STATE_KEYS = ("workspace_id", "channel_id", "user_id", "counterpart_user_id")
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def _render_channel(ctx, row: dict) -> dict:
|
|
274
|
+
"""The channel as conversations.* answer it to the token's holder: the row, the
|
|
275
|
+
viewer's fields Slack adds (``is_member``, ``last_read``, ``unread_count``,
|
|
276
|
+
``is_starred``, ``is_muted``, ``is_open`` from ``slack_conversation_states``),
|
|
277
|
+
``num_members``, and the other party of an IM as ``user``."""
|
|
278
|
+
channel = _public(row)
|
|
279
|
+
workspace = row["workspace_id"]
|
|
280
|
+
members = [m["user_id"] for m in _scoped(ctx, "slack_memberships", workspace, channel_id=row["id"])]
|
|
281
|
+
me = _writer(ctx, workspace).get("user")
|
|
282
|
+
if me:
|
|
283
|
+
key = {"workspace_id": workspace, "channel_id": row["id"], "user_id": me}
|
|
284
|
+
state = ctx.get("slack_conversation_states", key)
|
|
285
|
+
if state is not None:
|
|
286
|
+
channel.update({k: v for k, v in state.items() if k not in VIEWER_STATE_KEYS})
|
|
287
|
+
if members:
|
|
288
|
+
channel["num_members"] = len(members)
|
|
289
|
+
channel["is_member"] = me in members
|
|
290
|
+
if row.get("is_im"):
|
|
291
|
+
others = [user for user in members if user != me]
|
|
292
|
+
if others or members:
|
|
293
|
+
channel["user"] = (others or members)[-1]
|
|
294
|
+
return channel
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
def _render_user(ctx, row: dict) -> dict:
|
|
298
|
+
user = _public(row)
|
|
299
|
+
profile = user.get("profile")
|
|
300
|
+
if isinstance(profile, dict):
|
|
301
|
+
profile = dict(profile)
|
|
302
|
+
marker = profile.pop("fields_state", None)
|
|
303
|
+
fields = _scoped(ctx, "slack_user_profile_fields", row["workspace_id"], user_id=row["id"])
|
|
304
|
+
if marker is None and not fields:
|
|
305
|
+
profile["fields"] = None
|
|
306
|
+
else:
|
|
307
|
+
profile["fields"] = {
|
|
308
|
+
f["field_id"]: {k: v for k, v in f.items() if k not in ("workspace_id", "user_id", "field_id")}
|
|
309
|
+
for f in fields
|
|
310
|
+
}
|
|
311
|
+
user["profile"] = profile
|
|
312
|
+
return user
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
def _reactions(ctx, workspace: str, summaries: list[dict], users_entity: str, **scope: Any) -> list[dict]:
|
|
316
|
+
return [
|
|
317
|
+
{
|
|
318
|
+
"name": summary["name"],
|
|
319
|
+
"count": summary["count"],
|
|
320
|
+
"users": [u["user_id"] for u in _scoped(ctx, users_entity, workspace, name=summary["name"], **scope)],
|
|
321
|
+
}
|
|
322
|
+
for summary in summaries
|
|
323
|
+
]
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
def _render_message(ctx, row: dict) -> dict:
|
|
327
|
+
workspace, channel, ts = row["workspace_id"], row["channel_id"], row["ts"]
|
|
328
|
+
message = _public(row)
|
|
329
|
+
parent = ctx.get("slack_message_threads", {"workspace_id": workspace, "channel_id": channel, "reply_ts": ts})
|
|
330
|
+
if parent is not None:
|
|
331
|
+
message["thread_ts"] = parent["parent_ts"]
|
|
332
|
+
elif _scoped(ctx, "slack_message_threads", workspace, channel_id=channel, parent_ts=ts):
|
|
333
|
+
message["thread_ts"] = ts
|
|
334
|
+
summaries = _scoped(ctx, "slack_reaction_summaries", workspace, channel_id=channel, message_ts=ts)
|
|
335
|
+
if summaries:
|
|
336
|
+
message["reactions"] = _reactions(
|
|
337
|
+
ctx, workspace, summaries, "slack_reaction_users", channel_id=channel, message_ts=ts
|
|
338
|
+
)
|
|
339
|
+
files = []
|
|
340
|
+
for link in _scoped(ctx, "slack_message_files", workspace, channel_id=channel, message_ts=ts):
|
|
341
|
+
file = ctx.get("slack_files", {"workspace_id": workspace, "id": link["file_id"]})
|
|
342
|
+
if file is not None:
|
|
343
|
+
files.append((link.get("position", 0), _public(file)))
|
|
344
|
+
for link in _scoped(ctx, "slack_unavailable_message_files", workspace, channel_id=channel, message_ts=ts):
|
|
345
|
+
files.append((link.get("position", 0), {"id": link["file_id"], **link["reference"]}))
|
|
346
|
+
if files:
|
|
347
|
+
message["files"] = [value for _, value in sorted(files, key=lambda pair: (pair[0], pair[1]["id"]))]
|
|
348
|
+
if ctx.get("slack_pins", {"workspace_id": workspace, "channel_id": channel, "message_ts": ts}) is not None:
|
|
349
|
+
message["pinned_to"] = [channel]
|
|
350
|
+
return message
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
def _render_file(ctx, row: dict) -> dict:
|
|
354
|
+
workspace, file_id = row["workspace_id"], row["id"]
|
|
355
|
+
file = _public(row)
|
|
356
|
+
for kind in ("channels", "groups", "ims"):
|
|
357
|
+
file[kind] = [
|
|
358
|
+
o["channel_id"]
|
|
359
|
+
for o in _scoped(ctx, "slack_file_channel_observations", workspace, file_id=file_id, kind=kind)
|
|
360
|
+
]
|
|
361
|
+
shares: dict[str, dict[str, list]] = {}
|
|
362
|
+
for share in _scoped(ctx, "slack_file_shares", workspace, file_id=file_id):
|
|
363
|
+
detail = {
|
|
364
|
+
k: v
|
|
365
|
+
for k, v in share.items()
|
|
366
|
+
if k not in ("workspace_id", "channel_id", "file_id", "visibility", "message_ts")
|
|
367
|
+
}
|
|
368
|
+
shares.setdefault(share["visibility"], {}).setdefault(share["channel_id"], []).append(
|
|
369
|
+
{"ts": share["message_ts"], **detail}
|
|
370
|
+
)
|
|
371
|
+
if shares:
|
|
372
|
+
file["shares"] = shares
|
|
373
|
+
summaries = _scoped(ctx, "slack_file_reaction_summaries", workspace, file_id=file_id)
|
|
374
|
+
if summaries:
|
|
375
|
+
file["reactions"] = _reactions(ctx, workspace, summaries, "slack_file_reaction_users", file_id=file_id)
|
|
376
|
+
return file
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
def _render_usergroup(ctx, row: dict, *, include_users: bool = False) -> dict:
|
|
380
|
+
usergroup = _public(row, "users_state")
|
|
381
|
+
if include_users:
|
|
382
|
+
usergroup["users"] = _usergroup_users(ctx, row)
|
|
383
|
+
return usergroup
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
def _usergroup_users(ctx, row: dict) -> list[str]:
|
|
387
|
+
members = _scoped(ctx, "slack_usergroup_memberships", row["workspace_id"], usergroup_id=row["id"])
|
|
388
|
+
return sorted(m["user_id"] for m in members)
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
def _render_bookmark(row: dict) -> dict:
|
|
392
|
+
bookmark = _public(row)
|
|
393
|
+
bookmark["channel_id"] = row["channel_id"]
|
|
394
|
+
return bookmark
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
def _render_scheduled(row: dict) -> dict:
|
|
398
|
+
"""The ``scheduled_messages[]`` item: id, channel_id, post_at, date_created, text."""
|
|
399
|
+
return {k: row[k] for k in ("id", "channel_id", "post_at", "date_created", "text") if k in row}
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
def _conversation_types(params: dict) -> set[str]:
|
|
403
|
+
return set(_list(params, "types")) or {"public_channel"}
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
def _channel_type(row: dict) -> str:
|
|
407
|
+
if row.get("is_im"):
|
|
408
|
+
return "im"
|
|
409
|
+
if row.get("is_mpim"):
|
|
410
|
+
return "mpim"
|
|
411
|
+
if row.get("is_private"):
|
|
412
|
+
return "private_channel"
|
|
413
|
+
return "public_channel"
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
def _history(ctx, channel: dict, rows: list[dict], params: dict) -> dict:
|
|
417
|
+
oldest = params.get("oldest")
|
|
418
|
+
latest = params.get("latest")
|
|
419
|
+
inclusive = _flag(params, "inclusive")
|
|
420
|
+
if oldest:
|
|
421
|
+
low = _ts_number(oldest, "invalid_ts_oldest")
|
|
422
|
+
rows = [r for r in rows if (_ts_key(r) >= low if inclusive else _ts_key(r) > low)]
|
|
423
|
+
if latest:
|
|
424
|
+
high = _ts_number(latest, "invalid_ts_latest")
|
|
425
|
+
rows = [r for r in rows if (_ts_key(r) <= high if inclusive else _ts_key(r) < high)]
|
|
426
|
+
rows.sort(key=_ts_key, reverse=True)
|
|
427
|
+
page = _paged(ctx, [_render_message(ctx, r) for r in rows], "messages", params)
|
|
428
|
+
cursor = page.pop("response_metadata")["next_cursor"]
|
|
429
|
+
page["has_more"] = bool(cursor)
|
|
430
|
+
if cursor:
|
|
431
|
+
page["response_metadata"] = {"next_cursor": cursor}
|
|
432
|
+
pins = _scoped(ctx, "slack_pins", channel["workspace_id"], channel_id=channel["id"])
|
|
433
|
+
page["pin_count"] = len(pins)
|
|
434
|
+
page["channel_actions_ts"] = None
|
|
435
|
+
page["channel_actions_count"] = 0
|
|
436
|
+
return page
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
# ---------------------------------------------------------------- team / users
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
@route
|
|
443
|
+
def team_info(ctx, params):
|
|
444
|
+
workspace = _workspace(ctx, params)
|
|
445
|
+
row = ctx.get("slack_workspaces", {"id": workspace})
|
|
446
|
+
return _ok(team=dict(row))
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
@route
|
|
450
|
+
def bots_info(ctx, params):
|
|
451
|
+
workspace = _workspace(ctx, params)
|
|
452
|
+
_required(params, "bot")
|
|
453
|
+
row = ctx.get("slack_bots", {"workspace_id": workspace, "id": params["bot"]})
|
|
454
|
+
if row is None:
|
|
455
|
+
raise SlackError("bot_not_found")
|
|
456
|
+
bot = _public(row)
|
|
457
|
+
bot.pop("team_id", None)
|
|
458
|
+
return _ok(bot=bot)
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
@route
|
|
462
|
+
def users_list(ctx, params):
|
|
463
|
+
workspace = _workspace(ctx, params)
|
|
464
|
+
rows = sorted(_scoped(ctx, "slack_users", workspace), key=lambda r: r["id"])
|
|
465
|
+
return _paged(ctx, [_render_user(ctx, r) for r in rows], "members", params, cache_ts=_now_seconds(ctx))
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
@route
|
|
469
|
+
def users_info(ctx, params):
|
|
470
|
+
workspace = _workspace(ctx, params)
|
|
471
|
+
return _ok(user=_render_user(ctx, _user(ctx, workspace, params.get("user"))))
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
@route
|
|
475
|
+
def users_lookup_by_email(ctx, params):
|
|
476
|
+
workspace = _workspace(ctx, params)
|
|
477
|
+
_required(params, "email")
|
|
478
|
+
wanted = str(params["email"]).lower()
|
|
479
|
+
for row in _scoped(ctx, "slack_users", workspace):
|
|
480
|
+
email = (row.get("profile") or {}).get("email")
|
|
481
|
+
if isinstance(email, str) and email.lower() == wanted:
|
|
482
|
+
return _ok(user=_render_user(ctx, row))
|
|
483
|
+
raise SlackError("users_not_found")
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
@route
|
|
487
|
+
def users_profile_get(ctx, params):
|
|
488
|
+
workspace = _workspace(ctx, params)
|
|
489
|
+
user = params.get("user") or _writer_user(ctx, workspace)
|
|
490
|
+
rendered = _render_user(ctx, _user(ctx, workspace, user))
|
|
491
|
+
return _ok(profile=rendered.get("profile") or {})
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
@route
|
|
495
|
+
def users_profile_set(ctx, params):
|
|
496
|
+
workspace = _workspace(ctx, params)
|
|
497
|
+
user = params.get("user") or _writer_user(ctx, workspace)
|
|
498
|
+
row = _user(ctx, workspace, user)
|
|
499
|
+
profile = dict(row.get("profile") or {})
|
|
500
|
+
patch = _json_arg(params, "profile")
|
|
501
|
+
if isinstance(patch, dict):
|
|
502
|
+
profile.update(patch)
|
|
503
|
+
elif params.get("name"):
|
|
504
|
+
profile[str(params["name"])] = params.get("value")
|
|
505
|
+
else:
|
|
506
|
+
raise SlackError("invalid_arguments")
|
|
507
|
+
updated = ctx.update("slack_users", ctx.key_of("slack_users", row), {"profile": profile})
|
|
508
|
+
rendered = _render_user(ctx, updated)
|
|
509
|
+
return _ok(username=updated.get("name"), profile=rendered.get("profile") or {})
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
@route
|
|
513
|
+
def users_get_presence(ctx, params):
|
|
514
|
+
workspace = _workspace(ctx, params)
|
|
515
|
+
user = params.get("user") or _writer_user(ctx, workspace)
|
|
516
|
+
_user(ctx, workspace, user)
|
|
517
|
+
row = ctx.get("slack_presence", {"workspace_id": workspace, "user_id": user})
|
|
518
|
+
if row is None:
|
|
519
|
+
return _ok(presence="away")
|
|
520
|
+
return _ok(**{k: v for k, v in row.items() if k not in ("workspace_id", "user_id")})
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
@route
|
|
524
|
+
def users_set_presence(ctx, params):
|
|
525
|
+
workspace = _workspace(ctx, params)
|
|
526
|
+
_required(params, "presence")
|
|
527
|
+
manual = str(params["presence"])
|
|
528
|
+
if manual not in ("auto", "away"):
|
|
529
|
+
raise SlackError("invalid_presence")
|
|
530
|
+
key = {"workspace_id": workspace, "user_id": _writer_user(ctx, workspace)}
|
|
531
|
+
presence = "away" if manual == "away" else "active"
|
|
532
|
+
patch = {"presence": presence, "manual_presence": manual, "manual_away": manual == "away"}
|
|
533
|
+
if ctx.get("slack_presence", key) is None:
|
|
534
|
+
ctx.insert("slack_presence", {**key, **patch})
|
|
535
|
+
else:
|
|
536
|
+
ctx.update("slack_presence", key, patch)
|
|
537
|
+
_emit(ctx, "presence_change", user=key["user_id"], presence=presence)
|
|
538
|
+
return _ok()
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
@route
|
|
542
|
+
def users_conversations(ctx, params):
|
|
543
|
+
workspace = _workspace(ctx, params)
|
|
544
|
+
user = params.get("user") or _writer_user(ctx, workspace)
|
|
545
|
+
_user(ctx, workspace, user)
|
|
546
|
+
member_of = {m["channel_id"] for m in _scoped(ctx, "slack_memberships", workspace, user_id=user)}
|
|
547
|
+
types = _conversation_types(params)
|
|
548
|
+
rows = [
|
|
549
|
+
r
|
|
550
|
+
for r in _scoped(ctx, "slack_channels", workspace)
|
|
551
|
+
if r["id"] in member_of
|
|
552
|
+
and _channel_type(r) in types
|
|
553
|
+
and not (_flag(params, "exclude_archived") and r.get("is_archived"))
|
|
554
|
+
]
|
|
555
|
+
rows.sort(key=lambda r: r["id"])
|
|
556
|
+
return _paged(ctx, [_render_channel(ctx, r) for r in rows], "channels", params)
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
# ---------------------------------------------------------------- conversations
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
@route
|
|
563
|
+
def conversations_list(ctx, params):
|
|
564
|
+
workspace = _workspace(ctx, params)
|
|
565
|
+
types = _conversation_types(params)
|
|
566
|
+
rows = [
|
|
567
|
+
r
|
|
568
|
+
for r in _scoped(ctx, "slack_channels", workspace)
|
|
569
|
+
if _channel_type(r) in types and not (_flag(params, "exclude_archived") and r.get("is_archived"))
|
|
570
|
+
]
|
|
571
|
+
rows.sort(key=lambda r: r["id"])
|
|
572
|
+
return _paged(ctx, [_render_channel(ctx, r) for r in rows], "channels", params)
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
@route
|
|
576
|
+
def conversations_info(ctx, params):
|
|
577
|
+
workspace = _workspace(ctx, params)
|
|
578
|
+
row = _channel(ctx, workspace, params.get("channel"))
|
|
579
|
+
channel = _render_channel(ctx, row)
|
|
580
|
+
if _flag(params, "include_num_members"):
|
|
581
|
+
channel["num_members"] = len(_scoped(ctx, "slack_memberships", workspace, channel_id=row["id"]))
|
|
582
|
+
return _ok(channel=channel)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
@route
|
|
586
|
+
def conversations_members(ctx, params):
|
|
587
|
+
workspace = _workspace(ctx, params)
|
|
588
|
+
row = _channel(ctx, workspace, params.get("channel"))
|
|
589
|
+
members = sorted(m["user_id"] for m in _scoped(ctx, "slack_memberships", workspace, channel_id=row["id"]))
|
|
590
|
+
return _paged(ctx, members, "members", params)
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
@route
|
|
594
|
+
def conversations_history(ctx, params):
|
|
595
|
+
workspace = _workspace(ctx, params)
|
|
596
|
+
row = _channel(ctx, workspace, params.get("channel"))
|
|
597
|
+
replies = {t["reply_ts"] for t in _scoped(ctx, "slack_message_threads", workspace, channel_id=row["id"])}
|
|
598
|
+
rows = [m for m in _scoped(ctx, "slack_messages", workspace, channel_id=row["id"]) if m["ts"] not in replies]
|
|
599
|
+
return _history(ctx, row, rows, params)
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
@route
|
|
603
|
+
def conversations_replies(ctx, params):
|
|
604
|
+
workspace = _workspace(ctx, params)
|
|
605
|
+
row = _channel(ctx, workspace, params.get("channel"))
|
|
606
|
+
_required(params, "ts")
|
|
607
|
+
parent = _message(ctx, workspace, row["id"], params["ts"], "thread_not_found")
|
|
608
|
+
threads = _scoped(ctx, "slack_message_threads", workspace, channel_id=row["id"], parent_ts=parent["ts"])
|
|
609
|
+
rows = [parent] + [
|
|
610
|
+
m
|
|
611
|
+
for t in threads
|
|
612
|
+
for m in [ctx.get("slack_messages", {"workspace_id": workspace, "channel_id": row["id"], "ts": t["reply_ts"]})]
|
|
613
|
+
if m is not None
|
|
614
|
+
]
|
|
615
|
+
rows.sort(key=_ts_key)
|
|
616
|
+
page = _paged(ctx, [_render_message(ctx, r) for r in rows], "messages", params)
|
|
617
|
+
cursor = page.pop("response_metadata")["next_cursor"]
|
|
618
|
+
page["has_more"] = bool(cursor)
|
|
619
|
+
if cursor:
|
|
620
|
+
page["response_metadata"] = {"next_cursor": cursor}
|
|
621
|
+
return page
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
@route
|
|
625
|
+
def conversations_create(ctx, params):
|
|
626
|
+
workspace = _workspace(ctx, params)
|
|
627
|
+
_required(params, "name")
|
|
628
|
+
name = str(params["name"])
|
|
629
|
+
if any(r.get("name") == name for r in _scoped(ctx, "slack_channels", workspace)):
|
|
630
|
+
raise SlackError("name_taken")
|
|
631
|
+
private = _flag(params, "is_private")
|
|
632
|
+
creator = _writer(ctx, workspace).get("user")
|
|
633
|
+
now = _now_seconds(ctx)
|
|
634
|
+
row = {
|
|
635
|
+
"workspace_id": workspace,
|
|
636
|
+
"id": _slack_id("G" if private else "C"),
|
|
637
|
+
"name": name,
|
|
638
|
+
"name_normalized": name,
|
|
639
|
+
"created": now,
|
|
640
|
+
"is_channel": not private,
|
|
641
|
+
"is_group": private,
|
|
642
|
+
"is_im": False,
|
|
643
|
+
"is_mpim": False,
|
|
644
|
+
"is_private": private,
|
|
645
|
+
"is_archived": False,
|
|
646
|
+
"is_general": False,
|
|
647
|
+
"is_shared": False,
|
|
648
|
+
"is_org_shared": False,
|
|
649
|
+
"is_ext_shared": False,
|
|
650
|
+
"is_pending_ext_shared": False,
|
|
651
|
+
"unlinked": 0,
|
|
652
|
+
"pending_shared": [],
|
|
653
|
+
"previous_names": [],
|
|
654
|
+
"topic": {"value": "", "creator": "", "last_set": 0},
|
|
655
|
+
"purpose": {"value": "", "creator": "", "last_set": 0},
|
|
656
|
+
"context_team_id": workspace,
|
|
657
|
+
"shared_team_ids": [workspace],
|
|
658
|
+
}
|
|
659
|
+
if creator:
|
|
660
|
+
row["creator"] = creator
|
|
661
|
+
inserted = ctx.insert("slack_channels", row)
|
|
662
|
+
if creator:
|
|
663
|
+
ctx.insert("slack_memberships", {"workspace_id": workspace, "channel_id": inserted["id"], "user_id": creator})
|
|
664
|
+
channel = _render_channel(ctx, inserted)
|
|
665
|
+
_emit(ctx, "channel_created", channel=channel)
|
|
666
|
+
return _ok(channel=channel)
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
def _set_archived(ctx, params, archived: bool) -> dict:
|
|
670
|
+
workspace = _workspace(ctx, params)
|
|
671
|
+
row = _channel(ctx, workspace, params.get("channel"))
|
|
672
|
+
if row.get("is_general") and archived:
|
|
673
|
+
raise SlackError("cant_archive_general")
|
|
674
|
+
if bool(row.get("is_archived")) == archived:
|
|
675
|
+
raise SlackError("already_archived" if archived else "not_archived")
|
|
676
|
+
ctx.update("slack_channels", ctx.key_of("slack_channels", row), {"is_archived": archived})
|
|
677
|
+
_emit(ctx, "channel_archive" if archived else "channel_unarchive", channel=row["id"], user=_writer(ctx, workspace).get("user"))
|
|
678
|
+
return _ok()
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
@route
|
|
682
|
+
def conversations_archive(ctx, params):
|
|
683
|
+
return _set_archived(ctx, params, True)
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
@route
|
|
687
|
+
def conversations_unarchive(ctx, params):
|
|
688
|
+
return _set_archived(ctx, params, False)
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
@route
|
|
692
|
+
def conversations_rename(ctx, params):
|
|
693
|
+
workspace = _workspace(ctx, params)
|
|
694
|
+
row = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
695
|
+
_required(params, "name")
|
|
696
|
+
name = str(params["name"])
|
|
697
|
+
if any(r.get("name") == name and r["id"] != row["id"] for r in _scoped(ctx, "slack_channels", workspace)):
|
|
698
|
+
raise SlackError("name_taken")
|
|
699
|
+
previous = list(row.get("previous_names") or [])
|
|
700
|
+
if row.get("name") and row["name"] != name:
|
|
701
|
+
previous.append(row["name"])
|
|
702
|
+
patch = {"name": name, "name_normalized": name, "previous_names": previous}
|
|
703
|
+
updated = ctx.update("slack_channels", ctx.key_of("slack_channels", row), patch)
|
|
704
|
+
return _ok(channel=_render_channel(ctx, updated))
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
def _set_topic(ctx, params, field: str) -> dict:
|
|
708
|
+
workspace = _workspace(ctx, params)
|
|
709
|
+
row = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
710
|
+
_required(params, field)
|
|
711
|
+
value = {
|
|
712
|
+
"value": str(params[field]),
|
|
713
|
+
"creator": _writer(ctx, workspace).get("user", ""),
|
|
714
|
+
"last_set": _now_seconds(ctx),
|
|
715
|
+
}
|
|
716
|
+
updated = ctx.update("slack_channels", ctx.key_of("slack_channels", row), {field: value})
|
|
717
|
+
return _ok(channel=_render_channel(ctx, updated))
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
@route
|
|
721
|
+
def conversations_set_topic(ctx, params):
|
|
722
|
+
return _set_topic(ctx, params, "topic")
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
@route
|
|
726
|
+
def conversations_set_purpose(ctx, params):
|
|
727
|
+
return _set_topic(ctx, params, "purpose")
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
@route
|
|
731
|
+
def conversations_invite(ctx, params):
|
|
732
|
+
workspace = _workspace(ctx, params)
|
|
733
|
+
row = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
734
|
+
users = _list(params, "users")
|
|
735
|
+
if not users:
|
|
736
|
+
raise SlackError("invalid_arguments")
|
|
737
|
+
for user in users:
|
|
738
|
+
_user(ctx, workspace, user)
|
|
739
|
+
key = {"workspace_id": workspace, "channel_id": row["id"], "user_id": user}
|
|
740
|
+
if ctx.get("slack_memberships", key) is not None:
|
|
741
|
+
raise SlackError("already_in_channel")
|
|
742
|
+
ctx.insert("slack_memberships", key)
|
|
743
|
+
_emit(ctx, "member_joined_channel", user=user, channel=row["id"], channel_type=_channel_type(row), inviter=_writer(ctx, workspace).get("user"))
|
|
744
|
+
return _ok(channel=_render_channel(ctx, row))
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
@route
|
|
748
|
+
def conversations_kick(ctx, params):
|
|
749
|
+
workspace = _workspace(ctx, params)
|
|
750
|
+
row = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
751
|
+
_required(params, "user")
|
|
752
|
+
key = {"workspace_id": workspace, "channel_id": row["id"], "user_id": params["user"]}
|
|
753
|
+
if ctx.get("slack_memberships", key) is None:
|
|
754
|
+
raise SlackError("not_in_channel")
|
|
755
|
+
if row.get("is_general"):
|
|
756
|
+
raise SlackError("cant_kick_from_general")
|
|
757
|
+
ctx.delete("slack_memberships", key)
|
|
758
|
+
_emit(ctx, "member_left_channel", user=params["user"], channel=row["id"], channel_type=_channel_type(row))
|
|
759
|
+
return _ok()
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
@route
|
|
763
|
+
def conversations_join(ctx, params):
|
|
764
|
+
workspace = _workspace(ctx, params)
|
|
765
|
+
row = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
766
|
+
if row.get("is_private") or row.get("is_im") or row.get("is_mpim"):
|
|
767
|
+
raise SlackError("method_not_supported_for_channel_type")
|
|
768
|
+
key = {"workspace_id": workspace, "channel_id": row["id"], "user_id": _writer_user(ctx, workspace)}
|
|
769
|
+
if ctx.get("slack_memberships", key) is None:
|
|
770
|
+
ctx.insert("slack_memberships", key)
|
|
771
|
+
_emit(ctx, "member_joined_channel", user=key["user_id"], channel=row["id"], channel_type=_channel_type(row))
|
|
772
|
+
return _ok(channel=_render_channel(ctx, row))
|
|
773
|
+
return _ok(channel=_render_channel(ctx, row), warning="already_in_channel")
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
@route
|
|
777
|
+
def conversations_leave(ctx, params):
|
|
778
|
+
workspace = _workspace(ctx, params)
|
|
779
|
+
row = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
780
|
+
if row.get("is_general"):
|
|
781
|
+
raise SlackError("cant_leave_general")
|
|
782
|
+
key = {"workspace_id": workspace, "channel_id": row["id"], "user_id": _writer_user(ctx, workspace)}
|
|
783
|
+
if ctx.get("slack_memberships", key) is None:
|
|
784
|
+
return _ok(not_in_channel=True)
|
|
785
|
+
ctx.delete("slack_memberships", key)
|
|
786
|
+
_emit(ctx, "member_left_channel", user=key["user_id"], channel=row["id"], channel_type=_channel_type(row))
|
|
787
|
+
return _ok()
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
@route
|
|
791
|
+
def conversations_mark(ctx, params):
|
|
792
|
+
workspace = _workspace(ctx, params)
|
|
793
|
+
row = _channel(ctx, workspace, params.get("channel"))
|
|
794
|
+
_required(params, "ts")
|
|
795
|
+
_message(ctx, workspace, row["id"], params["ts"], "invalid_timestamp")
|
|
796
|
+
key = {"workspace_id": workspace, "channel_id": row["id"], "user_id": _writer_user(ctx, workspace)}
|
|
797
|
+
if ctx.get("slack_memberships", key) is None:
|
|
798
|
+
raise SlackError("not_in_channel")
|
|
799
|
+
marker = _ts_number(params["ts"], "invalid_timestamp")
|
|
800
|
+
unread = sum(
|
|
801
|
+
1
|
|
802
|
+
for m in _scoped(ctx, "slack_messages", workspace, channel_id=row["id"])
|
|
803
|
+
if _ts_key(m) > marker and m.get("user") != key["user_id"]
|
|
804
|
+
)
|
|
805
|
+
patch = {"last_read": params["ts"], "unread_count": unread, "unread_count_display": unread}
|
|
806
|
+
if ctx.get("slack_conversation_states", key) is None:
|
|
807
|
+
ctx.insert("slack_conversation_states", {**key, "is_member": True, **patch})
|
|
808
|
+
else:
|
|
809
|
+
ctx.update("slack_conversation_states", key, patch)
|
|
810
|
+
_emit(ctx, "channel_marked", channel=row["id"], ts=params["ts"], unread_count=unread, unread_count_display=unread)
|
|
811
|
+
return _ok()
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
# ---------------------------------------------------------------- chat
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
def _message_content(ctx, params, workspace: str) -> dict:
|
|
818
|
+
text = params.get("text")
|
|
819
|
+
blocks = _json_arg(params, "blocks")
|
|
820
|
+
attachments = _json_arg(params, "attachments")
|
|
821
|
+
if not text and not blocks and not attachments:
|
|
822
|
+
raise SlackError("no_text")
|
|
823
|
+
content: dict[str, Any] = {"type": "message", "text": text or "", "team": workspace}
|
|
824
|
+
if blocks:
|
|
825
|
+
content["blocks"] = blocks
|
|
826
|
+
if attachments:
|
|
827
|
+
content["attachments"] = attachments
|
|
828
|
+
for field in ("username", "icon_url", "icon_emoji"):
|
|
829
|
+
if params.get(field):
|
|
830
|
+
content[field] = str(params[field])
|
|
831
|
+
return content
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
@route
|
|
835
|
+
def chat_post_message(ctx, params):
|
|
836
|
+
workspace = _workspace(ctx, params)
|
|
837
|
+
channel = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
838
|
+
content = _message_content(ctx, params, workspace)
|
|
839
|
+
thread_ts = params.get("thread_ts")
|
|
840
|
+
if thread_ts:
|
|
841
|
+
_message(ctx, workspace, channel["id"], thread_ts, "thread_not_found")
|
|
842
|
+
ts = _next_ts(ctx, workspace)
|
|
843
|
+
row = {"workspace_id": workspace, "channel_id": channel["id"], "ts": ts, **_writer(ctx, workspace), **content}
|
|
844
|
+
inserted = ctx.insert("slack_messages", row)
|
|
845
|
+
if thread_ts:
|
|
846
|
+
ctx.insert(
|
|
847
|
+
"slack_message_threads",
|
|
848
|
+
{"workspace_id": workspace, "channel_id": channel["id"], "reply_ts": ts, "parent_ts": thread_ts},
|
|
849
|
+
)
|
|
850
|
+
parent = _message(ctx, workspace, channel["id"], thread_ts)
|
|
851
|
+
replies = _scoped(ctx, "slack_message_threads", workspace, channel_id=channel["id"], parent_ts=thread_ts)
|
|
852
|
+
users = sorted(
|
|
853
|
+
{
|
|
854
|
+
m["user"]
|
|
855
|
+
for t in replies
|
|
856
|
+
for m in [
|
|
857
|
+
ctx.get(
|
|
858
|
+
"slack_messages", {"workspace_id": workspace, "channel_id": channel["id"], "ts": t["reply_ts"]}
|
|
859
|
+
)
|
|
860
|
+
]
|
|
861
|
+
if m is not None and m.get("user")
|
|
862
|
+
}
|
|
863
|
+
)
|
|
864
|
+
ctx.update(
|
|
865
|
+
"slack_messages",
|
|
866
|
+
ctx.key_of("slack_messages", parent),
|
|
867
|
+
{"reply_count": len(replies), "reply_users_count": len(users), "reply_users": users, "latest_reply": ts},
|
|
868
|
+
)
|
|
869
|
+
message = _render_message(ctx, inserted)
|
|
870
|
+
_emit(ctx, "message", channel=channel["id"], channel_type=_channel_type(channel), **message)
|
|
871
|
+
return _ok(channel=channel["id"], ts=ts, message=message)
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
@route
|
|
875
|
+
def chat_me_message(ctx, params):
|
|
876
|
+
workspace = _workspace(ctx, params)
|
|
877
|
+
channel = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
878
|
+
_required(params, "text")
|
|
879
|
+
ts = _next_ts(ctx, workspace)
|
|
880
|
+
row = {
|
|
881
|
+
"workspace_id": workspace,
|
|
882
|
+
"channel_id": channel["id"],
|
|
883
|
+
"ts": ts,
|
|
884
|
+
"type": "message",
|
|
885
|
+
"subtype": "me_message",
|
|
886
|
+
"text": str(params["text"]),
|
|
887
|
+
"team": workspace,
|
|
888
|
+
**_writer(ctx, workspace),
|
|
889
|
+
}
|
|
890
|
+
ctx.insert("slack_messages", row)
|
|
891
|
+
return _ok(channel=channel["id"], ts=ts)
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
@route
|
|
895
|
+
def chat_update(ctx, params):
|
|
896
|
+
workspace = _workspace(ctx, params)
|
|
897
|
+
channel = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
898
|
+
row = _message(ctx, workspace, channel["id"], params.get("ts"))
|
|
899
|
+
content = _message_content(ctx, params, workspace)
|
|
900
|
+
patch = {k: v for k, v in content.items() if k in ("text", "blocks", "attachments")}
|
|
901
|
+
editor = _writer(ctx, workspace).get("user") or row.get("user")
|
|
902
|
+
if editor:
|
|
903
|
+
patch["edited"] = {"user": editor, "ts": _next_ts(ctx, workspace)}
|
|
904
|
+
updated = ctx.update("slack_messages", ctx.key_of("slack_messages", row), patch)
|
|
905
|
+
message = _render_message(ctx, updated)
|
|
906
|
+
_emit(ctx, "message", subtype="message_changed", channel=channel["id"], ts=patch.get("edited", {}).get("ts"), message=message)
|
|
907
|
+
return _ok(channel=channel["id"], ts=row["ts"], text=updated.get("text", ""), message=message)
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
def _delete_message_children(ctx, workspace: str, channel: str, ts: str) -> None:
|
|
911
|
+
scope = {"channel_id": channel, "message_ts": ts}
|
|
912
|
+
for entity in (
|
|
913
|
+
"slack_reaction_users",
|
|
914
|
+
"slack_reaction_summaries",
|
|
915
|
+
"slack_message_user_states",
|
|
916
|
+
"slack_file_shares",
|
|
917
|
+
"slack_message_files",
|
|
918
|
+
"slack_unavailable_message_files",
|
|
919
|
+
"slack_pins",
|
|
920
|
+
):
|
|
921
|
+
for child in _scoped(ctx, entity, workspace, **scope):
|
|
922
|
+
ctx.delete(entity, ctx.key_of(entity, child))
|
|
923
|
+
for thread in _scoped(ctx, "slack_message_threads", workspace, channel_id=channel, reply_ts=ts):
|
|
924
|
+
ctx.delete("slack_message_threads", ctx.key_of("slack_message_threads", thread))
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
@route
|
|
928
|
+
def chat_delete(ctx, params):
|
|
929
|
+
workspace = _workspace(ctx, params)
|
|
930
|
+
channel = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
931
|
+
row = _message(ctx, workspace, channel["id"], params.get("ts"))
|
|
932
|
+
for threads in ("slack_message_threads", "slack_scheduled_message_threads", "slack_ephemeral_message_threads"):
|
|
933
|
+
if _scoped(ctx, threads, workspace, channel_id=channel["id"], parent_ts=row["ts"]):
|
|
934
|
+
raise SlackError("cant_delete_message")
|
|
935
|
+
_delete_message_children(ctx, workspace, channel["id"], row["ts"])
|
|
936
|
+
ctx.delete("slack_messages", ctx.key_of("slack_messages", row))
|
|
937
|
+
_emit(ctx, "message", subtype="message_deleted", channel=channel["id"], deleted_ts=row["ts"])
|
|
938
|
+
return _ok(channel=channel["id"], ts=row["ts"])
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
@route
|
|
942
|
+
def chat_post_ephemeral(ctx, params):
|
|
943
|
+
workspace = _workspace(ctx, params)
|
|
944
|
+
channel = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
945
|
+
_required(params, "user")
|
|
946
|
+
recipient = _user(ctx, workspace, params["user"])
|
|
947
|
+
content = _message_content(ctx, params, workspace)
|
|
948
|
+
thread_ts = params.get("thread_ts")
|
|
949
|
+
if thread_ts:
|
|
950
|
+
_message(ctx, workspace, channel["id"], thread_ts, "thread_not_found")
|
|
951
|
+
ts = _next_ts(ctx, workspace)
|
|
952
|
+
row = {
|
|
953
|
+
"workspace_id": workspace,
|
|
954
|
+
"channel_id": channel["id"],
|
|
955
|
+
"ts": ts,
|
|
956
|
+
"recipient_user_id": recipient["id"],
|
|
957
|
+
**_writer(ctx, workspace),
|
|
958
|
+
**content,
|
|
959
|
+
}
|
|
960
|
+
ctx.insert("slack_ephemeral_messages", row)
|
|
961
|
+
if thread_ts:
|
|
962
|
+
ctx.insert(
|
|
963
|
+
"slack_ephemeral_message_threads",
|
|
964
|
+
{
|
|
965
|
+
"workspace_id": workspace,
|
|
966
|
+
"channel_id": channel["id"],
|
|
967
|
+
"message_ts": ts,
|
|
968
|
+
"recipient_user_id": recipient["id"],
|
|
969
|
+
"parent_ts": thread_ts,
|
|
970
|
+
},
|
|
971
|
+
)
|
|
972
|
+
return _ok(message_ts=ts)
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
@route
|
|
976
|
+
def chat_schedule_message(ctx, params):
|
|
977
|
+
workspace = _workspace(ctx, params)
|
|
978
|
+
channel = _channel(ctx, workspace, params.get("channel"), write=True)
|
|
979
|
+
post_at = _int(params, "post_at", 0)
|
|
980
|
+
if post_at <= _now_seconds(ctx):
|
|
981
|
+
raise SlackError("time_in_past")
|
|
982
|
+
content = _message_content(ctx, params, workspace)
|
|
983
|
+
thread_ts = params.get("thread_ts")
|
|
984
|
+
if thread_ts:
|
|
985
|
+
_message(ctx, workspace, channel["id"], thread_ts, "thread_not_found")
|
|
986
|
+
row = {
|
|
987
|
+
"workspace_id": workspace,
|
|
988
|
+
"channel_id": channel["id"],
|
|
989
|
+
"id": _slack_id("Q"),
|
|
990
|
+
"post_at": post_at,
|
|
991
|
+
"date_created": _now_seconds(ctx),
|
|
992
|
+
**_writer(ctx, workspace),
|
|
993
|
+
**content,
|
|
994
|
+
"type": "delayed_message",
|
|
995
|
+
}
|
|
996
|
+
inserted = ctx.insert("slack_scheduled_messages", row)
|
|
997
|
+
if thread_ts:
|
|
998
|
+
ctx.insert(
|
|
999
|
+
"slack_scheduled_message_threads",
|
|
1000
|
+
{
|
|
1001
|
+
"workspace_id": workspace,
|
|
1002
|
+
"channel_id": channel["id"],
|
|
1003
|
+
"scheduled_message_id": inserted["id"],
|
|
1004
|
+
"parent_ts": thread_ts,
|
|
1005
|
+
},
|
|
1006
|
+
)
|
|
1007
|
+
message = {k: v for k, v in _public(inserted, "id", "post_at", "date_created").items()}
|
|
1008
|
+
return _ok(channel=channel["id"], scheduled_message_id=inserted["id"], post_at=post_at, message=message)
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
@route
|
|
1012
|
+
def chat_delete_scheduled_message(ctx, params):
|
|
1013
|
+
workspace = _workspace(ctx, params)
|
|
1014
|
+
channel = _channel(ctx, workspace, params.get("channel"))
|
|
1015
|
+
_required(params, "scheduled_message_id")
|
|
1016
|
+
key = {"workspace_id": workspace, "channel_id": channel["id"], "id": params["scheduled_message_id"]}
|
|
1017
|
+
row = ctx.get("slack_scheduled_messages", key)
|
|
1018
|
+
if row is None:
|
|
1019
|
+
raise SlackError("invalid_scheduled_message_id")
|
|
1020
|
+
for thread in _scoped(
|
|
1021
|
+
ctx, "slack_scheduled_message_threads", workspace, channel_id=channel["id"], scheduled_message_id=row["id"]
|
|
1022
|
+
):
|
|
1023
|
+
ctx.delete("slack_scheduled_message_threads", ctx.key_of("slack_scheduled_message_threads", thread))
|
|
1024
|
+
ctx.delete("slack_scheduled_messages", key)
|
|
1025
|
+
return _ok()
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
@route
|
|
1029
|
+
def chat_scheduled_messages_list(ctx, params):
|
|
1030
|
+
workspace = _workspace(ctx, params)
|
|
1031
|
+
rows = _scoped(ctx, "slack_scheduled_messages", workspace)
|
|
1032
|
+
if params.get("channel"):
|
|
1033
|
+
rows = [r for r in rows if r["channel_id"] == params["channel"]]
|
|
1034
|
+
oldest, latest = _int(params, "oldest", 0), _int(params, "latest", 0)
|
|
1035
|
+
if oldest:
|
|
1036
|
+
rows = [r for r in rows if r["post_at"] >= oldest]
|
|
1037
|
+
if latest:
|
|
1038
|
+
rows = [r for r in rows if r["post_at"] <= latest]
|
|
1039
|
+
rows.sort(key=lambda r: (r["post_at"], r["id"]))
|
|
1040
|
+
return _paged(ctx, [_render_scheduled(r) for r in rows], "scheduled_messages", params)
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
@route
|
|
1044
|
+
def chat_get_permalink(ctx, params):
|
|
1045
|
+
workspace = _workspace(ctx, params)
|
|
1046
|
+
channel = _channel(ctx, workspace, params.get("channel"))
|
|
1047
|
+
row = _message(ctx, workspace, channel["id"], params.get("message_ts"))
|
|
1048
|
+
if row.get("permalink"):
|
|
1049
|
+
return _ok(channel=channel["id"], permalink=row["permalink"])
|
|
1050
|
+
team = ctx.get("slack_workspaces", {"id": workspace}) or {}
|
|
1051
|
+
domain = team.get("domain") or workspace.lower()
|
|
1052
|
+
permalink = f"https://{domain}.slack.com/archives/{channel['id']}/p{row['ts'].replace('.', '')}"
|
|
1053
|
+
return _ok(channel=channel["id"], permalink=permalink)
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
# ---------------------------------------------------------------- reactions, pins, bookmarks
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
def _reaction_target(ctx, params, workspace: str) -> tuple[str, dict, dict]:
|
|
1060
|
+
"""Where a reaction lives: a message (``channel`` + ``timestamp``) or a ``file``."""
|
|
1061
|
+
if params.get("file"):
|
|
1062
|
+
file = _file(ctx, workspace, params["file"])
|
|
1063
|
+
return "file", file, {"file_id": file["id"]}
|
|
1064
|
+
channel = _channel(ctx, workspace, params.get("channel"))
|
|
1065
|
+
message = _message(ctx, workspace, channel["id"], params.get("timestamp"), "message_not_found")
|
|
1066
|
+
return "message", message, {"channel_id": channel["id"], "message_ts": message["ts"]}
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
@route
|
|
1070
|
+
def reactions_get(ctx, params):
|
|
1071
|
+
workspace = _workspace(ctx, params)
|
|
1072
|
+
kind, row, _ = _reaction_target(ctx, params, workspace)
|
|
1073
|
+
if kind == "file":
|
|
1074
|
+
return _ok(type="file", file=_render_file(ctx, row))
|
|
1075
|
+
return _ok(type="message", channel=row["channel_id"], message=_render_message(ctx, row))
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
@route
|
|
1079
|
+
def reactions_list(ctx, params):
|
|
1080
|
+
workspace = _workspace(ctx, params)
|
|
1081
|
+
user = params.get("user") or _writer_user(ctx, workspace)
|
|
1082
|
+
_user(ctx, workspace, user)
|
|
1083
|
+
items: list[dict] = []
|
|
1084
|
+
seen: set[tuple] = set()
|
|
1085
|
+
for reaction in _scoped(ctx, "slack_reaction_users", workspace, user_id=user):
|
|
1086
|
+
key = (reaction["channel_id"], reaction["message_ts"])
|
|
1087
|
+
if key in seen:
|
|
1088
|
+
continue
|
|
1089
|
+
seen.add(key)
|
|
1090
|
+
message = ctx.get("slack_messages", {"workspace_id": workspace, "channel_id": key[0], "ts": key[1]})
|
|
1091
|
+
if message is not None:
|
|
1092
|
+
items.append({"type": "message", "channel": key[0], "message": _render_message(ctx, message)})
|
|
1093
|
+
for reaction in _scoped(ctx, "slack_file_reaction_users", workspace, user_id=user):
|
|
1094
|
+
if ("file", reaction["file_id"]) in seen:
|
|
1095
|
+
continue
|
|
1096
|
+
seen.add(("file", reaction["file_id"]))
|
|
1097
|
+
file = ctx.get("slack_files", {"workspace_id": workspace, "id": reaction["file_id"]})
|
|
1098
|
+
if file is not None:
|
|
1099
|
+
items.append({"type": "file", "file": _render_file(ctx, file)})
|
|
1100
|
+
page, paging = _classic_page(items, params)
|
|
1101
|
+
return _ok(items=page, paging=paging)
|
|
1102
|
+
|
|
1103
|
+
|
|
1104
|
+
def _react(ctx, params, remove: bool) -> dict:
|
|
1105
|
+
workspace = _workspace(ctx, params)
|
|
1106
|
+
_required(params, "name")
|
|
1107
|
+
name = str(params["name"])
|
|
1108
|
+
user = _writer_user(ctx, workspace)
|
|
1109
|
+
kind, _, scope = _reaction_target(ctx, params, workspace)
|
|
1110
|
+
summaries = "slack_reaction_summaries" if kind == "message" else "slack_file_reaction_summaries"
|
|
1111
|
+
users = "slack_reaction_users" if kind == "message" else "slack_file_reaction_users"
|
|
1112
|
+
summary_key = {"workspace_id": workspace, **scope, "name": name}
|
|
1113
|
+
user_key = {**summary_key, "user_id": user}
|
|
1114
|
+
summary = ctx.get(summaries, summary_key)
|
|
1115
|
+
reacted = ctx.get(users, user_key) is not None
|
|
1116
|
+
item = {"type": kind, **({"channel": scope["channel_id"], "ts": scope["message_ts"]} if kind == "message" else {"file": scope["file_id"]})}
|
|
1117
|
+
if remove:
|
|
1118
|
+
if not reacted or summary is None:
|
|
1119
|
+
raise SlackError("no_reaction")
|
|
1120
|
+
ctx.delete(users, user_key)
|
|
1121
|
+
if summary["count"] <= 1:
|
|
1122
|
+
ctx.delete(summaries, summary_key)
|
|
1123
|
+
else:
|
|
1124
|
+
ctx.update(summaries, summary_key, {"count": summary["count"] - 1})
|
|
1125
|
+
_emit(ctx, "reaction_removed", user=user, reaction=name, item=item)
|
|
1126
|
+
return _ok()
|
|
1127
|
+
if reacted:
|
|
1128
|
+
raise SlackError("already_reacted")
|
|
1129
|
+
if summary is None:
|
|
1130
|
+
ctx.insert(summaries, {**summary_key, "count": 1})
|
|
1131
|
+
else:
|
|
1132
|
+
ctx.update(summaries, summary_key, {"count": summary["count"] + 1})
|
|
1133
|
+
ctx.insert(users, user_key)
|
|
1134
|
+
_emit(ctx, "reaction_added", user=user, reaction=name, item=item)
|
|
1135
|
+
return _ok()
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
@route
|
|
1139
|
+
def reactions_add(ctx, params):
|
|
1140
|
+
return _react(ctx, params, remove=False)
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
@route
|
|
1144
|
+
def reactions_remove(ctx, params):
|
|
1145
|
+
return _react(ctx, params, remove=True)
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
@route
|
|
1149
|
+
def pins_list(ctx, params):
|
|
1150
|
+
workspace = _workspace(ctx, params)
|
|
1151
|
+
channel = _channel(ctx, workspace, params.get("channel"))
|
|
1152
|
+
items = []
|
|
1153
|
+
for pin in _scoped(ctx, "slack_pins", workspace, channel_id=channel["id"]):
|
|
1154
|
+
message = ctx.get(
|
|
1155
|
+
"slack_messages", {"workspace_id": workspace, "channel_id": channel["id"], "ts": pin["message_ts"]}
|
|
1156
|
+
)
|
|
1157
|
+
if message is None:
|
|
1158
|
+
continue
|
|
1159
|
+
item = {"type": "message", "channel": channel["id"], "message": _render_message(ctx, message)}
|
|
1160
|
+
for field in ("created", "created_by"):
|
|
1161
|
+
if pin.get(field) is not None:
|
|
1162
|
+
item[field] = pin[field]
|
|
1163
|
+
items.append(item)
|
|
1164
|
+
items.sort(key=lambda i: i["message"]["ts"])
|
|
1165
|
+
return _ok(items=items)
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
def _pin(ctx, params, remove: bool) -> dict:
|
|
1169
|
+
workspace = _workspace(ctx, params)
|
|
1170
|
+
channel = _channel(ctx, workspace, params.get("channel"), write=not remove)
|
|
1171
|
+
message = _message(ctx, workspace, channel["id"], params.get("timestamp"))
|
|
1172
|
+
key = {"workspace_id": workspace, "channel_id": channel["id"], "message_ts": message["ts"]}
|
|
1173
|
+
pinned = ctx.get("slack_pins", key) is not None
|
|
1174
|
+
writer = _writer(ctx, workspace).get("user")
|
|
1175
|
+
if remove:
|
|
1176
|
+
if not pinned:
|
|
1177
|
+
raise SlackError("no_pin")
|
|
1178
|
+
ctx.delete("slack_pins", key)
|
|
1179
|
+
item = {"type": "message", "channel": channel["id"], "ts": message["ts"], "message": _render_message(ctx, message)}
|
|
1180
|
+
_emit(ctx, "pin_removed", user=writer, channel_id=channel["id"], item=item)
|
|
1181
|
+
return _ok()
|
|
1182
|
+
if pinned:
|
|
1183
|
+
raise SlackError("already_pinned")
|
|
1184
|
+
pin = {**key, "created": _now_seconds(ctx)}
|
|
1185
|
+
if writer:
|
|
1186
|
+
pin["created_by"] = writer
|
|
1187
|
+
ctx.insert("slack_pins", pin)
|
|
1188
|
+
item = {"type": "message", "channel": channel["id"], "ts": message["ts"], "message": _render_message(ctx, message)}
|
|
1189
|
+
_emit(ctx, "pin_added", user=writer, channel_id=channel["id"], item=item)
|
|
1190
|
+
return _ok()
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
@route
|
|
1194
|
+
def pins_add(ctx, params):
|
|
1195
|
+
return _pin(ctx, params, remove=False)
|
|
1196
|
+
|
|
1197
|
+
|
|
1198
|
+
@route
|
|
1199
|
+
def pins_remove(ctx, params):
|
|
1200
|
+
return _pin(ctx, params, remove=True)
|
|
1201
|
+
|
|
1202
|
+
|
|
1203
|
+
@route
|
|
1204
|
+
def bookmarks_list(ctx, params):
|
|
1205
|
+
workspace = _workspace(ctx, params)
|
|
1206
|
+
channel = _channel(ctx, workspace, params.get("channel_id"))
|
|
1207
|
+
rows = sorted(_scoped(ctx, "slack_bookmarks", workspace, channel_id=channel["id"]), key=lambda r: r["rank"])
|
|
1208
|
+
return _ok(bookmarks=[_render_bookmark(r) for r in rows])
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
@route
|
|
1212
|
+
def bookmarks_add(ctx, params):
|
|
1213
|
+
workspace = _workspace(ctx, params)
|
|
1214
|
+
channel = _channel(ctx, workspace, params.get("channel_id"), write=True)
|
|
1215
|
+
_required(params, "title", "type")
|
|
1216
|
+
if params["type"] == "link" and not params.get("link"):
|
|
1217
|
+
raise SlackError("link_required")
|
|
1218
|
+
existing = _scoped(ctx, "slack_bookmarks", workspace, channel_id=channel["id"])
|
|
1219
|
+
now = _now_seconds(ctx)
|
|
1220
|
+
row = {
|
|
1221
|
+
"workspace_id": workspace,
|
|
1222
|
+
"channel_id": channel["id"],
|
|
1223
|
+
"id": _slack_id("Bk"),
|
|
1224
|
+
"type": str(params["type"]),
|
|
1225
|
+
"title": str(params["title"]),
|
|
1226
|
+
"rank": chr(ord("a") + min(len(existing), 25)),
|
|
1227
|
+
"date_created": now,
|
|
1228
|
+
"date_updated": now,
|
|
1229
|
+
"last_updated_by_team_id": workspace,
|
|
1230
|
+
}
|
|
1231
|
+
for field in ("link", "emoji", "entity_id", "parent_id"):
|
|
1232
|
+
if params.get(field):
|
|
1233
|
+
row[field] = str(params[field])
|
|
1234
|
+
writer = _writer(ctx, workspace).get("user")
|
|
1235
|
+
if writer:
|
|
1236
|
+
row["last_updated_by_user_id"] = writer
|
|
1237
|
+
return _ok(bookmark=_render_bookmark(ctx.insert("slack_bookmarks", row)))
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
# ---------------------------------------------------------------- files
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
@route
|
|
1244
|
+
def files_list(ctx, params):
|
|
1245
|
+
workspace = _workspace(ctx, params)
|
|
1246
|
+
rows = _scoped(ctx, "slack_files", workspace)
|
|
1247
|
+
if not _flag(params, "show_files_hidden_by_limit"):
|
|
1248
|
+
rows = [r for r in rows if not r.get("is_hidden_by_limit")]
|
|
1249
|
+
if params.get("user"):
|
|
1250
|
+
rows = [r for r in rows if r.get("user") == params["user"]]
|
|
1251
|
+
if params.get("channel"):
|
|
1252
|
+
_channel(ctx, workspace, params["channel"])
|
|
1253
|
+
shared = {
|
|
1254
|
+
o["file_id"]
|
|
1255
|
+
for o in _scoped(ctx, "slack_file_channel_observations", workspace, channel_id=params["channel"])
|
|
1256
|
+
}
|
|
1257
|
+
rows = [r for r in rows if r["id"] in shared]
|
|
1258
|
+
types = set(_list(params, "types")) - {"all"}
|
|
1259
|
+
if types:
|
|
1260
|
+
rows = [r for r in rows if _file_type(r) in types]
|
|
1261
|
+
ts_from, ts_to = _int(params, "ts_from", 0), _int(params, "ts_to", 0)
|
|
1262
|
+
if ts_from:
|
|
1263
|
+
rows = [r for r in rows if (r.get("created") or 0) >= ts_from]
|
|
1264
|
+
if ts_to:
|
|
1265
|
+
rows = [r for r in rows if (r.get("created") or 0) <= ts_to]
|
|
1266
|
+
rows.sort(key=lambda r: (r.get("created") or 0, r["id"]))
|
|
1267
|
+
page, paging = _classic_page([_render_file(ctx, r) for r in rows], params)
|
|
1268
|
+
return _ok(files=page, paging=paging)
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
def _file_type(row: dict) -> str:
|
|
1272
|
+
"""The ``types`` filter buckets files.list documents: spaces, snippets, images, gdocs, zips, pdfs."""
|
|
1273
|
+
mimetype = row.get("mimetype") or ""
|
|
1274
|
+
filetype = row.get("filetype") or ""
|
|
1275
|
+
if filetype == "space":
|
|
1276
|
+
return "spaces"
|
|
1277
|
+
if row.get("mode") == "snippet":
|
|
1278
|
+
return "snippets"
|
|
1279
|
+
if mimetype.startswith("image/"):
|
|
1280
|
+
return "images"
|
|
1281
|
+
if filetype.startswith("g"):
|
|
1282
|
+
return "gdocs"
|
|
1283
|
+
if filetype == "zip":
|
|
1284
|
+
return "zips"
|
|
1285
|
+
if filetype == "pdf":
|
|
1286
|
+
return "pdfs"
|
|
1287
|
+
return "other"
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
@route
|
|
1291
|
+
def files_info(ctx, params):
|
|
1292
|
+
workspace = _workspace(ctx, params)
|
|
1293
|
+
row = _file(ctx, workspace, params.get("file"))
|
|
1294
|
+
return _ok(file=_render_file(ctx, row), comments=[], response_metadata={"next_cursor": ""})
|
|
1295
|
+
|
|
1296
|
+
|
|
1297
|
+
@route
|
|
1298
|
+
def files_delete(ctx, params):
|
|
1299
|
+
workspace = _workspace(ctx, params)
|
|
1300
|
+
row = _file(ctx, workspace, params.get("file"))
|
|
1301
|
+
for entity in (
|
|
1302
|
+
"slack_file_reaction_users",
|
|
1303
|
+
"slack_file_reaction_summaries",
|
|
1304
|
+
"slack_file_user_states",
|
|
1305
|
+
"slack_file_channel_observations",
|
|
1306
|
+
"slack_file_shares",
|
|
1307
|
+
"slack_message_files",
|
|
1308
|
+
"slack_ephemeral_message_files",
|
|
1309
|
+
):
|
|
1310
|
+
for child in _scoped(ctx, entity, workspace, file_id=row["id"]):
|
|
1311
|
+
ctx.delete(entity, ctx.key_of(entity, child))
|
|
1312
|
+
ctx.delete("slack_files", ctx.key_of("slack_files", row))
|
|
1313
|
+
return _ok()
|
|
1314
|
+
|
|
1315
|
+
|
|
1316
|
+
def _public_url(ctx, params, shared: bool) -> dict:
|
|
1317
|
+
workspace = _workspace(ctx, params)
|
|
1318
|
+
row = _file(ctx, workspace, params.get("file"))
|
|
1319
|
+
if bool(row.get("public_url_shared")) == shared:
|
|
1320
|
+
raise SlackError("already_public" if shared else "file_not_shared")
|
|
1321
|
+
patch: dict[str, Any] = {"public_url_shared": shared}
|
|
1322
|
+
if shared and not row.get("permalink_public"):
|
|
1323
|
+
patch["permalink_public"] = f"https://slack-files.com/{workspace}-{row['id']}-{uuid.uuid4().hex[:10]}"
|
|
1324
|
+
updated = ctx.update("slack_files", ctx.key_of("slack_files", row), patch)
|
|
1325
|
+
return _ok(file=_render_file(ctx, updated))
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
@route
|
|
1329
|
+
def files_shared_public_url(ctx, params):
|
|
1330
|
+
return _public_url(ctx, params, shared=True)
|
|
1331
|
+
|
|
1332
|
+
|
|
1333
|
+
@route
|
|
1334
|
+
def files_revoke_public_url(ctx, params):
|
|
1335
|
+
return _public_url(ctx, params, shared=False)
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
# ---------------------------------------------------------------- usergroups
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
@route
|
|
1342
|
+
def usergroups_list(ctx, params):
|
|
1343
|
+
workspace = _workspace(ctx, params)
|
|
1344
|
+
rows = _scoped(ctx, "slack_usergroups", workspace)
|
|
1345
|
+
if not _flag(params, "include_disabled"):
|
|
1346
|
+
rows = [r for r in rows if not r.get("date_delete")]
|
|
1347
|
+
rows.sort(key=lambda r: r["id"])
|
|
1348
|
+
include_users = _flag(params, "include_users")
|
|
1349
|
+
usergroups = [_render_usergroup(ctx, r, include_users=include_users) for r in rows]
|
|
1350
|
+
if _flag(params, "include_count"):
|
|
1351
|
+
for row, usergroup in zip(rows, usergroups):
|
|
1352
|
+
usergroup["user_count"] = len(_usergroup_users(ctx, row))
|
|
1353
|
+
return _ok(usergroups=usergroups)
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
@route
|
|
1357
|
+
def usergroups_users_list(ctx, params):
|
|
1358
|
+
workspace = _workspace(ctx, params)
|
|
1359
|
+
row = _usergroup(ctx, workspace, params.get("usergroup"))
|
|
1360
|
+
users = _usergroup_users(ctx, row)
|
|
1361
|
+
if not _flag(params, "include_disabled"):
|
|
1362
|
+
users = [u for u in users if not (_user(ctx, workspace, u).get("deleted"))]
|
|
1363
|
+
return _ok(users=users)
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
def _usergroup_channels(ctx, workspace: str, usergroup: str, channels: list[str]) -> None:
|
|
1367
|
+
for link in _scoped(ctx, "slack_usergroup_channels", workspace, usergroup_id=usergroup, kind="default_public"):
|
|
1368
|
+
ctx.delete("slack_usergroup_channels", ctx.key_of("slack_usergroup_channels", link))
|
|
1369
|
+
for channel in channels:
|
|
1370
|
+
_channel(ctx, workspace, channel)
|
|
1371
|
+
ctx.insert(
|
|
1372
|
+
"slack_usergroup_channels",
|
|
1373
|
+
{"workspace_id": workspace, "usergroup_id": usergroup, "channel_id": channel, "kind": "default_public"},
|
|
1374
|
+
)
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
@route
|
|
1378
|
+
def usergroups_create(ctx, params):
|
|
1379
|
+
workspace = _workspace(ctx, params)
|
|
1380
|
+
_required(params, "name")
|
|
1381
|
+
name = str(params["name"])
|
|
1382
|
+
handle = str(params.get("handle") or "")
|
|
1383
|
+
for existing in _scoped(ctx, "slack_usergroups", workspace):
|
|
1384
|
+
if existing.get("name") == name:
|
|
1385
|
+
raise SlackError("name_already_exists")
|
|
1386
|
+
if handle and existing.get("handle") == handle:
|
|
1387
|
+
raise SlackError("handle_already_exists")
|
|
1388
|
+
channels = _list(params, "channels")
|
|
1389
|
+
now = _now_seconds(ctx)
|
|
1390
|
+
writer = _writer(ctx, workspace).get("user")
|
|
1391
|
+
row = {
|
|
1392
|
+
"workspace_id": workspace,
|
|
1393
|
+
"id": _slack_id("S"),
|
|
1394
|
+
"team_id": workspace,
|
|
1395
|
+
"is_usergroup": True,
|
|
1396
|
+
"is_subteam": True,
|
|
1397
|
+
"is_external": False,
|
|
1398
|
+
"name": name,
|
|
1399
|
+
"handle": handle,
|
|
1400
|
+
"description": str(params.get("description") or ""),
|
|
1401
|
+
"date_create": now,
|
|
1402
|
+
"date_update": now,
|
|
1403
|
+
"date_delete": 0,
|
|
1404
|
+
"auto_type": None,
|
|
1405
|
+
"auto_provision": False,
|
|
1406
|
+
"enterprise_subteam_id": "",
|
|
1407
|
+
"created_by": writer,
|
|
1408
|
+
"updated_by": writer,
|
|
1409
|
+
"deleted_by": None,
|
|
1410
|
+
"prefs": {"channels": channels, "groups": []},
|
|
1411
|
+
"user_count": 0,
|
|
1412
|
+
"channel_count": len(channels),
|
|
1413
|
+
"users_state": "present",
|
|
1414
|
+
}
|
|
1415
|
+
inserted = ctx.insert("slack_usergroups", row)
|
|
1416
|
+
_usergroup_channels(ctx, workspace, inserted["id"], channels)
|
|
1417
|
+
return _ok(usergroup=_render_usergroup(ctx, inserted, include_users=_flag(params, "include_count")))
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
@route
|
|
1421
|
+
def usergroups_update(ctx, params):
|
|
1422
|
+
workspace = _workspace(ctx, params)
|
|
1423
|
+
row = _usergroup(ctx, workspace, params.get("usergroup"))
|
|
1424
|
+
patch: dict[str, Any] = {"date_update": _now_seconds(ctx), "updated_by": _writer(ctx, workspace).get("user")}
|
|
1425
|
+
for field in ("name", "handle", "description"):
|
|
1426
|
+
if params.get(field) is not None:
|
|
1427
|
+
patch[field] = str(params[field])
|
|
1428
|
+
if params.get("channels") is not None:
|
|
1429
|
+
channels = _list(params, "channels")
|
|
1430
|
+
_usergroup_channels(ctx, workspace, row["id"], channels)
|
|
1431
|
+
patch["prefs"] = {**(row.get("prefs") or {}), "channels": channels}
|
|
1432
|
+
patch["channel_count"] = len(channels)
|
|
1433
|
+
updated = ctx.update("slack_usergroups", ctx.key_of("slack_usergroups", row), patch)
|
|
1434
|
+
return _ok(usergroup=_render_usergroup(ctx, updated, include_users=_flag(params, "include_count")))
|
|
1435
|
+
|
|
1436
|
+
|
|
1437
|
+
def _set_disabled(ctx, params, disabled: bool) -> dict:
|
|
1438
|
+
workspace = _workspace(ctx, params)
|
|
1439
|
+
row = _usergroup(ctx, workspace, params.get("usergroup"))
|
|
1440
|
+
if bool(row.get("date_delete")) == disabled:
|
|
1441
|
+
raise SlackError("already_disabled" if disabled else "already_enabled")
|
|
1442
|
+
writer = _writer(ctx, workspace).get("user")
|
|
1443
|
+
now = _now_seconds(ctx)
|
|
1444
|
+
patch = {"date_delete": now if disabled else 0, "deleted_by": writer if disabled else None, "date_update": now}
|
|
1445
|
+
updated = ctx.update("slack_usergroups", ctx.key_of("slack_usergroups", row), patch)
|
|
1446
|
+
return _ok(usergroup=_render_usergroup(ctx, updated, include_users=_flag(params, "include_count")))
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
@route
|
|
1450
|
+
def usergroups_disable(ctx, params):
|
|
1451
|
+
return _set_disabled(ctx, params, True)
|
|
1452
|
+
|
|
1453
|
+
|
|
1454
|
+
@route
|
|
1455
|
+
def usergroups_enable(ctx, params):
|
|
1456
|
+
return _set_disabled(ctx, params, False)
|
|
1457
|
+
|
|
1458
|
+
|
|
1459
|
+
@route
|
|
1460
|
+
def usergroups_users_update(ctx, params):
|
|
1461
|
+
workspace = _workspace(ctx, params)
|
|
1462
|
+
row = _usergroup(ctx, workspace, params.get("usergroup"))
|
|
1463
|
+
users = _list(params, "users")
|
|
1464
|
+
if not users:
|
|
1465
|
+
raise SlackError("invalid_arguments")
|
|
1466
|
+
for user in users:
|
|
1467
|
+
_user(ctx, workspace, user)
|
|
1468
|
+
for member in _scoped(ctx, "slack_usergroup_memberships", workspace, usergroup_id=row["id"]):
|
|
1469
|
+
ctx.delete("slack_usergroup_memberships", ctx.key_of("slack_usergroup_memberships", member))
|
|
1470
|
+
for user in dict.fromkeys(users):
|
|
1471
|
+
ctx.insert(
|
|
1472
|
+
"slack_usergroup_memberships", {"workspace_id": workspace, "usergroup_id": row["id"], "user_id": user}
|
|
1473
|
+
)
|
|
1474
|
+
patch = {
|
|
1475
|
+
"date_update": _now_seconds(ctx),
|
|
1476
|
+
"updated_by": _writer(ctx, workspace).get("user"),
|
|
1477
|
+
"user_count": len(set(users)),
|
|
1478
|
+
}
|
|
1479
|
+
updated = ctx.update("slack_usergroups", ctx.key_of("slack_usergroups", row), patch)
|
|
1480
|
+
return _ok(usergroup=_render_usergroup(ctx, updated, include_users=True))
|
|
1481
|
+
|
|
1482
|
+
|
|
1483
|
+
# ---------------------------------------------------------------- the token's holder: what a client page asks
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
@route
|
|
1487
|
+
def auth_test(ctx, params):
|
|
1488
|
+
"""Who the token is and where: its user (and bot, for a bot token) and workspace."""
|
|
1489
|
+
workspace = _workspace(ctx, params)
|
|
1490
|
+
identity = _writer(ctx, workspace)
|
|
1491
|
+
if not identity.get("user"):
|
|
1492
|
+
raise SlackError("not_authed")
|
|
1493
|
+
team = ctx.get("slack_workspaces", {"id": workspace}) or {}
|
|
1494
|
+
user = _user(ctx, workspace, identity["user"])
|
|
1495
|
+
domain = team.get("domain") or workspace.lower()
|
|
1496
|
+
answer = _ok(
|
|
1497
|
+
url=team.get("url") or f"https://{domain}.slack.com/",
|
|
1498
|
+
team=team.get("name"),
|
|
1499
|
+
user=user.get("name"),
|
|
1500
|
+
team_id=workspace,
|
|
1501
|
+
user_id=user["id"],
|
|
1502
|
+
is_enterprise_install=False,
|
|
1503
|
+
)
|
|
1504
|
+
if identity.get("bot_id"):
|
|
1505
|
+
answer["bot_id"] = identity["bot_id"]
|
|
1506
|
+
return answer
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
def _open_state(ctx, workspace: str, channel: str, user: str) -> None:
|
|
1510
|
+
key = {"workspace_id": workspace, "channel_id": channel, "user_id": user}
|
|
1511
|
+
if ctx.get("slack_conversation_states", key) is None:
|
|
1512
|
+
ctx.insert("slack_conversation_states", {**key, "is_member": True, "is_open": True})
|
|
1513
|
+
else:
|
|
1514
|
+
ctx.update("slack_conversation_states", key, {"is_open": True})
|
|
1515
|
+
|
|
1516
|
+
|
|
1517
|
+
@route
|
|
1518
|
+
def conversations_open(ctx, params):
|
|
1519
|
+
"""The direct message with ``users`` (an IM for one, a group DM for more, the
|
|
1520
|
+
self DM for none but the token's user), found when its member set already
|
|
1521
|
+
exists (``no_op``/``already_open``) and created otherwise; or an existing IM
|
|
1522
|
+
reopened by ``channel``."""
|
|
1523
|
+
workspace = _workspace(ctx, params)
|
|
1524
|
+
me = _writer_user(ctx, workspace)
|
|
1525
|
+
users = _list(params, "users")
|
|
1526
|
+
if params.get("channel") and not users:
|
|
1527
|
+
row = _channel(ctx, workspace, params["channel"])
|
|
1528
|
+
if not (row.get("is_im") or row.get("is_mpim")):
|
|
1529
|
+
raise SlackError("channel_not_found")
|
|
1530
|
+
_open_state(ctx, workspace, row["id"], me)
|
|
1531
|
+
return _ok(channel=_render_channel(ctx, row), no_op=True, already_open=True)
|
|
1532
|
+
if not users:
|
|
1533
|
+
raise SlackError("invalid_arguments")
|
|
1534
|
+
for user in users:
|
|
1535
|
+
_user(ctx, workspace, user)
|
|
1536
|
+
members = sorted({me, *users})
|
|
1537
|
+
im = len(members) <= 2
|
|
1538
|
+
for row in _scoped(ctx, "slack_channels", workspace):
|
|
1539
|
+
if not (row.get("is_im") or row.get("is_mpim")):
|
|
1540
|
+
continue
|
|
1541
|
+
have = sorted(m["user_id"] for m in _scoped(ctx, "slack_memberships", workspace, channel_id=row["id"]))
|
|
1542
|
+
if have == members:
|
|
1543
|
+
_open_state(ctx, workspace, row["id"], me)
|
|
1544
|
+
return _ok(channel=_render_channel(ctx, row), no_op=True, already_open=True)
|
|
1545
|
+
if _flag(params, "prevent_creation"):
|
|
1546
|
+
raise SlackError("channel_not_found")
|
|
1547
|
+
row = {
|
|
1548
|
+
"workspace_id": workspace,
|
|
1549
|
+
"id": _slack_id("D" if im else "G"),
|
|
1550
|
+
"created": _now_seconds(ctx),
|
|
1551
|
+
"is_channel": False,
|
|
1552
|
+
"is_group": not im,
|
|
1553
|
+
"is_im": im,
|
|
1554
|
+
"is_mpim": not im,
|
|
1555
|
+
"is_private": True,
|
|
1556
|
+
"is_archived": False,
|
|
1557
|
+
"is_general": False,
|
|
1558
|
+
"is_shared": False,
|
|
1559
|
+
"is_org_shared": False,
|
|
1560
|
+
"is_ext_shared": False,
|
|
1561
|
+
"is_pending_ext_shared": False,
|
|
1562
|
+
"context_team_id": workspace,
|
|
1563
|
+
}
|
|
1564
|
+
if not im:
|
|
1565
|
+
handles = "--".join(_user(ctx, workspace, user).get("name") or user for user in members)
|
|
1566
|
+
row.update({"name": f"mpdm-{handles}-1", "name_normalized": f"mpdm-{handles}-1", "creator": me})
|
|
1567
|
+
inserted = ctx.insert("slack_channels", row)
|
|
1568
|
+
for user in members:
|
|
1569
|
+
ctx.insert("slack_memberships", {"workspace_id": workspace, "channel_id": inserted["id"], "user_id": user})
|
|
1570
|
+
_open_state(ctx, workspace, inserted["id"], me)
|
|
1571
|
+
channel = _render_channel(ctx, inserted)
|
|
1572
|
+
_emit(ctx, "im_created" if im else "group_open", user=me, channel=channel)
|
|
1573
|
+
return _ok(channel=channel)
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
@route
|
|
1577
|
+
def conversations_typing(ctx, params):
|
|
1578
|
+
"""RTM's ``typing`` over HTTP, the way a client page sends it (the Web API has
|
|
1579
|
+
no such method): a ``user_typing`` event for the token's user."""
|
|
1580
|
+
workspace = _workspace(ctx, params)
|
|
1581
|
+
row = _channel(ctx, workspace, params.get("channel"))
|
|
1582
|
+
me = _writer_user(ctx, workspace)
|
|
1583
|
+
if ctx.get("slack_memberships", {"workspace_id": workspace, "channel_id": row["id"], "user_id": me}) is None:
|
|
1584
|
+
raise SlackError("not_in_channel")
|
|
1585
|
+
_emit(ctx, "user_typing", channel=row["id"], user=me)
|
|
1586
|
+
return _ok()
|
|
1587
|
+
|
|
1588
|
+
|
|
1589
|
+
# ---------------------------------------------------------------- emoji, search, stars, prefs
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
#: The standard emoji the shipped client renders, ``name -> glyph``. Slack's own
|
|
1593
|
+
#: emoji.list answers custom emoji only and leaves the standard set to the client's
|
|
1594
|
+
#: table; the twin client reads its table from here (``standard``, an extra key
|
|
1595
|
+
#: next to the vendor's), so the two agree on which names have a glyph.
|
|
1596
|
+
STANDARD_EMOJI = {
|
|
1597
|
+
"+1": "👍", "thumbsup": "👍", "-1": "👎", "white_check_mark": "✅", "eyes": "👀", "tada": "🎉",
|
|
1598
|
+
"rocket": "🚀", "heart": "❤️", "fire": "🔥", "raised_hands": "🙌", "pray": "🙏", "joy": "😂",
|
|
1599
|
+
"sweat_smile": "😅", "wave": "👋", "100": "💯", "thinking_face": "🤔", "clap": "👏", "muscle": "💪",
|
|
1600
|
+
"slightly_smiling_face": "🙂", "smile": "😄", "ship": "🚢", "chart_with_upwards_trend": "📈", "memo": "📝",
|
|
1601
|
+
"bug": "🐛", "ok_hand": "👌", "point_up": "☝️", "moon": "🌙", "taco": "🌮", "sushi": "🍣", "pizza": "🍕",
|
|
1602
|
+
"coffee": "☕", "books": "📚", "cat": "🐱", "musical_note": "🎵", "warning": "⚠️", "x": "❌",
|
|
1603
|
+
"question": "❓", "bulb": "💡", "calendar": "📅", "sparkles": "✨", "star": "⭐", "heavy_check_mark": "✔️",
|
|
1604
|
+
"hourglass": "⌛", "zap": "⚡", "gear": "⚙️", "lock": "🔒", "mag": "🔍", "bell": "🔔", "speech_balloon": "💬",
|
|
1605
|
+
"handshake": "🤝", "grin": "😁",
|
|
1606
|
+
} # fmt: skip
|
|
1607
|
+
|
|
1608
|
+
|
|
1609
|
+
@route
|
|
1610
|
+
def emoji_list(ctx, params):
|
|
1611
|
+
"""The workspace's custom emoji, ``name -> url`` (``alias:<name>`` for an alias),
|
|
1612
|
+
plus the standard table the shipped client renders from (``STANDARD_EMOJI``)."""
|
|
1613
|
+
workspace = _workspace(ctx, params)
|
|
1614
|
+
rows = sorted(_scoped(ctx, "slack_emojis", workspace), key=lambda r: r["name"])
|
|
1615
|
+
emoji = {r["name"]: f"alias:{r['alias_for']}" if r.get("alias_for") else r["url"] for r in rows}
|
|
1616
|
+
answer = _ok(emoji=emoji, cache_ts=f"{_now_seconds(ctx)}.000000", standard=dict(STANDARD_EMOJI))
|
|
1617
|
+
if _flag(params, "include_categories"):
|
|
1618
|
+
answer["categories_version"] = "1"
|
|
1619
|
+
answer["categories"] = []
|
|
1620
|
+
return answer
|
|
1621
|
+
|
|
1622
|
+
|
|
1623
|
+
SEARCH_TOKEN = re.compile(r'(\w+):("[^"]*"|\S+)|"([^"]*)"|(\S+)')
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
def _search_terms(query: str) -> tuple[dict[str, list[str]], list[str]]:
|
|
1627
|
+
"""Slack's search grammar: ``from:@ada in:#general "exact words" loose words``."""
|
|
1628
|
+
filters: dict[str, list[str]] = {}
|
|
1629
|
+
terms = []
|
|
1630
|
+
for key, value, quoted, word in SEARCH_TOKEN.findall(query):
|
|
1631
|
+
if key:
|
|
1632
|
+
filters.setdefault(key.lower(), []).append(value.strip('"'))
|
|
1633
|
+
else:
|
|
1634
|
+
terms.append((quoted or word).lower())
|
|
1635
|
+
return filters, terms
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
def _user_ref(ctx, workspace: str, ref: str) -> str | None:
|
|
1639
|
+
mention = re.fullmatch(r"<@(\w+)(?:\|[^>]*)?>", ref.strip())
|
|
1640
|
+
if mention:
|
|
1641
|
+
return mention.group(1)
|
|
1642
|
+
handle = ref.strip().lstrip("@").lower()
|
|
1643
|
+
if handle == "me":
|
|
1644
|
+
return _writer(ctx, workspace).get("user")
|
|
1645
|
+
for row in _scoped(ctx, "slack_users", workspace):
|
|
1646
|
+
if handle in (row["id"].lower(), (row.get("name") or "").lower(), (row.get("real_name") or "").lower()):
|
|
1647
|
+
return row["id"]
|
|
1648
|
+
return None
|
|
1649
|
+
|
|
1650
|
+
|
|
1651
|
+
def _channel_ref(ctx, workspace: str, ref: str) -> str | None:
|
|
1652
|
+
mention = re.fullmatch(r"<#(\w+)(?:\|[^>]*)?>", ref.strip())
|
|
1653
|
+
if mention:
|
|
1654
|
+
return mention.group(1)
|
|
1655
|
+
name = ref.strip().lstrip("#").lower()
|
|
1656
|
+
for row in _scoped(ctx, "slack_channels", workspace):
|
|
1657
|
+
if name in (row["id"].lower(), (row.get("name") or "").lower()):
|
|
1658
|
+
return row["id"]
|
|
1659
|
+
return None
|
|
1660
|
+
|
|
1661
|
+
|
|
1662
|
+
@route
|
|
1663
|
+
def search_messages(ctx, params):
|
|
1664
|
+
"""Messages the token's user can see that carry every term, ``from:`` and ``in:``
|
|
1665
|
+
honoured, newest first, in Slack's ``count``/``page`` envelope."""
|
|
1666
|
+
workspace = _workspace(ctx, params)
|
|
1667
|
+
_required(params, "query")
|
|
1668
|
+
query = str(params["query"])
|
|
1669
|
+
me = _writer_user(ctx, workspace)
|
|
1670
|
+
filters, terms = _search_terms(query)
|
|
1671
|
+
authors = {_user_ref(ctx, workspace, ref) for ref in filters.get("from", [])}
|
|
1672
|
+
places = {_channel_ref(ctx, workspace, ref) for ref in filters.get("in", [])}
|
|
1673
|
+
member_of = {m["channel_id"] for m in _scoped(ctx, "slack_memberships", workspace, user_id=me)}
|
|
1674
|
+
matches = []
|
|
1675
|
+
for channel in _scoped(ctx, "slack_channels", workspace):
|
|
1676
|
+
if channel["id"] not in member_of or (places and channel["id"] not in places):
|
|
1677
|
+
continue
|
|
1678
|
+
for message in _scoped(ctx, "slack_messages", workspace, channel_id=channel["id"]):
|
|
1679
|
+
if message.get("subtype") == "channel_join" or (authors and message.get("user") not in authors):
|
|
1680
|
+
continue
|
|
1681
|
+
text = (message.get("text") or "").lower()
|
|
1682
|
+
if all(term in text for term in terms):
|
|
1683
|
+
matches.append((channel, message))
|
|
1684
|
+
matches.sort(key=lambda pair: _ts_key(pair[1]), reverse=params.get("sort_dir", "desc") != "asc")
|
|
1685
|
+
count = min(max(1, _int(params, "count", 20)), 100)
|
|
1686
|
+
page = max(1, _int(params, "page", 1))
|
|
1687
|
+
total = len(matches)
|
|
1688
|
+
pages = max(1, -(-total // count))
|
|
1689
|
+
start = (page - 1) * count
|
|
1690
|
+
team = ctx.get("slack_workspaces", {"id": workspace}) or {}
|
|
1691
|
+
domain = team.get("domain") or workspace.lower()
|
|
1692
|
+
rendered = []
|
|
1693
|
+
for channel, message in matches[start : start + count]:
|
|
1694
|
+
author = ctx.get("slack_users", {"workspace_id": workspace, "id": message.get("user") or ""})
|
|
1695
|
+
rendered.append(
|
|
1696
|
+
{
|
|
1697
|
+
"iid": f"{channel['id']}-{message['ts']}",
|
|
1698
|
+
"team": workspace,
|
|
1699
|
+
"channel": {
|
|
1700
|
+
"id": channel["id"],
|
|
1701
|
+
"name": channel.get("name") or "",
|
|
1702
|
+
**{k: bool(channel.get(k)) for k in ("is_channel", "is_group", "is_im", "is_mpim", "is_private", "is_shared", "is_ext_shared")},
|
|
1703
|
+
},
|
|
1704
|
+
"type": "message",
|
|
1705
|
+
"user": message.get("user"),
|
|
1706
|
+
"username": (author or {}).get("name"),
|
|
1707
|
+
"ts": message["ts"],
|
|
1708
|
+
"text": message.get("text", ""),
|
|
1709
|
+
"permalink": f"https://{domain}.slack.com/archives/{channel['id']}/p{message['ts'].replace('.', '')}",
|
|
1710
|
+
}
|
|
1711
|
+
)
|
|
1712
|
+
return _ok(
|
|
1713
|
+
query=query,
|
|
1714
|
+
messages={
|
|
1715
|
+
"total": total,
|
|
1716
|
+
"pagination": {
|
|
1717
|
+
"total_count": total,
|
|
1718
|
+
"page": page,
|
|
1719
|
+
"per_page": count,
|
|
1720
|
+
"page_count": pages,
|
|
1721
|
+
"first": start + 1 if total else 0,
|
|
1722
|
+
"last": min(start + count, total),
|
|
1723
|
+
},
|
|
1724
|
+
"paging": {"count": count, "total": total, "page": page, "pages": pages},
|
|
1725
|
+
"matches": rendered,
|
|
1726
|
+
},
|
|
1727
|
+
)
|
|
1728
|
+
|
|
1729
|
+
|
|
1730
|
+
def _star(ctx, params, remove: bool) -> dict:
|
|
1731
|
+
"""A star on a channel (the viewer's state), a message or a file (the user's state on it)."""
|
|
1732
|
+
workspace = _workspace(ctx, params)
|
|
1733
|
+
me = _writer_user(ctx, workspace)
|
|
1734
|
+
if params.get("file"):
|
|
1735
|
+
file = _file(ctx, workspace, params["file"])
|
|
1736
|
+
entity, key = "slack_file_user_states", {"workspace_id": workspace, "file_id": file["id"], "user_id": me}
|
|
1737
|
+
item = {"type": "file", "file": file["id"]}
|
|
1738
|
+
elif params.get("timestamp"):
|
|
1739
|
+
channel = _channel(ctx, workspace, params.get("channel"))
|
|
1740
|
+
message = _message(ctx, workspace, channel["id"], params["timestamp"], "bad_timestamp")
|
|
1741
|
+
entity = "slack_message_user_states"
|
|
1742
|
+
key = {"workspace_id": workspace, "channel_id": channel["id"], "message_ts": message["ts"], "user_id": me}
|
|
1743
|
+
item = {"type": "message", "channel": channel["id"], "ts": message["ts"]}
|
|
1744
|
+
else:
|
|
1745
|
+
channel = _channel(ctx, workspace, params.get("channel"))
|
|
1746
|
+
entity, key = "slack_conversation_states", {"workspace_id": workspace, "channel_id": channel["id"], "user_id": me}
|
|
1747
|
+
item = {"type": "channel", "channel": channel["id"]}
|
|
1748
|
+
state = ctx.get(entity, key)
|
|
1749
|
+
starred = bool(state and state.get("is_starred"))
|
|
1750
|
+
if remove and not starred:
|
|
1751
|
+
raise SlackError("not_starred")
|
|
1752
|
+
if not remove and starred:
|
|
1753
|
+
raise SlackError("already_starred")
|
|
1754
|
+
if state is None:
|
|
1755
|
+
ctx.insert(entity, {**key, "is_starred": not remove})
|
|
1756
|
+
else:
|
|
1757
|
+
ctx.update(entity, key, {"is_starred": not remove})
|
|
1758
|
+
_emit(ctx, "star_removed" if remove else "star_added", user=me, item=item)
|
|
1759
|
+
return _ok()
|
|
1760
|
+
|
|
1761
|
+
|
|
1762
|
+
@route
|
|
1763
|
+
def stars_add(ctx, params):
|
|
1764
|
+
return _star(ctx, params, remove=False)
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
@route
|
|
1768
|
+
def stars_remove(ctx, params):
|
|
1769
|
+
return _star(ctx, params, remove=True)
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
def _muted(ctx, workspace: str, user: str) -> list[str]:
|
|
1773
|
+
states = _scoped(ctx, "slack_conversation_states", workspace, user_id=user)
|
|
1774
|
+
return sorted(s["channel_id"] for s in states if s.get("is_muted"))
|
|
1775
|
+
|
|
1776
|
+
|
|
1777
|
+
@route
|
|
1778
|
+
def users_prefs_get(ctx, params):
|
|
1779
|
+
"""The token's user's preferences. ``muted_channels`` is the one this world keeps,
|
|
1780
|
+
as the viewer's ``is_muted`` on each conversation."""
|
|
1781
|
+
workspace = _workspace(ctx, params)
|
|
1782
|
+
me = _writer_user(ctx, workspace)
|
|
1783
|
+
return _ok(prefs={"muted_channels": ",".join(_muted(ctx, workspace, me))})
|
|
1784
|
+
|
|
1785
|
+
|
|
1786
|
+
@route
|
|
1787
|
+
def users_prefs_set(ctx, params):
|
|
1788
|
+
workspace = _workspace(ctx, params)
|
|
1789
|
+
me = _writer_user(ctx, workspace)
|
|
1790
|
+
_required(params, "name")
|
|
1791
|
+
if params["name"] != "muted_channels":
|
|
1792
|
+
raise SlackError("invalid_arguments")
|
|
1793
|
+
wanted = _list(params, "value")
|
|
1794
|
+
for channel in wanted:
|
|
1795
|
+
_channel(ctx, workspace, channel)
|
|
1796
|
+
for channel in set(_muted(ctx, workspace, me)) | set(wanted):
|
|
1797
|
+
key = {"workspace_id": workspace, "channel_id": channel, "user_id": me}
|
|
1798
|
+
muted = channel in wanted
|
|
1799
|
+
if ctx.get("slack_conversation_states", key) is None:
|
|
1800
|
+
ctx.insert("slack_conversation_states", {**key, "is_muted": muted})
|
|
1801
|
+
else:
|
|
1802
|
+
ctx.update("slack_conversation_states", key, {"is_muted": muted})
|
|
1803
|
+
value = ",".join(wanted)
|
|
1804
|
+
_emit(ctx, "pref_change", name="muted_channels", value=value)
|
|
1805
|
+
return _ok(prefs={"muted_channels": value})
|
|
1806
|
+
|
|
1807
|
+
|
|
1808
|
+
# ---------------------------------------------------------------- events
|
|
1809
|
+
|
|
1810
|
+
|
|
1811
|
+
@route
|
|
1812
|
+
def events(ctx, params):
|
|
1813
|
+
"""What changed after ``since`` (or the ``Last-Event-ID`` a reconnecting
|
|
1814
|
+
EventSource sends), as a server-sent-event body that ends at once: the page
|
|
1815
|
+
reads the backlog, the connection closes, and the browser reconnects after
|
|
1816
|
+
``retry`` — a poll, so it relays through the World Host as any request does."""
|
|
1817
|
+
marker = ctx.headers.get("last-event-id") or params.get("since") or "0"
|
|
1818
|
+
try:
|
|
1819
|
+
since = int(marker)
|
|
1820
|
+
except ValueError:
|
|
1821
|
+
raise SlackError("invalid_arguments") from None
|
|
1822
|
+
body = ["retry: 2000\n\n"]
|
|
1823
|
+
for event in ctx.events_since(since):
|
|
1824
|
+
payload = {k: v for k, v in event.items() if k != "seq"}
|
|
1825
|
+
body.append(f"id: {event['seq']}\nevent: {payload['type']}\ndata: {json.dumps(payload, ensure_ascii=False)}\n\n")
|
|
1826
|
+
return 200, "".join(body).encode("utf-8"), {"Content-Type": "text/event-stream", "Cache-Control": "no-cache"}
|
|
1827
|
+
|
|
1828
|
+
|
|
1829
|
+
def _png(width: int, height: int, rgb: tuple[int, int, int]) -> bytes:
|
|
1830
|
+
row = b"\x00" + bytes(rgb) * width
|
|
1831
|
+
|
|
1832
|
+
def chunk(kind: bytes, data: bytes) -> bytes:
|
|
1833
|
+
body = kind + data
|
|
1834
|
+
return struct.pack(">I", len(data)) + body + struct.pack(">I", zlib.crc32(body) & 0xFFFFFFFF)
|
|
1835
|
+
|
|
1836
|
+
return (
|
|
1837
|
+
b"\x89PNG\r\n\x1a\n"
|
|
1838
|
+
+ chunk(b"IHDR", struct.pack(">IIBBBBB", width, height, 8, 2, 0, 0, 0))
|
|
1839
|
+
+ chunk(b"IDAT", zlib.compress(row * height, 9))
|
|
1840
|
+
+ chunk(b"IEND", b"")
|
|
1841
|
+
)
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
def _colour(key: str) -> tuple[int, int, int]:
|
|
1845
|
+
digest = hashlib.sha1(key.encode("utf-8")).digest()
|
|
1846
|
+
return digest[0] % 112 + 96, digest[1] % 112 + 96, digest[2] % 112 + 96
|
|
1847
|
+
|
|
1848
|
+
|
|
1849
|
+
_IMAGE_HEADERS = {"Content-Type": "image/png", "Cache-Control": "public, max-age=86400"}
|
|
1850
|
+
|
|
1851
|
+
|
|
1852
|
+
def avatars(ctx, args, query, body):
|
|
1853
|
+
"""``/avatars/<holder>_<size>.png``: a flat PNG in a colour derived from the
|
|
1854
|
+
holder's name, the same every time, so a page renders profile images without
|
|
1855
|
+
an asset pipeline. The initials over the image come from the client."""
|
|
1856
|
+
match = re.fullmatch(r"([A-Za-z0-9-]+)_(\d{2,3})\.png", str(args.get("name", "")))
|
|
1857
|
+
if not match:
|
|
1858
|
+
return 404, {"ok": False, "error": "file_not_found"}
|
|
1859
|
+
size = int(match.group(2))
|
|
1860
|
+
return 200, _png(size, size, _colour(match.group(1))), _IMAGE_HEADERS
|
|
1861
|
+
|
|
1862
|
+
|
|
1863
|
+
def files(ctx, args, query, body):
|
|
1864
|
+
"""``/files/<id>/<name>``: the bytes behind a seeded file's ``url_private`` and
|
|
1865
|
+
``thumb_*`` urls — a flat PNG at the thumbnail's recorded size (``thumb_360``
|
|
1866
|
+
is ``thumb_360_w`` by ``thumb_360_h``), the file's own size for the original,
|
|
1867
|
+
in a colour derived from the file id. A non-image file answers its bytes as
|
|
1868
|
+
a PNG too: the page only ever renders it as a thumbnail."""
|
|
1869
|
+
file_id, name = str(args.get("id", "")), str(args.get("name", ""))
|
|
1870
|
+
row = next((f for f in ctx.rows("slack_files") if f["id"] == file_id), None)
|
|
1871
|
+
if row is None or not name:
|
|
1872
|
+
return 404, {"ok": False, "error": "file_not_found"}
|
|
1873
|
+
thumb = re.fullmatch(r"thumb_(\d+)\.png", name)
|
|
1874
|
+
if thumb:
|
|
1875
|
+
edge = int(thumb.group(1))
|
|
1876
|
+
width = int(row.get(f"thumb_{edge}_w") or edge)
|
|
1877
|
+
height = int(row.get(f"thumb_{edge}_h") or edge)
|
|
1878
|
+
else:
|
|
1879
|
+
width, height = int(row.get("original_w") or 640), int(row.get("original_h") or 360)
|
|
1880
|
+
return 200, _png(min(width, 1600), min(height, 1600), _colour(file_id)), _IMAGE_HEADERS
|